:root {
    color-scheme: light;
    --chefos-bg: #f8fafc;
    --chefos-surface: #ffffff;
    --chefos-surface-alt: #f1f5f9;
    --chefos-text: #0f172a;
    --chefos-muted: #64748b;
    --chefos-border: #e2e8f0;
    --chefos-accent: #b88a16;
    --chefos-accent-strong: #8f6b10;
    --chefos-accent-soft: #fff8df;
    --chefos-nav: rgba(255, 255, 255, 0.92);
    --chefos-overlay: rgba(15, 23, 42, 0.52);
    --chefos-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

html.dark {
    color-scheme: dark;
    --chefos-bg: #070b14;
    --chefos-surface: #0f172a;
    --chefos-surface-alt: #111c31;
    --chefos-text: #f8fafc;
    --chefos-muted: #a8b2c3;
    --chefos-border: #25324a;
    --chefos-accent: #d4af37;
    --chefos-accent-strong: #f1cf58;
    --chefos-accent-soft: #28230f;
    --chefos-nav: rgba(7, 11, 20, 0.9);
    --chefos-overlay: rgba(2, 6, 23, 0.72);
    --chefos-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

html, body { transition: background-color .25s ease, color .25s ease; }
body.chefos-ui { background: var(--chefos-bg) !important; color: var(--chefos-text) !important; }

.chefos-brand { color: var(--chefos-accent) !important; letter-spacing: .08em; }
.chefos-surface { background: var(--chefos-surface) !important; color: var(--chefos-text) !important; }
.chefos-surface-alt { background: var(--chefos-surface-alt) !important; color: var(--chefos-text) !important; }
.chefos-heading { color: var(--chefos-text) !important; }
.chefos-muted { color: var(--chefos-muted) !important; }
.chefos-border { border-color: var(--chefos-border) !important; }
.chefos-nav { background: var(--chefos-nav) !important; border-color: var(--chefos-border) !important; }
.chefos-nav-link { color: var(--chefos-text) !important; }
.chefos-nav-link:hover { color: var(--chefos-accent) !important; }
.chefos-card { background: var(--chefos-surface) !important; color: var(--chefos-text) !important; border-color: var(--chefos-border) !important; box-shadow: var(--chefos-shadow); }
.chefos-card:hover { border-color: color-mix(in srgb, var(--chefos-accent) 45%, var(--chefos-border)) !important; }
.chefos-input { background: var(--chefos-surface) !important; color: var(--chefos-text) !important; border-color: var(--chefos-border) !important; }
.chefos-input::placeholder { color: var(--chefos-muted) !important; }
.chefos-input:focus { border-color: var(--chefos-accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--chefos-accent) 18%, transparent); }

.chefos-theme-toggle,
.chefos-language-select {
    height: 38px;
    border: 1px solid var(--chefos-border);
    background: var(--chefos-surface);
    color: var(--chefos-text);
    border-radius: 9999px;
    font: 600 12px/1 Inter, Arial, sans-serif;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
}
.chefos-theme-toggle {
    width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.chefos-language-select { padding: 0 30px 0 12px; cursor: pointer; }
.chefos-theme-toggle:hover,
.chefos-language-select:hover { border-color: var(--chefos-accent); }

.chefos-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    direction: ltr;
}
.chefos-floating-controls {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9999;
}
html[dir="rtl"] .chefos-floating-controls { right: auto; left: 14px; }

html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="rtl"] .chefos-no-rtl,
html[dir="rtl"] .font-mono,
html[dir="rtl"] input[type="tel"] { direction: ltr; }
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }
html[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-6 > :not([hidden]) ~ :not([hidden]),
html[dir="rtl"] .space-x-8 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 1; }

/* Landing page */
body.chefos-home #navbar { background: var(--chefos-nav) !important; border-bottom: 1px solid var(--chefos-border) !important; }
body.chefos-home #about { background: var(--chefos-surface) !important; }
body.chefos-home #menu { background: var(--chefos-surface-alt) !important; }
body.chefos-home #about .text-white,
body.chefos-home #menu .text-white { color: var(--chefos-text) !important; }
body.chefos-home #about .text-gray-400,
body.chefos-home #menu .text-gray-400,
body.chefos-home footer .text-gray-500,
body.chefos-home footer .text-gray-600 { color: var(--chefos-muted) !important; }
body.chefos-home #menu .bg-midnight-700 { background: var(--chefos-surface) !important; border: 1px solid var(--chefos-border); box-shadow: var(--chefos-shadow); }
body.chefos-home footer { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; color: var(--chefos-text) !important; }
body.chefos-home footer .border-gray-800 { border-color: var(--chefos-border) !important; }
body.chefos-home .hero-overlay { background: linear-gradient(to bottom, rgba(15, 23, 42, 0.22), var(--chefos-overlay)) !important; }
body.chefos-home #home .text-white { color: #fff !important; }
body.chefos-home #home .text-gray-300 { color: #e5e7eb !important; }
body.chefos-home #home .text-gold-400 { color: #f4ce54 !important; }
html:not(.dark) body.chefos-home #navbar .text-gray-300 { color: var(--chefos-text) !important; }
html:not(.dark) body.chefos-home #navbar svg.text-gold-400 { color: var(--chefos-accent) !important; }
html:not(.dark) body.chefos-home #about img[alt="Chef Signature"] { filter: none !important; opacity: .35 !important; }

/* Menu page */
body.chefos-menu { background: var(--chefos-bg) !important; background-image: none !important; }
body.chefos-menu #navbar { background: var(--chefos-nav) !important; border-color: var(--chefos-border) !important; }
body.chefos-menu header .text-white { color: var(--chefos-text) !important; }
body.chefos-menu .meal-card { background: var(--chefos-surface) !important; border: 1px solid var(--chefos-border) !important; box-shadow: var(--chefos-shadow) !important; }
body.chefos-menu .meal-card .bg-black\/50 { background: var(--chefos-surface-alt) !important; }
body.chefos-menu .meal-card .text-white { color: var(--chefos-text) !important; }
body.chefos-menu .meal-card .text-gray-400 { color: var(--chefos-muted) !important; }
body.chefos-menu .meal-card .border-white\/10 { border-color: var(--chefos-border) !important; }
body.chefos-menu .meal-card .bg-black\/20 { background: transparent !important; }
body.chefos-menu #category-filters .filter-btn:not(.active) { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; color: var(--chefos-muted) !important; }
body.chefos-menu #category-filters .filter-btn:hover { color: var(--chefos-accent) !important; border-color: var(--chefos-accent) !important; }
body.chefos-menu .sticky.top-20 { background: color-mix(in srgb, var(--chefos-bg) 88%, transparent) !important; border-color: var(--chefos-border) !important; }
body.chefos-menu #cart-drawer { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; box-shadow: var(--chefos-shadow) !important; }
body.chefos-menu #cart-drawer .glass-panel,
body.chefos-menu #cart-drawer .bg-midnight-800,
body.chefos-menu #cart-drawer .bg-midnight-900,
body.chefos-menu #cart-drawer .bg-\[\#0a0e17\],
body.chefos-menu #cart-drawer .bg-\[\#05080f\] { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; }
body.chefos-menu #cart-drawer .text-white,
body.chefos-menu #cart-drawer .text-gray-300 { color: var(--chefos-text) !important; }
body.chefos-menu #cart-drawer .text-gray-400,
body.chefos-menu #cart-drawer .text-gray-500 { color: var(--chefos-muted) !important; }
body.chefos-menu #cart-drawer .border-gray-800,
body.chefos-menu #cart-drawer .border-white\/10 { border-color: var(--chefos-border) !important; }
body.chefos-menu #cart-drawer .input-glass { background: var(--chefos-surface-alt) !important; color: var(--chefos-text) !important; border-color: var(--chefos-border) !important; }
body.chefos-menu #cart-drawer .input-glass::placeholder { color: var(--chefos-muted) !important; }
body.chefos-menu #cart-drawer .bg-black\/50,
body.chefos-menu #cart-drawer .bg-black\/40,
body.chefos-menu #cart-drawer .bg-white\/5 { background: var(--chefos-surface-alt) !important; }
body.chefos-menu #cart-drawer .border-gray-700\/50 { border-color: var(--chefos-border) !important; }
body.chefos-menu #cart-drawer .leaflet-container { border-color: var(--chefos-border) !important; }

/* Shared checkout/public header */
body.chefos-shared { background: var(--chefos-bg) !important; color: var(--chefos-text) !important; }
body.chefos-shared nav,
body.chefos-shared footer { background: var(--chefos-surface) !important; color: var(--chefos-text) !important; border-color: var(--chefos-border) !important; }
body.chefos-shared nav { border-bottom: 1px solid var(--chefos-border); }
body.chefos-shared footer { border-top: 1px solid var(--chefos-border); }
body.chefos-shared .text-rest-blue-dark,
body.chefos-shared .text-text-dark { color: var(--chefos-text) !important; }
body.chefos-shared .bg-rest-blue-dark { background: var(--chefos-surface-alt) !important; color: var(--chefos-text) !important; }
body.chefos-shared .text-rest-blue-light { color: var(--chefos-muted) !important; }
body.chefos-shared input,
body.chefos-shared select,
body.chefos-shared textarea { background: var(--chefos-surface) !important; color: var(--chefos-text) !important; border-color: var(--chefos-border) !important; }

/* Order tracker and table-side menu */
body.chefos-tracker,
body.chefos-ipad { background: var(--chefos-bg) !important; color: var(--chefos-text) !important; }
body.chefos-tracker header,
body.chefos-ipad nav { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; }
body.chefos-tracker .glass-card,
body.chefos-ipad .bg-white { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; }
body.chefos-tracker .text-gray-900,
body.chefos-tracker .text-gray-800,
body.chefos-ipad .text-gray-900,
body.chefos-ipad .text-gray-800 { color: var(--chefos-text) !important; }
body.chefos-tracker .text-gray-400,
body.chefos-tracker .text-gray-500,
body.chefos-ipad .text-gray-400,
body.chefos-ipad .text-gray-500 { color: var(--chefos-muted) !important; }
body.chefos-tracker .border-white,
body.chefos-tracker .border-gray-100,
body.chefos-tracker .border-gray-200,
body.chefos-ipad .border-gray-100,
body.chefos-ipad .border-gray-200 { border-color: var(--chefos-border) !important; }

/* Admin branding/theme helpers */
body.chefos-admin { background: var(--chefos-bg) !important; color: var(--chefos-text) !important; }
body.chefos-admin .admin-surface { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; color: var(--chefos-text) !important; }
body.chefos-admin .admin-muted { color: var(--chefos-muted) !important; }

@media (max-width: 767px) {
    .chefos-theme-toggle, .chefos-language-select { height: 34px; }
    .chefos-theme-toggle { width: 34px; }
    .chefos-language-select { max-width: 94px; padding-right: 24px; }
}
body.chefos-home #menu .bg-midnight-900 { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; box-shadow: var(--chefos-shadow); }
body.chefos-home footer .text-white { color: var(--chefos-text) !important; }
body.chefos-home .chefos-surface .text-gray-400 { color: var(--chefos-muted) !important; }
body.chefos-home { background: var(--chefos-bg) !important; color: var(--chefos-text) !important; }
body.chefos-shared .bg-white { background: var(--chefos-surface) !important; border-color: var(--chefos-border) !important; color: var(--chefos-text) !important; }
body.chefos-shared .bg-gray-50 { background: var(--chefos-surface-alt) !important; }
body.chefos-shared .text-gray-900,
body.chefos-shared .text-gray-800,
body.chefos-shared .text-gray-600 { color: var(--chefos-text) !important; }
body.chefos-shared .text-gray-500,
body.chefos-shared .text-gray-400 { color: var(--chefos-muted) !important; }
body.chefos-shared .border-gray-100,
body.chefos-shared .border-gray-200,
body.chefos-shared .border-gray-300 { border-color: var(--chefos-border) !important; }
body.chefos-ipad .bg-gray-50,
body.chefos-ipad #fullscreen-cart { background: var(--chefos-bg) !important; }
body.chefos-ipad .bg-gray-100 { background: var(--chefos-surface-alt) !important; }
body.chefos-ipad .border-gray-100,
body.chefos-ipad .border-gray-200,
body.chefos-ipad .border-gray-300 { border-color: var(--chefos-border) !important; }
html.dark body.chefos-ipad .meal-card.selected { background: var(--chefos-accent-soft) !important; }
