.home-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gray-1);
    border: 1px solid var(--gray-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.home-system {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.home-system-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
}
.home-system-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.home-system-row button {
    margin-left: auto;
    font-size: 13px;
}

/* ── SETTINGS PAGE ── */

.settings-page {
    padding: 0 16px 24px;
}
.settings-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--navy);
}
.settings-content {
    padding-top: 56px;
}
[data-theme="dark"] .settings-header {
    background: #0A1220;
}
.settings-back {
    background: none;
    border: none;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
    padding: 4px 8px;
    -webkit-tap-highlight-color: transparent;
}
.settings-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.settings-section-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 18px 0 8px;
}
.settings-card {
    background: var(--white);
    border-radius: 14px;
    border: 1px solid var(--gray-1);
    overflow: hidden;
}
.settings-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--gray-1);
}
.settings-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}
.settings-profile-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.settings-profile-role {
    font-size: 13px;
    color: var(--gray-3);
    text-transform: capitalize;
}
.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-1);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}
.settings-row:last-child {
    border-bottom: none;
}
.settings-row:hover {
    background: var(--gray-1);
}
.settings-row-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.settings-row-chevron {
    margin-left: auto;
    color: var(--gray-3);
    font-size: 20px;
    font-weight: 300;
}
.settings-row-value {
    margin-left: auto;
    color: var(--gray-3);
    font-size: 13px;
}
.settings-row-danger {
    color: var(--red);
}
.settings-theme-toggle {
    display: flex;
    padding: 12px 18px;
}
.settings-theme-toggle button {
    flex: 1;
    padding: 10px 0;
    border: 1px solid var(--gray-2);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.settings-theme-toggle button:first-child {
    border-radius: 8px 0 0 8px;
}
.settings-theme-toggle button:last-child {
    border-radius: 0 8px 8px 0;
}
.settings-theme-toggle button.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.settings-row-static {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px 4px;
    font-size: 13px;
    color: var(--text-lt);
}
.settings-row-static .settings-row-icon {
    width: 22px;
    font-size: 16px;
    text-align: center;
}
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.settings-toggle-row .settings-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    font-size: 15px;
    color: var(--text);
}
.settings-toggle-row .settings-row-icon {
    width: 22px;
    font-size: 16px;
    text-align: center;
}
.settings-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.settings-toggle-title {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    color: var(--text);
}
.settings-toggle-sub {
    font-size: 12px;
    color: var(--gray-3);
}
.settings-toggle-beta {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-3);
    border: 1px solid var(--gray-2);
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 6px;
}
.settings-toggle-switch {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: var(--gray-2);
    transition: background 0.18s ease;
}
.settings-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease;
}
.settings-toggle-switch.is-on {
    background: var(--blue);
}
.settings-toggle-switch.is-on::after {
    transform: translateX(18px);
}
.settings-fab-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 18px 14px;
}
/* Special-case: this picker's dim overlay must STOP above the bottom
   tab bar so the user can watch the real bar resize as they tap each
   option. Modal box is also nudged up so it doesn't visually crowd
   the bar. */
#btab-h-picker.dim-overlay {
    bottom: calc(var(--btab-h) + env(safe-area-inset-bottom, 0px));
    transition: bottom 0.18s ease;
}
#btab-h-picker .confirm-modal-box {
    top: 38%;
}
.btab-h-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.btab-h-opt {
    appearance: none;
    -webkit-appearance: none;
    background: var(--gray-1);
    border: 2px solid var(--gray-2);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
    color: var(--text);
    font-family: inherit;
    min-height: 110px;
}
.btab-h-opt:hover { background: var(--gray-2); }
.btab-h-opt.active {
    border-color: var(--blue);
    background: rgba(74, 144, 217, 0.08);
}
.btab-h-opt-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 8px;
}
.btab-h-opt-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.btab-h-opt-note {
    font-size: 10px;
    color: var(--gray-3);
    text-align: center;
    line-height: 1.2;
}
.btab-h-opt-bar {
    width: 100%;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btab-h-opt-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
}
.btab-h-opt.active .btab-h-opt-dot { background: var(--blue); }
.settings-clock-slider-row {
    padding: 0 18px 14px;
}
.settings-clock-slider-row input[type="range"] {
    width: 100%;
    accent-color: var(--blue);
}
.settings-clock-preview {
    padding: 0 18px 18px;
}
.settings-clock-preview-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--clock-h);
    padding: 0 12px 0 26px;
    background: rgba(var(--clock-color-rgb), var(--clock-alpha));
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.18);
    position: relative;
}
.settings-clock-preview-dot {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}
.settings-clock-preview-label {
    flex: 1;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.28);
}
.settings-clock-preview-timer {
    color: #fff;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.28);
}
.settings-fab-swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, border-color 0.15s;
    padding: 0;
}
.settings-fab-swatch:hover {
    transform: scale(1.08);
}
.settings-fab-swatch.active {
    border-color: var(--text);
    transform: scale(1.08);
}
[data-theme="dark"] .settings-fab-swatch.active {
    border-color: #fff;
}

/* ── SCHEDULE VIEW ── */

.sched-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
}
.sched-month {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 1px;
    color: var(--navy);
}
.sched-nav-btn {
    background: none;
    border: 1px solid var(--gray-2);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    color: var(--navy);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sched-nav-btn:hover { background: var(--gray-bg); }

.sched-strip {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 4px 16px 12px;
    scrollbar-width: none;
}
.sched-strip::-webkit-scrollbar { display: none; }

.sched-date-cell {
    flex-shrink: 0;
    width: 48px;
    padding: 8px 4px 6px;
    border: none;
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.sched-date-cell:hover { background: #EFF6FF; }
.sched-date-active {
    background: var(--navy) !important;
    color: #fff !important;
}
.sched-date-active .sched-day-name,
.sched-date-active .sched-day-num { color: #fff; }
.sched-date-today { border: 2px solid var(--blue); }
.sched-day-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-3);
    letter-spacing: 0.3px;
}
.sched-day-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    color: var(--navy);
    line-height: 1;
}
.sched-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green);
}

.sched-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px;
}
.sched-selected-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--navy);
}
.sched-mode-toggle {
    display: flex;
    border: 1px solid var(--gray-2);
    border-radius: 8px;
    overflow: hidden;
}
.sched-mode-toggle button {
    padding: 5px 14px;
    border: none;
    background: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-3);
    cursor: pointer;
}
.sched-mode-toggle button.active {
    background: var(--navy);
    color: #fff;
}

.sched-events {
    padding: 0 16px 24px;
}
.sched-event {
    background: var(--white);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.sched-event:hover { box-shadow: var(--shadow-lg); }
.sched-event.sched-overdue { border-left-color: var(--red) !important; }
.sched-event-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.sched-event-time {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--gray-3);
}
.sched-event-type { font-size: 14px; }
.sched-event-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--navy);
    margin-bottom: 4px;
}
.sched-event-meta {
    font-size: 12px;
    color: var(--gray-3);
}
.sched-done-badge {
    display: inline-block;
    background: var(--green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
}
.sched-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-3);
    font-size: 14px;
}

.sched-day-grid {
    border-top: 1px solid var(--gray-1);
}
.sched-hour-row, .sched-allday {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-1);
    min-height: 44px;
}
.sched-hour-label {
    width: 50px;
    flex-shrink: 0;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--gray-3);
    padding-top: 2px;
}
.sched-hour-events {
    flex: 1;
}
.sched-hour-events .sched-event {
    margin-bottom: 4px;
}

/* ── CLOCK IN/OUT WIDGET ── */

#clock-widget {
    display: none;
}

@media (max-width: 768px) {
    #clock-widget {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9000;
    }
    #clock-widget.clock-active {
        padding: 0;
    }
    .clock-btn {
        border: none;
        border-radius: 28px;
        font-family: 'DM Sans', sans-serif;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        -webkit-tap-highlight-color: transparent;
    }
    .clock-btn-icon { font-size: 14px; }
    .clock-running {
        display: flex;
        align-items: center;
        gap: 10px;
        height: var(--clock-h);
        padding: 0 12px 0 26px;
        background: rgba(var(--clock-color-rgb), var(--clock-alpha));
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        border-bottom: 1px solid rgba(255,255,255,0.18);
        box-shadow: 0 2px 10px rgba(0,0,0,0.18);
        position: relative;
    }
    .clock-running::before {
        content: '';
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
        animation: clock-pulse 1.6s ease-out infinite;
    }
    @keyframes clock-pulse {
        0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
        70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
        100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
    }
    .clock-job {
        flex: 1;
        font-family: 'DM Sans', sans-serif;
        font-size: 12px;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-shadow: 0 1px 2px rgba(0,0,0,0.28);
    }
    .clock-timer {
        font-family: 'DM Mono', monospace;
        font-size: 14px;
        font-weight: 700;
        color: #fff;
        letter-spacing: 1px;
        text-shadow: 0 1px 2px rgba(0,0,0,0.28);
    }
    .clock-out-btn {
        background: rgba(255,255,255,0.22);
        color: #fff;
        padding: 4px 12px;
        font-size: 11px;
        border-radius: 6px;
        border: 1px solid rgba(255,255,255,0.3);
        height: 26px;
        line-height: 1;
    }
    .clock-out-btn:hover { background: rgba(255,255,255,0.32); }

    /* Shift anything pinned to the top down by the banner height. */
    body.clock-active .site-header        { top: var(--clock-h) !important; }
    body.clock-active .home-header        { top: var(--clock-h) !important; }
    body.clock-active .header-sub-bar     { margin-top: var(--clock-h); }
    body.clock-active .main-wrap          { padding-top: calc(76px + var(--clock-h)) !important; }
    body.clock-active .home-content       { padding-top: calc(56px + var(--clock-h)); }
}

/* ── BOTTOM TAB BAR (mobile ≤768px) ── */

#bottom-tab-bar {
    display: none;
}

@media (max-width: 768px) {
    #bottom-tab-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 8000;
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        /* Box is border-box, so a plain height: var(--btab-h) eats the
           safe-area padding from inside — leaving only ~30px of content
           space on notched iPhones. Adding safe-area-inset-bottom into
           the height gives the buttons (especially the lifted Create
           icon) their full 64px to live in. */
        height: calc(var(--btab-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: #000;
        border-top: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 -2px 12px rgba(0,0,0,0.18);
        transition: height 0.18s ease;
    }
    .btab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: none;
        background: transparent;
        color: rgba(255,255,255,0.6);
        font-family: 'DM Sans', sans-serif;
        padding: 8px 0 10px;
        min-width: 50px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s, background 0.15s;
    }
    .btab-active {
        background: #1a2744;
        color: #fff;
    }
    .btab-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    .btab-icon svg {
        width: 22px;
        height: 22px;
    }
    .btab-label {
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.2px;
    }

    /* Center Create button — raised pill, brand blue */
    .btab-create {
        color: #fff !important;
        background: transparent;
        position: relative;
    }
    .btab-create .btab-icon {
        width: 44px;
        height: 44px;
        border-radius: 22px;
        background: rgb(var(--create-color-rgb));
        box-shadow: 0 4px 12px rgba(var(--create-color-rgb), 0.45);
        margin-top: -14px;
        transition: background 0.15s, transform 0.1s;
    }
    .btab-create:active .btab-icon {
        background: rgba(var(--create-color-rgb), 0.72);
        transform: scale(0.96);
    }
    /* Job-focused state — flip the brand-blue create variable to green
       at the button level so the lifted pill, its glow, and the active
       state all recolor in lockstep. RGB triplet for --green #27AE60. */
    .btab-create.has-focused-job {
        --create-color-rgb: 39, 174, 96;
    }
    .btab-create .btab-icon svg {
        width: 24px;
        height: 24px;
    }
    .btab-create .btab-label {
        margin-top: -2px;
        font-weight: 600;
        color: rgba(255,255,255,0.85);
    }

    /* iOS-style light bottom tab bar — translucent glass to match the
       light header. Light theme + mobile only. Dark theme keeps the
       existing dark bar from 01-base.css. */
    html:not([data-theme="dark"]) #bottom-tab-bar {
        background: rgba(255, 255, 255, 0.88);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid rgba(60, 60, 67, 0.12);
        box-shadow: none;
    }
    html:not([data-theme="dark"]) .btab {
        color: rgba(60, 60, 67, 0.65);
    }
    html:not([data-theme="dark"]) .btab-active {
        background: rgba(120, 120, 128, 0.16);
        color: #1C1C1E;
    }
    html:not([data-theme="dark"]) .btab-create .btab-label {
        color: rgba(60, 60, 67, 0.85);
    }

    /* Buffer accounts for the lifted Create icon (margin-top: -14px) plus
       a few px of breathing room so scrolling content doesn't visually
       collide with the protruding button. */
    .main-wrap {
        padding-bottom: calc(var(--btab-h) + env(safe-area-inset-bottom) + 30px) !important;
    }
    .site-footer {
        padding-bottom: calc(var(--btab-h) + env(safe-area-inset-bottom) + 26px) !important;
    }
    .mobile-collapse-btn {
        bottom: calc(var(--btab-h) + env(safe-area-inset-bottom) + 26px) !important;
        right: auto !important;
        left: 50%;
        transform: translateX(-50%);
    }
    body.clock-active .mobile-collapse-btn {
        bottom: calc(var(--btab-h) + env(safe-area-inset-bottom) + 50px + 26px) !important;
    }
    .header-hamburger,
    .mobile-menu {
        display: none !important;
    }
    body.home-active .site-header,
    body.home-active .header-sub-bar {
        display: none !important;
    }
    body.home-active .main-wrap {
        padding-top: 0 !important;
    }
}

/* ── ACTION SHEET (Create, More) ── */
#action-sheet {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
}
#action-sheet.action-sheet-open {
    pointer-events: auto;
}
.action-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.2s;
}
#action-sheet.action-sheet-open .action-sheet-overlay {
    background: rgba(0, 0, 0, var(--sheet-overlay-alpha));
}
.action-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 12px 16px calc(env(safe-area-inset-bottom) + 16px);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.22);
    transform: translateY(100%);
    transition: transform 0.22s ease-out;
}
#action-sheet.action-sheet-open .action-sheet-panel {
    transform: translateY(0);
}
[data-theme="dark"] .action-sheet-panel {
    background: #1B2A3F;
    color: #E4ECF5;
}
.action-sheet-grip {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0,0,0,0.18);
    margin: 4px auto 12px;
}
[data-theme="dark"] .action-sheet-grip {
    background: rgba(255,255,255,0.25);
}
.action-sheet-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #6B8299;
    text-align: center;
    margin-bottom: 14px;
}
.action-sheet-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.action-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 6px;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    background: #F4F6F9;
    color: #1B3350;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, transform 0.08s;
}
.action-sheet-item:active {
    background: #E2E8EF;
    transform: scale(0.97);
}
[data-theme="dark"] .action-sheet-item {
    background: #24364D;
    border-color: rgba(255,255,255,0.06);
    color: #E4ECF5;
}
[data-theme="dark"] .action-sheet-item:active {
    background: #2E4561;
}
.action-sheet-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: #fff;
    color: #2968A6;
    border: 1px solid rgba(41,104,166,0.18);
}
[data-theme="dark"] .action-sheet-item-icon {
    background: #1B3350;
    color: #8BB8E0;
    border-color: rgba(139,184,224,0.24);
}
.action-sheet-item-icon svg { width: 20px; height: 20px; }
.action-sheet-item-label {
    text-align: center;
    line-height: 1.2;
    font-size: 12px;
}
.action-sheet-item-danger { color: #C0392B; }
.action-sheet-item-danger .action-sheet-item-icon {
    color: #C0392B;
    border-color: rgba(192,57,43,0.22);
}
[data-theme="dark"] .action-sheet-item-danger { color: #F9A8A0; }
[data-theme="dark"] .action-sheet-item-danger .action-sheet-item-icon {
    color: #F9A8A0;
    border-color: rgba(249,168,160,0.24);
}
.action-sheet-cancel {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: #1B3350;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── FIRST-RUN TOUR ── */
#tour-root {
    position: fixed;
    inset: 0;
    z-index: 9500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
#tour-root.tour-open {
    pointer-events: auto;
    opacity: 1;
}
.tour-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 35, 0.62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.tour-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-50% + 8px));
    width: min(92vw, 420px);
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 20px;
    box-shadow: 0 22px 64px rgba(0,0,0,0.35);
    text-align: center;
    transition: transform 0.25s ease-out;
}
#tour-root.tour-open .tour-card {
    transform: translate(-50%, -50%);
}
[data-theme="dark"] .tour-card {
    background: #1B2A3F;
    color: #E4ECF5;
}
.tour-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(41,104,166,0.12);
    color: #2968A6;
}
[data-theme="dark"] .tour-icon {
    background: rgba(139,184,224,0.16);
    color: #8BB8E0;
}
.tour-icon svg { width: 30px; height: 30px; }
.tour-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #1B3350;
    margin-bottom: 8px;
    line-height: 1.25;
}
[data-theme="dark"] .tour-title { color: #E4ECF5; }
.tour-body {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #5A6A7A;
    line-height: 1.55;
    margin-bottom: 18px;
}
[data-theme="dark"] .tour-body { color: #B8C5D5; }
.tour-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}
.tour-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(41,104,166,0.22);
    transition: background 0.2s, transform 0.2s;
}
.tour-dot-active {
    background: #2968A6;
    transform: scale(1.35);
}
[data-theme="dark"] .tour-dot { background: rgba(139,184,224,0.22); }
[data-theme="dark"] .tour-dot-active { background: #8BB8E0; }
.tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tour-skip {
    background: none;
    border: none;
    color: #7A8694;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 4px;
    cursor: pointer;
}
.tour-skip:hover { color: #1B3350; }
[data-theme="dark"] .tour-skip:hover { color: #E4ECF5; }
.tour-nav { display: flex; gap: 8px; }
.tour-back, .tour-next {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tour-back {
    background: transparent;
    border: 1px solid rgba(27,51,80,0.2);
    color: #1B3350;
}
.tour-next {
    background: #2968A6;
    border: 1px solid #2968A6;
    color: #fff;
}
.tour-next:hover { background: #1B3350; border-color: #1B3350; }
[data-theme="dark"] .tour-back { border-color: rgba(255,255,255,0.18); color: #E4ECF5; }


/* ── TRANSACTIONS LEDGER ──────────────────────────────────────────────── */
.txn-page {
    padding: 20px 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
}
.txn-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.txn-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 1px;
    color: var(--navy);
}
.txn-sub {
    font-size: 13px;
    color: var(--gray-3);
    margin-top: 4px;
}
.txn-export-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.txn-export-btn:hover:not(:disabled) { background: var(--navy); }
.txn-export-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.txn-filter-card {
    background: var(--white);
    border: 1px solid var(--gray-1);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.txn-filter-card .analytics-range-bar { margin-bottom: 10px; }
.txn-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.txn-filter {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.txn-filter select {
    padding: 7px 10px;
    border: 1px solid var(--gray-2);
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--navy);
    background: #fff;
    min-width: 180px;
}

.txn-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.txn-summary-item {
    background: var(--white);
    border: 1px solid var(--gray-1);
    border-radius: 10px;
    padding: 12px 14px;
}
.txn-summary-item-primary {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.txn-summary-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-3);
    margin-bottom: 4px;
}
.txn-summary-item-primary .txn-summary-label { color: #B8C2CE; }
.txn-summary-value {
    font-family: 'DM Mono', monospace;
    font-size: 19px;
    font-weight: 600;
    color: var(--navy);
}
.txn-summary-item-primary .txn-summary-value { color: #fff; }

.txn-table-wrap {
    background: var(--white);
    border: 1px solid var(--gray-1);
    border-radius: 10px;
    overflow: hidden;
}
.txn-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
}
.txn-table thead th {
    background: #F4F6F9;
    color: var(--gray-3);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-1);
}
.txn-row td {
    padding: 11px 12px;
    border-top: 1px solid var(--gray-1);
    vertical-align: top;
}
.txn-row:first-child td { border-top: none; }
.txn-row:hover { background: #F8FAFC; }
.txn-date {
    font-family: 'DM Mono', monospace;
    color: var(--gray-3);
    white-space: nowrap;
}
.txn-job a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}
.txn-job a:hover { text-decoration: underline; }
.txn-client {
    font-size: 12px;
    color: var(--gray-3);
    margin-top: 2px;
}
.txn-amount {
    font-family: 'DM Mono', monospace;
    font-weight: 600;
    color: var(--navy);
    text-align: right;
    white-space: nowrap;
}
.txn-method { white-space: nowrap; }
.txn-source-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.txn-source-manual {
    background: rgba(107,130,153,0.14);
    color: var(--gray-3);
}
.txn-source-square {
    background: rgba(41,104,166,0.14);
    color: var(--blue);
}
.txn-notes {
    color: var(--gray-3);
    max-width: 260px;
    font-size: 12px;
}
.txn-actions { text-align: right; white-space: nowrap; }
.txn-action-btn {
    background: transparent;
    border: 1px solid var(--gray-2);
    color: var(--gray-3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.txn-action-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.txn-loading, .txn-empty, .txn-error {
    background: var(--white);
    border: 1px solid var(--gray-1);
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    color: var(--gray-3);
    font-size: 14px;
}
.txn-error { color: var(--red); border-color: var(--red); }

@media (max-width: 768px) {
    .txn-page { padding: 12px 12px 80px; }
    .txn-header-row { flex-direction: column; align-items: stretch; }
    .txn-table thead { display: none; }
    .txn-table, .txn-table tbody, .txn-row, .txn-row td { display: block; width: 100%; }
    .txn-row {
        border-top: 1px solid var(--gray-1);
        padding: 10px 4px;
    }
    .txn-row td { border-top: none; padding: 3px 8px; }
    .txn-row td.txn-amount { text-align: right; font-size: 16px; }
    .txn-filter select { min-width: 0; width: 100%; }
    .txn-filter { flex: 1; min-width: 120px; }
}

[data-theme="dark"] .txn-filter-card,
[data-theme="dark"] .txn-summary-item:not(.txn-summary-item-primary),
[data-theme="dark"] .txn-table-wrap,
[data-theme="dark"] .txn-loading,
[data-theme="dark"] .txn-empty {
    background: #1B2A3F;
    border-color: #2A3D55;
    color: #E4ECF5;
}
[data-theme="dark"] .txn-title { color: #E4ECF5; }
[data-theme="dark"] .txn-summary-value { color: #E4ECF5; }
[data-theme="dark"] .txn-amount { color: #E4ECF5; }
[data-theme="dark"] .txn-table thead th {
    background: #162337;
    color: #8BB8E0;
    border-bottom-color: #2A3D55;
}
[data-theme="dark"] .txn-row td { border-top-color: #2A3D55; }
[data-theme="dark"] .txn-row:hover { background: #24364D; }
[data-theme="dark"] .txn-filter select {
    background: #24364D;
    border-color: #2A3D55;
    color: #E4ECF5;
}

/* ── SETTINGS: About card + sub-section label ─────────────────────────── */
.settings-subsection-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 14px 16px 6px;
    border-top: 1px solid var(--gray-1);
    margin-top: 4px;
}
[data-theme="dark"] .settings-subsection-label { border-top-color: #2A3D55; }

.settings-about-card { padding: 0; }
.about-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--gray-1);
}
.about-logo {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.about-company {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 1.2px;
    color: var(--navy);
    line-height: 1;
}
[data-theme="dark"] .about-company { color: #E4ECF5; }
.about-tagline {
    font-size: 12px;
    color: var(--gray-3);
    margin-top: 4px;
    line-height: 1.3;
}
.about-section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 14px 18px 6px;
    border-top: 1px solid var(--gray-1);
}
[data-theme="dark"] .about-section-title {
    color: #8BB8E0;
    border-top-color: #2A3D55;
}
.about-section-title:first-of-type { border-top: none; padding-top: 14px; }
.about-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 18px;
    font-size: 13px;
    line-height: 1.4;
}
.about-key {
    color: var(--gray-3);
    flex-shrink: 0;
    font-weight: 500;
}
.about-val {
    color: var(--navy);
    text-align: right;
    word-break: break-word;
}
[data-theme="dark"] .about-val { color: #E4ECF5; }
.about-val a { color: var(--blue); text-decoration: none; }
.about-val a:hover { text-decoration: underline; }
.about-mono { font-family: 'DM Mono', monospace; font-size: 12px; }
.about-note {
    padding: 6px 18px 16px;
    font-size: 12px;
    color: var(--gray-3);
    line-height: 1.5;
}

/* ── About card — edit mode (appended for merge safety during parallel
