/* =========================================================================
   캐시바이크 웹 공용 스타일 — 디자인 기준 D (저장소 CLAUDE.md '디자인 기준')
   규칙: 요소 간 거리 10px 고정 / 모서리: 단추 · 입력 · 칩 알약, 카드 · 표 16px, 창 20px
   색: 흰 바탕 · 검정 글자 · 회색 단계 면. 레몬은 칠하는 색 — 위 글자는 검정, 한 화면에 한 군데. 상태 색은 칩 · 알림에만.
   움직임: transform · opacity 만, 상태 전환 150~240ms ease-out, 튀는 효과 없음, 동작 줄이기 설정 존중
   ========================================================================= */

:root {
  color-scheme: light;

  --gap: 10px;

  /* 디자인 기준 D (2026-11-30): 흰 바탕 · 검정 글자 · 회색 단계 면 · 레몬 한 점 */
  --bg:            #ffffff;
  --surface:       #ffffff;
  --surface-2:     #f5f5f5;   /* 회색 단계 1 */
  --surface-3:     #ebebeb;   /* 회색 단계 2 */
  --th-bg:         #f5f5f5;   /* 표 머리 — 알파 없는 단색 (고정 머리 뒤로 내용이 비치지 않게) */
  --th-bg-hover:   #ebebeb;
  --line:          #d9d9d9;   /* 표 안 칸선 · 카드 선 */
  --line-strong:   #cccccc;   /* 입력칸 · 바깥선 단추 */
  --text:          #000000;
  --text-2:        #333333;
  --muted:         #6b6b6b;   /* 작은 회색 글자도 흰 바탕에서 4.5:1 이상 */
  --faint:         #999999;   /* 24px 이상 큰 글자의 이어지는 문장에만 */
  --accent:        #000000;   /* 주 단추 · 선택 · 초점 */
  --accent-weak:   #f0f0f0;
  --accent-text:   #ffffff;
  --brand:         #fff066;   /* 레몬 — 칠하는 색. 위 글자는 언제나 검정 */
  --brand-dark:    #fff275;   /* 레몬 위에 마우스 */
  --on-brand:      #000000;
  --side:          #f5f5f5;
  --side-2:        #ebebeb;
  --danger:        #c4161c;
  --danger-weak:   #fdecec;
  --warn:          #8a5a00;
  --warn-weak:     #fcf3dc;
  --info:          #1d5fa8;
  --info-weak:     #e8f1fb;
  --ok:            #1f6b3a;
  --ok-weak:       #e9f4ec;
  --row-hover:     #fafafa;
  --overlay:       rgba(0, 0, 0, .44);
  /* 그림자는 떠 있는 판(드롭다운 · 달력 · 창 · 튜토리얼)에만 옅게. 바닥에 놓인 카드 · 표는 선으로만 나눈다 */
  --shadow-1:      none;
  --shadow-2:      0 10px 30px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);
  --shadow-3:      0 18px 50px rgba(0, 0, 0, .18);

  --r-lg: 16px;
  --r-md: 10px;
  --r-pill: 999px;

  --ease: cubic-bezier(.215, .61, .355, 1);
  --dur-1: 150ms;
  --dur-2: 200ms;
  --dur-3: 240ms;

  --sidebar-w: 220px;
  --header-h: 52px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #000000;
  --surface:       #0d0d0d;
  --surface-2:     #161616;
  --surface-3:     #222222;
  --th-bg:         #161616;
  --th-bg-hover:   #222222;
  --line:          #333333;
  --line-strong:   #4d4d4d;
  --text:          #ffffff;
  --text-2:        #d6d6d6;
  --muted:         #a3a3a3;
  --faint:         #999999;
  --accent:        #ffffff;
  --accent-weak:   #222222;
  --accent-text:   #000000;
  --side:          #0d0d0d;
  --side-2:        #222222;
  --danger:        #ff8a8a;
  --danger-weak:   #3a1414;
  --warn:          #f3c969;
  --warn-weak:     #33270c;
  --info:          #8cc2ff;
  --info-weak:     #10243b;
  --ok:            #86d19c;
  --ok-weak:       #12291a;
  --row-hover:     #141414;
  --overlay:       rgba(0, 0, 0, .62);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;                    /* 페이지 스크롤 제거 - 내부 컨테이너만 스크롤 */
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;                /* 한글은 낱말 단위로 줄바꿈 */
  overflow-wrap: break-word;           /* 칸보다 긴 낱말만 쪼갠다 */
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* 숫자 스피너 완전 제거 (요구사항: 스피너 금지) */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 키보드 초점 테두리는 각 요소의 둥근 모서리를 그대로 따른다 (모서리 값을 바꾸지 않는다 — 단추 모양이 초점 때 달라지지 않게) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
/* 손잡이 둘레는 투명하게 — 배경색 테두리는 흰 표 · 카드 위에서 회색 틀로 보인다 */
::-webkit-scrollbar-thumb { background: var(--line-strong) padding-box; border-radius: var(--r-pill); border: 3px solid transparent; }
::-webkit-scrollbar-thumb:hover { background: var(--muted) padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
/* 파이어폭스는 위 모양을 몰라서 얇은 막대 + 같은 색으로 (크롬은 표준 속성이 있으면 위 모양을 버리므로 따로 둔다) */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
}

/* =============================== 앱 셸 =============================== */

#app {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  min-height: 0;
}
#app.nav-collapsed { grid-template-columns: 56px minmax(0, 1fr); }

.sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap);
  min-height: 0;
  overflow: hidden;
}

.brand {
  display: flex; align-items: center; gap: var(--gap);
  padding: 6px 4px; height: 50px;   /* 정수 높이 — 49.5px 이면 메뉴 끝 칸 아래 선이 0.5px 잘린다 */
}
.brand-mark { width: 28px; height: 28px; flex: 0 0 28px; display: inline-flex; }
/* 로고: 바코드 기호 (UI.logo). 바탕 · 선 색은 토큰을 따라 어둡게 테마에서도 같은 모양 */
.logo { display: block; width: 100%; height: 100%; }
.logo-bg { fill: var(--accent); }
.logo-mark { fill: var(--brand); }
.brand-name { font-weight: 750; font-size: 14px; letter-spacing: -.02em; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--muted); white-space: nowrap; }
/* 접으면 글자만 숨긴다 — 아래 버튼까지 숨기면 다시 펼칠 방법이 없다 */
.nav-collapsed .brand-text, .nav-collapsed .nav-label, .nav-collapsed .nav-count, .nav-collapsed .nav-badge, .nav-collapsed .side-foot .btn span { display: none; }

.nav {
  display: flex; flex-direction: column; gap: var(--gap); overflow-y: auto; min-height: 0; flex: 1;
  /* 스크롤 막대(6px)는 사이드바 오른쪽 여백 안에 둔다 → 메뉴 칸 폭이 아래 버튼과 같고 좌우 여백도 같다 */
  margin-right: calc(var(--gap) * -1); padding-right: calc(var(--gap) - 6px); scrollbar-gutter: stable;
}
.nav > * { flex: none; }   /* 메뉴가 많아도 칸이 눌려 납작해지지 않게 — 넘치면 스크롤 */
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { border-width: 1px; }
.nav-item {
  display: flex; align-items: center; gap: var(--gap);
  height: 30px; padding: 0 9px;
  border-radius: var(--r-md);
  color: var(--text-2); font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  width: 100%; text-align: left;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav.is-switching .nav-item { transition: none; }   /* 화면을 옮길 때 선택 칸은 전환 없이 바로 (app.js render) */
.nav-item:active { transform: scale(.985); }
.nav-item.is-active {
  background: var(--accent-weak); color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  font-weight: 700;
}
.nav-item .ic { flex: 0 0 16px; display: inline-flex; }
.nav-count {
  margin-left: auto; font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* 창구 확인을 기다리는 사전등록 건수 (접수 목록 메뉴 오른쪽) */
.nav-badge {
  margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: var(--warn-weak); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.nav-badge[hidden] { display: none; }
.side-foot { border-top: 1px solid var(--line); padding-top: var(--gap); display: flex; flex-direction: column; gap: var(--gap); }

.main {
  min-width: 0; min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 1fr);   /* 긴 글 하나가 화면 폭을 밀어내지 않게 */
  gap: var(--gap);
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex; align-items: center; gap: var(--gap);
  padding: 0 var(--gap);
}
.topbar h1 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.01em; white-space: nowrap; }
.topbar .crumb { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .spacer { flex: 1; }

/* 실시간 표시 — 다른 창구 입력을 10초마다 받아 온다. 누르면 바로 받아 온다 */
.live {
  display: inline-flex; align-items: center; gap: var(--gap);
  height: 30px; padding: 0 var(--gap); border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.live:hover { border-color: var(--line-strong); background: var(--surface); }
.live:active { transform: scale(.96); }
.live-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--ok); }
.live.is-off { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.live.is-off .live-dot { background: var(--warn); }
@media (prefers-reduced-motion: no-preference) {
  .live.is-beat .live-dot { animation: liveBeat 700ms var(--ease) 1; }
}
@keyframes liveBeat { 0% { transform: scale(1); } 35% { transform: scale(1.7); } 100% { transform: scale(1); } }

.content {
  min-height: 0; min-width: 0;
  position: relative;
  display: flex; flex-direction: column; gap: var(--gap);
  overflow: hidden;                    /* 내부 스크롤러가 담당 */
}
.page {
  min-height: 0; min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: var(--gap);
}
.page-scroll { overflow: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: var(--gap); }
/* 표가 다른 카드와 한 화면을 나눠 쓰면 남는 높이가 0 이 되어 사라진다 → 제 높이를 지키고, 길면 안에서 스크롤 */
.page-scroll > .table-shell:not(:only-child) { flex: none; max-height: 70vh; }

/* =============================== 버튼 =============================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--gap);
  height: 30px; padding: 0 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px; font-weight: 600; line-height: 1;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: scale(.96); }   /* 누름 느낌 — .95 아래로 줄이면 과하다 */
.btn[disabled] { opacity: .48; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-danger { background: var(--danger-weak); border-color: color-mix(in srgb, var(--danger) 34%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 25px; padding: 0 8px; font-size: 11.5px; border-radius: 5px; }
.btn-icon { width: 30px; padding: 0; }
.btn-icon.btn-sm { width: 25px; }

.icon-btn {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.96); }

/* 가이드(?) 버튼 */
.help-btn {
  position: relative;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent); background: var(--accent-weak);
}
.help-btn:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.help-btn::after {
  content: ""; position: absolute; inset: -3px; border-radius: 9px;
  border: 1.5px solid var(--accent); opacity: 0; transform: scale(.86);
}
@media (prefers-reduced-motion: no-preference) {
  .help-btn.pulse::after { animation: helpPulse 1.6s var(--ease) 2; }
}
@keyframes helpPulse {
  0%   { opacity: .55; transform: scale(.86); }
  70%  { opacity: 0;   transform: scale(1.28); }
  100% { opacity: 0;   transform: scale(1.28); }
}

/* =============================== 폼 =============================== */

.field { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--text-2); line-height: 1; }
.field .hint { font-size: 11px; color: var(--muted); line-height: 1.35; }
/* 화면 쪽이 App.field 칸 안에 덧붙이는 오류 문구 (칸 테두리는 .input.is-invalid) — 위에서 살짝 내려오며 나타난다 */
.field .err { font-size: 11.5px; font-weight: 600; color: var(--danger); line-height: 1.35; }
@media (prefers-reduced-motion: no-preference) {
  .field .err { animation: errIn var(--dur-2) var(--ease) both; }
}
@keyframes errIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.req::after { content: "*"; color: var(--danger); margin-left: 3px; }

.input, .textarea, .select-native {
  height: 30px; width: 100%;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.textarea { height: auto; min-height: 68px; padding: 7px 9px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input[readonly] { background: var(--surface-3); color: var(--text-2); }
.input-num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }

.form-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

.toolbar {
  display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--gap);
}
.toolbar .spacer { flex: 1 1 auto; }
.toolbar-label { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.search-box { position: relative; display: inline-flex; align-items: center; min-width: 200px; }
.search-box .ic { position: absolute; left: 8px; color: var(--muted); pointer-events: none; display: inline-flex; }
.search-box .input { padding-left: 28px; }

/* =============================== 카드 =============================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--gap);
  display: flex; flex-direction: column; gap: var(--gap);
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: var(--gap); }
.card-title { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { font-size: 11.5px; color: var(--muted); }
.cards { display: grid; gap: var(--gap); }
.cards-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1320px) { .cards-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .cards-5, .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px)  { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) { .cards-5, .cards-4, .cards-3, .cards-2 { grid-template-columns: 1fr; } }

.stat { gap: var(--gap); }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 750; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-foot { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: var(--gap); }

/* 지표 색: 취소 등 눈에 띄어야 하는 것(danger) · 확인할 것이 있는 것(warn, 예: 사전등록 대기) · 진행(info) · 끝난 것(ok) */
.stat-danger { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.stat-danger .stat-label,
.stat-danger .stat-value,
.stat-danger .stat-foot i { color: var(--danger); }
.stat-warn { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.stat-warn .stat-label,
.stat-warn .stat-value,
.stat-warn .stat-foot i { color: var(--warn); }
.stat-info .stat-value, .stat-info .stat-foot i { color: var(--info); }
.stat-ok .stat-value, .stat-ok .stat-foot i { color: var(--ok); }
.stat-link { cursor: pointer; transition: box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.stat-link:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.stat-link:active { transform: scale(.99); }
.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =============================== 테이블 =============================== *
   1. 모든 요소 중앙정렬  2. 헤더명 100% 채움  3. 세로줄  5. 100건 페이지네이션
   6. 테이블 내부 스크롤  7~10. 테두리 1px 단일 규칙, 헤더/본문 동일,
      마지막 행 테두리 유지, 고정 헤더 비침 없음
   ------------------------------------------------------------------- */

/* 표 틀은 내용 높이만큼만 차지한다(줄이 많을 때만 남은 높이까지 줄어들어 표 안에서 스크롤).
   예전 flex:1 은 줄이 적은 표에서도 남은 높이를 다 차지해 마지막 줄 아래에 빈 상자가 남고
   틀 아래 선이 따로 떠 보였다. */
.table-shell {
  flex: 0 1 auto; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow: auto;
  /* 셀은 오른쪽 · 아래 선만 그린다. 위 · 왼쪽 바깥 선은 셸 테두리가 맡는다.
     오른쪽 · 아래 끝 1px 은 셸 테두리 밑으로 넣어 잘리게 한다 → 바깥 선이 늘 한 줄.
     마지막 행의 아래 선은 셸 아래 선(쪽 넘김이 붙으면 그 위 선)과 같은 자리에 겹쳐 한 줄로 보인다. */
  margin: 0 -1px -1px 0;
}
/* 세로 스크롤 막대가 생기면 머리줄 배경이 막대 위에서 끊겨 흰 홈이 생겼다 → 스크롤 칸 자체 배경으로
   머리줄 높이(34px) 띠와 그 아래 1px 선을 깔아 막대 위까지 잇는다. 이 배경은 내용과 같이 움직이지 않는다.
   빈 표(머리줄 없음)에는 깔지 않는다. */
.table-scroll:has(> table.tbl) {
  background:
    linear-gradient(var(--line), var(--line)) 0 34px / 100% 1px repeat-x,
    linear-gradient(var(--th-bg), var(--th-bg)) 0 0 / 100% 34px repeat-x;
}

table.tbl {
  border-collapse: separate;           /* sticky 헤더에서 테두리 유지 */
  border-spacing: 0;
  width: 100%;
  min-width: max-content;
  table-layout: auto;
}

.tbl th, .tbl td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 9px;
  height: 34px;
  text-align: center;                  /* 요구사항 1 */
  vertical-align: middle;
  white-space: nowrap;
  font-size: 12.5px;
  background-clip: padding-box;
}
/* 맨 오른쪽 열은 오른선을 긋지 않는다 — 바깥 선은 셸이 맡는다.
   표 안에 세로 스크롤 막대(11px)가 생기면 마지막 열 오른선과 셸 선이 막대 폭만큼 떨어져 두 줄로 보였다(2026-10-22 사용자 지적) */
.tbl tr > :last-child { border-right: 0; }
.tbl th {
  position: sticky; top: 0; z-index: 3;
  background: var(--th-bg);            /* 알파 없는 단색 - 비침 방지 */
  font-weight: 700;
  font-size: 12px;
  color: var(--text-2);
  height: 34px;                        /* 내용 줄(34px)과 같은 높이 */
  user-select: none;
}
.tbl th.sortable { cursor: pointer; transition: background var(--dur-1) var(--ease); }
.tbl th.sortable:hover { background: var(--th-bg-hover); }
.tbl th .th-in { display: inline-flex; align-items: center; justify-content: center; gap: var(--gap); line-height: 1; }
.tbl th .sort-ic { opacity: .3; transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.tbl th.is-sorted .sort-ic { opacity: 1; color: var(--accent); }
.tbl th.is-sorted.desc .sort-ic { transform: rotate(180deg); }

.tbl tbody tr { transition: background var(--dur-1) var(--ease); }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl tbody tr.is-selected td { background: var(--accent-weak); }

/* 줄 색: 왼쪽 색 띠 대신 옅은 바탕색 (띠는 테두리처럼 보여 선 규칙이 깨진다)
   row-out = 취소처럼 빠진 줄 · row-rest = 확인을 기다리는 줄 (rowClass 로 붙인다) */
.tbl tbody tr.row-out td { background: color-mix(in srgb, var(--danger-weak) 55%, var(--surface)); }
.tbl tbody tr.row-out:hover td { background: var(--danger-weak); }
.tbl tbody tr.row-rest td { background: color-mix(in srgb, var(--warn-weak) 55%, var(--surface)); }
.tbl tbody tr.row-rest:hover td { background: var(--warn-weak); }
.name-out { color: var(--danger); text-decoration: line-through; }
.tbl td { color: var(--text); }
.tbl td.cell-l { text-align: center; }          /* 요구사항 1: 표 안은 모두 가운데 */
.tbl td.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.tbl td.wrap { white-space: normal; word-break: break-word; text-align: center; min-width: 220px; max-width: 460px; line-height: 1.45; padding: 7px 9px; }
.tbl .cell-mid { display: flex; align-items: center; justify-content: center; gap: var(--gap); line-height: 1; }

/* 고정 첫 열 (가로로 긴 표에서 체크 · 번호 · 이름이 따라오게) */
/* 고정 칸의 바탕은 줄 상태 규칙(마우스 올림 · 선택 · 취소 · 대기)이 그대로 덮도록 낮은 우선순위로만 준다.
   예전에는 마우스 올림 색만 따로 더 강하게 걸려, 선택한 줄 · 취소 줄에서 체크 칸만 다른 색이 되어 선이 어긋나 보였다. */
.tbl .stick-l { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.tbl thead th.stick-l { z-index: 4; background: var(--th-bg); }

.tbl .col-chk { width: 38px; }
.tbl .col-no { width: 54px; }
.tbl .col-act { width: 108px; }

.table-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--gap); padding: 46px var(--gap); color: var(--muted); text-align: center;
}
/* 표 밖에서 쓰는 빈 안내(emptyBox)도 표가 빌 때와 같은 틀 — 화면마다 빈 화면 모양이 다르지 않게 */
:not(.table-scroll):not(.table-shell) > .table-empty { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.table-empty .em-title { font-weight: 700; color: var(--text-2); font-size: 13px; }
.table-empty .em-sub { font-size: 12px; }

/* 페이지네이션 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: var(--gap);
  padding: var(--gap); border: 1px solid var(--line); border-radius: var(--r-lg);   /* 표 아래 따로 놓이면 표 셸과 같은 틀 */
  flex-wrap: wrap; background: var(--surface);
}
.table-pager > .pager { border-width: 1px 0 0; border-radius: 0; }   /* 표 셸 안에서는 위 선만 */
.pager .pager-info { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager-pages { display: inline-flex; align-items: center; gap: var(--gap); flex-wrap: wrap; justify-content: center; }
.pg {
  min-width: 27px; height: 27px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.pg:hover:not([disabled]):not(.is-current) { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.pg:active:not([disabled]) { transform: scale(.96); }
.pg.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pg[disabled] { opacity: .4; pointer-events: none; }
.pg-gap { color: var(--muted); padding: 0 2px; user-select: none; }

/* =============================== 칩 / 배지 =============================== *
   요구사항: 칩·원문자 내 글자를 세로 중앙에 정확히 맞춤
   ------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);   /* 글자색으로 테두리 → 회색 · 색 칩 모두 같은 방식 */
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;                      /* 세로 중앙 정렬 핵심 */
  white-space: nowrap;
  vertical-align: middle;
  background: var(--surface-3);
  color: var(--text-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.chip > * { line-height: 1; display: inline-flex; align-items: center; }
.chip-accent  { background: var(--accent-weak); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 24%, transparent); }
.chip-danger  { background: var(--danger-weak); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 24%, transparent); }
.chip-warn    { background: var(--warn-weak);   color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.chip-info    { background: var(--info-weak);   color: var(--info);   border-color: color-mix(in srgb, var(--info) 24%, transparent); }
.chip-ok      { background: var(--ok-weak);     color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.chip-solid   { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip-close { margin-left: 5px; margin-right: -3px; opacity: .6; cursor: pointer; transition: opacity var(--dur-1) var(--ease); }
.chip-close:hover { opacity: 1; }

/* 원문자 - 정확한 원 안 중앙정렬 */
.circ {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px; height: 21px;
  flex: 0 0 21px;
  border-radius: 50%;
  font-size: 11.5px; font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  background: var(--surface-3); color: var(--text-2);
  font-feature-settings: "tnum" 1;
}
.circ-lg { width: 28px; height: 28px; flex-basis: 28px; font-size: 13px; }
.circ-accent { background: var(--accent); color: var(--accent-text); }
/* 글자는 바탕(surface)색 — 밝게에서는 흰 글씨, 어둡게에서는 짙은 글씨라 두 테마 모두 대비가 맞다 */
.circ-danger { background: var(--danger); color: var(--surface); }
.circ-warn   { background: var(--warn);   color: var(--surface); }
.circ-info   { background: var(--info);   color: var(--surface); }
.circ-ok     { background: var(--ok);     color: var(--surface); }
.circ-outline { background: transparent; border: 1.5px solid currentColor; }

.chip-row { display: inline-flex; align-items: center; justify-content: center; gap: var(--gap); flex-wrap: wrap; }
/* 눌러서 켜고 끄는 칩 (여러 개 켤 수 있는 것). 하나만 고르는 것은 아래 .seg */
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--line-strong); }
button.chip:active { transform: scale(.96); }

/* 하나만 고르는 칩 묶음 (App.seg) — 드롭다운 대신 상태 · 창구 · 차량처럼 하나만 고르는 칸.
   높이는 입력칸 · 버튼과 같은 30px. 고른 칸은 강조색(또는 t-warn · t-info · t-ok · t-danger 색) */
.seg { display: inline-flex; align-items: center; gap: var(--gap); flex-wrap: wrap; min-width: 0; }
.seg-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--gap);
  height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.seg-opt:hover { border-color: var(--line-strong); color: var(--text); }
.seg-opt:active { transform: scale(.96); }
.seg-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-pill); }
.seg-opt.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.seg-opt.is-on.t-warn   { background: var(--warn);   border-color: var(--warn);   color: var(--surface); }
.seg-opt.is-on.t-info   { background: var(--info);   border-color: var(--info);   color: var(--surface); }
.seg-opt.is-on.t-ok     { background: var(--ok);     border-color: var(--ok);     color: var(--surface); }
.seg-opt.is-on.t-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.seg-opt[disabled] { opacity: .45; pointer-events: none; }
.seg-meta { font-size: 11px; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }
.form-grid .seg { width: 100%; }

/* =============================== 드롭다운 =============================== */

.dd { position: relative; display: inline-flex; min-width: 0; }
.dd-trigger {
  display: inline-flex; align-items: center; gap: var(--gap);
  height: 30px; padding: 0 8px 0 9px; min-width: 132px; max-width: 300px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-size: 12.5px; text-align: left;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.dd-trigger:hover { border-color: var(--line-strong); }
.dd.is-open .dd-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.dd-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; }
.dd-value.is-placeholder { color: var(--muted); }
.dd-count {
  display: inline-flex; align-items: center; justify-content: center;
  height: 17px; min-width: 17px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-text);
  font-size: 10.5px; font-weight: 700; line-height: 1;
}
.dd-caret { color: var(--muted); display: inline-flex; transition: transform var(--dur-2) var(--ease); }
.dd.is-open .dd-caret { transform: rotate(180deg); }

.dd-panel {
  position: fixed; z-index: 600;   /* 창(.modal-root 500) 위에 떠야 창 안의 목록이 보인다 */
  min-width: 216px; max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform-origin: top center;
}
@media (prefers-reduced-motion: no-preference) {
  .dd-panel { animation: ddIn var(--dur-2) var(--ease) both; }
  .dd-panel.is-up { animation-name: ddInUp; }
}
@keyframes ddIn   { from { opacity: 0; transform: translateY(-5px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes ddInUp { from { opacity: 0; transform: translateY(5px) scale(.985); }  to { opacity: 1; transform: none; } }

.dd-search { padding: var(--gap); border-bottom: 1px solid var(--line); }
.dd-list { overflow-y: auto; max-height: 264px; padding: 4px; display: flex; flex-direction: column; }
.dd-opt {
  display: flex; align-items: center; gap: var(--gap);
  min-height: 30px; padding: 5px 8px; border-radius: 5px;
  font-size: 12.5px; color: var(--text); text-align: left; width: 100%;
  background: transparent; border: 0;
  transition: background var(--dur-1) var(--ease);
}
.dd-opt:hover, .dd-opt.is-cursor { background: var(--surface-2); }
.dd-opt.is-selected { color: var(--accent); font-weight: 650; }
.dd-opt .opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-opt .opt-meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dd-empty { padding: 18px var(--gap); text-align: center; color: var(--muted); font-size: 12px; }
/* 항목이 아주 많을 때(300개 넘음) 목록 끝 안내 한 줄 */
.dd-more { padding: 8px var(--gap); text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
/* 요구사항: 리스트 아래에 전체선택/전체해제 */
.dd-foot {
  display: flex; align-items: center; gap: var(--gap);
  padding: var(--gap); border-top: 1px solid var(--line); background: var(--surface-2);
}
.dd-foot .btn { flex: 1; }

/* 체크박스 */
.cbx {
  position: relative; flex: 0 0 15px; width: 15px; height: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-strong); border-radius: 4px;
  background: var(--surface);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.cbx svg { opacity: 0; transform: scale(.55); color: var(--accent-text); transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.cbx.is-on { background: var(--accent); border-color: var(--accent); }
.cbx.is-on svg { opacity: 1; transform: none; }
.cbx.is-part { background: var(--accent); border-color: var(--accent); }
.cbx.is-part::after { content: ""; width: 7px; height: 1.5px; background: var(--accent-text); border-radius: 1px; }
label.cbx-wrap { display: inline-flex; align-items: center; gap: var(--gap); cursor: pointer; line-height: 1; user-select: none; }
label.cbx-wrap:active .cbx { transform: scale(.9); }
.tbl .cbx { margin: 0 auto; }

/* 스위치 */
.switch {
  width: 34px; height: 19px; flex: none; border-radius: var(--r-pill);   /* flex-basis 34px 는 세로 배치(.field)에서 높이가 돼 원이 됐다 */
  background: var(--line-strong); border: 0; position: relative; padding: 0;
  transition: background var(--dur-2) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease);
}
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(15px); }

/* =============================== 달력 =============================== */

.dp { position: relative; display: flex; width: 100%; min-width: 0; }
.dp .input { padding-right: 30px; font-variant-numeric: tabular-nums; }
.dp-btn {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--muted); border-radius: 0 5px 5px 0;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.dp-btn:hover { color: var(--accent); background: var(--surface-2); }

.cal {
  position: fixed; z-index: 620; width: 304px;   /* 창 위. 날짜 칸 7개 + 10px 간격 6개가 들어가는 폭 */
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap);
  transform-origin: top left;
}
@media (prefers-reduced-motion: no-preference) { .cal { animation: ddIn var(--dur-2) var(--ease) both; } }
.cal-head { display: flex; align-items: center; gap: var(--gap); }
.cal-head .cal-nav {
  width: 25px; height: 25px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.cal-head .cal-nav:hover { background: var(--surface-2); color: var(--text); }
.cal-title { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0; }
.cal-title .cal-m { margin-left: 4px; }
/* "2026년 10월" — 연도는 직접 고치는 칸이라 오른쪽 맞춤으로 '년'에 붙인다 */
.cal-y {
  width: 42px; height: 25px; padding: 0 1px; text-align: right; font-variant-numeric: tabular-nums;
  border: 1px solid transparent; border-radius: 5px; background: transparent;
  font-weight: 700; font-size: 12.5px; color: var(--text);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.cal-y:hover { background: var(--surface-2); }
.cal-y:focus { background: var(--surface); border-color: var(--accent); outline: none; }
.cal-yl { font-weight: 700; font-size: 12.5px; color: var(--text); line-height: 1; }
.cal-m {
  height: 25px; padding: 0 5px; border: 1px solid transparent; border-radius: 5px;
  background: transparent; font-weight: 700; font-size: 12.5px; color: var(--text);
}
.cal-m:hover { background: var(--surface-2); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--gap); }   /* 날짜 칸 사이도 10px 규칙 */
.cal-dow {
  height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1;
}
.cal-dow.sun { color: var(--danger); }
.cal-dow.sat { color: var(--info); }
.cal-d {
  height: 29px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; border: 1px solid transparent; background: transparent;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.cal-d:hover { background: var(--surface-2); }
.cal-d:active { transform: scale(.92); }
.cal-d.is-out { color: var(--muted); opacity: .45; }
.cal-d.is-today { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.cal-d.is-sel { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
/* 드롭다운 아래 칸(.dd-foot)과 같은 모양 — 선이 양끝까지 닿고 옅은 바탕 */
.cal-foot {
  display: flex; gap: var(--gap); margin: 0 calc(var(--gap) * -1) calc(var(--gap) * -1); padding: var(--gap);
  border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
}
.cal-foot .btn { flex: 1; }

/* =============================== 모달 =============================== */

.modal-root { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: var(--gap); }
.modal-bd { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); }
@media (prefers-reduced-motion: no-preference) {
  .modal-bd { animation: fadeIn var(--dur-2) var(--ease) both; }
  .modal-box { animation: modalIn var(--dur-3) var(--ease) both; }
  .modal-root.is-closing .modal-bd { animation: fadeIn var(--dur-1) var(--ease) reverse both; }
  .modal-root.is-closing .modal-box { animation: modalOut var(--dur-2) var(--ease) both; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn  { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes modalOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.99); } }

.modal-box {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  width: min(720px, 100%); max-height: calc(100dvh - 20px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-box:focus { outline: none; }   /* 입력칸이 없는 창은 창 자체가 첫 초점 — 테두리는 그리지 않는다 */
.modal-box.w-sm { width: min(460px, 100%); }
.modal-box.w-lg { width: min(1020px, 100%); }
.modal-box.w-xl { width: min(1240px, 100%); }
.modal-head {
  display: flex; align-items: center; gap: var(--gap);
  padding: var(--gap); border-bottom: 1px solid var(--line);
  min-height: 46px;
}
.modal-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: var(--gap); overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--gap);
  padding: var(--gap); border-top: 1px solid var(--line); background: var(--surface-2);
}

/* =============================== 토스트 =============================== */

.toast-wrap {
  position: fixed; right: var(--gap); bottom: var(--gap); z-index: 900;
  display: flex; flex-direction: column; gap: var(--gap); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--gap);
  min-width: 232px; max-width: 380px;
  padding: var(--gap);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));   /* 한쪽 굵은 띠 대신 네 변 같은 1px */
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  font-size: 12.5px; pointer-events: none;   /* 뒤의 단추를 가리지 않게 — 눌러도 뒤로 지나간다 */
}
.toast > svg, .toast > i { color: var(--accent); flex: none; }
.toast.is-err { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.toast.is-err > svg, .toast.is-err > i { color: var(--danger); }
.toast.is-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.toast.is-warn > svg, .toast.is-warn > i { color: var(--warn); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toastIn var(--dur-3) var(--ease) both; }
  .toast.is-out { animation: toastOut var(--dur-2) var(--ease) both; }
}
@keyframes toastIn  { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(14px); } }

/* =============================== 로딩 =============================== *
   요구사항: 실제 로딩이 일어나는 영역에만 표시 (사이드바/헤더 제외)
   ------------------------------------------------------------------- */

.loader {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap);
  background: var(--bg);
  border-radius: var(--r-lg);
}
.loader.is-overlay { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(1px); }
/* 로딩 로고 = 앱 로고(바코드 기호, UI.logo) */
.loader-logo { width: 42px; height: 42px; display: inline-flex; }
@media (prefers-reduced-motion: no-preference) {
  .loader-logo { animation: logoBeat 1.25s var(--ease) infinite; }
}
@keyframes logoBeat {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(.9); opacity: .74; }
}
.loader-bar { width: 118px; height: 3px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.loader-bar::after {
  content: ""; display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--accent);
  transform: translateX(-100%);
}
@media (prefers-reduced-motion: no-preference) {
  .loader-bar::after { animation: barSlide 1.1s var(--ease) infinite; }
}
@keyframes barSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(255%); } }
.loader-text { font-size: 11.5px; color: var(--muted); }
/* App.load 가 본문 안에 까는 자리 (로더가 이 칸만 덮는다) */
.load-box { position: relative; flex: 1; min-height: 160px; }

.skel { background: var(--surface-3); border-radius: 5px; }
@media (prefers-reduced-motion: no-preference) {
  .skel { animation: skelPulse 1.35s var(--ease) infinite; }
}
@keyframes skelPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* 초기 부팅 화면 - 새로고침 시 잔상 제거 */
#boot {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap);
  background: var(--bg);
  transition: opacity var(--dur-3) var(--ease);
}
#boot.is-gone { opacity: 0; pointer-events: none; }

/* =============================== 진입 애니메이션 =============================== */

@media (prefers-reduced-motion: no-preference) {
  .enter { animation: enterUp var(--dur-3) var(--ease) both; }
  .stagger > * { animation: enterUp var(--dur-3) var(--ease) both; animation-delay: calc(min(var(--i, 0), 12) * 45ms); }   /* 긴 표에서 마지막 줄이 몇 초씩 기다리지 않게 */
}
@keyframes enterUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================== 가이드 =============================== */

.guide-box { width: min(1080px, 100%); height: min(700px, calc(100dvh - 20px)); }
.guide-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 238px 1fr; }
.guide-side {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--gap); padding: var(--gap);
  min-height: 0; background: var(--surface-2);
}
.guide-list { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
.guide-side > :not(.guide-list) { flex: none; }   /* 목록만 줄어든다 — 아래 버튼이 눌려 테두리가 잘리지 않게 */
.guide-group { font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 0 8px; letter-spacing: .04em; }
.guide-link {
  display: flex; align-items: center; gap: var(--gap); text-align: left; width: 100%;
  min-height: 30px; padding: 5px 8px; border-radius: 5px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font-size: 12.5px;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.guide-link:hover { background: var(--surface-3); color: var(--text); }
.guide-link:active { transform: scale(.985); }
.guide-link.is-active { background: var(--accent-weak); color: var(--accent); font-weight: 700; border-color: color-mix(in srgb, var(--accent) 24%, transparent); }
.guide-link .g-hit { font-size: 10.5px; color: var(--muted); margin-left: auto; }
.guide-main { overflow-y: auto; min-height: 0; padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); }
.guide-main > * { flex-shrink: 0; }   /* 본문이 길면 overflow: hidden 인 미니 데모가 2px 로 눌리던 것 막음 (2026-10-27) */
.guide-h { font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.guide-lead { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.guide-sec { display: flex; flex-direction: column; gap: var(--gap); }
.guide-sec-h { display: flex; align-items: center; gap: var(--gap); font-size: 13px; font-weight: 700; }
.guide-step {
  display: grid; grid-template-columns: 28px 1fr; gap: var(--gap);
  padding: var(--gap); border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.guide-step:hover { border-color: var(--line-strong); background: var(--surface); }
.guide-step .gs-body { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.guide-step .gs-t { font-weight: 700; font-size: 12.5px; }
.guide-step .gs-d { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.guide-kbd {
  display: inline-flex; align-items: center; justify-content: center; height: 19px; padding: 0 6px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface); font-family: var(--mono); font-size: 10.5px; line-height: 1;
}
.guide-note {
  display: flex; gap: var(--gap); padding: var(--gap);
  border-radius: var(--r-md); font-size: 12px; line-height: 1.6;
  background: var(--info-weak); color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
}
.guide-note.warn { background: var(--warn-weak); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 24%, transparent); }
.guide-demo {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); overflow: hidden;
}
.guide-demo-cap { font-size: 11px; color: var(--muted); }

/* 가이드 미니 데모 무대 (모양별 그림 · 움직임은 아래 '기본 파일 정리' 묶음) */
.demo-stage { position: relative; height: 132px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); overflow: hidden; }
.demo-cursor {
  position: absolute; width: 13px; height: 13px; pointer-events: none;
  color: var(--text); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
}

/* 튜토리얼 스포트라이트 — 자리 옮김은 guide.js 가 transform 으로 움직인다 (top/left 애니메이션 없음) */
.tut-root { position: fixed; inset: 0; z-index: 800; }
.tut-mask { position: absolute; inset: 0; pointer-events: auto; }
.tut-ring {
  position: absolute; border-radius: var(--r-md);
  box-shadow: 0 0 0 9999px var(--overlay), 0 0 0 2px var(--accent);
  transform-origin: 0 0;
  pointer-events: none;
}
.tut-card {
  position: absolute; width: min(296px, calc(100vw - 20px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap);
}
.tut-card .tut-step { font-size: 10.5px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.tut-card .tut-t { font-size: 13.5px; font-weight: 700; }
.tut-card .tut-d { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.tut-card .tut-foot { display: flex; align-items: center; gap: var(--gap); }
.tut-chain { display: flex; align-items: center; gap: var(--gap); padding-bottom: var(--gap); border-bottom: 1px solid var(--line); }
.tut-chain-t { flex: 1; min-width: 0; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tut-chain .btn { flex: none; white-space: nowrap; }
.tut-dots { display: inline-flex; gap: var(--gap); margin-right: auto; }
.tut-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.tut-dot.is-on { background: var(--accent); transform: scale(1.3); }

/* =============================== 상세/기타 =============================== */

.kv { display: grid; grid-template-columns: 92px 1fr; gap: var(--gap); align-items: start; }
.kv dt { font-size: 11.5px; color: var(--muted); font-weight: 600; padding-top: 1px; }
.kv dd { margin: 0; font-size: 12.5px; word-break: break-word; }
.pre-wrap { white-space: pre-wrap; line-height: 1.65; font-size: 12.5px; }

.tabs { display: inline-flex; gap: var(--gap); padding: 2px; background: var(--surface-3); border-radius: var(--r-md); }   /* 2 + 26 + 2 = 입력칸 · 버튼과 같은 30px */
/* 필터 · 동작 줄 안의 작은 버튼도 입력칸 · 드롭다운과 같은 30px */
.toolbar .btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-md); }
.toolbar .btn-sm.btn-icon { width: 30px; padding: 0; }
.tab {
  height: 26px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent;
  color: var(--text-2); font-size: 12.5px; font-weight: 600; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  /* 선택 배경은 즉시 옮긴다 — 서서히 바꾸면 이전 탭이 잠깐 같이 선택돼 보인다(잔상). 글자색 · 누름만 부드럽게 */
  transition: color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.tab:hover { color: var(--text); }
.tab:active { transform: scale(.97); }
.tab.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.bar-track { height: 7px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--accent); }

.divider { height: 1px; background: var(--line); }

.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex; align-items: center; gap: var(--gap);
  min-height: 30px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row .ml { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .mr { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* 항목이 많은 미니 목록을 반씩 두 열로 나눠 카드 높이를 줄인다 */
.mini-list[class*="split"] {
  display: block; column-gap: calc(var(--gap) * 2);
  column-rule: 1px solid var(--line);
}
.mini-list.split2 { columns: 2; }
.mini-list.split3 { columns: 3; }
.mini-list.split4 { columns: 4; }
/* 열로 나누면 열마다 마지막 줄을 알 수 없어 밑선이 덩그러니 남는다 → 가로선 없이 세로 구분선만 */
.mini-list[class*="split"] .mini-row { break-inside: avoid; border-bottom: 0; }
.mini-list[class*="split"] .mini-row .mr { white-space: nowrap; flex: 0 0 auto; }
.mini-list[class*="split"] .bar-track { flex-shrink: 1; min-width: 36px; }
@media (max-width: 1600px) { .mini-list.split4 { columns: 3; } }
@media (max-width: 1200px) { .mini-list.split4, .mini-list.split3 { columns: 2; } }
@media (max-width: 1000px) { .mini-list[class*="split"] { columns: 1; column-rule: 0; } }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 860px) {
  #app { grid-template-columns: 56px minmax(0, 1fr); }
  #app .brand-text, #app .nav-label, #app .side-foot .btn span, #app .nav-count, #app .nav-badge { display: none; }
}

.tagpick { display: flex; flex-wrap: wrap; gap: var(--gap); }
.tagpick .chip { cursor: pointer; user-select: none; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.tagpick .chip:hover { border-color: var(--line-strong); }
.tagpick .chip.is-on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ------------------------------------------------------- 안내 띠 · 처리 대기 */
.banner {
  display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap;
  padding: var(--gap); border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); font-size: 12.5px;
}
.banner.is-info { background: var(--info-weak); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.banner.is-warn { background: var(--warn-weak); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 24%, transparent); }
.banner strong { font-weight: 700; }

/* ------------------------------------------------------------ 상태 탭 숫자 */
.tab .tab-n { margin-left: var(--gap); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tab.is-on .tab-n { color: inherit; opacity: .8; }

/* ---------------------------------------------------------- 요약 칸 (상세 창 위쪽 등) */
.card-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.hero-cell { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--gap); min-width: 0; background: var(--surface-2); }
.hero-cell .hl { font-size: 11px; color: var(--muted); font-weight: 600; }
.hero-cell .hv { font-size: 13px; font-weight: 650; margin-top: 3px; word-break: break-word; white-space: pre-wrap; }
.hero-cell .hs { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hero-actions { display: flex; gap: var(--gap); flex-wrap: wrap; align-items: center; }
@media (max-width: 900px) { .card-hero { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .card-hero { grid-template-columns: 1fr; } }

/* 패치노트(!) 버튼 — 확인 안 한 소식이 있으면 오른쪽 위에 점 */
.notes-btn { position: relative; color: var(--warn); }
.notes-btn.has-new::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger, #d14343); box-shadow: 0 0 0 2px var(--surface);
}
@media (prefers-reduced-motion: no-preference) {
  .notes-btn.has-new::after { animation: notesDot 1.8s var(--ease) infinite; }
}
@keyframes notesDot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* 패치노트 창 */
.notes { display: flex; flex-direction: column; gap: var(--gap); }
.notes-date { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.notes-list { display: flex; flex-direction: column; gap: var(--gap); }
.notes-item {
  display: flex; gap: var(--gap); padding: var(--gap); border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); transition: border-color var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.notes-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.notes-item.is-done { opacity: .62; }
.notes-checkwrap { padding-top: 2px; cursor: pointer; }
.notes-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: var(--gap); }
.notes-head { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.notes-title { font-size: 14px; }
.notes-where { display: flex; align-items: center; gap: var(--gap); font-size: 12.5px; color: var(--accent); font-weight: 600; }
.notes-desc { font-size: 13px; color: var(--text); line-height: 1.55; }
.notes-acts { display: flex; gap: var(--gap); flex-wrap: wrap; }

/* ---- 2026-10-15 공통 기준 보강 ---- */
.inline-pick { display: flex; gap: 10px; align-items: center; }
.inline-pick > .input { flex: 1; min-width: 0; }
.inline-pick > .btn { flex: none; }
.postcode-box { height: min(480px, 70vh); position: relative; }
.table-pager { position: relative; z-index: 5; background: var(--surface); }   /* 고정 열 칸이 위 선을 덮지 않게 */   /* 안의 .pager 가 위 선 · 여백을 그린다 (두 줄로 겹치지 않게) */
/* 입력 창 안 드롭다운은 옆 입력 칸과 같은 폭 */
.form-grid .dd { width: 100%; }
.form-grid .dd > .dd-trigger { width: 100%; max-width: none; }
.form-grid .inline-pick .dd { width: auto; }

/* ---- 휴대폰 폭 (갤럭시 S25 360px 기준) ---- */
.top-actions { display: flex; align-items: center; gap: var(--gap); }
.menu-btn, .nav-backdrop { display: none; }
@media (max-width: 640px) {
  #app, #app.nav-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--gap); bottom: var(--gap); left: var(--gap); width: 240px; z-index: 460;
    transform: translateX(calc(-100% - 20px)); transition: transform var(--dur-2) var(--ease);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  }
  #app.nav-open .sidebar { transform: none; }
  #app .brand-text { display: block; }
  #app .nav-label, #app .nav-count, #app .side-foot .btn span { display: inline; }
  #app .nav-badge { display: inline-flex; }
  #app .nav-badge[hidden] { display: none; }
  #app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 455; background: rgba(0, 0, 0, .45); }
  .menu-btn { display: inline-flex; }
  .topbar { height: auto; flex-wrap: wrap; padding: var(--gap); row-gap: var(--gap); }
  .topbar .crumb { display: none; }
  .top-actions { order: 10; flex: 1 1 100%; overflow-x: auto; padding-bottom: 2px; }
  .top-actions:empty { display: none; }
  .top-actions > * { flex: none; }
  .pager { flex-wrap: wrap; justify-content: center; gap: var(--gap); }
  .search-box { min-width: 0; flex: 1 1 100%; }
  .modal-box { width: calc(100vw - 20px) !important; max-height: calc(100dvh - 20px); }
  /* 창 아래 단추가 넷(삭제 · 취소 · 저장 · 저장하고 라벨 출력)이면 360px 를 넘어 잘렸다 → 줄을 바꾸고 칸을 나눠 채운다 */
  .modal-foot { flex-wrap: wrap; }
  .modal-foot > .btn { flex: 1 1 auto; }
  .modal-foot > div:empty { display: none; }
  .toolbar .tabs { max-width: 100%; overflow-x: auto; }
  .tab { flex: none; white-space: nowrap; }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
.picker-row { display: flex; gap: var(--gap); flex-wrap: wrap; }
.picker-row > .input { flex: 1 1 160px; min-width: 0; }
@media (max-width: 640px) {
  .picker-row > .dd { flex: 1 1 100%; }
  .picker-row > .dd > .dd-trigger { width: 100%; max-width: none; }
}

.topbar, .content { min-width: 0; }
@media (max-width: 640px) { .toolbar .card-sub { white-space: normal; } }

/* ---- 확장 연결 (2026-10-16): 메뉴 묶음 제목 · 확장 카드 · 가이드 튜토리얼 버튼 ---- */
.nav-group { padding: 0 9px; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .02em; color: var(--muted); user-select: none; }
.nav-collapsed .nav-group { display: none; }
.ext-cards { display: flex; flex-direction: column; gap: var(--gap); }
.ext-cards:empty { display: none; }
.guide-tour { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }

/* ---- 2026-10-16 기본 파일 정리 ---- */
/* 세로로 쌓는 묶음 (창 안 설명 + 표 등) */
.stack { display: flex; flex-direction: column; gap: var(--gap); }
/* 카드 안 표는 제 높이를 지키고, 길면 표 안에서만 스크롤 (페이지가 늘어나지 않게) */
.card > .table-shell { flex: none; max-height: 60vh; }

/* 막대는 그려질 때 왼쪽에서 자란다 (transform 만) */
@media (prefers-reduced-motion: no-preference) {
  .bar-fill { animation: barGrow var(--dur-3) var(--ease) both; transform-origin: left center; }
  .tut-root { animation: fadeIn var(--dur-2) var(--ease) both; }
  .tut-root.is-out { animation: fadeIn var(--dur-1) var(--ease) reverse both; }
}
@keyframes barGrow { from { transform: scaleX(0); } to { transform: none; } }

/* 가이드 창 — 휴대폰 폭에서는 목록을 위, 본문을 아래로 */
@media (max-width: 640px) {
  .guide-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .guide-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 38dvh; }
}

/* 가이드 미니 데모 — 화면 모양별 (guide.js DEMOS). 멈춘 그림 = 동작 줄이기 설정일 때 보이는 모습 */
.demo-el { position: absolute; border-radius: 4px; background: var(--surface-3); }
.demo-el.is-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.demo-el.is-col { background: transparent; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.demo-el.is-cell { border-radius: 3px; }
.demo-el.is-chip { border-radius: var(--r-pill); }
.demo-el.is-btn { background: var(--accent); border-radius: var(--r-md); }
.demo-el.is-line { background: var(--line-strong); opacity: .55; border-radius: 3px; }
.demo-el.is-num { background: var(--text-2); opacity: .35; border-radius: 3px; }
.demo-hit::after, .demo-chip::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--accent-weak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}
.demo-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); }
.demo-fill { position: absolute; left: 8px; top: 50%; width: 62%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--text-2); opacity: .4; transform-origin: left center; }
.demo-bar { position: absolute; bottom: 14px; width: 9%; border-radius: 3px 3px 0 0; background: var(--accent); transform-origin: bottom center; }
.demo-check {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  background: var(--accent); color: var(--accent-text); font-size: 15px;
}
.demo-ring { border-radius: var(--r-md); background: transparent; box-shadow: 0 0 0 2px var(--accent), 0 0 0 600px color-mix(in srgb, var(--text) 14%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .demo-play .demo-cursor { animation: demoCur 3.2s var(--ease) infinite; }
  .demo-play .demo-hit::after { animation: demoGlow 3.2s var(--ease) infinite; }
  .demo-play .demo-lift { animation: demoLift 3.2s var(--ease) infinite; }
  .demo-play .demo-dot { animation: demoStamp 3.2s var(--ease) infinite both; animation-delay: calc(var(--i, 0) * 160ms); }
  .demo-play .demo-chip::after { animation: demoGlow 3.2s var(--ease) infinite both; animation-delay: calc(var(--i, 0) * 220ms); }
  .demo-play .demo-drag { animation: demoDrag 3.6s var(--ease) infinite; }
  .demo-play .demo-fly { animation: demoFly 3.2s var(--ease) infinite; }
  .demo-play .demo-check { animation: demoPop 3.2s var(--ease) infinite; }
  .demo-play .demo-bar { animation: demoGrow 3.2s var(--ease) infinite both; animation-delay: calc(var(--i, 0) * 90ms); }
  .demo-play .demo-fill { animation: demoFill 3.2s var(--ease) infinite both; animation-delay: calc(var(--i, 0) * 400ms); }
  .demo-play .demo-press { animation: demoPress 3.2s var(--ease) infinite; }
  .demo-play .demo-ring { animation: demoSpot 4.2s var(--ease) infinite; }
}
@keyframes demoCur   { 0% { opacity: 0; transform: translate(-46px, 40px); } 12% { opacity: 1; } 40% { transform: none; } 48% { transform: scale(.82); } 56%, 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes demoGlow  { 0%, 38% { opacity: 0; } 50%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes demoLift  { 0%, 38% { transform: none; } 50%, 82% { transform: translateY(-3px); } 100% { transform: none; } }
@keyframes demoStamp { 0% { opacity: 0; transform: scale(0); } 8% { opacity: 1; transform: scale(1.2); } 14%, 78% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(.6); } }
@keyframes demoDrag  { 0%, 12% { opacity: 1; transform: none; } 22% { transform: translateY(-3px) rotate(-2deg) scale(1.03); } 56% { transform: translate(133.3%, -3px) rotate(-2deg) scale(1.03); } 64%, 86% { opacity: 1; transform: translateX(133.3%); } 94% { opacity: 0; transform: translateX(133.3%); } 95%, 100% { opacity: 0; transform: none; } }
@keyframes demoFly   { 0% { opacity: 0; transform: none; } 8%, 24% { opacity: 1; transform: none; } 50% { opacity: 0; transform: translateX(150%) scale(.9); } 51%, 100% { opacity: 0; transform: none; } }
@keyframes demoPop   { 0%, 46% { opacity: 0; transform: scale(.4); } 56% { opacity: 1; transform: scale(1.12); } 62%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes demoGrow  { 0% { transform: scaleY(0); } 30%, 80% { transform: none; } 100% { transform: scaleY(0); } }
@keyframes demoFill  { 0% { transform: scaleX(0); } 22%, 84% { transform: none; } 100% { transform: scaleX(0); } }
@keyframes demoPress { 0%, 44% { transform: none; } 50% { transform: scale(.94); } 56%, 100% { transform: none; } }
@keyframes demoSpot  { 0%, 22% { transform: none; } 33%, 55% { transform: translateX(125%); } 66%, 88% { transform: translateX(250%); } 100% { transform: none; } }

/* 페이지 틀 — 표가 남는 높이를 채우고 표 안에서만 스크롤 */
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.row-gap { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; min-width: 0; }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--text); font-weight: 700; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-1) var(--ease);
}
.link-btn:hover { text-decoration-color: var(--brand-dark); }
.note-text { font-size: 12px; color: var(--muted); line-height: 1.5; }
.act-row { display: inline-flex; align-items: center; justify-content: center; gap: var(--gap); }
.tbl .col-act { width: auto; }
/* 칸이 많은 표에서도 관리 단추는 늘 보이게 오른쪽에 붙인다 (휴대폰은 화면을 덮으므로 뺀다) */
@media (min-width: 641px) {
  .tbl td.col-act { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: -1px 0 0 var(--line); }
  .tbl th.col-act { position: sticky; right: 0; z-index: 4; box-shadow: -1px 0 0 var(--line); }
  .tbl tbody tr:hover td.col-act { background: var(--row-hover); }
  .tbl tbody tr.row-rest td.col-act { background: color-mix(in srgb, var(--warn-weak) 55%, var(--surface)); }
  .tbl tbody tr.row-out td.col-act { background: color-mix(in srgb, var(--danger-weak) 55%, var(--surface)); }
}
.tbl td { line-height: 1.4; }
.tbl td.wrap small { display: block; color: var(--muted); }
.tbl td .thumb { width: 26px; height: 26px; border-radius: 5px; object-fit: cover; background: var(--surface-3); display: block; margin: 0 auto; }
.dd-cell .dd-trigger { height: 25px; min-width: 0; font-size: 11.5px; padding: 0 7px; }
.mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.file-pick { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; min-width: 0; }
.file-pick .card-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.photo-row { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.photo-row img { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; border: 1px solid var(--line); }
.gallery { display: flex; flex-wrap: wrap; gap: var(--gap); }
.gallery:empty { display: none; }
.gallery div { position: relative; width: 96px; height: 72px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .icon-btn { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; flex: none; background: rgba(28, 26, 25, .72); border-color: transparent; color: #fff; }
.week-grid { display: grid; gap: var(--gap); }
.week-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: var(--gap); }
.week-row b { font-size: 12.5px; }
.week-row.is-off .input { opacity: .4; }
.cred { background: var(--side); color: #fff; border-color: var(--side); }
.cred .card-sub { color: #b9b2ab; }
.cred dl { margin: 0; display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: var(--gap); align-items: center; }
.cred dt { font-size: 12px; color: #a79f97; }
.cred dd { margin: 0; font-family: var(--mono); font-size: 14px; font-weight: 700; word-break: break-all; }
.perm-tools { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.ad-prev { position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--side); width: 100%; max-width: 360px; }
.ad-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-prev small { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); }
.ad-chip { display: inline-flex; align-items: center; gap: var(--gap); border-radius: var(--r-md); padding: 5px var(--gap); color: #fff; max-width: 260px; }
.ad-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type="range"] { width: 100%; accent-color: var(--brand-dark); }
.swatch { width: 30px; height: 30px; flex: 0 0 30px; border-radius: var(--r-md); border: 1px solid var(--line); }

/* 로그인 */
#login { position: fixed; inset: 0; z-index: 100; overflow: auto; background: var(--side); display: flex; align-items: center; justify-content: center; padding: var(--gap); }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--gap); }
.login-mark { display: flex; flex-direction: column; align-items: center; gap: var(--gap); color: #fff; text-align: center; padding-bottom: var(--gap); }
.login-mark svg { width: 56px; height: 56px; }
.login-mark h1 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.login-mark p { margin: 0; font-size: 12.5px; color: #a79f97; }
.login-card { background: var(--surface); border-radius: var(--r-lg); padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); }
.login-card .tabs { display: flex; }
.login-card .tab { flex: 1; }
.login-err { min-height: 17px; font-size: 12px; font-weight: 600; color: var(--danger); text-align: center; }
.login-links { display: flex; justify-content: center; gap: var(--gap); flex-wrap: wrap; }
.btn-lg { height: 38px; font-size: 13.5px; width: 100%; }
.demo-list { display: grid; gap: var(--gap); }
.demo-role { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: var(--gap); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: left; width: 100%;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.demo-role:hover { border-color: var(--brand); background: var(--accent-weak); }
.demo-role:active { transform: scale(.985); }
.demo-role b { font-size: 13px; }
.demo-role span { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.demo-badge { align-self: center; }

.stat-value .unit { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.cards > .span-all { grid-column: 1 / -1; }
.tabs-wrap { flex-wrap: wrap; max-width: 100%; }
.modal-box .table-shell { max-height: 46vh; }
.modal-foot { flex-wrap: wrap; }

/* =============================== 디자인 기준 D (2026-11-30) ===============================
   흰 바탕 · 검정 글자 · 레몬 한 점. 위계는 굵기가 아니라 크기와 색(검정 → 회색)으로 낸다 — 굵기 400, 머리 · 단추만 500.
   레몬(--brand)은 칠하는 색: 로고 기호 · 처리할 일 숫자 · 가장 먼저 할 일 단추(.btn-lemon) 한 군데에만.
   이 묶음이 파일 맨 끝에 있어야 위의 옛 모양을 덮는다. */

.ic-svg { width: 1em; height: 1em; flex: none; display: inline-block; fill: currentColor; vertical-align: -.125em; }
.ic { font-size: 16px; }

/* 셸 — 왼쪽 메뉴는 회색 판이 화면 끝까지, 본문은 흰 바탕 */
#app { padding: 0; gap: 0; }
.sidebar { background: var(--side); border: 0; border-radius: 0; color: var(--text); }
.brand { padding: 4px; }
.brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
.brand-name { font-weight: 500; font-size: 15px; letter-spacing: -.02em; color: var(--text); }
.brand-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em; color: var(--muted); }
.nav-group { padding: 4px 12px 0; font-size: 11px; font-weight: 500; letter-spacing: .03em; color: var(--muted); }
.nav-item { height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 0; color: var(--text); font-weight: 400; }
.nav-item:hover { background: var(--side-2); color: var(--text); }
.nav-item.is-active { background: var(--accent); color: var(--accent-text); font-weight: 500; border-color: transparent; }
.nav-item.is-active::before { content: none; }
.nav-item .ic { flex-basis: 16px; }
.nav-count { color: inherit; opacity: .65; }
.nav-badge { background: var(--brand); color: var(--on-brand); border: 0; font-weight: 500; }
.nav::-webkit-scrollbar-thumb { background: #cfcfcf padding-box; }
.nav::-webkit-scrollbar-thumb:hover { background: #b0b0b0 padding-box; }
.side-foot { border-top: 1px solid var(--line); }
.side-foot .btn { background: transparent; border-color: transparent; color: var(--text); justify-content: flex-start; }
.side-foot .btn:hover { background: var(--side-2); border-color: transparent; }
.side-who { padding: 0 12px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: var(--gap); }
.topbar { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 2px; }
.topbar h1 { font-size: 18px; font-weight: 400; letter-spacing: -.02em; }
/* 위치 표시는 묶음 / 화면 — 묶음은 회색, 화면 이름은 검정, 같은 크기 */
.menu-btn { order: -2; }
.topbar .crumb { order: -1; font-size: 18px; letter-spacing: -.02em; color: var(--muted); overflow: visible; flex: none; }
.topbar .crumb:not(:empty)::after { content: "/"; margin-left: 8px; color: var(--line-strong); }

/* 단추 — 알약. 주 단추는 검은 알약 · 흰 글자, 보통 단추는 흰 바탕 · 회색 바깥선 */
.btn { border-radius: var(--r-pill); padding: 0 14px; border-color: var(--line-strong); font-weight: 500; }
.btn:hover { background: var(--surface); border-color: #999; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, transparent); border-color: transparent; }
.btn-lemon { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-lemon:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: var(--danger-weak); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm, .toolbar .btn-sm { border-radius: var(--r-pill); padding: 0 12px; }
.btn-icon, .btn-icon.btn-sm, .toolbar .btn-sm.btn-icon { padding: 0; }
.icon-btn { border-radius: var(--r-pill); border-color: var(--line-strong); color: var(--text); }
.icon-btn:hover { background: var(--surface); border-color: #999; color: var(--text); }
.help-btn, .help-btn:hover { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.help-btn::after { border-color: var(--text); border-radius: var(--r-pill); }
.notes-btn { color: var(--text); }
.notes-btn.has-new::after { background: var(--danger); }
.link-btn { font-weight: 500; text-decoration-color: currentColor; text-decoration-thickness: 1px; }
.link-btn:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }

/* 입력 — 한 줄 칸은 알약, 여러 줄 칸은 14px */
.input, .select-native, .dd-trigger { border-radius: var(--r-pill); border-color: var(--line-strong); padding-left: 14px; }
.dd-trigger { padding-right: 10px; }
.textarea { border-radius: 14px; border-color: var(--line-strong); padding: 8px 12px; }
.input:hover, .textarea:hover, .dd-trigger:hover { border-color: #999; }
.input:focus, .textarea:focus, .dd.is-open .dd-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.input[readonly] { background: var(--surface-2); }
.input-num { font-family: var(--font); }
.search-box .input { padding-left: 34px; }
.search-box .ic { left: 13px; }
.dp .input { padding-right: 36px; }
.dp-btn { right: 2px; width: 32px; border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.dd-cell .dd-trigger { padding: 0 9px; }
.field > label { font-weight: 500; color: var(--text-2); }
.field .err, .login-err { font-weight: 500; }

/* 카드 · 필터 줄 — 필터 줄은 회색 판, 그 안의 칸은 흰 알약 */
.card { border-color: var(--line); }
.toolbar { background: var(--surface-2); border-color: transparent; }
.toolbar-label { font-weight: 500; }
.card-title { font-size: 14px; font-weight: 500; }
.stat-label { font-weight: 400; }
.stat-value { font-size: 18px; font-weight: 400; letter-spacing: -.01em; }
.stat-value .unit { font-weight: 400; }
.stat-link:hover { box-shadow: none; transform: none; border-color: #999; }
.hero-cell { background: var(--surface-2); border-color: transparent; border-radius: 14px; }
.hero-cell .hl { font-weight: 400; }
.hero-cell .hv { font-weight: 500; }
.banner { border-radius: var(--r-lg); }
.banner strong { font-weight: 500; }

/* 표 — 머리는 회색 판 · 검정 글자 500, 숫자는 본문 글꼴의 고른 폭 숫자 */
.tbl th { font-weight: 500; color: var(--text); }
.tbl td.num { font-family: var(--font); font-size: 12.5px; }
.tbl tbody tr.is-selected td { background: var(--accent-weak); }
.mini-row .mr { font-family: var(--font); }
.table-empty .em-title { font-weight: 500; color: var(--text); }
.pg { border-radius: var(--r-pill); border-color: var(--line-strong); font-weight: 500; }
.pg.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* 칩 — 회색 바탕 · 검정 글자. 상태 색은 옅은 바탕 + 진한 글자 */
.chip { font-weight: 500; background: var(--surface-2); color: var(--text-2); border-color: transparent; }
.chip-accent { background: var(--surface); color: var(--text); border-color: var(--text); }
.chip-solid { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip-lemon { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.circ { font-weight: 500; }
.circ-accent { background: var(--accent); color: var(--accent-text); }
.seg-opt { font-weight: 500; border-color: var(--line-strong); }
.seg-opt:hover { border-color: #999; }
.seg-opt.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.seg-meta { font-weight: 500; }
.tagpick .chip.is-on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tabs { border-radius: var(--r-pill); background: var(--surface-2); }
.tab { border-radius: var(--r-pill); font-weight: 500; }
.tab.is-on { background: var(--accent); color: var(--accent-text); box-shadow: none; }

/* 체크 · 스위치 · 달력 고른 날 — 검정 */
.cbx { border-color: #999; border-radius: 5px; }
.cbx.is-on, .cbx.is-part, .switch.is-on { background: var(--accent); border-color: var(--accent); }
.cbx.is-on svg { color: var(--accent-text); }
.switch { background: #cfcfcf; }
input[type="range"] { accent-color: var(--accent); }
.dd-panel, .cal { border-radius: var(--r-lg); border-color: var(--line); }
.cal-foot { border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px); }
.dd-opt { border-radius: 8px; }
.dd-opt.is-selected { color: var(--text); font-weight: 500; }
.dd-count { background: var(--accent); color: var(--accent-text); font-weight: 500; }
.cal-d, .cal-head .cal-nav, .cal-y, .cal-m { border-radius: var(--r-pill); }
.cal-y, .cal-yl, .cal-m, .cal-dow { font-weight: 500; }
.cal-d.is-today { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.cal-d.is-sel { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }

/* 창 · 알림 · 튜토리얼 */
.modal-box { border: 0; border-radius: 20px; }
.modal-title { font-size: 16px; font-weight: 500; }
.modal-foot { background: var(--surface); }
.toast { background: var(--accent); color: var(--accent-text); border: 0; border-radius: var(--r-pill); padding: 10px 16px; }
.toast > svg, .toast > i { color: var(--brand); }
.toast.is-err { border: 0; }
.toast.is-err > svg, .toast.is-err > i { color: #ff8a8a; }
.toast.is-warn { border: 0; }
.toast.is-warn > svg, .toast.is-warn > i { color: var(--brand); }
.tut-ring { border-radius: 12px; box-shadow: 0 0 0 9999px var(--overlay), 0 0 0 2px var(--brand); }
.tut-card { border: 0; border-radius: 20px; }
.tut-card .tut-step { color: var(--muted); font-family: var(--mono); font-weight: 400; letter-spacing: .03em; }
.tut-card .tut-t { font-size: 15px; font-weight: 500; }
.tut-dot.is-on { background: var(--accent); }
.loader-bar::after, .bar-fill, .demo-el.is-btn, .demo-dot, .demo-bar, .demo-check { background: var(--accent); }
.demo-check { color: var(--accent-text); }
.demo-hit::after, .demo-chip::after { background: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.demo-ring { box-shadow: 0 0 0 2px var(--accent), 0 0 0 600px rgba(0, 0, 0, .12); }

/* 가이드 · 패치노트 */
.guide-h { font-size: 22px; font-weight: 400; letter-spacing: -.02em; }
.guide-group { font-weight: 500; letter-spacing: .03em; }
.guide-link { border-radius: var(--r-pill); }
.guide-link:hover { background: var(--surface-3); }
.guide-link.is-active { background: var(--accent); color: var(--accent-text); font-weight: 500; border-color: transparent; }
.guide-sec-h, .guide-step .gs-t { font-weight: 500; }
.guide-step { border-radius: 14px; border-color: transparent; background: var(--surface-2); }
.guide-step:hover { border-color: var(--line); background: var(--surface); }
.guide-note, .guide-demo, .demo-stage { border-radius: 14px; }
.notes-date { font-family: var(--mono); font-weight: 400; letter-spacing: .03em; }
.notes-item { border-radius: var(--r-lg); }
.notes-item:hover { box-shadow: none; border-color: #999; }
.notes-where { color: var(--text); font-weight: 500; }

/* 로고 — 검은 칸 + 레몬 기호 */
.logo-bg { fill: #000000; }
.logo-mark { fill: var(--brand); }

/* 발급한 아이디 · 비밀번호 — 한 번 뒤집는 검은 무대 */
.cred { background: #000000; border-color: #000000; color: #ffffff; }
.cred .card-sub, .cred dt { color: #999999; }
.cred dd { font-weight: 500; }
.ad-prev { background: #000000; }

/* 로그인 — 흰 바탕, 큰 제목, 알약 단추 */
#login { background: var(--bg); }
.login-mark { color: var(--text); align-items: flex-start; text-align: left; }
.login-mark svg { width: 44px; height: 44px; }
.login-mark h1 { font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.login-mark p { font-size: 14px; color: var(--muted); }
.login-card { border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.btn-lg { height: 44px; font-size: 15px; }
.demo-role { border-radius: 14px; }
.demo-role:hover { border-color: var(--accent); background: var(--surface-2); }
.demo-role b { font-weight: 500; }

/* 휴대폰 폭 — 메뉴는 밀려 나오는 판 */
@media (max-width: 640px) {
  .sidebar { top: 0; bottom: 0; left: 0; border-radius: 0 20px 20px 0; box-shadow: var(--shadow-3); }
  .topbar .crumb { display: none; }
}

/* 새 버전 자동 업데이트 — 화면 가운데 큰 숫자 5 · 4 · 3 · 2 · 1 (ui.js checkBuild) */
.upd-root { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: var(--gap); background: rgba(255, 255, 255, .92); }
.upd-card { display: flex; flex-direction: column; align-items: center; gap: var(--gap); text-align: center; }
.upd-t { font-size: 22px; letter-spacing: -.02em; color: var(--text); }
.upd-num { font-size: 120px; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.upd-num::after { content: ""; display: block; width: 56px; height: 8px; margin: 6px auto 0; border-radius: var(--r-pill); background: var(--brand); }
.upd-s { font-size: 14px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .upd-root { animation: fadeIn var(--dur-2) var(--ease) both; }
  .upd-num { animation: updTick 1s var(--ease) infinite; }
}
@keyframes updTick { 0% { opacity: .35; transform: translateY(6px); } 25%, 100% { opacity: 1; transform: none; } }
@media (max-width: 640px) { .upd-num { font-size: 96px; } .upd-t { font-size: 18px; } }

/* 대시보드 위 한 줄 — 이름과 숫자를 나란히 (48px). 칸 사이 실선은 1px 틈으로 (어떤 줄바꿈에서도 선이 한 줄) */
.kpi-strip { flex: none; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kpi { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); min-width: 0; height: 48px; padding: 0 14px; border: 0; background: var(--surface); color: var(--text); text-align: left; }
.kpi-l { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kpi-v { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 18px; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v small { font-size: 12px; color: var(--muted); }
.kpi-v.is-todo { height: 26px; padding: 0 11px; border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand); font-size: 15px; font-weight: 500; }
.kpi-link { cursor: pointer; transition: background var(--dur-1) var(--ease); }
.kpi-link:hover { background: var(--surface-2); }
.kpi-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mini-row .ml-sub { margin-left: 6px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 640px) {
  .kpi-strip { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 0 10px; }
}

/* 표 안: 금액은 오른쪽, 칩 아래 작은 줄 (사용한 날 · 유효기간) */
.tbl td.amt { text-align: right; }
.stack-in { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.2; }
.stack-in small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* 기프티쇼 비즈머니 — 칩 · 충전 필요 · 충전 바로가기. 좁으면 통째로 다음 줄 */
.gsbox { position: relative; z-index: 6; display: inline-flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.gsneed { position: relative; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--danger); cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; outline: none; border-radius: 4px; }
.gsneed:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.gsneed .tip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: max-content; max-width: min(300px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 14px; background: #000; color: #d6d6d6; font-size: 12px; font-weight: 400; line-height: 1.55; white-space: normal; word-break: keep-all; text-align: left; text-decoration: none; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), visibility 0s var(--dur-1); }
.gsneed .tip b { display: block; margin-bottom: 2px; color: #fff; font-weight: 500; }
.gsneed:hover .tip, .gsneed:focus .tip { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (max-width: 720px) { .gsneed { position: static; } }

/* 사용자 상세 창 위 요약 — 한 줄에 이름 · 숫자, 셋씩 두 줄 (휴대폰은 둘씩) */
.kpi-strip.kpi-detail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-detail .kpi-v { font-size: 16px; }
@media (max-width: 640px) { .kpi-strip.kpi-detail { grid-template-columns: 1fr 1fr; } }

/* unslop 다듬기 (2026-11-30) — 작은 글자에는 좁은 자간을 쓰지 않는다 · 입력칸은 알약 대신 10px (단추 · 칩 · 메뉴만 알약) · 살아 있지 않은 점은 깜박이지 않는다 */
.brand-name, .topbar h1, .topbar .crumb, .modal-title, .card-title, .kpi-v, .stat-value, .tut-card .tut-t { letter-spacing: 0; }
.input, .select-native, .dd-trigger { border-radius: 10px; }
.textarea { border-radius: 10px; }
.dp-btn { border-radius: 0 9px 9px 0; }
.toolbar { border-radius: 20px; }
.notes-btn.has-new::after { animation: none; }
