.theme-toggle-fab {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 14px);
    right: 14px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.18);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(10px);
    z-index: 5000;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.theme-toggle-fab:hover {
    transform: translateY(-1px);
}

.theme-toggle-fab:active {
    transform: translateY(0);
}

.theme-toggle-fab__icon {
    font-size: 1.08rem;
    line-height: 1;
}

html[data-theme="light"] {
    color-scheme: light;
    --tp-bg: #eef4ff;
    --tp-bg-soft: #f8fbff;
    --tp-surface: #ffffff;
    --tp-surface-soft: #f8fbff;
    --tp-line: #dbeafe;
    --tp-text: #0f172a;
    --tp-muted: #64748b;
    --tp-primary: #3b82f6;
    --tp-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --tp-bg: #07111f;
    --tp-bg-soft: #0b1730;
    --tp-surface: #0f1b31;
    --tp-surface-soft: #13233d;
    --tp-line: #28405e;
    --tp-text: #e7eefc;
    --tp-muted: #9db0cf;
    --tp-primary: #63a7ff;
    --tp-shadow: 0 16px 34px rgba(2, 6, 23, 0.34);
}

html[data-theme] body,
html[data-theme] #appView,
html[data-theme] main,
html[data-theme] .auth-page,
html[data-theme] .auth-shell {
    background: var(--tp-bg) !important;
    color: var(--tp-text);
}

html[data-theme] .container,
html[data-theme] .card,
html[data-theme] .restaurant-card,
html[data-theme] .menu-item,
html[data-theme] .order-card,
html[data-theme] .status-tracker,
html[data-theme] .promo-card,
html[data-theme] .modal-content,
html[data-theme] .modal-card,
html[data-theme] .field,
html[data-theme] .auth-card,
html[data-theme] .business-category-shell,
html[data-theme] .business-category-slide,
html[data-theme] .business-category-preview__item,
html[data-theme] .category-empty,
html[data-theme] .coming-soon-screen,
html[data-theme] .db-client-panel,
html[data-theme] .promo-card,
html[data-theme] .menu-card,
html[data-theme] .order-card,
html[data-theme] .alert {
    background: var(--tp-surface) !important;
    border-color: var(--tp-line) !important;
    color: var(--tp-text);
    box-shadow: var(--tp-shadow);
}

html[data-theme="dark"] .business-category-shell {
    background: linear-gradient(180deg, #12203a 0%, #0f1b31 100%) !important;
}

html[data-theme="dark"] .business-category-slide {
    background: linear-gradient(135deg, #0f1b31 0%, #152849 100%) !important;
}

html[data-theme="dark"] .business-category-preview__item {
    background: #13233d !important;
}

html[data-theme="dark"] .business-category-preview__placeholder {
    background: linear-gradient(135deg, #183154 0%, #10233d 100%) !important;
    color: #dceafe !important;
}

html[data-theme] .bottom-nav {
    background: var(--tp-surface) !important;
    border-top-color: var(--tp-line) !important;
}

html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea {
    background: var(--tp-surface-soft) !important;
    border-color: var(--tp-line) !important;
    color: var(--tp-text) !important;
}

html[data-theme] .muted,
html[data-theme] small,
html[data-theme] .tracker-dist,
html[data-theme] .db-tag,
html[data-theme] .category-empty,
html[data-theme] .business-category-meta,
html[data-theme] .business-category-slide__meta,
html[data-theme] .nav-item,
html[data-theme] .hero p,
html[data-theme] .hero-contact span {
    color: var(--tp-muted) !important;
}

html[data-theme] .price,
html[data-theme] .business-category-kicker,
html[data-theme] .business-category-slide__eyebrow,
html[data-theme] .business-category-title,
html[data-theme] .section-title {
    color: var(--tp-text);
}

html[data-theme="light"] .theme-toggle-fab {
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.35);
}

html[data-theme="dark"] .theme-toggle-fab {
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.16);
}
