/*! Daily - hand-written CSS, no framework/build step. Rationale in
 * design/DESIGN.md. 19 sections below. */

/* -- 1. DESIGN TOKENS -- */
:root {
  /* --- Color. Ratio vs. the surface named per line; table in DESIGN.md. --- */
  --color-paper: #f5f1e6;       /* app background */
  --color-surface: #ffffff;     /* raised cards */
  --color-ink: #14140f;         /* primary text - 16.4:1 on paper */
  --color-ink-soft: #4a4a42;    /* secondary/meta text - 7.9:1 on paper */
  --color-red: #c81d25;         /* 5.1:1 on paper (safe for text) */
  --color-blue: #1b3f8b;        /* 8.7:1 on paper (safe for text) */
  --color-yellow: #f5c518;      /* FILL ONLY - 1.4:1 on paper, never text-on-paper */
  --color-line: rgba(20, 20, 15, 0.16);   /* hairline rules, decorative only */
  --color-line-strong: rgba(20, 20, 15, 0.32);

  --color-on-red: #ffffff;      /* 5.7:1 on red */
  --color-on-blue: #ffffff;     /* 9.9:1 on blue */
  --color-on-yellow: #14140f;   /* 11.3:1 on yellow */
  --color-on-ink: #ffffff;      /* 18.5:1 on ink */

  --color-focus: var(--color-blue);

  /* --- Type: Jost (UI) + Caslon (serif). 4 weight files: 400/700 each. --- */
  --font-ui: "Jost", "Futura PT", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --text-xs: 0.75rem;      /* 12px - captions, datelines */
  --text-sm: 0.875rem;     /* 14px - meta, labels */
  --text-base: 1rem;       /* 16px - body */
  --text-md: 1.125rem;     /* 18px */
  --text-lg: 1.375rem;     /* 22px - card titles */
  --text-xl: 1.75rem;      /* 28px - section headings */
  --text-2xl: clamp(2rem, 1.4rem + 2.5vw, 2.75rem);   /* page headings */
  --text-3xl: clamp(2.5rem, 1.6rem + 5vw, 4.5rem);    /* masthead / reveal */
  --text-giant: clamp(4rem, 1rem + 14vw, 9rem);       /* band numerals */

  --leading-tight: 1.15;
  --leading-base: 1.5;
  --tracking-wide: 0.06em;

  /* --- Spacing (4px grid) --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* --- Shape --- */
  --radius: 0;             /* Bauhaus: flat corners everywhere */
  --radius-round: 50%;     /* for the actual circle shape motif only */
  --border-thin: 1px solid var(--color-ink);
  --border-thick: 3px solid var(--color-ink);
  --border-heavy: 6px solid var(--color-ink);

  /* Hard-edge offset "shadow", no blur - flat poster look */
  --shadow-sm: 3px 3px 0 var(--color-ink);
  --shadow-md: 6px 6px 0 var(--color-ink);

  /* --- Motion; every rule wrapped by the reduced-motion guard, §3 --- */
  --duration-fast: 120ms;
  --duration-base: 220ms;
  --duration-slow: 420ms;
  --duration-slower: 650ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Layout --- */
  --nav-height: 3.75rem;
  --tabbar-height: 3.75rem;
  --container-max: 72rem;
}

/* -- 2. PAGE ARRIVAL ANIMATION: CSS-only, no View Transitions API (client
   decision 2026-09-26; ARCHITECTURE.md). A swap inserts fresh DOM, so
   .band's wipe-in below and .shape's entrance (§6) just replay, no JS. -- */

/* -- 3. RESET & BASE -- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--color-blue); text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: var(--leading-tight); font-weight: 700; }
ul, ol { padding-left: 1.1em; }
table { border-collapse: collapse; width: 100%; }

/* UA [hidden]{display:none} loses to .toast/.stack/.grid-auto's own display; force it */
[hidden] { display: none !important; }

/* Honor OS-level reduced-motion everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -3rem;
  z-index: 100;
  background: var(--color-ink);
  color: var(--color-on-ink);
  padding: var(--space-2) var(--space-4);
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-3); }

/* Focus ring: blue clears 3:1 on paper/white; 2nd selector covers the weekday-picker's hidden input's label */
:focus-visible, .weekday-picker input:focus-visible + label {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* 44px min touch target */
button, a.btn, .tab-bar a, input[type="radio"] {
  min-height: 44px;
}
input[type="radio"] { min-width: 44px; }

/* -- 5. LAYOUT PRIMITIVES -- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container, .site-header { padding-inline: var(--space-6); }
}

.stack { display: flex; flex-direction: column; }
.stack > * + *, .news-columns h3 + p { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.grid-auto, .form-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
.grid-auto > *, .form-grid > * { min-width: 0; }
/* prev/next pair: one row at every width */
.pager { display: flex; justify-content: space-between; gap: var(--space-2); }
.pager .btn { padding-inline: var(--space-2); }
@media (min-width: 640px) {
  .grid-auto { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-auto { grid-template-columns: repeat(3, 1fr); }
}

.split {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
.split > * { min-width: 0; } /* grid items default to min-width:auto, can blow out the track */
@media (min-width: 900px) {
  .split { grid-template-columns: 22rem 1fr; }
  .split.-two-one { grid-template-columns: 2fr 1fr; }
  .split.-one-two { grid-template-columns: 1fr 2fr; }
  .split.-divided > :first-child { border-right: var(--border-thick); padding-right: var(--space-5); }
}

main {
  padding-bottom: calc(var(--tabbar-height) + var(--space-6));
}
@media (min-width: 768px) {
  main { padding-bottom: var(--space-7); }
}

.page-head {
  padding-block: var(--space-6) var(--space-5);
}
.page-head h1, .headline-lg { font-size: var(--text-2xl); }
.page-head p { color: var(--color-ink-soft); margin-top: var(--space-1); }

/* -- 6. BAUHAUS SHAPES - decorative only; mark aria-hidden -- */
/* z-index:-1 keeps behind text; slides/rotates/scales in, staggered via --delay */
.shape {
  position: absolute;
  z-index: -1;
  display: block;
  pointer-events: none;
  animation: shape-in 620ms var(--ease-bounce) both;
  animation-delay: var(--delay, 0ms);
}
@keyframes shape-in {
  from { opacity: 0; transform: scale(0.4) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
/* reduced-motion: covered by the §3 catch-all, see DESIGN.md */
.shape-circle { border-radius: var(--radius-round); }
.shape-square { border-radius: var(--radius); }
.shape-triangle {
  width: 0; height: 0;
  background: transparent !important;
  border-style: solid;
}
.shape-triangle.-up {
  border-width: 0 2.5rem 4.3rem 2.5rem;
  border-color: transparent transparent var(--tri, var(--color-red)) transparent;
}
.shape-triangle.-down {
  border-width: 4.3rem 2.5rem 0 2.5rem;
  border-color: var(--tri, var(--color-blue)) transparent transparent transparent;
}

.fill-red { background: var(--color-red); }
.fill-blue { background: var(--color-blue); }
.fill-yellow { background: var(--color-yellow); }
.fill-ink { background: var(--color-ink); }

/* -- 7. BUTTONS -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.01em;
  border: var(--border-thick);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translate(0, 0); box-shadow: none; }

/* reused by .tag-brick/.tag-ball and the checklist done-dot */
.btn-primary, .tag-brick { background: var(--color-red); color: var(--color-on-red); border-color: var(--color-ink); }
.btn-blue, .tag-ball { background: var(--color-blue); color: var(--color-on-blue); border-color: var(--color-ink); }
.btn-yellow { background: var(--color-yellow); color: var(--color-on-yellow); border-color: var(--color-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(20, 20, 15, 0.06); transform: none; box-shadow: none; }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); min-height: 44px; }
.btn-icon { padding: var(--space-3); aspect-ratio: 1; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* -- 8. FORMS -- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label, .field legend {
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.field .hint { font-size: var(--text-sm); color: var(--color-ink-soft); font-weight: 400; }

.input, .select, .textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: var(--border-thin);
  border-radius: var(--radius);
  font-size: var(--text-base);
  min-height: 44px;
  min-width: 0;
}
.textarea { min-height: 7rem; resize: vertical; }
/* iOS WebKit gives date/time inputs a native width that ignores width:100% */
@supports (-webkit-touch-callout: none) {
  .input[type="date"], .input[type="time"] { -webkit-appearance: none; appearance: none; display: block; }
  .input::-webkit-date-and-time-value { text-align: left; }
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 1px;
  border-color: var(--color-focus);
}

/* .form-grid base merged with .grid-auto, section 5 */
@media (min-width: 640px) {
  .form-grid.-two { grid-template-columns: 1fr 1fr; }
}

/* checkbox: red-fill square, global; sized at 44px directly, not via min-width */
input[type="checkbox"] {
  position: relative;
  appearance: none;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border: var(--border-thick);
  background: var(--color-surface);
  cursor: pointer;
  display: grid;
  place-content: center;
}
input[type="checkbox"]::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  background: var(--color-red);
  transform: scale(0);
  transition: transform var(--duration-fast) var(--ease-bounce);
}
input[type="checkbox"]:checked::before { transform: scale(1); }
/* a ring pops and fades outward the moment a box is checked */
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute; inset: -6px;
  border: 3px solid var(--color-red);
  border-radius: var(--radius-round);
  animation: check-pop 420ms var(--ease-out) both;
}
@keyframes check-pop {
  from { transform: scale(0.3); opacity: 1; }
  to { transform: scale(1.7); opacity: 0; }
}
/* reduced-motion: covered by the §3 catch-all too */
.check { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: var(--text-base); }

/* weekday picker (S M T W T F S), repeat option */
.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 2.75rem)); gap: var(--space-1); }
.weekday-picker input, .segmented input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-picker label {
  display: grid;
  place-content: center;
  height: 2.75rem;
  border: var(--border-thin);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.weekday-picker input:checked + label {
  background: var(--color-blue);
  color: var(--color-on-blue);
  border-color: var(--color-ink);
}

/* segmented toggle: Now/Scheduled, Brick/Ball, Week/Month */
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; border: var(--border-thick); background: var(--color-surface); }
.segmented label { flex: none; white-space: nowrap; }
.segmented label {
  padding: var(--space-3) var(--space-5);
  font-weight: 700;
  color: var(--color-ink);
  cursor: pointer;
  border-right: var(--border-thick);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.segmented label:last-child { border-right: none; }
@media (max-width: 359px) { .segmented label { padding-inline: var(--space-3); } }
/* inside a form field, a toggle fills the row in equal halves */
.field > .segmented { display: flex; }
.field > .segmented label { flex: 1 1 0; justify-content: center; padding-inline: var(--space-2); white-space: normal; text-align: center; }
.segmented input:checked + label { background: var(--color-ink); color: var(--color-on-ink); }
.segmented input:focus-visible + label { outline: 3px solid var(--color-focus); outline-offset: -4px; }
/* semantic red/blue pairing, reused by Now/Scheduled and Brick/Ball */
.segmented input:checked + .seg-red { background: var(--color-red); color: var(--color-on-red); }
.segmented input:checked + .seg-blue { background: var(--color-blue); color: var(--color-on-blue); }

/* expanding section: Repeat? -> weekday picker */
.expand {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--duration-slow) var(--ease-standard);
}
.expand.is-open { max-height: 32rem; }
@media (prefers-reduced-motion: reduce) {
  .expand { transition: none; }
}

/* -- 9. NAVIGATION -- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-inline: var(--space-4);
  background: var(--color-paper);
  border-bottom: var(--border-thick);
}

.logo-mark {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--color-red);
  color: var(--color-on-red);
  display: grid;
  place-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
  flex-shrink: 0;
}
.logo-word { font-weight: 700; font-size: var(--text-md); letter-spacing: 0.01em; }
.site-brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--color-ink); }

.primary-nav { display: none; align-items: center; gap: var(--space-1); margin-left: var(--space-4); }
.primary-nav a {
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.primary-nav a[aria-current="page"] {
  background: var(--section, var(--color-red));
  color: var(--section-on, var(--color-on-red));
  border-color: transparent;
}
.primary-nav a:hover { border-color: var(--color-ink); }
@media (min-width: 768px) { .primary-nav { display: flex; } }

.header-spacer { flex: 1; }

.menu-toggle {
  border: var(--border-thick);
  background: var(--color-surface);
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-toggle span { display: block; width: 1.1rem; height: 2px; background: var(--color-ink); position: relative; }
.menu-toggle span::before,
.menu-toggle span::after { content: ""; position: absolute; left: 0; width: 1.1rem; height: 2px; background: var(--color-ink); }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }

.account-menu {
  position: absolute;
  top: var(--nav-height);
  right: var(--space-4);
  width: 14rem;
  background: var(--color-surface);
  border: var(--border-thick);
  box-shadow: var(--shadow-md);
  padding: var(--space-2);
  display: none;
  flex-direction: column;
  z-index: 60;
}
.account-menu.is-open { display: flex; }
.account-menu a, .account-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-3);
  background: none;
  border: none;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--color-paper); }
.account-menu hr { border: none; border-top: var(--border-thin); margin: var(--space-1) 0; }

/* bottom tab bar: primary nav pattern on small screens */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  height: var(--tabbar-height);
  background: var(--color-surface);
  border-top: var(--border-thick);
}
.tab-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-ink-soft);
  text-decoration: none;
}
.tab-bar .tab-icon { font-size: var(--text-lg); line-height: 1; }
/* filled badge behind the icon, not text colour - keeps yellow legible */
.tab-bar a[aria-current="page"] .tab-icon {
  background: var(--section, var(--color-red));
  color: var(--section-on, var(--color-on-red));
  width: 1.75rem; height: 1.75rem;
  border-radius: var(--radius-round);
  display: grid; place-content: center;
  font-size: var(--text-base);
}
@media (min-width: 768px) { .tab-bar { display: none; } }

/* -- 10. CARDS -- */
.card, .event-card {
  background: var(--color-surface);
  border: var(--border-thick);
  padding: var(--space-5);
}
.card-title, .event-card__title { font-size: var(--text-lg); font-weight: 700; }
.card-meta { font-size: var(--text-sm); color: var(--color-ink-soft); }

/* tool cards slide up on load, staggered via inline --delay */
.tool-card {
  background: var(--color-surface);
  border: var(--border-thick);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-ink);
  animation: card-in var(--duration-slow) var(--ease-out) both;
  animation-delay: var(--delay, 0ms);
}
/* hard shadow moves on hover/press - shared by any "pick-up-able" card */
.tool-card, .event-card, .checklist-row {
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.tool-card:hover, .event-card:hover, .checklist-row:hover { box-shadow: var(--shadow-sm); transform: translate(-2px, -2px); }
.tool-card:active, .event-card:active, .checklist-row:active { box-shadow: none; transform: translate(0, 0); }
.tool-card .tool-icon {
  width: 2.5rem; height: 2.5rem;
  display: grid; place-content: center;
  font-weight: 700;
  color: var(--color-on-ink);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card { animation: none; }
}

/* event cards (background/border/padding shared with .card, above) */
.event-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); align-items: flex-start; }
/* actions stay one row: beside the title when they fit, else on their own line */
.event-card__head > div:first-child { flex: 1 1 9rem; min-width: 0; }
.event-card__head > .cluster { flex-wrap: nowrap; gap: var(--space-1); margin-left: auto; }
.event-card__head .btn-sm { padding-inline: var(--space-2); }
/* colour says what kind of event this is: now/red, scheduled/blue, you're hosting/yellow */
.event-card.-now { border-left: 6px solid var(--color-red); }
.event-card.-scheduled { border-left: 6px solid var(--color-blue); }
.event-card.-hosting { border-left: 6px solid var(--color-yellow); }
.event-card__details {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--duration-base) var(--ease-standard);
  margin-top: 0;
}
.event-card__details.is-open { max-height: 16rem; margin-top: var(--space-4); }
.event-card__details dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); }
.event-card__details dt { font-weight: 700; color: var(--color-ink-soft); }

.disclosure-btn {
  background: none; border: none; cursor: pointer;
  font-size: var(--text-lg);
  color: var(--color-ink);
  transition: transform var(--duration-fast) var(--ease-out);
  min-width: 44px; min-height: 44px;
}
.disclosure-btn[aria-expanded="true"] { transform: rotate(180deg); }

/* -- 11. TO-DO & CHECKLIST LISTS -- */
.todo-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.todo-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: var(--border-thin);
}
.todo-list li:last-child { border-bottom: none; }
.todo-list .todo-title { flex: 1 1 8rem; min-width: 0; }
.todo-list input:checked ~ .todo-title { text-decoration: line-through; color: var(--color-ink-soft); }
.todo-cat {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px var(--space-2);
  border: var(--border-thin);
}
/* urgency cue for an overdue to-do row */
.todo-list li.-overdue { border-left: 4px solid var(--color-red); padding-left: var(--space-3); }
/* phones: title on line 1; tag + Edit/Delete together on line 2, under the title */
@media (max-width: 599px) {
  .todo-list li:has(.btn-sm) .todo-title { flex-basis: calc(100% - 3.5rem); }
  .todo-list li:has(> input):has(.btn-sm) .todo-cat { margin-left: 3.5rem; }
  .todo-list .todo-cat { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .todo-list .btn-sm { padding-inline: var(--space-2); }
}

/* stacked, not side-by-side: at 1/3-column width, 4 action buttons
   beside a label wrap awkwardly - a full-width second line reads better
   at every size, so there's one layout, not a breakpoint override */
.checklist-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: var(--border-thin);
  background: var(--color-surface);
}
.checklist-row .cluster:last-child { justify-content: flex-end; }
.checklist-row .btn-sm { padding-inline: var(--space-2); }
/* staff row: account picker + Link on their own full-width line */
.checklist-row form.cluster { flex: 1 1 100%; flex-wrap: nowrap; }
.checklist-row form.cluster .input, .checklist-row form.cluster .select { flex: 1; width: auto; }

/* -- 12. CALENDAR GRID -- */
.calendar {
  border: var(--border-thick);
  background: var(--color-surface);
}
.calendar-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: var(--border-thick);
}
.calendar-head span {
  padding: var(--space-2);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  border-right: var(--border-thin);
}
.calendar-head span:last-child { border-right: none; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-day {
  min-height: 5rem;
  min-width: 0;
  padding: var(--space-2);
  border-right: var(--border-thin);
  border-bottom: var(--border-thin);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.calendar-day:nth-child(7n) { border-right: none; }
.day-label { display: flex; align-items: center; gap: var(--space-2); }
.day-name, .day-num { font-weight: 700; font-size: var(--text-sm); }
.day-name { display: none; }
.day-events { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.calendar-day.-today { background: rgba(27, 63, 139, 0.08); }
.calendar-day.-today .day-num {
  background: var(--color-blue);
  color: var(--color-on-blue);
  width: 1.5rem; height: 1.5rem;
  display: grid; place-content: center;
}
.calendar-event {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 1px var(--space-1);
  background: var(--color-yellow);
  color: var(--color-on-yellow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* vertical agenda below the breakpoint. Scoped to #week-view so the
   month grid (same class names) keeps 7 columns. */
@media (max-width: 767px) {
  #week-view .calendar-head { display: none; }
  #week-view .calendar-grid { grid-template-columns: 1fr; }
  .calendar-day {
    flex-direction: row;
    align-items: center;
    min-height: auto;
    border-right: none;
    gap: var(--space-3);
  }
  .day-label { flex-shrink: 0; width: 4.25rem; }
  .day-name { display: inline; }
  .day-events { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .calendar-event { white-space: normal; }
}

/* -- 13. TAGS, EMPTY STATE, TOAST -- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-1) var(--space-3);
  border: var(--border-thin);
}
/* .tag-brick/.tag-ball colors: see .btn-primary/.btn-blue, sect. 7 */
.tag-coming-soon { background: var(--color-paper); color: var(--color-ink-soft); }

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  border: 3px dashed var(--color-line-strong);
}
.empty-state .shape-circle {
  position: static;
  margin: 0 auto var(--space-4);
  width: 4rem; height: 4rem;
}
.empty-state h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.empty-state p { color: var(--color-ink-soft); max-width: 28rem; margin-inline: auto; }

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-ink);
  color: var(--color-on-ink);
  border: var(--border-thick);
  border-color: var(--color-ink);
  animation: toast-in var(--duration-base) var(--ease-bounce) both;
}
.toast .toast-dot {
  width: 1.5rem; height: 1.5rem; flex-shrink: 0;
  background: var(--color-yellow);
  border-radius: var(--radius-round);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* -- 14. TOOL PANELS -- */
/* .roster: bordered list wrapper, reused by the Staff roster page (sect.
   23) - each row is a .checklist-row (sect. 11). The grid + Lock styling
   from the pass-1 shuffle demo is gone along with that panel. */
.roster { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }

.result-list { list-style: none; padding: 0; counter-reset: result; display: flex; flex-direction: column; gap: var(--space-2); }
.result-list li {
  counter-increment: result;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: var(--border-thin);
  animation: card-in var(--duration-base) var(--ease-out) both;
  animation-delay: var(--delay, 0ms);
}
.result-list li::before {
  content: counter(result);
  width: 1.75rem; height: 1.75rem;
  flex-shrink: 0;
  display: grid; place-content: center;
  background: var(--color-red);
  color: var(--color-on-red);
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) { .result-list li { animation: none; } }

/* -- 15. NEWSPAPER MODE -- */
.newspaper { background: var(--color-paper); }
.masthead {
  border-bottom: var(--border-heavy);
  padding-block: var(--space-5);
  text-align: center;
}
.masthead h1 {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  letter-spacing: 0.01em;
}
.masthead .dateline {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-top: var(--border-thin);
  border-bottom: var(--border-thin);
  padding-block: var(--space-1);
  margin-top: var(--space-3);
}

.headline { font-family: var(--font-serif); font-weight: 700; line-height: var(--leading-tight); }
.headline-md { font-size: var(--text-xl); }
.headline-sm { font-size: var(--text-md); }
.byline { font-size: var(--text-xs); text-transform: uppercase; color: var(--color-ink-soft); letter-spacing: var(--tracking-wide); }
.dropcap:first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 3.4em;
  line-height: 0.85;
  font-weight: 700;
  padding-right: var(--space-2);
}

/* reset zeroes margins - heading clearance merged with .stack, section 5 */
.news-columns p + p { margin-top: var(--space-3); }

.news-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding-block: var(--space-6);
}
@media (min-width: 768px) {
  .news-columns.-two { grid-template-columns: 1fr 1fr; }
  .news-columns.-three { grid-template-columns: repeat(3, 1fr); }
}
.news-columns > * + * { border-top: var(--border-thin); padding-top: var(--space-5); }
@media (min-width: 768px) {
  .news-columns.-two > *, .news-columns.-three > * { border-top: none; padding-top: 0; }
  .news-columns.-two > :nth-child(n+2), .news-columns.-three > :nth-child(n+2) {
    border-left: var(--border-thin);
    padding-left: var(--space-6);
  }
}
.rule { border: none; border-top: var(--border-thick); margin-block: var(--space-5); }
.rule-thin { border: none; border-top: var(--border-thin); margin-block: var(--space-4); }

.archive-story { padding-bottom: var(--space-5); }
.archive-story .headline { margin-bottom: var(--space-2); }

/* -- 16. REVEAL DECK -- */
.reveal-stage {
  position: fixed;
  inset: 0;
  background: var(--color-ink);
  color: var(--color-on-ink);
  overflow: hidden;
}
/* blue fails contrast here; yellow is 11.3:1 on ink */
.reveal-stage :focus-visible { outline-color: var(--color-yellow); }
.slide {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  gap: var(--space-4);
}
.slide.is-active {
  display: flex;
  animation: slide-in var(--duration-slower) var(--ease-out) both;
}
@keyframes slide-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .slide.is-active { animation: none; } }

/* kicker stays yellow (11.3:1 on ink); red/blue text on ink fails 4.5:1, use .tag instead */
.slide-kicker { font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; font-size: var(--text-sm); color: var(--color-yellow); }
.slide-title { font-family: var(--font-serif); font-size: var(--text-3xl); max-width: 44rem; }
.slide-body { font-size: var(--text-lg); max-width: 36rem; color: rgba(255,255,255,0.85); }

/* bauhaus shape motif behind each slide, swapped per type */
.slide-shape {
  position: absolute;
  z-index: -1;
  opacity: 0.9;
  animation: shape-drift 6s var(--ease-standard) infinite alternate;
}
@keyframes shape-drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(12px, -12px) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) { .slide-shape { animation: none; } }
.slide.-brick .slide-shape { background: var(--color-red); }
.slide.-ball .slide-shape { background: var(--color-blue); }

.rating {
  display: flex;
  gap: var(--space-2);
}
.rating button, .reveal-nav button {
  width: 3rem; height: 3rem;
  border: var(--border-thick);
  border-color: var(--color-on-ink);
  background: transparent;
  color: var(--color-on-ink);
  cursor: pointer;
}
.rating button { font-weight: 700; min-height: 44px; }
.rating button[aria-pressed="true"] { background: var(--color-yellow); color: var(--color-on-yellow); border-color: var(--color-yellow); }

.reveal-nav {
  position: absolute;
  bottom: var(--space-5);
  right: var(--space-5);
  display: flex;
  gap: var(--space-3);
  z-index: 5;
}
.reveal-progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.2);
  z-index: 5;
}
.reveal-progress span {
  display: block; height: 100%;
  background: var(--color-yellow);
  transition: width var(--duration-base) var(--ease-standard);
}

.leaderboard { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); width: 100%; max-width: 30rem; }
.leaderboard li {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: var(--border-thick);
  border-color: var(--color-on-ink);
  text-align: left;
}
.leaderboard .rank { font-family: var(--font-serif); font-size: var(--text-xl); width: 2rem; }
.leaderboard .score { margin-left: auto; font-weight: 700; color: var(--color-yellow); }

/* -- 17. UTILITIES -- */
.text-center { text-align: center; }
.text-soft { color: var(--color-ink-soft); }
.mt-0 { margin-top: 0 !important; }

/* -- 18. SECTION COLOUR & FULL-BLEED BANDS -- */
/* one accent per area, read by nav's active state. Events/Brick&Ball
   use .band-mixed instead of a single hue. */
.section-home { --section: var(--color-ink); --section-on: var(--color-on-ink); }
.section-tasks { --section: var(--color-red); --section-on: var(--color-on-red); }
.section-cal { --section: var(--color-blue); --section-on: var(--color-on-blue); }
.section-tools { --section: var(--color-yellow); --section-on: var(--color-on-yellow); }
/* Events' nav identity matches its band-mixed diagonal, not a single hue -
   custom properties can hold a gradient just like any other background value. */
.section-events { --section: linear-gradient(100deg, var(--color-red) 0 50%, var(--color-blue) 50% 100%); --section-on: #fff; }

/* full-bleed: a child of <main>, outside .container - no vw/margin hacks */
.band {
  background: var(--section, var(--color-ink));
  color: var(--section-on, var(--color-on-ink));
  position: relative;
  z-index: 0;
  overflow: hidden;
  padding-block: var(--space-7) var(--space-6);
  /* Arrival animation (§2): replays on every fresh .band (load or boosted
     swap). Scoped to this element only, so nothing elsewhere is ever
     covered/unclickable. Reduced-motion: §3 catch-all, like .shape below. */
  animation: band-wipe-in var(--duration-slow) var(--ease-standard) both;
}
@keyframes band-wipe-in {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
.band a { color: inherit; }
.band .container { position: relative; z-index: 0; }
/* keep headline text clear of the corner shape; controls below use full width */
.band-clear > .band-eyebrow, .band-clear > .band-title, .band-clear > .band-lead { padding-right: 7rem; }
/* Events/Brick&Ball: hard red/blue/ink stripe - white text passes all
   three (5.7 / 9.9 / 18.5:1) */
.band-mixed {
  background: linear-gradient(120deg,
    var(--color-red) 0 30%, var(--color-blue) 30% 65%, var(--color-ink) 65% 100%);
  color: #fff;
}
.band-eyebrow { text-transform: uppercase; letter-spacing: var(--tracking-wide); font-weight: 700; font-size: var(--text-sm); opacity: .92; }
.band-title { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.01em; margin-top: var(--space-1); }
.band-lead { margin-top: var(--space-2); opacity: .92; max-width: 32rem; }
.band-numeral { font-size: var(--text-giant); font-weight: 700; line-height: 0.8; font-variant-numeric: tabular-nums; }
.band-stats { display: flex; gap: var(--space-6); margin-top: var(--space-5); flex-wrap: wrap; }
.band-stat b { display: block; font-size: var(--text-2xl); font-weight: 700; line-height: 1; }
.band-stat span { display: block; max-width: 7rem; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); opacity: .92; }

/* -- 19. MONTH CALENDAR -- */
/* one cell = one <button>: real tap target on phones; desktop shows
   chips and hides the tap-agenda panel below */
.month-day {
  min-height: 3.25rem;
  min-width: 0;
  width: 100%;
  padding: var(--space-1);
  border: none;
  border-right: var(--border-thin);
  border-bottom: var(--border-thin);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calendar-grid.-month .month-day:nth-child(7n) { border-right: none; }
.month-day.-outside .day-num { color: var(--color-ink-soft); }
.month-day.-today .day-num {
  background: var(--color-blue); color: var(--color-on-blue);
  width: 1.5rem; height: 1.5rem; display: grid; place-content: center;
}
.month-day.is-selected { background: rgba(27, 63, 139, 0.1); }
.month-day:focus-visible { outline: 3px solid var(--color-focus); outline-offset: -3px; }
.month-chips { display: none; }
.month-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.month-dots span { width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--radius-round); background: var(--color-blue); }
@media (min-width: 768px) {
  .month-day { min-height: 5rem; cursor: default; }
  .month-chips { display: flex; flex-direction: column; gap: 2px; }
  .month-dots { display: none; }
}
.month-agenda { border: var(--border-thick); padding: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 768px) { .month-agenda { display: none; } }

/* -- 20. SELF-HOSTED FONTS (Phase 1b; replaces Google Fonts <link> in templates) -- */
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jost-variable.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Caslon Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/libre-caslon-text-400.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Caslon Text";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/libre-caslon-text-700.woff2") format("woff2");
}

/* -- 21. INVITES: owner-role warning, shown only while "owner" is selected -- */
#owner-invite-warning { display: none; }
#role:has(option[value="owner"]:checked) + #owner-invite-warning { display: block; }

/* -- 22. NAME-ORDER SNAKE DRAFT (Tools) -- */
/* people picker: same hidden-input/label mechanics as .weekday-picker
   (sect. 8), but content-width chips instead of fixed 44px squares */
.chip-picker { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip-picker input { position: absolute; opacity: 0; pointer-events: none; }
.chip-picker label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: var(--border-thin);
  font-weight: 700;
  font-size: var(--text-base);
  text-transform: none;
  cursor: pointer;
  min-height: 44px;
  user-select: none;
}
.chip-picker input:checked + label { background: var(--color-ink); color: var(--color-on-ink); border-color: var(--color-ink); }
.chip-picker input:focus-visible + label { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* the live draw gets a livelier drop than plain .result-list card-in;
   applied only while the demo is mid-reveal */
@keyframes draw-drop {
  0% { opacity: 0; transform: translateY(-36px) rotate(-6deg) scale(0.85); }
  65% { opacity: 1; transform: translateY(4px) rotate(2deg) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}
.result-list.-drawing li { animation: draw-drop var(--duration-slower) var(--ease-bounce) both; }
@media (prefers-reduced-motion: reduce) { .result-list.-drawing li { animation: none; } }

/* snake pick board: grouped by round; .-rev mirrors the row for the
   leftward turn while each tile keeps its own true pick number */
.snake-board { display: flex; flex-direction: column; gap: var(--space-5); }
.snake-round-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink-soft);
}
.snake-row { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
/* tiles always read in pick order; direction is carried by the round head's arrow + the turn callouts (row-reverse misread once a round wraps on phones) */
.snake-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 4.25rem;
  min-height: 4.25rem;
  padding: var(--space-1);
  border: var(--border-thin);
  background: var(--color-surface);
  font-weight: 700;
  text-align: center;
  overflow-wrap: break-word;
}
.snake-pick b { font-size: var(--text-xs); font-weight: 700; color: var(--color-ink-soft); }
/* double-pick at each turn - red text on this tint is 5.2:1, see DESIGN.md */
.snake-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-left: 4px solid var(--color-red);
  background: rgba(200, 29, 37, 0.06);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-red);
}

.tag-saved { background: var(--color-ink); color: var(--color-on-ink); border-color: var(--color-ink); }
.readonly-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: var(--border-thin);
  border-left: 4px solid var(--color-ink);
  background: var(--color-surface);
  font-size: var(--text-sm);
}
.history-list { display: flex; flex-direction: column; gap: var(--space-3); }

/* -- 23. STAFF ROSTER (owner admin, reached via the account menu) -- */
/* rows reuse .checklist-row (sect. 11) for the bordered, stacked layout -
   same reasoning as Tasks: several actions read better stacked than
   squeezed beside a name at narrow widths */
.staff-name { font-weight: 700; }
.checklist-row.-inactive .staff-name { color: var(--color-ink-soft); }

/* -- 24. CAROUSEL MODE (name-order, Phase 4) -- */
.carousel { display: flex; flex-direction: column; gap: var(--space-4); }
.carousel-progress { position: relative; height: 6px; background: var(--color-line); }
.carousel-progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--color-ink); transition: width var(--duration-base) var(--ease-out); }
.carousel-progress-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--color-paper); }
.carousel-slots { display: grid; grid-template-columns: minmax(3.5rem, .7fr) minmax(0, 2fr) minmax(3.5rem, .7fr); gap: var(--space-2); }
.carousel-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-1);
  padding: var(--space-3);
  border: var(--border-thin);
  background: var(--color-paper);
  color: var(--color-ink-soft);
  min-height: 6rem;
}
.carousel-slot.-empty { border-style: dashed; }
.carousel-slot.-now { border: var(--border-thick); background: var(--color-surface); color: var(--color-ink); padding: var(--space-5) var(--space-3); box-shadow: var(--shadow-sm); }
.carousel-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.carousel-name { font-weight: 700; overflow-wrap: break-word; }
.carousel-slot.-now .carousel-name { font-size: var(--text-3xl); }
.carousel-meta { font-size: var(--text-sm); }
.carousel-done { text-align: center; font-weight: 700; }
.carousel-done .btn { display: inline-flex; margin-top: var(--space-3); }
/* reduced-motion catch-all (sect. 3) collapses these to ~0 duration */
@keyframes carousel-in-now { from { opacity: 0; transform: scale(.92) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes carousel-in-side { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.carousel-slots.-anim .carousel-slot.-now { animation: carousel-in-now var(--duration-base) var(--ease-bounce); }
.carousel-slots.-anim .carousel-slot.-prev, .carousel-slots.-anim .carousel-slot.-next { animation: carousel-in-side var(--duration-base) var(--ease-out); }
:fullscreen .carousel { justify-content: center; height: 100%; padding: var(--space-6); }
:fullscreen .carousel-slot.-now .carousel-name { font-size: var(--text-giant); }
