/* Brockmann (riffifi/brockmann-flutter) for the web: achromatic chrome, one accent,
   square edges, hairline divisions, Geist typography, a 4 px rhythm. */
@font-face { font-family: "Geist"; src: url("fonts/Geist.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Pixel Square"; src: url("fonts/GeistPixel-Square.ttf") format("truetype"); font-display: swap; }

:root {
  --background: #000; --surface: #121212; --foreground: #fff; --secondary: #a6a6a6;
  --disabled: #5c5c5c; --line: #3a3a3a; --line-strong: #8a8a8a; --danger: #e51400;
  --accent: #00aba9; --on-accent: #000; --accent-text: #00aba9;
  --press: 60ms; --release: 160ms;
}
@media (prefers-color-scheme: light) {
  :root { --background: #fff; --surface: #f2f2f2; --foreground: #000; --secondary: #5a5a5a;
    --disabled: #a8a8a8; --line: #bdbdbd; --line-strong: #4a4a4a; --accent-text: #00716f; }
}
@media (prefers-reduced-motion: reduce) { :root { --press: 0ms; --release: 0ms; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground);
  font: 400 14px/20px "Geist", system-ui, sans-serif; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { max-width: 640px; margin: 0 auto; padding: 24px 24px 48px; }
@media (min-width: 720px) { .page { padding: 48px 48px 64px; } }

/* Type roles */
.logo { display: block; flex: none; align-self: center; line-height: 0; }
.logo img { display: block; width: 64px; height: 28px; }
.wordmark { font: 400 32px/36px "Geist Pixel Square", "Geist Mono", monospace; letter-spacing: 0; }
.title { margin: 40px 0 16px; font-size: clamp(32px, 9vw, 40px); line-height: 1.1; font-weight: 300; letter-spacing: -.01em; }
.heading { margin: 0; font-size: 24px; line-height: 28px; font-weight: 400; }
.value { font-size: 20px; line-height: 24px; font-weight: 500; }
.label { font-size: 12px; line-height: 16px; letter-spacing: .5px; color: var(--secondary); }
.caption { font-size: 11px; line-height: 16px; letter-spacing: .2px; color: var(--secondary); }
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.mono.large { font-size: 32px; line-height: 36px; font-weight: 300; }
.mono.small { font-size: 12px; line-height: 16px; color: var(--secondary); word-break: break-all; }
.lead { margin: 0 0 24px; color: var(--secondary); max-width: 52ch; font-size: 16px; line-height: 24px; }
.note { margin: 16px 0 0; color: var(--secondary); max-width: 60ch; }

.masthead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

/* Buttons: typography-led, square, no shadows. */
button, .button { appearance: none; display: inline-flex; align-items: center; min-height: 48px; margin: 0;
  padding: 12px 16px; border: 0; border-radius: 0; background: none; color: var(--foreground);
  font: 500 20px/24px "Geist", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  transition: background-color var(--release), color var(--release), border-color var(--release); }
button:active, .button:active { transition-duration: var(--press); }
.primary { background: var(--accent); color: var(--on-accent); }
.primary:active { background: color-mix(in srgb, var(--accent), #000 18%); }
.secondary { border: 2px solid var(--line-strong); }
.secondary:active, .text-button:active { background: var(--surface); }
.text-button { padding: 12px 0; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--accent-text); }
button:disabled { cursor: default; color: var(--disabled); border-color: var(--line); }
.primary:disabled { background: var(--line); color: var(--disabled); }
.danger { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 24px; }

/* Sign-in */
.login { display: grid; justify-items: start; gap: 16px; }
.status { margin: 0; font-size: 16px; line-height: 24px; }
.qr { width: 264px; height: 264px; padding: 12px; background: #fff; image-rendering: pixelated; }

/* Account */
.facts { display: grid; gap: 16px; margin: 0 0 8px; }
.facts div { display: grid; gap: 4px; }
.facts dd { margin: 0; }
.facts.pair { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 16px; }
.block { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lesson { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.lesson-now { display: grid; gap: 4px; min-width: 0; flex: 1 1 220px; }

/* Lists: hairline rows, at least 48 px, title + caption. */
.list { margin-top: 16px; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-body { display: grid; gap: 4px; min-width: 0; }
.row-body strong { font-size: 16px; line-height: 20px; font-weight: 500; }
.row-body .meta { font-size: 11px; line-height: 16px; letter-spacing: .2px; color: var(--secondary); }
.row .actions { margin: 0; }
.row button { font-size: 14px; line-height: 20px; font-weight: 400; padding: 12px 0; }
.acs-in { color: var(--accent-text); }
.badge { display: inline-block; margin-left: 8px; padding: 0 6px; border: 1px solid var(--line-strong); font-size: 11px; line-height: 16px; font-weight: 400; vertical-align: 2px; }

.banner { margin: 24px 0 0; padding: 16px; background: var(--surface); border-left: 4px solid var(--danger); }
.footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); }
.about-content { white-space: pre-wrap; overflow-wrap: anywhere; }

/* AntiAttendance site */
.page.wide { max-width: 760px; }
.masthead .push { margin-left: auto; }
.wordmark { overflow-wrap: anywhere; }
.lesson-block { margin-top: 32px; }
.title.tight { margin: 8px 0 8px; }
.lesson-meta { margin: 0; font-size: 16px; line-height: 24px; }
.banner.info { border-left-color: var(--accent); }
.banner a { color: var(--accent-text); }
.field { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.input { flex: 1 1 220px; min-height: 48px; padding: 12px; border: 2px solid var(--line-strong); border-radius: 0;
  background: var(--background); color: var(--foreground); font: 400 16px/24px "Geist", system-ui, sans-serif; }
.input:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border: 1px solid var(--line-strong); font-size: 14px; }
.chip.own { border-color: var(--accent); }
.person { cursor: pointer; justify-content: flex-start; }
.person input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.person .row-body { flex: 1; }
.person > .mark { flex: none; font-size: 13px; line-height: 16px; text-align: right; color: var(--secondary); }
.mark.ok, .here { color: var(--accent-text); }
.mark.bad { color: var(--danger); }
.mark.wait { color: var(--foreground); }
.actions.sticky { position: sticky; bottom: 0; padding: 12px 0; background: var(--background); }
.list.compact .row { min-height: 40px; padding: 8px 0; }
.scanner { position: fixed; inset: 0; z-index: 10; overflow-y: auto; background: var(--background); }
.scanner-body { max-width: 640px; margin: 0 auto; padding: 24px; }
.viewfinder { position: relative; margin-top: 16px; overflow: hidden; background: #000; }
.video { display: block; width: 100%; max-height: 60vh; background: #000; object-fit: cover; }
.viewfinder .frame { position: absolute; left: 50%; top: 50%; height: 72%; max-width: 90%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgb(0 0 0 / .35); pointer-events: none; }
.viewfinder.found .frame { border-color: #fff; border-width: 4px; }
.scanner-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
.select { flex: 1 1 200px; min-height: 40px; padding: 6px 8px; font-size: 14px; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.countdown { margin: 8px 0 0; font-size: 20px; line-height: 28px; color: var(--accent-text); }
.status { margin-top: 16px; }
@media (max-width: 480px) { .person { flex-wrap: wrap; } .person > .mark { width: 100%; text-align: left; padding-left: 36px; } }

/* Admin panel */
.count { font-size: .5em; color: var(--secondary); vertical-align: middle; }
.block-head.top { margin-top: 32px; }
.admin-row { flex-wrap: wrap; align-items: flex-start; }
.admin-row .row-body { flex: 1 1 320px; }
.row-actions { gap: 0 16px; }
.admin-row .row-actions button { padding: 4px 0; min-height: 32px; }
.dialog { width: min(480px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--background); color: var(--foreground); }
.dialog::backdrop { background: rgb(0 0 0 / .6); }
.list.compact .mark { font-size: 13px; line-height: 16px; text-align: right; }

/* Admin console: tabs, data tables, logs */
.page.console { max-width: 1200px; }
.tabs { position: sticky; top: 0; z-index: 2; display: flex; overflow-x: auto; white-space: nowrap; align-items: center; gap: 0 20px; margin-top: 24px;
  background: var(--background); border-bottom: 1px solid var(--line); }
.tabs [role=tab] { flex: none; padding: 12px 0 10px; border-bottom: 2px solid transparent; font-size: 14px; line-height: 20px; color: var(--secondary); }
.tabs [role=tab][aria-selected=true] { color: var(--foreground); border-bottom-color: var(--accent); }
.tabs .push { margin-left: auto; }
.block-gap { margin-top: 32px; }
.table-wrap { margin-top: 16px; overflow-x: auto; border-top: 1px solid var(--line); }
.grid { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 16px; }
.grid th, .grid td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid th { position: sticky; top: 0; background: var(--background); font-weight: 500; color: var(--secondary); white-space: nowrap; }
.grid td { font-family: "Geist Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid td.long { white-space: normal; min-width: 240px; max-width: 480px; overflow-wrap: anywhere; }
.grid td.null { color: var(--disabled); }
.grid tr.bad td { color: var(--danger); }
.grid tr.slow td { color: var(--accent-text); }
.log { margin-top: 16px; border-top: 1px solid var(--line); font: 12px/16px "Geist Mono", ui-monospace, monospace; }
.log-line { display: grid; grid-template-columns: 136px 64px minmax(0, 1fr); gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.log-line .msg { overflow-wrap: anywhere; white-space: pre-wrap; }
.log-line.warning .lvl { color: var(--accent-text); }
.log-line.error .lvl, .log-line.critical .lvl { color: var(--danger); }
.log-line details { grid-column: 3; }
.log-line pre { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--secondary); }
@media (max-width: 640px) { .log-line { grid-template-columns: 1fr; gap: 2px; } .log-line details { grid-column: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips button { min-height: 32px; padding: 6px 10px; border: 1px solid var(--line-strong); font-size: 12px; line-height: 16px; }
.chips button[aria-pressed=true] { border-color: var(--accent); color: var(--accent-text); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 24px; margin-top: 16px; }
.facts div { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.facts span:first-child { font-size: 11px; line-height: 16px; color: var(--secondary); }
.facts span:last-child { font: 14px/20px "Geist Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--secondary); }
.input.narrow { flex: 0 1 120px; }

/* Today: people × lessons */
.grid.attendance th.col { min-width: 120px; white-space: normal; vertical-align: bottom; }
.grid.attendance th.col strong { display: block; color: var(--foreground); font-weight: 500; }
.grid.attendance th.col span { display: block; }
.grid.attendance th.col.now { box-shadow: inset 0 -2px 0 var(--accent); }
.grid.attendance th.col.future strong { color: var(--secondary); }
.grid.attendance td { text-align: center; font-size: 14px; }
.grid.attendance td.person { text-align: left; font-family: "Geist", system-ui, sans-serif; position: sticky; left: 0; background: var(--background); }
.grid.attendance tr.own td.person span:first-child { font-weight: 500; color: var(--accent-text); }
.grid.attendance tr.group-row td { text-align: left; padding-top: 16px; font: 500 12px/16px "Geist", system-ui, sans-serif; color: var(--secondary); }
.grid.attendance td.off { background: var(--surface); }
.legend { margin-top: 8px; }
.legend .null { color: var(--disabled); }
.report { max-height: 480px; margin: 16px 0 0; padding: 12px; overflow: auto; border: 1px solid var(--line); font: 11px/15px "Geist Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Schedule: a week of a group's lessons */
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.week-nav .secondary { min-width: 48px; justify-content: center; }
.week-nav .push { margin-left: auto; }
.week { margin-top: 8px; }
.day { margin-top: 32px; scroll-margin-top: 16px; }
.day.today .heading { color: var(--accent-text); }
.slot { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.slot-time { display: grid; align-content: start; font-size: 14px; line-height: 20px; }
.slot-body { display: grid; gap: 4px; min-width: 0; }
.slot-body strong { font-size: 16px; line-height: 20px; font-weight: 500; }
.slot-body .meta { font-size: 12px; line-height: 16px; color: var(--secondary); overflow-wrap: anywhere; }
.slot.past { opacity: .55; }
.slot.now { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
#tab-system canvas { display: block; width: 100%; max-width: 900px; height: 200px; }
.metric-rx { color: #4778df; }
.metric-tx { color: #d78b24; }
.forum-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.forum-topic { margin: 16px 0; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.forum-topic-title { display: block; font-size: 20px; line-height: 28px; overflow-wrap: anywhere; text-decoration: none; }
.forum-topic-title:hover { text-decoration: underline; }
.forum-topic p { margin: 8px 0 0; color: var(--secondary); font-size: 12px; }
.forum-vote { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 8px; background: transparent; border: 0; box-shadow: none; }
.forum-votes { display: inline-flex; align-items: center; gap: 4px; }
.forum-votes .forum-score { min-width: 2ch; }
.forum-vote svg { width: 26px; height: 26px; fill: #fff; stroke: #000; stroke-width: 1.5; stroke-linejoin: round; }
.vote-down svg { transform: rotate(180deg); }
.vote-up[aria-pressed=true] svg { fill: #22c55e; }
.vote-down[aria-pressed=true] svg { fill: #ef4444; }
.forum-score { min-width: 3ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-zero { color: #facc15; }
.score-positive { color: #22c55e; }
.score-negative { color: #ef4444; }
@media (prefers-color-scheme: light) { .score-zero { color: #927000; } .score-positive { color: #15803d; } .score-negative { color: #b91c1c; } }
.forum-score { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
header .logo[data-surprise] { -webkit-touch-callout: none; user-select: none; touch-action: none; }
/* Private inboxes and email settings. */
.notification-box { max-width: 100%; }
.notification-item { border-bottom: 1px solid var(--line, #777); padding: 1rem 0; overflow-wrap: anywhere; }
.notification-item p { white-space: pre-wrap; }
.notification-settings { display: grid; gap: 1rem; max-width: 40rem; min-width: 0; }
.notification-settings label { display: grid; gap: .4rem; min-width: 0; }
.notification-settings .input, .notification-box .input { width: 100%; min-width: 0; }
.notification-settings label:has(input[type=checkbox]), .notification-box label:has(input[type=checkbox]) { display: flex; align-items: center; gap: .6rem; }
.notification-settings input[type=checkbox], .notification-box input[type=checkbox] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.notification-box .field > label { display: grid; gap: .4rem; min-width: 0; flex: 1 1 220px; }
.notification-settings + .actions button, .notification-box button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.email-preferences { display: grid; gap: 20px; max-width: 40rem; margin-top: 24px; }
.email-preferences > label { display: grid; gap: 8px; }
.email-current { font-size: 20px; line-height: 28px; overflow-wrap: anywhere; margin-top: 8px; }
.email-preferences .actions { margin-top: 16px; }
.email-preferences .note, .email-preferences .caption { margin: 0; }
.email-code { font-family: "Geist Mono", ui-monospace, monospace; letter-spacing: .3em; max-width: 16rem; }
.notification-anchor { position: relative; flex: none; align-self: center; }
.notification-bell { position: relative; justify-content: center; width: 44px; min-height: 44px; padding: 10px; color: var(--foreground); }
.notification-bell:hover, .notification-bell[aria-expanded=true] { background: var(--surface); }
.notification-count { position: absolute; top: 0; right: 0; padding: 0 3px; min-width: 15px; background: var(--accent); color: var(--on-accent); font: 500 10px/15px "Geist Mono",monospace; }
.notification-popover { position: absolute; top: calc(100% + 8px); z-index: 20; width: min(420px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: min(640px, 75vh); overflow-y: auto; padding: 16px; border: 1px solid var(--line-strong); background: var(--background); color: var(--foreground); }
.masthead > .notification-anchor:last-child { margin-left: auto; }
.notification-popover .heading { font-size: 20px; line-height: 24px; }
.notification-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; margin-top: 8px; }
.notification-categories { margin: 12px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.notification-categories legend { font-size: 16px; padding: 0 12px 0 0; }
.category-row { display: grid; grid-template-columns: minmax(0,1fr) 64px 56px; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.category-row > label { display: flex; justify-content: center; }
.category-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.category-labels { font-size: 11px; color: var(--secondary); }
.category-labels > span:not(:first-child) { text-align: center; }
