/* ============================================================
   NORTHSTAR DESIGN SYSTEM v3
   Built from ../app-v3/V3System.dc.html and V3Motion.dc.html.
   Minimal, photographic, earned. Paper and ink; colour lives
   only in Sounds (cover title, vinyl) and Protocol washes.
   ============================================================ */
:root {
  --ink: #0B0B0C; --paper: #ffffff; --bone: #F3F2EE; --stone: #6B6A66; --stone2: #4A4945;
  --hair: #EDECE8; --hair2: #E2E1DC; --dash: #A8A6A0;
  --water: rgba(4, 28, 36, 0.46);
  --sans: 'aktiv-grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Azeret Mono', ui-monospace, 'SF Mono', monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.05);
  --t: 240ms;
  --top: max(env(safe-area-inset-top), 20px);
  --bot: env(safe-area-inset-bottom);
  --kb: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); overscroll-behavior: none; }
body { font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
img { display: block; -webkit-user-drag: none; }
h1, h2, h3, p { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { position: fixed; left: 0; right: 0; top: 0; bottom: var(--kb); overflow: hidden; background: var(--paper); transition: bottom 260ms var(--ease); }

/* ---------- type ---------- */
.mono { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.mono.s { font-size: 11.5px; letter-spacing: 0.13em; }
.mono.xs { font-size: 11px; letter-spacing: 0.12em; }
.mono.h { font-size: 22px; letter-spacing: 0.1em; }
.q { font-size: 34px; line-height: 37px; font-weight: 700; letter-spacing: -0.035em; }
.q .dim { opacity: 0.72; }
.h2 { font-size: 26px; line-height: 29px; font-weight: 700; letter-spacing: -0.03em; }
.cover-t { font-weight: 800; letter-spacing: -0.065em; text-transform: uppercase; line-height: 0.8; }
.stone { color: var(--stone); }

/* ---------- layers: tabs, pages, overlays ---------- */
.tab { position: absolute; inset: 0; visibility: hidden; }
.tab.on { visibility: visible; }
.page { position: absolute; inset: 0; overflow: hidden; background: var(--paper); will-change: transform;
  transition: transform 420ms var(--ease), opacity 420ms var(--ease); }
.page.dark { background: #0A2A33; color: #fff; }
.page.under { transform: translateX(-28%); }
.page.right { transform: translateX(100%); }
.page.up { transform: translateY(100%); }
.page.under::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.12); pointer-events: none; }
.page.drag, .page.drag + .page { transition: none; }
.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { display: none; }
.pad { padding: calc(var(--top) + 10px) 24px calc(var(--bot) + 120px); }

/* top bar: star, account, back */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.star { width: 24px; height: 27px; }
.star.s { width: 20px; height: 23px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; text-align: center; }
.on-photo .avatar, .avatar.glass { background: rgba(255,255,255,0.2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.back { width: 40px; height: 40px; margin-left: -10px; display: flex; align-items: center; justify-content: center; }
.back svg { width: 24px; height: 24px; }
.pill-glass { height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,0.2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.pill-glass .sq { width: 8px; height: 8px; border-radius: 2px; background: #fff; }
.pill-ink { height: 44px; padding: 0 16px; border-radius: 999px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.pill-ink .sq { width: 8px; height: 8px; border-radius: 2px; background: #fff; }

/* ---------- buttons ---------- */
.btn { height: 56px; padding: 0 28px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform 160ms var(--ease), opacity 160ms; width: 100%; }
.btn:active { transform: scale(0.97); }
.btn.out { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn.white { background: #fff; color: var(--ink); }
.btn.glassy { background: rgba(255,255,255,0.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4); }
.btn:disabled { opacity: 0.35; transform: none; }
.btn svg { width: 18px; height: 18px; }
.link { font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; padding: 12px 0; }
.link.mono { font-size: 11px; letter-spacing: 0.12em; }
.tag { height: 22px; padding: 0 8px; border-radius: 4px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; }

/* ---------- bottom bar ---------- */
#tabbar { position: absolute; left: 50%; bottom: calc(var(--bot) + 12px); transform: translateX(-50%); height: 62px; padding: 6px; border-radius: 999px;
  background: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,0.18); display: flex; gap: 2px; white-space: nowrap; z-index: 20;
  transition: transform 420ms var(--ease), opacity 300ms, background 300ms; }
#tabbar.glass { background: rgba(255,255,255,0.14); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); }
#tabbar.off { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
#tabbar button { position: relative; z-index: 1; height: 50px; padding: 0 20px; border-radius: 999px; color: #fff; font-size: 16px; font-weight: 700; transition: color 240ms; }
#tabbar button[aria-current="page"] { color: var(--ink); }
#tabbar .knob { position: absolute; top: 6px; height: 50px; border-radius: 999px; background: #fff; transition: left 340ms var(--spring), width 340ms var(--spring); }
.fadeout { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--bot) + 120px); background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 60%); pointer-events: none; z-index: 2; }

/* ---------- the chat: photo above, you below ---------- */
.chat { position: absolute; inset: 0; display: flex; flex-direction: column; color: #fff; background: #0A2A33; }
.chat > .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 68% 50%; }
.chat > .shade { position: absolute; left: 0; top: 0; width: 100%; height: 62%; background: linear-gradient(180deg, rgba(3,20,26,0.68) 0%, rgba(3,20,26,0.30) 70%, rgba(3,20,26,0) 100%); }
.chat .above { position: relative; flex: 1 1 auto; min-height: 0; padding: calc(var(--top) + 10px) 20px 16px; display: flex; flex-direction: column; }
.chat .above .say { padding: 0 4px; margin-top: 22px; }
.chat .above .say .mono { color: rgba(255,255,255,0.88); }
.chat .above .say .q { margin-top: 12px; }
.chat .above .mid { margin-top: 0; }
.chat .line { position: relative; height: 1.5px; background: #fff; flex: 0 0 1.5px; }
.chat .below { position: relative; flex: 0 0 auto; background: var(--water); -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3);
  padding: 8px 24px calc(var(--bot) + 20px); }
.chat.tabs .below { padding-bottom: calc(var(--bot) + 100px); }
body.kb .chat .below { padding-bottom: 12px; }

/* the exchange above the line */
.ex { display: flex; flex-direction: column; gap: 10px; }
.ex .me { align-self: flex-end; max-width: 80%; font-size: 17px; line-height: 22px; font-weight: 700; padding: 10px 14px; border-radius: 18px 18px 4px 18px;
  background: rgba(255,255,255,0.18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ex .them { font-size: 19px; line-height: 25px; letter-spacing: -0.015em; max-width: 92%; }
.ex .ask { font-size: 26px; line-height: 29px; font-weight: 700; letter-spacing: -0.03em; }
.ex .prev { opacity: 0.6; font-size: 15px; line-height: 20px; }

/* option rows, in water */
.opts { display: flex; flex-direction: column; }
.opt { height: 54px; display: flex; align-items: center; justify-content: space-between; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #fff;
  border-top: 1px solid rgba(255,255,255,0.18); margin: 0 -8px; padding: 0 8px; border-radius: 12px; transition: background 120ms; }
.opt:first-child { border-top-color: transparent; }
.opt:active, .opt.picked { background: rgba(255,255,255,0.16); }
.opt .n { width: 14px; font-family: var(--mono); font-weight: 500; font-size: 13px; color: rgba(255,255,255,0.8); margin-right: 12px; }
.opt > span { display: flex; align-items: center; }
.opt svg { width: 20px; height: 20px; opacity: 0.7; flex: 0 0 auto; }
.opt.check svg { opacity: 1; }
.opt.multi[aria-pressed="true"] .box { background: #fff; }
.opt.multi[aria-pressed="true"] .box svg { opacity: 1; }
.box { width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px #fff; display: flex; align-items: center; justify-content: center; transition: background 160ms; }
.box svg { width: 16px; height: 16px; color: var(--ink); opacity: 0; }
.grp { margin-top: 12px; color: rgba(255,255,255,0.75); }
.grp:first-child { margin-top: 4px; }
.opts.small .opt { height: 42px; font-size: 18px; }

/* the field with the mic */
.field { margin-top: 12px; height: 52px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4); display: flex; align-items: center; padding: 0 5px 0 18px; gap: 8px; }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: #fff; font: inherit; font-size: 17px; }
.field input::placeholder { color: rgba(255,255,255,0.72); }
.field .go { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; flex: 0 0 38px; }
.field .go svg { width: 18px; height: 18px; }

/* ---------- motion 01: answer drops in ---------- */
.fly { position: fixed; z-index: 60; pointer-events: none; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #fff;
  transition: transform 420ms var(--spring), opacity 200ms; transform-origin: 0 50%; }
.rise { animation: rise var(--t) var(--ease) both; }
.rise.d1 { animation-delay: 80ms; } .rise.d2 { animation-delay: 160ms; } .rise.d3 { animation-delay: 240ms; } .rise.d4 { animation-delay: 320ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-out { animation: fadeout 180ms ease-out both; }
@keyframes fadeout { to { opacity: 0; } }

/* typing: the star turns */
.think { display: inline-flex; align-items: center; height: 26px; }
.think svg { width: 18px; height: 20px; animation: think 1.4s linear infinite; }
@keyframes think { 0% { transform: rotate(0) scale(1); opacity: 0.6; } 50% { transform: rotate(180deg) scale(1.15); opacity: 1; } 100% { transform: rotate(360deg) scale(1); opacity: 0.6; } }

/* ---------- vinyl ---------- */
.rec { position: relative; display: block; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.28); }
.rec .lbl { position: absolute; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px rgba(0,0,0,0.26); }
.rec .hole { position: absolute; border-radius: 50%; }
.rec .sheen { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 20deg, rgba(255,255,255,0) 0deg, rgba(255,255,255,0.3) 30deg, rgba(255,255,255,0) 70deg, rgba(255,255,255,0) 180deg, rgba(255,255,255,0.18) 210deg, rgba(255,255,255,0) 250deg); }
.rec .spin { position: absolute; inset: 0; border-radius: 50%; }

/* sleeve: a 7-inch single */
.slv { position: relative; display: block; overflow: hidden; border-radius: 3px; box-shadow: 0 10px 24px rgba(0,0,0,0.18); flex: 0 0 auto; }
.slv > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slv .st { position: absolute; right: 8px; top: 8px; width: 10px; height: 11px; }
.slv .cover-t { position: absolute; left: 7px; bottom: 5px; }
.slv.type { background: var(--bone); }
.single { position: relative; display: block; flex: 0 0 auto; }
.single .rec { position: absolute; transition: transform 380ms var(--ease); }
.single .slv { position: absolute; left: 0; top: 0; }
.single.peek .rec { transform: translateX(var(--peek, 56%)); }

/* not earned yet */
.slv.locked { background-color: var(--ink); background-image: radial-gradient(rgba(255,255,255,0.16) 1px, transparent 1.4px); background-size: 10px 10px; box-shadow: none; }
.slv.locked .st { position: absolute; left: 50%; top: 30%; right: auto; width: 24px; height: 27px; transform: translateX(-50%); }
.slv.locked .req { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); height: 26px; padding: 0 11px; border-radius: 999px; background: #fff; color: var(--ink); display: flex; align-items: center; }

/* ---------- the Protocol strip ---------- */
.strip { position: relative; padding: 14px 10px; border-radius: 22px; background: rgba(255,255,255,0.12); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16); color: #fff; }
.strip .hd { display: flex; justify-content: space-between; padding: 0 8px; }
.strip .rail { position: absolute; left: 22%; right: 22%; top: 66px; height: 1px; background: rgba(255,255,255,0.3); }
.strip .slots { position: relative; margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slot { display: flex; flex-direction: column; align-items: center; text-align: center; }
.slot .dot { width: 52px; height: 52px; position: relative; }
.slot .now { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; display: block; }
.slot .now::after { content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: currentColor; }
.slot .now { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.0); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,0.14); } }
.slot .empty { width: 52px; height: 52px; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,0.5); display: block; }
.slot .ph { margin-top: 10px; }
.slot .mo { margin-top: 3px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.slot .soon { margin-top: 2px; opacity: 0.7; }
.slot .drop { animation: drop 900ms cubic-bezier(0.34, 1.4, 0.5, 1) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-26px) rotate(-90deg); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
.strip.ink { color: var(--ink); background: var(--bone); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.strip.ink .rail { background: var(--hair2); }
.strip.ink .slot .empty { border-color: var(--dash); }

/* ---------- lists on paper ---------- */
.tabs-mono { display: flex; gap: 22px; }
.tabs-mono button { height: 44px; display: flex; align-items: center; color: var(--stone); font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.14em; }
.tabs-mono button[aria-selected="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.card { position: relative; border-radius: 20px; overflow: hidden; }
.hair { height: 2px; border-radius: 1px; background: var(--hair2); position: relative; }
.hair > i { position: absolute; left: 0; top: 0; height: 2px; background: var(--ink); transition: width 480ms var(--ease); }
.hair > i::after { content: ''; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.hair.bump > i::after { animation: dotbump 600ms ease-out; }
@keyframes dotbump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.9); } }
.roll { display: inline-block; position: relative; overflow: hidden; vertical-align: bottom; }
.roll .o, .roll .n { display: inline-block; transition: transform 240ms var(--ease), opacity 240ms; }
.roll .n { position: absolute; left: 0; top: 0; transform: translateY(16px); opacity: 0; }
.roll.go .o { transform: translateY(-16px); opacity: 0; }
.roll.go .n { transform: none; opacity: 1; }

/* ---------- sheets ---------- */
#layer { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.4); opacity: 0; transition: opacity 320ms; pointer-events: auto; }
.scrim.on { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--top) - 12px); background: #fff; color: var(--ink); border-radius: 24px 24px 0 0;
  transform: translateY(100%); transition: transform 420ms var(--ease); pointer-events: auto; display: flex; flex-direction: column;
  padding-bottom: calc(var(--bot) + 16px); }
.sheet.on { transform: none; }
.sheet.drag { transition: none; }
.sheet .grab { flex: 0 0 auto; height: 24px; display: flex; justify-content: center; align-items: center; touch-action: none; }
.sheet .grab::before { content: ''; width: 36px; height: 5px; border-radius: 3px; background: var(--hair2); }
.sheet .body { overflow-y: auto; padding: 4px 24px 8px; overscroll-behavior: contain; }
.sheet.full { top: calc(var(--top) + 12px); }
.sheet h2 { font-size: 26px; line-height: 29px; font-weight: 700; letter-spacing: -0.03em; }
.sheet p { font-size: 16px; line-height: 22px; color: var(--stone2); }
.row { display: flex; align-items: center; justify-content: space-between; min-height: 56px; border-top: 1px solid var(--hair); font-size: 17px; font-weight: 700; width: 100%; }
.row .v { color: var(--stone); font-weight: 400; display: flex; align-items: center; gap: 6px; }
.row svg { width: 18px; height: 18px; }
.row.danger { color: #B3261E; }
.input { width: 100%; height: 52px; border-radius: 14px; border: 0; background: var(--bone); padding: 0 16px; font: inherit; font-size: 17px; color: var(--ink); }
textarea.input { height: 110px; padding: 14px 16px; resize: none; line-height: 22px; }

/* toast */
#toast { position: absolute; left: 16px; right: 16px; top: calc(var(--top) + 6px); z-index: 80; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #fff;
  font-size: 16px; line-height: 21px; transform: translateY(calc(-100% - var(--top) - 24px)); visibility: hidden; transition: transform 360ms var(--ease), visibility 0s 360ms; pointer-events: none; }
#toast.on { transform: none; visibility: visible; transition: transform 360ms var(--ease); }

/* spinner */
.spin-i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* press feedback everywhere */
.press { transition: transform 160ms var(--ease); }
.press:active { transform: scale(0.97); }

@media (max-height: 700px) {
  .q { font-size: 30px; line-height: 33px; }
  .opt { height: 43px; font-size: 18px; }
  .ex .ask { font-size: 23px; line-height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------- player (design 12) ---------- */
#player { position: absolute; inset: 0; z-index: 70; background: var(--ink); color: #fff; transform: translateY(100%); transition: transform 520ms var(--ease);
  display: flex; flex-direction: column; align-items: center; padding: calc(var(--top) + 10px) 24px calc(var(--bot) + 28px); }
#player.on { transform: none; }
#player:empty { display: none; }
.pl-top { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.pl-x { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; }
.pl-x svg { width: 18px; height: 18px; }
.pl-ctx { font-size: 11px; color: rgba(255,255,255,0.72); text-align: center; flex: 1; padding: 0 8px; }
.pl-rec { position: relative; margin-top: clamp(16px, 5vh, 46px); width: min(300px, 74vw, 36vh); height: min(300px, 74vw, 36vh); border-radius: 50%;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06); flex: 0 0 auto; }
.pl-rec .rec { width: 100% !important; height: 100% !important; }
.pl-rec .rec .spin { transform-origin: 50% 50%; }
.pl-rec .lbl { left: 27% !important; top: 27% !important; width: 46% !important; height: 46% !important; }
.pl-rec .hole { left: 40% !important; top: 40% !important; width: 20% !important; height: 20% !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.pl-sheen { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 20deg, rgba(255,255,255,0) 0deg, rgba(255,255,255,0.34) 30deg, rgba(255,255,255,0) 70deg, rgba(255,255,255,0) 180deg, rgba(255,255,255,0.2) 210deg, rgba(255,255,255,0) 250deg); }
.pl-meta { margin-top: clamp(16px, 4vh, 34px); text-align: center; }
.pl-meta h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.pl-step { margin-top: clamp(12px, 3vh, 28px); text-align: center; min-height: 64px; }
.pl-name { margin-top: 10px; font-size: 21px; line-height: 27px; letter-spacing: -0.02em; }
.pl-bar { width: 100%; margin-top: auto; display: flex; gap: 4px; padding: 10px 0; touch-action: none; }
.pl-bar span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.2); overflow: hidden; }
.pl-bar i { display: block; height: 3px; width: 0; background: #fff; }
.pl-times { width: 100%; display: flex; justify-content: space-between; color: rgba(255,255,255,0.6); letter-spacing: 0.08em; }
.pl-ctl { margin-top: clamp(16px, 4vh, 36px); display: flex; align-items: center; justify-content: center; gap: 48px; }
.pl-skip { position: relative; width: 48px; height: 48px; color: #fff; display: flex; align-items: center; justify-content: center; }
.pl-skip svg { width: 36px; height: 36px; }
.pl-skip b { position: absolute; left: 0; right: 0; top: 18px; text-align: center; font-size: 9px; }
.pl-play { position: relative; width: 84px; height: 84px; border-radius: 50%; }
.pl-play svg { position: absolute; inset: 0; width: 84px; height: 84px; }
.pl-play .pl-pp { position: absolute; left: 8px; top: 8px; width: 68px; height: 68px; border-radius: 50%; background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 11px; letter-spacing: 0.14em; transition: transform 160ms var(--ease); }
.pl-play:active .pl-pp { transform: scale(0.94); }


/* ---------- the thread (one conversation, like Messages) ---------- */
body.kb #tabbar { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.chat .shade.full, .chat > .shade { height: 100%; background: linear-gradient(180deg, rgba(3,20,26,0.72) 0%, rgba(3,20,26,0.45) 45%, rgba(3,20,26,0.35) 100%); }
.cbar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; padding: calc(var(--top) + 6px) 20px 0; pointer-events: none; }
.cbar > * { pointer-events: auto; }
.thread { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--top) + 64px) 20px 14px; display: flex; flex-direction: column;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent calc(var(--top) + 46px), #000 calc(var(--top) + 76px)); mask-image: linear-gradient(180deg, transparent 0, transparent calc(var(--top) + 46px), #000 calc(var(--top) + 76px)); }
.thread::-webkit-scrollbar { display: none; }
.pin { display: none; position: sticky; top: 0; z-index: 2; margin: 0 -6px 16px; }
.pin.on { display: block; }
.tin { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 4px; }
.m { max-width: 100%; }
.m.in { animation: rise 280ms var(--ease) both; }
.m.ns { font-size: 23px; line-height: 28px; font-weight: 700; letter-spacing: -0.025em; color: #fff; max-width: 94%; }
.m.ns.q { font-size: 30px; line-height: 33px; letter-spacing: -0.035em; }
.m.ns.dim { opacity: 0.75; }
.m.ns.sub { font-size: 17px; line-height: 23px; font-weight: 400; opacity: 0.85; letter-spacing: -0.01em; }
.m.me { align-self: flex-end; max-width: 80%; }
.m.me span { display: inline-block; padding: 11px 16px; border-radius: 20px 20px 6px 20px; background: #fff; color: var(--ink); font-size: 17px; line-height: 22px; font-weight: 700; }
.m.stamp { color: rgba(255,255,255,0.8); margin-top: 4px; }
.m.think-m { height: 28px; display: flex; align-items: center; }
.m.think-m svg { width: 20px; height: 22px; animation: think 1.4s linear infinite; }
.m.card-m { max-width: 100%; }
.chat .dock { position: relative; flex: 0 0 auto; background: var(--water); -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3);
  overflow: hidden; transition: height 260ms var(--ease); }
.chat .dock-in { padding: 10px 24px calc(var(--bot) + 18px); }
.chat.tabs .dock-in { padding-bottom: calc(var(--bot) + 92px); }
body.kb .chat .dock-in { padding-bottom: 10px; }
.chat .dock-in:empty { padding-top: 0; padding-bottom: calc(var(--bot) + 8px); }
.chat.tabs .dock-in:empty { padding-bottom: calc(var(--bot) + 86px); }
.dock-lead { font-size: 15px; line-height: 20px; color: rgba(255,255,255,0.8); padding: 6px 0 2px; }
.dock .cont { margin-top: 14px; }
.dock .btn.white svg { width: 13px; height: 13px; }
.dock .link { color: #fff; width: 100%; text-align: center; padding: 14px 0 2px; font-size: 16px; }
.chat .rec-card { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 20px; background: rgba(255,255,255,0.1); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.chat .rec-card .t { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; display: block; }
.chat .rec-card .mono { display: block; margin-top: 6px; color: rgba(255,255,255,0.8); }
.chat .step-single { display: flex; justify-content: flex-start; padding: 6px 0 4px; }
.pin { top: calc(var(--top) + 52px); }
.pin .strip { background: rgba(8,30,38,0.55); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2); }
.thread { -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent calc(var(--top) + 36px), #000 calc(var(--top) + 54px)); mask-image: linear-gradient(180deg, transparent 0, transparent calc(var(--top) + 36px), #000 calc(var(--top) + 54px)); }
/* the strip between the app and the keyboard blends with the water; inputs get no square ring */
html, body { background: #0A2A33; }
input:focus, input:focus-visible, textarea:focus-visible { outline: none; }
.field:focus-within { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.85); }
/* the answers never take over the screen: the conversation stays in view */
.chat .dock-in { max-height: min(56vh, 520px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
body.kb .chat .dock-in { max-height: none; }
.chat .thread { min-height: 30vh; }

/* every tap counts: no double-tap zoom handling, no tap delay */
html, body, button, a, input { touch-action: manipulation; }

.chat .dock-in { transition: opacity 200ms ease-out; }
.chat .dock-in.spent { opacity: 0; pointer-events: none; }

/* the Protocol strip sits in its own place under the top bar, never over the messages */
.chat > .pin { position: relative; z-index: 2; display: none; margin: calc(var(--top) + 56px) 14px 0; top: auto; flex: 0 0 auto; }
.chat > .pin.on { display: block; }
.chat > .pin.on + .thread { padding-top: 14px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px); mask-image: linear-gradient(180deg, transparent 0, #000 22px); }

/* ---------- the stage: one exchange at a time, as the design draws it ---------- */
.chat.stage .above { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: calc(var(--top) + 6px) 20px 14px; }
.chat.stage .cbar { position: relative; padding: 0; z-index: 2; }
.chat.stage .say { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 18px; padding: 0 4px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.chat.stage .say::-webkit-scrollbar { display: none; }
.ex-cur { display: flex; flex-direction: column; gap: 12px; }
.ex-out { position: absolute; left: 4px; right: 4px; pointer-events: none; animation: exout 260ms cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes exout { to { opacity: 0; transform: translateY(-20px); } }
.m.in { animation: rise 340ms var(--ease) both; }
.m.prev { font-size: 15px; line-height: 20px; color: rgba(255,255,255,0.78); }
.m.me { margin-top: -4px; }
.m.me span { -webkit-backdrop-filter: none; backdrop-filter: none; }
.chat.stage .pin { position: relative; top: auto; display: none; margin: 14px -6px 0; flex: 0 0 auto; }
.chat.stage .pin.on { display: block; }
.chat.stage.tight .m.prev, .chat.stage.tight .m.stamp { display: none; }
.dock-cards { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; margin-bottom: 16px; }
.dock-cards .card-m { max-width: 100%; }
/* nothing that moves is live-blurred: blur only on the still water and the strip */
.chat .rec-card, .daycard, .staycard { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: rgba(255,255,255,0.1); }
.fly { will-change: transform, opacity; }
#app { transition: bottom 300ms cubic-bezier(0.2, 0.8, 0.2, 1); }

.dock-lead.q { font-size: 21px; line-height: 26px; font-weight: 700; letter-spacing: -0.02em; color: #fff; padding: 4px 0 6px; }

/* spec: answers are plain text on the photo; only the typed new-need line is a bubble */
.m.me.plain span { background: none; color: #fff; padding: 0; border-radius: 0; font-size: 17px; }
.m.me .n { font-size: 13px; opacity: 0.8; margin-right: 8px; letter-spacing: 0; }
.dock-cards .rn { color: rgba(255,255,255,0.8); }
.dock-cards .rn-l { font-size: 15px; line-height: 20px; color: rgba(255,255,255,0.85); margin: -4px 0 2px; }
.swap-row .was .rec::after { content: ''; position: absolute; left: -8%; right: -8%; top: 50%; height: 2px; background: #fff; transform: rotate(-24deg); }
.swap-row .is { animation: drop 900ms cubic-bezier(0.34, 1.4, 0.5, 1) both; }
