/* learn.sanjayj.dev: Captain's Desk, ported from blog.sanjayj.dev.
   Sections marked [blog] are copied from myblog/themes/captains-desk/assets/css/main.css;
   the design authority is myblog/DESIGN.md. Keep them in sync. */

/* [blog] tokens, base, header, shared bits, window */
/* ---------- tokens ---------- */
:root {
  --paper: #ebdab8;
  --paper-2: #e1cda5;
  --ink: #24190f;
  --ink-soft: #56432e;
  --ink-faint: #6b573c;
  --rule: #c4aa80;
  --mark: #9b3517;
  --grain-op: .26;
  --grain-blend: multiply;

  --f-display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --f-display-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --f-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-label: "VT323", ui-monospace, monospace;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --measure: 68ch;
  --page: calc(68ch + 12rem);
  --col: 44rem;
  --rail: 15rem;

  /* Excalidraw SVGs (see convert-svg-to-css-vars.py) read these */
  --svg-text-primary: var(--ink);
  --svg-text-secondary: var(--ink-soft);
  --svg-bg-light: var(--paper);
  --svg-bg-subtle: var(--paper-2);
  --svg-border: var(--rule);
  --svg-accent-secondary: var(--ink-faint);
  --svg-accent-1: var(--mark);
  --svg-accent-2: var(--ink-soft);
  --svg-accent-3: var(--mark);
  --svg-accent-4: var(--ink-soft);
  --svg-accent-5: var(--mark);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b140c; --paper-2: #261c11; --ink: #ecd9b1; --ink-soft: #c2a77c;
    --ink-faint: #a38c68; --rule: #42331f; --mark: #e27d4e; --grain-op: .12; --grain-blend: screen;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b140c; --paper-2: #261c11; --ink: #ecd9b1; --ink-soft: #c2a77c;
  --ink-faint: #a38c68; --rule: #42331f; --mark: #e27d4e; --grain-op: .12; --grain-blend: screen;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {                                   /* paper grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .27  0 0 0 0 .2  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img { max-width: 100%; height: auto; }
::selection { background: var(--mark); color: var(--paper); }
a { color: inherit; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--mark); text-decoration-color: currentColor; }
:focus-visible { outline: 2px dashed var(--mark); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: calc(env(safe-area-inset-top, 0px) + .75rem); left: max(16px, env(safe-area-inset-left, 0px)); z-index: 70;
  width: auto; height: auto; clip: auto; padding: .4rem .7rem; background: var(--ink); color: var(--paper); font-family: var(--f-label); font-size: 17px; }

.wrap {
  position: relative;
  max-width: var(--page);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- header ---------- */
.bar {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between;
  padding-block: 1.1rem .9rem; border-bottom: 2px solid var(--ink);
  font-family: var(--f-label); font-size: 16px; letter-spacing: .06em; text-transform: uppercase;
}
.bar .brand { font-family: var(--f-display-sc); font-size: 20px; letter-spacing: .04em; text-transform: none; text-decoration: none; }
.bar nav { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; align-items: baseline; }
.bar nav a { text-decoration: none; }
.bar nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--mark); }
.toggle {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer;
  background: none; border: 1.5px solid var(--ink); border-radius: 6px; padding: 3px 10px;
}
.toggle:hover, .toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.subbar {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-block: .35rem; border-bottom: 3px double var(--ink);
  font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); letter-spacing: .05em;
}

/* ---------- shared bits ---------- */
.crumbs { font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1rem; }
.dek { font-style: italic; color: var(--ink-soft); font-size: 1.15rem; margin: 0 0 1.5rem; }
.page-head { margin-block: 3rem 2rem; }
.page-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.4rem, 6vw, 3.8rem); line-height: 1; margin: 0 0 .8rem; text-wrap: balance; }
.page-head .dek { margin: 0; }
.dither-rule { height: 10px; margin-block: 2.5rem; background-image: var(--dither-url, linear-gradient(transparent 4px, var(--rule) 4px 6px, transparent 6px)); background-size: auto 10px; image-rendering: pixelated; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding-block: .45rem; margin-top: 1rem;
}
.sec-head h2 { margin: 0; font-family: var(--f-display-sc); font-weight: 400; font-size: 1.5rem; letter-spacing: .03em; }
.sec-head span { font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; }

/* Mac-style window: striped title bar, 2px frame, dithered drop shadow */
.win { position: relative; isolation: isolate; border: 2px solid var(--ink); background: var(--paper); margin-right: 8px; }
.win::after {
  content: ""; position: absolute; inset: 6px -8px -8px 6px; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0 / 2px 2px;
  clip-path: polygon(calc(100% - 8px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(100% - 8px), calc(100% - 8px) calc(100% - 8px));
}
.winbar {
  display: flex; align-items: center; gap: .6rem; padding: 3px 6px; border-bottom: 2px solid var(--ink);
  font-family: var(--f-label); font-size: 16px; line-height: 1.3; color: var(--ink);
  background: repeating-linear-gradient(var(--ink) 0 1px, var(--paper) 1px 3px);
}
.winbar i { width: 13px; height: 13px; border: 1.5px solid var(--ink); background: var(--paper); flex: none; }
.winbar span { margin: 0 auto; background: var(--paper); padding: 0 .6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.winbar .copy {
  font-family: var(--f-label); font-size: 15px; line-height: 1; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 4px; padding: 2px 7px; cursor: pointer; flex: none;
}
.winbar .copy:hover { background: var(--ink); color: var(--paper); }


/* [blog] ledger */
.ledger-scroll { overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger th { text-align: left; font-family: var(--f-label); font-weight: 400; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: .7rem .5rem .4rem; border-bottom: 1px solid var(--rule); }
.ledger td { padding: .8rem .5rem; border-bottom: 1px dotted var(--rule); vertical-align: baseline; }
.ledger tbody tr:not(.year):hover { background: var(--ink); }
.ledger tbody tr:not(.year):hover :is(td, a, .tags) { color: var(--paper); }
.ledger .no, .ledger .date, .ledger .min { font-family: var(--f-label); font-size: 17px; color: var(--ink-soft); white-space: nowrap; }
.ledger .no { color: var(--mark); width: 3.2rem; }
.ledger .min { text-align: right; }
.ledger .title a { font-family: var(--f-display); font-size: 1.32rem; text-decoration: none; line-height: 1.2; }
.ledger .tags { display: block; margin-top: .2rem; font-family: var(--f-label); font-size: 14.5px; color: var(--ink-faint); letter-spacing: .03em; }
.ledger tr.year td { padding: 1.6rem .5rem .3rem; border-bottom: 2px solid var(--ink); font-family: var(--f-display-sc); font-size: 1.1rem; letter-spacing: .08em; }
.ledger tbody tr.year:first-child td { padding-top: .9rem; }
@media (max-width: 560px) { .ledger .min, .ledger th.min { display: none; } }

/* [blog] prose (subset, for the note reader) */
/* ---------- prose ---------- */
.prose { font-size: 18px; line-height: 1.55; counter-reset: sec; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.2rem; hyphens: auto; }
.prose li { hyphens: auto; margin-bottom: .3rem; }
.prose strong { font-weight: 500; }
.prose :is(h1, h2, h3, h4, h5) { font-weight: 400; text-wrap: balance; scroll-margin-top: 1.5rem; }
/* the top heading level of each post is its "section": engraved, numbered with § */
.prose .sec { font-family: var(--f-display); font-size: 2rem; line-height: 1.1; margin: 2.6rem 0 .7rem; counter-increment: sec; }
.prose .sec::before { content: "§" counter(sec); font-family: var(--f-label); font-size: 1.05rem; color: var(--mark); margin-right: .6rem; vertical-align: .25em; }
.prose .lead { font-family: var(--f-display); font-size: 2.2rem; line-height: 1.1; margin: 2.8rem 0 1rem; }
.prose > .lead:first-child { margin-top: 0; }
.prose .sub { font-family: var(--f-display-sc); font-size: 1.3rem; letter-spacing: .04em; margin: 2rem 0 .5rem; }
.prose .subsub { font-family: var(--f-display); font-style: italic; font-size: 1.2rem; margin: 1.8rem 0 .4rem; }
.prose ol, .prose ul { padding-left: 1.4rem; margin: 0 0 1.2rem; }
.prose li > ul, .prose li > ol { margin: .3rem 0 0; }
.prose ol li::marker { font-family: var(--f-label); font-size: 1.05em; color: var(--mark); }
.prose :not(pre) > code { font-family: var(--f-mono); font-size: .82em; background: var(--paper-2); padding: .08em .35em; border: 1px solid var(--rule); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.prose blockquote { margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 3px double var(--ink); font-family: var(--f-display); font-style: italic; font-size: 1.25rem; line-height: 1.45; color: var(--ink-soft); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 10px; margin: 2.4rem 0; background-image: var(--dither-url, linear-gradient(transparent 4px, var(--rule) 4px 6px, transparent 6px)); background-size: auto 10px; image-rendering: pixelated; }
.prose mark { background: var(--mark); color: var(--paper); padding: 0 .2em; }
.prose kbd { font-family: var(--f-label); font-size: .9em; border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 4px; padding: 0 .35em; background: var(--paper); }
.prose del { text-decoration-color: var(--mark); text-decoration-thickness: 2px; }
.prose sup a[href^="#fn"] { font-family: var(--f-label); font-size: 1rem; color: var(--mark); text-decoration: none; }
.prose .footnotes { margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.prose .footnotes hr { display: none; }

/* [blog] activity grid */
.activity-win { margin-bottom: 2.5rem; }
.activity { padding: 1.1rem 1.2rem 1rem; display: grid; gap: .7rem; overflow-x: auto; }
.act-row { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); align-items: center; gap: .6rem; }
.act-year { font-family: var(--f-label); font-size: 18px; color: var(--ink-soft); }
.act-cells { display: grid; grid-template-columns: repeat(12, minmax(18px, 1fr)); gap: 6px; }
.act-cell { display: grid; gap: 3px; justify-items: center; }
.act-cell b, .act-legend b { display: block; width: 100%; aspect-ratio: 1; max-width: 34px; border: 1.5px solid var(--ink); background: var(--paper); image-rendering: pixelated; }
.act-legend b { width: 14px; display: inline-block; vertical-align: -2px; margin-right: .35rem; }
[data-l="1"] b, b[data-l="1"] { background: var(--dz1, var(--paper-2)) 0 0 / 8px 8px; }
[data-l="2"] b, b[data-l="2"] { background: var(--dz2, var(--rule)) 0 0 / 8px 8px; }
[data-l="3"] b, b[data-l="3"] { background: var(--ink); }
[data-l="f"] b { border-style: dotted; border-color: var(--ink-faint); }
.act-cell i { font-style: normal; font-family: var(--f-label); font-size: 14px; color: var(--ink-faint); line-height: 1; }
.act-legend { display: flex; gap: 1.1rem; justify-content: flex-end; font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); padding-top: .2rem; }
.arch-year { margin-bottom: 2.6rem; }
.arch-year h2 { display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding-block: .35rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--f-display-sc); font-weight: 400; font-size: 1.6rem; letter-spacing: .05em; }
.arch-year h2 small { font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; }
.arch-list { list-style: none; margin: 0; padding: 0; }
.arch-list li { display: grid; grid-template-columns: 7.5rem 3rem minmax(0, 1fr) auto; gap: .8rem; align-items: baseline; padding: .55rem .4rem; border-bottom: 1px dotted var(--rule); }
.arch-list.term li { grid-template-columns: 8rem minmax(0, 1fr) auto; }
.arch-list li:hover { background: var(--paper-2); }
.arch-month { font-family: var(--f-display); font-style: italic; color: var(--ink-soft); font-size: 1.05rem; }
.arch-day, .arch-min { font-family: var(--f-label); font-size: 16px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.arch-list a { font-family: var(--f-display); font-size: 1.28rem; line-height: 1.25; text-decoration: none; }
.arch-list a:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .arch-list li { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .arch-month { grid-column: 1 / -1; }
  .arch-month:empty { display: none; }
  .arch-min { display: none; }
  .arch-list.term li { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
}


/* [blog] footer */
/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--ink); padding-block: 1.2rem 2.5rem; margin-top: 3rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); letter-spacing: .05em;
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
/* [blog] prose checkboxes, tables, code */
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.4rem; }
.prose input[type="checkbox"] { appearance: none; width: 14px; height: 14px; border: 1.5px solid var(--ink); background: var(--paper); margin: 0 .5rem 0 0; transform: translateY(2px); }
.prose input[type="checkbox"]:checked { background: repeating-conic-gradient(var(--ink) 0 25%, var(--paper) 0 50%) 0 0 / 2px 2px; }

/* tables */
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.4; font-variant-numeric: tabular-nums; margin: 1.4rem 0 1.8rem; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); display: block; overflow-x: auto; }
.prose th { font-family: var(--f-label); font-weight: 400; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--ink); }
.prose td { padding: .55rem .7rem; border-bottom: 1px dotted var(--rule); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }

/* code */
.code-win { margin: 1.6rem 8px 1.8rem 0; }
.code-win pre, .prose pre {
  margin: 0; padding: 1rem 1.1rem; overflow-x: auto; background: var(--paper) !important; color: var(--ink);
  font-family: var(--f-mono); font-size: 13.5px; line-height: 1.65; tab-size: 4; font-variant-ligatures: none;
}
.prose > pre { border: 2px solid var(--ink); margin: 1.6rem 0; }
.prose img { max-width: 100%; }

/* ======================================================================
   Tracker components (app only). Same rules: paper + ink + one accent,
   VT323 for things you scan, IM Fell for things you read, dither not blur.
   ====================================================================== */
:root { --page: 64rem; --dither-50: repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0 / 2px 2px; }
body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
.label { font-family: var(--f-label); font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.mark { color: var(--mark); }
.num { font-family: var(--f-label); font-size: 18px; font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 1.5rem; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.win-body { padding: .9rem 1rem 1rem; }
.win-body > :first-child { margin-top: 0; }
.win-body > :last-child { margin-bottom: 0; }
.win.dim { opacity: .62; }
.win.dim:hover { opacity: 1; }
h1.page-title { margin-top: 0; }
.page-head { margin-block: 2rem 1.5rem; }
.sec-head { margin-top: 2.4rem; margin-bottom: 1rem; }

/* progress meter: 2px frame, 50% Bayer fill, solid leading edge; dotted = ticked without proof */
.meter { position: relative; height: 14px; border: 2px solid var(--ink); background: var(--paper); image-rendering: pixelated; }
.meter > i, .meter > b { position: absolute; top: 0; bottom: 0; left: 0; display: block; }
.meter > i { background: var(--dither-50); border-right: 2px solid var(--ink); }
.meter > i[style="width:0%"] { border-right: 0; }
.meter > b { background: repeating-linear-gradient(90deg, var(--ink-faint) 0 2px, transparent 2px 5px); opacity: .7; }
.meter.sm { height: 10px; border-width: 1.5px; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; }
.meter-row .num { font-size: 16px; color: var(--ink-soft); white-space: nowrap; }

/* track cards */
.track-card h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; line-height: 1.1; margin: 0 0 .25rem; }
.track-card h3 a { text-decoration: none; }
.track-card .kv { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-family: var(--f-label); font-size: 15.5px; color: var(--ink-soft); margin: .6rem 0; }
.track-card .next { border-top: 1px dotted var(--rule); padding-top: .6rem; margin-top: .6rem; font-size: 16px; }
.track-card .next .label { display: block; font-size: 14px; }
.kind { font-family: var(--f-label); font-size: 14px; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0 .4em; text-transform: uppercase; letter-spacing: .06em; }
.status { font-family: var(--f-label); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.status.active { color: var(--mark); }
.status.done { color: var(--ink); }
.status.queued, .status.parked { color: var(--ink-faint); }

/* habit chips */
.chips { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.chip { position: relative; isolation: isolate; display: grid; gap: .15rem; text-align: left; width: 100%; cursor: pointer;
  font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: .6rem .8rem; }
.chip::after { content: ""; position: absolute; inset: 4px -6px -6px 4px; z-index: -1; border-radius: 6px; background: var(--dither-50);
  clip-path: polygon(calc(100% - 6px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(100% - 6px), calc(100% - 6px) calc(100% - 6px)); }
.chip:active { transform: translate(2px, 2px); }
.chip .t { font-family: var(--f-display); font-size: 1.25rem; line-height: 1.1; }
.chip .s { font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); letter-spacing: .04em; }
.chip.on { background: var(--ink); color: var(--paper); }
.chip.on .s { color: var(--paper); }
details.more > summary { list-style: none; cursor: pointer; font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); margin-top: .35rem; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary.chip::before { content: none; }
details.more > summary::before { content: "▸ "; color: var(--mark); }
details.more[open] > summary::before { content: "▾ "; }

/* forms */
form.inline { display: inline; margin: 0; }
.field { display: grid; gap: .25rem; margin-bottom: .7rem; }
.field > span { font-family: var(--f-label); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
input[type="text"], input[type="url"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 4px; padding: .45rem .6rem; caret-color: var(--mark); }
textarea { min-height: 6rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); font-style: italic; }
.btn { font-family: var(--f-label); font-size: 17px; letter-spacing: .06em; text-transform: uppercase; line-height: 1; cursor: pointer;
  color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: .5rem .85rem; text-decoration: none; display: inline-block; }
.btn:hover, .btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--mark); border-color: var(--mark); }
.btn.sm { font-size: 15px; padding: .3rem .55rem; border-width: 1.5px; }
.btn.link { border: 0; background: none; padding: 0; text-decoration: underline; text-decoration-color: var(--ink-faint); color: inherit; }
.btn.link:hover { color: var(--mark); background: none; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row.end { justify-content: flex-end; }

/* units list */
.units { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.units > li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .5rem; padding: .6rem .2rem; border-bottom: 1px dotted var(--rule); align-items: start; }
.box { width: 16px; height: 16px; border: 1.5px solid var(--ink); background: var(--paper); margin-top: .3rem; display: block; }
.box.done { background: var(--dither-50); }
.box.proven { background: var(--ink); }
.units .lbl { line-height: 1.35; }
.units .proof { font-family: var(--f-label); font-size: 15px; color: var(--ink-soft); }
.units .proof.missing { color: var(--mark); }
.units details { margin-top: .3rem; }
.units .res { font-family: var(--f-label); font-size: 15px; }
.units.log > li { grid-template-columns: 3.2rem minmax(0, 1fr); }

/* notices */
.banner { border: 2px solid var(--mark); color: var(--mark); background: var(--paper); padding: .55rem .8rem; margin-block: 1rem; font-family: var(--f-label); font-size: 17px; letter-spacing: .03em; }
.banner a { color: inherit; }
.flash { border: 2px solid var(--ink); padding: .5rem .8rem; margin-block: 1rem; font-family: var(--f-label); font-size: 17px; }
.flash.err { border-color: var(--mark); color: var(--mark); }

/* timer */
.timer { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.timer .clock { font-family: var(--f-label); font-size: 44px; line-height: 1; color: var(--mark); font-variant-numeric: tabular-nums; }

/* brief */
.brief { font-size: 17px; line-height: 1.55; }
.brief p { margin: 0 0 .7rem; }
.brief ol, .brief ul { margin: 0 0 .7rem; padding-left: 1.3rem; }

/* habit grid: 12 weeks × 7 days per habit */
.hgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; max-width: 26rem; }
.hgrid .wk { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.hgrid b { display: block; aspect-ratio: 1; border: 1.5px solid var(--ink); background: var(--paper); }
.hgrid b[data-l="1"] { background: repeating-conic-gradient(var(--ink) 0 25%, var(--paper) 0 100%) 0 0 / 4px 4px; }
.hgrid b[data-l="2"] { background: var(--dither-50); }
.hgrid b[data-l="3"] { background: var(--ink); }
.hgrid b[data-l="f"] { border-style: dotted; border-color: var(--ink-faint); }
.hgrid b.today { outline: 2px solid var(--mark); outline-offset: 1px; }

/* shipped wall */
.ship-steps { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .45rem; }
.ship-steps li { display: grid; grid-template-columns: 1.4rem 7.5rem minmax(0, 1fr); gap: .4rem; align-items: center; font-size: 16px; }
.ship-steps .label { font-size: 14px; }
.ship-steps form { display: flex; gap: .35rem; }
.ship-steps input { padding: .25rem .45rem; font-size: 15px; }

/* nav: top bar on desktop, bottom bar on phones */
.bar nav a[aria-current] { color: var(--mark); }
.tabbar { display: none; }
@media (max-width: 720px) {
  .bar nav.top { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    padding: .35rem max(6px, env(safe-area-inset-left, 0px)) calc(.35rem + env(safe-area-inset-bottom, 0px));
    background: var(--paper); border-top: 3px double var(--ink); }
  .tabbar a { display: grid; justify-items: center; gap: .05rem; text-decoration: none; font-family: var(--f-label); font-size: 13.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
  .tabbar a i { font-style: normal; font-size: 20px; line-height: 1; color: var(--ink); }
  .tabbar a[aria-current] { color: var(--mark); }
  .tabbar a[aria-current] i { color: var(--mark); }
  .ledger .hide-sm, .ledger th.hide-sm { display: none; }
}
.login { max-width: 24rem; margin: 3rem auto; }
