/* ==========================================================================
   Unstuck — design system  ·  "Bold Poster / Tokyo Focus"
   --------------------------------------------------------------------------
   POV: cream paper · MASSIVE ultra-heavy black grotesque (Archivo Black) ·
   confident red graphic blocks · the plush-rabbit mascot · 集中力 kanji accent.
   High-contrast, graphic, lofi-focus energy — cool, not clinical.
   Design law still holds: one primary action per screen · forgiving language ·
   red is a BRAND colour, never a shame/failure colour · progress only ever
   moves forward · big tap targets · calm motion.
   ========================================================================== */

:root {
  --paper:    #f3ebd7;   /* warm poster cream */
  --paper-2:  #ece1c7;
  --card:     #faf4e4;
  --ink:      #16130e;   /* poster near-black */
  --ink-2:    #4d473c;
  --ink-3:    #8b8472;
  --line:     #e3d7bd;
  --line-2:   #d2c3a1;

  --red:      #e4352a;   /* the brand red — energy, never shame */
  --red-deep: #c0261d;
  --red-wash: #f8ddd6;

  --r-lg: 26px;
  --r:    18px;
  --r-sm: 12px;
  --shadow:   0 1px 2px rgba(22,19,14,.06), 0 12px 34px -14px rgba(22,19,14,.30);
  --shadow-2: 0 2px 4px rgba(22,19,14,.08), 0 26px 60px -22px rgba(22,19,14,.42);
  --maxw: 540px;

  --poster: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --sans:   "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:   "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); background: var(--paper); color: var(--ink);
  line-height: 1.55; font-size: 17px; font-weight: 440;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  position: relative; min-height: 100vh;
}

/* whisper paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; } }

.wrap { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 16px 22px 124px; min-height: 100vh; }

/* install-to-home-screen bar */
.install-bar { position: relative; z-index: 6; display: flex; align-items: center; gap: 10px; max-width: var(--maxw); margin: 0 auto; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 0 0 14px 14px; font-size: 14px; }
.install-bar span { flex: 1; }
.install-bar #installBtn { border: 0; background: var(--red); color: #fff; font-family: var(--sans); font-weight: 700; font-size: 13px; padding: 7px 13px; border-radius: 9px; cursor: pointer; }
.install-bar #installX { border: 0; background: transparent; color: var(--paper); font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; padding: 0 2px; }

/* staggered entrance */
.rise { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
.rise.d1 { animation-delay: .05s; } .rise.d2 { animation-delay: .13s; } .rise.d3 { animation-delay: .22s; }
.rise.d4 { animation-delay: .32s; } .rise.d5 { animation-delay: .42s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---- Top bar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 20px; }
.topbar .mark { font-family: var(--poster); font-size: 23px; letter-spacing: -.04em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline; }
.topbar .mark .j { text-transform: none; }
.topbar .mark .l { color: var(--red); letter-spacing: -.02em; text-transform: none; }
.topbar .mark .l .o { position: relative; }
/* the OO in LOOM wink like the mascot's eyes */
.topbar .mark .l .o::after { content: ""; position: absolute; top: 42%; left: 50%; width: 3px; height: 3px; background: var(--paper); border-radius: 50%; transform: translate(-50%,-50%); }
.topbar a.quiet { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; }
.topbar a.quiet:hover { color: var(--ink); }

/* ---- Poster type ---- */
h1 { font-family: var(--poster); font-weight: 400; font-size: clamp(40px, 13vw, 62px); line-height: .92; letter-spacing: -.035em; margin: 6px 0 14px; text-transform: uppercase; }
h1 .red { color: var(--red); }
h2 { font-family: var(--poster); font-weight: 400; font-size: clamp(22px, 6vw, 28px); line-height: 1; letter-spacing: -.03em; margin: 34px 0 14px; text-transform: uppercase; }
h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; }
.lede { color: var(--ink-2); font-size: 18px; line-height: 1.5; margin: 0 0 22px; max-width: 32ch; }
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin: 0 0 10px; }
.muted { color: var(--ink-2); } .small { font-size: 14px; } .ink3 { color: var(--ink-3); }

/* ---- THE signature hero: black poster slab + mascot + red accent + kanji ---- */
.hero {
  position: relative; display: block; width: 100%; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper); border-radius: var(--r-lg);
  padding: 24px 24px 22px; text-align: left; box-shadow: var(--shadow-2);
  text-decoration: none; overflow: hidden; font-family: inherit; isolation: isolate;
  min-height: 248px;
}
/* red circle bleeding behind the mascot, bottom-right */
.hero::before {
  content: ""; position: absolute; z-index: 0; right: -36px; bottom: -52px;
  width: 215px; height: 215px; background: var(--red); border-radius: 50%; opacity: .97;
}
/* text column — reserved width so it NEVER runs under the mascot */
.hero-text { position: relative; z-index: 2; max-width: 60%; }
.hero .hero-eyebrow { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.hero .hero-title { display: block; font-family: var(--poster); font-size: clamp(40px, 13vw, 54px); line-height: .88; letter-spacing: -.04em; text-transform: uppercase; margin: 10px 0 12px; }
.hero .hero-sub { display: block; font-size: 15px; line-height: 1.45; opacity: .9; }
.hero .hero-go { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; font-weight: 700; font-size: 15.5px; color: var(--paper); }
.hero .hero-go b { background: var(--red); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.hero .hero-mascot { position: absolute; z-index: 1; right: 10px; bottom: -6px; width: 150px; height: auto; }
.hero .hero-kanji { position: absolute; z-index: 2; top: 18px; right: 18px; writing-mode: vertical-rl; font-size: 20px; letter-spacing: .08em; color: var(--paper); opacity: .8; font-weight: 700; }
.hero:active { transform: scale(.99); }

/* ---- 3D flip: front "I'm stuck" → back "how do you want to start?" ---- */
.hero-flip { perspective: 1700px; }
.flip-inner { position: relative; width: 100%; min-height: 312px; transform-style: preserve-3d; transition: transform .72s cubic-bezier(.2,.85,.25,1); }
.flip-inner.flipped { transform: rotateY(180deg); }
/* explicit face visibility (deterministic) + backface-hidden for the 3D look.
   visibility swaps at the rotation midpoint so only one face ever shows. */
.flip-front, .flip-back { -webkit-backface-visibility: hidden; backface-visibility: hidden; transition: visibility 0s linear .36s; }
.flip-back { visibility: hidden; }
.flip-inner.flipped .flip-back { visibility: visible; }
.flip-inner.flipped .flip-front { visibility: hidden; }
.flip-front { position: relative; min-height: 312px; } /* the .hero slab — defines height */
.flip-back { position: absolute; inset: 0; transform: rotateY(180deg); background: var(--ink); color: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 20px 18px; display: flex; flex-direction: column; justify-content: center; gap: 9px; overflow: hidden; isolation: isolate; }
.flip-back::after { content: ""; position: absolute; right: -44px; bottom: -54px; width: 150px; height: 150px; background: var(--red); border-radius: 50%; opacity: .9; z-index: 0; }
.flip-back .hero-eyebrow { position: relative; z-index: 2; color: var(--red); margin: 0 4px 8px; }
.flip-return { position: absolute; top: 13px; right: 14px; z-index: 3; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid rgba(243,235,215,.28); background: transparent; color: var(--paper); cursor: pointer; font-size: 15px; line-height: 1; }
.flip-return:active { transform: scale(.9); }

.hero-opt { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--paper); background: rgba(243,235,215,.07); border: 1.5px solid rgba(243,235,215,.18); border-radius: 14px; padding: 11px 13px; transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.hero-opt:hover { background: var(--red); border-color: var(--red); }
.hero-opt:active { transform: scale(.98); }
.hero-opt .opt-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; background: rgba(243,235,215,.1); display: grid; place-items: center; }
.hero-opt:hover .opt-ic { background: rgba(0,0,0,.2); }
.hero-opt .opt-ic svg { width: 22px; height: 22px; }
.hero-opt .opt-txt { display: flex; flex-direction: column; line-height: 1.18; min-width: 0; }
.hero-opt .opt-txt b { font-size: 15.5px; letter-spacing: -.01em; }
.hero-opt .opt-txt small { font-size: 11.5px; opacity: .72; margin-top: 2px; }
.hero-opt .opt-arrow { margin-left: auto; font-size: 18px; opacity: .85; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; cursor: pointer; font-family: var(--sans); font-size: 16px; font-weight: 700; letter-spacing: .01em; background: var(--ink); color: var(--paper); border-radius: 14px; padding: 17px 22px; text-decoration: none; width: 100%; box-shadow: var(--shadow); transition: transform .12s ease, background .15s ease; }
.btn:active { transform: scale(.98); }
.btn:hover { background: #000; }
.btn.red { background: var(--red); } .btn.red:hover { background: var(--red-deep); }
.btn.secondary { background: var(--card); color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
.btn.secondary:hover { background: var(--paper-2); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; font-weight: 600; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.small { width: auto; padding: 11px 17px; font-size: 14px; border-radius: 11px; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { width: auto; flex: 1; }

/* ---- Cards ---- */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.tappable { display: block; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .15s ease; }
.card.tappable:hover { box-shadow: var(--shadow-2); }
.card.tappable:active { transform: scale(.99); }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.card .meta { color: var(--ink-2); font-size: 14.5px; }

/* today's one big thing — home banner */
.today-chip { display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 14px 16px; margin: 16px 0 4px; text-decoration: none; box-shadow: 4px 4px 0 var(--red); }
.today-chip .tc-star { font-size: 20px; flex: 0 0 auto; }
.today-chip .tc-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.today-chip .tc-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.today-chip .tc-txt b { font-size: 15.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-chip .tc-arrow { margin-left: auto; font-size: 18px; opacity: .8; flex: 0 0 auto; }

/* Goal tiles — poster blocks with big red index numbers */
.goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.goal-tile { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 16px; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .15s ease; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.goal-tile:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--red); }
.goal-tile:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }
.goal-tile .g-ic { width: 30px; height: 30px; color: var(--ink); display: block; }
.goal-tile:hover .g-ic { color: var(--red); }
.goal-tile .gt-title { font-weight: 700; font-size: 16px; line-height: 1.18; margin-top: 12px; letter-spacing: -.01em; }
.goal-tile .gt-n { position: absolute; top: 6px; right: 12px; font-family: var(--poster); font-size: 30px; color: var(--red); opacity: .8; }

/* ---- Progress: forward only. red fill = energy, not shame ---- */
.progress { height: 12px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin: 12px 0; border: 1.5px solid var(--ink); }
.progress > span { display: block; height: 100%; background: var(--red); border-radius: 999px; transition: width .6s cubic-bezier(.2,.7,.2,1); }
.progress-label { font-size: 14.5px; color: var(--ink-2); }
.progress-label b { font-family: var(--mono); color: var(--ink); }

/* Step reveal — one at a time. Calmer than the hero (mid-task = low stimulation) */
.step-card { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-lg); padding: 24px 24px 22px; box-shadow: 5px 5px 0 var(--ink); }
.step-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); font-weight: 700; margin-bottom: 10px; }
.step-title { font-family: var(--sans); font-weight: 700; font-size: 23px; line-height: 1.22; letter-spacing: -.015em; margin: 0 0 6px; }
.step-tool { background: var(--paper); border: 1.5px solid var(--line-2); border-radius: var(--r-sm); padding: 13px 15px; margin: 16px 0; font-size: 15px; color: var(--ink-2); }
.done-pill { font-size: 13px; color: var(--paper); background: var(--ink); border-radius: 999px; padding: 7px 13px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* gentle unlock */
.unlock { background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 15px 18px; margin-bottom: 14px; font-size: 15.5px; }
.unlock b { color: var(--red); }

/* ---- Coach chat ---- */
.chat { display: flex; flex-direction: column; gap: 13px; padding-bottom: 12px; }
.bubble { max-width: 87%; padding: 14px 17px; border-radius: 20px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.bubble.coach { background: var(--card); border: 1.5px solid var(--ink); border-bottom-left-radius: 6px; align-self: flex-start; box-shadow: 3px 3px 0 var(--ink); }
.bubble.me { background: var(--ink); color: var(--paper); border-bottom-right-radius: 6px; align-self: flex-end; }
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i { width: 8px; height: 8px; background: var(--ink-3); border-radius: 50%; animation: blink 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: .2s; } .typing i:nth-child(3){ animation-delay: .4s; }
@keyframes blink { 0%,100%{opacity:.25} 50%{opacity:.9} }

/* coach mode toggle — segmented control */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 16px; padding: 5px; margin-bottom: 16px; }
.seg-btn { border: 0; background: transparent; cursor: pointer; font-family: var(--sans); font-weight: 700; font-size: 14.5px; color: var(--ink-2); border-radius: 11px; padding: 9px 8px; line-height: 1.15; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: background .15s ease, color .15s ease; }
.seg-btn small { font-weight: 500; font-size: 11.5px; color: var(--ink-3); }
.seg-btn.on { background: var(--ink); color: var(--paper); box-shadow: 2px 2px 0 var(--red); }
.seg-btn.on small { color: rgba(243,235,215,.7); }

.coach-hd { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.coach-hd img { width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--ink); object-fit: cover; }
.coach-hd .who { font-weight: 700; font-size: 15px; flex: 1; } .coach-hd .who span { display: block; font-weight: 500; font-size: 12.5px; color: var(--ink-3); }
/* mascot pulses while the coach is speaking */
.coach-hd img.speaking { animation: speakpulse 1s ease-in-out infinite; border-color: var(--red); }
@keyframes speakpulse { 0%,100%{ transform: scale(1); box-shadow: 0 0 0 0 rgba(228,53,42,.4); } 50%{ transform: scale(1.06); box-shadow: 0 0 0 6px rgba(228,53,42,0); } }
/* calm pulse while it's the user's turn to talk */
.coach-hd img.listening { animation: listenpulse 1.5s ease-in-out infinite; border-color: var(--ink-3); }
@keyframes listenpulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(139,132,114,.4); } 50%{ box-shadow: 0 0 0 7px rgba(139,132,114,0); } }

/* speak-replies toggle */
.voice-toggle { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.voice-toggle svg { width: 22px; height: 22px; }
.voice-toggle.on { background: var(--red); color: #fff; border-color: var(--red); }
.voice-toggle:active { transform: scale(.94); }

/* persistent "talk it out loud" call button in the coach header */
.call-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px 0 12px; border-radius: 12px; border: 0; background: var(--red); color: #fff; font-family: var(--sans); font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 6px 16px -5px rgba(228,53,42,.7); }
.call-btn svg { width: 19px; height: 19px; }
.call-btn:active { transform: scale(.95); }
.call-btn.live { animation: speakpulse 1.6s ease-in-out infinite; }

/* "plug in and talk" prompt */
.voice-prompt { background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 14px 16px; margin: 4px 0 2px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; box-shadow: 3px 3px 0 var(--red); }
.voice-prompt span { font-size: 15px; }
.voice-prompt .btn { width: auto; background: var(--red); }

/* hands-free banner (fixed, above composer) */
.hf-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 6; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px -8px rgba(22,19,14,.5); display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.hf-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: micpulse 1.1s ease-in-out infinite; }

/* mic button in the composer */
.composer .mic { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 14px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.composer .mic svg { width: 23px; height: 23px; }
.composer .mic:active { transform: scale(.94); }
.composer .mic.listening { background: var(--red); color: #fff; border-color: var(--red); animation: micpulse 1.1s ease-in-out infinite; }
@keyframes micpulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(228,53,42,.45); } 50%{ box-shadow: 0 0 0 8px rgba(228,53,42,0); } }

.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: linear-gradient(to top, var(--paper) 66%, transparent); padding: 14px 22px calc(16px + env(safe-area-inset-bottom)); }
.composer .inner { max-width: var(--maxw); margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 2px solid var(--ink); background: var(--card); border-radius: 16px; padding: 13px 16px; font-family: inherit; font-size: 16px; max-height: 120px; color: var(--ink); }
.composer textarea:focus { outline: none; border-color: var(--red); }
.composer .send { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; border: 0; background: var(--red); color: #fff; font-size: 21px; cursor: pointer; box-shadow: var(--shadow); }
.composer .send:active { transform: scale(.95); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 6px; }
.chip { background: var(--card); border: 2px solid var(--ink); color: var(--ink); border-radius: 999px; padding: 9px 16px; font-size: 14.5px; cursor: pointer; font-weight: 600; font-family: inherit; }
.chip:active { background: var(--red); color: #fff; border-color: var(--red); }
.chip:hover { background: var(--paper-2); }

/* ---- Crisis card: distinct from brand red → solid BLACK, unmistakable ---- */
.crisis-card { border: 0; background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 18px 20px; margin: 16px 0; box-shadow: var(--shadow-2); }
.crisis-card h3 { color: #fff; margin: 0 0 7px; font-family: var(--poster); font-weight: 400; font-size: 18px; letter-spacing: -.02em; text-transform: uppercase; }
.crisis-card p { margin: 0 0 6px; font-size: 15px; opacity: .92; }
.crisis-card a { color: #fff; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--red); }
.crisis-card .line { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(243,235,215,.18); font-size: 15px; }
.crisis-card .line span { color: rgba(243,235,215,.7); }

/* ---- Disclaimer + bottom nav ---- */
.disclaimer { font-size: 13px; line-height: 1.5; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px; margin-top: 20px; }
.disclaimer a { color: var(--red); font-weight: 600; }
.footnav { display: flex; justify-content: space-around; position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; background: rgba(243,235,215,.94); backdrop-filter: blur(10px); border-top: 2px solid var(--ink); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.footnav a { color: var(--ink-2); text-decoration: none; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: center; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.footnav .chip-ic { width: 46px; height: 32px; display: grid; place-items: center; border-radius: 11px; border: 2px solid transparent; transition: transform .16s cubic-bezier(.2,.8,.2,1), background .16s ease, border-color .16s ease; }
.footnav .nav-ic { width: 23px; height: 23px; display: block; }
.footnav a:active .chip-ic { transform: scale(.9); }
/* active tab: bold black chip with cream glyph + red label — unmistakable */
.footnav a.on { color: var(--red); }
.footnav a.on .chip-ic { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-3px); box-shadow: 3px 3px 0 var(--red); }
.footnav a:not(.on):hover .chip-ic { border-color: var(--line-2); }

/* tools */
.timer { text-align: center; padding: 10px 0; }
.timer .dial { font-family: var(--poster); font-size: 56px; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.breathe { display: grid; place-items: center; padding: 26px 0; }
.breathe .dot { width: 128px; height: 128px; border-radius: 50%; background: var(--red); animation: breathe 11s ease-in-out infinite; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; box-shadow: var(--shadow); }
@keyframes breathe { 0%,100%{ transform: scale(.6); } 18%{ transform: scale(1); } 50%{ transform: scale(1); } 68%{ transform: scale(.6); } }

/* ---- Flow (focus music) ---- */
.flow-hd { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.flow-hd .lede { flex: 1; }
.flow-mascot { width: 116px; height: auto; flex: 0 0 auto; margin: -8px -6px -8px 0; }

/* our own player — black poster slab, YouTube hidden underneath */
.player { position: relative; background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: 22px 22px 24px; box-shadow: 5px 5px 0 var(--red); overflow: hidden; margin-bottom: 16px; }
.np, .controls { position: relative; z-index: 2; }
.np { display: flex; align-items: center; gap: 14px; }
.np-meta { display: flex; flex-direction: column; min-width: 0; }
.np-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.np-title { font-family: var(--poster); font-size: 24px; line-height: 1; letter-spacing: -.02em; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { font-size: 13.5px; color: rgba(243,235,215,.6); margin-top: 4px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 20px; }
.pc { border: 0; background: transparent; color: var(--paper); font-size: 30px; line-height: 1; cursor: pointer; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; transition: transform .12s ease, color .12s ease; }
.pc:hover { color: var(--red); } .pc:active { transform: scale(.9); }
.pc.play { background: var(--red); color: #fff; width: 66px; height: 66px; font-size: 22px; box-shadow: 0 6px 18px -4px rgba(228,53,42,.6); }
.pc.play:hover { background: var(--red-deep); color: #fff; }
/* The YouTube iframe must stay genuinely rendered (opacity:1, in viewport) or
   Chrome throttles decoding and it sits at "buffering" forever. So we keep it
   full-size at z-0 and simply COVER it with an opaque slab (occlusion doesn't
   pause media, transparency does). Result: our own player, audio intact. */
.yt-host { position: absolute; inset: 0; z-index: 0; opacity: 1; pointer-events: none; overflow: hidden; border-radius: inherit; }
.yt-host iframe { width: 100%; height: 100%; border: 0; }
.player-cover { position: absolute; inset: 0; z-index: 1; background: var(--ink); border-radius: inherit; pointer-events: none; }

.station-row { display: flex; gap: 9px; margin-bottom: 14px; flex-wrap: wrap; }
.chip.station.active { background: var(--red); color: #fff; border-color: var(--red); }

/* equalizer — only animates while audio plays */
.eq { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-left: auto; flex: 0 0 auto; }
.eq i { width: 5px; background: var(--paper); border-radius: 3px; height: 22%; animation: eq 1.1s ease-in-out infinite; animation-play-state: paused; }
.eq i:nth-child(odd) { background: var(--red); }
.eq i:nth-child(1){animation-delay:-.2s} .eq i:nth-child(2){animation-delay:-.9s} .eq i:nth-child(3){animation-delay:-.5s}
.eq i:nth-child(4){animation-delay:-.3s} .eq i:nth-child(5){animation-delay:-.7s} .eq i:nth-child(6){animation-delay:-.1s}
.eq i:nth-child(7){animation-delay:-.8s} .eq i:nth-child(8){animation-delay:-.4s} .eq i:nth-child(9){animation-delay:-.6s}
.eq i:nth-child(10){animation-delay:-.25s}
.player.playing .eq i { animation-play-state: running; }
@keyframes eq { 0%,100%{ height:18%; } 50%{ height:100%; } }

/* assessment scale buttons — big, tap to advance */
.scale { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.scale-btn { width: 100%; text-align: left; border: 2px solid var(--ink); background: var(--card); color: var(--ink); border-radius: 13px; padding: 15px 18px; font-family: var(--sans); font-weight: 600; font-size: 16px; cursor: pointer; transition: transform .1s ease, background .12s ease, color .12s ease; }
.scale-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.scale-btn:active { transform: scale(.985); }

hr.soft { border: 0; border-top: 1.5px solid var(--line-2); margin: 24px 0; }
.note-input { width: 100%; border: 2px solid var(--ink); background: var(--card); border-radius: var(--r-sm); padding: 13px 15px; font-family: inherit; font-size: 16px; color: var(--ink); resize: vertical; min-height: 70px; }
.note-input:focus { outline: none; border-color: var(--red); }
.ifthen-grid { display: grid; gap: 10px; margin: 14px 0; }
.ifthen-grid label { font-size: 13px; color: var(--ink-2); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-family: var(--mono); }
