@font-face { font-family: "Archivo"; src: url("/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #f1f4f7; --card: #fff; --line: #dde3ea; --line-soft: #e9edf2;
  --ink: #0e1620; --text: #1c2733; --muted: #5b6676; --faint: #8b95a3;
  --accent: #cf4307; --accent-ink: #b23a06; --rail: #0e1620; --ok: #1b7a4b;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 10px; --data: #2a78d6; --data-strong: #1c5fb0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.boot { padding: 80px 24px; text-align: center; color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* header */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; flex: none; align-items: center; gap: 11px; font-weight: 700; font-stretch: 118%; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.brand-name { white-space: nowrap; }
/* The logo: a wide wordmark is 28px tall; a squarish badge is taller so the lettering inside stays readable. */
.brand-logo { display: block; height: 28px; width: auto; max-width: 170px; object-fit: contain; }
.brand-logo.badge { height: 44px; max-width: 70px; border-radius: 3px; }
/* Beside a wide wordmark the site name steps back, so the two do not compete and the bar keeps its room. */
.brand-logo:not(.badge) + .brand-name { font-weight: 500; font-stretch: 100%; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.brand-logo.on-dark { box-sizing: border-box; height: 38px; padding: 7px 12px; border-radius: 6px; background: var(--ink); }
.brand-logo.badge.on-dark { height: 46px; padding: 5px; }
.nav { display: flex; gap: 16px; margin: 0 auto; }
.nav a { font-size: 13.5px; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); font-weight: 600; border-color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 8px; background: #e6eaf0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink); border: 0; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 44px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; min-width: 190px; box-shadow: 0 8px 24px rgba(14,22,32,.12); z-index: 20; }
.menu-list a, .menu-list span { display: block; padding: 8px 10px; border-radius: 6px; font-size: 13.5px; }
.menu-list span { color: var(--muted); border-bottom: 1px solid var(--line-soft); border-radius: 0; margin-bottom: 4px; }
.menu-list a:hover { background: var(--bg); }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #c3ccd7; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: #a3200f; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { color: var(--accent-ink); font-weight: 600; font-size: 13px; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

/* flight status rail */
.rail { background: var(--rail); color: #c8d0da; font-size: 12.5px; }
.rail .wrap { display: flex; align-items: stretch; min-height: 40px; }
.rail-item { display: flex; align-items: center; gap: 10px; padding: 8px 24px 8px 0; margin-right: 24px; border-right: 1px solid #25303c; white-space: nowrap; }
.rail-item b { color: #fff; font-weight: 600; }
.rail-item .mono { color: #e4e9ef; }
.rail-item .label { color: #8e99a8; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(207,67,7,.25); }
.rail .ops { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; }

/* hero + search */
.hero { padding: 56px 0 8px; }
.kicker { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); margin-bottom: 10px; }
h1 { font-size: clamp(34px, 5vw, 50px); line-height: 1.04; font-weight: 700; font-stretch: 116%; letter-spacing: -.02em; color: var(--ink); max-width: 13.5em; text-wrap: balance; }
.page h1 { font-size: 34px; max-width: none; }
.lede { margin-top: 18px; max-width: 30em; color: var(--muted); font-size: 16px; }
.search { position: relative; max-width: 680px; margin-top: 32px; }
.search-box { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 6px 6px 6px 16px; }
.search-box input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: none; font-size: 16px; }
.kbd { font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(14,22,32,.14); padding: 6px; z-index: 10; }
.result { display: flex; align-items: baseline; gap: 12px; padding: 9px 12px; border-radius: 7px; }
.result:hover, .result.on { background: var(--bg); }
.result .kind { width: 64px; flex: none; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.result .t { font-weight: 600; color: var(--ink); }
.result .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }
.empty .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; font-size: 12px; color: var(--text); }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on .muted { color: #c8d0da; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tagbtn { border: 0; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; }
.tagbtn:hover { color: var(--ink); background: var(--line); }

/* cards */
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card h3 { font-size: 16.5px; font-weight: 650; font-stretch: 108%; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; }
.card h3 .mono { color: var(--muted); font-weight: 400; }
.section { margin-top: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
h2 { font-size: 24px; font-weight: 650; font-stretch: 112%; color: var(--ink); letter-spacing: -.01em; }
.section-head p { color: var(--muted); font-size: 13px; }
.bar { display: flex; gap: 4px; margin: 14px 0 6px; }
.bar i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-soft); }
.bar i.on { background: var(--accent); }
.rows > * { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.rows .grow { flex: 1; min-width: 0; }
.rows .src { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rows a.src, .rows .src.go { color: var(--accent-ink); font-weight: 600; }
.check { width: 18px; height: 18px; flex: none; border: 1.5px solid #b9c2ce; border-radius: 4px; background: var(--card); padding: 0; display: grid; place-items: center; }
.check.on { background: var(--ink); border-color: var(--ink); }
.check[disabled] { cursor: default; }
.done .grow { color: var(--faint); text-decoration: line-through; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tag.warn { background: #fdeee6; color: var(--accent-ink); }
.tag.ok { background: #e6f4ec; color: var(--ok); }
.big { font-size: 44px; line-height: 1; font-weight: 700; font-stretch: 112%; color: var(--accent); margin: 16px 12px 6px 0; }
.count { display: flex; align-items: baseline; }
.meter { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter.data i { background: var(--data); }
.notice { padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.notice b { display: block; font-size: 11.5px; color: var(--accent-ink); margin-bottom: 2px; }
.card .foot { margin-top: 12px; }
.tile { display: block; }
.tile:hover { border-color: var(--ink); }
.tile svg { color: var(--ink); margin-bottom: 10px; }
.tile b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.slim { padding: 16px; }
.tag.info { background: #e8eef7; color: #2b4a7a; }
.nowrap { white-space: nowrap; }
.sub { font-size: 12.5px; margin-top: 4px; max-width: 46em; }
.sub b { font-weight: 600; color: var(--text); }
.star { border: 0; background: none; padding: 0 4px 0 0; font-size: 15px; line-height: 1; color: #b9c2ce; }
.star.on, .star:hover { color: var(--accent); }
.link.quiet { color: var(--faint); font-weight: 500; }
.helpful { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); max-width: 720px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.stack { display: grid; gap: 14px; }
.details { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread { margin-top: 8px; }
.note { padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.note p { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note b { color: var(--ink); }
.note.sys p { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; font-size: 11.5px; color: var(--muted); }
.stats b { display: block; font-size: 26px; line-height: 1.1; font-stretch: 110%; color: var(--ink); }
.stats b.accent { color: var(--accent); }
.card h3 .link { font-stretch: 100%; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat b { display: block; font-size: 30px; line-height: 1.1; font-weight: 700; font-stretch: 110%; color: var(--ink); }
.stat span { display: block; margin-top: 4px; font-size: 13px; color: var(--text); }
.stat small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.chart { margin-top: 18px; }
.plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-left: 30px; border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--line-soft), var(--line-soft)) 30px 0 / 100% 1px no-repeat, linear-gradient(var(--line-soft), var(--line-soft)) 30px 50% / 100% 1px no-repeat; }
.ytick { position: absolute; left: 0; width: 24px; text-align: right; transform: translateY(-50%); font-size: 11px; color: var(--faint); }
.slot { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline-offset: -2px; }
.slot i { display: block; width: 100%; max-width: 24px; background: var(--data); border-radius: 4px 4px 0 0; }
.slot:hover i, .slot:focus i { background: var(--data-strong); }
.slot b { font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.xaxis { display: flex; gap: 2px; padding-left: 30px; margin-top: 6px; }
.xaxis span { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
.astable { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.astable summary { cursor: pointer; }
.astable .table-wrap { margin-top: 8px; max-height: 260px; overflow-y: auto; }
#tip { position: absolute; z-index: 60; background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 10px; border-radius: 6px; pointer-events: none; display: none; white-space: nowrap; }
#tip.show { display: block; }
.clipline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note.internal { background: #fff8f3; margin: 0 -12px; padding: 12px; border-radius: 8px; }
.days { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; }
.day { padding: 16px; }
.day.today { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }
.day h3 { font-size: 15px; }
.meal { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.meal b { display: block; color: var(--ink); font-size: 14.5px; }
.meal p { margin-top: 4px; }
.meal-kind { font-size: 11px; font-weight: 600; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .04em; }
.rate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.rate .chip { cursor: pointer; }
.emergency { border-color: #f6cdb8; background: #fff8f3; }
.emergency p { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.mapwrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.map { position: relative; width: 100%; user-select: none; }
.map.big { width: 190%; }
.map.editing { cursor: crosshair; }
.map img { display: block; width: 100%; height: auto; }
.noplan { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--muted); font-size: 14px;
  background: linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 40px 40px; }
.mk { position: absolute; transform: translate(-50%, -50%); min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; border: 2px solid #fff; font: 700 10.5px/1 var(--sans); letter-spacing: .02em; color: #fff; box-shadow: 0 1px 4px rgba(14,22,32,.4); }
.mk:hover, .mk:focus-visible { z-index: 2; transform: translate(-50%, -50%) scale(1.15); }
.sw { display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 9px; font: 700 9.5px/1 var(--sans); font-style: normal; color: #fff; vertical-align: middle; }
.mk-red { background: #c62828; } .mk-green { background: #1b7a4b; } .mk-blue { background: #1c5fb0; } .mk-amber { background: #f2b705; color: #1c2733; }
.chip.off { opacity: .45; text-decoration: line-through; }
.who { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.who .avatar { flex: none; }
.who b { display: block; color: var(--ink); font-size: 14px; }
.who span { color: var(--muted); font-size: 12.5px; }

/* inner pages */
.page { padding: 40px 0 0; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 46em; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.input, textarea, select { height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 0 12px; font-size: 14px; }
.input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--ink); }
textarea { height: auto; padding: 10px 12px; width: 100%; line-height: 1.5; resize: vertical; }
.toolbar .input { width: 280px; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: 13.5px; }
.table-wrap { overflow-x: auto; border-radius: var(--r); }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; background: #f7f9fb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table .num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.table .clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.golink { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.golink:hover { color: var(--accent-ink); }
.banner { background: #fdeee6; border: 1px solid #f6cdb8; color: #7a2a05; border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.banner.info { background: #eef3f8; border-color: var(--line); color: var(--text); }
.banner.conflict { justify-content: flex-start; }
.theirs { margin: 0; padding: 0 18px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13.5px; color: var(--text); }
.prose { max-width: 720px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose a { color: var(--accent-ink); font-weight: 600; }
.prose a:hover { text-decoration: underline; }
.meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current] { color: var(--ink); font-weight: 600; border-color: var(--accent); }
details.editor { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; }
details.editor > summary { padding: 14px 18px; font-weight: 600; color: var(--ink); cursor: pointer; }
details.editor > form { padding: 0 18px 18px; }
details.editor > .logo-edit { padding: 0 18px 18px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.logo-stage { height: 64px; min-width: 230px; padding: 0 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.logo-side { flex: 1 1 320px; }
.logo-side p { margin: 0 0 10px; font-size: 13.5px; }
.logo-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.erow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); align-items: end; }
.erow .wide { grid-column: 1 / -1; }
@media (min-width: 901px) { .erow .grow { grid-column: span 3; } }   /* a field that usually holds a longer line, such as a dish */
.erow.fresh { margin: 0 -10px; padding: 12px 10px; background: #eef6f0; box-shadow: inset 3px 0 0 var(--ok, #2e7d4f); }   /* filled in from a menu, not saved yet */
.menu-import { margin-bottom: 16px; }
.menu-import > p { margin: 6px 0 12px; font-size: 13.5px; max-width: 70ch; }
.menu-import details.paste { margin-top: 14px; font-size: 13.5px; }
.menu-import details.paste summary { cursor: pointer; color: var(--muted); }
.menu-import details.paste textarea { display: block; width: 100%; margin: 10px 0; }
.menu-note { margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: #eef3f8; font-size: 13.5px; }
.menu-note.ok { background: #eef6f0; border-color: #cfe5d6; }
.menu-note.bad { background: #fdeee6; border-color: #f3cdb8; }
.menu-note b { color: var(--ink); font-weight: 600; }
.menu-note ul { margin: 6px 0 0; padding-left: 18px; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
label.f .input, label.f textarea, label.f select { display: block; width: 100%; margin-top: 4px; font-weight: 400; color: var(--text); }
label.c { display: flex; gap: 8px; align-items: center; font-size: 13px; height: 38px; }
.form-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--card); font-size: 12.5px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
footer b { color: var(--ink); }
footer nav { display: flex; gap: 20px; }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(14,22,32,.3); color: var(--text); }
dialog::backdrop { background: rgba(14,22,32,.45); }
dialog form { padding: 24px; display: grid; gap: 14px; }
dialog h2 { font-size: 20px; }
.slug-field { display: flex; align-items: center; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding-left: 12px; font-weight: 400; }
.slug-field span { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.slug-field input { flex: 1; border: 0; outline: 0; height: 36px; background: none; font-family: var(--mono); font-size: 14px; padding: 0 12px 0 2px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }
#toast.bad { background: #8f1d0c; }

/* Resources (the knowledge base): web/resources.js */
.kb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.kb-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kb-search { max-width: 680px; margin-top: 18px; }
.kb-search .search-box svg { flex: none; color: var(--muted); }
.kb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.kb-viewas { justify-content: flex-start; }
.kb-viewas .chip { cursor: pointer; }
.kb-space .kb-count { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 12px; }
.kb-start { max-width: 720px; }
.kb-start p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.kb-start .kb-actions { margin-top: 16px; }
.kb-empty { padding: 12px 0 0; font-size: 14px; }
.kb-title-link { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.kb .rows .tag { flex: none; }
.kb-title-link:hover, .kb-outline a:hover, .kb-side a:hover, .kb-children a:hover { color: var(--accent-ink); }
.kb .rows > :first-child { border-top: 0; }
.kb .card > h3 { margin-bottom: 6px; }
.kb .page-head { align-items: flex-start; }
.kb .meta { margin-bottom: 20px; }
.kb-outline { padding: 8px 20px; }
.kb-outline ul { list-style: none; margin: 0; padding: 0; }
.kb-outline ul ul { padding-left: 22px; border-left: 1px solid var(--line-soft); margin-left: 4px; }
.kb-outline li > a { display: inline-block; padding: 9px 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.kb-outline ul ul li > a { font-weight: 500; }
.kb-archive { margin-top: 16px; }
.kb-archive .rows, .kb-archive .hint { padding: 0 18px 14px; }
.kb-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; }
.kb-side-toggle { display: none; }
.kb-side { font-size: 13.5px; }
.kb-side-title { display: block; font-weight: 700; color: var(--ink); padding: 0 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.kb-side ul { list-style: none; margin: 0; padding: 0; }
.kb-side ul ul { padding-left: 16px; }
.kb-node { display: flex; align-items: flex-start; gap: 2px; }
.kb-node a { flex: 1; min-width: 0; padding: 5px 6px; border-radius: 6px; color: var(--text); overflow-wrap: anywhere; }
.kb-node a[aria-current] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.kb-twist { flex: none; width: 24px; height: 30px; border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; border-radius: 6px; }
button.kb-twist:hover { background: var(--line-soft); color: var(--ink); }
.kb-dot { color: var(--accent); padding: 5px 4px 0 0; }
.kb-main { min-width: 0; }
.kb-main .banner { margin-bottom: 12px; }
.kb-head { margin-bottom: 14px; flex-wrap: nowrap; }
.kb-head h1 { overflow-wrap: anywhere; min-width: 0; }
.kb-head .kb-actions { flex: none; flex-wrap: nowrap; }
.kb-more { position: relative; }
.kb-more > summary { list-style: none; cursor: pointer; }
.kb-more > summary::-webkit-details-marker { display: none; }
.kb-more .menu-list { top: 44px; min-width: 250px; }
.menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font-size: 13.5px; }
.menu-list button:hover { background: var(--bg); }
.kb-children { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 760px; }
.kb-children h2 { font-size: 16px; margin-bottom: 8px; }
.kb-children ul { margin: 0; padding-left: 20px; }
.kb-children li { margin: 6px 0; }
.kb-children a { font-weight: 600; color: var(--ink); }

/* a page's text, in the reading view and in the editor alike */
.kb-doc { max-width: 760px; font-size: 15.5px; line-height: 1.6; overflow-wrap: anywhere; }
.kb-doc > :first-child { margin-top: 0; }
.kb-doc p { margin: 0 0 12px; }
.kb-doc h2 { font-size: 24px; margin: 30px 0 10px; }
.kb-doc h3 { font-size: 19px; font-weight: 650; color: var(--ink); margin: 26px 0 8px; }
.kb-doc h4 { font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 22px 0 6px; }
.kb-editor .kb-doc h1 { font-size: 24px; font-weight: 650; font-stretch: 112%; letter-spacing: -.01em; margin: 30px 0 10px; max-width: none; line-height: 1.25; }
.kb-editor .kb-doc h2 { font-size: 19px; font-stretch: 100%; letter-spacing: 0; margin: 26px 0 8px; }
.kb-editor .kb-doc h3 { font-size: 15.5px; font-weight: 700; margin: 22px 0 6px; }
.kb-doc ul, .kb-doc ol { margin: 0 0 12px; padding-left: 24px; }
.kb-doc li { margin: 4px 0; }
.kb-doc li > p { margin-bottom: 4px; }
.kb-doc a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-decoration-color: #e7b9a3; text-underline-offset: 2px; }
.kb-doc blockquote { margin: 0 0 12px; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.kb-doc code { font-family: var(--mono); font-size: .88em; background: #e9edf2; border-radius: 4px; padding: 1px 5px; }
.kb-doc pre { margin: 0 0 12px; padding: 14px 16px; background: var(--ink); color: #e4e9ef; border-radius: var(--r); overflow-x: auto; overflow-wrap: normal; }
.kb-doc pre code { background: none; padding: 0; color: inherit; font-size: 13px; white-space: pre; }
.kb-doc hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.kb-doc .table-scroll, .kb-doc .tableWrapper { overflow-x: auto; margin: 0 0 14px; }
.kb-doc table { border-collapse: collapse; width: 100%; background: var(--card); font-size: 14px; overflow-wrap: normal; }
.kb-doc th, .kb-doc td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; min-width: 80px; position: relative; }
.kb-doc th { background: #f7f9fb; font-weight: 600; color: var(--ink); }
.kb-doc th > p:last-child, .kb-doc td > p:last-child { margin-bottom: 0; }
.kb-doc th, .kb-doc td { height: 38px; }
.kb-doc ul.tasks, .kb-doc ul[data-type="taskList"] { list-style: none; padding-left: 2px; }
.kb-doc ul.tasks > li, .kb-doc ul[data-type="taskList"] > li { display: flex; gap: 10px; align-items: flex-start; }
.kb-doc ul.tasks > li > div, .kb-doc ul[data-type="taskList"] > li > div { flex: 1; min-width: 0; }
.kb-doc .box { flex: none; width: 18px; height: 18px; margin-top: 3px; border: 1.5px solid #b9c2ce; border-radius: 4px; background: var(--card); display: grid; place-items: center; font-size: 12px; line-height: 1; color: #fff; }
.kb-doc li.done > .box { background: var(--ink); border-color: var(--ink); }
.kb-doc ul[data-type="taskList"] > li > label { flex: none; margin-top: 3px; }
.kb-doc ul[data-type="taskList"] input { width: 16px; height: 16px; accent-color: var(--ink); }
mark { background: #ffe9a8; color: inherit; border-radius: 2px; padding: 0 1px; }

/* history and search */
.kb-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.kb-results { margin-top: 24px; max-width: 760px; }
.kb-hit { display: block; padding: 14px 0; border-top: 1px solid var(--line); }
.kb-hit b { display: block; color: var(--ink); font-size: 16px; }
.kb-hit:hover b { color: var(--accent-ink); }
.kb-hit .src { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.kb-snip { display: block; font-size: 14px; color: var(--text); }

/* the editor */
.kb-edit { max-width: 860px; }
.kb-title { display: block; margin: 4px 0 14px; }
.kb-title input { width: 100%; border: 0; border-bottom: 2px solid var(--line); background: none; padding: 6px 0; font-size: 30px; font-weight: 700; font-stretch: 112%; letter-spacing: -.01em; color: var(--ink); outline: 0; }
.kb-title input:focus { border-color: var(--ink); }
.kb-toolbar { position: sticky; top: 0; z-index: 5; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.kb-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.kb-toolbar select { height: 32px; padding: 0 8px; font-size: 13px; }
.kb-tool { height: 32px; min-width: 32px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: none; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.kb-tool:hover { background: var(--bg); }
.kb-tool[aria-pressed="true"] { background: var(--ink); color: #fff; }
.kb-tool[disabled] { opacity: .4; cursor: default; }
.kb-tool-italic { font-style: italic; } .kb-tool-underline { text-decoration: underline; } .kb-tool-strike { text-decoration: line-through; } .kb-tool-code { font-family: var(--mono); font-size: 12px; }
.kb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.kb-tabletools { padding-top: 6px; margin-top: 6px; border-top: 1px solid var(--line-soft); }
.kb-tabletools[hidden] { display: none; }
.kb-linkform { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 10px; background: #eef3f8; border: 1px solid var(--line); border-top: 0; }
.kb-linkform[hidden] { display: none; }
.kb-linkform label { flex: 1 1 280px; }
.kb-editor .ProseMirror { min-height: 340px; max-width: none; padding: 20px 22px 60px; background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); outline: 0; white-space: pre-wrap; word-wrap: break-word; }
.kb-editor .ProseMirror:focus-visible { border-color: var(--ink); border-radius: 0 0 var(--r) var(--r); outline: 0; box-shadow: inset 0 0 0 1px var(--ink); }
.kb-editor .ProseMirror pre { white-space: pre-wrap; }
.kb-editor .selectedCell { background: #e8eef7; }
.kb-editor .ProseMirror-selectednode { outline: 2px solid var(--data); }
.kb-editor .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.kb-editor .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid var(--ink); }
.kb-editor .ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.kb-previewed { padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); max-width: none; min-height: 200px; }
.kb-editbar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
#kb-status { font-size: 13px; color: var(--muted); }
#kb-status.bad { color: #a3200f; font-weight: 600; }
#kb-restrict { display: grid; gap: 14px; }
#kb-restrict[hidden] { display: none; }
.kb-theirs { margin-bottom: 14px; }
.kb-theirs .kb-doc { padding: 0 18px 18px; }
dialog .banner { font-size: 13.5px; }

@media (max-width: 900px) {
  .kb-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .kb-side-toggle { display: inline-flex; }
  .kb-side { display: none; margin-top: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
  .kb-side-wrap.open .kb-side { display: block; }
  .kb-node a { padding: 8px 6px; }
  .kb-twist { height: 36px; width: 30px; }
  .kb-head { flex-wrap: wrap; }
  .kb-filters { grid-template-columns: minmax(0, 1fr); }
  .kb-title input { font-size: 24px; }
  .kb-tool { height: 36px; min-width: 36px; }
  .kb-tools { flex-wrap: nowrap; overflow-x: auto; }           /* one row that slides sideways, so the bar stays small above a phone keyboard */
  .kb-tools > * { flex: none; }
  .kb-editor .ProseMirror { padding: 16px 14px 48px; }
}

@media (max-width: 900px) {
  .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
}
/* The menu moves to its own row before the top bar runs out of room (a logo makes the bar wider). */
.nav.mobile { display: none; margin: 0; padding: 0 max(24px, calc((100vw - 1072px) / 2)); gap: 18px; overflow-x: auto; background: var(--card); border-bottom: 1px solid var(--line); }
.nav.mobile a { padding: 10px 0; }
@media (max-width: 1120px) {
  .top .nav { display: none; }
  .top .wrap { justify-content: space-between; }
  .nav.mobile { display: flex; }
  .rail .wrap { overflow-x: auto; }
}
/* A wide wordmark logo leaves no room for the menu beside it, so the menu takes its own row at every width. */
.top:has(.brand-logo:not(.badge)) .nav { display: none; }
.top:has(.brand-logo:not(.badge)) .wrap { justify-content: space-between; }
.top:has(.brand-logo:not(.badge)) ~ .nav.mobile { display: flex; }
@media (max-width: 600px) {
  .g3, .g4 { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
  .nav.mobile, .top:has(.brand-logo:not(.badge)) ~ .nav.mobile { padding: 0 16px; }
  .kbd { display: none; }
  .brand-logo:not(.badge) { max-width: 130px; }
  .brand-logo:not(.badge) + .brand-name { display: none; }
  .toolbar .input { width: 100% !important; }
  .days { grid-template-columns: minmax(0, 1fr); }
  .details { grid-template-columns: 1fr; gap: 2px 0; }
  .details dd { margin-bottom: 8px; }
}
@media (max-width: 400px) { .brand-name { display: none; } .brand-logo:not(.badge) { max-width: 96px; } }   /* small phones: the logo alone */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
