/* VOCE — shared stylesheet (ported from Stitch design tokens). No external resources. */
:root {
  --accent: #0D9488;
  --success: #0F766E; --on-success: #FFFFFF; --success-container: #CCFBF1; --on-success-container: #115E59;
  --warning: #B45309; --on-warning: #FFFFFF; --warning-container: #FEF3C7; --on-warning-container: #92400E;
  --info: #0369A1; --on-info: #FFFFFF; --info-container: #E0F2FE; --on-info-container: #075985;
  --primary: #002C5F; --on-primary: #FFFFFF; --primary-container: #134280; --on-primary-container: #D7E3FF;
  --secondary: #515F79; --secondary-container: #D2E0FF; --on-secondary-container: #233049;
  --error: #BA1A1A; --on-error: #FFFFFF; --error-container: #FFDAD6; --on-error-container: #93000A;
  --surface: #F9F9FF;
  --surface-lowest: #FFFFFF; --surface-low: #F3F3F9; --surface-container: #EEEDF3;
  --surface-high: #E8E7EE; --surface-highest: #E2E2E8;
  --on-surface: #1A1C20; --on-surface-variant: #434750;
  --outline: #737781; --outline-variant: #C3C6D2;
  --inverse-surface: #2F3035; --inverse-on-surface: #F1F0F6;
  --scrim: rgba(26, 28, 32, .5);

  --font-headline: "Red Hat Display", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-body: "Radio Canada Big", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 4px; --r: 8px; --r-md: 12px; --r-lg: 16px;
  --t-state: 100ms ease-out;
  --t-enter: 220ms cubic-bezier(.2, 0, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --success: #5EEAD4; --success-container: #134E4A; --on-success-container: #CCFBF1;
    --warning: #FBBF24; --warning-container: #78350F; --on-warning-container: #FEF3C7;
    --info: #7DD3FC; --info-container: #0C4A6E; --on-info-container: #E0F2FE;
    --primary: #ABC7FF; --on-primary: #002F65; --primary-container: #134280; --on-primary-container: #D7E3FF;
    --secondary: #B9C7E5; --secondary-container: #3C4963; --on-secondary-container: #D7E3FF;
    --error: #FFB4AB; --on-error: #690005; --error-container: #93000A; --on-error-container: #FFDAD6;
    --surface: #121317;
    --surface-lowest: #0C0E12; --surface-low: #1A1C20; --surface-container: #1E2024;
    --surface-high: #282A2E; --surface-highest: #333539;
    --on-surface: #E2E2E8; --on-surface-variant: #C3C6D2;
    --outline: #8D909B; --outline-variant: #434750;
    --inverse-surface: #E2E2E8; --inverse-on-surface: #2F3035;
    --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface); color: var(--on-surface);
  font-family: var(--font-body); font-size: 14px; line-height: 21px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
pre, code, .mono { font-family: var(--font-mono); }

/* ---------- type scale ---------- */
.t-display { font: 700 40px/48px var(--font-headline); letter-spacing: -.5px; }
.t-headline-lg { font: 700 28px/36px var(--font-headline); letter-spacing: -.25px; }
.t-headline-md { font: 600 22px/28px var(--font-headline); letter-spacing: -.15px; }
.t-title-lg { font: 600 18px/26px var(--font-headline); }
.t-title-md { font: 600 16px/24px var(--font-headline); }
.t-body-lg { font: 400 16px/24px var(--font-body); }
.t-body-md { font: 400 14px/21px var(--font-body); }
.t-body-sm { font: 400 12px/18px var(--font-body); letter-spacing: .1px; }
.t-label-lg { font: 600 14px/20px var(--font-body); letter-spacing: .1px; }
.t-label-md { font: 600 12px/16px var(--font-body); letter-spacing: .2px; }
.t-label-sm { font: 500 12px/16px var(--font-body); letter-spacing: .2px; }
.t-mono-md { font: 500 13px/20px var(--font-mono); }
.t-mono-sm { font: 400 12px/16px var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--on-surface-variant); }
.c-primary { color: var(--primary); }
.c-success { color: var(--success); }
.c-warning { color: var(--warning); }
.c-error { color: var(--error); }
.c-info { color: var(--info); }
.c-accent { color: var(--accent); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }

/* ---------- layout helpers ---------- */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1279px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1023px) {
  .g-12 { grid-template-columns: minmax(0, 1fr); }
  .g-12 > * { grid-column: auto; }
  .g-3, .g-2.stack-md { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639px) { .g-4, .g-2 { grid-template-columns: minmax(0, 1fr); } .g-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- icons ---------- */
.ic { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; vertical-align: middle; }
.ic svg { width: 100%; height: 100%; display: block; }
.ic-16 { width: 16px; height: 16px; } .ic-20 { width: 20px; height: 20px; } .ic-22 { width: 22px; height: 22px; } .ic-28 { width: 28px; height: 28px; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  width: 240px; flex: 0 0 240px; min-height: 100vh; position: sticky; top: 0; height: 100vh;
  background: var(--surface-lowest); border-right: 1px solid var(--outline-variant);
  display: flex; flex-direction: column; justify-content: space-between; overflow-y: auto;
}
.sidebar .top { padding: 16px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 0; color: var(--on-surface); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--r); background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; }
.brand-name { font: 600 16px/1 var(--font-headline); display: block; }
.brand-sub { font: 400 12px/16px var(--font-mono); color: var(--on-surface-variant); display: block; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r);
  color: var(--on-surface-variant); font: 600 12px/16px var(--font-body); letter-spacing: .2px; white-space: nowrap;
  transition: background var(--t-state), color var(--t-state);
}
.nav a > span { display: flex; align-items: center; gap: 10px; }
.nav a:hover { background: var(--surface-low); color: var(--on-surface); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.nav .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 400 12px/20px var(--font-mono); text-align: center; }
.sidebar .foot { padding: 16px; border-top: 1px solid var(--outline-variant); display: flex; flex-direction: column; gap: 12px; }
.engine { padding: 12px; border-radius: var(--r); background: var(--surface-low); display: flex; flex-direction: column; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--outline); flex: 0 0 auto; }
.dot.ok { background: var(--success); } .dot.bad { background: var(--error); } .dot.warn { background: var(--warning); }
.userbox { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font: 500 12px/1 var(--font-body); flex: 0 0 auto; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 20; background: var(--surface-lowest); border-bottom: 1px solid var(--outline-variant);
  padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.header .titles { display: flex; align-items: center; gap: 12px; min-width: 0; }
.content { flex: 1; padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 1023px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; min-height: 0; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--outline-variant); }
  .sidebar .top { gap: 12px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { flex: 0 0 auto; }
  .sidebar .foot { display: none; }
  .mobile-user { display: flex !important; }
  .content { padding: 16px; }
  .header { padding: 12px 16px; }
}
.mobile-user { display: none; }

/* ---------- cards ---------- */
.card { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-md); padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card.tight { gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.kpi { justify-content: space-between; gap: 12px; height: 100%; }
.kpi .val { font: 700 28px/36px var(--font-headline); letter-spacing: -.25px; font-variant-numeric: tabular-nums; }
.tile { padding: 12px; border-radius: var(--r); background: var(--surface-low); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile.lg { padding: 14px; }
.tile.outline { background: transparent; border: 1px solid var(--outline-variant); }
.tile .big { font: 600 22px/28px var(--font-headline); font-variant-numeric: tabular-nums; }
.step-tile.active { outline: 2px solid var(--primary); outline-offset: -2px; }
/* 현재 상태 배너(조밀) */
.stage-banner { --tone: var(--info); --tone-bg: var(--info-container); gap: 12px; padding: 14px 18px; border: 2px solid var(--tone); }
.stage-banner.tone-success { --tone: var(--success); --tone-bg: var(--success-container); }
.stage-banner.tone-error { --tone: var(--error); --tone-bg: var(--error-container); }
.stage-banner.tone-warning { --tone: var(--warning); --tone-bg: var(--warning-container); }
.sb-head { display: flex; gap: 14px; align-items: center; }
.sb-num { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: var(--tone-bg); color: var(--tone); display: flex; align-items: center; justify-content: center; font: 700 22px/1 var(--font-headline); }
.sb-num small { font: 600 11px/1 var(--font-body); margin-left: 1px; opacity: .8; }
.sb-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sb-title { font: 700 18px/24px var(--font-headline); color: var(--tone); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-title .t-label-md { font-weight: 500; }
.sb-desc { font: 400 13px/19px var(--font-body); color: var(--on-surface-variant); }
.sb-desc b { color: var(--tone); }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 0 2px; }
.stepper li::before { content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: var(--outline-variant); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.st-done::before, .stepper li.st-cur::before, .stepper li.st-bad::before, .stepper li.st-warn::before { background: var(--success); }
.stepper .dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 700 11px/1 var(--font-body); background: var(--surface-high); color: var(--on-surface-variant); border: 2px solid var(--outline-variant); }
.stepper .lb { font: 500 11px/14px var(--font-body); color: var(--on-surface-variant); }
.stepper .st-done .dot { background: var(--success); border-color: var(--success); color: var(--surface-lowest); }
.stepper .st-cur .dot, .stepper .st-bad .dot, .stepper .st-warn .dot { color: var(--surface-lowest); box-shadow: 0 0 0 3px var(--tone-bg); }
.stepper .st-cur .dot { background: var(--info); border-color: var(--info); }
.stepper .st-bad .dot { background: var(--error); border-color: var(--error); }
.stepper .st-warn .dot { background: var(--warning); border-color: var(--warning); }
.stepper .st-cur .lb, .stepper .st-bad .lb, .stepper .st-warn .lb { color: var(--on-surface); font-weight: 700; }
.stepper .st-na { opacity: .4; }
@media (max-width: 760px) { .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; } .stepper li:nth-child(5)::before { display: none; } }
.step-tile.done { background: var(--success-container); }
.step-tile.done .t-mono-sm, .step-tile.done .t-label-sm { color: var(--on-success-container); }
.section { display: flex; flex-direction: column; gap: 12px; }
.divider { border-top: 1px solid var(--outline-variant); padding-top: 12px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-sm); font: 500 12px/16px var(--font-body); letter-spacing: .2px; white-space: nowrap; }
.badge.sm { padding: 2px 8px; }
.badge.mono { font-family: var(--font-mono); font-weight: 400; font-variant-numeric: tabular-nums; }
.b-success { background: var(--success-container); color: var(--on-success-container); }
.b-info { background: var(--info-container); color: var(--on-info-container); }
.b-warning { background: var(--warning-container); color: var(--on-warning-container); }
.b-error { background: var(--error-container); color: var(--on-error-container); }
.b-neutral { background: var(--surface-high); color: var(--on-surface-variant); }
.b-primary { background: var(--primary); color: var(--on-primary); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--r);
  font: 600 14px/20px var(--font-body); letter-spacing: .1px; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--t-state), opacity var(--t-state); text-decoration: none !important;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn.sm { padding: 6px 12px; font: 500 12px/16px var(--font-body); gap: 6px; }
.btn.md { padding: 8px 14px; font: 600 12px/16px var(--font-body); gap: 6px; }
.btn.block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-container); color: #fff; }
.btn-secondary { background: var(--surface-lowest); color: var(--on-surface); border-color: var(--outline-variant); }
.btn-secondary:hover { background: var(--surface-low); }
.btn-link { background: var(--surface-lowest); color: var(--primary); border-color: var(--outline-variant); }
.btn-link:hover { background: var(--surface-low); }
.btn-danger { background: var(--error); color: var(--on-error); }
.btn-danger:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--on-surface-variant); }
.btn-ghost:hover { background: var(--surface-low); color: var(--on-surface); }
.btn-text-danger { background: transparent; color: var(--error); padding-left: 0; padding-right: 0; }
.btn[disabled], .btn.disabled { background: var(--surface-high) !important; color: var(--on-surface-variant) !important; border-color: transparent !important; cursor: not-allowed; opacity: .8; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r); border: 0; background: transparent; color: var(--on-surface-variant); cursor: pointer; }
.icon-btn:hover { background: var(--surface-low); color: var(--on-surface); }
.icon-btn.bordered { border: 1px solid var(--outline-variant); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.field > .lbl { font: 600 12px/16px var(--font-body); letter-spacing: .2px; color: var(--on-surface); }
.field .hint { font: 400 12px/18px var(--font-body); color: var(--on-surface-variant); }
.field .hint.err { color: var(--error); }
.input, .select, .textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--r); background: var(--surface-lowest);
  border: 1px solid var(--outline-variant); color: var(--on-surface); font: 400 14px/21px var(--font-body); outline: none;
  transition: border-color var(--t-state), box-shadow var(--t-state);
}
.input.sm, .select.sm { padding: 6px 12px; font-size: 12px; line-height: 18px; }
.input.mono { font-family: var(--font-mono); font-size: 13px; }
.input::placeholder, .textarea::placeholder { color: var(--on-surface-variant); opacity: .85; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.input.invalid, .highlight .input { border-color: var(--warning); box-shadow: 0 0 0 2px var(--warning-container); }
.textarea { resize: vertical; min-height: 64px; }
.with-icon { position: relative; display: flex; align-items: center; }
.with-icon > .ic:first-child { position: absolute; left: 12px; color: var(--on-surface-variant); pointer-events: none; }
.with-icon > .input { padding-left: 40px; }
.with-icon > .trail { position: absolute; right: 8px; }
.with-icon.has-trail > .input { padding-right: 40px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font: 400 12px/18px var(--font-body); }
.check input { margin-top: 2px; accent-color: var(--primary); width: 16px; height: 16px; flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--outline-variant); border-radius: var(--r); cursor: pointer; font: 500 12px/16px var(--font-body); background: var(--surface-lowest); }
.chip input { accent-color: var(--primary); margin: 0; }
.chip:has(input:checked) { background: var(--secondary-container); border-color: var(--secondary-container); color: var(--on-secondary-container); }
.form-error { padding: 10px 12px; border-radius: var(--r); background: var(--error-container); color: var(--on-error-container); font: 400 12px/18px var(--font-body); }
.form-info { padding: 10px 12px; border-radius: var(--r); background: var(--info-container); color: var(--on-info-container); font: 400 12px/18px var(--font-body); }
.form-ok { padding: 10px 12px; border-radius: var(--r); background: var(--success-container); color: var(--on-success-container); font: 400 12px/18px var(--font-body); }

/* ---------- tables ---------- */
.table-wrap { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-md); overflow-x: auto; width: 100%; }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table.minw { min-width: 760px; }
.table thead { background: var(--surface-low); }
.table th { padding: 12px 16px; font: 600 12px/16px var(--font-body); letter-spacing: .2px; color: var(--on-surface-variant); border-bottom: 1px solid var(--outline-variant); white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--outline-variant); vertical-align: middle; }
.table tbody tr:first-child td { border-top: 0; }
.table.hover tbody tr:hover { background: var(--surface-low); }
.table tbody tr.row-link { cursor: pointer; }
/* 진행 막대 */
.meter { height: 8px; border-radius: 999px; background: var(--surface-high); overflow: hidden; }
.meter > div { height: 100%; background: var(--primary); transition: width var(--t-enter); }
.meter.warn > div { background: var(--warning); } .meter.bad > div { background: var(--error); }
/* 세그먼트 탭 */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-high); }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 6px; cursor: pointer; font: 600 13px/18px var(--font-body); color: var(--on-surface-variant); }
.seg button[aria-selected="true"] { background: var(--surface-lowest); color: var(--on-surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
/* 작은 막대 차트(일별) */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.bars > i { display: block; width: 6px; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--primary); }
.bars > i.bad { background: var(--error); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 500 13px/18px var(--font-body); }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--outline-variant); position: relative; cursor: pointer; transition: background var(--t-state); margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-state); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(14px); }
.cmp { display: grid; grid-template-columns: minmax(140px, 1fr) 1fr 1fr; gap: 0; border: 1px solid var(--outline-variant); border-radius: var(--r); overflow: hidden; }
.cmp > div { padding: 8px 12px; border-top: 1px solid var(--outline-variant); font: 400 13px/18px var(--font-body); }
.cmp > div.h { border-top: 0; background: var(--surface-low); font-weight: 600; }
.cmp > div.win { color: var(--success); font-weight: 600; }
.table tr.sub > td { background: var(--surface-low); padding: 12px 16px 16px; }
.table .sel-row { cursor: pointer; }
.table .sel-row.selected { background: var(--secondary-container); }
.empty { padding: 32px 16px; text-align: center; color: var(--on-surface-variant); font: 400 14px/21px var(--font-body); }
.empty .ic { width: 28px; height: 28px; display: block; margin: 0 auto 8px; opacity: .7; }

/* ---------- code ---------- */
.code { margin: 0; padding: 16px; border-radius: var(--r); background: var(--surface-low); border: 1px solid var(--outline-variant); font: 400 12px/1.65 var(--font-mono); color: var(--on-surface); overflow-x: auto; white-space: pre; max-height: 420px; }
.code.log { max-height: 220px; white-space: pre-wrap; word-break: break-all; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font: 400 12px/18px var(--font-body); }
.kv dt { color: var(--on-surface-variant); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 16px 24px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--outline-variant); }
.timeline li:last-child::after { display: none; }

/* ---------- modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; animation: fade var(--t-enter); }
.dialog { position: relative; width: 100%; max-width: 512px; max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-md); padding: 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 20px 25px -5px rgba(0,0,0,.15), 0 8px 10px -6px rgba(0,0,0,.1); animation: pop var(--t-enter); }
.dialog.wide { max-width: 640px; }
.dialog.xwide { max-width: 760px; }
/* 큰 작업 대화상자(CVE 등록 등): 화면 높이에 맞춰 고정, 머리말·하단 버튼은 고정하고 가운데 내용만 스크롤 */
.dialog.xl { max-width: min(1440px, calc(100vw - 48px)); height: calc(100vh - 48px); max-height: none; overflow: hidden; }
.dialog.xl > header, .dialog.xl > footer, .dialog.xl > [data-err] { flex: 0 0 auto; }
.dialog.xl > [data-body] { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
/* HTML 셀렉트박스 */
.vsel { position: relative; display: block; width: 100%; min-width: 0; }
.vsel-native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.vsel-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.vsel-btn:disabled { cursor: not-allowed; opacity: .6; }
.vsel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vsel-caret { display: inline-flex; color: var(--on-surface-variant); transition: transform var(--t-state); flex: 0 0 auto; }
.vsel.open .vsel-caret { transform: rotate(180deg); }
.vsel.open .vsel-btn { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.vsel-list { position: fixed; z-index: 1000; max-height: 280px; overflow-y: auto; max-width: min(520px, calc(100vw - 16px)); padding: 4px;
  background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r); box-shadow: 0 12px 24px -6px rgba(0,0,0,.25); animation: pop var(--t-enter); }
.vsel-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: 400 13px/18px var(--font-body); color: var(--on-surface); }
.vsel-opt.act { background: var(--surface-high); }
.vsel-opt.sel { color: var(--primary); font-weight: 600; }
.vsel-opt.dis { opacity: .45; cursor: not-allowed; }
.vsel-sp { display: inline-block; width: 14px; flex: 0 0 auto; }
.dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--outline-variant); padding-bottom: 16px; }
.dialog > header .lead { display: flex; align-items: flex-start; gap: 12px; }
.dialog > footer { padding-top: 16px; border-top: 1px solid var(--outline-variant); display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.dialog > footer .left { margin-right: auto; }
.dialog-icon { width: 40px; height: 40px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.box { padding: 16px; border-radius: var(--r); background: var(--surface-low); border: 1px solid var(--outline-variant); display: flex; flex-direction: column; gap: 12px; }
.box.warn { background: var(--warning-container); border-color: transparent; color: var(--on-warning-container); }
.box.err { background: var(--error-container); border-color: transparent; color: var(--on-error-container); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--inverse-surface); color: var(--inverse-on-surface); font: 400 14px/20px var(--font-body); box-shadow: 0 10px 20px rgba(0,0,0,.2); animation: pop var(--t-enter); }
.toast.error .ic { color: #FFB4AB; } .toast.success .ic { color: #5EEAD4; } .toast.info .ic { color: #7DD3FC; }

/* ---------- auth (split) layout ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 5fr 7fr; }
.auth-aside { background: #002C5F; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-aside .sub { color: #D7E3FF; }
.auth-aside .feat { display: flex; align-items: flex-start; gap: 12px; }
.auth-aside .feat .ic { color: var(--accent); margin-top: 2px; }
.auth-aside .sep { border-top: 1px solid rgba(215, 227, 255, .2); padding-top: 32px; }
.auth-aside .brand-mark { width: 40px; height: 40px; background: #134280; border: 1px solid rgba(215,227,255,.3); color: #fff; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--surface); }
.auth-box { width: 100%; max-width: 448px; display: flex; flex-direction: column; gap: 32px; }
.auth-box.wide { max-width: 520px; }
.auth-form { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-md); padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--on-surface-variant); font: 500 12px/16px var(--font-body); }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--outline-variant); }
@media (max-width: 1023px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { padding: 32px; }
  .auth-main { padding: 24px; }
  .auth-form { padding: 24px; }
}

/* ---------- misc ---------- */
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 48px; text-align: center; color: var(--on-surface-variant); }
.page-error { padding: 32px; text-align: center; color: var(--on-surface-variant); }
.role-card { gap: 8px; }
.role-card .cnt { font: 700 28px/36px var(--font-headline); }
.copy-field { display: flex; gap: 8px; align-items: stretch; }
.copy-field .input { font-family: var(--font-mono); font-size: 12px; }
ul.plain { margin: 0; padding-left: 18px; }
ul.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ul.checks li { display: flex; gap: 8px; align-items: flex-start; font: 400 12px/18px var(--font-body); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: var(--on-surface); text-align: left; display: block; max-width: 100%; }
.linkish:hover { color: var(--primary); text-decoration: underline; }
.mono-title { font: 600 18px/26px var(--font-mono); }

.btn-text-danger[data-del-case] { padding: 8px 12px; }
/* 목록 필터 */
.filters { padding: 14px 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-item > .lbl { font: 600 11px/14px var(--font-body); color: var(--on-surface-variant); letter-spacing: .2px; }
