/* ==========================================================================
   Family Board — app styles
   Plain CSS. Light + dark themes via custom properties (system preference by
   default, manual override via [data-theme] on <html>). Designed for 375px
   phones, iPads, and the 1920x1080 TV board (see the TV section at the end).
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */
:root {
  color-scheme: light;

  --font-display: 'Bricolage Grotesque', 'Figtree', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bg: #f4f1eb;
  --bg-glow: rgba(255, 255, 255, 0.7);
  --surface: #ffffff;
  --surface-2: #f8f5f0;
  --surface-3: #efeae2;
  --ink: #1c2530;
  --ink-2: #56616e;
  --ink-3: #7d8794;
  --line: rgba(28, 37, 48, 0.1);
  --line-strong: rgba(28, 37, 48, 0.18);
  --accent: #2e86ab;
  --accent-strong: #1f6c8d;
  --accent-soft: rgba(46, 134, 171, 0.13);
  --ok: #3f8f5b;
  --ok-soft: rgba(63, 143, 91, 0.14);
  --warn: #b8741c;
  --warn-soft: rgba(184, 116, 28, 0.15);
  --danger: #b23a48;
  --danger-soft: rgba(178, 58, 72, 0.12);
  --star: #d99a1f;
  --star-soft: rgba(217, 154, 31, 0.16);
  --focus: #3d8fc4;

  --shadow-sm: 0 1px 2px rgba(23, 30, 38, 0.06), 0 2px 8px rgba(23, 30, 38, 0.05);
  --shadow-md: 0 2px 6px rgba(23, 30, 38, 0.06), 0 18px 40px -20px rgba(23, 30, 38, 0.28);
  --shadow-lg: 0 30px 80px -32px rgba(15, 22, 30, 0.45);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --tap: 44px;
  --nav-height: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --page-pad: clamp(14px, 4vw, 30px);

  /* Sky placeholder (JS paints the time-of-day phase on the hero). */
  --sky-top: #a9dcf7;
  --sky-mid: #74bce9;
  --sky-bottom: #3e8fc9;
  --sky-ink: #0e2433;
  --sky-ornament: 'dark';
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #10161d;
    --bg-glow: rgba(46, 134, 171, 0.12);
    --surface: #18222b;
    --surface-2: #1e2933;
    --surface-3: #26323d;
    --ink: #f1f4f6;
    --ink-2: #aab7c3;
    --ink-3: #8493a1;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --accent: #63b3d8;
    --accent-strong: #8ccbe8;
    --accent-soft: rgba(99, 179, 216, 0.16);
    --ok: #6cbf8a;
    --ok-soft: rgba(108, 191, 138, 0.16);
    --warn: #e0a052;
    --warn-soft: rgba(224, 160, 82, 0.16);
    --danger: #ec8290;
    --danger-soft: rgba(236, 130, 144, 0.16);
    --star: #f0c05a;
    --star-soft: rgba(240, 192, 90, 0.16);
    --focus: #7cc4e8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.32), 0 20px 44px -22px rgba(0, 0, 0, 0.65);
    --shadow-lg: 0 34px 90px -34px rgba(0, 0, 0, 0.75);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #10161d;
  --bg-glow: rgba(46, 134, 171, 0.12);
  --surface: #18222b;
  --surface-2: #1e2933;
  --surface-3: #26323d;
  --ink: #f1f4f6;
  --ink-2: #aab7c3;
  --ink-3: #8493a1;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #63b3d8;
  --accent-strong: #8ccbe8;
  --accent-soft: rgba(99, 179, 216, 0.16);
  --ok: #6cbf8a;
  --ok-soft: rgba(108, 191, 138, 0.16);
  --warn: #e0a052;
  --warn-soft: rgba(224, 160, 82, 0.16);
  --danger: #ec8290;
  --danger-soft: rgba(236, 130, 144, 0.16);
  --star: #f0c05a;
  --star-soft: rgba(240, 192, 90, 0.16);
  --focus: #7cc4e8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.32), 0 20px 44px -22px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 34px 90px -34px rgba(0, 0, 0, 0.75);
}

:root[data-theme='light'] {
  color-scheme: light;
}

/* ---------------------------------------------------------------- 2. Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% -10%, var(--bg-glow), transparent 62%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.sheet-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 10px;
}

::selection {
  background: var(--accent-soft);
}

/* No motion on request: kill decorative animation/transitions too. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------- 3. Utilities */
.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;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: calc(12px + var(--safe-top));
}

.icon {
  --icon-size: 20px;
  display: inline-flex;
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
}

.icon svg {
  width: 100%;
  height: 100%;
}

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

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.grow {
  flex: 1;
  min-width: 0;
}

.muted {
  color: var(--ink-2);
}

.tiny {
  font-size: 12px;
  color: var(--ink-3);
}

.nowrap {
  white-space: nowrap;
}

/* ------------------------------------------------------------- 4. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn .icon {
  --icon-size: 19px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -14px var(--accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--line-strong);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 8px;
  border-radius: 50%;
}

.btn-quiet:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-icon {
  padding: 10px;
  border-radius: 50%;
}

.btn-block {
  width: 100%;
}

.btn-small {
  min-height: var(--tap);
  padding: 8px 14px;
  font-size: 13px;
}

/* ------------------------------------------------------------- 5. Inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.field-hint {
  font-size: 12px;
  color: var(--ink-3);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px; /* keeps iOS from zooming on focus */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--ink-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-row .input {
  flex: 1;
}

/* ---------------------------------------------------------- 6. Avatars etc */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--member-color, var(--accent));
  color: var(--member-ink, #fff);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.avatar-xs {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 19px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 27px;
}

.avatar-glyph {
  transform: translateY(0.02em);
}

.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 14px;
  min-width: 0;
}

.member-badge.is-small {
  font-size: 12px;
  gap: 6px;
}

.member-badge-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 15px 8px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  font-weight: 650;
  font-size: 14px;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.member-chip:active {
  transform: scale(0.97);
}

.member-chip .member-chip-emoji {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--member-color);
  color: var(--member-ink);
  font-size: 15px;
}

.member-chip.is-selected {
  border-color: var(--member-color);
  background: color-mix(in srgb, var(--member-color) 14%, var(--surface));
  box-shadow: 0 0 0 1px var(--member-color) inset;
}

.member-chip-lg {
  min-height: 52px;
  font-size: 15px;
}

.emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-choice {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--radius-sm);
  font-size: 22px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.emoji-choice.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.04);
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-choice {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  background: var(--swatch);
  border: 3px solid transparent;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.color-choice.is-selected {
  border-color: var(--ink);
  transform: scale(1.05);
}

/* --------------------------------------------------------- 7. Segmented */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}

.segmented-item {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented-item.is-selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.segmented-emoji {
  font-size: 14px;
}

/* ------------------------------------------------------------ 8. Switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--tap);
}

.switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-label {
  font-weight: 650;
  font-size: 15px;
}

.switch-hint {
  font-size: 12.5px;
  color: var(--ink-3);
}

.switch {
  flex: none;
  width: 58px;
  height: 34px;
  min-width: 58px;
  min-height: 34px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

/* Enlarge the switch's hit area to 44px+ without making the control huge. */
.switch::before {
  content: '';
  position: absolute;
  inset: -6px -4px;
  border-radius: var(--radius-pill);
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.switch.is-on {
  background: var(--accent);
  border-color: var(--accent);
}

.switch.is-on .switch-thumb {
  transform: translateX(24px);
}

/* ------------------------------------------------------------- 9. Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 16px;
}

.card-stripe {
  position: relative;
  overflow: hidden;
  padding-left: 20px;
}

.card-stripe::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 5px;
  border-radius: 0 99px 99px 0;
  background: var(--stripe, var(--accent));
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--surface-3);
  color: var(--ink-2);
  white-space: nowrap;
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-star {
  background: var(--star-soft);
  color: var(--star);
}

.pill .icon {
  --icon-size: 13px;
}

/* ------------------------------------------------------- 10. App shell */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) var(--page-pad) 10px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.app-header.is-scrolled {
  border-bottom-color: var(--line);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #bfe3f2, #6fb6e9 55%, #2e86ab);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.brand-mark .icon {
  --icon-size: 20px;
}

.brand-mark svg {
  stroke-width: 2.6;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-top: -2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  animation: pill-in 0.25s ease;
}

.offline-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.offline-pill[hidden] {
  display: none;
}

@keyframes pill-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.app-main {
  flex: 1;
  width: 100%;
  padding: 4px var(--page-pad) calc(var(--nav-height) + var(--safe-bottom) + 28px);
  outline: none;
}

.screen {
  animation: screen-in 0.22s ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Bottom tab bar (becomes a side rail on wide screens). */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 8px max(12px, env(safe-area-inset-left)) calc(8px + var(--safe-bottom)) max(12px, env(safe-area-inset-right));
  pointer-events: none;
}

.tabbar-inner {
  pointer-events: auto;
  display: flex;
  gap: 2px;
  width: min(560px, 100%);
  padding: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tap);
  padding: 6px 2px;
  border-radius: 18px;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tab .icon {
  --icon-size: 22px;
}

.tab[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tab:hover {
  color: var(--ink);
}

/* ------------------------------------------------------ 11. Section heads */
.section {
  margin-top: clamp(20px, 3.2vw, 30px);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-3);
}

.section-action {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-strong);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 10px;
}

.screen-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 18px;
  padding: 0 2px;
  flex-wrap: wrap;
}

.screen-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.screen-sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-3);
  font-weight: 550;
}

.screen-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------- 12. Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 34px);
  color: var(--sky-ink);
  background: linear-gradient(158deg, var(--sky-top) 0%, var(--sky-mid) 54%, var(--sky-bottom) 100%);
  box-shadow: var(--shadow-md);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 70% at 88% -10%, rgba(255, 255, 255, 0.42), transparent 62%),
    radial-gradient(60% 50% at 0% 110%, rgba(255, 255, 255, 0.12), transparent 70%);
}

.hero-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 3vw, 26px);
}

.hero-copy {
  min-width: 0;
}

.hero-greeting {
  font-family: var(--font-display);
  font-size: clamp(26px, 5.2vw, 42px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}

.hero-date {
  margin-top: 8px;
  font-size: clamp(13px, 2.6vw, 15px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.82;
}

.hero-note {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
  max-width: 34ch;
}

.hero-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
}

.hero-ring-caption {
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.hero .ring {
  --ring-tone: var(--sky-ink);
}

.hero .ring-track {
  stroke: rgba(255, 255, 255, 0.32);
}

.hero .ring-fill {
  stroke: currentColor;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.hero .ring-center {
  color: currentColor;
}

.hero-ornament {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.hero-sun {
  position: absolute;
  top: -34px;
  right: -22px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(255, 250, 226, 0.95), rgba(255, 226, 150, 0.42) 46%, rgba(255, 226, 150, 0) 70%);
  animation: sun-drift 16s ease-in-out infinite alternate;
}

.hero-stars {
  position: absolute;
  inset: 0;
}

.hero-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  animation: twinkle 3.4s ease-in-out infinite;
}

.hero[data-ornament='sun'] .hero-stars,
.hero[data-ornament='moon'] .hero-stars,
.hero[data-ornament='none'] .hero-stars,
.hero[data-ornament='stars'] .hero-sun,
.hero[data-ornament='moon'] .hero-sun {
  display: none;
}

.hero[data-ornament='moon']::after {
  content: '';
  position: absolute;
  top: -26px;
  right: 26px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.92), rgba(255, 251, 235, 0.3) 55%, transparent 72%);
  z-index: -1;
}

@keyframes sun-drift {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(10px) scale(1.04);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

/* Talk bar */
.talkbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: clamp(16px, 3vw, 22px);
  padding: 5px 5px 5px 6px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 28px -18px rgba(15, 22, 30, 0.55);
  color: var(--ink);
}

.talkbar .icon {
  --icon-size: 20px;
  color: var(--ink-3);
}

.talkbar-orb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  flex: none;
}

.talkbar-input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 550;
}

.talkbar-input::placeholder {
  color: var(--ink-3);
}

.talkbar-input:focus {
  outline: none;
}

.talkbar-send {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 15px;
  background: var(--accent);
  color: #fff;
  flex: none;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.talkbar-send:hover {
  background: var(--accent-strong);
}

.talkbar-send:active {
  transform: scale(0.95);
}

.talkbar-send[disabled] {
  opacity: 0.5;
}

/* ------------------------------------------------------ 13. Progress ring */
.ring {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--ring-tone, var(--accent));
}

.ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ring-track {
  stroke: var(--line);
}

.ring-fill {
  stroke: var(--ring-tone, var(--accent));
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.ring-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  color: var(--ink);
}

.ring-pct {
  font-family: var(--font-display);
  font-size: calc(var(--ring-size, 104px) * 0.2);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ring-count {
  margin-top: 3px;
  font-size: calc(var(--ring-size, 104px) * 0.095);
  font-weight: 650;
  opacity: 0.7;
}

/* -------------------------------------------------------- 14. Check button */
.checkbtn {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  min-width: var(--tap);
  min-height: var(--tap);
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  color: var(--check-tone, var(--accent));
  flex: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.checkbtn:hover {
  border-color: var(--check-tone, var(--accent));
}

.checkbtn:active {
  transform: scale(0.92);
}

.checkbtn svg {
  width: 60%;
  height: 60%;
}

.checkbtn-check {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  opacity: 0;
}

.checkbtn.is-checked {
  background: var(--check-tone, var(--accent));
  border-color: var(--check-tone, var(--accent));
  color: #fff;
}

.checkbtn.is-checked .checkbtn-check {
  animation: draw-check 0.34s cubic-bezier(0.3, 0.9, 0.4, 1) forwards;
  opacity: 1;
}

@keyframes draw-check {
  from {
    stroke-dashoffset: 26;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.checkbtn-sm {
  --tap: 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

.checkbtn-lg {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
}

/* ------------------------------------------------------------ 15. Confetti */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 2px;
  animation: confetti-burst 0.82s cubic-bezier(0.16, 0.7, 0.4, 1) forwards;
}

@keyframes confetti-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.55) rotate(var(--rot));
  }
}

/* ---------------------------------------------------------------- 16. Toast */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  z-index: 100;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-success {
  background: var(--ok);
  color: #fff;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.toast .btn-quiet {
  color: currentColor;
  opacity: 0.85;
}

.toast .btn-quiet:hover {
  background: rgba(255, 255, 255, 0.14);
  color: currentColor;
}

.toast-undo {
  min-height: var(--tap);
  padding: 6px 14px;
  border-radius: 12px;
  color: currentColor;
  font-weight: 750;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.toast-undo:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------------------------------------------------------------- 17. Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(9, 14, 20, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
  overscroll-behavior: contain;
}

.sheet-backdrop.is-visible {
  opacity: 1;
}

.sheet {
  display: flex;
  flex-direction: column;
  width: min(580px, 100%);
  max-height: 92dvh;
  background: var(--surface);
  color: var(--ink);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(18px);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow: hidden;
}

.sheet-backdrop.is-visible .sheet {
  transform: none;
}

.sheet-wide {
  width: min(760px, 100%);
}

.sheet-tall {
  max-height: 94dvh;
}

@media (min-width: 720px) {
  .sheet-backdrop {
    align-items: center;
    padding: 28px;
  }

  .sheet {
    border-radius: 26px;
    max-height: 86dvh;
  }
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 6px;
}

.sheet-titles {
  flex: 1;
  min-width: 0;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.sheet-subtitle {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-3);
  font-weight: 550;
}

.sheet-body {
  padding: 12px 20px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-copy {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

.sheet-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 12px 20px calc(18px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.sheet-actions .btn {
  flex: 0 1 auto;
}

@media (max-width: 480px) {
  .sheet-actions .btn {
    flex: 1 1 auto;
  }
}

/* ------------------------------------------------------------- 18. Today */
.today-top {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.person-group {
  margin-top: 18px;
}

.person-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.person-name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.person-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}

.chore-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chore-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 9px 14px;
  width: 100%;
  text-align: left;
}

.chore-row + .chore-row {
  border-top: 1px solid var(--line);
}

.chore-emoji {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 22px;
  flex: none;
}

.chore-body {
  flex: 1;
  min-width: 0;
}

.chore-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chore-meta {
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chore-meta .star-ico {
  color: var(--star);
}

.chore-row.is-done .chore-name {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--line-strong);
}

.chore-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.chore-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  min-height: var(--tap);
  border-radius: 12px;
  color: var(--ink-3);
}

/* Events strip */
.strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar {
  display: none;
}

.event-chip {
  scroll-snap-align: start;
  flex: none;
  width: 216px;
  padding: 12px 14px 12px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  text-align: left;
  min-height: 76px;
  transition: transform 0.12s ease;
}

.event-chip:active {
  transform: scale(0.98);
}

.event-chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 99px 99px 0;
  background: var(--stripe, var(--accent));
}

.event-chip-time {
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.event-chip-title {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.event-chip-members {
  margin-top: 5px;
  display: flex;
  gap: 4px;
}

.event-chip-members .avatar {
  width: 20px;
  height: 20px;
  font-size: 10px;
  box-shadow: none;
}

/* List cards on Today */
.list-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.list-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.list-card:active {
  transform: scale(0.98);
}

.list-card:hover {
  border-color: var(--line-strong);
}

.list-card-emoji {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 21px;
  flex: none;
}

.list-card-name {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card-count {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}

.list-card-count.is-empty {
  color: var(--ok);
}

/* Today empty */
.today-empty {
  padding: 6px 2px 0;
}

/* ------------------------------------------------------------ 19. Chores */
.chores-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.week-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  min-width: 116px;
  text-align: center;
  white-space: nowrap;
}

.person-chore-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.person-chore-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px 10px 18px;
  position: relative;
  overflow: hidden;
}

.person-chore-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 5px;
  border-radius: 0 99px 99px 0;
  background: var(--stripe, var(--accent));
}

.chore-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.chore-title-row .chore-emoji {
  width: 32px;
  height: 32px;
  font-size: 17px;
  border-radius: 10px;
}

.chore-title-text {
  flex: 1;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chore-title-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.week-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}

.week-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tap);
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.week-cell-day {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
  font-weight: 750;
}

.week-cell-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
}

.week-cell-dot svg {
  width: 13px;
  height: 13px;
  opacity: 0;
}

.week-cell.is-absent {
  opacity: 0.28;
  pointer-events: none;
}

.week-cell.is-future .week-cell-dot {
  border-style: dashed;
  background: transparent;
}

.week-cell.is-missed .week-cell-dot {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.week-cell.is-missed .week-cell-dot::after {
  content: '';
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--danger);
}

.week-cell.is-done .week-cell-dot {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.week-cell.is-done .week-cell-dot svg {
  opacity: 1;
}

.week-cell.is-today {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.week-cell:not(.is-absent):hover {
  border-color: var(--line-strong);
}

/* By-day */
.day-group {
  margin-bottom: 18px;
}

.day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.day-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.day-date {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}

.day-empty {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

/* Leaderboard */
.leaderboard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  min-height: 58px;
}

.leader-row + .leader-row {
  border-top: 1px solid var(--line);
}

.leader-rank {
  width: 22px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-3);
  text-align: center;
  flex: none;
}

.leader-row.is-first .leader-rank {
  color: var(--star);
}

.leader-name {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
}

.leader-week {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 750;
  font-size: 14px;
  color: var(--star);
}

.leader-total {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  min-width: 58px;
  text-align: right;
}

/* ------------------------------------------------------------- 20. Lists */
.list-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}

.list-tabs::-webkit-scrollbar {
  display: none;
}

.list-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--tap);
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  flex: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.list-tab.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.list-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.quick-add {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.quick-add .input {
  border-radius: 14px;
  background: var(--surface);
}

.quick-add .btn {
  border-radius: 14px;
  min-width: var(--tap);
  padding: 0 16px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 6px;
  min-height: 56px;
}

.item-row + .item-row {
  border-top: 1px solid var(--line);
}

.item-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 6px 4px;
  text-align: left;
  border-radius: 12px;
  min-width: 0;
}

.item-toggle:active {
  background: var(--surface-2);
}

.item-toggle .checkbtn {
  pointer-events: none;
}

.item-text {
  flex: 1;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.item-row.is-done .item-text {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--line-strong);
}

.item-menu {
  flex: none;
  color: var(--ink-3);
}

.badge-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
}

.badge-due.is-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-due.is-today {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge-urgent {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 750;
}

.items-done-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  text-align: left;
}

.items-done-toggle .icon {
  --icon-size: 16px;
  transition: transform 0.15s ease;
}

.items-done-toggle[aria-expanded='true'] .icon {
  transform: rotate(90deg);
}

.list-empty {
  padding: 26px 18px;
}

/* ---------------------------------------------------------- 21. Calendar */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.cal-range {
  flex: 1;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  min-width: 140px;
  text-align: center;
}

.cal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cal-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(112px, 1fr));
  min-width: 832px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 3;
}

.cal-weekday {
  padding: 8px 4px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cal-weekday.is-today {
  color: var(--accent-strong);
}

.cal-weekday-date {
  display: block;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.cal-weekday.is-today .cal-weekday-date {
  color: var(--accent-strong);
}

.cal-allday {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(112px, 1fr));
  min-width: 832px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
}

.cal-allday-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cal-allday-cell {
  padding: 4px;
  min-height: 34px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-body {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(112px, 1fr));
  min-width: 832px;
  position: relative;
}

.cal-hours {
  position: relative;
  border-right: 1px solid var(--line);
}

.cal-hour-label {
  position: absolute;
  left: 0;
  right: 8px;
  text-align: right;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--ink-3);
  transform: translateY(-50%);
  line-height: 1;
}

.cal-daycol {
  position: relative;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 51px,
    var(--line) 51px,
    var(--line) 52px
  );
}

.cal-daycol.is-today {
  background-color: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.cal-event {
  position: absolute;
  left: 3px;
  right: 3px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 6px 4px 8px;
  border-radius: 8px;
  border: 0;
  border-left: 4px solid var(--member-color, var(--accent));
  background: color-mix(in srgb, var(--member-color, var(--accent)) 20%, var(--surface));
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  overflow: hidden;
  min-height: 22px;
  transition: transform 0.12s ease;
}

.cal-event:hover {
  transform: scale(1.02);
}

.cal-event-title {
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-time {
  font-size: 10px;
  color: var(--ink-2);
  font-weight: 650;
}

.cal-event.is-allday {
  position: static;
  min-height: 26px;
  padding: 3px 7px;
  font-size: 11px;
  width: 100%;
}

.cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger);
  z-index: 2;
  pointer-events: none;
}

.cal-now-line::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.cal-empty {
  padding: 30px 18px;
}

.cal-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.cal-tip .icon {
  --icon-size: 18px;
  margin-top: 1px;
}

/* ---------------------------------------------------------- 22. Settings */
.settings-section {
  margin-top: clamp(20px, 3vw, 28px);
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  min-height: 60px;
}

.setting-row + .setting-row {
  border-top: 1px solid var(--line);
}

.setting-main {
  flex: 1;
  min-width: 0;
}

.setting-label {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.setting-hint {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.35;
}

.setting-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.setting-value {
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 600;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 64px;
}

.member-row + .member-row {
  border-top: 1px solid var(--line);
}

.member-row-info {
  flex: 1;
  min-width: 0;
}

.member-row-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row-role {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: capitalize;
}

.member-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}

.status-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
}

.status-dot.is-on::before {
  background: var(--ok);
}

.status-dot.is-off::before {
  background: var(--warn);
}

.invite-code {
  font-family: 'Bricolage Grotesque', ui-monospace, monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  color: var(--ink);
  user-select: all;
}

.invite-url {
  font-size: 12.5px;
  color: var(--ink-2);
  word-break: break-all;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.token-box {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.04em;
  word-break: break-all;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  user-select: all;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: step;
}

.step {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.step-num {
  counter-increment: step;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

.step-num::before {
  content: counter(step);
}

.log-list {
  display: flex;
  flex-direction: column;
}

.log-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 16px;
}

.log-item + .log-item {
  border-top: 1px solid var(--line);
}

.log-text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-2);
  min-width: 0;
}

.log-time {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 62px;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
}

.theme-choice .theme-emoji {
  font-size: 18px;
}

.theme-choice.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* ------------------------------------------------- 23. Gate / setup / join */
.gate {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 5vw, 40px) var(--page-pad) calc(28px + var(--safe-bottom));
}

.gate-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.gate-hero {
  position: relative;
  overflow: hidden;
  padding: 26px 24px 22px;
  color: var(--sky-ink);
  background: linear-gradient(158deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom));
}

.gate-hero .brand-mark {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.gate-title {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(27px, 6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.gate-sub {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0.88;
  max-width: 40ch;
}

.gate-body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.gate-error {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

.gate-error[hidden] {
  display: none;
}

.gate-notice {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setup-member {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.setup-member-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup-member-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-role {
  display: flex;
  gap: 8px;
}

.setup-role .segmented {
  width: 100%;
}

.gate-footnote {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

.join-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vw, 40px) var(--page-pad) calc(26px + var(--safe-bottom));
}

.join-card {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.join-hero {
  padding: 26px 24px 22px;
  color: var(--sky-ink);
  background: linear-gradient(158deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom));
}

.join-body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.join-code-input {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  min-height: 58px;
}

.join-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.join-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.join-step-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  flex: none;
}

.join-step-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.join-step-copy {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}

.join-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 6px 0;
}

.join-success-emoji {
  font-size: 44px;
  line-height: 1;
}

/* ---------------------------------------------------------- 24. Empty/loading */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 34px 20px;
}

.empty-emoji {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 2px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.empty-copy {
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line:nth-child(2) {
  width: 82%;
}

.skeleton-line:nth-child(3) {
  width: 64%;
}

@keyframes shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}

.app-loading {
  min-height: 60dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 14px;
}

.loading-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(150deg, #bfe3f2, #6fb6e9 55%, #2e86ab);
  display: grid;
  place-items: center;
  color: #fff;
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.error-card {
  margin: 48px auto;
  max-width: 460px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.error-card h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.error-card p {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ------------------------------------------------------- 25. Wide screens */
@media (min-width: 1024px) {
  :root {
    --nav-height: 0px;
  }

  .app-shell {
    padding-left: 118px;
  }

  .app-header {
    padding-left: var(--page-pad);
  }

  .tabbar {
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
    padding: 0 0 0 20px;
  }

  .tabbar-inner {
    flex-direction: column;
    width: 86px;
    padding: 6px;
    border-radius: 28px;
  }

  .tab {
    min-height: 62px;
    font-size: 10px;
  }

  .app-main {
    padding-bottom: 40px;
  }

  .toast-root {
    bottom: 30px;
  }

  .hero-greeting {
    max-width: 18ch;
  }
}

@media (min-width: 760px) {
  .today-lists-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

/* --------------------------------------------------------------- 26. TV */
.tv-body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background: #0d131a;
  color: var(--sky-ink);
  font-family: var(--font-body);
}

.tv-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 44px) clamp(24px, 3vw, 64px);
  color: var(--sky-ink);
  background: linear-gradient(158deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-bottom) 100%);
  overflow: hidden;
}

.tv-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 92% -8%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(50% 45% at 0% 110%, rgba(255, 255, 255, 0.1), transparent 70%);
  pointer-events: none;
}

.tv-top {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(16px, 2.2vw, 34px);
}

.tv-clock {
  font-family: var(--font-display);
  font-size: clamp(58px, 6.4vw, 118px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.tv-date {
  margin-top: 8px;
  font-size: clamp(16px, 1.4vw, 24px);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}

.tv-family {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.7vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tv-family .brand-mark {
  width: clamp(44px, 3.2vw, 62px);
  height: clamp(44px, 3.2vw, 62px);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.tv-grid {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.9fr;
  gap: clamp(14px, 1.6vw, 30px);
}

.tv-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(16px, 1.5vw, 30px);
  border-radius: clamp(20px, 1.6vw, 30px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--ink);
  box-shadow: 0 30px 80px -40px rgba(6, 12, 20, 0.6);
  backdrop-filter: blur(10px);
}

.tv-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(10px, 1vw, 18px);
}

.tv-card-title {
  font-family: var(--font-display);
  font-size: clamp(19px, 1.6vw, 29px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tv-card-count {
  font-size: clamp(13px, 1vw, 18px);
  font-weight: 700;
  color: var(--ink-3);
}

.tv-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.tv-person + .tv-person {
  margin-top: clamp(8px, 0.8vw, 16px);
}

.tv-person-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.tv-person-name {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.2vw, 22px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tv-chore {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: clamp(40px, 3.4vw, 62px);
  padding: 2px 0;
  border-bottom: 1px solid var(--line);
}

.tv-chore:last-child {
  border-bottom: 0;
}

.tv-chore-emoji {
  font-size: clamp(20px, 1.7vw, 30px);
  width: clamp(30px, 2.6vw, 46px);
  text-align: center;
  flex: none;
}

.tv-chore-name {
  flex: 1;
  font-size: clamp(17px, 1.35vw, 26px);
  font-weight: 650;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-chore.is-done .tv-chore-name {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--line-strong);
}

.tv-check {
  display: grid;
  place-items: center;
  width: clamp(28px, 2.2vw, 40px);
  height: clamp(28px, 2.2vw, 40px);
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  color: transparent;
  flex: none;
}

.tv-check .icon {
  --icon-size: clamp(16px, 1.3vw, 22px);
}

.tv-chore.is-done .tv-check {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.tv-event {
  display: flex;
  gap: 12px;
  padding: clamp(5px, 0.55vw, 9px) 0;
  border-bottom: 1px solid var(--line);
}

.tv-event:last-child {
  border-bottom: 0;
}

.tv-event-time {
  flex: none;
  width: clamp(66px, 5.4vw, 104px);
  font-size: clamp(12px, 1vw, 18px);
  font-weight: 750;
  color: var(--ink-2);
  padding-top: 2px;
}

.tv-event-title {
  flex: 1;
  font-size: clamp(16px, 1.25vw, 24px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.tv-event-members {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}

.tv-grocery {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(6px, 0.6vw, 11px) 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(15px, 1.2vw, 24px);
  font-weight: 600;
}

.tv-grocery:last-child {
  border-bottom: 0;
}

.tv-grocery-dot {
  width: clamp(8px, 0.7vw, 12px);
  height: clamp(8px, 0.7vw, 12px);
  border-radius: 50%;
  flex: none;
  background: var(--accent);
}

.tv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  color: var(--ink-3);
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 600;
  text-align: center;
}

.tv-empty-emoji {
  font-size: clamp(30px, 2.6vw, 48px);
}

.tv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(10px, 1.4vw, 20px);
  font-size: clamp(12px, 0.95vw, 17px);
  font-weight: 650;
  opacity: 0.72;
}

.tv-sky-note {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tv-offline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  font-weight: 750;
}

.tv-offline[hidden] {
  display: none;
}

.tv-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(158deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom));
  color: var(--sky-ink);
}

.tv-gate-card {
  max-width: 720px;
  text-align: center;
}

.tv-gate-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 54px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.tv-gate-copy {
  margin-top: 14px;
  font-size: clamp(16px, 1.3vw, 24px);
  font-weight: 600;
  line-height: 1.5;
  opacity: 0.9;
}

@media (max-width: 900px) {
  .tv-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .tv-body {
    overflow: auto;
  }

  .tv-screen {
    position: static;
    min-height: 100dvh;
    overflow: visible;
  }

  .tv-card {
    max-height: none;
  }
}

/* TV typography bump for the real 1920x1080 board */
@media (min-width: 1600px) {
  .tv-clock {
    font-size: clamp(96px, 6.3vw, 150px);
  }

  .tv-chore-name {
    font-size: clamp(24px, 1.35vw, 34px);
  }

  .tv-person-name {
    font-size: clamp(21px, 1.2vw, 28px);
  }
}

/* ==========================================================================
   Change 1 — sign-off, push notifications, history
   ========================================================================== */

/* ---- parent nav badge + Today hero badge ---- */
.tab {
  position: relative;
}

.tab-badge {
  position: absolute;
  top: 1px;
  right: 50%;
  transform: translateX(15px);
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--warn);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--surface);
  animation: badge-pop 0.2s ease;
}

.tab-badge[hidden] {
  display: none !important;
}

@keyframes badge-pop {
  from {
    transform: translateX(15px) scale(0.6);
    opacity: 0;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  min-height: 40px;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  color: #6d4700;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 20px -14px rgba(15, 22, 30, 0.6);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.hero-badge:hover {
  background: #fff;
}

.hero-badge[hidden] {
  display: none !important;
}

.hero-badge .icon {
  --icon-size: 16px;
  color: #a76500;
}

/* ---- pending / rejected chore + item states ---- */
.chore-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.chore-status .icon {
  --icon-size: 14px;
}

.chore-status.is-waiting {
  color: var(--warn);
}

.chore-status.is-rejected {
  color: var(--danger);
}

.chore-status.is-approved {
  color: var(--ok);
}

.chore-row.is-pending {
  background: color-mix(in srgb, var(--warn-soft) 55%, transparent);
}

.chore-row.is-rejected {
  background: color-mix(in srgb, var(--danger-soft) 32%, transparent);
}

.chore-row.is-pending .chore-name,
.chore-row.is-rejected .chore-name {
  text-decoration: none;
}

.checkbtn-static {
  pointer-events: none;
}

.checkbtn.is-waiting {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--warn-soft);
}

.checkbtn.is-rejected {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.week-cell.is-pending .week-cell-dot {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
}

.week-cell.is-pending .week-cell-dot svg {
  opacity: 1;
}

.week-cell.is-rejected .week-cell-dot {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.week-cell.is-rejected .week-cell-dot svg {
  opacity: 1;
}

.item-row.is-pending {
  background: color-mix(in srgb, var(--warn-soft) 45%, transparent);
}

.item-row.is-rejected {
  background: color-mix(in srgb, var(--danger-soft) 26%, transparent);
}

.badge-due.is-waiting {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-due.is-signoff {
  background: var(--ok-soft);
  color: var(--ok);
}

.item-note {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  overflow-wrap: anywhere;
}

/* ---- sign-off queue (standalone page + #/approve route) ---- */
.approve-body {
  background: var(--bg);
}

.approve-shell {
  max-width: 880px;
}

.approve-header {
  border-bottom: 1px solid var(--line);
}

.approve-main {
  padding-top: 14px;
  padding-bottom: 48px;
}

.approve-count {
  margin-right: 2px;
}

.signoff-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signoff-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 16px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.signoff-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 5px;
  border-radius: 0 99px 99px 0;
  background: var(--stripe, var(--warn));
}

.signoff-card.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.signoff-card.is-highlighted {
  outline: 3px solid var(--warn);
  outline-offset: 2px;
  animation: signoff-glow 1.8s ease;
}

@keyframes signoff-glow {
  0% {
    box-shadow: 0 0 0 0 var(--warn-soft);
  }
  45% {
    box-shadow: 0 0 0 12px var(--warn-soft);
  }
  100% {
    box-shadow: var(--shadow-sm);
  }
}

.signoff-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.signoff-kid {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.signoff-meta {
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.signoff-waiting {
  flex: none;
}

.signoff-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.signoff-emoji {
  font-size: 24px;
  line-height: 1;
}

.signoff-title-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.signoff-list {
  margin: 0;
}

.signoff-title .signoff-list {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

.signoff-actions {
  display: flex;
  gap: 10px;
}

.signoff-actions .btn {
  flex: 1;
  min-height: 52px;
  font-size: 16px;
}

@media (min-width: 560px) {
  .signoff-actions .btn {
    flex: 0 0 auto;
    min-width: 150px;
  }
}

.signoff-note {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 2px;
  border-top: 1px dashed var(--line);
  margin-top: 2px;
  padding-top: 12px;
}

.signoff-note-input {
  min-height: 64px;
}

.quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-pick {
  min-height: var(--tap);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.quick-pick:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.signoff-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.signoff-empty .empty-state {
  padding: 26px 12px;
}

.approve-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) var(--page-pad) calc(28px + var(--safe-bottom));
}

.approve-gate-card {
  width: min(500px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.approve-gate-emoji {
  font-size: 40px;
  line-height: 1;
}

.approve-gate-card .gate-title {
  margin-top: 0;
}

.approve-gate-card .btn {
  margin-top: 6px;
}

/* ---- history ---- */
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.history-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.history-summary {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
}

.history-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.history-day {
  padding: 8px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.history-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  min-height: 56px;
}

.history-row + .history-row {
  border-top: 1px solid var(--line);
}

.history-emoji {
  width: 34px;
  font-size: 20px;
  text-align: center;
  flex: none;
}

.history-title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-detail {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.history-row.is-missed {
  opacity: 0.78;
}

.pill.history-missed {
  background: var(--surface-3);
  color: var(--ink-3);
}

/* ---- notifications / inbox in Settings ---- */
.inbox-heading {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  min-height: 44px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.inbox-list {
  display: flex;
  flex-direction: column;
}

.inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  text-align: left;
  border-top: 1px solid var(--line);
}

.inbox-item:hover {
  background: var(--surface-2);
}

.inbox-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  flex: none;
}

.inbox-item.is-unread .inbox-dot {
  opacity: 1;
}

.inbox-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.inbox-body {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
}

.inbox-time {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  flex: none;
}

.ios-steps .join-step-title {
  font-size: 14px;
}

.ios-steps .join-step-copy {
  font-size: 12.5px;
}

/* ---- TV waiting-for-sign-off ---- */
.tv-chore.is-pending .tv-chore-name {
  color: var(--warn);
}

.tv-pending-count {
  color: var(--warn);
  font-weight: 800;
}

.tv-waiting,
.tv-waiting-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: clamp(11px, 0.9vw, 16px);
  font-weight: 750;
  white-space: nowrap;
  flex: none;
}

.tv-waiting .icon {
  --icon-size: clamp(12px, 1vw, 18px);
}

.tv-waiting.small {
  font-size: 11px;
  padding: 2px 8px;
}

.tv-waiting-pill {
  margin-left: 4px;
  font-size: clamp(10px, 0.85vw, 14px);
}

.tv-grocery.is-pending .tv-grocery-dot {
  background: var(--warn);
}

/* Narrow phones: keep the queue buttons full width and the badge clear. */
@media (max-width: 420px) {
  .signoff-actions {
    flex-direction: column-reverse;
  }

  .signoff-actions .btn {
    width: 100%;
  }

  .approve-main {
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
  }
}

/* ==========================================================================
   Change 3 — assistant: dictation, voice settings, brief page, TV brief
   ========================================================================== */

/* ---- talk bar mic (Apple on-device dictation) ---- */
.talkbar-mic {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 15px;
  background: var(--surface-3);
  color: var(--ink-2);
  flex: none;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.talkbar-mic .icon {
  --icon-size: 21px;
}

.talkbar-mic:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.talkbar-mic:active {
  transform: scale(0.94);
}

.talkbar-mic.is-listening {
  background: var(--danger);
  color: #fff;
  animation: mic-pulse 1.3s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--danger-soft);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(178, 58, 72, 0);
  }
}

.talkbar-hint {
  margin-top: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sky-ink);
  opacity: 0.82;
}

.input-range {
  flex: 1;
  min-height: var(--tap);
  accent-color: var(--accent);
}

/* ---- /brief page ---- */
.brief-body {
  background: var(--bg);
}

.brief-shell {
  max-width: 920px;
}

.brief-main {
  padding-top: 18px;
  padding-bottom: 44px;
}

.brief-slot {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brief-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(18px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.brief-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brief-head-copy {
  min-width: 0;
}

.brief-kind {
  margin-bottom: 4px;
}

.brief-title {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.brief-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-3);
}

.brief-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.brief-actions .btn {
  min-height: 52px;
  font-size: 16px;
  padding: 10px 22px;
}

.brief-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brief-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.brief-note {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.brief-back {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.brief-back .btn {
  min-width: 220px;
}

.brief-empty {
  max-width: 560px;
  margin: 10px auto 0;
}

.brief-loading {
  padding: 44px 0;
  text-align: center;
  color: var(--ink-3);
  font-weight: 650;
}

.brief-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) var(--page-pad) calc(28px + var(--safe-bottom));
}

.brief-gate-card {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 30px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.brief-gate-emoji {
  font-size: 40px;
  line-height: 1;
}

.brief-gate-card .btn {
  width: 100%;
  margin-top: 4px;
}

/* ---- TV morning brief band ---- */
.tv-brief {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: clamp(12px, 1.4vw, 24px);
  padding: clamp(14px, 1.5vw, 26px) clamp(18px, 1.8vw, 32px);
  border-radius: clamp(18px, 1.4vw, 26px);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--ink);
  box-shadow: 0 26px 60px -40px rgba(6, 12, 20, 0.55);
  backdrop-filter: blur(10px);
}

.tv-brief-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-brief-label {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.tv-brief-who {
  font-size: clamp(13px, 1vw, 18px);
  font-weight: 700;
  color: var(--ink-2);
}

.tv-brief-voice {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: clamp(11px, 0.85vw, 14px);
  font-weight: 750;
}

.tv-brief-voice.is-muted {
  background: var(--surface-3);
  color: var(--ink-3);
}

.tv-brief-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.6vw, 30px);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

@media (min-width: 1600px) {
  .tv-brief-text {
    font-size: clamp(24px, 1.5vw, 34px);
  }
}

@media (max-width: 420px) {
  .brief-actions .btn {
    width: 100%;
  }

  .brief-card {
    padding: 18px 16px;
  }
}

/* ==========================================================================
   M7.5 — Liquid Glass redesign (Change 5)
   Content first, glass on top. Solid cards; glass only for chrome (nav, dock,
   toasts, sheets, hero controls, TV panels). Never glass-on-glass.
   ========================================================================== */

:root {
  /* Material */
  --glass-blur: 24px;
  --glass-saturate: 180%;
  --glass-alpha: 78%;
  --glass-clear-alpha: 72%;
  --glass-panel: color-mix(in oklab, var(--surface) var(--glass-alpha), transparent);
  --glass-clear-panel: color-mix(in oklab, var(--surface) var(--glass-clear-alpha), transparent);
  --glass-tint: rgba(255, 255, 255, 0.16);
  --glass-edge: rgba(255, 255, 255, 0.55);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 22px 60px -28px rgba(15, 23, 42, 0.5), 0 2px 10px rgba(15, 23, 42, 0.1);
  --glass-clear-shadow: 0 14px 34px -22px rgba(15, 23, 42, 0.4), 0 1px 4px rgba(15, 23, 42, 0.08);
  --spec-x: 30%;
  --spec-y: 8%;

  /* Concentric geometry + typography */
  --radius-card: 22px;
  --radius-outer: 28px;
  --radius-inner: calc(var(--radius-outer) - 8px);
  --display-tracking: -0.02em;
  --body-tracking: 0;
  --caption-tracking: 0.01em;
  --dock-height: 58px;
  --tabbar-height: 62px;

  /* Mesh sky motion (static under reduced motion) */
  --mesh-duration: 44s;
  --blob-1: #d1495b;
  --blob-2: #2e86ab;
  --blob-3: #f4a259;
  --blob-4: #6a994e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --glass-tint: rgba(255, 255, 255, 0.08);
    --glass-edge: rgba(255, 255, 255, 0.26);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    --glass-shadow: 0 26px 70px -30px rgba(0, 0, 0, 0.8), 0 2px 10px rgba(0, 0, 0, 0.35);
    --glass-clear-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.65), 0 1px 4px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme='dark'] {
  --glass-tint: rgba(255, 255, 255, 0.08);
  --glass-edge: rgba(255, 255, 255, 0.26);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 26px 70px -30px rgba(0, 0, 0, 0.8), 0 2px 10px rgba(0, 0, 0, 0.35);
  --glass-clear-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.65), 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ---------------------------------------------------------- living mesh sky */
body {
  background-color: var(--bg);
  background-image: none;
}

body::before {
  content: '';
  position: fixed;
  inset: -18vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 18% 18%, color-mix(in oklab, var(--sky-top) 82%, transparent), transparent 72%),
    radial-gradient(38% 34% at 82% 12%, color-mix(in oklab, var(--sky-mid) 78%, transparent), transparent 70%),
    radial-gradient(52% 44% at 76% 86%, color-mix(in oklab, var(--sky-bottom) 74%, transparent), transparent 74%),
    radial-gradient(34% 30% at 24% 84%, color-mix(in oklab, var(--blob-1) 30%, transparent), transparent 70%),
    radial-gradient(30% 28% at 58% 52%, color-mix(in oklab, var(--blob-2) 22%, transparent), transparent 72%);
  filter: blur(18px) saturate(125%);
  animation: mesh-drift var(--mesh-duration) ease-in-out infinite alternate;
  will-change: transform;
}

/* A second, slower veil gives the gradient depth without a visible loop. */
body::after {
  content: '';
  position: fixed;
  inset: -12vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46% 40% at 70% 30%, color-mix(in oklab, var(--blob-3) 16%, transparent), transparent 70%),
    radial-gradient(40% 36% at 30% 70%, color-mix(in oklab, var(--blob-4) 14%, transparent), transparent 72%);
  filter: blur(30px) saturate(115%);
  opacity: 0.65;
  animation: mesh-drift-2 calc(var(--mesh-duration) * 1.6) ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes mesh-drift {
  from {
    transform: translate3d(-2%, -1.2%, 0) scale(1.02) rotate(-1.5deg);
  }
  to {
    transform: translate3d(2%, 1.2%, 0) scale(1.06) rotate(1.5deg);
  }
}

@keyframes mesh-drift-2 {
  from {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
  to {
    transform: translate3d(-1.5%, -1%, 0) scale(1.08);
  }
}

/* --------------------------------------------------------------- glass base */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-panel);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
}

/* Specular edge refraction: a 1px gradient ring, masked to the border. */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.75),
    rgba(255, 255, 255, 0.06) 32%,
    rgba(255, 255, 255, 0.02) 62%,
    rgba(255, 255, 255, 0.45)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.9;
}

/* Pointer-following specular sheen (very subtle; tilt feeds the same vars). */
.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: radial-gradient(
    180px 120px at var(--spec-x) var(--spec-y),
    rgba(255, 255, 255, 0.22),
    transparent 70%
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
  opacity: 0.85;
}

.glass[data-glass='clear'] {
  background: var(--glass-clear-panel);
  box-shadow: var(--glass-highlight), var(--glass-clear-shadow);
}

.glass[data-glass='tinted'] {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border-color: color-mix(in oklab, var(--glass-tint-color, var(--accent)) 34%, transparent);
}

/* ------------------------------------------------------------ accessibility */
/* 1. No backdrop-filter at all. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: color-mix(in oklab, var(--surface) 94%, transparent);
    box-shadow: var(--glass-highlight), 0 18px 48px -26px rgba(15, 23, 42, 0.4);
  }
}

/* 2. Reduced transparency: frosted, near-solid surfaces, no blur. */
@media (prefers-reduced-transparency: reduce) {
  .glass {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: color-mix(in oklab, var(--surface) 96%, transparent);
    box-shadow: var(--glass-highlight), 0 16px 42px -26px rgba(15, 23, 42, 0.35);
  }

  body::before,
  body::after {
    opacity: 0.9;
    filter: none;
  }
}

/* 3. More contrast: solid surfaces with a defined border, no translucency. */
@media (prefers-contrast: more) {
  .glass {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--surface);
    border-color: var(--ink-2);
    box-shadow: none;
  }

  .glass::before,
  .glass::after {
    display: none;
  }

  .tab,
  .btn,
  .chore-name,
  .item-text {
    color: var(--ink);
  }
}

/* 4. Reduced motion: static sky, cross-fades only. */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none !important;
    transform: none !important;
  }

  .tab-lens,
  .tabbar-inner,
  .assistant-dock,
  .toast,
  .sheet,
  .sheet-backdrop,
  #app {
    transition: opacity 0.18s ease !important;
    animation: none !important;
  }

  .tv-screen,
  .tv-drift {
    animation: none !important;
  }
}

/* --------------------------------------------------------- vibrancy + type */
.glass,
.tabbar,
.assistant-dock,
.toast,
.hero-pill {
  color: var(--ink);
  font-weight: 620;
}

.glass .btn-label,
.glass input,
.glass .tab-label {
  letter-spacing: var(--caption-tracking);
}

h1,
h2,
.hero-greeting,
.screen-title,
.section-title,
.brief-title {
  letter-spacing: var(--display-tracking);
}

/* ------------------------------------------------------------ floating dock */
.assistant-dock {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-height) + 18px + var(--safe-bottom));
  z-index: 39;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(560px, calc(100vw - 24px));
  padding: 6px 6px 6px 8px;
  border-radius: 999px;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.assistant-dock .dock-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 55%),
    conic-gradient(from 210deg, var(--blob-1), var(--blob-2), var(--blob-3), var(--blob-1));
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 6px 18px -8px var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
}

.assistant-dock .dock-orb.is-listening::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--accent) 65%, transparent);
  animation: dock-glow 1.5s ease-out infinite;
}

@keyframes dock-glow {
  0% {
    transform: scale(0.94);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.assistant-dock .dock-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.assistant-dock .dock-name {
  padding-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--caption-tracking);
  text-transform: uppercase;
  color: var(--ink-3);
}

.assistant-dock .dock-input {
  width: 100%;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.assistant-dock .dock-input::placeholder {
  color: var(--ink-3);
}

.assistant-dock .dock-input:focus {
  outline: none;
}

.assistant-dock .dock-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  min-width: var(--tap);
  min-height: var(--tap);
  border-radius: 50%;
  color: var(--ink-2);
  flex: none;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.18s ease, color 0.18s ease;
}

.assistant-dock .dock-btn .icon {
  --icon-size: 20px;
}

.assistant-dock .dock-btn:hover {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  color: var(--ink);
}

.assistant-dock .dock-btn:active {
  transform: scale(0.94);
}

.assistant-dock .dock-send {
  background: var(--accent);
  color: #fff;
}

.assistant-dock .dock-send:hover {
  background: var(--accent-strong);
  color: #fff;
}

.assistant-dock .dock-mic.is-listening {
  background: var(--danger);
  color: #fff;
}

.talkbar-hint {
  display: none;
}

/* ------------------------------------------------------------- tab bar lens */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
}

.tabbar-inner {
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 2px;
  width: min(520px, 100%);
  padding: 6px;
  border-radius: 999px;
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), padding 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-lens {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  z-index: 0;
  width: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 24%, var(--surface) 76%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 6px 16px -8px rgba(15, 23, 42, 0.35);
  transform: translate3d(0, 0, 0);
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), width 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, width;
}

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 46px;
  min-width: 44px;
  padding: 5px 2px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--caption-tracking);
  transition: color 0.2s ease, transform 0.16s ease;
}

.tab .icon {
  --icon-size: 21px;
}

.tab:active {
  transform: scale(0.94);
}

.tab[aria-current='page'] {
  color: var(--accent-strong);
}

.tabbar-inner .tab-badge {
  border-color: var(--glass-edge);
}

.tabbar.is-compact .tabbar-inner {
  width: min(300px, 86%);
  padding: 5px;
}

.tabbar.is-compact .tab {
  min-height: 44px;
}

.tabbar.is-compact .tab-label {
  display: none;
}

.tabbar.is-compact .tab .icon {
  --icon-size: 22px;
}

/* --------------------------------------------------------------- hero pill */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--sky-ink);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: var(--caption-tracking);
}

.hero-pill .icon {
  --icon-size: 15px;
}

.hero {
  background: none !important;
  box-shadow: none !important;
  padding: clamp(14px, 3vw, 26px) 2px clamp(10px, 2vw, 16px);
  border-radius: 0;
  overflow: visible;
}

.hero::before {
  display: none;
}

.hero-greeting {
  font-size: clamp(30px, 6.4vw, 52px);
  line-height: 0.98;
  letter-spacing: var(--display-tracking);
  text-shadow: 0 2px 24px rgba(10, 20, 30, 0.18);
}

.hero-date {
  margin-top: 6px;
  opacity: 0.85;
  letter-spacing: var(--caption-tracking);
}

.hero-note {
  margin-top: 8px;
  font-size: 14.5px;
}

.hero-badge {
  min-height: 40px;
  border-radius: 999px;
}

/* Glass ring for the hero progress. */
.hero .ring {
  border-radius: 50%;
  background: var(--glass-clear-panel);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 16px 36px -22px rgba(10, 20, 30, 0.55);
}

.hero .ring-track {
  stroke: rgba(255, 255, 255, 0.28);
}

.hero .ring-fill {
  stroke: var(--ring-tone, var(--accent));
}

.hero .ring-center {
  color: var(--sky-ink);
}

/* -------------------------------------------------------------- solid cards */
.card,
.chore-list,
.person-chore-card,
.list-panel,
.settings-card,
.history-list,
.cal-card,
.leaderboard,
.signoff-card,
.brief-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--line) 60%, transparent),
    0 0 30px -16px color-mix(in oklab, var(--member-color, var(--accent)) 55%, transparent),
    0 18px 40px -34px rgba(15, 23, 42, 0.45);
}

/* Member-color edge glow replaces the old stripe. */
.card-stripe::before,
.person-chore-card::before,
.event-chip::before,
.signoff-card::before {
  display: none !important;
}

.card-stripe,
.person-chore-card,
.signoff-card {
  padding-left: 16px;
}

.chore-row.is-pending,
.item-row.is-pending {
  background: color-mix(in srgb, var(--warn-soft) 62%, var(--surface));
}

/* Springy check-off. */
.checkbtn.is-checked {
  animation: check-pop 0.42s cubic-bezier(0.22, 1.4, 0.4, 1);
}

@keyframes check-pop {
  0% {
    transform: scale(0.86);
  }
  55% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* TV + page transitions stay transform/opacity only. */

/* --------------------------------------------------------------- sheets */
.sheet-backdrop {
  background: rgba(8, 13, 20, 0.34);
  -webkit-backdrop-filter: blur(4px) saturate(120%);
  backdrop-filter: blur(4px) saturate(120%);
}

.sheet {
  border: 1px solid var(--glass-edge);
  background: var(--glass-panel);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  animation: sheet-materialize 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: 50% 100%;
  touch-action: none;
}

@keyframes sheet-materialize {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

.sheet-grabber {
  width: 42px;
  height: 5px;
  margin: 8px auto 2px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--ink-3) 55%, transparent);
  flex: none;
  cursor: grab;
}

.sheet-header {
  touch-action: none;
}

.sheet.is-dragging {
  animation: none !important;
}

body.sheet-open #app,
body.sheet-open .brief-shell,
body.sheet-open .approve-shell {
  transform: scale(0.96);
  filter: brightness(0.72);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}

/* --------------------------------------------------------------- toasts */
.toast-root {
  top: calc(10px + var(--safe-top));
  bottom: auto;
  align-items: center;
}

.toast {
  border: 1px solid var(--glass-edge);
  background: var(--glass-panel);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  color: var(--ink);
  border-radius: 999px;
  transform: translateY(-14px) scale(0.96);
}

.toast.is-visible {
  transform: none;
}

.toast-error {
  border-color: color-mix(in oklab, var(--danger) 55%, transparent);
}

.toast-success {
  border-color: color-mix(in oklab, var(--ok) 55%, transparent);
}

.toast .btn-quiet:hover {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  color: var(--ink);
}

.toast-undo {
  border-color: color-mix(in oklab, var(--ink-3) 45%, transparent);
  color: var(--ink);
}

/* ---------------------------------------------------------------- TV glass */
.tv-body {
  background-color: #0d131a;
}

.tv-screen {
  background: linear-gradient(158deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-bottom) 100%);
}

.tv-screen::before {
  background:
    radial-gradient(60% 50% at 92% -8%, rgba(255, 255, 255, 0.25), transparent 60%),
    radial-gradient(60% 50% at 0% 110%, color-mix(in oklab, var(--blob-2) 22%, transparent), transparent 70%),
    radial-gradient(50% 40% at 50% 50%, color-mix(in oklab, var(--blob-1) 10%, transparent), transparent 75%);
}

.tv-card {
  border-radius: clamp(20px, 1.6vw, 30px);
  border: 1px solid var(--glass-edge);
  background: var(--glass-panel);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-highlight), var(--glass-shadow);
}

.tv-drift {
  animation: tv-drift 420s ease-in-out infinite;
  will-change: transform;
}

@keyframes tv-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(1px, 1px, 0);
  }
  50% {
    transform: translate3d(2px, 0, 0);
  }
  75% {
    transform: translate3d(0, 2px, 0);
  }
}

.tv-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(10px, 1.2vw, 18px);
  padding: clamp(10px, 1vw, 16px) clamp(18px, 1.8vw, 30px);
  border-radius: 999px;
  color: var(--sky-ink);
  animation: tv-banner-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tv-banner-in {
  from {
    opacity: 0;
    transform: translateY(-120%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tv-banner-dot {
  width: clamp(8px, 0.7vw, 12px);
  height: clamp(8px, 0.7vw, 12px);
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.tv-banner-text {
  font-size: clamp(18px, 1.35vw, 26px);
  font-weight: 700;
  letter-spacing: var(--caption-tracking);
}

.tv-people-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: clamp(12px, 1.4vw, 24px);
  min-height: 0;
  flex: 0.92;
}

.tv-lower-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(12px, 1.4vw, 24px);
  flex: 1.42;
  min-height: 0;
  margin-top: clamp(12px, 1.4vw, 24px);
}

.tv-person-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(14px, 1.3vw, 24px);
}

/* TV readability from 10 ft: body copy is at least 28px. */
.tv-chore-name,
.tv-event-title,
.tv-grocery,
.tv-person-name,
.tv-brief-text {
  font-size: max(28px, clamp(24px, 1.35vw, 34px));
}

.tv-person-name {
  font-size: max(30px, clamp(24px, 1.3vw, 32px));
}

.tv-chore {
  min-height: clamp(46px, 3.8vw, 68px);
}

.tv-event {
  padding: clamp(9px, 0.8vw, 14px) 0;
}

.tv-event-time {
  font-size: max(20px, clamp(16px, 1vw, 22px));
}

.tv-empty,
.tv-card-count {
  font-size: max(22px, clamp(16px, 1vw, 24px));
}

.tv-banner,
.tv-brief-label,
.tv-brief-who,
.tv-brief-voice {
  letter-spacing: var(--caption-tracking);
}

/* ------------------------------------------------------------- small phones */
@media (max-width: 560px) {
  .assistant-dock {
    width: calc(100vw - 20px);
    bottom: calc(var(--tabbar-height) + 14px + var(--safe-bottom));
  }

  .tabbar-inner {
    width: 100%;
  }

  .tv-people-row {
    grid-auto-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1024px) {
  .assistant-dock {
    bottom: 18px;
    left: calc(50% + 59px);
  }

  .tabbar {
    bottom: 88px;
  }

  :root {
    --tabbar-height: 0px;
  }
}

/* M7.5 — TV content stack + More sheet rows (glass chrome only) */
.tv-content {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.more-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.more-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.more-row:hover {
  background: color-mix(in oklab, var(--surface-2) 80%, transparent);
}

.more-row:active {
  transform: scale(0.99);
}

.more-row .icon {
  --icon-size: 20px;
  color: var(--ink-2);
}

.more-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.more-hint {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}

/* Hero pill typography */
.hero-pill-lead {
  font-weight: 800;
}

.hero-pill-text {
  font-weight: 650;
  opacity: 0.85;
}

/* Dock transcript (solid rows inside the sheet; the sheet is the only glass) */
.dock-transcript {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dock-turn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.dock-turn.is-user {
  background: color-mix(in oklab, var(--accent) 14%, var(--surface));
}

.dock-turn-who {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dock-turn-text {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
}

/* M7.5 — room for the dock + tab bar, and no hard row dividers */
.app-main {
  padding-bottom: calc(var(--tabbar-height) + var(--dock-height) + 52px + var(--safe-bottom));
}

.chore-row + .chore-row,
.item-row + .item-row,
.setting-row + .setting-row,
.member-row + .member-row,
.leader-row + .leader-row,
.history-row + .history-row {
  border-top-color: transparent;
}

@media (min-width: 1024px) {
  .app-main {
    padding-bottom: 150px;
  }
}

/* ==========================================================================
   M7.5 addendum — the station layout (landscape tablet / kiosk)
   ========================================================================== */

.station-body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
}

.app-shell.is-station .app-header,
.app-shell.is-station .tabbar,
.app-shell.is-station .assistant-dock {
  display: none;
}

.app-shell.is-station .app-main {
  margin-left: 236px;
  padding: 0;
  height: 100dvh;
  overflow: hidden;
}

.station-sidebar {
  position: fixed;
  top: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 14px;
  width: 212px;
  padding: 16px 14px;
  border-radius: 26px;
  overflow-y: auto;
  scrollbar-width: none;
}

.app-shell.is-station .station-sidebar {
  display: flex;
}

.station-sidebar::-webkit-scrollbar {
  display: none;
}

.station-orb {
  align-self: flex-start;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 55%),
    conic-gradient(from 210deg, var(--blob-1), var(--blob-2), var(--blob-3), var(--blob-1));
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 8px 22px -10px var(--accent);
}

.station-orb-core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.station-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.station-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.station-nav-item .icon {
  --icon-size: 19px;
}

.station-nav-item[aria-current='page'] {
  background: color-mix(in oklab, var(--accent) 20%, var(--surface) 80%);
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.station-nav-item:hover {
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  color: var(--ink);
}

.station-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid transparent;
}

.station-member-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  opacity: 0.55;
}

.station-member-chip.is-selected {
  opacity: 1;
  background: color-mix(in oklab, var(--member-color) 14%, transparent);
  color: var(--ink);
}

.station-member-chip:hover {
  opacity: 1;
}

.station-member-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--member-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  flex: none;
}

.station-new {
  margin-top: auto;
  border-radius: 999px;
}

.station-sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid transparent;
}

.station {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100dvh;
  padding: 14px 18px 18px;
  overflow: hidden;
}

.station-widgets {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1.1fr;
  gap: 12px;
  flex: none;
}

.station-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 96px;
  padding: 12px 16px;
  border-radius: 22px;
  text-align: left;
  color: var(--ink);
  border-color: color-mix(in oklab, var(--tile-color, var(--accent)) 32%, var(--glass-edge));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 26px -16px color-mix(in oklab, var(--tile-color, var(--accent)) 70%, transparent),
    var(--glass-clear-shadow);
}

.station-tile:hover {
  transform: translateY(-1px);
}

.station-tile:active {
  transform: scale(0.985);
}

.station-tile-greeting {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: var(--caption-tracking);
  color: var(--ink-2);
}

.station-tile-clock {
  font-family: var(--font-display);
  font-size: clamp(30px, 2.5vw, 42px);
  font-weight: 800;
  letter-spacing: var(--display-tracking);
  line-height: 1;
}

.station-tile-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.station-tile-big {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 800;
  letter-spacing: var(--display-tracking);
  line-height: 1.1;
}

.station-tile-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.station-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.station-columns {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.station-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 10px;
  border-radius: 22px;
  border: 1px solid var(--glass-edge);
  background: color-mix(in oklab, var(--surface) 58%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
}

.station-column.is-today {
  transform: translateY(-4px) scale(1.012);
  background: color-mix(in oklab, var(--surface) 74%, transparent);
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  box-shadow:
    0 0 0 2px color-mix(in oklab, var(--accent) 55%, transparent),
    0 24px 60px -32px color-mix(in oklab, var(--accent) 65%, transparent);
  z-index: 2;
}

.station-column-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.station-weekday {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.station-date-badge {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--member-color, var(--accent));
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.station-month {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
}

.station-column-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
  scrollbar-width: thin;
}

.station-section-label {
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.station-event {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--member-color, var(--accent));
  color: #fff;
  text-align: left;
  line-height: 1.2;
  min-height: 34px;
}

.station-event-time {
  font-size: 9.5px;
  font-weight: 750;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.station-event-title {
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-chore {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 7px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in oklab, var(--member-color, var(--accent)) 34%, transparent);
  color: var(--ink);
  text-align: left;
  transition: transform 0.14s ease, background-color 0.16s ease;
}

.station-chore:hover {
  background: color-mix(in oklab, var(--surface) 96%, transparent);
}

.station-chore:active {
  transform: scale(0.97);
}

.station-chore.is-done {
  opacity: 0.72;
}

.station-chore.is-done .station-chore-name {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--line-strong);
}

.station-chore.is-pending {
  background: color-mix(in srgb, var(--warn-soft) 65%, var(--surface));
  border-color: color-mix(in oklab, var(--warn) 45%, transparent);
}

.station-chore:disabled {
  opacity: 0.55;
}

.station-chore-avatar .avatar {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.station-chore-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-chore-state .icon {
  --icon-size: 13px;
  color: var(--ok);
}

.station-chore.is-pending .station-chore-state .icon {
  color: var(--warn);
}

.station-empty {
  padding: 14px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-align: center;
}

/* Day / month / agenda / lists views */
.station-day {
  height: 100%;
  overflow-y: auto;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid var(--glass-edge);
  background: color-mix(in oklab, var(--surface) 66%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.station-day-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 800;
  letter-spacing: var(--display-tracking);
  margin-bottom: 12px;
}

.station-day-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-width: 620px;
}

.station-day .station-event,
.station-day .station-chore {
  min-height: 44px;
}

.station-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 100%;
  grid-auto-rows: 1fr;
}

.station-month-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}

.station-month-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 0;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--glass-edge);
  background: color-mix(in oklab, var(--surface) 62%, transparent);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.station-month-day.is-outside {
  opacity: 0.45;
}

.station-month-day.is-today {
  outline: 2px solid var(--accent);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
}

.station-month-date {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.station-month-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.station-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--row-color, var(--accent));
  flex: none;
}

.station-agenda {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.station-agenda-day {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--glass-edge);
  background: color-mix(in oklab, var(--surface) 66%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.station-agenda-date {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: var(--display-tracking);
}

.station-agenda .station-event,
.station-agenda .station-chore {
  min-height: 40px;
}

.station-lists {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
  max-width: 720px;
}

.station-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid var(--glass-edge);
  background: color-mix(in oklab, var(--surface) 66%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  color: var(--ink);
  font-weight: 650;
  text-align: left;
  box-shadow: 0 0 26px -18px color-mix(in oklab, var(--member-color, var(--accent)) 70%, transparent);
}

.station-list-row:hover {
  background: color-mix(in oklab, var(--surface) 82%, transparent);
}

.station-list-emoji {
  font-size: 22px;
}

.station-list-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}

/* Morning card */
.station-morning {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 60;
  width: min(560px, calc(100% - 40px));
  max-height: 80%;
  overflow-y: auto;
  transform: translate(-50%, -50%);
  padding: 26px 26px 20px;
  border-radius: 28px;
  color: var(--ink);
  animation: morning-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  cursor: pointer;
}

@keyframes morning-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.94);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }
}

.station-morning-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.station-morning-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.station-morning-date {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-3);
}

.station-morning-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 800;
  letter-spacing: var(--display-tracking);
  line-height: 1.05;
}

.station-morning-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}

.station-morning-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 2px;
  font-size: 15px;
  font-weight: 650;
}

.station-morning-row + .station-morning-row {
  border-top: 1px solid transparent;
}

.station-morning-meta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.station-morning-hint {
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

/* Kiosk */
.station.is-kiosk {
  padding: 10px 12px 8px;
}

.station.is-kiosk .station-main {
  animation: tv-drift 420s ease-in-out infinite;
  will-change: transform;
}

.station-kiosk-note {
  flex: none;
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: var(--caption-tracking);
  color: var(--ink-3);
  padding: 3px 0 0;
}

.station-home-hint {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}

.station-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.station-gate-card {
  width: min(480px, 100%);
  padding: 28px 24px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

/* Night palette: deeper indigo/violet, dimmer so it isn't a lamp. */
body[data-phase='night']::before,
body[data-phase='late']::before {
  background:
    radial-gradient(46% 42% at 18% 16%, rgba(63, 61, 130, 0.55), transparent 72%),
    radial-gradient(40% 36% at 82% 14%, rgba(46, 38, 92, 0.5), transparent 70%),
    radial-gradient(52% 44% at 76% 86%, rgba(24, 30, 62, 0.7), transparent 74%),
    radial-gradient(34% 30% at 26% 84%, color-mix(in oklab, var(--blob-2) 22%, transparent), transparent 70%);
}

body[data-phase='night']::after,
body[data-phase='late']::after {
  background:
    radial-gradient(46% 40% at 68% 32%, rgba(96, 78, 168, 0.24), transparent 70%),
    radial-gradient(40% 36% at 30% 70%, rgba(48, 92, 168, 0.18), transparent 72%);
  opacity: 0.55;
}

body[data-phase='night'],
body[data-phase='late'] {
  --glass-alpha: 74%;
  --glass-clear-alpha: 68%;
  --glass-edge: rgba(190, 198, 255, 0.24);
}

body[data-phase='night'] .station-tile,
body[data-phase='late'] .station-tile,
body[data-phase='night'] .station-column,
body[data-phase='late'] .station-column {
  filter: brightness(0.94);
}

@media (max-height: 900px) {
  .station-tile {
    min-height: 84px;
    padding: 10px 14px;
  }

  .station {
    gap: 10px;
    padding: 10px 14px 12px;
  }
}

@media (max-width: 1240px) {
  .app-shell.is-station .app-main {
    margin-left: 208px;
  }

  .station-sidebar {
    width: 184px;
    padding: 12px 10px;
  }

  .station-widgets {
    grid-template-columns: 1.3fr 0.9fr 1.1fr 1fr;
    gap: 9px;
  }

  .station-columns {
    gap: 7px;
  }

  .station-column {
    padding: 10px 7px;
  }

  .station-chore-name,
  .station-event-title {
    font-size: 11px;
  }
}

/* ==========================================================================
   M8 on Liquid Glass — brief page chrome, assigned items, station brief
   ========================================================================== */

.brief-header {
  position: sticky;
  top: calc(8px + var(--safe-top));
  z-index: 20;
  margin: 8px 14px 0;
  padding: 8px 12px;
  border-radius: 999px;
}

.brief-header .brand-sub {
  margin-top: -1px;
}

.brief-member.glass,
.brief-date.glass {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

/* Today — assigned items (Change 7) */
.assigned-row .assigned-from {
  font-weight: 750;
  color: var(--ink-2);
}

.chore-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.chore-meta-row .avatar {
  width: 22px;
  height: 22px;
  font-size: 11px;
  box-shadow: none;
}

.assigned-row .badge-due {
  font-size: 10.5px;
  padding: 1px 7px;
}

/* Station morning card — the brief */
.station-morning-brief {
  margin-top: 10px;
  max-height: 28vh;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--display-tracking);
  color: var(--ink-2);
}

/* TV morning brief on the glass system */
.tv-brief.glass {
  background: var(--glass-panel);
  color: var(--ink);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-highlight), var(--glass-shadow);
}

.tv-brief.glass .tv-brief-label {
  color: var(--accent-strong);
}

@media (max-width: 560px) {
  .brief-header {
    margin: 6px 10px 0;
  }
}

/* ==========================================================================
   M9.5 — Kids settings (Change 6) + History Questions tab
   ========================================================================== */

.kids-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.kids-note .icon {
  --icon-size: 18px;
  color: var(--accent-strong);
  flex: none;
  margin-top: 1px;
}

.kids-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kid-card {
  gap: 10px;
}

.kid-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kid-card-head .pill {
  font-size: 10.5px;
  padding: 2px 8px;
}

.settings-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.input-time,
.input-number,
.input-date,
.input-select {
  max-width: 100%;
  min-height: var(--tap);
}

.input-time {
  width: 128px;
}

.input-number {
  width: 108px;
}

.input-date {
  width: 168px;
}

.input-select {
  width: 100%;
}

/* History → Questions */
.history-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.history-tabs-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.history-toolbar-questions {
  align-items: flex-end;
}

.question-filter {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.question-filter .field-label {
  align-self: center;
}

.question-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 2px;
}

.question-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}

.question-hidden-hint {
  margin: 0 0 6px;
}

.question-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
}

.question-row + .question-row {
  margin-top: 6px;
}

.question-flags {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
  flex: none;
}

.question-flag {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.question-flag .icon {
  --icon-size: 14px;
}

.question-flag.is-redirected {
  background: color-mix(in oklab, var(--accent) 16%, var(--surface));
  color: var(--accent-strong);
}

.question-flag.is-safety {
  background: color-mix(in srgb, var(--danger-soft) 80%, var(--surface));
  color: var(--danger);
}

.question-flag.is-homework {
  background: color-mix(in srgb, var(--warn-soft) 80%, var(--surface));
  color: var(--warn);
}

.question-flag.is-ok {
  background: color-mix(in srgb, var(--ok-soft) 80%, var(--surface));
  color: var(--ok);
}

.question-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.question-answer {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
}

.question-time {
  flex: none;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-3);
  padding-top: 2px;
}

@media (max-width: 560px) {
  .history-tabs {
    align-items: flex-start;
  }

  .question-row {
    padding: 10px;
  }

  .question-time {
    font-size: 10.5px;
  }
}


/* ==========================================================================
   M8.1 functional fixes only (station/TV structure + visual direction on hold)
   ========================================================================== */

/* Bottom-safe space on every app route: dock + tab bar + breathing room */
.app-main {
  padding-bottom: calc(var(--tabbar-height) + var(--dock-height) + 122px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(var(--tabbar-height) + var(--dock-height) + 122px + env(safe-area-inset-bottom, 0px));
}

.screen {
  padding-bottom: 8px;
}

/* Overflow: TV cards never cut a row; "+N more" stays visible */
.tv-card {
  overflow: hidden;
}

.tv-card .tv-list {
  overflow: hidden;
}

.tv-more {
  flex: none;
  padding: clamp(8px, 0.8vw, 14px) 0 2px;
  font-size: clamp(12px, 1vw, 18px);
  font-weight: 750;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}

/* Person-card overflow affordance lives in the header so it can never be clipped. */
.tv-more-inline {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  font-size: clamp(11px, 0.85vw, 15px);
  font-weight: 750;
  color: var(--ink-3);
}

/* Neutral header slot reserved for the assistant orb (visual direction on hold) */
.brand-orb-slot {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  opacity: 0.7;
}

/* ==========================================================================
   M10 snapshot vision — glass look sheet (no sky/station/TV restyle)
   ========================================================================== */

.dock-camera[hidden] {
  display: none;
}

.look-sheet {
  gap: 12px;
}

.look-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 200px;
  max-height: 42vh;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 60%),
    color-mix(in oklab, var(--surface-2) 80%, transparent);
  border: 1px solid var(--line);
}

.look-video,
.look-preview {
  width: 100%;
  height: 100%;
  max-height: 42vh;
  object-fit: contain;
  border-radius: 18px;
  background: #0b0f14;
}

.look-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.look-placeholder .icon {
  color: var(--ink-3);
  opacity: 0.75;
}

.look-status {
  margin: 0;
  min-height: 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.look-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.look-source-row .btn {
  min-height: var(--tap);
}

.look-caption {
  width: 100%;
  min-height: 64px;
  resize: vertical;
}

.look-privacy {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 8%, var(--surface));
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.look-privacy .icon {
  --icon-size: 15px;
  flex: none;
  margin-top: 1px;
  color: var(--accent-strong);
}

.look-error:not([hidden]) {
  display: block;
}

.look-send {
  min-height: var(--tap);
}

@media (max-width: 430px) {
  .assistant-dock .dock-expand {
    display: none;
  }
}

/* ==========================================================================
   M11 rewards + allowance (glass base unchanged)
   ========================================================================== */

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.reward-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.reward-card.is-inactive {
  opacity: 0.62;
}

.reward-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reward-emoji {
  font-size: 30px;
  line-height: 1;
  flex: none;
}

.reward-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.reward-meta {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
}

.reward-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.reward-request {
  min-height: var(--tap);
}

.reward-pending-card {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.allowance-card {
  gap: 10px;
}

.allowance-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 9%, var(--surface));
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.allowance-note .icon {
  --icon-size: 15px;
  flex: none;
  color: var(--accent-strong);
}

.jar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.jar-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-2);
}

.jar-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.jar-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: var(--display-tracking);
}

.jar-split {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.mini-title {
  margin: 6px 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.goal-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
}

.goal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.goal-title {
  font-size: 13.5px;
  font-weight: 700;
}

.goal-amount {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-3);
}

.goal-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.goal-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--ok));
}

.goal-manage {
  gap: 8px;
}

.payout-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.payout-row:first-child {
  border-top: 0;
}

.payout-when {
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-3);
}

.redemption-section {
  margin-bottom: 8px;
}

.redemption-card .signoff-title-text {
  font-weight: 800;
}

.allowance-manage .row .input {
  min-width: 0;
}

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

  .reward-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   M8.2 "Midnight" — owner-chosen design (phone Today, station, TV)
   ========================================================================== */

.midnight-body {
  --bg: #0b0922;
  --surface: rgba(255, 255, 255, 0.09);
  --surface-2: rgba(255, 255, 255, 0.13);
  --surface-3: rgba(255, 255, 255, 0.18);
  --ink: #f5f2ff;
  --ink-2: #c9c2ea;
  --ink-3: #a49bc9;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --accent: #5fe3ff;
  --accent-strong: #7fe7ff;
  --ok: #3ee0b0;
  --warn: #ffa53a;
  --amber: #ffc56b;
  --danger: #ff4d8d;
  --cyan: #5fe3ff;
  --pink: #ff3b95;
  --violet: #7a2dff;
  --blue: #1d63ff;
  --glass-panel: rgba(255, 255, 255, 0.09);
  --glass-clear-panel: rgba(255, 255, 255, 0.07);
  --glass-edge: rgba(255, 255, 255, 0.24);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -14px 28px rgba(0, 0, 0, 0.25);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
  --glass-blur: 30px;
  --glass-saturate: 190%;
  --radius-card: 26px;
  color: var(--ink);
  background:
    radial-gradient(90% 50% at 0% 0%, #7a2dff 0%, rgba(122, 45, 255, 0) 62%),
    radial-gradient(80% 45% at 100% 22%, #ff3b95 0%, rgba(255, 59, 149, 0) 58%),
    radial-gradient(110% 60% at 50% 100%, #1d63ff 0%, rgba(29, 99, 255, 0) 66%),
    #0b0922;
  background-attachment: fixed;
}

.midnight-day {
  background:
    radial-gradient(90% 50% at 0% 0%, #9a4dff 0%, rgba(122, 45, 255, 0) 64%),
    radial-gradient(80% 45% at 100% 22%, #ff5aa8 0%, rgba(255, 59, 149, 0) 60%),
    radial-gradient(110% 60% at 50% 100%, #3a7bff 0%, rgba(29, 99, 255, 0) 68%),
    #16113a;
}

.midnight-body::before {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 62% 38%, #5a2dff 0%, transparent 72%),
    radial-gradient(28% 26% at 88% 82%, #00b8ff 0%, transparent 72%);
  filter: blur(90px);
  opacity: 0.55;
}

.midnight-body::after { content: none; }

.midnight-body .app-shell,
.midnight-body .ground { background: transparent; }

/* Phone app header */
.mid-app-header {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding-top: calc(14px + var(--safe-top));
  align-items: center;
}
.mid-app-date {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.mid-app-header .header-actions { gap: 10px; }
.mid-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: var(--glass-highlight);
}
.mid-bell-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 9px var(--pink);
}
.mid-bell-dot[hidden] { display: none; }
.mid-app-header .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55); }

/* Center orb tab bar */
.midnight-body .tabbar { background: transparent; }
.midnight-body .tabbar-inner {
  height: 72px;
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-highlight), 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: visible;
}
.midnight-body .tab {
  min-height: 56px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
}
.midnight-body .tab[aria-current='page'] { background: rgba(255, 255, 255, 0.12); color: var(--accent-strong); border-radius: 26px; }
.tab-orb {
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  margin-top: -34px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #8ff3ff 20%, #7a5cff 58%, #ff3b95 100%);
  box-shadow: 0 0 0 6px rgba(11, 9, 34, 0.85), 0 0 0 8px rgba(95, 227, 255, 0.35), 0 0 40px rgba(95, 227, 255, 0.6);
  cursor: pointer;
}
.tab-orb:active { transform: scale(0.96); }
.midnight-body .tab-lens { display: none; }

/* Phone layout */
.midnight-phone {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 10px 20px 150px;
  min-height: 100dvh;
}
.mid-greeting h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.mid-greeting p { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }

/* Tubes */
.mid-tubes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mid-tube {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -12px 24px rgba(0, 0, 0, 0.25), 0 12px 28px rgba(0, 0, 0, 0.35);
}
.mid-tubes-phone .mid-tube { height: 150px; }
.mid-tubes-station .mid-tube { height: 100%; min-height: 320px; border-radius: 40px; }
.mid-tube-liquid {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--tube-fill, 0%);
  background: linear-gradient(180deg, var(--member-light) 0%, var(--member-color) 75%);
  transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.mid-tube-wave {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--tube-fill, 0%);
  width: 100%; height: 16px;
  margin-bottom: -8px;
  animation: mid-wave 7s ease-in-out infinite alternate;
}
@keyframes mid-wave { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
.mid-bubble { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.mid-bubble-1 { width: 6px; height: 6px; left: 14px; bottom: 26%; }
.mid-bubble-2 { width: 4px; height: 4px; left: 30px; bottom: 18%; }
.mid-bubble-3 { width: 5px; height: 5px; right: 18px; bottom: 38%; opacity: 0.7; }
.mid-tube-sheen {
  position: absolute; left: 7px; top: 10px; bottom: 10px; width: 5px; border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}
.mid-tube-head { position: absolute; left: 0; right: 0; top: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mid-crown { color: #ffd36b; font-size: 18px; line-height: 1; text-shadow: 0 0 12px rgba(255, 211, 107, 0.7); }
.mid-tube-name { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
.mid-tube-foot, .mid-tube-stars { position: absolute; left: 0; right: 0; text-align: center; font-weight: 800; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.mid-tube-foot { bottom: 12px; font-size: 12px; }
.mid-tube-stars { bottom: 30px; font-size: 10px; color: var(--ink-2); }
.mid-tube-next { position: absolute; left: 10px; right: 10px; bottom: 12px; border-radius: 16px; background: rgba(11, 9, 34, 0.45); padding: 10px 12px; font-size: 14px; font-weight: 700; line-height: 1.25; }
.mid-tubes-station { gap: 20px; }
.mid-tubes-station .mid-tube-name { font-size: 30px; }
.mid-tubes-station .mid-tube-foot { bottom: 96px; font-size: 15px; }
.mid-tubes-station .mid-tube-stars { bottom: 72px; font-size: 13px; }
.mid-tubes-station .mid-tube-head { top: 22px; }

/* Waiting card */
.mid-waiting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 197, 107, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 30px rgba(255, 165, 58, 0.18);
  position: relative;
}
.mid-waiting-title { font-size: 16px; font-weight: 700; }
.mid-waiting-kicker { font-size: 12px; font-weight: 800; color: var(--amber); }
.mid-waiting-sub { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.layout-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mid-round { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--glass-edge); background: rgba(255, 255, 255, 0.12); color: var(--ink); cursor: pointer; }
.mid-approve { background: var(--accent); color: #0b0922; border-color: transparent; box-shadow: 0 0 18px rgba(95, 227, 255, 0.55); }
.mid-more { position: absolute; right: 14px; bottom: -9px; font-size: 11px; font-weight: 800; color: var(--accent-strong); text-decoration: none; }

/* Tonight phone */
.mid-tonight-head { display: flex; align-items: baseline; justify-content: space-between; }
.mid-tonight-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.mid-tonight-head a { font-size: 13px; font-weight: 800; color: var(--accent-strong); text-decoration: none; }
.mid-tonight-phone { position: relative; }
.mid-tonight-rows { position: relative; margin-top: 18px; padding-left: 34px; display: flex; flex-direction: column; gap: 8px; }
.mid-tonight-rows::before { content: ''; position: absolute; left: 11px; top: 6px; bottom: 0; width: 4px; border-radius: 2px; background: linear-gradient(180deg, #fff 0%, #5fe3ff 12%, #a77bff 55%, #ff3b95 100%); box-shadow: 0 0 14px rgba(167, 123, 255, 0.8); }
.mid-now-marker { position: relative; display: flex; align-items: center; gap: 10px; margin-left: -30px; margin-bottom: 4px; }
.mid-now-dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.18), 0 0 16px #fff; }
.mid-now-label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; color: #fff; }
.mid-tonight-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-edge); }
.mid-tonight-row::before { content: ''; position: absolute; left: -27px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bead); box-shadow: 0 0 12px var(--bead); }
.mid-tonight-time { width: 52px; flex: none; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.mid-tonight-title { display: block; font-size: 15px; font-weight: 700; }
.mid-tonight-sub { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.midnight-phone::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 150px; pointer-events: none; background: linear-gradient(180deg, rgba(11, 9, 34, 0) 0%, rgba(11, 9, 34, 0.85) 60%); z-index: 5; }
.midnight-phone > * { position: relative; z-index: 6; }

/* Station / TV */
.app-shell.is-station .app-main { margin-left: 0 !important; padding: 0 !important; height: 100dvh; }
.app-shell.is-station .station-sidebar { display: none !important; }
.midnight-station, .midnight-tv {
  position: relative;
  min-height: 100dvh;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: hidden;
}
.mid-station-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.mid-station-clock { font-family: var(--font-display); font-size: 112px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; }
.mid-station-date { margin-top: 6px; font-size: 20px; font-weight: 600; color: var(--ink-2); }
.mid-station-greet { margin-top: 8px; font-size: 20px; font-weight: 700; }
.mid-week { display: flex; gap: 10px; }
.mid-week-pill { width: 58px; height: 92px; border-radius: 29px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.mid-week-pill.is-today { background: rgba(95, 227, 255, 0.22); border: 2px solid rgba(95, 227, 255, 0.9); box-shadow: 0 0 30px rgba(95, 227, 255, 0.45); }
.mid-week-dow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--ink-2); }
.mid-week-num { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.mid-week-dots { display: flex; gap: 3px; height: 6px; }
.mid-week-dot { width: 6px; height: 6px; border-radius: 50%; }
.mid-tonight-station { position: relative; height: 250px; flex: none; }
.mid-tonight-kicker { position: absolute; left: 0; top: -22px; font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.mid-ribbon-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mid-now-station { position: absolute; left: 22px; top: 172px; font-size: 13px; font-weight: 800; }
.mid-bead { position: absolute; width: 190px; border-radius: 22px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 34px rgba(0, 0, 0, 0.35); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.mid-bead.is-high { top: 18px; }
.mid-bead.is-low { top: 168px; }
.mid-bead-dot { position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--bead); box-shadow: 0 0 14px var(--bead); }
.mid-bead-time { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.mid-bead-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.mid-bead-sub { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.mid-station-body { display: grid; grid-template-columns: 1fr 370px; gap: 20px; flex: 1; min-height: 0; }
.mid-orb-panel { border-radius: 40px; background: rgba(30, 24, 70, 0.45); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.mid-orb-row { display: flex; align-items: center; gap: 16px; }
.mid-big-orb { width: 84px; height: 84px; min-width: 84px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0%, #8ff3ff 20%, #7a5cff 58%, #ff3b95 100%); box-shadow: 0 0 0 8px rgba(95, 227, 255, 0.18), 0 0 60px rgba(95, 227, 255, 0.55); display: grid; place-items: center; }
.mid-orb-core { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); }
.mid-orb-name { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.mid-orb-status { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--accent-strong); }
.mid-chat { display: flex; flex-direction: column; gap: 10px; }
.mid-bubble { padding: 10px 14px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.mid-bubble-user { align-self: flex-end; max-width: 85%; border-radius: 20px 20px 6px 20px; background: rgba(255, 255, 255, 0.14); }
.mid-bubble-orb { max-width: 92%; border-radius: 20px 20px 20px 6px; background: rgba(95, 227, 255, 0.16); border: 1px solid rgba(95, 227, 255, 0.35); font-size: 16px; }
.mid-wave { display: flex; align-items: center; gap: 4px; height: 36px; }
.mid-wave span { flex: 1; border-radius: 3px; background: linear-gradient(180deg, #8ff3ff, #a77bff); }
.mid-orb-actions { display: flex; gap: 10px; align-items: center; margin-top: auto; }
.mid-orb-mic { width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 50%; border: 1px solid rgba(95, 227, 255, 0.6); background: rgba(95, 227, 255, 0.2); color: var(--accent-strong); display: grid; place-items: center; }

/* Other screens: Midnight surfaces, same content */
.midnight-body .app-main { background: transparent; }
.midnight-body .card,
.midnight-body .settings-card,
.midnight-body .chore-list,
.midnight-body .list-panel,
.midnight-body .history-list,
.midnight-body .signoff-card,
.midnight-body .reward-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-edge);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 12px 30px rgba(0, 0, 0, 0.3);
}
.midnight-body .input,
.midnight-body .textarea,
.midnight-body select {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-edge);
  color: var(--ink);
}
.midnight-body .screen-title, .midnight-body .section-title { color: var(--ink); }
.midnight-body .screen-sub, .midnight-body .section-sub, .midnight-body .setting-hint { color: var(--ink-2); }
.midnight-body .btn-secondary { background: rgba(255, 255, 255, 0.12); color: var(--ink); border-color: var(--glass-edge); }
.midnight-body .btn-primary { background: var(--accent); color: #0b0922; }
.midnight-body .chore-row + .chore-row,
.midnight-body .item-row + .item-row { border-top-color: var(--line); }
.midnight-body .section-action { color: var(--accent-strong); }
.midnight-body .badge-due, .midnight-body .pill { background: rgba(255, 255, 255, 0.12); color: var(--ink-2); }

/* TV: 10 ft sizes, lite path, D-pad */
.tv-midnight .midnight-tv { font-size: 28px; }
.midnight-tv .mid-station-clock { font-size: 160px; }
.midnight-tv .mid-tube-name { font-size: 44px; }
.midnight-tv .mid-station-date, .midnight-tv .mid-station-greet { font-size: 28px; }
.midnight-tv .mid-tube-foot { font-size: 26px; }
.midnight-tv .mid-tube-stars { font-size: 24px; }
.midnight-tv .mid-tube-next, .midnight-tv .mid-tonight-sub, .midnight-tv .mid-bead-sub { font-size: 24px; }
.midnight-tv .mid-bead, .midnight-tv .mid-bead-title { font-size: 26px; }
.midnight-tv .mid-orb-status, .midnight-tv .mid-orb-name { font-size: 34px; }
.midnight-tv { padding: 54px 5vw; }
.midnight-tv .mid-station-body { grid-template-columns: 1fr 460px; }
.midnight-tv button:focus-visible, .midnight-tv a:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
  border-radius: 18px;
}
.tv-voice-unlock {
  position: fixed;
  right: 5vw;
  bottom: 5vh;
  z-index: 50;
  min-height: 72px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid rgba(95, 227, 255, 0.6);
  background: rgba(95, 227, 255, 0.18);
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.tv-voice-unlock.is-on { display: none; }
.tv-lite .midnight-tv, .tv-lite .midnight-station { background: transparent; }
.tv-lite .midnight-body::before { filter: none; }
.tv-lite .glass,
.tv-lite .mid-waiting,
.tv-lite .mid-bead { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, 0.12); }
.tv-lite .mid-tube-wave { animation: none; }
.tv-lite .mid-bubble { animation: none; }
.tv-lite .mid-big-orb, .tv-lite .tab-orb { box-shadow: 0 0 0 6px rgba(95, 227, 255, 0.25); }

@media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
  .midnight-body { --glass-panel: #16113a; --glass-clear-panel: #16113a; --glass-edge: #6b5fa0; }
  .midnight-body::before { display: none; }
  .midnight-body .glass, .mid-tube, .mid-waiting, .mid-bead, .mid-orb-panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: #16113a; }
}
@media (prefers-reduced-motion: reduce) {
  .mid-tube-wave, .mid-bubble, .tab-orb { animation: none !important; }
  .mid-tube-liquid { transition: none; }
}

/* M8.2 screenshot-pass fixes */
.midnight-body .assistant-dock { display: none !important; }
.midnight-body .app-main {
  padding-bottom: calc(var(--tabbar-height) + 170px + env(safe-area-inset-bottom, 0px)) !important;
}
.mid-night { padding-bottom: 210px !important; }

/* Tubes: tiny bubbles, labels above liquid, no collisions */
.mid-tube-bubble { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.5); z-index: 2; pointer-events: none; }
.mid-tube-bubble-1 { width: 6px; height: 6px; left: 14px; bottom: 26%; }
.mid-tube-bubble-2 { width: 4px; height: 4px; left: 30px; bottom: 18%; }
.mid-tube-bubble-3 { width: 5px; height: 5px; right: 18px; bottom: 38%; opacity: 0.7; }
.mid-tube-liquid { z-index: 1; }
.mid-tube-wave { z-index: 2; }
.mid-tube-sheen { z-index: 3; }
.mid-tube-head, .mid-tube-foot, .mid-tube-stars, .mid-tube-next, .mid-crown, .mid-crown-label { z-index: 4; }
.mid-tube-head { top: 19px; }
.mid-tube-foot { bottom: 22px; }
.mid-tube-stars { bottom: 40px; }
.mid-tubes-station .mid-tube-head { top: 22px; }
.mid-tubes-station .mid-tube-foot { bottom: 118px; font-size: 15px; }
.mid-tubes-station .mid-tube-stars { bottom: 96px; font-size: 13px; }
.mid-tubes-station .mid-tube-next { bottom: 14px; max-height: 68px; overflow: hidden; }
.mid-tube-next { padding: 10px 12px; }
.mid-crown-label { position: absolute; left: 0; right: 0; top: 126px; text-align: center; font-size: 10px; font-weight: 800; color: #ffd36b; }

/* Phone: hide separate dock; ribbon clears tab bar */
.midnight-phone { padding-bottom: 210px; }
.mid-waiting { flex-wrap: wrap; padding: 12px 14px 16px; }
.mid-waiting .mid-more { position: static; margin-left: auto; padding: 2px 0; }
.mid-waiting-sub { overflow-wrap: anywhere; white-space: normal; }

/* Station ribbon sits in its own band; beads never cross into the tubes */
.mid-tonight-station { height: 220px; margin-bottom: 24px; overflow: hidden; }
.mid-tonight-kicker { top: -18px; }
.mid-bead { width: 170px; max-height: 82px; overflow: hidden; padding: 10px 12px; }
.mid-bead.is-low { top: 138px; }
.mid-bead-title, .mid-bead-time, .mid-bead-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mid-station-body { margin-top: 16px; position: relative; z-index: 1; }
.mid-station-clock { font-size: 112px; }
.mid-station-head { margin-bottom: 8px; }

/* Orb panel: chat above, waveform below, actions last */
.mid-orb-panel { overflow: hidden; }
.mid-chat { flex: none; min-height: 0; overflow: hidden; }
.mid-bubble { max-height: 92px; overflow: hidden; overflow-wrap: anywhere; }
.mid-wave { flex: none; height: 32px; }
.mid-orb-actions { flex: none; }

/* TV: fit the whole 1080p composition; overscan-safe 5%; bottom band reserved */
.midnight-tv {
  height: 100dvh;
  overflow: hidden;
  padding: 5vh 5vw 4vh;
  gap: 16px;
  font-size: 28px;
}
.midnight-tv .mid-station-clock { font-size: 160px; }
.midnight-tv .mid-tube-name { font-size: 44px; }
.midnight-tv .mid-station-date, .midnight-tv .mid-station-greet { font-size: 28px; }
.midnight-tv .mid-week-pill { width: 68px; height: 104px; }
.midnight-tv .mid-tonight-station { height: 200px; margin-bottom: 10px; }
.midnight-tv .mid-station-body { padding-bottom: 104px; min-height: 0; grid-template-columns: 1fr 430px; }
.midnight-tv .mid-tubes-station .mid-tube { min-height: 260px; }
.midnight-tv .mid-tube-head { top: 18px; }
.midnight-tv .mid-tube-foot { bottom: 104px; }
.midnight-tv .mid-tube-stars { bottom: 84px; }
.midnight-tv .mid-tube-next { max-height: 58px; }
.midnight-tv .mid-waiting {
  position: fixed;
  left: 5vw;
  bottom: 4vh;
  width: 600px;
  z-index: 30;
  min-height: 0;
}
.midnight-tv .mid-waiting .mid-waiting-title { font-size: 22px; }
.midnight-tv .mid-waiting .mid-waiting-sub { font-size: 18px; }
.midnight-tv .tv-voice-unlock { bottom: 4vh; right: 5vw; font-size: 22px; min-height: 64px; }
.midnight-tv .mid-orb-panel { padding: 20px; gap: 12px; }
.midnight-tv .mid-orb-row .mid-big-orb { width: 70px; height: 70px; min-width: 70px; }
.midnight-tv .mid-orb-name { font-size: 32px; }
.midnight-tv .mid-bubble { font-size: 18px; max-height: 72px; }
.midnight-tv .mid-wave { height: 26px; }
@media (min-width: 1024px) and (max-width: 1100px) {
  .midnight-station .mid-bead.is-low { top: 128px; }
}

/* M8.2 TV/footer round 2 */
.midnight-tv { display: flex; flex-direction: column; gap: 12px; }
.midnight-tv .mid-station-body { flex: 1; min-height: 0; padding-bottom: 0; }
.midnight-tv .mid-tubes-station { height: 100%; }
.midnight-tv .mid-tubes-station .mid-tube { min-height: 0; height: 100%; }
.mid-tv-footer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 0;
  z-index: 20;
}
.mid-tv-footer .mid-waiting {
  position: static;
  width: auto;
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
}
.mid-tv-footer .tv-voice-unlock {
  position: static;
  flex: none;
  min-height: 58px;
  font-size: 20px;
}
.midnight-tv .mid-tonight-station { height: 190px; margin-bottom: 4px; overflow: visible; }
.midnight-tv .mid-bead { width: 210px; max-height: 78px; overflow: hidden; padding: 8px 12px; }
.midnight-tv .mid-bead.is-high { top: 8px; }
.midnight-tv .mid-bead.is-low { top: 104px; }
.midnight-tv .mid-bead-title { font-size: 20px; line-height: 1.15; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.midnight-tv .mid-bead-time { font-size: 15px; }
.midnight-tv .mid-bead-sub { font-size: 14px; }
.midnight-tv .mid-tube-name { font-size: 40px; }
.midnight-tv .mid-tube-foot { bottom: 108px; }
.midnight-tv .mid-tube-stars { bottom: 88px; }
.midnight-tv .mid-tube-next {
  max-height: none;
  overflow: visible;
  bottom: 12px;
  font-size: 19px;
  line-height: 1.22;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.midnight-tv .mid-orb-panel { display: flex; flex-direction: column; gap: 10px; }
.midnight-tv .mid-chat { flex: 0 1 auto; max-height: 150px; overflow: hidden; }
.midnight-tv .mid-bubble { font-size: 17px; max-height: 64px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.midnight-tv .mid-wave { flex: none; height: 26px; margin-top: 4px; }
.midnight-tv .mid-orb-actions { margin-top: auto; }

/* All orb panels: chat, then waveform, then actions */
.mid-orb-panel { display: flex; flex-direction: column; gap: 12px; }
.mid-chat { flex: 0 1 auto; min-height: 0; max-height: 190px; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.mid-bubble { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mid-wave { flex: none; height: 30px; margin-top: 4px; }
.mid-orb-actions { margin-top: auto; }

/* Phone waiting card: compact, single-line label/timestamp */
.mid-waiting {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 44px 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 14px;
}
.mid-waiting > .mid-waiting-kid { grid-column: 1; }
.mid-waiting > .layout-meta { grid-column: 2; min-width: 0; }
.mid-waiting-kicker { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mid-waiting-title { font-size: 14px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mid-waiting-sub { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mid-waiting .mid-round { width: 44px; height: 44px; }
.mid-waiting .mid-more { grid-column: 1 / -1; justify-self: end; position: static; margin: 0; font-size: 10px; }
.midnight-tv .mid-waiting {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}
.midnight-tv .mid-waiting > .layout-meta { flex: 1; min-width: 0; }
.midnight-tv .mid-waiting-kicker { font-size: 14px; }
.midnight-tv .mid-waiting-title { font-size: 20px; -webkit-line-clamp: 1; }
.midnight-tv .mid-waiting-sub { font-size: 14px; }
.midnight-tv .mid-waiting .mid-more { font-size: 13px; }

/* Tube labels: count above stars, both clear of the liquid */
.mid-tubes-phone .mid-tube-foot { bottom: 34px; }
.mid-tubes-phone .mid-tube-stars { bottom: 16px; font-size: 9.5px; }
.mid-tubes-phone .mid-tube-head { top: 16px; }
.mid-tubes-station .mid-tube-foot { bottom: 112px; }
.mid-tubes-station .mid-tube-stars { bottom: 90px; }
.mid-tubes-station .mid-tube-next { bottom: 12px; }
.mid-bead { max-height: 96px; overflow: visible; }
.mid-bead-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* M8.2 round 3: station reference layout, phone compaction, TV fit */
.mid-station-head { align-items: flex-start; }
.mid-station-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.mid-station-right-row { display: flex; align-items: center; gap: 12px; }
.tv-voice-unlock {
  position: static;
  min-height: 52px;
  height: 52px;
  padding: 0 18px;
  font-size: 17px;
  border-radius: 999px;
  background: rgba(95, 227, 255, 0.16);
  color: var(--ink);
  border: 1px solid rgba(95, 227, 255, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.midnight-tv .tv-voice-unlock { font-size: 20px; min-height: 58px; height: 58px; padding: 0 22px; }
.mid-station-body { flex: 1; min-height: 0; }
.midnight-tv .mid-station-body { flex: 1; min-height: 0; padding-bottom: 0; }
.midnight-tv .mid-tubes-station .mid-tube { height: 100%; min-height: 0; }
.midnight-tv .mid-tubes-station .mid-tube-foot { bottom: 104px; font-size: 20px; }
.midnight-tv .mid-tubes-station .mid-tube-next {
  bottom: 10px;
  max-height: 62px;
  overflow: visible;
  -webkit-line-clamp: 2;
  font-size: 18px;
  line-height: 1.2;
}
.midnight-tv .mid-bead {
  width: 230px;
  max-height: none;
  overflow: visible;
  padding: 9px 12px;
}
.midnight-tv .mid-bead.is-high { top: 2px; }
.midnight-tv .mid-bead.is-low { top: 98px; }
.midnight-tv .mid-bead-title { font-size: 19px; line-height: 1.12; -webkit-line-clamp: 2; }
.midnight-tv .mid-bead-time { font-size: 14px; }
.midnight-tv .mid-bead-sub { font-size: 13px; }
.mid-tonight-station { height: 210px; }
.mid-bead { max-height: none; overflow: visible; }
.mid-bead-title { -webkit-line-clamp: 2; overflow: hidden; }
.mid-bead.is-high { top: 6px; }
.mid-bead.is-low { top: 116px; }

/* Chat then waveform then actions, never overlapping */
.mid-orb-panel { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.mid-chat { flex: 0 1 auto; max-height: 170px; overflow: hidden; }
.mid-bubble { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mid-wave { flex: none; height: 32px; margin-top: 2px; }
.mid-orb-actions { flex: none; margin-top: auto; }

/* Phone reference rhythm */
.midnight-phone { gap: 12px; padding: 4px 20px 200px; }
.mid-greeting h1 { font-size: 36px; }
.mid-greeting p { margin-top: 6px; font-size: 14px; }
.mid-tubes { margin-top: 2px; }
.mid-tubes-phone .mid-tube { height: 150px; }
.mid-tubes-phone .mid-tube-head { top: 14px; }
.mid-tubes-phone .mid-tube-foot { bottom: 14px; font-size: 12px; }
.mid-tubes-phone .mid-crown-label { top: 116px; font-size: 9px; }
.mid-waiting {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 44px 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 0;
}
.mid-waiting > .mid-waiting-kid { grid-column: 1; }
.mid-waiting > .layout-meta { grid-column: 2; min-width: 0; }
.mid-waiting .mid-round { width: 44px; height: 44px; }
.mid-waiting-kicker { font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.mid-waiting-title { font-size: 14px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mid-waiting-sub { font-size: 10.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mid-waiting .mid-more {
  position: absolute;
  right: 12px;
  top: -10px;
  margin: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(11, 9, 34, 0.9);
  border: 1px solid rgba(255, 197, 107, 0.5);
  font-size: 9.5px;
}
.mid-tonight-head { margin-top: 2px; }
.mid-tonight-rows { margin-top: 14px; }
.midnight-tv .mid-tonight-station { height: 190px; margin-bottom: 2px; }
.midnight-tv .mid-station-clock { font-size: 150px; }
.midnight-tv .mid-station-body { gap: 18px; }
.midnight-tv .mid-tubes-station { gap: 16px; }
.midnight-tv .mid-orb-panel { gap: 10px; }

/* M8.2 final: orb grid, waiting buttons, hyphenation, beads */
.mid-orb-panel {
  display: grid !important;
  grid-template-rows: auto minmax(64px, 1fr) 32px auto;
  gap: 10px;
  overflow: hidden;
}
.mid-orb-panel > .mid-orb-row { grid-row: 1; }
.mid-orb-panel > .mid-chat { grid-row: 2; min-height: 0; max-height: none; overflow: hidden; }
.mid-orb-panel > .mid-wave { grid-row: 3; height: 32px; align-self: stretch; }
.mid-orb-panel > .mid-orb-actions { grid-row: 4; margin: 0; }
.midnight-tv .mid-orb-panel { grid-template-rows: auto minmax(58px, 1fr) 26px auto; }
.mid-chat { max-height: none !important; }
.mid-bubble { max-height: 100% !important; overflow: hidden; }
.mid-wave { position: relative; z-index: 1; }

.mid-waiting {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 12px;
  flex-wrap: nowrap !important;
  overflow: visible;
}
.mid-waiting > .mid-waiting-kid { grid-column: 1; }
.mid-waiting > .layout-meta { grid-column: 2; min-width: 0; }
.mid-waiting-actions { grid-column: 3; display: flex; gap: 6px; flex: none; }
.mid-waiting .mid-round { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.mid-waiting .mid-more {
  position: absolute;
  right: 10px;
  top: -13px;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(11, 9, 34, 0.95);
  border: 1px solid rgba(255, 197, 107, 0.55);
  font-size: 9.5px;
  line-height: 1.4;
  z-index: 2;
}
.mid-bead-title, .mid-tube-next, .mid-waiting-title, .mid-bead-sub {
  hyphens: none !important;
  -webkit-hyphens: none !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  word-wrap: normal !important;
}
.mid-bead { width: 200px; }
.midnight-tv .mid-bead { width: 240px; }
.mid-bead-title { -webkit-line-clamp: 2; }

/* M8.2 final fixes: TV chat, phone buttons, chores tubes */
.midnight-tv .mid-chat { display: flex !important; flex-direction: column; gap: 8px; max-height: 150px; overflow: hidden; }
.midnight-tv .mid-bubble { display: block !important; -webkit-line-clamp: none !important; flex: none; position: relative; margin: 0; max-height: 62px; overflow: hidden; line-height: 1.3; }
.mid-waiting { min-height: 86px; overflow: visible !important; padding: 12px 14px !important; }
.mid-waiting-actions { display: flex !important; align-items: center; justify-content: flex-end; gap: 6px; height: 44px; flex: none; }
.mid-waiting-actions .mid-round {
  width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important;
  flex: 0 0 44px !important; border-radius: 50% !important; align-self: center; display: grid; place-items: center;
}
.mid-waiting > .layout-meta { max-height: 58px; overflow: hidden; }
.chores-tubes { margin-bottom: 16px; }
.chores-tubes .mid-tubes { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* M8.2 final: waiting-card actions group must own the action columns */
.mid-waiting { grid-template-columns: 38px minmax(0, 1fr) auto; }
.mid-waiting-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}
.mid-waiting .mid-waiting-actions .mid-round {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
}
.mid-waiting .mid-more { grid-column: 1 / -1; justify-self: end; }

/* M8.2 final: the "+N more" pill must stay compact above the card, never stretch */
.mid-waiting .mid-more {
  position: absolute !important;
  top: -15px !important;
  right: 10px !important;
  bottom: auto !important;
  grid-column: auto !important;
  height: auto !important;
  min-height: 0 !important;
  width: auto !important;
  line-height: 1 !important;
  padding: 4px 10px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* M8.3 class fixes */
.mid-chat { display: flex !important; flex-direction: column !important; gap: 8px !important; align-items: stretch; }
.mid-chat .mid-bubble { position: relative !important; flex: none !important; margin: 0 !important; }
.mid-bubble-user { align-self: flex-end; }
.mid-bubble-orb { align-self: flex-start; }
.mid-earlier-label { font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--warn); }
.mid-tonight-row.is-earlier { border-color: rgba(255, 165, 58, 0.45); background: rgba(255, 165, 58, 0.1); }
.mid-tonight-row.is-earlier::before { background: var(--warn); box-shadow: 0 0 12px var(--warn); }
.mid-tonight-phone .mid-earlier-label { margin: 0 0 6px -30px; }
.mid-tonight-station { padding-top: 34px; }
.mid-earlier-station { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; z-index: 3; }
.mid-earlier-chip { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 750; color: var(--amber); background: rgba(255, 165, 58, 0.14); border: 1px solid rgba(255, 165, 58, 0.45); }
.mid-tubes-station .mid-crown { font-size: 24px; }
.mid-tubes-phone .mid-crown { font-size: 18px; }
.mid-crown-label { top: 128px; }
.mid-tubes-phone .mid-crown-label { top: 118px; font-size: 9px; }

/* M8.3 round 2 */
.mid-earlier-station {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}
.mid-earlier-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 26px; overflow: hidden; }
.mid-earlier-label { display: block; flex: none; }
.mid-tonight-station { padding-top: 58px; height: 232px; }
.mid-bead.is-high { top: 62px; }
.mid-bead.is-low { top: 158px; }
.midnight-tv .mid-tonight-station { height: 214px; padding-top: 52px; }
.midnight-tv .mid-bead.is-high { top: 54px; }
.midnight-tv .mid-bead.is-low { top: 142px; }

.mid-earlier-more {
  display: inline-flex;
  align-self: flex-start;
  margin: 2px 0 6px -30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 165, 58, 0.16);
  border: 1px solid rgba(255, 165, 58, 0.5);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

/* Tubes: stronger liquid gradient, readable wave, bigger crowns */
.mid-tube-liquid {
  background: linear-gradient(180deg, color-mix(in srgb, var(--member-light) 92%, #ffffff) 0%, var(--member-light) 18%, var(--member-color) 62%, color-mix(in srgb, var(--member-color) 70%, #120a2e) 100%) !important;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.22);
}
.mid-tube-wave {
  height: 22px;
  margin-bottom: -11px;
  filter: drop-shadow(0 2px 5px rgba(255, 255, 255, 0.45));
}
.mid-tube-wave path { stroke: rgba(255, 255, 255, 0.65); stroke-width: 1.2; }
.mid-crown { font-size: 24px !important; line-height: 1; }
.mid-tubes-phone .mid-crown { font-size: 18px !important; }
.mid-tubes-station .mid-crown { font-size: 24px !important; }
.midnight-tv .mid-tubes-station .mid-crown { font-size: 28px !important; }
.mid-tube-bubble { z-index: 3; box-shadow: 0 0 6px rgba(255, 255, 255, 0.5); }

/* M8.3 final: compact earlier rows so the NOW marker stays visible */
.mid-tonight-row.is-earlier { padding: 6px 10px; gap: 8px; }
.mid-tonight-row.is-earlier .mid-tonight-time { width: 46px; font-size: 12px; }
.mid-tonight-row.is-earlier .mid-tonight-title { font-size: 14px; }
.mid-tonight-row.is-earlier .mid-tonight-sub { display: none; }
.mid-earlier-label { margin-top: 2px; margin-bottom: 2px; }
/* M12 meals + grocery aisles */
.mid-dinner { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid var(--glass-edge); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.mid-dinner-emoji { font-size: 24px; }
.mid-dinner-label { display: block; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.mid-dinner-title { display: block; font-size: 15px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mid-dinner-action { font-size: 12px; font-weight: 800; color: var(--accent-strong); }
.aisle-head { margin: 12px 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.aisle-head:first-child { margin-top: 0; }
.midnight-tv .mid-dinner-title { font-size: 22px; }
/* M12 bead geometry via layoutBeads */
.mid-tonight-station { height: 310px; padding-top: 0; overflow: visible; margin-bottom: 12px; }
.midnight-tv .mid-tonight-station { height: 286px; padding-top: 0; }
.mid-earlier-station { top: 0; }
.mid-bead.is-high, .mid-bead.is-low { top: auto; }
/* M12 dinner line on Week/Calendar */
.cal-dinners {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(112px, 1fr));
  min-width: 832px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 45%, var(--surface));
}
.cal-dinner-cell { min-height: 30px; justify-content: center; }
.cal-dinner {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 3px 7px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-dinner.is-empty { color: var(--ink-3); border-style: dashed; background: transparent; }
/* M13 countdowns, dinner question, wins */
.mid-countdowns { display: flex; gap: 8px; flex-wrap: wrap; }
.mid-countdown { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid var(--glass-edge); color: var(--ink); font-size: 12.5px; font-weight: 750; outline-offset: 3px; }
.mid-countdown:focus-visible { outline: 3px solid var(--accent); }
.mid-dinner-question { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 20px; background: rgba(95,227,255,.1); border: 1px solid rgba(95,227,255,.4); color: var(--ink); }
.mid-dinner-question-kicker { font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-strong); white-space: nowrap; }
.mid-dinner-question-text { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; }
.mid-dinner-question-close { width: 34px; height: 34px; min-width: 34px; min-height: 34px; border-radius: 50%; border: 1px solid var(--glass-edge); background: rgba(255,255,255,.1); color: var(--ink); display: grid; place-items: center; }
.mid-wins-overlay { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 5vw; background: rgba(11,9,34,.88); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); color: var(--ink); }
.mid-wins-head { display: flex; align-items: center; justify-content: space-between; width: min(1000px, 90vw); }
.mid-wins-kicker { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); }
.mid-wins-close { width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 50%; border: 1px solid var(--glass-edge); background: rgba(255,255,255,.12); color: var(--ink); display: grid; place-items: center; }
.mid-wins-title { margin: 0; width: min(1000px, 90vw); font-family: var(--font-display); font-size: clamp(30px, 4vw, 56px); letter-spacing: -.03em; }
.mid-wins-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; width: min(1000px, 90vw); }
.mid-wins-person { padding: 14px 16px; border-radius: 22px; background: rgba(255,255,255,.08); border: 1px solid color-mix(in srgb, var(--member-color) 50%, var(--glass-edge)); }
.mid-wins-name { font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.mid-wins-stats { margin-top: 2px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.mid-wins-highlight { margin-top: 8px; font-size: 14px; font-weight: 650; }
.mid-wins-hint { margin: 0; font-size: 14px; color: var(--ink-2); }
.mid-wins-trigger { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--glass-edge); background: rgba(255,255,255,.1); color: var(--ink); font-size: 13px; font-weight: 800; }
.midnight-tv .mid-countdown { font-size: 22px; padding: 8px 16px; }
.midnight-tv .mid-dinner-question-text { font-size: 26px; }
.midnight-tv .mid-wins-title { font-size: 64px; }
.midnight-tv .mid-wins-name { font-size: 32px; }
.midnight-tv .mid-wins-stats { font-size: 20px; }
.mid-vote:focus-visible, .mid-wins-close:focus-visible, .mid-dinner-question-close:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
/* M14 routines + practice */
.routine-card { gap: 8px; display: flex; flex-direction: column; }
.routine-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.routine-head.routine-streak { flex-wrap: wrap; }
.routine-card > .routine-streak { align-self: flex-start; }
.routine-title { font-size: 16px; font-weight: 800; }
.routine-step { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 2px; font-size: 14px; font-weight: 600; }
.routine-step input { width: 22px; height: 22px; min-width: 22px; accent-color: var(--accent); }
.routine-step input:checked + span { color: var(--ink-3); text-decoration: line-through; }
.practice-card .row .input { min-width: 0; }
.mid-routine-mini { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid var(--glass-edge); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.midnight-tv .mid-routine-mini { font-size: 28px; }
.homework-summary { margin: 0 0 8px; }

/* M15 house: weather card/line, announcements, upkeep, drivers, school feeds */
/* --- weather (Today phone card; station/TV use the header line) --- */
.mid-weather {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-edge);
  color: var(--ink);
}
.mid-weather-emoji { font-size: 28px; line-height: 1; flex: none; }
.mid-weather-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mid-weather-temp-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mid-weather-temp { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.mid-weather-cond { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.mid-weather-details { font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.mid-weather-alert { font-size: 12.5px; font-weight: 750; color: var(--amber); text-align: right; max-width: 44%; }
.mid-weather-stale { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.midnight-tv .mid-weather-temp { font-size: 34px; }
.midnight-tv .mid-weather-cond,
.midnight-tv .mid-weather-details { font-size: 22px; }

/* --- announcements: phone inline; station/TV float over the top band --- */
.mid-announce {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 12%, rgba(255, 255, 255, 0.08));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--glass-edge));
  color: var(--ink);
}
.mid-announce-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.mid-announce-text { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 750; }
.mid-announce-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}
.mid-announce-station,
.mid-announce-tv {
  position: fixed;
  z-index: 75;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, calc(100vw - 48px));
  animation: tv-banner-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mid-announce-station .mid-announce-text { font-size: 20px; }
.mid-announce-tv {
  top: 30px;
  width: min(1240px, calc(100vw - 88px));
  padding: 16px 26px;
  border-radius: 999px;
}
.midnight-tv .mid-announce-text { font-size: 30px; }
.mid-announce-close:focus-visible,
.mid-upkeep-add:focus-visible,
button.mid-upkeep-row:focus-visible,
.cal-upkeep:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .mid-announce-station,
  .mid-announce-tv { animation: none; }
}
.tv-lite .mid-announce-station,
.tv-lite .mid-announce-tv { animation: none; }

/* --- upkeep (Today card + calendar row) --- */
.mid-upkeep {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-edge);
  color: var(--ink);
}
.mid-upkeep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mid-upkeep-title { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.mid-upkeep-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.mid-upkeep-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.mid-upkeep-emoji { font-size: 20px; flex: none; }
.mid-upkeep-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.mid-upkeep-name { font-size: 14.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mid-upkeep-note { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mid-upkeep-who { font-size: 12px; font-weight: 700; color: var(--ink-2); flex: none; }
.midnight-tv .mid-upkeep-name { font-size: 22px; }
.cal-upkeep-row {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(112px, 1fr));
  min-width: 832px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 45%, var(--surface));
}
.cal-upkeep-cell { min-height: 30px; justify-content: center; flex-direction: column; gap: 2px; }
.cal-upkeep {
  display: block;
  width: 100%;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--amber) 34%, transparent);
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- drivers on calendar events + the event sheet --- */
.cal-event-source {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event-driver {
  display: block;
  font-size: 10.5px;
  font-weight: 750;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event.is-school { border-style: dashed; }
.event-driver {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.event-driver.is-needed {
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--amber) 34%, transparent);
}
.event-driver-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.event-driver-name { font-size: 14px; font-weight: 750; color: var(--ink); }
.pill-school {
  background: rgba(95, 227, 255, 0.14);
  border-color: rgba(95, 227, 255, 0.4);
  color: var(--accent-strong);
}

/* --- Settings → Calendar: school ICS feeds --- */
.input-small { width: 84px; min-width: 84px; }
.school-cal-list { display: flex; flex-direction: column; }
.school-cal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.school-cal-main { min-width: 0; flex: 1; }
.school-cal-label { font-size: 14px; font-weight: 750; color: var(--ink); }
.school-cal-url { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.school-cal-none { margin: 0; padding: 8px 0 4px; }
.school-cal-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
/* M16 live vision + timers */
.live-overlay { position: fixed; inset: 0; z-index: 90; display: flex; gap: 18px; padding: 24px; background: rgba(11,9,34,.92); color: var(--ink); }
.live-frame { position: relative; flex: 1; min-width: 0; border-radius: 28px; overflow: hidden; background: #05030f; display: flex; flex-direction: column; }
.live-video { flex: 1; width: 100%; min-height: 0; object-fit: cover; }
.live-pill { position: absolute; left: 16px; top: 16px; padding: 6px 12px; border-radius: 999px; background: #ff2d55; color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 0 18px rgba(255,45,85,.6); }
.live-status { margin: 0; padding: 10px 14px; font-size: 13px; font-weight: 650; color: var(--ink-2); background: rgba(11,9,34,.7); }
.live-controls { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 10px; }
.live-close { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-edge); background: rgba(255,255,255,.14); color: var(--ink); display: grid; place-items: center; }
.live-side { width: 340px; flex: none; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.live-title { margin: 0; font-family: var(--font-display); font-size: 28px; }
.live-hint { margin: 0; color: var(--ink-2); font-size: 13px; }
.live-recipe, .live-timer { padding: 12px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid var(--glass-edge); }
.live-recipe-title { font-weight: 800; }
.live-step-count { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--accent-strong); }
.live-step-text { margin: 6px 0; font-size: 15px; font-weight: 650; }
.live-step-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mid-timers { display: flex; gap: 8px; flex-wrap: wrap; }
.mid-timer { padding: 6px 12px; border-radius: 999px; background: rgba(95,227,255,.12); border: 1px solid rgba(95,227,255,.4); color: var(--accent-strong); font-size: 12px; font-weight: 800; }
@media (max-width: 760px) { .live-overlay { flex-direction: column; padding: 12px; } .live-side { width: auto; max-height: 45vh; } }

/* ==========================================================================
   M17 — family vote + emergency card (Midnight glass)
   ========================================================================== */

/* --- Votes screen --- */
.vote-empty { margin-top: 12px; }
.vote-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-card);
  color: var(--ink);
}
.vote-card.is-closed { opacity: 0.92; }
.vote-card.is-highlight { outline: 3px solid var(--accent); outline-offset: 3px; }
.vote-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vote-card-copy { min-width: 0; }
.vote-title { margin: 0; font-family: var(--font-display); font-size: clamp(20px, 3vw, 26px); font-weight: 800; letter-spacing: -0.02em; }
.vote-meta { margin: 4px 0 0; font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.vote-pill-closed { background: rgba(255, 255, 255, 0.1); border-color: var(--glass-edge); color: var(--ink-2); }
.vote-options { display: flex; flex-direction: column; gap: 8px; }
.vote-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  isolation: isolate;
}
.vote-option:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.vote-option:not(:disabled):active { transform: scale(0.995); }
.vote-option:disabled { cursor: default; }
.vote-option-fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.vote-option-label { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-option-meta { font-size: 13px; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.vote-option-own { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); white-space: nowrap; }
.vote-option-crown { font-size: 18px; line-height: 1; }
.vote-option.is-own { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 10%, rgba(255, 255, 255, 0.06)); }
.vote-option.is-winner { border-color: color-mix(in srgb, var(--amber) 65%, transparent); }
.vote-option.is-winner .vote-option-fill { background: color-mix(in srgb, var(--amber) 22%, transparent); }
.vote-status { min-height: 20px; }
.vote-open-note { margin: 0; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.vote-winner-line { margin: 0; font-size: 16px; font-weight: 800; }
.vote-winner-line.is-none { color: var(--ink-2); font-weight: 700; }
.vote-winner-line.is-pending { color: var(--amber); }
.vote-closed-note { margin: 3px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.vote-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vote-draft-options { display: flex; flex-direction: column; gap: 8px; }
.vote-draft-row { display: flex; align-items: center; gap: 6px; }
.vote-draft-row .input { min-width: 0; flex: 1; }

/* --- station/TV vote card + winner overlay --- */
.mid-vote {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 20px;
  color: var(--ink);
}
.mid-vote-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-strong); }
.mid-vote-title { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.mid-vote-meta { font-size: 12px; font-weight: 650; color: var(--ink-3); }
.mid-vote-bars { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.mid-vote-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  isolation: isolate;
}
.mid-vote-fill { position: absolute; inset: 0 auto 0 0; z-index: -1; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.mid-vote-label { font-size: 13.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mid-vote-count { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.mid-vote-hint { margin: 2px 0 0; font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.mid-vote-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mid-vote-own { font-size: 12px; font-weight: 750; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mid-vote-own.is-todo { color: var(--amber); }
.mid-vote-station,
.mid-vote-tv { flex-direction: row; align-items: center; gap: 14px; padding: 10px 18px; }
.mid-vote-station .mid-vote-kicker,
.mid-vote-tv .mid-vote-kicker { flex: none; }
.mid-vote-station .mid-vote-title,
.mid-vote-tv .mid-vote-title { flex: none; max-width: 28%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mid-vote-station .mid-vote-bars,
.mid-vote-tv .mid-vote-bars { flex: 1; flex-direction: row; flex-wrap: wrap; gap: 6px; margin: 0; }
.mid-vote-station .mid-vote-bar,
.mid-vote-tv .mid-vote-bar { min-width: 0; flex: 0 1 auto; padding: 4px 10px; }
.mid-vote-station .mid-vote-hint,
.mid-vote-tv .mid-vote-hint { flex: none; margin: 0; white-space: nowrap; }
.mid-vote-tv .mid-vote-title { font-size: 26px; }
.mid-vote-tv .mid-vote-kicker { font-size: 16px; }
.mid-vote-tv .mid-vote-meta { font-size: 20px; }
.mid-vote-tv .mid-vote-label,
.mid-vote-tv .mid-vote-count { font-size: 22px; }
.mid-vote-tv .mid-vote-hint { font-size: 18px; }
.mid-vote-winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 5vw;
  background: rgba(11, 9, 34, 0.9);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  color: var(--ink);
  animation: tv-banner-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mid-vote-winner-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(1000px, 90vw); }
.mid-vote-winner-kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-strong); }
.mid-vote-winner-title { margin: 4px 0 0; font-family: var(--font-display); font-size: clamp(30px, 4vw, 56px); font-weight: 800; letter-spacing: -0.03em; }
.mid-vote-winner-line { margin: 0; width: min(1000px, 90vw); font-size: 22px; font-weight: 800; }
.mid-vote-winner-hint { margin: 0; font-size: 14px; font-weight: 650; color: var(--ink-2); }
.mid-vote-winner-close {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}
.mid-vote-winner-close:focus-visible,
.mid-emergency-close:focus-visible,
.mid-emergency-trigger:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
.midnight-tv .mid-vote-winner-title { font-size: 64px; }
.midnight-tv .mid-vote-winner-line { font-size: 32px; }
.midnight-tv .mid-vote-winner-hint { font-size: 22px; }
@media (prefers-reduced-motion: reduce) {
  .mid-vote-winner-overlay { animation: none; }
  .vote-option-fill { transition: none; }
}

/* --- emergency card app screen --- */
.emergency-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 24px auto 0;
  padding: 32px 24px;
  border-radius: var(--radius-card);
  text-align: center;
}
.emergency-gate-emoji { font-size: 46px; line-height: 1; }
.emergency-gate-title { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.emergency-gate-copy { margin: 0; max-width: 46ch; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink-2); }
.emergency-content { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.emergency-section {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-edge);
  color: var(--ink);
}
.emergency-allergies { border-color: color-mix(in srgb, var(--amber) 45%, var(--glass-edge)); background: color-mix(in srgb, var(--amber) 9%, rgba(255, 255, 255, 0.06)); }
.emergency-heading { margin: 0 0 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3); }
.emergency-allergy-text { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.35; }
.emergency-list { display: flex; flex-direction: column; gap: 10px; }
.emergency-person { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; }
.emergency-person-name { grid-column: 1; font-size: 15px; font-weight: 750; }
.emergency-person-phone { grid-column: 2; grid-row: 1; font-size: 14px; font-weight: 800; color: var(--accent-strong); white-space: nowrap; }
.emergency-person-note { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.emergency-rows { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.emergency-rows dt { font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.emergency-rows dd { margin: 0; font-size: 14px; font-weight: 650; }
.emergency-none { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.emergency-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--ink-2); }
.emergency-empty-emoji { font-size: 34px; }
.emergency-footnote { margin: 2px 0 0; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.emergency-editor-list { display: flex; flex-direction: column; gap: 6px; }
.emergency-editor-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr 44px; gap: 6px; align-items: center; }
.emergency-editor-row .input { min-width: 0; }
.emergency-insurance-grid { gap: 6px; }

/* --- emergency reveal overlay on station/TV --- */
.mid-emergency-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.mid-emergency-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px 5vw;
  background: rgba(11, 9, 34, 0.94);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  color: var(--ink);
  animation: tv-banner-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mid-emergency-head { display: flex; align-items: center; gap: 14px; width: min(1100px, 92vw); margin: 0 auto; }
.mid-emergency-kicker { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.mid-emergency-hint { flex: 1; min-width: 0; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.mid-emergency-close {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}
.mid-emergency-body { width: min(1100px, 92vw); margin: 0 auto; overflow-y: auto; flex: 1; }
.mid-emergency-loading { font-size: 15px; font-weight: 650; color: var(--ink-2); }
.mid-emergency-tv .emergency-section { padding: 22px 26px; border-radius: 24px; }
.mid-emergency-tv .emergency-content { gap: 16px; margin-top: 0; }
.mid-emergency-tv .emergency-heading { font-size: 16px; }
.mid-emergency-tv .emergency-allergy-text { font-size: 36px; }
.mid-emergency-tv .emergency-person-name { font-size: 28px; }
.mid-emergency-tv .emergency-person-phone { font-size: 26px; }
.mid-emergency-tv .emergency-person-note { font-size: 20px; }
.mid-emergency-tv .emergency-rows dt { font-size: 16px; }
.mid-emergency-tv .emergency-rows dd { font-size: 26px; }
.mid-emergency-tv .emergency-footnote { font-size: 18px; }
.mid-emergency-tv .mid-emergency-kicker { font-size: 40px; }
@media (prefers-reduced-motion: reduce) {
  .mid-emergency-overlay { animation: none; }
}
.tv-lite .mid-emergency-overlay,
.tv-lite .mid-vote-winner-overlay { animation: none; }
@media (max-width: 560px) {
  .emergency-editor-row { grid-template-columns: 1fr 1fr; }
  .emergency-editor-row .input:last-of-type { grid-column: 1 / -1; }
}

/* ==========================================================================
   M19 — capture → calendar / imports queue (Midnight glass)
   ========================================================================== */

.imports-gate { margin-top: 12px; }
.imports-empty { margin-top: 12px; }
.imports-section { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.imports-heading {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.imports-note { margin: 12px 0 0; }
.imports-tip { margin-top: 18px; }
.mid-greeting-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* --- import cards (queue + saved) --- */
.import-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  color: var(--ink);
}
.import-card.is-review { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-edge)); }
.import-card.is-highlight { outline: 3px solid var(--accent); outline-offset: 3px; }
.import-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.import-card-copy { min-width: 0; }
.import-source {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.import-title { margin: 4px 0 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.import-meta { margin: 4px 0 0; font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.import-preview {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.import-warning { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--amber); }
.import-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imports-approve-card { margin-bottom: 12px; }
.imports-approve-card .icon { color: var(--accent-strong); }

/* --- saved rows + summary undo --- */
.import-items { display: flex; flex-direction: column; gap: 4px; }
.import-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--ink);
}
.import-item.is-undone { opacity: 0.6; }
.import-item-kind { flex: none; font-size: 16px; }
.import-item-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-item-date { flex: none; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.import-item-state { flex: none; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.import-summary-head { display: flex; align-items: center; gap: 10px; }
.import-summary-emoji { font-size: 30px; line-height: 1; }
.import-summary-title { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.import-summary-list { display: flex; flex-direction: column; gap: 4px; }
.import-warning-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}
.import-warning-block p { margin: 0; }

/* --- capture sheet --- */
.import-capture { gap: 12px; }
.import-source-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.import-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--glass-edge);
  background: rgba(255, 255, 255, 0.05);
}
.import-preview-image {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 12px;
  object-fit: contain;
}
.import-pdf-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 750; }
.import-file-meta { margin: 0; }
.import-privacy {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
}

/* --- review sheet --- */
.import-review { gap: 14px; }
.import-review-section { display: flex; flex-direction: column; gap: 8px; }
.import-review-list { display: flex; flex-direction: column; gap: 8px; }
.import-review-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-edge);
}
.import-review-row.is-skipped { opacity: 0.55; }
.import-review-head { display: flex; align-items: center; gap: 10px; }
.import-review-head .input { flex: 1; min-width: 0; }
.import-tick { width: 24px; height: 24px; min-width: 24px; accent-color: var(--accent); }
.import-review-grid { display: grid; grid-template-columns: 1.1fr auto 1fr; gap: 8px; align-items: center; }
.import-review-grid.two { grid-template-columns: 1fr 1fr; }
.import-allday { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.import-allday input { width: 20px; height: 20px; accent-color: var(--accent); }
.import-times { display: flex; align-items: center; gap: 6px; }
.import-times .input { min-width: 0; }
.import-time-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.import-recurrence { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 750; color: var(--accent-strong); }
.import-ingredients { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.import-meal-emoji { font-size: 22px; text-align: center; }
.import-person { min-width: 0; }
.import-review-row:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--glass-edge)); }
.import-review input:focus-visible,
.import-review select:focus-visible,
.import-tick:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- settings: inbound email --- */
.inbound-address { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbound-explainer { margin: 0; padding: 4px 0 8px; }
.inbound-senders { display: flex; flex-direction: column; }
.inbound-sender { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.inbound-sender-main { min-width: 0; flex: 1; }
.inbound-sender-email { font-size: 14px; font-weight: 750; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbound-sender-meta { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.inbound-auto { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.inbound-auto-label { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.inbound-auto .switch:disabled { opacity: 0.45; }
.inbound-none { margin: 0; padding: 6px 0; }
.inbound-add { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  .import-review-grid,
  .import-review-grid.two { grid-template-columns: 1fr 1fr; }
  .import-times { grid-column: 1 / -1; }
  .import-item-date { display: none; }
  .inbound-sender { flex-wrap: wrap; }
}

/* M21: ambient display uses opacity only; no extra backdrop blur on the TV. */
.midnight.is-dimmed { filter: brightness(.58); }
.midnight.is-slideshow { min-height: 90vh; }
.midnight.is-slideshow > :not(.ambient-slideshow):not(.mid-waiting) { visibility: hidden; }
.midnight.is-slideshow > .mid-waiting { position: relative; z-index: 7; }
.ambient-slideshow { position: fixed; inset: 0; z-index: 5; overflow: hidden; background: radial-gradient(ellipse at 25% 20%, #442171, #16113a 60%, #0b0922); }
.ambient-photo { position: absolute; width: 100%; height: 100%; object-fit: contain; animation: ambient-fade 1.2s ease both; }
.ambient-preload { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ambient-caption { position: absolute; bottom: 8%; left: 8%; right: 8%; font-size: clamp(28px, 3vw, 48px); color: #f5f2ff; text-shadow: 0 2px 8px #000; }
.ambient-wake { position: absolute; top: 5%; right: 5%; z-index: 8; min-height: 48px; padding: 12px 20px; border-radius: 22px; background: #16113a; color: #f5f2ff; border: 1px solid #7fe7ff; font: inherit; }
.ambient-wake:focus-visible { outline: 3px solid #5fe3ff; outline-offset: 4px; }
.sticky-board { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.sticky-note { flex: 1 1 220px; border-left: 4px solid var(--member-color); padding: 14px; border-radius: 20px; }
.sticky-yellow { background: rgba(255,197,107,.13); }
.sticky-pink { background: rgba(255,59,149,.13); }
.sticky-blue { background: rgba(95,227,255,.13); }
.sticky-green { background: rgba(98,216,166,.13); }
.sticky-text { margin: 0 0 8px; overflow-wrap: anywhere; color: #f5f2ff; }
.sticky-author { color: #c9c2ea; }
.midnight-tv .sticky-note, .midnight-tv .sticky-note .btn, .midnight-tv .ambient-wake { font-size: 28px; }
.ambient-photo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ambient-photo-row .input { flex: 1 1 180px; }
@keyframes ambient-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ambient-photo { animation: none; } }
@media (prefers-contrast: more) { .midnight.is-dimmed { filter: none; } .sticky-note { background: #16113a; border: 2px solid #f5f2ff; } }
@media (prefers-reduced-transparency: reduce) { .sticky-note { background: #16113a; } }

.midnight.is-private .mid-tonight { border-color: #7fe7ff; }
.ambient-photo-out { animation-name: ambient-fade-out; }
@keyframes ambient-fade-out { from { opacity: 1; } to { opacity: 0; } }

.ambient-photo-out { opacity: 0; }
.ambient-caption { padding: 12px 20px; border-radius: 16px; background: rgba(11,9,34,.85); }
.ambient-thumbnail, .ambient-thumbnail-placeholder { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.ambient-thumbnail-placeholder { display: grid; place-items: center; background: #442171; color: #f5f2ff; }

/* Notes use the orb panel's existing glass, keeping one blur layer. */
.mid-orb-panel > .sticky-board { grid-row: 2; min-height: 0; overflow: auto; margin: 0; align-content: start; }
.midnight-station { height: 100dvh; gap: 16px; }
.midnight-station .mid-tonight-station { flex: 0 0 290px; height: 290px; }
.midnight-station .mid-tubes-station .mid-tube { height: 100%; min-height: 0; }
.midnight-station > .mid-waiting { position: absolute; bottom: 4%; left: 48px; width: min(600px, 58%); z-index: 7; }
.midnight-tv > .mid-waiting .mid-waiting-title, .midnight-tv > .mid-waiting .mid-waiting-sub { font-size: 28px; }
.midnight-tv > .mid-waiting { width: min(860px, 65%); }
.midnight:not(.is-slideshow) > .ambient-wake { top: auto; bottom: 5%; right: 5%; }

.mid-orb-panel > .mid-orb-content { grid-row: 2; min-height: 0; overflow: auto; }
.mid-orb-content .sticky-board { margin: 0; }
.mid-orb-content .mid-routine-mini { margin-bottom: 10px; }
.midnight-tv > .mid-waiting > .layout-meta { max-height: none; }
.midnight.is-slideshow > .mid-waiting { position: absolute; top: 5%; bottom: auto; left: 5%; }

/* M22 meals and recipe library: Midnight glass, readable quantities, 44px controls. */
.meal-actions { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:20px; }
.meal-week, .recipe-library { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:16px; margin-top:18px; }
.meal-day, .recipe-card { padding:20px; min-width:0; }
.meal-date { color:var(--text-secondary); margin:0 0 10px; font-size:14px; }
.meal-day .section-title { line-height:1.3; overflow-wrap:anywhere; }
.servings-stepper { display:flex; align-items:center; gap:12px; margin:14px 0; }
.servings-stepper .btn { min-width:44px; min-height:44px; }
.recipe-ingredients, .recipe-steps { padding-left:22px; line-height:1.7; overflow-wrap:anywhere; }
.recipe-card { display:flex; flex-direction:column; text-align:left; gap:10px; cursor:pointer; color:inherit; }
.recipe-card-icon { font-size:28px; }
.recipe-edit-row { display:grid; grid-template-columns:2fr 1fr 1fr; gap:8px; }
.recipe-edit-row .input { min-width:0; }
.recipe-edit-row .btn { grid-column:3; }
.store-head { color:var(--accent); font-size:18px; margin:18px 0 8px; }
.store-filter { margin:12px 16px; max-width:calc(100% - 32px); }
.recipe-ingredient { padding:8px 0; border-bottom:1px solid var(--border); }
.food-chip { min-height:44px; }
@media (max-width:480px) { .recipe-edit-row { grid-template-columns:1fr 1fr; } .recipe-edit-row > :first-child { grid-column:1 / -1; } .recipe-edit-row .btn { grid-column:2; } .meal-day { padding:16px; } }

/* M23: calendar reminders and family ledger controls in the Midnight shell. */
.mid-logistics { border-color: color-mix(in srgb, var(--logistics-color, var(--accent)) 45%, var(--line)); background: linear-gradient(120deg, var(--accent-soft), transparent), var(--surface); }
.logistics-row, .birthday-line { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; overflow-wrap: anywhere; }
.logistics-row + .logistics-row { border-top: 1px solid var(--line); }
.logistics-row .grow { min-width: 0; }
.birthday-line { color: var(--ink); }
.birthday-settings { padding: 18px; border-top: 1px solid var(--line); }
.logistics-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.logistics-fields > * { min-width: 0; }
.logistics-check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.logistics-check input { width: 22px; height: 22px; accent-color: var(--accent); }
.allowance-schedule { border-top: 1px solid var(--line); padding-top: 18px; }
.share-settings .setting-row { flex-wrap: wrap; }
.share-settings input[readonly] { width: 100%; }
.interest-row { color: var(--ink); }
.midnight-station .mid-logistics, .midnight-tv .mid-logistics { font-size: clamp(18px, 1.4vw, 26px); }
.midnight-station .mid-logistics .mini-title, .midnight-tv .mid-logistics .mini-title { font-size: inherit; }
@media (max-width: 480px) { .birthday-settings .setting-row { flex-wrap: wrap; } }
@media (min-width: 900px) {
  .midnight-station .mid-logistics, .midnight-tv .mid-logistics { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 20px; padding: 12px 18px; }
  .midnight-station .mid-logistics .mini-title, .midnight-tv .mid-logistics .mini-title { margin: 0; font-size: 16px; white-space: nowrap; }
  .midnight-station .mid-logistics .birthday-line, .midnight-tv .mid-logistics .birthday-line { white-space: nowrap; }
  .midnight-tv .mid-logistics { font-size: 28px; }
}

/* M24: family facts, personal receipts and source links use Midnight's existing surfaces. */
.memory-group { margin-block: 24px; }
.memory-card { display: flex; flex-direction: column; gap: 12px; }
.memory-text, .message-text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-inbox { padding: 20px; }
.message-row { padding: 16px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border-top: 1px solid var(--glass-border, rgba(255,255,255,.22)); }
.message-heading { display: flex; width: 100%; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.message-ack { color: #7fe7ff; margin: 0; font-weight: 600; }
.message-row.is-highlighted { outline: 2px solid #5fe3ff; outline-offset: 6px; border-radius: 8px; }
.assistant-sources { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.source-link { color: #7fe7ff; min-height: 44px; display: inline-flex; align-items: center; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; }
.source-link:focus-visible { outline: 2px solid #5fe3ff; outline-offset: 3px; border-radius: 4px; }
.lookup-settings { padding-block: 12px; border-block: 1px solid var(--glass-border, rgba(255,255,255,.22)); }
@media (prefers-contrast: more) {
  .message-ack, .source-link { color: var(--text, #fff); }
}

/* Small M24 copy keeps contrast over the bright Midnight glow. */
.memory-screen .field-hint, .memory-screen .screen-sub, .memory-editor .field-hint,
.message-inbox .field-hint, .message-inbox .inbox-time,
.lookup-settings .field-hint, .lookup-settings .setting-hint, .lookup-settings .switch-hint,
.assistant-sources .field-hint { color: var(--ink); }
