:root {
  --navy-950: #17324d;
  --navy-900: #24445f;
  --teal-700: #1f665f;
  --teal-600: #287c73;
  --teal-100: #ccefed;
  --teal-50: #e9f8f6;
  --ink-950: #1e2933;
  --ink-700: #344154;
  --ink-600: #5a6777;
  --ink-500: #778292;
  --line-300: #c3cdd6;
  --line-200: #d7dee5;
  --line-100: #edf1f5;
  --canvas: #fff;
  --surface-muted: #f7f9fb;
  --warning-700: #c96b05;
  --warning-600: #e98511;
  --warning-50: #fff8e8;
  --danger-600: #c53b2c;
  --danger-50: #fff0f0;
  --info-600: #1769c2;
  --shadow-float: 0 10px 30px rgb(16 36 62 / 10%);
  --sidebar-width: 188px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink-950);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink-950); font-size: 14px; line-height: 1.55; }
button, input, select { font: inherit; }
a { color: var(--info-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a, select, input { outline: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { box-shadow: 0 0 0 3px rgb(11 143 141 / 24%); }
button:disabled, select:disabled, input:disabled { cursor: not-allowed; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 9px 13px; color: #fff; background: var(--navy-950); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.test-environment-ribbon { position: fixed; top: 14px; right: -42px; z-index: 1000; width: 170px; padding: 7px 0; color: #fff; background: #c53b2c; box-shadow: 0 2px 8px rgb(0 0 0 / 22%); font-size: 13px; font-weight: 800; letter-spacing: .18em; text-align: center; transform: rotate(38deg); pointer-events: none; }
.test-environment-notice { margin: -10px 0 20px; padding: 10px 14px; color: #8b2c22; border: 1px solid #eab1aa; background: #fff0f0; font-weight: 750; text-align: center; }
.is-test-environment .workspace { background-image: repeating-linear-gradient(-28deg, transparent 0, transparent 110px, rgb(197 59 44 / 2.5%) 112px, transparent 190px); }
.test-login-warning { padding: 10px 12px; border: 1px solid rgb(255 255 255 / 50%); font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-variant-numeric: tabular-nums; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger-600) !important; }
.button-danger { color: #fff; border-color: var(--danger-600); background: var(--danger-600); }
.status-partial, .status-review { color: var(--warning-700); background: var(--warning-50); }
.status-blocking { color: var(--danger-600); background: var(--danger-50); }
.status-info { color: var(--info-600); background: #eef6ff; }
.permission-note { align-self: center; color: var(--ink-600); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.app-shell.nav-collapsed { --sidebar-width: 72px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar-width); display: flex; flex-direction: column; color: #eaf4ff; background: var(--navy-950); border-right: 1px solid #153858; transition: transform 180ms ease; }
.brand { min-height: 76px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid rgb(255 255 255 / 12%); color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; background: rgb(255 255 255 / 3%); }
.brand-mark { width: 30px; height: 30px; display: none; place-items: center; border: 1px solid rgb(255 255 255 / 55%); border-radius: 4px; }
.sidebar-nav { padding-top: 10px; display: grid; gap: 1px; overflow-y: auto; }
.nav-item { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 18px 0 22px; color: #d8e5f2; border-left: 3px solid transparent; font-size: 14px; font-weight: 560; }
.nav-item:hover { text-decoration: none; color: #fff; background: rgb(255 255 255 / 5%); }
.nav-item.is-active { color: #fff; background: #214d61; border-left-color: #6bb8b0; }
.nav-item svg { flex: 0 0 auto; }
.nav-item.is-disabled { opacity: .8; cursor: default; }
.nav-item.is-disabled:hover { background: transparent; color: #d8e5f2; }
.sidebar-collapse { margin-top: auto; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border: 0; border-top: 1px solid rgb(255 255 255 / 10%); color: #dceaf7; background: transparent; }
.sidebar-collapse:hover { background: rgb(255 255 255 / 5%); }
.nav-collapsed .brand { justify-content: center; padding-inline: 10px; }
.nav-collapsed .brand-mark { display: grid; }
.nav-collapsed .brand > span:last-child, .nav-collapsed .nav-item > span, .nav-collapsed .sidebar-collapse > span:last-child { display: none; }
.nav-collapsed .nav-item { justify-content: center; padding-inline: 0; }
.nav-collapsed .sidebar-collapse { justify-content: center; padding-inline: 0; }
.nav-collapsed .sidebar-collapse > span:first-child { transform: rotate(180deg); }
.app-main { grid-column: 2; min-width: 0; min-height: 100vh; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 26px; background: rgb(255 255 255 / 96%); border-bottom: 1px solid var(--line-200); backdrop-filter: blur(8px); }
.context-controls { display: flex; align-items: center; gap: 24px; }
.context-field { display: flex; align-items: center; gap: 10px; color: var(--ink-700); font-weight: 600; white-space: nowrap; }
.context-field select, .period-field strong { height: 42px; min-width: 220px; padding: 0 40px 0 14px; color: var(--ink-950); background: #fff; border: 1px solid var(--line-300); border-radius: 4px; font-weight: 520; }
.period-field strong { min-width: 140px; display: flex; align-items: center; padding-right: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; border-radius: 4px; color: var(--ink-950); background: transparent; font-weight: 700; }
.icon-button:hover { background: var(--surface-muted); text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 8px; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line-200); color: var(--ink-700); font-weight: 560; }
.user-menu svg { width: 25px; height: 25px; }
.text-button { padding: 8px; border: 0; color: var(--ink-600); background: transparent; }
.text-button:hover { color: var(--teal-700); }
.mobile-menu { display: none; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line-200); background: #fff; border-radius: 4px; }

.workspace { min-height: calc(100vh - 76px); padding: 26px; background: var(--canvas); }
.page-grid { display: grid; gap: 26px; min-width: 0; }
.page-grid-with-rail { grid-template-columns: minmax(0, 1fr) 282px; }
.page-primary { min-width: 0; }
.page-header { min-height: 62px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.page-header h1 { margin: 0; color: var(--ink-950); font-size: 28px; line-height: 1.25; letter-spacing: -.025em; }
.page-header p { margin: 6px 0 0; color: var(--ink-600); }
.breadcrumb { margin: 0 0 8px !important; color: var(--ink-500) !important; font-size: 13px; }
.breadcrumb a { color: var(--ink-600); }
.title-line { display: flex; align-items: center; gap: 14px; }
.header-actions { display: flex; gap: 10px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; border: 1px solid transparent; border-radius: 4px; font-size: 14px; font-weight: 650; text-decoration: none; white-space: nowrap; transition: background 120ms ease, border-color 120ms ease, color 120ms ease; }
.button:hover { text-decoration: none; }
.button-primary { color: #fff; background: var(--teal-600); border-color: var(--teal-600); }
.button-primary:hover:not(:disabled) { background: var(--teal-700); border-color: var(--teal-700); }
.button-primary:disabled { color: #9da7b4; background: #eef1f4; border-color: #d8dee6; }
.button-secondary { color: var(--teal-700); background: #fff; border-color: #6abbb7; }
.button-secondary:hover:not(:disabled) { background: var(--teal-50); }
.button-secondary:disabled { color: #9aa4b1; border-color: var(--line-200); background: #f8f9fb; }
.button-full { width: 100%; }

.metric-row { display: grid; grid-template-columns: repeat(4, minmax(155px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { min-height: 112px; display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line-200); border-radius: 5px; background: #fff; }
.metric > svg, .metric-symbol { width: 38px; height: 38px; flex: 0 0 auto; color: var(--teal-600); }
.metric-symbol { display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-size: 20px; font-weight: 700; }
.metric-warning > svg { color: var(--warning-600); }
.metric div { display: grid; min-width: 0; }
.metric span { color: var(--ink-700); font-weight: 560; }
.metric strong { margin-top: 2px; color: var(--teal-700); font-size: 27px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric-warning strong { color: var(--warning-700); }
.metric small { margin-top: 3px; color: var(--ink-500); }

.panel { border: 1px solid var(--line-200); border-radius: 5px; background: #fff; overflow: hidden; }
.panel-heading { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; border-bottom: 1px solid var(--line-200); }
.panel-heading h2, .rail-heading h2, .timeline-rail h2, .section-heading h2 { margin: 0; color: var(--ink-950); font-size: 17px; line-height: 1.4; }
.panel-heading p { margin: 2px 0 0; color: var(--ink-500); font-size: 12px; }
.panel-heading a { font-weight: 560; }
.panel-count { color: var(--ink-600); font-variant-numeric: tabular-nums; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
th, td { height: 48px; padding: 9px 12px; border-right: 1px solid var(--line-200); border-bottom: 1px solid var(--line-200); text-align: left; vertical-align: middle; white-space: nowrap; }
.batch-panel table th, .batch-panel table td { height: 56px; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--ink-700); background: var(--surface-muted); font-weight: 650; }
tbody tr:hover td { background: #fbfdfd; }
.filename { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.status { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-700); font-weight: 600; }
.status svg { width: 16px; height: 16px; }
.status-succeeded { color: var(--teal-600); }
.status-processing { color: var(--info-600); }
.status-failed { color: var(--danger-600); }
.status-pending { color: var(--warning-700); }
.status-cancelled { color: var(--ink-500); }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-600); text-align: center; white-space: normal; }
.empty-state svg { width: 32px; height: 32px; margin-bottom: 10px; color: var(--teal-600); }
.empty-state strong { color: var(--ink-700); font-size: 15px; }
.empty-state span { margin-top: 3px; color: var(--ink-500); }
.table-footer { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px; border-top: 1px solid var(--line-200); color: var(--ink-600); }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination button, .pagination a, .pagination span, .pagination b { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 9px; border: 1px solid var(--line-200); border-radius: 4px; color: var(--ink-500); background: #fff; font-size: 12px; font-weight: 500; }
.pagination a:hover { color: var(--teal-700); border-color: var(--teal-600); text-decoration: none; }
.pagination span { color: #a5adb7; background: var(--surface-muted); }
.pagination b { color: #fff; border-color: var(--teal-600); background: var(--teal-600); }

.right-rail { min-width: 0; padding-left: 18px; border-left: 1px solid var(--line-200); }
.rail-heading { height: 46px; display: flex; align-items: flex-start; justify-content: space-between; }
.rail-heading span { color: var(--ink-500); }
.risk-item { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line-200); border-radius: 5px; background: #fff; }
.risk-title { display: flex; align-items: center; gap: 8px; }
.risk-title svg { width: 18px; height: 18px; color: var(--teal-600); }
.risk-title strong { font-size: 14px; }
.risk-title b { margin-left: auto; color: var(--danger-600); font-size: 17px; font-variant-numeric: tabular-nums; }
.risk-warning .risk-title svg { color: var(--warning-600); }
.risk-item p { margin: 10px 0 12px; color: var(--ink-600); font-size: 13px; }
.risk-item a { font-weight: 620; }
.risk-item a span { float: right; color: var(--ink-500); }
.rail-empty { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; color: var(--ink-600); border: 1px solid var(--line-200); text-align: center; }
.rail-empty svg { width: 34px; height: 34px; margin-bottom: 10px; color: var(--teal-600); }
.rail-empty p { margin: 5px 0 0; font-size: 13px; }

.reconcile-section { margin-top: 26px; }
.section-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.section-heading span { color: var(--ink-500); font-size: 12px; }
.reconcile-flow { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); border: 1px solid var(--line-200); background: #fff; }
.flow-step { position: relative; min-height: 98px; display: flex; align-items: center; gap: 10px; padding: 16px 12px; border-right: 1px solid var(--line-200); }
.flow-step:last-child { border-right: 0; }
.flow-step:not(:last-child)::after { content: "›"; position: absolute; right: -7px; z-index: 1; color: var(--ink-600); background: #fff; font-size: 20px; }
.flow-step svg, .flow-step .metric-symbol { width: 31px; height: 31px; color: var(--teal-600); }
.flow-step div { min-width: 0; display: grid; }
.flow-step strong { color: var(--ink-700); }
.flow-step span { color: var(--ink-500); font-size: 12px; }
.flow-step.is-ready { background: var(--teal-50); }

.summary-strip { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr; margin-bottom: 22px; border: 1px solid var(--line-200); }
.summary-strip > div { min-height: 78px; display: grid; align-content: center; padding: 14px 18px; border-right: 1px solid var(--line-200); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span, .metadata-row span { color: var(--ink-500); font-size: 12px; }
.summary-strip strong, .metadata-row strong { margin-top: 4px; color: var(--ink-700); font-weight: 620; }
.coverage-panel { margin-bottom: 22px; }
.coverage-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.coverage-grid > div { min-height: 78px; display: grid; align-content: center; padding: 14px 16px; border-right: 1px solid var(--line-200); border-bottom: 1px solid var(--line-200); }
.coverage-grid > div:nth-child(4n) { border-right: 0; }
.coverage-grid > div:nth-last-child(-n + 4) { border-bottom: 0; }
.coverage-grid span { color: var(--ink-500); font-size: 12px; }
.coverage-grid strong { margin-top: 4px; color: var(--ink-700); font-size: 17px; font-variant-numeric: tabular-nums; }
.issue-scope-note { margin: 16px 16px 0; padding: 10px 12px; border-left: 3px solid var(--teal-500); color: var(--ink-600); background: var(--teal-50); font-size: 13px; }
.issue-groups { display: grid; gap: 16px; padding: 16px; }
.issue-group { overflow: hidden; border: 1px solid var(--line-200); border-radius: 4px; }
.issue-group h2 { margin: 0; padding: 10px 12px; color: var(--ink-700); background: var(--surface-muted); font-size: 14px; }
.issue-group h2 span { margin-left: 6px; font-variant-numeric: tabular-nums; }
.issue-group-blocking { border-color: #f1b9bb; }
.issue-group-blocking h2 { color: var(--danger-600); background: var(--danger-50); }
.issue-group-review { border-color: #f4d7a5; }
.issue-group-review h2 { color: var(--warning-700); background: var(--warning-50); }
.issue-group-info h2 { color: var(--info-600); background: #eef6ff; }
.inline-filters { display: flex; gap: 12px; }
.status-open { color: var(--danger-600); }
.status-resolved { color: var(--teal-600); }
.filter-bar { display: flex; align-items: end; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-200); background: #fff; }
.filter-bar label { display: grid; gap: 5px; color: var(--ink-600); font-size: 12px; }
.filter-bar select, .filter-bar input { height: 38px; min-width: 150px; padding: 0 12px; color: var(--ink-700); border: 1px solid var(--line-300); border-radius: 4px; background: #fff; }
.filter-grow { flex: 1; }
.filter-grow input { width: 100%; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; margin: -26px; }
.detail-main { min-width: 0; padding: 26px; }
.detail-header { align-items: center; }
.metadata-panel { margin-bottom: 18px; border: 1px solid var(--line-200); }
.metadata-row { display: grid; grid-template-columns: 1fr 1.9fr 1.6fr 1fr 1.3fr; }
.metadata-row > div { min-width: 0; min-height: 82px; display: grid; align-content: center; padding: 14px 18px; border-right: 1px solid var(--line-200); }
.metadata-row > div:last-child { border-right: 0; }
.metadata-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metadata-counts { grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-200); }
.metadata-counts strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.detail-tabs { height: 52px; display: flex; align-items: end; gap: 34px; border-bottom: 1px solid var(--line-200); }
.detail-tabs > span { height: 52px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; color: var(--ink-600); font-weight: 600; }
.detail-tabs > span.is-selected { color: var(--teal-700); border-bottom: 2px solid var(--teal-600); }
.detail-tabs b { font-weight: 700; }
.detail-table-panel { border-top: 0; border-radius: 0 0 5px 5px; }
.batch-error { display: flex; gap: 10px; margin: 14px; padding: 12px 14px; border: 1px solid #f1b9bb; color: var(--danger-600); background: var(--danger-50); }
.batch-error svg { flex: 0 0 auto; }
.batch-error p { margin: 2px 0 0; color: var(--ink-700); }
.detail-actions { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-200); }
.timeline-rail { min-width: 0; padding: 110px 24px 28px; border-left: 1px solid var(--line-200); background: #fff; }
.timeline-rail h2 { margin-bottom: 26px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; min-height: 126px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 28px; bottom: 0; width: 1px; background: var(--line-300); }
.timeline-dot { width: 29px; height: 29px; z-index: 1; display: grid; place-items: center; border: 1px solid var(--line-300); border-radius: 50%; color: var(--ink-500); background: #fff; }
.timeline-dot svg { width: 17px; height: 17px; }
.timeline .is-complete .timeline-dot { color: var(--teal-600); border-color: var(--teal-600); }
.timeline .is-error .timeline-dot { color: var(--danger-600); border-color: var(--danger-600); }
.timeline li strong { display: block; color: var(--ink-700); }
.timeline li time { display: block; margin-top: 6px; color: var(--ink-500); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline li p { margin: 7px 0 0; color: var(--ink-600); font-size: 12px; }

.messages { margin-bottom: 18px; padding: 10px 14px; color: var(--teal-700); border: 1px solid var(--teal-100); background: var(--teal-50); }
.messages p { margin: 0; }
.upload-panel { max-width: 820px; }
.upload-form { padding: 26px; }
.upload-dropzone { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 28px; text-align: center; border: 1px dashed var(--teal-600); background: var(--teal-50); cursor: pointer; }
.upload-dropzone svg { width: 36px; height: 36px; color: var(--teal-700); }
.upload-dropzone span, .form-help { color: var(--ink-600); }
.upload-dropzone input { margin-top: 10px; }
.security-note { display: grid; gap: 4px; margin-top: 18px; padding: 13px 15px; border-left: 3px solid var(--teal-600); background: var(--surface-muted); }
.security-note span { color: var(--ink-600); }
.import-preview { margin-top: 18px; }
.preview-grid { display: grid; gap: 12px; padding: 14px; }
.preview-grid dl { margin: 0; padding: 12px; border: 1px solid var(--line-200); background: var(--surface-muted); }
.preview-grid dl > div { display: grid; grid-template-columns: minmax(130px, .3fr) 1fr; gap: 12px; padding: 4px 0; }
.preview-grid dt { color: var(--ink-600); }
.preview-grid dd { margin: 0; overflow-wrap: anywhere; }

.login-body { background: var(--navy-950); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(460px, .9fr); }
.login-brand-panel { display: flex; flex-direction: column; justify-content: center; padding: 9vw; color: #fff; background: #0b3153; }
.login-brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 55%); border-radius: 5px; font-size: 24px; font-weight: 700; }
.login-brand-panel h1 { margin: 22px 0 10px; font-size: clamp(32px, 4vw, 50px); line-height: 1.15; letter-spacing: -.04em; }
.login-brand-panel > p { max-width: 610px; margin: 0; color: #bfd1e2; font-size: 17px; }
.login-flow { max-width: 520px; display: grid; gap: 0; margin: 48px 0 0; padding: 0; list-style: none; border-top: 1px solid rgb(255 255 255 / 18%); }
.login-flow li { display: flex; align-items: center; gap: 16px; padding: 17px 0; border-bottom: 1px solid rgb(255 255 255 / 18%); color: #dce8f3; }
.login-flow span { color: #66d4ce; font-family: ui-monospace, monospace; }
.login-panel { display: grid; place-items: center; padding: 50px; background: #fff; }
.login-card { width: min(390px, 100%); }
.login-card h2 { margin: 0; font-size: 27px; letter-spacing: -.02em; }
.login-card > p { margin: 7px 0 28px; color: var(--ink-600); }
.login-form { display: grid; gap: 18px; }
.login-form label { display: grid; gap: 7px; color: var(--ink-700); font-weight: 600; }
.login-form input { height: 46px; padding: 0 13px; border: 1px solid var(--line-300); border-radius: 4px; color: var(--ink-950); }
.login-form .button { margin-top: 8px; min-height: 46px; }
.form-error { margin-bottom: 18px; padding: 10px 12px; color: var(--danger-600); border: 1px solid #f2bbbe; background: var(--danger-50); }
.login-help { margin-top: 18px !important; font-size: 12px; text-align: center; }

@media (max-width: 1180px) {
  .page-grid-with-rail { grid-template-columns: 1fr; }
  .right-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px 0 0; border-top: 1px solid var(--line-200); border-left: 0; }
  .rail-heading { grid-column: 1 / -1; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .reconcile-flow { grid-template-columns: repeat(3, 1fr); }
  .flow-step:nth-child(3) { border-right: 0; }
  .detail-layout { grid-template-columns: 1fr; }
  .timeline-rail { padding: 24px 26px; border-top: 1px solid var(--line-200); border-left: 0; }
  .timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .timeline li { min-height: 110px; }
  .timeline li::before { display: none; }
  .metadata-row { grid-template-columns: repeat(3, 1fr); }
  .metadata-row > div:nth-child(3) { border-right: 0; }
  .metadata-row > div:nth-child(n+4) { border-top: 1px solid var(--line-200); }
  .metadata-counts { grid-template-columns: repeat(4, 1fr); }
  .metadata-counts > div { border-top: 0 !important; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-main { grid-column: 1; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-float); }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .mobile-menu { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .context-controls { flex: 1; gap: 12px; }
  .context-field select { min-width: 160px; max-width: 220px; }
  .period-field { display: none; }
  .user-menu span, .text-button { display: none; }
  .workspace { padding: 18px; }
  .detail-layout { margin: -18px; }
  .detail-main { padding: 18px; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-strip > div:nth-child(2) { border-right: 0; }
  .summary-strip > div:nth-child(n+3) { border-top: 1px solid var(--line-200); }
  .coverage-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .coverage-grid > div:nth-child(odd) { border-right: 1px solid var(--line-200); }
  .coverage-grid > div:nth-child(even) { border-right: 0; }
  .coverage-grid > div:nth-last-child(-n + 4) { border-bottom: 1px solid var(--line-200); }
  .coverage-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 680px) {
  .topbar { height: 66px; }
  .workspace { min-height: calc(100vh - 66px); }
  .context-field > span { display: none; }
  .context-field select { min-width: 0; width: min(48vw, 220px); }
  .topbar-actions { gap: 2px; }
  .icon-button { width: 34px; }
  .user-menu { display: none; }
  .page-header { display: grid; }
  .page-header .button, .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .metric-row { grid-template-columns: 1fr; }
  .metric { min-height: 96px; }
  .right-rail { grid-template-columns: 1fr; }
  .reconcile-flow { grid-template-columns: 1fr; }
  .flow-step { border-right: 0; border-bottom: 1px solid var(--line-200); }
  .flow-step:last-child { border-bottom: 0; }
  .flow-step::after { display: none; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar select, .filter-bar input { width: 100%; }
  .metadata-row, .metadata-counts { grid-template-columns: 1fr; }
  .metadata-row > div { min-height: 68px; border-right: 0; border-top: 1px solid var(--line-200); }
  .metadata-row > div:first-child { border-top: 0; }
  .metadata-counts > div { border-top: 1px solid var(--line-200) !important; }
  .coverage-grid { grid-template-columns: 1fr; }
  .coverage-grid > div { border-right: 0 !important; border-bottom: 1px solid var(--line-200) !important; }
  .coverage-grid > div:last-child { border-bottom: 0 !important; }
  .detail-tabs { gap: 18px; overflow-x: auto; }
  .detail-tabs > span { flex: 0 0 auto; }
  .timeline { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-panel { padding: 30px 20px; }
}

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