:root {
  color-scheme: dark;
  --bg: #0c100d;
  --bg-2: #151b16;
  --panel: rgba(32, 40, 33, .68);
  --panel-strong: rgba(39, 48, 41, .88);
  --panel-light: rgba(255, 255, 255, .075);
  --text: #f4f5ed;
  --muted: #a6b0a8;
  --faint: #727d75;
  --line: rgba(232, 239, 231, .12);
  --line-strong: rgba(222, 239, 224, .23);
  --accent: #c9ff82;
  --accent-soft: rgba(193, 255, 122, .16);
  --accent-glow: rgba(176, 255, 112, .26);
  --accent-ink: #15200f;
  --warm: #e4a16f;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 28px 80px rgba(0, 0, 0, .46);
  --ease: cubic-bezier(.22, .8, .22, 1);
}

body[data-theme="present"] {
  --bg: #100e0d; --bg-2: #211714; --panel: rgba(47, 34, 30, .7); --panel-strong: rgba(55, 39, 33, .9);
  --accent: #ff9a62; --accent-soft: rgba(255, 132, 75, .15); --accent-glow: rgba(255, 114, 52, .25); --accent-ink: #231109;
}

body[data-theme="future"] {
  --bg: #0a1014; --bg-2: #111d25; --panel: rgba(25, 39, 48, .7); --panel-strong: rgba(28, 45, 56, .9);
  --accent: #90d9f8; --accent-soft: rgba(121, 205, 242, .15); --accent-glow: rgba(93, 195, 238, .25); --accent-ink: #09181f;
}

html[data-ui-theme="light"] { color-scheme: light; background: #f3f5ef; }
body[data-ui-theme="light"] {
  --bg: #f4f6f1; --bg-2: #e9eee8; --panel: rgba(255,255,255,.72); --panel-strong: rgba(255,255,255,.9);
  --panel-light: rgba(24,35,26,.05); --text: #182019; --muted: #58655c; --faint: #7b877e;
  --line: rgba(24,35,26,.13); --line-strong: rgba(24,35,26,.22);
  --accent: #82aa68; --accent-soft: rgba(130,170,104,.18); --accent-glow: rgba(130,170,104,.25); --accent-ink: #fff;
  --warm: #b97149; --shadow: 0 28px 80px rgba(37,52,40,.16);
  background: radial-gradient(circle at 18% 6%,var(--accent-glow),transparent 26rem), linear-gradient(145deg,#f6f7f2,var(--bg-2));
}
body[data-ui-theme="light"][data-theme="present"] { --bg: #fbf0e9; --bg-2: #f1ded3; --accent: #da7b46; --accent-soft: rgba(218,123,70,.16); --accent-glow: rgba(218,123,70,.22); --accent-ink: #fff; }
body[data-ui-theme="light"][data-theme="future"] { --bg: #edf7fb; --bg-2: #dcecf3; --accent: #5da8ca; --accent-soft: rgba(93,168,202,.16); --accent-glow: rgba(93,168,202,.22); --accent-ink: #fff; }
body[data-ui-theme="light"] .app-shell { box-shadow: 0 35px 120px rgba(37,52,40,.18); }
body[data-ui-theme="light"] .app-shell::before { background: linear-gradient(115deg, rgba(255,255,255,.48), transparent 18% 78%, rgba(255,255,255,.2)); }
body[data-ui-theme="light"] .glass { background: linear-gradient(145deg,rgba(255,255,255,.72),rgba(255,255,255,.38)); box-shadow: inset 0 1px 0 rgba(255,255,255,.82),0 20px 45px rgba(37,52,40,.08); }
body[data-ui-theme="light"] .top-title { color: var(--text); }
body[data-ui-theme="light"] .round-button, body[data-ui-theme="light"] .secondary { background: rgba(255,255,255,.6); }
body[data-ui-theme="light"] .dev-reset { background: rgba(255,255,255,.72); color: rgba(24,32,25,.5); border-color: rgba(24,32,25,.12); }
body[data-ui-theme="light"] .floating-note { background: rgba(255,255,255,.52); }
body[data-ui-theme="light"] .daily-card { background: radial-gradient(circle at 75% 25%,rgba(255,255,255,.9) 0 3%,var(--accent-glow) 4%,transparent 17%), linear-gradient(145deg, color-mix(in srgb,var(--accent) 32%,#fff), color-mix(in srgb,var(--accent) 10%,#f6f8f3) 56%, #e7eee5); box-shadow: 0 23px 55px rgba(37,52,40,.13); border: 1px solid rgba(255,255,255,.7); }
body[data-ui-theme="light"] .daily-time, body[data-ui-theme="light"] .daily-card p { color: var(--muted); }
body[data-ui-theme="light"] .daily-orbit { border-color: color-mix(in srgb,var(--accent) 34%, transparent); }
body[data-ui-theme="light"] .daily-orbit::after { border-color: color-mix(in srgb,var(--accent) 20%, transparent); }
body[data-ui-theme="light"] .bottom-nav { background: rgba(255,255,255,.72); box-shadow: 0 18px 48px rgba(37,52,40,.16), inset 0 1px 0 rgba(255,255,255,.9); }
body[data-ui-theme="light"] .bubble, body[data-ui-theme="light"] .reply-chip { color: var(--text); }
body[data-ui-theme="light"] .story-tabs { background: rgba(255,255,255,.72); }
body[data-ui-theme="light"] .literary-copy, body[data-ui-theme="light"] .source-card { color: var(--text); }

* { box-sizing: border-box; }
html { min-height: 100%; background: #070908; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 18% 6%, var(--accent-glow), transparent 26rem),
    radial-gradient(circle at 90% 88%, rgba(212, 143, 96, .14), transparent 24rem),
    linear-gradient(145deg, #070908, var(--bg-2));
  transition: background .7s ease;
}
body::before {
  content: ""; position: fixed; inset: 0; opacity: .055; pointer-events: none; z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
button, input, textarea { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app-shell {
  position: relative; isolation: isolate; width: min(100%, 430px); height: 100svh; min-height: 620px; margin: 0 auto; overflow: hidden;
  background:
    radial-gradient(circle at 78% -8%, var(--accent-soft), transparent 35%),
    radial-gradient(circle at -12% 78%, rgba(229, 154, 104, .08), transparent 35%),
    linear-gradient(160deg, var(--bg-2), var(--bg) 58%);
  box-shadow: var(--shadow); transition: background .7s ease;
}
.app-shell::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.045), transparent 18% 78%, rgba(255,255,255,.025));
}
.screen {
  position: relative; z-index: 1; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: max(18px, env(safe-area-inset-top)) 20px calc(34px + env(safe-area-inset-bottom)); scrollbar-width: none;
  animation: screen-in .48s var(--ease) both;
}
.screen::-webkit-scrollbar { display: none; }
@keyframes screen-in { from { opacity: 0; transform: translateY(12px) scale(.99); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
::view-transition-old(root) { animation: .18s ease both fade-out; }
::view-transition-new(root) { animation: .38s var(--ease) both fade-in; }
@keyframes fade-out { to { opacity: 0; transform: scale(.985); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.04em; }
h1 { font-size: clamp(42px, 12vw, 58px); line-height: .96; margin-bottom: 17px; }
h2 { font-size: 36px; line-height: 1.02; margin-bottom: 14px; }
h3 { font-size: 18px; line-height: 1.22; margin-bottom: 8px; }
p { line-height: 1.55; }
.lead { color: var(--muted); font-size: 15px; line-height: 1.58; }
.eyebrow { margin-bottom: 10px; color: var(--accent); font-size: 10px; font-weight: 780; letter-spacing: .18em; text-transform: uppercase; }
.microcopy { color: var(--faint); font-size: 11px; line-height: 1.5; text-align: center; }
.center { text-align: center; }
.card-kicker { display: block; margin-bottom: 8px; color: var(--accent); font-size: 10px; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.ui-icon { display: block; flex: 0 0 auto; }

.glass {
  position: relative; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 20px 45px rgba(0,0,0,.16); backdrop-filter: blur(22px) saturate(1.08);
}
.glass::before {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .25s ease;
  background: radial-gradient(190px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.13), transparent 68%);
}
.glass:hover::before { opacity: 1; }

.topbar { height: 46px; margin-bottom: 16px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; }
.top-title { display: flex; justify-content: center; align-items: center; gap: 8px; color: #eef2eb; font-size: 10px; font-weight: 780; letter-spacing: .15em; }
.brand-mark { width: 16px; height: 16px; display: inline-block; border: 1px solid var(--accent); border-radius: 50% 43% 50% 42%; box-shadow: 0 0 18px var(--accent-glow), inset 0 0 9px var(--accent-glow); animation: mark 8s linear infinite; }
@keyframes mark { to { transform: rotate(360deg); } }
.top-spacer { width: 44px; }
.round-button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.055); cursor: pointer; backdrop-filter: blur(16px); transition: transform .2s ease, background .2s ease; }
.round-button:active { transform: scale(.93); }
.topbar-tools, .welcome-tools { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.theme-toggle { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.055); cursor: pointer; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; backdrop-filter: blur(14px); transition: transform .18s ease, background .2s ease, border-color .2s ease; }
.theme-toggle .ui-icon { color: var(--accent); }
.theme-toggle:active { transform: scale(.95); }
.step-label { justify-self: end; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.progress-rail { height: 3px; margin: 0 4px 34px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.progress-rail span { display: block; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 18px var(--accent-glow); transition: width .55s var(--ease); }

.primary, .secondary { width: 100%; min-height: 58px; padding: 0 18px; border-radius: 19px; cursor: pointer; font-weight: 720; transition: transform .18s ease, box-shadow .25s ease, opacity .2s ease; }
.primary { display: flex; align-items: center; justify-content: space-between; border: 0; color: var(--accent-ink); background: var(--accent); box-shadow: 0 14px 34px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.55); }
.primary.luminous { position: relative; overflow: hidden; }
.primary.luminous::before { content: ""; position: absolute; top: -50%; bottom: -50%; left: -35%; width: 24%; transform: skewX(-18deg); background: rgba(255,255,255,.42); filter: blur(4px); animation: sheen 4.5s ease-in-out infinite; }
@keyframes sheen { 0%, 62% { left: -35%; } 82%, 100% { left: 125%; } }
.primary:active, .secondary:active { transform: scale(.975); }
.primary:disabled, .secondary:disabled { opacity: .38; cursor: default; box-shadow: none; }
.primary.compact { min-height: 52px; margin-top: 14px; }
.secondary { border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.055); backdrop-filter: blur(16px); }
.button-stack { display: grid; gap: 10px; margin-top: 24px; }

.dev-reset {
  position: absolute; z-index: 60; left: 9px; bottom: calc(9px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 4px;
  padding: 5px 7px; border: 1px solid rgba(255,255,255,.075); border-radius: 8px; background: rgba(8,10,9,.52); color: rgba(231,235,228,.38); font-size: 8px; letter-spacing: .04em; cursor: pointer; backdrop-filter: blur(9px); opacity: .72;
}
.dev-reset:hover { color: var(--text); opacity: 1; }

/* Welcome */
.welcome-screen { display: flex; flex-direction: column; justify-content: space-between; }
.welcome-top { display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 780; letter-spacing: .18em; }
.status-chip { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 10px; backdrop-filter: blur(14px); }
.hero-visual { position: relative; min-height: 270px; margin: 8px -20px -10px; display: grid; place-items: center; overflow: hidden; }
.halo { position: absolute; border: 1px solid var(--line-strong); border-radius: 50%; }
.halo-one { width: 260px; height: 178px; transform: rotate(-18deg); animation: halo-a 13s ease-in-out infinite; }
.halo-two { width: 196px; height: 246px; border-color: color-mix(in srgb, var(--accent) 34%, transparent); transform: rotate(32deg); animation: halo-b 16s ease-in-out infinite; }
@keyframes halo-a { 50% { transform: rotate(15deg) scale(1.08); } }
@keyframes halo-b { 50% { transform: rotate(-12deg) scale(.94); } }
.hero-silhouette { position: relative; width: 138px; height: 196px; display: grid; place-items: center; border-radius: 46% 46% 35% 35% / 26% 26% 60% 60%; color: var(--text); font-family: var(--serif); font-size: 30px; background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.72), rgba(255,255,255,.12) 22%, transparent 44%), linear-gradient(to bottom, var(--accent-soft), rgba(255,255,255,.025)); filter: drop-shadow(0 0 38px var(--accent-glow)); }
.hero-silhouette::before { content: ""; position: absolute; top: 27px; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #fff, color-mix(in srgb, var(--accent) 60%, #748078) 48%, #222a24 100%); box-shadow: 0 0 28px var(--accent-glow); }
.hero-silhouette span { margin-top: 62px; text-shadow: 0 0 20px rgba(255,255,255,.2); }
.floating-note { position: absolute; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(20,25,21,.5); font-size: 9px; backdrop-filter: blur(12px); animation: float 6s ease-in-out infinite; }
.note-a { left: 10%; top: 32%; }.note-b { right: 13%; top: 25%; animation-delay: -2s; color: var(--accent); }.note-c { right: 4%; bottom: 22%; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-9px); } }
.welcome-copy { position: relative; z-index: 2; }
.welcome-copy .lead { max-width: 37ch; margin-bottom: 0; }
.welcome-actions { margin-top: 24px; }
.trust-row { display: flex; justify-content: center; gap: 22px; padding: 14px 0 4px; color: var(--faint); font-size: 10px; }
.trust-row span { display: flex; align-items: center; gap: 5px; }

/* Test */
.question-heading { margin-bottom: 24px; }
.question-heading h2 { max-width: 10ch; }
.answer-stack { display: grid; gap: 11px; margin-bottom: 22px; }
.answer-card { width: 100%; min-height: 98px; display: grid; grid-template-columns: 48px 1fr 24px; gap: 14px; align-items: center; padding: 16px; border-radius: 23px; text-align: left; cursor: pointer; transition: transform .22s var(--ease), border-color .22s, background .22s; }
.answer-card:active { transform: scale(.978); }
.answer-card.selected { border-color: color-mix(in srgb, var(--accent) 62%, transparent); background: linear-gradient(145deg, var(--accent-soft), rgba(255,255,255,.04)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 34px var(--accent-soft); }
.answer-index { width: 48px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; color: var(--accent); font-family: var(--serif); font-size: 16px; background: rgba(255,255,255,.035); }
.answer-copy strong, .answer-copy small { display: block; }
.answer-copy strong { margin-bottom: 6px; font-size: 16px; }
.answer-copy small { color: var(--muted); font-size: 11px; line-height: 1.42; }
.choice-check { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--accent-ink); }
.selected .choice-check { border-color: var(--accent); background: var(--accent); }
.style-answer { grid-template-columns: 72px 1fr 24px; }
.style-swatch { position: relative; width: 72px; height: 72px; overflow: hidden; border-radius: 18px; background: #26342d; }
.style-swatch i, .style-swatch b { position: absolute; display: block; }
.swatch-cinema { background: radial-gradient(circle at 66% 24%, #f8c08d 0 7%, transparent 8%), linear-gradient(145deg,#23352f,#719184 55%,#b96948); }
.swatch-cinema i { width: 40px; height: 57px; right: 8px; bottom: 0; border-radius: 48% 48% 25% 25%; background: rgba(8,14,11,.72); }
.swatch-graphic { background: linear-gradient(135deg,#273f34 0 39%,#d7ff7c 40% 47%,#7d9546 48% 66%,#151a17 67%); }
.swatch-graphic i { inset: 10px; border: 1px solid rgba(255,255,255,.5); transform: rotate(12deg); }
.swatch-soft { background: radial-gradient(circle at 35% 35%,rgba(255,255,255,.65),transparent 18%),linear-gradient(155deg,#b9cfbf,#647f71 58%,#d6a884); filter: saturate(.7); }
.swatch-soft i { width: 50px; height: 50px; right: -7px; top: 8px; border-radius: 50%; background: rgba(255,255,255,.26); filter: blur(6px); }

/* Chat */
.chat-screen { display: flex; flex-direction: column; overflow: hidden; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.chat-context { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.chat-context span { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 9px; }
.chat-context span:first-child { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.chat-stream { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px 2px 18px; scrollbar-width: none; }
.message-row { display: flex; align-items: flex-end; gap: 8px; animation: message-in .42s var(--ease) both; animation-delay: var(--delay, 0ms); }
.message-row.user { justify-content: flex-end; }
@keyframes message-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.bot-avatar { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent); border-radius: 50% 43% 48% 42%; color: var(--accent); font-family: var(--serif); font-size: 13px; background: var(--accent-soft); box-shadow: 0 0 16px var(--accent-soft); }
.bubble { max-width: 83%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 19px 19px 19px 6px; color: #e9eee7; background: rgba(255,255,255,.06); font-size: 13px; line-height: 1.48; backdrop-filter: blur(14px); }
.user .bubble { border-radius: 19px 19px 6px 19px; border-color: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 88%, white 12%); }
.typing-bubble { display: flex; gap: 5px; padding: 15px 18px; }
.typing-bubble i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1.1s ease-in-out infinite; }
.typing-bubble i:nth-child(2) { animation-delay: .15s; }.typing-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { transform: translateY(-4px); background: var(--accent); } }
.chat-controls { flex: 0 0 auto; padding-top: 10px; }
.chat-hint { margin: 0; text-align: center; color: var(--faint); font-size: 10px; }
.quick-replies { display: flex; gap: 8px; flex-wrap: wrap; }
.reply-chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; color: #e7ece5; background: rgba(255,255,255,.055); cursor: pointer; font-size: 12px; backdrop-filter: blur(14px); transition: .18s ease; }
.reply-chip:active { transform: scale(.95); }
.reply-chip.selected { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.mode-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { min-height: 112px; display: flex; flex-direction: column; align-items: flex-start; gap: 13px; padding: 16px; border-radius: 21px; text-align: left; cursor: pointer; }
.mode-card .ui-icon { color: var(--accent); }
.mode-card strong, .mode-card small { display: block; }.mode-card strong { font-size: 13px; margin-bottom: 4px; }.mode-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.composer-wrap, .clarify-wrap { padding: 15px; border-radius: 23px; }
.composer-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.composer-wrap textarea, .clarify-wrap textarea { width: 100%; min-height: 92px; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; line-height: 1.5; }
.composer-footer { display: grid; grid-template-columns: auto 1fr 44px; align-items: center; gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
.record-mini { height: 34px; display: flex; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.05); cursor: pointer; font-size: 10px; }
.record-mini.recording { color: #ff9e7a; border-color: rgba(255,126,86,.45); animation: record-pulse 1.4s ease-in-out infinite; }
@keyframes record-pulse { 50% { box-shadow: 0 0 24px rgba(255,112,70,.22); } }
.composer-note { color: var(--faint); font-size: 8px; line-height: 1.3; }
.send-button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 14px; color: var(--accent-ink); background: var(--accent); cursor: pointer; }
.clarify-label { margin-bottom: 7px; color: var(--accent); font-size: 9px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.clarify-wrap h3 { margin-bottom: 15px; font-family: var(--serif); font-size: 21px; font-weight: 400; }
.clarify-wrap textarea { min-height: 52px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Processing and reveal */
.processing-screen { display: flex; flex-direction: column; justify-content: space-between; }
.processing-visual { flex: 1; display: grid; place-items: center; min-height: 280px; }
.story-orb { position: relative; width: 116px; height: 156px; display: grid; place-items: center; border-radius: 48% 48% 35% 35% / 28% 28% 58% 58%; color: var(--text); font-family: var(--serif); font-size: 26px; background: radial-gradient(circle at 50% 28%,rgba(255,255,255,.85),var(--accent-soft) 22%,transparent 48%),linear-gradient(to bottom,var(--accent-soft),rgba(255,255,255,.02)); filter: drop-shadow(0 0 44px var(--accent-glow)); }
.story-orb::before, .story-orb::after { content: ""; position: absolute; inset: -54px -82px; border: 1px solid color-mix(in srgb, var(--accent) 33%, transparent); border-radius: 50%; animation: orbit-spin 7s linear infinite; }
.story-orb::after { inset: -90px -48px; animation-duration: 11s; animation-direction: reverse; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.story-orb i, .story-orb b { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.story-orb i { left: -82px; }.story-orb b { right: -48px; bottom: -42px; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .3; transform: scale(.6); } }
.processing-copy { text-align: center; }
.processing-copy h2 { max-width: 10ch; margin-left: auto; margin-right: auto; }
.process-list { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.process-list span { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; background: rgba(255,255,255,.035); }
.process-list .ui-icon { color: var(--accent); }
.reveal-aura { height: 145px; display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 18px; }
.reveal-aura > span { color: var(--faint); font-size: 9px; }
.reveal-core { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; color: var(--text); font-family: var(--serif); font-size: 24px; background: radial-gradient(circle at 36% 28%, #fff, var(--accent) 18%, color-mix(in srgb,var(--accent) 28%,#17201a) 52%,#121613 100%); box-shadow: 0 0 60px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.6); }
.reveal-title { max-width: 12ch; margin-bottom: 25px; }
.insight-card, .hypothesis-card { padding: 18px; border-radius: 22px; margin-bottom: 10px; }
.insight-card p, .hypothesis-card p { margin: 0; color: #e5eae3; font-size: 13px; }
.vote-row { display: flex; gap: 7px; margin-top: 14px; }
.vote { flex: 1; min-height: 36px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; font-size: 11px; }
.vote.selected { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.next-step-card { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center; margin: 16px 0 20px; padding: 15px; border: 1px solid color-mix(in srgb,var(--accent) 25%,transparent); border-radius: 19px; background: var(--accent-soft); }
.next-step-card > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: var(--accent-ink); background: var(--accent); }
.next-step-card small, .next-step-card strong { display: block; }.next-step-card small { margin-bottom: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }.next-step-card strong { font-size: 12px; line-height: 1.4; }

/* Story */
.story-cover { position: relative; min-height: 430px; display: flex; flex-direction: column; justify-content: space-between; padding: 24px; border-radius: 31px; margin-bottom: 20px; background: radial-gradient(circle at 72% 20%, var(--accent-glow), transparent 18%), radial-gradient(ellipse at 35% 94%, rgba(229,154,104,.3), transparent 46%), linear-gradient(155deg, color-mix(in srgb,var(--accent) 25%,#28372f), #151b17 56%, #090c0a); }
.story-cover::after { content: ""; position: absolute; width: 250px; height: 350px; top: -70px; right: -65px; border: 1px solid color-mix(in srgb,var(--accent) 35%,transparent); border-radius: 48% 52% 42% 58%; transform: rotate(20deg); }
.cover-light { position: absolute; width: 80px; height: 80px; top: 55px; right: 60px; border-radius: 50%; background: var(--accent); filter: blur(28px); opacity: .42; }
.story-cover > * { position: relative; z-index: 1; }
.cover-brand, .cover-foot { color: rgba(245,247,239,.58); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.cover-path { margin-bottom: 10px; color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: .15em; }
.story-cover h2 { max-width: 8ch; margin: 0; font-size: 43px; }
.story-tabs { position: sticky; top: -1px; z-index: 8; display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 0 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 17px; background: rgba(15,19,16,.75); backdrop-filter: blur(18px); }
.story-tabs button { min-height: 38px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.story-tabs button.active { color: var(--accent-ink); background: var(--accent); }
.literary-copy, .source-card { color: #e5e8e1; font-family: var(--serif); font-size: 18px; line-height: 1.75; }
.saved-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 22px 0 14px; }
.saved-gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 13px; border: 1px solid var(--line); }
.source-card { padding: 20px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,255,255,.035); }
.source-card p { margin: 0; color: var(--muted); font-family: var(--sans); font-size: 13px; }
.axis-grid { display: grid; gap: 10px; }
.axis-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.035); }
.axis-grid article.axis-now { border-color: color-mix(in srgb,var(--accent) 34%,transparent); background: var(--accent-soft); }
.axis-grid small { color: var(--accent); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }.axis-grid p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

/* Identity and storyboard */
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.identity-card { min-height: 178px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 13px; border-radius: 22px; text-align: left; cursor: pointer; }
.identity-card:first-child { grid-column: 1 / -1; min-height: 105px; display: grid; grid-template-columns: 74px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 14px; }
.identity-card:first-child .identity-preview { grid-row: 1 / 3; }
.identity-card.selected { border-color: color-mix(in srgb,var(--accent) 52%,transparent); background: linear-gradient(145deg,var(--accent-soft),rgba(255,255,255,.03)); }
.identity-card input { display: none; }
.identity-preview { position: relative; width: 100%; height: 88px; display: grid; place-items: center; overflow: hidden; border-radius: 17px; color: var(--accent); background: radial-gradient(circle at 50% 20%,var(--accent-soft),transparent 45%),rgba(255,255,255,.045); }
.identity-card:first-child .identity-preview { width: 74px; height: 74px; }
.identity-preview img { width: 100%; height: 100%; object-fit: cover; }
.identity-card strong { font-size: 12px; }.identity-card small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.avatar-preview i { width: 44px; height: 58px; border-radius: 48% 48% 30% 30%; background: linear-gradient(to bottom,var(--accent),#26342d 54%); box-shadow: 0 0 25px var(--accent-glow); }
.faceless-preview .ui-icon { opacity: .7; }
.avatar-picker { padding: 16px; border-radius: 21px; margin: -10px 0 22px; }
.avatar-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.avatar-options button { display: grid; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.03); cursor: pointer; font-size: 9px; }
.avatar-options button.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.avatar-options i { height: 50px; border-radius: 10px; background: linear-gradient(145deg,#2c3931,var(--accent-soft)); }
.avatar-options i.preset-bold { background: linear-gradient(145deg,#392c25,#e79a62); }.avatar-options i.preset-dream { background: linear-gradient(145deg,#26333a,#83cce8); }
.avatar-picker p { margin: 12px 0 0; color: var(--faint); font-size: 9px; }
.setup-section { margin: 28px 0 24px; }.setup-section h3 { margin-bottom: 12px; }
.count-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }.count-heading h3 { margin: 0; }.count-heading output { min-width: 42px; color: var(--accent); font-family: var(--serif); font-size: 31px; text-align: right; }
.scene-range { width: 100%; height: 5px; margin: 18px 0 8px; accent-color: var(--accent); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: 8px; letter-spacing: .03em; }
.auto-count-button { display: inline-flex; align-items: center; gap: 7px; margin-top: 17px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; font-size: 9px; }
.auto-count-button:hover { color: var(--text); border-color: color-mix(in srgb,var(--accent) 50%,transparent); background: var(--accent-soft); }
.visual-style-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 18px 0 26px; }
.visual-style-picker button { min-width: 0; display: grid; gap: 8px; padding: 8px; border-radius: 17px; color: var(--muted); cursor: pointer; text-align: left; }
.visual-style-picker button.selected { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft),0 12px 28px var(--accent-glow); }
.visual-style-picker .style-swatch { width: 100%; height: 64px; }
.visual-style-picker strong { font-size: 9px; line-height: 1.25; }
.number-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.number-picker button { min-height: 70px; display: grid; place-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 17px; color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; }
.number-picker strong { font-family: var(--serif); font-size: 22px; font-weight: 400; }.number-picker small { font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.number-picker button.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); box-shadow: 0 10px 28px var(--accent-glow); }
.scene-list { display: grid; gap: 10px; margin: 22px 0 26px; }
.scene-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 13px; border-radius: 19px; }
.scene-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft); font-size: 9px; }
.scene-row textarea { width: 100%; min-height: 52px; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; line-height: 1.45; }
.scene-kind { padding: 5px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }

/* Carousel */
.carousel-screen { display: flex; flex-direction: column; overflow: hidden; padding-left: 0; padding-right: 0; }
.carousel-screen .topbar, .carousel-actions, .generation-status { margin-left: 20px; margin-right: 20px; }
.carousel-shell { flex: 1; min-height: 0; overflow: hidden; }
.carousel-track { height: 100%; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 20px 15px; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.story-slide { position: relative; flex: 0 0 89%; height: 100%; min-height: 410px; max-height: 570px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border: 1px solid rgba(255,255,255,.12); border-radius: 30px; scroll-snap-align: center; background: linear-gradient(150deg,#35493d,#121813 62%,#34251f); box-shadow: 0 24px 58px rgba(0,0,0,.34); }
.story-slide.slide-2 { background: linear-gradient(155deg,#1a211d,#536e5e 52%,#172019); }.story-slide.slide-3 { background: linear-gradient(135deg,#16211c 0 40%,#556b5e 41% 66%,#b87754 67%); }.story-slide.slide-4 { background: linear-gradient(155deg,#26322b,#151b18 55%,#6f4d3c); }.story-slide.slide-5 { background: linear-gradient(145deg,#5b7968,#19231d 46%,#121512); }.story-slide.slide-6 { background: linear-gradient(125deg,#171c19,#405449 58%,#9d694e); }
[data-theme="present"] .story-slide { background: linear-gradient(150deg,#5a2d20,#1d1512 62%,#773b20); }
[data-theme="future"] .story-slide { background: linear-gradient(150deg,#193445,#0d171d 62%,#334f59); }
.visual-scene { position: absolute; inset: 0; overflow: hidden; }
.visual-scene::before { content: ""; position: absolute; width: 270px; height: 390px; top: -90px; right: -105px; border: 1px solid rgba(255,255,255,.24); border-radius: 48% 52% 42% 58%; transform: rotate(23deg); }
.visual-scene i { position: absolute; width: 140px; height: 140px; top: 18%; left: 44%; border-radius: 50%; background: var(--accent); filter: blur(44px); opacity: .26; }
.visual-scene b { position: absolute; left: -12%; right: -12%; bottom: 19%; height: 28%; border-radius: 50% 60% 0 0; background: rgba(7,12,9,.52); transform: rotate(-7deg); }
.visual-scene em { position: absolute; left: -14%; right: -10%; bottom: 8%; height: 24%; border-radius: 50% 50% 0 0; background: rgba(4,7,5,.76); transform: rotate(8deg); }
.visual-hero { position: absolute; width: 128px; height: 240px; right: 13%; bottom: 16%; overflow: hidden; border-radius: 50% 50% 28% 28% / 20% 20% 65% 65%; background: radial-gradient(circle at 50% 15%,#d7e8da 0 11%,#6f8e78 12% 18%,transparent 19%),linear-gradient(to bottom,transparent 15%,#18221c 16%); filter: drop-shadow(0 0 28px var(--accent-glow)); opacity: .83; }
.visual-hero.faceless { background: radial-gradient(circle at 50% 16%,#232b26 0 11%,transparent 12%),linear-gradient(to bottom,transparent 15%,#111813 16%); }
.visual-hero img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: luminosity; opacity: .72; }
.generated-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-gradient { position: absolute; inset: 0; background: linear-gradient(to bottom,rgba(3,7,5,.08),transparent 26%,rgba(3,7,5,.94) 76%,rgba(3,7,5,.98)); }
.story-slide > *:not(.visual-scene):not(.generated-image):not(.slide-gradient) { position: relative; z-index: 2; }
.slide-number, .slide-sign { color: rgba(255,255,255,.65); font-size: 9px; letter-spacing: .13em; }
.slide-copy-window { height: clamp(104px,27%,142px); margin-top: auto; margin-bottom: 10px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom,transparent 0,#000 8%,#000 92%,transparent 100%); mask-image: linear-gradient(to bottom,transparent 0,#000 8%,#000 92%,transparent 100%); }
.slide-copy { padding: 10px 0 14px; will-change: transform; }
.slide-copy small { display: block; margin-bottom: 8px; color: rgba(255,255,255,.58); font-size: 8px; letter-spacing: .13em; text-transform: uppercase; }
.story-slide p { max-width: 100%; margin: 0; color: white; font-family: var(--serif); font-size: clamp(14px,4vw,16px); line-height: 1.42; letter-spacing: -.008em; text-wrap: pretty; }
.carousel-dots { height: 14px; display: flex; justify-content: center; gap: 5px; margin: 2px 20px 7px; }
.carousel-dots i { width: 4px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.18); transition: .25s ease; }
.carousel-dots i.active { width: 18px; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.generation-status { display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 8px; color: var(--faint); font-size: 8px; }
.generation-status i { width: 5px; height: 5px; border-radius: 50%; background: #6c746f; }.generation-status.connected i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.carousel-actions { display: grid; grid-template-columns: 1fr 1.12fr; gap: 8px; }
.carousel-actions .primary, .carousel-actions .secondary { min-height: 50px; padding: 0 12px; font-size: 10px; }
.icon-action { display: flex; align-items: center; justify-content: center; gap: 7px; }

/* Home */
.home-screen, .library-screen, .profile-screen { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.home-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }
.home-header h2 { margin-bottom: 0; }
.daily-card { position: relative; min-height: 300px; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; padding: 23px; border-radius: 30px; background: radial-gradient(circle at 75% 25%,rgba(255,255,255,.42) 0 3%,var(--accent-glow) 4%,transparent 17%),linear-gradient(145deg,color-mix(in srgb,var(--accent) 64%,#526359),color-mix(in srgb,var(--accent) 20%,#1b2a21) 56%,#111612); box-shadow: 0 23px 55px rgba(0,0,0,.32); }
.daily-card > *:not(.daily-orbit) { position: relative; z-index: 2; }
.daily-time { margin-bottom: 48px; color: rgba(255,255,255,.68); font-size: 9px; text-transform: uppercase; letter-spacing: .11em; }
.daily-card h3 { max-width: 11ch; margin-bottom: 10px; font-family: var(--serif); font-size: 30px; font-weight: 400; letter-spacing: -.03em; }
.daily-card p { max-width: 28ch; color: rgba(255,255,255,.68); font-size: 11px; }
.white-button { min-height: 42px; margin-top: auto; padding: 0 16px; border: 0; border-radius: 14px; color: #172018; background: rgba(255,255,255,.92); font-weight: 740; cursor: pointer; }
.daily-orbit { position: absolute; width: 270px; height: 270px; right: -120px; top: -80px; border: 1px solid rgba(255,255,255,.25); border-radius: 46% 54% 42% 58%; transform: rotate(25deg); }
.daily-orbit::after { content: ""; position: absolute; inset: 35px -30px 10px 38px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 11px; }
.section-title h3 { margin: 0; font-size: 14px; }.section-title span { color: var(--accent); font-size: 11px; }.section-title button { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.unlock-card { padding: 16px; border-radius: 20px; }
.unlock-card p { margin: 11px 0 0; color: var(--muted); font-size: 10px; }
.ten-dots { display: grid; grid-template-columns: repeat(10,1fr); gap: 5px; }.ten-dots i { height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); }.ten-dots i.filled { background: var(--accent); box-shadow: 0 0 9px var(--accent-glow); }
.saved-story { width: 100%; display: grid; grid-template-columns: 78px 1fr 22px; gap: 13px; align-items: center; padding: 11px; border-radius: 22px; text-align: left; cursor: pointer; }
.saved-cover { position: relative; width: 78px; height: 98px; display: grid; place-items: center; overflow: hidden; border-radius: 16px; font-family: var(--serif); background: linear-gradient(145deg,#6c927a,#1c2a21 58%,#b57854); }
.saved-cover img { width: 100%; height: 100%; object-fit: cover; }
.saved-cover.theme-present { background: linear-gradient(145deg,#dd8150,#281712 64%); }.saved-cover.theme-future { background: linear-gradient(145deg,#73b7d2,#132733 64%); }
.saved-cover i { position: absolute; inset: 11px; border: 1px solid rgba(255,255,255,.3); border-radius: 50% 40%; transform: rotate(18deg); }.saved-cover b { position: relative; font-size: 19px; font-weight: 400; }
.saved-story small, .saved-story strong, .saved-story p { display: block; }.saved-story small { margin-bottom: 5px; color: var(--faint); font-size: 8px; }.saved-story strong { font-size: 13px; }.saved-story p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.empty-card { min-height: 130px; display: grid; place-items: center; padding: 20px; border-radius: 22px; color: var(--faint); text-align: center; }.empty-card span { color: var(--accent); font-size: 22px; }.empty-card p { margin: 0; font-size: 11px; }
.bottom-nav { position: absolute; z-index: 30; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 72px; display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 23px; background: rgba(21,26,22,.76); box-shadow: 0 18px 48px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(25px) saturate(1.15); }
.bottom-nav button { display: grid; place-items: center; gap: 2px; padding: 5px; border: 0; border-radius: 16px; color: var(--faint); background: transparent; cursor: pointer; font-size: 8px; }
.bottom-nav button.active { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.bottom-nav .ui-icon { width: 18px; height: 18px; }
.library-list, .settings-list { display: grid; gap: 10px; }
.setting-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 14px; border-radius: 20px; }
.setting-row > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--accent); background: var(--accent-soft); }
.setting-row strong, .setting-row small { display: block; }.setting-row strong { font-size: 13px; }.setting-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #656d67; }.status-dot.on { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.danger-button { width: 100%; min-height: 50px; margin-top: 22px; border: 1px solid rgba(255,125,91,.2); border-radius: 17px; color: #e99c87; background: rgba(151,61,40,.08); cursor: pointer; font-size: 11px; }
.toast { position: absolute; z-index: 100; left: 20px; right: 20px; bottom: calc(90px + env(safe-area-inset-bottom)); padding: 14px 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; color: #151b16; background: rgba(244,247,239,.94); box-shadow: 0 18px 45px rgba(0,0,0,.34); font-size: 11px; animation: toast-in .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (min-width: 680px) {
  body { padding: 22px 0; }
  .app-shell { height: min(890px, calc(100vh - 44px)); min-height: 680px; border: 7px solid rgba(32,37,33,.92); border-radius: 42px; box-shadow: 0 35px 120px rgba(0,0,0,.6); }
}
@media (max-height: 720px) {
  .hero-visual { min-height: 205px; }.hero-silhouette { transform: scale(.82); }.welcome-copy h1 { font-size: 40px; }.daily-card { min-height: 240px; }
  .story-slide { min-height: 350px; }.reveal-aura { height: 105px; }.story-cover { min-height: 350px; }
}
@media (max-width: 360px) {
  .theme-toggle span { display: none; }
  .theme-toggle { width: 34px; justify-content: center; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ===== Яслово · движок v6 поверх дизайна v20 ===== */
.mur-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 760; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.brandline { margin: 14px 0 0; color: var(--faint); font-size: 9px; letter-spacing: .22em; text-transform: uppercase; text-align: center; font-weight: 700; }
.theme-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.theme-toggle.big { min-height: 58px; justify-content: center; border-radius: 19px; font-size: 12px; }
.name-input { width: 100%; padding: 16px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-light); color: var(--text); font-family: var(--serif); font-size: 26px; text-align: center; outline: none; }
.name-input:focus { border-color: var(--accent); }
.arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.arch-card { min-height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 16px; cursor: pointer; font-weight: 700; font-size: 13px; padding: 6px; }
.arch-card i { font-style: normal; font-family: var(--serif); font-size: 22px; color: var(--accent); }
.arch-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.who-screen .primary { margin-top: 12px; }
.notes-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--accent-soft); color: var(--text); font-size: 12px; cursor: pointer; }
.notes-chip.subtle { margin: 8px 0 0; background: transparent; color: var(--faint); font-size: 11px; }
.audio-row { width: 100%; display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; cursor: pointer; color: var(--text); text-align: left; }
.audio-row .ui-icon { color: var(--accent); }
.audio-row span { font-weight: 700; font-size: 14px; } .audio-row small { margin-left: auto; color: var(--faint); font-size: 11px; }
.audio-row.on { border-color: var(--accent); background: var(--accent-soft); }
.obs-line { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.dup-card { padding: 16px; border-radius: 20px; margin-bottom: 12px; border-color: var(--warm); }
.dup-card .card-kicker { color: var(--warm); }
.reveal-screen .vote-row { margin: 0 0 14px; }
.dark-screen { padding: 0 !important; background: #070908; color: #f4f5ed; }
.dark-screen .eyebrow { color: #c9ff82; }
.dark-screen .lead, .dark-screen .microcopy { color: rgba(244,245,237,.62); }
.dark-screen h2 { color: #f4f5ed; }
.scene-box { position: absolute; inset: 0; background: #070908; overflow: hidden; }
.scene-box canvas, .scene-box .scene-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-box .scene-img { object-fit: cover; animation: kenburns 40s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.scene-veil { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(7,9,8,.62), rgba(7,9,8,0) 30%, rgba(7,9,8,.1) 55%, rgba(7,9,8,.94) 100%); }
.dark-screen .over { position: relative; z-index: 2; min-height: 100%; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 20px calc(34px + env(safe-area-inset-bottom)); }
.dark-screen .over.center-col { text-align: center; }
.dark-screen .grow-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 0; }
.dark-screen .top-title { color: #eef2eb; } .dark-screen .round-button, .dark-screen .theme-toggle { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: rgba(244,245,237,.8); }
.dark-screen .secondary { border-color: rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.06); }
.dark-screen .primary { background: #f4f5ed; color: #15200f; box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.dark-screen .glass { background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); border-color: rgba(255,255,255,.14); color: #f4f5ed; }
.dark-screen .bubble { background: rgba(255,255,255,.08); color: #f4f5ed; }
.dark-screen .bot-avatar { color: #c9ff82; border-color: rgba(201,255,130,.5); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mirror { padding: 16px; border-radius: 18px; display: grid; gap: 12px; }
.mirror .r { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: baseline; }
.mirror .k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 700; }
.mirror .v { font-family: var(--serif); font-size: 18px; line-height: 1.25; } .mirror .v q { quotes: "«" "»"; color: #c9ff82; font-style: italic; }
.see { display: grid; gap: 8px; }
.see button { min-height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.05); color: #fff; font-family: var(--serif); font-size: 17px; padding: 10px 14px; text-align: left; transition: all .2s; cursor: pointer; }
.see button.on { background: rgba(201,255,130,.16); border-color: #c9ff82; }
.oath { font-family: var(--serif); font-size: 25px; line-height: 1.3; text-align: center; text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.oath b { color: #c9ff82; font-weight: 500; }
.pray-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pline { flex: 1; min-height: 0; display: flex; align-items: flex-end; justify-content: center; padding: 10px 0; font-family: var(--serif); font-size: 25px; line-height: 1.25; text-align: center; text-wrap: balance; opacity: 0; transform: translateY(10px); transition: opacity 1.2s ease, transform 1.2s ease; text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.pline.on { opacity: 1; transform: none; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.28); transition: background .5s; } .dots i.on { background: #fff; }
.words { margin: 0 0 12px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 700; text-align: center; line-height: 1.6; }
.pray-screen .primary { transition: opacity .9s; }
.opt { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; margin-top: 10px; }
.opt button { min-height: 58px; border-radius: 14px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); font-weight: 700; font-size: 13.5px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: all .2s; cursor: pointer; padding: 6px; }
.opt button small { font-size: 10px; color: rgba(255,255,255,.55); font-weight: 600; }
.opt button.on { background: rgba(201,255,130,.18); border-color: #c9ff82; }
.ring { position: relative; width: 170px; height: 170px; margin: 0 auto; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2; } .ring .bg { stroke: rgba(255,255,255,.15); } .ring .fg { stroke: #c9ff82; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring .breath { position: absolute; inset: 18px; border-radius: 50%; background: radial-gradient(circle, rgba(201,255,130,.5), rgba(201,255,130,.08) 60%, transparent 72%); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.7); opacity: .6; } 50% { transform: scale(1.05); opacity: 1; } }
.ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring .big { font-family: var(--serif); font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.ring .sm { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 700; }
.bodymode .ring { display: none; } .bodymode .grow-center { justify-content: flex-end; gap: 8px; }
.alt { display: none; font-size: 13px; color: rgba(255,255,255,.7); } .alt b { font-family: var(--serif); font-size: 30px; color: #fff; } .bodymode .alt { display: block; }
.cue { font-family: var(--serif); font-size: 19px; color: rgba(255,255,255,.85); transition: opacity .5s; min-height: 26px; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.mur { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.7); }
.mur b { font-family: var(--serif); font-size: 22px; color: #c9ff82; font-variant-numeric: tabular-nums; }
.body { position: relative; width: 150px; height: 220px; margin: 0 auto; }
.body svg, .body canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.body svg path { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 1.2; }
.shelves { display: grid; gap: 18px; padding-top: 14px; }
.shelf { position: relative; border-bottom: 2px solid rgba(201,255,130,.45); padding: 0 0 8px; min-height: 40px; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.shelf .lab { position: absolute; right: 0; top: -13px; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.45); font-weight: 700; }
.item { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); font-size: 12.5px; font-weight: 600; transition: transform 1.1s cubic-bezier(.2,.7,.2,1), opacity 1.1s; opacity: .35; white-space: nowrap; }
.item.set { transform: none !important; opacity: 1; } .item.new { border-color: #c9ff82; color: #c9ff82; background: rgba(201,255,130,.12); } .item.dim { opacity: .35 !important; border-style: dashed; }
.summary-screen .axisline, .axisline { margin: 0 0 6px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); text-align: center; }
.axisline b { color: var(--accent); }
.plus { font-family: var(--serif); font-size: 78px; line-height: .9; letter-spacing: -.04em; text-align: center; } .plus small { font-size: 36px; color: var(--accent); vertical-align: top; }
.summary-screen .microcopy { margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 12px 14px; border-radius: 16px; } .stat b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 400; } .stat small { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.house-wrap { padding: 14px 16px 8px; border-radius: 18px; margin: 12px 0; color: var(--muted); }
.house { width: 100%; height: auto; display: block; }
.summary-screen .message-row { margin-top: 12px; }
.counters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.counters .m { padding: 10px 8px; border-radius: 14px; text-align: center; }
.counters .m b { display: block; font-family: var(--serif); font-size: 22px; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; font-weight: 400; } .counters .m b small { font-size: 11px; font-family: var(--sans); color: var(--muted); }
.counters .m span { display: block; margin-top: 4px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.act-list { display: grid; gap: 8px; margin: 12px 0; }
.act { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-align: left; cursor: pointer; color: var(--text); }
.act .ic { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--serif); font-size: 16px; }
.act > span:nth-child(2) { flex: 1; min-width: 0; } .act strong { display: block; font-size: 14px; } .act small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.act .ui-icon { color: var(--faint); }
.act.gold { border-color: var(--accent); background: var(--accent-soft); margin-bottom: 8px; } .act.done { opacity: .7; margin-bottom: 8px; }
.note-widget { padding: 14px; border-radius: 18px; margin: 12px 0; }
.note-widget textarea { width: 100%; min-height: 58px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-light); color: var(--text); padding: 10px; resize: none; font-size: 14px; }
.note-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; } .note-row small { color: var(--faint); font-size: 11px; flex: 1; min-width: 120px; }
.empty-card.small { min-height: 60px; padding: 12px 14px; margin-bottom: 8px; } .empty-card.small p { margin: 0; font-size: 12.5px; color: var(--faint); }
.modes { display: grid; gap: 8px; margin-top: 8px; }
.mode { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-align: left; cursor: pointer; color: var(--text); transition: opacity .3s; }
.mode .ic { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--serif); font-size: 16px; }
.mode > span:nth-child(2) { flex: 1; min-width: 0; } .mode strong { display: block; font-size: 14px; } .mode small { display: block; color: var(--muted); font-size: 12px; }
.mode .sw { flex: 0 0 auto; width: 40px; height: 22px; border-radius: 11px; background: rgba(127,127,127,.25); position: relative; transition: background .3s; }
.mode .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .3s; }
.mode.on .sw { background: var(--accent); } .mode.on .sw::after { transform: translateX(18px); background: var(--accent-ink); }
.mode.off { opacity: .55; } .mode.off .ic { background: rgba(127,127,127,.15); color: var(--faint); }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.pick-grid .answer-card { min-height: 64px; padding: 12px; }
.chat-stream.fut { flex: 1; min-height: 0; overflow-y: auto; }
.future-screen .over { height: 100%; } .future-screen .chat-stream.fut { max-height: none; }
.fut-cap { align-self: center; padding: 14px 0 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.65); font-weight: 700; }
.inv { padding: 14px; border-radius: 16px; margin-top: 12px; font-family: var(--serif); font-size: 16px; line-height: 1.35; user-select: text; -webkit-user-select: text; }
.hypothesis-card .vote-row .vote.selected, .vote.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-height: 700px) { .ring { width: 140px; height: 140px; } .ring .big { font-size: 36px; } .body { width: 120px; height: 176px; } .plus { font-size: 60px; } .pline { font-size: 22px; } .oath { font-size: 22px; } }
.home-screen, .library-screen, .profile-screen { padding-bottom: calc(118px + env(safe-area-inset-bottom)) !important; }
body[data-ui-theme="light"] .insight-card p, body[data-ui-theme="light"] .hypothesis-card p, body[data-ui-theme="light"] .dup-card p, body[data-ui-theme="light"] .next-step-card strong, body[data-ui-theme="light"] .act strong, body[data-ui-theme="light"] .mode strong { color: var(--text); }
body[data-ui-theme="light"] .obs-line, body[data-ui-theme="light"] .act small, body[data-ui-theme="light"] .mode small { color: var(--muted); }
body[data-ui-theme="light"] .mur-chip { color: var(--accent-ink); background: var(--accent); }

/* ===== v1.1: живой шар, сосуды, тест дня ===== */
.orb-box { position: relative; width: var(--s, 200px); height: var(--s, 200px); margin: 0 auto; flex: 0 0 auto; }
.orb-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-visual.hero-orb { display: flex; align-items: center; justify-content: center; }
.hero-orb .floating-note { z-index: 2; }
.scene-bg { position: absolute; inset: 0; background: radial-gradient(60% 40% at 50% 18%, #142019 0%, #070908 70%); overflow: hidden; }
.scene-bg .scene-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; filter: saturate(.7); }
.scene-veil { display: none; }
.pres-count { text-align: center; margin-top: 4px; }
.pres-count b { display: block; font-family: var(--serif); font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; font-weight: 400; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.pres-count span { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 700; }
.body-box { position: relative; width: 190px; height: 276px; margin: 0 auto; flex: 0 0 auto; }
.body-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.horizon { position: absolute; left: 0; right: 0; top: 50%; height: 40%; pointer-events: none; overflow: hidden; opacity: .35; }
.horizon i { position: absolute; left: -20%; right: -20%; top: 0; border-top: 1px solid rgba(255,255,255,.6); }
.horizon i:nth-child(2) { top: 34%; opacity: .5; } .horizon i:nth-child(3) { top: 72%; opacity: .3; }
.viz-horizon .grow-center { position: relative; }
.pray-screen .pline { flex: 0 0 auto; min-height: 96px; align-items: center; }
.vessels { padding: 14px 12px 12px; border-radius: 20px; margin-bottom: 12px; }
.v-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.v { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--text); }
.v b { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; margin-top: 2px; } .v small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.v.big b { color: var(--accent); }
.v-link { flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: center; opacity: .55; }
.v-link i { display: block; width: 100%; height: 1px; background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 9px); }
.v-link i:nth-child(2) { width: 70%; } .v-link i:nth-child(3) { width: 45%; }
.dna { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dna-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dna-chain span { padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12px; font-weight: 600; }
.dna-chain i { width: 12px; height: 1px; background: var(--accent); opacity: .7; }
.ya-msg { padding: 12px; border-radius: 18px; margin-bottom: 12px; }
.ya-msg .quick-replies { margin-top: 10px; }
.reply-chip.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fact { padding: 14px; border-radius: 18px; margin: 12px 0; }
.fact p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.setting-row.col { flex-direction: column; align-items: stretch; }
.row-head { display: flex; align-items: center; gap: 12px; }
.quiz-screen h2 { text-align: center; font-size: 30px; }
.quiz-screen .row2 { margin-bottom: 10px; }
.dark-screen .theme-toggle.on { background: rgba(201,255,130,.2); border-color: #c9ff82; }
@media (max-height: 760px) { .orb-box[style*="--s:250px"] { --s: 200px !important; } .body-box { width: 160px; height: 232px; } .pres-count b { font-size: 38px; } }
.dark-screen .grow-center { overflow: auto; scrollbar-width: none; }
.dark-screen .grow-center::-webkit-scrollbar { display: none; }
.setting-row.col { display: block; }
.setting-row.col .row-head { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
