/* ─── RESET & ROOT ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --teal:       #1d4e4e;
  --teal-mid:   #2a7070;
  --teal-light: #e6f2f2;
  --teal-faint: #f0f8f8;
  --rose:       #b85c55;
  --rose-light: #fdf1f0;
  --gold:       #b87c28;
  --gold-light: #fdf5e6;
  --navy:       #2a3d6e;
  --navy-light: #eef1f9;
  --plum:       #5e3073;
  --plum-light: #f4eef9;
  --ink:        #1a2424;
  --ink-mid:    #3d4e4e;
  --ink-soft:   #6b7c7c;
  --rule:       #dce8e8;
  --bg:         #f7fafa;
  --white:      #ffffff;
  --card-shadow: 0 1px 3px rgba(29,78,78,0.08), 0 4px 12px rgba(29,78,78,0.06);
  --card-shadow-hover: 0 4px 16px rgba(29,78,78,0.13), 0 1px 3px rgba(29,78,78,0.1);
  --radius:     14px;
  --radius-sm:  8px;
  --nav-h:      64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ─── LAYOUT SHELL ─── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

#header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--teal);
  padding: env(safe-area-inset-top, 0px) 0 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.header-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.header-titles {
  flex: 1;
  min-width: 0;
}

.header-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: white;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  line-height: 1.2;
}

#install-btn {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: 20px;
  padding: 5px 11px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s;
}
#install-btn:active { background: rgba(255,255,255,0.28); }
#install-btn.visible { display: flex; }

/* Search bar */
#search-bar {
  padding: 0 16px 12px;
  position: relative;
}

#search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
  color: white;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: background .2s, border .2s;
}
#search-input::placeholder { color: rgba(255,255,255,0.55); }
#search-input:focus {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.45);
}

.search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.65;
  pointer-events: none;
}

#search-clear {
  display: none;
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}
#search-clear.visible { display: flex; }

/* ─── CONTENT AREA ─── */
#content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.page { display: none; padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); }
.page.active { display: block; }

/* ─── BOTTOM NAV ─── */
#nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--white);
  border-top: 1px solid var(--rule);
  display: flex;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 12px rgba(29,78,78,0.08);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  min-height: var(--nav-h);
  touch-action: manipulation;
}
.nav-btn.active { color: var(--teal); }
.nav-btn:active { opacity: 0.7; }

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* ─── CARDS & SECTIONS ─── */
.section-hero {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-mid) 100%);
  padding: 28px 20px 24px;
  position: relative;
  overflow: hidden;
}

.section-hero::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.section-hero.rose-hero { background: linear-gradient(135deg, #7a3a36 0%, var(--rose) 100%); }
.section-hero.gold-hero { background: linear-gradient(135deg, #7a5010 0%, var(--gold) 100%); }
.section-hero.navy-hero { background: linear-gradient(135deg, #1a2548 0%, var(--navy) 100%); }
.section-hero.plum-hero { background: linear-gradient(135deg, #3a1a48 0%, var(--plum) 100%); }

.hero-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.55;
}

/* Card list */
.cards { padding: 16px 16px 0; display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: box-shadow .2s;
}

.card:active { box-shadow: var(--card-shadow-hover); }

/* Accordion card */
.acc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.acc-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--teal-light);
}

.acc-icon-wrap.rose { background: var(--rose-light); }
.acc-icon-wrap.gold { background: var(--gold-light); }
.acc-icon-wrap.navy { background: var(--navy-light); }
.acc-icon-wrap.plum { background: var(--plum-light); }

.acc-icon-wrap svg { width: 20px; height: 20px; }

.acc-titles { flex: 1; min-width: 0; }

.acc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.acc-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 1px;
}

.acc-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.card.open .acc-chevron { transform: rotate(180deg); }

.acc-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--rule);
}

.card.open .acc-body { display: block; }

/* Body content styles */
.acc-body p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 10px;
}

.acc-body p:last-child { margin-bottom: 0; }

.acc-body .lead {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--teal);
  padding-top: 10px;
  margin-bottom: 10px;
}

.acc-body .lead.rose { color: var(--rose); }
.acc-body .lead.gold { color: var(--gold); }
.acc-body .lead.navy { color: var(--navy); }
.acc-body .lead.plum { color: var(--plum); }

.acc-body h4 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-mid);
  margin: 14px 0 6px;
}

.acc-body ul, .acc-body ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.acc-body li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 4px;
}

.acc-body li strong { font-weight: 600; }

/* Callout boxes */
.callout {
  background: var(--teal-faint);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  margin: 10px 0;
}
.callout.rose { background: var(--rose-light); border-color: var(--rose); }
.callout.gold { background: var(--gold-light); border-color: var(--gold); }
.callout.navy { background: var(--navy-light); border-color: var(--navy); }
.callout.plum { background: var(--plum-light); border-color: var(--plum); }
.callout.alert { background: #fff3f3; border-color: #c44; }

.callout-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal);
  margin-bottom: 5px;
}
.callout.rose .callout-title { color: var(--rose); }
.callout.gold .callout-title { color: var(--gold); }
.callout.navy .callout-title { color: var(--navy); }
.callout.plum .callout-title { color: var(--plum); }
.callout.alert .callout-title { color: #c44; }

.callout p { font-size: 13.5px; margin-bottom: 0; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.data-table th {
  background: var(--teal);
  color: white;
  padding: 7px 10px;
  font-weight: 600;
  font-size: 12px;
  text-align: left;
}
.data-table th.rose { background: var(--rose); }
.data-table th.gold { background: var(--gold); }
.data-table th.navy { background: var(--navy); }
.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.45;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--teal-faint); }

/* ─── HOME PAGE ─── */
.home-hero {
  background: linear-gradient(160deg, var(--teal) 0%, #1a6060 60%, #2a7d5a 100%);
  padding: 32px 20px 28px;
  position: relative;
  overflow: hidden;
}

.home-hero::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.home-hero-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}

.home-hero-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
  margin-bottom: 10px;
}

.home-hero-desc {
  font-size: 13.5px;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
  max-width: 320px;
}

/* Quick nav grid */
.quick-nav {
  padding: 20px 16px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.qnav-btn {
  background: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: box-shadow .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-decoration: none;
}
.qnav-btn:active { transform: scale(0.96); box-shadow: var(--card-shadow-hover); }

.qnav-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qnav-icon svg { width: 22px; height: 22px; }

.qnav-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.25;
}

/* Info strip */
.info-strip {
  margin: 16px 16px 0;
  background: var(--teal);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.info-strip-text { flex: 1; }
.info-strip-title { font-size: 14px; font-weight: 700; color: white; }
.info-strip-sub { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 1px; }

/* Quick-ref card */
.qref-card {
  margin: 16px 16px 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.qref-header {
  background: #fff3f3;
  border-bottom: 1px solid #ffd5d5;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qref-header-title {
  font-size: 13px;
  font-weight: 700;
  color: #c44;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qref-body { padding: 12px 16px; }

.qref-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.qref-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.qref-col-title.teal { color: var(--teal); }
.qref-col-title.rose { color: var(--rose); }

.qref-list { list-style: disc; padding-left: 16px; }
.qref-list li { font-size: 12.5px; line-height: 1.5; color: var(--ink); margin-bottom: 2px; }

/* ─── SEARCH RESULTS ─── */
#search-results-page {
  display: none;
  padding: 0 0 calc(var(--nav-h) + var(--safe-bottom) + 16px);
}
#search-results-page.active { display: block; }

.search-results-header {
  padding: 16px 16px 8px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}

.search-result-item {
  margin: 0 16px 10px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .15s;
}
.search-result-item:active { box-shadow: var(--card-shadow-hover); }

.sri-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--teal);
  margin-bottom: 4px;
}
.sri-section.rose { color: var(--rose); }
.sri-section.gold { color: var(--gold); }
.sri-section.navy { color: var(--navy); }
.sri-section.plum { color: var(--plum); }

.sri-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.sri-snippet {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sri-snippet em {
  font-style: normal;
  font-weight: 600;
  color: var(--teal);
}

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-soft);
  font-size: 15px;
}
.no-results strong { display: block; font-size: 18px; color: var(--ink); margin-bottom: 6px; }

/* ─── MY INFO PAGE ─── */
.myinfo-hero {
  background: linear-gradient(135deg, #1a2548 0%, var(--navy) 100%);
  padding: 24px 20px 20px;
}

.myinfo-hero-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}
.myinfo-hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.form-section {
  margin: 16px 16px 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.form-section-title {
  padding: 12px 16px 10px;
  background: var(--teal-faint);
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--teal);
}

.form-section-title.navy { background: var(--navy-light); color: var(--navy); border-color: var(--rule); }

.contact-row {
  border-bottom: 1px solid var(--rule);
  padding: 14px 16px;
}
.contact-row:last-child { border-bottom: none; }

.contact-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.contact-fields { display: flex; flex-direction: column; gap: 7px; }

.contact-field-wrap { display: flex; align-items: center; gap: 8px; }

.contact-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
}
.contact-input:focus { border-color: var(--teal); background: white; }
.contact-input::placeholder { color: var(--ink-soft); opacity: 0.6; }

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.action-btn:active { transform: scale(0.92); }
.action-btn:disabled { opacity: 0.3; cursor: default; }

.call-btn { background: #e8f5e9; color: #2e7d32; }
.text-btn { background: #e3f2fd; color: #1565c0; }

.myinfo-save-bar {
  padding: 16px;
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  display: flex;
  gap: 10px;
  align-items: center;
}

#save-btn {
  flex: 1;
  padding: 14px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
#save-btn:active { transform: scale(0.98); background: var(--teal-mid); }
#save-btn.saved { background: #2e7d32; }

/* ─── FAQ PAGE ─── */
.faq-item {
  margin-bottom: 10px;
}

.faq-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.faq-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-myth { background: #fde8e6; color: #c0392b; }
.badge-faq  { background: var(--teal-light); color: var(--teal); }

.faq-q {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.faq-chevron {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  flex-shrink: 0;
  margin-top: 2px;
  transition: transform .25s;
}
.card.open .faq-chevron { transform: rotate(180deg); }

/* ─── OFFLINE BANNER ─── */
#offline-banner {
  display: none;
  background: #e65100;
  color: white;
  text-align: center;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
}
#offline-banner.visible { display: block; }

/* ─── TOAST ─── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── UTILITY ─── */
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
strong { font-weight: 600; }
.text-muted { color: var(--ink-soft); }

/* Scrollbar (desktop) */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }

/* ─── TOOLS PAGE ─── */
.tool-back-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
}
.tool-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--teal);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}
.tool-back-btn svg { flex-shrink: 0; }
.tool-back-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  text-align: center;
  padding-right: 28px; /* offset for back btn width */
}
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 4px;
}
.tool-card-btn {
  background: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: box-shadow .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: left;
  width: 100%;
}
.tool-card-btn:active { transform: scale(0.97); box-shadow: var(--card-shadow-hover); }
.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-card-icon svg { width: 22px; height: 22px; }
.tool-card-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.tool-card-desc { font-size: 11px; color: var(--ink-soft); line-height: 1.35; }
.tool-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 16px 16px 8px;
}
.big-action-btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  line-height: 1.2;
}
.big-action-btn:active { transform: scale(0.97); opacity: .9; }
.btn-teal { background: var(--teal); color: white; }
.btn-rose { background: var(--rose); color: white; }
.btn-gold { background: var(--gold); color: white; }
.btn-navy { background: var(--navy); color: white; }
.btn-plum { background: var(--plum); color: white; }
.btn-green { background: #2e7d32; color: white; }
.btn-red { background: #c44; color: white; }
.btn-sm {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s;
}
.btn-sm:active { opacity: .8; }
.btn-row { display: flex; gap: 10px; padding: 0 16px; }
.tool-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
}
.tool-input:focus { border-color: var(--teal); background: white; }
.tool-textarea {
  width: 100%;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  resize: vertical;
  transition: border-color .2s;
  line-height: 1.5;
  min-height: 80px;
}
.tool-textarea:focus { border-color: var(--teal); background: white; }
.tool-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7c7c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}
.tool-select:focus { border-color: var(--teal); background-color: white; }
.form-field { padding: 0 16px 12px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.stat-row { display: flex; gap: 10px; padding: 12px 16px; }
.stat-box {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  box-shadow: var(--card-shadow);
  text-align: center;
}
.stat-number { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 11px; color: var(--ink-soft); margin-top: 3px; line-height: 1.3; }
.history-section-title {
  padding: 16px 16px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-soft);
}
.history-list-card {
  background: var(--white);
  border-radius: var(--radius);
  margin: 0 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.history-empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 20px;
}
/* Kick counter */
.kick-display { text-align: center; padding: 28px 20px 16px; }
.kick-count { font-family: var(--font-serif); font-size: 80px; font-weight: 600; line-height: 1; }
.kick-count.teal { color: var(--teal); }
.kick-count.gold { color: var(--gold); }
.kick-elapsed { font-size: 32px; font-weight: 600; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.kick-history-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  gap: 10px;
}
.kick-history-row:last-child { border-bottom: none; }
.khr-date { font-size: 11px; color: var(--ink-soft); flex: 0 0 auto; }
.khr-count { font-size: 14px; font-weight: 700; color: var(--ink); flex: 1; }
.khr-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.khr-pass { background: #e8f5e9; color: #2e7d32; }
.khr-fail { background: #ffebee; color: #c44; }
/* Contraction timer */
.contraction-live-time { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.cx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
}
.cx-row:last-child { border-bottom: none; }
.cx-num { font-size: 11px; color: var(--ink-soft); flex: 0 0 20px; }
.cx-dur { font-size: 15px; font-weight: 700; flex: 1; }
.cx-interval { font-size: 12px; color: var(--ink-soft); text-align: right; }
.alert-511 {
  margin: 0 16px 12px;
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 2px solid;
}
/* Feeding log */
.feed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
}
.feed-row:last-child { border-bottom: none; }
.feed-time { font-size: 11px; color: var(--ink-soft); flex: 0 0 45px; }
.feed-detail { font-size: 14px; font-weight: 500; flex: 1; }
.feed-note { font-size: 12px; color: var(--ink-soft); }
/* Diaper counter */
.diaper-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px; }
.diaper-big-btn {
  padding: 20px 12px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s;
}
.diaper-big-btn:active { transform: scale(0.96); }
.diaper-big-btn .dbb-count { font-size: 36px; font-weight: 700; line-height: 1; }
.diaper-log-row {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--rule);
  gap: 10px;
  font-size: 13px;
}
.diaper-log-row:last-child { border-bottom: none; }
/* Jaundice tracker */
.jaundice-day-num { font-family: var(--font-serif); font-size: 90px; font-weight: 600; color: var(--gold); line-height: 1; }
/* BP log */
.bp-row {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--rule);
  gap: 10px;
}
.bp-row:last-child { border-bottom: none; }
.bp-reading { font-size: 19px; font-weight: 700; flex: 1; }
.bp-pill { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; color: white; }
.bp-time { font-size: 11px; color: var(--ink-soft); }
/* Weight tracker */
.weight-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  gap: 10px;
}
.weight-row:last-child { border-bottom: none; }
.weight-wk { font-size: 11px; color: var(--ink-soft); flex: 0 0 50px; }
.weight-val { font-size: 16px; font-weight: 700; flex: 1; }
.weight-gain { font-size: 12px; color: var(--ink-soft); }
/* EPDS */
.epds-question { padding: 16px; border-bottom: 1px solid var(--rule); }
.epds-q-num { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); margin-bottom: 4px; }
.epds-q-text { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; line-height: 1.4; }
.epds-options { display: flex; flex-direction: column; gap: 8px; }
.epds-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.epds-option.selected { border-color: var(--teal); background: var(--teal-faint); }
.epds-option-text { font-size: 13.5px; color: var(--ink); flex: 1; }
/* Birth plan */
.bpb-question { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.bpb-q-text { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 10px; line-height: 1.4; }
.bpb-options { display: flex; flex-wrap: wrap; gap: 7px; }
.bpb-pill {
  padding: 7px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  background: white;
}
.bpb-pill.selected { border-color: var(--teal); color: var(--teal); background: var(--teal-faint); }
.birth-plan-output {
  margin: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.bpo-header {
  background: var(--teal);
  padding: 14px 16px;
  color: white;
  font-size: 14px;
  font-weight: 700;
}
.bpo-row {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  align-items: flex-start;
}
.bpo-row:last-child { border-bottom: none; }
.bpo-q { font-size: 12px; color: var(--ink-soft); flex: 1; }
.bpo-a { font-size: 13px; font-weight: 600; color: var(--ink); flex: 0 0 auto; max-width: 55%; text-align: right; }
/* Appointment notes */
.appt-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin: 0 16px 10px;
  overflow: hidden;
}
.appt-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.appt-date-badge {
  background: var(--teal-faint);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  flex-shrink: 0;
  min-width: 48px;
}
.adb-month { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--teal); }
.adb-day { font-size: 20px; font-weight: 700; color: var(--teal); line-height: 1; }
.appt-info { flex: 1; min-width: 0; }
.appt-type-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.appt-preview { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-chevron { color: var(--ink-soft); transition: transform .2s; flex-shrink: 0; }
.appt-card.open .appt-chevron { transform: rotate(180deg); }
.appt-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--rule);
}
.appt-card.open .appt-body { display: block; }
.appt-sub-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-soft);
  margin: 12px 0 6px;
}
/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  align-items: flex-end;
}
.modal-overlay.visible { display: flex; }
.modal-sheet {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(var(--safe-bottom) + 20px);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 14px auto 16px;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}
.inline-fields { display: flex; gap: 12px; padding: 0 16px 12px; }
.inline-fields > div { flex: 1; }
.pill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-pill {
  padding: 8px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  background: white;
  border: 1.5px solid var(--rule);
}
.choice-pill.selected { border-color: var(--teal); color: var(--teal); background: var(--teal-faint); }
.score-result-card {
  margin: 0 16px 16px;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.score-result-card .score-num { font-size: 48px; font-weight: 700; line-height: 1; }
.score-result-card .score-label { font-size: 14px; font-weight: 600; margin-top: 6px; }
.score-result-card .score-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }
.weight-profile-card {
  margin: 12px 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
}
.wpc-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.range-bar-wrap { height: 8px; background: var(--rule); border-radius: 4px; position: relative; margin: 8px 0; overflow: hidden; }
.range-bar-fill { position: absolute; top: 0; bottom: 0; background: var(--teal); border-radius: 4px; }
.range-bar-dot { position: absolute; top: 50%; width: 14px; height: 14px; background: var(--rose); border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid white; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ─── DARK MODE TOGGLE BUTTON ─── */
#theme-btn { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3); color: white; border-radius: 50%; cursor: pointer; flex-shrink: 0; transition: background .2s; -webkit-tap-highlight-color: transparent; }
#theme-btn:active { background: rgba(255,255,255,0.32); }

/* ─── EXPORT BUTTON IN SAVE BAR ─── */
#export-btn { padding: 14px 16px; background: var(--teal-faint); color: var(--teal); border: 1.5px solid var(--teal); border-radius: var(--radius); font-family: var(--font-sans); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .2s; -webkit-tap-highlight-color: transparent; }
#export-btn:active { background: var(--teal-light); }

/* ─── DARK MODE ─── */
body.dark { --bg: #111c1c; --white: #192828; --ink: #ddeaea; --ink-mid: #a8c0c0; --ink-soft: #6a8888; --rule: #253535; --teal-light: #182e2e; --teal-faint: #121f1f; --rose-light: #261616; --gold-light: #221800; --navy-light: #111c30; --plum-light: #1c1028; --card-shadow: 0 1px 4px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.4); }
body.dark .callout { background: #1a2b2b !important; border-color: #2a4040 !important; }
body.dark .callout.alert, body.dark .callout.rose { background: #280e0e !important; border-color: #4a1818 !important; }
body.dark .callout.gold { background: #221800 !important; border-color: #3a2800 !important; }
body.dark .callout.navy { background: #0f1825 !important; border-color: #1a2e45 !important; }
body.dark .callout.plum { background: #180f22 !important; border-color: #2c1845 !important; }
body.dark .qref-header { background: #220e0e; border-color: #381818; }
body.dark .bpb-pill { background: var(--white); border-color: var(--rule); color: var(--ink); }
body.dark .bpb-pill.selected { border-color: var(--teal); color: var(--teal); background: var(--teal-faint); }
body.dark .choice-pill { background: var(--white); border-color: var(--rule); color: var(--ink-soft); }
body.dark .choice-pill.selected { border-color: var(--teal); color: var(--teal); background: var(--teal-faint); }
body.dark #nav { background: var(--white); border-top-color: var(--rule); }
body.dark .tool-input, body.dark .tool-textarea { background: var(--white); border-color: var(--rule); color: var(--ink); }
body.dark .modal-sheet { background: var(--white); }
body.dark select { background: var(--white); border-color: var(--rule); color: var(--ink); }
body.dark .section-tab { background: var(--white); }
body.dark .section-tab.active { background: var(--teal-faint); }
body.dark .appt-card { background: var(--white); }
body.dark .birth-plan-output { background: var(--white); }
body.dark .myinfo-save-bar { background: var(--white); border-top: 1px solid var(--rule); }
body.dark #export-btn { background: var(--teal-faint); border-color: var(--teal); color: var(--teal); }
body.dark .bp-notes-area { background: var(--white); border-color: var(--rule); color: var(--ink); }
body.dark .score-result-card { background: #1a1a1a; }

/* ─── PRINT VIEW ─── */
#print-view { display: none; }

@media print {
  #app { display: none !important; }
  #print-view {
    display: block !important;
    font-family: Georgia, serif;
    color: #111;
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
  }
  #print-view h1 { font-size: 22px; margin-bottom: 4px; }
  #print-view .pv-meta { font-size: 12px; color: #666; margin-bottom: 20px; }
  #print-view .pv-row { display: flex; border-bottom: 1px solid #ddd; padding: 8px 0; }
  #print-view .pv-q { flex: 0 0 45%; font-weight: 600; font-size: 13px; }
  #print-view .pv-a { flex: 1; font-size: 13px; }
  #print-view .pv-notes { margin-top: 20px; font-size: 13px; white-space: pre-wrap; border-top: 2px solid #111; padding-top: 12px; }
  #print-view .pv-footer { margin-top: 20px; font-size: 11px; color: #999; }
}
