/* UI3: the approved blue/white workbench, shared by every real task surface.
   This file owns presentation only. Semantic states keep their existing labels. */
body {
  background: radial-gradient(ellipse 75% 620px at 90% 130px, #e8f2ff 0%, transparent 80%),
    linear-gradient(180deg, #f8fbff 0, #f5f9ff 760px, #ffffff 1500px);
  background-repeat: no-repeat;
}
.site-header {
  position: relative;
  z-index: 20;
  width: 100%;
  min-height: 76px;
  padding: 10px max(24px, calc((100% - var(--content)) / 2));
  gap: 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.brand { gap: 10px; flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 0; overflow: visible; }
.brand strong { font-size: 20px; letter-spacing: -.035em; font-weight: 750; }
.brand small { font-size: 10px; letter-spacing: .02em; }
.site-header > nav { flex: 1; justify-content: flex-start; gap: 4px; margin-left: 24px; }
.site-header nav a { padding: 10px 13px; border-radius: 7px; font-size: 13px; font-weight: 550; }
.site-header > nav a[aria-current=page] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 -2px var(--accent); }
.site-header nav a:hover { background: var(--paper); color: var(--accent-dark); }
.header-note { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mobile-navigation { display: none; }
.heading-accent { color: var(--accent); }
.eyebrow { font-size: 11px; letter-spacing: .1em; color: #4c6489; }
a, button, input, select, textarea, summary { touch-action: manipulation; }
button, .primary-button, .secondary-button, .copy-button, .text-action, .file-action { transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
.primary-button, .tc-review-button { background: var(--accent); border: 1px solid var(--accent); color: #fff; box-shadow: 0 3px 8px #1556f018, inset 0 1px #ffffff20; border-radius: 8px; }
.primary-button:hover, .tc-review-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.secondary-button, .copy-button, .tc-actions button { border-color: var(--line); border-radius: 8px; background: #fff; }
.secondary-button:hover, .copy-button:hover, .tc-actions button:hover { background: var(--accent-soft); border-color: #b4c9f3; }
.text-action, .file-action { text-decoration: none; color: var(--accent-dark); }
.text-action:hover, .file-action:hover { text-decoration: underline; }
textarea, input:not([type=checkbox]):not([type=radio]), select { border-color: var(--line-strong); border-radius: 8px; }
textarea { background: #fbfdff; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); outline: 3px solid #1556f022; }
:focus-visible { outline: 3px solid #1556f066; outline-offset: 3px; }

/* The first screen is the task. The right panel is pending, never a fake result. */
.diagnostic-workspace { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 18px 24px; align-items: start; padding-top: 28px; }
.diagnostic-workspace > .diagnostic-intro { grid-column: 1; grid-row: 1; display: block; padding: 0; }
.diagnostic-workspace .intro-copy { max-width: none; }
.diagnostic-intro h1 { max-width: 20ch; font-size: clamp(34px, 3.55vw, 48px); font-weight: 730; letter-spacing: -.045em; line-height: 1.07; margin-top: 8px; }
.diagnostic-intro .lede { font-size: 15px; line-height: 1.5; margin-top: 10px; }
.diagnostic-intro .intro-privacy { font-size: 11px; margin-top: 7px; }
.diagnostic-workspace > .workbench { grid-column: 1; grid-row: 2; display: block; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: visible; }
.workbench form { padding: 18px; }
.workbench .field-head { gap: 12px; align-items: center; }
.workbench .field-head label { font-size: 16px; }
.workbench .field-head p { font-size: 12px; margin-top: 3px; color: var(--ink-soft); }
.workbench .field-head .text-action { white-space: nowrap; font-size: 12px; }
#evidence { min-height: 120px; font-size: 13px; background: #fbfdff; border-color: #bacbe3; }
.category-group { margin-top: 9px; }
.category-group legend { font-size: 12px; color: var(--ink-soft); margin-bottom: 5px; }
.choices { gap: 5px; }
.choice span { border-radius: 6px; padding: 8px 10px; font-size: 12px; font-weight: 550; border-color: var(--line); }
.choice input:checked + span { background: var(--accent-soft); color: var(--accent-dark); border-color: #a8bff0; box-shadow: inset 0 0 0 1px #1556f033; }
.primary-actions { margin-top: 12px; }
.workbench .primary-actions > .primary-button { flex: 1; }
.workbench .primary-actions > .secondary-button { font-size: 12px; padding-inline: 12px; }
.privacy-note { line-height: 1.55; font-size: 11px; }
.diagnostic-workspace > .result-region { grid-column: 2; grid-row: 1 / span 2; min-width: 0; margin-top: 0; }
.diagnostic-workspace > .result-example { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: clip; }
.workspace-empty { padding: 24px; }
.workspace-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.neutral-status { font: 11px var(--mono); color: var(--muted); padding: 5px 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.workspace-empty h2 { font-size: clamp(25px, 2.6vw, 34px); line-height: 1.13; letter-spacing: -.035em; margin-top: 28px; font-weight: 700; }
.workspace-empty-intro { margin-top: 14px; font-size: 14px; color: var(--ink-soft); max-width: 43ch; }
.workspace-preview-rows { border: 1px solid var(--line); border-radius: 10px; margin-top: 23px; overflow: clip; }
.workspace-preview-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; font-size: 12px; }
.workspace-preview-rows > div + div { border-top: 1px solid var(--line); }
.workspace-preview-rows dt { color: var(--ink-soft); }
.workspace-preview-rows dd { text-align: right; color: var(--muted); font-size: 11px; }
.workspace-empty .workbench-guide { border: 0; background: transparent; padding: 24px 0 0; }
.workspace-empty .workbench-guide ol { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.workspace-empty .workbench-guide li { border: 0; padding: 0; }
.workspace-empty .workbench-guide li::before { display: none; }
.workspace-empty .workbench-guide span { font-size: 12px; }
.workspace-empty .workbench-guide small { font-size: 11px; line-height: 1.5; }
.workspace-empty .guide-stop { font-size: 11px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.result-example > .worked-example { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: #f8fbff; }
.worked-example > summary { min-height: 82px; }
.worked-example > summary strong { font-size: 15px; }
.worked-example > summary small { font-size: 11px; }
.worked-example > summary::after { width: 28px; height: 28px; border-radius: 6px; border-color: var(--line); }
.worked-example-checkpoint { border-color: var(--line); background: #fff; font-size: 10px; }
.worked-example-body { background: #fff; }
.worked-example-output { grid-template-columns: 1fr; }
.diagnostic-workspace > .request-recovery, .diagnostic-workspace > .draft-change-notice { grid-column: 1 / -1; grid-row: auto; margin-top: 0; }

/* Real results keep their full actions and evidence, with compact workbench density. */
.diagnosis-card { border-color: var(--line); box-shadow: var(--shadow); border-radius: 16px; background: #fff; }
.diagnostic-workspace .diagnosis-card { margin-top: 0; }
.diagnostic-workspace .diagnosis-header { flex-direction: column; padding: 22px; gap: 12px; }
.diagnostic-workspace .diagnosis-header h2 { font-size: clamp(25px, 2.5vw, 32px); }
.diagnostic-workspace .result-badges { justify-content: flex-start; }
.diagnostic-workspace .result-summary { padding: 16px 22px; font-size: 15px; }
.diagnostic-workspace .next-check-card { padding: 20px; margin-top: 16px; border-color: #bdd1f8; background: #f0f5ff; }
.diagnostic-workspace .next-check-head { flex-direction: column; gap: 10px; }
.diagnostic-workspace .next-check-head h3 { font-size: 22px; line-height: 1.25; }
.diagnostic-workspace .next-check-scope { text-align: left; justify-items: start; }
.diagnostic-workspace .next-check-outcomes { grid-template-columns: 1fr; }
.diagnostic-workspace .next-check-command { grid-template-columns: minmax(0, 1fr); }
.diagnostic-workspace .next-check-command p { grid-column: 1; }
.diagnostic-workspace .chain-list, .diagnostic-workspace .decision-trace-grid, .diagnostic-workspace .cause-grid { grid-template-columns: 1fr; }
.diagnostic-workspace .why-block { grid-template-columns: 1fr; gap: 8px; }
.diagnostic-workspace .save-block, .diagnostic-workspace .verify-block { flex-direction: column; align-items: stretch; }
.diagnostic-workspace .action-step-summary { padding: 14px 20px; gap: 10px; }
.diagnostic-workspace .action-step-body { padding: 0 20px 20px; }
.diagnostic-workspace .action-rail-button { padding-inline: 8px; font-size: 11px; }
.diagnostic-workspace .action-rail { position: relative; top: auto; }
.diagnostic-workspace .evidence-grid, .diagnostic-workspace .evidence-meta, .diagnostic-workspace .recheck-fields { grid-template-columns: 1fr; }
.diagnostic-workspace .recheck-fields label { grid-column: auto; }
.diagnostic-workspace .next-check-card, .diagnostic-workspace .supporting-evidence { margin-inline: 0; }
.resolution-workspace, .comparison-conditions, .resolution-steps { background: var(--paper-deep); }
.resolution-workspace, .request-recovery, .draft-change-notice, .attempt-timeline, .support-boundary { border-color: var(--line); box-shadow: none; }
.request-recovery { border-left-color: var(--warning); }
.context-panel, .first-screen-boundary, .same-task-comparison { border-color: var(--line); }
.first-screen-boundary, .same-task-comparison { background: #f8fbff; }
.dialog { border: 1px solid var(--line); box-shadow: 0 24px 90px #10244833; }
.dialog::backdrop { background: #10244855; }

.task-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 24px 0 0; }
.task-shortcuts > a { display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 5px 16px #23477a04; }
.task-shortcuts > a:hover { border-color: #b0c9f9; background: #fbfdff; box-shadow: var(--shadow); }
.task-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #cbdfff; border-radius: 9px; background: #edf4ff; color: var(--accent); font: 21px var(--mono); margin-bottom: 13px; }
.task-shortcuts strong { font-size: 15px; letter-spacing: -.02em; line-height: 1.3; display: flex; justify-content: space-between; gap: 8px; }
.task-shortcuts strong > span { color: var(--accent); font-size: 16px; }
.task-shortcuts p { font-size: 12px; line-height: 1.6; color: var(--ink-soft); margin: 8px 0 14px; }
.task-shortcuts small { font: 9px var(--mono); letter-spacing: .07em; color: var(--accent-dark); margin-top: auto; }

/* All secondary routes, not just the home page, use the same blue-white system. */
.content-hero { padding-top: 40px; padding-bottom: 28px; }
.content-hero h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.1; max-width: 24ch; font-weight: 720; }
.content-hero .lede { max-width: 68ch; font-size: 16px; }
.method-section, .related-section { padding: 40px 0; border-color: var(--line); }
.method-section h2, .related-section h2 { font-size: 28px; line-height: 1.15; }
.method-section .chain-preview { padding: 16px; margin-top: 18px; background: #fff; border-color: var(--line); }
.method-section .chain-preview-note { font-size: 12px; }
.related-links > a, .registry-card, .source-card, .collector-workbench, .report-banner, .empty-state-page, .ruleset-transparency { border-color: var(--line); border-radius: 12px; background: #fff; }
.registry-published { border-color: #b6cffa; }
.collector-workbench { box-shadow: var(--shadow); }
.collector-checklist { background: #f7faff; border-color: var(--line); }
.content-shell table, .registry-scope, .ruleset-counts { border-color: var(--line); }
.content-shell th { background: var(--paper); }
.evidence-count-strip, .registry-summary { border-color: var(--line); border-radius: 10px; }
.incident-action-section { border-color: #b6cffa; }
.site-footer { width: 100%; margin-top: 40px; padding: 26px max(24px, calc((100% - var(--content)) / 2)); gap: 24px; background: #fff; border-top: 1px solid var(--line); min-height: 126px; }
.footer-brand { max-width: 420px; }
.footer-brand strong { font-size: 16px; letter-spacing: -.025em; }
.footer-brand p { font-size: 11px; line-height: 1.5; color: var(--muted); }
.site-footer nav { gap: 0 16px; }
.site-footer nav a { font-size: 12px; }

/* H1 / H2 use the same native editor and result materials. */
.tool-check-shell { padding-top: 24px; }
.tc-intro { margin-bottom: 18px; }
.tc-intro h1 { font-weight: 720; color: var(--ink); font-size: clamp(30px, 3.3vw, 44px); }
.tc-workbench { border: 0; border-radius: 0; background: transparent; gap: 22px; overflow: visible; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.tc-input, .tc-output { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 20px; box-shadow: var(--shadow); }
.tc-output { min-height: 460px; }
.tc-empty h2 { font-size: 27px; line-height: 1.18; letter-spacing: -.03em; }
.tc-empty .eyebrow { color: #4c6489; }
.tc-empty dl, .tc-states { border: 1px solid var(--line); border-radius: 9px; overflow: clip; }
.tc-empty dl > div, .tc-states > div { padding: 12px; border-top: 0; font-size: 13px; }
.tc-empty dl > div + div, .tc-states > div + div { border-top: 1px solid var(--line); }
.tc-modes { gap: 4px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f5f8fd; }
.tc-modes button { flex: 1; border: 0; border-radius: 5px; color: var(--ink-soft); min-height: 44px; }
.tc-modes button[aria-pressed=true] { background: #fff; color: var(--accent-dark); box-shadow: 0 1px 5px #254a8314; outline: 1px solid #dde7f7; }
.tc-scope select, .tool-check-shell textarea { border-color: #bacbe3; border-radius: 8px; }
.tool-check-shell textarea { background: #fbfdff; font-size: 12px; }
.tc-field-head { gap: 10px; }
.tc-field-head label { font-size: 12px; }
.tc-field-head button { font-size: 12px; }
.tc-diff > div { background: #f5f8fd; border: 1px solid var(--line); border-radius: 6px; }
.tc-diff pre { font-size: 12px; line-height: 1.65; }
.tc-diff strong { color: var(--ink-soft); }
.tc-proposal { border-color: var(--line); }
.tc-finding { border-color: var(--line); }
.tc-finding[data-code] .tc-level { color: var(--ink-soft); }
.tc-notice, .tc-error { border-radius: 0 8px 8px 0; }
.tc-sample[data-changed=true] { background: #fffcf5; }
.tc-candidate { padding-top: 8px; }
.tc-actions { gap: 8px; }
.tc-actions button { font-size: 12px; }
.tc-method { border-color: var(--line); padding-top: 28px; }
.tc-method h2 { font-size: 25px; }

@media (max-width: 1120px) {
  .header-note { display: none; }
  .site-header > nav { margin-left: 0; justify-content: flex-end; }
  .site-header nav a { padding-inline: 10px; }
  .diagnostic-workspace { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 18px; }
  .workbench .primary-actions { flex-direction: column; }
  .workbench .primary-actions .primary-button { flex: auto; }
  .workspace-empty { padding: 20px; }
  .workspace-preview-rows > div { align-items: start; }
  .workspace-empty .workbench-guide ol { grid-template-columns: 1fr; gap: 12px; }
  .task-shortcuts { gap: 10px; }
  .task-shortcuts > a { padding: 16px; }
}
@media (max-width: 900px) {
  .site-header { min-height: 64px; padding: 6px 20px; }
  .site-header > nav { display: none; }
  .mobile-navigation { display: block; margin-left: auto; }
  .mobile-navigation > summary { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; list-style: none; font-size: 12px; font-weight: 600; cursor: pointer; }
  .mobile-navigation > summary::-webkit-details-marker { display: none; }
  .mobile-navigation[open] > summary { color: var(--accent-dark); background: var(--accent-soft); }
  .site-header .mobile-navigation nav { display: flex; position: absolute; top: calc(100% - 2px); right: 16px; width: min(300px, calc(100vw - 32px)); flex-direction: column; align-items: stretch; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 16px 36px #18376a24; }
  .mobile-navigation nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent); }
  .diagnostic-workspace { display: flex; flex-direction: column; gap: 18px; padding-top: 22px; }
  .diagnostic-workspace > * { width: 100%; }
  .diagnostic-intro h1 { max-width: 26ch; font-size: 38px; }
  .workbench .primary-actions { flex-direction: row; }
  .workspace-empty .workbench-guide ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .diagnostic-workspace > .result-region { margin-top: 0; }
  .task-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evidence-policy-grid, .behavior-level-list, .evidence-source-list { grid-template-columns: minmax(0, 1fr); }
  .evidence-policy-grid { gap: 20px; padding-block: 28px; }
  .review-state-list li { grid-template-columns: minmax(85px, .4fr) minmax(0, 1fr); }
  .behavior-level-list li { border-right: 0; }
  .behavior-level-list li:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .evidence-source-card { min-width: 0; }
  .content-shell .section-heading { flex-wrap: wrap; }
  .content-shell > * { min-width: 0; }
  .tc-workbench { gap: 16px; }
}
@media (max-width: 760px) {
  .tool-check-shell { margin: 0 12px; padding-top: 16px; }
  .tc-intro { margin-bottom: 12px; }
  .tc-intro h1 { font-size: 29px; }
  .tc-workbench { display: grid; grid-template-columns: 1fr; gap: 16px; }
  .tc-input, .tc-output { padding: 13px; border-radius: 12px; }
  .tc-output { min-height: 0; }
  .tc-modes { margin-bottom: 8px; padding: 3px; }
  .tc-modes button { min-height: 44px; }
  .tool-check-shell.is-comparing .tc-intro { margin-bottom: 10px; }
  .tc-input[data-mode=compare] .tc-definitions #toolBefore { height: 72px; min-height: 72px; }
  .tc-input[data-mode=compare] .tc-definitions #toolDefinition { height: 112px; min-height: 112px; }
  .tc-definitions #toolDefinition { height: 135px; min-height: 135px; }
  .tc-scope .tc-same-tool { font-size: 11px; min-height: 54px; }
  .tc-scope select { font-size: 12px; }
  .tc-empty h2 { font-size: 25px; }
  .tc-states > div { font-size: 12px; }
  .tc-actions button { flex: 1 1 140px; }
}
@media (max-width: 680px) {
  .site-header { min-height: 58px; padding: 5px 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand strong { font-size: 18px; }
  .brand small { display: none; }
  .page-shell, .content-shell { width: calc(100% - 24px); }
  .diagnostic-workspace { gap: 12px; padding-top: 16px; }
  .diagnostic-intro h1 { font-size: clamp(29px, 8.5vw, 36px); margin-top: 5px; line-height: 1.06; max-width: none; }
  .diagnostic-intro .lede { font-size: 14px; line-height: 1.4; margin-top: 8px; }
  .diagnostic-intro .intro-privacy { font-size: 11px; margin-top: 6px; }
  .workbench form { padding: 12px; }
  .workbench .field-head label { font-size: 15px; }
  .workbench .field-head { min-height: 44px; }
  .workbench .field-head .text-action { font-size: 11px; }
  #evidence { min-height: 104px; margin-top: 5px; padding: 10px; font-size: 12px; line-height: 1.5; }
  .mobile-category-select { margin-top: 7px; }
  .workbench .primary-actions { flex-direction: column; margin-top: 9px; }
  .workbench .primary-actions > .primary-button { min-height: 48px; }
  .privacy-note { font-size: 11px; }
  .workspace-empty { padding: 20px 16px; }
  .workspace-empty h2 { font-size: 28px; margin-top: 20px; }
  .workspace-empty .workbench-guide ol { grid-template-columns: 1fr; }
  .workspace-preview-rows > div { padding: 12px; }
  .result-example > .worked-example > summary { min-height: 76px; }
  .diagnostic-workspace .action-rail-button { font-size: 11px; }
  .diagnostic-workspace .diagnosis-header { padding: 18px; }
  .diagnostic-workspace .next-check-card { padding: 16px; }
  .diagnostic-workspace .result-summary { padding-inline: 18px; }
  .task-shortcuts { margin-top: 18px; gap: 10px; }
  .task-shortcuts > a { padding: 14px; }
  .task-shortcuts strong { font-size: 14px; }
  .task-shortcuts p { font-size: 12px; }
  .task-shortcuts small { font-size: 9px; line-height: 1.5; }
  .evidence-count-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-hero { padding-top: 28px; }
  .content-hero h1 { font-size: 32px; }
  .content-hero .lede { font-size: 15px; }
  .method-section, .related-section { padding: 32px 0; }
  .site-footer { margin-top: 24px; padding: 24px 16px; gap: 18px; min-height: 0; }
  .site-footer nav { gap: 0 16px; }
}
@media (max-width: 359px) {
  .task-shortcuts { grid-template-columns: 1fr; }
  .workspace-panel-head { flex-wrap: wrap; }
  .tc-scope .tc-same-tool { font-size: 10px; }
  .tool-check-shell.is-comparing .tc-field-head label { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: white !important; border: 0; }
  .mobile-navigation, .task-shortcuts, .site-header, .site-footer { display: none !important; }
  .diagnostic-workspace, .tc-workbench { display: block; }
  .diagnostic-workspace > .workbench, .workspace-empty { display: none; }
  .diagnostic-workspace > .result-region, .tc-output { width: 100%; border: 0; box-shadow: none; }
  .tc-input, .tc-actions, .tc-run, .tc-review { display: none; }
  .tc-output pre { white-space: pre-wrap; }
}
