:root {
  color-scheme: light;
  --ink-950: #101b21;
  --ink-900: #17252e;
  --ink-800: #243943;
  --ink-700: #3d515b;
  --ink-600: #60737c;
  --ink-500: #7b8d95;
  --paper: #f3f6f7;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-deep: #e8eef0;
  --line: #cbd7dc;
  --line-strong: #aebfc6;
  --blue: #285569;
  --blue-dark: #1e4354;
  --blue-soft: #e6eff2;
  --green: #2e6651;
  --green-soft: #e5f0ea;
  --red: #a33e32;
  --red-soft: #f7e8e5;
  --amber: #8a6426;
  --amber-soft: #f6eedc;
  --purple: #6b507e;
  --purple-soft: #eee8f2;
  --nav: #13242c;
  --nav-raised: #1c343f;
  --nav-line: #2a4551;
  --shadow: 0 12px 30px rgba(18, 37, 46, .08);
  --shadow-high: 0 24px 60px rgba(18, 37, 46, .2);
  --radius-sm: 4px;
  --radius: 7px;
  --sans: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", "Consolas", monospace;
  --sidebar-width: 228px;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink-900);
  background: var(--paper);
  font: 14px/1.55 var(--sans);
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, [data-route], [data-action], [data-modal] { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:focus-visible {
  outline: 3px solid #79a8ba;
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 12px;
  top: -80px;
  padding: 9px 14px;
  color: #fff;
  background: var(--blue-dark);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 10px; }

.prototype-ribbon {
  position: fixed;
  z-index: 90;
  inset: 0 0 auto 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px;
  color: #f7f1e6;
  background: #684e29;
  border-bottom: 1px solid #81653b;
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  padding-top: 34px;
}

.sidebar {
  position: fixed;
  z-index: 70;
  top: 34px;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #e8f0f3;
  background: var(--nav);
  border-right: 1px solid var(--nav-line);
}
.brand {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--nav-line);
}
.brand-mark {
  position: relative;
  width: 36px;
  height: 43px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--nav);
  background: #dce9ed;
  border-radius: 3px 3px 9px 3px;
  box-shadow: inset -5px 0 0 #7397a6;
  font: 800 14px var(--mono);
}
.brand-mark i {
  position: absolute;
  right: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(19, 36, 44, .2);
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font: 600 18px/1.3 var(--serif); letter-spacing: .05em; }
.brand-copy small { color: #91adb7; font-size: 11px; letter-spacing: .08em; }

.primary-nav {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 18px;
}
.nav-group + .nav-group { margin-top: 17px; }
.nav-group-title {
  margin: 0 10px 6px;
  color: #7896a1;
  font: 700 10px/1 var(--mono);
  letter-spacing: .16em;
}
.nav-button {
  width: 100%;
  min-height: 41px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  padding: 7px 10px;
  color: #c5d5db;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
}
.nav-button svg { width: 17px; height: 17px; stroke-width: 1.8; }
.nav-button:hover { color: #fff; background: #1a313b; }
.nav-button.active {
  color: #fff;
  background: #244350;
  border-color: #355a69;
  box-shadow: inset 3px 0 0 #b0cbd5;
}
.nav-button.disabled { color: #758d96; }
.nav-badge {
  min-width: 22px;
  padding: 1px 6px;
  color: #d9e5e9;
  background: #31515e;
  border-radius: 9px;
  font: 10px/1.6 var(--mono);
  text-align: center;
}
.nav-button.disabled .nav-badge { color: #9aadb4; background: #253d47; }

.sidebar-foot {
  padding: 10px;
  border-top: 1px solid var(--nav-line);
}
.user-switch {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  color: #d7e3e7;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
}
.user-switch:hover { background: var(--nav-raised); border-color: var(--nav-line); }
.user-switch > span:nth-child(2) { display: grid; }
.user-switch b { font-size: 12px; }
.user-switch small { color: #849fa9; font-size: 10px; }
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--nav);
  background: #c9dce3;
  border-radius: 50%;
  font: 700 13px var(--serif);
}

.content-shell {
  grid-column: 2;
  min-width: 0;
}
.global-header {
  position: sticky;
  z-index: 55;
  top: 34px;
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.header-start, .header-actions { display: flex; align-items: center; gap: 8px; }
.breadcrumb { color: var(--ink-600); font-size: 12px; }
.breadcrumb b { color: var(--ink-900); font-weight: 600; }
.breadcrumb span + span::before { content: "/"; margin: 0 8px; color: var(--line-strong); }
.icon-button, .command-trigger {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--ink-700);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.icon-button:hover, .command-trigger:hover { color: var(--blue); border-color: #92b0bc; background: var(--blue-soft); }
.command-trigger { min-width: 210px; justify-content: flex-start; color: var(--ink-600); }
.command-trigger kbd {
  margin-left: auto;
  padding: 1px 5px;
  color: var(--ink-500);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 10px var(--mono);
}
.health-dot { width: 8px; height: 8px; background: var(--amber); border-radius: 50%; box-shadow: 0 0 0 3px var(--amber-soft); }
.notification-count { min-width: 17px; height: 17px; display: grid; place-items: center; color: #fff; background: var(--red); border-radius: 50%; font: 9px var(--mono); }

#main-content { min-height: calc(100vh - 91px); }
.page-wrap { padding: 22px; }
.page-wrap.edge { padding: 0; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.page-head h1, .task-title h1 {
  margin: 2px 0 5px;
  font: 600 25px/1.25 var(--serif);
  letter-spacing: .015em;
}
.page-head p, .task-title p { max-width: 800px; margin: 0; color: var(--ink-600); }
.section-title { margin: 2px 0 0; font: 600 20px/1.35 var(--serif); }
.section-stack { margin-top: 18px; }
.section-stack > .stack { padding-top: 15px; border-top: 1px solid var(--line); }
.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font: 700 10px/1.2 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 13px;
  color: var(--ink-800);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.button:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.danger { color: var(--red); border-color: #d8a59e; background: var(--red-soft); }
.button.quiet { min-height: 31px; padding: 4px 8px; border-color: transparent; background: transparent; }
.button:disabled, .button.disabled { color: #8b999f; background: #edf1f2; border-color: #d6dfe2; opacity: .8; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 7px;
  color: var(--ink-700);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; background: var(--ink-500); border-radius: 50%; }
.chip.green { color: var(--green); background: var(--green-soft); border-color: #a9c8ba; }
.chip.green::before { background: var(--green); }
.chip.red { color: var(--red); background: var(--red-soft); border-color: #deb1aa; }
.chip.red::before { background: var(--red); }
.chip.amber { color: var(--amber); background: var(--amber-soft); border-color: #d9c38d; }
.chip.amber::before { background: var(--amber); }
.chip.blue { color: var(--blue); background: var(--blue-soft); border-color: #b7cdd6; }
.chip.blue::before { background: var(--blue); }
.chip.purple { color: var(--purple); background: var(--purple-soft); border-color: #c8b7d2; }
.chip.purple::before { background: var(--purple); }
.chip.neutral::before, .chip.no-dot::before { display: none; }
.badge {
  display: inline-flex;
  min-width: 24px;
  min-height: 21px;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  color: var(--ink-700);
  background: var(--surface-deep);
  border-radius: 10px;
  font: 10px var(--mono);
}
.priority { font: 800 11px var(--mono); }
.priority.p0, .priority.p1 { color: var(--red); }
.priority.p2 { color: var(--amber); }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.metric {
  min-height: 90px;
  padding: 15px 17px;
  background: var(--surface);
}
.metric label { display: block; color: var(--ink-600); font-size: 11px; }
.metric strong { display: block; margin: 4px 0 1px; font: 650 25px/1.2 var(--serif); }
.metric small { color: var(--ink-500); }
.metric.alert strong { color: var(--red); }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: minmax(0, 1.5fr) minmax(310px, .75fr); }
.grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 14px; }
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel.flat { box-shadow: none; }
.panel-head {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { margin: 0; font: 600 16px/1.3 var(--serif); }
.panel-head p { margin: 2px 0 0; color: var(--ink-600); font-size: 11px; }
.panel-body { padding: 14px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 10px 14px; background: var(--surface-soft); border-top: 1px solid var(--line); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toolbar-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.input, .select {
  min-height: 34px;
  padding: 6px 9px;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.input.search { min-width: 240px; padding-left: 31px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2360737c' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") 9px center/14px no-repeat; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  padding: 9px 11px;
  color: var(--ink-600);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  white-space: nowrap;
}
.data-table td { padding: 10px 11px; border-bottom: 1px solid #e2e9eb; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfc; }
.data-table tbody tr.selected { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.data-table strong { display: block; color: var(--ink-900); }
.data-table small { display: block; margin-top: 2px; color: var(--ink-600); }
.data-table progress { width: 96px; accent-color: var(--blue); }
.table-link { color: var(--blue); background: transparent; border: 0; padding: 0; font-weight: 700; text-align: left; }
.nowrap { white-space: nowrap; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  color: var(--ink-700);
  background: var(--blue-soft);
  border: 1px solid #bad0d8;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.notice::before {
  content: "i";
  flex: 0 0 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font: 800 11px var(--serif);
}
.notice.warning { color: #6b4c1d; background: var(--amber-soft); border-color: #d9c38d; border-left-color: var(--amber); }
.notice.warning::before { content: "!"; background: var(--amber); }
.notice.danger { color: #713b33; background: var(--red-soft); border-color: #dcaea7; border-left-color: var(--red); }
.notice.danger::before { content: "!"; background: var(--red); }
.notice.success { color: #244f3f; background: var(--green-soft); border-color: #aac8ba; border-left-color: var(--green); }
.notice.success::before { content: "✓"; background: var(--green); }

.task-hero {
  padding: 18px 22px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.task-hero-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.task-meta, .status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-meta { margin-top: 8px; color: var(--ink-600); font-size: 11px; }
.task-meta span + span::before { content: ""; display: inline-block; width: 1px; height: 10px; margin-right: 8px; background: var(--line); vertical-align: -1px; }
.task-tabs {
  display: flex;
  align-items: end;
  gap: 1px;
  margin-top: 16px;
  overflow-x: auto;
}
.task-tab {
  min-height: 43px;
  flex: 0 0 auto;
  padding: 8px 11px;
  color: var(--ink-600);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
}
.task-tab:hover { color: var(--blue); background: var(--blue-soft); }
.task-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.task-tab.locked { color: #9aa7ac; }
.task-body { padding: 14px; }

.stage-rail { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage-row {
  position: relative;
  min-height: 56px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  background: #fff;
}
.stage-row .stage-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--ink-600);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font: 10px var(--mono);
}
.stage-row.done .stage-index { color: #fff; background: var(--green); border-color: var(--green); }
.stage-row.active { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.stage-row.active .stage-index { color: #fff; background: var(--blue); border-color: var(--blue); }
.stage-row.blocked { background: var(--red-soft); }
.stage-row.blocked .stage-index { color: #fff; background: var(--red); border-color: var(--red); }
.stage-copy { min-width: 0; }
.stage-copy strong { display: block; }
.stage-copy small { display: block; color: var(--ink-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: 135px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #e1e8ea; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--ink-600); font-size: 11px; }
.detail-row dd { margin: 0; }
.hash { display: inline-block; max-width: 100%; color: var(--ink-700); font: 10px/1.5 var(--mono); word-break: break-all; }
.plain-list { margin: 0; padding-left: 20px; color: var(--ink-700); }
.plain-list li + li { margin-top: 7px; }

.timeline { position: relative; display: grid; gap: 0; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.timeline-item { position: relative; padding: 0 0 17px 12px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; background: #fff; border: 2px solid var(--blue); border-radius: 50%; }
.timeline-item.done::before { background: var(--green); border-color: var(--green); }
.timeline-item.warning::before { background: var(--amber); border-color: var(--amber); }
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item small { color: var(--ink-600); }

.document-workbench {
  display: grid;
  grid-template-columns: 188px minmax(460px, 1.25fr) minmax(330px, .82fr);
  gap: 10px;
  height: calc(100vh - 224px);
  min-height: 650px;
}
.document-workbench .panel { min-height: 0; overflow: hidden; }
.scroll-panel { min-height: 0; overflow: auto; }
.page-list { padding: 8px; }
.page-thumb {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px 7px;
  color: var(--ink-700);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
}
.page-thumb:hover { background: var(--surface-soft); }
.page-thumb.active { color: var(--blue); background: var(--blue-soft); border-color: #b7ccd5; }
.page-thumb .mini-page { height: 40px; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 2px 4px rgba(18,37,46,.08); }
.page-thumb small { display: block; color: var(--ink-600); }
.pdf-panel { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.pdf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; color: var(--ink-600); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 11px; }
.pdf-stage { min-height: 0; overflow: auto; padding: 25px 43px 52px; background: #dbe2e5; }
.pdf-stage.compact { min-height: 700px; padding-top: 35px; }
.pdf-page {
  position: relative;
  width: min(100%, 690px);
  min-height: 750px;
  margin: 0 auto;
  padding: 52px 58px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(18,37,46,.19);
}
.pdf-page .page-kicker { color: var(--ink-600); font-size: 10px; letter-spacing: .08em; }
.pdf-page h2 { margin: 10px 0 19px; font: 600 21px/1.4 var(--serif); }
.pdf-page p { margin: 0 0 12px; color: #3d4c53; text-align: justify; }
.pdf-page table { width: 100%; margin: 15px 0; border-collapse: collapse; font-size: 10px; }
.pdf-page th, .pdf-page td { padding: 6px; border: 1px solid #9eabb0; }
.pdf-highlight { margin: 16px -11px; padding: 11px; background: #fff8d9; border-left: 3px solid #b68b2e; }
.page-number { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font: 11px var(--mono); }
.tender-page { min-height: 620px; }
.evidence-spine { position: absolute; top: 0; right: -34px; width: 28px; height: 100%; background: #edf3f5; border-left: 1px solid #b6c6cd; }
.spine-mark { position: absolute; right: 3px; min-width: 22px; padding: 3px 2px; color: #fff; border-radius: 2px; font: 800 9px var(--mono); text-align: center; }
.spine-mark.e { top: 15%; background: var(--green); }
.spine-mark.s { top: 29%; background: var(--blue); }
.spine-mark.l { top: 51%; background: var(--red); }
.spine-mark.m { top: 68%; background: var(--purple); }
.spine-mark.ocr { top: 84%; color: var(--ink-900); background: #e2c86e; }
.inspector { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.segmented { display: flex; border-bottom: 1px solid var(--line); }
.segmented button { flex: 1; min-height: 38px; padding: 6px; color: var(--ink-600); background: var(--surface-soft); border: 0; border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button.active { color: var(--blue); background: #fff; box-shadow: inset 0 -3px 0 var(--blue); font-weight: 700; }
.inspector-body { min-height: 0; overflow: auto; padding: 11px; }
.record-card { margin-bottom: 9px; padding: 11px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.record-card.redline { border-left: 4px solid var(--red); }
.record-card.greenline { border-left: 4px solid var(--green); }
.record-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.record-title code { color: var(--blue); font: 800 11px var(--mono); }
.field + .field { margin-top: 9px; }
.field label { display: block; margin-bottom: 2px; color: var(--ink-600); font-size: 10px; }
.field p { margin: 0; font-size: 12px; }
.location-tag { display: inline-block; margin-top: 8px; padding: 2px 5px; color: var(--blue); background: var(--blue-soft); border: 1px solid #bed1d8; border-radius: 2px; font: 10px var(--mono); }

.score-layout { display: grid; grid-template-columns: minmax(560px, 1.35fr) minmax(340px, .7fr); gap: 12px; }
.score-summary { position: sticky; top: 105px; }
.score-number { display: flex; align-items: baseline; gap: 8px; margin: 5px 0 12px; }
.score-number strong { font: 650 42px/1 var(--serif); color: var(--blue); }
.score-number span { color: var(--ink-600); }
.score-bar { height: 7px; overflow: hidden; background: #e4ebed; border-radius: 4px; }
.score-bar span { display: block; height: 100%; width: 83.6%; background: var(--blue); }
.chain-list { display: grid; gap: 7px; margin-top: 12px; }
.chain-row { display: grid; grid-template-columns: 82px minmax(0,1fr) auto; align-items: center; gap: 8px; font-size: 11px; }
.chain-row i { height: 5px; background: #e1e8ea; border-radius: 3px; overflow: hidden; }
.chain-row i::before { content: ""; display: block; width: var(--fill, 70%); height: 100%; background: var(--green); }

.report-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
.chapter-nav { position: sticky; top: 105px; padding: 8px; }
.chapter-button { width: 100%; display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 7px; padding: 8px; color: var(--ink-700); background: transparent; border: 0; border-radius: var(--radius-sm); text-align: left; }
.chapter-button:hover, .chapter-button.active { color: var(--blue); background: var(--blue-soft); }
.chapter-button b { font: 700 10px var(--mono); }
.report-paper { padding: 34px 40px; min-height: 900px; }
.report-paper h1 { margin: 0 0 6px; text-align: center; font: 600 27px var(--serif); }
.report-paper .report-subtitle { margin-bottom: 28px; color: var(--ink-600); text-align: center; font-size: 11px; }
.report-paper h2 { margin: 26px 0 10px; padding-bottom: 7px; border-bottom: 2px solid var(--ink-900); font: 600 19px var(--serif); }
.report-paper p { color: var(--ink-700); }

.mod-layout { display: grid; grid-template-columns: minmax(580px, 1.25fr) minmax(380px, .85fr); gap: 12px; align-items: start; }
.mod-card { position: sticky; top: 105px; }
.mod-section { padding: 13px 0; border-bottom: 1px solid #e1e8ea; }
.mod-section:last-child { border-bottom: 0; }
.mod-section h4 { margin: 0 0 6px; color: var(--ink-600); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.mod-section p { margin: 0; }
.replacement-copy { padding: 11px; color: var(--ink-800); background: #f6f9fa; border: 1px dashed var(--line-strong); white-space: pre-line; }

.wizard { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 620px; overflow: hidden; }
.wizard-steps { padding: 18px 12px; color: #dce8ec; background: var(--nav); }
.wizard-step { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 8px; padding: 11px 8px; border-radius: var(--radius-sm); }
.wizard-step.active { color: #fff; background: #244350; }
.wizard-step.done .wizard-index { color: #fff; background: var(--green); border-color: var(--green); }
.wizard-index { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #5f7a85; border-radius: 50%; font: 10px var(--mono); }
.wizard-step strong { display: block; font-size: 12px; }
.wizard-step small { color: #91a8b1; }
.wizard-content { padding: 24px; }
.dropzone { min-height: 180px; display: grid; place-items: center; padding: 22px; color: var(--ink-600); background: var(--surface-soft); border: 2px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }
.dropzone strong { display: block; margin-bottom: 5px; color: var(--ink-900); font: 600 17px var(--serif); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-field { display: grid; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--ink-600); font-size: 11px; font-weight: 700; }
.form-field small { color: var(--ink-500); }

.screen-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.screen-card { position: relative; min-height: 154px; display: flex; flex-direction: column; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.screen-card::after { content: attr(data-code); position: absolute; right: 12px; top: 12px; color: #a5b3b9; font: 700 10px var(--mono); }
.screen-card h3 { margin: 17px 0 5px; font: 600 16px var(--serif); }
.screen-card p { flex: 1; margin: 0 0 12px; color: var(--ink-600); font-size: 12px; }
.screen-card .button { align-self: flex-start; }

.empty-state { min-height: 280px; display: grid; place-items: center; padding: 30px; text-align: center; }
.empty-state .empty-mark { width: 70px; height: 84px; display: grid; place-items: center; margin: 0 auto 15px; color: var(--blue); background: var(--blue-soft); border: 1px solid #b5ccd5; border-radius: 4px 4px 14px 4px; box-shadow: inset -8px 0 0 #c6d9df; font: 800 18px var(--mono); }
.empty-state h2 { margin: 0 0 6px; font: 600 20px var(--serif); }
.empty-state p { max-width: 520px; margin: 0 auto 15px; color: var(--ink-600); }

.authorization-lock { display: grid; grid-template-columns: 1fr 38px 1fr; gap: 10px; align-items: stretch; }
.lock-record { padding: 14px; border: 1px solid var(--line); background: #fff; }
.lock-record strong { display: block; margin-bottom: 6px; }
.lock-record .lock-score { font: 650 26px var(--serif); color: var(--blue); }
.lock-link { display: grid; place-items: center; color: #fff; background: var(--blue); font: 800 11px var(--mono); }

.permission-matrix td:first-child, .permission-matrix th:first-child { position: sticky; left: 0; background: inherit; }
.permission-yes { color: var(--green); font-weight: 700; }
.permission-no { color: var(--ink-500); }
.permission-conditional { color: var(--amber); font-weight: 700; }
.settings-tabs { margin: -4px 0 14px; padding: 0; border-bottom: 1px solid var(--line); }

.error-demo { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.error-card { padding: 12px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: var(--radius-sm); }
.error-card code { color: var(--red); font-weight: 800; }
.error-card strong { display: block; margin: 5px 0; }
.error-card p { margin: 0; color: var(--ink-600); font-size: 11px; }

.auth-demo { min-height: calc(100vh - 91px); display: grid; grid-template-columns: minmax(420px,.85fr) minmax(520px,1.15fr); }
.auth-panel { display: grid; place-items: center; padding: 46px; background: #fff; }
.auth-box { width: min(100%,410px); }
.auth-box .brand { margin-bottom: 32px; padding: 0; color: var(--ink-900); border: 0; }
.auth-box .brand-copy small { color: var(--ink-600); }
.auth-box h1 { margin: 0 0 7px; font: 600 27px var(--serif); }
.auth-box > p { margin: 0 0 24px; color: var(--ink-600); }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 56px; color: #ecf3f5; background: var(--nav); }
.auth-aside::before { content: "E\A S\A L\A M"; white-space: pre; position: absolute; right: 8%; top: 9%; color: rgba(210,230,237,.08); font: 800 96px/.92 var(--mono); }
.auth-aside h2 { max-width: 570px; margin: 0; font: 500 36px/1.35 var(--serif); }
.auth-aside blockquote { max-width: 520px; margin: 0; padding-left: 16px; color: #aac0c8; border-left: 3px solid #7595a2; }

.modal {
  width: min(720px, calc(100vw - 34px));
  max-height: min(86vh, 860px);
  padding: 0;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-high);
}
.modal::backdrop { background: rgba(10, 25, 32, .54); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 600 20px var(--serif); }
.modal-body { max-height: calc(86vh - 145px); overflow: auto; padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 18px; background: var(--surface-soft); border-top: 1px solid var(--line); }
.role-list { display: grid; gap: 7px; }
.role-option { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 10px; color: var(--ink-800); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: left; }
.role-option:hover, .role-option.active { border-color: var(--blue); background: var(--blue-soft); }
.role-option span:nth-child(2) { display: grid; }
.role-option small { color: var(--ink-600); }

/* 自然语言协作层：Chat负责解释与编排，证据工作台负责裁决。 */
.chat-home {
  min-height: calc(100vh - 91px);
  padding: 28px;
  background:
    linear-gradient(rgba(40, 85, 105, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 85, 105, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}
.chat-home-head {
  max-width: 1480px;
  margin: 0 auto 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.chat-home-head h1 { margin: 3px 0 4px; font: 600 clamp(27px, 3vw, 40px)/1.15 var(--serif); letter-spacing: -.025em; }
.chat-home-head p { margin: 0; color: var(--ink-600); font-size: 15px; }
.chat-role {
  max-width: 470px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.chat-role > span:nth-child(2) { min-width: 0; display: grid; }
.chat-role small { overflow: hidden; color: var(--ink-600); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-home-grid {
  max-width: 1480px;
  min-height: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .65fr);
  gap: 16px;
  align-items: stretch;
}
.conversation-surface {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(430px, 1fr) auto;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 18px 50px rgba(18, 37, 46, .1);
  overflow: hidden;
}
.conversation-top {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.conversation-top > div { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 8px; }
.conversation-top small { grid-column: 2; color: var(--ink-600); font-size: 11px; }
.status-orbit { grid-row: 1 / span 2; width: 10px; height: 10px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 5px var(--green-soft); }
.conversation-stream {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(20px, 4vw, 42px);
  scroll-padding-bottom: 24px;
}
.conversation-compose { padding: 14px 18px 13px; background: #fff; border-top: 1px solid var(--line); }
.conversation-compose > p { margin: 7px 4px 0; color: var(--ink-500); font-size: 10px; text-align: center; }
.chat-message { display: flex; align-items: flex-start; gap: 10px; margin: 0 auto 20px; }
.chat-message.user { justify-content: flex-end; }
.chat-message.user .chat-bubble { max-width: min(680px, 86%); padding: 12px 15px; background: var(--blue-soft); border: 1px solid #b7cdd5; border-radius: 12px 12px 3px 12px; }
.chat-message.assistant .chat-bubble { width: min(850px, calc(100% - 44px)); }
.chat-avatar { width: 32px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--nav); border-radius: 3px 3px 10px 3px; box-shadow: inset -4px 0 0 #638b9b; font: 700 12px var(--mono); }
.message-author { display: block; margin-bottom: 6px; color: var(--ink-600); font: 700 10px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.chat-bubble > h2 { max-width: 680px; margin: 2px 0 10px; font: 600 clamp(23px, 3vw, 34px)/1.24 var(--serif); letter-spacing: -.02em; }
.chat-bubble > p { max-width: 760px; margin: 0 0 14px; color: var(--ink-700); }
.welcome-message { min-height: 100%; align-items: center; }
.welcome-message .chat-bubble { padding-block: 20px; }
.chat-prompts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 20px; }
.chat-prompt {
  min-height: 94px;
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 13px 14px;
  color: var(--ink-800);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.chat-prompt:hover { border-color: #86a7b4; box-shadow: var(--shadow); transform: translateY(-1px); }
.chat-prompt span { color: var(--blue); font: 700 10px var(--mono); letter-spacing: .08em; }
.chat-prompt strong { font-size: 13px; font-weight: 650; }
.chat-prompt small { color: var(--ink-600); font-size: 10px; }
.chat-composer {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(18,37,46,.04);
}
.chat-composer:focus-within { border-color: #7399a8; box-shadow: 0 0 0 3px rgba(121,168,186,.18); }
.chat-composer textarea { width: 100%; max-height: 130px; resize: vertical; padding: 7px 3px; color: var(--ink-900); background: transparent; border: 0; outline: 0; line-height: 1.55; }
.composer-tool, .composer-send { min-height: 36px; border: 0; border-radius: 7px; }
.composer-tool { color: var(--ink-600); background: var(--surface-deep); font-size: 20px; }
.composer-send { min-width: 66px; padding: 0 15px; color: #fff; background: var(--blue); font-weight: 650; }
.composer-send:hover { background: var(--blue-dark); }
.execution-slip {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 13px 32px rgba(18,37,46,.08);
}
.execution-slip::after { content: "E  S  L  M"; position: absolute; top: 0; right: 0; bottom: 0; width: 20px; display: grid; place-items: center; padding: 9px 0; color: #dce8ec; background: var(--blue); font: 8px/1.65 var(--mono); letter-spacing: .12em; text-align: center; writing-mode: vertical-rl; }
.execution-slip.warning::after { background: var(--amber); }
.execution-slip.danger::after { background: var(--red); }
.execution-slip.purple::after { background: var(--purple); }
.execution-slip > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 38px 11px 16px; border-bottom: 1px solid var(--line); }
.execution-slip h3, .artifact-card h3 { margin: 2px 0 0; font: 600 18px var(--serif); }
.slip-stamp { padding: 3px 7px; color: var(--amber); border: 1px solid #c8a35f; border-radius: 3px; font: 700 10px var(--mono); transform: rotate(-2deg); }
.chat-context-list { margin: 0; padding: 8px 36px 8px 16px; }
.chat-context-list > div { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 12px; padding: 6px 0; border-bottom: 1px dashed #dbe3e6; }
.chat-context-list > div:last-child { border-bottom: 0; }
.chat-context-list dt { color: var(--ink-600); font-size: 11px; }
.chat-context-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.slip-body { padding: 10px 36px 12px 16px; color: var(--ink-700); background: var(--surface-soft); border-top: 1px solid #e5ebed; }
.slip-body p { margin: 0; }
.slip-warning { margin-top: 8px; padding: 8px 10px; color: #684d1f; background: var(--amber-soft); border-left: 3px solid #b68b3d; font-size: 11px; }
.execution-slip > footer { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 36px 11px 16px; border-top: 1px solid var(--line); }
.artifact-card { margin-top: 14px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.artifact-card > header, .artifact-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; }
.artifact-card > header { border-bottom: 1px solid var(--line); }
.artifact-card > footer { flex-wrap: wrap; color: var(--ink-600); background: var(--surface-soft); border-top: 1px solid var(--line); font-size: 11px; }
.advice-preview { list-style: none; margin: 0; padding: 4px 15px; }
.advice-preview li { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.advice-preview li:last-child { border-bottom: 0; }
.advice-preview span { color: var(--ink-700); }
.context-rail { display: grid; align-content: start; gap: 12px; }
.context-card { padding: 15px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.context-card.primary { color: #eef5f7; background: var(--nav); border-color: var(--nav-line); }
.context-card h2 { margin: 4px 0 10px; font: 600 19px/1.35 var(--serif); }
.context-card.primary .eyebrow, .context-card.primary dt { color: #8fb0bd; }
.context-card.primary .chat-context-list { padding-inline: 0; }
.context-card.primary .chat-context-list > div { border-color: #2c4651; }
.context-card.primary .button { width: 100%; margin-top: 10px; color: var(--nav); background: #dceaf0; border-color: #dceaf0; }
.context-card > header { display: grid; gap: 3px; margin-bottom: 9px; }
.context-action { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 3px; color: var(--ink-800); background: transparent; border: 0; border-top: 1px solid var(--line); text-align: left; }
.context-action > span:first-child { display: grid; }
.context-action small { color: var(--ink-600); font-size: 10px; }
.context-action:hover b { color: var(--blue); }
.context-card.quiet { box-shadow: none; background: rgba(248,250,251,.9); }
.context-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.context-links button { padding: 8px; color: var(--ink-700); background: #fff; border: 1px solid var(--line); border-radius: 5px; text-align: left; }
.context-links button:hover { color: var(--blue); border-color: #9bb7c1; }

.drawer.assistant-mode { width: min(500px, 96vw); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; padding: 0; overflow: hidden; background: var(--surface-soft); }
.assistant-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px 13px; color: #ecf4f6; background: var(--nav); border-bottom: 1px solid var(--nav-line); }
.assistant-panel-head h2 { margin: 2px 0; font: 600 21px var(--serif); }
.assistant-panel-head p { margin: 0; color: #8eabb6; font-size: 11px; }
.assistant-panel-head .eyebrow { color: #8eabb6; }
.assistant-panel-head .icon-button { color: #dce9ed; background: var(--nav-raised); border-color: var(--nav-line); }
.assistant-context { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 10px; padding: 9px 18px; background: #eef3f5; border-bottom: 1px solid var(--line); font-size: 10px; }
.assistant-context span { color: var(--ink-600); }
.assistant-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-stream { min-height: 0; overflow-y: auto; padding: 18px; }
.assistant-stream .chat-message { margin-bottom: 14px; }
.assistant-stream .chat-message.assistant .chat-bubble { width: calc(100% - 42px); }
.assistant-stream .chat-bubble > h2 { font-size: 24px; }
.assistant-stream .chat-prompts { grid-template-columns: 1fr; }
.assistant-stream .chat-prompt { min-height: 64px; }
.assistant-stream .chat-context-list > div { grid-template-columns: 94px minmax(0,1fr); }
.assistant-stream .execution-slip > header { padding-right: 34px; }
.assistant-compose { display: grid; gap: 8px; padding: 12px; background: #fff; border-top: 1px solid var(--line); }
.assistant-compose > .table-link { justify-self: center; }

.drawer-backdrop, .nav-backdrop { display: none; position: fixed; z-index: 79; inset: 0; background: rgba(12,28,35,.42); }
.drawer {
  position: fixed;
  z-index: 80;
  top: 34px;
  right: 0;
  bottom: 0;
  width: min(520px, 96vw);
  overflow: auto;
  padding: 20px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-high);
  transform: translateX(105%);
  transition: transform .18s ease;
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { display: block; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.drawer-head h2 { margin: 0; font: 600 20px var(--serif); }

.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 10px 12px; color: #fff; background: var(--ink-900); border-left: 4px solid #9bc0cf; border-radius: var(--radius-sm); box-shadow: var(--shadow-high); animation: toast-in .18s ease-out; }
.toast.success { border-left-color: #68ad8e; }
.toast.warning { border-left-color: #d6aa4f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

.route-loading, .noscript { padding: 40px; color: var(--ink-600); text-align: center; }
.mobile-only { display: none; }

@media (min-width: 1440px) {
  body.assistant-open .content-shell { margin-right: 500px; transition: margin-right .18s ease; }
  body.assistant-open .drawer-backdrop { display: none; }
  .drawer.assistant-mode { box-shadow: -12px 0 36px rgba(18,37,46,.12); }
}

@media (max-width: 1280px) {
  :root { --sidebar-width: 76px; }
  .brand { justify-content: center; padding-inline: 10px; }
  .brand-copy, .nav-group-title, .nav-button span:not(.nav-badge), .user-switch > span:not(.avatar) { display: none; }
  .nav-button { grid-template-columns: 1fr; justify-items: center; padding: 8px 5px; }
  .nav-badge { position: absolute; margin: -24px 0 0 26px; }
  .user-switch { grid-template-columns: 1fr; justify-items: center; }
  .document-workbench { grid-template-columns: 160px minmax(430px,1fr) 320px; }
  .report-layout { grid-template-columns: 180px minmax(0,1fr); }
  .report-layout > :last-child { grid-column: 2; }
  .screen-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chat-home { padding: 20px; }
  .chat-home-grid { grid-template-columns: minmax(0,1.35fr) minmax(290px,.65fr); }
}

@media (max-width: 1023px) {
  :root { --sidebar-width: 0px; }
  .prototype-ribbon .mono { display: none; }
  .sidebar { width: 228px; transform: translateX(-105%); transition: transform .18s ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop { display: block; z-index: 60; }
  .brand { justify-content: flex-start; padding-inline: 18px; }
  .brand-copy, .nav-group-title, .nav-button span:not(.nav-badge), .user-switch > span:not(.avatar) { display: initial; }
  .nav-button { position: relative; grid-template-columns: 24px minmax(0,1fr) auto; justify-items: initial; padding: 7px 10px; }
  .nav-badge { position: static; margin: 0; }
  .user-switch { grid-template-columns: 34px minmax(0,1fr) auto; justify-items: initial; }
  .mobile-only { display: inline-flex; }
  .global-header { padding-inline: 12px; }
  .page-wrap { padding: 14px; }
  .document-workbench { height: auto; min-height: 0; grid-template-columns: 150px minmax(0,1fr); }
  .document-workbench > .inspector { grid-column: 1 / -1; min-height: 430px; }
  .score-layout, .mod-layout, .grid.two { grid-template-columns: 1fr; }
  .score-summary, .mod-card { position: static; }
  .report-layout { grid-template-columns: 160px minmax(0,1fr); }
  .metric-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .error-demo { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth-demo { grid-template-columns: 1fr; }
  .auth-aside { min-height: 360px; }
  .chat-home-grid { grid-template-columns: 1fr; }
  .context-rail { grid-template-columns: 1fr 1fr; }
  .context-card.primary { grid-row: span 2; }
}

@media (max-width: 767px) {
  .prototype-ribbon { height: 44px; padding: 5px 10px; line-height: 1.3; }
  .app-shell { padding-top: 44px; }
  .sidebar { top: 44px; }
  .global-header { top: 44px; }
  .command-trigger { min-width: 36px; width: 36px; padding: 6px; }
  .command-trigger span:nth-child(2), .command-trigger kbd, .desktop-only { display: none; }
  .page-head, .task-hero-main { flex-direction: column; }
  .page-head h1, .task-title h1 { font-size: 21px; }
  .metric-strip, .grid.equal, .grid.three, .screen-grid, .form-grid { grid-template-columns: 1fr; }
  .wizard { grid-template-columns: 1fr; }
  .wizard-steps { display: flex; overflow-x: auto; }
  .wizard-step { min-width: 160px; }
  .document-workbench { display: block; }
  .document-workbench > * { margin-bottom: 10px; }
  .document-workbench > :first-child { display: none; }
  .pdf-stage { padding: 18px 24px 36px; }
  .pdf-page { min-height: 610px; padding: 35px 30px; }
  .evidence-spine { right: -24px; width: 21px; }
  .spine-mark { right: 1px; min-width: 18px; font-size: 8px; }
  .report-layout { display: block; }
  .chapter-nav { position: static; display: flex; overflow-x: auto; margin-bottom: 10px; }
  .chapter-button { min-width: 120px; }
  .report-paper { padding: 24px 18px; }
  .authorization-lock { grid-template-columns: 1fr; }
  .lock-link { min-height: 34px; }
  .error-demo { grid-template-columns: 1fr; }
  .auth-panel, .auth-aside { padding: 28px 20px; }
  .auth-aside h2 { font-size: 27px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .input.search { min-width: 0; width: 100%; }
  .detail-row { grid-template-columns: 1fr; gap: 3px; }
  .chat-home { min-height: calc(100vh - 101px); padding: 12px 10px; }
  .chat-home-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .chat-role { max-width: none; }
  .chat-home-grid { min-height: 0; }
  .conversation-surface { grid-template-rows: auto minmax(480px,1fr) auto; border-radius: 8px; }
  .conversation-stream { padding: 18px 13px; }
  .chat-message.assistant .chat-bubble { width: calc(100% - 40px); }
  .chat-message.user .chat-bubble { max-width: 92%; }
  .chat-prompts { grid-template-columns: 1fr; }
  .chat-prompt { min-height: 72px; }
  .chat-composer { grid-template-columns: 34px minmax(0,1fr) auto; }
  .composer-send { min-width: 58px; padding-inline: 10px; }
  .chat-context-list > div, .assistant-stream .chat-context-list > div { grid-template-columns: 1fr; gap: 2px; }
  .execution-slip > header { padding-right: 34px; }
  .execution-slip > footer { display: grid; }
  .execution-slip > footer .button { width: 100%; }
  .advice-preview li { grid-template-columns: 1fr; gap: 2px; }
  .context-rail { grid-template-columns: 1fr; }
  .context-card.primary { grid-row: auto; }
  .drawer.assistant-mode { width: 100vw; max-width: none; }
}

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

@media print {
  .prototype-ribbon, .sidebar, .global-header, .task-tabs, .toolbar, .head-actions, .chat-composer, .assistant-compose, .drawer-backdrop { display: none !important; }
  .app-shell { display: block; padding: 0; }
  .content-shell { display: block; }
  .page-wrap, .task-body { padding: 0; }
  .panel, .report-paper { box-shadow: none; }
}
