/* Doors: one column, a notebook that grows down the page. Light only, by choice. */
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 500; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 700; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 800; font-display: swap; src: url(/fonts/schibsted-grotesk-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Martian Mono"; font-weight: 400; font-display: swap; src: url(/fonts/martian-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Martian Mono"; font-weight: 700; font-display: swap; src: url(/fonts/martian-mono-latin-700-normal.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #ECEEEA; --surface: #FFFFFF; --surface-2: #F5F6F3; --ink: #181C20; --muted: #5F666C; --line: #D6DAD3;
  --accent: #2B45C4; --accent-ink: #FFFFFF; --accent-soft: #E2E7FA; --danger: #B3372B;
  --t-none: #A3A9AE; --t-no: #6E7780; --t-maybe: #B07A12; --t-good: #2E7A57; --t-great: #1C6A8A; --t-win: #2B45C4;
  --scrim: rgba(20, 24, 28, .38);
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 10; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }

.app {
  max-width: 560px; margin: 0 auto; min-height: 100vh;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}
.loading { padding: 40px 0; color: var(--muted); }

/* Header */
.head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 18px 0 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kicker { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.sub { font-size: 13px; color: var(--muted); }
.prog { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.prog .big { font-size: 14px; color: var(--muted); }
.prog .big b { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; margin-right: 6px; font-variant-numeric: tabular-nums; }
.prog .stats { font-size: 13px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar.hit i { background: var(--t-good); }

.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 15px; min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn.danger.confirm { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.small { min-height: 36px; padding: 7px 12px; font-size: 13px; border-radius: 10px; white-space: nowrap; }
.btn:disabled { opacity: .4; cursor: default; }
.link { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; }
.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.notice { margin-top: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; }
.notice.warn { background: #FBF3E2; border-color: #E9D3A6; }
.notice.error { background: #FBE9E7; border-color: #EDC2BC; }

/* Days */
.past { border-bottom: 1px solid var(--line); }
.past summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 0; font-size: 14.5px; font-weight: 600; }
.past summary::-webkit-details-marker { display: none; }
.past summary .meta { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.past summary .hit { color: var(--t-good); font-weight: 700; }
.past summary::after { content: "+"; font-family: var(--mono); color: var(--muted); font-weight: 400; width: 1ch; text-align: center; }
.past[open] summary::after { content: "–"; }
.past .review-note { font-size: 13px; padding: 8px 0 8px 40px; color: var(--ink); }
.past .review-note b { font-family: var(--mono); font-size: 10.5px; color: var(--muted); font-weight: 400; margin-right: 6px; }
.earlier { padding: 10px 0 0; }
.dayhead { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 20px 0 4px; }
.empty { font-size: 14.5px; color: var(--muted); padding: 14px 0; }

/* Entries */
.entry { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.entry:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.entry .num { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.entry .body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.entry .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.entry .place { font-weight: 700; font-size: 15.5px; min-width: 0; overflow-wrap: anywhere; }
.entry .place.none { color: var(--muted); font-weight: 500; }
.entry .time { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: none; }
.entry .said { font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.entry .foot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.entry.compact { padding: 9px 0; }
.entry.compact .said { font-size: 13.5px; color: var(--muted); }
.entry.pending .num::after { content: "•"; color: var(--t-maybe); margin-left: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.pill::before, .ochip::before, .dot { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); flex: none; }
.next { font-size: 13px; color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.next.done { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.next.overdue { color: var(--danger); }
.t-none { --tone: var(--t-none); } .t-no { --tone: var(--t-no); } .t-maybe { --tone: var(--t-maybe); }
.t-good { --tone: var(--t-good); } .t-great { --tone: var(--t-great); } .t-win { --tone: var(--t-win); }

.setline { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 0 2px; }
.setline::before, .setline::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.marker { display: flex; justify-content: center; padding: 12px 0 2px; }
.marker span { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.review { background: var(--accent-soft); border-radius: 16px; padding: 14px; margin: 12px 0 2px; display: grid; gap: 10px; }
.review .rt { font-weight: 700; font-size: 15.5px; }
.review .rs { font-size: 13px; color: var(--muted); }
.review .saved { font-size: 15px; font-weight: 600; white-space: pre-line; }
.review form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.review input { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }

/* Composer */
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 12px; margin-top: 18px; }
.composer .cnum { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; }
.field textarea { resize: vertical; min-height: 64px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.ochips { display: flex; flex-wrap: wrap; gap: 6px; }
.ochip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; font-weight: 600; }
.ochip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

/* Sheet and toast */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.sheet-wrap.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .22s; }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; transform: translateY(105%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.sheet-wrap.open .sheet { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 9px; background: var(--line); justify-self: center; }
.sheet h2 { font-size: 22px; font-weight: 800; letter-spacing: -.015em; }
.sheet .lede { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.sheet-body { display: grid; gap: 12px; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-actions .spacer { flex: 1; }
.form-error { font-size: 13.5px; color: var(--danger); }
.fu { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.fu input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.fu .what { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.fu .where { font-size: 13px; color: var(--muted); }
.fu .when { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.fu .when.overdue { color: var(--danger); font-weight: 700; }
.fu button.link { font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 160%); z-index: 25; width: min(528px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.toast.in { transform: translate(-50%, 0); }
.toast span { flex: 1; min-width: 0; }
.toast button { border: 0; background: transparent; color: var(--bg); font-weight: 700; font-size: 13.5px; padding: 8px 6px; text-decoration: underline; text-underline-offset: 3px; }

/* Sign in */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: grid; gap: 14px; }
.login-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login-card .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
