:root {
  --ink: #17221f;
  --muted: #65716d;
  --paper: #f5f2e9;
  --surface: #fffdf7;
  --line: #dcd9cf;
  --green: #164f43;
  --green-2: #267965;
  --lime: #c9df82;
  --amber: #f1d79a;
  --red: #a33c31;
  --shadow: 0 18px 55px rgba(25, 45, 38, 0.09);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #edf4f0;
  --muted: #a8b6b0;
  --paper: #0f1614;
  --surface: #17211e;
  --line: #35433e;
  --green: #2e7d69;
  --green-2: #83cbb3;
  --lime: #b9d578;
  --amber: #7b6431;
  --red: #ef8f84;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; font: 17px/1.55 "DM Sans", sans-serif; background: radial-gradient(circle at 5% 0%, #fffdf7 0, transparent 34%), var(--paper); }
body.app-active { height: 100vh; overflow: hidden; }
body.app-active main { height: calc(100vh - 78px); overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }

.topbar { height: 78px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(245, 242, 233, .92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-family: "Libre Caslon Display", serif; letter-spacing: -.05em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { min-height: 42px; padding: 0 15px; border: 1px solid #c7c2b4; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 700; cursor: pointer; }
.theme-toggle:hover { border-color: var(--green-2); color: var(--ink); }
.theme-toggle-icon { font-size: 15px; line-height: 1; }
.deadline-badge { padding: 9px 15px; border: 1px solid #c7c2b4; border-radius: 999px; color: var(--muted); font-size: 15px; font-weight: 600; }
.deadline-badge.closed { border-color: #d09c94; color: var(--red); }

.public-layout { max-width: 1240px; margin: 0 auto; padding: clamp(48px, 8vw, 108px) 28px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .6fr); gap: clamp(48px, 8vw, 108px); align-items: start; }
.eyebrow { margin: 0 0 12px; color: var(--green-2); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 24px; font: 400 clamp(45px, 6vw, 82px)/.98 "Libre Caslon Display", serif; letter-spacing: -.035em; }
h1 em { color: var(--green-2); font-style: italic; }
.hero-copy { max-width: 690px; color: #4f5c57; font-size: clamp(17px, 2vw, 20px); line-height: 1.65; }
.process-grid { margin: 42px 0 30px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.process-grid article { padding: 24px 22px 0 0; }
.process-grid span { color: var(--green-2); font-size: 14px; font-weight: 700; }
.process-grid h3 { margin: 10px 0 6px; font-size: 17px; }
.process-grid p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.notice { padding: 16px 18px; border-radius: 8px; font-size: 15px; line-height: 1.6; }
.notice.amber { border: 1px solid #dec47e; background: #fff7df; color: #594c27; }
.notice.small { margin: 20px 0; font-size: 15px; }

.auth-card { position: sticky; top: 112px; padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h2 { margin-bottom: 8px; font: 400 31px/1.1 "Libre Caslon Display", serif; }
.auth-card > div > p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.6; }
.tab-list { display: flex; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.tab.active { border-color: var(--green); color: var(--ink); font-weight: 700; }
.stack-form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #36423e; font-size: 15px; font-weight: 700; }
label span { color: var(--muted); font-weight: 400; }
.field-group { min-width: 0; display: grid; gap: 7px; align-content: start; }
.field-group > label[for] { display: flex; align-items: baseline; gap: 0; }
.field-group > label[for]::before,
.additional-solvers-heading h4::before { content: var(--field-number, ""); flex: 0 0 auto; margin-right: .55rem; color: var(--green-2); font-weight: 700; }
.field-group > label[for] > span { margin-left: .35em; }
label[for="solutionTitle"] { --field-number: "1.1"; }
label[for="primarySolver"] { --field-number: "1.2"; }
label[for="primaryAffiliation"] { --field-number: "1.3"; }
.additional-solvers-heading h4 { --field-number: "1.4"; }
label[for="sourceReference"] { --field-number: "1.5"; }
label[for="manuscriptUrl"] { --field-number: "1.6"; }
label[for="referencesText"] { --field-number: "1.7"; }
label[for="ciphertextTranscription"] { --field-number: "2.1"; }
label[for="proposedPlaintext"] { --field-number: "2.2"; }
label[for="solutionAlignment"] { --field-number: "2.3"; }
label[for="generatedKey"] { --field-number: "2.4"; }
label[for="originalKeyReference"] { --field-number: "2.5"; }
label[for="methodDescription"] { --field-number: "3.1"; }
label[for="aiTools"] { --field-number: "3.2"; }
label[for="repositoryUrl"] { --field-number: "3.3"; }
label[for="unresolvedAnalysis"] { --field-number: "3.4"; }
label[for="additionalNotes"] { --field-number: "3.5"; }
.field-help { margin: -1px 0 2px; color: var(--muted); font-size: 15px; font-weight: 400; }
.field-help summary { width: fit-content; color: var(--green-2); font-weight: 700; cursor: pointer; list-style-position: outside; }
.field-help summary:hover { color: var(--ink); }
.field-help p { margin: 8px 0 4px; padding: 12px 14px; border-left: 3px solid var(--green-2); background: rgba(38, 121, 101, .06); color: var(--muted); font-size: 15px; line-height: 1.65; }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.field-help code { padding: 2px 5px; border-radius: 4px; background: rgba(38, 121, 101, .1); color: var(--ink); font: .92em/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
input, textarea, select { width: 100%; border: 1px solid #cbc9bf; border-radius: 7px; background: #fff; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; }
input, select { height: 44px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(38, 121, 101, .12); }
input[readonly] { background: #f0eee7; color: #59625e; cursor: not-allowed; }
input:disabled, textarea:disabled, select:disabled { border-color: #d2d0c7; background: #eeece5; color: #67706c; cursor: not-allowed; opacity: 1; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: #0d4036; }
.button.secondary { border-color: #babdb7; background: white; color: var(--ink); }
.button.danger { border-color: #c77c72; background: #fff6f4; color: var(--red); }
.button.danger:hover { background: #fbe4df; }
.button.compact { min-height: 34px; padding: 0 11px; font-size: 13px; white-space: nowrap; }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.submit { background: var(--lime); color: #243b2b; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button.wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.form-message { min-height: 22px; margin: 12px 0 0; color: var(--red); font-size: 15px; line-height: 1.5; }
.editor-message:empty { display: none; }
.editor-message:not(:empty) { margin: -14px 0 24px; padding: 12px 15px; border: 1px solid #d6aaa3; border-radius: 7px; background: #fff2ef; }
.editor-message strong { display: block; }
.editor-message ul { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.editor-message li { padding-left: 2px; }
.editor-message li strong { display: inline; margin-right: 5px; color: inherit; }
.app-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink); }
.app-dialog::backdrop { background: rgba(16, 27, 23, .58); backdrop-filter: blur(3px); }
.dialog-card { padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 70px rgba(18, 31, 26, .28); }
.dialog-card h2 { margin: 8px 0 12px; font: 400 34px/1.08 "Libre Caslon Display", serif; }
.dialog-card > p:not(.eyebrow):not(.form-message) { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.dialog-actions { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.import-dialog { width: min(760px, calc(100vw - 32px)); }
.import-validation-errors { max-height: min(42vh, 420px); margin-top: 20px; padding: 16px 18px; overflow-y: auto; border: 1px solid #d39a92; border-radius: 8px; background: #fff1ee; color: #762e27; }
.import-validation-errors ul { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.import-validation-errors li { padding-left: 3px; }
.import-validation-errors strong { display: block; font: 700 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.import-validation-errors span { display: block; margin-top: 2px; color: inherit; line-height: 1.5; }
.import-dialog .notice p { margin: 0; }

.app-layout { height: 100%; min-height: 0; overflow: hidden; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { height: 100%; min-height: 0; overflow: hidden; padding: 32px 22px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; background: #efede4; }
.sidebar-navigation { min-height: 0; overflow-y: auto; display: grid; gap: 30px; scrollbar-gutter: stable; }
.sidebar-section > .eyebrow { margin-bottom: 10px; }
.side-nav { display: grid; gap: 6px; }
.side-nav button { padding: 12px 13px; border: 0; border-radius: 7px; background: transparent; text-align: left; color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.side-nav button.active { background: var(--green); color: white; }
.admin-side-nav { gap: 17px; }
.admin-nav-section { display: grid; gap: 4px; }
.admin-nav-section + .admin-nav-section { padding-top: 15px; border-top: 1px solid var(--line); }
.sidebar-nav-heading { margin: 0 13px 3px; color: var(--green-2); font-size: 11px; font-weight: 700; letter-spacing: .105em; line-height: 1.35; text-transform: uppercase; }
.sidebar-about-section { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.sidebar-about-section .side-nav button { color: var(--green-2); font-weight: 700; }
.sidebar-about-section .side-nav button::before { content: "?"; width: 22px; height: 22px; margin-right: 9px; display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; }
.sidebar-about-section .side-nav button.active { color: white; }
.submission-nav-list { margin: 4px 0 8px 12px; padding-left: 10px; border-left: 1px solid var(--line); display: grid; gap: 3px; }
.submission-nav-list button { padding: 8px 9px; display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 8px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 500; }
.submission-nav-list button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aaa99f; }
.submission-nav-list button.submitted::before { background: var(--green-2); }
.submission-nav-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.submission-nav-list button.current { color: var(--green-2); background: rgba(35, 108, 86, .08); }
.mobile-account-nav { display: none; }
.sidebar-user { width: 100%; flex: 0 0 auto; margin-top: 18px; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; min-width: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.sidebar-user:hover strong { color: var(--green-2); }
.sidebar-user > span { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%; background: #d3ddc5; font-size: 14px; font-weight: 700; }
.sidebar-user > div { min-width: 0; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 15px; }
.sidebar-user small { max-width: 165px; margin-top: 2px; color: var(--muted); font-size: 14px; }
.sidebar-user .sidebar-user-arrow { width: auto; height: auto; flex: 0 0 auto; margin-left: auto; border-radius: 0; background: transparent; color: var(--muted); font-size: 20px; font-weight: 400; }
.workspace { height: 100%; min-width: 0; overflow-y: auto; padding: 48px clamp(25px, 5vw, 72px) 80px; scrollbar-gutter: stable; }
body.editor-active .workspace { overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; }
body.editor-active #editorView { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
body.editor-active .editor-heading { flex: 0 0 auto; }
body.editor-active .editor-message { flex: 0 0 auto; }
body.editor-active .editor-grid { min-height: 0; flex: 1 1 auto; align-items: stretch; padding-bottom: 24px; }
body.editor-active .solution-form { min-height: 0; overflow-y: auto; padding-right: 10px; scrollbar-gutter: stable; }
body.editor-active .check-panel { position: static; max-height: none; overflow-y: auto; }
.submission-window-banner { margin-bottom: 28px; padding: 18px 20px; border: 1px solid #d09c94; border-radius: 9px; background: #fff0ed; color: #6f2f29; }
.submission-window-banner.upcoming { border-color: #b8a76c; background: #fff8df; color: #604f1d; }
.submission-window-banner strong { display: block; margin-bottom: 4px; }
.submission-window-banner p { margin: 0; font-size: 15px; line-height: 1.6; }
.verification-banner { margin-bottom: 28px; padding: 18px 20px; border: 1px solid #d7b75d; border-radius: 9px; background: #fff7df; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.verification-banner strong { display: block; margin-bottom: 3px; color: #5b4717; }
.verification-banner p { margin: 0; color: #74612f; font-size: 15px; line-height: 1.55; }
.verification-banner a { display: inline-block; margin-top: 8px; color: var(--green-2); font-size: 14px; font-weight: 700; }
.page-heading { margin-bottom: 32px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading.compact { align-items: center; }
.page-heading.editor-heading { align-items: flex-end; }
.page-heading.editor-heading > .button-row { margin-bottom: 7px; }
.page-heading h2 { margin-bottom: 7px; font: 400 clamp(32px, 4vw, 48px)/1 "Libre Caslon Display", serif; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 16px; }
.text-button { padding: 0; margin-bottom: 16px; border: 0; background: transparent; color: var(--green-2); font-size: 15px; font-weight: 700; cursor: pointer; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.solution-card, .empty-card { min-height: 220px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(30, 46, 40, .04); }
.solution-card { display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: border .15s, transform .15s; }
.solution-card:hover { border-color: #9baea7; transform: translateY(-2px); }
.solution-card h3 { margin: 20px 0 8px; font: 400 24px/1.15 "Libre Caslon Display", serif; }
.solution-card p { color: var(--muted); font-size: 15px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.status { padding: 5px 9px; border-radius: 999px; background: #e5e4dc; color: #59625e; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.status.submitted, .status.accepted { background: #dcebdc; color: #265c39; }
.status.declined { background: #f6ded9; color: #8b322a; }
.empty-card { grid-column: 1 / -1; display: grid; place-items: center; text-align: center; color: var(--muted); border-style: dashed; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.solution-form { display: grid; gap: 18px; }
.form-section { padding: 28px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.section-heading { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .7rem; align-items: start; }
.section-number { padding-top: 5px; color: var(--green-2); font-size: 27px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.section-copy { min-width: 0; }
.section-copy h3 { margin: 0 0 9px; font: 400 clamp(32px, 2.4vw, 40px)/1.08 "Libre Caslon Display", serif; letter-spacing: -.015em; }
.section-copy p { margin: 0 0 8px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.form-section label.full, .form-section .full { grid-column: 1 / -1; }
.additional-solvers { padding-top: 4px; }
.additional-solvers-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.additional-solvers-heading h4 { margin: 0 0 4px; display: flex; align-items: baseline; font-size: 15px; }
.additional-solvers-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.additional-solvers-list { margin-top: 14px; display: grid; gap: 10px; }
.additional-solver-row { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #faf8f1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.additional-solver-row .remove-solver { min-width: 42px; padding: 0 12px; color: var(--red); }
.check-panel { position: sticky; top: 106px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.check-panel h3 { margin-bottom: 14px; font: 400 26px/1.15 "Libre Caslon Display", serif; }
.progress { height: 7px; margin: 10px 0; overflow: hidden; border-radius: 99px; background: #e1e1d9; }
.progress span { display: block; width: 0; height: 100%; background: var(--green-2); transition: width .2s; }
#progressText { font-size: 14px; color: var(--muted); }
.check-list { margin: 20px 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.check-list li { display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; color: var(--muted); font-size: 14px; line-height: 1.5; }
.check-list li::before { content: ""; width: 15px; height: 15px; border: 1px solid #c6c8c3; border-radius: 50%; }
.check-list li.complete { color: #295849; }
.check-list li.complete::before { content: "✓"; display: grid; place-items: center; background: var(--green-2); border-color: var(--green-2); color: white; font-size: 9px; }
.check-number { display: inline-block; min-width: 0; margin-right: .5rem; color: var(--green-2); font-weight: 700; }
.check-link { width: 100%; padding: 0; border: 0; background: transparent; display: flex; align-items: flex-start; color: inherit; text-align: left; font-size: inherit; line-height: inherit; cursor: pointer; }
.check-link:hover span, .check-link:focus-visible span { color: var(--green-2); text-decoration: underline; text-underline-offset: 3px; }
.check-link:focus-visible { outline: 2px solid var(--green-2); outline-offset: 4px; border-radius: 2px; }
.field-target { border-radius: 7px; animation: field-target-pulse 1.8s ease-out; }
@keyframes field-target-pulse {
  0%, 35% { box-shadow: 0 0 0 4px rgba(38, 121, 101, .28); background: rgba(38, 121, 101, .08); }
  100% { box-shadow: 0 0 0 0 rgba(38, 121, 101, 0); background: transparent; }
}
.declaration-layout { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.declaration-card, .declaration-note { padding: 30px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(30, 46, 40, .04); }
.declaration-project-summary { margin-bottom: 26px; padding: 18px; border-left: 4px solid var(--green-2); background: var(--paper); display: grid; gap: 4px; }
.declaration-project-summary span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.declaration-project-summary strong { font: 400 24px/1.25 "Libre Caslon Display", serif; }
.declaration-project-summary small { color: var(--muted); font-size: 14px; }
.declaration-introduction { color: var(--muted); font-size: 16px; line-height: 1.65; }
.declaration-sections { margin: 24px 0; display: grid; gap: 22px; }
.declaration-section h3 { margin-bottom: 7px; font-size: 17px; }
.declaration-section p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.72; }
.declaration-confirmation { padding: 20px; border: 1px solid #b9943e; border-radius: 8px; background: #fff6dd; display: grid; grid-template-columns: 22px 1fr; gap: 13px; align-items: start; font-weight: 600; line-height: 1.6; cursor: pointer; }
.declaration-confirmation input { width: 20px; height: 20px; margin-top: 2px; }
.ai-pre-review-consent { margin-top: 20px; padding: 22px; border: 1px solid #8aaea1; border-radius: 9px; background: #f1f8f5; }
.ai-pre-review-consent > h3 { margin: 0 0 8px; font-size: 19px; }
.ai-pre-review-consent > p { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.72; }
.ai-pre-review-consent .ai-confirmation { margin: 0; border-color: #79a695; background: #e3f2ec; }
.declaration-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }
.declaration-note { position: sticky; top: 106px; }
.declaration-note h3 { font: 400 25px/1.2 "Libre Caslon Display", serif; }
.declaration-note p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.65; }

.about-view { max-width: 1180px; margin: 0 auto; padding-bottom: 70px; }
.about-hero { max-width: 1000px; padding: clamp(12px, 2vw, 30px) 0 36px; }
.about-hero h2 { max-width: 960px; margin-bottom: 22px; font: 400 clamp(40px, 5vw, 68px)/1.03 "Libre Caslon Display", serif; letter-spacing: -.025em; }
.about-hero > p:last-child { max-width: 920px; color: var(--muted); font-size: 19px; line-height: 1.75; }
.about-principles { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-principles article { padding: 28px 30px 28px 0; }
.about-principles article + article { padding-left: 30px; border-left: 1px solid var(--line); }
.about-principles span { color: var(--green-2); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.about-principles h3 { margin: 9px 0 7px; font: 400 27px/1.15 "Libre Caslon Display", serif; }
.about-principles p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.about-section { margin-top: 58px; display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); gap: clamp(36px, 6vw, 82px); align-items: start; }
.about-section-heading { position: sticky; top: 104px; }
.about-section-heading h3 { max-width: 320px; font: 400 38px/1.08 "Libre Caslon Display", serif; }
.about-steps { margin: 0; padding: 0; list-style: none; }
.about-steps li { padding: 0 0 27px; display: grid; grid-template-columns: 42px 1fr; gap: 18px; }
.about-steps li + li { padding-top: 27px; border-top: 1px solid var(--line); }
.about-steps li > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 13px; font-weight: 800; }
.about-steps h4 { margin: 3px 0 7px; font-size: 18px; }
.about-steps p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.68; }
.about-outcome { margin-top: 58px; padding: clamp(28px, 4vw, 50px); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .5fr); gap: clamp(32px, 5vw, 64px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.about-outcome h3 { max-width: 760px; margin-bottom: 20px; font: 400 clamp(32px, 4vw, 48px)/1.08 "Libre Caslon Display", serif; }
.about-outcome > div > p:not(.eyebrow) { color: var(--muted); line-height: 1.72; }
.about-outcome aside { padding: 24px; border-left: 4px solid var(--green-2); background: var(--paper); align-self: start; }
.about-outcome aside h4 { margin: 0 0 10px; font: 400 25px/1.18 "Libre Caslon Display", serif; }
.about-outcome aside p:last-child { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.about-help { margin-top: 28px; padding: 26px 30px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-radius: 10px; background: var(--green); color: white; }
.about-help h3 { margin-bottom: 4px; font: 400 28px/1.15 "Libre Caslon Display", serif; }
.about-help p { max-width: 760px; margin: 0; color: #dcece6; font-size: 15px; }
.about-help .button { flex: 0 0 auto; background: var(--surface); color: var(--green); }

.metric-grid { margin-bottom: 28px; display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 14px; }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.metric strong { display: block; font: 400 34px/1 "Libre Caslon Display", serif; }
.metric span { display: block; margin-top: 7px; color: var(--muted); font-size: 15px; }
.statistics-controls { display: grid; grid-template-columns: minmax(180px, 220px) auto; gap: 7px 10px; align-items: end; }
.statistics-controls label { grid-column: 1; font-size: 13px; }
.statistics-controls select { grid-column: 1; min-height: 42px; }
.statistics-controls .button { grid-column: 2; grid-row: 2; }
.statistics-group { margin-top: 30px; }
.statistics-group-heading { margin-bottom: 14px; display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.statistics-group-heading h3 { margin: 0; font: 400 29px/1.15 "Libre Caslon Display", serif; }
.statistics-group-heading .eyebrow { margin-bottom: 5px; }
.statistics-group-heading small { color: var(--muted); }
.statistics-metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.statistics-chart-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.statistics-chart-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(30, 46, 40, .04); }
.statistics-chart-card > div:first-child { margin-bottom: 18px; }
.statistics-chart-card h3 { margin-bottom: 5px; font: 400 24px/1.2 "Libre Caslon Display", serif; }
.statistics-chart-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.statistics-chart-wide { margin-top: 18px; }
.statistics-chart { min-height: 250px; }
.statistics-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.statistics-chart .chart-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.statistics-chart .chart-axis { stroke: var(--muted); stroke-width: 1; opacity: .55; }
.statistics-chart .chart-axis-label { fill: var(--muted); font: 12px "DM Sans", sans-serif; }
.statistics-chart .chart-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.statistics-chart .chart-point { stroke: var(--surface); stroke-width: 2; transition: r .15s ease; }
.statistics-chart .chart-point:hover { r: 5.5px; }
.statistics-chart .chart-empty { fill: var(--muted); font: 15px "DM Sans", sans-serif; }
.statistics-chart .chart-line.series-0 { stroke: var(--green-2); fill: none; }
.statistics-chart .chart-line.series-1 { stroke: #b7832f; fill: none; }
.statistics-chart .chart-line.series-2 { stroke: #8662a8; fill: none; }
.statistics-chart .chart-point.series-0 { fill: var(--green-2); }
.statistics-chart .chart-point.series-1 { fill: #b7832f; }
.statistics-chart .chart-point.series-2 { fill: #8662a8; }
.statistics-legend { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }
.statistics-legend span { display: inline-flex; align-items: center; gap: 6px; }
.statistics-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.statistics-legend .series-0 { background: var(--green-2); }
.statistics-legend .series-1 { background: #b7832f; }
.statistics-legend .series-2 { background: #8662a8; }
.statistics-breakdown { display: grid; gap: 11px; }
.statistics-breakdown-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(100px, 2fr) auto; gap: 12px; align-items: center; }
.statistics-breakdown-row span { color: var(--muted); font-size: 14px; }
.statistics-breakdown-row strong { font-size: 14px; }
.statistics-breakdown-bar { width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 999px; background: var(--paper); appearance: none; }
.statistics-breakdown-bar::-webkit-progress-bar { border-radius: inherit; background: var(--paper); }
.statistics-breakdown-bar::-webkit-progress-value { border-radius: inherit; background: var(--green-2); }
.statistics-breakdown-bar::-moz-progress-bar { border-radius: inherit; background: var(--green-2); }
.statistics-summary-grid { margin-top: 28px; }
.statistics-privacy-note { margin-top: 24px; }
.admin-section { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.admin-section h3 { font: 400 25px/1.2 "Libre Caslon Display", serif; }
.admin-section > p, .admin-settings-section > div > p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.admin-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.admin-section-heading h3 { margin-bottom: 6px; }
.admin-section-heading p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.admin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-actions .text-button { margin: 0; }
.danger-text { color: var(--red); }
.audit-table-wrap { max-height: 620px; overflow: auto; }
.audit-table-wrap table { min-width: 1050px; }
.audit-table-wrap th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.audit-details summary { color: var(--green-2); font-weight: 700; cursor: pointer; }
.audit-details pre { max-width: 420px; margin: 8px 0 0; padding: 10px; overflow: auto; border-radius: 6px; background: var(--paper); color: var(--ink); font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.admin-settings-section { margin: 0 0 28px; }
.admin-settings-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto; gap: 18px; align-items: end; }
.admin-settings-form .button { white-space: nowrap; }
.llm-settings-card { max-width: 900px; margin-top: 0; }
.llm-settings-form { gap: 20px; }
.llm-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.agent-prompts-form { max-width: 1100px; display: grid; gap: 22px; }
.agent-prompts-form .admin-section { margin: 0; }
.prompt-section { display: grid; gap: 20px; }
.prompt-section > div:first-child h3 { margin: 5px 0 6px; }
.prompt-section > div:first-child p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.55; }
.prompt-section label { display: grid; gap: 8px; font-weight: 700; }
.prompt-section textarea { width: 100%; min-height: 96px; resize: vertical; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.criterion-prompt-list { display: grid; gap: 16px; }
.criterion-prompt { padding-top: 16px; border-top: 1px solid var(--line); }
.criterion-prompt > span { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.criterion-prompt small { color: var(--muted); font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.email-template-list { display: grid; gap: 18px; }
.email-template-card { display: grid; gap: 18px; }
.template-variable-list { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); }
.template-variable-list strong { margin-right: 4px; color: var(--ink); }
.template-variable-list code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--green-2); }
.prompt-form-actions { position: static; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.toggle-field { padding: 16px; border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.toggle-field input { width: 19px; height: 19px; margin-top: 2px; }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field small { margin-top: 4px; color: var(--muted); font-weight: 400; line-height: 1.5; }
.secret-status { margin: -10px 0 0; color: var(--red); font-size: 14px; }
.secret-status.configured { color: var(--green-2); }
.agent-privacy-note { margin-bottom: 22px; }
.agent-queue-list { display: grid; gap: 20px; }
.agent-job { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(30, 46, 40, .04); }
.agent-job.superseded { opacity: .72; }
.agent-job.running { border-color: #68a0cc; }
.agent-job.failed { border-color: #c88177; }
.agent-job-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.agent-job-heading h3 { margin: 11px 0 4px; font: 400 27px/1.2 "Libre Caslon Display", serif; }
.agent-job-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.agent-job-meta, .agent-job-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 13px; }
.agent-job-progress { margin-top: 18px; display: grid; grid-template-columns: minmax(240px, 520px) auto; gap: 12px; align-items: center; }
.agent-job-progress strong { color: var(--muted); font-size: 13px; }
.agent-segmented-progress { height: 12px; display: flex; gap: 3px; overflow: hidden; border-radius: 4px; }
.agent-progress-segment { min-width: 4px; flex: 1 1 0; border-radius: 2px; background: #d9dad4; transition: background-color .2s, transform .2s; }
.agent-progress-segment.passed { background: #4d9869; }
.agent-progress-segment.violation, .agent-progress-segment.error { background: #bd5145; }
.agent-progress-segment.not_verifiable, .agent-progress-segment.warning { background: #d3a53c; }
.agent-progress-segment.not_applicable { background: #9aa29e; }
.agent-progress-segment.running { background: #3f86c7; animation: agent-progress-pulse 1.4s ease-in-out infinite; }
.agent-progress-segment.pending { background: #d9dad4; }
@keyframes agent-progress-pulse { 50% { opacity: .45; } }
.agent-progress-legend { max-width: 760px; margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 11px; }
.agent-progress-legend span { display: inline-flex; align-items: center; gap: 6px; }
.agent-progress-legend span::before { width: 8px; height: 8px; border-radius: 2px; background: #d9dad4; content: ""; }
.agent-progress-legend .passed::before { background: #4d9869; }
.agent-progress-legend .violation::before { background: #bd5145; }
.agent-progress-legend .not_verifiable::before { background: #d3a53c; }
.agent-progress-legend .not_applicable::before { background: #9aa29e; }
.agent-progress-legend .running::before { background: #3f86c7; }
.agent-review-disclosures { margin-top: 18px; display: grid; gap: 10px; }
.agent-review-disclosure { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.agent-review-disclosure > summary { min-height: 48px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--ink); font-weight: 700; cursor: pointer; list-style: none; }
.agent-review-disclosure > summary::-webkit-details-marker { display: none; }
.agent-review-disclosure > summary::after { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--green-2); content: "+"; font-size: 16px; line-height: 1; }
.agent-review-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.agent-review-disclosure[open] > summary::after { content: "−"; }
.agent-review-disclosure > summary span { margin-right: auto; }
.agent-review-disclosure > summary small { color: var(--muted); font-size: 12px; font-weight: 500; text-align: right; }
.agent-disclosure-body { padding: 16px; }
.agent-summary p { margin: 0; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }
.agent-check-details .agent-disclosure-body { padding: 0 16px 16px; }
.agent-check-details .table-wrap { margin-top: 0; }
.agent-check-details table { min-width: 880px; }
.agent-step td:first-child { width: 32px; }
.agent-step-icon { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #babdb8; border-radius: 50%; color: var(--muted); font-size: 12px; font-weight: 800; }
.agent-step.passed .agent-step-icon { border-color: var(--green-2); background: var(--green-2); color: white; }
.agent-step.violation { background: rgba(174, 55, 42, .07); }
.agent-step.warning { background: rgba(184, 139, 39, .08); }
.agent-step.violation .agent-step-icon, .agent-step.error .agent-step-icon { border-color: var(--red); background: var(--red); color: white; }
.agent-step.warning .agent-step-icon { border-color: #b88b27; background: #fff1c8; color: #6d5319; }
.agent-step.not_verifiable .agent-step-icon { border-color: #b88b27; background: #fff1c8; color: #6d5319; }
.agent-step.running .agent-step-icon { border-color: #3f86c7; color: #3f86c7; }
.agent-state, .severity { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e8e7df; color: #58625e; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.agent-state.passed { background: #dcebdc; color: #265c39; }
.agent-state.violation, .agent-state.error, .severity.major, .severity.critical { background: #f6ded9; color: #8b322a; }
.agent-state.running { background: #dcecf8; color: #245f8b; }
.agent-state.not_verifiable, .severity.minor { background: #fff0c7; color: #705619; }
.agent-state.warning { background: #fff0c7; color: #705619; }
.eligibility-blocker-notice { margin-top: 12px; }
.agent-finding, .agent-human-question { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.agent-human-question { color: #76531f; }
.agent-evidence, .agent-sources { margin-top: 8px; color: var(--muted); font-size: 12px; }
.agent-evidence ul, .agent-sources ul { margin: 4px 0 0; padding-left: 18px; }
.agent-sources a { overflow-wrap: anywhere; }
.status.queued { background: #eee8d7; color: #695728; }
.status.running { background: #dcecf8; color: #245f8b; }
.status.completed { background: #dcebdc; color: #265c39; }
.status.failed, .status.superseded { background: #f6ded9; color: #8b322a; }
.account-grid { max-width: 900px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.account-settings { display: grid; gap: 24px; }
.account-card, .account-status-card { padding: 28px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(30, 46, 40, .04); }
.account-card h3, .account-status-card h3 { margin-bottom: 7px; font: 400 27px/1.15 "Libre Caslon Display", serif; }
.account-card > div > p, .account-status-card > p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.account-card .notice { margin: 0; }
.account-status-card { position: sticky; top: 106px; }
.consent-inline { display: grid !important; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; font-size: 13px; line-height: 1.45; }
.consent-inline input { width: 18px; height: 18px; margin-top: 1px; }
.auth-legal { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.session-list { margin-top: 18px; display: grid; gap: 10px; }
.session-row { padding: 12px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.session-row:first-child { border-top: 0; }
.session-row div { min-width: 0; display: grid; gap: 3px; }
.session-row small { color: var(--muted); overflow-wrap: anywhere; }
.receipt-summary { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.agent-admin-review { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); display: grid; gap: 10px; }
.agent-admin-review label { display: grid; gap: 4px; font-size: 12px; }
.agent-admin-review textarea, .agent-admin-review select { width: 100%; }
.compact-control { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; }
.compact-control input { width: 62px; padding: 7px; }
.agent-provenance p { margin: 0; overflow-wrap: anywhere; color: var(--muted); line-height: 1.65; }
.policy-page h2 { margin-top: 28px; font: 400 25px/1.2 "Libre Caslon Display", serif; }
.policy-page p { line-height: 1.7; }
.policy-version { margin-top: 35px; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e5e2d9; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
td select { min-width: 130px; height: 34px; }
.automatic-review-cell { min-width: 145px; display: grid; justify-items: start; gap: 6px; }
.automatic-review-cell small { color: var(--muted); white-space: nowrap; }
.decision-list { display: grid; gap: 18px; margin: 24px 0; }
.decision-card { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(30, 46, 40, .04); }
.decision-card-heading, .decision-card-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.decision-card-heading h3 { margin: 4px 0 6px; font: 400 27px/1.2 "Libre Caslon Display", serif; }
.decision-card-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.decision-fields { display: grid; grid-template-columns: minmax(210px, .35fr) minmax(420px, 1fr); gap: 20px; margin: 22px 0 16px; }
.decision-fields label { margin: 0; }
.decision-fields select { width: 100%; }
.decision-fields textarea { width: 100%; resize: vertical; }
.decision-card-footer { align-items: center; }
.decision-card-footer small { color: var(--muted); }
.decision-send-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 28px; }
.decision-send-panel .form-message { grid-column: 1 / -1; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 420px; padding: 15px 19px; border-radius: 8px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 15px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

.agent-public-page { max-width: 1050px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) 28px 90px; }
.agent-public-card { padding: clamp(28px, 5vw, 62px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.agent-public-card h1 { max-width: 850px; margin-bottom: 30px; font-size: clamp(44px, 6vw, 72px); }
.agent-public-card h2 { margin: 0 0 10px; font: 400 28px/1.15 "Libre Caslon Display", serif; }
.agent-public-description { max-width: 850px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.agent-public-card section { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.agent-public-card section p { margin-bottom: 0; color: var(--muted); }
.agent-public-card code { margin-top: 14px; padding: 14px 16px; display: block; border-radius: 7px; background: rgba(38, 121, 101, .09); overflow-wrap: anywhere; font: 14px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.agent-public-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.agent-public-grid > div + div { padding-left: 30px; border-left: 1px solid var(--line); }

:root[data-theme="dark"] body { background: radial-gradient(circle at 5% 0%, #1a2823 0, transparent 34%), var(--paper); }
:root[data-theme="dark"] .topbar { background: rgba(15, 22, 20, .92); }
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .deadline-badge { border-color: #46534e; }
:root[data-theme="dark"] .hero-copy { color: #c0cbc6; }
:root[data-theme="dark"] .notice.amber,
:root[data-theme="dark"] .verification-banner { border-color: #715d30; background: #2b2517; color: #e2cf9b; }
:root[data-theme="dark"] .submission-window-banner { border-color: #7f4a43; background: #301d1b; color: #f1b5ad; }
:root[data-theme="dark"] .submission-window-banner.upcoming { border-color: #6e6037; background: #292516; color: #e7d797; }
:root[data-theme="dark"] .verification-banner strong { color: #ead7a5; }
:root[data-theme="dark"] .verification-banner p { color: #c8b985; }
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select { border-color: #46534e; background: #101815; color: var(--ink); }
:root[data-theme="dark"] label,
:root[data-theme="dark"] .additional-solvers-heading h4 { color: #dce6e1; }
:root[data-theme="dark"] input[readonly] { background: #202a26; color: #b9c5c0; }
:root[data-theme="dark"] input:disabled,
:root[data-theme="dark"] textarea:disabled,
:root[data-theme="dark"] select:disabled { border-color: #3d4944; background: #202824; color: #9faaa5; opacity: 1; }
:root[data-theme="dark"] .button.secondary { border-color: #52605a; background: #202a26; color: var(--ink); }
:root[data-theme="dark"] .button.danger { border-color: #8d5149; background: #351f1b; color: #f4aca2; }
:root[data-theme="dark"] .button.primary:hover { background: #3a917a; }
:root[data-theme="dark"] .editor-message:not(:empty) { border-color: #754942; background: #301d1b; }
:root[data-theme="dark"] .dialog-card { box-shadow: 0 24px 70px rgba(0, 0, 0, .48); }
:root[data-theme="dark"] .import-validation-errors { border-color: #754942; background: #301d1b; color: #f1b5ad; }
:root[data-theme="dark"] .sidebar { background: #131c19; }
:root[data-theme="dark"] .sidebar-user > span { background: #2d433b; }
:root[data-theme="dark"] .solution-card,
:root[data-theme="dark"] .empty-card,
:root[data-theme="dark"] .form-section,
:root[data-theme="dark"] .check-panel,
:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .admin-section,
:root[data-theme="dark"] .account-card,
:root[data-theme="dark"] .account-status-card { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .declaration-card,
:root[data-theme="dark"] .declaration-note { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .declaration-project-summary { background: #121a17; }
:root[data-theme="dark"] .about-outcome aside { background: #121a17; }
:root[data-theme="dark"] .about-help .button { color: var(--ink); }
:root[data-theme="dark"] .declaration-confirmation { border-color: #715d30; background: #2b2517; }
:root[data-theme="dark"] .ai-pre-review-consent { border-color: #466d60; background: #17251f; }
:root[data-theme="dark"] .ai-pre-review-consent .ai-confirmation { border-color: #466d60; background: #20362e; }
:root[data-theme="dark"] .additional-solver-row { background: #121a17; }
:root[data-theme="dark"] .field-help p { background: rgba(131, 203, 179, .08); }
:root[data-theme="dark"] .progress { background: #34413c; }
:root[data-theme="dark"] .status { background: #303b37; color: #bdc7c3; }
:root[data-theme="dark"] .status.submitted,
:root[data-theme="dark"] .status.accepted { background: #254535; color: #b8dfc4; }
:root[data-theme="dark"] .status.declined { background: #4b2926; color: #f0b0a8; }
:root[data-theme="dark"] .agent-job { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .decision-card { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .statistics-chart-card { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .agent-review-disclosure { background: #121a17; }
:root[data-theme="dark"] .agent-progress-segment.pending,
:root[data-theme="dark"] .agent-progress-legend .pending::before { background: #38413e; }
:root[data-theme="dark"] .agent-job.running { border-color: #4b86b7; }
:root[data-theme="dark"] .status.running,
:root[data-theme="dark"] .agent-state.running { background: #183b58; color: #a9d5f5; }
:root[data-theme="dark"] .agent-step.violation { background: rgba(210, 91, 77, .09); }
:root[data-theme="dark"] .agent-step.warning { background: rgba(214, 177, 85, .08); }
:root[data-theme="dark"] .agent-state, :root[data-theme="dark"] .severity { background: #303b37; color: #bdc7c3; }
:root[data-theme="dark"] .agent-state.passed { background: #254535; color: #b8dfc4; }
:root[data-theme="dark"] .agent-state.violation,
:root[data-theme="dark"] .agent-state.error,
:root[data-theme="dark"] .severity.major,
:root[data-theme="dark"] .severity.critical { background: #4b2926; color: #f0b0a8; }
:root[data-theme="dark"] .agent-state.not_verifiable,
:root[data-theme="dark"] .agent-state.warning,
:root[data-theme="dark"] .severity.minor { background: #493e20; color: #e8d18c; }
:root[data-theme="dark"] .toast { background: #e8efeb; color: #17221f; }

@media (max-width: 980px) {
  body.app-active { height: auto; min-height: 100vh; overflow: auto; }
  body.app-active main { height: auto; overflow: visible; }
  .public-layout { grid-template-columns: 1fr; }
  .auth-card { position: static; max-width: 560px; }
  .app-layout { height: auto; min-height: calc(100vh - 78px); overflow: visible; display: block; }
  .sidebar { position: sticky; top: 78px; z-index: 10; padding: 12px 20px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; justify-content: flex-start; }
  .sidebar .eyebrow, .sidebar-user { display: none; }
  .sidebar-navigation { width: 100%; display: flex; gap: 10px; overflow-x: auto; }
  .sidebar-section { flex: 0 0 auto; }
  .side-nav { display: flex; }
  .admin-side-nav { gap: 10px; }
  .admin-nav-section { display: flex; gap: 6px; }
  .admin-nav-section + .admin-nav-section { padding-top: 0; border-top: 0; }
  .sidebar-nav-heading { display: none; }
  .side-nav .mobile-account-nav { display: block; }
  .editor-grid { grid-template-columns: 1fr; }
  .declaration-layout { grid-template-columns: 1fr; }
  .about-section { grid-template-columns: 1fr; }
  .about-section-heading { position: static; }
  .about-principles { grid-template-columns: 1fr; }
  .about-principles article { padding: 22px 0; }
  .about-principles article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .about-outcome { grid-template-columns: 1fr; }
  .declaration-note { position: static; }
  .submission-nav-list { display: none; }
  .check-panel { position: static; }
  .workspace,
  body.editor-active .workspace { height: auto; overflow: visible; padding-bottom: 80px; display: block; }
  body.editor-active #editorView { display: block; }
  body.editor-active .editor-grid { display: grid; padding-bottom: 0; }
  body.editor-active .solution-form,
  body.editor-active .check-panel { overflow: visible; padding-right: 0; }
  .account-grid { grid-template-columns: 1fr; }
  .account-status-card { position: static; }
  .admin-settings-form { grid-template-columns: 1fr 1fr; }
  .statistics-metrics { grid-template-columns: 1fr 1fr; }
  .statistics-chart-grid { grid-template-columns: 1fr; }
  .admin-settings-form .button { grid-column: 1 / -1; }
  .agent-job-heading { flex-direction: column; }
  .decision-fields { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { height: auto; min-height: 70px; padding: 12px 18px; }
  .deadline-badge { display: none; }
  .theme-toggle-label { display: none; }
  .public-layout, .workspace { padding: 36px 18px 60px; }
  .process-grid { grid-template-columns: 1fr; }
  .about-help { align-items: flex-start; flex-direction: column; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading.editor-heading { align-items: flex-start; }
  .page-heading.editor-heading > .button-row { margin-bottom: 0; }
  .form-section { padding: 20px; grid-template-columns: 1fr; }
  .form-section label.full, .form-section .full { grid-column: auto; }
  .additional-solvers.full { grid-column: auto; }
  .additional-solvers-heading { align-items: flex-start; flex-direction: column; }
  .additional-solver-row { grid-template-columns: 1fr; }
  .section-heading { grid-template-columns: auto minmax(0, 1fr); column-gap: .6rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .statistics-controls { width: 100%; grid-template-columns: 1fr auto; }
  .verification-banner { align-items: flex-start; flex-direction: column; }
  .admin-settings-form { grid-template-columns: 1fr; }
  .admin-settings-form .button { grid-column: auto; }
  .llm-settings-grid { grid-template-columns: 1fr; }
  .agent-job-progress { grid-template-columns: 1fr; }
  .agent-public-grid { grid-template-columns: 1fr; }
  .agent-public-grid > div + div { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .decision-card-heading, .decision-card-footer { align-items: stretch; flex-direction: column; }
  .decision-send-panel { grid-template-columns: 1fr; }
  .decision-send-panel .form-message { grid-column: auto; }
}
