@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-700.woff2') format('woff2');
}

:root {
    color-scheme: light;
    --bg: #F3F4EF;
    --surface: #FFFFFF;
    --surface-subtle: #EAECE6;
    --border: #E1E6E0;
    --ink: #10201C;
    --muted: #4A5A55;
    --primary: #0E3B34;
    --primary-2: #14504A;
    --on-primary: #FFFFFF;
    --on-primary-muted: #A9C9C1;
    --lime: #D4F36A;
    --food: #E8833A;
    --food-tint: #FDE6D3;
    --food-on-tint: #9A4A0E;
    --ent: #6C5CE7;
    --ent-tint: #E6E1FB;
    --ent-on-tint: #4A3BB5;
    --invest: #14B8A6;
    --invest-tint: #D5F3EE;
    --invest-on-tint: #0B6B60;
    --reserve: #64748B;
    --reserve-tint: #E2E8F0;
    --reserve-on-tint: #334155;
    --positive: #0B6B60;
    --danger: #B42318;
    --danger-tint: #FEE4E2;

    --radius-icon: 12px;
    --radius-key: 14px;
    --radius-btn: 16px;
    --radius-card: 20px;
    --radius-hero: 24px;
    --radius-pill: 999px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 18px;
    --space-6: 24px;

    --nav-bottom-h: 72px;
    --nav-rail-w: 84px;
    --sidebar-w: 240px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0B1412;
        --surface: #121F1C;
        --surface-subtle: #182925;
        --border: #243430;
        --ink: #E8F0EC;
        --muted: #9DB3AB;
        --primary: #D4F36A;
        --primary-2: #193832;
        --on-primary: #0B1412;
        --on-primary-muted: #B8D4CC;
        --food-tint: #3D2414;
        --food-on-tint: #FDBA8C;
        --ent-tint: #28224A;
        --ent-on-tint: #C7BFFF;
        --invest-tint: #103531;
        --invest-on-tint: #6FE3D5;
        --reserve-tint: #1E293B;
        --reserve-on-tint: #CBD5E1;
        --positive: #34D399;
        --danger: #F97066;
        --danger-tint: #3B1816;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B1412;
    --surface: #121F1C;
    --surface-subtle: #182925;
    --border: #243430;
    --ink: #E8F0EC;
    --muted: #9DB3AB;
    --primary: #D4F36A;
    --primary-2: #193832;
    --on-primary: #0B1412;
    --on-primary-muted: #B8D4CC;
    --food-tint: #3D2414;
    --food-on-tint: #FDBA8C;
    --ent-tint: #28224A;
    --ent-on-tint: #C7BFFF;
    --invest-tint: #103531;
    --invest-on-tint: #6FE3D5;
    --reserve-tint: #1E293B;
    --reserve-on-tint: #CBD5E1;
    --positive: #34D399;
    --danger: #F97066;
    --danger-tint: #3B1816;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
    font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

button,
.chip,
.keypad-key,
.custom-picker-trigger,
.select-option,
.calendar-day {
    touch-action: manipulation;
}
/* App Shell & Navigation */
.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(16px + env(safe-area-inset-top)) 18px calc(var(--nav-bottom-h) + 28px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-rail,
.nav-sidebar {
    display: none;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
}

.bottom-nav-item {
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.fab-btn {
    width: 54px;
    height: 54px;
    margin: -18px auto 0;
    border-radius: var(--radius-pill);
    border: 3px solid var(--bg);
    background: var(--primary);
    color: var(--on-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(14, 59, 52, 0.25);
    transition: transform 120ms ease;
}

.fab-btn:active {
    transform: scale(0.95);
}

@media (min-width: 600px) and (max-width: 1023px) {
    .bottom-nav {
        display: none;
    }

    /* App Shell & Navigation */
.app-shell {
        flex-direction: row;
    }

    .nav-rail {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: var(--nav-rail-w);
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100dvh;
        background: var(--surface);
        border-right: 1px solid var(--border);
        padding: calc(16px + env(safe-area-inset-top)) 8px 16px;
    }

    .rail-item {
        width: 100%;
        min-height: 52px;
        border-radius: 14px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 11px;
        font-weight: 600;
        color: var(--muted);
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 6px 4px;
    }

    .rail-item.active {
        background: var(--surface-subtle);
        color: var(--primary);
    }

    .rail-add-btn {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        background: var(--primary);
        color: var(--on-primary);
        border: none;
        display: grid;
        place-items: center;
        cursor: pointer;
        margin-bottom: 8px;
    }

    .app-main {
        max-width: 720px;
        padding: 24px 24px 36px;
    }
}

@media (min-width: 1024px) {
    .bottom-nav,
    .nav-rail {
        display: none;
    }

    /* App Shell & Navigation */
.app-shell {
        flex-direction: row;
    }

    .nav-sidebar {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: var(--sidebar-w);
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100dvh;
        background: var(--surface);
        border-right: 1px solid var(--border);
        padding: 24px 14px;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 4px 10px 16px;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

    .sidebar-mark {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        background: #0E3B34;
        color: #D4F36A;
        display: grid;
        place-items: center;
    }

    .sidebar-item {
        min-height: 46px;
        padding: 0 12px;
        border-radius: 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 14px;
        font-weight: 600;
        color: var(--muted);
        border: none;
        background: transparent;
        cursor: pointer;
        width: 100%;
        text-align: left;
    }

    .sidebar-item.active {
        background: var(--surface-subtle);
        color: var(--primary);
    }

    .sidebar-add-btn {
        min-height: 48px;
        border-radius: 16px;
        background: var(--primary);
        color: var(--on-primary);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        margin: 8px 0 12px;
    }

    .sidebar-spacer {
        flex: 1;
    }

    .app-main {
        padding: 28px 32px 48px;
    }
}

/* Typography & Layout Helpers */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.page-greeting {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.row-title {
    font-size: 15px;
    font-weight: 600;
}

.muted-text {
    color: var(--muted);
    font-size: 13px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-card {
    background: #0E3B34;
    color: #FFFFFF;
    border: 1px solid rgba(169, 201, 193, 0.16);
    border-radius: var(--radius-hero);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hero-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #A9C9C1;
}

.hero-number {
    font-size: clamp(32px, 9.5vw, 46px);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin-top: 4px;
    color: #FFFFFF;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.hero-number.danger {
    color: #FDA29B;
}

.hero-sub {
    font-size: 13px;
    color: #A9C9C1;
    margin-top: 6px;
}

.hero-hint {
    font-size: 12px;
    color: #A9C9C1;
    opacity: 0.9;
}

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

.stat-tile {
    background: #14504A;
    border-radius: 14px;
    padding: 10px 12px;
    min-width: 0;
}

.stat-tile-label {
    font-size: 12px;
    color: #A9C9C1;
}

.stat-tile-value {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.stat-tile.light {
    background: var(--surface);
    border: 1px solid var(--border);
}

.stat-tile.light .stat-tile-label {
    color: var(--muted);
}

.stat-tile.light .stat-tile-value {
    color: var(--ink);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.dashboard-grid > *,
.two-col-grid > * {
    min-width: 0;
}

.two-col-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

@media (min-width: 600px) {
    .two-col-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        align-items: start;
    }
    .col-span-8 { grid-column: span 8; }
    .col-span-4 { grid-column: span 4; }
    .col-span-6 { grid-column: span 6; }
    .col-span-12 { grid-column: span 12; }
    .col-span-4 .two-col-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Buttons & Interactive Controls */
.btn-primary {
    min-height: 52px;
    border-radius: var(--radius-btn);
    border: none;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    min-height: 48px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-danger {
    min-height: 48px;
    border-radius: var(--radius-btn);
    border: none;
    background: var(--danger);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-key);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.text-link-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Chips & Segmented Control */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    min-height: 44px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: var(--surface-subtle);
    padding: 4px;
    border-radius: var(--radius-btn);
    gap: 4px;
}

.segmented-item {
    min-height: 44px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.segmented-item.active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Form Controls */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.input,
.select {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    font-size: 16px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-key);
}

/* Amount Display & Keypad */
.amount-display {
    text-align: center;
    padding: 12px 8px;
}

.amount-display-value {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -1.5px;
    font-variant-numeric: tabular-nums;
}

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

.keypad-key {
    min-height: 52px;
    border-radius: var(--radius-key);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.keypad-key:active {
    background: var(--surface-subtle);
}

/* Progress, Budget Cards, Sliders, Entry Rows */
.progress-track {
    width: 100%;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-subtle);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 180ms ease;
}

.stacked-bar {
    width: 100%;
    height: 14px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    display: flex;
    background: var(--surface-subtle);
}

.stacked-seg {
    height: 100%;
    transition: width 150ms ease;
}

.icon-tile {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-icon);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.entry-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px;
    min-height: 56px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.entry-row:last-child {
    border-bottom: none;
}

.entry-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.entry-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.entry-row-sub {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row {
    width: 100%;
    min-height: 56px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    color: inherit;
    text-align: left;
}

.slider-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-card);
    background: var(--surface);
    border: 1px solid var(--border);
}

.slider-input {
    width: 100%;
    height: 36px;
    cursor: pointer;
}

/* Bucket token colors */
.tone-food { --tone: var(--food); --tone-tint: var(--food-tint); --tone-on-tint: var(--food-on-tint); }
.tone-ent { --tone: var(--ent); --tone-tint: var(--ent-tint); --tone-on-tint: var(--ent-on-tint); }
.tone-invest { --tone: var(--invest); --tone-tint: var(--invest-tint); --tone-on-tint: var(--invest-on-tint); }
.tone-reserve { --tone: var(--reserve); --tone-tint: var(--reserve-tint); --tone-on-tint: var(--reserve-on-tint); }

.money-pos { color: var(--positive); }
.money-neg { color: var(--danger); }

/* Banners, Toasts, Sheets, Dialogs */
.banner {
    border-radius: var(--radius-card);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
}

.banner-warn {
    background: var(--food-tint);
    color: var(--food-on-tint);
}

.banner-info {
    background: var(--invest-tint);
    color: var(--invest-on-tint);
}

.toast-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(var(--nav-bottom-h) + 14px + env(safe-area-inset-bottom));
    max-width: 480px;
    margin: 0 auto;
    z-index: 60;
    background: #10201C;
    color: #FFFFFF;
    border-radius: var(--radius-btn);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

@media (min-width: 600px) {
    .toast-bar {
        bottom: 24px;
    }
}

.toast-action {
    background: transparent;
    border: none;
    color: #D4F36A;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    padding: 0 8px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(16, 32, 28, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

@media (min-width: 600px) {
    .modal-backdrop {
        align-items: center;
        padding: 24px;
    }
}

.sheet-panel {
    width: 100%;
    max-width: 520px;
    max-height: 88dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 600px) {
    .sheet-panel {
        border-radius: 24px;
        padding: 24px;
    }
}

.dialog-panel {
    width: min(440px, calc(100vw - 32px));
    background: var(--surface);
    border-radius: 24px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: auto;
}

/* Skeleton */
.skeleton-box {
    background: var(--surface-subtle);
    border-radius: var(--radius-card);
    animation: ma-pulse 1.4s ease-in-out infinite;
}

@keyframes ma-pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Charts */
.chart-wrap {
    width: 100%;
    overflow-x: auto;
}

.donut-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.legend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.entry-editor-card {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (min-width: 600px) {
    .entry-editor-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-hero);
        padding: 22px;
        box-shadow: 0 12px 32px rgba(16, 32, 28, 0.08);
    }
}

@media (max-width: 359px) {
    .app-main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .stat-tiles {
        gap: 6px;
    }

    .stat-tile {
        padding: 8px 8px;
    }

    .stat-tile-value {
        font-size: 13px;
    }

    .keypad-key {
        min-height: 46px;
        font-size: 18px;
    }

    .bottom-nav-item {
        font-size: 10px;
    }
}

/* Custom Themed Select & Date/Time Picker */
.custom-picker-trigger {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    font-size: 16px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-key);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 120ms ease;
}

.custom-picker-trigger:hover:not(:disabled) {
    border-color: var(--primary);
}

.custom-picker-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.custom-picker-trigger-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.custom-picker-trigger-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-picker-trigger-muted {
    color: var(--muted);
}

.picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(16, 32, 28, 0.58);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 600px) {
    .picker-backdrop {
        align-items: center;
        padding: 24px;
    }
}

.picker-panel {
    width: 100%;
    max-width: 420px;
    max-height: 85dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

@media (max-height: 520px) {
    .picker-backdrop,
    .modal-backdrop {
        align-items: center;
        padding: 12px;
    }

    .picker-panel,
    .sheet-panel {
        max-height: 92dvh;
        border-radius: 20px;
        padding: 14px;
        gap: 10px;
    }

    .calendar-day {
        min-height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 359px) {
    .picker-panel {
        padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
    }

    .calendar-grid,
    .calendar-weekdays {
        gap: 2px;
    }

    .calendar-day {
        min-height: 40px;
        font-size: 13px;
    }
}

@media (min-width: 600px) {
    .picker-panel {
        border-radius: 24px;
        padding: 20px;
    }
}

.select-option-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.select-option {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: var(--radius-key);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
}

.select-option.selected {
    border-color: var(--primary);
    background: var(--surface-subtle);
    color: var(--primary);
}

.calendar-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.calendar-month-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    text-align: center;
}

.calendar-weekday {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    padding: 4px 0;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-variant-numeric: tabular-nums;
}

.calendar-day:hover:not(:disabled) {
    background: var(--surface-subtle);
}

.calendar-day.today:not(.selected) {
    border-color: var(--primary);
    color: var(--primary);
}

.calendar-day.selected {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

.calendar-day:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.time-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-input {
    width: 64px;
    min-height: 44px;
    padding: 6px 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-variant-numeric: tabular-nums;
}

#blazor-error-ui {
    background: var(--food-tint);
    color: var(--food-on-tint);
    bottom: 0;
    display: none;
    left: 0;
    padding: 12px 18px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
}
