/* Layaqa — marketing site design system
   Dark, athletic-luxury theme. One accent color (lime) drives every action. */

:root {
    --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';

    --bg: #070a08;
    --bg-alt: #0c100d;
    --bg-elevated: #10140f;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.20);

    --ink: #f5f7f1;
    --ink-dim: rgba(245, 247, 241, 0.72);
    --muted: #92a096;

    --lime: #c7f464;
    --lime-strong: #ddff7f;
    --lime-ink: #0f1a0c;
    --coral: #f4785d;

    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;

    --shadow-soft: 0 30px 80px rgba(0, 0, 0, 0.45);
    --shadow-lime: 0 18px 44px rgba(199, 244, 100, 0.22);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

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

svg {
    fill: currentColor;
}

h1, h2, h3, h4, p {
    margin: 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    font-weight: 600;
}

::selection {
    background: var(--lime);
    color: var(--lime-ink);
}

/* Layout helpers */

.container {
    width: min(1200px, calc(100% - 40px));
    margin-inline: auto;
}

.section {
    position: relative;
    padding: 128px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-head {
    max-width: 720px;
    margin-bottom: 56px;
}

.section-head.center {
    margin-inline: auto;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: var(--lime);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 4px rgba(199, 244, 100, 0.16);
}

h2 {
    font-size: clamp(2rem, 3.6vw, 3.2rem);
    line-height: 1.08;
}

h3 {
    font-size: 1.3rem;
    line-height: 1.25;
}

.lede {
    margin-top: 18px;
    max-width: 620px;
    color: var(--ink-dim);
    font-size: 1.1rem;
    line-height: 1.7;
}

.section-head.center .lede {
    margin-inline: auto;
}

/* Buttons — one action color, everywhere */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), background 220ms var(--ease), border-color 220ms var(--ease);
}

.btn-primary {
    background: var(--lime);
    color: var(--lime-ink);
    box-shadow: var(--shadow-lime);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.015);
    background: var(--lime-strong);
    box-shadow: 0 22px 54px rgba(199, 244, 100, 0.32);
}

.btn-primary:active {
    transform: translateY(0) scale(0.99);
}

/* Disabled state: reads as clearly unavailable until a choice is made. Applies
   to any .btn carrying the disabled attribute (e.g. onboarding "Continue"). */
.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    box-shadow: none;
}

/* Some browsers still fire :hover on a disabled control — keep it inert. */
.btn:disabled:hover,
.btn[disabled]:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(20px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 44px;
    padding: 0 20px;
    font-size: 0.9rem;
}

.cta-micro {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.cta-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Reveal-on-scroll */

[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 900ms var(--ease), transform 900ms var(--ease);
    transition-delay: var(--delay, 0ms);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Header */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 22px 0;
    transition: padding 280ms var(--ease), background 280ms var(--ease), border-color 280ms var(--ease);
    border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
    padding: 14px 0;
    background: rgba(7, 10, 8, 0.72);
    backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    z-index: 2;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--lime);
    color: var(--lime-ink);
}

.brand-mark svg {
    width: 20px;
    height: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 34px;
    color: var(--ink-dim);
    font-size: 0.92rem;
    font-weight: 600;
}

.nav-links a {
    position: relative;
    transition: color 200ms ease;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--lime);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms var(--ease);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-login {
    color: var(--ink-dim);
    font-size: 0.92rem;
    font-weight: 600;
}

.nav-login:hover {
    color: var(--ink);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
}

.nav-toggle svg {
    width: 20px;
    height: 20px;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-open {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 99;
    width: min(320px, 84vw);
    height: 100vh;
    padding: 110px 28px 28px;
    background: rgba(10, 13, 10, 0.97);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 320ms var(--ease);
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.mobile-nav.is-open {
    transform: translateX(0);
}

.mobile-nav a {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink-dim);
}

.mobile-nav a:hover {
    color: var(--ink);
}

.mobile-nav .btn {
    margin-top: 8px;
}

/* Hero */

.hero {
    position: relative;
    padding: 168px 0 96px;
    isolation: isolate;
    overflow: hidden;
}

.mesh {
    position: absolute;
    inset: -10%;
    z-index: -1;
    filter: blur(60px);
}

.mesh span {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: meshFloat 22s ease-in-out infinite alternate;
}

.mesh span:nth-child(1) {
    top: 8%;
    left: 8%;
    width: 42vw;
    height: 42vw;
    background: radial-gradient(circle, rgba(199, 244, 100, 0.32), transparent 70%);
    animation-duration: 26s;
}

.mesh span:nth-child(2) {
    top: 30%;
    right: 4%;
    width: 34vw;
    height: 34vw;
    background: radial-gradient(circle, rgba(244, 120, 93, 0.16), transparent 70%);
    animation-duration: 30s;
    animation-delay: -6s;
}

.mesh span:nth-child(3) {
    bottom: -10%;
    left: 30%;
    width: 38vw;
    height: 38vw;
    background: radial-gradient(circle, rgba(199, 244, 100, 0.14), transparent 70%);
    animation-duration: 34s;
    animation-delay: -12s;
}

@keyframes meshFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6%, 8%) scale(1.12); }
}

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

.hero-copy {
    max-width: 620px;
}

h1 {
    font-size: clamp(2.9rem, 5.6vw, 4.7rem);
    line-height: 1.02;
    margin-bottom: 24px;
}

h1 em {
    font-style: normal;
    color: var(--lime);
}

.hero-copy .lede {
    font-size: 1.2rem;
}

.hero-copy .cta-group {
    margin-top: 36px;
}

/* Hero dashboard mockup */

.dash {
    position: relative;
    width: min(100%, 480px);
    justify-self: end;
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-soft);
    animation: floatY 7s ease-in-out infinite;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.dash-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.dash-top p {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-top strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.dash-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(199, 244, 100, 0.14);
    color: var(--lime);
    font-weight: 800;
    font-size: 0.86rem;
}

.dash-chart {
    margin: 18px 0 14px;
    padding: 16px 14px 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.dash-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.dash-chart-head span {
    color: var(--muted);
    font-weight: 700;
}

.dash-chart-head strong {
    color: var(--lime);
}

.dash-chart svg {
    width: 100%;
    height: 108px;
    overflow: visible;
}

.chart-line {
    fill: none;
    stroke: var(--lime);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawLine 2.2s var(--ease) forwards 0.3s;
}

.chart-fill {
    opacity: 0;
    animation: fadeIn 1.2s var(--ease) forwards 1.6s;
}

.chart-dot {
    fill: var(--lime);
    animation: dotPulse 2.4s ease-in-out infinite 2s;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes dotPulse {
    0%, 100% { r: 4; opacity: 1; }
    50% { r: 6.5; opacity: 0.65; }
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.dash-stats div {
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.dash-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dash-stats strong {
    display: block;
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.dash-stats strong.up { color: var(--lime); }
.dash-stats strong.down { color: var(--coral); }

.dash-streak {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(199, 244, 100, 0.06);
    border: 1px dashed rgba(199, 244, 100, 0.3);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-dim);
}

.streak-dots {
    display: flex;
    gap: 4px;
}

.streak-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(199, 244, 100, 0.25);
}

.streak-dots span.on {
    background: var(--lime);
}

/* Proof strip */

.proof {
    padding: 64px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
}

.proof-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.proof-counter {
    flex: 0 0 auto;
}

.proof-counter strong {
    display: block;
    font-family: var(--font-display);
    font-size: 2.6rem;
    color: var(--lime);
    line-height: 1;
}

.proof-counter span {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
}

.proof-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1 1 480px;
}

.logo-pill {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--ink-dim);
    font-weight: 700;
    font-size: 0.88rem;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 200ms ease, color 200ms ease;
}

.logo-pill:hover {
    border-color: var(--border-strong);
    color: var(--ink);
}

/* Problem section */

.problem-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1fr);
    gap: 56px;
    align-items: center;
}

.compare {
    display: grid;
    gap: 14px;
}

.compare-card {
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
}

.compare-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.86rem;
    font-weight: 700;
}

.compare-card.bad header { color: var(--muted); }
.compare-card.good header { color: var(--lime); }

.compare-card svg {
    width: 100%;
    height: 70px;
}

.compare-card.bad path {
    fill: none;
    stroke: var(--muted);
    stroke-width: 2.5;
}

.compare-card.good path {
    fill: none;
    stroke: var(--lime);
    stroke-width: 3;
    stroke-linecap: round;
}

.compare-card footer {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.punchline {
    margin-top: 28px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ink);
}

/* Value props */

.value-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
    gap: 64px;
    align-items: center;
}

.value-row + .value-row {
    margin-top: 120px;
}

.value-row.reverse {
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1fr);
}

.value-row.reverse .value-copy {
    order: 2;
}

.value-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(199, 244, 100, 0.12);
    color: var(--lime);
    font-family: var(--font-display);
    font-weight: 700;
}

.value-copy h3 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    margin-bottom: 14px;
}

.value-copy p {
    color: var(--ink-dim);
    line-height: 1.75;
    font-size: 1.03rem;
}

.value-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.value-tags span {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.value-visual {
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-soft);
    transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}

.value-visual:hover {
    transform: translateY(-6px);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
}

/* Log form mockup */

.log-rows {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.log-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    font-weight: 700;
}

.log-row span {
    color: var(--muted);
    font-weight: 600;
}

.log-row input-mock {
    display: inline-block;
}

.log-field {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    min-width: 64px;
    text-align: center;
}

/* Quiz teaser mockup */

.quiz-mini {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.quiz-progress {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 18px;
}

.quiz-progress span {
    display: block;
    height: 100%;
    width: 40%;
    background: var(--lime);
    border-radius: 999px;
}

.quiz-mini p.q {
    font-weight: 700;
    margin-bottom: 14px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-dim);
    transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}

.chip.selected {
    border-color: var(--lime);
    background: rgba(199, 244, 100, 0.12);
    color: var(--lime);
}

/* Calorie dial mockup */

.dial-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.dial {
    position: relative;
    width: 108px;
    height: 108px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--lime) 0deg 265deg, rgba(255, 255, 255, 0.08) 265deg 360deg);
    display: grid;
    place-items: center;
}

.dial::before {
    content: '';
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--bg-elevated);
}

.dial strong {
    position: relative;
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.dial-label span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.dial-label strong {
    font-family: var(--font-display);
    font-size: 1.4rem;
}

.sync-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-dim);
}

.sync-badge svg {
    width: 13px;
    height: 13px;
    color: var(--lime);
}

/* Trend / streak mockup */

.spark-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.spark-card {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.spark-card span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.spark-card svg {
    width: 100%;
    height: 32px;
}

.spark-card path {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.spark-card.up path { stroke: var(--lime); }
.spark-card.down path { stroke: var(--coral); }

.heat-grid {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 14px;
}

.heat-grid span {
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(199, 244, 100, 0.12);
}

.heat-grid span.l1 { background: rgba(199, 244, 100, 0.3); }
.heat-grid span.l2 { background: rgba(199, 244, 100, 0.55); }
.heat-grid span.l3 { background: var(--lime); }

/* Onboarding preview */

.quiz-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.quiz-card {
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 280ms var(--ease), border-color 280ms var(--ease);
}

.quiz-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
}

.quiz-card .q-num {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.82rem;
    margin-bottom: 10px;
}

.quiz-card h4 {
    font-size: 1.08rem;
    margin-bottom: 18px;
    line-height: 1.4;
}

.quiz-card .chip-row {
    flex-direction: column;
}

.quiz-card .chip {
    text-align: left;
}

/* Integrations */

.integ-wheel {
    position: relative;
    width: 100%;
    max-width: 620px;
    aspect-ratio: 1;
    margin: 0 auto;
}

.integ-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(199, 244, 100, 0.22), transparent 70%), var(--bg-elevated);
    border: 1px solid var(--border-strong);
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(199, 244, 100, 0.08), 0 30px 70px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.integ-hub span {
    display: block;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-top: 4px;
}

.integ-spoke {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, rgba(199, 244, 100, 0.35), transparent);
    transform-origin: left center;
    z-index: 0;
}

.integ-node {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--ink-dim);
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: border-color 200ms ease, color 200ms ease;
}

.integ-node:hover {
    border-color: var(--lime);
    color: var(--ink);
}

.integ-copy {
    max-width: 460px;
}

.integ-copy .lede {
    max-width: 100%;
}

/* Testimonials */

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

.testi-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: transform 280ms var(--ease), border-color 280ms var(--ease), box-shadow 280ms var(--ease);
}

.testi-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

.testi-quote-mark {
    font-family: var(--font-display);
    font-size: 2.6rem;
    color: var(--lime);
    line-height: 1;
}

.testi-card p.quote {
    color: var(--ink-dim);
    line-height: 1.7;
    font-size: 1.01rem;
}

.testi-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(199, 244, 100, 0.06);
    font-weight: 700;
    font-size: 0.92rem;
}

.testi-stat .arrow {
    color: var(--lime);
}

.testi-attrib {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

/* Pricing */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 860px;
    margin: 0 auto;
    align-items: center;
}

.price-card {
    position: relative;
    padding: 36px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}

.price-card.featured {
    border-color: var(--lime);
    background: linear-gradient(165deg, rgba(199, 244, 100, 0.1), rgba(255, 255, 255, 0.02));
    box-shadow: 0 30px 90px rgba(199, 244, 100, 0.14);
    transform: scale(1.035);
}

.price-badge {
    position: absolute;
    top: -14px;
    left: 32px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--lime);
    color: var(--lime-ink);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.price-tier {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.price-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    font-family: var(--font-display);
}

.price-amount strong {
    font-size: 2.6rem;
}

.price-amount span {
    color: var(--muted);
    font-weight: 600;
}

.price-sub {
    color: var(--ink-dim);
    font-size: 0.92rem;
    margin-bottom: 24px;
}

.price-list {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: grid;
    gap: 12px;
}

.price-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ink-dim);
    font-size: 0.92rem;
    line-height: 1.4;
}

.price-list svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: var(--lime);
}

.pricing-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 44px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.pricing-trust div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-trust svg {
    width: 16px;
    height: 16px;
    color: var(--lime);
}

/* FAQ */

.faq-list {
    max-width: 780px;
    margin: 0 auto;
    display: grid;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: none;
    border: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.02rem;
    text-align: left;
    cursor: pointer;
}

.faq-q .plus {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    color: var(--lime);
    transition: transform 280ms var(--ease), background 280ms var(--ease);
}

.faq-item.is-open .faq-q .plus {
    transform: rotate(45deg);
    background: rgba(199, 244, 100, 0.14);
}

.faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 380ms var(--ease);
}

.faq-item.is-open .faq-a {
    grid-template-rows: 1fr;
}

.faq-a-inner {
    overflow: hidden;
}

.faq-a-inner p {
    padding: 0 24px 22px;
    color: var(--ink-dim);
    line-height: 1.7;
}

/* Final CTA */

.final-cta {
    position: relative;
    text-align: center;
    padding: 140px 0;
    overflow: hidden;
    isolation: isolate;
}

.final-cta::before {
    content: '';
    position: absolute;
    inset: -20% -10%;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(199, 244, 100, 0.18), transparent 65%);
}

.final-cta h2 {
    max-width: 780px;
    margin: 0 auto 20px;
}

.final-cta .lede {
    margin-inline: auto;
    max-width: 560px;
    font-size: 1.1rem;
}

.final-cta .cta-group {
    justify-content: center;
    margin-top: 40px;
}

.final-cta .cta-micro {
    margin-top: 16px;
}

/* Footer */

.site-footer {
    padding: 72px 0 32px;
    border-top: 1px solid var(--border);
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 0.8fr));
    gap: 40px;
    padding-bottom: 56px;
}

.footer-brand p {
    margin-top: 14px;
    max-width: 320px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.footer-social a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--muted);
    transition: border-color 200ms ease, color 200ms ease;
}

.footer-social a:hover {
    border-color: var(--lime);
    color: var(--lime);
}

.footer-social svg {
    width: 16px;
    height: 16px;
}

.footer-col h4 {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 18px;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.footer-col a {
    color: var(--ink-dim);
    font-size: 0.94rem;
    transition: color 200ms ease;
}

.footer-col a:hover {
    color: var(--lime);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-disclaimer {
    max-width: 620px;
    line-height: 1.6;
}

/* Responsive */

@media (max-width: 1080px) {
    .hero-grid,
    .problem-grid,
    .value-row,
    .value-row.reverse {
        grid-template-columns: 1fr;
    }

    .value-row.reverse .value-copy {
        order: 0;
    }

    .dash,
    .value-visual {
        justify-self: stretch;
        width: 100%;
        max-width: 520px;
        margin-inline: auto;
    }

    .value-row + .value-row {
        margin-top: 80px;
    }

    .quiz-cards,
    .testi-grid {
        grid-template-columns: 1fr;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 860px) {
    .nav-links {
        display: none;
    }

    .nav-login,
    .nav-actions .btn-primary {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .section {
        padding: 88px 0;
    }

    .proof-inner {
        justify-content: center;
        text-align: center;
    }

    .proof-logos {
        justify-content: center;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .price-card.featured {
        transform: none;
        order: -1;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 560px) {
    .hero {
        padding-top: 128px;
    }

    .cta-group {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-group .btn {
        width: 100%;
    }

    .dash-stats,
    .spark-grid {
        grid-template-columns: 1fr 1fr;
    }

    .proof-inner {
        flex-direction: column;
    }

    .integ-wheel {
        max-width: 340px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mesh span,
    .dash,
    .chart-dot {
        animation: none !important;
    }

    .chart-line,
    .chart-fill {
        animation: none !important;
        stroke-dashoffset: 0;
        opacity: 1;
    }

    html {
        scroll-behavior: auto;
    }

    dialog.modal,
    dialog.modal::backdrop {
        transition: none !important;
    }
}

/* ==========================================================================
   Auth pages (login / register)
   ========================================================================== */

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    isolation: isolate;
    overflow: hidden;
}

.auth-shell .mesh {
    position: fixed;
}

.auth-back {
    position: fixed;
    top: 28px;
    left: 28px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    transition: color 200ms ease;
}

.auth-back:hover {
    color: var(--ink);
}

.auth-back svg {
    width: 16px;
    height: 16px;
}

.auth-wrap {
    width: min(100%, 440px);
    z-index: 1;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
}

.auth-card {
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-soft);
}

.auth-card h1 {
    font-size: clamp(1.8rem, 4vw, 2.3rem);
    margin-bottom: 10px;
    text-align: center;
}

.auth-card > p {
    text-align: center;
    color: var(--ink-dim);
    line-height: 1.6;
    margin-bottom: 32px;
}

.auth-field {
    margin-top: 18px;
}

.auth-field:first-of-type {
    margin-top: 0;
}

.auth-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.auth-input-wrap {
    position: relative;
}

/* Password requirement checklist */

.password-reqs {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.password-reqs li {
    position: relative;
    padding-left: 24px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    transition: color 200ms ease;
}

/* Unmet: hollow circle. Met: lime check. */
.password-reqs li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    box-sizing: border-box;
    transition: border-color 200ms ease, background 200ms ease;
}

.password-reqs li.is-met {
    color: var(--ink-dim);
}

.password-reqs li.is-met::before {
    border-color: var(--lime);
    background: var(--lime);
}

.password-reqs li.is-met::after {
    content: "";
    position: absolute;
    left: 5px;
    top: calc(0.15em + 3px);
    width: 4px;
    height: 8px;
    border: solid var(--lime-ink);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.auth-input {
    width: 100%;
    height: 52px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    padding: 0 16px;
    color: var(--ink);
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.auth-input::placeholder {
    color: rgba(146, 160, 150, 0.6);
}

.auth-input:focus {
    border-color: var(--lime);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(199, 244, 100, 0.14);
}

.auth-input-wrap .auth-input {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 200ms ease, background 200ms ease;
}

.password-toggle:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle .icon-hide {
    display: none;
}

.password-toggle.is-visible .icon-show {
    display: none;
}

.password-toggle.is-visible .icon-hide {
    display: block;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 4px;
    color: var(--ink-dim);
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--lime);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 0 4px;
}

.auth-row .auth-check {
    margin: 0;
}

.auth-inline-link {
    color: var(--lime);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.auth-card .btn {
    margin-top: 28px;
}

.auth-link {
    margin: 24px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.94rem;
}

.auth-link a {
    color: var(--lime);
    font-weight: 700;
}

.auth-errors {
    margin: 0 0 24px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(244, 120, 93, 0.3);
    background: rgba(244, 120, 93, 0.1);
    color: #ffb7a3;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-errors strong {
    display: block;
    margin-bottom: 6px;
    color: var(--coral);
}

.auth-errors ul {
    margin: 0;
    padding-left: 18px;
}

/* ==========================================================================
   Measurement dashboard
   ========================================================================== */

.app-shell {
    min-height: 100vh;
    padding-bottom: 80px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 18px 0;
    background: rgba(7, 10, 8, 0.78);
    backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.app-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.app-header .brand {
    font-size: 1.05rem;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-main {
    padding-top: 48px;
}

.app-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.app-intro h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 8px;
}

.app-intro p {
    color: var(--ink-dim);
    font-size: 1.02rem;
}

.btn-icon-danger {
    background: rgba(244, 120, 93, 0.1);
    color: #ffb7a3;
    border: 1px solid rgba(244, 120, 93, 0.24);
}

.btn-icon-danger:hover {
    background: rgba(244, 120, 93, 0.18);
    border-color: rgba(244, 120, 93, 0.4);
    color: #ffd6c9;
    transform: translateY(-1px);
}

.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
}

.notice svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.notice-success {
    background: rgba(199, 244, 100, 0.1);
    border: 1px solid rgba(199, 244, 100, 0.28);
    color: var(--lime);
}

.notice-error {
    align-items: flex-start;
    background: rgba(244, 120, 93, 0.1);
    border: 1px solid rgba(244, 120, 93, 0.28);
    color: #ffb7a3;
}

.notice-error ul {
    margin: 6px 0 0;
    padding-left: 18px;
    font-weight: 500;
}

/* Stat row */

.stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 260ms var(--ease), border-color 260ms var(--ease);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.stat-card strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.7rem;
}

.stat-card strong.up { color: var(--lime); }
.stat-card strong.down { color: var(--coral); }

.stat-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.stat-card small.trend {
    color: var(--ink-dim);
}

/* Body metrics */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (min-width: 640px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.metric-card {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.metric-card strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.1;
}

.metric-card strong em {
    margin-left: 4px;
    font-size: 0.85rem;
    font-style: normal;
    font-weight: 600;
    color: var(--muted);
}

.metric-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.metric-note {
    font-weight: 700;
    color: var(--ink-dim);
}

.metric-note-healthy,
.metric-note-normal {
    color: var(--lime);
}

.metric-note-elevated,
.metric-note-overweight,
.metric-note-underweight {
    color: #f4c95d;
}

.metric-note-high,
.metric-note-obese {
    color: var(--coral);
}

/* Shared dashboard panel */

.panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 24px;
}

.panel-pad {
    padding: 30px;
}

.panel-head {
    margin-bottom: 22px;
}

.panel-head h2 {
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.panel-head p {
    color: var(--muted);
    font-size: 0.94rem;
}

/* Settings panel */

.settings-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 30px;
    flex-wrap: wrap;
}

.settings-copy h2 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.settings-copy p {
    color: var(--muted);
    font-size: 0.9rem;
}

.settings-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.select-wrap select {
    appearance: none;
    min-height: 48px;
    min-width: 220px;
    padding: 0 40px 0 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 200ms ease;
}

.select-wrap select:focus {
    border-color: var(--lime);
}

.select-wrap select option {
    background: var(--bg-elevated);
    color: var(--ink);
}

/* Measurement form */

.measure-group {
    margin: 0 0 24px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.measure-group:last-of-type {
    margin-bottom: 0;
}

.measure-group legend {
    padding: 0 10px;
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.field-grid > div label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.field-grid input {
    width: 100%;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    padding: 0 14px;
    color: var(--ink);
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.field-grid input::placeholder {
    color: rgba(146, 160, 150, 0.45);
}

.field-grid input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px rgba(199, 244, 100, 0.12);
}

.form-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

/* Trend charts */

.trend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.trend-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    transition: transform 260ms var(--ease), border-color 260ms var(--ease);
}

.trend-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.trend-card header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.trend-card strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.trend-card > span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.trend-card svg {
    width: 100%;
    height: 170px;
    overflow: visible;
}

.trend-card polyline {
    fill: none;
    stroke: var(--lime);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trend-card circle {
    fill: var(--lime);
    stroke: var(--bg);
    stroke-width: 2;
    transition: r 200ms ease;
}

.trend-card circle:hover {
    r: 7;
}

.chart-grid-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.empty-note {
    padding: 6px 30px 30px;
    color: var(--muted);
}

/* History list */

.history-panel {
    padding: 30px;
}

.history-head {
    margin-bottom: 22px;
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-entry {
    padding: 20px 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 220ms ease, background 220ms ease;
}

.history-entry:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.history-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.history-entry-head > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.history-entry-head strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.history-entry-head span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.history-entry-actions {
    display: flex;
    gap: 8px;
}

.history-entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.history-chip {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.history-chip span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.history-chip strong {
    font-family: var(--font-display);
    font-size: 0.96rem;
}

.history-entry-empty {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.88rem;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-dim);
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    color: var(--ink);
    transform: translateY(-1px);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.icon-btn-danger {
    border-color: rgba(244, 120, 93, 0.24);
    background: rgba(244, 120, 93, 0.08);
    color: #ffb7a3;
}

.icon-btn-danger:hover {
    background: rgba(244, 120, 93, 0.18);
    border-color: rgba(244, 120, 93, 0.4);
    color: #ffd6c9;
}

/* Modals */

.btn-danger {
    background: var(--coral);
    color: #2a0d06;
    box-shadow: 0 18px 40px rgba(244, 120, 93, 0.22);
}

.btn-danger:hover {
    background: #ff8a68;
    transform: translateY(-2px);
}

dialog.modal {
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    color: var(--ink);
    width: min(720px, calc(100% - 40px));
    max-height: min(86vh, 900px);
    box-shadow: var(--shadow-soft);
    opacity: 1;
    transform: scale(1);
    transition: opacity 220ms var(--ease), transform 220ms var(--ease), overlay 220ms var(--ease) allow-discrete, display 220ms var(--ease) allow-discrete;
}

dialog.modal:not([open]) {
    opacity: 0;
    transform: scale(0.96);
}

@starting-style {
    dialog.modal[open] {
        opacity: 0;
        transform: scale(0.96);
    }
}

dialog.modal::backdrop {
    background: rgba(3, 5, 4, 0.72);
    backdrop-filter: blur(6px);
    transition: background 220ms ease, overlay 220ms ease allow-discrete, display 220ms ease allow-discrete;
}

@starting-style {
    dialog.modal[open]::backdrop {
        background: rgba(3, 5, 4, 0);
    }
}

dialog.modal-sm {
    width: min(440px, calc(100% - 40px));
}

.modal-card {
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    font-size: 1.2rem;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
    transition: color 200ms ease, border-color 200ms ease;
}

.modal-close:hover {
    color: var(--ink);
    border-color: var(--border-strong);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: 22px 26px;
    overflow-y: auto;
}

.modal-body p {
    color: var(--ink-dim);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 26px;
    border-top: 1px solid var(--border);
}

@media (max-width: 1080px) {
    .stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trend-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-intro {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .stat-row,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .panel-pad,
    .history-panel,
    .settings-panel {
        padding: 22px;
    }

    .history-entry-actions {
        gap: 6px;
    }
}

/* ==========================================================================
   Onboarding slideshow
   ========================================================================== */

.onb-body {
    height: 100vh;
    height: 100dvh; /* excludes mobile browser chrome so the layout can't jump */
    overflow: hidden;
}

.onb-shell {
    position: relative;
    height: 100vh;
    height: 100dvh;
    isolation: isolate;
    overflow: hidden;
}

.onb-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
}

.onb-back {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    color: var(--ink);
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}

.onb-back[hidden] {
    display: none;
}

.onb-back:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-2px);
}

.onb-back svg {
    width: 18px;
    height: 18px;
}

.onb-progress {
    flex: 1 1 auto;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.onb-progress-fill {
    height: 100%;
    width: 14.28%;
    border-radius: 999px;
    background: var(--lime);
    box-shadow: 0 0 12px rgba(199, 244, 100, 0.5);
    transition: width 420ms var(--ease);
}

.onb-viewport {
    position: relative;
    height: 100vh;
    height: 100dvh;
}

.onb-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 96px 24px 28px;
    opacity: 0;
    transform: translateX(36px) scale(0.98);
    pointer-events: none;
    overflow-y: auto;
    transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms ease;
}

.onb-slide.is-prev {
    opacity: 0;
    transform: translateX(-36px) scale(0.98);
}

.onb-slide.is-active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.onb-slide-inner {
    width: min(760px, 100%);
    margin: auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 24px;
}

.onb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--lime);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.onb-question {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4.6vw, 3rem);
    line-height: 1.08;
    margin-bottom: 14px;
}

.onb-sub {
    max-width: 560px;
    margin-bottom: 36px;
    color: var(--ink-dim);
    font-size: 1.05rem;
    line-height: 1.6;
}

.onb-slide-foot {
    width: min(760px, 100%);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
}

.onb-skip-link {
    border: 0;
    background: none;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.94rem;
    cursor: pointer;
    padding: 14px 6px;
    transition: color 200ms ease;
}

.onb-skip-link:hover {
    color: var(--ink);
}

/* Cards (goal + cadence) */

.onb-goal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.onb-cadence-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.onb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}

.onb-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.onb-card.is-selected {
    border-color: var(--lime);
    background: linear-gradient(160deg, rgba(199, 244, 100, 0.14), rgba(255, 255, 255, 0.02));
    transform: translateY(-2px) scale(1.015);
}

.onb-card-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(199, 244, 100, 0.12);
    color: var(--lime);
}

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

.onb-card-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
}

.onb-card-hint {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.onb-card-check {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--lime-ink);
    transform: scale(0);
    transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onb-card.is-selected .onb-card-check {
    transform: scale(1);
}

.onb-card-check svg {
    width: 13px;
    height: 13px;
}

/* Toggle pills (units / sex / photos) */

.onb-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.onb-pill {
    padding: 13px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-dim);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease), color 220ms ease;
}

.onb-pill:hover {
    border-color: var(--border-strong);
    color: var(--ink);
}

.onb-pill.is-selected {
    border-color: var(--lime);
    background: var(--lime);
    color: var(--lime-ink);
    transform: scale(1.04);
}

/* Field blocks */

.onb-field-block {
    margin-bottom: 28px;
}

.onb-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 0.98rem;
}

.onb-unit-badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(199, 244, 100, 0.12);
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 700;
}

.onb-optional-badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.onb-microcopy {
    margin: -6px 0 14px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.onb-input {
    width: 100%;
    height: 54px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    padding: 0 16px;
    color: var(--ink);
    font-size: 1rem;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.onb-input::placeholder {
    color: rgba(146, 160, 150, 0.5);
}

.onb-input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 4px rgba(199, 244, 100, 0.14);
}

.onb-field-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* Step 3 — checklist */

.onb-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.onb-check-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
    transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.onb-check-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.onb-check-card input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.onb-check-box {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 7px;
    border: 1px solid var(--border-strong);
    color: transparent;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onb-check-box svg {
    width: 13px;
    height: 13px;
    transform: scale(0);
    transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onb-check-card input:checked ~ .onb-check-box {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--lime-ink);
}

.onb-check-card input:checked ~ .onb-check-box svg {
    transform: scale(1);
}

.onb-check-card:has(input:checked) {
    border-color: var(--lime);
    background: rgba(199, 244, 100, 0.08);
}

/* Step 4 — baseline entry */

.onb-baseline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.onb-baseline-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onb-baseline-empty {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 20px 0;
}

.onb-tooltip-btn {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: color 200ms ease, border-color 200ms ease;
}

.onb-tooltip-btn:hover,
.onb-tooltip-btn[aria-expanded="true"] {
    color: var(--lime);
    border-color: var(--lime);
}

.onb-tooltip-text {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 320ms var(--ease);
    margin: -4px 0 0;
}

.onb-tooltip-text.is-open {
    grid-template-rows: 1fr;
}

.onb-tooltip-text-inner {
    overflow: hidden;
}

.onb-tooltip-text p {
    padding-top: 4px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

/* Step 5 — photos */

.onb-photo-extra {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 380ms var(--ease);
}

.onb-photo-extra.is-open {
    grid-template-rows: 1fr;
}

.onb-photo-extra-inner {
    overflow: hidden;
}

.onb-privacy-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 18px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(199, 244, 100, 0.24);
    background: rgba(199, 244, 100, 0.08);
    color: var(--ink-dim);
    font-size: 0.88rem;
    font-weight: 600;
}

.onb-privacy-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--lime);
}

.onb-file-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
    background: rgba(255, 255, 255, 0.02);
    color: var(--ink-dim);
    font-weight: 700;
    cursor: pointer;
    transition: border-color 200ms ease, background 200ms ease;
    margin-bottom: 10px;
}

.onb-file-drop:hover {
    border-color: var(--lime);
    background: rgba(199, 244, 100, 0.05);
}

.onb-file-drop input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

/* Step 6 — wellness demo */

.onb-demo-card {
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}

.onb-demo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    font-weight: 700;
}

.onb-demo-head span {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.onb-demo-head strong {
    font-family: var(--font-display);
    color: var(--lime);
    font-size: 1.1rem;
}

#onb-demo-slider {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    appearance: none;
    outline: none;
}

#onb-demo-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 6px 18px rgba(199, 244, 100, 0.4);
    cursor: pointer;
    transition: transform 160ms ease;
}

#onb-demo-slider::-webkit-slider-thumb:hover {
    transform: scale(1.12);
}

#onb-demo-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 6px 18px rgba(199, 244, 100, 0.4);
    cursor: pointer;
}

/* Completion */

.onb-slide-complete .onb-slide-inner {
    align-items: center;
    text-align: center;
}

.onb-complete-badge {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 24px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--lime-ink);
    animation: onbBadgePop 560ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onb-complete-badge svg {
    width: 34px;
    height: 34px;
}

@keyframes onbBadgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes onbShake {
    10%, 90% { transform: translateX(-4px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}

.onb-slide.is-active.onb-shake {
    animation: onbShake 420ms ease;
}

@media (max-width: 720px) {
    .onb-goal-grid {
        grid-template-columns: 1fr 1fr;
    }

    .onb-cadence-grid,
    .onb-field-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    /* Compact every step so it fits the screen without scrolling. */
    .onb-topbar {
        padding: 14px 16px;
    }

    .onb-slide {
        padding: 70px 16px 16px;
        overflow-x: hidden;          /* overflow-y:auto otherwise lets content scroll sideways */
        justify-content: flex-start;
    }

    /* Top-align instead of vertical-centering: centering pushes overflowing
       content above the scroll origin, which is what made step 1 jump/lag. */
    .onb-slide-inner {
        justify-content: flex-start;
        margin: 0 auto;
        padding-block: 0;
    }

    .onb-eyebrow {
        margin-bottom: 8px;
    }

    .onb-question {
        font-size: clamp(1.45rem, 6.4vw, 1.9rem);
        margin-bottom: 8px;
    }

    .onb-sub {
        margin-bottom: 16px;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    /* Step 1 — keep goals two-up (not stacked) and shrink the cards. */
    .onb-goal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .onb-card {
        padding: 12px;
        gap: 2px;
    }

    .onb-card-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 6px;
        border-radius: 9px;
    }

    .onb-card-icon svg {
        width: 16px;
        height: 16px;
    }

    .onb-card-label {
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .onb-card-hint {
        font-size: 0.74rem;
    }

    .onb-card-check {
        top: 8px;
        right: 8px;
        width: 18px;
        height: 18px;
    }

    .onb-card-check svg {
        width: 10px;
        height: 10px;
    }

    /* Steps 2+ — tighten fields, stack the paired inputs, no sideways overflow. */
    .onb-field-block {
        margin-bottom: 14px;
    }

    .onb-field-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .onb-toggle-row {
        gap: 8px;
        margin-bottom: 14px;
    }

    .onb-pill {
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    .onb-label {
        margin-bottom: 8px;
        font-size: 0.92rem;
    }

    .onb-microcopy {
        margin: -4px 0 10px;
        font-size: 0.8rem;
    }

    .onb-input {
        height: 48px;
        min-width: 0;
    }

    /* Steps 3 & 4 — two columns so the lists stay short. */
    .onb-check-grid,
    .onb-baseline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .onb-slide-foot {
        padding-top: 12px;
    }

    .onb-skip-link {
        padding: 12px 4px;
        font-size: 0.9rem;
    }

    /* The blurred, endlessly-animating background repaints every frame and is a
       big part of the lag on step 1; hold it still on small screens. */
    .onb-shell .mesh span {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .onb-slide {
        transition: opacity 200ms ease !important;
        transform: none !important;
    }

    .onb-complete-badge {
        animation: none !important;
    }
}

/* ==========================================================================
   Mobile-first app shell (authenticated PWA)
   ========================================================================== */

:root {
    --pwa-appbar-h: 56px;
    --pwa-tabbar-h: 64px;
    --pwa-max: 640px;
}

.pwa-body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
}

.pwa-app {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
}

/* App bar */

.pwa-appbar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    width: min(var(--pwa-max), 100%);
    height: calc(var(--pwa-appbar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(7, 10, 8, 0.82);
    backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.pwa-appbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
}

.pwa-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: rgba(199, 244, 100, 0.12);
    color: var(--lime);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}

.pwa-avatar:hover {
    background: rgba(199, 244, 100, 0.2);
    transform: scale(1.05);
}

/* Scroll region + screens */

.pwa-scroll {
    width: min(var(--pwa-max), 100%);
    margin-inline: auto;
    padding: calc(var(--pwa-appbar-h) + env(safe-area-inset-top) + 20px) 16px
             calc(var(--pwa-tabbar-h) + env(safe-area-inset-bottom) + 28px);
}

.pwa-screen {
    display: none;
}

.pwa-screen.is-active {
    display: block;
    animation: pwaScreenIn 360ms var(--ease);
}

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

.pwa-screen-head {
    margin-bottom: 22px;
}

.pwa-screen-head h1 {
    font-size: clamp(1.7rem, 6vw, 2.1rem);
    margin-bottom: 6px;
}

.pwa-screen-head p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Home */

.pwa-greeting {
    margin-bottom: 20px;
}

.pwa-greeting-eyebrow {
    color: var(--lime);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.pwa-greeting h1 {
    font-size: clamp(1.8rem, 7vw, 2.3rem);
    line-height: 1.05;
}

.pwa-cta {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    margin-bottom: 22px;
    border: 1px solid var(--lime);
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, rgba(199, 244, 100, 0.16), rgba(255, 255, 255, 0.02));
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}

.pwa-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 46px rgba(199, 244, 100, 0.16);
}

.pwa-cta:active {
    transform: translateY(0) scale(0.99);
}

.pwa-cta-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 14px;
    background: var(--lime);
    color: var(--lime-ink);
}

.pwa-cta-icon svg { width: 24px; height: 24px; }

.pwa-cta-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
}

.pwa-cta-copy strong {
    font-family: var(--font-display);
    font-size: 1.08rem;
}

.pwa-cta-copy small {
    color: var(--muted);
    font-size: 0.85rem;
}

.pwa-cta-arrow {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: var(--lime);
}

/* Two-column stat grid inside the narrow app column, regardless of viewport width */

.pwa-app .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.pwa-app .stat-card strong {
    font-size: 1.4rem;
}

.pwa-app .trend-grid {
    grid-template-columns: 1fr;
}

.pwa-panel-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.pwa-empty {
    text-align: center;
}

.pwa-empty-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 4px auto 16px;
    border-radius: 16px;
    background: rgba(199, 244, 100, 0.1);
    color: var(--lime);
}

.pwa-empty-icon svg { width: 28px; height: 28px; }

.pwa-empty h2 { margin-bottom: 8px; }

.pwa-empty p {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 340px;
    margin-inline: auto;
}

/* Settings */

.pwa-settings-form {
    display: grid;
    gap: 12px;
}

.pwa-settings-form .select-wrap select {
    width: 100%;
    min-width: 0;
}

.pwa-account {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pwa-account-avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(199, 244, 100, 0.12);
    color: var(--lime);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
}

.pwa-account strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.pwa-account span {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Profile form */

.pwa-account-avatar-lg {
    width: 72px;
    height: 72px;
    font-size: 1.7rem;
    overflow: hidden;
}

.pwa-account-avatar img,
.pwa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.pwa-avatar { overflow: hidden; padding: 0; }

.pwa-profile-form {
    display: grid;
    gap: 20px;
}

.pwa-password-form {
    display: grid;
    gap: 16px;
}

.pwa-profile-photo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-profile-photo-actions {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.pwa-profile-photo-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* The real file input is visually hidden, so its <label> is the control the
   user sees and clicks. */
.pwa-profile-photo-actions label.btn {
    cursor: pointer;
}

.pwa-profile-photo-actions small {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.pwa-photo-remove {
    color: #ffb7a3;
    border-color: rgba(244, 120, 93, 0.24);
}

.pwa-photo-remove:hover {
    border-color: rgba(244, 120, 93, 0.4);
    background: rgba(244, 120, 93, 0.14);
}

/* The input is sr-only but still focusable, so mirror its focus ring onto the
   label that stands in for it. */
.pwa-profile-photo-buttons:has(~ input:focus-visible) label.btn {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

.field-grid-stack {
    grid-template-columns: minmax(0, 1fr);
}

/* ---- Progress photo: check-in picker ---- */

.photo-field {
    display: flex;
    align-items: center;
    gap: 14px;
}

.photo-field-thumb {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.photo-field-thumb svg {
    width: 24px;
    height: 24px;
    color: var(--muted);
}

.photo-field-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-field-body {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.photo-field-body label.btn {
    cursor: pointer;
    justify-self: start;
}

.photo-field-body small {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---- Progress photo: gallery ---- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.photo-card {
    margin: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
}

.photo-card-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    aspect-ratio: 3 / 4;
}

.photo-card-open img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-card figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
}

.photo-card figcaption span {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
}

@media (min-width: 640px) {
    .photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---- Progress photo: lightbox ---- */

.photo-lightbox {
    max-width: min(92vw, 560px);
    max-height: 92vh;
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    overflow: visible;
}

.photo-lightbox::backdrop {
    background: rgba(4, 6, 5, 0.86);
    backdrop-filter: blur(4px);
}

.photo-lightbox img {
    display: block;
    width: 100%;
    max-height: 92vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.photo-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg, #070a08);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.photo-lightbox-close svg {
    width: 18px;
    height: 18px;
}

.pwa-settings-links {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.pwa-linkrow {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
    font-size: 0.96rem;
    cursor: pointer;
    transition: border-color 200ms ease, background 200ms ease;
}

.pwa-linkrow:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
}

.pwa-linkrow svg { width: 18px; height: 18px; color: var(--muted); }

.pwa-linkrow-danger {
    color: #ffb7a3;
    border-color: rgba(244, 120, 93, 0.24);
    background: rgba(244, 120, 93, 0.08);
}

.pwa-linkrow-danger:hover {
    border-color: rgba(244, 120, 93, 0.4);
    background: rgba(244, 120, 93, 0.14);
}

.pwa-linkrow-danger svg { color: #ffb7a3; }

.pwa-version {
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

/* FAB */

.pwa-fab {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom) + var(--pwa-tabbar-h) - 26px);
    transform: translateX(-50%);
    z-index: 62;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--lime);
    color: var(--lime-ink);
    box-shadow: 0 12px 30px rgba(199, 244, 100, 0.36);
    cursor: pointer;
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}

.pwa-fab svg { width: 26px; height: 26px; }

/* Label only surfaces on desktop, where the FAB becomes an extended pill */
.pwa-fab-label { display: none; }

.pwa-fab:hover {
    transform: translateX(-50%) translateY(-3px) scale(1.04);
    box-shadow: 0 18px 40px rgba(199, 244, 100, 0.44);
}

.pwa-fab:active {
    transform: translateX(-50%) scale(0.96);
}

/* Tab bar */

.pwa-tabbar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 60;
    width: min(var(--pwa-max), 100%);
    height: calc(var(--pwa-tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: 1fr 1fr 64px 1fr 1fr;
    align-items: center;
    background: rgba(7, 10, 8, 0.9);
    backdrop-filter: blur(20px) saturate(140%);
    border-top: 1px solid var(--border);
}

.pwa-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding-top: 10px;
    border: 0;
    background: none;
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 200ms ease;
}

.pwa-tab svg {
    width: 23px;
    height: 23px;
    transition: transform 220ms var(--ease);
}

.pwa-tab.is-active {
    color: var(--lime);
}

.pwa-tab.is-active svg {
    transform: translateY(-2px) scale(1.05);
}

.pwa-tab-gap { display: block; }

/* Log sheet */

.pwa-sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    inset: 0;
    color: var(--ink);
    overflow: hidden;
}

.pwa-sheet::backdrop {
    background: rgba(3, 5, 4, 0.6);
    backdrop-filter: blur(4px);
}

.pwa-sheet-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--pwa-max);
    height: 100%;
    margin-inline: auto;
    background: var(--bg-elevated);
    transform: translateY(100%);
    transition: transform 340ms var(--ease);
}

.pwa-sheet[open] .pwa-sheet-card {
    transform: translateY(0);
}

@starting-style {
    .pwa-sheet[open] .pwa-sheet-card {
        transform: translateY(100%);
    }
}

.pwa-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: calc(env(safe-area-inset-top) + 18px) 20px 18px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.pwa-sheet-head h2 { font-size: 1.2rem; }

.pwa-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.pwa-sheet-body .measure-group { margin-bottom: 16px; }

.pwa-sheet .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pwa-sheet-actions {
    display: flex;
    gap: 12px;
    padding: 16px 20px calc(env(safe-area-inset-bottom) + 16px);
    border-top: 1px solid var(--border);
    flex: 0 0 auto;
}

.pwa-sheet-actions .btn { flex: 1 1 auto; }
.pwa-sheet-actions .btn-ghost { flex: 0 0 auto; }

/* Toast */

.pwa-toast {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(var(--pwa-max), calc(100% - 24px));
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: var(--shadow-soft);
    animation: pwaToastIn 320ms var(--ease);
}

.pwa-toast svg { width: 18px; height: 18px; flex: 0 0 auto; }

.pwa-toast.is-hiding {
    animation: pwaToastOut 300ms var(--ease) forwards;
}

.pwa-toast-success {
    background: #14351f;
    border: 1px solid rgba(199, 244, 100, 0.4);
    color: var(--lime);
}

.pwa-toast-error {
    background: #3a1712;
    border: 1px solid rgba(244, 120, 93, 0.4);
    color: #ffb7a3;
}

@keyframes pwaToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes pwaToastOut {
    to { opacity: 0; transform: translateX(-50%) translateY(-16px); }
}

/* Desktop: present the sheet as a centered rounded modal instead of full-screen */

@media (min-width: 700px) {
    /* Scoped to [open] so the closed dialog keeps the UA's display:none —
       an unscoped display would render the sheet as a ghost panel. */
    .pwa-sheet[open] {
        width: 100vw;
        display: grid;
        place-items: center;
        background: transparent;
    }

    .pwa-sheet-card {
        height: auto;
        max-height: 86vh;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-soft);
        overflow: hidden;
    }

    .pwa-sheet-head {
        padding: 20px 24px;
    }

    .pwa-sheet-actions {
        padding: 16px 24px;
    }
}

@media (max-width: 380px) {
    .pwa-app .stat-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Desktop app shell (>= 1024px)
   The mobile shell pins every region to a 640px centered column. Here the tab
   bar becomes a left sidebar, the app bar spans the viewport, and the content
   column widens so the grids can breathe instead of stretching the phone view.
   ========================================================================== */

@media (min-width: 1024px) {
    :root {
        --pwa-appbar-h: 64px;
        --pwa-sidebar-w: 248px;
        --pwa-gutter: 32px;
        --pwa-content-max: 1180px;
    }

    /* App bar: full width, brand sitting over the sidebar column */

    .pwa-appbar {
        left: 0;
        width: 100%;
        transform: none;
        height: var(--pwa-appbar-h);
        padding: 0 var(--pwa-gutter) 0 24px;
    }

    .pwa-appbar-brand {
        flex: 0 0 auto;
        width: calc(var(--pwa-sidebar-w) - 24px);
        font-size: 1.1rem;
    }

    /* Tab bar -> sidebar */

    .pwa-tabbar {
        top: var(--pwa-appbar-h);
        bottom: 0;
        left: 0;
        transform: none;
        width: var(--pwa-sidebar-w);
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 16px 12px;
        background: rgba(7, 10, 8, 0.6);
        border-top: 0;
        border-right: 1px solid var(--border);
    }

    .pwa-tab {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        height: auto;
        padding: 12px 14px;
        border-radius: var(--radius-sm);
        font-size: 0.92rem;
        transition: color 200ms ease, background 200ms ease;
    }

    .pwa-tab svg { width: 20px; height: 20px; }

    .pwa-tab:hover {
        color: var(--ink);
        background: rgba(255, 255, 255, 0.04);
    }

    .pwa-tab.is-active {
        background: rgba(199, 244, 100, 0.12);
    }

    .pwa-tab.is-active svg { transform: none; }

    .pwa-tab-gap { display: none; }

    /* Content column */

    .pwa-scroll {
        width: auto;
        max-width: none;
        margin-inline: 0;
        margin-left: var(--pwa-sidebar-w);
        padding: calc(var(--pwa-appbar-h) + 32px) var(--pwa-gutter) 104px;
    }

    .pwa-screen {
        max-width: var(--pwa-content-max);
        margin-inline: auto;
    }

    /* Greeting and log CTA share a row instead of stacking full-bleed */

    .pwa-home-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 28px;
        margin-bottom: 28px;
    }

    .pwa-greeting { margin-bottom: 0; }

    .pwa-cta {
        flex: 0 1 380px;
        width: auto;
        margin-bottom: 0;
    }

    .pwa-app .stat-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        margin-bottom: 28px;
    }

    .pwa-app .trend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-entry-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    /* Settings reads as a form, not a full-width wall. Left-aligned so its
       content edge matches the other screens when switching tabs. */

    .pwa-screen[data-screen="settings"] {
        max-width: 760px;
        margin-inline: 0;
    }

    .pwa-settings-form {
        grid-template-columns: auto auto;
        justify-content: start;
        align-items: center;
    }

    .pwa-settings-form .btn-block { width: auto; }

    /* FAB -> extended pill, bottom right */

    .pwa-fab {
        left: auto;
        right: var(--pwa-gutter);
        bottom: var(--pwa-gutter);
        transform: none;
        grid-auto-flow: column;
        gap: 10px;
        width: auto;
        height: 52px;
        padding: 0 22px;
        border-radius: 999px;
        font-family: var(--font-display);
        font-size: 0.95rem;
        font-weight: 700;
    }

    .pwa-fab svg { width: 20px; height: 20px; }

    .pwa-fab-label { display: block; }

    .pwa-fab:hover {
        transform: translateY(-3px);
        box-shadow: 0 18px 40px rgba(199, 244, 100, 0.44);
    }

    .pwa-fab:active {
        transform: scale(0.97);
    }

    /* Wider sheet so the measurement fields get a third column */

    .pwa-sheet-card { max-width: 760px; }

    .pwa-sheet .field-grid,
    .modal .field-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Held back until the four stat cards are wide enough that a value
   like "83.50 cm" stays on one line */
@media (min-width: 1280px) {
    .pwa-app .stat-card strong { font-size: 1.7rem; }
}

@media (min-width: 1440px) {
    .pwa-app .trend-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .pwa-screen.is-active,
    .pwa-toast {
        animation: none;
    }

    .pwa-sheet-card {
        transition: none;
    }
}
