/* The round: signboard look. Yellow means "where to go" or "the number that matters";
   black type on yellow reads at about 14:1 in sunlight. Square corners throughout. */
:root {
  --yellow: #FFCC00;
  --black: #0B0B0B;
  --frame: #1F1F1F;
  --paper: #F2F2F0;
  --sheet: #FFFFFF;
  --ink: #0B0B0B;
  --ink-2: #2A2A2A;
  --muted: #555555;
  --rule: #D0D0CC;
  --rule-strong: #8A8A86;
  --danger: #B3261E;
  --done-bg: #E3F0DF; --done-ink: #1E4D1A;
  --short-bg: #FBE3DF; --short-ink: #8A1C12;
  --focus: #1F5FBF;
  --t0: #3E6E3A; --t1: #8A5A2B; --t2: #2F5C8C; --t3: #8C3E6E; --t4: #2E7A73; --t5: #6F6420; --t6: #5A4A8C; --t7: #8E4A3E;
  --font: "Frutiger", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 70px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.35 var(--font); font-variant-numeric: tabular-nums; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--yellow); color: var(--black); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ic { flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 14px; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- frame (header) ---------- */
.frame { background: var(--black); color: #fff; padding: calc(env(safe-area-inset-top) + 10px) 16px 12px; position: sticky; top: 0; z-index: 5; }
.frame .brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--yellow); min-height: 32px; }
.frame .brand span { flex: 1; }
.frame .brand small { color: #C8C8C8; font-weight: 500; letter-spacing: 0; text-align: right; }
.navrow { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.navrow h1 { flex: 1; margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -.01em; line-height: 1.12; min-width: 0; overflow-wrap: anywhere; }
.navrow h1 small { display: block; font-size: 14px; font-weight: 500; color: #C8C8C8; letter-spacing: 0; }
.sq { width: 48px; height: 48px; border: 0; background: var(--frame); color: #fff; display: grid; place-items: center; border-radius: 4px; flex: none; text-decoration: none; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 4px; color: inherit; flex: none; }
.frame .iconbtn { color: #fff; margin-right: -10px; }

/* ---------- sign bands ---------- */
.band { background: var(--yellow); color: var(--black); padding: 14px 16px 16px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; border-bottom: 4px solid var(--black); }
.band .pict { width: 64px; height: 64px; background: var(--black); color: #fff; display: grid; place-items: center; border-radius: 4px; }
.band .lab { font-size: 15px; font-weight: 700; }
.band .big { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -.02em; margin: 2px 0 4px; overflow-wrap: anywhere; }
.band .where { font-size: 21px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.band .who { font-size: 16px; margin-top: 4px; }
.band .bnote { font-size: 16px; margin-top: 6px; }
.band .btns { margin-top: 12px; }
.band .btn { border-color: var(--black); background: var(--black); color: var(--yellow); }
.band .btn.ghost { background: transparent; color: var(--black); }
.band.plain { grid-template-columns: minmax(0, 1fr); }
.band.black { background: var(--black); color: #fff; border-bottom-color: var(--yellow); }

main { padding: 0 0 calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.pad { padding: 0 16px; }
h2.sec { font-size: 21px; margin: 22px 16px 8px; letter-spacing: -.01em; }
p.lede { color: var(--muted); margin: 0 16px 10px; font-size: 15px; }

/* ---------- departures board rows ---------- */
.boardhead { display: grid; grid-template-columns: 58px minmax(0, 1fr) 44px; gap: 10px; padding: 14px 16px 6px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .03em; border-bottom: 2px solid var(--black); }
.dep { display: grid; grid-template-columns: 58px minmax(0, 1fr) 44px; gap: 10px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--sheet); position: relative; }
.dep .open { all: unset; position: absolute; inset: 0; cursor: pointer; }
.dep .open:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.dep .tm { font-size: 19px; font-weight: 700; padding-top: 1px; overflow-wrap: anywhere; }
.dep .hs { font-size: 18px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.dep .nt { font-size: 15px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dep .ln { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: 15px; font-weight: 600; }
.dep.skipped .hs { text-decoration: line-through; color: var(--muted); }
.dep.clash { background: repeating-linear-gradient(135deg, #FFF3BF 0 6px, var(--sheet) 6px 12px); }
.tick { position: relative; z-index: 1; width: 44px; height: 44px; border: 2px solid var(--black); background: #fff; border-radius: 4px; display: grid; place-items: center; }
.tick.done { background: var(--black); color: var(--yellow); }
.tick.skipped { border-style: dashed; color: var(--muted); }
.st { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 3px; font-size: 13px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.st.todo { background: var(--black); color: #fff; }
.st.done { background: var(--done-bg); color: var(--done-ink); }
.st.skipped { background: #E6E6E6; color: #444; }
.st.need { background: var(--yellow); color: var(--black); box-shadow: inset 0 0 0 2px var(--black); }
.st.short { background: var(--short-bg); color: var(--short-ink); }
.addline { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; font-weight: 700; text-align: left; }
.empty { padding: 18px 16px; color: var(--muted); }
.tot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; font-weight: 700; }

/* ---------- week of signs ---------- */
.wday { margin: 14px 16px; background: var(--sheet); border: 2px solid var(--black); }
.wday > .wh { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 52px; padding: 6px 12px; border: 0; background: var(--black); color: #fff; text-align: left; }
.wday.today > .wh { background: var(--yellow); color: var(--black); }
.wday .wn { font-size: 22px; font-weight: 700; }
.wday .wc { font-size: 14px; text-align: right; }
.wl { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; border: 0; border-top: 1px solid var(--rule); font-size: 15px; align-items: center; width: 100%; background: transparent; text-align: left; min-height: 48px; }
.wl b { font-weight: 700; overflow-wrap: anywhere; }
.wl > span:last-child { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.wl.skipped b { text-decoration: line-through; color: var(--muted); }

/* ---------- ledgers and lists ---------- */
.ledger { width: calc(100% - 32px); margin: 0 16px; border-collapse: collapse; background: var(--sheet); border: 2px solid var(--black); }
.ledger td, .ledger th { padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
.ledger td.n, .ledger th.n { text-align: right; font-weight: 700; white-space: nowrap; }
.ledger tr.total td { background: var(--yellow); font-size: 20px; }
.ledger tr.sub td { color: var(--muted); font-size: 15px; }
.ledger th { font-size: 13px; letter-spacing: .03em; color: var(--muted); background: var(--paper); }
.ledger tr.link { cursor: pointer; }
.ledger tr.link:active td { background: var(--paper); }
.ledger td .who { font-weight: 700; }
.scrollx { overflow-x: auto; margin: 0 16px; }
.scrollx .ledger { width: 100%; margin: 0; }
.list { margin: 0 16px; border: 2px solid var(--black); background: var(--sheet); }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; width: 100%; min-height: 64px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: left; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.item .s { grid-column: 1; font-size: 14px; color: var(--muted); }
.item .r { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.item.archived .t { color: var(--muted); }
.search { margin: 12px 16px; }

.figrows .frow { display: grid; gap: 4px; padding: 12px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.figrows .frow:last-child { border-bottom: 0; }
.figrows a.frow:active { background: var(--paper); }
.fname { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.fnote { font-size: 14px; color: var(--muted); }
.fnote .owed { color: var(--short-ink); font-weight: 700; }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.figs span { display: grid; }
.figs small { font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--muted); text-transform: uppercase; }
.figs b { font-size: 17px; }

/* ---------- period switch and chart ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--black); border-radius: 4px; overflow: hidden; }
.seg button { min-height: 48px; border: 0; background: var(--sheet); font-weight: 700; border-left: 2px solid var(--black); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--black); color: var(--yellow); }
.periodbar { margin: 14px 16px 0; }
.periodnav { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.periodnav .lbl { flex: 1; text-align: center; font-size: 20px; font-weight: 700; }
.periodnav .sq { background: var(--black); }
.chart { margin: 14px 16px 0; background: var(--sheet); border: 2px solid var(--black); padding: 12px 10px 8px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin: 0 4px 8px; }
.chart .legend i { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; border: 2px solid var(--black); }
.chart details { margin-top: 6px; font-size: 14px; }
.chart summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 4px; border: 2px solid var(--black); background: var(--sheet); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.chip[aria-pressed="true"] { background: var(--black); color: var(--yellow); }
.chips.pad { padding: 12px 16px 0; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--tone, var(--muted)); display: inline-block; line-height: 18px; text-align: center; color: #fff; font-size: 11px; font-weight: 700; flex: none; }

/* ---------- buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns.pad { padding: 12px 16px 0; }
.btn { min-height: 48px; padding: 0 16px; border-radius: 4px; border: 2px solid var(--ink); background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--ink); }
.btn.solid { background: var(--ink); color: #fff; }
.btn.yellow { background: var(--yellow); color: var(--black); border-color: var(--black); }
.btn.wide { width: 100%; }
.btn.quiet { border-color: var(--rule-strong); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.notice { margin: 12px 16px 0; padding: 12px 14px; background: var(--sheet); border: 2px solid var(--black); display: grid; gap: 8px; }
.notice.yellow { background: var(--yellow); }
.notice p { margin: 0; }

/* ---------- bottom navigation and add button ---------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: var(--black); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tab { min-height: 58px; border: 0; background: transparent; color: #C8C8C8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 700; border-radius: 4px; text-decoration: none; }
.tab[aria-current="page"] { background: var(--yellow); color: var(--black); }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 6; width: 64px; height: 64px; border: 3px solid var(--black); border-radius: 4px; background: var(--yellow); color: var(--black); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
@media (min-width: 760px) { .bar { left: 50%; transform: translateX(-50%); width: 760px; } .fab { right: calc(50% - 364px); } }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 20; opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 640px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--sheet); border-top: 6px solid var(--yellow); box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet.on { transform: none; }
.sheethead { display: flex; align-items: center; gap: 8px; position: sticky; top: -4px; background: var(--sheet); padding: 8px 0; z-index: 1; border-bottom: 1px solid var(--rule); }
.sheethead h2 { flex: 1; margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.field { margin: 14px 0; }
.field > label, .field > .lab { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); }
.in { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 4px; border: 2px solid var(--black); background: #fff; font-size: 17px; caret-color: var(--black); }
.in:focus { outline: none; box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px var(--black); }
textarea.in { min-height: 84px; resize: vertical; }
select.in { appearance: auto; }
.moneyin { position: relative; }
.moneyin span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.moneyin .in { padding-left: 30px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 700; }
.toggle input { width: 26px; height: 26px; accent-color: var(--black); }
.tell { background: var(--yellow); border: 2px solid var(--black); padding: 12px; margin: 12px 0; }
.tell p { margin: 0 0 8px; font-weight: 700; }
.msgpreview { white-space: pre-wrap; font-size: 15px; }
.standing { background: var(--paper); border-left: 0; padding: 10px 12px; font-size: 15px; border: 1px solid var(--rule); }
.pickhouse { max-height: 46dvh; overflow-y: auto; border: 2px solid var(--black); }
.pickhouse .item { min-height: 56px; }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }

/* ---------- toast ---------- */
.toast { visibility: hidden; position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom)); z-index: 30; max-width: 616px; margin: 0 auto; background: var(--black); color: #fff; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; }
.toast.on { visibility: visible; transform: none; opacity: 1; pointer-events: auto; }
.toast .t { flex: 1 1 160px; font-weight: 700; }
.toast button { min-height: 44px; padding: 0 14px; border-radius: 4px; border: 2px solid #fff; background: transparent; color: #fff; font-weight: 700; }
.toast button.solid { background: var(--yellow); color: var(--black); border-color: var(--yellow); }

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

/* ---------- six months at a glance (house and person pages) ---------- */
.hist { margin: 14px 16px 0; background: var(--sheet); border: 2px solid var(--black); }
.hist .bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; height: 150px; padding: 12px 10px 0; align-items: end; }
.hist .mo { height: 100%; display: grid; grid-template-rows: auto 1fr auto; align-items: end; text-align: center; }
.hist .mo i { display: block; align-self: end; background: var(--rule); }
.hist .mo.now i { background: var(--black); }
.hist .mo .v { font-size: 12px; font-weight: 700; white-space: nowrap; align-self: end; padding-bottom: 3px; }
.hist .mo .m { font-size: 14px; color: var(--muted); padding: 6px 0 8px; border-top: 2px solid var(--black); }
.hist .mo.now .m { color: var(--ink); font-weight: 700; }
.hist .strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 2px solid var(--black); }
.hist .strip div { padding: 10px 8px 12px; text-align: center; border-left: 1px solid var(--rule); }
.hist .strip div:first-child { border-left: 0; }
.hist dt { font-size: 13px; color: var(--muted); }
.hist dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; white-space: nowrap; }
.ledger tr.mhead th { background: var(--black); color: #fff; font-size: 14px; letter-spacing: .02em; }
