/* ToneSee basecamp — 스타일
   순수 CSS. 프레임워크·빌드 없음.

   색은 전부 이 파일 맨 위 팔레트를 거친다. 규칙 안에 색 값을 직접 쓰지 않는다.
   팔레트는 세 블록뿐이다 —
     :root                                          라이트
     @media (prefers-color-scheme: dark) :root      OS 설정을 따를 때의 다크
     :root[data-theme="dark"]                       사용자가 직접 고른 다크
   뒤의 두 블록은 내용이 같아야 한다 (test/theme.js 가 확인한다).
   사용자가 라이트를 직접 고르면 [data-theme="light"] 가 붙어 OS 다크를 이긴다. */

/* ─────────────────────────── 팔레트 (라이트) ─────────────────────────── */
:root {
  --data-gap: 16px;
  --data-section: 24px;
  --data-title: 24px;
  --data-number: 28px;
  --data-small: 12px;
  --bg:          #f5f6f8;
  --surface:     #ffffff;
  --surface-2:   #fafbfc;
  --line:        #e3e6ea;
  --line-2:      #eef0f3;
  --line-strong: #d3d8de;
  --text:        #1b2027;
  --text-2:      #5b6472;
  --text-3:      #8a93a0;

  --nav-bg:         #171c24;
  --nav-text:       #aeb7c4;
  --nav-text-hover: #dde3ea;
  --nav-active:     #ffffff;
  --nav-hover:      #232a35;
  --nav-dim:        #6f7a89;
  --nav-line:       rgba(255, 255, 255, .09);

  --accent:        #2f6df0;
  --accent-strong: #255bd0;
  --accent-dim:    #e8efff;
  --on-accent:     #ffffff;
  --focus-ring:    rgba(47, 109, 240, .18);

  --ok:      #17794a;  --ok-bg:      #e4f4ea;  --ok-line:      #bfe3cd;
  --warn:    #8a5a00;  --warn-bg:    #fdf0d5;  --warn-line:    #f0dcae;
  --danger:  #b3261e;  --danger-bg:  #fdeaea;  --danger-line:  #e7bdbb;
  --info:    #1f5f8b;  --info-bg:    #e4f0f8;  --info-line:    #cfe3f0;
  --neutral: #59616d;  --neutral-bg: #eceef1;  --neutral-line: #dcdfe4;
  --priv:    #6b21a8;  --priv-bg:    #f3e8ff;

  --table-head: #fafbfc;
  --table-head-text: #5b6472;
  --table-column: transparent;
  --table-padding: 8px 12px;
  --table-font: 12.5px;
  --table-head-font: 11.5px;
  --row-alt:   #fbfcfd;
  --row-hover: #e8efff;
  --line-row:  #f1f3f5;
  /* HUD 발광색 — 상태창 점이 같은 팔레트를 쓴다 (두 테마 모두 같은 값) */
  --hud-off:    #626873;
  --hud-white:  #ffffff;
  --hud-yellow: #ffd600;
  --hud-red:    #ff3030;

  --skel-1: #eceef1;
  --skel-2: #f5f6f8;

  --scrim:  rgba(16, 20, 28, .42);
  --shadow: 0 8px 28px rgba(20, 26, 35, .14);

  --toast-bg:   #171c24;
  --toast-text: #ffffff;

  --auth-1: #1b2230;
  --auth-2: #10141c;

  --assume-bg: #fff8ee;  --assume-line: #e0c9a8;

  --radius: 8px;
  --radius-sm: 5px;
  --font: "Malgun Gothic", "맑은 고딕", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Consolas", "D2Coding", ui-monospace, monospace;
}

/* ───────────────────── 팔레트 (다크 — OS 설정을 따를 때) ───────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --data-gap: 16px;
  --data-section: 24px;
  --data-title: 24px;
  --data-number: 28px;
  --data-small: 12px;
    --bg:          #0d121b;
    --surface:     #161e2b;
    --surface-2:   #202c3d;
    --line:        #3a4b63;
    --line-2:      #2d3b50;
    --line-strong: #526880;
    --text:        #edf3fc;
    --text-2:      #c2cee0;
    --text-3:      #a6b7ce;

    --nav-bg:         #0a0d12;
    --nav-text:       #9aa5b3;
    --nav-text-hover: #dde3ea;
    --nav-active:     #ffffff;
    --nav-hover:      #1a212b;
    --nav-dim:        #79838f;
    --nav-line:       rgba(255, 255, 255, .08);

    --accent:        #6f9bff;
    --accent-strong: #8fb2ff;
    --accent-dim:    #1b2842;
    --on-accent:     #0b1220;
    --focus-ring:    rgba(111, 155, 255, .26);

    --ok:      #6ee7a8;  --ok-bg:      #10291d;  --ok-line:      #1e5238;
    --warn:    #ffc95c;  --warn-bg:    #2e2312;  --warn-line:    #5a4520;
    --danger:  #ff8f85;  --danger-bg:  #331a19;  --danger-line:  #63302c;
    --info:    #7cc4f2;  --info-bg:    #10242f;  --info-line:    #23485c;
    --neutral: #b6c0cd;  --neutral-bg: #2d3b50;  --neutral-line: #333c48;
    --priv:    #d6b4fe;  --priv-bg:    #251a33;

    --table-head: #2c3e56;
  --table-head-text: #edf3fc;
  --table-column: #3b4d66;
  --table-padding: 12px 14px;
  --table-font: 13px;
  --table-head-font: 12.5px;
  --row-alt:   #212e40;
    --row-hover: #2e4564;
    --line-row:  #41536c;
    /* HUD 발광색 — 상태창 점이 같은 팔레트를 쓴다 (두 테마 모두 같은 값) */
    --hud-off:    #626873;
    --hud-white:  #ffffff;
    --hud-yellow: #ffd600;
    --hud-red:    #ff3030;

    --skel-1: #1e242d;
    --skel-2: #262d38;

    --scrim:  rgba(0, 0, 0, .62);
    --shadow: 0 10px 34px rgba(0, 0, 0, .62);

    --toast-bg:   #3a4b63;
    --toast-text: #edf3fc;

    --auth-1: #10141c;
    --auth-2: #070a0e;

    --assume-bg: #241d12;  --assume-line: #5a4520;
  }
}

/* ───────────────────── 팔레트 (다크 — 사용자가 직접 고름) ───────────────────── */
:root[data-theme="dark"] {
  --data-gap: 16px;
  --data-section: 24px;
  --data-title: 24px;
  --data-number: 28px;
  --data-small: 12px;
  --bg:          #0d121b;
  --surface:     #161e2b;
  --surface-2:   #202c3d;
  --line:        #3a4b63;
  --line-2:      #2d3b50;
  --line-strong: #526880;
  --text:        #edf3fc;
  --text-2:      #c2cee0;
  --text-3:      #a6b7ce;

  --nav-bg:         #0a0d12;
  --nav-text:       #9aa5b3;
  --nav-text-hover: #dde3ea;
  --nav-active:     #ffffff;
  --nav-hover:      #1a212b;
  --nav-dim:        #79838f;
  --nav-line:       rgba(255, 255, 255, .08);

  --accent:        #6f9bff;
  --accent-strong: #8fb2ff;
  --accent-dim:    #1b2842;
  --on-accent:     #0b1220;
  --focus-ring:    rgba(111, 155, 255, .26);

  --ok:      #6ee7a8;  --ok-bg:      #10291d;  --ok-line:      #1e5238;
  --warn:    #ffc95c;  --warn-bg:    #2e2312;  --warn-line:    #5a4520;
  --danger:  #ff8f85;  --danger-bg:  #331a19;  --danger-line:  #63302c;
  --info:    #7cc4f2;  --info-bg:    #10242f;  --info-line:    #23485c;
  --neutral: #b6c0cd;  --neutral-bg: #2d3b50;  --neutral-line: #333c48;
  --priv:    #d6b4fe;  --priv-bg:    #251a33;

  --table-head: #2c3e56;
  --table-head-text: #edf3fc;
  --table-column: #3b4d66;
  --table-padding: 12px 14px;
  --table-font: 13px;
  --table-head-font: 12.5px;
  --row-alt:   #212e40;
  --row-hover: #2e4564;
  --line-row:  #41536c;
  /* HUD 발광색 — 상태창 점이 같은 팔레트를 쓴다 (두 테마 모두 같은 값) */
  --hud-off:    #626873;
  --hud-white:  #ffffff;
  --hud-yellow: #ffd600;
  --hud-red:    #ff3030;

  --skel-1: #1e242d;
  --skel-2: #262d38;

  --scrim:  rgba(0, 0, 0, .62);
  --shadow: 0 10px 34px rgba(0, 0, 0, .62);

  --toast-bg:   #3a4b63;
  --toast-text: #edf3fc;

  --auth-1: #10141c;
  --auth-2: #070a0e;

  --assume-bg: #241d12;  --assume-line: #5a4520;
}

/* 폼 컨트롤·스크롤바가 브라우저 기본 색을 쓰지 않게 */
:root {
  --data-gap: 16px;
  --data-section: 24px;
  --data-title: 24px;
  --data-number: 28px;
  --data-small: 12px; color-scheme: light; }
:root[data-theme="dark"] {
  --data-gap: 16px;
  --data-section: 24px;
  --data-title: 24px;
  --data-number: 28px;
  --data-small: 12px; color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --data-gap: 16px;
  --data-section: 24px;
  --data-title: 24px;
  --data-number: 28px;
  --data-small: 12px; color-scheme: dark; } }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 13px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; }

/* ---------- 로그인 ---------- */
.auth-wrap {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--auth-1) 0%, var(--auth-2) 100%); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 32px 30px; box-shadow: var(--shadow);
}
.auth-brand { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.auth-sub { color: var(--text-3); font-size: 12px; margin-top: 4px; margin-bottom: 24px; }
.auth-step { display: none; }
.auth-step.is-on { display: block; }
.auth-steps-ind { display: flex; gap: 6px; margin-bottom: 20px; }
.auth-steps-ind i {
  height: 3px; flex: 1; border-radius: 2px; background: var(--line); display: block;
}
.auth-steps-ind i.on { background: var(--accent); }
.auth-hint {
  margin-top: 20px; padding: 10px 12px; background: var(--surface-2);
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  font-size: 11.5px; color: var(--text-2); line-height: 1.7;
}
.auth-hint b { color: var(--text); }
.totp-input {
  letter-spacing: 10px; text-align: center; font-family: var(--mono);
  font-size: 20px; font-weight: 700;
}

/* ---------- 앱 셸 ---------- */
.app { display: grid; grid-template-columns: 226px 1fr; height: 100vh; }

.nav { background: var(--nav-bg); display: flex; flex-direction: column; min-height: 0; }
.nav-brand {
  padding: 16px 18px 14px; color: var(--nav-active); font-weight: 800; font-size: 15px;
  letter-spacing: -.3px; border-bottom: 1px solid var(--nav-line);
}
.nav-brand small { display: block; font-weight: 500; font-size: 10.5px; color: var(--nav-dim); letter-spacing: 0; margin-top: 2px; }
.nav-list { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; margin-bottom: 1px; border: 0; background: none; cursor: pointer;
  color: var(--nav-text); border-radius: var(--radius-sm); font-size: 12.5px;
}
.nav-item:hover { background: var(--nav-hover); color: var(--nav-text-hover); }
.nav-item.is-active { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.nav-item .n { font-family: var(--mono); font-size: 10.5px; opacity: .6; width: 10px; }
.nav-item.is-active .n { opacity: .85; }
.nav-sep { height: 1px; background: var(--nav-line); margin: 9px 10px; }
.nav-foot { padding: 10px 16px 14px; font-size: 10.5px; color: var(--nav-dim); border-top: 1px solid var(--nav-line); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.hdr {
  height: 52px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px; gap: 16px;
}
.hdr-title { font-size: 14px; font-weight: 700; }
.hdr-right { display: flex; align-items: center; gap: 10px; }
.acct { text-align: right; line-height: 1.3; }
.acct b { font-size: 12.5px; }
.acct span { display: block; font-size: 11px; color: var(--text-3); }

/* 화면 밝기 토글 */
.theme-btn { display: inline-flex; align-items: center; gap: 6px; }
.theme-btn .ico { font-size: 12px; line-height: 1; }

.crumb {
  flex: none; height: 34px; display: flex; align-items: center; gap: 6px;
  padding: 0 18px; background: var(--surface-2); border-bottom: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--text-2);
}
.crumb .sep { color: var(--text-3); }
.crumb .cur { color: var(--text); font-weight: 700; }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--accent); }

.content { flex: 1; overflow-y: auto; padding: 18px 18px 64px; position: relative; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-head h2 { font-size: 16px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 12px; max-width: 720px; }
.page-actions { display: flex; gap: 8px; flex: none; }

/* 기능 코드 자리 */
.code-slot {
  position: fixed; right: 10px; bottom: 8px; z-index: 30;
  display: flex; align-items: center; gap: 5px;
  background: none; color: var(--text-3); border: 0; box-shadow: none;
  padding: 2px 4px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .3px; opacity: .8; pointer-events: none; user-select: none;
}
.code-slot em { font-style: normal; color: var(--text-3); font-size: 9px; }

/* ---------- 서브탭 ---------- */
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.subtab {
  border: 0; background: none; cursor: pointer; padding: 8px 13px; font-size: 12.5px;
  color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap;
}
.subtab:hover { color: var(--text); }
.subtab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

/* ---------- 카드 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 14px; }
.card-head {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h3 { font-size: 13px; }
.card-head .sub { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 14px; }
.card-body.flush { padding: 0; }

.stat-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.stat {
  flex: none; min-width: 172px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat .k { font-size: 11.5px; color: var(--text-3); }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-top: 3px; }
.stat .v small { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: 3px; }

/* ---------- 테이블 ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--table-font); }
.tbl th, .tbl td { padding: var(--table-padding); border-right: 1px solid var(--table-column); text-align: left; border-bottom: 1px solid var(--line-row); white-space: nowrap; }
.tbl th { background: var(--table-head); color: var(--table-head-text); border-bottom: 2px solid var(--line-strong); font-weight: 700; font-size: var(--table-head-font); position: sticky; top: 0; }
.tbl tbody tr:nth-child(even) { background: var(--row-alt); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:hover, .tbl tbody tr:focus-within { background: var(--row-hover); }
.tbl th:last-child, .tbl td:last-child { border-right: 0; }
.tbl td.mono, .tbl th.mono { font-family: var(--mono); font-size: 11.5px; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-foot {
  padding: 8px 12px; border-top: 1px solid var(--line-row); color: var(--text-3);
  font-size: 11.5px; display: flex; justify-content: space-between; align-items: center;
}

/* ---------- Badge ----------
   알약도 점도 쓰지 않는다. 글자와 글자색만으로 상태를 보여 준다. */
.badge {
  display: inline; padding: 0; border: 0; background: none; border-radius: 0;
  font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap;
}
.badge.ok      { color: var(--ok); }
.badge.warn    { color: var(--warn); }
.badge.danger  { color: var(--danger); }
.badge.info    { color: var(--info); }
.badge.neutral { color: var(--neutral); }
.badge.priv    { color: var(--priv); }

/* ---------- 버튼 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { background: var(--surface); border-color: var(--danger-line); color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: 3px 9px; font-size: 11.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; padding: 10px; font-size: 13px; }

/* ---------- Form ---------- */
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.field .err { font-size: 11px; color: var(--danger); margin-top: 4px; display: none; }
.field.is-err .err { display: block; }
.field.is-err .input { border-color: var(--danger); }
.input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
textarea.input { resize: vertical; min-height: 68px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.inline-note {
  background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info);
  border-radius: var(--radius-sm); padding: 8px 11px; font-size: 11.5px; margin-bottom: 13px;
}
.inline-note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

/* ---------- 상태 뷰 ---------- */
.state { padding: 44px 20px; text-align: center; color: var(--text-2); }
.state .ico { font-size: 26px; opacity: .5; }
.state h4 { margin: 10px 0 4px; font-size: 13.5px; color: var(--text); }
.state p { margin: 0 0 14px; font-size: 12px; color: var(--text-3); }
.skel { background: linear-gradient(90deg, var(--skel-1) 25%, var(--skel-2) 50%, var(--skel-1) 75%);
  background-size: 200% 100%; animation: sk 1.1s linear infinite; border-radius: 4px; height: 11px; }
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.skel-row { display: flex; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line-row); }
.skel-row .skel:nth-child(1) { flex: 2 } .skel-row .skel:nth-child(2) { flex: 3 }
.skel-row .skel:nth-child(3) { flex: 1 } .skel-row .skel:nth-child(4) { flex: 1 }

/* ---------- Drawer ---------- */
.scrim {
  position: fixed; inset: 0; background: var(--scrim); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .16s;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 94vw);
  background: var(--surface); z-index: 70; box-shadow: var(--shadow);
  border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .2s ease;
  display: flex; flex-direction: column;
}
.drawer.is-on { transform: none; }
.drawer-head {
  flex: none; padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-head h3 { font-size: 14px; }
.drawer-head .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.drawer-foot {
  flex: none; padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2);
}
.x-btn { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--text-3); line-height: 1; padding: 2px 4px; }
.x-btn:hover { color: var(--text); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; z-index: 70; top: 50%; left: 50%; transform: translate(-50%,-48%);
  width: min(460px, 94vw); background: var(--surface); border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.modal.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.modal-head { padding: 15px 17px 0; }
.modal-head h3 { font-size: 14.5px; }
.modal-body { padding: 11px 17px 4px; font-size: 12.5px; color: var(--text-2); }
.modal-foot { padding: 13px 17px 15px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 정의 목록 ---------- */
.dl { display: grid; grid-template-columns: 128px 1fr; gap: 0; font-size: 12.5px; }
.dl dt { color: var(--text-3); padding: 7px 0; border-bottom: 1px solid var(--line-row); }
.dl dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line-row); }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filters .field { margin-bottom: 0; }
.filters .input { min-width: 130px; }

.toast-wrap { position: fixed; bottom: 46px; right: 14px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--toast-bg); color: var(--toast-text); padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 12px; box-shadow: var(--shadow); animation: tin .18s ease;
}
@keyframes tin { from { opacity: 0; transform: translateY(6px) } }

.banner-draft {
  background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); color: var(--warn);
  font-size: 11.5px; padding: 5px 18px; text-align: center; flex: none;
}

/* ---------- 로고 ---------- */
.nav-brand { padding: 14px 16px; display: flex; align-items: center; }
.nav-brand img { height: 22px; width: auto; display: block; }
.logo-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 58vh; gap: 18px;
}
.logo-hero img { width: min(520px, 62vw); height: auto; display: block; }
.logo-hero .tagline { color: var(--text-3); font-size: 12.5px; letter-spacing: .2px; }
.auth-logo { display: block; height: 30px; width: auto; margin-bottom: 20px; }

/* ---------- ASSUMPTION REQUIRED ---------- */
.assume {
  border: 1px solid var(--assume-line); background: var(--assume-bg); border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 14px;
}
.assume h4 {
  font-size: 12px; color: var(--warn); letter-spacing: .6px; margin-bottom: 7px;
  font-family: var(--mono);
}
.assume p { margin: 0 0 8px; font-size: 12.5px; color: var(--text); }
.assume ul { margin: 0; padding-left: 17px; font-size: 12.5px; color: var(--text-2); }
.assume li { margin-bottom: 4px; }

/* ---------- 추후 개발 자리 ---------- */
.placeholder {
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2);
  min-height: 260px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--text-3); gap: 6px; text-align: center; padding: 24px;
}
.placeholder .t { font-size: 14px; font-weight: 700; color: var(--text-2); }
.placeholder .d { font-size: 12px; }

/* ---------- HUD 테스트 화면 ----------
   왼쪽 시뮬레이터(입력) · 오른쪽 HUD(출력). HUD 안쪽 모양은 HUD 파일이 직접 가진다. */
.hud-lab { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.hud-lab .card + .card { margin-top: 14px; }
.hud-sim { min-width: 0; }
.hud-stage { min-width: 560px; overflow: auto; }
@media (max-width: 1100px) { .hud-lab { grid-template-columns: 1fr; } }

/* 2026-09-22 — '지금 상태'는 HUD 아래. 오른쪽 열 폭을 다 쓰지 않고 1/4 만 차지한다 */
.hud-out > .card + .card { width: 25%; min-width: 260px; }
@media (max-width: 1100px) { .hud-out > .card + .card { width: auto; min-width: 0; } }

/* 시뮬레이터 토글도 지금 상태를 색으로 보여 준다 */
.input.state-on    { border-color: var(--ok);   box-shadow: inset 3px 0 0 var(--ok); }
.input.state-speak { border-color: var(--info); box-shadow: inset 3px 0 0 var(--info); }
.input.state-off   { border-color: var(--line); box-shadow: inset 3px 0 0 var(--neutral); }

/* ---------- 상태창 — 지금 어느 상태인지 색으로 ---------- */
.stat-list { display: grid; gap: 5px; }
.stat-line {
  display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 6px 9px; border-radius: var(--radius-sm); background: var(--surface-2);
  transition: background .5s ease;
}
.stat-line.is-changed { background: var(--accent-dim); }
.stat-line .k { color: var(--text-3); font-size: 11.5px; }
.stat-line .v { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.stat-dot {
  width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--neutral);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.stat-dot.idle       { background: var(--neutral); }
.stat-dot.on         { background: var(--ok); }
.stat-dot.speak      { background: var(--info); }
.stat-dot.mute       { background: var(--warn); }
.stat-dot.blink      { background: var(--warn); animation: statBlink .9s ease-in-out infinite; }
.stat-dot.hud-off    { background: var(--hud-off); }
.stat-dot.hud-white  { background: var(--hud-white); }
.stat-dot.hud-yellow { background: var(--hud-yellow); }
.stat-dot.hud-red    { background: var(--hud-red); }
@keyframes statBlink { 50% { opacity: .25; } }

/* 60초 연쇄 남은 시간 */
.chain-bar {
  flex: 1 1 auto; height: 6px; min-width: 60px; border-radius: 99px;
  background: var(--line); overflow: hidden;
}
.chain-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s linear; }
.chain-text { flex: none; color: var(--text-2); font-size: 11.5px; }

/* ---------- 드릴다운 ---------- */
.drill-back {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--text-2); background: none; border: 0; cursor: pointer; padding: 4px 0; margin-bottom: 8px;
}
.drill-back:hover { color: var(--accent); }

/* ---------- 변경 전 / 후 나란히 ---------- */
.diff-title { font-size: 12.5px; margin-bottom: 7px; }
.diff { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.diff-row { display: grid; grid-template-columns: 110px 1fr 1fr; font-size: 12.5px; }
.diff-row > div { padding: 7px 10px; border-bottom: 1px solid var(--line-2); }
.diff-row:last-child > div { border-bottom: 0; }
.diff-head > div { background: var(--surface-2); color: var(--text-3); font-size: 11.5px; font-weight: 700; }
.diff-k { color: var(--text-3); border-right: 1px solid var(--line-2); }
.diff-b { color: var(--text-2); border-right: 1px solid var(--line-2); }
.diff-row.is-changed .diff-b { background: var(--danger-bg); color: var(--danger); text-decoration: line-through; }
.diff-row.is-changed .diff-a { background: var(--ok-bg); color: var(--ok); font-weight: 700; }

/* ---------- 자격증명 원문 ---------- */
.secret-val {
  font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 10px 0 8px; word-break: break-all; text-align: center;
}
.secret-val.is-masked { color: var(--text-3); letter-spacing: 3px; }
.secret-timer { font-size: 11.5px; color: var(--warn); text-align: center; }

/* Data workspace: inherits the existing light/dark palette. */
.data-workspace { min-width: 0; }
.data-heading { margin-bottom: var(--data-section); }
.data-heading h2 { font-size: var(--data-title); margin: 8px 0; letter-spacing: -.02em; }
.data-heading p { color: var(--text-2); margin: 0; line-height: 1.7; }
.data-eyebrow { color: var(--text-2); font-size: var(--data-small); }
.data-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--data-gap); margin-bottom: var(--data-section); }
.data-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--data-section); display: flex; flex-direction: column; gap: 8px; }
.data-stat strong { font-size: var(--data-number); font-variant-numeric: tabular-nums; }
.data-stat small { color: var(--text-2); }
.data-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--data-gap); margin-bottom: var(--data-gap); }
.data-month { display: flex; align-items: center; gap: 12px; }
.data-month input { color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 12px; font: inherit; min-height: 40px; }
.data-switch { display: flex; gap: 4px; }
.data-switch [aria-pressed="true"] { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.data-details { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--data-gap); margin: var(--data-section) 0; background: var(--surface-2); }
.data-details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.data-details[open] > summary { margin-bottom: var(--data-gap); }
.data-workspace :is(h2,p,td,summary) { word-break: keep-all; overflow-wrap: anywhere; }
.data-workspace :is(button,input,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.data-workspace .tbl td { white-space: normal; min-width: 96px; }
.data-workspace .tbl th { white-space: nowrap; }
@media (max-width: 600px) { .data-stats { grid-template-columns: 1fr; } .data-stat { padding: var(--data-gap); } .data-toolbar { align-items: start; flex-direction: column; } }
.data-workspace > .card, .data-workspace > div > .card { margin-bottom: var(--data-section); }
.data-workspace .tbl { min-width: 900px; }
.data-workspace .sub, .data-workspace .tbl-foot { word-break: keep-all; overflow-wrap: anywhere; }
.data-workspace .tbl-foot { gap: 12px; flex-wrap: wrap; }
.data-workspace .tbl-foot > span:first-child { flex-shrink: 0; }
.data-report-detail dd { word-break: keep-all; overflow-wrap: anywhere; }
.query-fields { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--data-gap); margin: var(--data-gap) 0; }
.query-field { display: flex; flex-direction: column; gap: 8px; color: var(--text-2); min-width: 0; }
.query-field :is(input,select) { padding: 8px 12px; min-height: 40px; width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.query-quick,.query-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.query-actions { justify-content: flex-end; margin: var(--data-gap) 0; }
.query-message { color: var(--text-2); line-height: 1.7; }
.query-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.data-query .card { margin-bottom: var(--data-section); }
@media(max-width: 900px) { .query-fields,.query-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 500px) { .query-fields,.query-stats { grid-template-columns: 1fr; } }

.tbl th.center, .tbl td.center { text-align: center; }
