:root {
  --ground: #F4F2F7;
  --card: #FFFFFF;
  --ink: #1F1B2E;
  --muted: #5E5870;
  --line: #E4E0EB;
  --line-2: #D9D4E3;
  --plum: #5B2A86;
  --plum-ink: #4A2270;
  --plum-soft: #EFE7F7;
  --teal: #0F5F58;
  --teal-soft: #E6F2F0;
  --amber-soft: #FFF4E8;
  --amber-ink: #8A4A0B;
  --gold: #F6C177;
  --danger: #A3261A;
  --radius: 20px;
  --serif: Fraunces, Georgia, 'Times New Roman', serif;
  --sans: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--plum-ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; }
p { margin: 0; line-height: 1.5; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 560px; margin: 0 auto; padding: 24px 16px calc(110px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.top { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.top h1 { flex: 1; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--plum-ink); }
.brand i { font-style: italic; }
.date { font-family: var(--sans); font-weight: 500; font-size: 14px; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.soft { background: var(--amber-soft); }
.card.teal { background: var(--teal-soft); }
.card.hero { background: var(--plum); color: #fff; padding: 24px; text-decoration: none; }
.card.hero .kick { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.card.hero .big { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.2; }
.card.hero .pill-w { background: #fff; color: var(--plum); font-weight: 700; padding: 12px 20px; border-radius: 999px; }
.card.medcard { background: var(--teal); color: #fff; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 16px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.mini { background: var(--ground); border-radius: 12px; padding: 10px; }
.mini .k { font-size: 11px; color: var(--muted); }
.mini .v { font-weight: 700; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.ask { font-size: 13px; font-weight: 700; color: var(--amber-ink); }

.btn { min-height: 48px; padding: 0 20px; border-radius: 999px; border: none; background: var(--plum); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.block { width: 100%; min-height: 56px; font-size: 17px; }
.btn.ghost { background: #fff; color: var(--plum-ink); border: 2px solid var(--plum); }
.btn.quiet { background: transparent; color: var(--plum-ink); border: 1px dashed #A79FBA; border-radius: 12px; }
.btn.danger { background: #fff; color: var(--danger); border: 2px solid var(--danger); }
.btn.teal { background: var(--teal); }
.btn.white { background: #fff; color: var(--teal); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line-2); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; text-decoration: none; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.pills.scroll::-webkit-scrollbar { display: none; }
.pills.scroll .pill { flex-shrink: 0; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.pill[aria-pressed="true"] { border: 2px solid var(--plum); background: var(--plum-soft); color: var(--plum-ink); }
.pill.solid[aria-pressed="true"] { border: none; background: var(--plum); color: #fff; }
.seg { display: flex; gap: 8px; }
.seg .pill { flex: 1; border-radius: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.input, textarea.input, select.input { min-height: 48px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; padding: 12px 14px; font-size: 16px; width: 100%; }
textarea.input { min-height: 120px; resize: vertical; }

.slider { display: flex; flex-direction: column; gap: 6px; }
.slider .row { justify-content: space-between; font-size: 15px; }
input[type=range] { width: 100%; accent-color: var(--plum); height: 32px; }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.chart .bar { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--plum); min-height: 3px; }
.chart .bar.low { background: #E8933A; }
.chart .bar.none { background: var(--line); }
.chart.teal .bar { background: var(--teal); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

.post .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.post .meta b { color: var(--ink); }
.post img { width: 100%; border-radius: 14px; display: block; }
.post audio { width: 100%; }
.post .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.post .acts button { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.post .acts button[aria-pressed="true"] { background: var(--plum-soft); border-color: var(--plum); color: var(--plum-ink); }
.reply { border-left: 3px solid var(--plum-soft); padding-left: 10px; font-size: 14px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: var(--safe-b); z-index: 5; }
.nav .in { display: flex; justify-content: space-around; width: 100%; max-width: 560px; }
.nav[hidden] { display: none; }
.nav a { flex: 1; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--plum); font-weight: 700; }
.nav svg, .ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: 90vw; text-align: center; }
.lock { position: fixed; inset: 0; background: var(--ground); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 30; padding: 24px; }
.lock .input { max-width: 220px; text-align: center; font-size: 24px; letter-spacing: .4em; }
.card-preview { width: 100%; border-radius: 16px; display: block; }
details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.guide p + p { margin-top: 10px; }
.guide ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }

/* ---------- welcome (night) ---------- */
body.night { background: #24103A; color: #fff; }
body.night #app { padding-bottom: 32px; min-height: 100vh; }
.w { min-height: calc(100vh - 48px); display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 12px 4px; }
.w-dots { display: flex; gap: 6px; position: absolute; top: calc(20px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); }
.w-dots span { width: 8px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.25); transition: width .25s; }
.w-dots span.on { width: 24px; background: #F2B866; }
.w-logo { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 20px 50px -10px rgba(242,184,102,.35); }
.w-logo.sm { width: 72px; height: 72px; border-radius: 18px; }
.w-h { font-family: var(--serif); font-variation-settings: 'SOFT' 100, 'opsz' 144; font-weight: 560; font-size: clamp(40px, 11vw, 60px); line-height: .98; letter-spacing: -.03em; color: #fff; }
.w-p { font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.8); max-width: 30em; }
.w-btn { display: flex; align-items: center; justify-content: center; min-height: 58px; border-radius: 999px; background: #F2B866; color: #24103A; font-weight: 800; font-size: 18px; text-decoration: none; border: none; cursor: pointer; margin-top: 8px; box-shadow: 0 12px 30px -10px rgba(242,184,102,.6); }
.w-link { background: none; border: none; color: rgba(255,255,255,.75); font-size: 16px; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; cursor: pointer; }
.w-fine { font-size: 13px; color: rgba(255,255,255,.55); }
.w-promises { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.w-promises li { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.w-promises b { font-size: 18px; color: #F6D5CB; }
.w-promises span { color: rgba(255,255,255,.78); font-size: 15px; line-height: 1.5; }
.w-pills .pill { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.w-pills .pill[aria-pressed="true"] { background: #F2B866; color: #24103A; border-color: #F2B866; }
@media (prefers-reduced-motion: no-preference) {
  .w > * { animation: wIn .5s cubic-bezier(.2,.8,.2,1) both; }
  .w > *:nth-child(2) { animation-delay: .06s } .w > *:nth-child(3) { animation-delay: .12s } .w > *:nth-child(4) { animation-delay: .18s } .w > *:nth-child(5) { animation-delay: .24s }
  .w1 .w-logo { animation: wPop .7s cubic-bezier(.2,1.5,.4,1) both; }
  @keyframes wIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes wPop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
}
.daily-note { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--plum-ink); margin-top: 6px; }
.install-card { border: 2px solid var(--plum-soft); }
:focus-visible { outline: 3px solid #F2B866; outline-offset: 3px; }

/* ---------- video badges + players ---------- */
.live-badge { position: absolute; top: 6px; left: 6px; background: #D7263D; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; }
.live-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: #fff; margin-right: 5px; vertical-align: 1px; animation: livePulse 1.4s ease-in-out infinite; }
.live-badge.big { top: 12px; left: 12px; font-size: 13px; padding: 4px 10px; }
@keyframes livePulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-badge::before { animation: none; } }
.yt-badge { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; width: 24px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.yt-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.yt-wrap iframe, .yt-wrap > div { position: absolute; inset: 0; width: 100%; height: 100%; }
.pill-n { font-size: 12px; font-weight: 700; opacity: .7; }

/* ---------- Plus ---------- */
.plus-hero { background: #24103A; color: #fff; padding: 24px; }
.plus-hero h1 { font-variation-settings: 'SOFT' 100, 'opsz' 144; font-size: 34px; letter-spacing: -.02em; }
.plus-perks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.plus-perks li { padding-left: 30px; position: relative; line-height: 1.45; }
.plus-perks li::before { content: ''; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 10px; background: #F2B866 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324103A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat; }
.plans { display: flex; flex-direction: column; gap: 10px; }
.plan { text-align: left; background: #fff; border: 2px solid var(--line-2); border-radius: 18px; padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; cursor: pointer; font: inherit; color: inherit; }
.plan[aria-pressed="true"] { border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); }
.plan-name { font-weight: 800; font-size: 17px; }
.plan-price { font-family: var(--serif); font-weight: 600; font-size: 26px; grid-row: span 2; align-self: center; }
.plan-price small { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); }
.plan-sub { font-size: 13px; color: var(--muted); }
#pp-box { min-height: 60px; }

/* ---------- Printable doctor report ---------- */
#print-report { display: none; }
@media print {
  @page { size: letter; margin: 0.6in; }
  body { background: #fff; }
  #app, .nav, .toast { display: none !important; }
  #print-report { display: block; color: #000; font-family: var(--sans); font-size: 11pt; line-height: 1.45; }
  #print-report h1 { font-family: var(--serif); font-size: 20pt; margin: 0 0 4pt; }
  #print-report h2 { font-family: var(--serif); font-size: 13pt; margin: 14pt 0 4pt; border-bottom: 1px solid #999; padding-bottom: 2pt; }
  #print-report table { width: 100%; border-collapse: collapse; }
  #print-report td, #print-report th { text-align: left; padding: 3pt 6pt 3pt 0; vertical-align: top; }
  #print-report .foot { margin-top: 18pt; font-size: 9pt; color: #444; }
}

/* ----- Ask HeardHer ----- */
.ask-card { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; color: #fff; background: linear-gradient(135deg, #3A1A5C, #5B2A86 60%, #7A3E8F); }
.ask-card .small { color: rgba(255,255,255,.82); }
.ask-orb { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle at 35% 30%, #FFF4E0 0%, #F2B866 30%, #E58FA8 62%, #7A3E8F 100%); box-shadow: 0 0 0 6px rgba(242,184,102,.18), 0 10px 30px rgba(122,62,143,.45); animation: orb 5s ease-in-out infinite; }
.ask-orb.sm { width: 44px; height: 44px; box-shadow: 0 0 0 4px rgba(242,184,102,.22); }
@keyframes orb { 0%,100% { transform: scale(1); filter: hue-rotate(0deg); } 50% { transform: scale(1.06); filter: hue-rotate(-14deg); } }
@media (prefers-reduced-motion: reduce) { .ask-orb { animation: none; } }
.ask-hello { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px 6px; }
.ask-hello h2 { font-family: var(--serif); font-size: 24px; margin: 6px 0 0; }
.ask-hello p { color: var(--muted); margin: 0; max-width: 32ch; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0 12px; }
.ask-chips .pill { text-align: left; }
.ask-log { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.ask-b { max-width: 88%; padding: 12px 16px; border-radius: 20px; line-height: 1.5; font-size: 16px; }
.ask-b p { margin: 0 0 8px; } .ask-b p:last-child { margin: 0; }
.ask-b ul { margin: 4px 0 8px; padding-left: 20px; } .ask-b li { margin: 3px 0; }
.ask-b.me { align-self: flex-end; background: var(--plum); color: #fff; border-bottom-right-radius: 6px; }
.ask-b.her { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; box-shadow: 0 1px 0 var(--line); }
.ask-b.fresh { animation: askIn .35s ease-out; }
@keyframes askIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ask-b.typing { display: flex; gap: 5px; padding: 16px 18px; }
.ask-b.typing span { width: 8px; height: 8px; border-radius: 50%; background: #B9A6CF; animation: dot 1.2s infinite; }
.ask-b.typing span:nth-child(2) { animation-delay: .15s; } .ask-b.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%,80%,100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.ask-box { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--ground); padding: 10px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.ask-row { display: flex; gap: 8px; align-items: flex-end; }
.ask-row textarea { flex: 1; resize: none; min-height: 52px; border-radius: 22px; padding-top: 14px; }
.ask-send { width: 52px; min-width: 52px; height: 52px; padding: 0; background: var(--plum); }
.ask-send[disabled] { opacity: .5; }
.ask-share { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.ask-share input { width: 20px; height: 20px; accent-color: var(--plum); }
.ask-peek { white-space: pre-wrap; font: 13px/1.5 var(--sans, system-ui); background: var(--card); border-radius: 14px; padding: 12px; margin: 0; max-height: 240px; overflow: auto; }
.linkish { background: none; border: none; padding: 0; color: var(--plum); text-decoration: underline; font: inherit; cursor: pointer; }

/* ----- HeardHer Team + empty groups ----- */
.team-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #F2B866; color: #24103A; font-size: 11px; font-weight: 800; letter-spacing: .02em; vertical-align: 1px; }
.post.team { border: 2px solid #F2B866; background: linear-gradient(180deg, #FFF8EC, #fff 60%); }
.pin-tag { font-size: 12px; font-weight: 800; color: var(--amber-ink); letter-spacing: .03em; }
.reply.team { border-left-color: #F2B866; }
.empty-group { text-align: center; align-items: center; background: linear-gradient(160deg, #F3ECFA, #FFF4E8); }
.empty-group .eg-orb { font-size: 34px; width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; box-shadow: 0 6px 20px rgba(91,42,134,.15); }
.empty-group b { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.empty-group p { margin: 0; color: var(--muted); }
.empty-group blockquote { margin: 0; padding: 12px 16px; background: #fff; border-radius: 16px; font-style: italic; color: var(--plum-ink); }
