:root {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #fff;
  --inset: #f7f7f5;
  --text: #242520;
  --muted: #62655d;
  --line: #dedfd8;
  --accent: #30362d;
  --on-accent: #fff;
  --focus: #5267b0;
  --danger: #a13333;
  --space: 1.75rem;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-synthesis: none;
}
:root[data-theme="warm"] { --page: #f6f1e9; --surface: #fffdf8; --inset: #f7f1e6; --text: #342a22; --muted: #716252; --line: #e0d5c5; --accent: #604b37; }
:root[data-theme="dark"] { color-scheme: dark; --page: #171917; --surface: #202320; --inset: #282c28; --text: #eef0e9; --muted: #b0b7ad; --line: #41463e; --accent: #e0e6d9; --on-accent: #20271d; --focus: #a7b6fa; --danger: #ffa8a3; }
:root[data-layout="compact"] { --space: 1.1rem; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; justify-content: center; align-items: center; gap: .65rem; min-height: 2.75rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); color: var(--text); padding: .6rem 1rem; font-size: .9rem; font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--inset); }
button.primary, .button.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
button.primary:hover, .button.primary:hover { filter: brightness(.94); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, select, textarea { width: 100%; min-height: 2.75rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); color: var(--text); }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 1.1rem; min-height: 1.1rem; height: 1.1rem; flex: 0 0 1.1rem; margin: .25rem 0 0; accent-color: var(--accent); }
label { display: block; font-size: .9rem; font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
h1, h2, h3, h4, p { margin: 0 0 1rem; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 550; letter-spacing: -.045em; line-height: 1.14; }
h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.025em; }
h3 { font-size: 1rem; margin-top: 1.5rem; }
h4 { font-size: .95rem; }
.muted, .field-help, .fine-print { color: var(--muted); }
.eyebrow { color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .15em; font-weight: 650; margin-bottom: .85rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 28rem; }
.fine-print, .field-help { font-size: .8rem; line-height: 1.6; }
.fine-print { margin-top: 1.5rem; margin-bottom: 0; }
.field-help { margin: .4rem 0 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 5; padding: .6rem 1rem; background: var(--surface); border: 1px solid var(--line); }
.skip-link:focus { top: 1rem; }
.public-page { min-height: 100svh; display: grid; place-items: center; }
.public-shell { width: min(100% - 2rem, 32rem); padding: 3rem 0; }
.welcome-card, .auth-card { padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); background: var(--surface); border-radius: 1.1rem; }
.welcome-card h1 { margin: 1.5rem 0; }
.welcome-card .button { margin-top: 1.25rem; }
.auth-card { width: min(420px, 100%); margin-inline: auto; padding: 24px; }
.auth-card h1 { font-size: 2rem; margin-top: 1.25rem; }
.auth-card .eyebrow { margin-top: 2rem; }
.quiet-link, .public-footer { font-size: .85rem; color: var(--muted); }
.public-footer { text-align: center; padding-top: 1.5rem; }
.form-stack label { margin-bottom: .4rem; }
.form-stack input:not([type="checkbox"]):not([type="radio"]), .form-stack select, .form-stack textarea { margin-bottom: 1rem; }
.form-stack > .primary, .auth-card .form-stack button { margin-top: .75rem; }
.auth-card .form-stack button { width: 100%; }
.notice { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .5rem; font-size: .9rem; }
.error { color: var(--danger); }
.workspace-shell { width: min(100% - 4rem, 76rem); margin: auto; }
.workspace-header, .workspace-footer { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 0; }
.workspace-header { border-bottom: 1px solid var(--line); }
.wordmark { font-size: .9rem; font-weight: 600; text-decoration: none; letter-spacing: -.02em; }
.text-button { border-color: transparent; background: transparent; color: var(--muted); padding: .5rem; min-height: 2.75rem; font-size: .85rem; }
.greeting { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 3.5rem 0 2rem; }
.greeting h1 { margin-bottom: .75rem; }
.greeting p:last-child { margin-bottom: 0; }
.greeting-actions, .button-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.surface { border: 1px solid var(--line); background: var(--surface); border-radius: .85rem; padding: var(--space); margin-bottom: 1.25rem; }
.surface-header, .section-heading { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.surface-header h2 { margin-bottom: 0; }
.surface-header .eyebrow { margin-bottom: .3rem; }
.report-controls { display: flex; align-items: center; gap: .5rem; }
.report-controls select { width: auto; }
#report-status { margin: 1.25rem 0; font-size: .85rem; }
.report-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; margin: 1.25rem 0; }
.report-totals:empty { display: none; }
.report-totals > p { grid-column: 1 / -1; min-width: 0; margin: 0; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.metric { background: var(--inset); padding: 1rem; border-radius: .6rem; min-width: 0; }
.metric-label { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .4rem; }
.metric-value { display: block; font-size: clamp(1.3rem, 2.5vw, 1.9rem); font-weight: 550; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow-x: auto; }
.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th { text-align: left; font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
th, td { padding: .9rem .75rem; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td { font-variant-numeric: tabular-nums; }
td small, td .muted { display: block; }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 2rem .75rem; color: var(--muted); text-align: center; }
.source-link { display: inline-block; font-size: .8rem; margin-top: 1rem; }
.workspace-details { padding: 0; scroll-margin-top: 1rem; }
.workspace-details > summary { cursor: pointer; padding: 1.2rem var(--space); font-size: .95rem; font-weight: 600; }
.summary-note { margin-left: .75rem; color: var(--muted); font-size: .8rem; font-weight: 400; }
.workspace-details[open] > summary { border-bottom: 1px solid var(--line); }
.details-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.details-grid > section { padding: var(--space); min-width: 0; }
.details-grid > section:nth-child(even) { border-left: 1px solid var(--line); }
.details-grid > section:nth-child(n+3) { border-top: 1px solid var(--line); }
.details-grid .muted { font-size: .85rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.status { font-size: .82rem; color: var(--muted); margin: .75rem 0; overflow-wrap: anywhere; }
.status[data-state="error"] { color: var(--danger); }
.status:empty { display: none; }
.checklist { display: grid; gap: .6rem; margin-bottom: 1.5rem; }
.checklist label, .reference-choice { display: flex; align-items: flex-start; gap: .75rem; padding: .5rem 0; cursor: pointer; }
.checklist strong { display: block; font-size: .85rem; font-weight: 550; }
.checklist small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; margin-top: .15rem; }
.reference-list { display: grid; gap: .6rem; margin-bottom: 1.25rem; }
.reference-card { padding: .85rem; border: 1px solid var(--line); border-radius: .5rem; }
.reference-card a { display: inline-block; font-size: .8rem; margin-right: .75rem; }
.reference-card .field-help { margin-bottom: .6rem; }
.resource-list { list-style: none; margin: 0; padding: 0; }
.resource-list li { padding: .85rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.resource-list li:last-child { border-bottom: 0; }
.resource-list p { font-size: .85rem; margin: 0 0 .4rem; }
.resource-list a { display: inline-block; font-size: .82rem; margin-right: 1rem; }
.request-state { display: inline-block; font-size: .72rem; border: 1px solid var(--line); padding: .15rem .5rem; border-radius: 2rem; margin-bottom: .4rem; color: var(--muted); }
.workspace-footer { color: var(--muted); font-size: .75rem; padding: .5rem 0 2rem; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .workspace-shell { width: calc(100% - 2rem); }
  .greeting { align-items: flex-start; flex-direction: column; padding-top: 2rem; gap: 1.25rem; }
  .details-grid { grid-template-columns: minmax(0, 1fr); }
  .details-grid > section:nth-child(even) { border-left: 0; }
  .details-grid > section + section { border-top: 1px solid var(--line); }
  .summary-note { display: block; margin: .35rem 0 0 1rem; }
  .surface-header { align-items: flex-start; flex-wrap: wrap; }
  th, td { padding: .75rem .6rem; }
}
@media (max-width: 420px) {
  :root { --space: 1rem; }
  .report-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: .75rem; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .public-shell { width: calc(100% - 1.5rem); }
  .greeting-actions { width: 100%; }
  .greeting-actions .button { flex: 1 1 auto; }
  .report-controls { width: 100%; }
  .report-controls select { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) { details[open] .details-grid { animation: reveal .15s ease-out; } @keyframes reveal { from { opacity: .4; } to { opacity: 1; } } }
@media print { .workspace-header form, .greeting-actions, .workspace-details, .report-controls, .skip-link { display: none; } .workspace-shell { width: 100%; } .surface { border: 0; } }
