/* Pennyweek — a year of weeks you tick off, drawn like the app's grid: emerald on a calm ground. */
:root {
  --bg: #f3f6f3; --paper: #ffffff; --fg: #14201a; --muted: #566860;
  --line: #dbe4de; --accent: #047857; --ink: #056549; --chip: #d5efe2;
  --on-accent: #ffffff; --warn: #9a3412;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1310; --paper: #161f1a; --fg: #e8f1ec; --muted: #9db0a6;
    --line: #26342c; --accent: #34d399; --ink: #34d399; --chip: #143a2b;
    --on-accent: #05221a; --warn: #fdba74;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
.wrap { max-width: 48rem; margin: 0 auto; padding: 0 16px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; font-size: 0.9rem; }
.bar a { color: var(--muted); text-decoration: none; }
.bar a:hover { color: var(--fg); }
.bar .id { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.bar .id img { width: 26px; height: 26px; border-radius: 7px; display: block; }

.hero { padding: clamp(24px, 7vw, 52px) 0 12px; }
.kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.95rem; margin: 0 0 14px; }
.kicker img { width: 44px; height: 44px; border-radius: 11px; }
h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 14px; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(1.3rem, 4vw, 1.6rem); letter-spacing: -0.02em; margin: 2em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 1.4em 0 0.4em; }
.sub { font-size: clamp(1.03rem, 3.2vw, 1.18rem); color: var(--muted); margin: 0 0 20px; max-width: 38rem; }
.soon { display: inline-block; background: var(--chip); color: var(--ink); font-weight: 650; padding: 8px 14px; border-radius: 999px; font-size: 0.95rem; }
section { margin: 2.2em 0; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
li { margin: 0.4em 0; }
small { font-size: 0.82em; }

/* The page's centrepiece: a sketch of the app's main screen. */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 10px 30px -18px rgba(4, 60, 44, 0.4); }
.card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card .head h2 { margin: 0; }
.card .head small { color: var(--muted); }
.card .fields { margin-top: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0 4px; }
.chips button { font: inherit; font-size: 0.9rem; border: 1px solid var(--line); background: transparent; color: var(--fg); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.demo-head { margin-top: 10px; }
.eyebrow { margin: 0 0 2px; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); font-weight: 650; }
.saved { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.saved b { font-size: clamp(2.2rem, 10vw, 3rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.saved span { color: var(--muted); font-size: 1.05rem; }
.progress { height: 9px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.demo-head .line { margin: 8px 0 0; color: var(--muted); font-size: 0.92rem; }
.demo-next { margin: 16px 0; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 14px; background: var(--bg); }
.nextrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 10px; font-size: 1.05rem; font-weight: 600; }
.nextrow b { color: var(--accent); font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 7px; }
.cell { font: inherit; color: var(--fg); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 5px 2px 6px; text-align: center; cursor: pointer; line-height: 1.25; min-width: 0; }
.cell small { display: block; color: var(--muted); font-size: 0.68rem; }
.cell b { display: block; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.cell.next { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cell.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cell.on small { color: var(--on-accent); opacity: 0.8; }
.cell:focus-visible, .btn:focus-visible, .chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-note { color: var(--muted); font-size: 0.88rem; margin: 12px 0 0; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.feature h3 { margin: 0 0 4px; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.after-tiers { margin-top: 14px; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tier { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--paper); }
.tier h3 { margin: 0 0 6px; font-size: 1.02rem; }
.tier.pro { border-color: var(--accent); }
.tier ul { margin: 0; padding-left: 1.1em; font-size: 0.95rem; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.shots img { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line); }

.honest li b { display: inline; }
.reviewed { color: var(--muted); font-size: 0.85rem; }
footer { border-top: 1px solid var(--line); margin-top: 3em; padding: 20px 0 40px; color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 14px; }
footer a { color: var(--muted); }

/* Legal and help pages */
.doc h2 { font-size: 1.2rem; margin: 1.8em 0 0.5em; }
.doc p, .doc li { line-height: 1.62; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }

/* ------------------------------------------------------------------ tool pages */
.answer { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; padding: 12px 16px; margin: 0 0 8px; }
.answer p { margin: 0.35em 0; }
.tablewrap { overflow-x: auto; margin: 0.6em 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.94rem; background: var(--paper); border-radius: 14px; overflow: hidden; }
table.data caption { text-align: left; color: var(--muted); font-size: 0.88rem; padding: 0 0 6px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
table.data tbody th { font-weight: 650; text-transform: none; letter-spacing: 0; font-size: 0.94rem; color: var(--fg); }
table.data td.n { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data small { display: block; font-size: 0.78rem; font-weight: 400; color: var(--muted); }
table.data tr.sum th, table.data tr.sum td { border-top: 2px solid var(--line); }
.more { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.more li { margin: 0; }
.more a { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; text-decoration: none; color: var(--fg); height: 100%; }
.more a b { display: block; color: var(--ink); }
.more a span { color: var(--muted); font-size: 0.9rem; }
.app-note { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.app-note img.shot { width: 150px; height: auto; border-radius: 16px; border: 1px solid var(--line); }
.app-note h2 { margin-top: 0; }
.app-note .soon { margin-top: 4px; }

/* The PDF buttons under the heading of a tool page */
.get { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 14px; }
.get .hint { margin: 0; }

/* The hub of printables: one line each, with its PDF and its calculator */
.picks { list-style: none; padding: 0; margin: 0.5em 0 0; display: grid; gap: 10px; }
.picks li { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.picks b { display: block; color: var(--ink); }
.picks p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.picks .go { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: flex-end; }
.picks .btn { padding: 7px 14px; font-size: 0.92rem; }

/* Calculators */
.calc { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 10px 30px -18px rgba(4, 60, 44, 0.4); }
.calc h2 { margin: 0 0 10px; font-size: 1.15rem; }
.calc .fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); min-width: 0; }
.calc input, .calc select { font: inherit; font-size: 1rem; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); min-width: 0; max-width: 100%; }
.calc input[type="number"] { width: 7.5em; }
.calc input[type="text"] { width: 5em; }
.calc input[type="date"] { width: 10.5em; }
.calc input:focus-visible, .calc select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.calc .actions { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 14px 0 0; }
.calc .actions .hint { margin: 0; }
.calc h3.more-h { margin: 18px 0 8px; font-size: 1rem; }
.result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.result p { margin: 0.35em 0; }
.result .warn, .warn { color: var(--warn); font-weight: 600; }
.hint { color: var(--muted); font-size: 0.9rem; }
.btn { display: inline-block; font: inherit; border: 0; cursor: pointer; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 650; padding: 10px 18px; border-radius: 999px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
button.link { font: inherit; background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; }
.nw { white-space: nowrap; }

/* The sheet: what the print button prints */
.sheet { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.sheet-title { margin: 0 0 4px; font-size: 1.15rem; }
.sheet-sub { margin: 0.2em 0; color: var(--muted); font-size: 0.92rem; }
.sheet-sub b { color: var(--fg); }
.sheet-foot { display: none; }
.chart { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 12px; overflow-x: auto; }
@media (min-width: 720px) { .chart.cols-2 { grid-template-columns: 1fr 1fr; gap: 0 32px; } }
.chart-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.chart-table th, .chart-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.chart-table thead th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.chart-table tbody th { font-weight: 650; }
.chart-table .r { text-align: right; white-space: nowrap; }
.chart.fit-1 .chart-table { font-size: 0.86rem; }
.chart.fit-2 .chart-table { font-size: 0.8rem; }
.chart.fit-3 .chart-table { font-size: 0.72rem; }
.chart-table .c { text-align: center; width: 2.4em; }
.chart-table td.d { white-space: nowrap; color: var(--muted); }
.chart-table td.d.blank { min-width: 5em; }
.box { display: inline-block; width: 1.1em; height: 1.1em; border: 1.5px solid var(--muted); border-radius: 3px; vertical-align: -0.2em; }

.egrid { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
@media (min-width: 560px) { .egrid { grid-template-columns: repeat(10, 1fr); } }
.egrid li { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; text-align: center; padding: 14px 2px 6px; min-width: 0; font-variant-numeric: tabular-nums; line-height: 1.2; background: var(--paper); }
.egrid li:not(:has(.n)) { padding-top: 9px; padding-bottom: 9px; }
.egrid .n { position: absolute; top: 2px; left: 5px; font-size: 0.62rem; color: var(--muted); }
.egrid b { font-size: 0.95rem; }
.egrid.fit-1 b { font-size: 0.82rem; }
.egrid.fit-2 b { font-size: 0.7rem; }
.egrid.fit-3 b { font-size: 0.62rem; }
.egrid.fit-4 b { font-size: 0.56rem; }
.egrid li { overflow: hidden; }

.pgrid { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.pgrid li { margin: 0; border: 1px solid var(--line); border-radius: 6px; text-align: center; padding: 2px 0 3px; font-variant-numeric: tabular-nums; line-height: 1.2; min-width: 0; background: var(--paper); }
.pgrid .n { display: block; font-size: 0.6rem; color: var(--muted); }
.pgrid b { font-size: 0.78rem; font-weight: 600; }
.months-title { margin-top: 14px; }
.months { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 6px 14px; }
.months li { margin: 0; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 2px 0; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.months li span { color: var(--muted); }

@media (max-width: 560px) {
  .picks li { grid-template-columns: 1fr; }
  .picks .go { justify-content: flex-start; }
  .app-note { grid-template-columns: 1fr; }
  .app-note img.shot { width: 60%; max-width: 220px; justify-self: center; }
  table.data th, table.data td { padding: 8px 7px; }
  table.data { font-size: 0.9rem; }
}
@media (max-width: 420px) {
  .calc { padding: 14px; }
  .chart-table { font-size: 0.86rem; }
  .chart-table th, .chart-table td { padding: 5px 4px; }
  table.data th, table.data td { padding: 8px 5px; }
  table.data thead th { letter-spacing: 0.02em; }
  /* the hub's table has five columns and has to fit a phone */
  table.data.compact { font-size: 0.86rem; }
  table.data.compact th, table.data.compact td { padding: 8px 3px; }
  table.data.compact thead th { font-size: 0.66rem; letter-spacing: 0; }
}

/* ------------------------------------------------------------------ paper: only the sheet is printed */
@media print {
  @page { margin: 12mm; }
  :root { --bg: #fff; --paper: #fff; --fg: #000; --muted: #222; --line: #888; --accent: #000; --ink: #000; --chip: #eee; --on-accent: #fff; color-scheme: light; }
  body { background: #fff; color: #000; font-size: 10pt; line-height: 1.25; }
  .wrap { max-width: none; padding: 0; margin: 0; }
  /* A tool page prints only its sheet; every other page prints as it is. */
  .tool .wrap > :not(.printable) { display: none !important; }
  .printable { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; border-radius: 0; }
  .tool .printable > :not(.sheet):not(.sheet-foot) { display: none !important; }
  .sheet { margin: 0; border: 0; padding: 0; }
  .sheet-title { font-size: 16pt; margin: 0 0 1.5mm; }
  .sheet-sub { font-size: 9.5pt; color: #000; margin: 0 0 1mm; }
  .sheet-foot { display: block; margin: 4mm 0 0; font-size: 8.5pt; color: #222; }
  .chart { margin-top: 4mm; }
  .chart.cols-2 { grid-template-columns: 1fr 1fr; gap: 0 9mm; }
  .chart-table { font-size: 9.5pt; break-inside: avoid; }
  .chart-table th, .chart-table td { padding: 0 1.4mm; border-bottom: 0.25mm solid #777; }
  .chart-table thead th { font-size: 7.5pt; color: #000; padding-bottom: 1mm; border-bottom: 0.4mm solid #000; }
  .chart-table tbody tr { height: 7.8mm; break-inside: avoid; }
  .chart.cols-2.rows-13 .chart-table tbody tr { height: 15mm; }
  .chart.cols-1 { max-width: 165mm; }
  .chart.cols-1 .chart-table { font-size: 11pt; }
  .chart.cols-1 .chart-table tbody tr { height: 13mm; }
  .chart { overflow: visible; }
  .chart.fit-1 .chart-table { font-size: 8.5pt; }
  .chart.fit-2 .chart-table { font-size: 7.5pt; }
  .chart.fit-3 .chart-table { font-size: 6.5pt; }
  .chart-table td.d { color: #000; }
  .chart-table td.d.blank { min-width: 20mm; }
  .box { width: 4.4mm; height: 4.4mm; border: 0.35mm solid #000; border-radius: 0; vertical-align: middle; }
  .egrid { grid-template-columns: repeat(10, 1fr); gap: 0; margin-top: 4mm; border-top: 0.3mm solid #000; border-left: 0.3mm solid #000; }
  .egrid li { height: 20mm; border-radius: 0; border: 0; border-right: 0.3mm solid #000; border-bottom: 0.3mm solid #000; padding: 0; display: flex; align-items: center; justify-content: center; }
  .egrid li:not(:has(.n)) { padding: 0; }
  .egrid b { font-size: 15pt; }
  .egrid.fit-1 b { font-size: 12pt; }
  .egrid.fit-2 b { font-size: 10pt; }
  .egrid.fit-3 b { font-size: 8.5pt; }
  .egrid.fit-4 b { font-size: 7pt; }
  .egrid .n { top: 1.2mm; left: 1.6mm; font-size: 7pt; color: #000; }
  .pgrid { grid-template-columns: repeat(20, 1fr); gap: 0; margin-top: 4mm; border-top: 0.25mm solid #000; border-left: 0.25mm solid #000; }
  .pgrid li { height: 9.8mm; border-radius: 0; border: 0; border-right: 0.25mm solid #000; border-bottom: 0.25mm solid #000; padding: 0.6mm 0 0; }
  .pgrid .n { font-size: 5.5pt; color: #000; }
  .pgrid b { font-size: 7pt; font-weight: 600; }
  .months-title { margin-top: 4mm; font-size: 9pt; }
  .months { grid-template-columns: repeat(6, 1fr); gap: 1.5mm 4mm; margin-top: 1mm; }
  .months li { font-size: 8pt; padding: 0.5mm 0; border-bottom: 0.25mm solid #777; }
  .months li span { color: #000; }
}
