:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #5f6b7a; --line: #dde1e7;
  --brand: #004165; --brand-text: #fff; --accent: #772432; --ok: #1a7f37; --warn: #b7791f; --bad: #c0392b;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d222a; --text: #e8ebf0; --muted: #98a2b0; --line: #2c333d; --brand: #4a9fd0; --brand-text: #0b1117; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
.topbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 1rem; background: var(--brand); color: var(--brand-text); }
.topbar a { color: var(--brand-text); text-decoration: none; }
.topbar .brand { font-weight: 700; }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.topbar .who { margin-left: auto; font-size: .9rem; }
.container { max-width: 960px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
form.stack > * { display: block; margin: .5rem 0; }
/* Data blocks (e.g. the special item JSON) are never shown, even as a direct child of a stack form. */
script, template { display: none !important; }
label { font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); font: inherit;
}
textarea { min-height: 5rem; }
.btn, button { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--brand); border-radius: 6px; background: var(--brand); color: var(--brand-text); font: inherit; cursor: pointer; text-decoration: none; }
.btn.secondary, button.secondary { background: transparent; color: var(--brand); }
.btn.danger, button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small, button.small { padding: .2rem .55rem; font-size: .85rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.flash { padding: .6rem .9rem; border-radius: 6px; margin: 0 0 1rem; background: #e6f4ea; color: #14532d; }
.flash.error { background: #fdecea; color: #7f1d1d; }
.badge { display: inline-block; padding: 0 .5rem; border-radius: 99px; font-size: .75rem; background: var(--line); }
.badge.open { background: #fff3cd; color: #7a5b00; }
.badge.ok { background: #d4edda; color: #155724; }
.items { list-style: none; padding: 0; margin: 0; }
.items li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; margin: 0 0 .5rem; display: flex; gap: .6rem; align-items: flex-start; }
.items li.dragging { opacity: .5; }
.handle { cursor: grab; user-select: none; color: var(--muted); }
.hidden { display: none; }
/* meeting run */
.timer { font-size: 4rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; padding: 1rem; border-radius: var(--radius); }
.timer.t-none { background: var(--card); }
.timer.t-green { background: #1a7f37; color: #fff; }
.timer.t-yellow { background: #d9a400; color: #000; }
.timer.t-red { background: #c0392b; color: #fff; }
.timer.t-over { background: #4a0e0e; color: #fff; }
.display { text-align: center; }
.display .now { font-size: 2.2rem; margin: .5rem 0; }
.calendar { table-layout: fixed; }
.calendar td { height: 5.5rem; font-size: .85rem; border: 1px solid var(--line); }
.calendar td.other { background: color-mix(in srgb, var(--line) 30%, transparent); }
.calendar .day { font-weight: 700; color: var(--muted); }
@media (max-width: 600px) { .timer { font-size: 3rem; } th, td { padding: .3rem; } }
/* agendas */
.container h1 { margin-top: .25rem; }
.grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.agenda-card { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: inherit; margin: 0; }
.agenda-card:hover { border-color: var(--brand); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.empty { text-align: center; border-style: dashed; padding: 2rem; }
.card.row { margin-bottom: .5rem; padding: .6rem .8rem; }
.error { color: var(--bad); font-size: .9rem; margin: .25rem 0; }
ul.error { padding-left: 1.2rem; }
form.inline { display: inline; }
form.inline select { width: auto; display: inline-block; padding: .15rem; }
button:disabled { opacity: .4; cursor: not-allowed; }
.mono { font-family: ui-monospace, monospace; font-size: .85rem; }
.times { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.times label { font-size: .8rem; }
.times .t-green { color: var(--ok); }
.times .t-yellow { color: var(--warn); }
.times .t-red { color: var(--bad); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem .8rem; }
.special { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.items li { align-items: center; }
.items li .start { min-width: 3.2rem; font-variant-numeric: tabular-nums; }
.items li .body { min-width: 0; overflow-wrap: anywhere; }
.items li .planned { white-space: nowrap; }
.items li .actions { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.summary { margin: 1rem 0; }
.people { margin-bottom: 1rem; }
.person { display: flex; gap: .75rem; align-items: flex-start; }
.narrow { max-width: 24rem; margin: 0 auto; }
.center { text-align: center; }
/* honeypot: off-screen, not display:none (bots skip hidden fields less often) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 600px) {
  .items li { flex-wrap: wrap; }
  .times { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .25rem; }
}
/* live meeting run (control, display, report) */
.js-only { display: none; }
.js .js-only { display: inline-block; }
.js .nojs { display: none; }
.pre { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
.strong { font-weight: 600; }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .25rem 0; }
.eyebrow.big { font-size: 1.1rem; }
.run-control, .run-display { margin: 0 auto; }
.run-control[data-view=remote] { max-width: 24rem; }
.run-control .center h1, .run-control h1 { font-size: 1.4rem; margin: .25rem 0; }
.run-control .sub { font-size: 1.1rem; color: var(--muted); margin: .25rem 0; }
.run-control .sub strong { color: var(--text); font-weight: 600; }
.run-control.busy { opacity: .7; }
.run-control form { margin: 0; }
.seg-group { display: flex; gap: .25rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem; margin: .4rem 0; }
.seg-group form { flex: 1; }
.seg-group button { width: 100%; padding: .3rem .2rem; font-size: .85rem; }
.seg-group > button { flex: 1; }
.stack-btns { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.stack-btns form, .stack-btns button { width: 100%; }
button.big { font-size: 1.15rem; padding: .9rem 1rem; width: 100%; }
button.wide { padding: .7rem 1rem; width: 100%; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); }
button.ghost.danger-text { color: var(--bad); }
.bottom-actions { display: flex; flex-direction: column; align-items: center; gap: .25rem; margin: 1.25rem 0; }
.bottom-actions form { display: block; }
.sub-controls { display: flex; flex-direction: column; gap: .5rem; margin: .75rem 0; }
.sub-controls details summary { cursor: pointer; color: var(--brand); font-size: .9rem; }
.sub-controls details form { margin-top: .4rem; }
.row.end { justify-content: flex-end; flex-wrap: nowrap; }
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.timer { margin: .5rem 0; font-family: ui-monospace, monospace; }
.timer.paused { background: var(--card); color: var(--muted); }
.timer.big { font-size: 7rem; padding: 1.2rem 2rem; }
@media (max-width: 800px) { .timer.big { font-size: 4rem; padding: .8rem 1rem; } }
/* views of the control page */
.run-control[data-view=remote] .view-table { display: none; }
.run-control[data-view=table] .view-remote { display: none; }
.table-wrap { overflow-x: auto; }
.timer-sheet { min-width: 44rem; font-size: .9rem; }
.timer-sheet td, .timer-sheet th { vertical-align: middle; }
.timer-sheet td.indent { padding-left: 1.5rem; }
.timer-sheet tr.live { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.timer-sheet td.mark { text-align: center; font-family: ui-monospace, monospace; font-weight: 600; font-size: .8rem; }
.timer-sheet .c-green { background: color-mix(in srgb, #1a7f37 12%, transparent); }
.timer-sheet .c-yellow { background: color-mix(in srgb, #d9a400 15%, transparent); }
.timer-sheet .c-red { background: color-mix(in srgb, #c0392b 12%, transparent); }
.timer-sheet th.h-green { background: #1a7f37; color: #fff; }
.timer-sheet th.h-yellow { background: #d9a400; color: #000; }
.timer-sheet th.h-red { background: #c0392b; color: #fff; }
.timer-sheet select { min-width: 7rem; padding: .2rem; }
.tcell { display: inline-block; min-width: 4.2rem; padding: .15rem .5rem; border-radius: 4px; font-family: ui-monospace, monospace; font-weight: 600; }
.tcell.t-green { background: #1a7f37; color: #fff; }
.tcell.t-yellow { background: #d9a400; color: #000; }
.tcell.t-red { background: #c0392b; color: #fff; }
.tcell.paused { background: var(--line); color: var(--muted); }
.verdict { text-align: center; font-weight: 700; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
/* report */
table.report tr.row-over td { background: color-mix(in srgb, var(--bad) 18%, transparent); }
table.report tr.row-ok td { background: color-mix(in srgb, var(--ok) 14%, transparent); }
table.report tr.row-under td { background: color-mix(in srgb, var(--muted) 14%, transparent); }
table.report td.indent { padding-left: 1.5rem; }
table.report .comment { margin: .2rem 0 0; max-width: 60ch; }
/* display */
.run-display .display { display: flex; flex-direction: column; gap: 1.2rem; }
.run-display .display > .row:first-child { margin-bottom: .5rem; }
.run-display .now-block { text-align: center; }
.run-display h1.now { font-size: 2.4rem; margin: .25rem 0; }
.run-display .sub-line { font-size: 1.5rem; color: var(--muted); margin: .25rem 0; }
.run-display .sub-line strong { color: var(--text); }
.run-display .desc { max-width: 40rem; margin: .5rem auto; font-size: 1.1rem; }
.timer-row { display: flex; justify-content: center; align-items: center; gap: 2rem; flex-wrap: wrap; }
.upcoming { list-style: none; padding: 0; margin: 0 auto; width: 100%; max-width: 28rem; }
.upcoming li { border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .8rem; margin: 0 0 .5rem; color: var(--muted); }
.upcoming li.first { border: 2px solid var(--brand); background: var(--card); color: var(--text); font-weight: 600; }
.run-display table.plan { max-width: 40rem; }
.run-display .past { list-style: none; padding: 0; max-width: 28rem; }
.run-display .past li { margin: 0 0 .4rem; flex-wrap: nowrap; }
.run-display .past .btn { display: flex; justify-content: space-between; }
.qr-small { background: #fff; padding: .5rem; border: 0; border-radius: var(--radius); cursor: zoom-in; width: 8rem; height: 8rem; flex-shrink: 0; }
.qr-small svg, .qr-focus svg, .qr-big svg { display: block; width: 100%; height: 100%; }
.qr-big { display: block; width: min(80vw, 64vh); height: min(80vw, 64vh); }
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; background: #fff; color: #1d2330; border: 0; border-radius: 0; padding: 1rem; cursor: pointer; }
.overlay.hidden { display: none; }
.overlay-title { font-size: 2.2rem; font-weight: 600; margin: 0; text-align: center; }
.overlay-url { max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.2rem; color: #444; }
.overlay-close { position: absolute; top: 1rem; right: 1rem; width: 3rem; height: 3rem; border-radius: 50%; padding: 0; font-size: 1.4rem; background: transparent; color: #555; border-color: transparent; }
.overlay a { display: block; }
/* focus mode: the timer stage is painted across the whole screen */
.focus { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); color: var(--text); transition: background-color .5s; }
.focus[data-stage=green] { background: #1a7f37; color: #fff; }
.focus[data-stage=yellow] { background: #d9a400; color: #000; }
.focus[data-stage=red] { background: #c0392b; color: #fff; }
.focus-exit { position: absolute; top: .75rem; right: .75rem; background: transparent; color: inherit; border-color: transparent; opacity: .4; font-size: 1.3rem; }
.focus-exit:hover { opacity: 1; }
.focus-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2rem; text-align: center; overflow: hidden; }
.focus-eyebrow { font-size: 1.6rem; letter-spacing: .15em; text-transform: uppercase; opacity: .7; margin: 0; }
.focus-head { font-size: clamp(3rem, 11vw, 13rem); line-height: 1; margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
.focus-sub { font-size: clamp(1.5rem, 4vw, 4rem); opacity: .8; margin: 0; }
.focus-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: 0 2rem 2rem; font-size: clamp(1.25rem, 3vw, 2.5rem); }
.focus-foot.has-qr { padding-right: 13rem; }
.focus-foot .mono { font-size: inherit; }
.focus-paused { font-size: 1rem; letter-spacing: .15em; text-transform: uppercase; opacity: .7; }
.focus-next { opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qr-focus { position: absolute; right: 2rem; bottom: 2rem; width: clamp(7rem, 14vw, 16rem); height: clamp(7rem, 14vw, 16rem); background: #fff; padding: .5rem; border: 0; border-radius: var(--radius); cursor: zoom-in; }
.js .seg-group.js-only { display: flex; }
/* accounts */
.topbar form.inline { margin: 0; }
button.linklike { background: none; border: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
.topbar .who { margin-left: auto; }
.notice { padding: .6rem .9rem; border-radius: 6px; background: #e6f4ea; color: #14532d; }
/* agendas for members: roles, booking */
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.theme { font-style: italic; }
.meeting-facts { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.badge.role { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.items li.open-role { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--card)); }
.booking { margin-top: .35rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.role-list { list-style: none; margin: .25rem 0 0; padding: 0; columns: 2; column-gap: 1rem; }
.role-list li { break-inside: avoid; }
.open-text { color: var(--warn); font-weight: 600; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.check input { width: auto; }
@media (max-width: 600px) { .role-list { columns: 1; } }
.role-rows { list-style: none; padding: 0; margin: 0 0 1rem; }
.role-rows li { display: flex; gap: .6rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin: 0 0 .4rem; }
.next-meeting h2 { margin-top: 0; }
/* calendar, events, links */
.tabs { display: flex; gap: .25rem; }
.cal { table-layout: fixed; margin-bottom: 1rem; }
.cal th { text-align: center; }
.cal td { height: 6rem; padding: .2rem; font-size: .8rem; border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.cal td.other { background: color-mix(in srgb, var(--line) 35%, var(--bg)); color: var(--muted); }
.cal td.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.cal td.today .day { color: var(--brand); }
.cal .day { font-weight: 700; color: var(--muted); }
.cal .ev { display: block; margin-top: .15rem; padding: 0 .25rem; border-radius: 4px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal .ev.kind-competition { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.cal .ev.kind-party { background: color-mix(in srgb, var(--ok) 22%, transparent); }
.cal .ev.kind-special_meeting { background: color-mix(in srgb, var(--warn) 25%, transparent); }
.cancelled, .cancelled .title, .cal .ev.cancelled { text-decoration: line-through; }
.cancelled { opacity: .7; }
.badge.cancel { background: #fdecea; color: #7f1d1d; text-decoration: none; display: inline-block; }
.cal-nav { margin: .5rem 0; }
.cal-nav h2 { margin: 0; }
.event-list, .link-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.event-list li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; margin: 0 0 .5rem; }
.link-list li { padding: .25rem 0; }
.link-edit .row { margin-top: .4rem; }
.pre { white-space: pre-wrap; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; }
.menu summary::after { content: " ▾"; }
.menu-items { position: absolute; z-index: 10; top: 1.8rem; left: 0; min-width: 11rem; display: flex; flex-direction: column; gap: .4rem; padding: .6rem .8rem; background: var(--brand); border: 1px solid var(--brand-text); border-radius: var(--radius); }
@media (max-width: 600px) {
  .cal td { height: 4.5rem; font-size: .7rem; }
  .cal .ev .t { display: none; }
}

/* Pathways progress */
.bar { height: .7rem; border-radius: 99px; background: var(--line); overflow: hidden; margin: .4rem 0; }
.bar > span { display: block; height: 100%; background: var(--ok); }
.bar.small { height: .45rem; flex: 1; margin: 0; min-width: 4rem; }
ul.levels { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .35rem; }
ul.levels li { display: flex; align-items: center; gap: .6rem; }
ul.levels li.current .lvl { font-weight: 700; }
ul.levels .lvl { min-width: 4.5rem; }
pre.mail-preview { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; font-size: .9rem; overflow-x: auto; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; }
