/* The head of this file is the token sheet from the design canvas. Dark first: the
   audience lives in Discord and game engines at odd hours, so dark is :root and light is
   the override. Nothing below the tokens carries a raw colour. */

:root {
  color-scheme: dark light;

  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --paper: oklch(0.185 0.008 70);
  --surface: oklch(0.225 0.008 70);
  --sunken: oklch(0.155 0.008 70);
  --ink: oklch(0.945 0.005 85);
  --ink-2: oklch(0.75 0.008 75);
  --ink-3: oklch(0.60 0.008 72);
  --rule: oklch(0.315 0.008 70);
  --rule-strong: oklch(0.42 0.010 70);
  --focus: oklch(0.72 0.13 250);
  --focus-tint: oklch(0.30 0.05 250);

  --done: oklch(0.74 0.13 150);
  --wip: oklch(0.78 0.13 75);
  --review: oklch(0.74 0.12 250);
  --notdone: oklch(0.72 0.14 25);
  --unknown: oklch(0.68 0.012 70);
  --done-tint: oklch(0.28 0.05 150);
  --wip-tint: oklch(0.29 0.05 75);
  --review-tint: oklch(0.28 0.05 250);
  --notdone-tint: oklch(0.28 0.05 25);
  --unknown-tint: oklch(0.26 0.006 70);

  --r-sm: 3px;
  --r-md: 6px;
}

@media (prefers-color-scheme: light) {
  :root {
    --paper: oklch(0.985 0.004 85);
    --surface: oklch(1 0 0);
    --sunken: oklch(0.962 0.005 85);
    --ink: oklch(0.23 0.012 60);
    --ink-2: oklch(0.45 0.010 62);
    --ink-3: oklch(0.61 0.008 65);
    --rule: oklch(0.905 0.006 75);
    --rule-strong: oklch(0.80 0.008 75);
    --focus: oklch(0.55 0.15 250);
    --focus-tint: oklch(0.955 0.025 250);

    --done: oklch(0.52 0.13 150);
    --wip: oklch(0.55 0.13 75);
    --review: oklch(0.52 0.13 250);
    --notdone: oklch(0.53 0.15 25);
    --unknown: oklch(0.56 0.012 70);
    --done-tint: oklch(0.955 0.035 150);
    --wip-tint: oklch(0.955 0.04 75);
    --review-tint: oklch(0.955 0.03 250);
    --notdone-tint: oklch(0.955 0.03 25);
    --unknown-tint: oklch(0.955 0.004 70);
  }
}

/* -- base ---------------------------------------------------------------- */

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

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--focus); }
a:hover { color: var(--ink); }

/* Never removed, never softened into a shadow. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
h1 { font-size: 1.95rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
h3 { font-size: 1.05rem; font-weight: 600; }

.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.lede { font-size: 1.06rem; text-wrap: pretty; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -- shell --------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  min-height: 56px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  flex-wrap: wrap;
}
.top .mark {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink-2);
  text-decoration: none;
}
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 0 var(--ink); }
.top .right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.top .right a { text-decoration: none; }

.wrap { padding: 28px 24px 56px; max-width: 1440px; }
.wrap.narrow { max-width: 640px; }
.wrap.medium { max-width: 920px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}
.page-head .meta { font-family: var(--mono); font-size: 0.9rem; color: var(--ink-2); margin-top: 6px; }

.stack { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.stack.tight { gap: 8px; }
.stack.start { align-items: flex-start; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.columns-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }

.card {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
}
.card-pad { padding: 16px 18px; }
.card > .card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--rule);
}

.section { border-top: 1px solid var(--rule); padding-top: 20px; }

/* -- controls ------------------------------------------------------------ */

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  /* Solid ink, so the primary action never competes with a status colour. */
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { color: var(--paper); filter: brightness(1.08); }
.button.secondary { background: var(--surface); color: var(--ink-2); border-color: var(--rule-strong); font-weight: 500; }
.button.secondary:hover { color: var(--ink); }
.button.danger { background: var(--surface); color: var(--notdone); border-color: var(--notdone); }
.button.small { min-height: 44px; padding: 0 14px; font-size: 0.93rem; }
.button:disabled { background: var(--rule); border-color: var(--rule); color: var(--ink-3); cursor: default; }

button.link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--focus);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-3); cursor: pointer; font: inherit;
}
.icon-button:hover { color: var(--ink); background: var(--sunken); }
.icon-button.on { color: var(--focus); }

/* -- fields -------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field label, .field .label { font-size: 1.06rem; font-weight: 600; }
.field .hint { font-size: 0.875rem; color: var(--ink-2); }
.field .count { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); }
.field .count.over { color: var(--notdone); font-weight: 600; }

input[type="text"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  background: var(--sunken);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
textarea { min-height: 136px; line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.field.error input, .field.error textarea { border: 2px solid var(--notdone); }
input[readonly], textarea[readonly] { color: var(--ink-3); }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 12px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
/* Selection is a border weight, not only a tick -- it survives greyscale. */
.check:has(input:checked) { border: 2px solid var(--ink); color: var(--ink); font-weight: 600; }
.check:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 999px; background: var(--sunken); border: 1px solid var(--rule);
  font-size: 0.7rem; font-weight: 600; color: var(--ink-2);
}
.check:has(input:checked) .avatar { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* -- banners ------------------------------------------------------------- */

.banner {
  padding: 12px 16px;
  border-left: 3px solid var(--focus);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--focus-tint);
  font-size: 0.96rem;
  text-wrap: pretty;
}
.banner ul { padding-left: 1.1em; }
.banner-warn { border-left-color: var(--wip); background: var(--wip-tint); }
.banner-error { border-left-color: var(--notdone); background: var(--notdone-tint); }
.banner-ok { border-left-color: var(--done); background: var(--done-tint); }
.banner.wide { border-radius: 0; margin: 0; padding: 12px 24px; }

.ok-line { display: inline-flex; align-items: center; gap: 8px; color: var(--done); font-size: 0.93rem; }

/* -- status -------------------------------------------------------------- */

.glyph { display: inline-block; width: 1.1em; height: 1.1em; line-height: 1.1em; text-align: center; vertical-align: -0.15em; }
img.glyph { object-fit: contain; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--unknown);
  background: var(--unknown-tint);
  color: var(--unknown);
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.chip-done { border-color: var(--done); background: var(--done-tint); color: var(--done); }
.chip-wip { border-color: var(--wip); background: var(--wip-tint); color: var(--wip); }
.chip-review { border-color: var(--review); background: var(--review-tint); color: var(--review); }
.chip-not_done { border-color: var(--notdone); background: var(--notdone-tint); color: var(--notdone); }
/* No status is a different fact from Unknown: nobody has looked yet. The dashed border is
   what tells them apart across a screen share. */
.chip-none { border: 1px dashed var(--rule-strong); color: var(--ink-3); background: transparent; }

.sync {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--rule-strong); color: var(--ink-2); background: var(--sunken);
}
.sync-synced { border-color: var(--done); color: var(--done); background: var(--done-tint); }
.sync-failed, .sync-stale { border-color: var(--notdone); color: var(--notdone); background: var(--notdone-tint); }
.sync button.link { min-height: 0; color: inherit; font-weight: 600; }

.project { display: inline-flex; align-items: center; gap: 7px; font-size: 0.87rem; color: var(--ink-3); }
.carried {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px; padding: 1px 7px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}

/* -- goals list ---------------------------------------------------------- */

.goal { padding: 13px 18px; border-bottom: 1px solid var(--rule); }
.goal:last-child { border-bottom: 0; }
.goal .line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.goal .text { font-size: 1.06rem; font-weight: 500; line-height: 1.4; }
.goal .comment { font-size: 0.9rem; color: var(--ink-2); margin-top: 4px; }

.week-nav { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); overflow: hidden; }
.week-nav a, .week-nav span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px;
  color: var(--ink-2); text-decoration: none; background: var(--surface);
}
.week-nav a + *, .week-nav span + * { border-left: 1px solid var(--rule); }
.week-nav .here { color: var(--ink); font-weight: 600; background: var(--sunken); }

.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: 1rem; }
.summary .sep { color: var(--rule-strong); }
.summary .alert { color: var(--notdone); font-weight: 600; }

/* -- wrap-up board ------------------------------------------------------- */

.board-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 2px solid var(--ink);
}
.board-head .help { max-width: 820px; color: var(--ink-2); margin-top: 8px; text-wrap: pretty; }
.steps { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.steps .bars { display: flex; gap: 4px; }
.steps .bars span { width: 26px; height: 4px; border-radius: 2px; background: var(--rule-strong); }
.steps .bars span.on { background: var(--ink); }

.rows { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto auto;
  gap: 18px; align-items: center;
  padding: 12px 16px 12px 14px;
  border-top: 1px solid var(--rule);
  border-left: 4px solid transparent;
}
.row:first-child { border-top: 0; }
.row .text { font-size: 1.2rem; font-weight: 500; line-height: 1.35; }
.row .comment { font-size: 0.93rem; color: var(--ink-2); margin-top: 2px; }
/* The row the meeting is talking about, the same on every tab watching. */
.row.focused { border-left-color: var(--ink); background: var(--focus-tint); }

.picker { display: flex; gap: 4px; align-items: center; }
.picker button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 44px; height: 44px; padding: 0 10px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-3); font: inherit; cursor: pointer;
}
.picker button:hover { color: var(--ink); border-color: var(--ink-3); }
.picker .label { display: none; }
.picker button.set { font-weight: 600; }
.picker button.set .label { display: inline; }
.picker button.set.chip-done { border-color: var(--done); background: var(--done-tint); color: var(--done); }
.picker button.set.chip-wip { border-color: var(--wip); background: var(--wip-tint); color: var(--wip); }
.picker button.set.chip-review { border-color: var(--review); background: var(--review-tint); color: var(--review); }
.picker button.set.chip-not_done { border-color: var(--notdone); background: var(--notdone-tint); color: var(--notdone); }
.picker button.set.chip-unknown { border-color: var(--unknown); background: var(--unknown-tint); color: var(--unknown); }
.picker .glyph { opacity: 0.7; }
.picker button.set .glyph { opacity: 1; }

.add-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--rule); background: var(--sunken);
}
.add-row input[type="text"] { flex: 1 1 280px; width: auto; background: var(--surface); }
.add-row select { width: auto; background: var(--surface); }

.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 0; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 0; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); }
kbd { font-family: var(--mono); border: 1px solid var(--rule-strong); border-radius: var(--r-sm); padding: 1px 6px; color: var(--ink-2); }

.checklist { list-style: none; padding: 0; }
.checklist li { border-top: 1px solid var(--rule); }
.checklist li:first-child { border-top: 0; }
.checklist label { display: grid; grid-template-columns: 28px 190px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 56px; padding: 8px 16px; cursor: pointer; }
.checklist input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--ink); }

/* Presentation: remote meetings share this screen, so type grows and chrome goes. */
body.present { font-size: 1.15rem; }
body.present .row .text { font-size: 1.45rem; }
body.present .wrap { max-width: none; }

/* -- daily --------------------------------------------------------------- */

.carry { list-style: none; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.carry li { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; border-top: 1px solid var(--rule); }
.carry li:first-child { border-top: 0; }
.carry .what { flex: 1 1 auto; min-width: 0; }
.carry .choices { display: flex; gap: 4px; flex-shrink: 0; }
.carry .choices button {
  min-height: 44px; padding: 0 12px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 0.87rem; cursor: pointer;
}
.carry .choices button[aria-pressed="true"] { border: 2px solid var(--ink); color: var(--ink); font-weight: 600; }
.carry li.gone .what { text-decoration: line-through; color: var(--ink-3); }

.flag { padding: 13px 16px; }
.flag + .flag { border-top: 1px solid var(--rule); }
.flag .who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--rule); font-size: 0.87rem; }
.flag.posted { background: var(--sunken); }

.thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.thumb { position: relative; width: 132px; height: 92px; border-radius: var(--r-sm); border: 1px solid var(--rule-strong); overflow: hidden; background: var(--sunken); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .remove { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: flex; align-items: flex-start; justify-content: flex-end; padding: 5px; background: none; border: 0; cursor: pointer; }
.thumb .remove span { width: 26px; height: 26px; border-radius: 999px; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.thumb.gone { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: 0.75rem; color: var(--ink-3); }

.week-days { list-style: none; padding: 0; }
.week-days li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--rule); }
.week-days li:first-child { border-top: 0; }
.week-days .day-name { flex: 1 1 auto; }

.entry { padding: 16px 18px; }
.entry + .entry { border-top: 1px solid var(--rule); }
.entry .blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 10px; }
.entry ul { padding-left: 1.1em; }

/* -- tables -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--rule); vertical-align: middle; }
table.list thead th { border-top: 0; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); background: var(--sunken); }
table.list td form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
table.list input[type="text"], table.list input[type="time"], table.list input[type="number"] { width: auto; min-width: 0; }
.days { display: flex; gap: 4px; }
.days .check { min-height: 44px; padding: 0 9px; font-family: var(--mono); font-size: 0.8rem; }

dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; font-family: var(--mono); }

/* -- the link page ------------------------------------------------------- */

.command { font-family: var(--mono); font-size: 1.06rem; padding: 12px 16px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--sunken); }
.code { font-family: var(--mono); font-size: 3rem; font-weight: 600; letter-spacing: 0.14em; line-height: 1; padding: 18px 24px; border: 2px solid var(--ink); border-radius: var(--r-md); align-self: flex-start; }

/* -- small screens ------------------------------------------------------- */

@media (max-width: 1100px) {
  .columns-3 { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .wrap { padding: 20px 16px 40px; }
  h1 { font-size: 1.56rem; }
  .code { font-size: 2.3rem; padding: 14px 16px; }
  .top { gap: 8px; padding: 6px 12px; }
  .top .right { width: 100%; margin-left: 0; justify-content: space-between; }
  .entry .blocks { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .checklist label { grid-template-columns: 28px minmax(0, 1fr); }
  .checklist label .project, .checklist label .chip { grid-column: 2; }
  .sticky-save { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 16px; border-top: 1px solid var(--rule); }
  .sticky-save .button { width: 100%; }
}

/* -- small additions --------------------------------------------------- */

.card-head.strong { border-bottom: 2px solid var(--ink); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.admin-nav a[aria-current="page"] { border: 2px solid var(--ink); color: var(--ink); }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.right-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px 26px; }
