/* ===== Luna Care Studio — brand fonts ===== */
@font-face {
  font-family: 'Young Serif';
  src: url('../fonts/youngserif.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Rubik';
  src: url('../fonts/rubik.woff2') format('woff2');
  font-weight: 300 900; font-style: normal; font-display: swap;
}

/* ===== design tokens ===== */
:root {
  --bg: #f6efe4;         /* cream / ivory */
  --bg-warm: #f1e7d8;
  --card: #fffdf9;       /* warm white */
  --ink: #3b3a39;        /* warm charcoal */
  --ink-strong: #1c1c1c;
  --muted: #8a857d;
  --line: #e7ddcd;       /* warm hairline */

  --brand: #584a80;      /* ube purple — primary */
  --brand-deep: #4b2d5d;
  --brand-soft: #efeaf4; /* ube tint surface */
  --periwinkle: #6566a3;

  --rose: #bc4f60;
  --rose-soft: #d86b79;
  --wine: #a03348;
  --wine-deep: #84172f;
  --gold: #f2b544;
  --teal: #5e8e87;

  --shadow: 0 12px 34px rgba(75, 45, 93, .12);
  --shadow-sm: 0 4px 16px rgba(75, 45, 93, .08);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  padding: 8px 18px calc(96px + var(--safe-bottom));
  overflow-y: auto;
}
.view { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== topbar ===== */
.topbar { display: flex; align-items: center; gap: 10px; padding: 18px 2px 10px; }
.topbar h1 { font-size: 2rem; margin: 0; flex: 1; text-transform: lowercase; color: var(--brand-deep); }
.chart-title { flex: 1; text-align: center; }
.chart-title h1 { font-size: 1.5rem; text-transform: lowercase; color: var(--brand-deep); }
.date-chip { color: var(--muted); font-size: .9rem; }
.icon-btn {
  border: none; background: var(--brand-soft); color: var(--brand);
  width: 42px; height: 42px; border-radius: 14px; font-size: 1.4rem; line-height: 1;
  display: grid; place-items: center; cursor: pointer; transition: background .15s;
}
.icon-btn:active { background: #e6def0; }
.icon-btn:disabled { opacity: .35; }

/* ===== Today ring ===== */
.ring-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 26px 0 6px; }
.ring {
  width: 244px; height: 244px; border-radius: 50%;
  display: grid; place-items: center; padding: 14px;
  background: #cfc7bb;
  box-shadow: var(--shadow);
  transition: background .35s ease;
}
.ring-inner {
  width: 100%; height: 100%; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  box-shadow: inset 0 2px 10px rgba(75,45,93,.05);
}
.ring-big { font-family: var(--serif); font-size: 2rem; text-transform: lowercase; color: var(--brand-deep); }
.ring-small { color: var(--muted); margin-top: 6px; font-size: .98rem; }
.cycle-day-badge {
  background: var(--brand-soft); color: var(--brand);
  padding: 7px 18px; border-radius: 999px; font-weight: 500; font-size: .95rem;
}
.ring-card.bleed  .ring { background: linear-gradient(150deg, #bc4f60, #a03348); }
.ring-card.fertile .ring { background: linear-gradient(150deg, #e59aa5, #d86b79); }
.ring-card.peak   .ring { background: linear-gradient(150deg, #6a5a96, #4b2d5d); }
.ring-card.safe   .ring { background: linear-gradient(150deg, #79a89f, #5e8e87); }
.ring-card.unknown .ring { background: linear-gradient(150deg, #cfc7bb, #b8b3ab); }

.status-reason { text-align: center; color: var(--muted); font-size: .92rem; line-height: 1.5; margin: 2px 8px 4px; }

.cta {
  display: block; width: 100%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #6a5a96, #584a80); color: #fff;
  font-family: var(--sans); font-size: 1.05rem; font-weight: 500;
  padding: 16px; border-radius: 16px; margin: 14px 0; box-shadow: var(--shadow-sm);
  transition: transform .1s ease, filter .15s;
}
.cta:active { transform: translateY(1px); filter: brightness(.96); }

/* today's-log checklist */
.today-log { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 6px; margin: 14px 0 6px; box-shadow: var(--shadow-sm); overflow: hidden; }
.today-log-head { font-family: var(--serif); text-transform: lowercase; color: var(--brand-deep); font-size: 1.05rem; padding: 10px 12px 6px; }
.log-row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: none; cursor: pointer; font-family: var(--sans); text-align: left; padding: 12px; border-radius: 12px; color: var(--ink); }
.log-row:active { background: var(--brand-soft); }
.log-row + .log-row { border-top: 1px solid var(--line); }
.log-row-ico { font-size: 1.4rem; width: 30px; text-align: center; flex: none; }
.log-row-main { flex: 1; display: flex; flex-direction: column; }
.log-row-main b { font-weight: 500; font-size: .98rem; }
.log-row-main small { color: var(--muted); font-size: .78rem; margin-top: 1px; }
.log-row-val { color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.log-row-val.done { color: var(--teal); }

/* collapsible "more" section on the Log form */
.more { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.more > summary { list-style: none; cursor: pointer; padding: 14px; font-size: 1.15rem; font-family: var(--serif); text-transform: lowercase; color: var(--brand-deep); display: flex; align-items: center; gap: 6px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 1.4rem; transition: transform .2s; }
.more[open] > summary::after { transform: rotate(90deg); }
.more > summary em { font-family: var(--sans); font-style: normal; color: var(--muted); font-size: .8rem; font-weight: 400; }
.more-inner { display: flex; flex-direction: column; gap: 13px; padding: 0 14px 14px; }

.today-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.stat-chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: .88rem; color: var(--ink); }

/* today's log — single button */
.today-log-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  font-family: var(--sans); text-align: left; padding: 16px 18px;
  border-radius: 18px; margin: 14px 0 6px; box-shadow: var(--shadow-sm);
}
.today-log-btn:active { transform: translateY(1px); filter: brightness(.96); }
.tlb-ico { font-size: 1.5rem; width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.16); border-radius: 10px; }
.tlb-main { flex: 1; display: flex; flex-direction: column; }
.tlb-main b { font-weight: 500; font-size: 1.05rem; }
.tlb-main small { color: rgba(255,255,255,.8); font-size: .8rem; margin-top: 2px; }
.tlb-go { font-size: 1.6rem; color: rgba(255,255,255,.7); flex: none; }

/* findings dashboard */
.findings { margin: 20px 0 6px; }
.section-title { font-family: var(--serif); text-transform: lowercase; color: var(--brand-deep); font-size: 1.3rem; margin: 0 2px 12px; }
.findings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.finding-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 15px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 2px; min-height: 78px; justify-content: center;
}
.fc-value { font-family: var(--sans); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; font-size: 1.45rem; line-height: 1.15; color: var(--brand-deep); }
.fc-label { font-size: .78rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.fc-sub { font-size: .78rem; color: var(--muted); }
.finding-empty { grid-column: 1 / -1; background: var(--card); border: 1px dashed var(--line); border-radius: 16px; padding: 20px; text-align: center; color: var(--muted); font-size: .92rem; }

/* contact / booking card */
.contact-card {
  background: linear-gradient(155deg, #efeaf4, #f6efe4);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 22px 20px 24px; margin: 20px 0 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.contact-logo { width: 56px; height: 56px; border-radius: 50%; }
.contact-card h3 { font-family: var(--serif); text-transform: lowercase; color: var(--brand-deep); font-size: 1.35rem; margin: 2px 0 0; }
.contact-card p { color: var(--ink); font-size: .92rem; line-height: 1.55; margin: 0 0 6px; max-width: 34ch; }
.contact-cta {
  display: inline-block; text-decoration: none; background: var(--brand); color: #fff;
  font-family: var(--sans); font-weight: 500; font-size: .96rem;
  padding: 13px 22px; border-radius: 14px; box-shadow: var(--shadow-sm);
}
.contact-cta:active { transform: translateY(1px); filter: brightness(.96); }
.contact-cta-alt { background: transparent; color: var(--brand); border: 1px solid var(--brand); box-shadow: none; }

/* ===== chat ===== */
.nav-ico { position: relative; }
.nav-badge { position: absolute; top: -5px; right: -11px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--rose); color: #fff; font-size: .62rem; font-weight: 600; display: flex; align-items: center; justify-content: center; line-height: 1; }
.nav-badge[hidden] { display: none; }

.chat-topbar h1 { flex: 1; }
.chat-thread { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 88px; }
.bubble { max-width: 80%; padding: 10px 13px; border-radius: 16px; font-size: .95rem; line-height: 1.4; box-shadow: var(--shadow-sm); }
.bubble-body { white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 5px; }
.bubble-time { font-size: .68rem; margin-top: 4px; opacity: .6; }
.bubble.me .bubble-time { text-align: right; }

.chat-composer {
  position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-bottom)); z-index: 30;
  max-width: 560px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 18px; background: rgba(246,239,228,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.chat-composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 18px;
  padding: 10px 14px; font-family: var(--sans); font-size: .95rem; line-height: 1.4;
  background: var(--card); color: var(--ink); max-height: 120px;
}
.chat-composer textarea:focus { outline: none; border-color: var(--brand); }
.chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--brand); color: #fff; font-size: 1.05rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-send:active { filter: brightness(.95); }

.chat-empty { text-align: center; color: var(--muted); padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.chat-empty-logo { width: 64px; height: 64px; border-radius: 50%; }
.chat-empty p { max-width: 32ch; line-height: 1.5; }
.chat-hello { text-align: center; color: var(--muted); padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; }
.chat-hello img { width: 56px; height: 56px; border-radius: 50%; }
.chat-hello b { color: var(--brand-deep); font-size: 1.05rem; }
.chat-hello p { max-width: 32ch; line-height: 1.5; margin: 0; }
.chat-loading { text-align: center; color: var(--muted); padding: 32px; }

.thread-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.thread-row { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; text-align: left; font-family: var(--sans); color: var(--ink); }
.thread-row:active { background: var(--brand-soft); }
.thread-ava { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.05rem; }
.thread-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.thread-main b { font-weight: 500; }
.thread-main small { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-unread { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--rose); color: #fff; font-size: .72rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }

.disclaimer { color: var(--muted); font-size: .78rem; line-height: 1.5; text-align: center; margin: 22px 6px 0; }

/* ===== forms ===== */
.log-form { display: flex; flex-direction: column; gap: 13px; margin-top: 4px; }
.log-date { text-align: center; font-size: 1.35rem; text-transform: lowercase; color: var(--brand-deep); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .82rem; color: var(--muted); font-weight: 500; }
.field input[type=number], .field input[type=text], .field input[type=time],
.field select, .field textarea {
  font-size: 1rem; padding: 14px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); width: 100%; font-family: var(--sans);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(88,74,128,.14);
}
.field.big input { font-size: 1.7rem; font-weight: 500; text-align: center; color: var(--brand-deep); }
.field.check { flex-direction: row; align-items: center; gap: 10px; }
.field.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.field.check span { color: var(--ink); font-weight: 400; font-size: .92rem; }
.sec { margin: 14px 2px 0; font-size: 1.15rem; color: var(--brand-deep); text-transform: lowercase; }
.sec-em { color: var(--muted); font-style: normal; font-weight: 400; font-size: .82rem; font-family: var(--sans); }
.sec-note { color: var(--muted); font-size: .84rem; line-height: 1.45; margin: 4px 2px 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.log-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.log-actions.col { flex-direction: column; align-items: stretch; }
.link-btn { background: none; border: none; color: var(--brand); font-size: .95rem; cursor: pointer; padding: 12px; font-family: var(--sans); text-align: center; font-weight: 500; }
.link-btn.danger { color: var(--wine); }
.file-btn { border: 1px solid var(--line); border-radius: 14px; }

/* two temperatures */
.temp-pair { display: flex; flex-direction: column; gap: 12px; }
.temp-field span em { color: var(--muted); font-style: normal; font-weight: 400; font-size: .78rem; }
.temp-row { display: flex; gap: 10px; }
.temp-row input[type=number] { flex: 2; font-size: 1.4rem; font-weight: 500; text-align: center; color: var(--brand-deep); }
.temp-row input[type=time] { flex: 1; }

/* ===== observations ===== */
.obs-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.obs-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.obs-card-head { display: flex; align-items: center; gap: 10px; }
.obs-card-fields { display: flex; gap: 8px; }
.obs-card-fields .obs-sel { flex: 1 1 0; min-width: 0; width: auto !important; padding: 10px 8px !important; font-size: .85rem !important; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-family: var(--sans); }
.obs-card-fields .obs-time { flex: none; width: 116px !important; padding: 10px 8px !important; font-size: .85rem !important; }
.obs-art { width: 56px; height: 40px; flex: none; }
.obs-art svg { width: 56px; height: 40px; }
.obs-code { flex: 1; display: flex; flex-direction: column; font-weight: 600; color: var(--brand-deep); font-size: .95rem; line-height: 1.1; }
.obs-code small { font-weight: 400; color: var(--muted); font-size: .74rem; margin-top: 2px; }
.obs-del { flex: none; border: none; background: none; color: var(--wine); font-size: 1.1rem; cursor: pointer; padding: 4px 6px; }
.obs-add { width: 100%; margin-top: 8px; border: 1.5px dashed var(--brand); background: var(--brand-soft); color: var(--brand); border-radius: 14px; padding: 13px; font-size: .95rem; font-weight: 500; cursor: pointer; font-family: var(--sans); }
.obs-most { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .86rem; color: var(--ink); }
.obs-most-art { width: 50px; height: 34px; flex: none; }
.obs-most-art svg { width: 50px; height: 34px; }
.obs-most b { color: var(--brand-deep); }
.obs-empty { color: var(--muted); font-style: italic; }

/* reference photos fill the same slots the SVG diagrams used */
.appear-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; background: #efe9e2; }

/* appearance trigger (quick-log) */
.appear-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px;
  font-family: var(--sans); text-align: left; color: var(--ink);
}
.appear-trigger.empty-trigger { border-style: dashed; }
.appear-trigger-art { width: 62px; height: 42px; flex: none; display: grid; place-items: center; }
.appear-trigger-art svg, .appear-trigger-art img { width: 62px; height: 42px; }
.appear-trigger-text { flex: 1; font-size: .95rem; }
.appear-trigger-chev { color: var(--muted); font-size: 1.4rem; }

/* ===== bottom sheet ===== */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(40, 26, 45, .42);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease;
}
.sheet {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 18px 18px calc(26px + var(--safe-bottom));
  box-shadow: 0 -10px 40px rgba(40,26,45,.28); animation: slideup .26s ease;
}
@keyframes slideup { from { transform: translateY(24px); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; background: var(--bg); padding-bottom: 8px; }
.sheet-head h2 { font-size: 1.35rem; margin: 0; flex: 1; text-transform: lowercase; color: var(--brand-deep); }
.sheet-note { color: var(--muted); font-size: .82rem; line-height: 1.45; margin: 0 2px 12px; }
.appear-grid { display: grid; gap: 10px; }
.appear-card {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px; font-family: var(--sans); color: var(--ink);
}
.appear-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.appear-card.mucus-next { border-style: dashed; }
.mucus-next-ico { width: 92px; height: 76px; flex: none; display: grid; place-items: center; font-size: 2.3rem; background: var(--brand-soft); border-radius: 12px; }
.sense-badge { width: 72px; height: 72px; flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 1.8rem; color: var(--brand); background: var(--brand-soft); border-radius: 14px; }
.wiz-skip { display: block; width: 100%; margin-top: 12px; background: none; border: none; color: var(--muted); font-family: var(--sans); font-size: .9rem; cursor: pointer; padding: 12px; }
.appear-card-art { width: 92px; height: 76px; flex: none; }
.appear-card-art svg { width: 92px; height: 76px; }
.appear-card-body { display: flex; flex-direction: column; gap: 3px; }
.appear-card-code { font-weight: 600; color: var(--brand); font-size: .9rem; }
.appear-card-label { font-weight: 500; font-size: .98rem; color: var(--ink-strong); }
.appear-card-desc { color: var(--muted); font-size: .8rem; line-height: 1.35; }

/* ===== chart ===== */
.legend { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; font-size: .82rem; color: var(--muted); }
.legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.dot.red { background: #a03348; } .dot.pink { background: #d86b79; }
.dot.purple { background: #584a80; } .dot.green { background: #5e8e87; }
.dot.yellow { background: #f2b544; } .dot.brown { background: #9c7a6a; }
.key-btn { background: var(--brand-soft); color: var(--brand); border: none; border-radius: 999px; padding: 6px 13px; font-size: .8rem; font-weight: 500; cursor: pointer; font-family: var(--sans); }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow-sm); }
.cycle-svg { display: block; }
.cycle-svg .row-label { font-size: 10px; fill: var(--brand); font-weight: 500; font-family: var(--sans); }
.cycle-svg .cell { font-size: 12px; fill: var(--ink); font-family: var(--sans); }
.cycle-svg .cell.strong { font-weight: 700; }
.cycle-svg .cell.muted, .cycle-svg .muted { fill: var(--muted); }
.cycle-svg .axis { font-size: 9px; fill: var(--muted); font-family: var(--sans); }
.cycle-svg .stamp-label { font-size: 11px; fill: #fff; font-weight: 700; font-family: var(--sans); }
.cycle-svg .coverline-label { font-size: 8.5px; fill: #fff; font-weight: 600; font-family: var(--sans); letter-spacing: .2px; }
.empty { color: var(--muted); text-align: center; padding: 40px 20px; line-height: 1.5; }
.col-hit { cursor: pointer; }
.chart-hint { text-align: center; color: var(--muted); font-size: .78rem; margin: 8px 0 0; }
.peak-check span em { color: var(--muted); font-style: normal; font-size: .82rem; }

/* legend / key sheet */
.lg-sec { font-size: 1.1rem; color: var(--brand-deep); margin: 18px 2px 6px; text-transform: lowercase; }
.lg-row { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.lg-badge { flex: none; width: 90px; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.lg-text { font-size: .9rem; line-height: 1.35; }
.lg-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.lg-code { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .82rem; color: var(--brand); font-weight: 700; }
.lg-ic { width: 26px; height: 26px; }
.lg-art { width: 64px; height: 42px; display: inline-block; }
.lg-art svg { width: 64px; height: 42px; }

/* ===== cycles list ===== */
.cycle-list { display: flex; flex-direction: column; gap: 10px; }
.cycle-card {
  text-align: left; width: 100%; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px;
  display: flex; flex-direction: column; gap: 8px; font-family: var(--sans); box-shadow: var(--shadow-sm);
}
.cc-main { display: flex; justify-content: space-between; align-items: baseline; }
.cc-main strong { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; text-transform: lowercase; color: var(--brand-deep); }
.cc-main span { color: var(--muted); font-size: .85rem; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .82rem; }

/* ===== bottom nav ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: rgba(246,239,228,.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  max-width: 560px; margin: 0 auto;
}
.nav-btn {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: .7rem; padding: 6px 0; font-family: var(--sans);
}
.nav-ico { font-size: 1.35rem; line-height: 1; }
.nav-btn.active { color: var(--brand); }

/* ===== speed-dial FAB ===== */
.fab-wrap {
  position: fixed; right: 18px; bottom: calc(88px + var(--safe-bottom)); z-index: 45;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
}
@media (min-width: 592px) { .fab-wrap { right: calc(50% - 280px + 18px); } }
.fab-main {
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #6a5a96, #4b2d5d); color: #fff; font-size: 2rem; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 10px 26px rgba(75, 45, 93, .38);
  transition: transform .25s ease;
}
.fab-wrap.open .fab-main { transform: rotate(45deg); }
.fab-action {
  display: flex; align-items: center; gap: 10px; border: none; background: none; cursor: pointer;
  padding: 0; font-family: var(--sans);
  opacity: 0; transform: translateY(14px) scale(.85); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.fab-wrap.open .fab-action { opacity: 1; transform: none; pointer-events: auto; }
.fab-action .fab-label { background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-size: .85rem; font-weight: 500; box-shadow: var(--shadow-sm); }
.fab-action .fab-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-sm); display: grid; place-items: center; font-size: 1.35rem; }
.fab-action .fab-ico-text { font-family: var(--serif); font-size: 1.15rem; color: var(--brand); }

/* single-choice quick-log sheet (bleeding / cervix) */
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 14px; font-family: var(--sans); color: var(--ink); }
.choice-row.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice-code { flex: none; min-width: 34px; height: 34px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .95rem; }
.choice-label { font-size: 1rem; }
.fab-scrim { position: fixed; inset: 0; z-index: 44; background: transparent; }

/* ===== shared (read-only) chart view ===== */
.shared-overlay {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  overflow-y: auto; padding: 12px 18px calc(24px + var(--safe-bottom));
  animation: fade .22s ease;
}
.shared-top { display: flex; align-items: center; gap: 10px; padding: 14px 2px 8px; }
.shared-top .chart-title { flex: 1; }
.shared-top h1 { font-size: 1.6rem; text-transform: lowercase; color: var(--brand-deep); margin: 0; }
.shared-overlay .cta { margin-top: 14px; }

/* ===== sign-in screen ===== */
.signin-view { min-height: 78vh; display: flex; align-items: center; justify-content: center; }
.signin-card { max-width: 380px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 14px; padding: 12px; }
.signin-card h1 { font-size: 2.4rem; text-transform: lowercase; color: var(--brand-deep); margin: 0; }
.signin-sub { color: var(--muted); font-size: 1rem; line-height: 1.5; margin: -4px 0 6px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px; border-radius: 14px; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  font-family: var(--sans); font-size: 1rem; font-weight: 500; box-shadow: var(--shadow-sm);
}
.google-btn:active { transform: translateY(1px); }
.email-btn { width: 100%; padding: 13px; border-radius: 14px; cursor: pointer; background: var(--brand-soft); color: var(--brand); border: none; font-family: var(--sans); font-size: .98rem; font-weight: 500; }
.email-btn:active { transform: translateY(1px); }
.signin-view .field { text-align: left; }
.signin-msg { color: var(--wine); font-size: .88rem; }

/* account row in Settings */
.account-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.account-meta { flex: 1; display: flex; flex-direction: column; }
.account-meta b { font-weight: 500; }
.account-meta small { color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* ===== first-run onboarding ===== */
.onboard-overlay {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 22px;
  overflow-y: auto; animation: fade .25s ease;
}
.onboard-close { position: absolute; top: 14px; right: 16px; border: none; background: var(--brand-soft); color: var(--brand); width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; cursor: pointer; }
.onboard-card {
  position: relative;
  max-width: 460px; width: 100%; text-align: center;
  display: flex; flex-direction: column; gap: 14px;
}
.onboard-moon { font-size: 3rem; }
.brand-logo { width: 88px; height: 88px; margin: 0 auto 2px; display: block; border-radius: 50%; }
.onboard-card h1 { font-size: 2.4rem; text-transform: lowercase; color: var(--brand-deep); margin: 0; }
.onboard-sub { color: var(--muted); font-size: .98rem; line-height: 1.5; margin: -4px 0 6px; }
.onboard-q { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.onboard-q > span { font-size: .88rem; color: var(--ink); font-weight: 500; }
.seg { display: flex; gap: 8px; background: var(--brand-soft); padding: 5px; border-radius: 14px; }
.seg button { flex: 1; border: none; background: none; cursor: pointer; font-family: var(--sans); font-size: .95rem; padding: 12px 8px; border-radius: 10px; color: var(--brand); font-weight: 500; }
.seg button.seg-on { background: var(--card); color: var(--brand-deep); box-shadow: var(--shadow-sm); }
.onboard-how { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.how-row { display: flex; align-items: center; gap: 12px; font-size: .92rem; color: var(--ink); line-height: 1.35; }
.how-ico { font-size: 1.4rem; flex: none; width: 28px; text-align: center; }
.onboard-card .cta { margin: 6px 0 0; }

/* ===== toast ===== */
#toast {
  position: fixed; bottom: calc(104px + var(--safe-bottom)); left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--brand-deep); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 50; font-weight: 500;
}
#toast.show { opacity: .97; transform: translateX(-50%) translateY(0); }
