/* KRDS(대한민국 정부 디자인 시스템) 표준형 — 기존 스타일(style·config·home.css) 위에 덮어씀 (index.html 맨 마지막)
   근거: KRDS 공식 npm krds-uiux 1.1.0 (krds_tokens.css · component.css = 피그마 v1.0 라이브러리 값),
        krds.go.kr 스타일 가이드, 「디지털 정부서비스 UI/UX 가이드라인(2025.08)」
   · 서체 Pretendard GOV, 본문 17px·줄 간격 150%, 굵기는 보통(400)·굵게(700) 두 가지만
   · 간격 8px 단위 (8·16·24·32·40·64) — 카드 안 32(폰 24), 카드 사이 24, 본문↔푸터 64
   · 색: 주 색 primary-50 #256ef4(중요 버튼·링크, 화면당 주 버튼 1개), 보조 secondary(남색), 회색 단계, 상태색
   · 모서리: 배지·체크 4 · 버튼·입력칸 6 · 카드 10 · 창 12
   · 표면: 회색 바탕(gray5) 위 흰 카드 + 얇은 테두리(gray20) + 그림자 1단계 — 볼록·오목 그림자 없음
   · 다크 = 선명한 화면 모드 (검은 바탕, 층이 올라갈수록 밝게, 글자 대비 15:1) */

/* ── 굵기 두 가지로: 500→보통, 600·800·900→굵게 (같은 이름·굵기 선언은 나중 것이 이김) ── */
@font-face { font-family: "Pretendard GOV"; font-weight: 500; font-display: swap; src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard-gov/dist/web/static/woff2/PretendardGOV-Regular.woff2) format("woff2"); }
@font-face { font-family: "Pretendard GOV"; font-weight: 600; font-display: swap; src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard-gov/dist/web/static/woff2/PretendardGOV-Bold.woff2) format("woff2"); }
@font-face { font-family: "Pretendard GOV"; font-weight: 800; font-display: swap; src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard-gov/dist/web/static/woff2/PretendardGOV-Bold.woff2) format("woff2"); }
@font-face { font-family: "Pretendard GOV"; font-weight: 900; font-display: swap; src: url(https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard-gov/dist/web/static/woff2/PretendardGOV-Bold.woff2) format("woff2"); }

/* ── 색·모양 토큰 (기존 이름에 KRDS 값을 넣어 옛 규칙도 같이 바뀜) ── */
:root {
  --page: #ffffff;          /* 페이지 바탕 흰색 (정부 누리집 목록 화면처럼, 카드는 테두리로 구분) */
  --bg: #ffffff;            /* gray0 — 카드·헤더·입력칸 */
  --text: #1e2124;          /* gray90 */
  --muted: #464c53;         /* gray70 — 보조 글자 */
  --faint: #6d7882;         /* gray50 — 흐린 글자 (4.5:1) */
  --line: #e6e8ea;          /* gray10 */
  --border: #cdd1d5;        /* gray20 — 카드·구분선 */
  --border-strong: #b1b8be; /* gray30 — 탭 테두리 */
  --border-input: #58616a;  /* gray60 — 입력칸·3차 버튼 */
  --hover: #f4f5f6;
  --ok: #228738;            /* success-50 */
  --on: #256ef4;            /* primary-50 */
  --on-hover: #0b50d0;      /* primary-60 */
  --on-press: #083891;      /* primary-70 */
  --on-soft: #ecf2fe;       /* primary-5 */
  --bad: #de3412;           /* danger-50 */
  --bad-fill: #de3412;      /* 에러 배지 바탕 — 다크 모드에서도 같은 빨강 (--bad 는 다크에서 글자용으로 밝아짐) */
  --warn-fill: #ea580c;     /* 주의 배지 바탕 (주황) — 라이트 · 다크 같은 색 */
  --sub-soft: #eef2f7;      /* secondary-5 — 표 머리글·고른 메뉴 바탕 */
  --sub-line: #d6e0eb;      /* secondary-10 */
  --sub-mid: #1c589c;       /* secondary-60 — 배지(주 색 대신) */
  --sub-strong: #063a74;    /* secondary-70 — 고른 탭 */
  --sub-text: #052b57;      /* secondary-80 — 고른 메뉴 글자 */
  --track-off: #6d7882;     /* 스위치 꺼짐 */
  --light: transparent;
  --dark: rgba(0, 0, 0, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05);   /* 그림자 1단계: 카드·기본 버튼 */
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.08);  /* 2단계: 드롭다운·열린 메뉴 */
  --shadow-4: 0 16px 24px rgba(0, 0, 0, 0.12); /* 4단계: 창 */
  --raised: 0 0 0 1px var(--border), var(--shadow-1);
  --raised-sm: 0 0 0 1px var(--border-input);
  --inset: inset 0 0 0 1px var(--border);
  --elev-pop: 0 0 0 1px var(--border), var(--shadow-2);
  --elev-modal: 0 0 0 1px var(--border), var(--shadow-4);
  --radius: 10px;
  --brand-blue: #1d5bb0;    /* 가람환경기술 로고 글자 파랑 */
  /* 간격 8px 단위 */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s8: 64px;
  --card-pad: 32px;          /* 카드·창 안쪽 (PC medium) */
}

/* 선명한 화면 모드 — 바탕 gray100, 카드 gray95, 창 gray90, 글자 gray5, 테두리 굵고 밝게 */
:root[data-theme="dark"] {
  --page: #000000;
  --bg: #131416;
  --text: #f4f5f6;
  --muted: #cdd1d5;
  --faint: #8a949e;
  --line: #33363d;
  --border: #33363d;
  --border-strong: #58616a;
  --border-input: #8a949e;
  --hover: #1e2124;
  --ok: #2b9a43;
  --on: #4c87f6;
  --on-hover: #6c9df8;
  --on-press: #256ef4;
  --on-soft: #0d2a5e;
  --bad: #f05a3c;
  --sub-soft: #1e2124;
  --sub-line: #33363d;
  --sub-mid: #346fb2;
  --sub-strong: #86aff9;
  --sub-text: #b1cefb;
  --track-off: #58616a;
  --brand-blue: #7fb0ff;
  --dark: rgba(0, 0, 0, 0.4);
  --raised: 0 0 0 1px var(--border);
  --elev-pop: 0 0 0 1px var(--border-strong), 0 4px 12px rgba(0, 0, 0, 0.6);
  --elev-modal: 0 0 0 1px var(--border-strong), 0 16px 24px rgba(0, 0, 0, 0.7);
}

body { background: var(--page); font: 17px/1.5 "Pretendard GOV", "Pretendard", system-ui, -apple-system, "Malgun Gothic", sans-serif; }
main { padding: var(--s3) var(--s5) var(--s8); }
h1, h2, h3 { letter-spacing: -0.01em; }

/* ════════ 헤더 — 로고 왼쪽, 제목 가운데, 유틸리티(공지사항·화면 모드·알림 | 이름 | 로그아웃) 오른쪽 ════════ */
.top { padding: var(--s2) var(--s5); background: var(--bg); border-bottom: 1px solid var(--border); }
/* 시스템 이름: 32px 굵게, "하수악취"는 로고 파랑 · 아래 작은 영문 이름 (폰은 한 줄 17px, 영문 없음) */
.brand h1 { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.brand-key { color: var(--brand-blue); }
.brand-en { display: block; margin-top: 4px; color: var(--faint); font-size: 13px; line-height: 1.2; letter-spacing: 0.16em; text-align: center; }
.top-actions, .who { gap: var(--s2); }
.top-link { padding: 0; border-radius: 0; color: var(--text); font-size: 15px; font-weight: 400; }
.top-link:hover, .top-link.active { background: none; box-shadow: none; color: var(--on); text-decoration: underline; text-underline-offset: 4px; }
/* 화면 모드 스위치 · 알림 종은 예전 모양(오목한 홈 + 볼록한 손잡이, 둥근 종 + 빨간 숫자) 그대로 — 사용자 선호 (2026-11-05)
   바탕은 헤더와 같은 색, 그림자 색만 이 둘에 따로 (KRDS 토큰의 --raised 는 테두리 줄이라) */
.theme-toggle, .alert-btn { --nm-light: #ffffff; --nm-dark: #cfd6df; }
:root[data-theme="dark"] .theme-toggle, :root[data-theme="dark"] .alert-btn { --nm-light: #26292e; --nm-dark: #000000; }
.theme-toggle { background: var(--bg); box-shadow: inset 3px 3px 7px var(--nm-dark), inset -3px -3px 7px var(--nm-light); }
.theme-toggle::before { background: var(--bg); box-shadow: 2px 2px 6px var(--nm-dark), -2px -2px 6px var(--nm-light); }
.alert-btn { background: var(--bg); box-shadow: 3px 3px 8px var(--nm-dark), -3px -3px 8px var(--nm-light); }
.alert-btn .alert-text { display: none; } /* 글자 대신 aria-label ("알림 — 안 읽은 알림 N건") */
.alert-btn[aria-expanded="true"] { box-shadow: inset 3px 3px 7px var(--nm-dark), inset -3px -3px 7px var(--nm-light); }
.alerts { padding: var(--s1); border-radius: var(--radius); box-shadow: var(--elev-pop); }
.alerts-head { margin: var(--s1) var(--s2); font-size: 15px; }
.alerts-list a { gap: 4px; padding: 12px var(--s2); border-radius: 6px; }
.alerts-empty { padding: var(--s2); font-size: 15px; }
/* 이름·로그아웃은 글자 링크 + 앞에 구분선 (KRDS 유틸리티 링크) */
#who.chip, #logout { position: relative; min-height: auto; padding: 0 0 0 var(--s2); border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font-size: 15px; font-weight: 400; }
#who.chip::before, #logout::before { content: ''; position: absolute; top: 50%; left: 0; width: 1px; height: 14px; background: var(--border-strong); transform: translateY(-50%); }
#who.chip::after { content: ' 님'; color: var(--muted); }
#logout { cursor: pointer; }
#logout:hover { background: none; color: var(--on); text-decoration: underline; text-underline-offset: 4px; }

/* ════════ 왼쪽 메뉴 — 흰 판, 고른 메뉴는 남색 글씨·굵게·왼쪽 막대 ════════ */
.nav { top: calc(var(--top-h, 70px) + var(--s3)); bottom: var(--s3); left: var(--s2); gap: 4px; padding: var(--s1); border-radius: var(--radius); background: var(--bg); box-shadow: var(--raised); }
.nav-item { gap: 4px; padding: 12px 4px; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 400; }
.nav-item:hover { background: var(--sub-soft); color: var(--text); }
.nav-item.active { background: var(--sub-soft); color: var(--sub-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--sub-strong); }

/* ════════ 공통 부품 ════════ */
.panel { background: var(--bg); border-radius: var(--radius); box-shadow: var(--raised); }
.chip { padding: 4px var(--s1); border-radius: 4px; box-shadow: none; background: var(--sub-soft); color: var(--muted); font-size: 15px; }
.msg { font-weight: 400; }

/* 버튼 (KRDS: 기본은 3차 버튼 — 흰 바탕·회색 테두리, 핵심 동작만 주 버튼) 높이 32/40/48 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-input); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 15px; font-weight: 400; line-height: 1.2; box-shadow: none; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
a.btn { display: inline-flex; }
.btn:hover { background: var(--hover); color: var(--text); }
.btn:active { background: var(--line); box-shadow: none; }
.btn:disabled, .btn:disabled:hover { border-color: var(--border-strong); background: var(--border); color: var(--faint); box-shadow: none; }
:root[data-theme="dark"] .btn:disabled { background: var(--hover); }
.btn.primary { padding: 0 var(--s3); border-color: var(--on); background: var(--on); color: #fff; font-weight: 700; }
.btn.primary:hover { border-color: var(--on-hover); background: var(--on-hover); color: #fff; }
.btn.primary:active { border-color: var(--on-press); background: var(--on-press); }
:root[data-theme="dark"] .btn.primary { border-color: #256ef4; background: #256ef4; }
/* 2차 버튼 (KRDS secondary) — 연한 파랑 바탕·파랑 테두리·글씨: 로그 다운로드·기간별 보고서 */
.btn.secondary { border-color: var(--on); background: var(--on-soft); color: var(--on-hover); font-weight: 700; }
.btn.secondary:hover { background: color-mix(in srgb, var(--on) 16%, var(--bg)); color: var(--on-hover); }
.btn.secondary:active { background: color-mix(in srgb, var(--on) 24%, var(--bg)); }
.btn.secondary:disabled, .btn.secondary:disabled:hover { border-color: var(--border-strong); background: var(--border); color: var(--faint); }
.btn.mini { min-height: 32px; padding: 0 10px; border-radius: 4px; font-size: 15px; }
.btn.danger { color: var(--bad); }
/* 카카오톡 전송 — 카카오 노랑 바탕 · 말풍선 (카카오 안내 색: 바탕 #FEE500, 글자·말풍선 검정 85%). 어두운 화면에서도 같은 색 */
.btn.kakao { --kakao: #fee500; font-weight: 700; }
.btn.kakao:hover { --kakao: #f2da00; }
.btn.kakao:active { --kakao: #e6cf00; }
.btn.kakao, .btn.kakao:hover, .btn.kakao:active { border-color: var(--kakao); background: var(--kakao); color: rgba(0, 0, 0, 0.85); }
.btn.kakao svg { flex: none; width: 18px; height: 18px; fill: currentColor; }
/* 지도 "지역"·"목록" 버튼은 폰에서만 (위 .btn 의 inline-flex 가 원래 숨김을 덮지 않게) */
.btn.map-filter-toggle, .btn.map-list-toggle { display: none; }
.dialog .btn, .login .btn.primary, .cfg-bar .btn { min-height: 48px; padding: 0 var(--s3); font-size: 17px; }

/* 입력칸·선택칸 (KRDS small: 높이 40, 안쪽 16, 테두리 gray60, 모서리 6, 글자 15) */
input, select, textarea { border: 1px solid var(--border-input); border-radius: 6px; background-color: var(--bg); box-shadow: none; color: var(--text); font-size: 15px; font-weight: 400; } /* 굵은 레이블 안에 있어도 입력 글자는 보통 */
input, select { min-height: 40px; }
input { padding: 0 var(--s2); }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
select { padding: 0 40px 0 var(--s2); background-position: right 14px center; }
textarea { padding: 12px var(--s2); }
input:focus, select:focus, textarea:focus { border-color: var(--on); outline: 0; box-shadow: 0 0 0 1px var(--on); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--on); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.notice-dialog textarea { border: 1px solid var(--border-input); border-radius: 6px; box-shadow: none; font-weight: 400; }
.notice-dialog textarea:focus-visible { outline: 2px solid var(--on); outline-offset: 2px; }
select:disabled, input:disabled { border-color: var(--border-strong); background-color: var(--border); color: var(--faint); }
:root[data-theme="dark"] select:disabled, :root[data-theme="dark"] input:disabled { background-color: var(--hover); }
/* 조건을 고른 검색 칸('전체'가 아닌 값) · 글자를 쳐 둔 검색어 칸은 파란 굵은 테두리 — 어느 칸에 조건이 걸렸는지 한눈에 (2026-11-26 사용자 요청, 검색 묶음이 있는 모든 화면. 처음엔 남색이었다가 더 잘 보이게 파랑으로).
   '전체' 선택지(값 '' · 'all')가 있는 칸만: 기간 · 검색 대상처럼 늘 값이 있는 칸은 안 칠함. 고정된 지역 칸(게스트, disabled)도 안 칠함.
   g-soms 배치(.gs-search-area)는 그 화면 모양 그대로. 누르고 있는 동안은 초점 테두리가 먼저 */
form[role="search"]:not(.gs-search-area) input[type="search"][placeholder]:not(:placeholder-shown, :focus), /* 검색어를 쳐 둔 칸도 (자리표시 글이 안 보임 = 글자가 있음) */
form[role="search"]:not(.gs-search-area) select:not(:disabled, :focus):has(> option:is([value=""], [value="all"])):has(> option:checked:not([value=""], [value="all"])) {
  border-color: var(--on); box-shadow: inset 0 0 0 1px var(--on);
}
:root[data-theme="dark"] input, :root[data-theme="dark"] select { border-width: 2px; } /* 선명한 화면: 테두리 굵게 */
/* 레이블 위·입력칸 아래, 사이 8 */
.search label, .dialog label, .login label, .issue-form label, .np-search label { gap: var(--s1); color: var(--text); font-size: 15px; font-weight: 700; }

/* 체크박스·라디오 (모서리 4, 테두리 gray60) */
.check .box, .page-size .check .box { border-radius: 4px; box-shadow: inset 0 0 0 1px var(--border-input); }

/* 탭 (KRDS 채운 탭: 높이 40, 테두리 gray30, 고른 탭은 남색 바탕 흰 글씨) */
.tabs, .days { gap: var(--s1); padding: 0; border-radius: 0; box-shadow: none; }
.tab { min-height: 40px; padding: 0 var(--s2); border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 15px; font-weight: 700; box-shadow: none; }
.tab:hover { background: var(--sub-soft); color: var(--text); }
.tab.active, .tab.day.active { border-color: var(--sub-strong); background: var(--sub-strong); color: #fff; box-shadow: none; }
:root[data-theme="dark"] .tab.active, :root[data-theme="dark"] .tab.day.active { color: #000; }
.tab.day { padding: 0 12px; }

/* 스위치 (KRDS large: 40×24, 꺼짐 회색·켜짐 주 색) */
.switch .track { width: 40px; height: 24px; }
.switch .track::after { top: 3px; left: 3px; width: 18px; height: 18px; box-shadow: none; }
/* 현장 설정 창 좌표 칸: 현장명으로 자동으로 찾은 좌표는 남색 글자 + 아래 안내 (settings.js markAutoCoords) */
.dialog #s-coords.auto, .dialog .coords-auto { color: var(--sub-mid); }
:root[data-theme="dark"] .dialog #s-coords.auto, :root[data-theme="dark"] .dialog .coords-auto { color: var(--sub-strong); }
/* 현장 설정 창 토글 묶음 — 두 칸씩 (수위계 · LED / 인터넷 없는 현장) */
.switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s3); }
.switch-grid .switch { word-break: keep-all; }
.switch-grid .switch:last-child:nth-child(odd) { grid-column: 1 / -1; } /* 혼자 남은 줄은 한 줄 다 (폰에서 "인터넷 없는 현장"이 안 접히게) */
.switch input:checked + .track { background: var(--on); }
.switch input:checked + .track::after { transform: translateX(16px); }
.dialog label.switch, .notice-dialog label.switch { gap: 12px; font-size: 15px; font-weight: 400; }

/* 배지 (KRDS: 높이 24, 안쪽 8, 모서리 4, 줄바꿈 없음 — 바탕에 주 색 안 씀) · 태그 */
.badge { padding: 0 var(--s1); border-radius: 4px; font-size: 15px; font-weight: 700; line-height: 24px; white-space: nowrap; }
.sites .badge { padding: 0 var(--s1); font-size: 15px; }
.badge.on { background: var(--sub-mid); }
.badge.bad, .sites td.name .tag.dev.bad { background: var(--bad-fill); } /* 에러 배지 (목록 현장명 아래 · 지도 · 알람 이력) — 라이트 · 다크 같은 색 */
/* 주의 배지 (주황) — 에어펌프·팬 점검필요 (format.js cautionBadges): 목록 현장명 아래 · 지도 팝업은 배지, 상세 기기상태 칸은 주황 글자 */
.badge.warn, .sites td.name .tag.dev.warn { background: var(--warn-fill); color: #fff; }
.tile .state.warn { color: var(--c-h2s); }
.tag { padding: 0 6px; border-radius: 4px; box-shadow: none; background: var(--sub-soft); color: var(--muted); font-size: 13px; line-height: 22px; }
:root[data-theme="dark"] .tag { background: var(--hover); color: var(--muted); }
/* LED 배지 — 눈에 띄게 남색(secondary-60, 배지용) 바탕 흰 글씨 (상태 색 초록·빨강과 안 섞임) */
.tag.led, :root[data-theme="dark"] .tag.led { background: var(--sub-mid); color: #fff; font-weight: 700; }
/* PCB 배지 — 초록(success) 바탕 흰 글씨 (현장 설정 "PCB 타입") */
.tag.pcb, :root[data-theme="dark"] .tag.pcb { background: var(--ok); color: #fff; font-weight: 700; }
/* 수위계 배지 — 같은 남색 계열 테두리 (LED 꽉 찬 남색과 나란히 있어도 구분, 화면 색 가짓수는 그대로) */
.tag.water { background: var(--bg); color: var(--sub-mid); font-weight: 700; box-shadow: inset 0 0 0 1px var(--sub-mid); }
:root[data-theme="dark"] .tag.water { background: transparent; color: var(--sub-strong); box-shadow: inset 0 0 0 1px var(--sub-strong); }
.tag-pin, .np-title .tag-new, .notice-row .tag-new { border-radius: 4px; }

/* 페이지 번호 (가운데 아래): 번호는 글자만(마우스 올리면 옅은 회색 칸), 지금 쪽은 남색 칸,
   화살표는 테두리 칸 + 꺾은 선(« ‹ 글자는 굵기·크기가 제각각이라), 갈 데 없는 화살표는 흐리게만 (회색 칠 없음) */
.pager { align-items: center; gap: 4px; margin-top: var(--s3); }
.btn.page { min-width: 40px; height: 40px; padding: 0 var(--s1); border-color: transparent; border-radius: 8px; background: transparent; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn.page:hover:not(:disabled) { border-color: transparent; background: var(--hover); color: var(--text); }
.btn.page.current, .btn.page.current:hover:not(:disabled) { border-color: var(--sub-strong); background: var(--sub-strong); color: #fff; font-weight: 700; box-shadow: none; }
:root[data-theme="dark"] .btn.page.current { color: #000; }
.btn.page.arrow { position: relative; gap: 0; width: 40px; padding: 0; border-color: var(--border); color: var(--text); font-size: 0; }
.btn.page.arrow:hover:not(:disabled) { border-color: var(--border-strong); }
.btn.page.arrow:disabled, .btn.page.arrow:disabled:hover { border-color: var(--line, var(--border)); background: transparent; color: var(--border-strong); }
.btn.page.arrow::before, .btn.page.arrow::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.btn.page.first::before, .btn.page.first::after, .btn.page.prev::before { margin-left: 3px; transform: rotate(135deg); }
.btn.page.last::before, .btn.page.last::after, .btn.page.next::before { margin-right: 3px; transform: rotate(-45deg); }
.btn.page.prev::after, .btn.page.next::after { display: none; }
.btn.page.first::after { margin-left: -1px; }
.btn.page.last::before { margin-right: -1px; }
.btn.page.prev { margin-right: var(--s1); } /* 화살표와 번호 사이는 조금 더 띄움 */
.btn.page.next { margin-left: var(--s1); }
/* 현장 지도 왼쪽 목록 판 안: 한 단계 작게 */
.map-list-pager .btn.page { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px; font-size: 14px; }
.map-list-pager .btn.page.arrow { width: 34px; padding: 0; font-size: 0; }
.map-list-pager .btn.page.prev { margin-right: 4px; }
.map-list-pager .btn.page.next { margin-left: 4px; }
/* 폰: « ‹ 번호 5개 › » 9개가 한 줄에 (dom.js PHONE_PAGE_BLOCK) */
@media screen and (max-width: 860px) {
  .pager { gap: 2px; }
  .btn.page { min-width: 34px; height: 36px; padding: 0 4px; }
  .btn.page.arrow { width: 34px; padding: 0; }
  .btn.page.prev { margin-right: 4px; }
  .btn.page.next { margin-left: 4px; }
}

/* ════════ 표 (KRDS 데이터 표: 머리글 secondary-5 바탕·굵은 15px·위아래 8, 칸 위아래 12·양옆 16, 줄은 gray20, 세로줄 없음) ════════ */
.sites th, .np-table thead th, .issues th, .ops-table thead th, .stats-table thead th, .info-table th {
  padding: var(--s1) var(--s2);
  background: var(--sub-soft);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  border-bottom: 1px solid var(--sub-line);
}
.sites td, .np-table td, .issues td, .ops-table td, .stats-table td, .info-table td { padding: 12px var(--s2); border-bottom: 1px solid var(--border); }
/* 모니터링 표는 칸이 13개라 KRDS 기본(양옆 16·글자 17)이면 화면을 넘침 → 한 단계 작은 토큰(양옆 12 = padding-5, 글자 15 = label-small) */
.sites th { padding: var(--s1) 12px; }
.sites td { padding: 12px; font-size: 15px; }
.sites td .sub, .sites td.name .addr, .ops-table td.name .addr { font-size: 15px; }
body.view-list .sites thead th, body.view-ops .ops-table thead th { background: var(--sub-soft); }
.table-panel { padding: 0; overflow-x: auto; }
.sites tbody tr:hover td, .st-list tbody tr:hover td, .ops-table tbody tr:hover td { background: var(--hover); }
.sites th .sort, .ops-table th .sort { text-align: inherit; }
.ops-table th .sort .th-line { display: block; } /* 두 줄 머리글은 버튼 안에서도 두 줄 */

/* ════════ 데이터 표 (모니터링·운영 통계·고장 통계 · 공지사항·알람 이력·계정 관리) — 칸마다 세로줄, 값은 가운데, 현장명·구분·제목만 왼쪽 ════════
   한눈에 칸이 구분되게 · 폰은 카드라 해당 없음 */
@media (min-width: 861px) {
  :is(#np-list, #alarms-view, #users-view) .np-table th, :is(#np-list, #alarms-view, #users-view) .np-table td { text-align: center; }
  :is(#np-list, #alarms-view, #users-view) .np-table :is(th, td):is(.title, .site) { text-align: left; }
  :is(#np-list, #alarms-view, #users-view) .np-table th + th, :is(#np-list, #alarms-view, #users-view) .np-table td + td { border-left: 1px solid var(--border); }
}
@media print, (min-width: 861px) {
  .sites th, .sites td, .ops-table th, .ops-table td, .stats-table th, .stats-table td { text-align: center; }
  .sites th.name, .sites td.name, .ops-table th.name, .ops-table td.name,
  .st-list th.name, .st-list td.name, .stats-table th.kind { padding-left: var(--s2); text-align: left; }
  .sites th + th, .sites td + td, .ops-table th + th, .ops-table td + td,
  .stats-table th + th, .stats-table th + td, .stats-table td + td { border-left: 1px solid var(--border); }
  .stats-table tbody tr:last-child th, .stats-table tbody tr:last-child td { border-bottom: 1px solid var(--border); }
  .stats-table { border: 1px solid var(--border); } /* 운영·고장 통계 표는 판 안쪽에 있어 바깥 테두리까지 (모니터링 표는 판 테두리가 대신) */
}
/* 상세 아래 표 (이슈 히스토리 · 흡착분해제 교체 기록 · 제품 정보) — 운영 통계 표처럼 바깥·칸 사이 모두 줄, 값은 가운데 (내용·메모만 왼쪽) */
.issues { margin-top: var(--s2); border: 1px solid var(--border); font-size: 15px; }
/* 줄은 다 그려 두고 다른 쪽 줄은 숨김(.off, issues.js) — 기간별 보고서(인쇄)는 쪽 나눔 없이 전부 (아래 @media print) */
.issue-panel .issues tbody tr.off { display: none; }
/* 제목 옆 조회기간 — 운영 통계 상세에서만 (그 기간의 기록만 보여 줌) */
.issue-range { margin-left: var(--s1); color: var(--muted); font-size: 15px; font-weight: 400; white-space: nowrap; } /* 폰에서 날짜 중간이 안 잘리게 — 자리가 없으면 통째로 다음 줄 */
.issues th, .issues td { border: 1px solid var(--border); text-align: center; }
.issues .content { text-align: left; }
.issues tbody tr:last-child td { border-bottom: 1px solid var(--border); }
.issues th.act, .issues td.act { padding-right: var(--s1); padding-left: var(--s1); }
.info-table { border: 1px solid var(--border); }
.info-table th, .info-table td { border: 1px solid var(--border); vertical-align: middle; }
.info-table th { color: var(--text); font-size: 15px; font-weight: 700; }
.info-table td { font-size: 15px; font-weight: 400; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 1px solid var(--border); }
/* 공지사항·알람 이력: 머리글·칸 글자 크기 한 가지(15), 번호·조회수·지속 시간은 오른쪽 */
.np-panel .np-table thead th { color: var(--text); font-size: 15px; font-weight: 700; }
.np-panel .np-table td { font-size: 15px; }
.np-table th, .np-table td { text-align: left; }
.np-table th.no, .np-table td.no, .np-table th.views, .np-table td.views, .al-table th.dur, .al-table td.dur { text-align: right; }
.np-table th.no, .np-table td.no { width: 96px; }
.tag-pin { white-space: nowrap; }
.np-table th.date, .np-table td.date { width: 176px; white-space: nowrap; }
.np-table th.author, .np-table td.author { width: 150px; }
/* 통계 표 머리글·합계 */
.stats-table thead th { color: var(--text); font-size: 15px; font-weight: 700; border-bottom-width: 1px; }
.stats-table tr.total th, .stats-table tr.total td, .stats-table .sum { font-weight: 700; }
.stats-table tbody th { padding: 12px var(--s2); font-weight: 700; }
/* 검색칸 아래 빈 안내 줄이 여백을 두 배로 만들지 않게 (안내가 뜰 때만 자리 차지) */
#stats-msg:empty, #ops-msg:empty { min-height: 0; }

/* ════════ 목록 위: 검색 묶음 · 표시 개수 · 정렬 ════════ */
.search { gap: var(--s2); padding: var(--s3) var(--s4); margin-bottom: var(--s3); }
.search .btn { min-height: 40px; }
/* 검색 칸 접기 (모니터링·운영 통계 form.has-toggle, PC·폰 공통): 검색어 + "상세 검색" 버튼 한 줄 — 누르면 지역·상태 칸이 아래에 펼쳐짐 (app.js),
   버튼 숫자 = 걸린 조건 수. PC 는 접었을 때 표시 개수 줄까지 한 줄 (아래 PC 규칙), 폰은 펼친 칸이 두 칸씩 (폰 규칙) */
.search.has-toggle { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s1); }
.search.has-toggle > label.q { order: -2; flex: 1 1 60%; gap: 0; min-width: 0; font-size: 0; } /* 칸 이름은 숨김 (자리표시 글로 충분) */
.search.has-toggle > label.q input { font-size: 15px; }
.search.has-toggle > .filter-toggle { display: inline-flex; flex: none; order: -1; }
.search.has-toggle > .filter-reset { flex: none; order: -1; } /* 초기화는 펼침 밖 — 상세 검색 바로 옆에 늘 */
/* 상세 검색 칸 (네 화면 공통 — index.html .filter-fields > [.filter-group >] .filter-row > 칸). 모니터링은 지역 · 운전 상태 · 현장 구성 세 묶음 (2026-11-26 사용자가 고른 배치).
   묶음은 제 폭대로 놓이고 자리가 모자라면 묶음째 다음 줄로. 칸 폭은 width 로 (flex-basis 만 주면 묶음 폭 계산에 안 잡혀 묶음이 좁아짐) */
.search.has-toggle:not(.open) > .filter-fields { display: none; }
.filter-fields { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: var(--s2) var(--s3); min-width: 0; }
.filter-group { flex: 0 0 auto; max-width: 100%; min-width: 0; }
.filter-group-name { display: none; } /* 묶음 이름(지역 · 운전 상태 · 현장 구성)은 화면에 안 보임 — 줄을 차지해서 뺌 (2026-11-26 사용자). 묶음은 간격으로만 나뉘고, 이름은 읽어 주는 프로그램용(aria-labelledby)으로 남김 */
.filter-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s1); }
.filter-row > label { flex: 0 0 auto; width: 160px; }
.filter-row > label.short { width: 120px; } /* 선택지가 짧은 칸(전체 · 적용 · 미적용 …) */
.filter-toggle[aria-expanded="true"] { border-color: var(--sub-strong); color: var(--sub-text); }
/* 펼침 화살표: 접힘 ▾ · 펼침 ▴ (선택칸 화살표처럼 꺾은 선) */
.filter-toggle::after { content: ''; width: 7px; height: 7px; margin: -4px 0 0 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.filter-toggle[aria-expanded="true"]::after { margin-top: 4px; transform: rotate(-135deg); }
.filter-count:not(:empty) { min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 10px; background: var(--sub-strong); color: var(--bg); font-size: 13px; line-height: 20px; }
.result-line { gap: var(--s1) var(--s2); margin: 0 0 var(--s2); padding-top: 0; color: var(--muted); font-size: 15px; font-weight: 400; }
.page-size { gap: var(--s1) var(--s2); }
.page-size .check { gap: var(--s1); }
body.view-list .board-head { padding-bottom: var(--s2); }

/* ════════ 요약 칸 ════════ */
.summary { gap: var(--s3); margin-bottom: var(--s3); }
.tile { gap: var(--s1); padding: var(--s3); background: var(--bg); border-radius: var(--radius); box-shadow: var(--raised); }
.tile .label { color: var(--muted); font-size: 15px; font-weight: 400; }
.tile b { font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
.tile b.time { font-size: 24px; }

/* ════════ 상세 ════════ */
.detail-head { gap: var(--s3); margin-bottom: var(--s3); }
.detail-title h2 { font-size: 32px; font-weight: 700; }
/* 폰 상세: 현장명 오른쪽에 카카오톡 전송 (m-share) — 현장명이 길어 줄이 바뀌어도 버튼은 그 오른쪽 가운데. PC 는 버튼 줄 맨 끝 (d-share) */
#detail .detail-title { display: flex; align-items: center; gap: var(--s2); }
#detail .detail-title h2 { min-width: 0; }
#detail .detail-title .btn { flex: none; margin-left: 5px; }
.detail-title p { gap: 4px var(--s2); margin-top: var(--s1); font-size: 15px; }
.detail-tiles { margin-bottom: var(--s3); }
.chart-panel { padding: var(--s4); }
.chart-bar { gap: var(--s2); margin-bottom: var(--s2); }
.chart-left, .chart-right { gap: var(--s2); }
.chart-sub { gap: var(--s1) var(--s2); margin-bottom: var(--s1); }
.readout, .legend, .chart-tip { font-size: 15px; }
/* 그래프 밑 범례 (여과전·여과후) — 누르면 그 선을 켜고 끔: 켠 선은 색 칸을 채움, 끈 선은 빈 칸 + 흐린 글자 */
.legend { justify-content: center; gap: var(--s1); margin-top: var(--s1); }
.legend:empty { display: none; }
.legend button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s1); border: 0; border-radius: 6px;
  background: none; box-shadow: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.legend button:hover { background: var(--hover); }
.legend i { width: 14px; height: 14px; border: 2px solid var(--line-color); border-radius: 3px; background: var(--line-color); }
.legend button[aria-pressed="false"] { color: var(--faint); }
.legend button[aria-pressed="false"] i { background: none; }
.ctl-box { gap: var(--s1); }
.ctl-row { gap: var(--s2); }
/* 운전 모드 조작판: 옆 버튼과 같은 흰 판에 [운전 모드 | 자동 수동 정지] — 지금 모드만 표 운전모드 배지와 같은 색으로 칠함
   (자동 초록 · 수동 파랑 · 정지 빨강, 흰 굵은 글씨), 나머지는 글자만. 높이는 옆 버튼과 같은 40 */
/* 잘 보이게: 테두리·"운전 모드" 라벨을 남색으로 칠함 (라벨은 판 왼쪽 끝까지 꽉 채운 탭), 안 고른 버튼 글자도 진하게 */
.ctl { --ctl-c: var(--sub-strong); align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--ctl-c); border-radius: 9px; background: var(--bg); }
:root[data-theme="dark"] .ctl { --ctl-c: var(--sub-mid); } /* 어두운 화면의 sub-strong 은 밝은 파랑이라 흰 글씨가 안 보임 */
.ctl-label { align-self: stretch; display: flex; align-items: center; margin: -3px 4px -3px -3px; padding: 0 14px; border-radius: 8px 0 0 8px; background: var(--ctl-c); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.ctl .ctl-btn { min-width: 60px; min-height: 32px; padding: 0 12px; border-color: transparent; border-radius: 6px; background: transparent; color: var(--text); }
.ctl .ctl-btn:hover:not(:disabled):not(.active) { border-color: transparent; background: var(--hover); color: var(--text); }
.ctl .ctl-btn:disabled:not(.active) { border-color: transparent; background: transparent; color: var(--faint); }
.ctl .ctl-btn.active, .ctl .ctl-btn.active:hover, .ctl .ctl-btn.active:disabled { border-color: transparent; background: var(--ok); color: #fff; font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.ctl .ctl-btn.active[data-cmd="manual"], .ctl .ctl-btn.active[data-cmd="manual"]:hover, .ctl .ctl-btn.active[data-cmd="manual"]:disabled { background: var(--sub-mid); }
.ctl .ctl-btn.active[data-cmd="stop"], .ctl .ctl-btn.active[data-cmd="stop"]:hover, .ctl .ctl-btn.active[data-cmd="stop"]:disabled { background: var(--bad); }
.ctl-msg { font-size: 15px; }
.map-panel, .issue-panel, .info-panel, .ad-panel { margin-top: var(--s3); padding: var(--s4); }
.map-panel h3, .issue-panel h3, .info-panel h3, .ad-panel h3, .stats-panel h3 { margin-bottom: var(--s2); font-size: 19px; font-weight: 700; }
.loc-grid { gap: var(--s3); }
.loc-head { margin-bottom: var(--s2); }
/* 이슈 개수 · 흡착분해제 요약: 떠 있는 카드 대신 표 한 줄 — 위 이름 칸(옅은 남색 머리글) · 아래 값 칸
   줄은 칸마다 오른쪽·아래, 바깥 위·왼쪽은 묶음이 (칸 수가 화면 폭 따라 바뀌어도 줄이 맞고, 인쇄해도 안 뭉개짐). 고른 이슈 구분은 머리글이 남색 */
.issue-counts, .ad-summary { gap: 0; padding: 0; border: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
.issue-counts .tile, .issue-counts button.tile, .ad-summary > div {
  justify-content: flex-start; gap: 0; padding: 0; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  border-radius: 0; background: var(--bg); box-shadow: none; text-align: center;
}
.issue-counts .tile .label, .ad-summary .label { padding: 10px var(--s2); background: var(--sub-soft); color: var(--text); font-size: 15px; font-weight: 700; }
.issue-counts .tile b { padding: 14px var(--s2); font-size: 19px; }
.issue-counts button.tile:hover b { background: var(--hover); }
.issue-counts button.tile[aria-pressed="true"] { box-shadow: none; }
.issue-counts button.tile[aria-pressed="true"] .label { background: var(--sub-strong); color: #fff; }
:root[data-theme="dark"] .issue-counts button.tile[aria-pressed="true"] .label { color: #000; }
.issue-form { gap: var(--s2); }
.issue-counts { margin-bottom: var(--s5); } /* 위 구분별 개수 표와 아래 입력 줄 사이 — 24 면 표 밑줄과 칸 이름이 붙어 보여서 묶음 간격 40 */
.ad-head { margin-bottom: var(--s2); }
.ad-summary { margin-bottom: var(--s2); }
.ad-summary > div { align-items: center; }
.ad-summary > div > :not(.label) { margin: 12px var(--s2); }
.ad-summary .label { align-self: stretch; }
.ad-summary .dday-badge { align-self: center; }
.ad-form { margin-bottom: var(--s2); }
.dday-badge { border-radius: 4px; }

/* ════════ 통계 · 운영 ════════ */
.stats-panel { margin-bottom: var(--s3); padding: var(--s4); }
.stats-row { gap: var(--s3); margin-bottom: var(--s3); }
.stats-charts { gap: var(--s3); }
.stats-legend { gap: var(--s1); font-size: 15px; }
.ops-head { gap: var(--s2); margin-bottom: var(--s2); }
.ops-actions { flex-wrap: wrap; gap: var(--s1); }
.stats-tip { border-radius: 6px; box-shadow: var(--elev-pop); }

/* ════════ 운영 통계 조회기간 — "조회기간 [2026.11.01 📅] ~ [2026.11.05 📅]" 시작일·종료일 칸마다 달력(flatpickr)
   고른 날은 남색 동그라미 (참고: 정부 누리집 기간별 보고서) ════════ */
.ops-dates { display: inline-flex; align-items: center; gap: var(--s1); margin-right: var(--s1); color: var(--text); font-size: 15px; font-weight: 700; white-space: nowrap; }
.date-range {
  width: 152px; min-height: 40px; padding-right: 44px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d7882' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
  font-variant-numeric: tabular-nums; font-weight: 400; cursor: pointer;
}
@media screen and (max-width: 860px) { /* 폰: "조회기간"은 위 줄, 시작일 ~ 종료일 칸이 아래 줄을 반씩 (한 줄에 다 넣으면 화면 밖으로 나감) */
  .ops-dates { flex-wrap: wrap; width: 100%; margin-right: 0; }
  .ops-dates > span:first-child { flex-basis: 100%; }
  .ops-dates .date-range { flex: 1 1 0; width: auto; min-width: 0; }
}
.stats-search > .ops-dates { order: -1; margin-left: auto; margin-right: 0; } /* 이슈 통계: 조회기간은 검색 줄 오른쪽 끝, 상세 검색을 펼쳐도 첫 줄 */
@media (min-width: 861px) { .stats-search > .ops-dates .date-range { width: 160px; } }
.flatpickr-calendar { padding: var(--s1) 0 4px; border-radius: var(--radius); background: var(--bg); box-shadow: var(--elev-pop); font-family: inherit; }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after, .flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-months { margin-bottom: 4px; padding-bottom: var(--s1); border-bottom: 1px solid var(--line); }
.flatpickr-months .flatpickr-month, .flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { color: var(--text); fill: var(--text); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--on); }
/* 달력 위 "2026년 11월" — 연도를 앞으로, 뒤에 "년", 월은 글자로 (ops.js monthSelectorType: 'static'), 연도 ▲▼ 숨김 */
.flatpickr-current-month { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); font-size: 15px; font-weight: 700; }
.flatpickr-current-month .numInputWrapper { order: -1; display: inline-flex; align-items: center; width: auto; }
.flatpickr-current-month .numInputWrapper::after { content: '년'; }
.flatpickr-current-month .numInputWrapper span.arrowUp, .flatpickr-current-month .numInputWrapper span.arrowDown { display: none; }
.flatpickr-current-month input.cur-year, .flatpickr-current-month input.cur-year[disabled], .flatpickr-current-month input.cur-year[disabled]:hover {
  width: 4.4ch; min-height: 0; padding: 0; border: 0; color: var(--text); font-size: 15px; font-weight: 700; text-align: right; box-shadow: none;
}
.flatpickr-current-month span.cur-month { margin: 0; color: var(--text); font-weight: 700; }
.flatpickr-current-month span.cur-month:hover { background: none; }
span.flatpickr-weekday { color: var(--muted); font-size: 15px; font-weight: 700; }
.flatpickr-day { color: var(--text); font-size: 15px; }
.flatpickr-day:hover, .flatpickr-day:focus { border-color: var(--hover); background: var(--hover); }
.flatpickr-day.today { border-color: var(--border-strong); }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay, .flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: var(--faint); opacity: 0.5; }
/* 기간 안 날: 끊긴 띠 대신 옅은 동그라미 하나씩 */
.flatpickr-day.inRange, .flatpickr-day.prevMonthDay.inRange, .flatpickr-day.nextMonthDay.inRange { border-color: var(--sub-soft); border-radius: 150px; background: var(--sub-soft); box-shadow: none; color: var(--sub-text); }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange,
.flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover { border-color: var(--sub-strong); border-radius: 150px; background: var(--sub-strong); color: #fff; }
.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) { box-shadow: none; }
/* 시작일·종료일도 반쪽(띠 끝) 모양 말고 그냥 동그라미 — flatpickr 의 50px 0 0 50px 등을 덮음 */
.flatpickr-day.selected.startRange, .flatpickr-day.startRange.startRange, .flatpickr-day.endRange.startRange,
.flatpickr-day.selected.endRange, .flatpickr-day.startRange.endRange, .flatpickr-day.endRange.endRange { border-radius: 150px; }
:root[data-theme="dark"] .flatpickr-day.selected, :root[data-theme="dark"] .flatpickr-day.startRange, :root[data-theme="dark"] .flatpickr-day.endRange { color: #000; }
:root[data-theme="dark"] .flatpickr-calendar { background: #1e2124; }
:root[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months { background: #1e2124; }

/* ════════ 운영 통계 상세 (opsReport.js) — 모니터링 상세 화면을 같이 쓰고 실시간 칸·그래프·원격 명령만 숨김
   위: 조회기간·로그 다운로드·기간별 보고서(PDF) / 요약 칸 5 / 그래프 3 (조회기간 한 줄, 월간·연간 나란히) / 날짜별 표 ════════ */
body.view-ops-detail #d-tiles, body.view-ops-detail #detail .chart-panel, body.view-ops-detail #d-ctl, body.view-ops-detail #ctl-msg,
body.view-ops-detail #d-config, body.view-ops-detail #d-settings, body.view-ops-detail #d-share, body.view-ops-detail #m-share { display: none; } /* 운영 통계 상세는 보고서라 원격 명령·현장 설정·설정 버튼·카카오톡 전송도 없음 */
/* 운영 통계 상세: 제품 정보를 현장 제목 줄 바로 아래로 — 기간별 보고서(PDF)와 같은 순서 */
body.view-ops-detail #detail { display: flex; flex-direction: column; }
body.view-ops-detail .detail-head { order: -3; }
body.view-ops-detail .info-panel { order: -2; margin: 0 0 var(--s3); }
body.view-ops-detail #ops-report { order: -1; }
.report-head, .report-sum { display: none; } /* 기간별 보고서(PDF) 머리·요약 표 — 인쇄 때만 (아래 @media print) */
.ops-report { margin-bottom: var(--s3); }
.or-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.or-tiles .tile b { font-size: 19px; }
.or-tiles .tile .tile-line { display: block; }
.or-tiles .dday-badge { margin-left: 4px; }
.or-chart-panel { margin-bottom: var(--s3); padding: var(--s3) var(--s4); }
.or-chart-panel h3 { margin: 0 0 var(--s2); font-size: 19px; font-weight: 700; }
.or-chart { min-height: 280px; }
.or-chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.or-chart .u-legend { margin-top: var(--s1); color: var(--muted); font-size: 13px; }
.or-chart .u-legend .u-marker { border-radius: 2px; }
.or-chart-note { display: grid; place-items: center; min-height: 280px; margin: 0; color: var(--muted); font-size: 15px; text-align: center; word-break: keep-all; }
.or-table-panel h3 { margin: 0 0 var(--s2); font-size: 19px; font-weight: 700; }
@media (max-width: 1100px) {
  .or-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .or-chart-row { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 860px) { /* 폰 화면만 — 인쇄(종이 폭이 860 보다 좁게 잡힘)엔 PC 모양 */
  .or-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .or-chart-panel { padding: var(--s2); }
}

/* ════════ 창 (KRDS 모달: 모서리 12, 안쪽 32, 버튼은 오른쪽 아래 — 보조 다음 주 버튼) ════════ */
.dialog { border-radius: 12px; background: var(--bg); box-shadow: var(--elev-modal); }
:root[data-theme="dark"] .dialog { background: #1e2124; } /* 선명한 화면: 창은 한 층 밝게 (gray90) */
.dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.dialog form { gap: var(--s2); padding: var(--s4); }
.dialog h2 { font-size: 24px; font-weight: 700; }
.dialog .hint { margin: calc(var(--s1) * -1) 0 0; font-size: 15px; }
.dialog-actions { gap: var(--s1); margin-top: var(--s1); }
.region-row { gap: var(--s2); }

/* ════════ 로그인 ════════ */
.login form { gap: var(--s2); padding: var(--s5); max-width: 420px; }
.login h2 { font-size: 24px; font-weight: 700; }
.login-opts { gap: var(--s1) var(--s3); }
.login .btn.primary { margin-top: var(--s2); }

/* ════════ 홈 (KRDS 표준 콘텐츠 폭 1200) ════════ */
#home-view { max-width: 1200px; margin: 0 auto; padding-top: 0; }
/* 홈만 바탕을 옅은 회청색으로 — 카드를 모아 놓은 첫 화면이라 흰 카드가 또렷하게 (표·목록 화면은 흰 바탕 그대로, 헤더·메뉴도 흰색) */
body.view-home { background: #eef2f9; }
:root[data-theme="dark"] body.view-home { background: var(--page); }
#notices-view, #alarms-view { max-width: none; margin: 0; padding-top: 0; } /* 공지·알람은 다른 메뉴와 같은 폭 — 경로·제목 왼쪽 시작선을 맞춤 */
.ticker { margin-bottom: var(--s3); border-radius: var(--radius); box-shadow: none; }
/* 다크는 바탕도 검정이라 검은 판이 묻힘 — 흰 판에 굵은 글씨 (현장명 검정 · 이상 빨강 · 정상 초록, 라이트 모드 색), 빛 번짐 · LED 점은 뺌 */
:root[data-theme="dark"] .ticker { background: #fff; box-shadow: none; }
:root[data-theme="dark"] .ticker::after { display: none; }
:root[data-theme="dark"] .ticker-item { color: #de3412; font-weight: 800; text-shadow: none; }
:root[data-theme="dark"] .ticker-item.ok { color: #228738; }
:root[data-theme="dark"] .ticker-item .name { color: #1e2124; text-shadow: none; }
:root[data-theme="dark"] .ticker-sep { background: #b1b8be; }
.ticker.ok { justify-content: center; } /* 이상 없음: "모든 현장 정상 작동중" 하나만 가운데 고정 (ticker.js) */
.home-hero { margin-bottom: var(--s3); border-radius: var(--radius); box-shadow: var(--raised); }
.home-grid { gap: var(--s3); }
.home-grid + .home-grid { margin-top: var(--s3); }
.home-card { padding: var(--s4); }
.home-head { gap: var(--s2); margin-bottom: var(--s2); }
.home-head h2 { font-size: 19px; font-weight: 700; }
.home-head .sub { font-size: 15px; font-weight: 400; }
.mini-search { top: var(--s2); left: var(--s2); gap: var(--s1); padding: var(--s1); border-radius: var(--radius); box-shadow: var(--elev-pop); }
.mini-search select, .mini-search input { min-height: 40px; font-size: 15px; }
.mini-search select { width: 150px; } /* "강원특별자치도"까지 안 잘리게 */
.mini-chips { right: var(--s2); bottom: var(--s2); left: var(--s2); gap: var(--s1) var(--s2); padding: var(--s1) var(--s2); border-radius: var(--radius); box-shadow: var(--elev-pop); font-size: 15px; font-weight: 400; }
.dday-sum { gap: var(--s1); }
.dday-sum span { padding: 0 var(--s1); border-radius: 4px; box-shadow: none; background: var(--sub-soft); font-size: 15px; font-weight: 700; line-height: 24px; }
.dday-row { gap: 4px var(--s2); padding: 12px var(--s1); border-radius: 6px; }
.dday-row .when { font-size: 15px; }
.notice-row { gap: var(--s2); padding: 12px var(--s1); }
.notice-row .d { font-size: 15px; }
.links { gap: var(--s2); }
.link-card { gap: var(--s1); padding: var(--s3); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--border); }
.link-card:hover { background: var(--hover); transform: none; }
.link-card:active { box-shadow: 0 0 0 1px var(--border-input); }
.link-card b { font-size: 17px; }
.link-card small { font-size: 15px; }
.link-card img { width: 56px; height: 56px; }
/* 푸터: 본문↔푸터 64, 로고 → 연락처 → 저작권 */
/* KRDS 푸터처럼: 화면 끝까지 옅은 회색 띠(내용은 1200 안), 작은 로고 → 본사·TEL·FAX 한 줄씩(이름 굵게) → 줄 → 저작권. 페이지 맨 아래까지 */
.home-foot { --foot-bg: #f4f5f6; margin: var(--s8) 0 calc(var(--s8) * -1); padding: var(--s5) 0; background: var(--foot-bg); box-shadow: 0 0 0 100vmax var(--foot-bg); clip-path: inset(0 -100vmax); font-size: 17px; }
:root[data-theme="dark"] .home-foot { --foot-bg: #131416; }
.foot-logo { margin-bottom: var(--s3); }
.foot-logo img { width: 180px; }
.foot-info { flex-direction: column; align-items: flex-start; row-gap: 4px; }
.foot-info .item { gap: var(--s1); }
.foot-info .item + .item::before { display: none; }
.foot-info .k { color: var(--text); font-size: 17px; font-weight: 700; }
.foot-info b, .foot-info a { font-weight: 400; }
.foot-copy { margin-top: var(--s3); padding-top: var(--s3); border-top-color: var(--border); color: var(--muted); font-size: 15px; }
.top-link { font-size: 15px; }

/* ════════ 공지사항 · 알람 이력 ════════ */
.np-panel { padding: var(--s4); }
.np-head { gap: var(--s2); padding-bottom: var(--s3); border-bottom: 2px solid var(--text); }
.np-head h2 { font-size: 32px; font-weight: 700; }
.np-search { gap: var(--s1); margin: var(--s3) 0 var(--s2); }
.np-table { font-size: 15px; }
.np-table tr.empty td { padding: var(--s5); text-align: center; }
.al-sum { font-size: 15px; }

/* ════════ 현장 설정 ════════ */
.cfg-grid { gap: var(--s3); }
.cfg-sec { padding: var(--s4); }
.cfg-sec h3 { margin-bottom: var(--s2); font-size: 19px; font-weight: 700; }
.cfg-scope { font-size: 15px; font-weight: 400; }
.cfg-row { gap: var(--s2); padding: var(--s2) 0; }
.cfg-label small { font-size: 15px; }
.cfg-num { gap: var(--s1); }
.cfg-num input { min-height: 40px; font-size: 17px; font-weight: 700; }
.cfg-num input.short { width: 76px; } /* 17px 굵게 "03:00" + 선명한 화면 2px 테두리까지 안 잘리게 */
.cfg-num.dt input.date { width: 140px; }
.cfg-step { width: 40px; height: 40px; border: 1px solid var(--border-input); border-radius: 6px; background: var(--bg); color: var(--text); box-shadow: none; }
.cfg-step:hover { background: var(--hover); color: var(--text); }
.cfg-step:active { background: var(--line); box-shadow: none; transform: none; }
.viz { margin-bottom: var(--s1); padding: var(--s2) var(--s3); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--border); background: var(--hover); }
.viz-note, .cal-formula { font-size: 15px; }
.cfg-ranges { gap: var(--s1); padding: var(--s2) 0; }
.cfg-range { gap: var(--s1); }
.cfg-range input[inputmode] { min-height: 40px; font-weight: 700; }
.cfg-hours-head { gap: var(--s2); padding: var(--s2) 0 var(--s1); }
.cfg-hours { gap: var(--s1); }
.cfg-hour { min-height: 40px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--border-strong); font-weight: 700; }
.cfg-state { padding: 0 var(--s2); min-height: 40px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--border); }
.cfg-banner { margin-bottom: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--border); }
.cfg-bar { gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--radius); box-shadow: var(--elev-modal); }

/* ════════ 현장 지도 ════════ */
/* 떠 있는 판·지도 틀은 카드 모서리(10), 목록 줄·팝업 버튼은 6 */
.map-card, .photo-box, .site-map, .mini-map, .pin-preview { border-radius: var(--radius); }
.map-card { box-shadow: var(--elev-pop); }
.map-item, .pop .btn { border-radius: 6px; }
/* 지도 팝업 버튼: 기본 스타일(style.css)의 display: block 때문에 링크("상세 보기")만 글자가 위로 붙던 것 — 버튼과 같게 가운데 */
.pop .btn { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; }
.pop { border-radius: var(--radius); box-shadow: var(--elev-pop); }
.map-side { gap: var(--s2); }
.map-search { gap: var(--s1); margin: 0; padding: var(--s2); } /* 검색 줄(.search) 아래 여백이 지도 판엔 안 붙게 */
.map-search select { min-height: 40px; font-size: 15px; }
.map-list { padding: var(--s2) var(--s1) var(--s3); }
.map-list-head { margin: 0 var(--s2) var(--s1); font-size: 15px; }
.map-chips { gap: var(--s1); padding: 4px var(--s2); border-radius: var(--radius); box-shadow: var(--elev-pop); }
.map-chip { padding: var(--s1) 12px; border-radius: 6px; font-size: 15px; }
/* 고른 상태 칩은 핀 이름표 토글처럼 남색 칠 · 흰 굵은 글씨 (다시 누르면 풀림) */
.map-chip.active, .map-chip.active:hover:not(:disabled) { background: var(--sub-strong); color: #fff; font-weight: 700; box-shadow: none; }
:root[data-theme="dark"] .map-chip.active { color: #000; }
.map-chip.active .dot { box-shadow: 0 0 0 2px #fff; } /* 남색 위에서도 상태 점이 보이게 */
/* 핀 이름표 토글 (현장 지도 오른쪽 위, 상태 막대와 같은 높이) — 고른 쪽은 남색 (고른 탭과 같은 색) */
.map-label { position: absolute; top: 16px; right: 16px; z-index: 6; display: flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--bg); box-shadow: var(--elev-pop); }
.map-label button { min-height: 40px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.map-label button:hover { background: var(--hover); color: var(--text); }
.map-label button[aria-pressed="true"] { background: var(--sub-strong); color: #fff; font-weight: 700; }
:root[data-theme="dark"] .map-label button[aria-pressed="true"] { color: #000; }
/* 상태 막대가 검색 카드 오른쪽 빈 곳 가운데에 서는 PC 폭(1700 미만)은 토글 자리만큼 비우고 가운데 */
@media (min-width: 861px) and (max-width: 1699px) {
  .map-chips { right: 189px; }
}
/* 폰: 위 검색줄 · 상태 막대 아래 오른쪽, 지역 칸을 펼치면 상태 막대처럼 잠깐 숨김 */
@media screen and (max-width: 860px) {
  .map-label { top: 134px; right: 10px; }
  .map-label button { min-height: 32px; }
  .map-view:has(.map-search.open) .map-label { display: none; }
}
.map-item-name { font-size: 17px; }
/* 목록 한 칸을 조금 얇게 (108→95) — 한 쪽 5곳이 노트북 화면에서도 잘리지 않고 다 들어가게 */
.map-item { padding: 10px 12px; }
.map-item-body { gap: 2px; }
.map-item-name, .map-item-sub { line-height: 1.4; }
.map-item-sub, .map-item-meta { font-size: 15px; }
.map-item-meta .badge { padding: 0 var(--s1); font-size: 15px; }

/* ════════ 글자 크기는 KRDS 단계만 (PC 13·15·17·19·24·32, 폰 13·15·17·19·22·24) — 옛 10·11·12·14·16·18·22px 정리 ════════ */
/* 표 본문 숫자는 보통 굵기 (KRDS 표 본문 = 400, 운영 통계 표와 같게) */
.sites td.num { font-weight: 400; }
.alert-dot { font-size: 13px; }
.tag-pin, .np-title .tag-new, .notice-row .tag-new { font-size: 13px; }
.dday-badge, .ops-table .dday-badge { font-size: 15px; }
.detail-tiles .tile b { font-size: 24px; }
.detail-tiles .tile b.time { font-size: 19px; }
/* 전력 칸 (detail.js powerValues): 한 줄에 값 두 개 — 줄 높이는 옆 칸 값 줄(24 × 1.5)과 같게 두고,
   글자는 칸 폭에 맞춰 화면 폭 따라 줄임 (1920 에선 옆 칸과 같은 24) */
.power-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s1); font-size: clamp(15px, 1.25vw, 24px); line-height: 36px; }
.power-row > span { white-space: nowrap; }
.info-table th .sub { font-size: 13px; }
.issue-form .btn.primary { min-height: 40px; padding: 0 var(--s3); font-size: 15px; }
.photo-del { font-size: 17px; }
.cfg-step { font-size: 19px; }
.cfg-when { font-size: 13px; }
.g-mark.now span, .g-labels { font-size: 13px; }
.g-labels { height: 20px; }
.tl-times, .tl-scale { height: 20px; font-size: 13px; }
.cfg-range .no, .cfg-range .dur { font-size: 13px; }
.cal-preview { font-size: 15px; }
.cfg-bar .btn.primary { min-height: 48px; padding: 0 var(--s3); font-size: 17px; }

/* ════════ 붙는 줄(검색)은 페이지 바탕과 같게, 현장 제목 줄(상세·운영 통계 상세·현장 설정)은 옅은 회색 띠로 화면 끝까지 ════════ */
body.view-list .board-head, body.view-ops .ops-sticky { background: var(--page); }
body.view-detail .detail-head, body.view-config .detail-head { --title-bg: #f4f5f6; background: var(--title-bg); border-bottom: 1px solid var(--line); }
:root[data-theme="dark"] body.view-detail .detail-head, :root[data-theme="dark"] body.view-config .detail-head { --title-bg: #1e2124; }
@media (min-width: 861px) {
  /* 모니터링·운영 통계는 위에 페이지 제목이 있어 그대로 두고, 스크롤하면 검색 묶음이 헤더 바로 아래 붙음 */
  /* 탭 ↔ 검색줄 40, 검색줄 ↔ 표 24 — 여백은 붙는 칸 안쪽이라 스크롤해 붙어도 간격이 안 변함.
     늘린 만큼 페이지 아래 여백을 64 → 40 으로 줄여 전체 길이는 같게 (페이지 번호 밑에 남던 빈자리를 위로) */
  body.view-list .board-head { margin: 0 calc(var(--s5) * -1); padding: var(--s5) var(--s5) var(--s3); }
  body.view-ops .ops-sticky { margin: 0 calc(var(--s5) * -1); padding: var(--s5) var(--s5) var(--s3); }
  body.view-list main, body.view-ops main, body.view-stats main, body.view-alarms main, body.view-notices main { padding-bottom: var(--s5); }
  /* 상세·현장 설정: 본문 위 여백(24)만큼 끌어올려 헤더 바로 아래에 붙게 */
  body.view-detail .detail-head, body.view-config .detail-head { margin: calc(var(--s3) * -1) calc(var(--s5) * -1) var(--s3); padding: var(--s3) var(--s5); }
  /* 상세 머리 한 줄 맞춤: 원격 명령 안내 줄이 조작판 밑에 자리를 잡으면 조작판이 제목보다 위로 뜸 → 안내 줄은 띄워서 아래 여백에 */
  #detail .ctl-box { position: relative; }
  #detail .ctl-msg { position: absolute; top: calc(100% + 2px); right: 0; min-height: 0; white-space: nowrap; }
  /* 모니터링 상세도 운영 통계처럼 제품 정보를 현장 제목 줄 바로 아래로 (폰은 정보 탭에 그대로) */
  body.view-detail:not(.view-ops-detail) #detail { display: flex; flex-direction: column; }
  body.view-detail:not(.view-ops-detail) .detail-head { order: -2; }
  body.view-detail:not(.view-ops-detail) .info-panel { order: -1; margin: 0 0 var(--s3); }
}
@media screen and (max-width: 860px) {
  /* 폰: 본문 여백(16)만큼 끌어올리고 양옆도 화면 끝까지 */
  body.view-detail .detail-head, body.view-config .detail-head { margin: calc(var(--s2) * -1) calc(var(--s2) * -1) var(--s2); padding: var(--s2); }
}

/* ════════ 페이지 틀 (정부 누리집 목록 화면처럼) — 흰 바탕, 헤더 아랫줄 가로 메뉴, 큰 제목 · 검은 줄, 목록 화면은 판 없이 ════════ */
.page-head { margin-bottom: var(--s3); padding: var(--s2) 0 var(--s3); border-bottom: 1px solid var(--text); }
.page-head h2 { margin: 0; font-size: 32px; font-weight: 700; }
.np-head { border-bottom-width: 1px; }
@media (min-width: 861px) { .np-head { padding-top: var(--s2); } } /* 공지·알람 제목도 다른 메뉴 제목과 같은 높이 */

@media (min-width: 861px) {
  /* 헤더 두 줄: 윗줄 로고 · 제목 · 유틸리티, 아랫줄 가로 메뉴 (KRDS 메인 메뉴처럼 화면 가운데 1080 폭에 고르게, 위에 화면 끝까지 줄)
     고른 메뉴는 남색 글씨 + 아래 막대 · 메뉴 줄은 헤더 좌우 여백(40)을 넘어 화면 끝까지 — 지도 화면은 스크롤바 자리(--sbw)까지
     (줄만 늘이고 탭 자리는 오른쪽 여백에 --sbw 를 더해 다른 페이지와 같게 — 안 그러면 지도 누를 때 탭이 옆으로 밀림) */
  .top { flex-wrap: wrap; row-gap: 0; padding-top: var(--s3); padding-bottom: 0; } /* 위 여백 24 · 메뉴 줄과 사이 24 — 제목(두 줄)이 위아래로 답답하지 않게 */
  .top:has(> .nav[hidden]) { padding-bottom: var(--s3); } /* 로그인 화면(메뉴 줄 없음): 아래도 24 — 없으면 가운데 제목 둘째 줄이 헤더 밑줄 밖으로 나감 */
  .nav { position: static; order: 9; flex: 0 0 calc(100% + var(--s5) * 2); flex-direction: row; gap: 0; width: auto; margin: var(--s3) calc(var(--s5) * -1) 0; padding: 0 max(var(--s5), calc((100% - 1000px) / 2)); border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
  body.view-map .nav { flex-basis: calc(100% + var(--s5) * 2 + var(--sbw, 0px)); padding-right: calc(max(var(--s5), calc((100% - 1000px) / 2)) + var(--sbw, 0px)); }
  .nav-item { flex: 1 1 0; flex-direction: row; justify-content: center; align-items: center; height: 56px; padding: 0 var(--s1); border-radius: 0; color: var(--text); font-size: 19px; font-weight: 700; white-space: nowrap; }
  .nav-item svg { display: none; }
  .nav-item:hover { background: none; color: var(--on); }
  /* 엑셀 시트 탭처럼: 메뉴 줄은 연회색 띠, 고른 탭만 흰 바탕 · 테두리로 들려서 아래 내용과 이어짐 (헤더 밑줄을 덮음) */
  .nav { gap: 4px; padding-top: var(--s1); border-top: 0; background: var(--hover); }
  .nav-item { height: 48px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 400; }
  .nav-item:hover { background: var(--line); color: var(--text); }
  .nav-item.active { position: relative; border-color: var(--border); background: var(--bg); color: var(--sub-text); font-weight: 700; box-shadow: none; }
  .nav-item.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 1px; background: var(--bg); } /* 탭 아래 헤더 밑줄을 덮어 아래 화면과 끊김 없이 이어짐 */
  :root[data-theme="dark"] .nav-item.active { color: var(--sub-strong); }
  /* 메뉴 이름은 고른 탭이 대신하므로 페이지 큰 제목 줄은 뺌 (알람 이력 · 공지사항은 오른쪽 건수 · 글쓰기만 남김) */
  .page-head { display: none; }
  .np-head h2 { display: none; }
  /* 탭 아래 첫 줄까지 24 — 모니터링 · 운영 통계는 붙는 검색 묶음이 위 여백(24)을 이미 가져서 main 여백은 뺌 */
  body.view-list main, body.view-ops main { padding-top: 0; }
  /* 알람 이력 · 공지사항: 남은 건수 · 글쓰기는 검색 줄 오른쪽 끝에 (제목 줄이 없어져 혼자 한 줄 차지하지 않게) */
  .np-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s2); }
  .np-panel > * { grid-column: 1 / -1; }
  .np-panel > .np-head { grid-column: 2; grid-row: 1; align-self: center; margin-bottom: var(--s2); padding: 0; border-bottom: 0; }
  .np-panel > .np-search { grid-column: 1; grid-row: 1; margin-top: 0; }
  /* 틀고정: 고장 통계 · 알람 이력 · 공지사항도 헤더 · 검색 줄 · 표 머리글이 스크롤해도 위에 붙음 (모니터링 · 운영 통계와 같은 방식)
     검색 줄은 위 여백(24)을 안쪽 여백으로 바꾸고 좌우 화면 끝까지 바탕을 깔아 아래로 지나가는 표를 가림 — 놓인 자리는 그대로 */
  body.view-stats .top, body.view-alarms .top, body.view-notices .top { position: sticky; top: 0; z-index: 20; background: var(--bg); }
  /* 탭 ↔ 검색줄 40 · 검색줄 ↔ 표 24 (모니터링 · 운영 통계와 같게) — 여백은 붙는 칸 안쪽이라 스크롤해 붙어도 그대로 */
  body.view-stats .st-sticky { position: sticky; top: var(--top-h, 76px); z-index: 19; margin: calc(var(--s3) * -1) calc(var(--s5) * -1) 0; padding: var(--s5) var(--s5) var(--s3); background: var(--page); }
  body.view-alarms .np-panel > .np-search, body.view-notices .np-panel > .np-search {
    position: sticky; top: var(--top-h, 76px); z-index: 19; margin: calc(var(--s3) * -1) 0 0 calc(var(--s5) * -1); padding: var(--s5) 0 var(--s3) var(--s5); background: var(--page);
  }
  body.view-alarms .np-panel > .np-head, body.view-notices .np-panel > .np-head { /* 같은 줄 오른쪽 (건수 · 글쓰기) — 칸 사이 16 까지 덮음 */
    position: sticky; top: var(--top-h, 76px); z-index: 19; align-self: stretch; align-items: center;
    margin: calc(var(--s3) * -1) calc(var(--s5) * -1) 0 calc(var(--s2) * -1); padding: var(--s5) var(--s5) var(--s3) var(--s2); background: var(--page);
  }
  body.view-alarms .al-table thead th { position: sticky; top: calc(var(--top-h, 76px) + var(--al-h, 88px)); z-index: 2; }
  /* 붙는 검색 줄 아래 빈 안내 칸(1.5em)은 글이 있을 때만 — 없으면 평소엔 그만큼 벌어졌다가 붙으면 좁아져 간격이 달라 보임 */
  #board-msg:empty, #ops-msg:empty, #stats-msg:empty, #al-msg:empty, #np-msg:empty { display: none; }
  /* 운영 통계: 조회기간 · 로그 다운로드 줄도 검색 묶음 아래 붙음 (스크롤해도 기간 바꾸기 · 받기 그대로) — 아래 여백은 안쪽으로 */
  #ops-title { display: none; } /* "운영 통계 · 기간" 제목은 탭 · 조회기간 칸과 겹쳐서 뺌 (폰은 탭이 없어 그대로) */
  body.view-ops .ops-panel > .ops-head { position: sticky; top: calc(var(--top-h, 76px) + var(--ops-h, 130px)); z-index: 18; margin-bottom: 0; padding-bottom: var(--s2); background: var(--page); }
  body.view-notices .np-table thead th { position: sticky; top: calc(var(--top-h, 76px) + var(--np-h, 88px)); z-index: 2; }
  /* 알람 이력 · 공지사항 표도 바깥 테두리 — 윗줄은 붙는 머리글 칸 안쪽 줄로 그려 스크롤해 붙어도 남게 */
  .np-panel .np-table { border: 1px solid var(--border); border-top-width: 0; }
  .np-panel .np-table thead th { box-shadow: inset 0 1px 0 var(--border); }
  .nav-item:focus-visible { outline-offset: -2px; }
  #top-notices { display: none; } /* 공지사항은 가로 메뉴에 */
  .map-view { left: 0; } /* 왼쪽 메뉴가 없어져 지도는 화면 끝까지 */
  /* 긴 지역 이름("강원특별자치도", "네트워크 이상")이 선택칸에서 안 잘리게 — 지도 왼쪽 판 430→460, 모니터링 상태·수위계 칸 130→150 */
  .map-side { width: 460px; }
  .map-chips { left: 492px; }
  #search { grid-template-columns: repeat(3, minmax(110px, 160px)) minmax(180px, 1fr) repeat(2, minmax(110px, 150px)) auto; }
  /* 지도 검색 판은 얇게: 검색어 한 줄 + 지역 세 칸 한 줄, 칸 이름은 숨기고 선택지에 ("시/도 전체") — 아래 목록 판이 길어지게 */
  .map-search > label { gap: 0; font-size: 0; }
  .map-search .q { order: -1; }

  /* 모니터링 · 운영 통계는 검색 묶음이 위에 붙는 칸이라 제목 아래 여백은 그 칸이 대신 */
  #board .page-head, #ops-view .page-head { margin-bottom: 0; }
  /* 검색 묶음 · 표 · 통계 · 공지 판: 테두리 상자 없이 흰 바탕에 바로 (표는 자기 테두리) */
  #search, #stats-search, #ops-search, #bulk-search, .table-panel, .stats-panel, .np-panel { border-radius: 0; background: none; box-shadow: none; }
  #search, #stats-search, #ops-search, #bulk-search, .stats-panel, .np-panel { padding: 0; }
  #search, #ops-search, #bulk-search { margin-bottom: var(--s2); }
  /* 검색 줄 (PC): [검색어][상세 검색][초기화] … [표시 개수 · 현장 추가 · 갱신] 한 줄 — 상세 검색을 펴도 이 줄은 그대로, 칸은 그 아래 판에 (아래 규칙) */
  .board-head, .ops-sticky { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
  .board-head > .result-line, .ops-sticky > .result-line { flex: 1 1 auto; align-items: center; margin: 0; }
  /* 검색 줄 오른쪽: 현장 추가는 검색칸과 같은 높이 40, 갱신 시각은 그 옆 16 띄우고 세로 가운데 */
  .board-head #site-add, .board-head #site-bulk { min-height: 40px; padding: 0 var(--s2); }
  .board-head #site-add + .updated, .board-head #site-bulk + .updated { margin-left: 0; }
  .search.has-toggle > label.q { flex: 0 1 auto; width: 480px; } /* 폭은 width 로 (flex-basis 만 주면 묶음 폭이 작게 잡혀 상세 검색 버튼이 아랫줄로 떨어짐) */
  /* 펼친 칸은 검색어 줄 아래 옅은 판에 (네 화면 공통 — 폭을 다 쓰는 칸이라 저절로 다음 줄) */
  .search.has-toggle > .filter-fields { margin-top: var(--s1); padding: 14px var(--s2) var(--s2); border-radius: 8px; background: var(--hover); }
  /* 모니터링 · 운영 통계 (PC): 윗줄 [검색어][상세 검색][초기화] 표시 개수 … [현장 추가 · 현장 통합 설정 · 갱신] 은 접든 펴든 같은 줄 —
     검색 묶음(form)의 상자를 없애(display: contents) 그 안의 것들이 붙는 칸(.board-head · .ops-sticky)에 바로 놓이게 함 (2026-11-26).
     간격: 윗줄 버튼끼리는 8, 표시 개수 줄 앞만 24 (8 + 초기화 뒤 16) — 접었을 때의 원래 간격 그대로.
     여백을 표시 개수 줄 쪽에 주면 좁은 화면에서 그 줄이 아랫줄로 내려갈 때 16 만큼 들여 써짐 */
  .board-head, .ops-sticky { column-gap: var(--s1); }
  .board-head > #search, .ops-sticky > #ops-search { display: contents; }
  .board-head > #search > .filter-reset, .ops-sticky > #ops-search > .filter-reset { margin-right: var(--s2); }
  .board-head > #search > .filter-fields, .ops-sticky > #ops-search > .filter-fields { order: 1; margin-top: 0; } /* 줄 사이 간격(16)은 붙는 칸의 것 */
  .stats-panel { margin-bottom: var(--s5); }
  .sites { border: 1px solid var(--border); }

  /* 모니터링 표 한 줄: 두 값은 "앞 / 뒤"로 나란히, 기기 상태 배지는 현장명 옆, 머리글은 칸이 좁을 때만 접힘 */
  .sites th { white-space: normal; word-break: keep-all; } /* 접혀도 낱말 단위로 ("운전모/드" X) */
  .sites th .th-sub, .ops-table th .th-line { white-space: nowrap; } /* "(여과전/여과후)" · "온도 / 습도"는 접혀도 통째로 아랫줄 */
  .sites td.act { padding-top: var(--s1); padding-bottom: var(--s1); } /* 설정 버튼(32) 때문에 줄이 높아지지 않게 */
  .sites td.name { white-space: normal; }
  .sites td.ver { white-space: normal; } /* 버전 "1.4.0 DPLT"는 1840 보다 좁으면 두 줄 (기기번호 / 모델명 칸 자리) */
  /* 현장명 · 기기상태 배지(정상 가동중 등)를 한 글줄로 흘림 — 긴 이름이 접혀도 배지는 이름 끝에 이어 붙어 두 줄로 끝남
     (수위계 · LED 배지는 모델명 칸 아랫줄 — .dev-tags). 점은 첫 줄 앞, 둘째 줄부터는 이름 글자에 맞춰 들여씀 */
  .sites tbody td.name { padding-left: calc(var(--s2) + 22px); text-indent: -22px; word-break: keep-all; } /* 접혀도 낱말 단위로 ("올리/브영" X) */
  .sites td.name * { text-indent: 0; }
  .sites td.name .name-row, .sites td.name .name-row > span:not(.net-dot) { display: inline; }
  .sites td.name .net-dot { display: inline-block; margin: 0 12px 0 0; vertical-align: 1px; }
  .sites td.name .addr { display: inline; margin: 0; }
  .sites td.name .tag { vertical-align: 1px; }
  /* 현장명은 늘 윗줄, 기기상태 배지는 늘 아랫줄에 모아서 — 이름 끝에서 줄을 끊고, 배지는 앞에서부터 6 씩 띄움 */
  .sites td.name .site-link::after { content: '\A'; white-space: pre; }
  .sites td.name .tag { margin: 0 6px 0 0; }
}
/* 운영 통계 표도 한 줄 — 현장명 옆 지역, 여과전 / 여과후, 교체일 옆 D-day. 기기번호·모델명·설치일 칸이 생겨 모니터링처럼 넓은 화면에서만
   (좁으면 두 줄로 쌓아 화면 안에) · 인쇄는 두 줄 그대로 */
@media screen and (min-width: 1840px) {
  .ops-table th .th-line, .ops-table td .line { display: inline; }
  .ops-table th .th-line::before { content: ' '; }
  .ops-table td .h2s-post::before { content: ' / '; color: var(--faint); }
  .ops-table td.name .addr { display: inline; margin: 0 0 0 var(--s1); }
  .ops-table .ad-val .dday-badge { margin-left: var(--s1); }
}
/* 쪽 나눔: 다른 쪽 줄은 접어 둠(.off) — 안 보이지만 칸 폭 계산엔 들어가서, 쪽을 넘기거나 10·20·30개로 바꿔도 칸 폭이 같음 (dom.js offPage) */
.sites tbody tr.off, .ops-table tbody tr.off, .st-list tbody tr.off { visibility: collapse; }
/* 운영 통계: 엑셀로 받을 현장 체크칸 (맨 앞 좁은 칸, 인쇄엔 없음) */
.ops-table th.pick, .ops-table td.pick { width: 48px; padding-right: 0; padding-left: 0; text-align: center; }
.ops-table th.info, .ops-table td.info { white-space: nowrap; } /* 기기번호 · 모델명 · 설치일 */
.ops-table td.name { min-width: 200px; white-space: normal; word-break: keep-all; } /* 긴 현장명은 칸 안에서 낱말 단위로 접힘 (표가 화면을 안 넘게) */
.ops-table .pick input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--on); vertical-align: middle; cursor: pointer; }
@media print { .ops-table .pick { display: none; } }
/* 표 머리글이 붙는 자리: 붙는 줄 높이를 소수점까지 재서(app.js) 딱 그 아래 — 겹치지 않아 붙기 전후 간격이 같음
   표 맨 윗줄은 표와 같이 스크롤돼 사라지므로, 표 윗테두리 대신 머리글 칸 안쪽 줄로 그려 붙어도 남게 */
@media (min-width: 1200px) {
  body.view-list .sites thead th { top: calc(var(--top-h, 76px) + var(--board-h, 160px)); }
  body.view-list .sites, body.view-ops .ops-table, body.view-stats .st-list { border-top-width: 0; }
  body.view-list .sites thead th, body.view-ops .ops-table thead th, body.view-stats .st-list thead th { box-shadow: inset 0 1px 0 var(--border); }
}
/* 두 값 칸(기기번호 / 모델명 · 시리얼 / 원격접속 · 황화수소 · 함내 · 하수관로 온습도)은 넓은 화면에서도 위아래 두 줄 — 현장명 칸 폭을 남김 (폰 카드는 따로) */
@media (min-width: 1840px) {
  .sites th.name { width: auto; } /* 좁은 화면은 현장명 칸 26% (이름이 덜 접히게) */
  .sites td.ver { white-space: nowrap; } /* 넓은 화면은 버전도 한 줄 */
}
@media (min-width: 861px) {
  .sites th.stack { white-space: nowrap; } /* 머리글도 "기기번호 /" · "모델명" 딱 두 줄 */
  .sites th .th-2 { display: block; }
  .sites th .th-sub { display: block; } /* 황화수소 "(여과전/여과후)" · 온습도 "온도 / 습도"도 늘 아랫줄 — 머리글이 칸 폭을 안 붙잡게 */
}
/* 1600 보다 좁은 PC(노트북)는 칸 양옆 12 → 8 — 14칸이라 줄어든 만큼 현장명 칸이 넓어짐 (현장명 왼쪽은 16 그대로) */
@media (min-width: 861px) and (max-width: 1599px) {
  .sites th, .sites td { padding-right: var(--s1); padding-left: var(--s1); }
  .sites th.name, .sites td.name { padding-left: var(--s2); }
}
@media (min-width: 1200px) {
  .brand { top: calc(var(--s3) + 20px); } /* 헤더 윗줄(로고·버튼 40) 가운데 */
}
@media (min-width: 1700px) {
  .map-chips { left: calc(50% - var(--sbw, 0px) / 2); }
}

/* ════════ 폰 (KRDS small: 화면 여백 16, 카드 안 24, 카드 사이 16) ════════ */
@media screen and (max-width: 860px) { /* 폰 화면만 — 인쇄(종이 폭이 860 보다 좁게 잡힘)엔 PC 모양 */
  :root { --card-pad: 24px; }
  main { padding: var(--s2) var(--s2) 100px; }
  .top { padding: 10px 12px 10px var(--s2); }
  .brand h1 { font-size: 17px; }
  .brand-en { display: none; }
  .top-actions, .who { gap: var(--s1); }
  /* 폰 종: 32 동그라미 + 숫자는 모서리에 */
  .top .alert-btn { position: relative; width: 32px; height: 32px; padding: 0; justify-content: center; }
  .top .alert-dot { position: absolute; top: -6px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 13px; line-height: 20px; }
  /* 폰 운영 통계: 카드 대신 간단한 목록 — 줄마다 [체크칸] 현장명 · 지역 (체크해서 보고서·로그 받기 편하게), 수치는 현장을 눌러 상세에서.
     머리글은 "이 쪽 전부 고르기" 체크칸만 */
  .ops-table thead { display: block; }
  .ops-table thead tr { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
  .ops-table thead th { display: none; }
  .ops-table thead th.pick { display: flex; flex: 1; align-items: center; gap: var(--s2); width: auto; padding: 12px var(--s2); }
  .ops-table thead th.pick::after { content: '이 쪽 전부 고르기'; color: var(--text); font-size: 15px; font-weight: 400; }
  .ops-table tbody tr:not(.empty) { display: flex; align-items: center; margin: 0; padding: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
  .ops-table tbody td { display: none; }
  .ops-table tbody td.pick { display: flex; flex: none; align-items: center; justify-content: center; width: 52px; padding: 14px 0; border: 0; }
  .ops-table tbody td.pick::before { content: none; }
  .ops-table tbody td.name { display: block; flex: 1; min-width: 0; margin: 0; padding: 12px var(--s2) 12px 0; border: 0; text-align: left; }
  .ops-table td.name .addr { display: block; margin: 2px 0 0; color: var(--muted); font-size: 13px; }
  .sites tbody tr.off, .ops-table tbody tr.off, .st-list tbody tr.off { display: none; } /* 폰 카드는 칸 폭이 없어 그냥 숨김 */
  .cfg-title { font-size: 19px; } /* 폰 접는 설정 칸 제목 (KRDS 폰 heading-small 19) */
  .cfg-title .cfg-scope { font-size: 13px; }
  #logout { padding-left: var(--s1); font-size: 15px; }
  /* 아래 메뉴 막대: PC 세로 메뉴 위치(top)를 풀고 화면 아래에 가로로, 고른 메뉴는 아래 막대 */
  .nav { top: auto; right: 12px; bottom: 12px; left: 12px; padding: 4px; }
  .nav-item { padding: var(--s1) 4px; font-size: 13px; }
  .nav-item.active { box-shadow: inset 0 -3px 0 var(--sub-strong); }
  .home-card, .np-panel, .cfg-sec .cfg-pad, .chart-panel, .map-panel, .issue-panel, .info-panel, .ad-panel, .stats-panel { padding: var(--s3); }
  .cfg-sec { padding: 0; }
  .search { padding: var(--s3); }
  .home-grid, .cfg-grid, .summary { gap: var(--s2); }
  /* 이슈 개수: 칸 사이 틈 없이 한 줄 5칸 (위 .summary 틈이 표 줄을 끊어서) */
  .issue-counts { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .issue-range { display: block; margin: 4px 0 0; } /* 제목 옆에 자리가 없어 아래 줄로 — 제목과 왼쪽을 맞춤 */
  .issue-counts .tile .label { padding: 8px 2px; font-size: 13px; }
  .issue-counts .tile b { padding: 10px 2px; font-size: 15px; }
  /* 이슈·흡착분해제 표: PC 고정 폭(날짜 140 · 구분 120 · 삭제 90)을 풀어 글자 폭만큼만, 남는 폭은 내용 — 내용·버튼이 세로로 한 글자씩 쌓이지 않게 */
  .issues th:first-child, .issues th:nth-child(2):not(.content), .issues th.author, .issues th.act { width: 1%; }
  .issues th, .issues td { padding: 10px 6px; }
  .issues th, .issues td.date, .issues td.kind, .issues td.act { white-space: nowrap; }
  .issues .content { min-width: 5em; }
  .issues td.act { padding-right: 4px; padding-left: 4px; }
  /* 이슈 히스토리 (폰): 칸 다섯(작성일 · 구분 · 내용 · 작성자 · 수정/삭제)이 한 줄에 안 들어가 내용이 세로로 쌓이고 삭제가 잘림 → 줄마다 카드로.
     윗줄 작성일 | 수정 · 삭제, 둘째 줄 구분 · 고장 유형 | 작성자, 셋째 줄 내용. 흡착분해제 표(칸 넷)는 표 그대로 */
  .issue-panel .issues { border: 0; }
  .issue-panel .issues, .issue-panel .issues tbody { display: block; }
  .issue-panel .issues thead { display: none; }
  .issue-panel .issues tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px var(--s1); padding: 12px 0; border-bottom: 1px solid var(--border); }
  .issue-panel .issues tbody tr td { display: block; min-width: 0; padding: 0; border: 0; text-align: left; }
  .issue-panel .issues tbody tr td.date { grid-area: 1 / 1; font-weight: 700; }
  .issue-panel .issues tbody tr td.act { grid-area: 1 / 2; }
  .issue-panel .issues tbody tr td.kind { grid-area: 2 / 1; overflow: hidden; text-overflow: ellipsis; }
  .issue-panel .issues td.kind .sub { display: inline; margin: 0 0 0 6px; }
  .issue-panel .issues tbody tr td.author { grid-area: 2 / 2; color: var(--muted); font-size: 13px; text-align: right; }
  .issue-panel .issues tbody tr td.content { grid-area: 3 / 1 / auto / -1; }
  .issue-panel .issues tbody tr.empty td { grid-column: 1 / -1; padding: var(--s2) 0; text-align: center; }
  .issue-panel .issues tbody tr.editing { background: var(--hover); } /* 고치는 중인 기록 — 칸마다 따로 칠하면 얼룩져 보여 줄 전체로 */
  .issue-panel .issues tbody tr.editing td { background: none; }
  /* 고장 통계 현장별: 표 대신 간단한 목록 — 줄마다 현장명·지역 | 합계 N건 · 최근 고장일 (종류별 건수는 위 그래프에), 누르면 상세 */
  .ticker, .home-hero { margin-bottom: var(--s2); }
  .home-foot { margin: var(--s5) 0 -100px; padding: var(--s4) 0 calc(100px + var(--s3)); font-size: 15px; } /* 아래 메뉴 막대(100) 밑까지 회색 */
  .foot-info .k { font-size: 15px; }
  .detail-title h2, .np-head h2 { font-size: 24px; }
  .dialog form { padding: var(--s3); }
  .login form { padding: var(--s3); }
  body.view-list .board-head { margin: 0; padding: 0; }
  .btn.map-filter-toggle, .btn.map-list-toggle { display: inline-flex; }
  .btn.map-list-toggle { min-height: 48px; padding: 0 var(--s3); box-shadow: var(--elev-pop); }
  /* 폰 지도: 검색 판은 한 줄(입력칸+지역)로 얇게, 상태 칸 4개가 한 줄에 */
  .map-search { gap: var(--s1); padding: var(--s1); }
  .map-chips { padding: 4px 6px; }
  /* 폰 모니터링 = 간단한 현장 카드 4줄 — 전압·전류·에어펌프·하수관로·버전·설정은 상세에서
     1줄 현장명 | 운전모드 · 2줄 시리얼 · 원격 · 3줄 황화수소 | 송풍기 · 4줄 함내 온도 / 습도 */
  .sites tbody tr:not(.empty) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px var(--s2);
    margin-bottom: var(--s2); padding: var(--s2) var(--s3); background: var(--bg);
  }
  .sites tbody tr:not(.empty) td { display: none; padding: 0; border: 0; font-size: 15px; text-align: left; }
  .sites tbody tr:not(.empty) td::before { content: none; }
  .sites tbody tr:not(.empty) td.name { display: block; grid-column: 1; grid-row: 1; margin: 0; padding: 0; border: 0; font-size: 17px; }
  .sites tbody tr:not(.empty) td[data-label="운전모드"] { display: block; grid-column: 2; grid-row: 1; align-self: start; }
  .sites tbody tr:not(.empty) td.serial { display: block; grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: 13px; }
  .sites tbody tr:not(.empty) td.serial .line { display: inline; margin-left: var(--s1); }
  .sites tbody tr:not(.empty) td[data-label^="황화수소"],
  .sites tbody tr:not(.empty) td[data-label="함내온도 / 함내습도"] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; grid-column: 1; grid-row: 3; }
  .sites tbody tr:not(.empty) td[data-label="함내온도 / 함내습도"] { grid-column: 1 / -1; grid-row: 4; }
  .sites tbody tr:not(.empty) td[data-label^="황화수소"]::before { content: '황화수소'; margin-right: 4px; color: var(--muted); font-size: 13px; }
  .sites tbody tr:not(.empty) td[data-label="함내온도 / 함내습도"]::before { content: '함내'; margin-right: 4px; color: var(--muted); font-size: 13px; }
  .sites tbody tr:not(.empty) td .line { grid-column: auto; }
  .sites tbody tr:not(.empty) td .h2s-post::before, .sites tbody tr:not(.empty) td[data-label="함내온도 / 함내습도"] .line::before { content: '/ '; color: var(--faint); }
  .sites tbody tr:not(.empty) td[data-label="송풍기 동작상태"] { display: block; grid-column: 2; grid-row: 3; text-align: right; }
  .sites tbody tr:hover td { background: none; }
  .table-panel { border: 0; background: none; } /* 카드를 감싸는 판 테두리 없이 (카드 안 카드로 안 보이게) */
  /* 폰 검색 칸 (접기 규칙은 위 공통): 펼친 지역·상태 칸은 두 칸씩 */
  /* 상세 검색 칸 (폰): 전과 같이 두 칸씩 이어서 — 묶음 틀은 없는 셈 치고(display: contents) 칸만 놓음
     (묶음마다 줄을 바꾸면 홀수 칸 줄이 늘어 폰에서는 펼친 높이가 길어짐) */
  .filter-fields { gap: var(--s1); }
  .filter-group, .filter-row { display: contents; }
  .filter-row > label, .filter-row > label.short { flex: 1 1 calc(50% - var(--s1)); width: auto; min-width: 0; }
  .map-chip { padding: 6px 4px; font-size: 13px; }
  .np-panel .np-table td.author, .np-panel .np-table td.date, .np-panel .al-table td.dur { font-size: 15px; }
  .np-table td.no, .al-table td.dur { width: auto; text-align: left; }
  /* 폰 공지·알람 = 줄마다 카드 (칸 여백·밑줄 없이 한 덩어리) */
  .np-table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .np-table td { padding: 2px 0; border: 0; }
  .np-table tr.pinned td { background: none; } /* 폰은 칸이 글줄이라 바탕이 조각나 보임 — 고정 표시는 "공지" 태그로 */
  .al-table td.dur { white-space: nowrap; }
  #stats-msg:empty, #ops-msg:empty, #np-msg:empty, #al-msg:empty { min-height: 0; }
  /* 폰: 공지사항은 헤더 글자 링크라 아래 막대엔 없음 */
  .nav .nav-notices { display: none; }
  .page-head { margin-bottom: var(--s2); padding: var(--s1) 0 var(--s2); }
  .page-head h2 { font-size: 24px; }
}

/* ════════ 인쇄 · PDF (운영 통계 상세의 "기간별 보고서") — 결과만 깔끔하게
   A4 세로(종이 폭 ≈718px, 기존 보고서 양식과 같은 크기) — 폰 규칙은 screen 으로 묶여 있어 PC 표 모양 그대로. 검색칸·버튼·입력칸은 빼고,
   그래프·지도는 opsReport.js 가 인쇄 직전 종이 크기에 맞춰 다시 그림, 범례는 색 표시만 ════════ */
@page { size: A4 portrait; margin: 10mm; }
@media print {
  /* 다크 모드에서 눌러도 흰 종이에 */
  :root, :root[data-theme="dark"] {
    --page: #fff; --bg: #fff; --text: #1e2124; --muted: #464c53; --faint: #6d7882; --line: #e6e8ea; --border: #cdd1d5; --border-strong: #b1b8be;
    --hover: #f4f5f6; --sub-soft: #eef2f7; --sub-line: #d6e0eb; --sub-strong: #063a74; --sub-text: #052b57;
  }
  body { font-size: 13px; }
  /* 화면에서만 쓰는 것 */
  .page-head, .ops-sticky, .msg:empty, .btn, .ctl-box, .ops-table .pick, body:not(.view-ops-detail) .map-panel, .issue-form, .ad-form,
  .issues th.act, .issues td.act, .photo-del, .u-legend .u-value, .u-legend .u-series:first-child { display: none !important; }
  /* 붙는 줄·판 여백 풀기 (main 여백이 0 이라 음수 여백이면 종이 밖으로 나감) */
  .detail-head, body.view-detail .detail-head { position: static !important; margin: 0 0 12px !important; padding: 0 !important; border: 0 !important; background: none !important; }
  .stats-panel, .np-panel { padding: 0 !important; border: 0 !important; }
  /* 오른쪽 테두리가 잘리던 것: 크롬은 종이 안쪽 폭(A4 − 여백 = 718.1px)을 719px 로 올려 배치하고 718.1px 에서 잘라서
     맨 오른쪽 1px(표·그래프 칸의 세로 테두리)이 종이 밖으로 나감 — 오른쪽을 1px 들여 둠 */
  main { padding-right: 1px !important; }
  .panel, .tile { border-color: var(--border) !important; }
  .ops-head { margin-bottom: 12px; }
  .ops-head h3 { font-size: 19px; }
  /* 운영 통계 상세: 요약 5칸 한 줄, 그래프 둘씩 나란히, 칸·그래프·표 줄이 장 사이에서 안 잘리게 */
  .or-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
  .or-tiles .tile { padding: 12px 16px; }
  .or-tiles .tile b { font-size: 15px; }
  .or-chart-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .or-chart-panel { position: relative; margin-bottom: 8px; padding: 8px 12px; overflow: hidden; }
  .or-chart-panel h3, .or-table-panel h3 { margin-bottom: 4px; font-size: 14px; }
  .or-chart { min-height: 0; }
  /* 그래프는 인쇄 직전 종이 폭으로 다시 그리지만(opsReport.js), 용지·여백이 달라 칸이 더 좁으면 잘리지 않고 칸 폭에 맞춰 줄어듦 */
  .or-chart .uplot, .or-chart .u-wrap { width: 100% !important; height: auto !important; }
  .or-chart canvas { display: block; width: 100% !important; height: auto !important; }
  .or-chart .u-over, .or-chart .u-under { display: none; }
  /* 범례는 그래프 위 제목 바로 아래 한 줄 (세로 종이의 반 칸은 제목 옆에 둘 자리가 없어서) */
  .or-chart .uplot { display: flex; flex-direction: column; }
  .or-chart .u-legend { order: -1; width: auto; margin: 0 0 4px; font-size: 11px; text-align: left; }
  .or-chart-panel, .tile, .ad-summary, .issue-counts, .info-table tr, .issues tr, .or-table tr { break-inside: avoid; }
  .panel h3 { break-after: avoid; } /* 제목만 장 끝에 남지 않게 */
  .or-table-panel { margin-top: 8px; }
  body.view-ops-detail #ops-report { margin-bottom: 0; }
  /* 장 나눔: 1쪽 = 머리·제품 정보·지도|사진·요약·조회기간 그래프, 2쪽 = 월간·연간·요일별·시간대별 → 날짜별 표 → 흡착분해제 → 이슈 히스토리
     (그래프·지도 크기는 opsReport.js PRINT_SIZE · MAP_PRINT_SIZE 가 쪽을 채우게) */
  .or-chart-panel:has(#or-chart-range) { break-after: page; }
  #ops-report .or-table th, #ops-report .or-table td { padding: 4px 10px; }
  /* 흡착분해제·이슈 히스토리: 판 테두리·안쪽 여백 없이 바로 이어서 */
  .ad-panel, .issue-panel { margin-top: 12px; padding: 0; border: 0; box-shadow: none; }
  .ad-panel h3, .issue-panel h3 { margin-bottom: 6px; font-size: 15px; }
  .ad-panel .ad-head { margin-bottom: 6px; }
  .issue-counts .tile .label, .ad-summary .label { padding: 5px 8px; font-size: 13px; }
  .issue-counts .tile b { padding: 6px 8px; font-size: 15px; }
  .ad-summary { margin-bottom: 8px; }
  .ad-summary > div > :not(.label) { margin: 6px 8px; }
  .ad-summary b { font-size: 15px; }
  .issue-counts { margin-bottom: 8px; }
  /* 기본 스타일의 폰 규칙(종이 폭 기준으로 걸림)을 PC 모양으로 되돌림: 제품 정보 4칸 표, 이슈 개수 5칸, 흡착분해제 요약 4칸 */
  .info-table { display: table; }
  .info-table tbody { display: table-row-group; }
  .info-table tr { display: table-row; }
  .info-table th, .info-table td { display: table-cell; padding: 6px 10px; font-size: 13px; }
  .info-table th { width: 15%; }
  .issue-counts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ad-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .issues th, .issues td { padding: 5px 10px; font-size: 13px; }
  /* 이슈 히스토리는 쪽 나눔 없이 조회기간의 기록 전부 (화면은 10개씩) */
  .issue-panel .issues tbody tr.off { display: table-row; }
  .issue-range { font-size: 13px; }
  /* 기간별 보고서 (운영 통계 상세 인쇄): 맨 위 "기간별 보고서" · 조회기간 → 제품 정보 표 → 요약 표 → 그래프 · 날짜별 표 → 흡착분해제 → 이슈 히스토리
     현장 이름 줄·조회기간 버튼 줄·요약 칸 대신 위 머리와 표 (순서는 화면 규칙 order 그대로) */
  body.view-ops-detail .detail-head, body.view-ops-detail #ops-report .ops-head, body.view-ops-detail .or-tiles,
  body.view-ops-detail .info-panel h3, .info-table .no-print { display: none !important; }
  body.view-ops-detail .report-head {
    order: -5; display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--text);
  }
  .report-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
  .report-head span { font-size: 13px; }
  body.view-ops-detail .info-panel { margin: 0 0 8px; padding: 0; border: 0; box-shadow: none; }
  /* 지도 | 사진 반반 — 제품 정보 바로 아래 (지도 칸 크기는 인쇄 직전 opsReport.js 가 종이 크기로 고정) */
  body.view-ops-detail .info-panel { order: -4; }
  body.view-ops-detail #ops-report { order: -2; }
  body.view-ops-detail .map-panel { order: -3; margin: 0 0 8px; padding: 0; border: 0; box-shadow: none; break-inside: avoid; }
  body.view-ops-detail .loc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.view-ops-detail .loc-head { min-height: 0; margin-bottom: 4px; }
  body.view-ops-detail .loc-head h3 { margin: 0; font-size: 14px; }
  body.view-ops-detail .site-map, body.view-ops-detail .photo-box { max-width: 100%; height: 250px; border: 1px solid var(--border); box-shadow: none; }
  body.view-ops-detail .report-sum { display: table; width: 100%; margin-bottom: 8px; border-collapse: collapse; break-inside: avoid; }
  .report-sum th, .report-sum td { padding: 5px 10px; border: 1px solid var(--border); text-align: center; vertical-align: middle; }
  .report-sum th { background: var(--sub-soft); color: var(--text); font-size: 13px; font-weight: 700; }
  .report-sum th .sub { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
  .report-sum td { font-size: 14px; }
  .report-sum .tile-line { display: block; }
}

/* ════════ 간격 KRDS 정리 (2026-11-09) — 여백·칸 사이는 0·4·8·12·16·24·32·40·64 단계만
   화면마다 어긋난 값을 검사해서 찾은 것 (옛 style·home·config.css 의 6·10·14·18·30 등). 인쇄(기간별 보고서)는 그대로라 화면에만 ════════ */
@media screen {
  .brand { gap: var(--s1); }
  .theme-toggle { padding-right: var(--s1); padding-left: var(--s1); }
  .alert-dot { padding: 0 4px; }
  .home-head .right { gap: var(--s1); }
  .mini-search input { padding: 0 12px; }
  .mini-chips span { gap: var(--s1); }
  .dday-badge { padding: 4px var(--s1); }
  .btn.mini { padding: 0 12px; }
  .tag, .tag-pin, .np-title .tag-new, .notice-row .tag-new { padding: 0 var(--s1); }
  input[type="checkbox"], input[type="radio"] { margin: 0; }
  .sites td.name .addr { margin-top: 4px; }
  .tile b.time, .detail-tiles .tile b.time { padding-top: var(--s1); }
  .legend button { gap: var(--s1); }
  .map-list-head { gap: var(--s1); }
  .issue-counts .tile .label, .ad-summary .label { padding: var(--s1) var(--s2); }
  .issue-counts .tile b { padding: 12px var(--s2); }
  .cfg-sync, .cfg-title { gap: 4px var(--s1); }
  .g-track { margin-top: var(--s4); }
  .cfg-step { padding: 0; }
  .tl-scale, .cal-preview { margin-top: var(--s1); }
  .cfg-hours { padding-bottom: var(--s1); }
  .cfg-num input, .cfg-range input[inputmode], .cfg-num.dt input.date { padding: 0 var(--s1); }
  .date-range { padding-right: var(--s5); background-position: right 12px center; } /* 달력 아이콘 자리 40 */
}
@media screen and (max-width: 860px) {
  .top { gap: var(--s1); padding: var(--s1) 12px var(--s1) var(--s2); }
  .brand { gap: var(--s1); }
  .top .alert-dot { padding: 0 4px; }
  main { padding-bottom: 96px; } /* 아래 메뉴 탭(64 + 아이폰 홈 막대) 밑으로 내용이 숨지 않게 */
  .home-foot { margin-bottom: -96px; padding-bottom: calc(96px + var(--s3)); }
  .ops-table tbody td.pick { padding: 12px 0; }
  .issue-counts .tile .label { padding: var(--s1) 2px; }
  .issue-counts .tile b { padding: var(--s1) 2px; }
  .issues th, .issues td { padding: 12px 4px; }
  .np-table td.author, .np-table td.date { margin-right: var(--s1); }
  body.view-detail .detail-head, body.view-config .detail-head { gap: var(--s2); margin-bottom: var(--s2); }
  .cfg-sec h3 { gap: var(--s1); padding: var(--s2); }
  #site-config .detail-head { gap: var(--s1) 12px; margin-bottom: var(--s2); }
  .cfg-row, .cfg-row:has(.cfg-num) { gap: var(--s1); }
  .cfg-range .dur { padding-left: var(--s3); }
}

/* 틀고정 (고장 통계 현장별 고장 표 머리글) — 머리글이 붙으려면 표 칸이 가로 스크롤 칸이면 안 돼서, 표가 한 화면에 들어가는 넓이(1200~)에서만 */
@media screen and (min-width: 1200px) {
  body.view-stats .stats-panel:has(.st-list) .stats-scroll { overflow: visible; }
  body.view-stats .st-list thead th { position: sticky; top: calc(var(--top-h, 76px) + var(--st-h, 88px)); z-index: 2; }
}
/* 운영 통계 표 머리글은 붙는 조회기간 줄(--oh-h) 아래 */
@media screen and (min-width: 1200px) {
  body.view-ops .ops-table thead th { top: calc(var(--top-h, 76px) + var(--ops-h, 130px) + var(--oh-h, 64px)); }
}
/* 운영 통계 넓은 화면(1610~): 조회기간 · 로그 다운로드 줄을 검색 줄 첫 줄 오른쪽 빈자리로 올려 한 줄로 (좁으면 자리가 모자라 두 줄 그대로)
   묶음이 달라 위치만 옮김 — 위로 (검색 줄 높이 - 24) 만큼 올리고, 아래는 그만큼 다시 채워 표 자리는 검색 줄 바로 아래 */
@media screen and (min-width: 1610px) { /* 1610 아래면 표시 개수와 24 보다 가까워짐 */
  body.view-ops .top { z-index: 21; } /* 아래 조회기간 줄(20)보다 위 — 종 알림 창이 조회기간 밑에 깔리지 않게 */
  body.view-ops .ops-panel > .ops-head {
    top: calc(var(--top-h, 76px) + var(--s3)); z-index: 20; width: fit-content;
    margin: calc(var(--s3) - var(--ops-h, 80px)) 0 calc(var(--ops-h, 80px) - var(--s3) - var(--oh-h, 40px)) auto; padding-bottom: 0; background: none;
  }
  body.view-ops .ops-table thead th { top: calc(var(--top-h, 76px) + var(--ops-h, 130px)); }
}
/* 모니터링 기기번호 · 모델명: 좁은 화면은 한 칸에 두 줄(dev-combo), 넓은 화면(1840~)은 두 칸(dev-split) — 표 칸은 숨기면 통째로 빠짐 */
.sites .dev-split { display: none; }
@media screen and (min-width: 1840px) {
  .sites .dev-combo { display: none; }
  .sites th.dev-split, .sites td.dev-split { display: table-cell; white-space: nowrap; }
}
/* 수위계 · LED 배지 — 모델명 아랫줄 (dev-combo 는 기기번호 / 모델명 밑 셋째 줄). 폰 카드는 둘째 줄 끝 (mobile.css .m-sub) */
/* 전류값 이상이 떠 있는 현장의 전류 값 — 빨강 · 깜빡임 (app.js renderRow). 고장 기록 끝의 그때 전류값(.alarm-value, dom.js fillIssueContent)도 빨강 */
.amp-alarm, .alarm-value { color: var(--bad); font-weight: 700; }
.amp-alarm { animation: amp-blink 1s ease-in-out infinite; }
@keyframes amp-blink { 50% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) { .amp-alarm { animation: none; } }
/* 센서 통신 실패 — 여과전: 프로그램이 못 읽는다고 알려 옴 (dom.js frontPart) · 여과후: 값을 보내던 현장인데 지금 안 옴 (rearPart). 원래 없는 현장의 흐린 '미적용'과 구분해 빨강 */
.h2s-pre.sensor-fail, .h2s-post.sensor-fail { color: var(--bad); font-weight: 700; }
.sites td .dev-tags { display: block; margin-top: 4px; }
.sites td .dev-tags .tag { margin: 0; vertical-align: top; }
.sites td .dev-tags .tag + .tag { margin-left: 4px; }

/* ════════ 권한 — 관리자가 아니면 관리자 버튼(.admin-only)을 안 보여 줌 (body.is-admin 은 session.js) · 실제로 막는 건 DB 권한 · 구독기 ════════ */
body:not(.is-admin) .admin-only { display: none !important; }
body:not(.is-own) .own-only { display: none !important; } /* 가람 계정만 (내 정보 수정) */
body.is-guest .no-guest { display: none !important; } /* 게스트는 이슈 · 교체 기록 쓰기, 사진 올리기, 현장 추가 · 정보 수정 · 원격 설정, PC 접속이 없음 (관리자 · A/S 요원만) */

/* ════════ 확인 창 (okDialog.js) — "저장했습니다" 를 화면 가운데 작은 창으로, "확인"을 누르면 닫힘 ════════ */
.dialog.ok-dialog { width: min(380px, calc(100vw - 32px)); padding: var(--s5) var(--s4) var(--s4); text-align: center; }
.ok-dialog p { margin: 0 0 var(--s4); font-size: 18px; font-weight: 700; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.ok-dialog .btn { min-width: 140px; }

/* ════════ 비밀번호 칸의 눈 버튼 (passwordEye.js) — 누르면 입력한 글자를 보이게/가리게. 칸 오른쪽 안에 얹음 ════════ */
.pw-box { position: relative; display: block; }
.pw-box input { width: 100%; padding-right: 44px; }
.pw-box input::-ms-reveal { display: none; } /* 엣지가 따로 띄우는 눈 버튼은 숨김 (두 개가 겹침) */
.pw-eye { position: absolute; top: 50%; right: 4px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--muted); cursor: pointer; transform: translateY(-50%); }
.pw-eye:hover { background: var(--hover); color: var(--text); }
.pw-eye:focus-visible { outline: 2px solid var(--on); outline-offset: 0; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-eye .eye-off, .pw-eye[aria-pressed="true"] .eye-on { display: none; }
.pw-eye[aria-pressed="true"] .eye-off { display: block; }

/* 헤더 "~ 님": 가람 계정은 누르면 내 정보 (#/me) */
#who { text-decoration: none; }
#who[href] { cursor: pointer; }
#who[href]:hover { color: var(--on); text-decoration: underline; text-underline-offset: 4px; }

/* 내 정보 (mypage.js) — 제품 정보 표 모양에 입력 칸 */
#me-view { max-width: none; margin: 0; padding-top: var(--s2); } /* 공지·알람처럼 다른 메뉴와 같은 폭 — 왼쪽 시작선을 맞춤 */
/* 마이페이지 — KRDS 사이드 메뉴 + 본문 (공지사항처럼 테두리 상자 없이): 메뉴 제목 아래 굵은 선, 메뉴 사이 얇은 선, 고른 메뉴는 연한 바탕 · 굵게 · 왼쪽 막대 */
.mp-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 240px; gap: var(--s8); align-items: start; } /* 왼쪽 메뉴는 다른 메뉴와 같은 시작선, 오른쪽에 같은 폭 빈 칸을 둬서 내용(회원정보 수정)이 화면 가운데에 800 까지 */
.mp-layout > .me-panel { justify-self: center; width: 100%; max-width: 800px; }
.mp-side-title { margin: 0; padding: 0 0 var(--s2); border-bottom: 2px solid var(--text); font-size: 24px; font-weight: 700; }
.mp-menu a { display: block; padding: var(--s2); border-bottom: 1px solid var(--border); color: var(--text); font-size: 17px; text-decoration: none; }
.mp-menu a:hover { background: var(--hover); }
.mp-menu a:focus-visible { outline: 2px solid var(--on); outline-offset: -2px; }
.mp-menu a.active { box-shadow: inset 4px 0 0 var(--sub-strong); background: var(--sub-soft); color: var(--sub-text); font-weight: 700; }
:root[data-theme="dark"] .mp-menu a.active { background: #2c3036; color: var(--text); }
@media (max-width: 1280px) { .mp-layout { grid-template-columns: 240px minmax(0, 1fr); } } /* 좁은 PC 는 오른쪽 빈 칸 없이 */
@media (max-width: 860px) { .mp-layout { grid-template-columns: 1fr; gap: var(--s3); } }
.me-title { margin: 0 0 var(--s3); padding-bottom: var(--s2); border-bottom: 2px solid var(--text); font-size: 24px; font-weight: 700; }
.me-info th { width: 170px; }
.me-info th label { font: inherit; color: inherit; }
.me-info td input { width: 100%; }
.me-info td { overflow-wrap: anywhere; } /* 긴 이메일이 칸 밖으로 안 나가게 */
#me-regions { white-space: pre-line; }   /* 담당 지역은 한 줄에 하나씩 (mypage.js 가 줄바꿈으로 이음) */
.me-actions { display: flex; justify-content: flex-end; gap: var(--s1); margin-top: var(--s3); }
.me-guide { margin: 0 0 var(--s2); color: var(--muted); font-size: 15px; } /* 비밀번호 재확인 안내 */

/* 계정 관리 이메일 · 전화번호 칸 */
.us-table td.email { overflow-wrap: anywhere; }
.us-table td.role .sub { display: block; color: var(--muted); font-size: 13px; } /* 게스트 담당 지역 요약 */
/* 계정 창 — 게스트 담당 지역: 고르는 줄 하나(시/도 · 시/군 · 구 · 추가, 폰은 두 줄) + 넣은 지역 목록(.ne-files 모양, 줄마다 ×) */
.us-region-box:not([hidden]) { display: flex; flex-direction: column; gap: var(--s1); }
.us-region { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: center; gap: 6px; }
.us-region select { width: 100%; min-width: 0; }
.us-region .btn, #us-reset { min-height: 40px; padding: 0 var(--s2); font-size: 15px; } /* 창 안 작은 버튼은 입력 칸 높이에 맞춤 */
.us-region-list { margin: 0; }
.us-region-list li { font-size: 15px; }
@media (max-width: 860px) { .us-region { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ════════ 입력 창 정식 양식 (계정 추가) — 제목 줄 · 항목 표 · 아래 버튼 줄을 나눔, 필수 항목은 * ════════ */
.dialog.form-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden; }
.dialog.form-dialog.notice-dialog { width: min(1000px, calc(100vw - 32px)); } /* 공지 쓰기는 넓게 */
.dialog.form-dialog form { gap: 0; max-height: calc(100vh - 32px); padding: 0; } /* 제목 줄 · 버튼 줄은 그대로, 가운데만 스크롤 */
.fd-head { padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid var(--border); }
.fd-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.fd-sub { margin: var(--s1) 0 0; color: var(--muted); font-size: 15px; word-break: keep-all; }
.fd-head, .fd-foot { flex: none; }
.fd-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; min-height: 0; padding: var(--s3) var(--s4); overflow-y: auto; }
.fd-sec { margin: var(--s1) 0 0; font-size: 16px; font-weight: 700; }
.fd-sec:first-child { margin-top: 0; }
.fd-table th { width: 130px; }
.fd-table th label { display: inline; color: inherit; font-size: inherit; font-weight: inherit; }
.fd-table td input:not([type="checkbox"]), .fd-table td select, .fd-table td textarea { width: 100%; }
.fd-table tr:has(textarea) th { padding-top: var(--s2); vertical-align: top; }
.fd-table td .hint, .fd-table td .fd-note { margin: 6px 0 0; }
.req { margin-left: 2px; color: var(--bad); }
.fd-note { margin: 0; color: var(--muted); font-size: 14px; }
.fd-body .msg:empty { display: none; }
.fd-foot { margin: 0; padding: var(--s2) var(--s4); border-top: 1px solid var(--border); background: var(--sub-soft); }
@media (max-width: 860px) { .fd-head, .fd-body, .fd-foot { padding-right: var(--s3); padding-left: var(--s3); } }
/* 폰: 정보 표(상세 제품 정보 · 정보 수정 창)는 줄마다 [항목 | 값] 격자로 바뀜 (home.css). 표가 아니라서 칸 테두리가 안 합쳐져 두 줄로 보였음 →
   칸은 아래 선과 항목 칸 오른쪽 선만 긋고 바깥 테두리는 표가 그림. 정보 수정 창은 항목 칸 폭(PC 130)이 격자 칸(110)보다 넓어 값 칸을 덮었음.
   구성 스위치는 값 칸이 좁아 글자가 접혀서 한 줄에 하나씩 */
@media screen and (max-width: 860px) {
  .info-table { border-bottom: 0; }
  .info-table tr { border-bottom: 0; }
  .info-table th, .info-table td { border-width: 0 0 1px; }
  .info-table th { border-right-width: 1px; }
  .fd-table th, .me-info th { width: auto; } /* 마이페이지 표도 같은 문제였음 (항목 칸 170 이 격자 칸 110 을 넘어 값을 덮음) */
  /* 마이페이지 표: 항목 이름 · 값을 줄 가운데에 맞춤 (입력 칸 옆 항목 이름이 위로 붙어 보였음), 줄 높이는 손가락으로 누르기 좋은 48 이상 */
  .me-info th, .me-info td { display: grid; align-content: center; min-height: 48px; padding: var(--s1) 12px; }
  .fd-table .switch-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
}
/* 선명한 화면(다크): 창 바탕 · 항목 이름 칸 · 버튼 줄이 같은 색이라 한 단씩 다르게 — 항목 칸은 밝게, 버튼 줄은 어둡게 */
:root[data-theme="dark"] .form-dialog .fd-table th { background: #2c3036; }
:root[data-theme="dark"] .form-dialog .fd-table th, :root[data-theme="dark"] .form-dialog .fd-table td { border-color: #3a3f46; }
:root[data-theme="dark"] .form-dialog .fd-table { border-color: #3a3f46; }
:root[data-theme="dark"] .form-dialog .fd-head { border-bottom-color: #3a3f46; }
:root[data-theme="dark"] .form-dialog .fd-foot { border-top-color: #3a3f46; background: #15171a; }

/* 이슈 통계 탭 (고장 · 점검, stats.js) — KRDS 탭: 밑줄 위에 글자, 고른 탭은 진한 밑줄 · 굵게 */
.st-tabs { display: flex; gap: var(--s1); margin-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.st-tab { margin-bottom: -1px; padding: 12px var(--s3); border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; }
.st-tab:hover { color: var(--text); }
.st-tab.active { border-bottom-color: var(--sub-strong); color: var(--text); font-weight: 700; }
.st-tab:focus-visible { outline: 2px solid var(--on); outline-offset: -2px; }
:root[data-theme="dark"] .st-tab.active { border-bottom-color: var(--sub-strong); }

/* ════════ 이슈 통계 (stats.js) — 누르면 좁히기(표 줄 · 범례 · 도넛) · 좁혀 보기 칩 · 현장 기록 창 ════════ */
.stats-table tr.pick { cursor: pointer; }
.stats-table tr.pick:hover th, .stats-table tr.pick:hover td { background: var(--hover); }
.stats-legend .legend-pick { display: flex; align-items: center; gap: 2px; padding: 2px 4px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
.stats-legend .legend-pick:hover, .stats-legend li.focus .legend-pick { background: var(--sub-soft); }
.stats-legend .legend-pick:focus-visible { outline: 2px solid var(--on); outline-offset: 1px; }
.stats-panel svg .seg, .stats-panel svg .ring { cursor: pointer; }
.st-focus { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); margin: 0 0 var(--s2); }
.st-focus .label { color: var(--muted); font-size: 15px; font-weight: 700; }
/* 이슈 통계: 월별이면 칸이 많아 그래프 · 표를 위아래 한 줄씩 (그래프 먼저), 그래프는 막대 옆에 도넛 */
#stats-view .stats-row { grid-template-columns: minmax(0, 1fr); }
#stats-view .stats-row > .stats-chart-panel { order: -1; }
@media (min-width: 861px) {
  #stats-view .stats-charts { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

/* ════════ 계정 관리 (users.js · accessLog.js) — 탭(계정 · 접속기록) + 검색 줄을 위에 고정, 표 머리글도 그 아래 고정 ════════ */
.us-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); }
#us-bar-accounts .np-search { margin: 0; }
#us-bar-accounts #us-open { margin-left: auto; }
.ul-search #ul-q { width: 260px; max-width: 100%; }
.ul-search select { width: 140px; }
.ul-search .ops-dates { margin: 0 0 0 auto; } /* 조회기간은 검색 줄 오른쪽 끝 */
.ul-search input[type="date"] { width: 160px; }
.ul-table th.name, .ul-table td.name { width: 20%; }
.ul-table th.uid, .ul-table td.uid { width: 18%; }
.ul-table th.date, .ul-table td.date { width: 22%; white-space: nowrap; }
.ul-table th.kind, .ul-table td.kind { width: 14%; }
.ul-table th .sort, .us-table th .sort { justify-content: center; }
.ul-table th.sorted { color: var(--text); }
#users-view .us-panel { margin-top: var(--s2); }
@media (min-width: 861px) {
  body.view-users .top { position: sticky; top: 0; z-index: 20; background: var(--bg); } /* 헤더도 붙어야 아래 탭 · 검색 줄 · 표 머리글이 그 밑에 이어 붙음 */
  body.view-users .us-sticky { position: sticky; top: var(--top-h, 76px); z-index: 19; margin: calc(var(--s3) * -1) calc(var(--s5) * -1) 0; padding: var(--s5) var(--s5) var(--s3); background: var(--page); }
  body.view-users .us-table thead th, body.view-users .ul-table thead th { position: sticky; top: calc(var(--top-h, 76px) + var(--us-h, 120px)); z-index: 2; }
  #users-view .us-panel { margin-top: 0; }
  /* 안쪽 탭(고장 · 점검, 계정 · 접속기록)은 고른 메뉴 탭 바로 아래 한 줄에 — 메뉴 탭 폭만큼 가운데 맞춤, 줄은 화면 끝까지
     (자리 = subTabs.js 가 넘기는 --sub-c 가운데 · --sub-w 폭). 폰은 메뉴가 아래라 화면 안 제자리 그대로 */
  body.view-stats .st-sticky, body.view-users .us-sticky { padding-top: 0; }
  body.view-stats .st-sticky::before, body.view-users .us-sticky::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 44px; border-bottom: 1px solid var(--border); pointer-events: none; }
  .st-tabs { position: relative; gap: 0; width: max-content; min-width: var(--sub-w, 0px); height: 44px; margin: 0 0 var(--s3) var(--sub-c, 50%); border-bottom: 0; transform: translateX(-50%); }
  .st-tab { flex: 1 1 auto; margin: 0; padding: 0 var(--s1); font-size: 16px; white-space: nowrap; }
}
@media (max-width: 860px) {
  .ul-search #ul-q, .ul-search select { flex: 1 1 45%; width: auto; }
  .ul-search .ops-dates { margin: 0; }
  .ul-search input[type="date"] { flex: 1 1 0; width: auto; min-width: 0; }
}

/* ════════ 이슈 통계 기록 목록 (stats.js renderList) — 알람 이력처럼 한 줄씩, 현장명은 상세 이슈 히스토리로 ════════ */
.stats-table tr.focus th, .stats-table tr.focus td { background: var(--sub-soft); }
.st-list th .sort { justify-content: center; }
.st-list th.sorted { color: var(--text); }
.st-list th.date, .st-list td.date { width: 160px; white-space: nowrap; } /* 날짜 + 시각 */
.st-list th.dev, .st-list td.dev { width: 90px; }
.st-list th.model, .st-list td.model { width: 120px; }
.st-list th.type, .st-list td.type { width: 140px; white-space: nowrap; }
.st-list th.author, .st-list td.author { width: 110px; }
.st-list td.type .sw { margin-right: 6px; }
.st-list th.name, .st-list td.name, .st-list th.content, .st-list td.content { text-align: left; }
.st-list th.name .sort, .st-list th.content .sort { justify-content: flex-start; }
.st-list td.name { white-space: nowrap; } /* 현장은 한 줄 (지역 줄 없음) */
.st-list td.content { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; } /* 내용이 길면 줄을 내려 표가 옆으로 넘치지 않게 (표 칸은 기본 한 줄) */
@media (max-width: 860px) {
  .st-list, .st-list tbody { display: block; }
  .st-list thead { display: none; }
  .st-list tbody tr:not(.empty) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--s2); padding: 12px 0; border-bottom: 1px solid var(--border); }
  .st-list tbody tr:not(.empty) td { display: none; padding: 0; border: 0; text-align: left; }
  .st-list tbody tr:not(.empty) td.name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; } /* 긴 현장명은 … 으로 줄임 — 그대로 두면 오른쪽 날짜와 겹침 */
  .st-list tbody tr:not(.empty) td.date { display: block; grid-column: 2; grid-row: 1; width: auto; color: var(--muted); font-size: 13px; text-align: right; } /* 폭은 글자만큼 — 표 칸 폭(160)을 그대로 두면 현장명 자리가 좁아짐 */
  .st-list tbody tr:not(.empty) td.type, .st-list tbody tr:not(.empty) td.content { display: block; grid-column: 1 / -1; }
  .st-list tbody tr:not(.empty) td.content { color: var(--muted); }
}
/* 이슈 통계에서 현장명으로 넘어오면 이슈 히스토리로 내려감 (issues.js revealIssues) — 위에 붙는 헤더 · 현장 이름 줄에 안 가리게 */
.issue-panel { scroll-margin-top: calc(var(--top-h, 76px) + 96px); }

/* ════════ 고객 지원 (notices.js) — 하위 탭 공지사항 · 게시판 · Q&A, 게시판 · Q&A 글 아래 댓글(답변) ════════ */
a.st-tab { display: flex; align-items: center; justify-content: center; text-decoration: none; } /* 하위 탭이 링크(#/notices · #/board · #/qna) */
/* Q&A 목록 제목 앞 답변 여부 — 답변완료 남색 채움, 답변대기 테두리만 */
.qa-state { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 4px; font-size: 13px; font-weight: 700; line-height: 22px; white-space: nowrap; vertical-align: 1px; }
.qa-state.done { background: var(--sub-mid); color: #fff; }
.qa-state.wait { color: var(--muted); box-shadow: inset 0 0 0 1px var(--border-strong); }
.np-table .nc-n { margin-left: 6px; color: var(--on); font-size: 14px; font-weight: 700; } /* 제목 뒤 댓글 수 [3] */
.nv-comments { margin-top: var(--s5); }
.nv-comments h3 { margin: 0 0 var(--s2); font-size: 19px; font-weight: 700; }
.nc-list { margin: 0; padding: 0; border-top: 1px solid var(--text); list-style: none; }
.nc-list li { padding: var(--s2) 4px; border-bottom: 1px solid var(--border); }
.nc-list li.empty { color: var(--muted); font-size: 15px; }
.nc-meta { display: flex; align-items: center; gap: var(--s1); color: var(--muted); font-size: 14px; }
.nc-meta b { color: var(--text); font-size: 15px; }
.nc-meta .btn { margin-left: auto; }
.nc-body { margin: 6px 0 0; font-size: 16px; line-height: 1.7; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.nc-form { display: flex; align-items: flex-end; gap: var(--s1); margin-top: var(--s2); }
.nc-form textarea { flex: 1; min-width: 0; min-height: 88px; resize: vertical; font: inherit; font-size: 16px; }
.nc-form .btn { flex: none; min-height: 48px; }
@media (min-width: 861px) {
  /* 하위 탭 줄: 헤더 바로 아래 화면 끝까지 붙음 (이슈 통계 · 계정 관리와 같은 모양). 검색 줄 · 표 머리글은 그 아래로 44 + 밑줄 1 만큼 내려 붙음 */
  body.view-notices .np-tabs { position: sticky; top: var(--top-h, 76px); z-index: 19; margin: calc(var(--s3) * -1) calc(var(--s5) * -1) 0; padding: 0 var(--s5); border-bottom: 1px solid var(--border); background: var(--page); }
  .np-tabs .st-tabs { margin-bottom: 0; }
  body.view-notices .np-panel > .np-search, body.view-notices .np-panel > .np-head { top: calc(var(--top-h, 76px) + 45px); margin-top: 0; padding-top: var(--s3); }
  body.view-notices .np-table thead th { top: calc(var(--top-h, 76px) + 45px + var(--np-h, 88px)); }
}
@media (max-width: 860px) {
  .np-tabs .st-tabs { margin-bottom: var(--s2); }
  .nc-form { flex-direction: column; align-items: stretch; }
}
