:root {
  --bg: #140F17;
  --side: #110D14;
  --surface: #1F1823;
  --surface-2: #241C29;
  --raised: #2A2130;
  --line: #3A2F40;
  --line-soft: #2A2130;
  --text: #F5EEE6;
  --text-2: #E6DCE3;
  --muted: #B8ACB6;
  --faint: #9C909A;
  --rose: #F2937E;
  --rose-ink: #2A1418;
  --gold: #EFC27B;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--rose); }
img { display: block; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--text); text-decoration: none; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px; background: var(--side); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.side .brand { padding: 4px 12px 18px; }
.nav { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 600; background: none; border: none; cursor: pointer; width: 100%; text-align: left; }
.nav:hover { background: var(--surface); }
.nav.on { background: var(--surface-2); color: var(--text); font-weight: 700; }
.nav .num { margin-left: auto; font-weight: 800; }
.nav .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 4px; background: var(--rose); }
.side-label { margin: 18px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--faint); }
.recent { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.recent:hover { background: var(--surface); }
.recent img { width: 36px; height: 36px; border-radius: 18px; object-fit: cover; object-position: center 15%; }
.recent span { font-size: 14px; font-weight: 700; }
.side-foot { margin-top: auto; padding: 20px 8px 0; font-size: 11px; color: var(--faint); line-height: 1.6; }
.side-foot a { color: var(--faint); }
.main { flex: 1; min-width: 0; padding: 20px 32px 48px; display: flex; flex-direction: column; gap: 20px; }

.top { display: flex; gap: 12px; align-items: center; }
.top .brand { display: none; }
.search { flex: 1; min-width: 0; height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.pill { height: 44px; padding: 0 14px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--text); cursor: pointer; }

.banner { display: flex; min-height: 220px; border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.banner .copy { flex: 1 1 360px; padding: 32px 36px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--gold); }
.banner .title { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.15; max-width: 560px; }
.banner img { flex: 0 1 46%; min-width: 0; height: 220px; object-fit: cover; object-position: center 18%; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 22px; background: var(--rose); color: var(--rose-ink); font-size: 15px; font-weight: 700; text-decoration: none; border: none; cursor: pointer; }
.btn.block { width: 100%; height: 50px; border-radius: 25px; font-size: 16px; }
.btn.small { align-self: flex-start; height: 40px; font-size: 14px; }
.link { background: none; border: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px 12px; text-decoration: none; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--line); background: transparent; color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.style-pick { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.style-pick select { height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.card { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text); background: var(--surface); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; transition: transform .4s ease; }
.card:hover img { transform: scale(1.03); }
.card .shade { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(180deg, rgba(20,15,23,0) 0%, rgba(20,15,23,.95) 62%); }
.card .info { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.card .name { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.card .hook { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.card .tags { font-size: 10px; font-weight: 800; letter-spacing: .07em; color: var(--gold); text-transform: uppercase; }
.end { text-align: center; color: var(--muted); font-size: 13px; padding-top: 8px; }
.end strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 400; color: var(--text); margin-bottom: 4px; }

/* story page */
.story-wrap { display: flex; gap: 0; flex: 1; min-width: 0; }
.story { flex: 1; min-width: 0; padding: 0 0 48px; }
.story-head { height: 68px; padding: 0 28px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.story-head img { width: 38px; height: 38px; border-radius: 19px; object-fit: cover; object-position: center 15%; }
.story-head .who { display: flex; flex-direction: column; }
.story-head .who b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.story-head .who span { font-size: 12px; color: var(--muted); }
.story-head .back { margin-right: 4px; color: var(--text); display: inline-flex; width: 36px; height: 44px; align-items: center; justify-content: center; }
.story-body { max-width: 720px; margin: 0 auto; padding: 28px 28px 0; display: flex; flex-direction: column; gap: 18px; }
.story-body .hero { width: 100%; height: 260px; object-fit: cover; object-position: center 30%; border-radius: 18px; }
.story-body h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 32px; }
.prose { display: flex; flex-direction: column; gap: 12px; font-family: var(--serif); font-size: 17px; line-height: 1.65; color: #EDE4EA; }
.prose p { margin: 0; }
.his { padding: 14px 18px; border-radius: 4px 18px 18px 18px; background: #221A27; border: 1px solid var(--line); font-family: var(--serif); font-size: 17px; line-height: 1.6; }
.his em, .prose em { color: #C9BEC7; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice { text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.4; cursor: pointer; }
.choice:hover { border-color: var(--rose); }
.own { display: flex; gap: 10px; }
.own input { flex: 1; min-width: 0; height: 50px; padding: 0 20px; border-radius: 25px; border: 1px solid var(--line); background: var(--surface); }
.send { width: 50px; height: 50px; border-radius: 25px; border: none; background: var(--rose); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.panel { width: 340px; flex-shrink: 0; border-left: 1px solid var(--line-soft); background: #17121A; }
.panel img { width: 100%; height: 440px; object-fit: cover; object-position: center 15%; }
.panel .meta { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 26px; }
.panel .line { font-size: 13px; color: #C9BEC7; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--raised); }
.ai-note { font-size: 12px; color: var(--faint); }
.more { max-width: 720px; margin: 40px auto 0; padding: 0 28px; display: flex; flex-direction: column; gap: 12px; }
.more .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.more .card .hook { display: none; }
.more .card .name { font-size: 16px; }

/* modal */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10,7,12,.8); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.modal h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.25; }
.modal p { margin: 0; font-size: 15px; line-height: 1.55; color: #C9BEC7; }
.modal .fine { font-size: 12px; color: var(--faint); text-align: center; }
.modal .x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 20px; border: none; background: var(--raised); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.modal form { display: flex; flex-direction: column; gap: 10px; }
.modal input[type=email] { height: 50px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: #181219; }
.modal .err { color: var(--rose); font-size: 13px; min-height: 1em; }
.modal .others { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.modal .others a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); font-size: 12px; font-weight: 700; }
.modal .others img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 15%; border-radius: 10px; }

/* legal pages */
.doc { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; line-height: 1.65; color: var(--text-2); }
.doc h1 { font-family: var(--serif); font-weight: 600; color: var(--text); }
.doc h2 { font-size: 17px; color: var(--text); margin-top: 28px; }

/* bottom tabs (phone) */
.tabs { display: none; }

@media (max-width: 1180px) {
  .panel { display: none; }
}
@media (max-width: 899px) {
  .side { display: none; }
  .main { padding: 12px 16px 96px; gap: 14px; }
  .top .brand { display: block; flex: 1; font-size: 24px; }
  .top .search { display: none; }
  .pill { height: 38px; }
  .banner { min-height: 132px; border-radius: 18px; }
  .banner .copy { padding: 14px 6px 14px 16px; gap: 6px; }
  .banner .title { font-size: 17px; }
  .banner .btn { display: none; }
  .banner img { flex: 0 0 130px; height: 132px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .style-pick { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { border-radius: 14px; }
  .card .info { left: 10px; right: 10px; bottom: 10px; gap: 4px; }
  .card .name { font-size: 15px; }
  .card .hook { font-size: 11px; line-height: 1.35; }
  .card .tags { font-size: 9px; }
  .story-head { padding: 0 12px; height: 58px; }
  .story-body { padding: 0 0 0; gap: 14px; }
  .story-body .hero { height: 200px; border-radius: 0; }
  .story-body > :not(.hero) { margin-left: 20px; margin-right: 20px; }
  .story-body h1 { font-size: 26px; }
  .prose, .his { font-size: 16px; }
  .choices { grid-template-columns: 1fr; }
  .more { padding: 0 16px; }
  .more .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 66px; padding: 0 18px 8px; background: #1A141E; border-top: 1px solid #2F2535; justify-content: space-between; align-items: center; }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--faint); font-size: 10px; font-weight: 600; background: none; border: none; cursor: pointer; min-width: 52px; }
  .tab.on { color: var(--text); font-weight: 800; }
  .scrim { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 26px 26px 0 0; padding: 26px 22px 30px; max-height: 92vh; }
}

/* Full MVP additions */
button { font-family: var(--sans); }
.nav svg, .tab svg, .back svg, .icon-btn svg, .send svg, .balance-pill svg, .refill svg, .pin svg, .me-balance svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.spark { fill: var(--gold) !important; stroke: none !important; }
.rose { color: var(--rose); }
.global-ai { margin: 0; text-align: center; color: var(--faint); font-size: 11px; }
.save-side { margin: 18px 8px 8px; min-height: 48px; padding: 7px 12px; border: 0; border-radius: 24px; background: var(--text); color: var(--bg); font-weight: 800; cursor: pointer; }
.save-side small { color: #65414c; }
.account-side { display: block; text-align: center; text-decoration: none; overflow: hidden; }
.account-side small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent.on { background: var(--surface-2); }
.fatal { max-width: 500px; margin: 20vh auto; padding: 24px; text-align: center; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 32px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 16px; border: 1px solid rgba(239,194,123,.45); border-radius: 999px; background: #2b222f; color: #f3d6a4; font-size: 13px; font-weight: 700; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.icon-btn { display: inline-grid; place-items: center; border: 0; background: transparent; color: inherit; cursor: pointer; }
.modal.wide { max-width: 860px; }
.modal input[type=email], .notify-email input { width: 100%; height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #181219; }
.modal .code-input, .delete-confirm input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #181219; }
.modal .code-input { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: .28em; }
.dev-code { padding: 9px 12px; border-radius: 10px; background: #181219; color: var(--gold); text-align: center; font-size: 12px; }
.delete-confirm { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.danger-btn { background: #c65f5f; color: white; }
.modal button:disabled { opacity: .55; cursor: default; }

/* model picker */
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.model-card { min-height: 180px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); color: var(--text); text-align: left; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.model-card.selected { border: 2px solid var(--rose); background: var(--raised); }
.model-title { display: flex; align-items: center; justify-content: space-between; font: 600 21px var(--serif); }
.model-title b { padding: 3px 7px; border-radius: 5px; background: var(--rose); color: var(--rose-ink); font: 800 9px var(--sans); letter-spacing: .08em; }
.model-card > strong { color: var(--gold); font-size: 14px; }
.model-card > small { color: #c9bec7; font-size: 13px; line-height: 1.5; }
.how { padding: 14px 16px; border: 1px dashed #4a3e50; border-radius: 14px; background: #181219; color: #c9bec7; font-size: 13px; line-height: 1.55; }

/* paywall, fake door, check-in */
.refill { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #181219; font-size: 13px; }
.refill svg { color: var(--rose); }
.offers { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.offer { position: relative; min-height: 116px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.offer.best { border: 2px solid var(--rose); background: var(--raised); }
.offer b { font-size: 20px; }
.offer small { color: var(--muted); }
.offer strong { margin-top: 6px; color: var(--rose); }
.pass { padding: 15px; border: 1px solid #6a4a55; border-radius: 16px; background: #2a1f2e; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.pass span { display: flex; flex-direction: column; gap: 5px; }
.pass b { font: 600 19px var(--serif); }
.pass small { color: #c9bec7; line-height: 1.4; }
.pass strong { color: var(--rose); white-space: nowrap; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; color: var(--text-2); font-size: 14px; }
.week { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.day { min-height: 70px; padding: 8px 4px; border: 1px solid var(--line-soft); border-radius: 12px; background: #181219; color: var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.day.today { border: 2px solid var(--rose); background: var(--raised); color: var(--text); }
.day:last-child { grid-column: span 2; background: #2a1f2e; }

/* chat */
.chat-shell { display: grid; grid-template-columns: 240px minmax(420px,1fr) 340px; height: 100vh; overflow: hidden; }
.chat-shell > .side { width: auto; }
.chat-main { min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-head { height: 68px; flex: 0 0 68px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.chat-head .back { display: none; width: 36px; color: var(--text); }
.chat-person { min-width: 0; margin-right: auto; padding: 0; border: 0; background: transparent; color: var(--text); display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.chat-person img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center 15%; }
.chat-person span { min-width: 0; display: flex; flex-direction: column; }
.chat-person b { font: 600 17px var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-person small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tier-pill, .balance-pill { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.balance-pill { background: var(--raised); border-color: transparent; }
.messages { flex: 1; overflow-y: auto; min-height: 0; padding: 24px max(22px, calc((100% - 700px)/2)) 28px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { max-width: 84%; padding: 12px 16px; font-size: 15px; line-height: 1.6; }
.msg.user { align-self: flex-end; border-radius: 18px 4px 18px 18px; background: #5a3440; }
.assistant-wrap { align-self: flex-start; max-width: 88%; }
.msg.assistant { max-width: none; border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; background: #221a27; font-family: var(--serif); font-size: 16px; }
.msg.assistant em { color: #c9bec7; }
.typing { color: var(--faint); letter-spacing: .15em; }
.reply-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 7px; }
.reply-meta > span { margin-right: 2px; color: var(--faint); font-size: 11px; }
.reply-meta button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 15px; background: #17121a; color: var(--text-2); font-size: 11px; font-weight: 700; cursor: pointer; }
.save-prompt { align-self: stretch; padding: 14px 16px; border: 1px solid rgba(239,194,123,.38); border-radius: 15px; background: rgba(239,194,123,.09); display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; }
.save-prompt b { color: #f3d6a4; }
.save-prompt span { color: #c9bec7; font-size: 12px; }
.save-prompt .btn { grid-row: 1 / 3; grid-column: 2; }
.composer { flex: 0 0 auto; padding: 10px max(22px, calc((100% - 700px)/2)) 12px; border-top: 1px solid var(--line-soft); background: rgba(20,15,23,.98); display: flex; flex-direction: column; gap: 9px; }
.composer form { display: flex; gap: 10px; }
.composer input { flex: 1; min-width: 0; height: 50px; padding: 0 18px; border: 1px solid var(--line); border-radius: 25px; background: var(--surface); }
.suggestions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.suggestions button { flex: 0 0 auto; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer; }
.chat-info { min-width: 0; border-left: 1px solid var(--line-soft); background: #17121a; overflow-y: auto; }
.info-portrait { width: 100%; height: 380px; object-fit: cover; object-position: center 15%; }
.info-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.info-body h2 { margin: 0; font: 600 24px var(--serif); }
.info-tabs { margin-top: 4px; display: flex; gap: 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.info-tabs b { padding: 10px 0; border-bottom: 2px solid var(--rose); color: var(--text); }
.info-tabs span { padding: 10px 0; }
.mini-memories { display: flex; flex-direction: column; gap: 8px; }
.mini-memories span { padding: 9px 11px; border-radius: 10px; background: var(--surface); font-size: 12px; }
.info-body > a { font-size: 12px; font-weight: 700; text-decoration: none; }
.drawer-close { display: none; }

/* relationship */
.us-main { width: min(900px, calc(100% - 240px)); margin: 0 auto; padding: 30px 36px 80px; display: flex; flex-direction: column; gap: 18px; }
.us-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.us-head h1 { margin: 4px 0 2px; font: 600 32px var(--serif); }
.us-head p { margin: 0; color: var(--muted); font-size: 13px; }
.relationship { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.relationship > div:first-child { display: flex; justify-content: space-between; }
.relationship b { font: 600 18px var(--serif); }
.relationship small, .relationship p { color: var(--muted); font-size: 12px; }
.relationship p { margin: 10px 0 0; }
.level-bar { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin-top: 12px; }
.level-bar span { height: 6px; border-radius: 3px; background: var(--line); }
.level-bar span.on { background: var(--rose); }
.us-section { display: flex; flex-direction: column; gap: 10px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); }
.section-title b { font-size: 11px; letter-spacing: .12em; }
.section-title span { color: var(--faint); font-size: 11px; }
.memory-list { display: flex; flex-direction: column; gap: 7px; }
.memory-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto auto; gap: 7px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.memory-row > span { font-size: 13px; }
.memory-row > button:not(.pin) { border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.pin { width: 28px; height: 28px; border: 0; background: transparent; color: #6a5c70; cursor: pointer; }
.pin.on { color: var(--gold); }
.add-memory { height: 40px; border: 1px dashed #4a3e50; border-radius: 12px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 700; cursor: pointer; }
.empty { margin: 0; padding: 16px; border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 13px; }
.anniversaries { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.anniversaries > div { padding: 12px 14px; border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; }
.anniversaries strong { color: var(--gold); font-size: 11px; }
.anniversaries span { font-size: 13px; }
.moments { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.moment { min-height: 130px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; cursor: pointer; }
.moment > span { font-size: 22px; color: var(--rose); }
.moment b { font-size: 12px; }
.moment small { color: var(--gold); }
.moment.diary { background: #2a1f2e; border-color: #6a4a55; }
.letter { padding: 18px; border-radius: 12px; background: #181219; color: #ded4dc; font: 15px/1.7 var(--serif); white-space: normal; }

/* account */
.me-main { width: min(920px, calc(100% - 240px)); margin: 0 auto; padding: 34px 38px 80px; display: flex; flex-direction: column; gap: 22px; }
.me-hero { max-width: 620px; margin: 12vh auto 0; padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.me-hero h1, .me-head h1 { margin: 0; font: 600 34px var(--serif); }
.me-hero p, .me-head p { margin: 0; color: var(--muted); line-height: 1.6; }
.me-head p { overflow-wrap: anywhere; }
.me-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.me-head > div:first-child { display: grid; gap: 5px; }
.me-balance { min-width: 150px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }
.me-balance svg { color: var(--gold); grid-row: span 2; }
.me-balance b { font-size: 22px; }
.me-balance span { color: var(--muted); font-size: 11px; }
.me-section { display: grid; gap: 10px; }
.me-section h2 { margin: 0; font: 600 21px var(--serif); }
.me-stories, .ledger-list { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.me-stories > a, .ledger-list > div { min-height: 66px; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; align-items: center; color: var(--text); text-decoration: none; }
.me-stories > a:last-child, .ledger-list > div:last-child { border-bottom: 0; }
.me-stories span, .ledger-list span { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.me-stories small, .ledger-list small { color: var(--muted); font-size: 11px; }
.me-stories strong { color: var(--rose); font-size: 12px; white-space: nowrap; }
.ledger-list strong { color: var(--muted); }
.ledger-list strong.plus { color: var(--gold); }
.account-actions { padding-top: 6px; display: flex; gap: 8px; }
.danger { color: #ef8585; }

@media (max-width: 1180px) {
  .chat-shell { grid-template-columns: 220px minmax(420px,1fr); }
  .chat-info { display: none; }
  .chat-info.open { display: block; position: fixed; z-index: 70; inset: 0 0 0 auto; width: 340px; box-shadow: -20px 0 60px rgba(0,0,0,.55); }
  .drawer-close { display: grid; position: absolute; z-index: 2; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(20,15,23,.8); }
  .us-main { width: min(850px, calc(100% - 220px)); }
}

@media (max-width: 899px) {
  .chat-shell { display: block; height: 100svh; }
  .chat-shell > .side { display: none; }
  .chat-main { height: calc(100svh - 66px); }
  .chat-head { height: 62px; flex-basis: 62px; padding: 0 10px; }
  .chat-head .back { display: inline-flex; }
  .chat-person img { width: 36px; height: 36px; }
  .chat-person b { font-size: 15px; }
  .chat-person small { max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
  .tier-pill { max-width: 76px; padding: 0 9px; overflow: hidden; }
  .balance-pill { padding: 0 9px; }
  .messages { padding: 16px 14px 20px; }
  .msg { max-width: 90%; padding: 10px 13px; font-size: 14px; }
  .assistant-wrap { max-width: 94%; }
  .msg.assistant { font-size: 15px; }
  .reply-meta > span { flex-basis: 100%; }
  .composer { padding: 8px 12px calc(9px + env(safe-area-inset-bottom)); }
  .composer input { height: 46px; }
  .composer .send { width: 46px; height: 46px; }
  .composer .global-ai { font-size: 9px; }
  .chat-info.open { width: min(88vw, 340px); bottom: 66px; }
  .info-portrait { height: 390px; }
  .save-prompt { grid-template-columns: 1fr; }
  .save-prompt .btn { grid-row: auto; grid-column: auto; margin-top: 7px; }
  .us-main { width: 100%; margin: 0; padding: 22px 16px 96px; }
  .me-main { width: 100%; margin: 0; padding: 22px 16px 96px; }
  .me-head { flex-direction: column; align-items: stretch; }
  .me-hero { margin-top: 6vh; padding: 24px 18px; }
  .me-head h1, .me-hero h1 { font-size: 27px; }
  .me-balance { width: 100%; min-width: 0; padding: 11px 13px; }
  .us-head h1 { font-size: 26px; }
  .us-head .btn { height: 38px; }
  .moments { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .memory-row { grid-template-columns: 26px minmax(0,1fr) auto; }
  .memory-row [data-delete] { grid-column: 3; }
  .model-grid { grid-template-columns: 1fr; }
  .model-card { min-height: 120px; }
  .week { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .day { min-height: 62px; font-size: 11px; }
  .pass { flex-direction: column; align-items: flex-start; }
}
