/* YearEndReceipts site: the app's look (apps/receipts/web/style.css) for pages.
   Paper white, ink, hairlines, one green; amber and red only for warnings.
   Light only, small radii, flat buttons, ruled tables like a bank statement. */

:root {
  color-scheme: only light;
  --bg: #fcfbf8;
  --surface: #ffffff;
  --surface-2: #f6f4ee;
  --text: #17201d;
  --muted: #59635f;
  --line: #dcd8ce;
  --line-strong: #8d887b;
  --accent: #1e5c4d;
  --accent-strong: #154437;
  --accent-soft: #eef4f1;
  --on-accent: #ffffff;
  --warn: #7c4a03;
  --warn-soft: #fbf6e6;
  --error: #9c2b2b;
  --error-soft: #fbf0ee;
  --radius: 4px;
  --radius-s: 3px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2359635f' stroke-width='1.6' stroke-linecap='square'%3E%3Cpath d='M4 6.2 8 10l4-3.8'/%3E%3C/svg%3E");
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231e5c4d' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M3.5 8.5 6.6 11.5 12.5 5'/%3E%3C/svg%3E");
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 30; background: var(--surface); padding: 0.5rem 1rem; border: 1px solid var(--text); color: var(--text); }
.skip:focus { left: 0.5rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(68rem, 100% - 4rem); margin-inline: auto; }

/* Type */

h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 2.6rem; line-height: 1.1; margin: 0 0 1rem; }
h2 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 1rem; }
h3 { font-size: 1.02rem; font-weight: 650; line-height: 1.35; margin: 0 0 0.35rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.15rem; line-height: 1.55; color: var(--muted); max-width: 40rem; text-wrap: pretty; }
.fine { font-size: 0.9rem; color: var(--muted); }
.label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
code, kbd { font: 0.88em var(--mono); background: var(--surface-2); border-radius: 2px; padding: 0.05em 0.3em; }
strong { font-weight: 650; }

/* Buttons: flat, one green */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  min-height: 2.6rem;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.button.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.button.ghost:hover { border-color: var(--text); color: var(--text); }
.button.big { font-size: 1.02rem; padding: 0.8rem 1.4rem; min-height: 3rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1rem; }

/* Header and footer */

.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.head-row { display: flex; align-items: center; gap: 2rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; font-weight: 650; font-size: 1.02rem; color: var(--text); text-decoration: none; letter-spacing: -0.005em; }
.brand:hover { color: var(--text); }
.mark { width: 1.5rem; height: 1.5rem; flex: none; }
.mark .tile { fill: var(--accent); }
.mark .paper { fill: var(--on-accent); }
.mark .ink { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--text); text-decoration: none; font-size: 0.95rem; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }

.draft-banner { background: var(--warn-soft); border-bottom: 1px solid var(--line); border-top: 3px solid var(--warn); padding: 0.7rem 0; color: var(--warn); }
.draft-banner strong { color: var(--warn); }

.site-foot { border-top: 1px solid var(--line); margin-top: 5rem; padding: 3rem 0 2rem; font-size: 0.92rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
.foot-grid h2 { font: 700 0.74rem/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 0 0 0.4rem; }
.foot-grid a { color: var(--text); }
.foot-grid .fine { margin-top: 0.75rem; max-width: 18rem; }
.foot-base { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.25rem; color: var(--muted); font-size: 0.86rem; }
.foot-base p { margin: 0 0 0.4rem; }
.foot-base a { color: var(--muted); }

/* Sections */

main { display: block; }
.section { padding: 4rem 0 0; }
.section > h2:first-child, .section .head h2 { margin-top: 0; }
.page-head + .section { padding-top: 1.5rem; }
.rule-top { border-top: 1px solid var(--line); padding-top: 3rem; margin-top: 4rem; }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 4rem; align-items: start; padding-top: 4rem; }
.hero h1 { font-size: 3.1rem; }
.hero .lead { font-size: 1.2rem; }

.sheet { margin: 0; }
.sheet img { display: block; width: 100%; border: 1px solid var(--line-strong); background: #fff; }
.sheet figcaption { margin-top: 0.75rem; font-size: 0.86rem; color: var(--muted); text-wrap: pretty; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.two > div > :last-child { margin-bottom: 0; }

/* A numbered list with hairlines, like the app's steps */

ol.steps { list-style: none; margin: 0 0 2rem; padding: 0; border-top: 1px solid var(--text); counter-reset: step; }
ol.steps > li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0 1rem; align-items: baseline; padding: 1.25rem 0; border-bottom: 1px solid var(--line); counter-increment: step; }
ol.steps > li::before { content: counter(step); font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
ol.steps > li > :last-child { margin-bottom: 0; }
ol.steps p { margin: 0; color: var(--muted); }
ol.steps.compact > li { grid-template-columns: 2rem minmax(0, 1fr); padding: 0.85rem 0; }
ol.steps.compact > li::before { font-size: 1.25rem; }
ol.steps.compact p { color: var(--text); }
ol.steps ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
ol.steps li li { margin-bottom: 0.3rem; }

/* Ruled lists and tables */

.ruled-list { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--line); }
.ruled-list > li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.ruled-list.sources > li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 0 1.5rem; }
.ruled-list.sources span { color: var(--muted); }
.ruled-list.ticks > li { padding-left: 1.6rem; background: var(--tick) left 1.05rem / 0.95rem no-repeat; }

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
table.ruled { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
table.ruled caption { text-align: left; font-weight: 650; margin-bottom: 0.5rem; }
table.ruled th, table.ruled td { padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.ruled th:last-child, table.ruled td:last-child { padding-right: 0; }
table.ruled thead th { padding-block: 0.45rem; border-bottom: 1px solid var(--text); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
table.ruled tbody th { font-weight: 650; }
table.ruled .money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.ruled tbody .money { font-weight: 650; font-size: 1.05rem; }
table.ruled tfoot td, table.ruled tfoot th { border-top: 1px solid var(--text); border-bottom: 0; font-weight: 650; }
table.ruled td.act { text-align: right; white-space: nowrap; }
table.ruled .sub { display: block; color: var(--muted); font-weight: 400; font-size: 0.9rem; }

/* Notices: a hairline box with a coloured rule down the left */

.notice { border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 0.85rem 1rem; margin: 0 0 1.5rem; background: var(--surface); font-size: 0.95rem; text-wrap: pretty; }
.notice > :last-child { margin-bottom: 0; }
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice.warn strong { color: var(--warn); }
.notice.ok { background: var(--accent-soft); border-left-color: var(--accent); }

.review-note { border: 1px dashed var(--warn); background: var(--warn-soft); color: var(--warn); padding: 0.6rem 0.85rem; margin: 0 0 1.25rem; font-size: 0.9rem; border-radius: var(--radius-s); }
mark.placeholder { background: var(--warn-soft); color: var(--warn); font: 0.9em var(--mono); padding: 0 0.2em; outline: 1px dashed var(--warn); }

/* FAQ: the marker sits on the question's first line; answers align with the question text */

.faqs { border-top: 1px solid var(--line); margin: 0 0 1.5rem; }
details.faq { border-bottom: 1px solid var(--line); padding: 0.9rem 0; }
details.faq > summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 1rem minmax(0, 1fr); column-gap: 0.65rem; align-items: start; font-weight: 650; font-size: 1.02rem; line-height: 1.4; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::before { content: ""; height: 1.4em; background: var(--chevron) center / 1rem no-repeat; transform: rotate(-90deg); transition: transform 0.15s ease; }
details.faq > summary:hover { color: var(--accent-strong); }
details.faq[open] > summary::before { transform: none; }
details.faq > :not(summary) { margin: 0.5rem 0 0 1.65rem; }
details.faq > :last-child { margin-bottom: 0.15rem; }

/* Prose pages: guides, rules, legal */

/* The text column starts at the same left edge as the header and the home page. */
.prose { padding-top: 3.5rem; }
.prose > * { max-width: 44rem; }
.prose h2 { margin-top: 2.75rem; }
.prose h3 { margin-top: 1.75rem; }
.prose ul, .prose ol:not(.steps) { padding-left: 1.3rem; margin: 0 0 1.25rem; }
.prose li { margin: 0 0 0.45rem; }
.prose .sheet { margin: 1.5rem 0 2rem; max-width: 30rem; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: var(--muted); }
.page-head { padding-top: 3.5rem; }
.updated { font-size: 0.88rem; color: var(--muted); }

.sources-note { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1rem; font-size: 0.9rem; color: var(--muted); }
.sources-note ul { padding-left: 1.2rem; }

/* A template to copy */

.template { position: relative; margin: 0 0 1.5rem; }
.template pre { margin: 0; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); font: 0.86rem/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.template .copy { position: absolute; top: 0.5rem; right: 0.5rem; min-height: 2rem; padding: 0.3rem 0.7rem; font-size: 0.84rem; background: var(--surface); }

/* Forms (the key recovery page) */

form.recover { margin: 0 0 1.5rem; max-width: 26rem; }
form.recover fieldset { border: 0; margin: 0; padding: 0; }
form.recover label { font-weight: 600; font-size: 0.9rem; }
form.recover input { font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 0.5rem 0.65rem; width: 100%; min-height: 2.6rem; margin-top: 0.35rem; }
form.recover fieldset:disabled { opacity: 0.6; }

/* Calls to action */

.cta { border-top: 1px solid var(--text); border-bottom: 1px solid var(--line); padding: 2rem 0; margin-top: 4rem; display: flex; gap: 2rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta h2 { margin: 0 0 0.3rem; font-size: 1.5rem; }
.cta p { margin: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0; border-top: 1px solid var(--line); margin: 0 0 2rem; padding: 0; list-style: none; }
.cards li { border-bottom: 1px solid var(--line); padding: 1rem 1.5rem 1rem 0; }
.cards a { font-weight: 650; }
.cards p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* Narrow windows */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero .sheet { max-width: 30rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .site-nav ul { gap: 1.1rem; }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 2rem); }
  .head-row { flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0.75rem 0 0; min-height: 0; }
  .head-cta { margin-left: auto; min-height: 2.3rem; padding: 0.4rem 0.8rem; font-size: 0.9rem; }
  .site-nav { order: 3; width: 100%; margin: 0; }
  .site-nav ul { gap: 0 1.1rem; flex-wrap: wrap; padding: 0.35rem 0 0.5rem; }
  .site-nav a { font-size: 0.9rem; display: inline-block; padding: 0.35rem 0; }
  h1, .hero h1 { font-size: 2.05rem; }
  h2 { font-size: 1.45rem; }
  .lead, .hero .lead { font-size: 1.05rem; }
  .hero, .prose, .page-head { padding-top: 2.25rem; }
  .section { padding-top: 3rem; }
  .page-head + .section { padding-top: 1.5rem; }
.rule-top { margin-top: 3rem; padding-top: 2.25rem; }
  .two { grid-template-columns: 1fr; gap: 2rem; }
  .ruled-list.sources > li { grid-template-columns: 1fr; }
  ol.steps > li { grid-template-columns: 2rem minmax(0, 1fr); }
  .foot-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .actions .button { flex: 1 1 auto; }
  table.ruled.stack thead { display: none; }
  table.ruled.stack, table.ruled.stack tbody, table.ruled.stack tr, table.ruled.stack th, table.ruled.stack td { display: block; width: 100%; padding-right: 0; }
  table.ruled.stack tr { border-bottom: 1px solid var(--line); padding: 0.9rem 0; }
  table.ruled.stack tr:first-child { border-top: 1px solid var(--text); }
  table.ruled.stack th, table.ruled.stack td { border: 0; padding: 0.15rem 0; }
  table.ruled.stack .money, table.ruled.stack td.act { text-align: left; }
  table.ruled.stack td.act { padding-top: 0.6rem; }
  .cta { margin-top: 3rem; }
}

@media print {
  .site-head, .site-foot, .cta, .draft-banner { display: none; }
}
