/* ==========================================================================
   Plated — mobile-first app shell.
   Everything is designed for a phone; on desktop it sits in a centred frame.
   ========================================================================== */

:root {
  --coral:      #FF5A36;
  --coral-dark: #E23F1D;
  --coral-soft: #FFE9E3;
  --green:      #16A34A;
  --green-soft: #DCFCE7;
  --amber:      #F59E0B;
  --amber-soft: #FEF3C7;

  /* Ink for text on the -soft backgrounds. These MUST flip with the theme:
     a dark brown on pale amber is correct in light mode and unreadable on the
     dark amber used at night, which is exactly what happened across six
     screens. */
  --amber-ink:  #78350F;
  --red-ink:    #991B1B;
  --green-ink:  #065F46;
  --red:        #DC2626;
  --red-soft:   #FEE2E2;
  --blue:       #2563EB;
  --blue-soft:  #DBEAFE;

  --ink:        #14181F;
  --ink-2:      #444C59;
  --ink-3:      #7A8494;
  --line:       #E9EDF2;
  --card:       #FFFFFF;
  --bg:         #F6F7F9;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --shadow:    0 1px 2px rgba(20,24,31,.04), 0 4px 16px rgba(20,24,31,.06);
  --shadow-lg: 0 8px 32px rgba(20,24,31,.12);

  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F2F5F9; --ink-2: #AAB4C2; --ink-3: #7C8798;
    --line: #262C36; --card: #171C24; --bg: #0E1218;
    --coral-soft: #3A1A12; --green-soft: #10301E; --amber-soft: #3A2A08;
    --red-soft: #3A1414; --blue-soft: #13223F;
    --amber-ink: #FCD34D; --red-ink: #FCA5A5; --green-ink: #6EE7B7;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

/* On desktop, pin the app into a phone-shaped frame so it always reads
   as an app rather than a website that got narrow. */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
}

/* Only the phone-framed app gets the dark surround — the landing page is a
   full-width site and must keep its own background. */
@media (min-width: 560px) {
  body[data-shell="app"] { background: #0E1218; }
  body[data-shell="app"] .app {
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 80px rgba(0,0,0,.5);
  }
}

/* ------------------------------------------------------------- typography -- */

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p  { margin: 0 0 12px; color: var(--ink-2); }
a  { color: var(--coral); text-decoration: none; }

.muted     { color: var(--ink-3); }
.small     { font-size: 13px; }
.tiny      { font-size: 11px; }
.bold      { font-weight: 700; }
.center    { text-align: center; }
.num       { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.eyebrow   { font-size: 11px; font-weight: 800; letter-spacing: .1em;
             text-transform: uppercase; color: var(--ink-3); }

/* ---------------------------------------------------------------- layout -- */

.pad     { padding: 0 18px; }
.stack   { display: flex; flex-direction: column; gap: 14px; }
.row     { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap    { flex-wrap: wrap; }
.grow    { flex: 1; min-width: 0; }
.gap-sm  { gap: 8px; }
.mt      { margin-top: 18px; }
.mb      { margin-bottom: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------------------------------------------------------------- header -- */

.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar h1 { font-size: 22px; }
.appbar .sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--coral), #FF9330);
  color: #fff; font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}

.back {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); font-size: 18px;
}

/* ----------------------------------------------------------------- cards -- */

.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.tight  { padding: 14px; }
.card.flush  { padding: 0; overflow: hidden; }

.hero {
  background: linear-gradient(150deg, var(--coral) 0%, #FF8A3D 55%, #FFB03A 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(255,90,54,.28);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: auto -30% -60% auto;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.hero * { position: relative; z-index: 1; }
.hero p, .hero .muted { color: rgba(255,255,255,.85); }

/* ----------------------------------------------------------------- pills -- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  background: var(--line); color: var(--ink-2);
  white-space: nowrap;
}
.pill.ok   { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber-ink); }
.pill.bad  { background: var(--red-soft);   color: var(--red); }
.pill.info { background: var(--blue-soft);  color: var(--blue); }

/* --------------------------------------------------------------- buttons -- */

.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 14px 20px; border-radius: 999px;
  background: var(--coral); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, filter .12s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.97); filter: brightness(.94); }
.btn.block  { display: flex; width: 100%; }
.btn.ghost  { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.dark   { background: var(--ink); color: var(--bg); }
.btn.sm     { padding: 9px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chip {
  border: 1px solid var(--line); background: var(--card);
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; font-family: inherit;
}
.chip[aria-pressed="true"], .chip.on {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}

.scroller {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 18px 2px; margin: 0 -18px;
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; }

/* ---------------------------------------------------------------- inputs -- */

label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--ink-2); margin-bottom: 6px;
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; font-family: inherit; font-size: 16px;   /* 16px stops iOS zoom */
  padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
/* Safari/Chrome give search fields their own UA chrome — strip it or the
   field renders as a white pill and ignores the dark theme entirely. */
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button,
input[type=search]::-webkit-search-results-button { -webkit-appearance: none; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-soft);
}
textarea { min-height: 90px; resize: vertical; }

.seg {
  display: flex; background: var(--line); border-radius: var(--r);
  padding: 3px; gap: 3px;
}
.seg input { display: none; }
.seg label {
  flex: 1; text-align: center; padding: 10px 6px;
  border-radius: 12px; font-size: 13px; font-weight: 700;
  color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.seg input:checked + label { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

input[type=range] {
  width: 100%; height: 32px; background: transparent; appearance: none;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px; background: var(--line);
}
input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 28px; height: 28px; margin-top: -10px;
  border-radius: 50%; background: var(--coral); border: 3px solid var(--card);
  box-shadow: var(--shadow);
}
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: var(--line); }
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--coral); border: 3px solid var(--card);
}

/* ------------------------------------------------------------ tab bar ----- */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  max-width: 480px; margin: 0 auto;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-3); font-size: 10px; font-weight: 700;
  text-decoration: none; position: relative;
}
.tabbar a .ico { font-size: 21px; line-height: 1; transition: transform .18s; }
.tabbar a.on { color: var(--coral); }
.tabbar a.on .ico { transform: translateY(-2px) scale(1.08); }
.tabbar a:active .ico { transform: scale(.88); }

/* The centre action button sits proud of the bar. */
.tabbar a.fab .ico {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(140deg, var(--coral), #FF8A3D);
  color: #fff; display: grid; place-items: center;
  margin-top: -18px; font-size: 26px; font-weight: 400;
  box-shadow: 0 6px 18px rgba(255,90,54,.42);
}
.tabbar a.fab.on .ico { transform: none; }

/* ------------------------------------------------------------ progress ---- */

.ring { display: block; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--line); }
.ring .fill {
  stroke: var(--coral);
  transition: stroke-dashoffset 1.1s cubic-bezier(.22,1,.36,1);
}
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-wrap .inner {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; line-height: 1.15;
}

.bar {
  height: 9px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.bar > i {
  display: block; height: 100%; border-radius: 999px; width: 0;
  background: var(--coral);
  transition: width 1s cubic-bezier(.22,1,.36,1);
}
.bar.green > i { background: var(--green); }
.bar.blue  > i { background: var(--blue); }
.bar.amber > i { background: var(--amber); }

/* --------------------------------------------------- weekly bar chart ----- */

/* The stem zone is a fixed height so the target line can be positioned
   against it in plain percentages. Value labels sit above it, day labels
   below — neither eats into the zone. */
.weekchart {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
}
.weekchart .col {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
/* The stem is absolutely positioned against the fixed-height zone. Percentage
   heights on a flex item are unreliable here — Chrome stretches a 0%-height
   item back to its content size — so we take flex out of the equation. */
.weekchart .zone { position: relative; height: 120px; width: 100%; }
.weekchart .stem {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 30px; height: 0;
  border-radius: 8px 8px 4px 4px;
  background: var(--line);
  transition: height .9s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}
.weekchart .stem > i {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, var(--coral), #FF9330);
}
.weekchart .stem.over > i { background: linear-gradient(180deg, var(--red), #F87171); }
.weekchart .stem.under > i { background: linear-gradient(180deg, var(--green), #4ADE80); }
.weekchart .zone::after {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 30px; height: 3px;
  transform: translateX(-50%); border-radius: 2px; background: var(--line);
}
.weekchart .lbl { font-size: 10px; font-weight: 700; color: var(--ink-3); }
.weekchart .col.today .lbl { color: var(--coral); }

/* Target line drawn across the stem zone. The frame is inset from the top so
   its 0–100% range lines up exactly with the 120px stem zone below the value
   labels. */
.chart-frame { position: relative; }
.chart-frame .target-zone {
  position: absolute; left: 0; right: 0; bottom: 22px; height: 120px;
  pointer-events: none;
}
.chart-frame .target-line {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 2px dashed color-mix(in srgb, var(--ink-3) 55%, transparent);
}
.chart-frame .target-line span {
  position: absolute; right: 0; top: -14px;
  font-size: 9px; font-weight: 800; color: var(--ink-3);
  background: var(--card); padding: 0 4px; border-radius: 4px;
}

/* ------------------------------------------------------ monthly heatmap --- */

.heat {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
}
.heat .cell {
  aspect-ratio: 1; border-radius: 7px; background: var(--line);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: var(--ink-3);
  opacity: 0; transform: scale(.6);
  animation: pop .35s cubic-bezier(.34,1.56,.64,1) forwards;
}
.heat .cell.blank { background: transparent; animation: none; opacity: 1; transform: none; }
.heat .cell.hit-1 { background: color-mix(in srgb, var(--green) 22%, var(--card)); color: var(--green); }
.heat .cell.hit-2 { background: color-mix(in srgb, var(--green) 48%, var(--card)); color: #fff; }
.heat .cell.hit-3 { background: var(--green); color: #fff; }
.heat .cell.miss  { background: var(--red-soft); color: var(--red); }
.heat .cell.today { box-shadow: 0 0 0 2px var(--coral); }

@keyframes pop { to { opacity: 1; transform: scale(1); } }

.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--ink-3); }
.heat-legend i { width: 12px; height: 12px; border-radius: 4px; display: block; }

/* ------------------------------------------------------------- list rows -- */

.list { display: flex; flex-direction: column; }
.list .item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.list .item:last-child { border-bottom: 0; }
.list .item:active { background: var(--bg); }
.list .item .ico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 19px;
  background: var(--bg);
}

/* ------------------------------------------------------------- counters --- */

.stat { text-align: center; }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat .k { font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* --------------------------------------------------------------- water ---- */

.glasses { display: flex; flex-wrap: wrap; gap: 7px; }
.glass {
  width: 34px; height: 42px; border-radius: 5px 5px 12px 12px;
  border: 2px solid var(--blue); background: transparent;
  position: relative; overflow: hidden; cursor: pointer; flex-shrink: 0;
  transition: transform .12s;
}
.glass:active { transform: scale(.9); }
.glass i {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(180deg, #60A5FA, var(--blue));
  transition: height .4s cubic-bezier(.22,1,.36,1);
}
.glass.full i { height: 100%; }

/* --------------------------------------------------------------- flash ---- */

.flash {
  padding: 12px 16px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  background: var(--green-soft); color: var(--green); margin-bottom: 14px;
}
.flash.err { background: var(--red-soft); color: var(--red); }

/* ---------------------------------------------------------------- misc ---- */

.divider { height: 1px; background: var(--line); margin: 6px 0; }

.empty {
  text-align: center; padding: 34px 20px; color: var(--ink-3);
}
.empty .big { font-size: 42px; margin-bottom: 8px; }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sheet-backdrop.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 61;
  max-width: 480px; margin: 0 auto;
  background: var(--card); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 18px calc(24px + var(--safe-b));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.22,1,.36,1);
  max-height: 86dvh; overflow-y: auto;
}
.sheet.on { transform: translateY(0); }
.sheet .grabber {
  width: 40px; height: 4px; border-radius: 999px; background: var(--line);
  margin: 6px auto 14px;
}

.confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 90;
}

/* Reveal-on-load for cards, staggered by JS. */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .45s ease, transform .45s cubic-bezier(.22,1,.36,1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Landing page. The only screen a signed-out visitor sees, so it breaks out
   of the 480px app frame and reads as a normal responsive site.
   ========================================================================== */

.site {
  max-width: 100%;
  background: var(--bg);
  color: var(--ink);
}

/* -------------------------------------------------------------- nav ----- */
.lp-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.lp-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; color: var(--ink);
  letter-spacing: -.02em; text-decoration: none;
}
.lp-logo { font-size: 22px; }
.lp-navlinks { display: flex; align-items: center; gap: 20px; }
.lp-navlinks a { color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.lp-navlinks a:hover { color: var(--ink); }
.lp-navlinks a.btn { color: #fff; }
@media (max-width: 560px) {
  .lp-navlinks a:not(.btn) { display: none; }
}

/* ------------------------------------------------------------- hero ----- */
.lp-hero {
  max-width: 780px; margin: 0 auto;
  padding: 56px 20px 40px; text-align: center;
}
.lp-hero h1 {
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.1; letter-spacing: -.03em;
  margin: 18px 0 0;
}
.lp-hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--coral), #FF9330);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-lede {
  font-size: clamp(15px, 2.2vw, 18px); line-height: 1.6;
  color: var(--ink-2); max-width: 580px; margin: 18px auto 0;
}
.lp-cta {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin-top: 26px;
}
.lp-cta .btn { padding: 15px 26px; font-size: 15px; }

.lp-stats {
  display: flex; justify-content: center; gap: 14px;
  flex-wrap: wrap; margin-top: 40px;
}
.lp-stats > div {
  background: var(--card); border-radius: var(--r-lg);
  padding: 18px 26px; box-shadow: var(--shadow); min-width: 130px;
}
.lp-stats strong {
  display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em;
}
.lp-stats span { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ---------------------------------------------------------- sections ---- */
.lp-section { padding: 56px 20px; max-width: 1040px; margin: 0 auto; }
.lp-section.alt {
  background: var(--card); max-width: 100%;
  border-block: 1px solid var(--line);
}
.lp-section.alt > * { max-width: 1040px; margin-inline: auto; }
.lp-section h2 {
  font-size: clamp(24px, 4vw, 34px); letter-spacing: -.02em; text-align: center;
}
.lp-sub {
  text-align: center; color: var(--ink-2); max-width: 620px;
  margin: 12px auto 0; font-size: 15px; line-height: 1.6;
}

/* ------------------------------------------------------------- grid ----- */
.lp-grid {
  display: grid; gap: 16px; margin-top: 34px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.lp-card {
  background: var(--card); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.lp-section.alt .lp-card { background: var(--bg); }
.lp-icon { font-size: 30px; line-height: 1; }
.lp-card h3 { font-size: 17px; margin: 12px 0 8px; }
.lp-card p { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; }

/* ------------------------------------------------------------ table ----- */
.lp-table-wrap { overflow-x: auto; margin-top: 30px; }
.lp-table {
  width: 100%; border-collapse: collapse; min-width: 520px;
  background: var(--bg); border-radius: var(--r); overflow: hidden;
}
.lp-table th {
  text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.lp-table td {
  padding: 14px 16px; font-size: 14px;
  border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.lp-table tr:last-child td { border-bottom: 0; }
.lp-table td strong { color: var(--ink); display: block; }
.lp-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; color: var(--ink); }
.lp-cat { font-size: 11px; color: var(--ink-3); }

.lp-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }

/* ------------------------------------------------------------ steps ----- */
.lp-steps {
  max-width: 640px; margin: 30px auto 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.lp-steps li { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.lp-steps strong { color: var(--ink); }
.lp-note {
  max-width: 640px; margin: 26px auto 0; padding: 16px 18px;
  background: var(--amber-soft); border-radius: var(--r);
  font-size: 13px; line-height: 1.6; color: #78350F;
}
@media (prefers-color-scheme: dark) { .lp-note { color: #FCD34D; } }

/* -------------------------------------------------------------- faq ----- */
.lp-faq { max-width: 700px; margin: 30px auto 0; }
.lp-faq details {
  background: var(--bg); border-radius: var(--r);
  padding: 16px 18px; margin-bottom: 10px; border: 1px solid var(--line);
}
.lp-faq summary {
  font-weight: 700; font-size: 15px; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: '+'; font-size: 20px; color: var(--ink-3); font-weight: 400; }
.lp-faq details[open] summary::after { content: '−'; }
.lp-faq p { margin: 12px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink-2); }

/* ------------------------------------------------------- final + footer -- */
.lp-final {
  text-align: center; padding: 64px 20px;
  background: linear-gradient(150deg, var(--coral) 0%, #FF8A3D 55%, #FFB03A 100%);
  color: #fff;
}
.lp-final h2 { font-size: clamp(22px, 4vw, 32px); letter-spacing: -.02em; max-width: 620px; margin: 0 auto; }
.lp-final p { color: rgba(255,255,255,.9); margin: 14px 0 0; }
.lp-final .btn { background: #fff; color: var(--coral); }
.lp-final .btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }

.lp-footer { text-align: center; padding: 36px 20px 48px; background: var(--card); }
.lp-footer p { margin: 0 0 8px; font-size: 14px; }
.lp-footer a { color: var(--coral); }

/* ------------------------------------------------------------ recipe steps -- */
ol.steps {
  margin: 0; padding: 0; list-style: none;
  counter-reset: step;
  display: flex; flex-direction: column; gap: 12px;
}
ol.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 26px 1fr; gap: 12px;
  font-size: 14px; line-height: 1.55; color: var(--ink-2);
}
ol.steps li::before {
  content: counter(step);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--coral-soft); color: var(--coral);
  font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}

/* ------------------------------------------------------------ taste picker -- */
.taste-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.taste {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--r);
  border: 1.5px solid var(--line); background: var(--bg);
  cursor: pointer; transition: border-color .15s, background .15s;
  position: relative;
}
.taste input { position: absolute; opacity: 0; pointer-events: none; }
.taste .t-ico  { font-size: 17px; flex: 0 0 auto; }
.taste .t-name { font-size: 13px; font-weight: 600; line-height: 1.25; flex: 1; min-width: 0; }
.taste .t-kcal { font-size: 11px; color: var(--ink-3); flex: 0 0 auto; }
.taste.on {
  border-color: var(--coral);
  background: var(--coral-soft);
}
.taste.on .t-name { color: var(--coral-dark); }
.taste.on::after {
  content: '✓'; position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--coral); color: #fff;
  font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
@media (prefers-color-scheme: dark) { .taste.on .t-name { color: #FFB4A0; } }

/* ── plan checklist ───────────────────────────────────────────────────────
   Ticking a planned dish is a one-tap confirmation, not a form. The portion
   picker still exists for "I had something else", where the app genuinely
   does not know what or how much. */
.tickbox {
  width: 30px; height: 30px; flex: 0 0 auto;
  border: 2px solid var(--line); border-radius: 50%;
  background: transparent; color: transparent;
  font-size: 15px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.tickbox:hover  { border-color: var(--green); }
.tickbox:active { transform: scale(.9); }
.tickbox.on {
  background: var(--green); border-color: var(--green); color: #fff;
}
.item.done .bold.small a,
.item.done .bold.small { text-decoration: line-through; opacity: .55; }
.item.done .tiny        { opacity: .55; }
.item.done .num         { opacity: .55; }
