/* ==========================================================================
   Rawmistry — design system v2
   Brand: white + vivid red #FF0000. Dark theme is a warm near-black that lets
   the red glow instead of fight. Fonts: Bricolage Grotesque (display) + Figtree (UI).
   ========================================================================== */
:root {
  --red: #FF0000;
  --red-hi: #FF2E2E;
  --red-lo: #D90000;
  --red-ink: #D10000;          /* small red text on white (AA contrast) */
  --red-soft: #FFF0F0;
  --red-soft2: #FFE1E1;
  --red-line: #FFC9C9;
  --on-red: #FFFFFF;

  --bg: #FFFFFF;
  --bg2: #FBF6F6;
  --card: #FFFFFF;
  --card2: #F8F2F2;
  --line: #F0E5E5;
  --line2: #E4D5D5;
  --tx: #1B0F10;
  --tx2: #4B3C3D;
  --mut: #857375;
  --ok: #0E9F6E;
  --warn: #B45309;

  --shadow: 0 1px 2px rgba(70, 10, 10, .06), 0 8px 24px rgba(70, 10, 10, .07);
  --shadow-lg: 0 12px 44px rgba(90, 0, 0, .24);
  --glow: 0 10px 26px rgba(255, 0, 0, .30);

  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --nav-h: 66px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --red-ink: #FF5C5C;
  --red-soft: #2B1214;
  --red-soft2: #3B1719;
  --red-line: #5C2428;
  --bg: #0C0708;
  --bg2: #110A0B;
  --card: #1A1112;
  --card2: #251819;
  --line: #2F2123;
  --line2: #3D2C2E;
  --tx: #FCF2F2;
  --tx2: #DAC8C9;
  --mut: #A39193;
  --ok: #34D399;
  --warn: #FBBF24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-lg: 0 14px 48px rgba(0, 0, 0, .65);
  --glow: 0 10px 30px rgba(255, 0, 0, .38);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); font-size: 16px; line-height: 1.45;
  color: var(--tx); background: var(--bg2);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--red); color: #fff; }

.ic { width: 22px; height: 22px; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 28px; height: 28px; }
.ic-xl { width: 40px; height: 40px; }

/* ---------- Type ---------- */
.h1, .h2, .h3, .display { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.display { font-size: 38px; font-weight: 800; }
.h1 { font-size: 30px; font-weight: 800; }
.h2 { font-size: 22px; font-weight: 700; }
.h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--mut); }
.tx2 { color: var(--tx2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.red { color: var(--red-ink); }
.center { text-align: center; }
.wordmark { font-family: var(--font-display); font-weight: 800; letter-spacing: -.035em; color: var(--red); }
.logo-mark { width: 1em; height: 1em; color: var(--red); display: inline-block; }

/* ---------- Shell ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; display: flex; flex-direction: column; }
.has-nav { padding-bottom: calc(var(--nav-h) + var(--sab)); }
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .06); } }
.page { padding: 4px 20px 28px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--sat)) 14px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar-title { flex: 1; margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -.02em; text-align: center; }
.topbar-right { min-width: 44px; display: flex; justify-content: flex-end; gap: 4px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--tx); transition: background .2s, transform .15s var(--ease); }
.icon-btn:hover { background: var(--red-soft); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.ghost { visibility: hidden; }
.icon-btn.red { color: var(--red); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 16px; font-weight: 700; font-size: 16px; letter-spacing: -.005em; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; user-select: none; text-align: center; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 58px; border-radius: 20px; font-size: 17px; }
.btn-sm { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-primary { background: linear-gradient(180deg, #FF1F1F 0%, #F00 55%, #E40000 100%); color: var(--on-red); box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-outline { border: 2px solid var(--red); color: var(--red-ink); background: transparent; }
.btn-outline:hover { background: var(--red-soft); }
.btn-soft { background: var(--red-soft); color: var(--red-ink); }
.btn-soft:hover { background: var(--red-soft2); }
.btn-plain { background: var(--card2); color: var(--tx); }
.btn-ghost { color: var(--mut); }
.btn-danger { background: transparent; color: var(--red-ink); border: 1.5px solid var(--red-line); }
.btn .ic { width: 20px; height: 20px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 13px; font-weight: 700; color: var(--tx2); }
.input, .select, .textarea { width: 100%; min-height: 54px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line2); background: var(--card); color: var(--tx); font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--mut); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23FF0000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.hint { font-size: 12.5px; color: var(--mut); }
.notice { padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.notice.err { background: var(--red-soft); color: var(--red-ink); border: 1px solid var(--red-line); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.notice.info { background: var(--card2); color: var(--tx2); }

/* ---------- Chips, pills, badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--card2); color: var(--tx2); font-size: 14px; font-weight: 600; border: 1.5px solid transparent; transition: all .18s var(--ease); white-space: nowrap; }
.chip .ic { width: 15px; height: 15px; }
button.chip:active { transform: scale(.95); }
.chip.sel { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 6px 16px rgba(255, 0, 0, .25); }
.chip.goal { background: var(--red-soft); color: var(--red-ink); font-size: 12.5px; padding: 5px 10px; }
.chip.goal.shared { background: var(--red); color: #fff; }
.chip.sm { padding: 5px 10px; font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--red-soft); color: var(--red-ink); }
.vbadge { display: inline-grid; place-items: center; color: #fff; vertical-align: -3px; }
.vbadge .ic { width: 20px; height: 20px; fill: var(--red); stroke: #fff; stroke-width: 2.2; }
.nbadge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 800 11px/18px var(--font-ui); text-align: center; font-style: normal; box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Avatars ---------- */
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--red-soft); color: var(--red-ink); font-family: var(--font-display); font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.av-xs { width: 28px; height: 28px; font-size: 13px; }
.av-sm { width: 40px; height: 40px; font-size: 16px; }
.av-md { width: 54px; height: 54px; font-size: 21px; }
.av-lg { width: 76px; height: 76px; font-size: 28px; }
.av-xl { width: 116px; height: 116px; font-size: 44px; }
.avatar.ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--red); }
.avatar .dot { position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Cards & lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card.flat { box-shadow: none; }
.card.red { background: var(--red); color: #fff; border: 0; box-shadow: var(--glow); }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); position: relative; }
.li:last-child { border-bottom: 0; }
.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 700; display: flex; align-items: center; gap: 5px; }
.li-sub { color: var(--mut); font-size: 14px; }
.li.unread .li-sub { color: var(--tx); font-weight: 600; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 44px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ic-wrap { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--red-soft); color: var(--red); }
.empty p { margin: 0; color: var(--mut); max-width: 270px; }

/* ---------- Segmented, switch ---------- */
.seg { display: flex; background: var(--card2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg > * { flex: 1; text-align: center; padding: 9px 8px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--mut); display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s var(--ease); }
.seg > .on { background: var(--card); color: var(--red-ink); box-shadow: var(--shadow); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--line2); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--red); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--red); outline-offset: 2px; }

/* ---------- Sheet & toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(15, 0, 0, .55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 50%; bottom: 0; z-index: 61; width: min(100%, 480px); max-height: 88dvh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + var(--sab)); transform: translate(-50%, 105%); transition: transform .38s var(--ease); box-shadow: var(--shadow-lg); overscroll-behavior: contain; }
.sheet.open { transform: translate(-50%, 0); }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line2); margin: 0 auto 14px; }
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); top: calc(14px + var(--sat)); width: min(92%, 440px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--tx); color: var(--bg); padding: 13px 16px; border-radius: 16px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: toastIn .35s var(--ease); display: flex; align-items: center; gap: 10px; }
.toast.err { background: var(--red); color: #fff; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--red-soft2); border-top-color: var(--red); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tab bar ---------- */
.tabbar { position: fixed; z-index: 40; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 480px); height: calc(var(--nav-h) + var(--sab)); padding-bottom: var(--sab); display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--mut); transition: color .2s; }
.tab-ic { position: relative; display: grid; place-items: center; width: 28px; height: 28px; }
.tab .ic { width: 25px; height: 25px; transition: transform .25s var(--ease); }
.tab.on { color: var(--red); }
.tab.on .ic { transform: translateY(-1px) scale(1.08); }
.tab.on .tab-ic .ic { fill: color-mix(in srgb, var(--red) 18%, transparent); }

/* ---------- Splash & landing ---------- */
.splash { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(24px + var(--sat)) 28px calc(28px + var(--sab)); text-align: center; position: relative; overflow: hidden; background: #fff; }
[data-theme="dark"] .splash { background: #0C0708; }
.splash::before { content: ""; position: absolute; inset: -20% -30% auto; height: 80%; background: radial-gradient(closest-side, rgba(255, 0, 0, .10), transparent 70%); pointer-events: none; }
[data-theme="dark"] .splash::before { background: radial-gradient(closest-side, rgba(255, 0, 0, .22), transparent 70%); }
.splash-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; position: relative; width: 100%; }
.splash-heart { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.splash-heart .logo-mark { width: 132px; height: 132px; overflow: visible; position: relative; z-index: 2; filter: drop-shadow(0 14px 22px rgba(255, 0, 0, .35)); }
.lm-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lmDraw .95s .15s var(--ease) forwards; }
.lm-fill { opacity: 0; transform-box: fill-box; transform-origin: 50% 55%; animation: lmPop .7s .85s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.lm-shine { opacity: 0; animation: lmShine .5s 1.4s ease forwards; }
.splash-heart .lm-beat { animation: beat 1.8s 2.3s ease-in-out infinite; transform-origin: center; }
.ripple { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--red); opacity: 0; transform: scale(.4); animation: ripple 1.8s var(--ease) infinite; }
.ripple.r1 { animation-delay: 1.15s; } .ripple.r2 { animation-delay: 1.55s; } .ripple.r3 { animation-delay: 1.95s; }
.splash-word { margin: 0; font-size: 56px; line-height: 1; display: flex; justify-content: center; overflow: hidden; padding: 4px 6px 10px; }
.splash-word span { display: inline-block; transform: translateY(110%); opacity: 0; animation: letterUp .6s var(--ease) forwards; animation-delay: calc(1.25s + var(--i) * .055s); }
.splash-word .sp { width: .28em; }
.splash-tag { margin: 0; color: var(--tx2); font-size: 17px; font-weight: 500; max-width: 290px; opacity: 0; animation: fadeUp .6s 1.85s var(--ease) forwards; }
.splash-cta { width: 100%; display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(26px); animation: fadeUp .7s 2.15s var(--ease) forwards; position: relative; }
.splash-fine { font-size: 12px; color: var(--mut); margin: 4px 8px 0; }
.splash.returning .splash-cta { display: none; }
.splash-loader { position: absolute; bottom: calc(46px + var(--sab)); left: 50%; width: 46px; height: 4px; margin-left: -23px; border-radius: 2px; background: var(--red-soft2); overflow: hidden; opacity: 0; animation: fadeUp .4s 1.9s forwards; }
.splash-loader::after { content: ""; display: block; height: 100%; width: 40%; background: var(--red); border-radius: 2px; animation: load 1s ease-in-out infinite; }
.splash.leaving { animation: leave .45s var(--ease) forwards; }
.splash.quick *, .splash.quick *::before, .splash.quick *::after { animation-delay: 0s !important; animation-duration: .45s !important; }
.splash.quick .splash-word span { animation-delay: calc(var(--i) * .02s) !important; }
.vh { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; pointer-events: none; }
.goal-tile:focus-within, label.chip:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
@keyframes lmDraw { to { stroke-dashoffset: 0; } }
@keyframes lmPop { 0% { opacity: 0; transform: scale(.5); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes lmShine { to { opacity: .55; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.07); } 28% { transform: scale(1); } 42% { transform: scale(1.05); } 70% { transform: scale(1); } }
@keyframes ripple { 0% { opacity: .5; transform: scale(.5); } 100% { opacity: 0; transform: scale(2.1); } }
@keyframes letterUp { to { transform: none; opacity: 1; } }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
@keyframes load { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes leave { to { opacity: 0; transform: scale(1.03); } }

/* ---------- Onboarding / goals ---------- */
.steps { display: flex; gap: 6px; margin: 4px 0 6px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line2); transition: background .3s; }
.steps i.on { background: var(--red); }
.goal-grid { display: flex; flex-direction: column; gap: 10px; }
.goal-tile { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 15px 16px; border-radius: 20px; border: 2px solid var(--line2); background: var(--card); transition: all .2s var(--ease); }
.goal-tile .g-ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); flex: none; transition: all .2s; }
.goal-tile .g-title { font-weight: 800; font-size: 16px; }
.goal-tile .g-desc { font-size: 13.5px; color: var(--mut); line-height: 1.3; }
.goal-tile .g-check { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; color: transparent; flex: none; transition: all .2s var(--ease); }
.goal-tile .g-check .ic { width: 15px; height: 15px; stroke-width: 3.5; }
.goal-tile.sel { border-color: var(--red); background: var(--red-soft); }
.goal-tile.sel .g-ic { background: var(--red); color: #fff; }
.goal-tile.sel .g-check { background: var(--red); border-color: var(--red); color: #fff; transform: scale(1.08); }
.goal-tile:active { transform: scale(.985); }
.goal-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--card2); color: var(--tx2); font-size: 13.5px; }
.goal-note .ic { color: var(--red); margin-top: 1px; }
.step-pane { display: none; }
.step-pane.on { display: flex; flex-direction: column; gap: 14px; animation: paneIn .35s var(--ease); }
@keyframes paneIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ---------- Discover ---------- */
.disc { height: calc(100dvh - var(--nav-h) - var(--sab)); display: flex; flex-direction: column; }
.disc-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--sat)) 18px 6px; }
.disc-top .wordmark { font-size: 27px; display: flex; align-items: center; gap: 7px; }
.disc-top .wordmark .logo-mark { font-size: 26px; }
.goalbar { display: flex; gap: 8px; overflow-x: auto; padding: 6px 18px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.goalbar::-webkit-scrollbar { display: none; }
.goalbar .chip { scroll-snap-align: start; border-color: var(--line2); background: var(--card); }
.goalbar .chip.sel { border-color: var(--red); background: var(--red); }
.deck { position: relative; flex: 1; min-height: 0; margin: 2px 12px 0; }
.dcard { position: absolute; inset: 0; border-radius: 30px; overflow: hidden; background: #1a1112; box-shadow: var(--shadow-lg); touch-action: pan-y; will-change: transform; transform-origin: 50% 110%; user-select: none; -webkit-user-select: none; cursor: grab; }
.dcard.back1 { transform: translateY(10px) scale(.95); filter: brightness(.9); pointer-events: none; transition: transform .35s var(--ease), filter .35s; }
.dcard.back2 { transform: translateY(20px) scale(.90); filter: brightness(.8); pointer-events: none; }
.dcard.fly { transition: transform .45s var(--ease), opacity .45s; }
.dcard.snap { transition: transform .35s var(--ease); }
.dcard .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dcard .ph-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #FF3A3A, #B30000); color: rgba(255, 255, 255, .92); font: 800 120px var(--font-display); }
.dcard .scrim-g { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(12, 0, 0, .92) 0%, rgba(12, 0, 0, .55) 30%, rgba(12, 0, 0, 0) 56%), linear-gradient(to bottom, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0) 20%); }
.pbars { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 3; }
.pbars i { flex: 1; height: 3.5px; border-radius: 2px; background: rgba(255, 255, 255, .38); }
.pbars i.on { background: #fff; }
.dinfo { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 20px 20px; color: #fff; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.dname { font: 800 31px/1.05 var(--font-display); letter-spacing: -.025em; display: flex; align-items: center; gap: 8px; margin: 0; text-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.dname small { font-weight: 600; font-size: 26px; opacity: .92; }
.dmeta { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; opacity: .95; flex-wrap: wrap; }
.dmeta .ic { width: 15px; height: 15px; }
.dmeta .live { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .3); }
.dbio { font-size: 14.5px; line-height: 1.35; opacity: .94; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.dgoals { display: flex; gap: 6px; flex-wrap: wrap; }
.dgoals .chip.goal { background: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .22); }
.dgoals .chip.goal.shared { background: var(--red); border-color: var(--red); }
.voice-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: #1B0F10; font-weight: 700; font-size: 13.5px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.voice-pill .vp-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; }
.voice-pill .vp-btn .ic { width: 14px; height: 14px; }
.voice-pill .bars { display: inline-flex; align-items: center; gap: 2.5px; height: 16px; }
.voice-pill .bars i { width: 3px; border-radius: 2px; background: var(--red); height: 5px; }
.voice-pill.playing .bars i { animation: eq .9s ease-in-out infinite; }
.voice-pill.playing .bars i:nth-child(2) { animation-delay: .15s; } .voice-pill.playing .bars i:nth-child(3) { animation-delay: .3s; } .voice-pill.playing .bars i:nth-child(4) { animation-delay: .45s; } .voice-pill.playing .bars i:nth-child(5) { animation-delay: .6s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 16px; } }
.stamp { position: absolute; top: 44px; z-index: 4; padding: 6px 16px; border: 4px solid; border-radius: 12px; font: 800 28px var(--font-display); letter-spacing: .02em; text-transform: uppercase; opacity: 0; pointer-events: none; }
.stamp.vibe { left: 22px; color: #fff; border-color: #fff; background: var(--red); transform: rotate(-12deg); }
.stamp.nope { right: 22px; color: #fff; border-color: rgba(255, 255, 255, .85); transform: rotate(12deg); background: rgba(20, 0, 0, .55); }
.actions { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 14px 0 12px; }
.act { display: grid; place-items: center; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .15s var(--ease), box-shadow .2s; color: var(--mut); }
.act:active { transform: scale(.88); }
.act-pass { width: 62px; height: 62px; color: var(--tx2); }
.act-pass .ic { width: 28px; height: 28px; stroke-width: 2.6; }
.act-vibe { width: 78px; height: 78px; background: linear-gradient(180deg, #FF2A2A, #F00 60%, #DD0000); color: #fff; border: 0; box-shadow: var(--glow); }
.act-vibe .ic { width: 36px; height: 36px; fill: #fff; }
.act-info { width: 48px; height: 48px; color: var(--red); }
.deck-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 30px; }
.deck-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.radar { position: relative; width: 120px; height: 120px; display: grid; place-items: center; color: var(--red); }
.radar::before, .radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--red); animation: ripple 2.2s var(--ease) infinite; }
.radar::after { animation-delay: 1.1s; }
.radar .ic { width: 44px; height: 44px; fill: var(--red); }

/* ---------- Vibe check cards ---------- */
.vc-stage { position: relative; min-height: 430px; margin-top: 8px; }
.vc-card { position: absolute; inset: 0; border-radius: 28px; padding: 22px 18px; background: var(--card); border: 1.5px solid var(--red-line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; transition: transform .45s var(--ease), opacity .4s; }
.vc-card.next { transform: translateY(12px) scale(.96); opacity: .6; pointer-events: none; }
.vc-card.later { transform: translateY(22px) scale(.92); opacity: 0; pointer-events: none; }
.vc-card.gone-l { transform: translateX(-125%) rotate(-12deg); opacity: 0; pointer-events: none; }
.vc-card.gone-r { transform: translateX(125%) rotate(12deg); opacity: 0; pointer-events: none; }
.vc-cat { align-self: flex-start; }
.vc-q { font: 700 21px/1.2 var(--font-display); letter-spacing: -.015em; margin: 2px 0 4px; }
.opt { width: 100%; text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--card2); border: 1.5px solid transparent; font-weight: 600; font-size: 15px; transition: all .18s var(--ease); display: flex; gap: 12px; align-items: center; }
.opt:hover { border-color: var(--red-line); }
.opt:active { transform: scale(.98); }
.opt.picked { background: var(--red); color: #fff; border-color: var(--red); }
.opt .ltr { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--card); color: var(--red-ink); font-weight: 800; font-size: 13px; flex: none; }
.opt.picked .ltr { background: rgba(255, 255, 255, .25); color: #fff; }

/* ---------- Match celebration ---------- */
.celebrate { min-height: 100dvh; background: radial-gradient(120% 80% at 50% 0%, #FF3B3B 0%, #F00 45%, #B80000 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; padding: 30px 26px calc(30px + var(--sab)); overflow: hidden; position: relative; }
.celebrate .big { font: 800 52px/1 var(--font-display); letter-spacing: -.035em; margin: 0; animation: popIn .8s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
.pair { display: flex; align-items: center; justify-content: center; margin: 4px 0; }
.pair .avatar { width: 128px; height: 128px; border: 5px solid #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); font-size: 48px; background: #fff; }
.pair .avatar:first-child { transform: rotate(-7deg) translateX(14px); animation: slideL .8s .1s var(--ease) both; }
.pair .avatar:last-child { transform: rotate(7deg) translateX(-14px); animation: slideR .8s .1s var(--ease) both; z-index: 2; }
.pair .heart-mid { position: absolute; z-index: 5; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--red); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0, 0, 0, .3); animation: popIn .7s .8s cubic-bezier(.3, 1.8, .5, 1) both; }
.pair .heart-mid .ic { fill: var(--red); }
.score-ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #E40000; }
.score-ring b { position: relative; font: 800 24px var(--font-display); }
.celebrate .btn-primary { background: #fff; color: var(--red-lo); box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.celebrate .btn-ghost { color: rgba(255, 255, 255, .85); }
@keyframes popIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes slideL { from { opacity: 0; transform: rotate(-7deg) translateX(-120px); } }
@keyframes slideR { from { opacity: 0; transform: rotate(7deg) translateX(120px); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

/* ---------- Chat ---------- */
.chat { height: 100dvh; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--sat)) 10px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
.chat-head .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.chat-head .who b { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 4px; }
.chat-head .who small { color: var(--mut); font-size: 12.5px; display: block; }
.chat-tools { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.chat-tools::-webkit-scrollbar { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 6px; background: var(--bg2); overscroll-behavior: contain; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 20px; font-size: 15.5px; line-height: 1.35; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; animation: bub .25s var(--ease); }
.bubble.me { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble time { display: block; font-size: 10.5px; opacity: .65; margin-top: 3px; text-align: right; }
.sys { align-self: center; font-size: 12px; color: var(--mut); text-align: center; padding: 6px 12px; }
@keyframes bub { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + var(--sab)); background: var(--bg); border-top: 1px solid var(--line); }
.composer .input { min-height: 46px; padding: 11px 16px; border-radius: 24px; resize: none; max-height: 120px; line-height: 1.3; }
.send { width: 46px; height: 46px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--glow); transition: transform .15s var(--ease); }
.send:active { transform: scale(.9); }
.send[disabled] { opacity: .4; box-shadow: none; }
.spark-card { align-self: stretch; background: var(--card); border: 1.5px solid var(--red-line); border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; animation: bub .35s var(--ease); box-shadow: var(--shadow); }
.spark-head { display: flex; align-items: center; gap: 8px; color: var(--red-ink); font-weight: 800; font-size: 12.5px; letter-spacing: .01em; }
.spark-q { font: 700 18px/1.25 var(--font-display); margin: 0; letter-spacing: -.01em; }
.reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reveal > div { padding: 10px 12px; border-radius: 14px; background: var(--card2); font-size: 14.5px; }
.reveal > div b { display: block; font-size: 11.5px; color: var(--mut); margin-bottom: 2px; }
.reveal > div.mine { background: var(--red-soft); }
.reveal > div.mine b { color: var(--red-ink); }
.locked { filter: blur(6px); user-select: none; }
.nudge { display: flex; gap: 12px; align-items: center; margin: 4px 0; padding: 12px 14px; border-radius: 18px; background: var(--red-soft); border: 1px dashed var(--red-line); }
.nudge .ic { color: var(--red); }

/* ---------- Voice recorder ---------- */
.rec { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.rec-btn { width: 92px; height: 92px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; box-shadow: var(--glow); position: relative; transition: transform .2s var(--ease); }
.rec-btn .ic { width: 38px; height: 38px; }
.rec-btn.on { animation: recPulse 1.2s ease-in-out infinite; }
@keyframes recPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, .5); } 100% { box-shadow: 0 0 0 26px rgba(255, 0, 0, 0); } }
.rec-time { font: 800 34px var(--font-display); font-variant-numeric: tabular-nums; }
.rec-meter { width: 100%; height: 8px; border-radius: 4px; background: var(--red-soft2); overflow: hidden; }
.rec-meter i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s linear; }

/* ---------- Rooms, games, dates, couples ---------- */
.event { display: flex; flex-direction: column; gap: 12px; padding: 18px; position: relative; overflow: hidden; }
.event .type { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12.5px; color: var(--red-ink); }
.event h3 { margin: 0; font: 800 20px/1.15 var(--font-display); letter-spacing: -.02em; }
.seats { display: flex; align-items: center; }
.seats .avatar { width: 28px; height: 28px; font-size: 12px; margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.seats .avatar:first-child { margin-left: 0; }
.cap { height: 6px; border-radius: 3px; background: var(--red-soft2); overflow: hidden; flex: 1; }
.cap i { display: block; height: 100%; background: var(--red); border-radius: 3px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12px; color: #fff; background: var(--red); padding: 3px 10px; border-radius: 999px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.prompt-box { background: var(--red); color: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--glow); display: flex; flex-direction: column; gap: 12px; }
.prompt-box h2 { margin: 0; font: 800 22px/1.15 var(--font-display); letter-spacing: -.02em; }
.vote { position: relative; overflow: hidden; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .3); font-weight: 700; color: #fff; }
.vote i { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, .28); width: 0; transition: width .5s var(--ease); }
.vote span { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.vote.mine { background: #fff; color: var(--red-lo); border-color: #fff; }
.vote.mine i { background: var(--red-soft2); }
.game-tile { display: flex; gap: 14px; align-items: center; padding: 16px; text-align: left; width: 100%; }
.game-tile .g-ic { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: var(--red); color: #fff; flex: none; box-shadow: var(--glow); }
.game-tile.soon { opacity: .55; }
.game-tile.soon .g-ic { background: var(--card2); color: var(--mut); box-shadow: none; }
.idea { text-align: left; padding: 14px; border-radius: 18px; border: 2px solid var(--line2); background: var(--card); display: flex; flex-direction: column; gap: 4px; transition: all .18s var(--ease); }
.idea .ic { color: var(--red); }
.idea b { font-size: 14.5px; line-height: 1.15; }
.idea small { color: var(--mut); font-size: 12px; line-height: 1.25; }
.idea.sel { border-color: var(--red); background: var(--red-soft); }
.date-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--card2); color: var(--tx2); }
.status-pill.accepted { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.status-pill.proposed { background: var(--red-soft); color: var(--red-ink); }
.status-pill.declined, .status-pill.cancelled { background: var(--card2); color: var(--mut); text-decoration: line-through; }
.us-hero { position: relative; overflow: hidden; border-radius: 0 0 36px 36px; background: radial-gradient(120% 90% at 50% 0%, #FF3B3B 0%, #F00 50%, #C20000 100%); color: #fff; text-align: center; padding: calc(18px + var(--sat)) 22px 30px; }
.us-hero .days { font: 800 76px/1 var(--font-display); letter-spacing: -.04em; margin: 8px 0 0; }
.us-hero .pair { margin: 10px 0 0; }
.us-hero .pair .avatar { width: 84px; height: 84px; font-size: 32px; border-width: 4px; }
.us-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 18px 4px; scrollbar-width: none; }
.us-tabs::-webkit-scrollbar { display: none; }
.milestone { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.milestone .when { width: 56px; text-align: center; border-radius: 14px; background: var(--red-soft); color: var(--red-ink); padding: 6px 0; flex: none; }
.milestone .when b { display: block; font: 800 22px/1 var(--font-display); }
.milestone .when small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.memory { overflow: hidden; }
.memory img { width: 100%; max-height: 300px; object-fit: cover; }
.check { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line2); display: grid; place-items: center; flex: none; color: transparent; transition: all .2s var(--ease); }
.check.on { background: var(--red); border-color: var(--red); color: #fff; }
.check .ic { width: 15px; height: 15px; stroke-width: 3.5; }
.todo-done { text-decoration: line-through; color: var(--mut); }
.progress-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--red) calc(var(--p) * 1%), var(--red-soft2) 0); position: relative; flex: none; }
.progress-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--card); }
.progress-ring b { position: relative; font: 800 15px var(--font-display); }
.verify-cam { position: relative; border-radius: 28px; overflow: hidden; background: #000; aspect-ratio: 3/4; }
.verify-cam video, .verify-cam img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.verify-cam img { transform: none; }
.pose-tag { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .95); color: #1B0F10; border-radius: 16px; font-weight: 700; text-align: center; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 18px; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; }
.stat b { display: block; font: 800 30px var(--font-display); color: var(--red-ink); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--mut); padding: 8px 10px; border-bottom: 1px solid var(--line2); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl-wrap { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .splash-word span, .splash-tag, .splash-cta, .lm-fill, .lm-shine { opacity: 1 !important; transform: none !important; }
  .lm-stroke { stroke-dashoffset: 0 !important; }
}

/* radio segments built from labels */
.seg > label { cursor: pointer; }
.seg > label.on { background: var(--card); color: var(--red-ink); box-shadow: var(--shadow); }
.seg > label:focus-within { outline: 3px solid var(--red); outline-offset: 1px; }

body.no-scroll { overflow: hidden; }
.dcard { touch-action: none; }
