/* VDALedger -- free calculator
   ----------------------------
   Light and dark, 390px up. Deliberately plain: this is a page that tells
   someone what they owe the government, and the design job is to make the
   numbers legible and the reasoning followable, not to be memorable. */

:root {
  color-scheme: light;
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --ink: #1a1a18;
  --ink-2: #55524c;
  --ink-3: #7d7970;
  --line: #e3dfd8;
  --accent: #1f4d3f;
  --accent-ink: #ffffff;
  --gain: #1a6b4a;
  --loss: #a33a20;
  --error-bg: #fdf1ee;
  --error-line: #e7bcb0;
  --warn-bg: #fdf7e9;
  --warn-line: #e6d5a8;
  --info-bg: #eef4f2;
  --info-line: #c5d8d1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26, 26, 24, .05), 0 6px 20px rgba(26, 26, 24, .04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14150f;
    --surface: #1c1e17;
    --surface-2: #24261e;
    --ink: #eceade;
    --ink-2: #b5b2a4;
    --ink-3: #8a8779;
    --line: #33362b;
    --accent: #8fd0b4;
    --accent-ink: #14150f;
    --gain: #6fc79c;
    --loss: #e0866a;
    --error-bg: #2c1d18;
    --error-line: #5c352a;
    --warn-bg: #2b2618;
    --warn-line: #56492a;
    --info-bg: #1b241f;
    --info-line: #31463c;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1060px; margin: 0 auto; padding-inline: 20px; }
.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;
}
.muted { color: var(--ink-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-gain { color: var(--gain); }
.is-loss { color: var(--loss); }
.is-good { color: var(--gain); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

/* -- header ---------------------------------------------------------------- */
.site { border-bottom: 1px solid var(--line); background: var(--surface); }
.site__bar { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-block: 14px; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.brand__tag { margin: 0; color: var(--ink-2); font-size: 14px; }

/* -- hero ------------------------------------------------------------------ */
.hero { padding-block: 40px 8px; max-width: 68ch; }
h1 { font-size: clamp(26px, 4.4vw, 38px); line-height: 1.16; letter-spacing: -.02em; margin: 0 0 14px; }
.lede { font-size: clamp(16px, 2vw, 18px); color: var(--ink-2); margin: 0 0 20px; }
.lede strong { color: var(--ink); }

.privacy {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--info-bg); border: 1px solid var(--info-line);
  border-radius: var(--radius); padding: 14px 16px; margin: 0;
  font-size: 15px; color: var(--ink-2);
}
.privacy strong { color: var(--ink); }
.privacy__lock { font-size: 18px; line-height: 1.4; }

/* -- panel / dropzone ------------------------------------------------------ */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-block: 28px; box-shadow: var(--shadow);
}
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--surface-2); }
.dropzone.is-over { border-color: var(--accent); background: var(--info-bg); }
.dropzone.busy { opacity: .6; pointer-events: none; }
.dropzone__title { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.dropzone__sub { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }

.btn {
  font: inherit; font-size: 15px; border-radius: 8px; padding: 9px 16px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--quiet { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn--quiet:hover { color: var(--ink); border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: default; }

.linkbtn {
  font: inherit; font-size: 14px; background: none; border: 0; padding: 0;
  color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; margin-top: 18px; }
.control { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
select {
  font: inherit; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%;
}
.control__hint { flex: 1 1 260px; margin: 0; font-size: 13px; color: var(--ink-3); }

/* -- file list ------------------------------------------------------------- */
.files { display: grid; gap: 10px; margin-top: 18px; }
.file { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface-2); }
.file--refused { background: var(--error-bg); border-color: var(--error-line); }
.file__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file__head strong { word-break: break-all; }
.file__err { margin: 8px 0 0; font-size: 14px; }
.file__hint { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.file__skipped { margin-top: 8px; font-size: 13px; }
.file__skipped ul { margin: 8px 0 0; padding-left: 18px; }
.file__skipped li { margin-bottom: 6px; }

.pill {
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--info-bg); border: 1px solid var(--info-line); color: var(--ink-2);
}
.pill--muted { background: var(--surface-2); border-color: var(--line); }

/* -- summary --------------------------------------------------------------- */
.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; font-size: 15px; }
.banner--error { background: var(--error-bg); border: 1px solid var(--error-line); }
.banner a { color: inherit; }

.fy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button {
  font: inherit; font-size: 14px; padding: 7px 14px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink-2); border-right: 1px solid var(--line);
}
.segmented button:last-child { border-right: 0; }
.segmented button.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card--primary { border-color: var(--accent); }
.card--warn { background: var(--warn-bg); border-color: var(--warn-line); }
.card__label { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.card__value { font-size: clamp(21px, 3vw, 27px); font-weight: 650; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.card__sub { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* -- issues ---------------------------------------------------------------- */
.issues { border-radius: var(--radius); padding: 16px; margin-top: 20px; border: 1px solid var(--line); }
.issues--error { background: var(--error-bg); border-color: var(--error-line); }
.issues--warning { background: var(--warn-bg); border-color: var(--warn-line); }
.issues--info { background: var(--surface); }
.issues h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.issues > .muted { margin: 0 0 12px; font-size: 14px; }
.issues ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.issues li { border-top: 1px solid var(--line); padding-top: 12px; }
.issues li p { margin: 0; font-size: 15px; }
.issues .action { margin-top: 5px; font-size: 14px; font-weight: 600; color: var(--ink); }

/* -- tables ---------------------------------------------------------------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.table--compact { font-size: 13.5px; }
.table--compact th, .table--compact td { padding: 7px 10px; }
.table tfoot th { font-weight: 650; border-bottom: 0; }

#disposals { margin-top: 28px; }
#disposals h2 { font-size: 21px; margin: 0 0 6px; }
#disposals > .muted { margin: 0 0 14px; font-size: 14.5px; max-width: 70ch; }
.row.is-open > td { background: var(--surface-2); }
.row--unresolved > td:first-child { box-shadow: inset 3px 0 0 var(--loss); }
.warnmark { color: var(--loss); font-weight: 700; cursor: help; }
.working-row > td { padding: 0; background: var(--surface-2); }

/* -- the working ----------------------------------------------------------- */
.working { padding: 6px 12px 18px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; padding-left: 30px; position: relative; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700;
}
.steps h4 { margin: 0 0 6px; font-size: 15px; letter-spacing: -.01em; }
.steps p { margin: 0 0 6px; font-size: 14.5px; }
.calc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; display: inline-block; max-width: 100%;
  overflow-x: auto;
}
.calc.total { border-color: var(--accent); }
.note { font-size: 13.5px; color: var(--ink-2); background: var(--warn-bg);
  border-left: 3px solid var(--warn-line); padding: 8px 10px; border-radius: 0 6px 6px 0; }
.lot--missing td { color: var(--loss); font-style: italic; }

.assumptions { margin-top: 18px; }
.assumptions summary { cursor: pointer; font-weight: 600; font-size: 14.5px; padding: 6px 0; }
.holdings { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14.5px; }

/* -- method + footer ------------------------------------------------------- */
.method { margin-block: 44px 20px; }
.method h2 { font-size: 21px; margin: 0 0 14px; }
.method__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.method h3 { font-size: 15px; margin: 0 0 8px; }
.method ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.method strong { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 24px 36px; margin-top: 30px; }
.site-footer p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); max-width: 80ch; }
.site-footer strong { color: var(--ink); }

@media (max-width: 620px) {
  .panel { padding: 14px; }
  .table th, .table td { padding: 8px 9px; }
  .working { padding-inline: 4px; }
  .steps li { padding-left: 26px; }
}
