/* HerEverything — shared styles. System fonts only (no Google Fonts = no tracking, faster). */
:root {
  --bg: #FBF8FF;
  --surface: #FFFFFF;
  --ink: #2B1E3A;
  --ink-soft: #5E5170;
  --line: #E6DFF0;
  --berry: #8A2C5E;
  --berry-dark: #6E2049;
  --apricot: #FFE2CC;
  --lilac: #EFE7FA;
  --sage: #2F6F4F;
  --sage-bg: #E3F2EA;
  --warn: #9A4A00;
  --warn-bg: #FFF1DC;
  --stop: #A12A2A;
  --stop-bg: #FDE5E5;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --font-body: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--berry); text-underline-offset: 3px; }
a:hover { color: var(--berry-dark); }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.logo { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.logo span { color: var(--berry); }
.site-nav { display: flex; gap: 18px; font-size: 0.95rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--berry); }
@media (max-width: 520px) { .site-nav .hide-sm { display: none; } }

/* Promise bar */
.promise { background: var(--ink); color: #fff; font-size: 0.9rem; text-align: center; padding: 7px 16px; }

/* Headings & text */
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 32px 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 1.45rem; margin: 40px 0 12px; }
h3 { font-size: 1.15rem; margin: 24px 0 8px; }
.lead { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 24px; max-width: 60ch; }
p, li { max-width: 68ch; }

/* Tool box */
.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin: 8px 0 28px;
}
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint, .hint { font-size: 0.9rem; color: var(--ink-soft); margin-top: 4px; }
input[type="date"], input[type="time"], input[type="month"], input[type="number"], input[type="text"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  min-height: 48px;
}
input:focus, select:focus, textarea:focus { border-color: var(--berry); outline: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label {
  display: inline-block; font-weight: 600; margin: 0;
  border: 2px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; background: #fff;
}
.choices input:checked + label { border-color: var(--berry); background: var(--lilac); color: var(--berry-dark); }
.choices input:focus-visible + label { outline: 3px solid var(--berry); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--berry); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 24px; min-height: 48px;
}
.btn:hover { background: var(--berry-dark); color: #fff; }
.btn.secondary { background: var(--lilac); color: var(--berry-dark); }
.btn.secondary:hover { background: #E3D7F4; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* Result — the memorable piece: a big soft "bubble" */
.result { margin-top: 22px; }
.result[hidden] { display: none; }
.bubble {
  background: var(--apricot);
  border-radius: 28px 28px 28px 8px;
  padding: 22px 24px;
}
.bubble .big { font-family: var(--font-head); font-size: clamp(1.9rem, 6vw, 2.5rem); font-weight: 700; line-height: 1.15; margin: 2px 0 6px; }
.bubble .small { color: var(--ink-soft); margin: 0; }
.bubble .emoji { font-size: 3rem; line-height: 1; float: right; margin-left: 12px; }
.facts { list-style: none; padding: 0; margin: 16px 0 0; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); max-width: none; }
.facts li span:last-child { font-weight: 700; text-align: right; }

.progress { height: 12px; background: var(--lilac); border-radius: 999px; overflow: hidden; margin: 14px 0 4px; }
.progress div { height: 100%; background: var(--berry); border-radius: 999px; }

.status { border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; margin-top: 12px; }
.status.ok { background: var(--sage-bg); color: var(--sage); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.stop { background: var(--stop-bg); color: var(--stop); }
.error { color: var(--stop); font-weight: 600; margin-top: 10px; }
.error[hidden] { display: none; }

.saved-note { font-size: 0.92rem; background: var(--lilac); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 16px; }
.saved-note[hidden] { display: none; }

/* Share card output */
.card-out { margin-top: 18px; }
.card-out img { display: block; width: 100%; max-width: 360px; border-radius: 16px; box-shadow: 0 6px 24px rgba(43, 30, 58, 0.18); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; }

/* Caffeine list */
.drink { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.drink .name { font-weight: 600; }
.drink .mg { font-size: 0.88rem; color: var(--ink-soft); font-weight: 400; display: block; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }

/* Cycles */
.cycle { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; background: #fff; }
.cycle strong { display: block; }

/* Teeth */
.tooth { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.chip { font-size: 0.85rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.chip.done { background: var(--sage-bg); color: var(--sage); }
.chip.now { background: var(--warn-bg); color: var(--warn); }
.chip.later { background: var(--lilac); color: var(--ink-soft); }

/* Content sections */
.answer { background: var(--surface); border-left: 4px solid var(--berry); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.how { background: var(--lilac); border-radius: var(--radius-lg); padding: 18px 20px; margin-top: 28px; }
.how h2 { margin-top: 0; font-size: 1.2rem; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 8px 0 0; }
.related { display: grid; gap: 10px; padding: 0; list-style: none; }
.related a { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; text-decoration: none; color: var(--ink); font-weight: 600; }
.related a:hover { border-color: var(--berry); }
.disclaimer { font-size: 0.9rem; color: var(--ink-soft); border-top: 1px solid var(--line); margin-top: 36px; padding-top: 16px; }

/* Home */
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.3rem); margin-top: 28px; }
.stage-pick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin: 20px 0 8px; }
.stage-pick p { margin: 0 0 10px; font-weight: 700; }
.tool-list { list-style: none; padding: 0; margin: 0; }
.tool-list li { max-width: none; }
.tool-list a { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tool-list a:hover .t { color: var(--berry); }
.tool-list .e { font-size: 1.8rem; text-align: center; }
.tool-list .t { font-weight: 700; display: block; }
.tool-list .d { color: var(--ink-soft); font-size: 0.95rem; }
.tool-list li[hidden] { display: none; }
.soon { color: var(--ink-soft); font-size: 0.95rem; }

/* Week pages */
.week-nav { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; list-style: none; padding: 0; }
.week-grid li { max-width: none; }
.week-grid a { display: block; text-align: center; padding: 10px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.week-grid a span { display: block; font-size: 1.5rem; }
.week-grid a:hover { border-color: var(--berry); }

/* Footer */
.site-footer { margin-top: 56px; background: var(--ink); color: #E9E2F2; padding: 32px 0; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  .site-header, .site-footer, .promise, .btn-row, .related, .how, details, .disclaimer { display: none !important; }
  .tool { border: 0; padding: 0; }
}

/* ---- footer owner line ---- */
.site-footer .owner {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.6;
}
.site-footer .owner a { text-decoration: underline; }
