/* ============================================
   AAPLA SWAD — Design system
   The app is dark-only: every page carries data-theme="dark", which switches
   on the warm dark palette below. The shared chrome every customer page
   uses (header, dock, buttons, cards) and the motion layer. Page files only
   add layout on top of this.
   ============================================ */

:root {
    --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: var(--font-ui);

    --brand: #f15a0a;
    --brand-2: #ff8a1f;
    --brand-ink: #c2410c;
    --brand-soft: rgba(241, 90, 10, 0.1);
    --brand-line: rgba(241, 90, 10, 0.28);
    --grad-brand: linear-gradient(135deg, #f15a0a 0%, #ff7a18 55%, #ffa23a 100%);
    --grad-hot: linear-gradient(135deg, #ff3d54 0%, #ff7a18 100%);

    --veg: #0f8a3c;
    --nonveg: #c62828;
    --ok: #15803d;
    --ok-2: #16a34a;
    --ok-soft: rgba(22, 163, 74, 0.12);
    --warn: #b45309;
    --warn-soft: rgba(245, 158, 11, 0.14);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.1);
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.1);

    --bg: #f3f3f6;
    --surface: #ffffff;
    --surface-2: #f6f6f9;
    --surface-3: #ececf1;
    --text: #16161b;
    --text-2: #55555f;
    --text-3: #6c6c77;
    --line: rgba(17, 17, 28, 0.08);
    --line-2: rgba(17, 17, 28, 0.15);
    --glass: rgba(255, 255, 255, 0.76);
    --scrim: rgba(12, 12, 16, 0.45);

    --shadow-sm: 0 1px 2px rgba(17, 17, 28, 0.05), 0 2px 10px rgba(17, 17, 28, 0.05);
    --shadow-md: 0 6px 20px rgba(17, 17, 28, 0.08), 0 2px 6px rgba(17, 17, 28, 0.05);
    --shadow-lg: 0 18px 48px rgba(17, 17, 28, 0.14), 0 4px 12px rgba(17, 17, 28, 0.06);
    --shadow-brand: 0 12px 30px rgba(241, 90, 10, 0.34);

    --r-sm: 10px;
    --r: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-pill: 999px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --col: 560px;
    --wide: 1200px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --dock-space: calc(96px + var(--safe-b));

    /* Older page styles and order.js still read these names */
    --orange: var(--brand);
    --saffron: var(--brand);
    --gold: var(--brand-ink);
    --amber: var(--brand-ink);
    --card: var(--surface);
    --card-solid: var(--surface);
    --border: var(--line);
    --text2: var(--text-2);
    --text3: var(--text-3);
    --green: var(--ok);
    --red: var(--danger);
    --blue: var(--info);
    --purple: var(--violet);
    --dark: var(--bg);
    --white: var(--text);
    --gray: var(--text-2);
    --muted: var(--text-3);

    color-scheme: light;
}

[data-theme="dark"] {
    --brand: #ff6a1a;
    --brand-2: #ff9a3d;
    --brand-ink: #ff8f47;
    --brand-soft: rgba(255, 106, 26, 0.14);
    --brand-line: rgba(255, 106, 26, 0.38);

    --veg: #22c55e;
    --nonveg: #f05252;
    --ok: #22c55e;
    --ok-2: #22c55e;
    --ok-soft: rgba(34, 197, 94, 0.14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.14);
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, 0.14);

    /* Warm near-black, so the orange feels at home */
    --bg: #0c0a09;
    --surface: #171311;
    --surface-2: #1f1915;
    --surface-3: #2a221d;
    --text: #f7f3f0;
    --text-2: #b9aea6;
    --text-3: #92867d;
    --line: rgba(255, 190, 150, 0.08);
    --line-2: rgba(255, 190, 150, 0.16);
    --glass: rgba(15, 11, 9, 0.78);
    --scrim: rgba(0, 0, 0, 0.62);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 22px 56px rgba(0, 0, 0, 0.62);
    --shadow-brand: 0 12px 32px rgba(255, 106, 26, 0.3);

    color-scheme: dark;
}

/* ========== BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    scroll-padding-top: 84px;
}
body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-soft); }
[hidden] { display: none !important; }

/* ========== HEADER ========== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--glass);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.app-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.app-header-inner {
    max-width: var(--wide);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 1rem 0.65rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; flex: 1; }
.brand-logo {
    width: 40px; height: 40px; border-radius: 13px; object-fit: cover; flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--brand-line), var(--shadow-sm);
}
.brand-text { min-width: 0; display: flex; flex-direction: column; }
.brand-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-sub {
    font-size: 0.68rem; color: var(--text-3); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ========== ICON BUTTON ========== */
.icon-btn {
    width: 40px; height: 40px; flex-shrink: 0;
    display: inline-grid; place-items: center;
    border-radius: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease-spring), background-color 0.25s ease, border-color 0.25s ease;
}
.icon-btn:active { transform: scale(0.9); }
@media (hover: hover) { .icon-btn:hover { border-color: var(--brand-line); } }
.icon-btn svg { width: 19px; height: 19px; }


/* ========== BUTTONS ========== */
.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    padding: 0.85rem 1.3rem;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 800; font-size: 0.92rem; letter-spacing: 0.01em;
    overflow: hidden;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.25s ease, background-color 0.25s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-block { width: 100%; }

/* Light sweep across primary buttons */
.shine::after {
    content: '';
    position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.38), transparent);
    transform: skewX(-18deg);
    animation: shine 3.6s ease-in-out 1.2s infinite;
    pointer-events: none;
}
@keyframes shine { 0% { left: -60%; } 38%, 100% { left: 130%; } }

/* ========== CARDS + CHIPS ========== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--text-2);
    font-size: 0.76rem; font-weight: 700; white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-spring);
}
.chip:active { transform: scale(0.95); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* FSSAI marks — square with dot (veg) or triangle (non-veg) */
.veg-mark, .nonveg-mark {
    width: 15px; height: 15px; flex-shrink: 0; display: inline-block;
    background-size: contain; background-repeat: no-repeat;
}
.veg-mark { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='.75' y='.75' width='14.5' height='14.5' rx='2.5' fill='%23fff' stroke='%230f8a3c' stroke-width='1.5'/%3E%3Ccircle cx='8' cy='8' r='3.6' fill='%230f8a3c'/%3E%3C/svg%3E"); }
.nonveg-mark { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='.75' y='.75' width='14.5' height='14.5' rx='2.5' fill='%23fff' stroke='%23c62828' stroke-width='1.5'/%3E%3Cpath d='M8 4.2l4 7H4z' fill='%23c62828'/%3E%3C/svg%3E"); }

/* ========== BOTTOM DOCK ========== */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(10px + var(--safe-b));
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 440px;
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--glass);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    animation: dockIn 0.7s var(--ease-spring) 0.15s both;
}
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 120%); } to { opacity: 1; transform: translate(-50%, 0); } }
.bnav-item {
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 0 7px;
    border-radius: 18px;
    color: var(--text-3);
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.01em;
    transition: color 0.25s ease, background-color 0.3s ease;
}
.bnav-item svg { width: 21px; height: 21px; stroke: currentColor; transition: transform 0.4s var(--ease-spring); }
.bnav-item.active { color: var(--brand); background: var(--brand-soft); }
.bnav-item.active svg { transform: translateY(-1px) scale(1.1); }
.bnav-item:active svg { transform: scale(0.82); }

/* ========== WHATSAPP FAB ========== */
.wa-fab {
    position: fixed;
    right: max(16px, calc((100vw - var(--wide)) / 2 + 16px));
    bottom: calc(var(--dock-space) + 6px);
    width: 52px; height: 52px;
    border-radius: 18px;
    background: #25d366;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 26px rgba(37, 211, 102, 0.38);
    z-index: 90;
    transition: transform 0.25s var(--ease-spring);
}
.wa-fab::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    border: 2px solid #25d366; animation: waPulse 2.6s ease-out infinite;
}
@keyframes waPulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.55); opacity: 0; } }
.wa-fab:active { transform: scale(0.9); }
@media (hover: hover) { .wa-fab:hover { transform: translateY(-3px) rotate(-6deg); } }
.wa-fab svg { width: 26px; height: 26px; fill: #fff; }

/* ========== STATUS PILL (index / order) ========== */
.nav-right {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.32rem 0.7rem;
    border-radius: var(--r-pill);
    font-size: 0.72rem; font-weight: 800;
    background: var(--surface-2); color: var(--text-2);
    border: 1px solid var(--line);
}
.nav-right.open { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.nav-right.closed { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

/* ========== MOTION ========== */
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

.js-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(26px) scale(0.98);
    transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
    transition-delay: var(--rd, 0ms);
}
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* Touch ripple */
.rp {
    position: absolute; border-radius: 50%;
    background: currentColor; opacity: 0.22;
    transform: scale(0);
    animation: ripple 0.65s var(--ease-out) forwards;
    pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Loading skeleton shimmer */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: skel 1.3s ease infinite;
    border-radius: var(--r);
}
@keyframes skel { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ========== ICONS (ASIcon / <i data-ic>) ========== */
:root {
    --mark-veg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='.75' y='.75' width='14.5' height='14.5' rx='2.5' fill='%23fff' stroke='%230f8a3c' stroke-width='1.5'/%3E%3Ccircle cx='8' cy='8' r='3.6' fill='%230f8a3c'/%3E%3C/svg%3E");
    --mark-nonveg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='.75' y='.75' width='14.5' height='14.5' rx='2.5' fill='%23fff' stroke='%23c62828' stroke-width='1.5'/%3E%3Cpath d='M8 4.2l4 7H4z' fill='%23c62828'/%3E%3C/svg%3E");
    --star-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.9 6.4.8-4.7 4.4 1.2 6.4L12 17.2l-5.7 3.1 1.2-6.4L2.8 9.5l6.4-.8z' fill='%23f5b50b'/%3E%3C/svg%3E");
}
i[data-ic] { display: inline-block; width: 1.1em; height: 1.1em; }
.ic { display: inline-block; width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -0.18em; }
.ic-star { color: #f5b50b; }

/* Row of rating stars: <span class="stars" style="--n:4"> */
.stars {
    --s: 14px;
    display: inline-block;
    width: calc(var(--n, 5) * var(--s)); height: var(--s);
    background: var(--star-img) 0 0 / var(--s) var(--s) repeat-x;
    vertical-align: -2px;
}

/* Live dot instead of 🟢 / 🔴 */
.nav-right.open::before, .nav-right.closed::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.nav-right.open::before { animation: liveDot 1.8s ease-out infinite; }
@keyframes liveDot { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); } 100% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } }

/* Map pins on the tracking map */
.map-pin { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 3px solid #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.map-pin .ic { width: 18px; height: 18px; }
.map-pin-rider { background: var(--grad-brand); animation: riderBob 1.6s ease-in-out infinite; }
.map-pin-home { background: linear-gradient(135deg, #16a34a, #0f7a35); }
@keyframes riderBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ========== LANGUAGE PICKER (i18n.js) ========== */
.lang-btn {
    height: 40px; display: inline-flex; align-items: center; gap: 6px;
    padding: 0 9px 0 11px; border-radius: 13px;
    background: var(--surface); border: 1px solid var(--line);
    color: var(--text); box-shadow: var(--shadow-sm);
    font-size: 0.8rem; font-weight: 800; white-space: nowrap;
    transition: transform 0.25s var(--ease-spring), border-color 0.2s ease;
}
.lang-btn:active { transform: scale(0.94); }
@media (hover: hover) { .lang-btn:hover { border-color: var(--brand-line); } }
.lang-btn .ic-globe { width: 17px; height: 17px; color: var(--brand); }
.lang-btn .ic-chevron { width: 14px; height: 14px; opacity: 0.55; transition: transform 0.35s var(--ease-spring); }
.lang-btn[aria-expanded="true"] .ic-chevron { transform: rotate(180deg); }
.lang-btn-label { min-width: 20px; text-align: center; }
.lang-scrim { position: fixed; inset: 0; z-index: 998; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.lang-scrim.open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.lang-menu {
    position: fixed; z-index: 999; width: 272px; padding: 8px;
    border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden;
    transform: translateY(-8px) scale(0.96); transform-origin: top right;
    transition: opacity 0.25s ease, transform 0.4s var(--ease-spring), visibility 0s linear 0.4s;
}
.lang-menu.open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s ease, transform 0.4s var(--ease-spring); }
.lang-handle { display: none; }
.lang-head { display: flex; flex-direction: column; padding: 8px 10px 10px; }
.lang-head b { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; color: var(--text); }
.lang-head span { font-size: 0.72rem; color: var(--text-3); }
.lang-option {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 10px; border: 0; border-radius: 15px;
    background: transparent; color: var(--text); text-align: left;
    transition: background-color 0.2s ease;
}
@media (hover: hover) { .lang-option:hover { background: var(--surface-2); } }
.lang-glyph {
    width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px;
    display: grid; place-items: center;
    font-family: var(--font-display); font-size: 1.2rem; font-weight: 900;
    background: var(--surface-2); color: var(--text-2);
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.lang-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lang-names b { font-size: 0.96rem; font-weight: 800; }
.lang-names small { font-size: 0.72rem; color: var(--text-3); }
.lang-check { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; transform: scale(0); transition: transform 0.4s var(--ease-spring); }
.lang-check .ic { width: 13px; height: 13px; stroke-width: 3; }
.lang-option.active { background: var(--brand-soft); }
.lang-option.active .lang-glyph { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-brand); }
.lang-option.active .lang-check { transform: scale(1); }
@media (max-width: 599px) {
    .lang-scrim { background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
    .lang-menu {
        left: 0 !important; right: 0 !important; top: auto !important; bottom: 0;
        width: auto; max-width: 520px; margin: 0 auto;
        padding: 10px 14px calc(16px + var(--safe-b));
        border-radius: 28px 28px 0 0;
        transform: translateY(105%); transform-origin: bottom center;
    }
    .lang-menu.open { transform: none; }
    .lang-handle { display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 0 auto 6px; }
    .lang-option { padding: 12px; }
}
/* A soft fade on the page when the language changes */
.lang-swap .app, .lang-swap .order-main { animation: langFade 0.45s var(--ease-out); }
@keyframes langFade { from { opacity: 0.35; } to { opacity: 1; } }

/* ========== CHEF GREETER (chef.js) ========== */
.chef-greet { position: fixed; inset: 0; z-index: 600; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.chef-scrim {
    position: absolute; inset: 0; pointer-events: auto;
    background: radial-gradient(120% 70% at 50% 100%, rgba(241, 90, 10, 0.22), transparent 60%), rgba(8, 5, 3, 0.6);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    opacity: 0; transition: opacity 0.4s ease;
}
.chef-greet.show .chef-scrim { opacity: 1; }
.chef-stage { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; padding: 0 16px; pointer-events: none; }
.chef-bubble {
    position: relative; pointer-events: auto;
    width: 100%; max-width: 340px; margin-bottom: 2px;
    padding: 18px 18px 22px; border-radius: 24px; text-align: center;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(24px) scale(0.85); transform-origin: 50% 100%;
    transition: opacity 0.35s ease 0.5s, transform 0.65s var(--ease-spring) 0.5s;
}
.chef-greet.show .chef-bubble { opacity: 1; transform: none; }
.chef-bubble::after {
    content: ''; position: absolute; left: 50%; bottom: -9px;
    width: 18px; height: 18px; background: var(--surface);
    border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
    transform: translateX(-50%) rotate(45deg);
}
.chef-bubble b { display: block; padding: 0 22px; font-family: var(--font-display); font-size: 1.32rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; color: var(--text); margin-bottom: 6px; }
.chef-bubble p { font-size: 0.88rem; line-height: 1.45; color: var(--text-2); margin-bottom: 14px; }
.chef-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text-2); font-size: 1.1rem; line-height: 1; }
.chef-timer { position: absolute; left: 24px; right: 24px; bottom: 9px; height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.chef-timer span { display: block; height: 100%; background: var(--grad-brand); transform-origin: left; }
.chef-greet.show .chef-timer span { animation: chefTimer var(--chef-ms, 6000ms) linear forwards; }
.chef-greet.paused .chef-timer span { animation-play-state: paused; }
@keyframes chefTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.chef-figure { width: 210px; transform: translateY(115%); transition: transform 0.95s var(--ease-spring) 0.1s; pointer-events: none; }
@media (min-width: 768px) { .chef-figure { width: 240px; } }
.chef-greet.show .chef-figure { transform: none; }
.chef-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chef-shadow { fill: rgba(0, 0, 0, 0.35); }
.chef-all { animation: chefBob 2.2s ease-in-out 1.1s infinite; }
@keyframes chefBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.chef-head { transform-origin: 110px 160px; animation: chefTilt 3.2s ease-in-out 1.2s infinite; }
@keyframes chefTilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.chef-eyes-open { transform-origin: 110px 122px; animation: chefBlink 4s ease-in-out 2s infinite; }
@keyframes chefBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.chef-sign { transform-origin: 110px 206px; animation: chefSwing 2.6s ease-in-out 0.9s infinite; }
@keyframes chefSwing { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.sign-board { fill: #6e4220; stroke: rgba(0, 0, 0, 0.25); stroke-width: 2; }
.sign-face { fill: #a1662f; }
.sign-text { fill: #ffe7cf; font-family: var(--font-display); font-weight: 900; font-size: 21px; letter-spacing: 2px; }
.is-open .sign-board { fill: #0d5f2b; }
.is-open .sign-face { fill: #16a34a; }
.is-open .sign-text { fill: #fff; }
.is-paused .sign-board { fill: #8a4b06; }
.is-paused .sign-face { fill: #d97706; }
.is-paused .sign-text { fill: #fff; }

/* Awake by default; asleep (eyes shut, zzz, moon, slow swing) at night */
.chef-eyes-sleep, .chef-mouth-sleep, .chef-moon, .chef-zzz, .chef-spark { display: none; }
.is-asleep .chef-eyes-open, .is-asleep .chef-mouth-smile { display: none; }
.is-asleep .chef-eyes-sleep, .is-asleep .chef-mouth-sleep, .is-asleep .chef-moon, .is-asleep .chef-zzz { display: inline; }
.is-asleep .chef-all { animation-duration: 3.6s; }
.is-asleep .chef-sign { animation-duration: 4.2s; }
.chef-moon { fill: #ffd27a; }
.chef-zzz text { fill: #ffb27a; font-family: var(--font-display); font-weight: 900; opacity: 0; transform-box: fill-box; animation: chefZ 2.7s ease-in infinite; }
.chef-zzz text:nth-child(1) { font-size: 14px; }
.chef-zzz text:nth-child(2) { font-size: 18px; animation-delay: 0.6s; }
.chef-zzz text:nth-child(3) { font-size: 23px; animation-delay: 1.2s; }
@keyframes chefZ { 0% { opacity: 0; transform: translate(0, 8px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -18px); } }
.is-open .chef-spark { display: inline; }
.chef-spark path { fill: #ffd27a; transform-box: fill-box; transform-origin: center; animation: chefTwinkle 1.8s ease-in-out infinite; }
.chef-spark path:nth-child(2) { animation-delay: 0.4s; }
.chef-spark path:nth-child(3) { animation-delay: 0.8s; }
.chef-spark path:nth-child(4) { animation-delay: 1.2s; }
@keyframes chefTwinkle { 0%, 100% { transform: scale(0.4); opacity: 0.3; } 50% { transform: scale(1.1); opacity: 1; } }

/* Leaving: bubble shrinks, chef sinks back down */
.chef-greet.leaving .chef-scrim { opacity: 0; }
.chef-greet.leaving .chef-bubble { opacity: 0; transform: translateY(16px) scale(0.9); transition: opacity 0.25s ease, transform 0.3s ease; }
.chef-greet.leaving .chef-figure { transform: translateY(115%); transition: transform 0.55s cubic-bezier(0.5, 0, 0.75, 0); }

/* ========== TOAST (ASTheme.toast) ========== */
.as-toast {
    position: fixed; left: 50%; z-index: 9000;
    top: calc(84px + env(safe-area-inset-top, 0px));
    max-width: calc(100% - 32px);
    display: flex; align-items: center; gap: 8px;
    padding: 11px 16px; border-radius: 16px;
    background: var(--text); color: var(--bg);
    font-size: 0.86rem; font-weight: 700;
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none;
    transform: translate(-50%, -24px) scale(0.96);
    transition: transform 0.45s var(--ease-spring), opacity 0.3s ease;
}
.as-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.as-toast .toast-ic { width: 18px; height: 18px; color: var(--brand-2); }

/* ========== DESKTOP: dock moves into the header ========== */
@media (min-width: 1024px) {
    :root { --dock-space: calc(28px + var(--safe-b)); }
    .bottom-nav.nav-top {
        position: static; transform: none; flex: none;
        width: auto; max-width: none;
        padding: 4px; gap: 2px;
        border-radius: 16px;
        background: var(--surface-2);
        box-shadow: none; animation: none;
        backdrop-filter: none; -webkit-backdrop-filter: none;
    }
    .nav-top .bnav-item { flex-direction: row; gap: 7px; padding: 8px 14px; border-radius: 12px; font-size: 0.82rem; }
    .nav-top .bnav-item svg { width: 18px; height: 18px; }
    .nav-top .bnav-item.active svg { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .js-reveal [data-reveal] { opacity: 1; transform: none; }
}
