/* AXIOM TT v0.2 — design tokens and components carried over from AXIOM TT v0.1 (AXIOM-TT.html), with dark tokens
   added and small type sizes raised for readability. No inline styles anywhere (CSP default-src 'self'). */

:root {
  color-scheme: light;
  --bg: #f6f7fa;
  --paper: #fff;
  --ink: #202432;
  --ink-2: #586073;
  --muted: #6f7687;
  --line: #e9ecf2;
  --line-2: #e1e4ed;
  --soft: #f3f4f8;
  --soft-2: #fafafd;
  --accent: #6862d8;
  --accent-ink: #fff;
  --accent-hover: #5750c4;
  --accent-soft: #eeedfc;
  --green: #2a7d65;
  --green-soft: #eaf6f0;
  --orange: #a0632a;
  --orange-soft: #fff3e6;
  --red: #b4515a;
  --red-soft: #fceef0;
  --blue: #3f6ca8;
  --blue-soft: #edf3fb;
  --gray: #6f7687;
  --gray-soft: #f1f2f6;
  --focus: #8f89e8;
  --shadow: 0 8px 24px rgba(30, 37, 65, .04);
  --shadow-lg: 0 25px 90px rgba(29, 33, 53, .18);
  --radius: 11px;
  --sidebar-w: 214px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14161d;
    --paper: #1c1f28;
    --ink: #e8eaf1;
    --ink-2: #c4c8d4;
    --muted: #9aa1b2;
    --line: #2b2f3b;
    --line-2: #343948;
    --soft: #242835;
    --soft-2: #20232d;
    --accent: #8f89ef;
    --accent-ink: #14161d;
    --accent-hover: #a39ef5;
    --accent-soft: #2a2849;
    --green: #6cc9a8;
    --green-soft: #1d3a31;
    --orange: #e3a86c;
    --orange-soft: #3d2c1b;
    --red: #ec8c94;
    --red-soft: #432329;
    --blue: #8db3e8;
    --blue-soft: #1f2d42;
    --gray: #a3a9b8;
    --gray-soft: #2a2e3a;
    --focus: #b2adf7;
    --shadow: 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 25px 90px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14161d;
  --paper: #1c1f28;
  --ink: #e8eaf1;
  --ink-2: #c4c8d4;
  --muted: #9aa1b2;
  --line: #2b2f3b;
  --line-2: #343948;
  --soft: #242835;
  --soft-2: #20232d;
  --accent: #8f89ef;
  --accent-ink: #14161d;
  --accent-hover: #a39ef5;
  --accent-soft: #2a2849;
  --green: #6cc9a8;
  --green-soft: #1d3a31;
  --orange: #e3a86c;
  --orange-soft: #3d2c1b;
  --red: #ec8c94;
  --red-soft: #432329;
  --blue: #8db3e8;
  --blue-soft: #1f2d42;
  --gray: #a3a9b8;
  --gray-soft: #2a2e3a;
  --focus: #b2adf7;
  --shadow: 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 25px 90px rgba(0, 0, 0, .55);
}

/* ---- base ---------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; overflow-x: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.55; letter-spacing: -.2px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, .btn[aria-busy="true"] { cursor: not-allowed; opacity: .5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
p + p { margin-top: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: -.3px; overflow-wrap: anywhere; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.warn-text { color: var(--red); font-weight: 600; }
.pre-line { white-space: pre-line; }
.sr-only, .offscreen { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--paper); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
details > summary { cursor: pointer; color: var(--ink-2); }
.stack-xs { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start; }

/* ---- buttons, tags --------------------------------------------------------------------------------------- */
.btn {
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 14px;
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none; min-height: 38px;
}
.btn:hover:not(:disabled) { background: var(--soft); border-color: var(--line-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 7px rgba(104, 98, 216, .12); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--red); background: var(--red-soft); border-color: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; min-height: 32px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper); color: var(--muted);
}
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 8px; white-space: nowrap;
  font-size: 12px; line-height: 1.4; font-weight: 600; background: var(--gray-soft); color: var(--gray);
}
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.orange { background: var(--orange-soft); color: var(--orange); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.purple { background: var(--accent-soft); color: var(--accent); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.dot { width: 6px; height: 6px; border-radius: 100%; background: currentColor; display: inline-block; flex: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }

/* ---- shell ---------------------------------------------------------------------------------------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 24px 14px 16px; z-index: 40; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 22px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; background: var(--ink); color: var(--paper); border-radius: 8px; display: grid; place-items: center; font-size: 18px; font-weight: 700; flex: none; }
.brand-name { font-size: 18px; letter-spacing: 2.4px; font-weight: 700; line-height: 1.2; }
.brand-name b { color: var(--accent); letter-spacing: 0; font-size: 14px; margin-left: 4px; }
.brand-caption { font-size: 10px; letter-spacing: 1.6px; color: var(--muted); margin-top: 4px; }
.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-label { padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 1.4px; color: var(--muted); }
.nav-btn {
  display: flex; align-items: center; width: 100%; gap: 11px; padding: 10px 12px; border-radius: 8px; color: var(--ink-2);
  font-size: 13px; text-decoration: none;
}
.nav-btn .icon { width: 17px; height: 17px; }
.nav-btn:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.nav-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-badge { margin-left: auto; border-radius: 6px; min-width: 20px; padding: 0 5px; line-height: 20px; text-align: center; font-size: 11px; font-weight: 700; background: var(--orange-soft); color: var(--orange); }
.sidebar-bottom { margin-top: auto; padding-top: 16px; }
.user-card { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 14px 6px 0; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; flex: none; }
.user-meta { min-width: 0; display: flex; flex-direction: column; }
.user-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-actions { margin-left: auto; display: flex; gap: 4px; }
.user-actions .icon-btn { width: 32px; height: 32px; }
.main-shell { margin-left: var(--sidebar-w); min-height: 100vh; min-width: 0; }
.topbar {
  height: 64px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; align-items: center;
  justify-content: space-between; padding: 0 32px; gap: 14px; position: sticky; top: 0; z-index: 30;
}
.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumb strong { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumb .sep { color: var(--line-2); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mobile-menu { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(20, 20, 35, .35); z-index: 35; }
.content { max-width: 1440px; margin: 0 auto; padding: 26px 32px 48px; outline: none; }

/* ---- page parts ---------------------------------------------------------------------------------------- */
.page-title { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.page-title > div:first-child { min-width: 0; flex: 1 1 320px; }
.eyebrow { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; overflow-wrap: anywhere; }
.page-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -.8px; line-height: 1.35; overflow-wrap: anywhere; }
.page-title p { font-size: 13px; color: var(--muted); margin-top: 5px; max-width: 760px; }
.page-title-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel.pad { padding: 18px 20px; }
.panel.pad > h2, .panel-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.panel-head { padding: 16px 20px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin-bottom: 0; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.count { font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.section-gap { margin-top: 18px; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 10px; }
.empty h3 { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.empty p { font-size: 13px; max-width: 460px; margin: 0 auto; }
.empty-row { padding: 18px 20px; font-size: 13px; }
.loading-screen { min-height: 40vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 13px; }
.spinner { width: 26px; height: 26px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; background: var(--soft-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.7; margin: 10px 0;
}
.notice .icon { margin-top: 2px; }
.notice.warning { background: var(--orange-soft); border-color: transparent; color: var(--orange); }
.notice.ok { background: var(--green-soft); border-color: transparent; color: var(--green); }
.notice.danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.notice.small { font-size: 12px; padding: 8px 12px; }
.notice p { color: inherit; }
.code-output { white-space: pre-wrap; word-break: break-word; padding: 12px; background: var(--soft-2); border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; max-height: 320px; overflow: auto; margin: 6px 0 0; }

/* ---- home ---------------------------------------------------------------------------------------------- */
.todo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.todo-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; border-top: 3px solid var(--line); }
.todo-card.orange { border-top-color: var(--orange); }
.todo-card.purple { border-top-color: var(--accent); }
.todo-card.zero .todo-count { color: var(--muted); }
.todo-top { display: flex; align-items: center; gap: 10px; }
.todo-top h2 { font-size: 14px; font-weight: 700; flex: 1; min-width: 0; }
.metric-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--soft); color: var(--accent); flex: none; }
.metric-icon .icon { width: 16px; height: 16px; }
.todo-count { font-size: 28px; font-weight: 700; letter-spacing: -1px; color: var(--ink); text-decoration: none; line-height: 1; }
.todo-count small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.todo-hint { font-size: 12px; color: var(--muted); margin: 6px 0 8px; }
.todo-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.todo-items li a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.todo-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.todo-items li a .muted { flex: none; font-size: 12px; }
.more-link { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; }
.attn-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 0 20px 18px; }
.attn-cell { border: 1px solid var(--line); border-radius: 9px; padding: 12px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; background: var(--soft-2); }
.attn-cell:hover { text-decoration: none; border-color: var(--accent); }
.attn-cell.red { background: var(--red-soft); border-color: transparent; color: var(--red); }
.attn-cell.orange { background: var(--orange-soft); border-color: transparent; color: var(--orange); }
.attn-cell.blue { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.attn-cell.zero { color: var(--muted); }
.attn-count { font-size: 24px; font-weight: 700; line-height: 1.1; }
.attn-label { font-size: 12px; font-weight: 600; }

/* ---- request list ------------------------------------------------------------------------------------- */
.req-list { list-style: none; margin: 0; padding: 0; }
.req-row { border-top: 1px solid var(--line); }
.req-link { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, .9fr); gap: 14px; align-items: center; padding: 12px 20px; color: var(--ink); text-decoration: none; }
.req-link:hover { background: var(--soft-2); text-decoration: none; }
.req-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-title strong { font-size: 14px; overflow-wrap: anywhere; }
.req-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-top: 3px; color: var(--ink-2); }
.req-change { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.change .val.unknown { color: var(--muted); font-style: italic; }
.change .arrow { color: var(--muted); }
.req-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; text-align: right; }
.list-count { padding: 0 20px 8px; font-size: 12px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filter-bar .field { min-width: 150px; }
.filter-bar .field.grow { flex: 1 1 200px; }
.filter-bar .field.end { min-width: 0; }
.check-group { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }

/* ---- forms --------------------------------------------------------------------------------------------- */
.form-panel .form-body { padding: 0 20px 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline label { white-space: nowrap; }
.field label, fieldset legend { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red); }
.field input, .field select, .field textarea, .filter-bar input, .filter-bar select {
  width: 100%; border: 1px solid var(--line-2); border-radius: 7px; padding: 9px 11px; font-size: 14px; color: var(--ink);
  background: var(--paper); min-width: 0; min-height: 40px;
}
.field input[type="checkbox"], .field input[type="radio"] { width: auto; min-height: 0; }
.field input:disabled, .field select:disabled { background: var(--soft); color: var(--muted); }
.field textarea { min-height: 70px; resize: vertical; }
.field small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.checkbox-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 4px 0; cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; min-width: 0; }
.checkbox-list { display: flex; flex-direction: column; max-height: 220px; overflow: auto; }
.radio-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.form-section { margin: 16px 0 10px; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.panel.pad .form-foot, .stage .form-foot { padding: 14px 0 0; margin-top: 8px; }
.form-error { font-size: 13px; color: var(--red); background: var(--red-soft); padding: 10px 12px; border-radius: 7px; margin: 8px 0; }
.info-box { font-size: 13px; background: var(--soft-2); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; }
.info-box p { margin-top: 4px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin: 0; }
.mini-grid dt, .run-grid dt, .detail-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.mini-grid dd, .run-grid dd { margin: 2px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.value-holder { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.preview-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.preview-section h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.preview-box { min-height: 44px; }
.decision { border-radius: 9px; padding: 12px 14px; border: 1px solid var(--line); background: var(--soft-2); }
.decision.green { border-color: var(--green); background: var(--green-soft); }
.decision.orange { border-color: var(--orange); background: var(--orange-soft); }
.decision.red { border-color: var(--red); background: var(--red-soft); }
.decision-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.decision .tag { font-size: 13px; }
.reasons { margin: 6px 0; padding-left: 20px; font-size: 13px; }
.reasons li + li { margin-top: 2px; }

/* ---- dialogs, toasts ------------------------------------------------------------------------------------ */
dialog.modal {
  border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: 90vh;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); overflow: auto;
}
dialog.modal.wide { width: min(900px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(35, 35, 56, .35); }
.modal-head { position: sticky; top: 0; z-index: 2; background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 14px; flex-wrap: wrap; }
.modal-form .modal-foot { padding: 14px 20px; margin: 0; }
.dialog-message { font-size: 14px; margin-bottom: 12px; color: var(--ink-2); }
.token-row { display: flex; gap: 8px; margin: 12px 0; }
.token-box { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 7px; padding: 9px 11px; background: var(--soft-2); font-size: 13px; }
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: min(620px, calc(100vw - 24px)); pointer-events: none; }
.toast { border: 1px solid var(--line); background: var(--paper); box-shadow: 0 8px 30px rgba(37, 32, 59, .15); border-radius: 9px; padding: 12px 16px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; animation: rise .2s ease; }
.toast .icon { color: var(--accent); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.error .icon { color: var(--red); }
.toast.ok .icon { color: var(--green); }

/* ---- tables -------------------------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--soft-2); padding: 9px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 180px; max-width: 360px; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--soft-2); }
.row-actions { display: inline-flex; gap: 4px; }

/* ---- request detail ------------------------------------------------------------------------------------- */
.status-explain { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--line); background: var(--paper); margin-bottom: 16px; border-left: 5px solid var(--gray); }
.status-explain.green { border-left-color: var(--green); }
.status-explain.orange { border-left-color: var(--orange); }
.status-explain.red { border-left-color: var(--red); background: var(--red-soft); }
.status-explain.blue { border-left-color: var(--blue); }
.status-explain.purple { border-left-color: var(--accent); }
.status-explain h2 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.status-explain p { font-size: 14px; color: var(--ink-2); }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.value-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.value-box { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--soft-2); min-width: 0; }
.value-box.desired { border-color: var(--accent); background: var(--accent-soft); }
.value-box.ok { border-color: var(--green); background: var(--green-soft); }
.value-box.unknown .value-big { color: var(--muted); font-style: italic; }
.value-big { font-size: 17px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.run-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.run-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--soft-2); min-width: 0; }
.run-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.run-head .mono { margin-left: auto; }
.run-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 14px; margin: 0; }
.run-evidence { margin-top: 10px; }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.evidence-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.evidence-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.evidence-list a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.evidence-text { overflow-wrap: anywhere; min-width: 0; }
.evidence-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.log-list li:first-child { border-top: 0; }
.log-main { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }

/* ---- metrics ------------------------------------------------------------------------------------------- */
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.metric { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.metric.accent { border-top: 3px solid var(--accent); }
.metric.danger { border-top: 3px solid var(--red); }
.metric-top { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.metric-value { font-size: 26px; letter-spacing: -1px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.metric-value.unknown { color: var(--muted); font-size: 20px; }
.metric-foot { font-size: 12px; color: var(--muted); margin-top: 8px; }
.readiness-items { display: flex; flex-direction: column; gap: 9px; }
.readiness-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.readiness-row .label { width: 120px; color: var(--ink-2); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 8px; flex: 1; border-radius: 5px; background: var(--soft); overflow: hidden; min-width: 40px; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 5px; }
.readiness-row .value { width: 40px; text-align: right; color: var(--ink-2); flex: none; }
.import-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.import-summary div { background: var(--soft-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: center; font-size: 12px; color: var(--muted); }
.import-summary strong { display: block; font-size: 22px; font-weight: 700; color: var(--ink); }

/* ---- manual wizard ------------------------------------------------------------------------------------- */
.stepper { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 7px; padding: 7px 12px 7px 8px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.stepper li.current { border-color: var(--accent); color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.stepper li.done { color: var(--green); }
.step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 12px; font-weight: 700; }
.stepper li.current .step-num { background: var(--accent); color: var(--accent-ink); }
.stepper li.done .step-num { background: var(--green-soft); color: var(--green); }
.timer-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 13px; padding: 10px 14px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line); margin-bottom: 12px; }
.wizard-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stage h2 { font-size: 16px; }
.stage > p { margin-bottom: 8px; }
.howto { margin: 4px 0 14px; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.howto li + li { margin-top: 3px; }
.manual-steps { margin-top: 12px; font-size: 13px; background: var(--soft-2); border-radius: 8px; padding: 10px 12px; }
.manual-steps p { margin-top: 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 4px; }
.choice { display: flex; flex-direction: column; gap: 6px; }
.choice .btn { width: 100%; min-height: 48px; font-size: 14px; }
.evidence-fieldset .field { margin-bottom: 10px; }
.uploaded { font-size: 13px; }
.job-card { position: sticky; top: 80px; }
.job-card .strong { font-size: 15px; }

/* ---- login --------------------------------------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { padding: 0 0 6px; }
.login-card h1 { font-size: 20px; }
.login-card p { font-size: 13px; }
.login-card .btn { width: 100%; min-height: 44px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ---- responsive ---------------------------------------------------------------------------------------- */
@media (max-width: 1270px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .attn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .detail-cols, .wizard-cols { grid-template-columns: minmax(0, 1fr); }
  .job-card { position: static; }
  .todo-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; width: min(280px, 86vw); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-shell { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 16px; height: 56px; }
  .content { padding: 18px 16px 40px; }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field.full { grid-column: auto; }
  .req-link { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 16px; }
  .req-meta { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 16px; }
  .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .page-title h1 { font-size: 21px; }
  .panel.pad { padding: 16px; }
  .panel-head, .filter-bar { padding-left: 16px; padding-right: 16px; }
  .filter-bar .field { min-width: 0; flex: 1 1 140px; }
  .form-panel .form-body { padding: 0 16px 8px; }
  .form-foot { padding: 14px 16px; }
  .form-foot .btn { flex: 1 1 auto; }
  th:first-child, td:first-child { padding-left: 16px; }
  .import-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .run-head .mono { margin-left: 0; width: 100%; }
  .top-actions .btn { padding: 6px 10px; }
  .modal-body { padding: 16px; }
  .token-row { flex-direction: column; }
}
@media (max-width: 420px) {
  .metrics-grid { grid-template-columns: minmax(0, 1fr); }
  .readiness-row .label { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
