/* Double W Office: a sister to doublew.ventures. The same faces (League Gothic for
   display, Inter for text, Instrument Serif italic for accents, JetBrains Mono for
   labels), the same paper, ink and vermilion, pill buttons and big rounded cards. */
/* The website's faces, Latin only, served from /public/fonts (copied from the same
   @fontsource packages the website uses). */
@font-face { font-family: "League Gothic Variable"; font-style: normal; font-display: swap; font-weight: 400; font-stretch: 75% 100%; src: url(/public/fonts/league-gothic-latin-wdth-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/public/fonts/inter-latin-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-display: swap; font-weight: 400; src: url(/public/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url(/public/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --paper: #eeeae1; --card: #f7f4ec; --ink: #16120f; --muted: #5c554d; --line: rgba(22, 18, 15, 0.15);
  --vermilion: #f2541b; --cream: #fbf1c7; --green: #006b45; --green-soft: #dde9df; --warn: #c2341a; --warn-soft: #fbe2d9;
  --display: "League Gothic Variable", "League Gothic", "Oswald", system-ui, sans-serif;
  --body: "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* button styles mustn't override it */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
main { max-width: 1040px; margin: 0 auto; padding: 32px 20px 96px; }

/* ── Type ── */
h1, h2, .display { font-family: var(--display); font-weight: 400; font-stretch: condensed; text-transform: uppercase; letter-spacing: 0.02em; line-height: 0.92; margin: 0 0 16px; }
h1 { font-size: clamp(48px, 9vw, 88px); }
h2 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 12px; }
.serif, .lead em { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }
.lead { font-size: 18px; line-height: 1.5; color: var(--ink); max-width: 62ch; margin: 0 0 24px; }
.eyebrow, .label, label, legend, dt, caption, th, .count, .tag, .badge, .state, .when, .hint, .status, .tabs a, .rows small, .doc-row small, .todo small, .deadlines small, summary {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400;
}
.eyebrow { color: var(--muted); margin: 0 0 12px; }
.hint, .status { color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 12px; line-height: 1.6; }
.pre { white-space: pre-wrap; }
.mono { font-family: var(--mono); font-size: 13px; }

/* ── The bar ── */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--ink); }
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.mark .logo { height: 32px; width: auto; display: block; }
.mark .office { font-family: var(--serif); font-style: italic; font-size: 26px; line-height: 1; color: var(--vermilion); }
nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
nav a, nav button.link { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink); opacity: 0.7; }
nav a:hover, nav button.link:hover { opacity: 1; }
nav form { margin: 0; }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; row-gap: 12px; }
  nav { width: 100%; justify-content: flex-start; gap: 16px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  nav::-webkit-scrollbar { display: none; }
  nav a, nav form { flex: none; }
}

/* ── Surfaces ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 28px; }
@media (max-width: 640px) { .card { padding: 22px; border-radius: 22px; } }
.narrow { max-width: 460px; margin: 10vh auto 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 24px 0; }
.stack { display: grid; gap: 14px; margin-top: 16px; }
.head-row { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin: 36px 0 14px; }
.head-row h1, .head-row h2 { margin: 0; }
.head-row > a:not(.button) { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
section > .head-row:first-child, main > .head-row:first-child { margin-top: 0; }
.notice { border-radius: 16px; padding: 14px 16px; background: var(--green-soft); font-size: 15px; margin: 0 0 18px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 20px; }

/* ── Buttons: pills, spaced capitals ── */
button, a.button, label.button { font-family: var(--body); font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 24px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ink) 50%, transparent); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; transition: background 0.2s, color 0.2s, border-color 0.2s; }
button:hover, a.button:hover, label.button:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary, a.button.primary, label.button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary:hover, a.button.primary:hover, label.button.primary:hover { background: var(--vermilion); border-color: var(--vermilion); color: var(--ink); }
button.wide, a.button.wide { width: 100%; }
button:disabled { opacity: 0.45; cursor: default; }
button.link { min-height: 0; padding: 0; border: 0; background: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); font-weight: 400; }
button.link:hover { background: none; color: var(--ink); }
button.danger { color: var(--warn); }
label.button input[type=file] { display: none; }

/* ── Forms ── */
label { display: grid; gap: 6px; color: var(--muted); }
input[type=text], input[type=email], input[type=date], input[type=number], select { font: 16px/1.4 var(--body); text-transform: none; letter-spacing: 0; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 2px; }
input[type=radio], input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented { display: flex; gap: 8px; margin-top: 8px; }
.segmented legend { color: var(--muted); margin-bottom: 8px; }
.segmented label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); cursor: pointer; font-size: 12px; }
.segmented label:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.segmented input { accent-color: var(--vermilion); }
.fallback { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
summary { cursor: pointer; color: var(--muted); }

/* ── Lists ── */
.rows, .docs, .todos, .plain { list-style: none; padding: 0; margin: 0; }
.rows, .docs, .todos { border-top: 1px solid var(--ink); margin-bottom: 24px; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rows li span { display: grid; gap: 4px; }
.rows small, .doc-row small, .todo small { color: var(--muted); }
.doc-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.doc-row:hover b { text-decoration: underline; }
.doc-row span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.doc-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.badge.receipt { border-color: var(--vermilion); color: var(--vermilion); }
.state { color: var(--muted); text-align: right; }
.state.todo { color: var(--ink); }
.state.warn { color: var(--warn); }
@media (max-width: 560px) { .doc-row { grid-template-columns: 1fr auto; } .doc-row .badge { display: none; } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tabs a.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.count { display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); text-align: center; vertical-align: middle; margin-left: 6px; }

/* ── To do ── */
.group h2.overdue { color: var(--vermilion); }
.todo { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.todo > div { display: grid; gap: 6px; min-width: 0; }
.todo b { font-weight: 600; }
.todo.done b, .todo.dismissed b { text-decoration: line-through; color: var(--muted); }
.todo details p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.todo-actions { display: flex; gap: 12px; align-items: center; margin: 0; }
.todo-actions button:not(.link) { min-height: 36px; padding: 8px 16px; font-size: 11px; }
@media (max-width: 560px) { .todo { grid-template-columns: 1fr; } }
.when { color: var(--muted); }
.when.soon { color: var(--ink); }
.when.overdue { color: var(--vermilion); }
.add-todo { margin: 24px 0; }
.closed { margin-top: 24px; }

/* ── Home ── */
.capture { display: grid; gap: 10px; margin: 20px 0 8px; }
@media (min-width: 640px) { .capture { grid-template-columns: 1fr 1fr; } }
.capture.big .button { min-height: 64px; font-size: 13px; }

/* ── A document and its reading ── */
.reading { margin: 8px 0 28px; }
.reading > .lead { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.25; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 20px; margin: 0 0 24px; }
.facts div { border-top: 1px solid var(--ink); padding: 10px 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 600; display: grid; }
.facts dd small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.facts.small { margin-top: 28px; }
.kv { width: 100%; border-collapse: collapse; margin: 0 0 24px; }
.kv caption { text-align: left; color: var(--muted); padding-bottom: 8px; }
.kv th, .kv td { text-align: left; padding: 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.kv th { width: 40%; color: var(--muted); padding-right: 12px; }
.correct { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.pdf { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 22px; background: #fff; margin-top: 8px; }
.open-pdf { display: none; }
@media (max-width: 640px) { .pdf { display: none; } .open-pdf { display: flex; width: 100%; } }
.read-again { margin-top: 16px; }

/* ── Scanning ── */
.pages { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.pages li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 8px; background: var(--paper); }
.pages img, .pdf-thumb { width: 56px; height: 72px; object-fit: cover; border-radius: 8px; background: #fff; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pages li > span:nth-child(2) { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.page-actions { display: flex; gap: 14px; }
.scan > label { margin-bottom: 16px; }

/* ── Tables (receipts) ── */
.grid-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--ink); margin-bottom: 24px; }
.grid-table th, .grid-table td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); }
.grid-table td { font-size: 15px; }
.grid-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table tfoot th, .grid-table tfoot td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 600; }
@media (max-width: 560px) { .grid-table th:nth-child(3), .grid-table td:nth-child(3) { display: none; } }
.deadlines li { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.plain li .count { margin-left: 8px; }

/* Step 4: the Account page */
main > .card + .card, main > h1 + .card, main > .notice + .card { margin-top: 20px; }
h2.sub { margin-top: 28px; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 12px; }
.row-buttons form { margin: 0; }
input[readonly] { font-family: var(--mono); font-size: 13px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); }
