* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  background: #10151c;
  color: #e6e9ef;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-box {
  background: #1b2330;
  padding: 2.5rem;
  border-radius: 12px;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-box h1 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  text-align: center;
}

.login-box input {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

.login-box button {
  margin-top: 1rem;
  padding: 0.7rem;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.login-box .error {
  color: #f87171;
  font-size: 0.85rem;
  margin: 0;
}

/* 처음 설정(/setup) — 로그인 상자와 같은 모양, 좁은 화면에서도 넘치지 않게 */
.setup-box { max-width: calc(100vw - 32px); box-sizing: border-box; }
.setup-box .setup-title { margin: 0; font-size: 1.05rem; font-weight: 700; text-align: center; }
.setup-box .setup-hint { margin: 0 0 0.5rem; font-size: 0.85rem; color: #a9b3c1; text-align: center; }
.login-locks { display: flex; flex-direction: column; gap: 6px; }
.login-lock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: #161d28; border: 1px solid #26303d; border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.login-lock-row button { margin-left: auto; }
.setup-box label { font-size: 0.85rem; color: #c3cad6; display: inline-flex; align-items: center; gap: 4px; margin-top: 0.35rem; }

.remember-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

.cf-turnstile {
  width: 100%;
  margin-top: 0.8rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, #1e2735 0%, #1b2330 100%);
  border-bottom: 1px solid #232d3d;
}

header h1 { margin: 0; font-size: 1.1rem; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}

.brand-link:hover .brand-name { color: #22d3ee; }
.brand-link:focus-visible { outline: 2px solid #22d3ee; outline-offset: 3px; }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
}

.brand-sub {
  color: #a9b3c1;
  font-weight: 400;
}

.login-box .brand {
  justify-content: center;
  margin-bottom: 0.4rem;
}

.login-box .brand-mark {
  width: 36px;
  height: 36px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-right form { margin: 0; }

.header-right button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid #333c4a;
  border-radius: 6px;
  background: transparent;
  color: #a9b3c1;
  font-size: 0.9rem;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

/* 로그아웃 버튼의 아이콘. 인라인 SVG에 width/height 속성이 없어(_header.html
   의 icon_* 는 viewBox만 있다) 크기를 CSS가 정해야 한다. .link-btn svg에는
   16px 규칙이 있지만 이 버튼은 .link-btn이 아니라 규칙이 없었고, 모바일에서
   햄버거를 열면 버튼이 width:100%가 되면서 아이콘이 그 폭까지 늘어났다. */
.header-right button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header-right button:hover {
  border-color: #566073;
  color: #e6e9ef;
}

/* 화면 언어 선택(_lang_switch.html) — 상단 바 오른쪽 끝, 로그아웃 옆.
   .header-right 밖에 있으므로 margin-left:auto는 .header-right가 받는다
   (메뉴 묶음과 언어 선택이 함께 오른쪽에 붙는다). */
header .header-right { margin-left: auto; }
.lang-switch {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #a9b3c1;
}
header .lang-switch { margin-left: 0.5rem; }
.lang-switch-icon {
  position: absolute;
  left: 0.55rem;
  width: 15px;
  height: 15px;
  pointer-events: none;
}
.lang-select {
  -webkit-appearance: none;
  appearance: none;
  height: 2.05rem;
  padding: 0 1.7rem 0 1.85rem;
  border: 1px solid #333c4a;
  border-radius: 6px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b3c1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 12px 12px;
  color: #a9b3c1;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.lang-select:hover,
.lang-select:focus-visible {
  border-color: #566073;
  color: #e6e9ef;
}
.lang-select:disabled { opacity: 0.6; cursor: progress; }
.lang-select option { background: #1b2330; color: #e6e9ef; }
/* super 에게만: 이 화면 언어가 시스템 기본값과 다를 때(_lang_switch.html) — 노란 테두리와 지구본 위
   점으로 알리고, 바꾸는 선택지는 select 목록 끝에 있다. 상단 바 폭은 늘리지 않는다(점은 absolute).
   옛 [기본값으로] 버튼은 1280px 영어 화면에서 상단 바 밖으로 밀렸다(2026-11-19 통합 검토). */
.lang-switch.is-mismatch .lang-select { border-color: #7c5a12; field-sizing: content; }
.lang-switch.is-mismatch .lang-select:hover,
.lang-switch.is-mismatch .lang-select:focus-visible { border-color: #fbbf24; }
.lang-switch.is-mismatch::after {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: 1.25rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  pointer-events: none;
}
/* 저장 실패 안내 — 상단 바 높이를 바꾸지 않게 select 아래에 띄운다. */
.lang-switch-msg {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: #3a1d1d;
  border: 1px solid #7f2a2a;
  color: #fca5a5;
  font-size: 0.8rem;
  white-space: nowrap;
}
.lang-switch-msg[hidden] { display: none; }
.login-lang {
  position: fixed;
  top: 1rem;
  right: 1rem;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-divider {
  width: 1px;
  align-self: stretch;
  margin: 0.2rem 0.4rem;
  background: #2a3444;
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.badge.ok { background: #14532d; color: #86efac; }
.badge.bad { background: #4b1113; color: #fca5a5; }

main {
  padding: 1.5rem;
}

#stream {
  max-width: 100%;
  border-radius: 8px;
  background: #000;
}

.channel-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem 0;
  flex-wrap: wrap;
}

.tab {
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 6px 6px 0 0;
  background: #1b2330;
  color: #a9b3c1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.tab.active {
  background: #2a3444;
  color: #e6e9ef;
}

.tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.grid-view {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* 5채널 이상: 4x2 배치 (데스크톱). 모바일은 아래 미디어 쿼리에서 1열. */
.grid-view.grid-view--wide {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: none;
}

.tile {
  background: #1b2330;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}

.tile-stream {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

/* .tile-header is position:absolute (see tactical.css) and floats over the
   video rather than pushing it down, so .tile-poster/.tile-waiting can
   simply cover the same box as .tile-stream (position:relative comes from
   .tile) without needing a header-height offset — see docs/
   live_view_multichannel_loading_delay_diagnosis_20260913.md section 5,
   C-1/C-2. Placed after .tile-stream in the DOM so they paint on top of it
   until JS hides them on the stream's first 'load'. */
.tile-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  pointer-events: none;
}

.tile-waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #9aa4b6;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0 0.5rem;
  pointer-events: none;
}

.tile-poster[hidden],
.tile-waiting[hidden] {
  display: none;
}

.tile-waiting.slow {
  color: #e0a94a;
}

.tile-waiting-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #9aa4b6;
  animation: tile-waiting-spin 0.85s linear infinite;
}

.tile-waiting.slow .tile-waiting-spinner {
  border-top-color: #e0a94a;
}

@keyframes tile-waiting-spin {
  to { transform: rotate(360deg); }
}

.tile-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: #000;
  color: #566073;
  font-size: 0.85rem;
}

.single-view {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
}

.single-view-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* .single-stream의 width:100%가 실제로 "남은 가로 공간을 채운다"는
     뜻이 되려면 이 컨테이너 자신이 먼저 그 공간을 차지해야 한다 —
     .single-view가 justify-content:center인 flex 컨테이너라 기본값
     (flex: 0 1 auto)으로는 이 컬럼이 콘텐츠 크기로만 좁혀지고, 704x480
     같은 작은 원본 해상도 카메라는 다시 원본 크기로 작게 보이는 문제가
     재발한다(min-width:0은 flex 자식이 콘텐츠 고유 크기 밑으로도 줄어들
     수 있게 해 그 좁혀짐을 완전히 막는다). */
  flex: 1 1 0;
  min-width: 0;
}

.single-view-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #2a3444;
  border-radius: 10px;
  background: #1b2330;
  color: #a9b3c1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  background: #232d3d;
  color: #e6e9ef;
  border-color: #333f52;
}

.icon-btn.active {
  background: #123a44;
  border-color: #22d3ee;
  color: #22d3ee;
}

.hamburger-btn {
  display: none;
}

.plate-panel {
  flex-direction: column;
  width: 280px;
  max-height: calc(100vh - 160px);
  background: #1b2330;
  border-radius: 8px;
  padding: 0.8rem;
  /* 패널 전체가 아니라 목록(.plate-panel-list)만 스크롤되도록 — 헤더/검색창/
     "전체 이력에서 더 보기" 링크는 항상 고정 위치에 보여야 한다. maxVisible
     PlateItems()/maxVisibleDetectionItems()가 목록에 들어갈 개수를 미리
     계산하지만, 창 크기 변경 타이밍이나 반올림 오차로 살짝 넘칠 수 있는데
     그 경우에도 "더 보기" 버튼이 스크롤 속으로 밀려 들어가면 안 된다(신고:
     최대화 시 우측에 원치 않는 스크롤 + 더보기 버튼 안 보임). */
  overflow: hidden;
  flex-shrink: 0;
}

.plate-panel-header {
  font-size: 0.85rem;
  color: #a9b3c1;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

.plate-panel-search {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  flex-shrink: 0;
}

.plate-panel-search input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-size: 0.85rem;
}

.plate-panel-search .icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.plate-panel-search .icon-btn svg {
  width: 16px;
  height: 16px;
}

.plate-panel-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  /* .plate-panel 안에서 유일하게 늘어나고(min-height:0으로 flex 자식이
     콘텐츠 크기만큼 무한정 커지는 걸 막음) 넘치면 스크롤되는 영역 —
     헤더/검색창/더보기 링크는 이 스크롤 밖에 고정된다. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* 스크롤 동작(마우스 휠/터치 스와이프)은 그대로 두고 스크롤바 막대만
     시각적으로 숨긴다 — 좁은 사이드 패널에 스크롤바까지 보이면 답답해
     보인다는 피드백. Firefox는 scrollbar-width, WebKit/Blink 계열은
     아래 ::-webkit-scrollbar로 각각 처리. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.plate-panel-list::-webkit-scrollbar {
  display: none;
}

.plate-panel-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.plate-panel-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  flex-shrink: 0;
}

.plate-panel-thumb-empty {
  display: flex;
}

.plate-panel-item-text {
  min-width: 0;
}

.plate-panel-plate {
  font-weight: 600;
  color: #22d3ee;
}

.plate-panel-time {
  font-size: 0.75rem;
  color: #6b7688;
}

.plate-panel-empty {
  color: #6b7688;
  font-size: 0.85rem;
}

.plate-panel-ask-ai-btn {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #1c5560;
  background: #123a44;
  color: #22d3ee;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.plate-panel-ask-ai-btn:hover {
  background: #164a56;
}

.plate-panel-more-link {
  display: block;
  text-align: center;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #2a3444;
  color: #22d3ee;
  font-size: 0.8rem;
  text-decoration: none;
  flex-shrink: 0;
}

.plate-panel-more-link:hover {
  text-decoration: underline;
}

.single-stream {
  /* max-width/max-height만으로는 704x480처럼 작은 원본 해상도의 카메라가
     원본 크기 그대로(브라우저 창보다 훨씬 작게) 표시된다 — <img>는 명시적
     크기가 없으면 원본 픽셀 크기로 렌더링되고, max-* 제약은 "이보다 크게
     키우지 마라"만 의미하지 "이 컨테이너를 채워라"는 아니기 때문(1920x1080
     같은 고해상도 카메라는 우연히 max-height에 걸려 줄어들어 문제가 안
     보였을 뿐). width:100%로 폭을 채우게 한다.

     여기에 object-fit:contain으로 세로 제약(max-height)까지 같이 걸면,
     브라우저 창 종횡비가 카메라 종횡비와 다를 때 "박스는 width:100%,
     실제 그려지는 영상 픽셀은 그보다 작게 레터박스 안쪽"이 되어 버린다.
     .tac-count-badge/IN·OUT 배지/OSD는 .tac-frame(이 <img>가
     차지하는 박스) 모서리 기준 absolute 위치라, 그 경우 가이드라인·배지가
     실제 영상 경계와 어긋나 보인다(신고 사례: 704x480 카메라, 넓은 창).

     대신 JS(dashboard.html — singleImg의 load 이벤트에서 naturalWidth/
     naturalHeight로 aspect-ratio를 직접 지정)가 이 요소 자체를 정확히
     카메라의 실제 종횡비로 고정한다. aspect-ratio가 걸린 상태에서는
     width와 height가 서로를 강제하므로 — width:100%가 폭을 정하면
     height는 그 비율로 자동 계산되고, 반대로 max-height가 발동하면
     브라우저가 폭을 그 비율에 맞게 자동으로 줄인다 — object-fit 없이도
     "박스 크기 = 실제 영상 픽셀 크기"가 항상 성립해 레터박스 자체가
     생기지 않는다. */
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  border-radius: 8px;
  background: #000;
  cursor: pointer;
}

.settings-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem;
}

#settings-form {
  max-width: 1400px;
}

.channel-grid {
  max-width: 600px;
}

.channel-block {
  background: #1b2330;
  border: none;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.channel-block[hidden] {
  display: none;
}

.channel-block legend {
  padding: 0;
  width: 100%;
  margin-bottom: 0.4rem;
}

.enable-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.enable-toggle.disabled-row {
  opacity: 0.5;
}

.channel-block label {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

.channel-block .hint {
  color: #6b7688;
  font-size: 0.75rem;
}

.channel-block input[type="text"],
.channel-block input[type="password"],
.channel-block input[type="number"] {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

.channel-block .test-btn {
  margin-top: 0.8rem;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  background: #333c4a;
  color: #e6e9ef;
  cursor: pointer;
}

.channel-block-divider {
  border-top: 1px solid #2a3444;
  margin: 0.4rem 0;
}

.channel-block .save-all-btn {
  padding: 0.7rem;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#settings-form > .success {
  color: #86efac;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.settings-shell {
  display: flex;
  align-items: stretch;
}

.settings-sidebar {
  width: 232px;
  flex-shrink: 0;
  background: #1b2330;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-right: 1px solid #232d3d;
}

.settings-nav-label {
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: #566073;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  color: #a9b3c1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.settings-nav-item svg { flex-shrink: 0; }

.settings-nav-item:hover {
  background: #232d3d;
  color: #e6e9ef;
}

.settings-nav-item.active {
  background: #123a44;
  color: #22d3ee;
}

.settings-nav-item.disabled {
  color: #566073;
  cursor: default;
  pointer-events: none;
}

.settings-breadcrumb {
  font-size: 0.8rem;
  color: #566073;
  margin-bottom: 1rem;
}

.channel-tabs-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.channel-tab-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #1b2330;
  color: #a9b3c1;
  font-size: 0.9rem;
  font-family: inherit;
}

.channel-tab-pill.active {
  background: #2a3444;
  color: #e6e9ef;
}

.channel-tab-pill .ch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.channel-tab-pill .ch-dot.on { background: #4ade80; }
.channel-tab-pill .ch-dot.off { background: #4b5563; }

.admin-box {
  background: #1b2330;
  padding: 2rem;
  border-radius: 12px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-box label {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

.admin-box input {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

.admin-box input:disabled {
  color: #6b7688;
}

.admin-box .success {
  color: #86efac;
  font-size: 0.85rem;
  margin: 0;
}

.admin-box .error {
  color: #f87171;
  font-size: 0.85rem;
  margin: 0;
}

.role-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.role-badge.role-super { background: rgba(234, 179, 8, 0.18); color: #eab308; }
.role-badge.role-manager { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.role-badge.role-viewer { background: rgba(148, 163, 184, 0.18); color: #94a3b8; }

.user-delete-btn { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.retention-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 900px;
}

.retention-card {
  background: #1b2330;
  padding: 1.5rem;
  border-radius: 12px;
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.retention-card h3 {
  margin: 0 0 0.2rem;
}

.retention-card label {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

/* 메신저 탭 안내 한 줄 — 「모든 인식 차량 알림」은 채널별 번호판 인식에서 정한다(2026-11-19). */
.retention-card .notify-plate-scope-hint {
  margin: 0.6rem 0 0;
  color: #6b7688;
  font-size: 0.8rem;
}

.retention-card input,
.retention-card select {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-family: inherit;
  font-size: 0.95rem;
}

.capacity-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #0f141c;
  overflow: hidden;
}

.capacity-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22d3ee, #3b82f6);
  transition: width 0.4s ease;
}

.capacity-bar-fill.warn { background: linear-gradient(90deg, #f2b84b, #f87171); }

.capacity-disk-summary {
  font-size: 0.85rem;
  color: #a9b3c1;
}

.capacity-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.capacity-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #a9b3c1;
}

.capacity-stat b {
  font-size: 1rem;
  color: #e6e9ef;
  font-weight: 600;
}

.capacity-confidence-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #333c4a;
  color: #a9b3c1;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.link-btn:not(.disabled):not(.current):hover {
  border-color: #566073;
  color: #e6e9ef;
}

.link-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* A disabled nav item renders as <span> (see _header.html) — this is
   purely visual, not the security boundary (that's the server-side role
   check on every route). */
.link-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  user-select: none;
}

/* 현재 보고 있는 페이지의 메뉴 항목 — 클릭 가능한 .link-btn(차단기 열기
   등)과 똑같이 테두리 박스로 그리면 "눌리는 버튼인데 왜 안 눌리지"라는
   오해를 산다(2026-09-17 피드백). 그래서 평소엔 테두리/배경 없는 라벨
   텍스트로 두고, 색으로만 "지금 여기"를 표시한다 — hover했을 때만 옅은
   배경이 떠서 "정보 표시일 뿐 버튼이 아니다"가 분명해지게 한다.
   색은 .accent-settings와 같은 청록(#22d3ee) — 원래 빨강(#ff6b7a)이
   차단기 열기 등 위험 동작 버튼과 같은 색이라 "긴급/경고"로 오인되기
   쉬웠다(2026-09-17 후속 피드백). */
.link-btn.current {
  border-color: transparent;
  background: transparent;
  color: #22d3ee;
  cursor: default;
  user-select: none;
}

.link-btn.current:hover {
  background: rgba(34, 211, 238, 0.1);
}

/* '실시간 영상'/'설정'처럼 다른 페이지에 가 있을 때도 항상 눈에 띄어야
   하는 항목 — 각각 고유색을 써서 .current(현재 위치, 빨강)와 헷갈리지
   않게 한다. */
.link-btn.accent-live {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

.link-btn.accent-live:hover {
  background: rgba(74, 222, 128, 0.18);
}

.link-btn.accent-settings {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
}

.link-btn.accent-settings:hover {
  background: rgba(34, 211, 238, 0.18);
}

/* 차량/사람 드롭다운 그룹 (_header.html navgroup 매크로). 트리거는
   .link-btn을 그대로 상속하고 화살표만 덧붙인다 — 서브 항목이 열렸을 때
   트리거가 갑자기 다른 스타일로 보이면 "같은 버튼"이라는 인상이 깨진다. */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
  font: inherit;
}

.nav-dropdown-caret {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.nav-dropdown-trigger[aria-expanded="true"] .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-trigger:not(.disabled):not(.current):hover {
  border-color: #566073;
  color: #e6e9ef;
}

/* 드롭다운 트리거는 서브 항목에 현재 페이지가 있어도 트리거 자체는
   여전히 눌러서 열 수 있는 버튼이다 — [실시간 영상]처럼 완전히 클릭
   불가한 .link-btn.current(테두리 없는 라벨)와 달리 테두리를 유지해
   "눌러도 되는 버튼"임을 분명히 한다. */
.nav-dropdown-trigger.current {
  border-color: #ff6b7a;
  background: rgba(255, 107, 122, 0.1);
  cursor: pointer;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 20;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 190px;
  padding: 0.35rem;
  background: #161b26;
  border: 1px solid #333c4a;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

/* [hidden]과 아래 열림 상태는 둘 다 클래스 없는 속성 선택자라 캐스케이드
   명시도가 같다 — 이 규칙이 소스 순서상 나중이라 항상 이겨서, 기본
   display:flex가 [hidden]의 display:none을 덮어써 버리는(=닫아도 항상
   펼쳐져 보이는) 버그가 있었다. [hidden] 쪽에 !important를 둬 확실히
   닫히게 한다. */
.nav-dropdown-menu[hidden] {
  display: none !important;
}

.nav-dropdown-menu:not([hidden]) {
  display: flex;
}

.nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-menu .link-btn {
  border-color: transparent;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
}

.nav-dropdown-menu .link-btn:not(.disabled):not(.current):hover {
  background: rgba(255, 255, 255, 0.07);
}

.account-btn {
  background: none;
  border-color: transparent;
  padding: 0.4rem 0.2rem;
  font-weight: 600;
}

.account-btn:hover { text-decoration: underline; }

.settings-box {
  background: #1b2330;
  padding: 2rem;
  border-radius: 12px;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-box label {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

.settings-box .hint {
  color: #6b7688;
  font-size: 0.75rem;
}

.settings-box input {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

.settings-box .success {
  color: #86efac;
  font-size: 0.85rem;
  margin: 0;
}

.button-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.button-row button {
  flex: 1;
  padding: 0.7rem;
  border: none;
  border-radius: 6px;
  background: #333c4a;
  color: #e6e9ef;
  font-weight: 600;
  cursor: pointer;
}

.button-row button.primary {
  background: #3b82f6;
  color: white;
}

/* 파일 고르기 — 입력은 화면에서만 숨기고(키보드·폼 검사는 그대로) 번역된 버튼과
   파일 이름을 보인다(_header.html의 .file-pick 처리). */
.file-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.file-pick-input {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-pick-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  border: 1px solid #333c4a;
  border-radius: 6px;
  background: #333c4a;
  color: #e6e9ef;
  font-size: 0.85rem;
  cursor: pointer;
}
.file-pick-btn:hover { border-color: #566073; }
.file-pick-input:focus-visible + .file-pick-btn { outline: 2px solid #3b82f6; outline-offset: 2px; }
.file-pick-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a9b3c1;
  font-size: 0.85rem;
}
.file-pick-name.has-file { color: #e6e9ef; }

.test-result {
  min-height: 1.2rem;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.test-result.ok { color: #86efac; }
.test-result.bad { color: #f87171; }

.gate-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.gate-log-table th,
.gate-log-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gate-log-table th {
  color: #a9b3c1;
  font-weight: 600;
}

.gate-log-table th:first-child,
.gate-log-table td:first-child {
  width: 40%;
}

.gate-open-menu .link-btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

/* Simplified gate settings card — see
   docs/barrier_gate_control_ui_simplification_20260914.md */

.gate-card,
.gate-log-card,
.gate-master-card {
  max-width: 520px;
}

/* 차단기 자체의 사용/사용 안함 스위치 — 자동 개방 등 세부 카드와
   헷갈리지 않도록 별도 카드로 분리했다(2026-09-17 피드백). */
.gate-master-card .gate-row-toggle {
  border-bottom: none;
  padding: 0;
}

.gate-master-card .gate-row-toggle span {
  font-weight: 600;
  color: #e6e9ef;
}

.gate-master-card .gate-field-note {
  margin-top: 0.5rem;
}

/* 차단기 제어가 꺼진 상태에서는 세부 설정을 건드려도 저장 즉시 무시되니
   — 필드가 멀쩡히 눌리면 "바꿨는데 왜 안 되지"로 헷갈린다 — 카드
   전체를 흐리게 하고 입력을 막는다. 저장 버튼은 그대로 눌러야 이
   꺼짐 상태 자체를 서버에 반영할 수 있으므로 흐리게 하지 않는다. */
.gate-card.gate-card-disabled {
  opacity: 0.45;
}

.gate-card.gate-card-disabled .gate-button-row {
  opacity: 1;
}

.gate-intro {
  margin: 0 0 0.4rem;
  color: #a9b3c1;
  font-size: 0.9rem;
}

.gate-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gate-row:last-of-type {
  border-bottom: none;
}

.gate-row-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.gate-row label,
.gate-field-label {
  font-size: 0.85rem;
  color: #a9b3c1;
}

.gate-row select,
.gate-row input[type="text"],
.gate-row input[type="number"] {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-family: inherit;
}

.gate-field-note {
  font-size: 0.8rem;
  color: #7c8797;
}

.gate-field-error {
  color: #f87171;
}

.gate-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}

.gate-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #e6e9ef;
}

/* Toggle switch for "자동 개방" — a plain checkbox reads as a settings
   field, but this is closer to an on/off operational control. */
.gate-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.gate-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.gate-switch-track {
  position: absolute;
  inset: 0;
  background: #333c4a;
  border-radius: 999px;
  transition: background 0.15s;
  cursor: pointer;
}

.gate-switch-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #e6e9ef;
  border-radius: 50%;
  transition: transform 0.15s;
}

.gate-switch input:checked + .gate-switch-track {
  background: #3b82f6;
}

.gate-switch input:checked + .gate-switch-track::before {
  transform: translateX(20px);
}

.gate-switch input:disabled + .gate-switch-track {
  opacity: 0.4;
  cursor: not-allowed;
}

.gate-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.gate-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gate-status-dot.gate-status-info { background: #60a5fa; }
.gate-status-dot.gate-status-ok { background: #86efac; }
.gate-status-dot.gate-status-warn { background: #fbbf24; }
.gate-status-dot.gate-status-bad { background: #f87171; }

.license-id-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.license-id-row code {
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  background: #0f1520;
  border: 1px solid #2a3444;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.license-detail-table {
  margin-top: 0.6rem;
  border-collapse: collapse;
  width: 100%;
}

.license-detail-table th {
  text-align: left;
  color: #9aa5b1;
  font-weight: 500;
  padding: 0.35rem 0.8rem 0.35rem 0;
  vertical-align: top;
  white-space: nowrap;
}

.license-detail-table td {
  padding: 0.35rem 0;
}

.gate-advanced {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gate-advanced summary {
  cursor: pointer;
  color: #a9b3c1;
  font-size: 0.85rem;
  user-select: none;
}

.gate-advanced label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

.gate-advanced input[type="number"],
.gate-advanced input[type="text"] {
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-family: inherit;
  box-sizing: border-box;
}

.gate-install-info {
  margin-top: 0.8rem;
}

.gate-button-row {
  justify-content: flex-end;
  gap: 0.6rem;
}

.gate-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.gate-modal-overlay[hidden] {
  display: none;
}

.gate-modal {
  background: #1b2330;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 380px;
  width: 90%;
}

.gate-modal h4 {
  margin: 0 0 0.6rem;
}

.gate-modal p {
  margin: 0 0 1rem;
  color: #a9b3c1;
  font-size: 0.9rem;
}

.gate-modal label {
  font-size: 0.85rem;
  color: #a9b3c1;
}

.gate-modal input {
  width: 100%;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-family: inherit;
  box-sizing: border-box;
  margin-top: 0.3rem;
}

/* 저장 동작 전 공용 확인 팝업 (_header.html의 window.confirmAction) —
   .gate-modal과 같은 크기/톤이지만 예/아니오 두 버튼 전용이라 별도
   클래스로 둔다. */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirm-modal-overlay[hidden] {
  display: none;
}

.confirm-modal {
  background: #1b2330;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.confirm-modal p {
  margin: 0 0 1.2rem;
  color: #e6e9ef;
  font-size: 0.95rem;
}

.confirm-modal .button-row {
  justify-content: flex-end;
  gap: 0.6rem;
}

.ai-detect {
  max-width: 1400px;
}

/* 오른쪽 카드(.ai-side-col) 폭을 고정 px로 못박고 영상(.ai-video-col)이
   나머지 공간을 전부 차지하게 한다. 이전에는 2fr 1fr처럼 비율(fr)로만
   나눴는데, 그리드 아이템의 기본 min-width는 auto라 트랙이 콘텐츠의
   min-content 폭보다 좁아지지 못한다 — 구역을 추가하면 그 행(체크박스
   3개+select+삭제버튼)의 min-content가 넓어지며 1fr 트랙을 밀어
   넓혔고, 그 여파로 영상이 매번 다른 크기로 보였다(구역 0개일 때는
   크게, 몇 개 추가하면 실사용에 적당한 크기로 좁아짐 — 사용자가
   실제로 "적당하다"고 확인한 건 후자였다). 고정 폭으로 못박으면
   구역이 몇 개든 카드 폭도, 영상 크기도 항상 일정하다. */
.ai-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 580px;
  gap: 1.5rem;
}

.ai-video-col,
.ai-side-col {
  min-width: 0;
}

.ai-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.ai-draw-mode {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

.ai-toolbar select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

/* 확대 감지 줄 — .enable-toggle의 display:flex가 [hidden]을 덮지 않게 한다. */
#ai-zoom-mode-row[hidden] {
  display: none;
}

/* 메신저 알림 줄 — 재알림 간격을 같은 줄의 하위 설정으로(세로 구분선 뒤). 좁은 화면에서는 다음 줄로 넘어간다. */
.enable-toggle.notify-row {
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

.notify-row .notify-main,
.notify-row .notify-interval-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.notify-row .notify-interval-inline {
  padding-left: 0.75rem;
  border-left: 1px solid #333c4a;
  font-weight: 400;
  color: #a9b3c1;
}

.notify-row .notify-interval-inline.disabled-row {
  opacity: 0.45;
}

#ai-notify-interval,
#ai-zoom-mode-select {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-weight: 400;
}

#count-badge-position-select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  margin-top: 0.4rem;
}

.ai-canvas-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.ai-video {
  display: block;
  width: 100%;
  height: auto;
}

.ai-count-badge {
  position: absolute;
  z-index: 2;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: #7cf5e8;
  background: rgba(5, 8, 11, 0.75);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}
.ai-count-badge.pos-top-left { top: 8px; left: 8px; }
.ai-count-badge.pos-top-center { top: 8px; left: 50%; transform: translateX(-50%); }
.ai-count-badge.pos-top-right { top: 8px; right: 8px; }
.ai-count-badge.pos-bottom-left { bottom: 8px; left: 8px; }
.ai-count-badge.pos-bottom-center { bottom: 8px; left: 50%; transform: translateX(-50%); }
.ai-count-badge.pos-bottom-right { bottom: 8px; right: 8px; }

#ai-canvas,
#pm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.ai-side-col {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ai-tabs-row {
  display: flex;
  gap: 0.5rem;
}

.ai-tab-pill {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #1b2330;
  color: #a9b3c1;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
}

.ai-tab-pill.active {
  background: #123a44;
  color: #22d3ee;
}

.ai-section-card {
  background: #1b2330;
  border-radius: 12px;
  padding: 1.2rem;
}

.ai-section-card[hidden] {
  display: none;
}

.ai-section-divider {
  border-top: 1px solid #2a3444;
  margin: 1rem 0 0.8rem;
}

.ai-side-col h3,
.ai-subheading {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: #a9b3c1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.anpr-sensitivity {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.sensitivity-label {
  font-size: 0.85rem;
  color: #a9b3c1;
}

.sensitivity-option {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 0.1rem 0.5rem;
  background: #0f141c;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.sensitivity-option .sensitivity-title {
  font-weight: 600;
  color: #e6e9ef;
}

.sensitivity-option .hint {
  grid-column: 2 / 4;
}

.field-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #333c4a;
  color: #a9b3c1;
  font-size: 0.7rem;
  font-style: normal;
  cursor: help;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.events-clear-btn {
  padding: 0.25rem 0.6rem;
  border: none;
  border-radius: 6px;
  background: #333c4a;
  color: #a9b3c1;
  font-size: 0.75rem;
  font-weight: normal;
  cursor: pointer;
}

.ai-zone-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.ai-zone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: #141a24;
  border-radius: 8px;
  padding: 0.6rem;
  cursor: pointer;
}

.ai-zone-row.selected {
  outline: 2px solid #3b82f6;
}

.ai-zone-row .zone-name {
  flex: 1;
  /* 행 항목이 많아지면(구역별 확대 체크 등) 이름 칸을 찌그러뜨리지 않고 다음 줄로 넘긴다 */
  min-width: 7rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

.ai-zone-row .zone-duration,
.ai-zone-row .zone-sensitivity {
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

.mask-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.mask-type-options .sensitivity-option input[type="radio"] {
  accent-color: #3b82f6;
}

.mask-strength-block {
  margin: 0.8rem 0 0.4rem;
}

.mask-strength-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #0f141c;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.4rem;
}

.mask-strength-row input[type="range"] {
  flex: 1;
  accent-color: #3b82f6;
}

.mask-strength-end {
  font-size: 0.75rem;
  color: #a9b3c1;
  white-space: nowrap;
}

.mask-strength-badge {
  min-width: 1.4rem;
  text-align: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #3b82f6;
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
}

/* 구역별 확대 — 배율/효과 없음 표시(체크했고 확대 감지가 시험·켬일 때만) */
.zone-zoom-note {
  font-size: 0.75rem;
  color: #22c55e;
  white-space: nowrap;
}
.zone-zoom-note.is-skipped {
  color: #f59e0b;
}
.ai-zoom-hint {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.8rem;
  color: #f59e0b;
}

.zone-enabled-toggle,
.zone-mask-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #a9b3c1;
  white-space: nowrap;
}

/* 라이선스 잠금 표시 — 설정 > 라이선스 탭 참고: 백엔드는 이미 config
   빌더/출력 단에서 강제하고 있고, 여기 스타일은 "잠겨 있다"는 것을
   눈으로 보여주는 용도다(설계서 §9.1 프런트엔드 안내). */
.is-license-locked {
  color: #6b7686;
  opacity: 0.75;
}

/* 자물쇠 아이콘 하나로 끝 — 자세한 설명은 title 툴팁(hover), 클릭하면
   라이선스 탭으로. 배경 배지 없이 zone 체크박스 옆 🔒와 같은 톤. */
.license-lock-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  filter: grayscale(0.2);
}

.license-lock-badge:hover {
  opacity: 0.75;
}

/* fieldset 리셋 — 브라우저 기본 여백/테두리를 지우고, disabled일 때만
   내부 컨트롤이 흐려 보이도록 한다(체크박스 disabled는 이미 개별로도
   처리하지만, fieldset 통짜 잠금(ANPR 탭·모자이크 스타일·PPE 감도)은
   여기서 시각적으로도 분명히 드러나야 한다). */
fieldset.ai-anpr-fieldset,
fieldset.ai-mask-fieldset,
fieldset.ai-ppe-sensitivity-fieldset,
fieldset.ai-chatbot-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

fieldset.ai-anpr-fieldset:disabled,
fieldset.ai-mask-fieldset:disabled,
fieldset.ai-ppe-sensitivity-fieldset:disabled,
fieldset.ai-chatbot-fieldset:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.zone-delete {
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: 6px;
  background: #4b1113;
  color: #fca5a5;
  cursor: pointer;
}

.line-flip-btn {
  padding: 0.4rem 0.6rem;
  border: 1px solid #333c4a;
  border-radius: 6px;
  background: #1f2937;
  color: #a9b3c1;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.8rem;
}

.ai-events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ai-events-table th, .ai-events-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #333c4a;
  color: #a9b3c1;
}

.anpr-toast-container {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 1000;
  pointer-events: none;
}

/* 단일 채널 보기(.tac-frame, position:relative — tactical.css) 안쪽에 겹쳐
   보이는 버전 — 화면 전체 기준 버전보다 살짝 더 눈에 띄게 키운다(요청:
   "약간 크기를 키우고 영상 내 우측 하단으로"). .tac-frame이 곧 <img>와
   같은 크기이므로 absolute 배치가 정확히 영상 경계 안에 들어맞는다. */
.anpr-toast-container-inline {
  position: absolute;
  right: 12px;
  bottom: 34px;
  z-index: 4;
}

.anpr-toast {
  background: #0f141c;
  border: 1px solid #22d3ee;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: anpr-toast-in 0.25s ease-out;
}

.anpr-toast-container-inline .anpr-toast {
  padding: 1rem 1.5rem;
  border-radius: 12px;
}

.anpr-toast.anpr-toast-out {
  animation: anpr-toast-out-anim 0.4s ease-in forwards;
}

.anpr-toast-channel {
  font-size: 0.75rem;
  color: #a9b3c1;
}

.anpr-toast-container-inline .anpr-toast-channel {
  font-size: 0.9rem;
}

.anpr-toast-plate {
  font-size: 1.3rem;
  font-weight: 700;
  color: #22d3ee;
  letter-spacing: 0.02em;
}

.anpr-toast-container-inline .anpr-toast-plate {
  font-size: 1.8rem;
}

@keyframes anpr-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes anpr-toast-out-anim {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(10px); }
}

.history-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.history-filters select,
.history-filters input {
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
}

.history-filters input[type="text"] {
  min-width: 180px;
}

.history-filters button {
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 6px;
  background: #333c4a;
  color: #e6e9ef;
  cursor: pointer;
}

.history-filters button.primary {
  background: #3b82f6;
  color: white;
}

.history-table td, .history-table th {
  vertical-align: middle;
}

.history-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  cursor: pointer;
}

.plate-panel-thumb-clickable {
  cursor: pointer;
}

.image-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 200;
}

.image-lightbox-overlay[hidden] {
  display: none;
}

.image-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.image-lightbox-close {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: none;
  background: rgba(27, 35, 48, 0.9);
  color: #e6e9ef;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox-close:hover {
  background: #2a3444;
}

#load-more-btn {
  margin: 0 auto;
  max-width: 240px;
}

.diagnostics-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  background: #1b2330;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.diag-item b {
  color: #22d3ee;
}

.diag-item.hint {
  color: #6b7688;
  font-weight: normal;
}

.review-section {
  margin-top: 1.5rem;
  background: #1b2330;
  border: 1px solid #7c4a12;
  border-radius: 8px;
  padding: 0.8rem 1rem;
}

.review-section summary {
  cursor: pointer;
  color: #fbbf24;
  font-size: 0.9rem;
}

.review-table {
  margin-top: 0.8rem;
}

/* ===== Mobile (dashboard) — see CLAUDE.md 2026-08-27 for context =====
   Only the dashboard (실시간 영상) is redesigned for mobile per the user's
   request; other pages just get the viewport meta tag (readable at native
   size, not visually restructured) since a phone-friendly layout wasn't
   asked for there. */
@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
  }

  main {
    padding: 0.75rem;
  }

  .hamburger-btn {
    display: flex;
    order: 2;
  }

  /* 휴대폰 폭: 브랜드 | 언어 선택 · 햄버거. 언어는 메뉴를 열지 않고 바로 바꾼다.
     세 가지가 늘 첫 줄에 있어야 한다 — 화면 이름(— 연기 감지 등)이 길면 줄이 넘쳐
     햄버거가 둘째 줄 왼쪽으로 혼자 떨어졌다(2026-11-19 검토, 360·390px). 그래서
     브랜드가 남는 폭만 쓰고(flex-basis 0, min-width 0) 화면 이름은 말줄임으로 줄인다.
     header 의 flex-wrap 은 그대로 둔다 — 열린 메뉴(.header-right)가 둘째 줄로 내려가야 한다. */
  header .brand {
    flex: 1 1 0;
    min-width: 0;
  }

  header .brand-name {
    flex-shrink: 0;
  }

  header .brand-sub {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* margin-left 은 작게 — 0.5rem 이면 360px 에서 짧은 화면 이름('— 내 계정')까지 2px 모자라
     말줄임이 됐다(옛 margin-left:auto 가 실제로 남기던 자리는 약 6px, 2026-11-19 통합 검토). */
  header .lang-switch {
    order: 1;
    margin-left: 0.25rem;
    margin-right: 0.5rem;
  }

  .lang-select {
    font-size: 0.85rem;
  }

  .header-right {
    display: none;
  }

  body.mobile-nav-open .header-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 3;
    gap: 0.5rem;
    margin-top: 0.8rem;
  }

  .header-right form {
    width: 100%;
  }

  .header-right .link-btn,
  .header-right button {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
  }

  .nav-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .nav-divider {
    width: 100%;
    height: 1px;
    align-self: auto;
    margin: 0.2rem 0;
  }

  /* 모바일에서는 이미 전체 메뉴가 세로 목록으로 펼쳐지므로(위
     .nav-group 규칙) 드롭다운 토글은 불필요 — 트리거를 라벨처럼 보이게
     하고 서브 메뉴는 항상 펼친 상태로 그 아래 이어 붙인다. */
  .nav-dropdown {
    display: contents;
  }

  .nav-dropdown-trigger {
    cursor: default;
    font-weight: 600;
  }

  .nav-dropdown-caret {
    display: none;
  }

  /* 모바일은 hidden 속성/aria-expanded와 무관하게 항상 펼친 상태로
     고정한다 — 데스크톱의 열림/닫힘 애니메이션(opacity/transform)도
     여기서 전부 무효화한다. [hidden]에도 걸리도록 !important를 써서
     데스크톱 규칙(.nav-dropdown-menu[hidden]{display:none!important})을
     확실히 덮어쓴다 — 이전에는 이 반대로 걸려 있어서(펼침 조건이 아니라
     [hidden]에 flex를 강제) 데스크톱에서도 media query 판정이 애매한
     폭(임베디드 뷰, 확대 상태)에서 드롭다운이 위치가 붕 뜬 채 항상
     펼쳐지는 버그가 있었다. */
  .nav-dropdown-menu {
    position: static !important;
    display: flex !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 1rem;
    min-width: 0;
  }

  .channel-tabs {
    display: none;
    flex-direction: column;
    padding: 0.75rem 1rem;
  }

  body.mobile-nav-open .channel-tabs {
    display: flex;
  }

  .channel-tabs .tab {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
  }

  .grid-view,
  .grid-view.grid-view--wide {
    grid-template-columns: 1fr;
  }

  /* Recognized-plate side panel is desktop-only per the user's request —
     the bottom-right toast popup (.anpr-toast-container, untouched) still
     surfaces new reads on mobile. */
  .plate-panel,
  #plate-panel-toggle-btn {
    display: none !important;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem;
  overflow-y: auto;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.vehicle-form-panel {
  background: #1b2330;
  border-radius: 12px;
  padding: 1.2rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.vehicle-form-panel label {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}

.vehicle-form-panel input,
.vehicle-form-panel select,
.vehicle-form-panel textarea {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-family: inherit;
}

.vehicle-form-panel input:disabled {
  color: #6b7688;
}

.period-radios {
  display: flex;
  gap: 1.2rem;
  font-size: 0.9rem;
  color: #e6e9ef;
}

.period-range-fields {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.category-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.category-badge.badge-vip { background: rgba(234, 179, 8, 0.18); color: #eab308; }
.category-badge.badge-registered { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.category-badge.badge-restricted { background: rgba(248, 113, 113, 0.18); color: #f87171; }
.category-badge.badge-visitor { background: rgba(148, 163, 184, 0.18); color: #94a3b8; }
.category-badge.badge-unregistered { background: rgba(107, 118, 136, 0.18); color: #a9b3c1; }
.category-badge.badge-unclassified { background: rgba(107, 118, 136, 0.12); color: #6b7688; }
.category-badge.badge-lookup-error { background: rgba(248, 113, 113, 0.1); color: #f87171; border: 1px dashed #f87171; }

.calendar-panel {
  background: #1b2330;
  border: 1px solid #2b3647;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  padding: 1rem;
  /* 아래 표 기준 가운데(2026-11-19) — 표가 화면 폭을 다 쓰므로 가운데 정렬이 곧 표 가운데다. */
  margin: 0 auto 1rem;
  max-width: 340px;
}

.calendar-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid #263041;
}

.cal-close-btn {
  min-width: 4.5rem;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 6px;
  background: #333c4a;
  color: #e6e9ef;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.cal-close-btn:hover {
  background: #3f4a5c;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.calendar-header button {
  background: none;
  border: none;
  color: #a9b3c1;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
}

.calendar-header button:hover {
  color: #e6e9ef;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-weekday {
  text-align: center;
  font-size: 0.75rem;
  color: #566073;
  padding: 0.3rem 0;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #a9b3c1;
  cursor: pointer;
  font-family: inherit;
  gap: 2px;
}

.cal-cell.cal-empty {
  cursor: default;
}

.cal-day:hover {
  background: #232d3d;
  color: #e6e9ef;
}

.cal-day.selected {
  background: #3b82f6;
  color: white;
}

.cal-dots {
  display: flex;
  gap: 2px;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.cal-dot-confirmed { background: #3b82f6; }
.cal-dot-review { background: #f59e0b; }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #a9b3c1;
  align-items: center;
}

.calendar-legend .cal-dot {
  margin-right: 0.3rem;
}

.notify-help-details {
  border: 1px solid #333c4a;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.4rem;
}

.notify-help-details summary {
  cursor: pointer;
  color: #3b82f6;
  font-size: 0.9rem;
}

.notify-help-details[open] summary {
  margin-bottom: 0.8rem;
}

.notify-help-details .notify-help-step {
  margin-top: 1rem;
}

.notify-help-step h4 {
  margin: 0 0 0.4rem;
  color: #e6e9ef;
}

.notify-help-step ol,
.notify-help-step ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: #a9b3c1;
  line-height: 1.6;
}

.notify-help-step li {
  margin-bottom: 0.3rem;
}

.notify-help-step code {
  background: #0f141c;
  color: #e6e9ef;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.notify-help-faq li strong {
  color: #e6e9ef;
}

.telegram-mock {
  margin-top: 0.6rem;
  background: #0f141c;
  border: 1px solid #333c4a;
  border-radius: 10px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.telegram-mock-msg {
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  max-width: 85%;
}

.telegram-mock-msg.mine {
  align-self: flex-end;
  background: #2b5278;
  color: #e6e9ef;
}

.telegram-mock-msg.theirs {
  align-self: flex-start;
  background: #202b3a;
  color: #cdd5e0;
}

.telegram-mock.code-block {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  color: #cdd5e0;
  max-width: 100%;
}

.telegram-mock.code-block mark {
  background: #f59e0b;
  color: #10151c;
  padding: 0 0.2rem;
  border-radius: 3px;
}

/* 메신저 알림 설정 — Discord 연동 카드
   see docs/discord_notification_design_20260921.md 4.4절. .telegram-mock의
   상자 모양만 일반화한 것이 .messenger-mock이다. 기존 .telegram-mock은
   텔레그램 가이드가 그대로 쓰고 있어 건드리지 않았다(무의미한 diff 방지). */

.notify-provider-tabs {
  margin-bottom: 0.9rem;
}

/* 공급자 알약은 "지금 무엇을 편집 중인가"를 알려주는 탭이다. 기본
   .channel-tab-pill의 활성 표시는 배경을 한 단계 밝히는 것뿐이라(#1b2330 →
   #2a3444) 두 개만 놓고 보면 어느 쪽이 선택됐는지 읽히지 않는다 — 특히
   연동 상태 점(초록/회색)이 함께 있어 시선이 그쪽으로 간다. 테두리와 글자
   굵기를 더해 분명히 한다. 비활성에도 투명 테두리를 둬서 선택해도 크기가
   흔들리지 않게 한다. */
.notify-provider-tabs .channel-tab-pill {
  border: 1px solid transparent;
}

.notify-provider-tabs .channel-tab-pill.active {
  border-color: #3b82f6;
  font-weight: 600;
}

/* 공급자 패널은 .retention-cards를 겸하는데 그 규칙이 display:flex다 —
   UA 스타일시트의 [hidden]{display:none}보다 우선순위가 높아 hidden 속성만
   걸면 카드가 그대로 보인다. 명시적으로 눌러준다. */
[data-provider-panel][hidden] {
  display: none;
}

.messenger-mock {
  margin-top: 0.6rem;
  background: #0f141c;
  border: 1px solid #333c4a;
  border-radius: 10px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.messenger-mock.code-block {
  /* 상자 자체는 flex 컬럼이지만 코드 블록은 한 덩어리의 흐르는 텍스트다 —
     flex인 채로 두면 <mark>가 별도 플렉스 항목이 되어 URL이 줄로 쪼개진다. */
  display: block;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  color: #cdd5e0;
  max-width: 100%;
}

.messenger-mock.code-block mark {
  background: #f59e0b;
  color: #10151c;
  padding: 0 0.2rem;
  border-radius: 3px;
}

/* Discord 브랜드색(#5865F2)은 강조 요소에만 쓴다 — 카드 전체를 브랜드색으로
   칠하면 텔레그램 카드와 위계가 어긋난다. */
.discord-mock-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #a9b3c1;
}

.discord-mock-path .sep {
  color: #4b5563;
}

.discord-mock-path .cur {
  color: #e6e9ef;
  font-weight: 600;
}

.discord-mock-btn {
  align-self: flex-start;
  background: #5865f2;
  color: #fff;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
}

.discord-mock-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #cdd5e0;
  flex-wrap: wrap;
}

.discord-mock-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #5865f2;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.discord-mock-name {
  color: #e6e9ef;
  font-weight: 600;
}

.discord-mock-copy {
  margin-left: auto;
  border: 1px solid #5865f2;
  color: #a5adf6;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

.access-stats-summary {
  font-size: 0.95rem;
  color: #e6e9ef;
  margin-bottom: 1rem;
}

/* 차량/인원 출입 현황 요약 표 — "라벨 | 값 | 라벨 | 값" 2열 그리드.
   기존 .ai-events-table(단일 헤더 행 목록)과 형태가 달라 전용 스타일을
   둔다: th를 라벨, td를 값으로 써서 한 행에 두 항목을 나란히 보여준다. */
.access-stats-summary-table {
  width: 100%;
  max-width: 640px;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.access-stats-summary-table th, .access-stats-summary-table td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid #2a3444;
  text-align: left;
}

.access-stats-summary-table th {
  color: #a9b3c1;
  font-weight: 500;
  width: 25%;
  white-space: nowrap;
}

.access-stats-summary-table td {
  color: #e6e9ef;
  font-weight: 600;
  width: 25%;
}

.access-stats-summary-table.loading {
  opacity: 0.6;
}

/* 인원 출입 현황 — 최초 출입자/마지막 퇴실자 카드. .plate-panel-item과
   같은 "썸네일 + 텍스트" 배치를 재사용하되, 사이드 패널이 아니라 넓은
   retention-card 안에 들어가므로 썸네일을 조금 더 키운다. */
.count-edge-event {
  cursor: default;
}

.count-edge-event-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.count-edge-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  flex-shrink: 0;
  cursor: pointer;
}

.count-edge-thumb-empty {
  display: flex;
}

.count-edge-event-text {
  min-width: 0;
}

.count-edge-event-channel {
  font-weight: 600;
  color: #22d3ee;
  font-size: 0.95rem;
}

.count-edge-event-time {
  font-size: 0.8rem;
  color: #6b7688;
  margin-top: 0.2rem;
}

/* 대표 항목(첫 IN/마지막 OUT) 아래로 펼쳐지는 나머지 최대 4건 목록 —
   구분선으로 대표 항목과 시각적으로 분리하고, 썸네일을 줄여 목록 형태로
   보여준다. */
.count-edge-event-more {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #2a3444;
}

.count-edge-event-row-compact {
  gap: 0.6rem;
}

.count-edge-thumb-sm {
  width: 56px;
  height: 42px;
}

.count-edge-event-row-compact .count-edge-event-channel {
  font-size: 0.85rem;
  font-weight: 500;
}

.count-edge-event-row-compact .count-edge-event-time {
  font-size: 0.75rem;
}

.access-chart-card {
  flex: 1 1 480px;
  max-width: 100%;
}

.access-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 0.4rem;
}

.access-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #a9b3c1;
}

.access-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.access-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.owner-stats-card {
  flex: 1 1 100%;
  max-width: 100%;
  margin-bottom: 1.5rem;
}

.owner-basis-badge {
  font-size: 0.75rem;
  font-weight: 400;
  color: #6b7688;
  margin-left: 0.4rem;
}

.owner-table-scroll {
  overflow-x: auto;
}

.owner-unattributed {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: #6b7688;
}

.owner-usage-row {
  cursor: pointer;
}

.owner-usage-row:hover {
  background: #212a38;
}

.owner-expand-toggle {
  width: 1.5rem;
  color: #6b7688;
}

.owner-vehicle-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid #2a3444;
  font-size: 0.85rem;
}

.owner-vehicle-row a {
  color: #7dd3fc;
}

/* --- AI 검색(assistant) 채팅 패널 — docs/n100_local_llm_object_search_claude_
   handoff_20260915.md section 7.1/7.1.1. 우측 고정 FAB로 그리드뷰/단일뷰
   어디서든 열 수 있고(고정 진입점), 단일뷰 툴바의 기존 아이콘 클릭도 같은
   패널을 컨텍스트(channel_id/domain)를 채운 채로 연다(컨텍스트 진입점).
   .plate-panel과 같은 톤(#1b2330 배경, #22d3ee 포인트)을 쓰되 목록형이 아닌
   대화형 레이아웃이라 별도 클래스로 둔다. */

.assistant-fab {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 40;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid #22d3ee;
  background: #123a44;
  color: #22d3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.assistant-fab svg {
  width: 24px;
  height: 24px;
}

.assistant-fab:hover {
  transform: scale(1.05);
  background: #164a56;
}

.assistant-fab.active {
  display: none;
}

.assistant-panel-overlay {
  display: none;
}

.assistant-panel {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 41;
  width: 360px;
  height: min(600px, calc(100vh - 2.8rem));
  background: #1b2330;
  border: 1px solid #2a3444;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.assistant-panel[hidden] {
  display: none;
}

.assistant-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #2a3444;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e6e9ef;
  flex-shrink: 0;
}

.assistant-panel-subtitle {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: #6b7688;
}

.assistant-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.assistant-panel-header .icon-btn {
  width: 32px;
  height: 32px;
}

.assistant-panel-header .icon-btn svg {
  width: 16px;
  height: 16px;
}

.assistant-panel-header .icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.assistant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 1rem 0;
  flex-shrink: 0;
}

.assistant-chip {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #333f52;
  background: #0f141c;
  color: #a9b3c1;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.assistant-chip:hover {
  background: #232d3d;
  color: #e6e9ef;
  border-color: #22d3ee;
}

.assistant-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.assistant-messages::-webkit-scrollbar {
  display: none;
}

.assistant-msg {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-msg-user {
  align-self: flex-end;
  background: #123a44;
  color: #e6e9ef;
  border: 1px solid #1c5560;
}

.assistant-msg-bot {
  align-self: flex-start;
  background: #232d3d;
  color: #d5dae3;
  border: 1px solid #2a3444;
}

.assistant-msg-bot.assistant-msg-error {
  border-color: #7f2d2d;
  color: #f4b4b4;
}

.assistant-msg-status {
  align-self: flex-start;
  color: #6b7688;
  font-size: 0.78rem;
  font-style: italic;
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.assistant-suggestions .assistant-chip {
  font-size: 0.74rem;
}

.assistant-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.assistant-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #0f141c;
  border: 1px solid #2a3444;
  border-radius: 8px;
  padding: 0.45rem;
}

.assistant-card-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  flex-shrink: 0;
  cursor: pointer;
}

/* 사진이 없는(또는 못 불러온) 결과. 검은 사각형만 보이면 "사진이 원래 없는
   기록"인지 "깨진 기록"인지 구별할 수 없어 안내 문구를 넣는다 —
   docs/zone_capture_gap_when_counting_enabled_20260918.md P1. */
.assistant-card-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  background: #151b25;
  border: 1px dashed #2a3444;
  color: #7d8a9c;
  font-size: 0.58rem;
  line-height: 1.15;
  cursor: default;
  overflow: hidden;
}

.assistant-card-text {
  min-width: 0;
  font-size: 0.78rem;
}

.assistant-card-title {
  font-weight: 600;
  color: #22d3ee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-card-time {
  color: #6b7688;
  font-size: 0.72rem;
}

.assistant-more-btn {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #333f52;
  background: #0f141c;
  color: #22d3ee;
  font-size: 0.75rem;
  cursor: pointer;
}

.assistant-more-btn:hover {
  background: #232d3d;
}

.assistant-input-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid #2a3444;
  flex-shrink: 0;
}

.assistant-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #333c4a;
  background: #0f141c;
  color: #e6e9ef;
  font-size: 0.85rem;
}

.assistant-input:disabled {
  opacity: 0.6;
}

.assistant-send-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .assistant-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    height: min(78vh, 620px);
    border-radius: 16px 16px 0 0;
  }

  .assistant-fab {
    right: 1rem;
    bottom: 1rem;
  }

  .assistant-panel-overlay:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 40;
  }
}

/* --- 프라이버 마스킹(고정 영역) 설정 --- */
.pm-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
  color: #c3ccd8;
}
.pm-empty {
  color: #7c8798;
  font-size: 12px;
  padding: 14px 4px;
  text-align: center;
  border: 1px dashed #2c3442;
  border-radius: 6px;
}
.pm-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pm-side-head .pm-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 긴 안내 문구는 인라인 문단 대신 물음표 툴팁으로 — 설정 화면 본문은 짧게 */
.pm-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #4a5666;
  color: #9aa4b2;
  font-size: 11px;
  line-height: 1;
  cursor: help;
  position: relative;
  flex: none;
}
.pm-help:hover { border-color: #00e5ff; color: #00e5ff; }
.pm-help::after {
  content: attr(data-tip);
  position: absolute;
  top: 130%;
  right: 0;
  width: 250px;
  padding: 9px 11px;
  border: 1px solid #2c3442;
  border-radius: 6px;
  background: #11161d;
  color: #c3ccd8;
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s;
  z-index: 20;
  pointer-events: none;
}
.pm-help:hover::after { opacity: 1; visibility: visible; }

.pm-region-row {
  border: 1px solid #2c3442;
  border-radius: 5px;
  margin-bottom: 3px;
  background: #151a22;
}
.pm-region-row.is-open {
  border-color: #00e5ff;
  background: #16202a;
}
.pm-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.5;
}
.pm-row-head input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  flex: none;
}
.pm-row-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e6ebf2;
}
.pm-row-type {
  color: #8b95a3;
  font-size: 12px;
  flex: none;
}
.pm-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid #3a4453;
  flex: none;
}
.pm-region-num {
  color: #7c8798;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 12px;
}
.pm-row-body {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 6px;
  border-top: 1px solid #222a35;
}
.pm-row-body input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  background: #0e1218;
  border: 1px solid #2c3442;
  border-radius: 4px;
  color: #e6ebf2;
  padding: 3px 6px;
  font-size: 12px;
}
.pm-row-body select {
  flex: none;
  width: 76px;
  background: #0e1218;
  border: 1px solid #2c3442;
  border-radius: 4px;
  color: #e6ebf2;
  padding: 3px 4px;
  font-size: 12px;
}
.pm-row-body input[type="color"] {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid #2c3442;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  flex: none;
}
.pm-row-body input[type="range"].pm-strength {
  width: 68px;
  flex: none;
}
.link-danger {
  background: none;
  border: none;
  color: #e06c6c;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  flex: none;
}
.link-danger:hover { color: #ff8a8a; }
#pm-canvas { cursor: crosshair; }

/* 버튼은 다른 설정 탭과 같은 모양으로 — 파랑 채움(주 동작) / 외곽선(보조) */
#pm-save-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
#pm-save-btn:hover { background: #2f74e0; }
#pm-save-btn:disabled { opacity: 0.6; cursor: default; }
#pm-add-btn {
  padding: 5px 10px;
  border: 1px solid #3a4453;
  border-radius: 5px;
  background: transparent;
  color: #c3ccd8;
  font-size: 12px;
  cursor: pointer;
}
#pm-add-btn:hover { border-color: #3b82f6; color: #fff; }

/* 영상 크기 제한을 여기서 따로 걸지 않는다. 예전에는
   `#privacy-mask .ai-video-col { max-width: 640px }`로 영상만 좁혔는데,
   .ai-layout의 왼쪽 트랙은 여전히 1fr(≈780px)이라 줄어든 140px이 영상과
   오른쪽 카드 사이의 빈 공간으로 남았다 — 카드가 영상에서 떨어져 떠 보였다.
   영상이 화면을 다 먹지 않게 하는 일은 이미 .ai-detect의 max-width와
   .ai-layout의 고정 580px 오른쪽 트랙이 하고 있고, 같은 구조를 쓰는 AI 감지
   화면이 그 증거다. 폭을 다시 제한해야 하면 영상이 아니라 **트랙**을 줄일 것
   (예: grid-template-columns: minmax(280px, 640px) 580px + justify-content:
   start). 아니면 빈 공간이 그대로 돌아온다. */

/* 데이터 관리 탭만 넓게 쓴다. 저장 시간대 격자가 24칸이라 기본 900px
   컨테이너에 들어가지 않는데, 그 카드만 삐져나오면 위의 두 카드(보존 기간·
   오래된 이력 삭제)가 상대적으로 작아 보여 화면이 어긋난다. 한 탭만 넓히려고
   .retention-cards 자체를 건드리지 않는 이유는, 차단기·알림·챗봇·라이선스·
   언어 탭이 같은 클래스를 쓰고 그 화면들은 900px가 적당하기 때문이다.
   1400px는 AI 감지/프라이버 마스킹 화면의 .ai-detect와 같은 값이다. */
.retention-cards-wide { max-width: 1400px; }

/* --- 채널별 이미지 저장 시간대 (docs/capture_schedule_design_20260918.md) ---
   격자가 24칸이라 다른 retention-card와 나란히 두면 칸이 눌린다. 한 행을
   통째로 쓰게 하고, 좁은 화면에서는 격자만 가로 스크롤한다. */
/* 데이터 관리 「사진 저장 시간」 — 이벤트 스케줄 요약(2026-11-24, 옛 이미지 저장 시간대 카드 자리) */
.photo-off-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.photo-off-moved { font-size: 11px; font-weight: 600; color: #93c5fd; background: #172554; border-radius: 4px; padding: 1px 6px; }
.photo-off-label { font-size: 0.85rem; color: #a9b3c1; margin: 4px 0 8px; }
.photo-off-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.photo-off-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: #161d28; border: 1px solid #26303d; border-radius: 8px; padding: 7px 10px; }
.photo-off-row b { font-size: 12px; background: #2a3442; border-radius: 4px; padding: 1px 6px; }
.photo-off-row .k { color: #c3cad6; }
.photo-off-row .w { margin-left: auto; color: #a9b3c1; }
.photo-off-none { font-size: 12px; color: #8a94a6; }
.photo-off-row.legacy { border-style: dashed; border-color: #5b4a1a; }
.photo-off-row.legacy .k { color: #fbbf24; }
.photo-off-link { display: inline-block; margin-top: 12px; border: 1px solid #22d3ee; color: #22d3ee; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; text-decoration: none; }
.photo-off-link:hover { background: #12262e; }

.capture-schedule-card {
  flex: 1 1 100%;
  gap: 0;
  /* flex 아이템의 기본 min-width:auto는 콘텐츠의 min-content(격자 24칸 =
     약 934px)보다 좁아지지 못하게 막는다. 그대로 두면 창이 좁을 때 카드가
     컨테이너를 뚫고 나가 **페이지 전체**가 가로 스크롤된다 — .cs-gridscroll을
     둔 의도(격자만 스크롤)가 무력화된다. */
  min-width: 0;
}

.cs-toprow {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.6rem;
  align-items: flex-end;
  padding: 0.4rem 0 1rem;
  border-bottom: 1px solid #26303d;
  margin-bottom: 1rem;
}

.cs-field { display: flex; flex-direction: column; }
.cs-field label { margin-top: 0; margin-bottom: 0.35rem; font-size: 0.85rem; color: #a9b3c1; }

.cs-switch { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; user-select: none; }
.cs-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cs-track {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #2a3341;
  border: 1px solid #333c4a;
  position: relative;
  transition: background .13s;
  flex: none;
}
.cs-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8b97a8;
  transition: transform .13s, background .13s;
}
.cs-switch input:checked + .cs-track { background: #2b5fb4; border-color: #3b82f6; }
.cs-switch input:checked + .cs-track::after { transform: translateX(18px); background: #fff; }
.cs-switch input:focus-visible + .cs-track { outline: 2px solid #3b82f6; outline-offset: 2px; }
.cs-switch-text b { font-weight: 600; }
.cs-switch-text span { display: block; color: #6b7688; font-size: 0.76rem; }

.cs-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.cs-plabel { color: #6b7688; font-size: 0.78rem; }
.cs-presets button,
.cs-quickdays button,
#cs-apply {
  font: inherit;
  font-size: 0.83rem;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #333c4a;
  background: #232c39;
  color: #e6e9ef;
  padding: 0.4rem 0.75rem;
}
.cs-presets button:hover,
.cs-quickdays button:hover,
#cs-apply:hover { border-color: #46525f; background: #283242; }

.cs-gridscroll { overflow-x: auto; padding-bottom: 0.25rem; }
.cs-grid {
  --cs-cell: 34px;      /* 행 높이 + 좁은 화면에서의 칸 최소 너비 */
  --cs-label: 46px;
  display: grid;
  /* 칸 너비는 고정하지 않고 카드 폭을 채우게 둔다. 고정 34px로 두면 넓은
     화면에서 격자 오른쪽에 카드 절반만 한 빈 공간이 남아 카드가 비어 보였다.
     minmax()의 아래쪽 값 덕분에 좁은 화면에서는 칸이 뭉개지는 대신 min-width:
     min-content가 걸려 .cs-gridscroll이 가로 스크롤된다. */
  grid-template-columns: var(--cs-label) repeat(24, minmax(var(--cs-cell), 1fr));
  gap: 3px;
  min-width: min-content;
  touch-action: pan-y;
}
.cs-grid.is-off { opacity: 0.35; pointer-events: none; }

.cs-corner, .cs-hhead, .cs-dhead {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cs-corner { color: #6b7688; font-size: 0.62rem; }
.cs-hhead { color: #93a0b4; font-size: 0.68rem; height: 22px; }
.cs-dhead {
  color: #93a0b4;
  font-size: 0.8rem;
  height: var(--cs-cell);
  justify-content: flex-start;
  padding-left: 2px;
}
.cs-corner:hover, .cs-hhead:hover, .cs-dhead:hover { color: #e6e9ef; }

.cs-cell {
  height: var(--cs-cell);
  border-radius: 4px;
  background: #222b38;
  border: 1px solid #2b3543;
  padding: 0;
  cursor: pointer;
  transition: background .06s, border-color .06s;
}
.cs-cell[data-on="1"] { background: #2f6fd0; border-color: #4b8ae6; }
.cs-cell[data-preview="on"] { background: #4b8ae6; border-color: #7fb0f2; }
.cs-cell[data-preview="off"] { background: #2b3543; border-color: #46525f; }
.cs-grid .cs-sep { border-left: 1px solid rgba(255, 255, 255, 0.09); }
.cs-cell:focus-visible, .cs-hhead:focus-visible, .cs-dhead:focus-visible, .cs-corner:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.cs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: #6b7688;
  font-size: 0.76rem;
  margin-top: 0.65rem;
}
.cs-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  vertical-align: -1px;
  margin-right: 5px;
}
.cs-swatch.on { background: #2f6fd0; border: 1px solid #4b8ae6; }
.cs-swatch.off { background: #222b38; border: 1px solid #2b3543; }

.cs-summary {
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  background: #151c26;
  border: 1px solid #26303d;
  border-radius: 8px;
  font-size: 0.87rem;
}
.cs-summary.is-empty { color: #f87171; }
.cs-summary-total { color: #a9b3c1; }
.cs-summary-lines { margin: 0.2rem 0 0; padding: 0; list-style: none; }
.cs-summary-lines li { padding: 2px 0; }
.cs-summary-day { color: #93a0b4; display: inline-block; min-width: 62px; }
.cs-summary-carry { color: #6b7688; font-size: 0.78rem; margin-top: 0.45rem; }

.cs-detail {
  margin-top: 1rem;
  border: 1px solid #26303d;
  border-radius: 8px;
  background: #151c26;
}
.cs-detail > summary {
  padding: 0.7rem 0.95rem;
  cursor: pointer;
  font-size: 0.87rem;
  user-select: none;
}
.cs-detail-body { padding: 0.25rem 0.95rem 1rem; border-top: 1px solid #26303d; }
.cs-drow { display: flex; flex-wrap: wrap; gap: 0.9rem 1.25rem; align-items: flex-end; margin-top: 0.9rem; }
.cs-daypick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cs-daypick label {
  border: 1px solid #333c4a;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.83rem;
  cursor: pointer;
  user-select: none;
  background: #1a222e;
  margin-top: 0;
  color: #e6e9ef;
}
.cs-daypick input { position: absolute; opacity: 0; width: 0; height: 0; }
.cs-daypick label:has(input:checked) { background: #2b5fb4; border-color: #3b82f6; color: #fff; }
.cs-daypick label:has(input:focus-visible) { outline: 2px solid #3b82f6; outline-offset: 1px; }
.cs-applyline { color: #a9b3c1; font-size: 0.83rem; margin-top: 0.9rem; }

.cs-footrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #26303d;
}
.cs-footnote { color: #6b7688; font-size: 0.78rem; flex: 1 1 260px; min-width: 200px; }
/* .button-row 안이 아니라서 .button-row button.primary가 닿지 않는다 — 같은
   모양을 여기서 준다. flex:1은 일부러 빼: 이 버튼은 행 전체를 채우지 않는다. */
.capture-schedule-card #cs-copyto {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  min-width: 190px;
}
.capture-schedule-card #cs-save {
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.capture-schedule-card #cs-save:hover { background: #2f74e0; }
.capture-schedule-card #cs-result { margin-top: 0.6rem; text-align: right; }

@media (max-width: 720px) {
  .cs-grid { --cs-cell: 28px; --cs-label: 38px; }
}

/* --- 데이터 보관 카드 (docs/retention_overwrite_mode_review_20260918.md) --- */
.retention-banner {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid #7f2c2c;
  border-left: 3px solid #f87171;
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  color: #fca5a5;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0.3rem;
}

/* 연기 2차 확인 상태 배너 — 일부러 끈 경우·일부러 CPU를 고른 경우는 노란 info */
.retention-banner.info {
  background: rgba(251, 191, 36, 0.10);
  border-color: #6b5313;
  border-left-color: #fbbf24;
  color: #fcd34d;
}
.smoke-verifier-banner .field-help { margin-left: 0.2rem; }

.retention-days-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.retention-card .retention-days-row input[type="number"] { width: 6.5rem; flex: none; }
.retention-card .retention-days-row input:disabled { opacity: 0.4; }
.retention-unit { color: #a9b3c1; font-size: 0.85rem; }
.retention-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0 !important;
  color: #a9b3c1;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.retention-overwrite {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem !important;
  color: #e6e9ef !important;
  font-size: 0.9rem !important;
  cursor: pointer;
  user-select: none;
}

/* 설정값이 아니라 지금 실제로 며칠이 남아 있는지 — 저장 한도를 30일로 잡아도
   디스크가 18일치밖에 못 담으면 여기에 18일로 나온다. 이 줄이 없으면 사용자가
   설정값을 실제 보관 기간으로 오해한다(설계문서 S2). */
.retention-actual {
  margin-top: 0.8rem;
  padding: 0.6rem 0.75rem;
  background: #151c26;
  border: 1px solid #26303d;
  border-radius: 6px;
  color: #a9b3c1;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* 대시보드 최상단 배너 — tactical 테마 위에 올라가므로 폭을 직접 잡는다. */
.retention-banner-global {
  margin: 0.8rem 1.2rem 0;
  border-radius: 8px;
}

/* --- 시스템 현황 (docs/system_status_page_design_20260918.md) --- */
.sys-page { display: flex; flex-direction: column; gap: 1.2rem; max-width: 1180px; }
.sys-card { flex: 1 1 100%; gap: 0; }

.sys-verdict {
  display: flex; align-items: flex-start; gap: 0.9rem;
  padding-bottom: 1rem; margin-bottom: 1.1rem;
  border-bottom: 1px solid #26303d;
}
.sys-dot {
  width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; flex: none;
  background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .15);
}
.sys-verdict.warn .sys-dot { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .15); }
.sys-verdict.bad .sys-dot { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .15); }
.sys-verdict-title { font-size: 1.15rem; font-weight: 700; }
.sys-verdict.warn .sys-verdict-title { color: #fbbf24; }
.sys-verdict.bad .sys-verdict-title { color: #f87171; }
.sys-verdict-sub { color: #a9b3c1; font-size: .88rem; margin-top: 2px; }

.sys-bars { display: flex; flex-direction: column; gap: 0.85rem; }
.sys-bar-row {
  display: grid; grid-template-columns: 110px 1fr 48px 190px;
  align-items: center; gap: 0.9rem;
}
.sys-bar-label { font-size: .88rem; display: flex; align-items: center; gap: 0.35rem; }
.sys-bar-track {
  height: 16px; border-radius: 8px; background: #222b38;
  border: 1px solid #26303d; overflow: hidden;
}
.sys-bar-fill {
  height: 100%; border-radius: 8px 0 0 8px; background: #3b82f6;
  transition: width .35s ease, background .25s;
}
.sys-bar-fill.ok { background: #34d399; }
.sys-bar-fill.warn { background: #fbbf24; }
.sys-bar-fill.bad { background: #f87171; }
/* 값이 없을 때는 막대를 비워 둔다 — 0%를 초록으로 칠하면 "한가함"으로 읽힌다. */
.sys-bar-fill.none { background: #333c4a; }
.sys-bar-pct { text-align: right; font-variant-numeric: tabular-nums; font-size: .88rem; font-weight: 600; }
.sys-bar-raw { color: #6b7688; font-size: .78rem; font-variant-numeric: tabular-nums; }

.sys-tablescroll { overflow-x: auto; }
.sys-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.sys-table th {
  text-align: left; color: #6b7688; font-weight: 500; font-size: .76rem;
  padding: 0 10px 8px; border-bottom: 1px solid #26303d; white-space: nowrap;
}
.sys-table td { padding: 11px 10px; border-bottom: 1px solid #1f2733; vertical-align: top; }
.sys-table tr:last-child td { border-bottom: none; }
.sys-table tr.sys-off { opacity: .45; }
.sys-name { font-weight: 600; }
.sys-sub { color: #6b7688; font-size: .76rem; margin-top: 2px; }
.sys-dim { color: #6b7688; font-variant-numeric: tabular-nums; }

/* --- 시스템 상태 「네트워크」(2026-11-24, app/net_monitor.py) --- */
.sys-net { gap: .85rem; }
.sys-net h3 { margin: 0; font-size: 1.05rem; }
.sys-net-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.sys-net-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.sys-net-badge {
  display: inline-flex; align-items: center; gap: .4rem; padding: 3px 10px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; background: rgba(148, 163, 184, .14); color: #a9b3c1;
}
.sys-net-badge i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sys-net-badge.ok { background: rgba(52, 211, 153, .14); color: #34d399; }
.sys-net-badge.warn { background: rgba(251, 191, 36, .14); color: #fbbf24; }
.sys-net-badge.bad { background: rgba(248, 113, 113, .14); color: #f87171; }
.sys-net-reason { color: #a9b3c1; font-size: .84rem; }
.sys-net-now { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; }
.sys-net-val { display: inline-flex; align-items: baseline; gap: .35rem; color: #a9b3c1; font-size: .82rem; }
.sys-net-val b { color: #e6e9ef; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.sys-net-val i { width: 14px; height: 3px; border-radius: 2px; align-self: center; }
.sys-net-val.rx i { background: #60a5fa; }
.sys-net-val.tx i { background: #fb923c; }
.sys-net-period { display: flex; border: 1px solid #2f3a49; border-radius: 8px; overflow: hidden; }
.sys-net-period button {
  background: transparent; color: #a9b3c1; border: 0; padding: 6px 12px; font-size: .82rem; min-height: 32px; cursor: pointer;
}
.sys-net-period button[aria-pressed="true"] { background: #1e3a5f; color: #e6e9ef; font-weight: 600; }
.sys-net-chart { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
.sys-net-y { position: relative; height: 180px; font-size: .7rem; color: #8a94a6; text-align: right; font-variant-numeric: tabular-nums; }
.sys-net-y span { position: absolute; right: 0; transform: translateY(-50%); }
.sys-net-plot { position: relative; height: 180px; min-width: 0; }
.sys-net-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sys-net-marks { position: absolute; inset: 0; pointer-events: none; }
.sys-net-mark {
  position: absolute; top: 4px; background: #3a1f24; color: #fecaca; border: 1px solid #7f1d1d;
  border-radius: 6px; padding: 2px 8px; font-size: .74rem; white-space: nowrap;
}
.sys-net-x { display: flex; justify-content: space-between; margin-left: 48px; font-size: .7rem; color: #8a94a6; }
.sys-net-bandrow { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: center; font-size: .7rem; color: #8a94a6; }
.sys-net-bandrow > span { text-align: right; }
.sys-net-band { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #222b38; }
.sys-net-band i { display: block; height: 100%; }
.sys-net-band i.ok { background: #34d399; }
.sys-net-band i.warn { background: #fbbf24; }
.sys-net-band i.bad { background: #f87171; }
.sys-net-band i.none { background: #333c4a; }
.sys-net-hosts { display: flex; flex-wrap: wrap; gap: .6rem; }
.sys-net-host {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; border-radius: 8px;
  background: #161d27; border: 1px solid #26303d; min-width: 0;
}
.sys-net-host.warn { border-color: #6b5313; }
.sys-net-host.bad { border-color: #7f1d1d; }
.sys-net-host > i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #34d399; }
.sys-net-host.warn > i { background: #fbbf24; }
.sys-net-host.bad > i { background: #f87171; }
.sys-net-host b { display: block; font-size: .84rem; }
.sys-net-host small { display: block; font-size: .76rem; color: #a9b3c1; overflow-wrap: anywhere; }
.sys-net-foot {
  display: flex; flex-wrap: wrap; gap: .35rem 1.3rem; padding-top: .75rem; border-top: 1px solid #26303d;
  font-size: .8rem; color: #a9b3c1; font-variant-numeric: tabular-nums;
}
.sys-net-foot .up::before, .sys-net-foot .down::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #34d399;
}
.sys-net-foot .down::before { background: #f87171; }
@media (max-width: 640px) {
  .sys-net-y, .sys-net-plot { height: 150px; }
}
.sys-num { font-variant-numeric: tabular-nums; }
.sys-pill {
  display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: .72rem;
  border: 1px solid #26303d; background: #202836; color: #a9b3c1;
  margin: 0 4px 4px 0; white-space: nowrap;
}
.sys-pill.on { background: rgba(59, 130, 246, .16); border-color: #2f5b96; color: #a8c8f5; }
.sys-pill.ok { background: rgba(52, 211, 153, .14); border-color: #2c6b53; color: #86efac; }
.sys-pill.bad { background: rgba(248, 113, 113, .14); border-color: #7f2c2c; color: #fca5a5; }
.sys-pill.lock { opacity: .55; }

/* 설정 › 카메라: 채널 목록 + 편집 창(채널별 저장). 표·알약은 시스템 상태와 같은 모양. */
.cam-table td { vertical-align: middle; }
.cam-table tr.cam-off td:not(:last-child) { opacity: .45; }
.cam-addr { word-break: break-all; font-variant-numeric: tabular-nums; }
.cam-edit-panel { max-width: 560px; }
.cam-list-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cam-list-head h3 { margin-right: auto; }
.cam-list-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.cam-list-actions .primary { background: #3b82f6; color: #fff; border: none; border-radius: 6px; padding: .35rem .8rem; cursor: pointer; font-size: .8rem; }
.cam-list-actions a.events-clear-btn { text-decoration: none; display: inline-block; }
.cam-test-head > span:last-child { display: flex; gap: .3rem; }
.cam-edit-panel .cam-check { display: flex; align-items: center; gap: 0.45rem; color: #e6e9ef; }
.cam-edit-panel .cam-check input { width: auto; }
.cam-fields { display: flex; flex-direction: column; gap: 0.3rem; }
.cam-fields[hidden] { display: none; }
.cam-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.cam-row2 > div { display: flex; flex-direction: column; gap: 0.3rem; }
.cam-test-card {
  margin-top: 0.9rem; padding: 0.7rem 0.8rem; border: 1px solid #26303d;
  border-radius: 8px; background: #151c27;
}
.cam-test-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-size: .85rem; color: #a9b3c1; }
.cam-test-result:empty { display: none; }
.cam-test-result { margin-top: 0.6rem; font-size: .84rem; }
.cam-test-title { font-weight: 600; color: #a9b3c1; }
.cam-test-title.ok { color: #86efac; }
.cam-test-title.bad { color: #f87171; }
.cam-test-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0.45rem 0 0; }
.cam-test-grid dt { color: #6b7688; }
.cam-test-grid dd { margin: 0; color: #e6e9ef; font-variant-numeric: tabular-nums; word-break: break-all; }
@media (max-width: 560px) { .cam-row2 { grid-template-columns: 1fr; } }

/* 설명은 한 줄로 두고 입력/버튼은 그 아래 한 행에 모은다 — 같은 행에 두면
   라벨 높이 차이로 설명만 아래로 처져 어긋나 보인다. */
.sys-restart-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; }
.sys-restart-desc { color: #a9b3c1; font-size: .85rem; margin-bottom: 0.9rem; }
.sys-restart-row .cs-field input { min-width: 260px; }
.sys-page .events-clear-btn { white-space: nowrap; }
.sys-restart-log { color: #6b7688; font-size: .78rem; margin-top: 0.5rem; }

@media (max-width: 800px) {
  .sys-bar-row { grid-template-columns: 92px 1fr 44px; }
  .sys-bar-raw { grid-column: 1 / -1; padding-left: 92px; }
  .sys-table { min-width: 720px; }
}

/* 시스템 상태와 아래 설정 항목들을 가르는 선. 이 메뉴에서 유일하게
   "설정하는 곳"이 아니라 "보는 곳"이라 성격이 다름을 드러낸다. */
.settings-nav-divider {
  height: 1px;
  background: #26303d;
  margin: 0.5rem 0.9rem;
}

/* ==========================================================================
   모바일 레이아웃 — 설정 계열 화면
   (settings / vehicle_registry / access_stats / count_stats 가 공유하는
    .settings-shell = 232px 고정 사이드바 + 본문의 가로 2열)
   --------------------------------------------------------------------------
   좁은 화면에서도 사이드바가 232px을 그대로 차지해, 360px 단말에서는 본문에
   130px 안팎만 돌아갔다. 그래서 카드 제목이 한 글자씩 세로로 쪼개지고
   ("차 단 기 제 어"), 표와 입력칸이 화면 밖으로 잘려 나갔다.
   (2026-09-23 모바일 실기 제보)

   데스크톱 레이아웃은 건드리지 않는다 — 768px 이하에서만 세로로 쌓고
   사이드바를 가로 탭 줄로 바꾼다.
   ========================================================================== */
@media (max-width: 768px) {
  .settings-shell {
    flex-direction: column;
  }

  /* 사이드바 → 화면 상단에 붙는 가로 스크롤 탭 줄. 항목이 12개라 접어
     넣으면 4~5줄을 먹는다. 가로 스크롤이 본문을 가장 적게 밀어낸다. */
  .settings-sidebar {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.7rem;
    border-right: none;
    border-bottom: 1px solid #232d3d;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .settings-sidebar::-webkit-scrollbar { display: none; }

  /* "설정 메뉴"는 세로 목록의 머리말이라 가로 줄에서는 자리만 먹는다 */
  .settings-nav-label { display: none; }

  .settings-nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
  }

  /* 시스템 상태와 나머지를 가르는 선도 가로 방향으로 세운다 */
  .settings-nav-divider {
    flex: 0 0 1px;
    width: 1px;
    height: 20px;
    margin: 0 0.25rem;
  }

  .settings-main,
  .history-main { padding: 1rem 0.8rem; }
  .settings-breadcrumb { margin-bottom: 0.75rem; }

  /* 고정 폭 카드는 화면 폭을 따라간다 */
  .admin-box,
  .settings-box,
  .vehicle-form-panel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.2rem;
  }

  /* 입력칸이 칸 밖으로 비어져 나가지 않게 (카메라 IP/포트, 웹훅 URL 등) */
  .settings-main input,
  .settings-main select,
  .settings-main textarea,
  .history-main input,
  .history-main select,
  .history-main textarea {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 검색·필터 줄: 입력이 180px을 고집해 버튼이 줄 밖으로 밀려났다 */
  .history-filters { gap: 0.45rem; }
  .history-filters input[type="text"] {
    min-width: 0;
    flex: 1 1 100%;
  }

  /* 표는 칸을 세로로 쪼개는 대신 표 안에서만 가로로 스크롤시킨다.
     래퍼 div 없이 놓인 표가 많아(사용자 목록, 차량 목록, 통계) 표 자체를
     스크롤 상자로 만든다. */
  .settings-main table,
  .history-main table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 머리글과 행 안의 버튼은 끊기면 못 읽는다. 본문 칸은 그대로 줄바꿈을
     허용한다 — 전부 nowrap으로 묶으면 표가 쓸데없이 넓어진다. */
  .settings-main th,
  .history-main th { white-space: nowrap; }
  .settings-main td button,
  .history-main td button { white-space: nowrap; }

  /* 한글은 어절 가운데서 끊지 않는다 — "역 할 변 경"처럼 쪼개지던 곳 */
  .settings-main th,
  .settings-main td,
  .history-main th,
  .history-main td { word-break: keep-all; }

  /* 시스템 상태 표는 이미 .sys-tablescroll이 감싸고 있다(min-width 720px).
     위의 표 규칙이 겹쳐 걸리지 않도록 되돌린다. */
  .sys-tablescroll table { display: table; }

  /* ? 도움말 풍선이 화면 밖으로 나가지 않게 */
  .pm-help::after {
    width: min(250px, calc(100vw - 3rem));
  }
}

/* 설정 > AI 감지 > 연기 감지 탭 — 확인 시간·감도·재알림 슬라이더 */
.smoke-range-row { display: grid; grid-template-columns: 90px 1fr 52px; align-items: center; gap: .5rem; margin: .35rem 0; }
.smoke-range-row input[type=range] { width: 100%; }
.smoke-range-row output { text-align: right; font-variant-numeric: tabular-nums; }
.smoke-range-row select { justify-self: start; min-width: 7rem; }

/* 연기 오탐 학습 — 설정 › AI › 연기 감지 (app/smoke/fa_learning.py) */
.smoke-fa-h {
  margin: 0.8rem 0 0.4rem;
  font-size: 0.85rem;
  color: #a9b3c1;
}
.smoke-fa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}
.smoke-fa-card {
  border: 1px solid #333c4a;
  border-radius: 6px;
  padding: 0.4rem;
  font-size: 0.78rem;
  color: #a9b3c1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.smoke-fa-card.is-off { opacity: 0.55; }
.smoke-fa-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #000;
  display: block;
}
.smoke-fa-noimg {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111720;
  border-radius: 4px;
}
.smoke-fa-meta div { overflow-wrap: anywhere; }
.smoke-fa-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.smoke-fa-btn {
  padding: 0.35rem 0.6rem;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  background: transparent;
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.78rem;
}
.smoke-fa-btn:disabled { opacity: 0.5; cursor: default; }
/* 1.0.23 지금 어느 채널에도 없는 카메라의 경보·등록 — 「이전 카메라」 */
.smoke-prev-tag { font-size: 0.72rem; padding: 0.05rem 0.45rem; border: 1px solid #4a5768; border-radius: 6px; color: #9aa7b6; margin-left: 0.35rem; white-space: nowrap; cursor: help; }
.smoke-fa-actions .zone-delete { font-size: 0.78rem; padding: 0.35rem 0.6rem; }

/* --- 세그먼트 버튼(여럿 중 하나 고르기) ---------------------------------------
   smoke.html 인라인 .sk-seg 와 같은 모양을 공용으로 둔다. 고른 칸은 aria-pressed="true". */
.seg-group {
  display: inline-flex; background: #10151c; border: 1px solid #2b3647;
  border-radius: 10px; padding: 3px; gap: 2px;
}
.seg-group button {
  border: 0; background: transparent; color: #8b97a8; font: inherit; font-size: .82rem;
  padding: .32rem .8rem; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg-group button[aria-pressed="true"] { background: #232d3d; color: #e6e9ef; font-weight: 600; }
.seg-group button:not(:disabled):not([aria-pressed="true"]):hover { color: #c7cfdb; }
.seg-group button:disabled { cursor: default; opacity: .5; }

/* --- 설정 › AI 학습 (tab=ai_training) ------------------------------------------
   카드 바탕(.retention-card)·막대(.sys-bar-*)·표(.sys-table)·? 도움말(.field-help)은
   기존 클래스를 그대로 쓰고, 여기는 배치와 상태 알약·결과 팝업만 둔다. */
.ait-page { display: flex; flex-direction: column; gap: 1.2rem; max-width: 1180px; }
.ait-msg { color: #a9b3c1; font-size: .9rem; }
.ait-msg[hidden] { display: none; }
.ait-body { display: flex; flex-direction: column; gap: 1.2rem; }
.ait-body[hidden] { display: none; }

.ait-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.ait-title { margin: 0; font-size: 1.4rem; display: flex; align-items: center; }
.ait-sub { margin: .35rem 0 0; color: #8b97a8; font-size: .9rem; }
.ait-head-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ait-night {
  padding: .35rem .8rem; border-radius: 999px; border: 1px solid #2b3647;
  background: #1b2330; color: #a9b3c1; font-size: .82rem; white-space: nowrap;
}

/* 버튼: 기본은 회색 테두리, .primary 는 설정 화면 저장 버튼과 같은 파랑 */
.ait-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 .95rem; border: 1px solid #2b3647; border-radius: 8px;
  background: #10151c; color: #c7cfdb; font: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ait-btn:hover:not(:disabled) { border-color: #3b4a60; color: #e6e9ef; }
.ait-btn.primary { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.ait-btn.primary:hover:not(:disabled) { background: #2f74e0; border-color: #2f74e0; color: #fff; }
.ait-btn:disabled { opacity: .45; cursor: default; }
/* 꺼진 버튼은 파란 버튼도 회색으로 — 눌러지는 것처럼 보이지 않게(이 화면 범위) */
.ait-page .ait-btn:disabled, .ait-page .ait-btn.primary:disabled {
  background: #1f2733; border-color: #2b3647; color: #6b7686; opacity: 1;
}
.ait-btn.small { min-height: 30px; padding: 0 .7rem; font-size: .78rem; }

.ait-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem;
}
.ait-steps li {
  padding: .75rem .9rem; border-radius: 10px; background: #1b2330; border: 1px solid #26303d;
  display: flex; flex-direction: column; gap: 2px; font-size: .9rem; min-width: 0;
}
.ait-step-no { color: #8b97a8; font-size: .75rem; font-variant-numeric: tabular-nums; }
.ait-step-sub { color: #8b97a8; font-size: .76rem; }

.ait-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ait-card { gap: .85rem; padding: 1.2rem; border: 1px solid #26303d; min-width: 0; }
.ait-card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.ait-card-head h3 { margin: 0; font-size: 1.05rem; }
.ait-summary { margin: 0; color: #a9b3c1; font-size: .86rem; }

/* 상태 알약 — 학습 가능·적용 중=초록, 모으는 중=노랑, 학습 중·확인 대기=파랑, 준비 중·자료 없음=회색 */
.ait-state {
  display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem;
  border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap;
  background: rgba(148, 163, 184, .14); color: #a9b3c1;
}
.ait-state-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.ait-state.ok { background: rgba(52, 211, 153, .12); color: #6ee7b7; }
.ait-state.warn { background: rgba(251, 191, 36, .12); color: #fcd34d; }
.ait-state.info { background: rgba(59, 130, 246, .16); color: #93c5fd; }

.ait-mode { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.ait-mode-label { color: #a9b3c1; font-size: .85rem; display: flex; align-items: center; }
.ait-mode-locked { flex-basis: 100%; font-size: .8rem; color: #fbbf24; }

/* 막대는 시스템 상태와 같은 클래스 — 카드 폭에 맞게 칸만 좁힌다(라벨 | 막대 | 값) */
.ait-bars { gap: .6rem; }
.ait-card .sys-bar-row { grid-template-columns: 92px minmax(0, 1fr) minmax(76px, auto); gap: .7rem; }
.ait-card .sys-bar-track { height: 10px; }
.ait-bar-val { white-space: nowrap; }
.ait-card.is-off .sys-bars { opacity: .55; }

.ait-active-line {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap;
  font-size: .8rem; font-variant-numeric: tabular-nums;
}
.ait-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap;
  margin-top: auto; padding-top: .8rem; border-top: 1px solid #26303d;
}
.ait-foot-text { color: #8b97a8; font-size: .8rem; font-variant-numeric: tabular-nums; }
.ait-hl { color: #93c5fd; }
/* 줄이 접혀도 버튼은 오른쪽에 */
.ait-foot > .ait-btn, .ait-active-line > .ait-btn, .ait-foot-btns { margin-left: auto; }
.ait-foot-btns { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
/* 경고(적용했지만 지금은 처음 AI, 저장 실패 등) */
.ait-warn { color: #fcd34d; }
.ait-warn-line { font-size: .8rem; color: #fcd34d; }
.ait-card .test-result { margin-top: 0; }

.ait-history h3 { margin: 0 0 .8rem; }
.ait-history .sys-table td { vertical-align: middle; }

/* 결과 팝업(.modal-overlay 안) */
.ait-modal {
  background: #1b2330; border: 1px solid #2b3647; border-radius: 14px; width: 100%; max-width: 600px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); overflow: hidden;
}
.ait-modal-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; border-bottom: 1px solid #26303d; }
.ait-modal-head h3 { margin: 0; flex: 1; font-size: 1.05rem; }
.ait-x {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
  color: #8b97a8; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.ait-x:hover { background: #232d3d; color: #e6e9ef; }
.ait-modal-body { padding: 1.1rem; display: flex; flex-direction: column; gap: .9rem; }
.ait-modal-foot { display: flex; align-items: center; gap: .5rem; padding: .9rem 1.1rem; border-top: 1px solid #26303d; }
.ait-modal-foot .ait-foot-text { flex: 1; }

.ait-verdict {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .75rem .9rem; border-radius: 10px; border: 1px solid;
}
.ait-verdict-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ait-verdict-sub { color: #a9b3c1; font-size: .84rem; }
.ait-verdict.ok { background: rgba(52, 211, 153, .10); border-color: rgba(52, 211, 153, .33); }
.ait-verdict.ok strong { color: #6ee7b7; }
.ait-verdict.ok .ait-verdict-dot { background: #34d399; }
.ait-verdict.warn { background: rgba(251, 191, 36, .10); border-color: rgba(251, 191, 36, .33); }
.ait-verdict.warn strong { color: #fcd34d; }
.ait-verdict.warn .ait-verdict-dot { background: #fbbf24; }
.ait-verdict.bad { background: rgba(248, 113, 113, .10); border-color: rgba(248, 113, 113, .33); }
.ait-verdict.bad strong { color: #fca5a5; }
.ait-verdict.bad .ait-verdict-dot { background: #f87171; }

.ait-result td, .ait-result th { vertical-align: middle; }
.ait-result th:not(:first-child), .ait-result td:not(:first-child) { text-align: right; }
.ait-strong { font-weight: 700; }
.ait-chg.good { color: #6ee7b7; font-weight: 700; }
.ait-chg.bad { color: #fca5a5; font-weight: 700; }
.ait-chg.same { color: #a9b3c1; }
.ait-note { margin: 0; color: #8b97a8; font-size: .78rem; }

@media (max-width: 1100px) {
  .ait-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ait-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ait-modal-foot { flex-wrap: wrap; }
  .ait-modal-foot .ait-foot-text { flex: 1 1 100%; }
}

/* 시스템 상태 맨 아래 빌드 버전(app/version.py) */
.sys-version { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; margin: 18px 4px 4px; font-size: 12px; color: #8a94a6; }
.sys-version b { color: #c3cad6; font-weight: 600; }
.sys-version code { font-size: 12px; color: #a9b3c1; background: none; padding: 0; }

/* 화면 경보 「관리자 확인」(1.0.31, app/alarm_display.py) — 확인 대기 줄·칸의 [확인]·경보 칸 빨간 테두리 */
.alarm-ack-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 6px 8px 6px 14px; border-radius: 10px;
  background: #3b1114; border: 1px solid #ef4444; color: #fde2e2; font-size: 14px;
}
.alarm-ack-bar[hidden] { display: none; }
.alarm-ack-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .25); }
.alarm-ack-list { color: #fca5a5; font-size: 13px; min-width: 0; }
.alarm-ack-all {
  margin-left: auto; padding: 6px 12px; border: 0; border-radius: 7px; cursor: pointer;
  background: #ef4444; color: #fff; font-size: 13px; font-weight: 700;
}
.tile--alarm { outline: 2px solid #ef4444; outline-offset: -2px; }
.tile-ack {
  position: absolute; right: 10px; bottom: 10px; z-index: 6;
  padding: 8px 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: #fff; color: #b91c1c; font-size: 14px; font-weight: 800; line-height: 1.2; box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.tile-ack--wait { cursor: default; background: rgba(11, 16, 22, .78); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; }

/* 상단 메뉴 이벤트 묶음 — 화면 경보 관리자 확인 대기 수(1.0.32) */
.nav-dropdown-trigger { position: relative; }
.nav-ack-badge {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.nav-ack-badge[hidden], .nav-ack-item[hidden] { display: none; }
.nav-ack-item { color: #fca5a5 !important; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-ack-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
