/* Textbound app styles. Tokens (--bg, --ink, --accent, ...) come from the platform theme. */
:root {
  --him: #2b2624;
  --her: #6e2239;
  --gold-line: #6b5532;
  --crisis-bg: #2a1c1a;
  --crisis-line: #8a4b40;
  --todo-bg: rgba(217, 169, 91, 0.18);
}

/* ---------- landing ---------- */
.tb-hero { max-width: 1180px; margin: 0 auto; padding: clamp(40px, 8vw, 84px) 20px clamp(48px, 8vw, 96px); display: flex; flex-wrap: wrap; gap: clamp(32px, 6vw, 64px); align-items: center; }
.tb-hero-copy { flex: 1 1 460px; min-width: 0; }
.tb-hero-art { flex: 1 1 340px; min-width: 0; display: flex; justify-content: center; }
.tb-h1 { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: var(--h1); line-height: 1.02; margin: 0 0 22px; }
.tb-h1 em { color: var(--accent); font-style: var(--h1-italic); }
.tb-h2 { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: var(--h2); line-height: 1.08; margin: 12px 0 20px; }
.tb-lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); margin: 0 0 30px; max-width: 540px; }
.tb-ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.tb-btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.tb-reassure { font-size: 14px; color: var(--muted); margin: 18px 0 0; }
.tb-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 22px; }
.tb-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tb-kicker { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tb-phone { width: 100%; max-width: 370px; background: #0b0a09; border-radius: 46px; padding: 12px; border: 1px solid #2f2a27; box-shadow: 0 0 120px -30px rgba(217,169,91,.35); }
.tb-phone-in { background: #171413; border-radius: 36px; overflow: hidden; padding-bottom: 14px; }
.tb-phone .tb-thread { padding: 14px; gap: 8px; }
.tb-phone .tb-bubble { font-size: 14px; }
.tb-facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.tb-facts ul { max-width: 1180px; margin: 0 auto; padding: 24px 20px; list-style: none; display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: space-between; }
.tb-facts li { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.tb-section { max-width: 1180px; margin: 0 auto; padding: clamp(56px, 9vw, 104px) 20px; }
.tb-cards { display: flex; flex-wrap: wrap; gap: 20px; }
.tb-card { flex: 1 1 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.tb-card h3 { font-family: var(--display); font-weight: var(--display-weight); font-size: var(--h3); margin: 18px 0 8px; line-height: 1.15; }
.tb-card p { margin: 0; color: var(--muted); font-size: 16px; }
.tb-num { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.tb-band { background: var(--band); color: var(--band-ink); }
.tb-band .tb-kicker { color: var(--band-accent); }
.tb-journey { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 24px; }
.tb-journey li { flex: 1 1 260px; border-top: 2px solid var(--band-accent); padding-top: 20px; }
.tb-journey .when { font-size: 13px; font-weight: 600; color: var(--band-accent); }
.tb-journey .t { font-size: 21px; font-weight: 600; margin: 6px 0; }
.tb-journey .b { color: var(--band-muted); font-size: 16px; }
.tb-wl { margin-top: 52px; background: var(--band-card); border-radius: var(--radius); padding: 26px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.tb-wl > div:first-child { flex: 1 1 300px; }
.tb-wl > form, .tb-wl > .pf-form { flex: 1 1 380px; }
.tb-faq { max-width: 820px; }
.tb-faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.tb-faq summary { cursor: pointer; font-weight: 600; font-size: 18px; min-height: 32px; }
.tb-faq p { color: var(--muted); margin: 10px 0 0; }
.tb-final { text-align: center; border-top: 1px solid var(--line); }
.tb-check { flex: none; }

/* ---------- gate / forms ---------- */
.tb-gate { max-width: 560px; margin: 0 auto; padding: clamp(32px, 7vw, 72px) 20px 64px; }
.tb-gate h1 { font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(34px, 6vw, 48px); line-height: 1.08; margin: 0 0 14px; }
.tb-steps { font-size: 13px; color: var(--muted); letter-spacing: .04em; margin: 0 0 18px; }
.tb-dob { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.tb-dob > div { flex: 1 1 120px; }
.tb-select { width: 100%; min-height: 50px; border-radius: var(--input-radius); border: 1px solid var(--control); background: var(--surface); color: var(--ink); font: inherit; padding: 0 14px; }
fieldset.tb-group { border: 0; padding: 0; margin: 22px 0 0; }
fieldset.tb-group legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.tb-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-radio { position: relative; }
.tb-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tb-radio span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--control); cursor: pointer; }
.tb-radio input:checked + span { border-color: var(--accent); background: var(--soft); color: var(--accent); font-weight: 600; }
.tb-radio input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.tb-radio small { display: block; }
.tb-clock span { flex-direction: column; align-items: flex-start; justify-content: center; padding: 8px 16px; border-radius: 16px; }
.tb-clock small { color: var(--muted); font-weight: 400; font-size: 13px; }
.tb-bullets { padding-left: 20px; }
.tb-bullets li { margin: 6px 0; }
.tb-minors { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }
.tb-note { font-size: 14px; color: var(--muted); }

/* ---------- reader ---------- */
.tb-app { display: flex; min-height: 100dvh; }
.tb-side { display: none; }
@media (min-width: 1100px) {
  .tb-side { display: block; flex: 0 0 270px; border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; box-sizing: border-box; }
  .tb-side-right { flex: 0 0 320px; border-right: 0; border-left: 1px solid var(--line); padding: 20px; }
  .tb-only-narrow { display: none !important; }
}
.tb-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tb-topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.tb-topbar-in { display: flex; align-items: center; gap: 10px; padding: 10px 14px; max-width: 760px; margin: 0 auto; }
.tb-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: #3a2d25; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--accent); border: 1px solid var(--gold-line); }
.tb-who { line-height: 1.2; min-width: 0; }
.tb-who h1 { margin: 0; font-size: 17px; font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) {
  .tb-home { display: none !important; }
  .tb-who p { display: none; }
  .tb-who h1 { font-size: 16px; }
  .tb-night { padding: 4px 9px; }
}
.tb-who h1 span { font-weight: 400; color: var(--muted); }
.tb-who p { margin: 0; font-size: 13px; color: var(--muted); }
.tb-night { margin-left: auto; font-size: 13px; color: var(--accent); border: 1px solid var(--gold-line); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.tb-iconlink { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--control); display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.tb-iconlink:hover { color: var(--ink); }
.tb-subnav { display: flex; gap: 6px; padding: 0 14px 10px; max-width: 760px; margin: 0 auto; overflow-x: auto; font-size: 14px; }
.tb-subnav a { white-space: nowrap; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; min-height: 36px; display: inline-flex; align-items: center; }
.tb-subnav a:hover { color: var(--ink); border-color: var(--control); }
.tb-subnav .tb-988 { color: var(--accent); border-color: var(--gold-line); }
.tb-banner { max-width: 760px; margin: 10px auto 0; padding: 0 14px; }
.tb-banner > div { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #1f1b19; border: 1px solid var(--gold-line); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.tb-banner button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; min-width: 44px; min-height: 44px; }
.tb-thread { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px 14px 8px; max-width: 760px; width: 100%; margin: 0 auto; box-sizing: border-box; list-style: none; }
.tb-thread > li { display: flex; flex-direction: column; }
.tb-bubble { max-width: 82%; border-radius: 20px; padding: 9px 14px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.tb-him { align-self: flex-start; background: var(--him); border-bottom-left-radius: 6px; }
.tb-him.tb-recall { border: 1px solid var(--gold-line); }
.tb-her { align-self: flex-end; background: var(--her); color: #fff; border-bottom-right-radius: 6px; }
.tb-her.tb-action { font-style: italic; background: transparent; border: 1px solid var(--her); color: var(--ink); }
.tb-hook { align-self: flex-start; background: #1b1d22; border: 1px dashed #7a8197; border-bottom-left-radius: 6px; }
.tb-hook small { display: block; color: #a9b0c2; font-size: 12px; margin-bottom: 2px; }
.tb-narr { font-family: var(--display); font-style: italic; color: var(--muted); font-size: 19px; line-height: 1.4; margin: 6px 4px; }
.tb-sys { align-self: center; text-align: center; font-size: 13px; color: var(--muted); background: #1f1b19; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; max-width: 92%; }
.tb-sys.tb-capture { color: var(--accent); background: none; border-style: dashed; border-color: var(--gold-line); }
.tb-sys a { color: inherit; }
.tb-meta { display: flex; gap: 14px; align-items: center; font-size: 12px; margin: 2px 8px 0; color: var(--muted); }
.tb-meta a { color: #8f867f; text-decoration: none; padding: 4px 0; }
.tb-meta a:hover, .tb-meta a:focus-visible { color: var(--ink); text-decoration: underline; }
.tb-meta .tb-remembered { color: var(--accent); }
.tb-hidden { align-self: flex-start; font-size: 13px; color: var(--muted); font-style: italic; }
.tb-dock { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
.tb-dock-in { max-width: 760px; margin: 0 auto; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.tb-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--gold-line); background: #1e1a16; color: var(--accent); font: inherit; font-size: 15px; cursor: pointer; }
.tb-chip.tb-chip-action { font-style: italic; }
.tb-chip:hover { background: #2a2219; }
.tb-compose { display: flex; gap: 10px; }
.tb-compose input { flex: 1; min-width: 0; min-height: 50px; border-radius: 999px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font: inherit; padding: 0 18px; }
.tb-send { width: 50px; height: 50px; flex: none; border-radius: 50%; border: 0; background: #9b3150; color: #fff; cursor: pointer; display: grid; place-items: center; }
.tb-hint { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
.tb-wait { text-align: center; color: var(--muted); font-size: 15px; padding: 6px 0; }
.tb-wait strong { color: var(--ink); }
.tb-cards-end { max-width: 760px; width: 100%; margin: 0 auto; padding: 0 14px; box-sizing: border-box; }
.tb-endcard { border: 1px solid var(--gold-line); background: linear-gradient(180deg, #221a14, #171413); border-radius: 20px; padding: 22px; text-align: center; margin: 14px 0; }
.tb-endcard h2 { font-family: var(--display); font-size: 30px; margin: 0 0 6px; font-weight: 600; }
.tb-endcard p { color: var(--muted); margin: 0 0 16px; }
.tb-endcard .pf-row { justify-content: center; }
.tb-crisis { background: var(--crisis-bg); border: 2px solid var(--crisis-line); border-radius: 18px; padding: 20px; margin: 14px 0; }
.tb-crisis h2 { margin: 0 0 6px; font-size: 20px; }
.tb-crisis .brand { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.tb-crisis ul { padding-left: 18px; }
.tb-crisis .pf-row { flex-wrap: wrap; gap: 8px; }
.tb-placeholder { font-size: 12px; color: #f0c27a; border: 1px dashed #8a6a35; border-radius: 8px; padding: 6px 8px; margin-top: 12px; }

/* ---------- side panels ---------- */
.tb-label { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: #a39a92; padding: 0 8px 10px; }
.tb-shelf-item { display: flex; gap: 12px; align-items: center; padding: 12px 10px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.tb-shelf-item.current { background: var(--surface); border: 1px solid var(--gold-line); }
.tb-shelf-item .t { font-weight: 600; }
.tb-shelf-item .s { font-size: 13px; color: var(--muted); }
.tb-lock { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); border: 1px solid var(--control); display: grid; place-items: center; color: var(--muted); }
.tb-mem { list-style: none; margin: 0; padding: 0; }
.tb-mem li { border-top: 1px solid var(--line); padding: 12px 0; }
.tb-mem .k { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #a39a92; }
.tb-mem .v { font-size: 16px; margin: 2px 0 8px; }
.tb-mem .v.empty { color: var(--muted); font-style: italic; }
.tb-mem form { display: inline; }
.tb-mem .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tb-mem .pf-input { min-height: 44px; }
.tb-mem li.hl { background: var(--soft); border-radius: 10px; padding: 12px 10px; }
.tb-help { margin-top: 24px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.tb-help strong { color: var(--ink); display: block; margin-bottom: 4px; }
.tb-page { max-width: 760px; margin: 0 auto; padding: 28px 16px 64px; }
.tb-page h1 { font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(32px, 6vw, 44px); line-height: 1.08; margin: 0 0 8px; }
.tb-locked-card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 20px; margin: 14px 0; }
.tb-locked-card h2 { margin: 0; font-family: var(--display); font-size: 28px; }
.tb-locked-card .tag { color: var(--accent); margin: 2px 0 8px; }
.tb-toast { max-width: 760px; margin: 10px auto 0; padding: 0 14px; }

/* ---------- share card ---------- */
.tb-share { max-width: 520px; margin: 0 auto; padding: 32px 16px 64px; }
.tb-quote { aspect-ratio: 4 / 5; border-radius: 28px; padding: 36px 30px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(500px 380px at 80% 15%, rgba(217,169,91,.22), transparent 70%), radial-gradient(500px 420px at 0% 100%, rgba(155,49,80,.28), transparent 70%), #12100f; border: 1px solid var(--gold-line); }
.tb-quote blockquote { margin: 0; font-family: var(--display); font-size: clamp(28px, 7vw, 40px); line-height: 1.15; font-style: italic; }
.tb-quote footer { font-size: 14px; color: var(--muted); }
.tb-quote footer strong { color: var(--accent); font-weight: 600; }

/* ---------- legal pages (ported from love/site) ---------- */
.tb-legal { max-width: 760px; margin: 0 auto; padding: 40px 18px 72px; }
.tb-legal h1 { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 7vw, 52px); line-height: 1.05; margin: 0 0 8px; }
.tb-legal h2 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 4vw, 32px); margin: 40px 0 10px; }
.tb-legal h3 { font-size: 18px; margin: 24px 0 6px; }
.tb-legal .updated { color: var(--muted); font-size: 14px; }
.tb-legal .lede { font-size: 19px; color: var(--muted); }
.tb-legal table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.tb-legal th, .tb-legal td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.tb-legal .callout, .tb-legal .crisis-box { border: 1px solid var(--gold-line); background: var(--surface); border-radius: 14px; padding: 16px 18px; margin: 18px 0; }
.tb-legal .crisis-box { background: var(--crisis-bg); border-color: var(--crisis-line); }
.tb-legal .todo, .todo { background: var(--todo-bg); color: #f0c27a; border-radius: 4px; padding: 0 4px; }
.tb-legal .toc { columns: 2 220px; font-size: 15px; }

.tb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#bottom { scroll-margin-bottom: 200px; }
.tb-crisis { scroll-margin-top: 130px; }
