:root {
  color-scheme: light;
  --ink: #173f36;
  --ink-2: #2d584d;
  --cream: #f4f0e7;
  --paper: #fffdf8;
  --sand: #e9e0d0;
  --gold: #f0c36a;
  --gold-soft: #fae8bc;
  --coral: #dc7b62;
  --sage: #9db5a4;
  --muted: #6e7f78;
  --line: rgba(23, 63, 54, 0.12);
  --shadow: 0 18px 45px rgba(32, 62, 53, 0.09);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -5%, rgba(240, 195, 106, 0.28), transparent 32rem),
    var(--cream);
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, label, input, textarea { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: rgba(244, 240, 231, 0.78);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 22px 12px;
  background: rgba(244, 240, 231, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(23, 63, 54, 0.06);
}

.brand {
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  cursor: pointer;
  text-align: right;
}

.brand-mark, .onboarding-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px 14px 6px 14px;
  color: var(--gold);
  background: var(--ink);
  font-weight: 900;
  font-size: 24px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -0.01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
}

main { padding: 18px 18px 120px; }
.view { display: none; animation: appear 220ms ease both; }
.view.active { display: block; }

@keyframes appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: -0.035em; }
h1 { margin-bottom: 10px; font-size: clamp(31px, 8vw, 48px); line-height: 1.05; }
h2 { margin-bottom: 8px; font-size: 24px; }
p { color: var(--muted); line-height: 1.65; }

.eyebrow {
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card {
  padding: 22px;
  border: 1px solid rgba(23, 63, 54, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.hero-card {
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 0 100%, rgba(240, 195, 106, 0.23), transparent 48%),
    var(--ink);
}

.hero-card::after {
  content: "";
  position: absolute;
  left: -30px;
  top: -45px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.hero-card h1 { margin-bottom: 8px; color: #fff; font-size: clamp(29px, 8vw, 44px); }
.hero-card .eyebrow { color: var(--gold); }
.hero-copy { margin: 0; color: rgba(255, 255, 255, 0.74); font-size: 14px; line-height: 1.5; }

.progress-ring {
  --value: 0deg;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--value), rgba(255,255,255,.13) 0);
  position: relative;
}

.progress-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.progress-ring span { z-index: 1; color: #fff; font-weight: 800; font-size: 14px; }

.week-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 20px 4px 17px;
}

.week-strip div span, .week-strip div strong { display: block; }
.week-kicker { margin-bottom: 2px; color: var(--coral); font-size: 12px; font-weight: 800; }
.week-strip strong { font-size: 17px; }

.text-button {
  padding: 8px 0;
  border: 0;
  color: var(--ink-2);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.focus-card { margin-bottom: 28px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading.compact { align-items: center; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0; }
.focus-card > p { margin: 14px 0 20px; }

.focus-number {
  color: rgba(23, 63, 54, 0.1);
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
}

.micro-action {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 15px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
}

.micro-action > span { color: var(--coral); font-size: 24px; line-height: 1; }
.micro-action small, .micro-action strong { display: block; }
.micro-action small { margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.micro-action strong { font-size: 14px; line-height: 1.45; }

.section-block { margin-bottom: 28px; }
.counter { color: var(--muted); font-size: 13px; font-weight: 800; }

.task-list { display: grid; gap: 10px; }
.task-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
  cursor: pointer;
  transition: 160ms ease;
}

.task-item:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(23,63,54,.06); }
.task-item input { position: absolute; opacity: 0; }
.task-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(23, 63, 54, 0.2);
  border-radius: 10px;
  color: transparent;
  background: #fff;
  font-weight: 900;
  transition: 160ms ease;
}

.task-item.done { color: var(--muted); background: rgba(255, 253, 248, 0.5); }
.task-item.done .task-check { color: #fff; border-color: var(--ink); background: var(--ink); }
.task-item.done .task-copy { text-decoration: line-through; text-decoration-color: rgba(23,63,54,.25); }
.task-copy { font-size: 14px; font-weight: 650; line-height: 1.45; }

.checkin-card { margin-bottom: 18px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sand); }
.status-dot.saved { background: #5b9b72; box-shadow: 0 0 0 5px rgba(91,155,114,.12); }

.checkin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 20px 0;
}

.checkin-grid label {
  padding: 12px 10px;
  border-radius: 14px;
  background: #f5f2eb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.checkin-grid output { display: block; margin: 4px 0; color: var(--ink); font-size: 25px; font-weight: 900; }
input[type="range"] { width: 100%; accent-color: var(--coral); }

.note-field span, .settings-card label, .ask-form label, .onboarding-dialog label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

textarea, input[type="text"], input[type="date"], input[type="search"], .ask-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: 150ms ease;
}

textarea, input[type="text"], input[type="date"] { padding: 12px 13px; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(220,123,98,.12); }

.primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 13px;
  padding: 12px 18px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: 150ms ease;
}

.primary-button:hover { background: var(--ink-2); transform: translateY(-1px); }

.mentor-prompt {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: var(--coral);
  text-align: right;
  box-shadow: 0 16px 35px rgba(220, 123, 98, 0.22);
  cursor: pointer;
}

.mentor-prompt small, .mentor-prompt strong { display: block; }
.mentor-prompt small { color: rgba(255,255,255,.76); }
.mentor-prompt strong { margin-top: 2px; }
.mentor-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--gold);
  font-size: 22px;
  font-weight: 900;
}

.mentor-avatar.large { width: 64px; height: 64px; font-size: 30px; box-shadow: 0 10px 28px rgba(23,63,54,.14); }
.page-heading { padding: 8px 2px 18px; }
.page-heading > p:last-child { max-width: 540px; margin-bottom: 0; }

.plan-progress { margin-bottom: 17px; }
.plan-progress > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.plan-progress strong, .plan-progress span { font-weight: 900; }
.plan-progress > div:first-child span { font-size: 30px; }
.plan-progress small { color: var(--muted); }
.plan-progress p { margin: 12px 0 0; font-size: 13px; }
.progress-track { height: 8px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: var(--sand); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--coral); transition: width 300ms ease; }

.weeks-list { display: grid; gap: 10px; }
.week-card {
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255,253,248,.86);
  overflow: hidden;
}

.week-card summary {
  list-style: none;
  display: grid;
  grid-template-columns: 43px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  cursor: pointer;
}

.week-card summary::-webkit-details-marker { display: none; }
.week-card.current { border-color: rgba(220,123,98,.45); box-shadow: 0 12px 32px rgba(23,63,54,.08); }
.week-card.locked { opacity: .64; }
.week-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--ink);
  background: var(--sand);
  font-weight: 900;
}

.week-card.current .week-badge { color: #fff; background: var(--coral); }
.week-card.completed .week-badge { color: #fff; background: var(--ink); }
.week-summary strong, .week-summary small { display: block; }
.week-summary strong { font-size: 14px; }
.week-summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.week-state { color: var(--muted); font-size: 18px; }
.week-details { padding: 0 18px 18px 70px; }
.week-details p { font-size: 13px; }
.week-details blockquote { margin: 13px 0 0; padding: 11px 14px; border-right: 3px solid var(--gold); color: var(--ink-2); background: var(--gold-soft); font-size: 12px; line-height: 1.6; }

.mentor-hero { display: flex; align-items: center; gap: 16px; padding: 10px 2px 8px; }
.mentor-hero h1 { margin: 0; }
.mentor-hero .eyebrow { margin-bottom: 5px; }
.mentor-intro { margin: 10px 0 20px; }
.quick-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.topic-chip, .filter-chip {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.topic-chip:hover, .topic-chip.active, .filter-chip.active { color: #fff; border-color: var(--ink); background: var(--ink); }
.mentor-answer { min-height: 245px; position: relative; overflow: hidden; }
.mentor-answer::after { content: "✦"; position: absolute; left: 18px; top: 13px; color: rgba(240,195,106,.55); font-size: 34px; }
.mentor-answer h2 { max-width: 80%; }
.mentor-answer > p:not(.eyebrow) { color: var(--ink-2); }
.mentor-next { margin-top: 18px; padding: 13px 14px; border-radius: 14px; color: var(--ink); background: var(--gold-soft); font-size: 13px; font-weight: 750; line-height: 1.55; }
.ask-form { margin-top: 17px; }
.ask-form > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ask-form input { padding: 13px 14px; }
.ask-form button { border: 0; border-radius: 13px; padding: 0 19px; color: #fff; background: var(--coral); font-weight: 800; cursor: pointer; }
.disclaimer { margin: 18px 5px; font-size: 10px; text-align: center; }

.search-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.search-field input { padding: 14px 0; border: 0; background: transparent; box-shadow: none; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding: 13px 0 16px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; padding: 8px 12px; }
.recipe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.recipe-card {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--paper);
}

.recipe-card .recipe-icon { font-size: 24px; }
.recipe-card h3 { margin: 12px 0 8px; font-size: 15px; line-height: 1.35; }
.recipe-card small { color: var(--coral); font-size: 10px; font-weight: 800; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.recipe-tags span { padding: 4px 6px; border-radius: 7px; color: var(--muted); background: #f3efe6; font-size: 9px; }
.empty-state { grid-column: 1 / -1; padding: 40px 10px; color: var(--muted); text-align: center; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 15px; }
.stat { padding: 17px 10px; border-radius: 18px; text-align: center; }
.stat strong, .stat span { display: block; }
.stat strong { margin-bottom: 4px; font-size: 27px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 10px; }
.settings-card h2 { margin-bottom: 20px; }
.settings-card label { margin-bottom: 15px; }
.settings-card label input, .settings-card label textarea { margin-top: 6px; }
.why-card { margin-top: 15px; background: var(--gold-soft); box-shadow: none; }
.why-card blockquote { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.6; }
.danger-link { display: block; margin: 22px auto 0; padding: 8px; border: 0; color: #a25949; background: transparent; font-size: 11px; cursor: pointer; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 50%;
  bottom: 0;
  transform: translateX(50%);
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  color: #829089;
  background: transparent;
  cursor: pointer;
}

.bottom-nav button span, .bottom-nav button small { display: block; }
.bottom-nav button span { margin-bottom: 2px; font-size: 21px; }
.bottom-nav button small { font-size: 10px; font-weight: 750; }
.bottom-nav button.active { color: var(--ink); background: #f0ece2; }
.bottom-nav .mentor-nav { color: var(--coral); }
.bottom-nav .mentor-nav span { font-size: 25px; }

.onboarding-dialog {
  width: min(calc(100% - 28px), 520px);
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 30px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(23,63,54,.24);
}

.onboarding-dialog::backdrop { background: rgba(12,37,31,.72); backdrop-filter: blur(7px); }
.onboarding-dialog form { padding: 28px; overflow-y: auto; }
.onboarding-mark { width: 58px; height: 58px; margin-bottom: 22px; border-radius: 20px 20px 8px 20px; font-size: 31px; }
.onboarding-dialog h1 { font-size: 35px; }
.onboarding-dialog form > p:not(.eyebrow) { margin-bottom: 22px; }
.onboarding-dialog label { margin: 13px 0; }
.onboarding-dialog label input, .onboarding-dialog label textarea { margin-top: 7px; }
.privacy-note { display: block; margin-top: 12px; color: var(--muted); text-align: center; }

.toast {
  position: fixed;
  z-index: 80;
  right: 50%;
  bottom: 90px;
  transform: translate(50%, 20px);
  padding: 11px 17px;
  border-radius: 99px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  font-size: 12px;
  font-weight: 750;
}

.toast.show { opacity: 1; transform: translate(50%, 0); }

@media (min-width: 660px) {
  main { padding-inline: 32px; }
  .topbar { padding-inline: 36px; }
  .hero-card { padding: 30px; }
  .recipe-grid { grid-template-columns: repeat(3, 1fr); }
  .weeks-list { grid-template-columns: repeat(2, 1fr); }
  .week-details { padding-right: 18px; }
}

@media (max-width: 390px) {
  main { padding-inline: 14px; }
  .hero-card { padding: 19px; }
  .progress-ring { width: 66px; height: 66px; flex-basis: 66px; }
  .week-strip { align-items: flex-start; }
  .checkin-grid { grid-template-columns: 1fr; }
  .checkin-grid label { display: grid; grid-template-columns: 65px 28px 1fr; align-items: center; text-align: right; }
  .checkin-grid output { margin: 0; font-size: 18px; }
  .stats-grid { gap: 6px; }
  .stat { padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}


/* ==========================================================================
   ENHANCED STYLES: Water, Tools, Modals, Guides, Timers, Fasting
   ========================================================================== */

/* Topbar enhancements */
.brand-text strong { display: block; font-size: 15px; }
.brand-text small { color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.water-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(23, 63, 54, 0.08);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* Week Navigator Controls */
.nav-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-arrow-btn:hover { background: var(--sand); }
.nav-arrow-btn:active { transform: scale(0.92); }

.week-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  margin: 12px 16px;
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.week-strip-text { flex: 1; text-align: center; }
.week-strip-text strong { display: block; font-size: 15px; color: var(--ink); }

/* Daily Tip Box */
.daily-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(240, 195, 106, 0.2);
  border-right: 3px solid var(--gold);
  font-size: 13px;
  color: var(--ink-2);
}

/* Water Tracker Card */
.water-card {
  margin: 16px;
  padding: 20px;
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.water-amount {
  font-size: 15px;
  font-weight: 800;
  color: #1a73e8;
}
.water-bar-track {
  width: 100%;
  height: 14px;
  background: rgba(26, 115, 232, 0.12);
  border-radius: 999px;
  margin: 14px 0;
  overflow: hidden;
}
.water-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4285f4, #1a73e8);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.water-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.water-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(26, 115, 232, 0.25);
  background: rgba(26, 115, 232, 0.08);
  color: #1a73e8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.water-btn:hover { background: rgba(26, 115, 232, 0.15); }
.water-btn:active { transform: scale(0.97); }
.water-reset-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.water-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Slider helper labels */
.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

/* Mentor enhancements */
.mentor-context-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(23, 63, 54, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.mentor-body-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin: 12px 0;
}
.mentor-protocol {
  margin: 14px 0;
  padding: 12px 16px;
  background: rgba(23, 63, 54, 0.04);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--ink);
}
.mentor-protocol strong { display: block; font-size: 13px; margin-bottom: 6px; }
.mentor-protocol ul { margin: 0; padding-right: 18px; font-size: 13px; line-height: 1.5; }
.mentor-protocol li { margin-bottom: 4px; }
.ask-input-row { display: flex; gap: 8px; margin-top: 6px; }
.ask-input-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
}
.ask-input-row button {
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Tools View */
.tool-card {
  margin: 16px;
  padding: 20px;
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tool-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.tool-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(240, 195, 106, 0.25);
  display: grid;
  place-items: center;
}
.tool-header h2 { margin: 0; font-size: 16px; color: var(--ink); }
.tool-header small { color: var(--muted); font-size: 12px; display: block; }
.tool-instructions { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-bottom: 14px; }

/* Fasting status */
.fasting-status-box {
  background: rgba(23, 63, 54, 0.04);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}
.fasting-state { font-size: 13px; font-weight: 700; color: var(--coral); }
.fasting-countdown { font-size: 32px; font-weight: 900; letter-spacing: 0.03em; color: var(--ink); font-variant-numeric: tabular-nums; margin: 4px 0; }
.fasting-presets { display: flex; gap: 8px; margin-bottom: 12px; justify-content: center; }
.preset-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.preset-chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Timer box */
.timer-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(23, 63, 54, 0.04);
  border-radius: var(--radius-sm);
}
.timer-digits {
  font-size: 32px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.timer-btn { min-width: 140px; }

/* Density / Weight calculation */
.density-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.density-inputs label { font-size: 13px; font-weight: 700; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.density-inputs input, .density-inputs select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
}
.density-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}
.density-result.good {
  background: rgba(46, 125, 50, 0.12);
  border-right: 4px solid #2e7d32;
  color: #1b5e20;
}
.density-result.warn {
  background: rgba(245, 124, 0, 0.12);
  border-right: 4px solid #f57c00;
  color: #e65100;
}
.density-result.alert {
  background: rgba(211, 47, 47, 0.12);
  border-right: 4px solid #d32f2f;
  color: #b71c1c;
}

/* Breathing 4-7-8 Circle */
.breathing-circle-container {
  display: grid;
  place-items: center;
  margin: 20px 0;
}
.breathing-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sage), var(--ink));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  transition: transform 1s ease-in-out, background 1s ease;
  box-shadow: 0 10px 30px rgba(23, 63, 54, 0.2);
}
.breathing-circle.inhale {
  transform: scale(1.4);
  background: radial-gradient(circle, #81c784, var(--ink));
}
.breathing-circle.hold {
  transform: scale(1.4);
  background: radial-gradient(circle, var(--gold), var(--ink));
}
.breathing-circle.exhale {
  transform: scale(0.9);
  background: radial-gradient(circle, var(--coral), var(--ink));
}

/* Sub-tabs */
.view-subtabs {
  display: flex;
  margin: 0 16px 16px;
  background: var(--sand);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
}
.subtab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.subtab-btn.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Guide Cards */
.guide-card {
  margin: 16px;
  padding: 20px;
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.guide-card h2 { font-size: 17px; margin-top: 0; color: var(--ink); }
.pyramid-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pyramid-item {
  padding: 12px 14px;
  background: rgba(23, 63, 54, 0.04);
  border-radius: var(--radius-sm);
  border-right: 4px solid var(--ink);
}
.pyramid-item strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.pyramid-item p { margin: 0 0 6px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.pyramid-item small { color: var(--coral); font-weight: 700; }

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}
.guide-item {
  padding: 10px 14px;
  background: rgba(23, 63, 54, 0.03);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.guide-item strong { font-size: 14px; color: var(--ink); }
.guide-item span { font-size: 12px; color: var(--muted); }

/* Recipe Modal Dialog */
.recipe-modal {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 600px;
  width: 90%;
  background: var(--paper);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}
.recipe-modal::backdrop {
  background: rgba(23, 63, 54, 0.5);
  backdrop-filter: blur(4px);
}
.recipe-modal-content {
  position: relative;
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 16px;
  cursor: pointer;
}
.recipe-modal-header { margin-bottom: 20px; text-align: right; }
.modal-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23, 63, 54, 0.08);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  margin-left: 6px;
}
.modal-density {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(46, 125, 50, 0.15);
  color: #1b5e20;
  font-size: 11px;
  font-weight: 800;
}
.recipe-modal-header h2 { font-size: 22px; margin: 8px 0 4px; color: var(--ink); }
.modal-meta { font-size: 13px; color: var(--muted); }

.modal-section { margin-bottom: 18px; }
.modal-section h3 { font-size: 15px; margin-bottom: 8px; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.modal-section ul, .modal-section ol { margin: 0; padding-right: 20px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.modal-section li { margin-bottom: 6px; }

.modal-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: rgba(240, 195, 106, 0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-2);
}

/* Backup and danger buttons */
.backup-actions { display: flex; gap: 10px; margin-top: 14px; }
.file-upload-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.danger-button {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--coral);
  background: rgba(220, 123, 98, 0.1);
  color: var(--coral);
  font-weight: 700;
  cursor: pointer;
}
.danger-button:hover { background: rgba(220, 123, 98, 0.2); }
