:root {
  --bg: #0d0a17;
  --bg-2: #151026;
  --panel: #1a1430;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f3ff;
  --muted: #a9a2c2;
  --pink: #ff4fa3;
  --amber: #ffb020;
  --violet: #7c4dff;
  --grad: linear-gradient(100deg, #ff4fa3 0%, #ffb020 50%, #8f5cff 100%);
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(124, 77, 255, 0.28), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(255, 79, 163, 0.16), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 10px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 21px var(--display); letter-spacing: -0.02em; }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px 9px 9px 3px; background: var(--grad); box-shadow: 0 6px 24px rgba(255, 79, 163, 0.4); }
.top-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.top-link:hover { color: var(--text); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 700; font-size: 15px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--grad); color: #160b24; box-shadow: 0 10px 30px rgba(255, 79, 163, 0.35); }
.btn.primary:hover { box-shadow: 0 12px 38px rgba(255, 176, 32, 0.4); }
.btn.ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.14); }
.btn.light { background: #fff; color: #160b24; }
.btn.outline { background: transparent; border: 2px solid currentColor; }

/* Landing */
.landing { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding: 40px 0 64px; }
.hero h1 { font-size: clamp(52px, 8.5vw, 104px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(17px, 2vw, 19px); color: #d7d1ea; max-width: 34em; margin: 22px 0 28px; }

.drop {
  position: relative;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.drop.is-over { border-color: var(--amber); background: rgba(255, 176, 32, 0.08); transform: scale(1.01); }
.drop.is-busy .drop-actions { opacity: 0.4; pointer-events: none; }
.drop-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; }
.drop-icon svg { width: 30px; height: 30px; fill: none; stroke: #160b24; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font: 800 22px var(--display); margin: 0; }
.drop-help { color: var(--muted); margin: 4px 0 18px; font-size: 14px; }
.drop-help b { color: var(--text); font-weight: 600; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.status { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; font-weight: 600; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--amber); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 77, 109, 0.14); border: 1px solid rgba(255, 77, 109, 0.4); color: #ffd3dc; }
.options { display: grid; gap: 8px; margin-top: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check b { color: var(--text); font-weight: 600; }
.check input { accent-color: var(--pink); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }

/* Decorative stacked slides */
.preview { position: relative; height: 520px; width: min(100%, 430px); justify-self: center; }
.phone {
  position: absolute; width: 250px; height: 440px; border-radius: 30px; padding: 30px 24px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.15);
}
.phone b { font: 800 54px/1 var(--display); letter-spacing: -0.03em; }
.phone small { font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; opacity: 0.8; }
.phone span { font-weight: 700; font-size: 18px; }
.phone.p1 { left: 0; top: 70px; transform: rotate(-7deg); background: linear-gradient(160deg, #d4ff3a, #18b36b); color: #0d0a17; z-index: 3; animation: float 7s ease-in-out infinite; }
.phone.p2 { left: 90px; top: 30px; transform: rotate(4deg); background: linear-gradient(160deg, #3d7bff, #7a2cf0); z-index: 2; animation: float 7s ease-in-out -2.3s infinite; }
.phone.p3 { left: 175px; top: 0; transform: rotate(12deg); background: linear-gradient(160deg, #ff6a1a, #e8125c); z-index: 1; animation: float 7s ease-in-out -4.6s infinite; }
.phone .tag { position: absolute; top: 22px; right: 20px; font-size: 44px; }
@keyframes float { 50% { translate: 0 -12px; } }

/* Info */
.info { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-bottom: 72px; }
.how, .privacy, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; min-width: 0; }
.info h2 { font-size: 28px; margin-bottom: 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: #160b24; border-color: #fff; }
.how ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: #d7d1ea; }
.how .muted { font-size: 14px; margin: 12px 0 0; }
.shortcut { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.shortcut summary { cursor: pointer; }
.shortcut ol { margin-top: 10px; font-size: 14px; }
.shortcut .btn { margin-top: 12px; }
code { font-size: 0.9em; background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.notice { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: rgba(61, 242, 192, 0.12); border: 1px solid rgba(61, 242, 192, 0.4); color: #d6fff2; }
.privacy ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; color: #d7d1ea; }
.privacy b { color: var(--text); }
body.has-results .landing, body.has-results .info { display: none; }

/* Dashboard */
.dashboard { padding: 16px 0 64px; display: grid; gap: 20px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.dash-head h2 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; overflow-wrap: anywhere; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; display: grid; gap: 2px; }
.tile span { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile b { font: 800 clamp(24px, 6vw, 32px)/1.1 var(--display); letter-spacing: -0.02em; }
.tile small { color: var(--muted); }
.panel h3 { font-size: 22px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; }

.ai-panel { background: linear-gradient(135deg, rgba(124, 77, 255, 0.35), rgba(255, 79, 163, 0.25)), var(--panel); }
.ai-panel .vibe { font: 800 clamp(26px, 4vw, 38px)/1.1 var(--display); margin: 0 0 8px; }
.personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin: 16px 0; }
.personas > div { background: rgba(0, 0, 0, 0.22); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; }
.personas em { font-style: normal; color: var(--amber); font-weight: 700; }
.personas span { color: #d7d1ea; font-size: 14px; }

.table-wrap { overflow-x: auto; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
tbody th { font-weight: 600; width: 34%; }
td small { color: var(--muted); margin-left: 6px; }
.who { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.meter { display: block; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); margin-top: 6px; max-width: 260px; }
.meter i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--grad); }

.heatmap { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10px; color: var(--muted); }
.heatmap i { aspect-ratio: 1; border-radius: 3px; background: rgba(255, 79, 163, var(--o)); }
.heatmap .hx { white-space: nowrap; overflow: visible; min-width: 0; }
.heatmap .hy { align-self: center; }
.timeline { display: flex; align-items: flex-end; gap: 4px; height: 190px; }
.tl-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.tl-col i { width: 100%; height: var(--h); border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--amber), var(--pink)); }
.tl-col span { font-size: 11px; color: var(--muted); height: 14px; }
.cloud { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.cloud span { font: 700 calc(15px * var(--s)) var(--display); }
.cloud span:nth-child(3n + 1) { color: var(--pink); }
.cloud span:nth-child(3n + 2) { color: var(--amber); }
.emoji-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.emoji-list li { background: rgba(255, 255, 255, 0.05); border-radius: 14px; padding: 10px; display: grid; justify-items: center; }
.emoji-list span { font-size: 34px; line-height: 1.2; }
.emoji-list b { font-size: 13px; color: var(--muted); }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.award { background: rgba(255, 255, 255, 0.05); border-radius: 18px; padding: 16px; display: grid; gap: 2px; }
.a-emoji { font-size: 30px; }
.award span:not(.a-emoji) { font-weight: 700; color: var(--amber); }
.award small, .moments small { color: var(--muted); }
.moments { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.moments > div { background: rgba(255, 255, 255, 0.05); border-radius: 18px; padding: 16px; display: grid; gap: 4px; min-width: 0; }
.moments span { color: var(--muted); font-size: 13px; font-weight: 600; }
.moments b { font: 800 22px/1.2 var(--display); overflow-wrap: anywhere; }
.moments .first b { font: 600 16px/1.4 var(--body); }

/* Story */
.story { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(6, 4, 12, 0.9); backdrop-filter: blur(10px); animation: fade 0.25s; }
@keyframes fade { from { opacity: 0; } }
.story-card {
  --from: #ff4fa3; --to: #6a2cf0;
  position: relative; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  width: min(100vw, calc(94dvh * 9 / 16)); height: min(100dvh, 94dvh); border-radius: 28px;
  background: linear-gradient(165deg, var(--from), var(--to));
  color: #fff; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); cursor: pointer;
}
.story-card[data-ink="dark"] { color: #120a1f; }
.story-card::before, .story-card::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; mix-blend-mode: soft-light; }
.story-card::before { width: 75%; aspect-ratio: 1; right: -25%; top: -12%; background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 65%); animation: drift 12s ease-in-out infinite; }
.story-card::after { width: 90%; aspect-ratio: 1; left: -40%; bottom: -25%; border: 26px solid rgba(255, 255, 255, 0.35); animation: drift 15s ease-in-out -5s infinite reverse; }
@keyframes drift { 50% { transform: translate(-8%, 6%) scale(1.08); } }
.story-bars { position: absolute; top: 14px; left: 14px; right: 56px; display: flex; gap: 4px; z-index: 3; }
.story-bars span { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.story-card[data-ink="dark"] .story-bars span { background: rgba(18, 10, 31, 0.2); }
.story-bars i { display: block; height: 100%; width: 0; background: currentColor; }
.story-close { position: absolute; top: 4px; right: 8px; z-index: 4; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; cursor: pointer; color: inherit; }
.story-paused { position: absolute; bottom: 18px; left: 50%; translate: -50% 0; z-index: 3; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 13px; font-weight: 700; opacity: 0; transition: opacity 0.2s; }
.story-card.is-paused .story-paused { opacity: 1; }
.story-stage { position: absolute; inset: 0; z-index: 2; display: flex; }
.story-slide { flex: 1; display: flex; flex-direction: column; justify-content: safe center; padding: 64px 24px 56px; overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: none; }
.story-slide::-webkit-scrollbar { display: none; }
.story-slide > * > * { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 110ms); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.s-center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.s-eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 13px; font-weight: 800; margin: 0 0 12px; opacity: 0.85; }
.s-title { font: 800 clamp(26px, 7.5vw, 38px)/1.08 var(--display); letter-spacing: -0.025em; margin: 0 0 12px; overflow-wrap: anywhere; }
.s-title.xl { font-size: clamp(36px, 11vw, 58px); }
.s-big { font: 800 clamp(72px, 24vw, 132px)/0.9 var(--display); letter-spacing: -0.05em; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.s-big.md { font-size: clamp(52px, 16vw, 84px); }
.s-sub { font-size: 18px; font-weight: 600; margin: 0 0 10px; opacity: 0.92; }
.s-note { font-size: 15px; font-weight: 500; margin: 14px 0 0; opacity: 0.85; }
.s-hint { margin-top: 36px; font-weight: 700; opacity: 0.8; animation: nudge 1.6s ease-in-out infinite !important; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.s-bars { display: grid; gap: 10px; margin-top: 10px; }
.s-bar { display: grid; grid-template-columns: minmax(0, 0.9fr) 1.4fr auto; align-items: center; gap: 10px; font-weight: 700; }
.s-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-bar-track { height: 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.story-card[data-ink="dark"] .s-bar-track { background: rgba(18, 10, 31, 0.14); }
.s-bar-track i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: currentColor; animation: grow 1s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.s-split { height: 54px; border-radius: 16px; background: rgba(18, 10, 31, 0.2); overflow: hidden; margin-top: 14px; }
.s-split i { display: block; height: 100%; width: var(--w); background: currentColor; animation: grow 1.1s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left; }
.s-split-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-weight: 600; }
.s-split-legend b { font: 800 26px var(--display); }
.s-heat { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin: 18px 0 0; }
.s-heat i { aspect-ratio: 1; border-radius: 2px; background: currentColor; opacity: var(--o); }
.s-words { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 8px; }
.s-words span { font: 800 calc(17px * var(--s))/1.15 var(--display); letter-spacing: -0.02em; }
.s-emoji-hero { font-size: clamp(110px, 34vw, 170px); line-height: 1.1; margin: 0; animation: pop 0.9s cubic-bezier(0.3, 1.6, 0.5, 1) both !important; }
@keyframes pop { from { transform: scale(0.2) rotate(-20deg); opacity: 0; } }
.s-emoji-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.s-emoji-row span { display: grid; justify-items: center; }
.s-emoji-row i { font-style: normal; font-size: 40px; }
.s-emoji-row small { font-weight: 700; opacity: 0.85; }
.s-awards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.s-awards > * { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 120ms + 200ms); }
.s-award { background: rgba(255, 255, 255, 0.16); border-radius: 16px; padding: 10px 12px; display: grid; gap: 1px; min-width: 0; }
.s-award b { font: 800 15px/1.15 var(--display); }
.s-award span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-award small { font-size: 12px; opacity: 0.85; line-height: 1.3; }
.s-award-emoji { font-size: 22px; }
.s-ai { display: flex; flex-direction: column; }
.quote::before { content: "“"; }
.quote::after { content: "”"; }
.s-personas { display: grid; gap: 8px; margin-top: 6px; }
.s-personas > div { background: rgba(255, 255, 255, 0.13); border-radius: 14px; padding: 10px 12px; display: grid; font-size: 14px; animation: rise 0.6s both; animation-delay: calc(var(--i, 0) * 140ms + 200ms); }
.s-shimmer { display: grid; gap: 12px; margin: 10px 0; }
.s-shimmer i, .panel .s-shimmer i { display: block; height: 22px; border-radius: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.s-shimmer i:nth-child(1) { height: 46px; width: 85%; }
.s-shimmer i:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.s-card-img { width: min(72%, 300px); aspect-ratio: 1080 / 1350; border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); background: rgba(255, 255, 255, 0.08); margin-bottom: 18px; }
.s-actions { display: grid; gap: 8px; width: min(100%, 300px); }
.s-actions .btn { padding: 11px 18px; }

/* Footer */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 14px; }

@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; padding-top: 16px; }
  .preview { display: none; }
  .info { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .story-card { width: 100vw; height: 100dvh; border-radius: 0; }
  .drop { padding: 22px 16px; }
  .how, .privacy, .panel { padding: 20px; border-radius: 20px; }
  .heatmap { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .heatmap .hx { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

.notfound { padding: 120px 0; text-align: center; }
.notfound h1 { font-size: 64px; margin-bottom: 12px; }

/* Story additions */
.s-title.ai-vibe { font-size: clamp(26px, 7.5vw, 38px); }
.s-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.s-personas.s-scroll { max-height: 42vh; padding-right: 4px; }
.s-roll-wrap { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.s-roll { list-style: none; margin: 4px 0 0; padding: 0 4px 0 0; display: grid; gap: 6px; max-height: 58vh; }
.s-roll li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 8px 12px; }
.s-roll li.is-you { background: rgba(255, 255, 255, 0.28); outline: 2px solid rgba(255, 255, 255, 0.7); }
.s-roll-rank { font: 800 16px var(--display); opacity: 0.8; }
.s-roll-body { display: grid; min-width: 0; }
.s-roll-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-roll-body span { font-size: 12.5px; opacity: 0.85; line-height: 1.3; }
.s-roll-num { text-align: right; font: 800 16px var(--display); display: grid; }
.s-roll-num small { font: 600 11px var(--body); opacity: 0.75; }
.s-phrases { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; width: 100%; text-align: left; }
.s-phrases li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.18); font-weight: 700; }
.story-card[data-ink="dark"] .s-phrases li { background: rgba(18, 10, 31, 0.1); }
.s-phrases li span { overflow-wrap: anywhere; }

/* Setup sheet: who are you, which period */
.setup { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(6, 4, 12, 0.85); backdrop-filter: blur(8px); animation: fade 0.2s; }
.setup-card { width: min(520px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 24px; display: grid; gap: 18px; }
.setup-card h2 { font-size: 26px; overflow-wrap: anywhere; }
.setup-card h3 { font: 700 14px var(--body); color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip[aria-pressed="true"] { background: #fff; color: #160b24; border-color: #fff; }
.setup-card .btn { width: 100%; }

/* Dashboard additions */
.period { display: flex; flex-wrap: wrap; gap: 6px; }
.people-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.pcard { background: rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; min-width: 0; }
.pcard.is-you { outline: 2px solid var(--amber); }
.pcard header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pcard header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .sig { color: var(--amber); font-weight: 700; font-size: 14px; }
.pcard dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.pcard dt { color: var(--muted); }
.pcard dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.people-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.people-tools input { flex: 1; min-width: 180px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: inherit; font: inherit; }
.duo-list, .phrase-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.duo-list li, .phrase-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: rgba(255, 255, 255, 0.05); border-radius: 12px; }
.table-wrap.tall { max-height: 460px; overflow: auto; }
.table-wrap.tall thead th { position: sticky; top: 0; background: var(--panel); }
tr.is-you th, tr.is-you td { background: rgba(255, 176, 32, 0.1); }
.dash-head .period { margin-top: 12px; }

/* Calendar (story + dashboard) */
.cal { display: grid; grid-template-columns: repeat(var(--weeks), minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 2px; margin-top: 12px; }
.cal i { aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.cal i.on { background: rgba(255, 255, 255, var(--o)); }
.cal i.out { background: transparent; }
.dashboard .cal { gap: 3px; min-width: 640px; }
.dashboard .cal i { border-radius: 3px; background: rgba(255, 255, 255, 0.05); }
.dashboard .cal i.on { background: rgba(255, 79, 163, var(--o)); }
.dashboard .cal i.out { background: transparent; }
.cal-scroll { overflow-x: auto; padding-bottom: 4px; }
.cal-months { display: grid; grid-template-columns: repeat(var(--weeks), minmax(0, 1fr)); gap: 3px; min-width: 640px; font-size: 11px; color: var(--muted); }
.cal-months span { white-space: nowrap; overflow: visible; min-width: 0; }

/* Search */
.search-form { display: flex; gap: 8px; margin-bottom: 12px; }
.search-form input { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: inherit; font: inherit; }
.search-total { font-size: 18px; margin: 4px 0 12px; }
.search-total b { font: 800 34px var(--display); }
.dash-bars { color: var(--pink); margin-bottom: 12px; }
.dash-bars .s-bar { color: var(--text); font-weight: 600; font-size: 14px; }
.dash-bars .s-bar-track { background: rgba(255, 255, 255, 0.08); height: 10px; }
.dash-bars .s-bar-track i { background: var(--grad); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin: 6px 0 10px; }
.spark i { flex: 1; height: var(--h); border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--amber), var(--pink)); min-width: 2px; }
.fine { font-size: 12.5px; margin: 10px 0 0; }

/* Quiz */
.quiz blockquote { margin: 10px 0 4px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); font: 600 19px/1.4 var(--body); overflow-wrap: anywhere; }
.quiz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; margin: 12px 0; }
.quiz-option { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 11px 12px; font-weight: 600; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.quiz-option:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.quiz-option.right { background: rgba(61, 242, 192, 0.2); border-color: rgba(61, 242, 192, 0.8); }
.quiz-option.right::after { content: " ✓"; }
.quiz-option.wrong { background: rgba(255, 77, 109, 0.18); border-color: rgba(255, 77, 109, 0.8); }
.quiz-option.wrong::after { content: " ✗"; }
.quiz-option:disabled { cursor: default; }
.quiz-score b { font: 800 64px var(--display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Who replies to whom */
.matrix { min-width: 0; font-size: 13px; }
.matrix th, .matrix td { text-align: center; padding: 8px 6px; }
.matrix tbody th { text-align: left; width: auto; }
.matrix td { background: rgba(255, 79, 163, calc(var(--o, 0) * 0.85)); font-variant-numeric: tabular-nums; }
.matrix td.self { background: rgba(255, 255, 255, 0.03); }
.pcard .btn { justify-self: start; margin-top: 4px; }
.media-list { margin-top: 12px; }
.months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-top: 8px; }
.month span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-top: 3px; }
.month-grid i { aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.month-grid i.on { background: rgba(255, 255, 255, var(--o)); }
.month-grid i.out { background: transparent; }
