/* home.css */

.page-skeleton.skeleton-home .sk-home-stack {
    gap: 10px;
}

.page-skeleton.skeleton-home .sk-home-reminder {
    height: 42px;
}

.page-skeleton.skeleton-home .sk-home-snapshot {
    min-height: 124px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-skeleton.skeleton-home .sk-home-session {
    min-height: 142px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.page-skeleton.skeleton-home .sk-home-money {
    min-height: 104px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-skeleton.skeleton-home .sk-title {
    height: 12px;
    width: 42%;
}

.page-skeleton.skeleton-home .sk-row {
    height: 12px;
    width: 100%;
}

.page-skeleton.skeleton-home .sk-timer {
    height: 24px;
    width: 58%;
}

.page-skeleton.skeleton-home .sk-meta {
    height: 12px;
    width: 52%;
}

.page-skeleton.skeleton-home .sk-amount {
    height: 28px;
    width: 56%;
}

@media (min-width: 1024px) {
    .page-skeleton.skeleton-home {
        padding: 14px 16px 20px;
    }

    .page-skeleton.skeleton-home .sk-home-stack {
        max-width: 1280px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
        grid-template-areas:
            "reminder reminder"
            "snapshot money"
            "session session";
        gap: 10px;
    }

    .page-skeleton.skeleton-home .sk-home-reminder {
        grid-area: reminder;
    }

    .page-skeleton.skeleton-home .sk-home-snapshot {
        grid-area: snapshot;
    }

    .page-skeleton.skeleton-home .sk-home-money {
        grid-area: money;
    }

    .page-skeleton.skeleton-home .sk-home-session {
        grid-area: session;
    }
}

/* Stop Confirmation Modal - Enhanced for safety */
#stopConfirmModal {
    background: rgba(13, 10, 9, 0.52);
    backdrop-filter: blur(4px);
}

#stopConfirmModal .modal-content {
    width: min(420px, calc(100vw - 28px));
    border: 1px solid rgba(217, 74, 56, 0.2);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

#stopConfirmModal .modal-header {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.12) 0%, rgba(242, 138, 30, 0.08) 100%);
    border-bottom: 1px solid rgba(217, 74, 56, 0.18);
    padding: 16px 18px;
}

#stopConfirmModal .modal-header h3 {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

#stopConfirmModal .modal-header h3::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d94a38;
    box-shadow: 0 0 0 5px rgba(217, 74, 56, 0.14);
}

#stopConfirmModal .confirmation-message {
    color: var(--text);
    font-weight: 500;
    line-height: 1.55;
    font-size: 14px;
    padding: 2px 18px 0;
}

#stopConfirmModal .modal-footer {
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: none;
}

#stopConfirmModal #confirmCancelBtn {
    flex: 1;
    order: 2;
    min-height: 40px;
    background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
    border: 1px solid rgba(217, 74, 56, 0.34);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(217, 74, 56, 0.24);
}

#stopConfirmModal #confirmContinueBtn {
    flex: 1;
    order: 1;
    min-height: 40px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.14);
    color: var(--text);
    font-weight: 600;
}

#stopConfirmModal #confirmCancelBtn:hover {
    filter: brightness(1.03);
}

#stopConfirmModal #confirmCancelBtn:active {
    transform: translateY(1px);
}

body.dark-mode #stopConfirmModal .modal-content {
    border-color: rgba(242, 138, 30, 0.3);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.46);
}

body.dark-mode #stopConfirmModal .modal-header {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.2) 0%, rgba(242, 138, 30, 0.16) 100%);
    border-bottom-color: rgba(242, 138, 30, 0.24);
}

body.dark-mode #stopConfirmModal .modal-header h3 {
    color: var(--dark-text);
}

body.dark-mode #stopConfirmModal #confirmCancelBtn {
    color: #fff;
    border-color: rgba(242, 138, 30, 0.4);
    box-shadow: 0 10px 20px rgba(217, 74, 56, 0.28);
}

body.dark-mode #stopConfirmModal #confirmContinueBtn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--dark-text);
}

#overtimeChoiceModal {
    background: rgba(13, 10, 9, 0.52);
    backdrop-filter: blur(4px);
}

#overtimeChoiceModal .modal-content {
    width: min(420px, calc(100vw - 28px));
    border: 1px solid rgba(217, 74, 56, 0.2);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

#overtimeChoiceModal .modal-header {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.12) 0%, rgba(242, 138, 30, 0.08) 100%);
    border-bottom: 1px solid rgba(217, 74, 56, 0.18);
    padding: 16px 18px;
}

#overtimeChoiceModal .modal-header h3 {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

#overtimeChoiceModal .modal-header h3::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d94a38;
    box-shadow: 0 0 0 5px rgba(217, 74, 56, 0.14);
}

#overtimeChoiceModal .confirmation-message {
    color: var(--text);
    font-weight: 500;
    line-height: 1.55;
    font-size: 14px;
    padding: 2px 18px 0;
}

#overtimeChoiceModal .modal-footer {
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: none;
}

#overtimeChoiceModal #overtimeDiscardBtn {
    flex: 1;
    order: 2;
    min-height: 40px;
    background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
    border: 1px solid rgba(217, 74, 56, 0.34);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(217, 74, 56, 0.24);
}

#overtimeChoiceModal #overtimeAddBtn {
    flex: 1;
    order: 1;
    min-height: 40px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.14);
    color: var(--text);
    font-weight: 600;
}

body.dark-mode #overtimeChoiceModal .modal-content {
    border-color: rgba(242, 138, 30, 0.3);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.46);
}

body.dark-mode #overtimeChoiceModal .modal-header {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.2) 0%, rgba(242, 138, 30, 0.16) 100%);
    border-bottom-color: rgba(242, 138, 30, 0.24);
}

body.dark-mode #overtimeChoiceModal .modal-header h3 {
    color: var(--dark-text);
}

body.dark-mode #overtimeChoiceModal #overtimeDiscardBtn {
    color: #fff;
    border-color: rgba(242, 138, 30, 0.4);
    box-shadow: 0 10px 20px rgba(217, 74, 56, 0.28);
}

body.dark-mode #overtimeChoiceModal #overtimeAddBtn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--dark-text);
}

/* Time picker (home) */
.time-picker-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    z-index: 1105;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.time-picker-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.time-picker-sheet {
    width: min(600px, 100%);
    max-height: 72vh;
    overflow: hidden;
    background: var(--card);
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(217, 74, 56, 0.18);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
    padding: 14px 16px 18px;
    transform: translateY(100%);
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.time-picker-backdrop.show .time-picker-sheet {
    transform: translateY(0);
}

.time-picker-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--card);
}

.time-picker-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.time-picker-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.time-picker-now-btn {
    min-height: 34px;
    border: 1px solid rgba(10, 119, 221, 0.28);
    border-radius: 999px;
    background: rgba(10, 119, 221, 0.08);
    color: #0a77dd;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
}

.time-picker-preview-pill {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    color: #0a77dd;
    font-weight: 600;
    background: rgba(10, 119, 221, 0.1);
}

.time-wheel-wrap {
    --time-wheel-row-height: 44px;
    --time-wheel-padding-y: 88px;
    --time-wheel-wrap-top-pad: 10px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 8px;
    padding-top: var(--time-wheel-wrap-top-pad);
}

.time-wheel-col {
    min-width: 0;
}

.time-wheel-scroller {
    height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    border-radius: 14px;
    background: var(--card);
    padding: var(--time-wheel-padding-y) 0;
    -webkit-overflow-scrolling: touch;
}

.time-wheel-scroller::-webkit-scrollbar {
    display: none;
}

.time-wheel-option {
    width: 100%;
    min-height: var(--time-wheel-row-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    opacity: 0.28;
    transform: scale(0.95);
    scroll-snap-align: center;
    transition: opacity 130ms ease, transform 130ms ease, color 130ms ease, font-size 130ms ease;
}

.time-wheel-option.selected {
    opacity: 1;
    transform: scale(1);
    font-size: 18px;
    font-weight: 700;
}

.time-wheel-center-guide {
    position: absolute;
    left: 4px;
    right: 4px;
    top: calc(var(--time-wheel-wrap-top-pad) + var(--time-wheel-padding-y) + (var(--time-wheel-row-height) / 2));
    transform: translateY(-50%);
    height: var(--time-wheel-row-height);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

.time-picker-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.time-picker-done {
    min-height: 38px;
}

body.dark-mode .time-picker-sheet {
    border-color: rgba(242, 138, 30, 0.28);
}

body.dark-mode .time-picker-header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    background: var(--card);
}

body.dark-mode .time-picker-now-btn {
    border-color: rgba(130, 186, 255, 0.35);
    background: rgba(130, 186, 255, 0.12);
    color: #9dc8ff;
}

body.dark-mode .time-wheel-center-guide {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Duplicate session modal (same visual system as stop confirm) */
#duplicateSessionModal {
    background: rgba(12, 9, 8, 0.46);
    backdrop-filter: blur(3px);
    z-index: 1200;
}

#duplicateSessionModal .modal-content {
    width: min(448px, calc(100vw - 28px));
    border: 1px solid rgba(217, 74, 56, 0.18);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

#duplicateSessionModal .modal-header {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.1) 0%, rgba(242, 138, 30, 0.08) 100%);
    border-bottom: 1px solid rgba(217, 74, 56, 0.16);
    padding: 14px 18px;
}

#duplicateSessionModal .modal-header h3 {
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

#duplicateSessionModal .modal-body {
    padding: 14px 18px 10px;
    display: grid;
    gap: 8px;
}

#duplicateSessionModal .confirmation-message {
    color: var(--text);
    font-weight: 600;
    line-height: 1.5;
    font-size: 14px;
    margin: 0;
}

#duplicateSessionModal .duplicate-session-helper {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

#duplicateSessionModal .modal-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 18px 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

#duplicateSessionModal #duplicateSessionCancelBtn,
#duplicateSessionModal #duplicateSessionStartBtn,
#duplicateSessionModal #duplicateSessionCalendarBtn {
    min-height: 44px;
    border-radius: 14px;
    padding: 0 10px;
    width: 100%;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.01em;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

#duplicateSessionModal #duplicateSessionCancelBtn {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--text);
}

#duplicateSessionModal #duplicateSessionStartBtn {
    background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
    border: 1px solid rgba(217, 74, 56, 0.32);
    color: #fff;
    box-shadow: 0 6px 14px rgba(217, 74, 56, 0.22);
}

#duplicateSessionModal #duplicateSessionCalendarBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.18);
    color: var(--text);
}

#duplicateSessionModal #duplicateSessionCancelBtn:hover,
#duplicateSessionModal #duplicateSessionCalendarBtn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.24);
}

#duplicateSessionModal #duplicateSessionStartBtn:hover {
    filter: brightness(1.03);
    box-shadow: 0 8px 16px rgba(217, 74, 56, 0.24);
}

#duplicateSessionModal #duplicateSessionStartBtn:active {
    transform: translateY(1px);
}

#duplicateSessionModal #duplicateSessionCancelBtn:focus-visible,
#duplicateSessionModal #duplicateSessionStartBtn:focus-visible,
#duplicateSessionModal #duplicateSessionCalendarBtn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 74, 56, 0.25);
}

#duplicateSessionModal #duplicateSessionStartBtn:disabled {
    opacity: 0.62;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

@media (max-width: 480px) {
    #duplicateSessionModal .modal-content {
        width: min(420px, calc(100vw - 24px));
    }

    #duplicateSessionModal .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

body.dark-mode #duplicateSessionModal .modal-content {
    border-color: rgba(242, 138, 30, 0.24);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.46);
}

body.dark-mode #duplicateSessionModal .modal-header {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.18) 0%, rgba(242, 138, 30, 0.14) 100%);
    border-bottom-color: rgba(242, 138, 30, 0.2);
}

body.dark-mode #duplicateSessionModal .duplicate-session-helper {
    color: rgba(255, 255, 255, 0.74);
}

body.dark-mode #duplicateSessionModal .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode #duplicateSessionModal #duplicateSessionCancelBtn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--dark-text);
}

body.dark-mode #duplicateSessionModal #duplicateSessionCalendarBtn {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--dark-text);
}

body.dark-mode #duplicateSessionModal #duplicateSessionCancelBtn:hover,
body.dark-mode #duplicateSessionModal #duplicateSessionCalendarBtn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 14px 18px 34px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    gap: 10px;
    transition: max-width 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    padding-bottom: 72px;
}

/* Today summary */
.today-summary-card {
    background-color: var(--card);
    border-radius: var(--radius-md);
    padding: 0;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(217, 74, 56, 0.18);
    overflow: hidden;
}

.today-summary-toggle {
    width: 100%;
    min-height: 42px;
    border: none;
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.08) 0%, rgba(242, 138, 30, 0.10) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text);
}

.today-summary-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
}

.today-summary-chevron {
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.today-summary-card.expanded .today-summary-chevron {
    transform: rotate(180deg);
}

.today-summary-panel {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: height 200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.today-summary-card.expanded .today-summary-panel {
    opacity: 1;
}

.today-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.today-summary-row:first-of-type {
    border-top: none;
}

.today-summary-label {
    font-size: 13px;
    color: var(--muted);
}

.today-summary-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

body.dark-mode .today-summary-row {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .today-summary-card {
    border-color: rgba(242, 138, 30, 0.4);
}

body.dark-mode .today-summary-toggle {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.2) 0%, rgba(242, 138, 30, 0.2) 100%);
}

/* Schedule reminder banner */
.schedule-reminder-banner {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.14) 0%, rgba(242, 138, 30, 0.12) 100%);
    border: 1px solid rgba(217, 74, 56, 0.35);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    position: sticky;
    top: 72px;
    z-index: 90;
}

.schedule-reminder-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-reminder-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.schedule-reminder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.reminder-primary-btn,
.reminder-snooze-btn {
    min-height: 40px;
    padding: 8px 12px;
}

.reminder-dismiss-btn {
    font-size: 12px;
    min-height: 40px;
}

body.dark-mode .schedule-reminder-banner {
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.24) 0%, rgba(242, 138, 30, 0.18) 100%);
    border-color: rgba(242, 138, 30, 0.45);
}

/* Clock */
.clock-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.clock-left-controls,
.clock-right-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 64px;
}

.clock-right-controls {
    justify-content: flex-end;
}

.clock-main {
    text-align: center;
    min-width: 0;
}

.clock-icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(217, 74, 56, 0.24);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.08) 0%, rgba(242, 138, 30, 0.1) 100%);
}

.clock-icon-btn .icon-moon {
    display: none;
}

body.dark-mode .clock-icon-btn .icon-sun {
    display: none;
}

body.dark-mode .clock-icon-btn .icon-moon {
    display: block;
}

.connectivity-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.connectivity-dot.online {
    background: #22c55e;
}

.connectivity-dot.offline {
    background: #d94a38;
}

.header-balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(217, 74, 56, 0.25);
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.12) 0%, rgba(242, 138, 30, 0.14) 100%);
    color: var(--text);
    white-space: nowrap;
    text-decoration: none;
}

.header-balance-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--muted);
}

.header-balance-value {
    font-size: 12px;
    font-weight: 700;
}

.header-nav .calendar-icon {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(217, 74, 56, 0.24);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.08) 0%, rgba(242, 138, 30, 0.1) 100%);
}

.realtime-clock {
    font-size: 33px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.realtime-clock.working {
    transform: scale(0.75);
    opacity: 0.85;
}

.clock-date {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}

/* Session Card */
.session-card {
    background-color: var(--card);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    text-align: center;
    min-height: 168px;
    transition:
        min-height 240ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 240ms cubic-bezier(0.22, 1, 0.36, 1),
        border-radius 240ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 240ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.home-session-active .session-card {
    display: flex;
    flex-direction: column;
}

.session-main-pane {
    width: 100%;
    position: relative;
}

.session-status {
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.session-timer {
    margin: 12px 0 16px;
}

.timer-time {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent-green);
    margin-bottom: 4px;
}

.timer-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.session-time-in {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    margin: 12px 0 16px;
}

.session-time-in .label {
    color: var(--muted);
}

.session-time-in .value {
    color: var(--text);
    font-weight: 500;
}

.session-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.auto-timeout-row {
    margin-top: 18px;
    padding-top: 12px;
    display: none;
    gap: 10px;
    flex-direction: column;
    margin-top: auto;
}

body.home-session-active .auto-timeout-row {
    display: flex;
}

.auto-timeout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.auto-timeout-title-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auto-timeout-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
}

.auto-timeout-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.auto-timeout-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auto-timeout-slider {
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    position: relative;
    transition: background 180ms ease;
}

.auto-timeout-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    left: 2px;
    top: 2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease;
}

.auto-timeout-switch input:checked + .auto-timeout-slider {
    background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
}

.auto-timeout-switch input:checked + .auto-timeout-slider::after {
    transform: translateX(20px);
}

.auto-timeout-state {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
}

.auto-timeout-time-pill {
    min-height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(217, 74, 56, 0.24);
    background: rgba(217, 74, 56, 0.08);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.auto-timeout-time-pill.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

body.dark-mode .auto-timeout-row {
    border-top-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .auto-timeout-slider {
    background: rgba(255, 255, 255, 0.18);
}

body.dark-mode .auto-timeout-time-pill {
    border-color: rgba(242, 138, 30, 0.32);
    background: rgba(242, 138, 30, 0.12);
}

/* Inactive session: compact single-band pill */
body:not(.home-session-active) .session-card {
    min-height: 56px;
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

body:not(.home-session-active) .session-main-pane {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    width: 100%;
    min-height: 100%;
    line-height: 1;
}

body:not(.home-session-active) .session-status {
    margin-bottom: 0;
    font-size: 14px;
    letter-spacing: 0.6px;
    line-height: 1;
}

body:not(.home-session-active) .session-actions {
    position: static;
    margin: 0;
    width: auto;
    justify-content: center;
}

body:not(.home-session-active) #startStopBtn {
    min-height: 32px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    background: #d94a38;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 5px 12px rgba(217, 74, 56, 0.22);
}

body.home-session-active .session-main-pane {
    padding-top: 46px;
}

body.home-session-active .session-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    margin: 0;
    width: auto;
    justify-content: flex-start;
}

body.home-session-active #startStopBtn {
    min-height: 33px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #d94a38;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 10px rgba(217, 74, 56, 0.28);
    font-size: 12px;
    letter-spacing: 0.2px;
}

body.home-session-active #startStopBtn:hover {
    background: #c94233;
}

body.home-session-active #startStopBtn:active {
    background: #b93b2d;
    transform: translateY(1px);
}

body.home-session-active #startStopBtn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 74, 56, 0.25);
}

/* warning shown when user tries to start a duplicate session */
.session-warning {
    margin-top: 8px;
    font-size: 13px;
    color: #d9534f; /* danger red */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.session-warning-start {
    background: none;
    border: none;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.session-warning-link svg {
    width: 18px;
    height: 18px;
    color: inherit;
}

/* Narrative Note */
.narrative-note-container {
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.narrative-note {
    background-color: var(--card);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.note-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.note-input-wrap {
    position: relative;
}

.note-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    padding: 10px 62px 54px 10px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
    color: var(--text);
    background-color: var(--bg);
    transition: border-color 0.2s ease;
}

.note-textarea::-webkit-scrollbar {
    width: 8px;
}

.note-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.note-textarea::-webkit-scrollbar-thumb {
    background: rgba(217, 74, 56, 0.45);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.note-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 74, 56, 0.65);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.note-textarea {
    scrollbar-width: thin;
    scrollbar-color: rgba(217, 74, 56, 0.55) transparent;
}

.note-save-controls {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0px;
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
}

.note-save-btn-icon {
    min-height: 40px;
    min-width: 40px;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
    border: none;
    box-shadow: none;
}

.note-save-btn-icon:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.note-save-btn-icon:hover,
.note-save-btn-icon:active {
    background: transparent;
    border: none;
    box-shadow: none;
}

.note-save-btn-icon:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(217, 74, 56, 0.28);
}

body.dark-mode .note-save-btn-icon,
body.dark-mode .note-save-btn-icon:hover,
body.dark-mode .note-save-btn-icon:active,
body.dark-mode .note-save-btn-icon:disabled {
    background: transparent;
    border: none;
    box-shadow: none;
}

.note-save-btn-icon .save-icon {
    display: none;
}

.note-save-btn-icon .save-icon-default {
    display: block;
}

.note-save-btn-icon.state-saving .save-icon-default,
.note-save-btn-icon.state-success .save-icon-default {
    display: none;
}

.note-save-btn-icon.state-saving .save-icon-spinner {
    display: block;
    animation: iconSpin 0.85s linear infinite;
}

.note-save-btn-icon.state-success .save-icon-check {
    display: block;
}

.note-save-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.note-save-dot.saved {
    background: #22c55e;
}

.note-save-dot.unsaved {
    background: #f28a1e;
}

.note-save-dot.saving {
    background: #d94a38;
}

.note-save-dot.error {
    background: #111111;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.note-save-dot.autosave-off {
    background: #7b7b7b;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.note-textarea:focus {
    outline: none;
    border-color: #d94a38;
    box-shadow: 0 0 0 3px rgba(217, 74, 56, 0.15);
}

.note-textarea::placeholder {
    color: var(--muted);
}

/* Money Card */
.money-card {
    background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
    border-radius: var(--radius-lg);
    padding: 14px;
    color: white;
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
                position 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                max-width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                padding 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-radius 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(217, 74, 56, 0.32);
    max-height: 220px;
    overflow: hidden;
}

.money-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(217, 74, 56, 0.4);
}

.money-card:active {
    transform: scale(0.98);
}

body.home-session-active .money-card {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    pointer-events: none;
    transform: scale(0.985);
}

/* responsive tweaks for phones */
@media (max-width: 480px) {
    .main-content {
        padding: 11px 10px 26px;
        gap: 9px;
    }

    .clock-row { gap: 8px; }
    .clock-left-controls { min-width: 52px; }
    .clock-right-controls { min-width: 0; }
    .header-balance-chip { padding: 5px 8px; gap: 4px; }
    .header-balance-label { display: none; }
    .header-balance-value { font-size: 11px; }
    .realtime-clock { font-size: 29px; }
    .clock-date { font-size: 11px; }

    .session-card { padding: 16px 14px; }
    body:not(.home-session-active) .session-card {
        padding: 6px 10px;
        min-height: 48px;
        border-radius: 999px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    body:not(.home-session-active) .session-main-pane { gap: 9px; justify-content: center; align-items: center; white-space: nowrap; }
    body:not(.home-session-active) .session-status { font-size: 13px; line-height: 1; margin-bottom: 0; }
    body:not(.home-session-active) #startStopBtn { min-height: 30px; padding: 4px 12px; font-size: 13px; line-height: 1; }

    .session-status { font-size: 11px; }
    .timer-time { font-size: 28px; }
    .timer-label { font-size: 9px; }
    .session-time-in { font-size: 13px; }

    .note-label { font-size: 10px; }
    .note-textarea { min-height: 70px; padding: 9px 56px 50px 9px; }
    .note-save-controls { right: 7px; bottom: 7px; }
    .today-summary-card { border-radius: 12px; }
    .today-summary-toggle { padding: 9px 12px; }
    .today-summary-label { font-size: 12px; }
    .today-summary-value { font-size: 13px; }
    .schedule-reminder-banner { padding: 9px 10px; top: 68px; }
    .daily-verse-grabber { width: 36px; }
    .daily-verse-panel { padding: 14px; }

    .money-card { padding: 11px; }
}

@media (max-width: 360px) {
    .main-content { padding: 9px 8px 22px; gap: 8px; }
    .clock-icon-btn { width: 34px; height: 34px; }
    .header-nav .calendar-icon { width: 34px; height: 34px; }
    .realtime-clock { font-size: 26px; }
    .clock-date { font-size: 10px; }
    .session-card { padding: 14px 11px; }
    body:not(.home-session-active) .session-card {
        padding: 5px 8px;
        min-height: 46px;
        border-radius: 999px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    body:not(.home-session-active) .session-main-pane { gap: 7px; justify-content: center; align-items: center; white-space: nowrap; }
    body:not(.home-session-active) .session-status { font-size: 12px; letter-spacing: 0.5px; line-height: 1; margin-bottom: 0; }
    body:not(.home-session-active) #startStopBtn { min-height: 28px; padding: 4px 10px; font-size: 12px; line-height: 1; }
    .timer-time { font-size: 24px; }
    .session-time-in { font-size: 12px; }
    .note-textarea { min-height: 60px; padding: 8px 52px 46px 8px; }
    .note-save-controls { right: 6px; bottom: 6px; gap: 5px; }
    .money-card { padding: 9px; }
}

.money-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.money-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.money-card svg {
    color: white;
    display: block;
}

.money-amount {
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.money-footer {
    font-size: 12px;
    opacity: 0.85;
}

.money-subtitle {
    font-weight: 500;
}

.verse-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.verse-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    font-style: italic;
    margin-bottom: 4px;
    font-weight: 400;
    text-align: center;
    display: -webkit-box;
    line-clamp: none;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verse-reference {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    margin: 0;
    text-align: center;
}

/* Working Session Expanded Layout */
.main-content.working-session {
    max-width: 100%;
    padding: 16px 16px 80px;
}

.main-content.working-session .session-card {
    margin-bottom: 10px;
}

.main-content.working-session .narrative-note-container,
.main-content.working-session .money-card {
    max-width: 100%;
}

.main-content.working-session .narrative-note-container {
    width: 100%;
}

.main-content.working-session .money-card {
    width: 100%;
}

@keyframes slideInRight {
    from {
        transform: translateX(420px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.notification-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-close {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: var(--text);
}

.notification-message {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

.notification-time,
.notification-elapsed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 12px;
}

.notification-time .label,
.notification-elapsed .label {
    color: var(--muted);
    font-weight: 500;
}

.notification-time .value,
.notification-elapsed .value {
    color: var(--text);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.notification-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.notification.info {
    border-left: 4px solid var(--accent-green);
}

.notification.break {
    border-left: 4px solid #f59e0b;
}

.notification.active-session {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

body.dark-mode .notification.active-session {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

/* Daily verse fixed dropup */
.daily-verse-handle {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    pointer-events: none;
    display: flex;
    justify-content: center;
    padding: 0 12px max(10px, env(safe-area-inset-bottom));
}

.daily-verse-toggle {
    pointer-events: auto;
    width: 100%;
    max-width: 220px;
    min-height: 32px;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    cursor: pointer;
}

.daily-verse-grabber {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
    box-shadow: 0 2px 8px rgba(217, 74, 56, 0.35);
}

.daily-verse-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 118;
}

.daily-verse-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.daily-verse-panel {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 20px);
    bottom: max(56px, calc(env(safe-area-inset-bottom) + 56px));
    width: min(400px, calc(100% - 24px));
    max-height: 60vh;
    overflow: auto;
    background: var(--card);
    border-radius: 16px;
    border: 1px solid rgba(217, 74, 56, 0.25);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
    padding: 16px;
    opacity: 0;
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
}

.daily-verse-backdrop.open .daily-verse-panel {
    transform: translate(-50%, 0);
    opacity: 1;
}

body.daily-verse-open .app-container {
    filter: blur(1px);
}

body.daily-verse-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 600px) and (min-width: 481px) {
    .main-content {
        padding: 24px 14px 42px;
        gap: 12px;
    }

    .realtime-clock { font-size: 31px; }

    .session-card {
        padding: 24px 18px;
    }

    .timer-time {
        font-size: 35px;
    }

    .money-card {
        padding: 16px;
    }

    .money-amount {
        font-size: 29px;
    }

    .verse-text {
        font-size: 13px;
    }


    /* Notifications on mobile */
    .notification-container {
        right: 12px;
        left: 12px;
        max-width: none;
        top: 85px;
    }

    .notification {
        max-width: 100%;
    }
}

@media (min-width: 1024px) {
    .desktop-main .main-content {
        --home-desktop-top-card-height: 184px;
        max-width: none;
        width: calc(100% - 32px);
        margin: 0 16px;
        padding: 12px 8px 164px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
        grid-template-areas:
            "session session"
            "snapshot balance"
            "reminder reminder";
        align-items: start;
        gap: 10px;
    }

    .desktop-main .main-content > * {
        max-width: none;
        width: 100%;
    }

    .desktop-main #headerBalanceChip {
        display: none !important;
    }

    .desktop-main .schedule-reminder-banner {
        grid-area: reminder;
        position: sticky;
        top: 72px;
    }

    .desktop-main .today-summary-card {
        grid-area: snapshot;
        align-self: stretch;
        min-height: 160px;
        display: flex;
        flex-direction: column;
    }

    .desktop-main .money-card {
        grid-area: balance;
        position: static;
        max-width: none;
        align-self: stretch;
        padding: 12px;
        border-radius: 16px;
        min-height: 160px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transition: opacity 220ms ease, box-shadow 220ms ease, transform 220ms ease;
    }

    /* Desktop inactive: top cards auto-size to content */
    body:not(.home-session-active) .desktop-main .today-summary-card,
    body:not(.home-session-active) .desktop-main .money-card {
        height: auto;
        min-height: 0;
        max-height: none;
        align-self: stretch;
    }

    body:not(.home-session-active) .desktop-main .today-summary-card {
        border-radius: 16px;
        overflow: hidden;
    }

    body:not(.home-session-active) .desktop-main .today-summary-toggle {
        min-height: 36px;
        padding: 7px 12px;
    }

    body:not(.home-session-active) .desktop-main .today-summary-panel {
        padding: 2px 12px 8px !important;
        gap: 0;
    }

    body:not(.home-session-active) .desktop-main .today-summary-row {
        flex: 0 0 auto;
        min-height: 0;
        padding: 6px 0;
        align-items: center;
    }

    body:not(.home-session-active) .desktop-main .today-summary-label {
        font-size: 12px;
    }

    body:not(.home-session-active) .desktop-main .today-summary-value {
        font-size: 12px;
        font-weight: 700;
    }

    body:not(.home-session-active) .desktop-main .money-card {
        max-height: none;
        overflow: hidden;
        padding: 10px 12px;
        justify-content: flex-start;
        gap: 10px;
    }

    body:not(.home-session-active) .desktop-main .money-header {
        margin-bottom: 6px;
    }

    body:not(.home-session-active) .desktop-main .money-amount {
        margin: 0;
        font-size: 46px;
        line-height: 1;
    }

    body:not(.home-session-active) .desktop-main .money-footer {
        margin-top: 0;
    }

    .desktop-main .session-card {
        grid-area: session;
        margin-top: 0;
        padding: 12px 14px;
        border-radius: 16px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 0fr;
        align-items: stretch;
        gap: 0;
        overflow: hidden;
    }

    body:not(.home-session-active) .desktop-main .session-card {
        border-radius: 999px;
        min-height: 58px;
        padding: 4px 10px;
        box-shadow: var(--shadow-sm);
        width: fit-content;
        max-width: none;
        justify-self: center;
        align-self: start;
        margin: 0;
        display: flex;
        grid-template-columns: none;
        align-items: center;
        justify-content: center;
    }

    body:not(.home-session-active) .desktop-main .session-main-pane {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transform: none;
        white-space: nowrap;
        width: auto;
        min-height: 0;
    }

    body:not(.home-session-active) .desktop-main .session-status {
        margin-bottom: 0;
        font-size: 13px;
        letter-spacing: 0.6px;
        line-height: 1;
    }

    body:not(.home-session-active) .desktop-main .session-actions {
        position: static;
        margin: 0;
        width: auto;
        justify-content: center;
    }

    body:not(.home-session-active) .desktop-main #startStopBtn {
        min-height: 30px;
        padding: 4px 14px;
        border-radius: 999px;
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
        background: #d94a38;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 5px 12px rgba(217, 74, 56, 0.22);
    }

    body:not(.home-session-active) .desktop-main #startStopBtn:hover {
        filter: brightness(1.03);
    }

    body:not(.home-session-active) .desktop-main #startStopBtn:active {
        transform: translateY(1px);
    }

    body:not(.home-session-active) .desktop-main .session-card .narrative-note-container {
        display: none !important;
    }

    .desktop-main .session-main-pane {
        min-width: 0;
        transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
            width 200ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .desktop-main .session-card .narrative-note-container {
        display: block !important;
        width: 100%;
        height: 100%;
        max-width: none;
        min-width: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateX(14px) scale(0.98);
        transform-origin: right center;
        transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1),
            transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
        animation: none;
    }

    body.home-session-active .desktop-main .session-card {
        grid-template-columns: minmax(0, 58%) minmax(0, 42%);
        gap: 10px;
    }

    body.home-session-active .desktop-main .session-main-pane {
        transform: translateX(-6px);
    }

    body.home-session-active .desktop-main .session-card .narrative-note-container {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0) scale(1);
    }

    .desktop-main .narrative-note {
        height: 100%;
        padding: 9px 10px;
        border-radius: 12px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
    }

    .desktop-main .session-card .note-input-wrap {
        flex: 1;
        display: flex;
    }

    .desktop-main .session-card .note-textarea {
        flex: 1;
        height: 100%;
        min-height: 0;
    }

    .desktop-main .today-summary-toggle {
        cursor: default;
        pointer-events: none;
        min-height: 38px;
        padding: 8px 12px;
    }

    .desktop-main .today-summary-panel {
        height: auto !important;
        opacity: 1 !important;
        overflow: visible !important;
        padding: 8px 14px 12px !important;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex: 1;
    }

    .desktop-main .today-summary-chevron {
        display: none;
    }

    .daily-verse-handle {
        display: none;
    }

    .daily-verse-backdrop {
        display: block;
        opacity: 1;
        pointer-events: none;
        background: transparent;
        backdrop-filter: none;
        position: fixed;
        left: 264px;
        right: 0;
        bottom: 0;
        top: auto;
        height: 170px;
        z-index: 116;
    }

    .daily-verse-panel,
    .daily-verse-backdrop.open .daily-verse-panel {
        position: fixed;
        left: calc(264px + ((100% - 264px) / 2));
        transform: translateX(-50%);
        bottom: 10px;
        width: min(1240px, calc(100vw - 312px));
        max-height: 136px;
        overflow: auto;
        opacity: 1;
        pointer-events: auto;
        border-radius: 14px;
        padding: 12px 14px;
    }

    body.daily-verse-open .desktop-main .app-container {
        filter: none;
    }

    body.daily-verse-open {
        overflow: auto;
    }

    body.home-session-active .desktop-main .money-card {
        opacity: 1 !important;
        max-height: none !important;
        margin: 0 !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        overflow: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .desktop-main .session-card .note-label {
        margin-bottom: 8px;
    }

    .desktop-main .session-card .note-textarea {
        max-height: none;
        padding: 10px 58px 48px 10px;
    }

    .desktop-main .session-card .note-save-controls {
        right: 7px;
        bottom: 7px;
    }

}

@media (min-width: 1024px) {
    .desktop-main .main-content {
        --home-space-1: 8px;
        --home-space-2: 12px;
        --home-space-3: 16px;
        --home-space-4: 24px;
        --home-top-card-height: 192px;
        width: min(1280px, calc(100% - 40px));
        margin: 0 auto;
        padding: 18px 8px 28px;
        gap: var(--home-space-3);
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
        grid-template-areas:
            "session session"
            "snapshot balance"
            "reminder reminder"
            "verse verse";
    }

    .desktop-main .main-content > .daily-verse-backdrop {
        grid-area: verse;
    }

    .desktop-main .clock-row {
        gap: 14px;
    }

    .desktop-main .realtime-clock {
        font-size: 40px;
        letter-spacing: -1.2px;
    }

    .desktop-main .clock-date {
        margin-top: 6px;
        font-size: 14px;
    }

    body:not(.home-session-active) .desktop-main .session-card {
        justify-self: start;
        align-self: start;
        min-height: 48px;
        padding: 6px 10px;
        border-radius: 999px;
        background: linear-gradient(135deg, rgba(217, 74, 56, 0.08), rgba(242, 138, 30, 0.09));
        border: 1px solid rgba(217, 74, 56, 0.22);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
    }

    body:not(.home-session-active) .desktop-main .session-main-pane {
        gap: 10px;
    }

    body:not(.home-session-active) .desktop-main .session-status {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.45px;
        color: var(--text);
        text-transform: uppercase;
        border: 1px solid rgba(217, 74, 56, 0.2);
        background: rgba(0, 0, 0, 0.08);
        border-radius: 999px;
        padding: 6px 10px;
    }

    body:not(.home-session-active) .desktop-main #startStopBtn {
        min-height: 32px;
        padding: 6px 14px;
        font-size: 14px;
    }

    body:not(.home-session-active) .desktop-main .today-summary-card,
    body:not(.home-session-active) .desktop-main .money-card {
        height: auto;
        min-height: 0;
        max-height: none;
        border-radius: 16px;
        align-self: start;
    }

    body:not(.home-session-active) .desktop-main .today-summary-card {
        border-color: rgba(217, 74, 56, 0.28);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
        transition: transform 180ms ease, box-shadow 180ms ease;
    }

    body:not(.home-session-active) .desktop-main .today-summary-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    }

    body:not(.home-session-active) .desktop-main .today-summary-toggle {
        min-height: 42px;
        padding: 10px 14px;
    }

    body:not(.home-session-active) .desktop-main .today-summary-title {
        font-size: 13px;
        letter-spacing: 0.55px;
    }

    body:not(.home-session-active) .desktop-main .today-summary-panel {
        padding: 6px 14px 6px !important;
        gap: 0;
    }

    body:not(.home-session-active) .desktop-main .today-summary-row {
        flex: 0 0 auto;
        min-height: 0;
        padding: 6px 0;
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    body:not(.home-session-active) .desktop-main .today-summary-label {
        font-size: 13px;
        color: var(--muted);
    }

    body:not(.home-session-active) .desktop-main .today-summary-value {
        font-size: 18px;
        font-weight: 700;
        text-align: right;
    }

    body:not(.home-session-active) .desktop-main .money-card {
        padding: 14px;
        max-height: none;
        min-height: 0;
        overflow: hidden;
        box-shadow: 0 10px 24px rgba(217, 74, 56, 0.24);
        transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
        align-self: start;
    }

    body:not(.home-session-active) .desktop-main .money-card:hover {
        transform: translateY(-1px) scale(1.004);
        box-shadow: 0 12px 26px rgba(217, 74, 56, 0.28);
        filter: saturate(1.03);
    }

    body:not(.home-session-active) .desktop-main .money-header {
        margin-bottom: 10px;
    }

    body:not(.home-session-active) .desktop-main .money-label {
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.55px;
    }

    body:not(.home-session-active) .desktop-main .money-amount {
        font-size: 56px;
        line-height: 0.95;
        margin: 0;
    }

    body:not(.home-session-active) .desktop-main .money-footer {
        margin-top: 0;
        font-size: 13px;
        opacity: 0.9;
    }

    .desktop-main .schedule-reminder-banner {
        width: 100%;
        max-width: none;
        padding: 12px 14px;
    }

    .desktop-main .daily-verse-backdrop {
        position: static;
        display: block;
        width: 100%;
        height: auto;
        inset: auto;
        background: transparent;
        backdrop-filter: none;
        opacity: 1;
        pointer-events: auto;
        z-index: auto;
    }

    .desktop-main .daily-verse-panel,
    .desktop-main .daily-verse-backdrop.open .daily-verse-panel {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
        width: 100%;
        max-height: none;
        overflow: visible;
        border-radius: 16px;
        padding: 16px 18px;
        border: 1px solid rgba(217, 74, 56, 0.22);
        background: linear-gradient(135deg, rgba(217, 74, 56, 0.07), rgba(242, 138, 30, 0.06));
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
        opacity: 1;
        pointer-events: auto;
    }

    .desktop-main .verse-text {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 8px;
        line-clamp: none;
        -webkit-line-clamp: unset;
    }

    .desktop-main .verse-reference {
        font-size: 15px;
        letter-spacing: 0.2px;
    }
}

@media (min-width: 1024px) {
    /* Final compact autosize pass for top cards to avoid dead bottom space on low-metric states. */
    body:not(.home-session-active) .desktop-main .today-summary-card,
    body:not(.home-session-active) .desktop-main .money-card {
        align-self: start !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    body:not(.home-session-active) .desktop-main .quick-snapshot-card .today-summary-panel {
        padding-bottom: 6px !important;
    }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
    .desktop-main .session-main-pane,
    .desktop-main .session-card .narrative-note-container {
        transition: none;
    }
}

/* Desktop session card activation sequence: left-anchored grow */
@media (min-width: 1024px) {
    .desktop-main .session-card {
        justify-self: start;
        width: auto;
        max-width: 100%;
        inline-size: auto;
        transform-origin: left center;
        transition:
            inline-size 220ms cubic-bezier(0.22, 1, 0.36, 1),
            padding 220ms cubic-bezier(0.22, 1, 0.36, 1),
            border-radius 220ms cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
            gap 220ms cubic-bezier(0.22, 1, 0.36, 1),
            transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
            opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
            grid-template-columns 220ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .session-card.session-start-attempt {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(217, 74, 56, 0.2);
    }

    body:not(.home-session-active):not(.home-session-activating) .desktop-main .session-card {
        inline-size: fit-content;
        min-height: 48px;
        padding: 6px 10px;
        border-radius: 999px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 0fr;
        gap: 0;
        justify-self: start;
        align-self: start;
    }

    body.home-session-activating .desktop-main .session-card,
    body.home-session-active .desktop-main .session-card {
        inline-size: 100%;
        min-height: 176px;
        padding: 12px 14px;
        border-radius: 16px;
        justify-self: stretch;
        align-self: start;
        display: grid;
        grid-template-columns: minmax(0, 58%) minmax(0, 42%);
        gap: 10px;
    }

    body.home-session-activating .desktop-main .session-main-pane,
    body.home-session-active .desktop-main .session-main-pane {
        padding-top: 46px;
    }

    body.home-session-activating .desktop-main .session-actions,
    body.home-session-active .desktop-main .session-actions {
        position: absolute;
        top: 8px;
        left: 8px;
        width: auto;
        justify-content: flex-start;
        margin: 0;
    }

    body.home-session-activating .desktop-main .session-main-pane {
        transform: translateX(-2px);
    }

    body.home-session-activating .desktop-main .session-card .narrative-note-container {
        opacity: 0.35;
        pointer-events: none;
        transform: translateX(8px) scale(0.99);
    }

    body.home-session-active .desktop-main .session-card .narrative-note-container {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0) scale(1);
    }
}

body.dark-mode .clock-icon-btn,
body.dark-mode .header-nav .calendar-icon {
    border-color: rgba(242, 138, 30, 0.4);
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.18) 0%, rgba(242, 138, 30, 0.22) 100%);
}

body.dark-mode .header-balance-chip {
    border-color: rgba(242, 138, 30, 0.4);
    background: linear-gradient(135deg, rgba(217, 74, 56, 0.24) 0%, rgba(242, 138, 30, 0.26) 100%);
}

body.dark-mode .note-textarea {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .note-textarea::-webkit-scrollbar-thumb {
    background: rgba(242, 138, 30, 0.48);
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.dark-mode .note-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(242, 138, 30, 0.72);
    border: 2px solid transparent;
    background-clip: padding-box;
}

body.dark-mode .note-textarea {
    scrollbar-color: rgba(242, 138, 30, 0.62) transparent;
}

/* Quick Snapshot overrides */
.quick-snapshot-card {
    overflow: hidden;
}

.quick-snapshot-card .today-summary-toggle {
    cursor: default;
}

@media (max-width: 767px) {
    .quick-snapshot-card .today-summary-toggle {
        cursor: pointer;
    }
}

.quick-snapshot-card .today-summary-panel {
    height: auto;
    overflow: hidden;
    max-height: 640px;
    opacity: 1;
    padding: 4px 12px 8px;
    transition: max-height 210ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, padding 180ms ease;
}

.quick-snapshot-card .today-summary-title {
    font-size: 12px;
    letter-spacing: 0.5px;
    padding-left: 8px;
}

.quick-snapshot-card .quick-snapshot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.quick-snapshot-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.quick-snapshot-period-desktop {
    display: none;
}

.quick-snapshot-period-mobile {
    display: flex;
}

.quick-snapshot-period-trigger {
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(217, 74, 56, 0.26);
    padding: 10px 14px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.quick-snapshot-settings-btn {
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(217, 74, 56, 0.24);
    background: rgba(217, 74, 56, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quick-snapshot-collapse-btn {
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(217, 74, 56, 0.24);
    background: rgba(217, 74, 56, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quick-snapshot-collapse-btn svg {
    transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quick-snapshot-collapse-btn.expanded svg {
    transform: rotate(180deg);
}

.quick-snapshot-settings-btn:focus-visible,
.quick-snapshot-collapse-btn:focus-visible,
.quick-period-btn:focus-visible,
.quick-snapshot-period-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 74, 56, 0.24);
}

.quick-snapshot-card.collapsed .today-summary-panel {
    max-height: 0;
    opacity: 0;
    padding: 0 12px;
}

.quick-snapshot-period-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(4px);
    z-index: 1200;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 200ms;
}

.quick-snapshot-period-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.quick-snapshot-period-sheet {
    width: min(520px, 100%);
    border-radius: 16px;
    border: 1px solid rgba(217, 74, 56, 0.25);
    background: var(--card);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
    padding: 10px 10px 12px;
    transform: translateY(20px) scale(0.98);
    opacity: 0;
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quick-snapshot-period-backdrop.show .quick-snapshot-period-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.quick-snapshot-period-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 8px;
}

.quick-snapshot-period-header h3 {
    margin: 0;
    font-size: 15px;
}

.quick-snapshot-period-options {
    display: grid;
    gap: 6px;
}

.quick-snapshot-period-option {
    min-height: 44px;
    border: 1px solid rgba(217, 74, 56, 0.16);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
}

.quick-snapshot-period-option.active {
    color: #fff;
    border-color: rgba(217, 74, 56, 0.3);
    background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
}

.quick-snapshot-period-option:focus-visible,
.quick-snapshot-period-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 74, 56, 0.24);
}

.quick-snapshot-card .today-summary-row {
    padding: 10px 0;
    min-height: 42px;
}

.quick-snapshot-rows--dense .today-summary-row {
    padding: 7px 0;
    min-height: 34px;
}

.quick-snapshot-card .today-summary-label {
    font-size: 13px;
    color: var(--muted);
}

.quick-snapshot-card .today-summary-value {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    margin-left: auto;
}

#quickSnapshotCustomizeModal .modal-content {
    width: min(460px, calc(100vw - 28px));
    border-radius: 16px;
}

#quickSnapshotCustomizeModal .modal-body {
    display: grid;
    gap: 10px;
}

#quickSnapshotCustomizeModal .quick-snapshot-modal-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#quickSnapshotCustomizeModal .quick-snapshot-action-btn {
    min-height: 44px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
}

#quickSnapshotCustomizeModal .quick-snapshot-action-icon {
    flex: 0 0 auto;
}

#quickSnapshotCustomizeModal .quick-snapshot-action-label {
    font-weight: 600;
}

#quickSnapshotResetBtn:hover .quick-snapshot-action-icon-reset {
    transform: rotate(-30deg);
    transition: transform 180ms ease;
}

.quick-snapshot-option {
    min-height: 44px;
    border: 1px solid rgba(217, 74, 56, 0.18);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.quick-snapshot-option label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.quick-snapshot-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d94a38;
}

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

@media (min-width: 768px) {
    .quick-snapshot-period-mobile {
        display: none;
    }

    .quick-snapshot-collapse-btn {
        display: none !important;
    }

    .quick-snapshot-period-backdrop {
        display: none !important;
    }

    .quick-snapshot-period-desktop {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        padding: 2px;
        border-radius: 999px;
        border: 1px solid rgba(217, 74, 56, 0.26);
        background: rgba(0, 0, 0, 0.08);
    }

    .quick-snapshot-card .today-summary-panel {
        max-height: none;
        opacity: 1;
        padding: 6px 14px 8px;
    }

    .quick-period-btn {
        border: none;
        background: transparent;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        padding: 6px 10px;
        border-radius: 999px;
        transition: background-color 170ms ease, color 170ms ease, box-shadow 170ms ease;
    }

    .quick-period-btn.active {
        color: #fff;
        background: linear-gradient(135deg, #d94a38 0%, #f28a1e 100%);
        box-shadow: 0 4px 10px rgba(217, 74, 56, 0.22);
    }

    #quickSnapshotCustomizeModal .quick-snapshot-action-label {
        display: inline;
    }

    #quickSnapshotCustomizeModal .quick-snapshot-action-btn {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .quick-snapshot-controls {
        gap: 6px;
    }

    .quick-snapshot-period-mobile {
        min-width: 0;
    }

    .quick-snapshot-period-trigger {
        min-height: 34px;
        height: 34px;
        border-radius: 999px;
        padding: 0 10px;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        min-width: 96px;
        max-width: 122px;
        white-space: nowrap;
        gap: 6px;
        touch-action: manipulation;
    }

    #quickSnapshotPeriodTriggerLabel {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .quick-snapshot-period-trigger svg {
        width: 12px;
        height: 12px;
        flex: 0 0 auto;
    }

    .quick-snapshot-settings-btn,
    .quick-snapshot-collapse-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
        border-radius: 50%;
        touch-action: manipulation;
    }

    .quick-snapshot-card .today-summary-toggle {
        min-height: 42px;
        padding: 9px 10px;
    }

    /* Mobile shape states:
       - collapsed: compact pill
       - expanded: rounded rectangle card */
    .quick-snapshot-card {
        transition: box-shadow 180ms ease;
    }

    .quick-snapshot-card.collapsed {
        width: 100%;
        border-radius: 999px;
    }

    .quick-snapshot-card.collapsed .today-summary-toggle {
        width: 100%;
        min-height: 40px;
        padding: 8px 10px;
        border-radius: 999px;
        transition: border-radius 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
    }

    .quick-snapshot-card.expanded {
        width: 100%;
        border-radius: 14px;
    }

    .quick-snapshot-card.expanded .today-summary-toggle {
        width: 100%;
        min-height: 40px;
        padding: 8px 10px;
        border-radius: 14px 14px 0 0;
        transition: border-radius 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
    }

    .quick-snapshot-card .today-summary-panel {
        padding: 4px 12px 8px;
    }

    .quick-snapshot-card .today-summary-row {
        min-height: 34px;
        padding: 6px 0;
    }

    .quick-snapshot-rows--dense .today-summary-row {
        min-height: 30px;
        padding: 4px 0;
    }

    #quickSnapshotCustomizeModal .quick-snapshot-action-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0;
    }

    #quickSnapshotCustomizeModal .quick-snapshot-action-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quick-snapshot-period-backdrop,
    .quick-snapshot-period-sheet {
        transition: opacity 120ms ease !important;
    }

    .quick-snapshot-period-sheet,
    .quick-snapshot-period-backdrop.show .quick-snapshot-period-sheet {
        transform: none !important;
    }
}

@media (min-width: 1024px) {
    .desktop-main .quick-snapshot-card .today-summary-toggle {
        pointer-events: auto !important;
        min-height: 46px;
        padding: 10px 14px;
    }

    .desktop-main .quick-snapshot-card .today-summary-title {
        font-size: 13px;
        letter-spacing: 0.55px;
    }

    .desktop-main .quick-snapshot-card .today-summary-panel {
        padding: 6px 14px 6px !important;
    }

    .desktop-main .quick-snapshot-card .today-summary-row {
        padding: 8px 0;
        flex: 0 0 auto !important;
        min-height: 36px;
    }

    .desktop-main .quick-snapshot-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    }

    body:not(.home-session-active) .desktop-main .today-summary-card,
    body:not(.home-session-active) .desktop-main .money-card {
        height: auto;
        max-height: none;
        min-height: 0;
        transition: min-height 180ms ease, padding 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    }
}

body.dark-mode .quick-snapshot-period-backdrop {
    background: rgba(0, 0, 0, 0.46);
}

body.dark-mode .quick-snapshot-period-sheet {
    border-color: rgba(242, 138, 30, 0.28);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.44);
}

body.dark-mode .quick-snapshot-period-option {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--dark-text);
}

/* Do not replay Home entrance transitions while restoring state. */
html.app-restoring-state .session-card,
html.app-restoring-state .session-main-pane,
html.app-restoring-state .narrative-note-container,
html.app-restoring-state .today-summary-card,
html.app-restoring-state .today-summary-panel,
html.app-restoring-state .money-card,
html.app-restoring-state #startStopBtn {
    transition: none !important;
    animation: none !important;
}

html:not(.app-animations-ready) .session-card,
html:not(.app-animations-ready) .narrative-note-container {
    transition: none !important;
    animation: none !important;
}
