:root {
  --cream: #ece7dd;
  --muted: rgba(236, 231, 221, 0.62);
  --faint: rgba(236, 231, 221, 0.38);
  --gold: #d9b25e;
  --approve: #7fb685;
  --dismiss: #d9776b;
  --sheet: #161618;
  --line: rgba(236, 231, 221, 0.1);
  --sans: 'Bricolage Grotesque', -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--cream); font-family: var(--sans); overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- feed ---------- */
#stage { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card { position: absolute; inset: calc(env(safe-area-inset-top) + 14px) 0 0 0; overflow: hidden; background: #000; will-change: transform;
  display: flex; flex-direction: column; }
.card.fly { transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.card.snap { transition: transform 0.35s var(--ease); }
.screen { position: relative; flex: 1 1 auto; min-height: 0; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.card.textonly .screen { display: none; }

.info { position: relative; flex: 0 0 auto; padding: 14px 76px calc(env(safe-area-inset-bottom) + 18px) 16px; }
.meta { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 8px; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.meta .count { position: absolute; right: 16px; top: 14px; color: var(--faint); }
.info h1 { margin: 0; font-size: 19px; line-height: 1.22; font-weight: 600; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.question { margin: 6px 0 0; font-size: 15px; line-height: 1.35; color: var(--cream); }
.body { display: none; margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; }
.info.open .body { display: block; max-height: 40vh; overflow: auto; }
.info.open h1 { -webkit-line-clamp: unset; }
.approve-label { margin: 10px 0 0; font: 500 11px/1.3 var(--mono); letter-spacing: 0.04em; color: var(--faint); }
.question:empty, .body:empty, .approve-label:empty { display: none !important; }

/* text-only card: the words are the screen */
.card.textonly { background: #0d0d0e; }
.card.textonly .info { flex: 1; padding: 24px 24px calc(env(safe-area-inset-bottom) + 84px); display: flex; flex-direction: column; justify-content: center; }
.card.textonly .info h1 { font-size: 28px; line-height: 1.12; letter-spacing: -0.025em; -webkit-line-clamp: 4; }
.card.textonly .question { font-size: 17px; margin-top: 12px; }
.card.textonly .body { display: block; font-size: 15px; margin-top: 14px; max-height: 40vh; overflow: auto; }

.rail { position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 14px; }
.railbtn { width: 48px; height: 48px; border-radius: 50%; padding: 13px; display: block; color: var(--cream); background: rgba(236, 231, 221, 0.09); }
.railbtn:active { transform: scale(0.94); }

.play { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; padding: 22px 20px 22px 24px;
  border-radius: 50%; color: var(--cream); background: rgba(20, 20, 22, 0.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* swipe mark: one quiet circle that fills as you drag */
.mark { position: fixed; left: 50%; top: 44%; width: 92px; height: 92px; margin: -46px 0 0 -46px; padding: 26px; border-radius: 50%;
  opacity: 0; transform: scale(0.6); pointer-events: none; color: #0b0b0c; z-index: 5; }
.mark.approve { background: var(--approve); }
.mark.dismiss { background: var(--dismiss); }
.mark.later { background: var(--cream); }

/* ---------- top ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; padding-top: env(safe-area-inset-top); pointer-events: none; }
.progress { height: 2px; margin: 6px 16px 0; background: rgba(236,231,221,0.18); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--cream); }
.top-row { position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 22px); }
.count { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--muted); text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.iconbtn { width: 32px; height: 32px; padding: 7px; border-radius: 50%; color: var(--cream); pointer-events: auto;
  background: rgba(20,20,22,0.42); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.iconbtn.big { width: 44px; height: 44px; padding: 11px; background: rgba(236,231,221,0.08); }
.iconbtn.big.rec { background: var(--dismiss); color: #0b0b0c; }

/* ---------- empty ---------- */
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #0d0d0e; }
.empty h2 { margin: 22px 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.empty p { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.logo { width: 40px; height: 40px; border-radius: 50%; border: 5px solid var(--cream); position: relative; }
.logo::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--gold); }

/* ---------- hold to talk ---------- */
.listening { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ring { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--cream); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(0.92); opacity: 0.55; } 50% { transform: scale(1.06); opacity: 1; } }
.live { margin: 0; max-width: 82%; text-align: center; font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; color: var(--cream); min-height: 1.3em; }
.live.idle { font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ---------- reply sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; }
.sheet-inner { width: 100%; background: var(--sheet); border-radius: 16px 16px 0 0; border-top: 1px solid var(--line);
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 14px); animation: up 0.32s var(--ease); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-q { margin: 0 0 12px; font-size: 15px; line-height: 1.35; color: var(--muted); }
.sheet-q:empty { display: none; }
.sheet textarea { width: 100%; background: transparent; color: var(--cream); border: 0; border-bottom: 1px solid var(--line); padding: 4px 0 12px;
  font: 18px/1.4 var(--sans); resize: none; outline: none; }
.sheet textarea::placeholder { color: var(--faint); }
.sheet-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.lang { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--faint); padding: 8px 4px; }
.voice-note { flex: 1; font: 500 11px/1.3 var(--mono); letter-spacing: 0.04em; color: var(--faint); }
.send { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: var(--cream); color: #0b0b0c; }
.send:active { transform: scale(0.94); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 44px); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-radius: 10px; white-space: nowrap;
  background: rgba(22,22,24,0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 14px; animation: drop 0.3s var(--ease); }
@keyframes drop { from { transform: translate(-50%, -8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast button { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); padding: 4px 0; }

/* ---------- first open ---------- */
.intro { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
.intro ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.intro li { font-size: 20px; color: var(--muted); }
.intro b { display: inline-block; width: 72px; font-weight: 600; color: var(--cream); }
.intro p { margin: 0; font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* ---------- desktop: keep the phone shape ---------- */
@media (min-width: 700px) {
  .card, .top { left: 50%; right: auto; width: min(calc(100vh * 9 / 16), 100vw); margin-left: calc(min(calc(100vh * 9 / 16), 100vw) / -2); }
  .sheet { justify-content: center; }
  .sheet-inner { width: min(calc(100vh * 9 / 16), 100vw); }
}

/* ---------- sign in ---------- */
body.login { display: flex; align-items: center; justify-content: center; background: #0d0d0e; overflow: auto; }
.login-box { width: min(320px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 14px; }
.login-box .logo { margin-bottom: 18px; }
.login-box h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.025em; }
.login-box p { margin: 0 0 14px; font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.login-box input { background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--cream); padding: 12px 0; font: 18px var(--sans); outline: none; border-radius: 0; }
.login-box input:focus { border-bottom-color: var(--muted); }
.login-box button { margin-top: 10px; padding: 14px; border-radius: 6px; background: var(--cream); color: #0b0b0c; font-weight: 600; font-size: 15px; }
.login-box button:active { transform: scale(0.98); }
.wrong { color: var(--dismiss) !important; }
.sprite { position: absolute; width: 0; height: 0; }
