/* Design language: warm cream, deep plum, soft rose, hairline borders, Inter. */
:root {
  --bg: #faf6f2;
  --surface: #fffdfb;
  --surface-2: #f6eeea;
  --line: #ede0da;
  --line-2: #dccbc4;
  --ink: #1d0f17;
  --text: #54444b;
  --muted: #8c7a81;
  --brand: #4a1942;
  --brand-mid: #7a3a6c;
  --aqua: #f4b6c2;
  --aqua-pale: #fbeaf0;
  --on-brand: #ffffff;
  --rose-ink: #7a1f3d;
  --rose-wash: #fce8ee;
  --good-ink: #006100;
  --good-wash: #edf7ed;
  --warn-ink: #7a5200;
  --warn-wash: #fcf2dd;
  --bad-ink: #8f1f1f;
  --bad-wash: #fbeaea;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .08);
  --r: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Headlines only (the "20%"): everything people read stays in Inter. */
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #170b16;
    --surface: #221220;
    --surface-2: #2c1829;
    --line: #3d2238;
    --line-2: #563050;
    --ink: #f8eef3;
    --text: #d9c6cf;
    --muted: #a8919d;
    --brand: #f4b6c2;
    --brand-mid: #e48aa3;
    --aqua: #f4b6c2;
    --aqua-pale: #3b1d33;
    --on-brand: #2a0e24;
    --rose-ink: #f7b8c6;
    --rose-wash: #3f1a2c;
    --good-ink: #7fd88f;
    --good-wash: #12301b;
    --warn-ink: #f1c76a;
    --warn-wash: #33280f;
    --bad-ink: #ff9a8f;
    --bad-wash: #3a1616;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 24px -8px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg); }
body {
  height: 100dvh; width: 100%; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { color: var(--ink); font-weight: 700; letter-spacing: -.02em; margin: 0; }
h1 { font-family: var(--display); font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 17px; margin-bottom: 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pill {
  display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface);
}

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: #4a1942; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); display: grid; place-items: center; }
.mark svg { width: 16px; height: 16px; }
.brand .tld { color: var(--muted); font-weight: 500; }
.brand .wordmark { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 16.5px; letter-spacing: 0; }
.badge18 { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; color: var(--muted); }

main { flex: 1; overflow-y: auto; padding: 16px 16px 28px; }
main.flush { padding: 0; }
main.chat { display: flex; flex-direction: column; padding: 0; }

/* bottom nav */
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.tabs a svg { width: 21px; height: 21px; }
.tabs a.on { color: var(--brand); }
.tabs a.on::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--brand); border-radius: 2px; }
.dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: #e0566e; border: 2px solid var(--surface); }

/* hero (landing) */
.hero {
  position: relative; color: #fff; padding: 40px 20px 34px; text-align: center; overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(160deg, #2a0d27 0%, #4a1942 55%, #7a3a6c 100%);
}
.hero::after { content: ""; position: absolute; inset: auto -20% -60% -20%; height: 70%; background: radial-gradient(closest-side, rgba(244, 182, 194, .32), transparent); pointer-events: none; }
.hero .pill { background: transparent; color: rgba(255, 255, 255, .8); border-color: rgba(255, 255, 255, .25); }
.hero h1 { color: #fff; font-size: 44px; letter-spacing: -.015em; margin: 18px 0 12px; }
.hero h1 span { color: var(--aqua); font-style: italic; }
.hero .lede { color: rgba(255, 255, 255, .72); font-size: 16px; max-width: 34ch; margin: 0 auto 22px; }
.hero .ctas { display: flex; gap: 10px; justify-content: center; }
.hero .checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 20px; font-size: 12px; color: rgba(255, 255, 255, .62); }
.hero .checks span::before { content: "✓ "; color: var(--aqua); }
.section { padding: 20px 16px 4px; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.feature .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--aqua-pale); color: var(--brand); margin-bottom: 8px; }
.feature .ic svg { width: 16px; height: 16px; }
.feature b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.feature span { font-size: 12.5px; color: var(--muted); line-height: 1.45; display: block; }

/* cards + forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.tight { padding: 14px; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--aqua-pale); }
textarea { resize: vertical; min-height: 84px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-weight: 500; font-size: 14px; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; border: 1px solid transparent; border-radius: var(--r); padding: 11px 18px;
  background: var(--brand); color: var(--on-brand); cursor: pointer; box-shadow: var(--shadow);
  transition: transform .08s, filter .15s, background .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover { filter: brightness(1.08); }
button:active { transform: scale(.985); }
button.aqua { background: var(--aqua); color: #4a1942; box-shadow: var(--shadow-lg); }
button.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: none; }
button.ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); box-shadow: none; }
button.danger { background: var(--surface); color: var(--bad-ink); border-color: var(--line-2); box-shadow: none; }
button.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
button:disabled { opacity: .45; cursor: default; transform: none; filter: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.full { width: 100%; margin-top: 16px; }

/* role + interest pickers */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role { flex-direction: column; align-items: flex-start; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; padding: 14px; font-weight: 500; }
.role b { font-size: 15px; }
.role span { font-size: 12.5px; color: var(--muted); }
.role.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--aqua-pale); }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); box-shadow: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chips-static { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chips-static span { font-size: 11.5px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text); }

/* page header */
.pagehead { margin: 2px 0 16px; }
.pagehead h1 { margin: 8px 0 4px; }
.pagehead p { color: var(--muted); margin: 0; }
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; }
.sectionhead h2 { margin: 0; font-size: 15px; }
.count { font-size: 12px; font-weight: 600; color: var(--brand); background: var(--aqua-pale); padding: 2px 8px; border-radius: 99px; }

/* filters */
.filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.filters select, .filters input { width: auto; flex: none; padding: 7px 11px; font-size: 13px; border-radius: 99px; background: var(--surface); }
.filters input[type=number] { width: 68px; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text); margin: 0 0 12px; font-weight: 500; }
.toggle input { width: 16px; height: 16px; accent-color: var(--brand); }

/* people */
.person { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.person:hover { border-color: var(--line-2); }
.avatar {
  position: relative; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 18px; text-transform: uppercase;
}
.avatar.lg { flex-basis: 72px; width: 72px; height: 72px; border-radius: 18px; font-size: 28px; }
.avatar.online::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #2fb36b; border: 2px solid var(--surface); }
.person .info { flex: 1; min-width: 0; }
.person .name { color: var(--ink); font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.person .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--line-2); font-size: 20px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
.tag.ov { background: var(--rose-wash); color: var(--rose-ink); }
.tag.good { background: var(--good-wash); color: var(--good-ink); }
.tag.info { background: var(--aqua-pale); color: var(--brand); }

/* application card */
.app-card .note { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--aqua); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--ink); font-size: 14px; }
.app-card .actions { display: flex; gap: 8px; margin-top: 12px; }
.app-card .actions button { flex: 1; }

.profilehero { text-align: center; }
.profilehero .avatar { margin: 0 auto 12px; }
.profilehero h1 { font-size: 26px; }
.profilehero .tags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.profilehero .chips-static { justify-content: center; margin-top: 12px; }
.quote { font-size: 15px; color: var(--ink); margin: 14px 0 0; line-height: 1.55; }
.callout { border-radius: 10px; padding: 11px 13px; font-size: 13.5px; margin-top: 12px; text-align: left; background: var(--aqua-pale); color: var(--brand); }
.callout.rose { background: var(--rose-wash); color: var(--rose-ink); }
.callout.warn { background: var(--warn-wash); color: var(--warn-ink); }
.callout.bad { background: var(--bad-wash); color: var(--bad-ink); }

/* cycle tracker */
.cycle-bar { display: grid; grid-template-columns: repeat(28, 1fr); gap: 2px; margin: 12px 0 6px; }
.cycle-bar i { height: 22px; border-radius: 3px; background: var(--surface-2); }
.cycle-bar i.period { background: #d36b84; }
.cycle-bar i.fertile { background: var(--aqua); }
.cycle-bar i.ovu { background: var(--brand); }
.cycle-bar i.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.stat b { display: block; color: var(--ink); font-size: 15px; }
.stat span { font-size: 11.5px; color: var(--muted); }

/* chat */
.msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 80%; padding: 8px 13px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); word-wrap: break-word; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.msg .who { display: block; font-size: 12px; font-weight: 700; color: var(--brand-mid); cursor: pointer; }
.msg.mine .who { display: none; }
.msg time { display: block; font-size: 10.5px; opacity: .6; margin-top: 2px; }
.seen { align-self: flex-end; font-size: 11px; color: var(--muted); margin-top: -2px; }
.typing { font-size: 12px; color: var(--muted); padding: 0 18px 6px; min-height: 18px; }
.composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.composer input { flex: 1; }
.chathead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chathead .avatar { flex-basis: 38px; width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }
.chathead .grow { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; }
.chathead .grow small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.chathead .back { font-size: 26px; line-height: 1; color: var(--muted); padding-right: 2px; }
.banner { margin: 10px 14px 0; padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--warn-wash); color: var(--warn-ink); }
.roomhead { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.roomhead h1 { font-size: 26px; margin: 8px 0 2px; }
.roomhead p { font-size: 13px; color: var(--muted); margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
  max-width: calc(100% - 32px); z-index: 10; box-shadow: var(--shadow-lg);
}
.toast.err { background: var(--bad-ink); color: #fff; }
.globalbanner { margin: 10px 16px 0; padding: 11px 14px; border-radius: 12px; background: var(--bad-wash); color: var(--bad-ink); font-size: 13.5px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.globalbanner button { flex: none; }

ol.vows { list-style: none; counter-reset: v; padding: 0; margin: 0; }
ol.vows li { counter-increment: v; display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
ol.vows li:first-child { border-top: 0; padding-top: 4px; }
ol.vows li::before { content: counter(v, decimal-leading-zero); font-weight: 700; font-size: 12px; color: var(--brand-mid); min-width: 20px; padding-top: 2px; }
ol.vows b { display: block; color: var(--ink); font-size: 14px; }
ol.vows span { color: var(--muted); font-size: 13px; }
ul.tips { padding-left: 18px; margin: 0; }
ul.tips li { margin: 7px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.footer { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 0 6px; }

/* admin */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-grid .stat { background: var(--surface); border: 1px solid var(--line); }
.stat-grid .stat b { font-size: 22px; letter-spacing: -.02em; }
.stat-grid .stat.alert { background: var(--bad-wash); border-color: transparent; }
.stat-grid .stat.alert b, .stat-grid .stat.alert span { color: var(--bad-ink); }
.stat-grid .stat:first-child { grid-column: span 2; }
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 12px; overflow-x: auto; }
.segmented button { flex: 1; white-space: nowrap; background: transparent; color: var(--muted); box-shadow: none; padding: 8px 10px; font-size: 13px; border-radius: 9px; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.logrow { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.logrow:first-of-type { border-top: 0; }
.eyebrow + .logrow { border-top: 0; }
.backlink { display: inline-block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
a.card { display: flex; color: inherit; }

/* WhatsApp login */
button.wa, a.btn.wa { background: #1fa855; color: #fff; text-decoration: none; }
button.wa svg, a.btn.wa svg { width: 18px; height: 18px; }
.steps { padding-left: 20px; margin: 14px 0 4px; color: var(--ink); font-size: 14px; }
.steps li { margin: 4px 0; }
.waiting { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 12px 0 4px; font-size: 13.5px; color: var(--muted); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; box-shadow: none; color: var(--brand-mid); padding: 12px 0 0; font-size: 13.5px; width: 100%; }
.callout input { margin: 8px 0 0; }
.unsaved { color: var(--brand-mid); font-weight: 600; margin-top: 8px; }

/* voice typing */
button.mic { flex: none; width: 46px; padding: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
button.mic svg { width: 20px; height: 20px; }
button.mic.on { background: #e0566e; color: #fff; border-color: transparent; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(224, 86, 110, .25); } }
