/* Fiber website. One stylesheet, no framework, no build step.
   Two looks, like the app, from one set of tokens:
     light  the app's main look (LightLook.swift): a warm cream page, white cards, a peach accent,
            dark brown ink. Every visitor starts here.
     dark   the app's Dark mode (AccentPalette.swift, AppTheme.swift): "Calm Night" with one matcha
            accent. <html data-theme="dark">, set by the switch in the header (site.js) and kept in
            the browser's local storage, so it is still dark on the next visit.
   ONE accent and ONE error color per look. No other hues, and no gradients on fills.

   TO CHANGE A COLOR: edit the token in the look's block below. Nothing further down names a color,
   except the camera (black in both looks, as in the app) and the phone's titanium band. */

:root {
    /* ---- Light: LightLook.main, value for value. ---- */
    --accent: #FF9B7B;
    --bg: #FFF6EE;
    /* Cards. */
    --surface: #FFFFFF;
    /* Things that float over the page or a card (the tab pill, a toast, a menu). */
    --raised: #FFFFFF;
    /* A block inside a card: the page color again, as the app does inside its white pills. */
    --inset: #FFF6EE;
    --surface-hover: #FFFBF7;
    /* Tracks and empty bars. */
    --fill: #F2DBCA;
    --line: #EAD5C6;
    /* The hairline round a white thing on the cream page (AppTheme hairlineOverlay). */
    --edge: #DFC7B6;
    --text: #2B1B14;
    --text-2: #6E564A;
    --text-3: #9B8172;
    /* Sentences in the quiet tone. The app's text-3 is 3.4:1 on cream, fine for a label in an app,
       too faint for a line of small print on a web page: this is halfway to text-2, 4.6:1. */
    --text-quiet: #846B5E;
    /* The one signal color: form validation only. */
    --error: #B8432F;

    --accent-hover: #F78C6E;
    --accent-press: #EE7A5C;
    --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
    --accent-line: var(--accent);
    /* The accent as small text or a thin icon. Peach on cream is 2:1, so small accent text is this
       deeper coral (LightLook.accentText, 4.5:1). Peach itself is for fills and big headlines. */
    --accent-text: #C4492A;
    --link-hover: #9E3A20;
    --on-accent: #3A1608;
    --focus: #C4492A;
    /* A line or small mark the dark look draws in its accent: the ink on paper (AppTheme mark). */
    --mark: var(--text);
    /* Search fields: white with a hairline on paper, the track at night. */
    --field: var(--surface);
    --field-edge: var(--edge);
    /* The picked half of a two-way switch drawn inside a card. */
    --seg-on: var(--surface);
    /* The second half of a split card (the calculator's answer): white with a rule on paper. */
    --panel: var(--surface);
    --panel-line: var(--line);
    --knob: #FFFFFF;
    /* Faint to strong, for the weekly bars. */
    --ramp-1: #FFCDB9;
    --ramp-2: #FFBBA2;
    --ramp-3: #FFAA8D;
    --ramp-4: #FF9B7B;
    --ramp-5: #EC6B49;
    /* Shadows are the app's warm brown (LightLook.shadow), never grey. */
    --float-shadow: 0 18px 40px -18px rgba(107, 63, 44, 0.32);
    --phone-shadow: 0 40px 70px -30px rgba(107, 63, 44, 0.5);
    --thumb-shadow: 0 0 0 1px #DFC7B6, 0 2px 6px rgba(107, 63, 44, 0.3);
    /* The finger in the hero: a shade on paper, a light at night. */
    --touch: rgba(43, 27, 20, 0.16);
    --touch-edge: rgba(43, 27, 20, 0.14);
    /* In the phone: iOS's own clock and home bar, the frame, a waiting button's label, and the
       picked Today tab (AppTabBar.colors: one accent; the ring inside its disc is the card's
       white on paper, the accent's paler step at night). */
    --ios-ink: #000000;
    --titanium: linear-gradient(150deg, #d8d4ce, #a7a29b 38%, #cdc8c1 62%, #918c85);
    --wait-ink: color-mix(in srgb, var(--text) 38%, transparent);
    --tab-disc: var(--accent);
    --tab-ring: var(--surface);

    /* The bean in this look, drawn by the app (img/, made by scripts/make-images.py): light green
       on paper, pale matcha at night. The app icon (the bean on cream) is the same in both looks,
       as on the phone's home screen. */
    --bean: url("/img/bean-light.png");
    --bean-awake: url("/img/bean-awake-light.png");
    --bean-asleep: url("/img/bean-asleep-light.png");
    --faces: url("/img/faces-light.png");
    --cast: url("/img/cast-light.png");
    --icon: url("/img/icon.png");

    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius: 24px;
    --radius-sm: 14px;
    --gutter: 24px;
    --section: 136px;

    /* Motion (stageshow): travel, and arrival from nowhere. */
    --ease-travel: cubic-bezier(0.45, 0, 0.1, 1);
    --ease-arrive: cubic-bezier(0.25, 0.8, 0.25, 1);
    --ease-ui: cubic-bezier(0.3, 0.75, 0.1, 1);

    color-scheme: light;
}

/* ---- Dark: Calm Night neutrals (AppTheme.Colors) and matcha (AccentPalette.matcha). ---- */
:root[data-theme="dark"] {
    --accent: #A9DB8C;
    --bg: #0F1417;
    --surface: #161D22;
    --raised: #1C252B;
    --inset: #1C252B;
    --surface-hover: #1C252B;
    --fill: #253038;
    --line: #253038;
    --edge: rgba(255, 255, 255, 0.06);
    --text: #E6ECEF;
    --text-2: #B7C2C8;
    --text-3: #85959F;
    --text-quiet: #85959F;
    --error: #D07A7A;

    --accent-hover: color-mix(in oklab, var(--accent) 84%, white);
    --accent-press: color-mix(in oklab, var(--accent) 86%, black);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
    --accent-text: color-mix(in oklab, var(--accent) 88%, white);
    --link-hover: var(--accent-hover);
    --on-accent: #0C1808;
    --focus: color-mix(in srgb, var(--accent) 75%, transparent);
    --mark: var(--accent);
    --field: var(--fill);
    --field-edge: transparent;
    --seg-on: var(--raised);
    --panel: var(--raised);
    --panel-line: transparent;
    --knob: var(--text);
    /* The app's ramp: the accent mixed toward the #253038 track at 42, 56, 70, 85 and 100%. */
    --ramp-1: color-mix(in srgb, var(--accent) 42%, var(--fill));
    --ramp-2: color-mix(in srgb, var(--accent) 56%, var(--fill));
    --ramp-3: color-mix(in srgb, var(--accent) 70%, var(--fill));
    --ramp-4: color-mix(in srgb, var(--accent) 85%, var(--fill));
    --ramp-5: var(--accent);
    --float-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.7);
    --phone-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.6);
    --thumb-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    --touch: rgba(255, 255, 255, 0.34);
    --touch-edge: rgba(255, 255, 255, 0.4);
    --ios-ink: #FFFFFF;
    --titanium: linear-gradient(150deg, #4a4c50, #232427 38%, #3a3b3f 62%, #1d1e21);
    --wait-ink: color-mix(in srgb, var(--accent) 50%, transparent);
    /* AppTheme.Colors.accentHighlight. */
    --tab-disc: #D8F2C4;
    --tab-ring: var(--accent);

    --bean: url("/img/bean-dark.png");
    --bean-awake: url("/img/bean-awake-dark.png");
    --bean-asleep: url("/img/bean-asleep-dark.png");
    --faces: url("/img/faces-dark.png");
    --cast: url("/img/cast-dark.png");

    color-scheme: dark;
}

@media (max-width: 720px) {
    :root { --gutter: 20px; --section: 96px; --radius: 22px; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, .serif {
    font-family: var(--serif);
    font-optical-sizing: auto;
    color: var(--text);
    margin: 0;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.6rem, 1.7rem + 3.3vw, 4.4rem);
    font-weight: 580;
    line-height: 1.04;
    letter-spacing: -0.018em;
}

h2 {
    font-size: clamp(2.05rem, 1.55rem + 1.9vw, 3.1rem);
    font-weight: 580;
    line-height: 1.08;
    letter-spacing: -0.012em;
}

h3 {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection { background: var(--accent-soft); color: var(--text); }

.ico {
    width: 20px;
    height: 20px;
    flex: none;
}

.approx {
    font-family: var(--sans);
    font-weight: 400;
    color: var(--text-3);
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section { padding-block: var(--section); }

.section-head {
    max-width: 720px;
    margin-bottom: 64px;
}
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { margin-top: 18px; }

.lead {
    font-size: 1.1875rem;
    line-height: 1.55;
    color: var(--text-2);
}

.muted { color: var(--text-quiet); }

/* ---------- Buttons and links ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 28px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--sans);
    font-size: 1.0625rem;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms var(--ease-ui);
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { background: var(--accent-press); transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-quiet {
    background: var(--raised);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--edge);
}
.btn-quiet:hover { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--text-3); }
.btn-quiet:active { background: var(--fill); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-text);
}
.link-arrow .ico { width: 18px; height: 18px; transition: transform 220ms var(--ease-ui); }
.link-arrow:hover .ico { transform: translateX(3px); }

/* ---------- Nav ---------- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease;
}
.site-nav[data-scrolled] { border-bottom-color: var(--line); }

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 72px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}
.logo:hover { color: var(--text); }
.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--icon) center / cover no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    flex: none;
}
.logo-text {
    font-family: var(--serif);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.nav-link {
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-2);
    font-size: 0.9688rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); }
.nav-cta {
    margin-left: 10px;
    min-height: 42px;
    padding: 0 20px;
    font-size: 0.9688rem;
}

/* The look switch: one small round button at the end of the header, a moon on paper and a sun
   at night. site.js wires it; with no JavaScript it isn't shown (html.js), since it could do nothing. */
.theme-btn {
    display: none;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    margin-left: -8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge);
    color: var(--text-2);
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}
.js .theme-btn { display: grid; }
.theme-btn:hover { color: var(--text); }
.theme-btn svg { grid-area: 1 / 1; width: 19px; height: 19px; transition: opacity 200ms ease, transform 320ms var(--ease-ui); }
.theme-btn .sun { opacity: 0; transform: rotate(-40deg) scale(0.7); }
[data-theme="dark"] .theme-btn .sun { opacity: 1; transform: none; }
[data-theme="dark"] .theme-btn .moon { opacity: 0; transform: rotate(40deg) scale(0.7); }

.menu-btn {
    display: none;
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge);
    color: var(--text);
    cursor: pointer;
    position: relative;
}
.menu-btn span {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 260ms var(--ease-ui);
}
.menu-btn span:nth-child(1) { top: 17px; }
.menu-btn span:nth-child(2) { top: 25px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 900px) {
    .menu-btn { display: block; }
    .nav-content { gap: 10px; }
    .theme-btn { width: 44px; height: 44px; margin-left: auto; }
    .nav-menu {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px var(--gutter) 24px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        margin-left: 0;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 200ms ease, transform 260ms var(--ease-ui), visibility 0s linear 260ms;
    }
    .nav-menu.open {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity 200ms ease, transform 260ms var(--ease-ui), visibility 0s;
    }
    .nav-link { padding: 14px 4px; font-size: 1.0625rem; border-bottom: 1px solid var(--line); border-radius: 0; }
    .nav-cta { margin: 16px 0 0; min-height: 52px; }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    padding-top: 56px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 64px;
    align-items: center;
}

.hero-copy { padding-bottom: 24px; max-width: 600px; }
.hero-copy .lead { margin-top: 24px; max-width: 520px; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 28px;
    margin-top: 40px;
}

/* The whole phone stands in the hero: the bottom row, with the round button in it, is where
   every log starts, so nothing of the phone is cropped. */
.hero-visual {
    --s: 0.8;
    position: relative;
    padding: 0 6px;
}

@media (max-width: 960px) {
    .hero { padding-top: 40px; }
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero-copy { padding-bottom: 0; }
    .hero-visual { justify-self: center; }
}
@media (max-width: 720px) {
    .hero-visual { --s: 0.72; }
    .hero-actions { gap: 18px 24px; margin-top: 32px; }
}
@media (max-width: 360px) {
    .hero-visual { --s: 0.66; }
}
/* A short laptop window: a smaller phone, so the bottom row is still on the first screen. */
@media (min-width: 961px) and (max-height: 860px) {
    .hero-visual { --s: 0.72; }
}
@media (min-width: 961px) and (max-height: 780px) {
    .hero-visual { --s: 0.66; }
}

/* ---------- The phone (an iPhone 17 Pro screen, 402 x 874 pt, scaled as a whole) ----------
   Drawn from the app's own screens in both looks (captured with fiber_app/scripts/screens.sh,
   -debugScheme light|dark): every size below is a point on that screen. */

.phone {
    --s: inherit;
    --bezel: calc(11px * var(--s));
    position: relative;
    width: calc(402px * var(--s) + 2 * var(--bezel) + 4px);
    padding: 2px;
    border-radius: calc(64px * var(--s) + var(--bezel) + 2px);
    /* The one gradient on the site: the phone's titanium band. */
    background: var(--titanium);
    box-shadow: var(--phone-shadow);
}
.phone-glass {
    padding: var(--bezel);
    border-radius: calc(64px * var(--s) + var(--bezel));
    background: #050607;
}
.phone-window {
    position: relative;
    width: calc(402px * var(--s));
    height: calc(874px * var(--s));
    border-radius: calc(62px * var(--s));
    overflow: hidden;
    isolation: isolate;
}
.screen {
    position: absolute;
    left: 0;
    top: 0;
    width: 402px;
    height: 874px;
    transform: scale(var(--s));
    transform-origin: 0 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    letter-spacing: -0.01em;
}

/* The clock and the glyphs are iOS's own: black on paper, white at night and over the camera. */
.sb { position: absolute; inset: 0 0 auto 0; height: 62px; z-index: 4; color: var(--ios-ink); transition: color 240ms ease; }
.phone[data-beat~="cam"]:not([data-beat~="naming"]) .sb { color: #fff; }
.sb-time {
    position: absolute;
    top: 21.5px;
    left: 0;
    width: 138.5px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    line-height: 22px;
    letter-spacing: -0.02em;
}
.sb-glyphs {
    position: absolute;
    top: 25.33px;
    left: 285.25px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.sb-glyphs svg { display: block; fill: currentColor; }
.sb-glyphs .sig { margin-top: 1px; }
.island {
    position: absolute;
    top: 11px;
    left: 50%;
    z-index: 5;
    width: 124px;
    height: 37px;
    border-radius: 18.5px;
    background: #000;
    transform: translateX(-50%);
}

/* Today (TodayView.swift): 24 pt gutters; the gear on the left of the centered weekday; the
   ring, 176 pt across the middle of its 16 pt line (the small ring: the check-in is always on
   Today), with the bean seated on top; "Add food"; the stomach check-in; then Today's foods.
   SF text sits on its natural line (17 on 20, 15 on 18, 13 on 16). */
.app { position: absolute; inset: 0; padding: 78px 24px 0; }

.app-head { position: relative; height: 44px; }
.app-title {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 580;
    line-height: 44px;
    letter-spacing: -0.01em;
    text-align: center;
}
.app-gear {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-2);
}
.app-gear svg { width: 20px; height: 20px; }

.ring-wrap {
    position: relative;
    width: 192px;
    height: 192px;
    margin: 42px auto 0;
}
.ring { width: 192px; height: 192px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 16; }
.ring-track { stroke: var(--fill); }
/* One flat accent with round ends, in both looks (RingArc.swift). */
.ring-fill {
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-dasharray: 552.9 552.9;
    stroke-dashoffset: 0.1;
    transition: stroke-dashoffset 1400ms var(--ease-arrive);
}
.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.ring-num {
    display: flex;
    align-items: baseline;
    font-family: var(--serif);
    font-size: 56px;
    font-weight: 560;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-top: -6px;
}
.ring-num .approx { font-size: 26px; margin-right: 3px; letter-spacing: 0; }
.ring-of { margin-top: 0; font-size: 15px; color: var(--text-3); line-height: 18px; }
/* An empty day shows a plain 0: no fill and no "≈" until the first food lands. */
.app .ring-fill { stroke-dashoffset: 321.8; }
.ring-num .approx { transition: opacity 320ms ease 240ms; }
.phone[data-beat~="empty"] .app .ring-fill { opacity: 0; }
.phone[data-beat~="empty"] .ring-num .approx { opacity: 0; transition: none; }

/* The bean on the ring is the day's mood (TodayView ringBean): asleep with nothing logged,
   awake once she has, and it hops once at each log. The app's own drawing in each look. */
.ring-bean {
    position: absolute;
    left: 50%;
    top: -17px;
    width: 36.2px;
    height: 32.1px;
    margin-left: -18.1px;
}
.ring-bean i {
    position: absolute;
    inset: 0;
    background: var(--bean-awake) center / contain no-repeat;
    transition: opacity 260ms ease;
}
.ring-bean .asleep { background-image: var(--bean-asleep); opacity: 0; }
.phone[data-beat~="empty"] .ring-bean .asleep { opacity: 1; }
.phone[data-beat~="empty"] .ring-bean .awake { opacity: 0; }
.js-motion .phone:not([data-beat~="empty"]):not(.no-anim) .ring-bean { animation: bean-hop 620ms var(--ease-ui) 120ms 1 both; }
@keyframes bean-hop {
    0% { transform: none; }
    38% { transform: translateY(-9px); }
    100% { transform: none; }
}

/* "Add food", in words, under the ring: the round button is the camera. */
.add-food {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 60px;
    margin-top: 16px;
    border-radius: 30px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge);
    font-size: 17px;
    font-weight: 600;
    line-height: 20px;
}
.add-food .plus {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
}
.add-food .plus svg { width: 16px; height: 16px; stroke-width: 3; }

/* Rolling text and digits (site.js Roll): the changed part slides, the rest stays. */
.roll {
    display: inline-grid;
    vertical-align: bottom;
    overflow: hidden;
    /* The box reaches 0.22em past the line on both sides and fades only there, so text at
       rest is never masked; moving text fades as it leaves and enters. */
    padding: 0.22em 0;
    margin: -0.22em 0;
    -webkit-mask-image: linear-gradient(transparent, #000 0.22em, #000 calc(100% - 0.22em), transparent);
    mask-image: linear-gradient(transparent, #000 0.22em, #000 calc(100% - 0.22em), transparent);
    transition: width 520ms var(--ease-ui);
}
.roll > span {
    grid-area: 1 / 1;
    white-space: nowrap;
    transition: transform 520ms var(--ease-ui), opacity 380ms ease;
}
.roll > .roll-out { transform: translateY(-80%); opacity: 0; }
.roll > .roll-in-start { transform: translateY(80%); opacity: 0; transition: none; }

/* Today's foods. Before her first photo the app shows one card, "Scan your first meal"
   (FirstScanCard); after it, the meal is one row with its photo (TodayMealRow): a hairline
   above and below, the picture, the name over "3 foods · 9:41 AM", the grams. Water follows. */
/* The check-in (TodayView checkIn): always the five beans, one outline at one size, told apart
   by face, each a step of the warm ramp (AppTheme.Colors.feel); the app's own drawing in each
   look (img/faces-<look>.png). 74 pt apart, 52 x 46 pt each with the shadow under it. */
.today-checkin { margin-top: 25px; }
.t-feels { display: flex; justify-content: space-between; margin-top: 28px; padding: 0 3px; }
.t-feels span { display: flex; flex-direction: column; align-items: center; width: 52px; font-size: 15px; line-height: 18px; color: var(--text-3); }
.t-feels i { width: 52px; height: 46px; margin-bottom: 6px; background: var(--faces) calc(var(--i) * 25%) 0 / 500% 100% no-repeat; }
.today-foods { margin-top: 48px; }
.today-title {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    line-height: 27px;
}
.first-scan {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
    margin-top: 11px;
    padding: 0 18px 0 12px;
    border-radius: 30px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge);
    font-size: 17px;
    font-weight: 600;
    line-height: 20px;
}
.fs-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
}
.fs-ico svg { width: 22px; height: 22px; }
.first-scan > svg { width: 16px; height: 16px; margin-left: auto; color: var(--text-3); }
.today-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 16px;
    height: 72px;
    margin-top: 4px;
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
}
.today-row .thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.today-row .nm { display: block; font-size: 17px; line-height: 20px; }
.today-row .sv { display: block; margin-top: 4px; font-size: 15px; color: var(--text-2); line-height: 18px; }
.today-row .g { font-size: 17px; font-weight: 600; line-height: 20px; }
/* The card gives way to the meal while the camera still covers them. */
.phone[data-beat~="start"] .today-row.meal,
.phone:not([data-beat~="start"]) .first-scan { display: none; }
.water { margin-top: 34px; }
.phone[data-beat~="start"] .water { margin-top: 34px; }
/* "3 of 8 glasses" beside the title (TodayView water). */
.w-count { float: right; margin-top: 5px; font-family: var(--sans); font-size: 15px; font-weight: 400; line-height: 18px; color: var(--text-3); }
.drops { display: flex; justify-content: space-between; margin-top: 23px; padding: 0 2px; color: var(--text-2); }
.drops svg { width: 24px; height: 24px; stroke-width: 1.6; }

/* The bottom row (AppTabBar.swift): the tab pill and ONE round accent button in line with it.
   64 pt button, 64 pt tall pill, 16 pt between them, 24 pt side margins, sunk a little into the
   home indicator's area (788 to 852 pt). Rows fade out over the 28 pt above it. The pill shows
   icons only: the picked tab is filled in the one accent, in a capsule sunk into the pill. */
.tabbar {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    height: 114px;
    /* Not a fill: the rows under the pill fade out instead of being sliced by it. */
    background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 28px);
}
.tabpill {
    position: absolute;
    left: 24px;
    top: 28px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 274px;
    height: 64px;
    padding: 5px;
    border-radius: 32px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge);
}
.tab {
    display: grid;
    place-items: center;
    border-radius: 27px;
    color: var(--text);
}
.tab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { background: var(--bg); }
.tab.on .a { fill: var(--tab-disc); stroke: none; }
.tab.on .b { stroke: var(--tab-ring); stroke-width: 2.6; }

/* The round button, with the app's scan glyph: one tap opens the camera. */
.round-btn {
    position: absolute;
    z-index: 1;
    left: 314px;
    top: 788px;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background: var(--accent);
    color: var(--on-accent);
    transition: transform 140ms var(--ease-ui);
}
.round-btn > svg { width: 32px; height: 32px; stroke-width: 2.2; }
.phone[data-beat~="tap"] .round-btn { transform: scale(0.93); }

/* A meal from a photo lands quietly: no tray, a toast with Undo just above the row (ToastView). */
.toast {
    position: absolute;
    z-index: 1;
    left: 24px;
    right: 24px;
    top: 720px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 24px;
    border-radius: 25px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge);
    font-size: 17px;
    line-height: 20px;
    transition: opacity 280ms ease, transform 460ms var(--ease-ui);
}
.toast .act { font-weight: 600; color: var(--accent-text); }
.phone:not([data-beat~="toast"]) .toast { opacity: 0; transform: translateY(12px); }

/* The finger: a soft disc under the press (stageshow touch cursor), a shade on paper and a
   light at night. */
.touch {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    background: var(--touch);
    box-shadow: 0 0 0 1px var(--touch-edge);
    opacity: 0;
    transform: scale(1.3);
    transition: opacity 220ms ease, transform 260ms var(--ease-ui);
    pointer-events: none;
}
/* On white and on the accent the disc is always a shade. */
.shutter .touch, .log-btn .touch, .round-btn .touch { background: rgba(0, 0, 0, 0.2); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16); }
.phone[data-beat~="tap"] .round-btn .touch,
.phone[data-beat~="snap"] .shutter .touch,
.phone[data-beat~="tap-chia"] .tile .touch,
.phone[data-beat~="tap-log"] .log-btn .touch { opacity: 1; transform: scale(1); }

/* The home indicator, over everything, as on the phone. */
.home-ind {
    position: absolute;
    left: 50%;
    bottom: 8px;
    z-index: 6;
    width: 144px;
    height: 5px;
    margin-left: -72px;
    border-radius: 3px;
    background: var(--ios-ink);
    transition: background-color 240ms ease;
}
.phone[data-beat~="cam"]:not([data-beat~="naming"]) .home-ind { background: #fff; }

/* ---------- The camera (MealScanView.swift) ----------
   A full-screen cover, black in both looks: the close button, the picture as a card with thin
   corners, the mode bar (Scan meal, barcode, label, a library photo, the pencil that opens
   typing) and the white shutter. */
.cam {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #000;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 520ms var(--ease-ui), visibility 0s linear 520ms;
}
.phone[data-beat~="cam"] .cam { transform: none; visibility: visible; transition-delay: 0s; }

.cam-x {
    position: absolute;
    z-index: 2;
    left: 18px;
    top: 72px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(84, 84, 88, 0.72);
    color: #fff;
}
.cam-x svg { width: 17px; height: 17px; }

/* The picture: 8 pt from the sides, between the close button and the controls. At the
   shutter it moves up to fill the top, and the review's sheet rises under it. */
.cam-photo {
    position: absolute;
    left: 8px;
    top: 130px;
    width: 386px;
    height: 514px;
    border-radius: 24px;
    overflow: hidden;
    background: #1c1c1e;
    transition: left 560ms var(--ease-ui), top 560ms var(--ease-ui), width 560ms var(--ease-ui),
        height 560ms var(--ease-ui), border-radius 560ms var(--ease-ui);
}
.cam-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1500ms var(--ease-arrive);
}
/* Before the shutter she is still framing the bowl: the picture settles as the camera opens. */
.phone[data-beat~="start"]:not([data-beat~="cam"]) .cam-photo img { transform: scale(1.07); }
.phone[data-beat~="naming"] .cam-photo { left: 0; top: 0; width: 402px; height: 415px; border-radius: 0; }
/* The answer asks two things here ("Anything stirred in?" and "Oatmeal: how much?"), so the
   sheet grows to fit them and the photo gives way (281 pt of it stays). */
.phone[data-beat~="review"] .cam-photo { height: 300px; }

/* The scan corners (ViewfinderCorners): 14 pt in, each arm 18% of the short side, a 3 pt line. */
.corners {
    position: absolute;
    inset: 14px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
    transition: opacity 240ms ease;
}
.corners i { position: absolute; width: 64px; height: 64px; border: 3px solid #fff; }
.corners i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.corners i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.corners i:nth-child(3) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.corners i:nth-child(4) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.phone[data-beat~="naming"] .corners { opacity: 0; }

/* While the food is named, the app's line sweeps down and back over the photo (SweepLine). The
   line fades out at both ends, as the app draws it; it is a light, not a fill. */
.sweep {
    position: absolute;
    left: 28px;
    right: 28px;
    top: 44px;
    height: 2px;
    background: linear-gradient(to right, color-mix(in srgb, var(--accent) 0%, transparent), var(--accent), color-mix(in srgb, var(--accent) 0%, transparent));
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 70%, transparent);
    opacity: 0;
    transition: opacity 200ms ease;
}
.phone[data-beat~="naming"]:not([data-beat~="review"]) .sweep {
    opacity: 1;
    animation: sweep 1250ms ease-in-out 420ms infinite alternate;
}
@keyframes sweep { to { transform: translateY(300px); } }

.cam-bar {
    position: absolute;
    left: 50%;
    top: 660px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 28px;
    background: rgba(84, 84, 88, 0.5);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    white-space: nowrap;
    transform: translateX(-50%);
    transition: opacity 180ms ease;
}
.mode { display: grid; place-items: center; width: 44px; height: 44px; color: #fff; }
.mode svg { width: 20px; height: 20px; }
.mode.on {
    display: flex;
    gap: 6px;
    width: auto;
    padding: 0 14px;
    border-radius: 22px;
    background: #fff;
    color: #000;
    font-size: 15px;
    font-weight: 600;
    line-height: 18px;
}
.shutter {
    position: absolute;
    left: 161px;
    top: 740px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px #fff;
    transition: opacity 180ms ease;
}
.shutter::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: #fff;
    transition: transform 140ms var(--ease-ui);
}
.phone[data-beat~="snap"] .shutter::before { transform: scale(0.92); }
/* The controls give way to the sheet that rises over them. */
.phone[data-beat~="naming"] .cam-bar, .phone[data-beat~="naming"] .shutter { opacity: 0; }

/* ---------- The review (MealReviewSheet.swift) ----------
   A sheet under the photo: the meal's name and a stepper, the ring with this meal's fiber
   and the foods beside it, one question as three tiles, a + and "Log meal". While the photo is
   being named the sheet is already there with the shape of the answer (MealReviewSkeleton),
   and the answer fills it in place: nothing arrives as a new screen. */
.review {
    position: absolute;
    inset: auto 0 0;
    height: 483px;
    border-radius: 28px 28px 0 0;
    background: var(--bg);
    transform: translateY(100%);
    transition: transform 560ms var(--ease-ui), height 560ms var(--ease-ui);
}
.phone[data-beat~="review"] .review { height: 594px; }
.phone[data-beat~="naming"] .review { transform: none; }
.grabber {
    position: absolute;
    top: 9px;
    left: 50%;
    width: 36px;
    height: 5px;
    margin-left: -18px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--text-3) 55%, transparent);
}
.rv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 40px;
    margin: 29px 24px 0;
}
.rv-title { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 27px; }
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 108px;
    height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
}
.stepper svg { width: 15px; height: 15px; stroke-width: 2.4; }
.stepper b { font-size: 15px; font-weight: 600; line-height: 18px; }

.rv-main { display: flex; align-items: center; gap: 21px; height: 160px; margin: 18px 24px 0 18px; }
.meal-ring { position: relative; flex: none; width: 160px; height: 160px; }
.meal-ring svg { width: 160px; height: 160px; transform: rotate(-90deg); }
.meal-ring circle { fill: none; stroke-width: 12; }
.meal-ring .ring-fill {
    stroke-dasharray: 464.96 464.96;
    stroke-dashoffset: 270.6;
    transition: stroke-dashoffset 900ms var(--ease-arrive), opacity 300ms ease;
}
.meal-num {
    display: flex;
    align-items: baseline;
    font-family: var(--serif);
    font-size: 56px;
    font-weight: 560;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-top: -4px;
}
.meal-num .approx {
    display: inline-flex;
    justify-content: flex-end;
    width: 0;
    font-size: 30px;
    letter-spacing: 0;
    transform: translate(-0.16em, -0.3em);
}
.meal-unit { margin-top: 4px; font-size: 13px; line-height: 16px; color: var(--text-3); }

.rv-foods { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rv-food {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 11px;
    height: 44px;
    overflow: hidden;
    font-size: 15px;
    line-height: 18px;
    transition: height 420ms var(--ease-ui), opacity 300ms ease 180ms;
}
.rv-food img, .rv-food .pic { justify-self: center; width: 20px; height: 20px; font-size: 18px; line-height: 20px; text-align: center; }
.rv-food .g { color: var(--text-3); font-variant-numeric: tabular-nums; }

.rv-q { margin: 20px 24px 0; font-size: 17px; font-weight: 600; line-height: 20px; }
.tiles + .rv-q { margin-top: 26px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 24px 0; }
.tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface);
    font-size: 15px;
    font-weight: 600;
    line-height: 18px;
    color: var(--text);
    transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease-ui);
}
.tile img { width: 18px; height: 18px; }
/* A picked tile is the solid accent in both looks. */
.tile.on { background: var(--accent); color: var(--on-accent); }
.phone[data-beat~="tap-chia"] .tile.on { transform: scale(0.97); }
/* Until she taps it: the tile is plain and the meal has two foods. */
.phone[data-beat~="start"]:not([data-beat~="chia"]) .tile.on { background: var(--surface); color: var(--text); }
.phone[data-beat~="start"]:not([data-beat~="chia"]) .rv-food.added { height: 0; opacity: 0; }

.rv-actions { position: absolute; left: 24px; right: 24px; bottom: 50px; display: flex; gap: 16px; }
.rv-plus {
    display: grid;
    place-items: center;
    flex: none;
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--surface);
}
.rv-plus svg { width: 22px; height: 22px; stroke-width: 2.4; }
.log-btn {
    position: relative;
    flex: 1;
    display: grid;
    place-items: center;
    height: 54px;
    border-radius: 12px;
    background: var(--accent);
    font-size: 17px;
    font-weight: 600;
    color: var(--on-accent);
    transition: transform 140ms var(--ease-ui), background-color 300ms ease, color 300ms ease;
}
.phone[data-beat~="tap-log"] .log-btn { transform: scale(0.98); background: var(--accent-press); transition-duration: 140ms; }

/* The shape of the answer while the photo is named: still blocks in the track color where
   the name, the foods and the question will land; the tiles and buttons are already in place,
   empty, and "Log meal" waits. */
.skel { position: absolute; inset: 0; pointer-events: none; transition: opacity 260ms ease; }
.skel i { position: absolute; border-radius: 6px; background: var(--fill); }
.skel .dot { border-radius: 50%; }
.rv-title, .stepper > *, .meal-ring .ring-center, .rv-foods, .rv-q, .tile > img, .rv-plus svg { transition: opacity 300ms ease 60ms; }
.phone[data-beat~="review"] .skel { opacity: 0; }
.phone:not([data-beat~="review"]) .rv-title,
.phone:not([data-beat~="review"]) .stepper > *,
.phone:not([data-beat~="review"]) .meal-ring .ring-center,
.phone:not([data-beat~="review"]) .meal-ring .ring-fill,
.phone:not([data-beat~="review"]) .rv-foods,
.phone:not([data-beat~="review"]) .rv-q,
.phone:not([data-beat~="review"]) .tiles.amounts,
.phone:not([data-beat~="review"]) .tile > img,
.phone:not([data-beat~="review"]) .rv-plus svg { opacity: 0; transition: none; }
.phone:not([data-beat~="review"]) .tiles .tile, .phone:not([data-beat~="review"]) .tiles .tile.on { color: transparent; transition: none; }
.phone:not([data-beat~="review"]) .log-btn { background: var(--accent-soft); color: var(--wait-ink); transition: none; }

/* ---------- How it works ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.step {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.step-pic {
    position: relative;
    display: grid;
    place-items: center;
    height: 260px;
    padding: 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.step-text { padding: 28px 30px 32px; }
.step-text p { margin-top: 10px; color: var(--text-2); }


@media (max-width: 960px) {
    .steps { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
}

/* Step 1: the line she types, in the app's own field. */
.type-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 292px;
    padding: 18px 20px 18px 16px;
    border-radius: 16px;
    background: var(--inset);
    box-shadow: inset 0 0 0 1px var(--accent-line);
    font-size: 1.0625rem;
    line-height: 1.45;
}
.type-field > svg { width: 18px; height: 18px; margin-top: 4px; color: var(--text-3); }
.type-field .food { color: var(--accent-text); font-weight: 600; }
.caret {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    margin: 0 1px;
    border-radius: 1px;
    background: var(--accent-text);
    vertical-align: -0.22em;
}
.type-field .w { transition: opacity 260ms ease; }
.js-motion .step:not(.in) .type-field .w { opacity: 0; }

/* Step 1: the meal photo inside the app's scan corners (the same one file as the hero:
   /img/scan-example.jpg). The line sweeps it once when the card comes into view. */
.snap {
    position: relative;
    width: 100%;
    max-width: 292px;
    height: 204px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--inset);
}
.snap img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.snap .corners { inset: 12px; transition: opacity 320ms ease 200ms, transform 620ms var(--ease-arrive) 200ms; }
.snap .corners i { width: 34px; height: 34px; border-width: 2.5px; }
.snap .corners i:nth-child(1) { border-top-left-radius: 10px; }
.snap .corners i:nth-child(2) { border-top-right-radius: 10px; }
.snap .corners i:nth-child(3) { border-bottom-right-radius: 10px; }
.snap .corners i:nth-child(4) { border-bottom-left-radius: 10px; }
.js-motion .step:not(.in) .snap .corners { opacity: 0; transform: scale(1.07); }
.snap-sweep {
    position: absolute;
    left: 24px;
    right: 24px;
    top: 28px;
    height: 2px;
    background: linear-gradient(to right, color-mix(in srgb, var(--accent) 0%, transparent), var(--accent), color-mix(in srgb, var(--accent) 0%, transparent));
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 70%, transparent);
    opacity: 0;
}
.js-motion .step.in .snap-sweep { animation: snap-sweep 1500ms ease-in-out 700ms 1 both; }
@keyframes snap-sweep {
    0% { opacity: 0; transform: none; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { opacity: 0; transform: translateY(148px); }
}

/* Step 2: the one question a photo can't answer, as the app's tiles. Chia is picked and the
   meal's number has risen from 8 to 12. */
.ask { width: 100%; max-width: 304px; }
.ask-num {
    display: flex;
    align-items: baseline;
    justify-content: center;
    font-family: var(--serif);
    font-size: 56px;
    font-weight: 560;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text);
}
.ask-num .approx { font-size: 30px; margin-right: 4px; letter-spacing: 0; transform: translateY(-0.3em); }
.ask-num small { margin-left: 8px; font-family: var(--sans); font-size: 0.875rem; font-weight: 400; letter-spacing: 0; color: var(--text-quiet); }
.ask-n { display: inline-grid; overflow: hidden; padding: 0.12em 0; margin: -0.12em 0; }
.ask-n b { grid-area: 1 / 1; justify-self: end; font-weight: inherit; transition: transform 520ms var(--ease-ui) 900ms, opacity 380ms ease 900ms; }
.ask-n b:first-child { transform: translateY(-80%); opacity: 0; }
.js-motion .step:not(.in) .ask-n b:first-child { transform: none; opacity: 1; transition: none; }
.js-motion .step:not(.in) .ask-n b:last-child { transform: translateY(80%); opacity: 0; transition: none; }
.ask-q { margin-top: 22px; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.ask-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ask-tiles .tile { gap: 5px; background: var(--inset); font-size: 0.875rem; transition-delay: 900ms; }
.ask-tiles .tile img { width: 16px; height: 16px; }
.ask-tiles .tile.on { background: var(--accent); }
.js-motion .step:not(.in) .ask-tiles .tile.on { background: var(--inset); color: var(--text); transition: none; }
@media (min-width: 961px) and (max-width: 1100px) {
    .ask-tiles .tile img { display: none; }
}

/* The other way in: typing, as one wide card under the three. */
.step-wide { grid-column: 1 / -1; flex-direction: row; }
.step-wide .step-pic { flex: 1 1 50%; height: auto; min-height: 176px; border-bottom: 0; border-right: 1px solid var(--line); }
.step-wide .step-text { flex: 1 1 50%; align-self: center; padding: 28px 40px; }
@media (max-width: 960px) {
    .step-wide { flex-direction: column; }
    .step-wide .step-pic { flex: none; height: 200px; border-right: 0; border-bottom: 1px solid var(--line); }
    .step-wide .step-text { align-self: stretch; padding: 28px 30px 32px; }
}

/* Step 3: the meal is on today, and the day's ring has filled by it. */
.logged { display: flex; align-items: center; gap: 20px; width: 100%; max-width: 304px; }
.mini-ring { position: relative; width: 120px; height: 120px; flex: none; }
.mini-ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke-width: 11; }
.mini-ring .ring-fill { transition-duration: 1200ms; }
.mini-ring-c {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.mini-ring-c b { font-family: var(--serif); font-weight: 560; font-size: 36px; letter-spacing: -0.02em; }
.mini-ring-c b .approx { font-size: 16px; margin-right: 2px; }
.mini-ring-c span { margin-top: 6px; font-size: 0.8125rem; color: var(--text-quiet); }
.logged-row {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 2px 12px;
    padding: 14px;
    border-radius: 18px;
    background: var(--inset);
    transition: opacity 360ms ease 500ms, transform 560ms var(--ease-arrive) 500ms;
}
.logged-row img { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.logged-row .nm { align-self: end; font-weight: 600; line-height: 1.25; }
.logged-row .g { align-self: start; font-size: 0.9375rem; color: var(--text-2); line-height: 1.25; }
.js-motion .step:not(.in) .logged-row { opacity: 0; transform: translateY(10px); }

/* ---------- Feature split (picture + words) ---------- */

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 80px;
    align-items: center;
}
.split-text h2 + p { margin-top: 22px; }
.split-text .link-arrow { margin-top: 28px; }
.split.flip .split-pic { order: 2; }

@media (max-width: 960px) {
    .split { grid-template-columns: 1fr; gap: 48px; }
    .split.flip .split-pic { order: 0; }
    .split-text { max-width: 600px; }
}

/* ---------- The gentle ramp ---------- */

.ramp-wrap { position: relative; padding-bottom: 64px; }
.ramp-card {
    border-radius: var(--radius);
    background: var(--surface);
    padding: 30px 32px 28px;
}
.ramp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 20px;
}
.ramp-top p { font-weight: 600; color: var(--text-2); }

.seg {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: var(--bg);
    position: relative;
}
.seg button {
    position: relative;
    z-index: 1;
    min-height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font: 600 0.9375rem/1 var(--sans);
    cursor: pointer;
    transition: color 220ms ease;
}
.seg button[aria-pressed="true"] { color: var(--on-accent); }
.seg-thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    border-radius: 999px;
    background: var(--accent);
    transition: transform 420ms var(--ease-ui), width 420ms var(--ease-ui);
}

.bars {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    height: 300px;
    margin-top: 34px;
}
.bar {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.bar-val {
    margin-bottom: 10px;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.2;
    white-space: nowrap;
}
.bar-col {
    width: 100%;
    height: calc(var(--v) / 30 * 210px);
    border-radius: 12px 12px 6px 6px;
    transition: height 760ms var(--ease-arrive);
}
.bar:nth-child(1) .bar-col { background: var(--ramp-1); }
.bar:nth-child(2) .bar-col { background: var(--ramp-2); }
.bar:nth-child(3) .bar-col { background: var(--ramp-3); }
.bar:nth-child(4) .bar-col { background: var(--ramp-4); }
.bar:nth-child(5) .bar-col { background: var(--ramp-5); }
.bar-wk { margin-top: 12px; font-size: 0.875rem; color: var(--text-quiet); white-space: nowrap; }
.js-motion .ramp-wrap:not(.in) .bar-col { height: 0; }
.js-motion .ramp-wrap:not(.in) .bar-val { opacity: 0; }
.bar-val { transition: opacity 400ms ease; }
.ramp-wrap.in .bar:nth-child(2) .bar-col, .ramp-wrap.in .bar:nth-child(2) .bar-val { transition-delay: 90ms; }
.ramp-wrap.in .bar:nth-child(3) .bar-col, .ramp-wrap.in .bar:nth-child(3) .bar-val { transition-delay: 180ms; }
.ramp-wrap.in .bar:nth-child(4) .bar-col, .ramp-wrap.in .bar:nth-child(4) .bar-val { transition-delay: 270ms; }
.ramp-wrap.in .bar:nth-child(5) .bar-col, .ramp-wrap.in .bar:nth-child(5) .bar-val { transition-delay: 360ms; }
.ramp-wrap.settled .bar-col, .ramp-wrap.settled .bar-val { transition-delay: 0s !important; }

/* The bean rests on the goal bar. */
.bar-bean {
    position: absolute;
    left: 50%;
    bottom: calc(var(--v) / 30 * 210px + 26px);
    width: 76px;
    height: 70px;
    margin-left: -38px;
    background: var(--bean) center / contain no-repeat;
    transition: bottom 760ms var(--ease-arrive), transform 700ms var(--ease-arrive), opacity 260ms ease;
}
.js-motion .ramp-wrap:not(.in) .bar-bean { opacity: 0; transform: translateY(-36px); }
.ramp-wrap.in .bar-bean { transition-delay: 700ms; }
.ramp-wrap.settled .bar-bean { transition-delay: 0s; }
.bar:nth-child(5) .bar-val { margin-bottom: 72px; }
/* Room under the week labels for the check-in card that overlaps the foot. */
.ramp-card { padding-bottom: 122px; }

@media (max-width: 520px) {
    .ramp-card { padding: 24px 20px 22px; }
    .bars { gap: 8px; height: 270px; }
    .bar-val { font-size: 1.0625rem; }
    .bar-col { height: calc(var(--v) / 30 * 180px); }
    .bar-bean { bottom: calc(var(--v) / 30 * 180px + 26px); width: 60px; height: 56px; margin-left: -30px; }
    .bar:nth-child(5) .bar-val { margin-bottom: 58px; }
    .ramp-card { padding-bottom: 50px; }
    .wk-word { display: none; }
}

/* The evening check-in, a satellite straddling the ramp card's foot. */
.checkin {
    position: absolute;
    right: -20px;
    bottom: 0;
    width: min(380px, 92%);
    padding: 18px 18px 16px;
    border-radius: 20px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge), var(--float-shadow);
}
.checkin p { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; line-height: 1.3; color: var(--text); }
/* A stomach feeling is the bean's face (the app's FaceGlyph): one outline at one size on the warm
   ramp, five in one strip per look (img/faces-<look>.png). The picked one keeps its size on a
   soft accent disc and the others step back (TodayView checkIn, -debugRoute checkedin). */
.feels { display: flex; justify-content: space-between; gap: 2px; margin-top: 12px; }
.feel {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    text-align: center;
    color: var(--text-quiet);
}
.feel i {
    position: relative;
    width: 52px;
    height: 46px;
    background: var(--faces) calc(var(--i) * 25%) 0 / 500% 100% no-repeat;
}
.feel:not(.on) i { opacity: 0.55; }
.feel.on { color: var(--text); font-weight: 600; }
.feel.on i::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: -1;
    width: 66px;
    height: 66px;
    margin: -33px 0 0 -33px;
    border-radius: 50%;
    background: var(--accent-soft);
}
.feel i { isolation: isolate; }
.feels { padding-top: 8px; }
@media (max-width: 960px) {
    .checkin { right: 16px; }
}
@media (max-width: 520px) {
    .ramp-wrap { padding-bottom: 0; }
    .checkin { position: relative; right: auto; width: auto; margin: -24px 14px 0; }
    .feel { font-size: 0.75rem; }
    .feel i { width: 46px; height: 41px; }
    .feel.on i::before { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
}

/* ---------- Foods ---------- */

.foods-card {
    border-radius: var(--radius);
    background: var(--surface);
    padding: 26px;
}
.foods-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border-radius: 999px;
    background: var(--bg);
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
}
.foods-seg span { padding: 9px 0; border-radius: 999px; color: var(--text-2); }
.foods-seg .on { background: var(--seg-on); color: var(--text); }
.foods-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 0 16px;
    height: 50px;
    border-radius: 14px;
    background: var(--field);
    box-shadow: inset 0 0 0 1px var(--field-edge);
    color: var(--text-3);
}
.foods-search .grow { flex: 1; }
.foods-search .scan { color: var(--accent-text); }
.group {
    margin-top: 18px;
    padding: 18px 18px 8px;
    border-radius: 18px;
    background: var(--inset);
}
.group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.25rem;
}
.group-title .ico { color: var(--text-3); width: 18px; height: 18px; }
.food-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
}
.food-row + .food-row { border-top: 1px solid var(--line); }
.food-row img, .food-row .emo { width: 40px; height: 40px; font-size: 32px; line-height: 40px; text-align: center; }
.food-row .nm { font-weight: 600; line-height: 1.3; }
.food-row .nm { font-weight: 400; }
.food-row .g { font-weight: 600; color: var(--accent-text); white-space: nowrap; text-align: right; line-height: 1.3; }
.food-row .sv { display: block; font-size: 0.8125rem; color: var(--text-quiet); line-height: 1.3; font-weight: 400; }
/* All / Soluble / Insoluble (FoodsView fiber kind chips). */
.kind-chips { display: flex; gap: 8px; margin-top: 14px; }
.kind-chips span { padding: 7px 14px; border-radius: 999px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--edge); font-size: 0.875rem; color: var(--text); }
.kind-chips .on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.foods-seg.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- Insights (ProgressTabView: Fiber, Plants, Streak, Stomach) ---------- */

.insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ins-card {
    display: flex;
    flex-direction: column;
    min-height: 236px;
    padding: 22px 20px 20px;
    border-radius: var(--radius);
    background: var(--surface);
}
.ins-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.ins-num { display: flex; align-items: baseline; margin-top: 10px; font-family: var(--serif); font-size: 2.75rem; font-weight: 560; line-height: 1; letter-spacing: -0.02em; }
.ins-num .approx { font-size: 1.5rem; margin-right: 3px; }
.ins-num small { margin-left: 8px; font-family: var(--sans); font-size: 0.875rem; font-weight: 400; letter-spacing: 0; color: var(--text-2); }
/* The week's bars, flat, in the ramp's steps; today is the palest; the dashed line is the goal. */
.ins-bars { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 96px; margin-top: auto; }
.ins-bars i { height: calc(var(--v) / 30 * 96px); border-radius: 6px 6px 3px 3px; background: var(--ramp-3); }
.ins-bars i:nth-child(2n) { background: var(--ramp-4); }
.ins-bars i.today { background: var(--ramp-1); }
.ins-bars .goal { position: absolute; left: 0; right: 0; bottom: calc(24 / 30 * 96px); border-top: 1.5px dashed var(--text-3); opacity: 0.6; }
.ins-plants { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: auto; justify-items: center; }
.ins-plants img, .ins-plants span { width: 24px; height: 24px; font-size: 20px; line-height: 24px; text-align: center; }
.ins-plants i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--fill); }
.ins-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: auto; }
.ins-week span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.6875rem; color: var(--text-3); }
.ins-week b, .ins-week i { display: block; width: 26px; height: 23px; }
.ins-week b { background: var(--cast) calc(var(--c) * 50%) 0 / 300% 100% no-repeat; }
.ins-week.beans b { background: var(--faces) calc(var(--i) * 25%) 0 / 500% 100% no-repeat; }
.ins-week i { width: 20px; height: 20px; margin: 1.5px 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--fill); }
@media (max-width: 520px) {
    .insights { gap: 12px; }
    .ins-card { min-height: 210px; padding: 18px 14px 16px; border-radius: 20px; }
    .ins-title { font-size: 1.0625rem; }
    .ins-num { font-size: 2.25rem; }
    .ins-num { flex-wrap: wrap; }
    .ins-num small { flex-basis: 100%; margin: 6px 0 0; }
    .ins-bars { height: 80px; gap: 4px; }
    .ins-bars i { height: calc(var(--v) / 30 * 80px); }
    .ins-bars .goal { bottom: calc(24 / 30 * 80px); }
    .ins-plants { gap: 4px; }
    .ins-plants img, .ins-plants span { width: 19px; height: 19px; font-size: 16px; line-height: 19px; }
    .ins-plants i { width: 17px; height: 17px; }
    .ins-week b { width: 20px; height: 18px; }
    .ins-week i { width: 15px; height: 15px; }
}

/* ---------- Recipes (RecipesView: Saved, and the shopping list sheet) ---------- */

.recipes-wrap { position: relative; padding-bottom: 64px; }
/* Room under the recipes for the shopping list that overlaps the card's foot, as on the ramp. */
.recipes-card { border-radius: var(--radius); background: var(--surface); padding: 26px 26px 160px; }
.rc-list { display: grid; gap: 12px; margin-top: 18px; }
.rc {
    display: grid;
    grid-template-columns: 26px 64px minmax(0, 1fr) 22px;
    align-items: start;
    gap: 14px;
    padding: 12px 14px 12px 0;
}
.rc .tick { display: grid; place-items: center; align-self: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.rc .tick svg { width: 15px; height: 15px; stroke-width: 3; }
.rc .pic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--fill); font-size: 36px; line-height: 1; }
.rc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.rc-text b { font-weight: 600; }
.rc-text em { font-style: normal; font-weight: 600; font-size: 0.9375rem; color: var(--accent-text); }
.rc-text small { font-size: 0.875rem; color: var(--text-quiet); }
.rc .heart { width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
.shop {
    position: absolute;
    right: -20px;
    bottom: 0;
    width: min(300px, 80%);
    padding: 18px 20px 12px;
    border-radius: 20px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--edge), var(--float-shadow);
}
.shop p { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.shop-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 0.9375rem; }
.shop-row + .shop-row { border-top: 1px solid var(--line); }
.shop-row span:last-child { color: var(--text-quiet); white-space: nowrap; }
.rc { transition: opacity 360ms ease, transform 560ms var(--ease-arrive); }
.js-motion .recipes-wrap:not(.in) .rc { opacity: 0; transform: translateY(10px); }
.recipes-wrap.in .rc:nth-child(2) { transition-delay: 100ms; }
.recipes-wrap.in .rc:nth-child(3) { transition-delay: 200ms; }
@media (max-width: 960px) {
    .shop { right: 16px; }
}
@media (max-width: 520px) {
    .recipes-wrap { padding-bottom: 0; }
    .recipes-card { padding: 22px 16px 50px; }
    .rc { grid-template-columns: 22px 52px minmax(0, 1fr) 20px; gap: 10px; padding-right: 4px; }
    .rc .tick { width: 22px; height: 22px; }
    .rc .pic { width: 52px; height: 52px; font-size: 30px; border-radius: 14px; }
    .shop { position: relative; right: auto; width: auto; margin: -24px 14px 0; }
}
.group .food-row { transition: opacity 360ms ease, transform 560ms var(--ease-arrive); }
.js-motion .foods-wrap:not(.in) .group .food-row { opacity: 0; transform: translateY(10px); }
.foods-wrap.in .food-row:nth-child(3) { transition-delay: 100ms; }
.foods-wrap.in .food-row:nth-child(4) { transition-delay: 200ms; }

/* ---------- Privacy ---------- */

.vault {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0;
    padding: 40px 36px;
    border-radius: var(--radius);
    background: var(--surface);
}
.vault-phone {
    position: relative;
    width: 228px;
    padding: 44px 16px 22px;
    border-radius: 38px;
    border: 2px solid var(--fill);
    background: var(--bg);
    justify-self: center;
}
.vault-phone::before {
    content: "";
    position: absolute;
    top: 13px;
    left: 50%;
    width: 64px;
    height: 18px;
    margin-left: -32px;
    border-radius: 9px;
    background: var(--fill);
}
.vault-lock {
    position: absolute;
    top: -22px;
    right: -18px;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 0 0 6px var(--surface);
}
.vault-lock svg { width: 24px; height: 24px; stroke-width: 2.2; }
.vault-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
    background: var(--raised);
    font-size: 0.9375rem;
    font-weight: 600;
}
.vault-row + .vault-row { margin-top: 8px; }
.vault-row span:last-child { color: var(--text-quiet); font-weight: 500; }
.vault-out {
    display: flex;
    align-items: center;
    gap: 0;
}
.vault-wire {
    width: 56px;
    height: 0;
    border-top: 2px dashed var(--fill);
}
.vault-tag {
    max-width: 190px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--inset);
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-2);
}
.vault-tag .digits {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.vault-tag .digits .ico { width: 18px; height: 18px; color: var(--accent-text); }
/* Two things can leave the phone: each has its own tag. */
.vault-tags { display: grid; gap: 10px; }

@media (max-width: 1080px) {
    .vault { grid-template-columns: 1fr; gap: 0; padding: 40px 24px 28px; justify-items: center; }
    .vault-out { flex-direction: column; }
    .vault-wire { width: 0; height: 36px; border-top: 0; border-left: 2px dashed var(--fill); }
    .vault-tag { max-width: 260px; text-align: center; }
    .vault-tag .digits { justify-content: center; }
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 26px;
    margin-top: 26px;
    padding: 0;
    list-style: none;
}
.facts li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.facts .ico { width: 18px; height: 18px; color: var(--accent-text); }

/* ---------- Free tools ---------- */

.tool-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.tool-card {
    display: grid;
    grid-template-rows: 220px auto;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    transition: background-color 200ms ease;
}
.tool-card:hover { background: var(--surface-hover); color: var(--text); }
.tool-pic {
    display: grid;
    place-items: center;
    border-bottom: 1px solid var(--line);
    padding: 24px;
}
.tool-body { padding: 26px 30px 30px; }
.tool-body p { margin-top: 10px; color: var(--text-2); }
.tool-body .link-arrow { margin-top: 18px; }
.tool-card:hover .link-arrow .ico { transform: translateX(3px); }
.tool-big { text-align: center; }
.tool-big b {
    display: block;
    font-family: var(--serif);
    font-size: 5rem;
    font-weight: 560;
    line-height: 1;
    letter-spacing: -0.03em;
}
.tool-big b small { font-size: 2rem; font-weight: 560; margin-left: 6px; letter-spacing: 0; }
.tool-big span { display: block; margin-top: 10px; color: var(--text-quiet); font-size: 0.9375rem; }
.mini-bars { width: 100%; max-width: 330px; display: grid; gap: 12px; }
.mini-bar { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; font-size: 0.9375rem; }
.mini-bar .emo { font-size: 24px; line-height: 1; text-align: center; }
.mini-bar img { width: 28px; height: 28px; }
.mini-bar .track { height: 10px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.mini-bar .track i { display: block; height: 100%; width: var(--w); border-radius: 6px; background: var(--accent); }
.mini-bar .g { color: var(--accent-text); font-weight: 600; white-space: nowrap; }

@media (max-width: 860px) {
    .tool-cards { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */

.faq { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 2px;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .ico {
    width: 20px;
    height: 20px;
    color: var(--text-3);
    transition: transform 320ms var(--ease-ui);
}
.faq-item[open] summary .ico { transform: rotate(180deg); }
.faq-body { overflow: hidden; }
.faq-body > div { padding: 0 2px 26px; color: var(--text-2); max-width: 680px; }
.faq-body p + p { margin-top: 12px; }

/* ---------- Download ---------- */

.cta {
    text-align: center;
}
.cta-bean {
    width: 132px;
    height: 122px;
    margin: 0 auto 28px;
    background: var(--bean) center / contain no-repeat;
}
.cta h2 { max-width: 640px; margin: 0 auto; }
.cta .lead { max-width: 520px; margin: 18px auto 0; }
.cta .btn { margin-top: 36px; }
.cta .fine { margin-top: 18px; font-size: 0.9375rem; color: var(--text-quiet); }

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 72px 0 48px;
    color: var(--text-2);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 40px;
}
.footer-brand p { margin-top: 16px; max-width: 300px; font-size: 0.9375rem; color: var(--text-quiet); }
.footer-col h3 {
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}
.footer-col ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 0.875rem;
    color: var(--text-quiet);
}
@media (max-width: 860px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

/* Unfilled placeholder values ([COMPANY NAME]) show as a quiet pill until rebrand.mjs fills them. */
.placeholder {
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--fill);
    color: var(--text-2);
    font-size: 0.92em;
}

/* ---------- Legal and support pages ---------- */

.page-head { padding: 72px 0 8px; }
.page-head .updated { margin-top: 14px; color: var(--text-quiet); }
.prose { max-width: 720px; padding-bottom: 120px; }
.prose h2 {
    margin: 56px 0 16px;
    font-size: 1.75rem;
    font-weight: 600;
}
.prose h3 { margin: 32px 0 10px; font-size: 1.25rem; }
.prose p, .prose li { color: var(--text-2); }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 22px; margin: 14px 0 0; }
.prose li + li { margin-top: 8px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose .summary {
    margin-top: 40px;
    padding: 28px 30px;
    border-radius: var(--radius);
    background: var(--surface);
}
.prose .summary ul { list-style: none; padding: 0; margin: 0; }
.prose .summary li { display: flex; gap: 12px; color: var(--text); }
.prose .summary li + li { margin-top: 14px; }
.prose .summary .ico { width: 20px; height: 20px; margin-top: 3px; color: var(--accent-text); }

.support-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 40px;
}
.support-card {
    padding: 28px;
    border-radius: var(--radius);
    background: var(--surface);
}
.support-card .ico { width: 26px; height: 26px; color: var(--accent-text); margin-bottom: 18px; }
.support-card p { margin-top: 8px; color: var(--text-2); }
.support-card a { font-weight: 600; }
@media (max-width: 720px) {
    .support-cards { grid-template-columns: 1fr; }
}

.notfound {
    min-height: 62vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 96px 0;
}
.notfound .cta-bean { width: 150px; height: 138px; }
.notfound p { margin-top: 16px; color: var(--text-2); }
.notfound .btn { margin-top: 32px; }

/* ---------- Tool pages ---------- */

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0 0 22px;
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-quiet);
}
.crumbs li + li::before { content: "/"; margin-right: 6px; }
.crumbs a { color: var(--text-quiet); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.tool-hero { padding: 56px 0 0; }
.tool-hero .lead { margin-top: 18px; max-width: 640px; }

.calc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    margin-top: 44px;
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.calc-form { padding: 34px 36px 36px; display: grid; gap: 28px; align-content: start; }
.calc-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 32px;
    background: var(--panel);
    border-left: 1px solid var(--panel-line);
    text-align: center;
}
.field-label { display: block; font-weight: 600; margin-bottom: 12px; }
.field-hint { display: block; margin-top: 10px; font-size: 0.875rem; color: var(--text-quiet); }
.choice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.choice button {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: 600 0.9688rem/1 var(--sans);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
.choice button:hover { border-color: var(--text-3); }
.choice button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); border-width: 1.5px; }

.slider-row { display: flex; align-items: center; gap: 18px; }
.slider-row output {
    min-width: 64px;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.5rem;
    text-align: right;
}
input[type="range"] {
    flex: 1;
    min-width: 0;
    height: 30px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    --pct: 37.5%;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 6px;
    background: linear-gradient(to right, var(--accent) var(--pct), var(--fill) var(--pct));
}
input[type="range"]::-moz-range-track { height: 8px; border-radius: 6px; background: var(--fill); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 6px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--knob);
    border: 0;
    box-shadow: var(--thumb-shadow);
}
input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--knob);
    border: 0;
    box-shadow: var(--thumb-shadow);
}

.result-ring { position: relative; width: 236px; height: 236px; }
.result-ring svg { width: 236px; height: 236px; transform: rotate(-90deg); }
.result-ring circle { fill: none; stroke-width: 18; }
.result-ring .ring-fill { stroke-dasharray: 690 690; }
.result-ring .ring-center { gap: 0; }
.result-num {
    display: flex;
    align-items: baseline;
    justify-content: center;
    font-family: var(--serif);
    font-size: 80px;
    font-weight: 560;
    line-height: 1;
    letter-spacing: -0.03em;
}
.result-num small { font-size: 30px; margin-left: 6px; letter-spacing: 0; }
.result-sub { margin-top: 10px; color: var(--text-2); font-size: 0.9688rem; }
.result-note { max-width: 320px; margin-top: 18px; color: var(--text-2); }
.result-note b { color: var(--text); }

.plan {
    margin-top: 24px;
    width: 100%;
    max-width: 340px;
}
.plan-bars {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: end;
    height: 96px;
}
.plan-bars i {
    display: block;
    height: calc(var(--v) / 45 * 96px);
    border-radius: 6px 6px 3px 3px;
    background: var(--ramp-2);
    transition: height 560ms var(--ease-arrive);
}
.plan-bars i:last-child { background: var(--ramp-5); }
.plan p { margin-top: 12px; font-size: 0.9375rem; color: var(--text-2); }

@media (max-width: 860px) {
    .calc { grid-template-columns: 1fr; }
    .calc-form { padding: 28px 22px 30px; }
    .calc-result { padding: 36px 22px; border-left: 0; border-top: 1px solid var(--panel-line); }
}

.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.data-table th, .data-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { color: var(--text-quiet); font-size: 0.875rem; font-weight: 600; }
.data-table tbody tr:last-child td, .data-table tbody tr:last-child th { border-bottom: 0; }
.data-table td.num { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.data-table th[scope="row"] { font-weight: 600; }

.source-note { margin-top: 18px; font-size: 0.875rem; color: var(--text-quiet); max-width: 760px; }

.app-plug {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px 28px;
    padding: 32px 36px;
    border-radius: var(--radius);
    background: var(--surface);
}
.app-plug .cta-bean { width: 88px; height: 82px; margin: 0; }
.app-plug p { margin-top: 8px; color: var(--text-2); }
@media (max-width: 860px) {
    .app-plug { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 32px 24px; }
}

/* Fiber in foods */
.finder {
    margin-top: 40px;
    border-radius: var(--radius);
    background: var(--surface);
    padding: 22px;
}
.finder-top { display: grid; gap: 16px; }
.search {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 18px;
    border-radius: 16px;
    background: var(--field);
    box-shadow: inset 0 0 0 1px var(--field-edge);
    color: var(--text-3);
}
.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font: 400 1.0625rem/1 var(--sans);
    outline: none;
}
.search input::placeholder { color: var(--text-quiet); opacity: 1; }
.search:focus-within { box-shadow: inset 0 0 0 1px var(--field-edge), 0 0 0 2px var(--focus); }
.filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -22px;
    padding: 0 22px 2px;
}
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; }
.finder-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 6px;
    font-size: 0.9375rem;
    color: var(--text-quiet);
}
.finder-meta .tools { display: flex; gap: 8px; }
.small-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-2);
    font: 600 0.9063rem/1 var(--sans);
    cursor: pointer;
}
.small-btn:hover { color: var(--text); border-color: var(--text-3); }
.small-btn .ico { width: 17px; height: 17px; }

.food-list { list-style: none; margin: 14px 0 0; padding: 0; }
.food-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 160px 124px;
    align-items: center;
    gap: 16px;
    padding: 12px 6px;
    border-top: 1px solid var(--line);
}
.food-item[hidden] { display: none; }
.food-item .pic { width: 40px; height: 40px; font-size: 32px; line-height: 40px; text-align: center; }
.food-item .pic img { width: 40px; height: 40px; }
.food-item .nm { font-weight: 600; line-height: 1.3; }
.food-item .sv { display: block; font-size: 0.875rem; font-weight: 400; color: var(--text-quiet); line-height: 1.35; }
.food-item .track { height: 8px; border-radius: 5px; background: var(--fill); overflow: hidden; }
.food-item .track i { display: block; height: 100%; width: var(--w); border-radius: 5px; background: var(--accent); }
.food-item .g { text-align: right; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.food-item .g small { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--text-quiet); }
.empty { padding: 40px 0 24px; text-align: center; color: var(--text-2); }
@media (max-width: 620px) {
    .finder { padding: 18px 16px; }
    .filters { margin: 0 -16px; padding: 0 16px 2px; }
    .food-item { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; }
    .food-item .track { display: none; }
}

/* ---------- Scroll reveal (text only; solid cards never fade) ---------- */

.js-motion .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 700ms ease, transform 900ms var(--ease-arrive);
}
.js-motion .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition-duration: 0s !important;
        transition-delay: 0s !important;
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
    }
}

/* ---------- Print (the foods list and the fiber table print as plain pages) ---------- */

@media print {
    /* Plain black on white paper, whichever look is on screen (so the dark look's block is named too). */
    :root, :root[data-theme="dark"] {
        --bg: #fff; --surface: #fff; --raised: #fff; --inset: #fff; --panel: #fff; --field: #fff;
        --fill: #ddd; --line: #ccc; --edge: #ccc; --field-edge: #ccc; --panel-line: #ccc;
        --text: #111; --text-2: #333; --text-3: #555; --text-quiet: #555;
        --accent: #888; --accent-text: #111; --on-accent: #fff; --accent-soft: #eee;
        --ramp-1: #ccc; --ramp-2: #bbb; --ramp-3: #aaa; --ramp-4: #999; --ramp-5: #777;
        --float-shadow: none; --phone-shadow: none;
        color-scheme: light;
    }
    body { background: #fff; color: #111; font-size: 11pt; }
    .site-nav, .site-footer, .no-print, .app-plug, .faq-section, .skip-link { display: none !important; }
    .calc, .table-wrap, .foods-card, .finder { box-shadow: inset 0 0 0 1px #ccc; }
    .finder { padding: 0; }
    .food-item { break-inside: avoid; padding: 5px 0; grid-template-columns: 30px 1fr auto; }
    .food-item .track { display: none; }
    .food-item .pic { width: 26px; height: 26px; font-size: 20px; line-height: 26px; }
    .food-item .pic img { width: 26px; height: 26px; }
    .food-item .g { color: #111; }
    .food-list { columns: 2; column-gap: 28px; }
    a { color: #111; }
    h1 { font-size: 26pt; }
    .tool-hero { padding-top: 0; }
}

/* Helpers for site.js and hero.js */
.phone.no-anim, .phone.no-anim * { transition: none !important; }
.seg:not(.ready) button[aria-pressed="true"] { background: var(--accent); }
.seg:not(.ready) .seg-thumb { display: none; }
.faq-item.closing summary .ico { transform: none; }
.dg { display: inline-block; }
.mini-ring .ring-fill { stroke-dashoffset: 199.3; }
.js-motion .step:not(.in) .mini-ring .ring-fill { stroke-dashoffset: 342.4; }
.app-plug h2 { font-size: 1.75rem; }

.result-who { margin-top: 14px; color: var(--text-2); font-weight: 600; }
.result-sub { margin-top: 8px; }
.more { display: flex; justify-content: center; padding: 24px 0 8px; border-top: 1px solid var(--line); }
.more[hidden] { display: none; }
@media print { .more { display: none !important; } }
.filters { flex-wrap: nowrap; }
/* Calculator choices sit in one row of equal buttons at every width (no wrapping pills). */
.calc .choice { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.calc .choice button { padding: 0 8px; }
@media (max-width: 420px) {
    .calc .choice button { font-size: 0.9063rem; padding: 0 4px; }
}
.prose ul + p { margin-top: 14px; }
/* The fade variant of Roll, for centered labels: a short slide and a crossfade, never clipped. */
.roll.roll-fade { overflow: visible; -webkit-mask-image: none; mask-image: none; }
.roll.roll-fade > span { justify-self: center; }
.roll.roll-fade > .roll-out { transform: translateY(-40%); }
.roll.roll-fade > .roll-in-start { transform: translateY(40%); }

/* A centered number centers its digits (stageshow craft, "a centered amount centers its digits"):
   the ≈ hangs off the left and the unit off the right. Each is a zero-width box whose glyph overflows
   outward, so it still sits on the digits' baseline but adds nothing to the width being centered. */
.ring-num .approx, .mini-ring-c b .approx {
    display: inline-flex;
    justify-content: flex-end;
    width: 0;
    margin-right: 0;
    transform: translateX(-0.12em);
}
/* The app lifts the mark to the middle of the digits (ApproxMark: 0.35 of the size difference). */
.phone .ring-num .approx { transform: translate(-0.16em, -0.39em); }
.result-num small, .tool-big b small {
    display: inline-flex;
    width: 0;
    margin-left: 0;
    transform: translateX(0.2em);
}
