:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f9fafc;
  --ink: #17202b;
  --muted: #596675;
  --faint: #667386;
  --line: #dfe5ec;
  --line-strong: #cfd8e3;
  --accent: #2f5ce5;
  --accent-soft: #eef2ff;
  --accent-ink: #ffffff;
  --sidebar: #0d1524;
  --sidebar-soft: #15213a;
  --sidebar-line: #1e2d48;
  --sidebar-muted: #8d9bb0;
  --sidebar-label: #7b8aa0;
  --focus: #1d4ed8;
  --focus-dark: #a9c1ff;
  --success: #177245;
  --success-soft: #e7f7ee;
  --warning: #9a5b00;
  --warning-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #ffebe9;
  --radius: 9px;
  --radius-sm: 6px;
  --control-height: 38px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --shadow: 0 1px 2px rgba(20, 34, 55, .04), 0 8px 24px rgba(20, 34, 55, .035);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap;
}
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); color: var(--accent); box-shadow: var(--shadow);
  font-size: 12px; font-weight: 650;
  transform: translateY(-200%); transition: transform .12s ease;
}
.skip-link:focus { transform: none; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}
.sidebar :where(a, button, label, summary):focus-visible,
.nav-close:focus-visible {
  outline-color: var(--focus-dark);
  box-shadow: 0 0 0 2px var(--sidebar);
}
.main:focus,
.main:focus-visible { outline: none; box-shadow: none; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -.025em; }
h1 { margin: 0 0 8px; font-size: 26px; }
h2 { margin: 1.8rem 0 .8rem; font-size: 16px; }
h3 { margin: 1.4rem 0 .6rem; font-size: 14px; }
p { margin: .55rem 0; }
pre {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  font: 12px/1.55 var(--mono);
}
code { font: 12px/1.5 var(--mono); color: #3d4d63; background: #f1f4f8; padding: 1px 4px; border-radius: 4px; }
.muted { color: var(--muted); }

/* Shell */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -2px; }
html, body { height: 100%; }
body { overflow: hidden; }
.app-shell {
  display: grid; grid-template-columns: 224px minmax(0, 1fr);
  height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
}
.sidebar {
  position: relative; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  background: var(--sidebar); color: #d4ddeb;
  scrollbar-gutter: stable;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 9px 19px; color: #fff; text-decoration: none; }
.sidebar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: #2f5ce5; color: #fff;
  font: 800 13px/1 var(--sans);
}
.brand-copy b { display: block; color: #fff; font-size: 12px; letter-spacing: .01em; }
.brand-copy span { display: block; color: var(--sidebar-muted); font: 11px/1.4 var(--mono); }
.workspace-switcher {
  margin: 0 4px 18px; padding: 9px 10px; border: 1px solid var(--sidebar-line); border-radius: 7px;
  background: #111d31; color: #d9e3f2;
}
.workspace-switcher small { display: block; color: var(--sidebar-muted); font: 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.workspace-switcher b { display: block; margin-top: 3px; font-size: 12px; }
.side-group { margin: 0 0 15px; }
.side-group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 10px 6px; color: var(--sidebar-label); cursor: pointer;
  font: 700 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  list-style: none;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::after {
  content: "+"; margin-right: 3px; color: currentColor; opacity: .65;
  font: 700 13px/1 var(--mono);
}
.side-group[open] > summary::after { content: "−"; }
.side-group > summary:hover { color: #d4ddeb; }
.side-label { padding: 0 10px 6px; color: var(--sidebar-label); font: 700 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 9px; min-height: 31px; padding: 6px 10px;
  border-radius: 6px; color: #aebbd0; text-decoration: none; font-size: 12px;
}
.side-nav a:hover { background: #17243a; color: #fff; text-decoration: none; }
.side-nav a.active { background: #18243a; color: #fff; }
.side-nav .icon { color: #8fa3c2; }
.side-nav a.active .icon { color: #a9c1ff; }
.side-nav .nav-count { margin-left: auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--sidebar-line); padding: 13px 9px 0; }
.sidebar-foot .viewer { display: flex; align-items: center; gap: 8px; color: #d4ddeb; }
.viewer-avatar { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: #233323; color: #c8ff5a; font: 800 11px var(--mono); }
.viewer-copy b { display: block; font-size: 12px; color: #e8eef7; }
.viewer-copy span { display: block; color: var(--sidebar-muted); font: 11px var(--mono); }
.sidebar-foot a { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--sidebar-muted); font: 11px var(--mono); text-decoration: none; }
.sidebar-foot a .icon { width: 12px; height: 12px; }
.sidebar-foot a:hover { color: #fff; }

.app-main {
  min-width: 0; min-height: 0; height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.topbar {
  position: sticky; top: 0; z-index: 20; height: 58px;
  display: flex; align-items: center; gap: 18px; padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
}
.crumb { color: var(--muted); font-size: 12px; white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 600; }
.top-search { display: flex; align-items: center; gap: 8px; width: min(360px, 36vw); margin-left: auto; }
.top-search input { width: 100%; height: 34px; min-height: 34px; padding: 0 10px; background: #f8fafc; }
.top-search input::placeholder { color: #6b7280; opacity: 1; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: 2px; }
.icon-link { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: #53637a; background: #fff; font-size: 11px; font-weight: 600; text-decoration: none; }
.icon-link:hover { border-color: var(--line-strong); background: #f8fafc; text-decoration: none; }
.icon-link .badge { position: absolute; top: -5px; right: -5px; }
.top-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e6ebf3; color: #33415a; font: 800 11px var(--mono); text-decoration: none; }
.main { max-width: 1440px; margin: 0 auto; padding: 26px 28px 54px; }
footer { max-width: 1440px; margin: 0 auto; padding: 0 28px 24px; color: var(--muted); font-size: 11px; }
footer a { color: var(--muted); }

/* Buttons and forms: one control height, one type scale, one font. */
button, .button,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
  min-height: var(--control-height);
  height: var(--control-height);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.3;
}
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 13px; border: 1px solid var(--accent); border-radius: 7px;
  background: var(--accent); color: var(--accent-ink); font-weight: 650;
  cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { filter: brightness(.96); text-decoration: none; }
button.secondary, .button.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.small { min-height: 30px; height: 30px; padding: 0 9px; font-size: 11px; }
input, select, textarea {
  width: auto; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: var(--ink);
  font-weight: 400;
}
input::placeholder, textarea::placeholder { color: #6b7280; opacity: 1; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%23596675' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 8px;
}
select::-ms-expand { display: none; }
option { font-family: var(--sans); font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; padding: 8px 10px; }
input[type="file"] {
  height: auto;
  min-height: var(--control-height);
  padding: 4px 6px;
  font-size: 12px;
}
input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 9px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: 600 12px var(--sans);
  cursor: pointer;
}
label { color: var(--muted); font-size: 11px; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; }
.filters > .inline-disclosure { flex: 1 1 100%; margin: 0; border-top: 0; }
.filters > .inline-disclosure > summary { padding: 2px 0 6px; }
.filters > .inline-disclosure .filters { margin-bottom: 0; }
.filters label.wide, .filters .wide { flex: 1 1 100%; }
.filter-title { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }

/* Page header */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-actions .button { white-space: nowrap; }
.page-lead { max-width: 72ch; margin: -8px 0 18px; color: var(--ink); font-size: 14px; line-height: 1.55; text-wrap: pretty; }
.page-lead:empty { display: none; }

/* Record facts, labels and in-page navigation */
.record-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 18px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.record-facts span { display: inline-flex; align-items: center; gap: 5px; }
.record-facts b { color: var(--ink); font-weight: 600; }
.record-labels { margin-top: 6px; }
.record-labels .tag { font-weight: 600; text-decoration: none; }
.record-labels .asset-tag { background: #edf2fb; color: #3b5477; }
.record-labels a.tag:hover { background: var(--accent-soft); color: var(--accent); }
.record-tabs {
  display: flex; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.record-tabs::-webkit-scrollbar { display: none; }
.record-tabs a {
  position: relative; display: inline-flex; align-items: center; min-height: 38px;
  padding: 0 11px; color: var(--muted); font-size: 12px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.record-tabs a:hover { color: var(--ink); text-decoration: none; }
.record-tabs a[aria-current="page"] { color: var(--ink); }
.record-tabs a[aria-current="page"]::after {
  content: ""; position: absolute; right: 9px; bottom: -1px; left: 9px;
  height: 2px; border-radius: 2px 2px 0 0; background: var(--accent);
}
@media (min-width: 901px) {
  .record-tabs {
    position: sticky; top: 58px; z-index: 12;
    background: var(--bg);
  }
}
.record-tabs .tab-count { color: var(--faint); font: 10px var(--mono); }
.record-panel[hidden] { display: none !important; }
.record-panel { animation: panel-in .16s ease-out; }
@keyframes panel-in { from { opacity: .35; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .record-panel { animation: none; } }
.panel-link { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 600; }
.panel-link:hover { color: var(--accent); }
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 9px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px;
}
.work-list li:last-child { border-bottom: 0; }
.work-list .work-title { min-width: 0; flex: 1 1 260px; color: var(--ink); font-weight: 500; }
.work-list .work-date { margin-left: auto; color: var(--faint); font: 11px var(--mono); }
.work-group { margin-top: 4px; }
.work-group + .work-group { margin-top: 18px; }
.work-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.work-group-head h3 { margin: 0 0 2px; }
.work-group-head a { color: var(--muted); font-size: 11px; font-weight: 600; }
.empty-state.compact { padding: 10px 0 2px; }
.empty-state.compact p { margin: 3px 0 8px; }
.page-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -8px 0 18px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.page-nav a { color: var(--muted); font-size: 11px; font-weight: 600; }
.page-nav a:hover { color: var(--accent); }
:target { scroll-margin-top: 78px; }
.field-help { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; font-weight: 400; line-height: 1.4; }

/* Cards, KPI and layout */
.panel {
  margin-bottom: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow);
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head .muted, .panel-head .panel-meta { margin-left: auto; color: var(--muted); font: 11px var(--mono); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .72fr); gap: 16px; align-items: start; }
.dashboard-grid > *, .two-col > * { min-width: 0; }
.stack > *, .side-stack > * { min-width: 0; }
.dashboard-grid .table-wrap { min-width: 0; }
.side-stack { display: grid; gap: 0; }
.quick-links { display: grid; gap: 1px; margin-top: 12px; border-top: 1px solid var(--line); }
.quick-links a { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; text-decoration: none; }
.quick-links a:hover { color: var(--accent); }
.quick-links span { color: var(--muted); font: 11px var(--mono); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 16px; }

/* Tables */
table.records {
  width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow);
}
table.records th {
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-soft);
  color: var(--muted); text-align: left; font: 700 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
table.records td { padding: 11px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; font-size: 13px; }
table.records tr:last-child td { border-bottom: 0; }
.panel .table-wrap table.records { border: 0; border-radius: 0; box-shadow: none; }
table.records tbody tr:hover td { background: #f8faff; }
table.records a { font-weight: 600; }
.record-id { color: var(--accent); font: 700 11px var(--mono); white-space: nowrap; }
.record-summary { max-width: 460px; color: var(--ink); font-weight: 600; }
.record-sub { margin-top: 2px; color: var(--faint); font-size: 12px; font-weight: 400; }
.status, .tag {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  padding: 3px 7px; border: 0; border-radius: 99px; background: #f0f3f7; color: #5d6b7d;
  font: 700 11px/1.3 var(--mono); letter-spacing: .02em; white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #8793a3; }
.status-concluded, .status-supported, .status-finished, .status-done, .status-resolved, .status-clean, .status-verified, .status-approved { background: var(--success-soft); color: var(--success); }
.status-concluded::before, .status-supported::before, .status-finished::before, .status-done::before, .status-resolved::before, .status-clean::before, .status-verified::before, .status-approved::before { background: #2f9b64; }
.status-open, .status-blocking, .status-running, .status-pending, .status-in_progress { background: var(--warning-soft); color: var(--warning); }
.status-open::before, .status-blocking::before, .status-running::before, .status-pending::before, .status-in_progress::before { background: #d8891c; }
.status-redacted, .status-failed, .status-closed, .status-rejected, .status-blocked { background: var(--danger-soft); color: var(--danger); }
.status-redacted::before, .status-failed::before, .status-closed::before, .status-rejected::before, .status-blocked::before { background: #df4b3e; }
.status-not_applicable, .status-cannot_assess, .status-applied { background: #f0f3f7; color: #5d6b7d; }
.status-cancelled { background: var(--warning-soft); color: var(--warning); }
.status-cancelled::before { background: #d8891c; }
.tag.finding-pass { background: var(--success-soft); color: var(--success); }
.tag.finding-concern { background: var(--warning-soft); color: var(--warning); }
.tag.finding-fail { background: var(--danger-soft); color: var(--danger); }
.tag.finding-not_applicable { color: #5d6b7d; }
.tag.finding-cannot_assess { border: 1px dashed var(--line-strong); background: transparent; }

/* Disclosures */
.disclosure { padding: 0; }
.disclosure > summary, .inline-disclosure > summary {
  display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none;
  padding: 14px 18px; color: var(--ink); font-weight: 700;
}
.disclosure > summary::-webkit-details-marker, .inline-disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before, .inline-disclosure > summary::before {
  content: "+"; color: var(--muted); font: 700 13px var(--mono); width: 12px;
}
.disclosure[open] > summary::before, .inline-disclosure[open] > summary::before { content: "−"; }
.disclosure > summary span:last-child { margin-left: auto; color: var(--muted); font: 11px var(--mono); }
.disclosure-body { padding: 0 18px 18px; }
.inline-disclosure { margin: 12px 0 4px; border-top: 1px solid var(--line); }
.inline-disclosure > summary { padding: 10px 0; font-size: 12px; }
.inline-disclosure form { padding-bottom: 8px; }
.technical { margin: 10px 0 18px; }
.technical > summary { cursor: pointer; color: var(--muted); font-size: 11px; }
.technical .meta { margin-bottom: 0; }

/* Details and content */
.breadcrumb { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.meta, .content {
  display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: 1px;
  margin: 14px 0 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--line); overflow: hidden; box-shadow: var(--shadow);
}
.meta dt, .meta dd, .content dt, .content dd { margin: 0; padding: 9px 12px; background: var(--panel); font-size: 13px; }
.meta dt, .content dt { color: var(--muted); font-weight: 600; }
.meta dd, .content dd { overflow-wrap: anywhere; }
.issue-body, .comment-body {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px;
}
.links, .comments, .suggestions, .worklogs, .notifications, .reviews, .findings, .team-rules { list-style: none; padding: 0; margin: 0; }
.links li, .comments li, .suggestion, .worklogs li, .notifications .notification, .review, .finding {
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.links li:last-child, .comments li:last-child, .suggestion:last-child, .worklogs li:last-child, .notifications .notification:last-child, .review:last-child, .finding:last-child { border-bottom: 0; }
.comments li, .notifications .notification { font-size: 12px; }
.notification.unread { padding-left: 10px; }
.notification h2 { margin: 3px 0; font-size: 12px; }
.notification-body { white-space: pre-wrap; }
.review-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.finding-responses { margin-top: 6px; }
.watchers { margin: 0 0 10px; }
.issue-actions { display: grid; gap: 12px; }
.issue-actions form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.issue-actions label { display: flex; flex-direction: column; gap: 4px; }
.suggestion h3 { margin: 8px 0 4px; font-size: 12px; }
.evidence { margin: 4px 0 8px; }
.diff-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; }
.diff-table th, .diff-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.diff-table th { background: var(--panel-soft); color: var(--muted); font: 700 11px var(--mono); text-transform: uppercase; }
.diff-table tr:last-child td { border-bottom: 0; }
.diff-table pre { border: 0; padding: 0; background: transparent; }

/* Notices */
.reminder, .warning, .dispute-banner, .dependency-banner, .marked-export {
  padding: 11px 13px; margin: 0 0 14px; border-radius: var(--radius-sm); font-size: 12px;
}
.reminder { border: 1px solid #e8cf8c; background: var(--warning-soft); color: #6f4d00; }
.warning { border: 1px solid #e8cf8c; background: var(--warning-soft); color: var(--warning); }
.dispute-banner { border: 1px solid #f5b5b5; background: var(--danger-soft); color: #8a1c14; }
.dependency-banner { border: 1px solid #e8cf8c; background: var(--warning-soft); color: #6f4d00; }
.marked-export { border: 1px solid #cbd8ff; background: var(--accent-soft); color: #4b5d82; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; padding: 2px 5px; border-radius: 99px; background: var(--danger); color: #fff; font: 700 11px/1.2 var(--mono); }
.badge-disputed { background: var(--danger-soft); color: var(--danger); }
.badge-dependency { background: var(--warning-soft); color: var(--warning); }

/* Work log and history */
.worklog-form input[type="text"], .worklog-form textarea { width: 100%; }
.worklog-form textarea { min-height: 80px; }
.worklogs li { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 12px; }
.worklogs a { font: 700 11px var(--mono); }
.worklogs .tag { margin-left: auto; }

/* Charts, artifacts, exports */
svg.chart { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 11px; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; }
.series-picker { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.series-option { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.series-option label { display: inline; color: var(--ink); font-size: 11px; }
.artifacts { width: 100%; border-collapse: collapse; font-size: 12px; }
.artifacts th, .artifacts td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.artifacts th { color: var(--muted); font: 700 11px var(--mono); text-transform: uppercase; }
.artifact-preview { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.artifact-text { max-height: 32rem; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.caveats { padding-left: 18px; }
.caveats li { margin: 8px 0; font-size: 12px; }
.findings-form textarea { width: 100%; }

/* Responsive */
@media (max-width: 1080px) {
  .dashboard-grid, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100vh; overflow: visible; }
  .app-main { height: auto; overflow: visible; }
  .sidebar { position: relative; height: auto; max-height: none; padding-bottom: 12px; }
  .side-group { display: inline-block; width: 32%; vertical-align: top; margin-right: 1%; }
  .side-nav a { padding: 5px 7px; }
  .sidebar-foot { margin-top: 12px; }
  .topbar { padding: 0 16px; }
  .main, footer { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 620px) {
  .side-group { display: block; width: auto; }
  .side-nav { display: flex; flex-wrap: wrap; }
  .side-nav a { min-height: 27px; }
  .side-label { margin-top: 8px; }
  .topbar { height: auto; min-height: 58px; flex-wrap: wrap; gap: 8px; padding-top: 9px; padding-bottom: 9px; }
  .crumb { width: 100%; }
  .top-search { width: 100%; margin-left: 0; order: 4; }
  .top-actions { margin-left: auto; }
  .page-head { display: block; }
  .page-actions { margin-top: 12px; }
}

/* Compact action rows */
.issue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.issue-actions form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.issue-actions > .button { justify-self: start; }

/* Mobile shell: prevent clipped navigation and horizontal overflow */
@media (max-width: 620px) {
  html, body { overflow-x: hidden; }
  .sidebar {
    position: relative; display: block; height: auto; max-height: none;
    overflow-x: auto; overflow-y: hidden; padding: 10px 12px 8px;
  }
  .sidebar .brand { padding: 0 2px 9px; }
  .workspace-switcher, .side-label, .sidebar-foot { display: none; }
  .side-group { display: inline-block; width: auto; margin: 0 14px 0 0; vertical-align: top; }
  .side-nav { display: flex; flex-wrap: nowrap; gap: 2px; }
  .side-nav a { min-width: max-content; padding: 6px 8px; min-height: 28px; white-space: nowrap; }
  .side-nav a .nav-count { flex: none; }
}

@media (max-width: 620px) {
  .app-main, .main { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .dashboard-grid, .two-col, .page-head, .panel { min-width: 0; max-width: 100%; }
  table.records { display: block; width: 100%; min-width: 0; overflow-x: auto; white-space: nowrap; }
  .table-wrap { max-width: 100%; overflow-x: auto; }
  .page-actions { gap: 6px; }
  .page-actions .button { flex: 1 1 auto; text-align: center; }
  .page-actions { display: grid; grid-template-columns: 1fr; }
  .page-actions .button { width: 100%; }
}

/* Standard form layout for creation and decision forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: start;
  margin: 0;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.form-grid input,
.form-grid select,
.form-grid textarea { width: 100%; min-width: 0; }
.form-grid textarea { min-height: 70px; }
.form-grid .col-1 { grid-column: span 1; }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-3 { grid-column: span 3; }
.form-grid .col-4 { grid-column: span 4; }
.form-grid .col-5 { grid-column: span 5; }
.form-grid .col-6 { grid-column: span 6; }
.form-grid .col-7 { grid-column: span 7; }
.form-grid .col-8 { grid-column: span 8; }
.form-grid .col-9 { grid-column: span 9; }
.form-grid .col-10 { grid-column: span 10; }
.form-grid .col-12 { grid-column: 1 / -1; }
.form-grid .checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding-top: 19px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
}
.form-grid .checkbox input { width: auto; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.form-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; text-wrap: pretty; }

/* Purpose selector: readable rows, never the inline filter layout */
.token-form { max-width: 1040px; width: 100%; }
.token-form-note { max-width: 1040px; }
.purpose-options {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}
.purpose-options legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.form-grid .purpose-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.form-grid .purpose-option + .purpose-option { margin-top: 7px; }
.form-grid .purpose-option:hover { border-color: var(--line-strong); background: var(--panel); }
.form-grid .purpose-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.form-grid .purpose-option:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.purpose-option input[type="radio"] { margin: 2px 0 0; accent-color: var(--accent); }
.purpose-copy { display: grid; gap: 2px; min-width: 0; }
.purpose-copy strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.purpose-copy span { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; text-wrap: pretty; }
.purpose-copy code { color: var(--ink); background: var(--panel); }
.form-section { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); margin-bottom: 16px; }
.form-section > h2:first-child { margin-top: 0; }

/* Response rows and findings */
.finding-responses { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.finding-responses > strong { display: block; margin-bottom: 8px; font-size: 12px; }
.response-form {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}
.response-form label { display: flex; flex-direction: column; gap: 4px; }
.response-form input, .response-form select { width: 100%; }
.findings { display: grid; gap: 12px; }
.finding {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.finding > div:first-child { margin-bottom: 7px; }
.finding .evidence { margin: 7px 0; }
.finding-responses ul { margin: 6px 0 0; padding-left: 18px; }

/* Notifications as cards */
.notifications { display: grid; gap: 10px; }
.notifications .notification {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.notifications .notification.unread {
  border-color: var(--accent);
  padding-left: 13px;
}
.notifications .notification h2 { margin: 3px 0 5px; font-size: 13px; }
.notifications .notification form { margin-top: 9px; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .col-1, .form-grid .col-2, .form-grid .col-3, .form-grid .col-4,
  .form-grid .col-5, .form-grid .col-6, .form-grid .col-7, .form-grid .col-8,
  .form-grid .col-9, .form-grid .col-10, .form-grid .col-12 { grid-column: 1 / -1; }
  .response-form { grid-template-columns: 1fr; }
}

/* Keep legacy inline filter/action forms aligned and consistent */
.filters { align-items: end; }
.filters label { flex: 0 1 220px; min-width: 0; }
.filters label.wide { flex: 1 1 100%; }
.filters input, .filters select, .filters textarea { width: 100%; min-width: 0; }
.filters label:has(input[type="checkbox"]) {
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding-bottom: 8px;
}
.filters button { flex: 0 0 auto; }
.form-section > p:last-child { margin-bottom: 0; }

/* File inputs and action cards */
input[type="file"] {
  padding: 6px;
  background: var(--panel-soft);
  font-size: 11px;
}
input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: 600 11px var(--sans);
  cursor: pointer;
}
.issue-actions form { flex: 0 1 auto; }
.issue-actions form button { margin-top: 2px; }

/* More semantic state chips */
.status-active, .status-ready, .status-succeeded, .status-pass { background: var(--success-soft); color: var(--success); }
.status-active::before, .status-ready::before, .status-succeeded::before, .status-pass::before { background: #2f9b64; }
.status-published { background: var(--success-soft); color: var(--success); }
.status-published::before { background: #2f9b64; }
.status-checking { background: var(--warning-soft); color: var(--warning); }
.status-checking::before { background: #d8891c; }
.status-removed, .status-external { background: var(--surface-muted, #f1f3f6); color: var(--muted); }
.status-removed::before, .status-external::before { background: var(--muted); }
.status-draft, .status-submitted, .status-locked, .status-acknowledged { background: #eef2ff; color: #3454b3; }
.status-draft::before, .status-submitted::before, .status-locked::before, .status-acknowledged::before { background: #5d7fe0; }
.status-concerns, .status-concern { background: var(--warning-soft); color: var(--warning); }
.status-concerns::before, .status-concern::before { background: #d8891c; }
.status-fail, .status-expired, .status-disabled { background: var(--danger-soft); color: var(--danger); }
.status-fail::before, .status-expired::before, .status-disabled::before { background: #df4b3e; }

/* Checkboxes should never inherit text-input width */
input[type="checkbox"], input[type="radio"] { width: auto; flex: none; }
.filters input[type="checkbox"], .filters input[type="radio"] { width: auto; }
.series-option {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}
.series-option input { margin: 0; }

.worklogs-page { display: grid; gap: 0; }
.worklogs-page li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 5px 14px;
  align-items: baseline;
  padding: 13px 0;
}
.worklogs-page .worklog-date { font: 700 11px var(--mono); color: var(--accent); }
.worklogs-page .worklog-main strong { display: block; font-size: 12px; }
.worklogs-page .worklog-main .record-id { display: inline-block; margin-top: 3px; font-size: 11px; }
.worklogs-page .worklog-extra { grid-column: 2 / -1; color: var(--muted); font-size: 11px; }
.worklogs-page .worklog-extra span { display: block; margin-top: 2px; }
@media (max-width: 620px) {
  .worklogs-page li { grid-template-columns: 1fr auto; }
  .worklogs-page .worklog-date { grid-column: 1 / -1; }
  .worklogs-page .worklog-extra { grid-column: 1 / -1; }
}


/* Keep tables usable below the wide-desktop breakpoint */
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap table.records { min-width: 760px; }
.table-wrap table.records.activity-table { min-width: 0; }
.mono-sm { font: 11px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.cell-stack { display: grid; gap: 3px; min-width: 140px; }
.raw-record { margin: 18px 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.raw-record summary { padding: 10px 13px; color: var(--muted); cursor: pointer; font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.raw-record pre { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

/* Only filter/utility buttons are secondary by default; form-grid actions stay primary */
.filters button { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.filters button:hover { background: var(--panel-soft); filter: none; }
.issue-actions button { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.issue-actions form[action$="/resolve"] button,
.issue-actions form[action$="/accept"] button { background: var(--accent); color: #fff; border-color: var(--accent); }
.issue-actions form[action$="/close"] button,
.issue-actions form[action$="/decline"] button { background: var(--danger-soft); color: var(--danger); border-color: #f5b5b5; }
.notifications .notification form button { min-height: 26px; padding: 3px 8px; background: #fff; color: var(--ink); border-color: var(--line-strong); font-size: 11px; }

@media (max-width: 1200px) {
  table.records {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
  table.records td, table.records th { white-space: nowrap; }
  table.records td:not(:last-child) { overflow-wrap: normal; }
  .artifacts { display: block; width: 100%; max-width: 100%; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 620px) {
  table.records th:nth-child(5), table.records td:nth-child(5) { display: table-cell; }
  .side-nav a, .top-actions a, .button, button,
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select { min-height: 44px; height: 44px; }
  textarea { min-height: 88px; }
  .side-nav a { min-height: 40px; }
  .topbar { position: sticky; }
}

.status-revoked { background: var(--danger-soft); color: var(--danger); }
.status-revoked::before { background: #df4b3e; }
.review-counts { margin-top: 7px; color: var(--muted); font-size: 11px; }

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 10px;
}
.search-advanced { margin: -8px 0 10px; }
.search-advanced > summary { padding-top: 6px; }
.empty-state {
  padding: 28px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-soft);
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 13px; }
.empty-state p { margin: 0 0 12px; font-size: 12px; }

@media (max-width: 620px) {
  html, body { overflow-x: clip; }
  .app-main, .main { overflow-x: clip; }
  .topbar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    height: auto;
    padding: 10px 14px;
  }
  .topbar .crumb { grid-column: 1; grid-row: 1; width: auto; white-space: normal; }
  .topbar .top-actions { grid-column: 2; grid-row: 1; margin-left: 0; }
  .topbar .top-search { grid-column: 1 / -1; grid-row: 2; width: 100%; margin-left: 0; order: 0; }
  .sidebar { scrollbar-width: thin; }
  .sidebar::-webkit-scrollbar { height: 5px; }
  .sidebar::-webkit-scrollbar-thumb { background: #26364f; border-radius: 99px; }
}

/* Mobile navigation drawer */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle:focus-visible { outline: none; box-shadow: none; }
@media (min-width: 901px) { .nav-toggle { display: none; } }
.nav-toggle-label, .nav-close { display: none; }
@media (max-width: 900px) {
  .nav-toggle-label {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 7px;
    background: #fff; color: var(--ink); cursor: pointer;
  }
  .nav-toggle:focus-visible + .app-shell .nav-toggle-label,
  .nav-toggle:checked:focus-visible + .app-shell .nav-close {
    outline: 2px solid var(--focus); outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff;
  }
  .nav-toggle:checked:focus-visible + .app-shell .nav-close {
    outline-color: var(--focus-dark); box-shadow: 0 0 0 2px var(--sidebar);
  }
  .sidebar { display: none; }
  .nav-toggle:checked + .app-shell .sidebar {
    display: flex; position: fixed; inset: 0; z-index: 80; width: 100%; height: 100vh; height: 100dvh;
    overflow-y: auto; padding: 16px 16px max(22px, env(safe-area-inset-bottom));
  }
  .nav-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 14px; width: 44px; height: 44px;
    border: 1px solid var(--sidebar-line); border-radius: 7px; color: #d4ddeb;
    line-height: 1; cursor: pointer;
  }
  .nav-toggle:checked + .app-shell .app-main { visibility: hidden; }
  body:has(#nav-toggle:checked) { overflow: hidden; }
  .nav-toggle:checked + .app-shell .sidebar .side-group { display: block; width: 100%; }
  .nav-toggle:checked + .app-shell .sidebar .side-group > summary { width: 100%; }
  .nav-toggle:checked + .app-shell .sidebar .side-label { display: block; }
  .nav-toggle:checked + .app-shell .sidebar .side-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .nav-toggle:checked + .app-shell .sidebar .sidebar-foot { display: block; }
  .topbar .nav-toggle-label { grid-column: 1; grid-row: 1; justify-self: start; }
  .topbar .crumb { grid-column: 2; grid-row: 1; }
  .topbar .top-actions { grid-column: 3; grid-row: 1; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .topbar .top-search { grid-column: 1 / -1; grid-row: 2; }
  .doc-section, .doc-body :where(h2, h3, h4), .doc-body [id], .guide-tabs { scroll-margin-top: 132px; }
}

.record-content dd { min-width: 0; }
.result-summary { display: grid; gap: 8px; }
.result-summary p { margin: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; margin: 4px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--line); }
.metric-grid div { padding: 8px 10px; background: var(--panel-soft); }
.metric-grid dt { color: var(--muted); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.metric-grid dd { margin: 3px 0 0; padding: 0; background: transparent; font-size: 16px; font-weight: 650; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.result-summary .raw-record { margin-top: 4px; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 1.8rem 0 .8rem; }
.section-heading h2 { margin: 0; }
.response-disclosure { margin-top: 9px; border-top: 1px solid var(--line); padding-top: 8px; }
.response-disclosure summary { color: var(--muted); cursor: pointer; font: 700 11px var(--mono); letter-spacing: .05em; }
.response-disclosure[open] summary { margin-bottom: 6px; }

.artifact-pdf {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}
.preview-table { margin: 0; }
.preview-table td, .preview-table th { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* Searchable in-app guide */
.guide-search { margin-bottom: 8px; }
.guide-search label.wide { flex: 1 1 420px; }
.guide-summary { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; }
.docs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.docs-toc {
  position: sticky; top: 78px; grid-column: 2; grid-row: 1; padding: 14px 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow);
}
.docs-toc .side-label { margin: 0 0 8px; color: var(--muted); }
.docs-toc nav { display: grid; gap: 2px; }
.docs-toc a { padding: 6px 7px; border-radius: 5px; color: var(--muted); font-size: 12px; }
.docs-toc a:hover { background: var(--panel-soft); color: var(--accent); text-decoration: none; }
.docs-toc-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--faint); font: 11px/1.5 var(--mono); }
.docs-content { grid-column: 1; grid-row: 1; min-width: 0; }
.doc-intro { max-width: none; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #d3dcf5; background: var(--accent-soft); border-radius: var(--radius-sm); font-size: 15px; line-height: 1.7; }
.doc-intro p { margin: 8px 0; text-wrap: pretty; }
.doc-intro p:first-child { margin-top: 0; }
.doc-intro p:last-child { margin-bottom: 0; }
.doc-section { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.doc-section:last-child { margin-bottom: 0; }
.doc-section-heading { display: flex; align-items: baseline; gap: 10px; }
.doc-section-heading h2 { margin: 0 0 12px; }
.doc-anchor { color: var(--faint); font: 12px var(--mono); opacity: 0; }
.doc-section:hover .doc-anchor, .doc-anchor:focus { opacity: 1; }
.doc-body { max-width: none; color: var(--ink); font-size: 15px; line-height: 1.7; }
.doc-body h3 { margin-top: 20px; font-size: 16px; }
.doc-body p { margin: 8px 0; text-wrap: pretty; }
.doc-body ul, .doc-body ol { margin: 8px 0; padding-left: 22px; }
.doc-body li { margin: 4px 0; text-wrap: pretty; }
.doc-body pre { margin: 10px 0; }
.doc-body pre code { padding: 0; background: transparent; }
.doc-body table { width: 100%; margin: 10px 0; border-collapse: collapse; border: 1px solid var(--line); font-size: 13px; }
.doc-body th, .doc-body td { padding: 7px 9px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-body th { background: var(--panel-soft); color: var(--muted); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.doc-body tr:last-child td { border-bottom: 0; }
.doc-body td:last-child, .doc-body th:last-child { border-right: 0; }
.doc-body blockquote { margin: 10px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); background: var(--panel-soft); }
.doc-body hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.doc-section, .doc-body :where(h2, h3, h4), .doc-body [id], .guide-tabs { scroll-margin-top: 86px; }
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; justify-content: stretch; }
  .docs-toc, .docs-content { grid-column: auto; grid-row: auto; }
  .docs-toc { position: static; }
  .docs-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) { .docs-toc .side-label { display: block; } }

.guide-tabs { display: flex; gap: 4px; margin: -6px 0 18px; border-bottom: 1px solid var(--line); }
.guide-tabs a { padding: 9px 12px 8px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.guide-tabs a:hover { color: var(--accent); text-decoration: none; }
.guide-tabs a.active { border-bottom-color: var(--accent); color: var(--ink); }

.state-events { list-style: none; display: grid; gap: 7px; margin: 0; padding: 0; }
.state-events li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.state-events li:last-child { border-bottom: 0; }
.state-events .status { margin-right: 5px; }

.strategy-context-list { list-style: none; display: grid; gap: 8px; margin: 0 0 16px; padding: 0; }
.strategy-context-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.strategy-context-list li:last-child { border-bottom: 0; }
.strategy-context-list li form { margin-left: auto; }

/* Compact mobile activity list */
@media (max-width: 620px) {
  .activity-table { display: block; min-width: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; white-space: normal; }
  .activity-table thead { display: none; }
  .activity-table tbody { display: grid; gap: 8px; }
  .activity-table tr { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
  .activity-table td { display: block; padding: 0; border: 0; font-size: 13px; }
  .activity-table td:nth-child(1) { grid-column: 1; }
  .activity-table td:nth-child(2) { grid-column: 2; text-align: right; color: var(--muted); font-size: 11px; }
  .activity-table td:nth-child(3) { grid-column: 1 / -1; font-weight: 600; }
  .activity-table td:nth-child(4) { grid-column: 1; }
  .activity-table td:nth-child(5) { grid-column: 2; text-align: right; }
}

/* Mobile card fallback for dense tables */
@media (max-width: 620px) {
  table.mobile-cards { display: block; min-width: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; white-space: normal; }
  table.mobile-cards thead { display: none; }
  table.mobile-cards tbody { display: grid; gap: 8px; }
  table.mobile-cards tr { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
  table.mobile-cards td { display: grid; grid-template-columns: minmax(92px, 34%) 1fr; gap: 8px; padding: 0; border: 0; font-size: 13px; }
  table.mobile-cards td::before { content: attr(data-label) ': '; color: var(--muted); font: 700 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
  table.mobile-cards td:not([data-label])::before { content: none; }
}
@media (max-width: 620px) {
  table.mobile-cards td:not([data-label]) { display: block; grid-column: 1 / -1; margin-top: 4px; }
  table.mobile-cards td:not([data-label]) form { display: inline-block; }
}
@media (max-width: 620px) {
  table.mobile-cards td { grid-template-columns: minmax(92px, 36%) minmax(0, 1fr); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
  table.mobile-cards td::before { min-width: 0; overflow-wrap: anywhere; }
  table.mobile-cards td > * { min-width: 0; }
}
@media (max-width: 620px) {
  table.records.mobile-cards td,
  table.records.mobile-cards th { white-space: normal; }
}
@media (max-width: 620px) {
  .table-wrap table.records.mobile-cards { min-width: 0; width: 100%; }
}

/* Mobile hardening: readable cards, stacked record grids, no page-level table overflow */
@media (max-width: 620px) {
  .table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
  .table-wrap table.records.activity-table { width: 100%; min-width: 0; }
  table.records.activity-table,
  table.records.activity-table th,
  table.records.activity-table td { white-space: normal; }
  table.records.activity-table .record-summary { max-width: none; overflow-wrap: anywhere; }
  .meta, .content { grid-template-columns: minmax(0, 1fr); }
  .meta dt, .content dt { background: var(--panel-soft); }
  table { max-width: 100%; }
  .doc-body table, .diff-table, .artifacts {
    display: block; width: 100%; max-width: 100%; overflow-x: auto; white-space: nowrap;
  }
  .doc-body th, .doc-body td { white-space: normal; }
  table.records td a { display: inline; min-height: 0; overflow-wrap: anywhere; }
  table.records td button, table.records td .button { min-height: 44px; }
  .top-search input { font-size: 16px; }
}

/* Nested technical/verdict metadata should read as a definition list, not another card. */
.plain-meta { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.plain-meta dt, .plain-meta dd { background: transparent; }
.plain-meta dt { padding-left: 0; }
.plain-meta dd { padding-right: 0; }
.review-counts { font-size: 12px; }
.team-rule { padding: 16px 18px; }
.team-rule .meta { margin-bottom: 12px; }
.result-summary .metric-grid { border: 0; background: transparent; box-shadow: none; }
.content dd, .meta dd, .result-summary p { text-wrap: pretty; }
#verdict .panel-head h2 { text-wrap: balance; }
.page-head p { text-wrap: pretty; }


/* Public sign-in gate */
.landing-page {
  background: var(--sidebar);
  color: #f4f7fb;
  overflow: hidden;
}
.landing-page ::selection { background: var(--accent); color: #fff; }
.landing-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 4vh, 42px);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px;
}
.landing-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.landing-name {
  margin: 0;
  color: #f4f7fb;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.015em;
  text-align: center;
}
.landing-google {
  width: 18px;
  height: 18px;
  flex: none;
}
.landing-logo {
  display: block;
  width: clamp(96px, 12vw, 140px);
  height: auto;
}
.landing-signin {
  min-width: 148px;
  height: 44px;
  min-height: 44px;
  gap: 10px;
  padding: 0 18px;
  border-color: #f4f7fb;
  background: #f4f7fb;
  color: var(--sidebar);
  font-size: 13px;
}
.landing-signin:hover {
  border-color: #fff;
  background: #fff;
  filter: none;
}
.landing-page :where(a, button):focus-visible {
  outline-color: var(--focus-dark);
  box-shadow: 0 0 0 2px var(--sidebar);
}
@media (max-width: 620px) {
  .landing-logo { width: 104px; }
  .landing-gate { gap: 28px; }
}
@media (max-height: 500px) {
  .landing-gate { gap: 20px; }
  .landing-logo { width: 88px; }
}

/* Token copy control */
.token-copy { display: flex; align-items: stretch; gap: 8px; }
.token-copy pre { flex: 1 1 auto; min-width: 0; }
.copy-button {
  width: 42px;
  min-width: 42px;
  height: auto;
  min-height: 42px;
  padding: 0;
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--muted);
}
.copy-button:hover { border-color: var(--line-strong); background: var(--panel-soft); filter: none; color: var(--ink); }
.copy-button.copied { border-color: var(--success); color: var(--success); }
.copy-button.copy-failed { border-color: var(--danger); color: var(--danger); }
.copy-button .icon { width: 18px; height: 18px; }

/* Copy control for code and JSON blocks */
.copy-block { position: relative; }
.copy-block > pre { padding-right: 44px; }
.copy-block .copy-block-button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  background: var(--panel);
}
.copy-block .copy-block-button .icon { width: 15px; height: 15px; }
.doc-body .copy-block { margin: 10px 0; }
.doc-body .copy-block > pre { margin: 0; }
.diff-table .copy-block > pre { padding-right: 30px; }
.copy-inline-button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin-left: 3px;
  padding: 0;
  vertical-align: middle;
  border-color: var(--line);
  background: transparent;
  color: var(--faint);
}
.copy-inline-button .icon { width: 13px; height: 13px; }

/* Approval ergonomics: checks, required questions and the annotation digest. */
.status-passed { background: var(--success-soft); color: var(--success); }
.status-passed::before { background: #2f9b64; }
.status-not_checked { background: #f0f3f7; color: #5d6b7d; }
.status-withdrawn { background: var(--danger-soft); color: var(--danger); }
.status-withdrawn::before { background: #df4b3e; }
/* Change-set approval story */
.story-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 16px;
}
.story-scope {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font: 600 11px var(--mono);
}
.story-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.story-count {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}
.story-count b { color: var(--ink); }
.story-inputs { margin: 0 0 18px; }
.story-inputs h3 { margin: 0 0 8px; font-size: 13px; }
.story-hash { word-break: break-all; font-size: 11px; }
.story-chain { display: grid; gap: 10px; }
.story-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  position: relative;
}
.story-card:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 29px;
  bottom: -10px;
  width: 1px;
  background: var(--line-strong);
}
.story-marker {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: 700 11px var(--mono);
  position: relative;
  z-index: 1;
}
.story-box {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.story-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.story-head h3 { margin: 2px 0 0; font-size: 14px; }
.story-kind { color: var(--muted); font: 600 10px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.story-provides { flex: 0 0 auto; color: var(--ink); background: var(--panel-soft); }
.story-fields {
  display: grid;
  grid-template-columns: minmax(100px, 160px) minmax(0, 1fr);
  gap: 5px 12px;
  margin: 11px 0 0;
  font-size: 12px;
}
.story-fields dt { color: var(--muted); font-weight: 600; }
.story-fields dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.story-uses { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.story-uses span { font-weight: 600; }
.story-uses code { background: var(--panel-soft); }
.story-children { display: grid; gap: 10px; margin: 12px 0 0 3px; padding-left: 14px; border-left: 1px solid var(--line-strong); }
.story-card-child { grid-template-columns: 24px minmax(0, 1fr); }
.story-card-child .story-marker { width: 23px; height: 23px; font-size: 10px; }
.story-card-child:not(:last-child)::before { left: 11px; top: 25px; }
.story-exact { margin-top: 11px; }
.story-exact summary { color: var(--muted); cursor: pointer; font: 700 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.story-exact pre { margin: 8px 0 0; max-height: 280px; overflow: auto; }

@media (max-width: 700px) {
  .story-card, .story-card-child { grid-template-columns: 24px minmax(0, 1fr); }
  .story-card:not(:last-child)::before { left: 11px; }
  .story-fields { grid-template-columns: 1fr; gap: 2px; }
  .story-fields dd { margin-bottom: 5px; }
}
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.check-list > li { padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.check-list > li p { margin: 4px 0 0; }
.check-list.questions > li { background: #fbfcfe; }
.digest-actions { display: grid; gap: 8px; min-width: 220px; }
.digest-actions form { display: grid; gap: 6px; }
.prose { max-width: 78ch; line-height: 1.6; }
