/* The kitchen screen (UX run-29, DESIGN.md § 8m): the board kitchen/render.js draws, on the page, in
   its full-screen mode and in the landing's kit. It is a screen, so it is ink in any colour scheme, like
   the kit's stage: warm near-black, the toys' paper white for text, lemon for what comes next and the
   line's marks, mint for what is done and the little ones' question. Sizes follow the board's own
   width (container queries, `cqi`), so one tree reads from across the room on a tablet and fits a
   phone. The night look (from the page's setting until 06:00) keeps the clock and two lines, dim. */
.kc-b {
  --kc-bg: #121211;
  --kc-tile: #1e1e1c;
  --kc-tile-2: #2a2a27;
  --kc-ink: #f2f0ea;        /* 16.4:1 on the board, 14.7:1 on a tile */
  --kc-ink-2: #a9a59c;      /* 7.6:1 on the board, 6.8:1 on a tile */
  --kc-dark: #141414;       /* text on lemon (12.76:1) and mint (8.38:1) */
  --kc-lemon: #ffd23f;
  --kc-mint: #17c787;
  --kc-gap: clamp(10px, 1.8cqi, 22px);
  container-type: inline-size;
  container-name: kc;
  position: relative;
  display: grid; align-content: start; gap: var(--kc-gap);
  padding: clamp(16px, 3.2cqi, 44px);
  background: var(--kc-bg); color: var(--kc-ink);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-variation-settings: normal;
}
.kc-b p, .kc-b h2, .kc-b h3, .kc-b h4, .kc-b h5, .kc-b ul { margin: 0; }
.kc-b ul { padding: 0; list-style: none; }
.kc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.kc-k {
  font: 600 clamp(.75rem, 1.15cqi, 1rem)/1.25 var(--t-mono, "Geist Mono", ui-monospace, monospace);
  letter-spacing: .08em; text-transform: uppercase;
}

/* ---------- The clock and the hour ---------- */
.kc-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px clamp(14px, 3cqi, 40px); }
.kc-clock {
  font: 600 clamp(3.5rem, 15cqi, 12.5rem)/.86 var(--t-mono, "Geist Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.kc-clock time { display: block; }
.kc-when { display: grid; gap: 6px; padding-bottom: clamp(2px, .8cqi, 12px); }
@container kc (min-width: 760px) { .kc-when { justify-items: end; text-align: right; } }
.kc-date { font-size: clamp(1.125rem, 2.9cqi, 2.6rem); line-height: 1.1; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.kc-phase {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 clamp(.8125rem, 1.4cqi, 1.2rem)/1.2 var(--t-mono, "Geist Mono", ui-monospace, monospace);
  letter-spacing: .08em; text-transform: uppercase; color: var(--kc-ink-2);
}
.kc-dot { width: .6em; height: .6em; border-radius: 50%; background: var(--kc-lemon); flex: none; }
.kc-ex {
  justify-self: start; display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border-radius: 8px;
  border: 1.5px dashed var(--kc-lemon); color: var(--kc-lemon);
  font: 600 clamp(.75rem, 1.1cqi, .95rem)/1.2 var(--t-mono, "Geist Mono", ui-monospace, monospace); letter-spacing: .06em; text-transform: uppercase;
}
@container kc (min-width: 760px) { .kc-when .kc-ex { justify-self: end; } }

/* ---------- The grid: the day on the left, the cards on the right ---------- */
.kc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--kc-gap); align-items: start; }
@container kc (min-width: 760px) { .kc-grid { grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); } }
.kc-main { display: grid; gap: var(--kc-gap); min-width: 0; }
.kc-side { display: grid; gap: var(--kc-gap); min-width: 0; }
@container kc (min-width: 520px) and (max-width: 759px) {
  .kc-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kc-side .kc-table { grid-column: 1 / -1; order: 3; }
}

/* What comes next: the lemon slab, the one thing on the screen that shouts. */
.kc-next {
  display: grid; gap: 4px; padding: clamp(14px, 2.4cqi, 30px) clamp(16px, 2.8cqi, 34px);
  border-radius: clamp(16px, 2cqi, 26px);
  background: var(--kc-lemon); color: var(--kc-dark);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.16);
}
.kc-next-t { font-size: clamp(1.5rem, 4.4cqi, 3.6rem); line-height: 1; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.kc-next-m { font: 600 clamp(.9375rem, 1.8cqi, 1.5rem)/1.3 var(--t-mono, "Geist Mono", ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.kc-next.is-now { background: var(--kc-mint); }
.kc-next.is-none { background: var(--kc-tile); color: var(--kc-ink); box-shadow: inset 0 0 0 1.5px var(--kc-tile-2); }
.kc-next.is-none .kc-k { color: var(--kc-ink-2); }
.kc-next.is-none .kc-next-t { font-size: clamp(1.25rem, 3cqi, 2.4rem); }

/* The line of the day, 06:00 to 22:00: a mark per timed thing and where «now» is. Decoration: the list
   below says the same in words. */
.kc-line { padding: 6px 0 0; }
.kc-line-track { position: relative; height: 10px; border-radius: 99px; background: var(--kc-tile-2); }
.kc-line-mark, .kc-line-now { position: absolute; top: 50%; left: var(--at); transform: translate(-50%, -50%); }
.kc-line-mark { width: 16px; height: 16px; border-radius: 50%; background: var(--kc-lemon); box-shadow: 0 0 0 3px var(--kc-bg); }
.kc-line-mark.is-past { background: #6f6c65; }
.kc-line-mark.is-done { background: var(--kc-mint); }
.kc-line-now { width: 4px; height: 30px; border-radius: 4px; background: var(--kc-ink); box-shadow: 0 0 0 3px var(--kc-bg); }
.kc-line-hours { position: relative; height: 1.6em; margin-top: 8px; font: 500 clamp(.6875rem, 1.05cqi, .9rem)/1.6 var(--t-mono, "Geist Mono", ui-monospace, monospace); color: var(--kc-ink-2); }
.kc-line-hours span { position: absolute; left: var(--at); transform: translateX(-50%); }
.kc-line-hours span:first-child { transform: none; }
@container kc (max-width: 519px) { .kc-line-hours span:nth-child(even) { display: none; } }

/* Today (or tomorrow): one row per thing; on the page and full screen each row is a key that ticks it. */
.kc-list { display: grid; gap: 8px; min-width: 0; }
.kc-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: clamp(1.125rem, 2.4cqi, 2rem); line-height: 1.1; font-weight: 800; letter-spacing: -.01em; }
.kc-h-n { font: 600 clamp(.8125rem, 1.4cqi, 1.15rem)/1.2 var(--t-mono, "Geist Mono", ui-monospace, monospace); color: var(--kc-ink-2); letter-spacing: .04em; }
.kc-rest { display: grid; gap: 8px; min-width: 0; }
.kc-h-rest { font-size: clamp(1rem, 1.9cqi, 1.5rem); color: var(--kc-ink-2); }
.kc-rows { display: grid; gap: 6px; }
.kc-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "tick time title who";
  align-items: center; gap: 4px clamp(10px, 1.6cqi, 18px);
  width: 100%; min-height: max(52px, 6.2cqi); padding: 8px clamp(12px, 1.8cqi, 20px);
  border: 0; border-radius: clamp(12px, 1.4cqi, 18px); background: var(--kc-tile); color: var(--kc-ink);
  font: inherit; text-align: left;
  box-shadow: inset 0 0 0 1.5px var(--kc-tile-2);
}
button.kc-row { cursor: pointer; transition: transform 120ms var(--t-spring, ease); }
button.kc-row:active { transform: scale(.985); }
button.kc-row:focus-visible { outline: 3px solid var(--kc-lemon); outline-offset: 2px; }
.kc-row-tick {
  grid-area: tick; position: relative; width: clamp(24px, 2.8cqi, 36px); height: clamp(24px, 2.8cqi, 36px); border-radius: 50%;
  box-shadow: inset 0 0 0 2.5px var(--kc-ink-2);
}
.kc-row-time { grid-area: time; min-width: 5ch; font: 600 clamp(.9375rem, 1.9cqi, 1.6rem)/1.2 var(--t-mono, "Geist Mono", ui-monospace, monospace); font-variant-numeric: tabular-nums; color: var(--kc-ink-2); }
.kc-row-t { grid-area: title; font-size: clamp(1.0625rem, 2.3cqi, 1.9rem); line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.kc-row-who { grid-area: who; justify-self: end; padding: 2px 10px; border-radius: 8px; background: var(--kc-tile-2); font-size: clamp(.875rem, 1.6cqi, 1.3rem); line-height: 1.3; font-weight: 600; }
@container kc (max-width: 519px) {
  .kc-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tick title time" "tick who who"; }
  .kc-row-who { justify-self: start; }
  .kc-row:not(:has(.kc-row-who)) { grid-template-areas: "tick title time"; }
}
.kc-row.is-done .kc-row-tick { background: var(--kc-mint); box-shadow: none; }
.kc-row.is-done .kc-row-tick::after {
  content: ""; position: absolute; left: 34%; top: 20%; width: 26%; height: 46%;
  border: solid var(--kc-dark); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.kc-row.is-done .kc-row-t { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--kc-ink-2); }
.kc-row.is-chat .kc-row-t::before { content: "Class chat · "; color: var(--kc-ink-2); font-weight: 500; }
.kc-more, .kc-none { font-size: clamp(.9375rem, 1.7cqi, 1.35rem); color: var(--kc-ink-2); }
.kc-none { padding: 14px clamp(12px, 1.8cqi, 20px); border-radius: 14px; border: 1.5px dashed #3a3a36; }

/* ---------- The cards ---------- */
.kc-card {
  display: grid; gap: 8px; align-content: start; padding: clamp(14px, 2.2cqi, 28px);
  border-radius: clamp(16px, 2cqi, 26px); background: var(--kc-tile); box-shadow: inset 0 0 0 1.5px var(--kc-tile-2);
  min-width: 0;
}
.kc-card-k {
  font: 600 clamp(.75rem, 1.15cqi, 1rem)/1.3 var(--t-mono, "Geist Mono", ui-monospace, monospace);
  letter-spacing: .08em; text-transform: uppercase; color: var(--kc-ink-2);
}
.kc-card-t { font-size: clamp(1.25rem, 2.9cqi, 2.3rem); line-height: 1.08; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.kc-card-m { font-size: clamp(.9375rem, 1.75cqi, 1.4rem); line-height: 1.35; color: var(--kc-ink-2); overflow-wrap: anywhere; }
.kc-card.is-empty .kc-card-t { color: var(--kc-ink-2); }
.kc-q { font-size: clamp(1.125rem, 2.45cqi, 2rem); line-height: 1.18; font-weight: 700; text-wrap: pretty; overflow-wrap: anywhere; }
.kc-chip { padding: 8px 12px; border-radius: 12px; background: var(--kc-tile-2); font-size: clamp(.9375rem, 1.7cqi, 1.35rem); line-height: 1.35; }
.kc-chip-k {
  display: inline-block; margin-right: 4px; font: 600 clamp(.6875rem, 1.05cqi, .9rem)/1.4 var(--t-mono, "Geist Mono", ui-monospace, monospace);
  letter-spacing: .06em; text-transform: uppercase; color: var(--kc-lemon);
}
.kc-chip-mint { padding: 1px 8px; border-radius: 6px; background: var(--kc-mint); color: var(--kc-dark); }
.kc-off.is-now { box-shadow: inset 0 0 0 2px var(--kc-lemon); }

/* ---------- The night look ---------- */
.kc-b.is-night { --kc-ink: #8c887f; --kc-ink-2: #8c887f; --kc-bg: #050505; align-content: center; min-height: 100%; }
.kc-nightview { display: grid; gap: clamp(8px, 1.6cqi, 20px); justify-items: center; text-align: center; padding: clamp(10px, 4cqi, 60px) 0; }
.kc-clock-night { font-size: clamp(4rem, 20cqi, 16rem); }
.kc-night-l { max-width: 40ch; font-size: clamp(1rem, 2.2cqi, 1.8rem); line-height: 1.35; }
.kc-night-l .kc-k { margin-right: 6px; }
.kc-nightview .kc-ex { justify-self: center; border-color: currentColor; color: var(--kc-ink); }

@media (prefers-reduced-motion: reduce) {
  button.kc-row { transition: none; }
  button.kc-row:active { transform: none; }
}
.kc-b [hidden] { display: none !important; }
