/* VARA DQ — VARA BI 색 체계 (vara-crm theme.ts 와 같은 값). 외부 글꼴·스크립트 없음, 인라인 스타일 금지(CSP) */
:root {
  --navy950: #071526; --navy900: #0b1f3a; --navy800: #12345c; --navy700: #1d4877; --navy600: #2b5f94;
  --teal500: #1fa3a3; --teal700: #0f6e6e;
  --bg: #f4f6fa; --surface: #fff; --surface-2: #f8fafc; --tint: #eef3f9; --tint-border: #c9d6e6;
  --line: #e4e9f0; --line-strong: #cbd5e1; --ink: #0f172a; --ink-2: #334155; --muted: #5b6678;
  --brand: #1d4877; --brand-hover: #12345c; --brand-ink: #fff; --accent: #0f6e6e; --link: #1d4877; --focus: #2b5f94;
  --ok: #157347; --ok-bg: #e8f5ee; --ok-line: #b9e0c9; --err: #b42318; --err-bg: #fdecea; --err-line: #f5c2bd;
  --warn: #8a5a00; --warn-bg: #fff6e0; --warn-line: #f2d58f; --off: #64748b; --off-bg: #f1f5f9; --off-line: #e2e8f0;
  --radius: 14px; --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05); --shadow-2: 0 8px 24px rgba(15, 23, 42, .08); --shadow-3: 0 24px 60px rgba(7, 21, 38, .28);
  --side: 244px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, "Malgun Gothic", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121b2d; --surface-2: #18233a; --tint: #1a2942; --tint-border: #2d4163;
  --line: #243149; --line-strong: #364763; --ink: #e8eef7; --ink-2: #c6d1e1; --muted: #9aa8bf;
  --brand: #2f74c0; --brand-hover: #3f86d4; --accent: #4fd1d1; --link: #8fbdf0; --focus: #8fbdf0;
  --ok: #6fd6a0; --ok-bg: #12301f; --ok-line: #215238; --err: #ff9d91; --err-bg: #3a1a18; --err-line: #66302b;
  --warn: #f3c969; --warn-bg: #35290f; --warn-line: #5e4a1b; --off: #a3b1c6; --off-bg: #1f2b40; --off-line: #33425d;
  --shadow-1: none; --shadow-2: 0 8px 24px rgba(0, 0, 0, .35); --shadow-3: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121b2d; --surface-2: #18233a; --tint: #1a2942; --tint-border: #2d4163;
    --line: #243149; --line-strong: #364763; --ink: #e8eef7; --ink-2: #c6d1e1; --muted: #9aa8bf;
    --brand: #2f74c0; --brand-hover: #3f86d4; --accent: #4fd1d1; --link: #8fbdf0; --focus: #8fbdf0;
    --ok: #6fd6a0; --ok-bg: #12301f; --ok-line: #215238; --err: #ff9d91; --err-bg: #3a1a18; --err-line: #66302b;
    --warn: #f3c969; --warn-bg: #35290f; --warn-line: #5e4a1b; --off: #a3b1c6; --off-bg: #1f2b40; --off-line: #33425d;
    --shadow-1: none; --shadow-2: 0 8px 24px rgba(0, 0, 0, .35); --shadow-3: 0 24px 60px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
@view-transition { navigation: auto; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; word-break: keep-all; overflow-wrap: break-word; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.hide { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow-2); }
.skip:focus { top: 10px; }
.logo-d { display: none !important; }
:root[data-theme="dark"] .logo-l { display: none !important; }
:root[data-theme="dark"] .logo-d { display: inline-block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-l { display: none !important; }
  :root:not([data-theme="light"]) .logo-d { display: inline-block !important; }
}
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: inline-block; }
}

/* ---------- 로그인 화면 ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); }
.auth-aside { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(60% 50% at 85% 10%, rgba(31, 163, 163, .45) 0%, transparent 70%), radial-gradient(70% 60% at 0% 100%, rgba(43, 95, 148, .7) 0%, transparent 70%), linear-gradient(160deg, var(--navy950) 0%, var(--navy800) 100%); }
.auth-aside img { height: 28px; width: auto; align-self: flex-start; }
.auth-aside h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.25; font-weight: 800; max-width: 12em; }
.auth-aside .sub { margin: 14px 0 0; color: #c6d6ea; max-width: 30em; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: 14px; }
.auth-points .ico { color: #6fe0e0; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand img { height: 24px; width: auto; }
.auth-brand .product { font-weight: 800; color: var(--ink); font-size: 14px; letter-spacing: .02em; padding-left: 10px; border-left: 1px solid var(--line-strong); }
.auth-brand .icon-btn { margin-left: auto; }
.auth-card h1 { margin-bottom: 6px; font-size: 26px; }
.auth-card .lead { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.auth-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.target { display: inline-flex; align-items: center; gap: 6px; background: var(--tint); color: var(--ink); border: 1px solid var(--tint-border); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; margin-bottom: 14px; }

.stepper { list-style: none; display: flex; gap: 4px; margin: 0 0 24px; padding: 0; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.stepper li { flex: 1; display: grid; gap: 6px; }
.stepper li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line); }
.stepper li.done::before, .stepper li.on::before { background: var(--teal500); }
.stepper li.on { color: var(--ink); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 13px; min-height: 46px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: 13.5px; }
input:hover, select:hover, textarea:hover { border-color: var(--navy600); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input[type=search] { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c8aa0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.500'/%3E%3Cpath d='M20 20l-4.300-4.300'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; background-size: 17px; }
/* 비밀번호 보기 단추·대문자 경고 (app.js 가 감쌈) */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pw-eye:hover { color: var(--ink); background: var(--tint); }
.caps { font-size: 12.5px; color: var(--warn); font-weight: 700; }
/* 새 비밀번호 조건 표시 */
.pw-rules { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.pw-rules li.met { color: var(--ok); font-weight: 700; }
.pw-rules li.met::before { background: var(--ok); }
/* OTP 칸 — 진짜 입력은 하나(붙여넣기·자동 입력 유지), 칸 6개는 보여 주기만 */
input.code { font-size: 26px; letter-spacing: .4em; text-align: center; font-weight: 700; padding: 10px; }
.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input.code { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; color: transparent; caret-color: transparent; border: 0; padding: 0; cursor: text; }
.otp-cell { height: 58px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 26px; font-weight: 800; }
.otp-cell.on { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.otp-cell.fill { background: var(--tint); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; border-radius: var(--radius-sm); padding: 10px 16px; min-height: 42px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-block { width: 100%; min-height: 50px; font-size: 16px; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--tint); border-color: var(--navy600); }
.btn-danger { background: var(--surface); color: var(--err); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); }
.btn-danger-fill { background: #c0281c; color: #fff; }
.btn-danger-fill:hover { background: #a11f15; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn-link { background: none; border: none; color: var(--link); padding: 0; min-height: auto; font-weight: 600; text-decoration: underline; cursor: pointer; font: inherit; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn-outline.loading::after, .btn-danger.loading::after { border-color: var(--line-strong); border-top-color: var(--ink); }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--tint); color: var(--ink); }

.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert-info { background: var(--tint); color: var(--ink); border-color: var(--tint-border); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: min(420px, calc(100vw - 40px)); margin: 0; box-shadow: var(--shadow-2); animation: rise .25s ease-out; align-items: center; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.toast .x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; display: grid; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.qr { display: grid; justify-items: center; gap: 10px; margin: 6px 0 16px; }
.qr svg { width: 196px; height: 196px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.secret { font-family: var(--mono); background: var(--tint); border-radius: 8px; padding: 6px 10px; font-size: 14px; letter-spacing: .06em; user-select: all; }
ol.guide { padding-left: 20px; margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
ol.guide li { margin-bottom: 4px; }

/* ---------- 앱 틀 (내 계정·관리) ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: linear-gradient(180deg, var(--navy950) 0%, var(--navy900) 100%); color: #d5e0ee; display: flex; flex-direction: column; padding: 16px 12px; z-index: 40; overflow-y: auto; }
.side .logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 6px 10px 18px; }
.side .logo img { height: 21px; }
.side .logo b { font-size: 13px; letter-spacing: .03em; border-left: 1px solid rgba(255, 255, 255, .3); padding-left: 10px; }
.side h3 { font-size: 11.5px; font-weight: 700; color: #8ea3bf; letter-spacing: .04em; margin: 14px 10px 6px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; color: #d5e0ee; text-decoration: none; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav a.on { background: rgba(31, 163, 163, .22); color: #fff; box-shadow: inset 3px 0 0 var(--teal500); }
.scrim { display: none; }
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.top .logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.top .logo img { height: 21px; }
.top .logo b { font-size: 13px; letter-spacing: .03em; border-left: 1px solid var(--line-strong); padding-left: 10px; }
.nav-btn { display: none; }
.has-side .top .logo { display: none; }
.palette-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; min-width: 240px; }
.palette-btn:hover { border-color: var(--line-strong); color: var(--ink); }
kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface-2); }
.palette-btn kbd { margin-left: auto; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.top .who form { margin: 0; }
.top .who .who-name { font-weight: 700; }
.top .who .btn { min-height: 38px; padding: 4px 12px; font-size: 13px; background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.top .who .btn:hover { background: var(--tint); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(140deg, var(--navy700), var(--teal500)); color: #fff; font-weight: 800; font-size: 13px; flex: none; vertical-align: middle; }
.avatar.sm { width: 26px; height: 26px; font-size: 11.5px; margin-right: 6px; }
table.stack td .avatar.sm { margin-right: 0; }
.chrome.has-side ~ .page { margin-left: var(--side); max-width: none; }
.chrome.has-side .top { margin-left: var(--side); }
.page { max-width: 1120px; margin: 0 auto; padding: 26px 24px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 62em; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-bottom: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-1); text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s, border-color .12s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.stat .tile { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--link); flex: none; }
.stat .tile.err { background: var(--err-bg); color: var(--err); }
.stat .tile.ok { background: var(--ok-bg); color: var(--ok); }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat .value { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat .value.err { color: var(--err); }

/* 내 계정 보안 요약 */
.sec { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow-1); }
.sec:hover { border-color: var(--line-strong); }
.sec .tile { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); flex: none; }
.sec.warn .tile { background: var(--warn-bg); color: var(--warn); }
.sec b { display: block; font-size: 14px; }
.sec span.d { font-size: 12.5px; color: var(--muted); }

.apps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.app { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--surface); transition: transform .12s, box-shadow .12s, border-color .12s; }
.app:hover { border-color: var(--focus); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.app .mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(140deg, var(--navy700), var(--teal500)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.app > span:not(.mark) { min-width: 0; flex: 1; }
.app b { display: block; }
.app span span, .app b + span { font-size: 12.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .go { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 800; white-space: nowrap; position: sticky; top: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
table[data-rowlink] tbody tr:has(a) { cursor: pointer; }
td.num { text-align: right; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
.empty { text-align: center; color: var(--muted); padding: 36px 20px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: var(--ink); border: 1px solid var(--tint-border); white-space: nowrap; }
.chip-ok, .chip-err, .chip-warn { padding-left: 8px; }
.chip-ok::before, .chip-err::before, .chip-warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip-err { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.chip-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.chip-off { background: var(--off-bg); color: var(--off); border-color: var(--off-line); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; flex: 0 1 280px; min-height: 42px; }
.toolbar .pw-wrap { width: auto; flex: 0 1 280px; }
.toolbar .pw-wrap input { width: 100%; }
.form-grid { display: grid; gap: 4px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
/* 켜고 끄는 값은 스위치로 */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; margin: 1px 0 0; flex: none; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; }
.check input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.check input:checked { background: var(--teal500); }
.check input:checked::after { transform: translateX(16px); }
.check input:disabled { opacity: .5; cursor: not-allowed; }
.check b { display: block; font-size: 14px; }
.check span { font-size: 12.5px; color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.checks .check { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.checks .check:has(input:checked) { border-color: var(--teal500); background: color-mix(in srgb, var(--teal500) 9%, transparent); }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 12px 16px; margin-top: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); }
.savebar .dirty-note { color: var(--warn); font-size: 13px; font-weight: 700; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); font-weight: 700; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.copy-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 4px; vertical-align: middle; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); cursor: pointer; }
.copy-btn:hover { color: var(--ink); background: var(--tint); }
.copy-btn.done { color: var(--ok); border-color: var(--ok-line); }
.secret-box { border: 2px dashed var(--teal500); background: color-mix(in srgb, var(--teal500) 8%, var(--surface)); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.secret-box .secret { display: inline-block; font-size: 18px; margin: 6px 0; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:first-child { padding-top: 0; }
.setting:last-child { border-bottom: none; padding-bottom: 0; }
.setting b { display: block; font-size: 14px; }
.setting span { font-size: 12.5px; color: var(--muted); }
.gap { height: 16px; }
dl.kv + p, .actions-row + dl.kv { margin-top: 14px; }

/* 확인 창 · 빠른 이동 */
dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); padding: 0; }
dialog::backdrop { background: rgba(7, 21, 38, .5); backdrop-filter: blur(2px); }
.dlg { width: min(420px, calc(100vw - 32px)); padding: 22px; }
.dlg h2 { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.dlg h2 .ico { color: var(--warn); }
.dlg.danger h2 .ico { color: var(--err); }
.dlg p { margin: 0 0 18px; color: var(--ink-2); font-size: 14.5px; }
.dlg .btns { display: flex; gap: 8px; justify-content: flex-end; }
.palette { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 54px; padding: 0 18px; box-shadow: none !important; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.palette li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.palette li.on a { background: var(--tint); }
.palette .none { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* 휴대폰 승인 */
.match { display: grid; justify-items: center; gap: 4px; margin: 6px 0 14px; padding: 18px; border-radius: 16px; background: var(--tint); border: 1px solid var(--tint-border); }
.match-num { font-size: 60px; font-weight: 800; color: var(--ink); letter-spacing: .08em; line-height: 1.1; }
.wait { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 10px; border-radius: 10px; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.wait.ok { background: var(--ok-bg); color: var(--ok); }
.wait.err { background: var(--err-bg); color: var(--err); }
.wait.ok .spinner, .wait.err .spinner { display: none; }
.wait-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.wait-bar i { display: block; height: 100%; background: var(--teal500); transform-origin: left; transition: transform 1s linear; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--tint-border); border-top-color: var(--focus); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-big { font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: .18em; color: var(--ink); background: var(--tint); border-radius: 12px; padding: 10px 18px; display: inline-block; }
.app-info { margin: 14px 0 10px; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .chrome.has-side ~ .page, .chrome.has-side .top { margin-left: 0; }
  .side { transform: translateX(-100%); transition: transform .2s; }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(7, 21, 38, .5); z-index: 35; }
  .nav-btn { display: inline-grid; }
  .has-side .top .logo { display: flex; }
  .palette-btn { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .palette-btn span, .palette-btn kbd { display: none; }
}
@media (max-width: 640px) {
  .top-in { padding: 0 14px; gap: 8px; }
  .top .who .who-name, .top .logo b, .top .who .btn span { display: none; }
  .page { padding: 18px 14px 60px; }
  .setting { grid-template-columns: 1fr; }
  .auth-main { align-items: start; padding: 24px 18px; }
  h1, .auth-card h1 { font-size: 22px; }
  .otp-cell { height: 50px; font-size: 22px; }
  /* 표를 카드처럼 — app.js 가 칸마다 머리글을 data-label 로 넣음 */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: none; }
  table.stack td { border: 0; padding: 3px 0; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px 6px; text-align: right; white-space: normal; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: left; flex: none; margin-right: auto; }
  table.stack td.empty { justify-content: center; }
  table.stack td:empty { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}

/* ---------- VARA DQ 추가 ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: thin; }
.tabs a { padding: 9px 13px; font-size: 14px; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--teal500); }
meter { width: 100%; height: 10px; border-radius: 6px; }
.meter-row { display: grid; grid-template-columns: 110px 1fr 72px; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.meter-row b { font-weight: 700; }
.meter-row span:last-child { text-align: right; font-weight: 700; }
.score-big { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.score-big small { font-size: 16px; color: var(--muted); font-weight: 700; }
.inline { display: inline; margin: 0; }
.row-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row-form .field { margin-bottom: 0; flex: 1 1 150px; }
.row-form select, .row-form input { min-height: 42px; padding: 8px 11px; }
td select, td input[type=text] { min-height: 36px; padding: 5px 9px; font-size: 13.5px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); margin-bottom: 6px; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 12.5px; flex: none; }
.steps li.done::before { background: var(--ok-bg); color: var(--ok); }
.note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.mono.small { overflow-wrap: anywhere; word-break: break-all; }
.card-head .toolbar { flex-wrap: nowrap; margin: 0; }
.card-head .toolbar input[type=number] { width: 110px; min-height: 42px; padding: 8px 11px; }
