/* ==========================================================================
   The Girlfriend Experience
   One idea: every character's dossier palette re-tints the interface.
   Everything else stays quiet: dusk aubergine, Bodoni names, plain UI type.
   ========================================================================== */

:root {
  --bg: #231A2E;
  --surface: #2F2440;
  --surface-2: #3A2D4D;
  --line: #4A3B5A;
  --text: #F7EEF2;
  --muted: #B8A8C3;
  --faint: #8A7B98;
  --brand: #FF8FA3;
  --danger: #FF7A7A;
  --ok: #8FD9A8;

  /* re-tinted per character via inline style */
  --her: var(--brand);
  --her-deep: #5B2A45;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* type scale */
  --t-xs: 0.75rem;   /* 12 */
  --t-sm: 0.875rem;  /* 14 */
  --t-md: 1rem;      /* 16 */
  --t-lg: 1.125rem;  /* 18 */
  --t-xl: 1.3125rem; /* 21 */
  --t-2xl: 1.5rem;   /* 24 */
  --t-3xl: 2.25rem;  /* 36 */
  --t-4xl: 3rem;     /* 48 */
  --t-5xl: clamp(3rem, 8vw, 5.5rem);

  --r-bubble: 20px;
  --r-ctl: 12px;
  --r-card: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--t-md)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--her); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--her); color: var(--bg); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.noscript { padding: 40px; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.serif { font-family: var(--serif); }
.name { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -0.01em; }
h1, h2, h3 { margin: 0; font-weight: 500; }
.h-display { font-family: var(--serif); font-size: var(--t-5xl); line-height: 0.95; font-weight: 500; letter-spacing: -0.03em; }
.h-section { font-family: var(--serif); font-size: var(--t-3xl); line-height: 1.1; letter-spacing: -0.02em; }
.h-panel { font-family: var(--serif); font-size: var(--t-2xl); line-height: 1.2; }
.lede { font-size: var(--t-lg); color: var(--muted); max-width: 34em; line-height: 1.55; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--her); color: #1A1220; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.quiet { background: transparent; color: var(--muted); padding: 0 10px; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: var(--t-sm); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > span { font-size: var(--t-sm); color: var(--muted); }
.field .hint { font-size: var(--t-xs); color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-ctl); color: var(--text);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--her); box-shadow: 0 0 0 3px color-mix(in srgb, var(--her) 25%, transparent); }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--her); flex: none; }

/* chip toggles */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); cursor: pointer; font-size: var(--t-sm); user-select: none;
}
.chip input:checked + span { background: color-mix(in srgb, var(--her) 18%, transparent); border-color: var(--her); color: var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--her); outline-offset: 2px; }

/* segmented */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex-wrap: wrap; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 7px 14px; border-radius: 999px; font-size: var(--t-sm); color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--her); color: #1A1220; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--her); }

.range-row { display: flex; align-items: center; gap: 14px; }
input[type=range] { flex: 1; accent-color: var(--her); }

.switch { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked { background: var(--her); }
.switch input:checked::after { transform: translateX(18px); background: #1A1220; }

.error-msg { color: var(--danger); font-size: var(--t-sm); min-height: 1.4em; margin: 4px 0 10px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gutter); max-width: 1240px; margin: 0 auto;
}
.wordmark { font-family: var(--serif); font-style: italic; font-size: var(--t-xl); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark b { font-weight: 600; color: var(--brand); font-style: normal; }
.topbar nav { display: flex; gap: 8px; align-items: center; }

/* ---------- Landing ---------- */
.landing { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 80px; }
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 96px);
  align-items: center; min-height: min(78vh, 760px); padding: 32px 0 64px;
}
.hero .h-display { margin-bottom: 28px; }
.hero .lede { margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 28px; font-size: var(--t-sm); color: var(--faint); max-width: 30em; }

/* the phone thread */
.phone {
  --her: var(--brand);
  width: 100%; max-width: 380px; justify-self: center; aspect-ratio: 9 / 17;
  border-radius: 44px; padding: 14px; background: #160F1D;
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px -30px color-mix(in srgb, var(--her-deep) 90%, transparent);
  transition: box-shadow .8s ease;
}
.phone-screen { height: 100%; border-radius: 32px; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(180deg, color-mix(in srgb, var(--her-deep) 55%, var(--bg)) 0%, var(--bg) 45%); transition: background .8s ease; }
.phone-head { display: flex; align-items: center; gap: 12px; padding: 22px 18px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.phone-head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.phone-head .name { font-size: var(--t-lg); line-height: 1.1; }
.phone-head .small { color: var(--muted); }
.phone-body { flex: 1; padding: 18px 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }

/* roster */
.section { padding: 72px 0 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 36em; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px 20px; }
.card {
  display: block; text-decoration: none; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; text-align: left;
}
.card .portrait { aspect-ratio: 4 / 5; border-radius: var(--r-card); overflow: hidden; background: var(--her-deep); position: relative; }
.card .portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .portrait img { transform: scale(1.03); }
.card .portrait::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--her); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.card:hover .portrait::after, .card:focus-visible .portrait::after { transform: scaleX(1); }
.card .name { display: block; font-size: var(--t-xl); margin-top: 12px; color: var(--text); }
.card .meta { font-size: var(--t-sm); color: var(--muted); }
.card .tag { font-size: var(--t-sm); color: var(--faint); margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: s; }
.steps li { list-style: none; border-top: 1px solid var(--line); padding-top: 18px; }
.steps li::before { counter-increment: s; content: counter(s); font-family: var(--serif); font-style: italic; font-size: var(--t-3xl); color: var(--brand); display: block; line-height: 1; margin-bottom: 14px; }
.steps h3 { font-size: var(--t-lg); font-weight: 600; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }
.steps-wrap { padding-left: 0; margin: 0; }

.footer { max-width: 1240px; margin: 0 auto; padding: 48px var(--gutter) 40px; color: var(--faint); font-size: var(--t-sm); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer p { margin: 0; max-width: 46em; }

/* ---------- Profile sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 10, 20, .72); z-index: 40; display: flex; justify-content: flex-end; animation: fade .2s ease; }
.sheet {
  width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--bg); border-left: 1px solid var(--line);
  animation: slide .28s cubic-bezier(.2,.8,.2,1);
}
.sheet-hero { position: relative; aspect-ratio: 4 / 3.4; background: var(--her-deep); }
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; }
.sheet-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--bg)); }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(20,14,26,.6); color: var(--text); }
.sheet-body { padding: 0 28px 120px; margin-top: -72px; position: relative; z-index: 1; }
.sheet-body .name { font-size: var(--t-4xl); line-height: 1; color: var(--text); }
.sheet-body .facts { color: var(--her); margin: 10px 0 22px; font-size: var(--t-sm); font-weight: 600; }
.sheet-body p { line-height: 1.6; }
.sheet-body h3 { font-family: var(--serif); font-size: var(--t-xl); margin: 32px 0 12px; }
.sheet-body ul { padding-left: 18px; color: var(--muted); }
.sheet-body li { margin-bottom: 6px; }
.dims { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: var(--t-sm); }
.dims dt { color: var(--faint); }
.dims dd { margin: 0; color: var(--muted); }
.sheet-cta { position: sticky; bottom: 0; padding: 32px 28px calc(16px + var(--safe-b)); background: linear-gradient(180deg, transparent, var(--bg) 45%); display: flex; gap: 10px; }
.sheet-cta .btn { flex: 1; }

/* ---------- Bubbles (shared) ---------- */
.bubble {
  max-width: 82%; padding: 10px 15px; border-radius: var(--r-bubble); line-height: 1.42; font-size: var(--t-md);
  word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
.bubble.her { align-self: flex-start; background: var(--her-deep); color: #FFF7F9; border-bottom-left-radius: 6px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--her) 30%, transparent); }
.bubble.me { align-self: flex-end; background: var(--surface-2); color: var(--text); border-bottom-right-radius: 6px; }
.bubble.her + .bubble.her { border-top-left-radius: 6px; }
.bubble.me + .bubble.me { border-top-right-radius: 6px; }
.bubble.enter { animation: pop .28s cubic-bezier(.2,.9,.3,1.2); }
.typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px; background: var(--her-deep); border-radius: var(--r-bubble); border-bottom-left-radius: 6px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--her); opacity: .4; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: var(--her-deep); position: relative; overflow: hidden; }
.auth-art img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.auth-art blockquote { position: absolute; left: 32px; right: 32px; bottom: 40px; margin: 0; font-family: var(--serif); font-style: italic; font-size: var(--t-2xl); line-height: 1.3; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.auth-art cite { display: block; font-style: normal; font-family: var(--sans); font-size: var(--t-sm); margin-top: 10px; color: var(--her); }
.auth-panel { padding: 32px var(--gutter); display: flex; flex-direction: column; }
.auth-form { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.auth-form h1 { font-family: var(--serif); font-size: var(--t-4xl); line-height: 1; margin-bottom: 10px; }
.auth-form > p { color: var(--muted); margin: 0 0 28px; }
.auth-switch { margin-top: 20px; color: var(--muted); font-size: var(--t-sm); }

/* ---------- Age gate ---------- */
.gate { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; padding: var(--gutter); }
.gate-inner { max-width: 460px; text-align: center; }
.gate .h-section { margin-bottom: 16px; }
.gate p { color: var(--muted); }
.gate .hero-actions { justify-content: center; margin-top: 28px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 340px 1fr; height: 100dvh; }
.side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 10px 20px; }
.side-list { overflow-y: auto; flex: 1; padding: 4px 8px 12px; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--safe-b)); display: flex; gap: 6px; }
.side-foot .btn { flex: 1; }
.thread-link {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; text-decoration: none; position: relative;
}
.thread-link:hover { background: var(--surface); }
.thread-link[aria-current=page] { background: var(--surface); box-shadow: inset 3px 0 0 var(--her); }
.thread-link img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; background: var(--her-deep); }
.thread-link .who { min-width: 0; flex: 1; }
.thread-link .name { font-size: var(--t-lg); display: block; line-height: 1.2; }
.thread-link .last { font-size: var(--t-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.thread-link.archived { opacity: .55; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--her); color: #1A1220; font-size: var(--t-xs); font-weight: 700; display: grid; place-items: center; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.empty { margin: auto; text-align: center; padding: 40px var(--gutter); max-width: 440px; }
.empty .h-section { margin-bottom: 12px; }
.empty p { color: var(--muted); margin-bottom: 24px; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--her-deep) 38%, transparent), transparent 70%); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); }
.chat-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--her-deep); }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .name { font-size: var(--t-xl); line-height: 1.1; display: block; }
.chat-head .status { font-size: var(--t-xs); color: var(--muted); }
.back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 20px clamp(12px, 3vw, 32px) 12px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.messages .day { align-self: center; font-size: var(--t-xs); color: var(--faint); margin: 14px 0 6px; }
.messages .bubble.proactive { box-shadow: inset 0 0 0 1px var(--her); }
.msg-time { font-size: var(--t-xs); color: var(--faint); margin: 0 6px 6px; }
.msg-time.her { align-self: flex-start; }
.msg-time.me { align-self: flex-end; }
.load-more { align-self: center; margin-bottom: 10px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); }
.composer textarea { min-height: 46px; max-height: 160px; border-radius: 24px; padding: 12px 18px; resize: none; }
.composer .send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--her); color: #1A1220; display: grid; place-items: center; cursor: pointer; flex: none; }
.composer .send[disabled] { opacity: .4; }
.composer .send svg { width: 20px; height: 20px; }
.notice { margin: 8px 16px; padding: 12px 16px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--line); font-size: var(--t-sm); color: var(--muted); }
.notice a { color: var(--text); }

/* panels (settings, customize, account) */
.page { overflow-y: auto; height: 100%; }
.page-inner { max-width: 680px; margin: 0 auto; padding: 24px var(--gutter) 80px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.page-head .h-panel { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; }
.tabs a { padding: 12px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current=page] { color: var(--text); border-color: var(--her); }
.group { margin-bottom: 36px; }
.group > h2 { font-family: var(--serif); font-size: var(--t-xl); margin-bottom: 6px; }
.group > p { color: var(--muted); margin: 0 0 18px; font-size: var(--t-sm); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

.mem-list { list-style: none; padding: 0; margin: 0; }
.mem { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mem .txt { flex: 1; min-width: 0; }
.mem .txt input { min-height: 40px; }
.mem .sub { font-size: var(--t-xs); color: var(--faint); margin-top: 4px; }
.mem.pending { background: color-mix(in srgb, var(--her) 8%, transparent); border-radius: 10px; padding: 12px; border: 1px dashed var(--her); margin-bottom: 8px; }
.summary-box { padding: 16px; background: var(--surface); border-radius: var(--r-ctl); color: var(--muted); font-size: var(--t-sm); line-height: 1.6; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.plan.current { border-color: var(--her); }
.plan h3 { font-family: var(--serif); font-size: var(--t-xl); }
.plan .price { font-size: var(--t-lg); font-weight: 600; }
.plan ul { padding-left: 18px; margin: 6px 0 12px; color: var(--muted); font-size: var(--t-sm); flex: 1; }

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: var(--t-sm); font-weight: 600; transition: all .2s ease; z-index: 99; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); color: #1A1220; }

.loading { margin: auto; color: var(--faint); padding: 60px; text-align: center; }

@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 16px; }
  .phone { max-width: 330px; aspect-ratio: 9 / 15; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell.in-thread .side { display: none; }
  .shell:not(.in-thread) .main { display: none; }
  .back { display: grid; }
  .side { border-right: 0; height: 100dvh; }
}
@media (max-width: 560px) {
  .roster { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .card .name { font-size: var(--t-lg); }
  .row2 { grid-template-columns: 1fr; }
  .topbar .hide-sm { display: none; }
  .sheet-body { padding: 0 20px 120px; }
  .sheet-cta { padding-left: 20px; padding-right: 20px; }
  .bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Legal pages ---------- */
.legal { max-width: 72ch; margin: 0 auto; padding: 24px var(--gutter) 96px; }
.legal h1 { font-family: var(--serif); font-size: var(--t-4xl); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 10px; }
.legal .updated { color: var(--faint); font-size: var(--t-sm); margin: 0 0 32px; }
.legal .summary { background: var(--surface); border-radius: var(--r-ctl); padding: 18px 22px; margin-bottom: 40px; color: var(--muted); }
.legal .summary ul { margin: 8px 0 0; padding-left: 20px; }
.legal h2 { font-family: var(--serif); font-size: var(--t-2xl); margin: 44px 0 12px; scroll-margin-top: 20px; }
.legal h3 { font-size: var(--t-lg); font-weight: 600; margin: 24px 0 8px; }
.legal p, .legal li { line-height: 1.65; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--brand); }
.legal table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); margin: 12px 0 20px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.legal th { color: var(--muted); font-weight: 600; }
.legal .toc { columns: 2; column-gap: 32px; padding-left: 20px; font-size: var(--t-sm); margin-bottom: 8px; }
.legal .toc a { color: var(--muted); text-decoration: none; }
.legal .toc a:hover { color: var(--text); }
.legal .callout { border-left: 3px solid var(--brand); padding: 4px 0 4px 18px; margin: 20px 0; }
.legal-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--t-sm); }
.legal-nav a { color: var(--muted); }
.safety-card { margin: 8px 16px; padding: 16px 18px; border-radius: var(--r-ctl); background: #3A2433; border: 1px solid #FF8FA3; font-size: var(--t-sm); line-height: 1.55; }
.safety-card strong { display: block; font-size: var(--t-md); margin-bottom: 4px; }
.safety-card a { color: var(--text); }
.safety-card .actions { margin-top: 10px; }
@media (max-width: 560px) { .legal .toc { columns: 1; } .legal table { font-size: var(--t-xs); } .legal th, .legal td { padding: 8px 6px; } }
