/* Everly Watch MVP — pixel-art styles
   Order: tokens · base · pixel helpers · top bar · scene · watch screen · Linda's phone ·
   phone home screen · Everly app · data screen · sections · talk · demo controls · motion

   One pixel of the room = var(--s) screen pixels (set by js/scene.js: 2, 3 or 4).
   Things that sit in the room (watch screen, button, labels, phone frame) use var(--s),
   so they stay on the same pixel grid as the art. */

/* ---------- Fonts ----------
   Pixelify Sans's 5 and 8 look almost the same, so digits come from Jersey 15
   (only 0–9 use it, thanks to unicode-range). Both are free (SIL Open Font License). */
@font-face {
  font-family: 'Everly Digits';
  src: url('fonts/jersey-15-digits.woff2') format('woff2');
  unicode-range: U+0030-0039;
  size-adjust: 118%;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --s: 3px;
  --scene-w: 908px;

  /* page + panels */
  --page: #161a27;
  --page-dot: #222a40;
  --ink: #1e2230;
  --panel: #f6f2e7;
  --panel-2: #ece5d3;
  --field: #fffdf8;
  --line: #ddd5c2;
  --text: #1e2230;
  --muted: #625f6e;
  --faint: #8f8a99;
  --on-dark: #eef0f7;
  --on-dark-muted: #9aa2bd;

  /* the penguin's colors */
  --accent: #f08a24;
  --accent-dark: #c4631a;
  --accent-soft: #ffe1bf;
  --link: #b3541a;
  --navy: #22335c;

  /* status */
  --listen: #3a78d6;
  --ok: #2e8049;
  --ok-bg: #dbeed6;
  --alert: #c4442d;
  --alert-dark: #96321f;
  --alert-bg: #fbe0d8;
  --warn: #946208;
  --warn-bg: #f7e9c2;
  --focus: #3a78d6;

  /* the watch screen is real hardware: always white */
  --screen-bg: #ffffff;
  --screen-ink: #15203a;
  --screen-muted: #6b7486;
  --screen-alert: #d23b2f;

  /* phone */
  --phone-body: #2b3352;
  --phone-light: #3f4a73;
  --phone-dark: #1c2238;
  --app-bg: #fbf9f3;

  /* Numbers use Jersey 15 (clearer 5 vs 8); everything else uses Pixelify Sans */
  --font: 'Everly Digits', 'Pixelify Sans', ui-rounded, system-ui, sans-serif;

  /* pixel outlines: a box with its corner pixels cut off */
  --ol2: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
  --ol3: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--page);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Crect width='2' height='2' fill='%23222a40'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--font);
  font-synthesis: none; /* Jersey 15 has one weight; don't fake a bold version */
  font-size: 15px;
  line-height: 1.35;
  padding: 0 16px 56px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; text-wrap: balance; font-weight: 700; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fine { font-size: 12px; color: var(--muted); }

/* ---------- Pixel helpers ---------- */
/* Arrows drawn from pixel-sized dots (box-shadow copies of one tiny square) */
.arrow {
  position: absolute;
  width: var(--ap, 3px);
  height: var(--ap, 3px);
  color: inherit;
}

/* ---------- Buttons ---------- */
.btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: var(--ol2), inset 0 -3px 0 0 var(--line);
}
.btn:hover { background: #ffffff; }
.btn:active { transform: translateY(2px); box-shadow: var(--ol2); }
.btn-primary { background: var(--accent); box-shadow: var(--ol2), inset 0 -3px 0 0 var(--accent-dark), inset 0 2px 0 0 #ffb466; }
.btn-primary:hover { background: #f69a3a; }
.btn-alert { background: var(--alert); color: #fff; box-shadow: var(--ol2), inset 0 -3px 0 0 var(--alert-dark); }
.btn-alert:hover { background: #d14e36; }
.btn-quiet { background: transparent; box-shadow: var(--ol2); }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.link-btn {
  border: 0;
  background: none;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--link);
}
.link-btn:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* ---------- Top bar ---------- */
.topbar {
  max-width: var(--scene-w);
  margin: 0 auto;
  padding: 14px 0 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-dark); }
.brand-penguin { width: 48px; height: 48px; image-rendering: pixelated; margin: -6px -4px -6px -6px; }
.wordmark { font-weight: 700; font-size: 28px; letter-spacing: 0.01em; line-height: 1; }
.wordmark::after { content: '.'; color: var(--accent); }
.brand-sub { color: var(--on-dark-muted); font-size: 15px; padding-top: 6px; }
.scene-controls {
  width: 100%;
  max-width: var(--scene-w);
  margin: -6px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.scene-controls-right { display: flex; align-items: center; gap: 12px; }
.scene-controls-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Demo mode bar (js/demomode.js) */
.demo-bar {
  width: 100%;
  max-width: var(--scene-w);
  margin: -12px auto 0;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  box-shadow: var(--ol3), inset 0 4px 0 0 var(--accent);
}
.demo-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; }
.demo-clock { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.demo-label { font-size: 13px; font-weight: 700; color: var(--accent-dark); }
.demo-clock b { font-size: 30px; line-height: 1; font-weight: 700; }
.demo-day { font-size: 13px; color: var(--muted); }
.demo-move { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-slider { display: flex; flex-direction: column; gap: 2px; }
.demo-slider input { width: 100%; accent-color: var(--accent); }
.demo-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.demo-note { padding: 8px 10px; font-size: 13.5px; font-weight: 600; background: #fdf1ec; box-shadow: inset 4px 0 0 0 var(--alert); }
.demo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.demo-step {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: start;
  gap: 8px;
  padding: 8px 10px 9px;
  border: 0;
  text-align: left;
  background: var(--field);
  box-shadow: var(--ol2), inset 0 -3px 0 0 var(--line);
  cursor: pointer;
}
.demo-step:hover { background: #fff; }
.demo-step-time { font-size: 12px; color: var(--muted); padding-top: 2px; }
.demo-step-text { display: flex; flex-direction: column; gap: 1px; }
.demo-step-text b { font-size: 14px; font-weight: 600; }
.demo-step-text small { font-size: 12px; color: var(--muted); }
.demo-step[data-state='next'] { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent), inset 0 -3px 0 0 var(--accent); }
.demo-step[data-state='done'] { opacity: 0.6; }
.demo-step[data-state='done'] .demo-step-text b::after { content: ' ✓'; color: var(--ok); }
.names-open .names-now { font-weight: 600; }

/* the names form (opens under the controls) */
.names-form {
  width: 100%;
  max-width: var(--scene-w);
  margin: -12px auto 0;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  background: var(--panel);
  box-shadow: var(--ol3);
}
.names-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; font-size: 13px; font-weight: 600; }
.names-field input {
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: var(--field);
  font-size: 15px;
  font-weight: 400;
  box-shadow: var(--ol2), inset 0 3px 0 0 #ece6d6;
}
.names-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* the Linda's phone on/off switch */
.px-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 14px;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--ol2), inset 0 -3px 0 0 var(--line);
}
.px-toggle:hover { background: #fffaf0; }
.px-toggle-track,
.convo-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  background: #cfc6b1;
  box-shadow: var(--ol2), inset 0 3px 0 0 #b9af97;
}
.px-toggle-knob,
.convo-track::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  background: var(--field);
  box-shadow: 0 0 0 2px var(--ink), inset 0 -2px 0 0 var(--line);
  transition: transform 0.12s steps(3);
}
.px-toggle[aria-checked='true'] .px-toggle-track { background: var(--accent); box-shadow: var(--ol2), inset 0 3px 0 0 var(--accent-dark); }
.px-toggle[aria-checked='true'] .px-toggle-knob { transform: translateX(18px); }
.px-toggle-state { min-width: 2.2em; font-size: 13px; color: var(--muted); text-align: left; }
.px-toggle[aria-checked='true'] .px-toggle-state { color: var(--ink); }
.toggle-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: var(--alert);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--ol2);
  animation: badge-pop 1s steps(2) infinite;
}
.toggle-badge[data-kind='daily'] { background: var(--navy); animation: none; }
@keyframes badge-pop { 50% { transform: translateY(-2px); } }

/* ---------- Page layout ---------- */
.stage {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* ---------- The scene (pixel room) ---------- */
.scene-card {
  width: 100%;
  max-width: var(--scene-w);
  margin: 0 auto;
  padding: 4px;
  background: #0d1019;
  box-shadow: 0 0 0 3px #39425f, 0 12px 0 3px rgba(0, 0, 0, 0.35);
}
.scene {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  background: #9fb59f;
  max-width: 100%;
}
.scene-canvas,
.scene-overlay { position: absolute; top: 0; left: 0; }
.scene-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.scene-place {
  position: absolute;
  z-index: 4;
  top: calc(var(--s) * 3);
  left: calc(var(--s) * 3);
  padding: 2px 8px 3px;
  background: rgba(30, 34, 48, 0.82);
  color: var(--on-dark);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 -2px 0 0 rgba(30, 34, 48, 0.82), 0 2px 0 0 rgba(30, 34, 48, 0.82);
  pointer-events: none;
}

/* name labels in the room, like a game's nameplates */
.tag {
  position: absolute;
  z-index: 2;
  transform: translateX(-50%);
  padding: calc(var(--s) * 0.67) calc(var(--s) * 2.67) calc(var(--s));
  background: var(--ink);
  color: var(--on-dark);
  font-size: calc(var(--s) * 4 + 1px);
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 calc(var(--s) * -1) 0 0 var(--ink), 0 var(--s) 0 0 var(--ink), 0 calc(var(--s) * 2) 0 0 rgba(30, 34, 48, 0.3);
  pointer-events: none;
}
.tag small { color: var(--on-dark-muted); font-weight: 500; font-size: 0.85em; margin-left: 4px; }

/* "Press to talk" pointer next to the watch button */
.button-hint {
  position: absolute;
  z-index: 2;
  transform: translateY(-50%);
  margin-left: calc(var(--s) * 4);
  padding: calc(var(--s) * 0.67) calc(var(--s) * 2.33) calc(var(--s));
  background: var(--accent);
  color: var(--ink);
  font-size: calc(var(--s) * 4);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 calc(var(--s) * -1) 0 0 var(--accent), 0 var(--s) 0 0 var(--accent), 0 calc(var(--s) * 2) 0 0 rgba(30, 34, 48, 0.3);
  animation: nudge-left 0.9s steps(1) infinite;
  cursor: pointer; /* clicking the label works like pressing the watch button */
}
.button-hint:hover { filter: brightness(1.06); }
.button-hint .arrow {
  --ap: var(--s);
  left: calc(var(--s) * -4);
  top: calc(50% - var(--s) * 2.5);
  color: var(--accent);
  box-shadow:
    calc(var(--s) * 2) 0 0 0 currentColor,
    var(--s) var(--s) 0 0 currentColor, calc(var(--s) * 2) var(--s) 0 0 currentColor,
    0 calc(var(--s) * 2) 0 0 currentColor, var(--s) calc(var(--s) * 2) 0 0 currentColor, calc(var(--s) * 2) calc(var(--s) * 2) 0 0 currentColor,
    var(--s) calc(var(--s) * 3) 0 0 currentColor, calc(var(--s) * 2) calc(var(--s) * 3) 0 0 currentColor,
    calc(var(--s) * 2) calc(var(--s) * 4) 0 0 currentColor;
}
@keyframes nudge-left { 50% { translate: calc(var(--s) * -1) 0; } }
/* when Linda's phone covers the right side, the pointer sits under the button instead */
.button-hint.below {
  transform: translateX(-50%);
  margin: calc(var(--s) * 4) 0 0;
  white-space: normal;
  width: min-content;
  text-align: center;
  line-height: 1.05;
  animation-name: nudge-up;
}
.button-hint.below .arrow {
  left: calc(50% - var(--s) * 2.5);
  top: calc(var(--s) * -4);
  box-shadow:
    calc(var(--s) * 2) 0 0 0 currentColor,
    var(--s) var(--s) 0 0 currentColor, calc(var(--s) * 2) var(--s) 0 0 currentColor, calc(var(--s) * 3) var(--s) 0 0 currentColor,
    0 calc(var(--s) * 2) 0 0 currentColor, var(--s) calc(var(--s) * 2) 0 0 currentColor, calc(var(--s) * 2) calc(var(--s) * 2) 0 0 currentColor,
    calc(var(--s) * 3) calc(var(--s) * 2) 0 0 currentColor, calc(var(--s) * 4) calc(var(--s) * 2) 0 0 currentColor;
}
@keyframes nudge-up { 50% { translate: 0 calc(var(--s) * -1); } }

/* ---------- Watch screen (on top of the watch drawn in the room) ---------- */
.watch { position: absolute; z-index: 2; }
.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--screen-bg);
  color: var(--screen-ink);
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.ring circle { fill: none; stroke-width: 2.8; }
.ring-track { stroke: transparent; }
.ring-arc { stroke: transparent; stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: butt; }
.ring[data-kind='count'] .ring-track { stroke: #f3d6d3; }
.ring[data-kind='count'] .ring-arc { stroke: var(--screen-alert); }
.watch[data-mode='listening'] .ring-arc {
  stroke: var(--screen-listen, var(--listen));
  stroke-dashoffset: 0 !important;
  animation: listen-pulse 1s steps(2) infinite;
}
@keyframes listen-pulse { 50% { opacity: 0.35; } }

/* Screen layout, in room pixels (the screen is 74 × 74):
   resting:  clock 7–12 · penguin 15–39 · hint 42–62
   talking:  penguin 5–29 · words 31–64 (the clock steps aside) */
.screen-clock {
  position: absolute;
  top: calc(var(--s) * 7);
  left: 0;
  right: 0;
  text-align: center;
  font-size: calc(var(--s) * 5);
  line-height: 1;
  font-weight: 600;
  color: var(--screen-muted);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.15s steps(2);
}
.watch[data-text] .screen-clock { opacity: 0; }

.penguin-wrap {
  position: absolute;
  left: calc(50% - var(--s) * 12);
  top: calc(var(--s) * 15);
  width: calc(var(--s) * 24);
  height: calc(var(--s) * 24);
  transition: top 0.2s steps(5);
}
.watch[data-text] .penguin-wrap { top: calc(var(--s) * 5); }
.penguin-wrap::after {
  /* flat pixel shadow under the feet */
  content: '';
  position: absolute;
  left: calc(var(--s) * 5);
  right: calc(var(--s) * 5);
  bottom: 0;
  height: var(--s);
  background: rgba(21, 32, 58, 0.14);
  z-index: -1;
}
#penguin {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: bob 1.6s steps(1) infinite;
}
.watch[data-mood='listen'] #penguin { animation-duration: 0.9s; }
.watch[data-mood='concern'] #penguin { animation-duration: 0.8s; }
.watch[data-mode='speaking'] #penguin { animation-duration: 0.5s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4.1667%); } /* exactly one pixel */
}

.screen-text {
  position: absolute;
  top: calc(var(--s) * 42);
  bottom: calc(var(--s) * 12);
  left: calc(var(--s) * 9);
  right: calc(var(--s) * 9);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--s);
  overflow: hidden;
}
.watch[data-text] .screen-text {
  top: calc(var(--s) * 31);
  bottom: calc(var(--s) * 10);
  left: calc(var(--s) * 11);
  right: calc(var(--s) * 11);
  justify-content: safe center;
}
.screen-caption {
  font-size: calc(var(--s) * 5); /* js/watch.js shrinks this until the words fit */
  font-weight: 600;
  line-height: 1.12;
  overflow-wrap: break-word;
  hyphens: auto;
}
.screen-caption:empty { display: none; }
.screen-caption[data-live] { color: var(--listen); }
.screen-hint {
  font-size: calc(var(--s) * 3.67);
  line-height: 1.2;
  color: var(--screen-muted);
  font-variant-numeric: tabular-nums;
}
.screen-hint:empty { display: none; }
.watch[data-mood='concern'] .screen-hint { color: var(--screen-alert); font-weight: 700; }

/* the one physical button (3 o'clock) */
.watch-button {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #eef1f4 0 25%, #c9ced6 25% 75%, #9aa2ae 75%);
  box-shadow:
    0 calc(var(--s) * -1) 0 0 var(--ink), 0 var(--s) 0 0 var(--ink), var(--s) 0 0 0 var(--ink),
    inset calc(var(--s) * -1) 0 0 0 #6f7784;
  transition: transform 0.06s steps(1);
}
.watch-button:hover { background: linear-gradient(180deg, #ffffff 0 25%, #dfe3e8 25% 75%, #aeb5c0 75%); }
.watch-button:active,
.watch-button.is-pressed { transform: translateX(calc(var(--s) * -2)); }
.watch-button:focus-visible { outline-offset: calc(var(--s) * 2); }

/* ---------- Linda's phone ---------- */
.phone-wrap {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--s) * 2);
}
.phone-wrap .tag-phone { position: relative; transform: none; flex: none; }
.phone-dock { display: flex; justify-content: center; }
.phone-dock .phone-wrap { position: relative; width: min(300px, 100%); height: 640px; }

.phone {
  --u: var(--s);
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: calc(var(--u) * 4) calc(var(--u) * 3);
  background: var(--phone-body);
  box-shadow: inset var(--u) var(--u) 0 0 var(--phone-light), inset calc(var(--u) * -1) calc(var(--u) * -1) 0 0 var(--phone-dark);
  /* pixel-rounded corners */
  clip-path: polygon(
    calc(var(--u) * 4) 0, calc(100% - var(--u) * 4) 0, calc(100% - var(--u) * 4) var(--u), calc(100% - var(--u) * 2) var(--u),
    calc(100% - var(--u) * 2) calc(var(--u) * 2), calc(100% - var(--u)) calc(var(--u) * 2), calc(100% - var(--u)) calc(var(--u) * 4), 100% calc(var(--u) * 4),
    100% calc(100% - var(--u) * 4), calc(100% - var(--u)) calc(100% - var(--u) * 4), calc(100% - var(--u)) calc(100% - var(--u) * 2), calc(100% - var(--u) * 2) calc(100% - var(--u) * 2),
    calc(100% - var(--u) * 2) calc(100% - var(--u)), calc(100% - var(--u) * 4) calc(100% - var(--u)), calc(100% - var(--u) * 4) 100%, calc(var(--u) * 4) 100%,
    calc(var(--u) * 4) calc(100% - var(--u)), calc(var(--u) * 2) calc(100% - var(--u)), calc(var(--u) * 2) calc(100% - var(--u) * 2), var(--u) calc(100% - var(--u) * 2),
    var(--u) calc(100% - var(--u) * 4), 0 calc(100% - var(--u) * 4), 0 calc(var(--u) * 4), var(--u) calc(var(--u) * 4),
    var(--u) calc(var(--u) * 2), calc(var(--u) * 2) calc(var(--u) * 2), calc(var(--u) * 2) var(--u), calc(var(--u) * 4) var(--u)
  );
}
/* a pixel outline and a hard shadow that follow the stepped corners */
.phone-wrap {
  filter:
    drop-shadow(var(--s) 0 0 var(--ink)) drop-shadow(calc(var(--s) * -1) 0 0 var(--ink))
    drop-shadow(0 var(--s) 0 var(--ink)) drop-shadow(0 calc(var(--s) * -1) 0 var(--ink))
    drop-shadow(calc(var(--s) * 2) calc(var(--s) * 2) 0 rgba(20, 24, 36, 0.35));
}
.phone.buzz { animation: buzz 0.5s steps(1) 2; }
@keyframes buzz {
  0%, 100% { translate: 0 0; }
  25% { translate: calc(var(--s) * -1) 0; }
  50% { translate: var(--s) 0; }
  75% { translate: calc(var(--s) * -1) 0; }
}

.phone-glass {
  --u: var(--s);
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--app-bg);
  clip-path: polygon(
    calc(var(--u) * 2) 0, calc(100% - var(--u) * 2) 0, calc(100% - var(--u) * 2) var(--u), calc(100% - var(--u)) var(--u), calc(100% - var(--u)) calc(var(--u) * 2), 100% calc(var(--u) * 2),
    100% calc(100% - var(--u) * 2), calc(100% - var(--u)) calc(100% - var(--u) * 2), calc(100% - var(--u)) calc(100% - var(--u)), calc(100% - var(--u) * 2) calc(100% - var(--u)), calc(100% - var(--u) * 2) 100%,
    calc(var(--u) * 2) 100%, calc(var(--u) * 2) calc(100% - var(--u)), var(--u) calc(100% - var(--u)), var(--u) calc(100% - var(--u) * 2), 0 calc(100% - var(--u) * 2),
    0 calc(var(--u) * 2), var(--u) calc(var(--u) * 2), var(--u) var(--u), calc(var(--u) * 2) var(--u)
  );
}
.phone-bar {
  position: relative;
  z-index: 4;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  pointer-events: none;
}
.phone[data-view='home'] .phone-bar { color: #fff; }
.notch { width: 30%; height: 12px; background: var(--phone-dark); clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px); }
.phone-icons { display: flex; align-items: flex-end; gap: 2px; height: 10px; }
.phone-icons i { width: 3px; background: currentColor; }
.phone-icons i:nth-child(1) { height: 4px; }
.phone-icons i:nth-child(2) { height: 7px; }
.phone-icons i:nth-child(3) { height: 10px; }
.phone-icons b { width: 16px; height: 9px; margin-left: 4px; box-shadow: inset 0 0 0 2px currentColor; position: relative; }
.phone-icons b::after { content: ''; position: absolute; inset: 3px 5px 3px 3px; background: currentColor; }

.home-bar {
  position: absolute;
  z-index: 6;
  bottom: 6px;
  left: 50%;
  width: 36%;
  height: 5px;
  padding: 0;
  border: 0;
  transform: translateX(-50%);
  background: var(--ink);
  opacity: 0.45;
}
.home-bar::before { content: ''; position: absolute; inset: -10px -8px -6px; }
.home-bar:hover { opacity: 0.8; }
.phone[data-view='home'] .home-bar { background: #fff; opacity: 0.85; }

/* ---------- Phone home screen ---------- */
.phone-home { position: absolute; inset: 0; z-index: 1; overflow: hidden; background: #33407a; color: #fff; }
.wallpaper { position: absolute; top: 0; left: 0; image-rendering: pixelated; image-rendering: crisp-edges; }

.home-clock { position: absolute; top: 15%; left: 0; right: 0; text-align: center; text-shadow: 0 3px 0 rgba(20, 22, 44, 0.45); }
.home-time { font-size: 46px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.home-date { font-size: 13px; margin-top: 6px; }

.app-icon {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)) drop-shadow(0 4px 0 rgba(20, 22, 44, 0.45));
}
.app-tile {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: end center;
  background: linear-gradient(180deg, #bfe6f6 0 40%, #9fd6ee 40% 72%, #ffffff 72%);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 2px, calc(100% - 4px) 2px, calc(100% - 4px) 4px, calc(100% - 2px) 4px, calc(100% - 2px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 2px) calc(100% - 8px), calc(100% - 2px) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) calc(100% - 2px), calc(100% - 8px) calc(100% - 2px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 2px), 4px calc(100% - 2px), 4px calc(100% - 4px), 2px calc(100% - 4px), 2px calc(100% - 8px), 0 calc(100% - 8px),
    0 8px, 2px 8px, 2px 4px, 4px 4px, 4px 2px, 8px 2px);
  transition: transform 0.1s steps(2);
}
.app-tile canvas { width: 48px; height: 48px; image-rendering: pixelated; margin-bottom: 4px; }
.app-icon:hover .app-tile { transform: translateY(-2px); }
.app-icon:active .app-tile { transform: translateY(1px); }
.app-name-label { font-size: 13px; font-weight: 600; }
.app-badge {
  position: absolute;
  top: -8px;
  left: calc(50% + 22px);
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: var(--alert);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.home-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(56% + 62px);
  width: max-content;
  margin: 0 auto;
  padding: 2px 8px 3px;
  font-size: 12px;
  color: #fff;
  background: rgba(20, 22, 44, 0.6);
  animation: hint-bob 1.2s steps(1) infinite;
}
@keyframes hint-bob { 50% { translate: 0 -2px; } }

/* notification banner */
.notif {
  position: absolute;
  z-index: 3;
  top: 34px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 9px;
  border: 0;
  text-align: left;
  color: var(--ink);
  background: rgba(251, 249, 243, 0.97);
  box-shadow: var(--ol2), 0 5px 0 0 rgba(20, 22, 44, 0.35);
}
.notif:hover { background: #fff; }
.notif-top { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.notif-top b { color: var(--ink); font-weight: 600; }
.notif-top small { margin-left: auto; font-size: 11px; }
.notif-icon { width: 24px; height: 24px; image-rendering: pixelated; background: #bfe6f6; }
.notif strong { font-size: 14px; font-weight: 700; line-height: 1.2; }
.notif-body { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.notif[data-kind='alert'] { box-shadow: var(--ol2), inset 4px 0 0 0 var(--alert), 0 5px 0 0 rgba(20, 22, 44, 0.35); padding-left: 14px; }
.notif[data-kind='alert'] strong { color: var(--alert); }
.notif[data-kind='changes'] { box-shadow: var(--ol2), inset 4px 0 0 0 var(--accent), 0 5px 0 0 rgba(20, 22, 44, 0.35); padding-left: 14px; }

/* ---------- The Everly app ---------- */
.phone-app {
  position: absolute;
  inset: 26px 0 0;
  z-index: 2;
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
}
.phone-screen {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 0 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.app-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--app-bg);
  padding: 6px 0 9px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: 0 2px 0 0 var(--line);
}
.app-name { font-size: 11px; font-weight: 700; color: var(--accent-dark); letter-spacing: 0.08em; text-transform: uppercase; }
.app-head h3 { font-size: 20px; line-height: 1.1; }
.app-sub { color: var(--muted); font-size: 12px; }

/* how Ruth is right now: the first thing Linda sees */
.status-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: var(--ok-bg);
  box-shadow: 0 -2px 0 0 var(--ok), 0 2px 0 0 var(--ok), -2px 0 0 0 var(--ok), 2px 0 0 0 var(--ok);
}
.status-dot { flex: none; width: 14px; height: 14px; background: var(--ok); box-shadow: 0 0 0 2px var(--ink); }
.status-title { font-size: 16px; font-weight: 700; color: var(--ok); line-height: 1.15; }
.status-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.3; }

.app-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 11px 11px;
  background: #ffffff;
  box-shadow: var(--ol2), 0 5px 0 0 rgba(30, 34, 48, 0.12);
}
.app-card h4 { font-size: 14px; }
.summary { font-size: 13.5px; line-height: 1.4; }

/* the one-sentence status */
.app-card.flash { animation: flash 1.6s steps(4); }
@keyframes flash { 0%, 100% { background: #fff; } 25% { background: var(--accent-soft); } }

.alert-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  background: var(--alert-bg);
  box-shadow: 0 -2px 0 0 var(--alert), 0 2px 0 0 var(--alert), -2px 0 0 0 var(--alert), 2px 0 0 0 var(--alert);
}
.alert-title { font-weight: 700; font-size: 16px; color: var(--alert); }
.alert-reason { font-size: 14px; }
.alert-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ladder { margin: 2px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: step; }
.ladder li { counter-increment: step; display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 12.5px; align-items: start; }
.ladder li::before {
  content: counter(step);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  color: var(--muted);
  box-shadow: inset 0 0 0 2px var(--muted);
}
.ladder li[data-state='done']::before { content: '✓'; background: var(--ink); color: #fff; box-shadow: none; }
.ladder li[data-state='now']::before { background: var(--alert); color: #fff; box-shadow: none; }
.ladder li[data-state='now'] { font-weight: 700; }
.ladder li[data-state='later'] { color: var(--muted); }
.alert-actions { display: flex; flex-wrap: wrap; gap: 9px 10px; padding: 2px; }
.alert-actions .btn { padding: 7px 10px; font-size: 13px; }
.alert-status { font-size: 13px; font-weight: 700; }
.alert-status:empty { display: none; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 8px;
  background: var(--panel);
  clip-path: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px);
}
.stat-label { font-size: 11px; color: var(--muted); }
.stat-value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value small { font-size: 11px; font-weight: 500; color: var(--muted); margin: 0 1px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 58px 1fr; gap: 6px; padding: 6px 0; font-size: 12.5px; border-bottom: 2px dotted var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline li[data-type='alert'] span { color: var(--alert); font-weight: 700; }
.timeline li[data-type='reminder-missed'] span,
.timeline li[data-type='checkin-missed'] span { color: var(--warn); }

.privacy { font-size: 11.5px; color: var(--muted); padding-top: 4px; line-height: 1.4; }

/* ---------- Three dropdown sections under the scene ---------- */
.sections {
  width: 100%;
  max-width: var(--scene-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.section {
  background: var(--panel);
  box-shadow: var(--ol3), 0 7px 0 0 rgba(0, 0, 0, 0.3);
  margin: 3px;
}
.section-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}
.section-head::-webkit-details-marker { display: none; }
.section-head:hover { background: var(--panel-2); }
.section-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  box-shadow: var(--ol2);
}
.sec-demo .section-num { background: var(--navy); }
.sec-predict .section-num { background: var(--muted); }
.section-title { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.section-title b { font-size: 18px; font-weight: 600; }
.section-title small { color: var(--muted); font-size: 13px; }
.soon {
  flex: none;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 2px var(--line);
}
/* the chevron sits at the right of every section header (same pixel chevron as "Try saying…") */
.section-head::after {
  content: '';
  flex: none;
  width: 3px;
  height: 3px;
  margin: -6px 22px 0 4px;
  color: var(--ink);
  box-shadow: 0 0 0 0 currentColor, 3px 0 0 0 currentColor, 6px 0 0 0 currentColor, 9px 0 0 0 currentColor, 12px 0 0 0 currentColor,
    3px 3px 0 0 currentColor, 6px 3px 0 0 currentColor, 9px 3px 0 0 currentColor, 6px 6px 0 0 currentColor;
  transition: transform 0.12s steps(2);
}
.section[open] > .section-head::after { transform: translate(12px, 6px) rotate(180deg); }
.section[open] > .section-head { box-shadow: inset 0 -2px 0 0 var(--line); }
.section-body { padding: 16px 18px 18px; }

/* Prediction: Everly Score v4 demo (js/predict.js) */
.predict { display: flex; flex-direction: column; gap: 14px; font-size: 14.5px; font-variant-ligatures: none; }
.predict-intro b { font-weight: 700; }
.predict-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.predict-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.predict-field select {
  min-width: 240px;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: var(--field);
  font: inherit;
  font-weight: 400;
  font-size: 14px;
  box-shadow: var(--ol2);
}
.predict-slider { flex: 1 1 220px; }
.predict-slider input { width: 100%; accent-color: var(--accent); }
.predict-play { min-width: 72px; align-self: flex-end; }
.predict-graph-toggle { align-self: flex-end; padding-bottom: 2px; }

/* this week's score */
.predict-score { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 16px 18px; background: var(--field); box-shadow: var(--ol2), inset 6px 0 0 0 var(--ok); }
.predict-score[data-state='above'] { box-shadow: var(--ol2), inset 6px 0 0 0 #e2a930; }
.predict-score[data-state='alert'] { box-shadow: var(--ol2), inset 6px 0 0 0 var(--alert); background: #fdf1ec; }
.ps-main { display: flex; flex-direction: column; align-items: center; min-width: 120px; padding-left: 6px; }
.ps-label { font-size: 13px; font-weight: 700; }
.ps-num { display: flex; align-items: baseline; gap: 4px; }
.ps-num b { font-size: 52px; font-weight: 700; line-height: 1.25; }
.ps-num small { font-size: 14px; color: var(--muted); }
.ps-week { font-size: 12px; color: var(--muted); }
.ps-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; }
.ps-scale { position: relative; height: 26px; background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.ps-band { position: absolute; left: 2px; top: 2px; bottom: 2px; width: calc(50% - 2px); background: #dcd6c6; }
.ps-range-label { width: 50%; margin-bottom: -4px; border-bottom: 2px solid #b9b19c; padding-bottom: 2px; font-size: 12px; font-weight: 600; }
.ps-pin { position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px; background: #2a78d6; box-shadow: 0 0 0 2px var(--ink); transition: left 0.15s; }
.ps-ticks { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.ps-ticks span:nth-child(2) { text-align: center; }
.ps-ticks span:last-child { text-align: right; }
.ps-ticks b { color: var(--ink); }
.ps-status { margin-top: 4px; font-size: 14.5px; font-weight: 700; }
.predict-score[data-state='alert'] .ps-status { color: var(--alert); }

/* the graph */
.predict-chart { margin: 0; padding: 12px 10px 10px; background: var(--field); box-shadow: var(--ol2); }
.predict-chart-title { padding: 0 4px 6px; font-size: 14px; font-weight: 700; }
.predict-chart svg { display: block; width: 100%; height: auto; font-family: inherit; }
.pc-learn { fill: #ece6d6; }
.pc-collect { fill: #f3efe4; }
.pc-zone { fill: var(--muted); font-size: 11.5px; }
.pc-band { fill: #dcd6c6; opacity: 0.6; }
.pc-band-text { fill: #6f6a5c; font-size: 12px; font-weight: 600; paint-order: stroke; stroke: #ece8dc; stroke-width: 4px; }
.pc-grid { stroke: #ddd6c4; stroke-width: 1; }
.pc-axis-line { stroke: var(--muted); stroke-width: 1; }
.pc-axis { fill: var(--muted); font-size: 12px; }
.pc-axis-title { fill: var(--ink); font-size: 12px; font-weight: 600; }
.pc-edge { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 6 5; }
.pc-edge-text { fill: var(--ink); font-size: 11.5px; font-weight: 600; paint-order: stroke; stroke: var(--field); stroke-width: 4px; }
.pc-sick { fill: #8f8a7e; }
.pc-start { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 2 3; }
.pc-start-text { fill: var(--muted); font-size: 11px; paint-order: stroke; stroke: var(--field); stroke-width: 4px; }
.pc-line { fill: none; stroke: #2a78d6; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.pc-end { fill: #2a78d6; stroke: var(--ink); stroke-width: 1.5; }
.pc-line-text { fill: #1f5ea8; font-size: 12.5px; font-weight: 700; paint-order: stroke; stroke: var(--field); stroke-width: 4px; }
.pc-dot { fill: #c4442d; stroke: var(--ink); stroke-width: 2; }
.pc-dot-text { fill: #c4442d; font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--field); stroke-width: 4px; }
.pc-now { stroke: var(--ink); stroke-width: 1; opacity: 0.3; }
.predict-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 4px 0; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ''; flex: none; }
.lg-score::before { width: 16px; height: 3px; background: #2a78d6; }
.lg-band::before { width: 14px; height: 12px; background: #dcd6c6; }
.lg-edge::before { width: 16px; height: 0; border-top: 2px dashed var(--ink); }
.lg-sick::before { width: 10px; height: 7px; background: #8f8a7e; }
.lg-dot::before { width: 10px; height: 10px; border-radius: 50%; background: #c4442d; box-shadow: 0 0 0 2px var(--ink); }

/* the two parts */
.predict-now { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.predict-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--field); box-shadow: var(--ol2); }
.predict-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.predict-card h3 b { margin-left: auto; font-size: 18px; }
.predict-card .fine { margin-top: -4px; }
.predict-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.predict-card li.quiet { list-style: none; margin-left: -18px; color: var(--muted); }
.predict-parts-note { margin-top: -8px; }

/* normal aging */
.predict-aging { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--panel-2); }
.predict-aging h3 { font-size: 14px; }
.predict-aging p { font-size: 13.5px; }

/* alert */
.predict-alert { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #fdf1ec; box-shadow: inset 4px 0 0 0 var(--alert); }
.predict-alert p { display: flex; flex-direction: column; gap: 2px; }
.predict-alert small { font-size: 12px; font-weight: 700; color: var(--alert); }
.predict-see { align-self: flex-start; }
.timeline li[data-type='change'] span { color: var(--accent-dark); font-weight: 700; }
.predict-note { margin-top: -4px; }

/* ---------- Talk ---------- */
.talk { display: flex; flex-direction: column; gap: 12px; }
.talk-form { display: flex; gap: 12px; padding: 2px; }
.talk-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: var(--field);
  font-size: 15px;
  box-shadow: var(--ol2), inset 0 3px 0 0 #ece6d6;
}
.talk-form input::placeholder { color: var(--faint); }
.talk-form input:focus-visible { outline-offset: 5px; }
.talk.nudge .talk-form input { animation: nudge 0.9s steps(3); }
@keyframes nudge { 30% { background: var(--accent-soft); } }

.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px; }
.chip {
  padding: 5px 10px 6px;
  border: 0;
  background: var(--field);
  font-size: 13.5px;
  text-align: left;
  box-shadow: var(--ol2), inset 0 -2px 0 0 var(--line);
}
.chip:hover { background: #fff; }
.chip:active { transform: translateY(1px); }
.chips-now { padding: 10px; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.chips-now::before { content: 'Quick answers'; flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--accent-dark); margin-bottom: -4px; }
.chips-now .chip { font-weight: 600; }

.switches { display: grid; gap: 8px 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.convo { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 2px; }
.convo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.convo input:checked + .convo-track { background: var(--accent); box-shadow: var(--ol2), inset 0 3px 0 0 var(--accent-dark); }
.convo input:checked + .convo-track::after { transform: translateX(18px); }
.convo input:focus-visible + .convo-track { outline: 2px solid var(--focus); outline-offset: 5px; }
.convo input:disabled + .convo-track { opacity: 0.45; }
.convo:has(input:disabled) { cursor: default; }
.convo-text { display: flex; flex-direction: column; font-size: 14px; }
.convo-text b { font-weight: 600; }
.convo-text small { color: var(--muted); font-size: 12px; }

/* the "Try saying…" dropdown uses a pixel chevron */
.drop { border-top: 2px dashed var(--line); }
.drop summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}
.drop summary { padding: 10px 2px 8px; font-size: 14px; }
.drop summary::-webkit-details-marker { display: none; }
.drop summary small { color: var(--faint); font-weight: 400; font-size: 12px; }
.drop summary::after {
  content: '';
  flex: none;
  align-self: center;
  width: 2px;
  height: 2px;
  margin: -4px 10px 0 auto;
  color: var(--muted);
  box-shadow: 0 0 0 0 currentColor, 2px 0 0 0 currentColor, 4px 0 0 0 currentColor, 6px 0 0 0 currentColor, 8px 0 0 0 currentColor,
    2px 2px 0 0 currentColor, 4px 2px 0 0 currentColor, 6px 2px 0 0 currentColor, 4px 4px 0 0 currentColor;
  transition: transform 0.12s steps(2);
}
.drop[open] > summary::after { transform: translate(8px, 4px) rotate(180deg); }
.drop > :not(summary) { margin-bottom: 12px; }


.status { border-top: 2px dashed var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.status-line { position: relative; padding-left: 16px; font-size: 13px; color: var(--muted); }
.status-line::before { content: ''; position: absolute; left: 0; top: 0.42em; width: 8px; height: 8px; background: var(--faint); }
#mic-status[data-state='ok'], .status-quiet[data-state='ai'] { color: var(--ink); }
#mic-status[data-state='ok']::before, .status-quiet[data-state='ai']::before { background: var(--ok); }
#mic-status[data-state='blocked']::before, #mic-status[data-state='unsupported']::before,
.status-quiet[data-state='scripted']::before { background: #e2a930; }
.mic-help { margin: 0; padding-left: 34px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.mic-help code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
  padding: 1px 5px;
  background: var(--panel-2);
  color: var(--ink);
  user-select: all;
}

/* ---------- Try what Everly does ---------- */
.moments { display: grid; gap: 16px; }
.moment-group { display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.moment-group h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.moment-group h3::before { content: ''; width: 8px; height: 8px; background: var(--accent); box-shadow: 0 0 0 2px var(--ink); }
.moment-safety h3::before { background: var(--alert); }
.moment-group .fine { margin-top: -6px; }
.moment-safety { padding-top: 14px; border-top: 2px dashed var(--line); }

.ctrl-list { display: flex; flex-direction: column; gap: 10px; }
.ctrl {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 9px 11px 10px;
  border: 0;
  text-align: left;
  background: var(--field);
  box-shadow: var(--ol2), inset 0 -3px 0 0 var(--line);
}
.ctrl:hover { background: #fff; }
.ctrl:active { transform: translateY(2px); box-shadow: var(--ol2); }
.ctrl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctrl-label { font-weight: 600; }
.ctrl-alert .ctrl-label { color: var(--alert); }
.ctrl-new { box-shadow: inset 0 0 0 2px var(--faint); background: transparent; }

/* ---------- Small screens ---------- */
body.is-compact .button-hint { display: none; }
@media (max-width: 520px) {
  .brand-sub { display: none; }
  .px-toggle-state { display: none; }
  .names-now-wrap { display: none; }
  .section-head { padding: 12px 14px; gap: 10px; }
  .section-body { padding: 14px; }
  .section-title b { font-size: 16px; }
  .soon { display: none; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #penguin, .watch[data-mode='listening'] .ring-arc, .app-card.flash,
  .button-hint, .home-hint, .toggle-badge, .phone.buzz { animation: none !important; }
  .penguin-wrap, .watch-button, .screen-clock, .app-tile, .px-toggle-knob, .convo-track::after,
  .drop summary::after, .section-head::after { transition: none; }
  .phone-screen { scroll-behavior: auto; }
}
