:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --surface: #fffdf9;
  --ink: #252624;
  --muted: #65665e;
  --line: #e5e0d7;
  --plum: #503d56;
  --plum-dark: #403044;
  --tint: #eee8f0;
  --sage: #41564b;
  --star: #846126;
  --train-art: url('/art/train.webp');
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  --app-height: 100dvh;
  --rail: 218px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.5 var(--sans); }
body, #app { height: var(--app-height); overflow: hidden; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid #916d9c; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

.layout { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100%; }
.rail {
  background: #f1eee8;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  padding: 35px 20px 21px;
}
.brand { display: inline-flex; gap: 11px; align-items: center; align-self: flex-start; }
.rail .brand { margin-left: 10px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 37px; height: 37px; flex: 0 0 37px;
  border-radius: 9px; color: #faf2e8; background: var(--plum);
}
.brand-mark .icon { width: 25px; height: 25px; stroke-width: 1.5; }
.brand-name { font: 400 28px/1 var(--serif); letter-spacing: -.06em; padding-right: 3px; }
.wide-nav { display: grid; gap: 6px; margin-top: 57px; }
.nav-link { display: flex; align-items: center; gap: 12px; color: #545650; font-size: 15px; font-weight: 560; }
.wide-nav .nav-link { min-height: 45px; padding: 7px 12px; border-radius: 8px; }
.nav-link[aria-current="page"] { color: var(--plum); }
.wide-nav .nav-link[aria-current="page"] { background: #e8dfeb; font-weight: 700; }
.wide-nav .nav-link:hover:not([aria-current="page"]) { background: #eae6df; }
.rail-foot { margin-top: auto; display: grid; gap: 12px; padding: 10px; }
.quiet { display: inline-flex; gap: 7px; align-items: center; background: none; border: 0; padding: 6px 0; color: var(--plum); font-size: 14px; text-align: left; }
.quiet:hover { text-decoration: underline; text-underline-offset: 3px; }
.quiet .icon { width: 17px; height: 17px; }
.rail-support { gap: 9px; color: #585952; font-size: 14px; }
.frame { display: grid; grid-template-rows: 67px minmax(0, 1fr); min-width: 0; min-height: 0; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(36px, calc((100% - 1120px) / 2)); gap: 12px; border-bottom: 1px solid var(--line);
}
.crumb { color: #595952; font-size: 14px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.top-brand, .compact-nav, .top-actions .mobile-help { display: none; }
.balance-chip {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  min-height: 38px; min-width: 84px; border-radius: 20px;
  padding: 5px 13px; border: 1px solid #ded5e3; background: #f0ebf2; color: var(--plum); white-space: nowrap;
  font-size: 14px; line-height: 1.2;
}
.balance-chip .icon { width: 16px; height: 16px; }
.balance-chip:hover { background: #e9e0ed; }
.balance-chip strong { font-variant-numeric: tabular-nums; }
.screen { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.container { width: min(calc(100% - 72px), 1120px); margin-inline: auto; }
.page-heading { display: flex; justify-content: space-between; gap: 15px; align-items: end; margin: 27px 0 25px; }
.page-heading h1 { font-size: clamp(40px, 5vw, 58px); line-height: 1.03; letter-spacing: -.05em; }
.page-heading p { color: var(--muted); margin-top: 8px; font-size: 16px; }
.button {
  border: 1px solid transparent; border-radius: 9px;
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 43px; padding: 10px 15px; font-size: 14px; font-weight: 680; line-height: 1.2;
  transition: background-color .15s, border-color .15s;
}
.button .icon { width: 17px; height: 17px; }
.button.primary { color: #fffaf8; background: var(--plum); }
.button.primary:hover:not(:disabled) { background: var(--plum-dark); }
.button.secondary { border-color: #ded7cf; background: var(--surface); color: var(--plum); }
.button.secondary:hover { border-color: #b7aabc; background: #f5eef6; }
.button.cream { background: #f8efe2; color: #202b25; }
.button.cream:hover { background: #fff8f1; }
.button.cream .icon { fill: currentColor; stroke-width: 1; width: 15px; height: 15px; }
.button.stretch { width: 100%; }
.icon-button { display: inline-grid; align-items: center; justify-items: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--plum); }
.icon-button:hover { background: var(--tint); }
.icon-button .icon { width: 21px; height: 21px; }

.feature {
  min-height: 310px; display: flex; align-items: center; border-radius: 15px;
  color: #fff7ea; position: relative; overflow: hidden;
  background: #0c2020 var(--train-art) center 53% / cover no-repeat;
  isolation: isolate;
}
.feature::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(7,22,22,.55), rgba(7,22,22,.09) 60%, transparent 76%);
}
.feature:not(.featured-train) { background: #2a1e1e; }
.feature:not(.featured-train)::before { background: linear-gradient(90deg, #261c1c, rgba(38,28,28,.76) 42%, transparent 81%); }
.feature-art { position: absolute; z-index: -2; inset: 0 0 0 30%; }
.feature-copy { padding: 33px clamp(23px, 4vw, 44px); max-width: 57%; }
.feature-genre { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #dde4d8; font-weight: 550; }
.feature-genre .icon { width: 15px; height: 15px; }
.feature h2 { margin: 11px 0 12px; font-size: clamp(35px, 4.65vw, 66px); line-height: .96; letter-spacing: -.057em; }
.feature p { font-size: 16px; line-height: 1.45; color: #e0e6dc; max-width: 340px; }
.feature .button { margin-top: 22px; }
.library { margin: 32px 0 48px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 13px; }
.section-title h2 { font-size: clamp(28px, 3vw, 35px); letter-spacing: -.045em; }
.section-title > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 17px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; color: #626059; font-size: 13px; font-weight: 600; line-height: 1; min-height: 34px; padding: 7px 12px; white-space: nowrap; border: 1px solid #dedad1; border-radius: 19px; background: transparent; }
.filter-chip .icon { width: 14px; height: 14px; }
.filter-chip[aria-pressed="true"] { border-color: #d7ccd9; background: var(--tint); color: var(--plum); }
.filter-chip:hover:not([aria-pressed="true"]) { background: #fdfaf5; color: var(--plum); }
.scene-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.scene-card {
  position: relative; min-width: 0; display: flex; flex-direction: column; padding: 0;
  border: 1px solid #e4dfd6; border-radius: 12px; background: var(--surface);
  text-align: left; overflow: hidden; transition: border-color .15s, background-color .15s;
}
.scene-card:hover { border-color: #aa99ae; background: #fffcf8; }
.card-copy { display: grid; gap: 4px; padding: 12px 35px 16px 15px; flex: 1; min-width: 0; }
.genre { color: var(--sage); font-size: 12px; font-weight: 700; line-height: 1.3; }
.genre-cafe, .genre-ball, .genre-bookstore, .genre-clock { color: #794d5e; }
.genre-orbit, .genre-lighthouse, .genre-radio { color: #435d6e; }
.card-copy strong { font-family: var(--serif); font-size: clamp(21px, 1.85vw, 26px); font-weight: 400; letter-spacing: -.04em; line-height: 1.12; }
.card-copy .hook { color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 3px; }
.card-chevron { color: #77766c; position: absolute; right: 12px; bottom: 17px; }
.card-chevron .icon { width: 16px; height: 16px; }

.art { position: relative; display: block; overflow: hidden; background: #343c37; flex-shrink: 0; }
.art > span {
  position: absolute; width: 100%; aspect-ratio: 1;
  left: 0; top: 50%; transform: translateY(-50%);
  background: url('/art/worlds.webp') var(--x, 0%) var(--y, 0%) / 300% 200% no-repeat;
}
.art-train > span { height: 100%; background: var(--train-art) 72% center / cover no-repeat; }
.art-library { --x: 50%; }
.art-cafe { --x: 100%; }
.art-orbit { --y: 100%; }
.art-ball { --x: 50%; --y: 100%; }
.art-valley { --x: 100%; --y: 100%; }
.art-clock > span, .art-garden > span, .art-cinema > span, .art-bookstore > span, .art-harbor > span, .art-radio > span {
  background-image: url('/art/extra.webp');
}
.art-garden { --x: 50%; }
.art-cinema { --x: 100%; }
.art-bookstore { --y: 100%; }
.art-harbor { --x: 50%; --y: 100%; }
.art-radio { --x: 100%; --y: 100%; }
.art-custom { background: #7d677d; }
.art-custom > span { border: 1px solid #f4e3ec88; background: none; width: 55%; left: 22.5%; transform: translateY(-50%) rotate(45deg); border-radius: 20%; }
.card-art { width: 100%; aspect-ratio: 1.92; max-height: 179px; }

.collection { padding-top: 16px; padding-bottom: 32px; }
.collection .page-heading { margin-bottom: 30px; }
.empty-state { text-align: center; padding: 58px 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.empty-icon { display: grid; place-items: center; width: 49px; height: 49px; background: var(--tint); color: var(--plum); border-radius: 12px; margin: 0 auto 15px; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-state h2 { font-size: 30px; letter-spacing: -.045em; }
.empty-state p { margin: 7px auto 18px; color: var(--muted); max-width: 390px; }
.chat-list { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; overflow: hidden; }
.chat-list-item { min-height: 80px; display: flex; align-items: center; padding: 12px 16px; gap: 13px; }
.chat-list-item + .chat-list-item { border-top: 1px solid var(--line); }
.chat-list-item:hover { background: #f5f0f3; }
.chat-list-item:focus-visible { outline-offset: -3px; }
.list-avatar, .initial { width: 46px; height: 46px; border-radius: 9px; flex: 0 0 46px; }
.list-copy { min-width: 0; display: grid; gap: 2px; flex: 1; }
.list-copy strong { font-weight: 680; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-copy span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 14px; }
.chat-list-item time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.chat-list-item > .icon { width: 16px; height: 16px; color: var(--muted); }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.hero-card { border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 13px; text-align: left; border-radius: 11px; padding: 15px; }
.hero-card:hover { border-color: #baaabf; }
.initial { display: grid; place-items: center; color: var(--plum); background: #eae3ed; font: 400 24px/1 var(--serif); }
.hero-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.hero-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-copy span { color: var(--muted); line-height: 1.3; font-size: 14px; overflow-wrap: anywhere; }
.hero-portrait { object-fit: cover; display: block; }
.chat-avatar { position: relative; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; color: var(--plum); background: #eae3ed; font: 400 20px/1 var(--serif); }
.chat-avatar::after { content: ''; position: absolute; inset: 0; background: var(--chat-portrait, none) center / cover no-repeat; }
.chat-avatar.line-avatar { font-size: 15px; }
.hero-portrait-preview, .hero-portrait-remove { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.hero-portrait-remove input { width: auto; }
.hero-card > .icon { color: var(--muted); width: 16px; height: 16px; }

.is-chat .frame { grid-template-rows: minmax(0, 1fr); }
.is-chat .top { display: none; }
.is-chat .screen { overflow: hidden; scrollbar-gutter: auto; }
.conversation { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.conversation-head { display: flex; align-items: center; padding: 0 25px; gap: 11px; min-height: 71px; flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.conversation-avatar { height: 41px; width: 41px; border-radius: 9px; }
.conversation-name { display: grid; flex: 1; min-width: 0; gap: 1px; }
.conversation-name h1 { font-family: var(--sans); font-weight: 700; font-size: 16px; line-height: 1.2; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.conversation-name > span { color: var(--muted); font-size: 13px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.conversation-info { border-color: var(--line); }
.conversation-body { display: flex; flex: 1; min-height: 0; }
.conversation-flow { min-width: 0; min-height: 0; display: flex; flex-direction: column; flex: 1; }
.messages { display: flex; min-height: 0; flex-direction: column; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.messages-inner { width: min(calc(100% - 48px), 680px); margin: auto auto 0; padding: 16px 0 23px; display: grid; gap: 15px; }
.scene-rule { display: flex; align-items: center; gap: 12px; color: #77756e; font-size: 12px; margin: 0 0 7px; }
.scene-rule::before, .scene-rule::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.line { display: flex; gap: 10px; align-items: start; min-width: 0; }
.line-avatar { width: 32px; height: 32px; border-radius: 8px; margin-top: 2px; }
.line-content { max-width: 88%; min-width: 0; }
.speaker { display: block; font-size: 13px; color: var(--plum); font-weight: 680; margin: 0 0 4px 1px; }
.bubble { padding: 11px 15px; border: 1px solid #e9e3da; background: var(--surface); border-radius: 3px 13px 13px 13px; overflow-wrap: anywhere; }
.bubble p { line-height: 1.6; margin: 0; }
.bubble p + p { margin-top: 9px; }
.rp-action { font-style: italic; }
.outgoing { justify-content: flex-end; }
.outgoing .bubble { border-radius: 13px 3px 13px 13px; background: #ebe4ee; border-color: #e3d9e8; }
.compose-area { width: min(calc(100% - 46px), 680px); margin-inline: auto; padding: 4px 0 14px; flex: 0 0 auto; }
.composer { display: flex; align-items: end; gap: 3px; padding: 7px; border: 1px solid #dcd5cd; background: var(--surface); border-radius: 12px; }
.composer:focus-within { border-color: #a287aa; box-shadow: 0 0 0 2px #e8dfea; }
.composer textarea { flex: 1; min-width: 0; min-height: 39px; max-height: 142px; padding: 8px 8px 8px 7px; line-height: 23px; background: none; border: 0; resize: none; outline: 0; color: var(--ink); }
.composer textarea:focus { outline: 0; }
.rp-preview {
  margin-bottom: 6px; padding: 6px 10px; max-height: 84px; overflow: auto;
  border-left: 2px solid #a287aa; background: #f0e9ef; color: var(--plum-dark);
  font-size: 13px; overflow-wrap: anywhere;
}
.rp-preview[hidden] { display: none; }
.credit-banner {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px;
  border: 1px solid #dfcfd9; background: #f0e9ef; color: var(--plum-dark); border-radius: 9px;
}
.credit-banner p { flex: 1; font-size: 13px; line-height: 1.36; }
.credit-banner .button { min-height: 34px; padding: 7px 10px; white-space: nowrap; }
.send-button { width: 39px; height: 39px; flex: 0 0 39px; background: var(--plum); color: #fffaf5; border: 0; border-radius: 8px; padding: 0; }
.send-button:hover:not(:disabled) { background: var(--plum-dark); }
.send-button:disabled { opacity: 1; color: #807084; background: #eee8f0; }
.send-button .icon { width: 20px; height: 20px; stroke-width: 1.9; }
.compose-note { display: flex; justify-content: space-between; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: 12px; }
.compose-note span { display: inline-flex; align-items: center; gap: 5px; }
.compose-note .icon { width: 13px; height: 13px; }
.choices { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.choice { background: transparent; color: var(--plum); border: 1px solid #dbd0de; min-height: 33px; border-radius: 7px; padding: 5px 9px; font-size: 13px; }
.choice:hover { background: var(--tint); }
.older { justify-self: center; }
.typing { display: inline-flex; gap: 4px; margin-left: 42px; }
.typing > span:not(.sr-only) { width: 5px; height: 5px; border-radius: 50%; background: #75617a; animation: breathe 1.2s ease-in-out infinite alternate; }
.typing > span:nth-child(2) { animation-delay: .18s; }
.typing > span:nth-child(3) { animation-delay: .36s; }
@keyframes breathe { from { opacity: .35; } to { opacity: .95; } }
.story-sidebar { display: none; flex: 0 0 min(28%, 308px); border-left: 1px solid var(--line); background: #f3efe9; padding: 26px 19px; overflow: auto; }
.story-sidebar > h2 { font: 600 14px/1.3 var(--sans); margin: 0 0 16px; }
.facts-hero, .introduce { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.facts-avatar { width: 42px; height: 42px; border-radius: 8px; }
.facts-hero div, .introduce div { display: grid; gap: 1px; min-width: 0; }
.facts-hero strong, .introduce strong { color: var(--ink); font-size: 15px; line-height: 1.3; }
.facts-hero small, .introduce small { color: var(--muted); font-size: 13px; line-height: 1.32; }
.facts dl, .card-facts { margin: 17px 0 0; overflow-wrap: anywhere; }
.facts dt, .card-facts dt { font-weight: 680; color: var(--ink); font-size: 14px; margin: 15px 0 4px; }
.facts dd, .card-facts dd { margin: 0; color: #55574f; font-size: 14px; line-height: 1.48; white-space: pre-line; }
.card-facts dd p + p { margin-top: 8px; }
.compact-facts { margin-bottom: 18px; }

.boot { min-height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 22px; }
.boot h1 { font-size: 45px; letter-spacing: -.06em; line-height: 1; }
.boot p, .screen-state { color: var(--muted); }
.screen-state { padding: 35px 25px; text-align: center; }
.gate { height: 100%; display: grid; align-items: safe center; justify-items: center; padding: 18px; overflow-y: auto; }
.gate-card {
  width: min(100%, 440px); background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  padding: clamp(17px, 5vw, 29px);
}
.gate-brand { display: flex; align-items: center; gap: 9px; color: var(--plum); }
.gate h1 { font-size: clamp(31px, 6vw, 41px); margin: 16px 0 8px; line-height: 1; letter-spacing: -.045em; }
.gate p { color: var(--muted); font-size: 15px; line-height: 1.4; }
.gate form { display: grid; gap: 12px; margin-top: 17px; }
.gate .field small { color: var(--muted); font-size: 12px; font-weight: 400; }
.welcome-card { padding: clamp(20px, 6vw, 32px); }
.welcome-card h1 { max-width: 13ch; line-height: 1.03; }
.welcome-credits { display: flex; align-items: center; gap: 12px; margin-top: 21px; padding: 14px; border-radius: 12px; background: var(--wash, #f3efe8); }
.welcome-credit-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); color: var(--plum); }
.welcome-credits strong, .welcome-credits small { display: block; }
.welcome-credits small { color: var(--muted); line-height: 1.4; margin-top: 2px; }
.welcome-card form { margin-top: 17px; }
.welcome-card .button { min-height: 48px; }
.gate .form-error { color: #8d2939; font-size: 14px; }
.gate-card > .button { margin-top: 16px; }
.sheet {
  border: 1px solid #e0d9ce; border-radius: 15px; background: var(--surface);
  max-width: min(calc(100vw - 32px), 540px); width: 540px; max-height: min(calc(var(--app-height) - 30px), 790px);
  padding: 0; overflow: auto; color: var(--ink); box-shadow: 0 15px 45px #251b2940; scrollbar-width: thin;
}
.sheet::backdrop { background: rgba(26,23,26,.48); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 22px 10px; }
.dialog-heading h2 { font-size: 35px; letter-spacing: -.044em; line-height: 1.02; overflow-wrap: anywhere; }
.dialog-heading .icon-button { margin-right: -6px; align-self: flex-start; }
.dialog-overline { display: block; color: var(--sage); font-weight: 660; font-size: 13px; margin-bottom: 5px; }
.dialog-body { padding: 3px 22px 22px; }
.dialog-body > p { font-size: 15px; color: var(--muted); }
.dialog-body > p + p { margin-top: 7px; }
.dialog-body > .intro { font-size: 16px; color: var(--ink); }
.scene-details .introduce { margin: 19px 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.sheet-cover { width: 100%; max-height: 180px; aspect-ratio: 2.8; }
.fields { display: grid; gap: 11px; }
.field { display: grid; gap: 5px; width: 100%; font-size: 14px; font-weight: 660; }
.intro + .field, .intro + .fields { margin-top: 13px; }
.field input, .field textarea, .field select {
  border: 1px solid #ded9d1; background: #fbf9f4; border-radius: 8px;
  width: 100%; padding: 9px 10px; color: var(--ink); font-size: 16px; font-weight: 400;
}
.field textarea { resize: vertical; min-height: 54px; }
.field select { min-height: 43px; }
.field + .stretch { margin-top: 14px; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 17px; }
.dialog-buttons .quiet { margin-right: auto; }
.dialog-body .form-error { color: #8d2939; font-size: 14px; margin: 9px 0 0; }
.danger { color: #864757; }
.delete-button { background: #8a4050; color: white; }
.delete-button:hover { background: #743343; }
.terms-body h3 { font: 680 15px/1.35 var(--sans); margin: 14px 0 4px; }
.terms-body p { margin-bottom: 13px; }

.wallet-total { display: flex; align-items: baseline; gap: 8px; margin: 0 0 13px; color: var(--plum); }
.wallet-total .icon { align-self: center; width: 22px; height: 22px; }
.wallet-total strong { font-family: var(--serif); font-weight: 400; font-size: 39px; letter-spacing: -.04em; line-height: 1.12; }
.wallet-total span { color: var(--muted); font-size: 14px; }
.promo { display: flex; gap: 13px; align-items: center; padding: 10px 12px; background: #eee7ef; color: var(--plum-dark); border-radius: 9px; margin-bottom: 15px; }
.promo-number { font: 400 30px/1 var(--serif); letter-spacing: -.055em; white-space: nowrap; }
.promo p { font-size: 13px; line-height: 1.36; }
.promo strong { font-weight: 700; font-size: 14px; }
.packs { min-width: 0; border: 0; padding: 0; margin: 0 0 15px; display: grid; gap: 7px; }
.packs legend { font-size: 13px; color: var(--muted); font-weight: 650; padding: 0; margin: 0 0 5px; }
.pack {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--line); min-height: 57px; background: var(--paper); cursor: pointer;
}
.pack:has(:checked) { border-color: #ad97b4; background: #f2ecf3; }
.pack input { accent-color: var(--plum); width: 16px; height: 16px; margin: 0; flex-shrink: 0; }
.pack-copy { display: grid; flex: 1; }
.pack-copy strong { font-weight: 700; font-size: 15px; line-height: 1.25; }
.pack-copy small { color: var(--muted); font-size: 12px; }
.star-price { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.star-price .icon, .wallet-body .primary .icon { width: 16px; height: 16px; fill: currentColor; }
.star-price .icon { color: var(--star); }
.wallet-body .wallet-receipt { color: #355d43; background: #e9f0e9; border-radius: 7px; padding: 6px 9px; font-size: 13px; margin: 7px 0; }
.wallet-body .wallet-warning { background: var(--tint); color: var(--plum-dark); }
.wallet-body .wallet-note { text-align: center; margin: 6px 0 4px; font-size: 12px; }
.order-history { border-top: 1px solid var(--line); margin-top: 11px; padding-top: 9px; }
.order-history summary { cursor: pointer; font-size: 14px; font-weight: 650; }
.order-history ul { margin: 8px 0 5px; padding: 0; list-style: none; }
.order-history li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.order-history li + li { border-top: 1px solid var(--line); }
.order-history li div { display: grid; }
.order-history li strong { font-size: 14px; }
.order-history li small { font-size: 12px; color: var(--muted); }
.wallet-help { display: flex; margin: 6px auto -6px; padding: 5px 3px; font-size: 13px; }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 20; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-radius: 8px; background: #38313a; color: #fff8ee; max-width: min(390px, calc(100vw - 36px)); box-shadow: 0 4px 15px #271e2929; font-size: 14px; }
.toast.positive { background: #3e594b; }
.toast .icon { width: 17px; height: 17px; }

@media (min-width: 1180px) {
  .story-sidebar { display: block; }
}
@media (max-width: 1050px) {
  :root { --rail: 182px; }
  .rail { padding-left: 14px; padding-right: 14px; }
  .scene-grid { gap: 13px; }
  .top { padding-inline: 25px; }
  .container { width: calc(100% - 50px); }
  .feature { min-height: 273px; }
  .card-copy { padding-right: 25px; }
  .card-chevron { right: 7px; }
}
@media (max-width: 840px) {
  .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .container { width: calc(100% - 42px); }
  .feature-copy { max-width: 68%; }
  .rail { padding-top: 29px; }
}
@media (max-width: 690px) {
  :root { --rail: 0px; }
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail, .crumb { display: none; }
  .top-brand { display: inline-flex; align-self: center; gap: 8px; }
  .top-brand .brand-mark { width: 30px; height: 30px; flex-basis: 30px; border-radius: 7px; }
  .top-brand .brand-mark .icon { width: 21px; height: 21px; }
  .top-brand .brand-name { font-size: 24px; }
  .top-actions .mobile-help { display: inline-grid; width: 34px; height: 34px; flex-basis: 34px; }
  .frame { grid-template-rows: 55px minmax(0, 1fr); }
  .top { padding-inline: 16px; }
  .balance-chip { min-width: 74px; min-height: 34px; padding-inline: 9px; gap: 5px; }
  .compact-nav {
    display: grid; grid-template-columns: repeat(3, 1fr);
    min-height: 60px; padding: 4px 8px max(4px, env(safe-area-inset-bottom)); background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .compact-nav .nav-link { justify-content: center; gap: 3px; flex-direction: column; min-height: 48px; font-size: 11px; line-height: 1.2; }
  .compact-nav .nav-link[aria-current="page"] { font-weight: 750; }
  .compact-nav .nav-link[aria-current="page"] .icon { stroke-width: 2; }
  .compact-nav .nav-link .icon { width: 22px; height: 22px; }
  .is-chat { grid-template-rows: minmax(0, 1fr); }
  .is-chat .compact-nav { display: none; }
  .screen { scrollbar-gutter: auto; }
  .container { width: calc(100% - 32px); }
  .page-heading { margin: 22px 0 17px; }
  .page-heading h1 { font-size: 41px; }
  .page-heading p { margin-top: 6px; font-size: 14px; line-height: 1.38; }
  .feature { min-height: 244px; border-radius: 12px; background-position: 69% center; }
  .feature::before { background: linear-gradient(90deg, rgba(7,22,22,.87), rgba(7,22,22,.59) 52%, rgba(7,22,22,.10)); }
  .feature:not(.featured-train)::before { background: linear-gradient(90deg, #261c1cee, #261c1ca3 55%, #261c1c25); }
  .feature-art { inset: 0 0 0 22%; }
  .feature-copy { max-width: min(90%, 400px); padding: 21px 19px; }
  .feature h2 { font-size: clamp(32px, 9.2vw, 50px); margin: 9px 0; }
  .feature p { font-size: 14px; max-width: 255px; }
  .feature-genre { font-size: 12px; }
  .feature .button { margin-top: 16px; }
  .library { margin: 21px 0 25px; }
  .section-title { margin-bottom: 8px; }
  .section-title h2 { font-size: 27px; }
  .filters { flex-wrap: nowrap; margin: 0 -16px 11px; padding: 3px 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter-chip { min-height: 34px; }
  .scene-grid { gap: 10px; }
  .scene-card { border-radius: 10px; }
  .card-copy { padding: 9px 10px 11px; gap: 4px; }
  .card-copy strong { font-size: 20px; line-height: 1.05; }
  .card-copy .hook { font-size: 12.5px; line-height: 1.34; }
  .card-chevron { display: none; }
  .genre { font-size: 11.5px; }
  .card-art { aspect-ratio: 1.53; }
  .collection { padding-top: 3px; }
  .collection .page-heading { flex-wrap: wrap; align-items: start; margin-bottom: 20px; gap: 11px; }
  .collection .page-heading .button { min-height: 38px; }
  .empty-state { padding: 35px 17px; }
  .empty-state h2 { font-size: 26px; }
  .empty-state p { font-size: 14px; }
  .hero-grid { grid-template-columns: 1fr; }
  .chat-list-item { padding: 8px 10px; gap: 8px; min-height: 67px; }
  .chat-list-item > .icon { display: none; }
  .list-avatar { width: 41px; height: 41px; flex-basis: 41px; }
  .list-copy span { font-size: 13px; }
  .conversation-head { min-height: 58px; padding: 0 9px 0 4px; gap: 6px; }
  .conversation-head .icon-button { width: 33px; height: 36px; flex-basis: 33px; }
  .conversation-avatar { width: 34px; height: 34px; border-radius: 7px; }
  .conversation-name h1 { font-size: 15px; }
  .conversation-name > span { font-size: 12px; }
  .messages-inner { width: calc(100% - 25px); gap: 12px; padding-bottom: 15px; }
  .line { gap: 6px; }
  .line-avatar { height: 26px; width: 26px; border-radius: 6px; }
  .line-content { max-width: min(calc(100% - 32px), 89%); }
  .bubble { padding: 9px 10px; }
  .bubble p { line-height: 1.48; }
  .compose-area { width: calc(100% - 22px); padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  .credit-banner { gap: 7px; padding: 7px 8px; }
  .credit-banner .button { padding-inline: 8px; font-size: 12px; }
  .choices { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: 0 -3px 4px; }
  .choice { white-space: nowrap; }
  .typing { margin-left: 32px; }
  .sheet { width: min(100vw, 540px); max-width: 100vw; border-radius: 15px 15px 0 0; margin: auto auto 0; max-height: min(calc(var(--app-height) - 19px), 790px); }
  .dialog-heading { padding: 17px 15px 9px; }
  .dialog-heading h2 { font-size: 31px; }
  .dialog-heading .icon-button { margin: -3px -4px 0 0; }
  .dialog-body { padding: 3px 15px max(20px, env(safe-area-inset-bottom)); }
  .dialog-body > p { font-size: 15px; }
  .sheet-cover { max-height: 136px; }
  #toasts { right: 10px; bottom: max(67px, calc(env(safe-area-inset-bottom) + 56px)); }
  .toast { max-width: calc(100vw - 20px); }
}
@media (max-width: 360px) {
  .feature { min-height: 225px; }
  .card-copy strong { font-size: 18px; }
  .card-copy .hook { font-size: 12px; }
  .conversation-head .chat-balance { min-width: 53px; padding-inline: 6px; }
  .conversation-head .chat-balance > span { display: none; }
  .dialog-buttons { gap: 5px; }
  .dialog-buttons .button { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
