/* "Departure board" identity: tokens from docs/design.md. No colors outside these custom properties. */
/* Self-hosted fonts (SIL OFL 1.1, see static/fonts/OFL.txt). */
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-600.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-700.woff2") format("woff2"); }

:root {
  --bg: #0E0F11;
  --panel: #1A1C1F;
  --rule: #2A2C30;
  --rule-soft: #24262A;
  --ink: #EDE6D6;
  --ink-2: #B9B4A8;
  --muted: #8C8A84;
  --accent: #FFB000;
  --late: #FF6A3D;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --gutter: 18px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--ink); }

body {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.eyebrow, .label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

input[type="text"], input[type="password"], input[type="datetime-local"], textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  font-size: 16px; /* below 16px iOS Safari zooms into the field */
}

.btn-accent {
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
}

.error { margin: 0; color: var(--late); }

/* Login */
.login {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 48px) var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-title {
  margin: 0 0 32px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  line-height: 0.9;
  color: var(--accent);
}

.login-form { display: flex; flex-direction: column; gap: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Today board */
.board {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 20px) var(--gutter) calc(env(safe-area-inset-bottom) + 18px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.board-header { display: flex; justify-content: space-between; align-items: flex-start; }
.date { display: flex; flex-direction: column; gap: 2px; }
.date-numeral {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 84px;
  line-height: 0.85;
  color: var(--accent);
}
.header-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.badge {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2em;
  padding: 4px 8px;
}
.clock { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.link-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.section { display: flex; flex-direction: column; }
.section-head {
  margin: 0;
  display: flex;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.section-head-late { color: var(--late); }
.empty { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 44px 62px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--rule-soft);
}
.row:last-child { border-bottom: 0; }
.rows-quiet .row { color: var(--ink-2); font-size: 13px; }

.check {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check::before {
  content: "";
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted); /* 3:1 non-text contrast on --bg */
}
.check svg { grid-area: 1 / 1; color: var(--bg); position: relative; }
.check.is-checked::before { background: var(--muted); border-color: var(--muted); }
.row-late .check::before { border-color: var(--late); }

.time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.time-next { color: var(--accent); }
.day { font-size: 13px; text-transform: uppercase; }
.day-late { color: var(--late); }
.title { overflow-wrap: anywhere; }

.pill, .status { font-size: 10px; letter-spacing: 0.14em; }
.pill { font-weight: 700; color: var(--bg); padding: 3px 6px; }
.pill-next { background: var(--accent); }
.pill-late { background: var(--late); }
.status { color: var(--muted); }

.row-done .title { text-decoration: line-through; color: var(--muted); }
.row-done .time { color: var(--muted); }

/* Add form, pinned to the bottom of the board: title on top, then date + ADD. */
.add {
  margin-top: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: end;
}
/* Title gets its own row; only the date shares a row with ADD, so it has room for its native label. */
.add-title { grid-column: 1 / -1; }
/* iOS Safari gives datetime-local an intrinsic min width (the native label, e.g. "10 Nov 2026 at 21:00")
   that ignores width: 100% and pushes the field under the ADD button. Dropping the native appearance
   keeps the picker but lets the box shrink to its column. */
input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  display: block;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  line-height: 50px;
  text-align: left;
}
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
.add-button { min-width: 72px; }
.add .error { grid-column: 1 / -1; }
input[aria-invalid="true"] { border-color: var(--late); }
