/* Pempol web client — mirrors the mobile app palette (ThemeContext.tsx) */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #C67C4E;
    --primary-dark: #A85D35;
    --primary-soft: #F6E6DA;
    --primary-tint: #FBF4EE;
    --ink: #2F2D2C;
    --muted: #6B6663;
    --faint: #9B9B9B;
    --bg: #F9F9F9;
    --surface: #ffffff;
    --border: #E8E2DC;
    --success: #36C07E;
    --error: #ED5151;
    --warning: #F59E0B;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 10px 30px -18px rgba(47, 45, 44, 0.25);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sidebar: 240px;
    --topbar: 60px;
    --tabbar: 64px;
    /* Colours that used to be literals — tokens so the dark theme can swap them */
    --muted-bg: #EFEAE5;
    --hover-bg: #F3EDE7;
    --box-border: #CFC7C0;
    --success-tint: #E3F7EC;
    --success-ink: #1F7A4D;
    --error-tint: #FDECEC;
    --error-ink: #B3261E;
    --error-hover: #D64545;
    --danger-tint: rgba(237, 81, 81, 0.1);
    --warning-tint: rgba(245, 158, 11, 0.12);
    --overlay: rgba(47, 45, 44, 0.45);
    --topbar-bg: rgba(249, 249, 249, 0.9);
    --toast-bg: #2F2D2C;
    --toast-ink: #fff;
    --shimmer: rgba(255, 255, 255, 0.6);
    --store-bg: #111;
    color-scheme: light;
}

/* Dark theme — the app's dark palette (nomnom/src/contexts/ThemeContext.tsx).
   Chosen in Settings → Theme and stored on the profile (themePreference), like the app. */
:root[data-theme="dark"] {
    --primary: #D17842;
    --primary-dark: #E39463;
    --primary-soft: rgba(209, 120, 66, 0.22);
    --primary-tint: rgba(209, 120, 66, 0.12);
    --ink: #F4F4F4;
    --muted: #AEAEAE;
    --faint: #80838A;
    --bg: #0C0F14;
    --surface: #1B1D23;
    --border: #2A2D36;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    --muted-bg: #262932;
    --hover-bg: #262932;
    --box-border: #4A4E58;
    --success-tint: rgba(54, 192, 126, 0.16);
    --success-ink: #6BD9A4;
    --error-tint: rgba(237, 81, 81, 0.16);
    --error-ink: #F59A9A;
    --error-hover: #F06A6A;
    --danger-tint: rgba(237, 81, 81, 0.15);
    --warning-tint: rgba(245, 158, 11, 0.16);
    --overlay: rgba(0, 0, 0, 0.6);
    --topbar-bg: rgba(12, 15, 20, 0.9);
    --toast-bg: #2E323B;
    --toast-ink: #F4F4F4;
    --shimmer: rgba(255, 255, 255, 0.06);
    --store-bg: #000;
    color-scheme: dark;
}

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

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
ul { list-style: none; }

.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;
}

.boot {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.boot img { animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* ---------- buttons / fields ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.3rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.2;
    border: 1.5px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.6; cursor: default; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -10px rgba(198, 124, 78, 0.8); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-dark); }
.btn-ghost { color: var(--muted); padding: 0.5rem 0.8rem; }
.btn-ghost:hover { color: var(--primary-dark); background: var(--primary-tint); }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-danger { color: var(--error); }

.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.field input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(198, 124, 78, 0.15); }

.alert {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
    margin-bottom: 1rem;
}
.alert-error { background: var(--error-tint); color: var(--error-ink); }
.alert-info { background: var(--primary-tint); color: var(--primary-dark); }

/* ---------- auth screen ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    /* One column on phones: the side panel is hidden below 900px, so a second column only halved the form */
    grid-template-columns: minmax(0, 1fr);
}

.auth-side {
    position: relative;
    display: none;
    background:
        radial-gradient(600px 400px at 20% 20%, rgba(255, 255, 255, 0.18), transparent 60%),
        linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 3rem;
    overflow: hidden;
}

.auth-side h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 1.5rem 0 1rem; }
.auth-side p { opacity: 0.92; max-width: 420px; line-height: 1.65; }
.auth-side ul { margin-top: 1.75rem; display: grid; gap: 0.7rem; }
.auth-side li { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }
.auth-side li svg { width: 20px; height: 20px; flex-shrink: 0; }
.auth-side .logo { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.3rem; text-decoration: none; }
.auth-side .logo img { width: 40px; height: 40px; }

.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-card .logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.3rem; color: var(--primary); text-decoration: none; margin-bottom: 2rem; }
.auth-card .logo img { width: 40px; height: 40px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.auth-card .lead { color: var(--muted); margin-bottom: 1.75rem; }
.auth-foot { margin-top: 1.5rem; font-size: 0.9rem; color: var(--muted); display: grid; gap: 0.5rem; }
.auth-foot a { color: var(--primary-dark); font-weight: 600; }
.google-slot { display: flex; justify-content: center; min-height: 44px; }
.google-consent { text-align: center; margin-top: 0.5rem; }
.field-hint { font-size: 0.8rem; color: var(--faint); margin: 0; }
.field-hint a, .check-row a, .auth-switch a { color: var(--primary-dark); font-weight: 600; }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0; color: var(--faint); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.check-row { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; color: var(--muted); margin: 0.25rem 0 1.1rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.auth-switch { margin-top: 1.1rem; text-align: center; font-size: 0.92rem; color: var(--muted); }
/* ---------- onboarding (mirrors the app's OnBoardingScreen) ---------- */
.onboard { min-height: 100vh; display: flex; justify-content: center; padding: 2.5rem 1.25rem 4rem; }
.onboard-card { width: 100%; max-width: 640px; }
.onboard-card .logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.2rem; color: var(--primary); text-decoration: none; margin-bottom: 1.5rem; }
.onboard-card .logo img { width: 36px; height: 36px; }
.onboard-card h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.onboard-card .lead { color: var(--muted); margin: 0.3rem 0 0.5rem; }
.ob-h { font-size: 1.05rem; font-weight: 800; margin: 1.75rem 0 0.35rem; }
.ob-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.mode-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.mode-card { display: grid; justify-items: start; gap: 0.25rem; text-align: left; padding: 1rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); transition: border-color 0.2s ease, background-color 0.2s ease; }
.mode-card svg { width: 24px; height: 24px; margin-bottom: 0.25rem; }
.mode-card strong { color: var(--ink); font-size: 1rem; }
.mode-card span { font-size: 0.85rem; }
.mode-card:hover { border-color: var(--primary); }
.mode-card.active { border-color: var(--primary); background: var(--primary-tint); color: var(--primary-dark); }
.mode-card.active strong { color: var(--primary-dark); }
.stepper { display: inline-flex; align-items: center; gap: 0.75rem; }
.stepper-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); color: var(--primary-dark); font-size: 1.4rem; font-weight: 700; line-height: 1; }
.stepper-btn:hover { border-color: var(--primary); }
.stepper-val { min-width: 3.5rem; text-align: center; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.pack-card { display: grid; gap: 0.35rem; text-align: left; padding: 0.9rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color 0.2s ease, background-color 0.2s ease; }
.pack-card:hover { border-color: var(--primary); }
.pack-card.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pack-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.pack-tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.pack-tick svg { width: 13px; height: 13px; opacity: 0; }
.pack-card.active .pack-tick { background: #fff; border-color: #fff; color: var(--primary-dark); }
.pack-card.active .pack-tick svg { opacity: 1; }
.pack-desc { font-size: 0.85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pack-author { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.pack-author img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.pack-count { font-size: 0.8rem; font-weight: 700; color: var(--primary-dark); }
.pack-card.active .pack-desc, .pack-card.active .pack-author, .pack-card.active .pack-count { color: rgba(255, 255, 255, 0.9); }
#obAllergens .chips { justify-content: flex-start; }
.ob-start { margin-top: 2rem; }
/* 14-day trial offer card (mirrors the app's onboarding trial card) */
.trial-card { margin-top: 1.25rem; padding: 1rem 1.1rem; border: 2px solid var(--primary); border-radius: var(--radius); background: var(--surface); }
.trial-head { display: flex; align-items: center; gap: 0.5rem; font-size: 1.02rem; }
.trial-head svg { width: 20px; height: 20px; color: var(--primary-dark); flex-shrink: 0; }
.trial-head strong { font-weight: 800; }
.trial-lead { color: var(--muted); font-size: 0.88rem; margin: 0.3rem 0 0.6rem; }
.trial-benefits { list-style: none; margin: 0 0 0.85rem; padding: 0; display: grid; gap: 0.3rem; }
.trial-benefits li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.trial-benefits svg { width: 14px; height: 14px; color: var(--primary-dark); flex-shrink: 0; }
.trial-actions { display: flex; align-items: center; gap: 0.6rem; }
.trial-actions .btn-primary { flex: 1; }
.trial-done { color: var(--primary-dark); }
/* Onboarding footer: consent + start stay on screen while the form scrolls */
.ob-footer { position: sticky; bottom: 0; z-index: 2; margin-top: 2rem; padding: 0.9rem 0 1rem; background: var(--bg); border-top: 1px solid var(--border); }
.consent-card { display: flex; align-items: center; gap: 0.75rem; min-height: 64px; margin: 0 0 0.7rem; padding: 0.65rem 0.8rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.consent-card:has(input:checked) { border-color: var(--primary); }
.consent-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); }
.consent-icon svg { width: 20px; height: 20px; }
.consent-text { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.consent-text strong { font-size: 0.98rem; font-weight: 700; color: var(--ink); }
.consent-text span { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 379px) { .consent-icon { display: none; } }
.ob-footer .ob-start { margin-top: 0; }
.ob-recommended { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; margin-top: 0.5rem; }
.ob-recommended small { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; }
/* Trial as the main CTA of a premium gate / the post-plan card */
.trial-cta { margin: 0.75rem 0 0.25rem; }
.trial-cta .btn svg { width: 18px; height: 18px; }
.trial-hint { text-align: center; margin-top: 0.4rem; }
/* One inline ask above the plan (retention asks — one per session) */
.prompt-card { margin: 0 0 1rem; padding: 1rem 1.1rem; border: 1.5px solid var(--primary); border-radius: var(--radius); background: var(--surface); }
.prompt-head { display: flex; align-items: center; gap: 0.5rem; }
.prompt-head strong { flex: 1; font-weight: 800; font-size: 1.02rem; }
.prompt-card p { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 0; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.invite-ask { display: flex; justify-content: center; margin-bottom: 0.5rem; }
.invite-ask svg { width: 40px; height: 40px; color: var(--primary-dark); }
@media (max-width: 520px) { .mode-row { grid-template-columns: 1fr; } }

/* ---------- cookie consent (same decision key as the landing) ---------- */
.consent-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; max-width: 720px; margin: 0 auto; padding: 0.8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.consent-bar p { font-size: 0.88rem; color: var(--muted); }
.consent-bar a { color: var(--primary-dark); font-weight: 600; }
.consent-actions { display: flex; gap: 0.5rem; }
/* Keep clear of the mobile tab bar */
@media (max-width: 899px) { .consent-bar { bottom: calc(var(--tabbar) + 12px); } }
.auth-lang { margin-top: 2rem; }

@media (min-width: 900px) {
    .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .auth-side { display: flex; flex-direction: column; justify-content: center; }
}

/* ---------- shell ---------- */
.shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: none;
    flex-direction: column;
    padding: 1.25rem 0.9rem;
    z-index: 20;
}

.sidebar .logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.2rem; color: var(--primary); text-decoration: none; padding: 0.25rem 0.6rem 1.25rem; }
.sidebar .logo img { width: 36px; height: 36px; }

.nav { display: grid; gap: 0.25rem; }
.nav a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    color: var(--muted);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav a:hover { background: var(--primary-tint); color: var(--primary-dark); }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); }

.sidebar-foot { margin-top: auto; display: grid; gap: 0.5rem; min-width: 0; }
.sidebar-foot .btn { justify-content: flex-start; }
.sidebar-user { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; border-radius: 12px; background: var(--bg); text-decoration: none; min-width: 0; overflow: hidden; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark);
    display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
    object-fit: cover; overflow: hidden;
}
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .who strong { display: block; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who span { display: block; font-size: 0.78rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar {
    position: sticky; top: 0; z-index: 15;
    height: var(--topbar);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 1rem;
    background: var(--topbar-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar .logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--primary); text-decoration: none; }
.topbar .logo img { width: 30px; height: 30px; }
.topbar h1 { font-size: 1.05rem; font-weight: 800; margin-left: auto; margin-right: auto; }
.topbar .spacer { flex: 1; }

.main { padding: 1.25rem 1rem calc(var(--tabbar) + 1.5rem); max-width: 1040px; margin: 0 auto; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 20;
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 0.7rem; font-weight: 700; color: var(--faint); text-decoration: none;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--primary); }

@media (min-width: 900px) {
    .sidebar { display: flex; }
    .topbar { display: none; }
    .tabbar { display: none; }
    .shell { padding-left: var(--sidebar); }
    .main { padding: 2rem 2.5rem 3rem; }
}

/* ---------- page pieces ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); font-size: 0.95rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
}

.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}
.empty .big { font-size: 2.4rem; margin-bottom: 0.5rem; }
.empty h3 { color: var(--ink); font-size: 1.1rem; margin-bottom: 0.35rem; }
.empty .btn { margin-top: 1rem; }

.skeleton { position: relative; overflow: hidden; background: var(--muted-bg); border-radius: 12px; min-height: 60px; }
.skeleton::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, var(--shimmer), transparent);
    animation: shimmer 1.2s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skeleton-list { display: grid; gap: 0.75rem; }

.chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.6rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 700;
    background: var(--primary-soft); color: var(--primary-dark);
    white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip-muted { background: var(--muted-bg); color: var(--muted); }
.chip-success { background: var(--success-tint); color: var(--success-ink); }

.toast {
    position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px);
    transform: translateX(-50%) translateY(20px);
    background: var(--toast-bg); color: var(--toast-ink);
    padding: 0.7rem 1.1rem; border-radius: 999px;
    font-size: 0.9rem; font-weight: 600;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- plan ---------- */
.daystrip {
    display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1.25rem;
    scrollbar-width: none;
}
.daystrip::-webkit-scrollbar { display: none; }
.daystrip button {
    flex: 0 0 auto;
    min-width: 64px;
    padding: 0.55rem 0.6rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: grid; justify-items: center; gap: 2px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.daystrip button .dow { font-size: 0.7rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.daystrip button .dom { font-size: 1.1rem; font-weight: 800; }
.daystrip button .dots { height: 6px; display: flex; gap: 3px; }
.daystrip button .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.daystrip button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.daystrip button.active .dow { color: rgba(255,255,255,0.8); }
.daystrip button.active .dots i { background: #fff; }
.daystrip button.today:not(.active) { border-color: var(--primary); }

.day-title { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.85rem; }
.day-title h3 { font-size: 1.2rem; font-weight: 800; }
.day-title span { color: var(--faint); font-size: 0.9rem; }

.meal-group { margin-bottom: 1.1rem; }
.meal-group h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 0.5rem; }
.meal-list { display: grid; gap: 0.6rem; }
.meal {
    display: flex; align-items: center; gap: 0.85rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.65rem 0.8rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.meal:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.thumb {
    width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
    background: var(--primary-soft); object-fit: cover;
    display: grid; place-items: center; color: var(--primary-dark); font-size: 1.3rem;
}
.meal .info { min-width: 0; flex: 1; }
.meal .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal .meta { font-size: 0.82rem; color: var(--muted); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.meal .meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.meal .meta svg { width: 14px; height: 14px; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.6rem; }
.week .wday { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem; min-height: 140px; }
.week .wday h5 { font-size: 0.75rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; display: flex; justify-content: space-between; }
.week .wday.today { border-color: var(--primary); }
.week .wday ul { display: grid; gap: 0.3rem; }
.week .wday li a { display: block; font-size: 0.78rem; font-weight: 600; line-height: 1.3; padding: 0.3rem 0.4rem; border-radius: 8px; background: var(--primary-tint); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week .wday li a small { display: block; font-weight: 600; color: var(--faint); font-size: 0.68rem; }

.segmented { display: inline-flex; background: var(--muted-bg); border-radius: 999px; padding: 3px; }
.segmented button { padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

/* ---------- shopping ---------- */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.85rem; }
.list-card { text-decoration: none; display: flex; flex-direction: column; gap: 0.5rem; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.list-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.list-card .title { font-weight: 800; font-size: 1.05rem; display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.list-card .sub { color: var(--muted); font-size: 0.85rem; }
.progress { height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--success); border-radius: 99px; transition: width 0.3s ease; }

.items { display: grid; gap: 0.5rem; }
.item {
    display: flex; align-items: center; gap: 0.8rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 0.65rem 0.8rem;
    width: 100%; text-align: left;
    transition: background-color 0.2s ease;
}
.item .box {
    width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0;
    border: 2px solid var(--box-border); display: grid; place-items: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.item .box svg { width: 14px; height: 14px; color: #fff; opacity: 0; }
.item .pname { flex: 1; font-weight: 600; }
.item .qty { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.item.checked { background: var(--bg); }
.item.checked .box { background: var(--success); border-color: var(--success); }
.item.checked .box svg { opacity: 1; }
.item.checked .pname { color: var(--faint); text-decoration: line-through; }
.item.busy { opacity: 0.6; }
.items-head { display: flex; justify-content: space-between; align-items: center; margin: 1.1rem 0 0.5rem; }
.items-head h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }

.back { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.8rem; }
.back svg { width: 18px; height: 18px; }

/* ---------- recipes ---------- */
.search {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px;
    padding: 0.55rem 1rem; margin-bottom: 1.1rem; max-width: 440px;
}
.search svg { width: 18px; height: 18px; color: var(--faint); flex-shrink: 0; }
.search input { border: 0; outline: none; background: transparent; width: 100%; }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
@media (min-width: 600px) { .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; } }
.recipe-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.recipe-card .img { aspect-ratio: 4 / 3; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary-dark); font-size: 2rem; }
.recipe-card .img img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card .body { padding: 0.75rem 0.85rem 0.9rem; }
.recipe-card .name { font-weight: 700; line-height: 1.3; margin-bottom: 0.3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-card .meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 0.7rem; }
.recipe-card .meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.recipe-card .meta svg { width: 14px; height: 14px; }

.recipe-detail { display: grid; gap: 1.25rem; }
.recipe-hero { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.recipe-hero .img { border-radius: var(--radius-lg); overflow: hidden; background: var(--primary-soft); aspect-ratio: 16 / 9; display: grid; place-items: center; font-size: 3rem; color: var(--primary-dark); }
.recipe-hero .img img { width: 100%; height: 100%; object-fit: cover; }
.recipe-hero h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.5rem; }
.recipe-hero .meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.source-chip { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; margin-top: 0.6rem; padding: 0.25rem 0.75rem 0.25rem 0.6rem; border-radius: 999px; background: var(--primary-tint); border: 1px solid var(--primary-soft); color: var(--primary-dark); font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s; }
.source-chip:hover { background: var(--primary-soft); border-color: var(--primary); }
.source-chip svg { width: 16px; height: 16px; flex-shrink: 0; }
.source-chip svg:last-child { width: 13px; height: 13px; opacity: 0.7; }
.source-chip .source-label { color: var(--muted); font-weight: 500; }
.source-chip .source-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.recipe-cols { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 800px) {
    .recipe-hero { grid-template-columns: 1.1fr 1fr; align-items: start; }
    .recipe-cols { grid-template-columns: 0.9fr 1.3fr; }
}
.ingredients li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--border); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients .amt { color: var(--muted); white-space: nowrap; }
.steps { counter-reset: step; display: grid; gap: 0.9rem; }
.steps li { display: flex; gap: 0.85rem; }
.steps li::before {
    counter-increment: step; content: counter(step);
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark);
    display: grid; place-items: center; font-weight: 800; font-size: 0.9rem;
}
.steps li p { padding-top: 0.25rem; line-height: 1.6; }
.card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.6rem; }

/* ---------- shared bits (premium card, wallet, auth) ---------- */
.kv { display: grid; gap: 0.6rem; }
.kv div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { font-weight: 600; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.stack { display: grid; gap: 1rem; }
.lang-select { display: flex; align-items: center; gap: 0.6rem; }
.lang-select select { padding: 0.5rem 0.75rem; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); }

.store-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.store-row a {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--store-bg); color: #fff; text-decoration: none; border: 1px solid var(--border);
    padding: 0.45rem 0.85rem; border-radius: 10px; font-weight: 700; font-size: 0.85rem;
}
.store-row a svg { width: 18px; height: 18px; }

/* ---------- editing layer (plan/lists/recipes/profile write features) ---------- */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    color: var(--faint); transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--hover-bg); color: var(--error); }
.icon-btn:disabled { opacity: 0.4; }

.field select, .field textarea {
    padding: 0.7rem 0.9rem; border: 1.5px solid var(--border); border-radius: 12px;
    background: var(--surface); width: 100%;
    font: inherit; color: inherit;
}
.field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(198, 124, 78, 0.15); }
.field select[size] { padding: 0.35rem; }
.field select[size] option { padding: 0.4rem 0.55rem; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8rem; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 0.55rem; margin: 0.25rem 0 1rem; cursor: pointer; font-size: 0.95rem; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.hint { color: var(--muted); font-size: 0.88rem; margin: 0.5rem 0; }

/* modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: var(--overlay);
    display: grid; place-items: center; padding: 1rem;
}
.modal-card {
    position: relative;
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    width: 100%; max-width: 460px; max-height: calc(100vh - 2rem); overflow-y: auto;
    padding: 1.4rem 1.4rem 1.2rem;
}
.modal-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.9rem; padding-right: 2rem; }
.modal-lead { color: var(--muted); font-size: 0.92rem; margin: -0.5rem 0 1rem; }
.modal-close { position: absolute; top: 0.8rem; right: 0.8rem; }
.modal-close:hover { color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.btn-danger-solid { background: var(--error); box-shadow: 0 8px 18px -10px rgba(237, 81, 81, 0.8); }
.btn-danger-solid:hover:not(:disabled) { background: var(--error-hover); }

/* plan editing */
.meal-row { display: flex; align-items: center; gap: 0.35rem; }
.meal-row .meal { flex: 1; min-width: 0; }
.meal-del { opacity: 0.55; }
.meal-row:hover .meal-del { opacity: 1; }

/* shopping editing */
.item-row { display: flex; align-items: center; gap: 0.35rem; }
.item-row .item { flex: 1; min-width: 0; }
.item-del { opacity: 0.55; }
.item-row:hover .item-del { opacity: 1; }
.add-item {
    display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
    background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius);
    padding: 0.6rem; margin-bottom: 1rem;
}
.add-item input { border: 1.5px solid var(--border); border-radius: 10px; padding: 0.5rem 0.7rem; background: var(--surface); }
.add-item input:focus { outline: none; border-color: var(--primary); }
.add-item #aiName { flex: 2 1 160px; min-width: 0; }
.add-item #aiQty { flex: 0 1 90px; min-width: 70px; }
.add-item #aiUnit { flex: 0 1 90px; min-width: 70px; }

/* recipe editing */
.recipe-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.9rem; }
.recipe-actions .btn { text-decoration: none; }
/* Cooking mode: a play button with the actions, like the app's header */
.recipe-actions .btn-play { padding: 0.4rem 0.6rem; color: var(--primary); }
.recipe-actions .btn-play svg { width: 22px; height: 22px; }
/* The servings chip of a recipe opened from the plan picks who eats it */
.chip-btn { border: 0; cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 700; }
.chip-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }

/* planned meal sheet (recipe opened from the plan) */
.pe-label { margin: 1rem 0 0.5rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pe-days { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.3rem; scrollbar-width: thin; }
.pe-meals { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pe-days .chip, .pe-meals .chip { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
.pe-eaters { display: grid; }
.pe-eater { display: flex; align-items: center; gap: 0.75rem; min-height: 48px; padding: 0.35rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.pe-eater input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.pe-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-kcal { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.pe-summary { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 0.75rem; }
.pe-edit-recipe { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.1rem; text-decoration: none; }
.pe-edit-recipe svg { width: 18px; height: 18px; }
.editor h3 { margin-top: 1.2rem; }
.editor .btn-ghost { margin-top: 0.4rem; }
.ing-block { margin-bottom: 0.5rem; }
.ing-row { display: flex; gap: 0.5rem; align-items: center; }
.ing-row input { border: 1.5px solid var(--border); border-radius: 10px; padding: 0.5rem 0.7rem; background: var(--surface); }
.ing-row input:focus { outline: none; border-color: var(--primary); }
.ing-row .ing-name { flex: 2 1 140px; min-width: 0; }
.ing-row .ing-amt { flex: 0 1 90px; min-width: 64px; }
.ing-row .ing-unit { flex: 0 1 84px; min-width: 56px; }
.row-btns { display: inline-flex; flex-shrink: 0; }
.row-btns .icon-btn { width: 28px; height: 28px; }
.row-btns .row-up:hover, .row-btns .row-down:hover { color: var(--primary-dark); }
/* suggestion chips (ingredient dictionary + canonical units) */
.sugg-row { margin: 0.35rem 0 0.15rem; }
.sugg-row[hidden] { display: none; }
.sugg-row .chip-pick.active { background: var(--success-tint); border-color: var(--success); color: var(--success-ink); }
.step-block { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.5rem; }
.step-block .step-num {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; margin-top: 0.35rem;
    background: var(--primary-soft); color: var(--primary-dark);
    display: grid; place-items: center; font-weight: 800; font-size: 0.85rem;
}
.step-block textarea {
    flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 10px; padding: 0.5rem 0.7rem;
    background: var(--surface); resize: vertical; min-height: 56px;
    /* Browsers default <textarea> to monospace — inherit the app font instead */
    font: inherit; color: inherit;
}
.step-block textarea:focus { outline: none; border-color: var(--primary); }
/* main image editing */
.photo-edit .photo-preview {
    width: 100%; max-width: 340px; aspect-ratio: 16 / 10; object-fit: cover;
    border-radius: var(--radius); border: 1px solid var(--border);
}
.photo-edit .recipe-actions { margin-top: 0.6rem; }
/* step media on the recipe page */
.steps li .step-body { flex: 1; min-width: 0; }
.step-media-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.step-media { max-width: 200px; max-height: 150px; border-radius: 10px; border: 1px solid var(--border); object-fit: cover; }

/* toggle chips (meal types / diets / allergens) */
.chips-toggle { justify-content: flex-start; margin-bottom: 0.4rem; }
.chip-pick { border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip-pick:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip-pick.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 700; }
.pref-h { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin: 0.9rem 0 0.45rem; }

/* premium / paywall */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.plan-card {
    border: 1.5px solid var(--border); border-radius: var(--radius); padding: 0.9rem;
    display: flex; flex-direction: column; gap: 0.45rem; background: var(--surface);
}
.plan-card.plan-best { border-color: var(--primary); background: var(--primary-tint); }
.plan-name { font-weight: 800; font-size: 0.95rem; }
.plan-price { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-price span { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-left: 0.2rem; }

/* ---------- premium AI features (import + quick inventory) ---------- */
.import-tabs { margin-bottom: 1rem; }
.inv-chip { border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; }
.inv-chip:hover { border-color: var(--error); color: var(--error); }
.inv-matches { display: grid; gap: 0.1rem; margin-bottom: 0.5rem; max-height: 240px; overflow-y: auto; }
.inv-matches .check { margin: 0; padding: 0.3rem 0; }
.inv-bar {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    background: var(--primary-tint); border: 1.5px solid var(--primary-soft); border-radius: var(--radius);
    padding: 0.5rem 0.75rem; margin-bottom: 1rem;
}
.inv-bar-label { font-size: 0.85rem; font-weight: 700; color: var(--primary-dark); }
.recipe-card .img { position: relative; }

/* ---------- cooking mode (full-screen, step by step) ---------- */
.cook {
    position: fixed; inset: 0; z-index: 70;
    background: var(--bg);
    display: flex; flex-direction: column;
}
.cook-head {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
    max-width: 860px; width: 100%; margin: 0 auto;
}
.cook-head .icon-btn { width: 44px; height: 44px; color: var(--ink); }
.cook-head .icon-btn svg { width: 24px; height: 24px; }
.cook-head .icon-btn:hover { color: var(--ink); }
.cook-title { flex: 1; min-width: 0; text-align: center; }
.cook-title small { display: block; color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-title strong { font-size: 1.15rem; font-weight: 800; }
.cook-progress { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; max-width: 820px; width: calc(100% - 2rem); margin: 0 auto; }
.cook-progress i { display: block; height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.25s ease; }
.cook-pill {
    align-self: center; margin-top: 0.8rem;
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.9rem; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 0.88rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cook-pill svg { width: 16px; height: 16px; color: var(--primary); }
.cook-pill.expired, .cook-pill.expired svg { color: var(--error); }
.cook-body { flex: 1; overflow-y: auto; }
.cook-inner { max-width: 820px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
/* Deliberately large: read from a counter away, with the laptop or tablet on the side */
.cook-step { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.cook-chip {
    margin-top: 2rem;
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.2rem; border-radius: 999px;
    border: 1.5px solid var(--primary); color: var(--primary-dark);
    font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cook-chip svg { width: 20px; height: 20px; }
.cook-chip:hover { background: var(--primary-tint); }
.cook-timer {
    margin-top: 2rem; padding: 1.5rem;
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    display: grid; justify-items: center; gap: 1rem;
}
.cook-clock { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cook-clock.expired { color: var(--error); font-size: 2rem; }
.cook-timer-ctrl { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.cook-timer-ctrl button {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.1rem; border-radius: 999px;
    background: var(--primary-tint); color: var(--primary-dark); font-weight: 700;
}
.cook-timer-ctrl svg { width: 18px; height: 18px; }
.cook-panel { margin-top: 1.5rem; padding: 1rem 1.2rem; border-radius: var(--radius-lg); }
.cook-panel.solid { background: var(--surface); box-shadow: var(--shadow); margin-top: 2rem; }
.cook-panel.outline { border: 1px solid var(--border); }
.cook-panel-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cook-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; }
.cook-toggle svg { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s ease; }
.cook-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.cook-ing { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; font-size: 1.1rem; }
.cook-ing + .cook-ing { border-top: 1px solid var(--border); }
.cook-ing .amt { color: var(--muted); font-weight: 700; white-space: nowrap; }
/* Big targets on purpose — used with messy hands */
.cook-foot {
    border-top: 1px solid var(--border); background: var(--surface);
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
}
.cook-foot-inner { max-width: 820px; margin: 0 auto; display: flex; gap: 0.75rem; }
.cook-foot .btn { padding: 1rem 1.2rem; font-size: 1.05rem; border-radius: var(--radius); }
.cook-foot .cook-prev { flex: 1; }
.cook-foot .cook-next { flex: 2; }
.cook-foot .spacer { flex: 1; }
.cook-done { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; padding: 2rem; }
.cook-done .badge { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 2.6rem; }
.cook-done h2 { font-size: 2rem; font-weight: 800; margin-top: 1.5rem; }
.cook-done p { color: var(--muted); font-size: 1.1rem; margin: 0.4rem 0 2rem; }
.cook-done .btn { padding: 1rem 3rem; font-size: 1.05rem; }
.inv-badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--success); color: #fff;
    font-size: 0.75rem; font-weight: 800; padding: 0.15rem 0.5rem; border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ---------- settings (1:1 with the app's SettingsList — docs/design/patterns.md) ---------- */
.topbar-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; text-decoration: none; flex-shrink: 0; }
.topbar-avatar .avatar { width: 34px; height: 34px; font-size: 0.8rem; }
.topbar-avatar.active .avatar, .sidebar-user.active .avatar { box-shadow: 0 0 0 2px var(--primary); }
.topbar-spacer { width: 34px; flex-shrink: 0; }
.sidebar-user.active { background: var(--primary-soft); }

.s-page { max-width: 640px; margin: 0 auto; }
.s-back { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); font-weight: 600; font-size: 0.9rem; text-decoration: none; margin: 0 0 0.5rem -0.3rem; }
.s-back svg { width: 18px; height: 18px; }
.s-back:hover { color: var(--primary-dark); }
.s-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1.1rem; }
.s-intro { color: var(--muted); font-size: 0.92rem; line-height: 1.5; margin: 0 0.25rem 1rem; }

.s-profile { display: flex; align-items: center; gap: 0.9rem; padding: 1rem; margin-bottom: 1.5rem; background: var(--surface); border-radius: 16px; text-decoration: none; color: var(--ink); }
.s-profile .avatar { width: 52px; height: 52px; font-size: 1.15rem; }
.s-profile .s-text strong { display: block; font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.s-profile .s-text span { display: block; color: var(--muted); font-size: 0.9rem; }

.s-group { margin-bottom: 1.5rem; }
.s-group-title { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin: 0 0.25rem 0.5rem; }
.s-card { background: var(--surface); border-radius: 16px; overflow: hidden; }
.s-footer { font-size: 0.8rem; line-height: 1.45; color: var(--muted); margin: 0.5rem 0.25rem 0; }
.s-footer-top { margin: -0.2rem 0.25rem 0.6rem; }

.s-row { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 52px; padding: 0.75rem 1rem; text-align: left; text-decoration: none; color: var(--ink); background: none; }
.s-row + .s-row { border-top: 1px solid var(--border); }
a.s-row:hover, button.s-row:hover, .s-profile:hover { background: var(--primary-tint); }
.s-icon { display: grid; place-items: center; width: 22px; color: var(--faint); flex-shrink: 0; }
.s-icon svg { width: 20px; height: 20px; }
.s-text { flex: 1; min-width: 0; }
.s-label { display: block; font-size: 1rem; }
.s-desc { display: block; font-size: 0.82rem; line-height: 1.4; color: var(--muted); margin-top: 0.1rem; }
.s-value { color: var(--faint); font-size: 0.95rem; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-chev { display: grid; place-items: center; color: var(--faint); flex-shrink: 0; }
.s-chev svg { width: 18px; height: 18px; }
.s-danger .s-icon, .s-danger .s-value { color: var(--error); }
.s-danger.s-action .s-label { color: var(--error); }
.s-row:disabled { opacity: 0.6; }

.s-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border); color: #fff; flex-shrink: 0; }
.s-check svg { width: 15px; height: 15px; opacity: 0; }
.s-check.on { background: var(--primary); border-color: var(--primary); }
.s-check.on.danger { background: var(--error); border-color: var(--error); }
.s-check.on svg { opacity: 1; }
.s-tick { display: grid; place-items: center; color: var(--primary); }
.s-tick svg { width: 20px; height: 20px; }
.s-sheet { background: var(--bg); max-height: 60vh; overflow-y: auto; }

.s-safety { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; margin-bottom: 1.1rem; border-radius: 16px; background: var(--danger-tint); }
.s-safety svg { width: 22px; height: 22px; color: var(--error); flex-shrink: 0; }
.s-safety p { font-size: 0.92rem; line-height: 1.45; }

.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background-color 0.2s ease; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s ease; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(198, 124, 78, 0.3); }

.s-stepper { display: inline-flex; align-items: center; gap: 0.75rem; }
.s-step { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); color: var(--primary); background: var(--surface); }
.s-step svg { width: 17px; height: 17px; }
.s-step:disabled { opacity: 0.35; cursor: default; }
.s-step-val { min-width: 1.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.s-modes { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }
.s-mode { display: grid; gap: 0.4rem; text-align: left; padding: 1rem; border-radius: 16px; background: var(--surface); border: 2px solid transparent; color: var(--ink); }
.s-mode.active { border-color: var(--primary); }
.s-mode-head { display: flex; align-items: center; gap: 0.75rem; }
.s-mode-head svg { width: 22px; height: 22px; color: var(--faint); flex-shrink: 0; }
.s-mode-head strong { flex: 1; font-size: 1.05rem; }
.s-mode.active .s-mode-head svg, .s-mode.active .s-mode-head strong { color: var(--primary); }
.s-mode-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.45; padding-left: calc(22px + 0.75rem); }
.s-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.active > .s-mode-head .s-radio, .s-radio-row.active .s-radio { border-color: var(--primary); box-shadow: inset 0 0 0 3px var(--surface); background: var(--primary); }

.s-form-card { display: grid; gap: 0.25rem; }
.s-form-card > .btn { margin-top: 0.5rem; }
.s-hint { margin: -0.6rem 0 0.9rem; }
.sp-photo { display: grid; justify-items: center; gap: 0.35rem; margin-bottom: 1.25rem; text-align: center; }
.sp-avatar .avatar { width: 96px; height: 96px; font-size: 2.1rem; transition: opacity 0.2s; }
.sp-photo.busy .sp-avatar .avatar { opacity: 0.45; }
.sp-photo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem; }
.sp-photo-actions .btn { color: var(--primary-dark); font-weight: 600; }
.s-chips { justify-content: flex-start; }
.s-radios { display: grid; gap: 0.1rem; }
.s-radio-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; text-align: left; font-size: 0.95rem; color: var(--ink); }
.s-requirement { font-weight: 700; color: var(--primary-dark); margin-bottom: 0.5rem; }
.s-consent-title { font-size: 1rem; font-weight: 800; }
.s-consent-body { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.s-link { color: var(--primary-dark); font-weight: 600; }
.s-add { margin-top: 0.75rem; }
.s-input { padding: 0.7rem 0.9rem; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); width: 100%; margin-bottom: 0.5rem; }
.s-join { display: flex; gap: 0.5rem; }
.s-join input { flex: 1; min-width: 0; padding: 0.7rem 0.9rem; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); text-transform: uppercase; }
.s-premium-card { display: flex; gap: 0.75rem; padding: 1rem; margin-bottom: 1.5rem; border-radius: 16px; background: var(--primary-tint); border: 1.5px solid var(--primary-soft); }
.s-premium-card > svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.s-premium-card p { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0.75rem; }
.s-family-name { font-size: 1.1rem; font-weight: 800; margin: -0.5rem 0.25rem 1rem; }
.s-warning { padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 12px; background: var(--warning-tint); font-size: 0.9rem; }
.s-code { font-size: 1.8rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; font-variant-numeric: tabular-nums; }
.s-code-exp { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.s-invite-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.s-packs-done { margin-top: 1rem; opacity: 0.6; }
.pack-card.pack-done { cursor: default; }
.s-packs-import { margin-top: 1.25rem; }
.s-page .stack > * { min-width: 0; }
.s-page .modal-actions { flex-wrap: wrap; }
