@import url('https://fonts.googleapis.com/css2?family=Product+Sans:wght@400;500;700&display=swap');

:root {
    --font-family: 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif;
    /* Keep the desktop "today" highlight in sync with the active accent */
    --today-glass-rgb: var(--accent-rgb, 0,137,241);
    --tmr-bounce-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --tmr-settle-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tmr-glass-sweep {
    0% {
        transform: translateX(-170%) translateY(-8%) rotate(24deg);
        opacity: 0;
    }
    18% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.45;
    }
    82% {
        opacity: 0.08;
    }
    100% {
        transform: translateX(170%) translateY(8%) rotate(24deg);
        opacity: 0;
    }
}

@keyframes tmr-button-bounce-click {
    0% { scale: 1; }
    18% { scale: 1.1; }
    42% { scale: 0.92; }
    68% { scale: 1.035; }
    86% { scale: 0.98; }
    100% { scale: 1; }
}

/* Live wallpaper background video */
.tmr-bg-video {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    background-color: #000;
    pointer-events: none;
    z-index: -1;
}

html.tmr-has-bg-video,
html.tmr-has-bg-video body {
    background-image: none !important;
    /* Fallback while video initializes to avoid a white flash between pages */
    background-color: #000 !important;
}

html.tmr-bg-video-ready body {
    background-color: transparent !important;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transform: none;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
}

/* ===== PAGE HEADER (Desktop only) ===== */
.page-header {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1240px, calc(100% - 96px));
    height: 56px;
    border-radius: 28px;
    background: var(--accent-color, #0089f1);
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.26), transparent 60%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.18), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.12), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 55%, transparent);
    backdrop-filter: blur(18px) saturate(175%);
    -webkit-backdrop-filter: blur(18px) saturate(175%);
    z-index: 2000;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.32);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0 20px;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
}

.header-left, .header-right {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.header-center {
    flex: 1;
    min-width: 220px;
    max-width: 560px;
}

.header-text-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.28s var(--tmr-bounce-ease), border-color 0.22s ease, filter 0.22s ease, box-shadow 0.28s var(--tmr-settle-ease);
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
    border-bottom: 2px solid transparent;
    transform-origin: center;
    will-change: transform;
}

.header-text-btn:hover {
    filter: brightness(1.05);
    border-bottom-color: rgba(255,255,255,0.9);
}

.header-text-btn:active {
    filter: brightness(0.98);
}

.header-text-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.28);
    border-radius: 4px;
}

.gear-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* Header right inline elements */
.header-clock {
    padding: 0 12px;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.4px;
}

.header-username {
    padding: 6px 8px;
    color: #fff;
    font-weight: 600;
}

/* Search Container */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 36px 10px 16px;
    border: 1.5px solid #ddd;
    border-radius: 16px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color, #0089f1);
    box-shadow: 0 0 0 3px rgba(0, 137, 241, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    transition: color 0.2s ease;
    display: none;
}

.search-clear-btn:hover {
    color: #333;
}

.search-input:not(:placeholder-shown) ~ .search-clear-btn {
    display: block;
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 2600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.highlighted {
    background: #f5f9ff;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-subtitle {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.suggestion-stars {
    font-size: 12px;
    color: #ffc107;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    gap: 2px;
}

.star-filled {
    color: #ffc107;
    text-shadow: 0 0 1px rgba(0,0,0,0.2);
}

.star-outline {
    color: #ddd;
    text-shadow: 0 0 1px rgba(0,0,0,0.1);
}

/* TMR Menu positioning (dropdown from header button) */
#tmr-header-menu {
    position: fixed;
    top: 0;
    left: 0;
    margin-top: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 12px 18px;
    min-width: 220px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 2610;
    border: 1px solid #f0f0f0;
}

/* Remove old margin-top from .tmr-menu since it's now in header */
.tmr-menu {
    position: absolute;
}

/* Adjust calendar-page for header space (desktop only) */
@media (min-width: 1025px) {
    :root {
        --tmr-desktop-top-offset: 50px;
    }

    .calendar-page {
        margin-top: calc(84px + var(--tmr-desktop-top-offset)); /* header height + padding + offset */
    }
}

/* Hide header on mobile */
@media (max-width: 1024px) {
    .page-header {
        display: none !important;
    }
}

/* Remove the global 20px shift specifically for CurrentSchedules page */
.triangle-background {
    transform: none;
}

/* Make the TMR tag visually flush to the viewport corner even when the
   document body has a translateX applied. We counteract that translate
   so the tag sits snug in the top-left of the screen. */
#TMR-tag {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    width: auto;
    background-color: #c3c3c3;
    padding: 6px 8px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    z-index: 1500;
    transform: none;
}

.tmr-tag {
    border-radius: 16px !important;
}

/* Page-specific override for CurrentSchedules.html to nudge TMR tag inwards */
body.triangle-background #TMR-tag {
    top: 12px !important;
    left: 12px !important;
}
body.triangle-background #TMR-tag {
    top: 12px !important;
    left: 12px !important;
}

body.triangle-background .tmr-menu {
    left: 0 !important;
    right: auto !important;
    min-width: 220px;
    min-height: 44px;
         /* This selector is now unused due to the spacer div method */
         /* Removed margin-top as it is no longer needed */
         /* This entire selector is being removed */
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 12px 18px 12px 18px;
    /* Remove forced always-visible so JS can control menu visibility */
}

.tmr-tag-btn {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 6px 4px;
}

.tmr-tag h1 { margin: 0; color: rgb(0,0,0); font-size: 28px; }

.tmr-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 12px 18px 12px 18px;
    min-width: 220px;
    min-height: 44px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 2000;
    /* Prevent menu from being cut off at the edge */
    left: 0;
    right: auto;
}

/* Compact Back button inside the TMR dropdown menu: half size, no drop shadow or movement */
.tmr-menu .leave-button {
    width: 45px;
    height: 22px;
    padding: 0 6px;
    font-size: 12px;
    background-color: var(--accent-color, #0089f1);
    color: #fff;
    border: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: background 0.15s ease;
}

/* Prevent menu buttons from translating or showing box-shadow on hover; keep only color change */
.tmr-menu .tmr-btn:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: var(--accent-hover, #006fab) !important;
}

.tmr-menu-item { margin-bottom: 8px; }

.tmr-menu label { display:flex; align-items:center; gap:8px; }

.side-buttons {
    position: fixed;
    top: calc(33.33vh - 160px);  /* Adjusted down from -200px */
    width: 100%;
    pointer-events: none;
}

/* Scoped right-shift: move only the interface controls that need nudging
   instead of moving the entire page. This reproduces the previous behavior
   but only for the side buttons, clock, and bottom buttons. */
.side-buttons,
.clock-container,
.bottom-buttons {
    transform: none;
}

.schedule-button {
    position: absolute;
    right: calc(50% + 300px);  /* Increased spacing from center */
    pointer-events: auto;
    height: 370px;  /* Fixed height instead of viewport-based */
    width: 280px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15px;
    border-radius: 20px;
    font-size: 24px !important;
}

.schedule-button2 {
    position: absolute;
    left: calc(50% + 300px);  /* Increased spacing from center */
    pointer-events: auto;
    height: 420px;  /* Fixed height instead of viewport-based */
    width: 280px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15px;
    border-radius: 20px;
    font-size: 24px !important;
}

.todo-button {
    /* keep absolute variant for other contexts, but when inside .side-buttons we'll show a simple stacked button */
    position: absolute;
    right: calc(50% - 420px);  /* Adjusted position */
    pointer-events: auto;
    height: calc(66.66vh - (33.33vh - 255px));
    width: 160px;  /* Increased width */
    display: flex;
    align-items: flex-start;  /* Align text to top */
    justify-content: center;  /* Center text horizontally */
    padding-top: 10px;  /* Add some space at the top */
    border-radius: 15px;  /* Round all corners */
}

/* Override when buttons are inside the left .side-buttons stack */
/* (left intentionally blank - stacked overrides for .side-buttons were removed to restore original layout) */

.button-group {
    position: fixed;
    top: calc(66.66vh + 60px);  /* Adjusted down from +20px */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

.button-group button {
    width: 680px;  /* Increased width by 50px */
    height: 90px;
}

/* Permanently place the New + Schedules button under the Current Schedules
   button (aligned horizontally) and leave ~60px vertical gap. This makes
   the button independent of the .button-group positioning. */
.side-buttons .new-sched {
    /* Place New + Schedules under the Current Schedules button inside .side-buttons
       .side-buttons is fixed, so absolute positioning here is relative to that container. */
    position: absolute;
    /* Keep the left edge aligned with .schedule-button while increasing width.
       right_new = right_sched + width_sched - width_new -> simplifies to 50% when
       width_new = width_sched + 300px (here 580px = 280px + 300px). */
    right: 40%; /* aligns left edge with .schedule-button */
    top: calc(370px + 60px);  /* schedule-button height (370px) + 60px gap */
    width: 750px; /* extend 300px to the right while keeping left edge aligned */
    height: 110px;
    pointer-events: auto;
}

.bottom-buttons {
    position: fixed;
    top: calc(33.33vh + 60px);  /* Adjusted down from +20px */
    left: calc(50% + 50px);
    transform: translateX(-50%);
    display: flex;
    gap: 80px;  /* Increased gap between buttons */
    justify-content: center;
    width: 700px;  /* Increased width */
}

.tmr-btn {
    padding: 25px 50px;
    font-size: 22px;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif) !important;
    cursor: pointer;
    background-color: var(--accent-color, #0089f1);
    color: white;
    border: none;
    border-radius: 20px;
    box-shadow: 15px 15px 0 rgba(128, 128, 128, 0.674);
    position: relative;
    transition: background-color 0.18s ease, box-shadow 0.24s var(--tmr-settle-ease), filter 0.22s ease;
    transform-origin: center;
    will-change: transform, box-shadow;
    overflow: hidden;
    isolation: isolate;
}

.tmr-btn:hover {
    background-color: var(--accent-hover, #006fab);
    box-shadow: 0 0 0 rgba(128, 128, 128, 0.674);
    filter: brightness(1.03);
}

/* Smaller variant of the site button for compact controls (nav/export/import) */
.small-tmr-btn {
    padding: 8px 14px;
    font-size: 16px;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif) !important;
    border-radius: 12px;
    box-shadow: 8px 8px 0 rgba(128,128,128,0.5);
    transition: background-color 0.18s ease, box-shadow 0.24s var(--tmr-settle-ease), filter 0.22s ease;
    transform-origin: center;
    will-change: transform, box-shadow;
    overflow: hidden;
    isolation: isolate;
}

.small-tmr-btn:hover { 
    box-shadow: 0 0 0 rgba(128,128,128,0.5);
    filter: brightness(1.03);
}

/* Nav/export/import buttons: no transform, shadow removed */
.calendar-header .nav-btn.small-tmr-btn:hover,
#export-btn.small-tmr-btn:hover,
#import-btn.small-tmr-btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Menu button styling - no border, nav-btn style appearance */
.tmr-menu button,
.tmr-menu .small-tmr-btn {
    background: #d7dbdf !important;
    border: none !important;
    color: #333 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: background 0.15s ease !important;
    transform: none !important;
}

.tmr-menu button:hover,
.tmr-menu .small-tmr-btn:hover {
    background: var(--accent-color, #0089f1) !important;
    transform: none !important;
    box-shadow: none !important;
}

.bottom-buttons2 {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    margin: 0;
    padding: 0;
    z-index: 1000;
    transform: none;
    /* No extra shift, so it's flush in the corner */
}

.bottom-buttons2 .leave-button {
    position: static;
    width: 45px;
    height: 22px;
    padding: 0 5px;
    font-size: 12px;
    cursor: pointer;
    background-color: var(--accent-color, #0089f1);
    color: white;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    box-shadow: none;
}

/* Ensure Back text is perfectly centered inside the leave button */
.bottom-buttons2 .leave-button .button-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
}

.bottom-buttons button {
    width: 160px;  /* Reduced width */
    height: 130px;  /* Reduced height */
    padding: 12px;
}

.button-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.image-placeholder {
    width: 65px;  /* Reduced size */
    height: 65px;  /* Reduced size */
    background-color: rgba(255, 255, 255, 0.418);
    border-radius: 8px;
    margin-bottom: 12px;
}

.button-icon {
    width: 65px;
    height: 65px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 8px;
}

/* Calendar styles */
.calendar-app {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(18px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(145%) !important;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.42) !important;
    /* Let the calendar height be driven by its grid (no internal scrolling) */
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 30px rgba(0,0,0,0.16) !important;
    overflow: visible;
    position: relative;
}

/* Desktop: size the grid/tiles by narrowing the calendar panel (≈85% of available space) */
@media (min-width: 1025px) {
    .calendar-app {
        width: clamp(720px, 85%, 1180px);
        margin-left: auto;
        margin-right: auto;
    }
}
.todo-app {
    margin: 8px 0 12px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 8px;
    display: none; /* hidden by default; toggled from the dropdown menu */
}
.todo-input-row { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.todo-input-row input[type="text"] {
    flex: 1 1 auto;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
}
.todo-list { list-style: none; margin: 0; padding: 0; display:flex; flex-direction: column; gap:6px; }
.todo-item {
    display:flex; align-items:center; gap:8px; padding:8px; border-radius:8px; background: #fff; border:1px solid rgba(0,0,0,0.04);
}
.todo-item .todo-text { flex: 1 1 auto; }
.todo-item .todo-actions { display:flex; gap:6px; }
.todo-item input[type="text"] { flex:1 1 auto; padding:6px 8px; border-radius:6px; border:1px solid rgba(0,0,0,0.06); }

/* Compact todo list inside the TMR dropdown menu */
.tmr-menu-todo { max-height: 220px; overflow: auto; padding-top: 6px; }
.tmr-menu-todo .todo-item { padding:6px; background: transparent; border: none; box-shadow: none; }
.tmr-menu-todo .todo-text span { font-size: 13px; }
.tmr-menu-todo button.small-tmr-btn { padding: 4px 8px; font-size: 12px; }

/* Unified modal backdrop for all modals */
.modal-backdrop, .todo-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    backdrop-filter: blur(4px);
}
.modal-backdrop.active, .todo-modal-backdrop.active { display: flex; }

/* Portrait mode: align modals to top instead of center */
@media (orientation: portrait) {
    .todo-modal-backdrop {
        align-items: flex-start !important;
        justify-content: center !important;
        padding-top: 0 !important;
    }
    
    .todo-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
}

/* Unified modal styling (based on Meibot design) */
.unified-modal, .todo-modal {
    background: white;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    font-family: inherit;
    width: 420px;
    max-width: calc(100% - 32px);
    max-height: 80vh;
    overflow: hidden;
}

.unified-modal-header, .todo-modal-header {
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-color, #0089f1), var(--accent-hover, #0073d1));
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

/* Style h3 inside todo-modal (not in a separate header) */
.todo-modal > h3 {
    margin: 0;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-color, #0089f1), var(--accent-hover, #0073d1));
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.unified-modal-header h3, .todo-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close-btn, .unified-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover, .unified-modal-close:hover {
    opacity: 0.8;
}

.unified-modal-content, .todo-modal-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#todo-create-edit-modal-backdrop.todo-modal-backdrop {
    padding: 12px;
    overflow-y: auto;
}

#todo-create-edit-modal-backdrop .todo-modal {
    max-height: min(88vh, calc(100vh - 24px));
}

#todo-create-edit-modal-backdrop .todo-modal > .todo-modal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Style the input row in todo modal (since it's not wrapped in a content div) */
.todo-modal > .todo-input-row {
    padding: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: white;
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
}

.todo-modal-input-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.todo-modal input[type="text"], .todo-modal input[type="number"] {
    flex: 1;
    min-width: 150px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.todo-modal input:focus {
    outline: none;
    border-color: var(--accent-color, #0089f1);
    box-shadow: 0 0 0 3px rgba(0,137,241,0.15);
}

/* Todo modal buttons styling */
.todo-modal .small-tmr-btn {
    background: #d7dbdf !important;
    border: none !important;
    color: #333 !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: background 0.15s ease !important;
    transform: none !important;
}

.todo-modal .small-tmr-btn:hover {
    background: var(--accent-color, #0089f1) !important;
    transform: none !important;
    box-shadow: none !important;
}

.todo-modal .todo-list { 
    max-height: 320px; 
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    padding: 12px 16px 16px 16px;
    list-style: none;
    margin: 0;
}

.todo-category-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.todo-category-strip {
    display: flex;
    flex: 1 1 240px;
    gap: 8px;
    flex-wrap: wrap;
}

.todo-category-chip {
    min-height: 38px;
}

.todo-category-add-btn {
    white-space: nowrap;
}

.todo-category-count {
    opacity: 0.72;
    margin-left: 4px;
}

.todo-category-home {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px 16px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.todo-category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.todo-category-card {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    cursor: pointer;
    color: #fff;
    text-align: left;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.38), transparent 56%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.22), transparent 58%),
        linear-gradient(135deg, rgba(255,255,255,0.12), transparent 44%),
        color-mix(in srgb, var(--accent-color, #0089f1) 38%, #c9c9c9);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.34);
    transition: transform 220ms var(--tmr-settle-ease), box-shadow 220ms var(--tmr-settle-ease), background 220ms ease, border-color 220ms ease;
}

.todo-category-card::before {
    content: "";
    position: absolute;
    inset: -38% -18%;
    background: linear-gradient(
        115deg,
        rgba(255,255,255,0) 24%,
        rgba(255,255,255,0.1) 38%,
        rgba(255,255,255,0.42) 50%,
        rgba(255,255,255,0.14) 60%,
        rgba(255,255,255,0) 76%
    );
    transform: translateX(-170%) translateY(-8%) rotate(24deg);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
}

.todo-category-card > * {
    position: relative;
    z-index: 1;
}

.todo-category-card:hover,
.todo-category-card:active,
.todo-category-card:focus-within {
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.42), transparent 56%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.28), transparent 58%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 44%),
        color-mix(in srgb, var(--accent-color, #0089f1) 44%, #c4c4c4);
    border-color: rgba(255,255,255,0.32);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
    transform: translateY(-1px);
}

.todo-category-card:hover::before,
.todo-category-card:focus-within::before {
    animation: tmr-glass-sweep 4.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.todo-category-card-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-family: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
}

.todo-category-card-main:focus,
.todo-category-card-menu:focus {
    outline: none;
}

.todo-category-card-menu {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px) saturate(155%);
    -webkit-backdrop-filter: blur(12px) saturate(155%);
    color: #fff;
    font: inherit;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 2px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
}

.todo-category-card-menu:hover,
.todo-category-card-menu:active {
    background: rgba(255, 255, 255, 0.22);
}

.todo-category-card-title {
    font-size: 15px;
    font-weight: 700;
    color: inherit;
}

.todo-category-card-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.92);
    opacity: 0.84;
    white-space: nowrap;
}

.todo-category-action-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-category-action-btn {
    width: 100%;
    justify-content: flex-start !important;
    text-align: left;
}

.todo-category-action-btn-danger {
    background: rgba(167, 36, 63, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

.todo-category-action-btn-danger:hover,
.todo-category-action-btn-danger:active {
    background: rgba(148, 28, 53, 0.96) !important;
}

.todo-category-detail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.todo-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 0;
}

.todo-category-detail .todo-list,
#todo-list,
#todo-modal-list {
    margin-top: 28px;
}

.todo-detail-toolbar .schedule-create-btn,
.todo-category-home .todo-category-add-btn {
    flex: 1 1 auto;
    margin: 0 !important;
}

.todo-detail-toolbar #desktop-create-todo-btn,
.todo-detail-toolbar #todo-modal-create-btn {
    margin: 0 !important;
    text-align: left;
}

.todo-create-btn-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.todo-create-btn-text {
    white-space: nowrap;
}

.todo-create-btn-category {
    white-space: nowrap;
    font-size: 0.92em;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    opacity: 1;
}

.todo-category-home .todo-category-add-btn {
    color: white !important;
    font-weight: 700 !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 82%, transparent) !important;
    backdrop-filter: blur(20px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22) !important;
}

.todo-category-home .todo-category-add-btn:hover,
.todo-category-home .todo-category-add-btn:active {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent) !important;
    filter: brightness(1.03);
}

.todo-detail-toolbar .todo-back-btn,
.todo-modal .todo-back-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #fff !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 82%, transparent) !important;
    backdrop-filter: blur(20px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22), 0 6px 14px rgba(76, 103, 255, 0.22) !important;
}

.todo-detail-toolbar .todo-back-btn:hover,
.todo-detail-toolbar .todo-back-btn:active,
.todo-modal .todo-back-btn:hover,
.todo-modal .todo-back-btn:active {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent) !important;
    filter: brightness(1.03);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22), 0 8px 18px rgba(76, 103, 255, 0.26) !important;
}

.todo-empty-state-item {
    display: block !important;
    padding: 14px !important;
    border: 1px dashed rgba(0, 0, 0, 0.12) !important;
    background: rgba(255, 255, 255, 0.56) !important;
}

.todo-empty-state-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.todo-empty-state-copy {
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.78;
    margin-bottom: 12px;
}

.todo-category-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.todo-view-category {
    margin: 8px 0;
    font-size: 14px;
    color: rgba(15,15,15,0.72);
}

.todo-category-modal-copy {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(15,15,15,0.72);
}

.todo-category-modal-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.todo-category-modal-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.42);
    border: 1px solid rgba(255,255,255,0.32);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.42);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.todo-category-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.34);
}

.todo-item-meta {
    font-size: 11px;
    line-height: 1.35;
    opacity: 0.7;
    margin-top: 2px;
}

.todo-modal .todo-item { 
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    gap: 8px;
}

.todo-modal .todo-item:hover {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* Mobile create/edit todo modal: white frosted + colored-glass header/buttons */
@media (max-width: 900px) {
    .todo-category-toolbar-mobile {
        margin: 12px 16px 0;
    }

    .todo-category-home-mobile {
        padding-top: 16px;
    }

    #todo-mobile-category-detail .todo-list,
    #todo-modal-list {
        margin-top: 16px;
        padding-top: 0;
    }

    .todo-category-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .todo-category-field-row .small-tmr-btn {
        width: 100%;
    }

    #todo-create-edit-modal-backdrop.todo-modal-backdrop {
        background: rgba(0,0,0,0.36);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        align-items: center !important;
        justify-content: center !important;
        padding: 12px;
        overflow-y: auto;
    }

    #todo-create-edit-modal-backdrop .todo-modal {
        width: min(420px, calc(100% - 24px)) !important;
        max-width: min(420px, calc(100% - 24px)) !important;
        height: auto !important;
        max-height: calc(100vh - 32px) !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.70), transparent 60%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.52), transparent 62%),
            linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.42));
        backdrop-filter: blur(22px) saturate(135%);
        -webkit-backdrop-filter: blur(22px) saturate(135%);
        border: 1px solid rgba(255,255,255,0.34);
        box-shadow: 0 16px 44px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.42);
    }

    #todo-create-edit-modal-backdrop .todo-modal-content {
        padding: 12px !important;
        gap: 10px !important;
    }

    #todo-create-edit-modal-backdrop .todo-modal-content > div[style*="border-top"] {
        padding-top: 8px !important;
    }

    #todo-create-edit-modal-backdrop textarea {
        min-height: 84px !important;
    }

    /* Header (h3 is used as the header bar in this modal) */
    #todo-create-edit-modal-backdrop .todo-modal > h3 {
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.30), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 62%, transparent);
        backdrop-filter: blur(18px) saturate(190%);
        -webkit-backdrop-filter: blur(18px) saturate(190%);
        border-bottom: 1px solid rgba(255,255,255,0.18);
        color: #fff;
    }

    /* Inputs: more opaque (less clear) than the modal background */
    #todo-create-edit-modal-backdrop input,
    #todo-create-edit-modal-backdrop select,
    #todo-create-edit-modal-backdrop textarea {
        background: rgba(255,255,255,0.78) !important;
        backdrop-filter: blur(12px) saturate(125%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(125%) !important;
        border: 1px solid rgba(255,255,255,0.55) !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.55) !important;
        color: rgba(15,15,15,0.95) !important;
    }

    /* Buttons: colored glass (including Bullet/Checkbox + Save/Cancel) */
    #todo-create-edit-modal-backdrop .small-tmr-btn {
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.30), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 68%, transparent) !important;
        backdrop-filter: blur(14px) saturate(190%) !important;
        -webkit-backdrop-filter: blur(14px) saturate(190%) !important;
        border: 1px solid rgba(255,255,255,0.26) !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(255,255,255,0.20) !important;
        color: #fff !important;
    }
}

/* Desktop create/edit todo modal: match mobile frosted/glass treatment */
@media (min-width: 901px) {
    #todo-create-edit-modal-backdrop.todo-modal-backdrop {
        inset: 0;
        background: rgba(0,0,0,0.36);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        align-items: center;
        justify-content: center;
        padding: 84px 12px 24px;
        overflow-y: auto;
        z-index: 1900;
    }

    #todo-create-edit-modal-backdrop .todo-modal {
        height: auto;
        max-height: calc(100vh - 32px);
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.70), transparent 60%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.52), transparent 62%),
            linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.42));
        backdrop-filter: blur(22px) saturate(135%);
        -webkit-backdrop-filter: blur(22px) saturate(135%);
        border: 1px solid rgba(255,255,255,0.34);
        box-shadow: 0 16px 44px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.42);
    }

    /* Header (h3 is used as the header bar in this modal) */
    #todo-create-edit-modal-backdrop .todo-modal > h3 {
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.30), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 62%, transparent);
        backdrop-filter: blur(18px) saturate(190%);
        -webkit-backdrop-filter: blur(18px) saturate(190%);
        border-bottom: 1px solid rgba(255,255,255,0.18);
        color: #fff;
    }

    /* Inputs: more opaque (less clear) than the modal background */
    #todo-create-edit-modal-backdrop input,
    #todo-create-edit-modal-backdrop select,
    #todo-create-edit-modal-backdrop textarea {
        background: rgba(255,255,255,0.78) !important;
        backdrop-filter: blur(12px) saturate(125%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(125%) !important;
        border: 1px solid rgba(255,255,255,0.55) !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.55) !important;
        color: rgba(15,15,15,0.95) !important;
    }

    /* Buttons: colored glass (including Bullet/Checkbox + Save/Cancel) */
    #todo-create-edit-modal-backdrop .small-tmr-btn {
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.30), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 68%, transparent) !important;
        backdrop-filter: blur(14px) saturate(190%) !important;
        -webkit-backdrop-filter: blur(14px) saturate(190%) !important;
        border: 1px solid rgba(255,255,255,0.26) !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(255,255,255,0.20) !important;
        color: #fff !important;
    }
}

/* Preview/View todo modal: frosted background + color frosted banner + buttons */
#todo-view-modal-backdrop.todo-modal-backdrop {
    background: rgba(0,0,0,0.30);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#todo-view-modal-backdrop .todo-modal {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.70), transparent 60%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.52), transparent 62%),
        linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.44));
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    border: 1px solid rgba(255,255,255,0.34);
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.42);
}

#todo-view-modal-backdrop .todo-modal > h3 {
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.32), transparent 60%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.22), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 58%, transparent);
    backdrop-filter: blur(18px) saturate(175%);
    -webkit-backdrop-filter: blur(18px) saturate(175%);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
    color: #fff;
    border-radius: 12px 12px 0 0;
}

#todo-view-modal-backdrop .todo-view-body {
    margin: 16px;
    padding: 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.58);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.34);
}

#todo-view-modal-backdrop .todo-view-section {
    margin-bottom: 16px;
}

#todo-view-modal-backdrop .todo-view-title {
    margin: 8px 0;
    font-size: 16px;
}

#todo-view-modal-backdrop .todo-view-notes {
    margin: 8px 0;
    font-size: 14px;
    white-space: pre-wrap;
    color: rgba(15,15,15,0.72);
}

#todo-view-modal-backdrop .todo-view-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Override default grey todo-modal small buttons: make them accent frosted glass */
#todo-view-modal-backdrop .small-tmr-btn {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.30), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 68%, transparent) !important;
    backdrop-filter: blur(14px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(190%) !important;
    border: 1px solid rgba(255,255,255,0.26) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(255,255,255,0.20) !important;
    color: #fff !important;
}

#todo-view-modal-backdrop .small-tmr-btn:hover {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.36), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent) !important;
}

/* To-do badge (small, non-intrusive). Do NOT change .todo-button positioning — it
   is intentionally absolute elsewhere in the stylesheet. Only the badge styles
   are applied so layout is preserved. */
.todo-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    min-width: 18px;
    padding: 2px 6px;
    height: 18px;
    line-height: 14px;
    font-size: 12px;
    border-radius: 999px;
    background: var(--accent-color, #e33);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2500; /* keep badge above other UI elements */
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.34), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.22), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.12), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 48%, transparent);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.22) !important;
    box-shadow: none !important;
    border-radius: 12px 12px 0 0;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-header .month-year,
.month-year {
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
    font-weight: 700;
    font-size: 18px;
    flex: 1;
    text-align: center;
    color: #fff;
}
.calendar-header .nav-btn {
    padding: 8px 14px;
    font-size: 13px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.24s var(--tmr-settle-ease), filter 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22);
    transform-origin: center;
    will-change: transform;
    overflow: hidden;
    isolation: isolate;
}

.calendar-header .nav-btn:active,
.calendar-header .nav-btn:hover {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent);
    color: #fff;
    filter: brightness(1.03);
}

/* Ensure nav/export/import labels are correct */
.calendar-header .nav-btn,
#export-btn,
#import-btn {
    color: white !important;
}

.calendar-header .schedule-month-toggle[hidden] {
    display: none !important;
}

.calendar-header .schedule-month-toggle {
    min-width: 0;
    width: auto;
    padding-inline: 10px;
}

.calendar-header .schedule-month-toggle.is-active {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.52), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.42), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.24), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 86%, transparent) !important;
    filter: brightness(1.05);
}

/* Remove default outlines but keep a subtle focus-visible ring for keyboard users */
.calendar-header .nav-btn,
#export-btn,
#import-btn,
#save-event,
#cancel-event {
    outline: none;
}

.calendar-header .nav-btn:focus,
#export-btn:focus,
#import-btn:focus,
#save-event:focus,
#cancel-event:focus {
    outline: none;
}

/* Accessible keyboard focus indicator (subtle) */
.calendar-header .nav-btn:focus-visible,
#export-btn:focus-visible,
#import-btn:focus-visible,
#save-event:focus-visible,
#cancel-event:focus-visible {
    box-shadow: 0 0 0 3px rgba(0,137,241,0.16);
}

/* Compact controls: prev/next month, export/import, and modal save/cancel
   Make them half-size, remove shadow/translate on hover, keep only color change */
.calendar-header .nav-btn,
#export-btn,
#import-btn {
    /* Keep original sizing; only remove decorative shadow and preserve hover color change */
    box-shadow: none;
    transition: background 0.18s ease, box-shadow 0.24s var(--tmr-settle-ease), filter 0.2s ease;
}

/* Modal action buttons (Save/Cancel) compact styling */
#save-event,
#cancel-event {
    /* Preserve modal button sizing; only remove decorative shadow and preserve hover color change */
    box-shadow: none;
    transition: background 0.15s ease;
}

/* Prevent translate/box-shadow on hover for these compact controls; only change color */
.calendar-header .nav-btn:hover,
#export-btn:hover,
#import-btn:hover {
    box-shadow: none !important;
    background-color: var(--accent-color, #0089f1) !important;
    filter: brightness(1.03);
}

.tmr-btn,
.small-tmr-btn,
.todo-panel-tab,
.calendar-header .nav-btn,
.calendar-buttons button,
#export-btn,
#import-btn,
#save-event,
#cancel-event,
.meibot-chat .meibot-action-btn,
.todo-panel .small-tmr-btn,
.meibot-panel .small-tmr-btn,
.meibot-modal-content .small-tmr-btn,
.auth-submit-btn {
    position: relative;
}

.tmr-btn::before,
.small-tmr-btn::before,
.todo-panel-tab::before,
.calendar-header .nav-btn::before,
.calendar-buttons button::before,
#export-btn::before,
#import-btn::before,
#save-event::before,
#cancel-event::before,
.meibot-chat .meibot-action-btn::before,
.todo-panel .small-tmr-btn::before,
.meibot-panel .small-tmr-btn::before,
.meibot-modal-content .small-tmr-btn::before,
.auth-submit-btn::before {
    content: "";
    position: absolute;
    top: -35%;
    left: -55%;
    width: 60%;
    height: 170%;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            115deg,
            rgba(255,255,255,0) 0%,
            rgba(255,255,255,0.03) 22%,
            rgba(255,255,255,0.3) 48%,
            rgba(255,255,255,0.08) 68%,
            rgba(255,255,255,0) 100%
        );
    filter: blur(2px);
    mix-blend-mode: screen;
}

.tmr-btn:hover::before,
.small-tmr-btn:hover::before,
.todo-panel-tab:hover::before,
.calendar-header .nav-btn:hover::before,
.calendar-buttons button:hover::before,
#export-btn:hover::before,
#import-btn:hover::before,
#save-event:hover::before,
#cancel-event:hover::before,
.meibot-chat .meibot-action-btn:hover::before,
.todo-panel .small-tmr-btn:hover::before,
.meibot-panel .small-tmr-btn:hover::before,
.meibot-modal-content .small-tmr-btn:hover::before,
.auth-submit-btn:hover::before {
    animation: tmr-glass-sweep 1.15s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.tmr-btn.tmr-click-bounce,
.small-tmr-btn.tmr-click-bounce,
.todo-panel-tab.tmr-click-bounce,
.header-text-btn.tmr-click-bounce,
.calendar-header .nav-btn.tmr-click-bounce,
.calendar-buttons button.tmr-click-bounce,
#export-btn.tmr-click-bounce,
#import-btn.tmr-click-bounce,
#save-event.tmr-click-bounce,
#cancel-event.tmr-click-bounce,
.meibot-chat .meibot-action-btn.tmr-click-bounce,
.todo-panel .small-tmr-btn.tmr-click-bounce,
.meibot-panel .small-tmr-btn.tmr-click-bounce,
.meibot-modal-content .small-tmr-btn.tmr-click-bounce,
.auth-submit-btn.tmr-click-bounce {
    animation: tmr-button-bounce-click 460ms cubic-bezier(0.22, 1.12, 0.32, 1) both;
    transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
    .header-text-btn,
    .tmr-btn,
    .small-tmr-btn,
    .todo-panel-tab,
    .calendar-header .nav-btn,
    #export-btn,
    #import-btn {
        transition: background-color 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease !important;
    }

    .tmr-btn::before,
    .small-tmr-btn::before,
    .todo-panel-tab::before,
    .calendar-header .nav-btn::before,
    .calendar-buttons button::before,
    #export-btn::before,
    #import-btn::before,
    #save-event::before,
    #cancel-event::before,
    .meibot-chat .meibot-action-btn::before,
    .todo-panel .small-tmr-btn::before,
    .meibot-panel .small-tmr-btn::before,
    .meibot-modal-content .small-tmr-btn::before,
    .auth-submit-btn::before {
        animation: none !important;
        opacity: 0 !important;
    }
}

/* Desktop-only: tinted frosted-glass calendar header buttons */
@media (min-width: 1025px) {
    .calendar-header .nav-btn {
        background: var(--accent-color, #0089f1);
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
        backdrop-filter: blur(18px) saturate(190%);
        -webkit-backdrop-filter: blur(18px) saturate(190%);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22);
    }

    .calendar-header .nav-btn:hover,
    .calendar-header .nav-btn:active {
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent) !important;
    }
}
.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0;
    padding: 8px 8px 2px 8px;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.16) !important;
    border-bottom: 1px solid rgba(255,255,255,0.18) !important;
}

.weekday-row > div,
.calendar-weekday {
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    padding: 3px 2px;
    color: #666;
    aspect-ratio: auto;
    min-height: auto;
    height: auto !important;
    width: auto !important;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: auto;
    gap: 2px;
    align-content: start;
    overflow: visible;
    flex: 0 0 auto;
    padding: 2px 8px 8px 8px;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.16) !important;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid rgba(255,255,255,0.18);
}

/* Desktop: increase spacing between day cells */
@media (min-width: 1025px) {
    .weekday-row { gap: 6px; }
    .calendar-grid { gap: 6px; }
}

.calendar-grid.month-transition {
    animation: monthSlide 0.35s ease-out;
}

/* Desktop: let the calendar section grow (avoid clipping the last week row) */
@media (min-width: 1025px) {
    .calendar-section {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        align-self: flex-start;
    }
}

@keyframes monthSlide {
    from {
        opacity: 0.7;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.calendar-cell {
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    aspect-ratio: 1 / 1;
}

/* Fill the desktop calendar panel; avoid fixed cell sizing */
.weekday-row .calendar-cell,
.calendar-grid .calendar-cell {
    width: auto;
    height: auto;
}
.calendar-day {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.26), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.18), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06)),
        color-mix(in srgb, var(--accent-color, #0089f1) 10%, rgba(255,255,255,0.08));
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    color: #222;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    box-shadow: none;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    cursor: pointer;
    overflow: hidden;
}

/* Calendar day number + hover/active states (match mobile look) */
.calendar-day .day-number {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.calendar-day.has-schedule-badge .day-number {
    padding: 0 8px;
}

.calendar-schedule-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.45), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.28), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 72%, transparent);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.42), 0 8px 16px rgba(0,0,0,0.12);
    backdrop-filter: blur(14px) saturate(185%);
    -webkit-backdrop-filter: blur(14px) saturate(185%);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.01em;
    z-index: 2;
}

@keyframes calendarScheduleBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.42), 0 8px 16px rgba(0,0,0,0.12);
    }
    50% {
        transform: scale(1.08);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.48), 0 10px 20px rgba(0,0,0,0.16);
    }
}

.calendar-day.today .calendar-schedule-badge {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.52), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        rgba(255,255,255,0.24);
    color: #fff;
}

.calendar-schedule-summary {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 34px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 1;
}

.calendar-schedule-summary-item,
.calendar-schedule-summary-more {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    color: rgba(29, 38, 49, 0.92);
}

.calendar-schedule-summary-more {
    color: rgba(57, 68, 80, 0.72);
}

.calendar-day.today .calendar-schedule-summary-item,
.calendar-day.today .calendar-schedule-summary-more {
    color: rgba(255,255,255,0.96);
}

.calendar-day.show-schedule-summary .day-number {
    opacity: 0;
    transform: translateY(-4px);
}

.calendar-day.show-schedule-summary .calendar-schedule-summary {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none), (pointer: coarse) {
    .calendar-schedule-badge {
        top: 5px;
        right: 5px;
        min-width: 26px;
        height: 26px;
        padding: 0 7px;
        font-size: 12px;
        animation: calendarScheduleBadgePulse 1.8s ease-in-out infinite;
    }

    .calendar-day.show-schedule-summary .calendar-schedule-badge {
        animation-play-state: paused;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calendar-schedule-badge {
        animation: none !important;
    }
}

.calendar-day:hover {
    transform: none !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.32), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.22), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.12), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 30%, transparent);
    border-color: rgba(255,255,255,0.26);
    color: #222;
}

.calendar-day:active {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.36), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.26), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 38%, transparent);
    border-color: rgba(255,255,255,0.30);
    transform: scale(1.03);
}

/* Today styling for desktop calendar */
.calendar-day.today {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.44), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.30), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 58%, transparent);
    backdrop-filter: blur(16px) saturate(190%);
    -webkit-backdrop-filter: blur(16px) saturate(190%);
    border: 1px solid rgba(255,255,255,0.32);
    color: #fff;
}

.calendar-day.today .day-number {
    color: #fff;
}

/* Desktop-only: today as tinted glass tile (color rotates by day) */
@media (min-width: 1025px) {
    .calendar-day.today {
        border: none !important;
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.35), transparent 60%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.28), transparent 60%),
            linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
            rgba(var(--today-glass-rgb, 0,137,241), 0.42);
        backdrop-filter: blur(14px) saturate(165%);
        -webkit-backdrop-filter: blur(14px) saturate(165%);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.18);
    }

    .calendar-day.today,
    .calendar-day.today .day-number {
        color: #fff;
    }

    .calendar-day.today:hover {
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 60%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 60%),
            linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
            rgba(var(--today-glass-rgb, 0,137,241), 0.48);
    }
}
.calendar-cell .day-number {
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 4px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.event-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0;
}
.cell-events {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Modal (uses unified styling above) */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    z-index: 4000;
    backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }

/* Ensure [hidden] always collapses layout (prevents Month + Day views from stacking) */
[hidden] { display: none !important; }

/* ===== Day View (hour-by-hour timeline) ===== */
.day-view {
    width: 100%;
    margin-top: 10px;
}

.day-view-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 12px;
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.22), transparent 60%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.14), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.10), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 18%, rgba(255,255,255,0.14));
    border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(14px) saturate(165%);
    -webkit-backdrop-filter: blur(14px) saturate(165%);
    box-shadow: 0 8px 20px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.22);
}

/* Day View navigation buttons: accent frosted-glass, no shadow, no transition */
.day-nav-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    box-shadow: none;
    transition: none;
    transform: none;
}

.day-nav-btn:hover,
.day-nav-btn:active {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent);
    box-shadow: none;
    transform: none;
}

.day-nav-btn:focus { outline: none; }
.day-nav-btn:focus-visible { box-shadow: 0 0 0 3px rgba(0,137,241,0.16); }

.day-view-scroll {
    margin-top: 10px;
    border-radius: 14px;
    overflow: auto;
    /* Keep Day View compact so users don't have to page-scroll to reach the bottom */
    max-height: min(56vh, 560px);
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(18px) saturate(175%);
    -webkit-backdrop-filter: blur(18px) saturate(175%);
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.day-view-grid {
    display: grid;
    grid-template-columns: 76px 1fr;
    min-width: 520px;
}

.day-time-col {
    position: sticky;
    left: 0;
    background: rgba(255,255,255,0.18);
    border-right: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    z-index: 3;
}

.day-time-label {
    height: 64px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 10px 0 0;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    color: rgba(70,70,70,0.90);
    text-shadow: 0 1px 0 rgba(255,255,255,0.14);
    box-sizing: border-box;
}

.day-grid {
    position: relative;
    min-height: calc(64px * 24);
}

.day-grid-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.day-grid-hour {
    height: 16px;
    border-top: 1px solid rgba(80,80,80,0.26);
    border-bottom: 1px dashed rgba(80,80,80,0.18);
    box-sizing: border-box;
}

.day-grid-quarter {
    height: 16px;
    border-bottom: 1px dashed rgba(80,80,80,0.18);
    box-sizing: border-box;
}

.day-events-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.day-selection {
    position: absolute;
    left: 10px;
    right: 10px;
    border-radius: 12px;
    pointer-events: none;
    user-select: none;
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.18), transparent 60%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.10), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.08), transparent 45%),
        rgba(255,255,255,0.10);
    border: 1px dashed rgba(255,255,255,0.40);
    box-shadow: 0 10px 22px rgba(0,0,0,0.16);
}

.day-event {
    position: absolute;
    left: 10px;
    right: 10px;
    border-radius: 12px;
    padding: 10px 12px;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.26), transparent 60%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.14), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.10), transparent 45%),
        rgba(var(--accent-rgb, 0,137,241), 0.28);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(16px) saturate(170%);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    box-shadow: 0 12px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.26);
}

.day-event .day-event-title {
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    line-height: 1.15;
    text-shadow: 0 2px 10px rgba(0,0,0,0.22);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-event .day-event-time {
    margin-top: 4px;
    color: rgba(255,255,255,0.92);
    font-size: 12px;
    font-weight: 700;
    opacity: 0.95;
}

.day-event .day-event-notes {
    margin-top: 6px;
    color: rgba(255,255,255,0.92);
    font-size: 12px;
    line-height: 1.25;
    opacity: 0.95;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.day-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.28);
}

.day-event.day-schedule {
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.18), transparent 60%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.12), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.10), transparent 45%),
        rgba(36, 72, 120, 0.34);
    border-style: dashed;
}

.day-event.day-schedule .day-event-time {
    opacity: 0.9;
}
.modal-content {
    background: white;
    color: #111;
    padding: 0;
    border-radius: 12px;
    width: 420px;
    max-width: calc(100% - 32px);
    max-height: 80vh;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content > h3 {
    margin: 0;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-color, #0089f1), var(--accent-hover, #0073d1));
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

/* Calendar event modal: match the clean todo modal spacing */
#event-modal.modal {
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#event-modal .modal-content {
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(24px) saturate(165%);
    -webkit-backdrop-filter: blur(24px) saturate(165%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}

#event-modal .event-modal-header {
    padding: 16px;
    background:
        radial-gradient(140% 180% at 0% 0%, rgba(255,255,255,0.32), transparent 60%),
        radial-gradient(140% 180% at 100% 0%, rgba(255,255,255,0.22), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 58%, transparent);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(18px) saturate(175%);
    -webkit-backdrop-filter: blur(18px) saturate(175%);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
}

#event-modal .event-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Close button in header (not absolute) */
#event-modal .modal-close {
    position: static;
    right: auto;
    top: auto;
    color: white;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#event-modal .modal-close:hover {
    opacity: 0.9;
}

#event-form {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#event-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#event-form .event-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 520px) {
    #event-form .event-form-row {
        grid-template-columns: 1fr;
    }
}

.modal-content label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.modal-content input[type="text"],
.modal-content input[type="date"],
.modal-content input[type="time"],
.modal-content textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--accent-color, #0089f1);
    box-shadow: 0 0 0 3px rgba(0,137,241,0.15);
}

.modal-content textarea {
    min-height: 80px;
    resize: vertical;
}

/* Sleek color picker */
#event-modal .event-color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#event-modal .event-color-picker .color-btn {
    width: 34px;
    height: 34px;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Actions: stacked, full-width (like Create Todo) */
#event-modal .modal-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    border-top-color: rgba(255,255,255,0.22);
}

#event-modal .modal-actions button {
    width: 100%;
}

/* Event modal actions: accent-colored frosted glass */
#event-modal .modal-actions .tmr-btn {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.46), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.55),
        inset 0 -1px 0 rgba(255,255,255,0.22),
        0 12px 24px rgba(0,0,0,0.18);
    transform: none !important;
}

#event-modal .modal-actions .tmr-btn:hover {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.52), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.20), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.60),
        inset 0 -1px 0 rgba(255,255,255,0.24),
        0 14px 28px rgba(0,0,0,0.20);
}

#event-modal .modal-actions .tmr-btn:active {
    transform: translateY(1px) !important;
}

/* Cancel: slightly softer tint but still accent-glass */
#event-modal #cancel-event {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.44), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.32), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 54%, transparent);
}

/* Delete: red frosted glass (keeps danger affordance) */
#event-modal #delete-event.danger {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.46), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, #e74c3c 78%, transparent);
    border-color: rgba(255,255,255,0.22);
}

#event-modal #delete-event.danger:hover {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.52), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.20), transparent 45%),
        color-mix(in srgb, #e74c3c 88%, transparent);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    position: absolute;
    right: 16px;
    top: 12px;
    cursor: pointer;
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.modal-actions button {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-actions button.tmr-btn {
    background: var(--accent-color, #0089f1);
    color: white;
}

.modal-actions button.tmr-btn:hover {
    background: var(--accent-hover, #0073d1);
}

.modal .danger {
    background: #e74c3c;
    color: white;
}

.modal .danger:hover {
    background: #c0392b;
}

/* Select/dropdown styling */
select {
    padding: 10px 12px !important;
    padding-right: 36px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px !important;
    background-color: white !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    font-family: inherit !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 20px !important;
    color: #333 !important;
    line-height: 1.4 !important;
}

select:hover {
    border-color: var(--accent-color, #0089f1) !important;
}

select:focus {
    outline: none !important;
    border-color: var(--accent-color, #0089f1) !important;
    box-shadow: 0 0 0 3px rgba(0,137,241,0.15) !important;
}

select option {
    padding: 8px 12px;
    background: white;
    color: #333;
}

.tmr-btn:hover {
    background-color: var(--accent-hover, #006fab);
    transform: translate(10px, 10px);
    box-shadow: 0 0 0 rgba(128, 128, 128, 0.674);
}

/* Bottom buttons hover styles */
.bottom-buttons .tmr-btn:hover {
    background-color: var(--accent-hover, #006fab);
}

.bottom-buttons2 button:hover {
    background-color: var(--accent-hover, #006fab);
    box-shadow: none;
}

/* Remove the diagonal positional shift on hover for the Back button but keep
   the color/box-shadow hover feedback. Using !important ensures this rule
   overrides any generic .tmr-btn:hover transforms. */
.bottom-buttons2 .leave-button:hover {
    transform: none !important;
    background-color: var(--accent-hover, #006fab);
    box-shadow: none;
}

.clock-container {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 100px 0 0 0;
    width: 100%;
    z-index: 10;
}


.clock-outer-box {
    background-color: var(--accent-color, #0089f1); /* Accent color */
    padding: 15px;
    border-radius: 25px;
    box-shadow: 15px 15px 0 rgba(128, 128, 128, 0.583);
    width: 350px;
}

body.currentschedules-page .clock-outer-box {
    padding: 8px;
    border-radius: 18px;
    box-shadow: 10px 10px 0 rgba(128, 128, 128, 0.45);
    width: 220px;
}

body.currentschedules-page .clock-container {
    margin-top: 80px !important;
}

body.currentschedules-page .clock-container.schedule-page-clock {
    position: fixed;
    top: 0;
    right: 20px;
    left: auto;
    margin: 0 !important;
    z-index: 1400;
    transform: none !important;
    display: flex;
    justify-content: flex-end;
}

.clock-inner-box {
    background-color: var(--accent-light, #b3d8fa); /* Lighter accent */
    padding: 20px;
    border-radius: 30px;
}

body.currentschedules-page .clock-inner-box {
    padding: 10px;
    border-radius: 16px;
}

#clock {
    font-size: 43px;
    text-align: center;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
    color: #333;
    margin: 0;
    padding: 15px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.currentschedules-page #clock {
    font-size: 22px;
    padding: 6px;
    height: 28px;
}

.cs-buttons {
    position: fixed;
    top: 110px; /* Moved down by 30px from 60px */
    left:50%;
    transform: translateX(-50%);
    width: 100%;
    padding: 20px;
    max-width: 100%;
}

/* Base styles for all buttons in cs-buttons */
.cs-buttons .tmr-btn {
    background-color: #f19100;
    box-shadow: 15px 15px 0 rgba(128, 128, 128, 0.674);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.08s ease-out, background-color 0.08s ease-out, box-shadow 0.15s ease-out;
}

/* Specific styles for the main schedule buttons */
.cs-buttons .schedule-button.tmr-btn {
    width: 300px;
    height: 400px !important;
    font-size: 24px;
    position: absolute;
    right: calc(50% + 75px); /* 300px (button width) + 100px (gap) = 400px total space, so 50px (half of gap) from center */
}

.cs-buttons .schedule-button2.tmr-btn {
    width: 300px;
    height: 400px !important;
    font-size: 24px;
    position: absolute;
    left: calc(50% + 75px); /* 50px (half of gap) from center */
}

/* Style for the New + Schedule button */
.cs-buttons .tmr-btn:not(.schedule-button):not(.schedule-button2) {
    width: 750px;
    height: 110px;
    font-size: 16px;
    padding: 20px 40px;
    background-color: #e68300; /* Slightly different shade */
    position: absolute;
    top: 475px; /* Increased by 75px from 440px */
    left: 50%;
    transform: translateX(-50%);
}

.cs-buttons .tmr-btn:hover {
    background-color: #b15900;
    transform: translate(15px, 15px);
    box-shadow: 0 0 0 rgba(128, 128, 128, 0.674);
}

/* Make New + Schedule use the same hover behavior as other cs-buttons */
.cs-buttons .tmr-btn:not(.schedule-button):not(.schedule-button2):hover {
    background-color: #b15900;
    transform: translate(calc(-50% + 15px), 15px);
    box-shadow: 0 0 0 rgba(128, 128, 128, 0.674);
}

/* ========== CLEAN MOBILE-FRIENDLY MEDIA QUERIES ========== */
/* Desktop layout (1025px and up) - absolute positioning for wide screens */
@media (min-width: 1025px) {
    /* Desktop buttons use absolute positioning */
    .schedule-button {
        position: absolute;
        right: calc(50% + 300px);
        height: 370px;
        width: 280px;
        box-shadow: 15px 15px 0 rgba(128, 128, 128, 0.674);
    }
    
    .schedule-button2 {
        position: absolute;
        left: calc(50% + 300px);
        height: 420px;
        width: 280px;
        box-shadow: 15px 15px 0 rgba(128, 128, 128, 0.674);
    }
    
    .todo-button {
        position: absolute;
        right: calc(50% - 420px);
        box-shadow: 15px 15px 0 rgba(128, 128, 128, 0.674);
    }
    
    .side-buttons {
        position: fixed;
        pointer-events: none;
        transform: translateX(50px);
    }
    
    .clock-container {
        transform: translateX(50px);
    }
    
    .schedule-button,
    .schedule-button2,
    .todo-button {
        pointer-events: auto;
    }
}

/* Tablet/medium screens (601px - 1024px) - iPad friendly layout */
@media (min-width: 601px) and (max-width: 1024px) {
    /* Clock removed from mobile/tablet calendar UI. */
    
    /* Horizontal layout for main buttons (320px × 230px each, 40px gap) */
    .side-buttons {
        position: relative !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 40px !important;
        padding: 20px !important;
        margin-top: 30px !important;
        transform: none !important;
        top: auto !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Main buttons: 320px height × 230px width (Meibot 370×280 minus 50px) */
    .schedule-button,
    .schedule-button2,
    .todo-button {
        position: relative !important;
        right: auto !important;
        left: auto !important;
        width: 230px !important;
        max-width: none !important;
        height: 320px !important;
        margin: 0 !important;
        box-shadow: 8px 8px 0 rgba(128, 128, 128, 0.4) !important;
        font-size: 18px !important;
        border-radius: 16px !important;
        padding: 12px !important;
    }
    
    /* iPad button hover: shadow disappears, button moves */
    .schedule-button:hover,
    .schedule-button2:hover,
    .todo-button:hover {
        transform: translate(8px, 8px) !important;
        box-shadow: 0 0 0 rgba(128, 128, 128, 0.4) !important;
    }
    
    /* Calendar button (new-sched) in horizontal layout */
    .side-buttons .new-sched {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 230px !important;
        height: 320px !important;
        margin: 0 !important;
        padding: 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 18px !important;
        box-shadow: 8px 8px 0 rgba(128, 128, 128, 0.4) !important;
        border-radius: 16px !important;
    }
    
    /* iPad calendar button hover: shadow disappears, button moves */
    .side-buttons .new-sched:hover {
        transform: translate(8px, 8px) !important;
        box-shadow: 0 0 0 rgba(128, 128, 128, 0.4) !important;
    }
    
    /* Refresh/Leave buttons: 75px below the main buttons, centered */
    .bottom-buttons {
        position: fixed !important;
        top: calc(140px + 30px + 320px + 60px) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 36px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .bottom-buttons button {
        width: auto !important;
        height: auto !important;
        padding: 27px 35px !important;
        font-size: 16px !important;
        border-radius: 16px !important;
        box-shadow: 6px 6px 0 rgba(128, 128, 128, 0.4) !important;
    }
    
    /* iPad bottom buttons hover: shadow disappears, button moves */
    .bottom-buttons button:hover {
        transform: translate(6px, 6px) !important;
        box-shadow: 0 0 0 rgba(128, 128, 128, 0.4) !important;
    }
    
    /* Scale down modals for tablet */
    .todo-modal,
    .unified-modal,
    .modal-content {
        width: 90% !important;
        max-width: 600px !important;
    }
    
    /* Calendar fits better on tablet */
    .calendar-app {
        max-width: 95% !important;
        margin: 16px auto !important;
    }
}

/* Mobile screens (max 600px) */
@media (max-width: 600px) {
    body { 
        padding-top: 300px !important; 
    }

    .day-time-label {
        transform: translateY(-7px);
    }
    
    .side-buttons {
        position: relative !important;
        top: auto !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        transform: none !important;
        pointer-events: auto !important;
        margin-top: 100px !important;
        margin-bottom: 40px !important;
    }
    
    /* Mobile tmr-btn override for consistent sizing */
    .side-buttons .tmr-btn {
        width: 85vw !important;
        max-width: 360px !important;
        height: 60px !important;
        min-height: 60px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 8px 8px 0 rgba(128, 128, 128, 0.4) !important;
        border-radius: 12px !important;
    }
    
    .schedule-button,
    .schedule-button2,
    .todo-button {
        position: relative !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
        width: 85vw !important;
        max-width: 360px !important;
        height: 60px !important;
        min-height: 60px !important;
        margin: 0 auto !important;
        padding: 12px 16px !important;
        box-shadow: 8px 8px 0 rgba(128, 128, 128, 0.4) !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Stack calendar button with other buttons on mobile - must override desktop rule */
    .side-buttons .new-sched {
        position: relative !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
        width: 85vw !important;
        max-width: 360px !important;
        height: 60px !important;
        min-height: 60px !important;
        margin: 0 auto !important;
        padding: 12px 16px !important;
        box-shadow: 8px 8px 0 rgba(128, 128, 128, 0.4) !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .button-group {
        position: relative !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }
    
    .button-group button {
        width: 85vw !important;
        max-width: 360px !important;
        height: auto !important;
        min-height: 48px !important;
    }
    
    .bottom-buttons {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }
    
    .bottom-buttons button {
        width: 85vw !important;
        max-width: 360px !important;
        height: auto !important;
        min-height: 48px !important;
        box-shadow: none !important;
    }
    
    .tmr-btn {
        width: 85vw !important;
        max-width: 360px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        margin: 0 auto !important;
    }
    
    /* Clock removed from mobile calendar. */
    
    .tmr-menu {
        position: absolute !important;
        left: 0 !important;
        right: auto !important;
        top: 100% !important;
        margin-top: 8px !important;
        min-width: 220px !important;
    }
}

/* Google Calendar sync animation */
@keyframes hueRotate {
    0% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(90deg);
    }
    100% {
        filter: hue-rotate(0deg);
    }
}

.gcal-syncing {
    animation: hueRotate 1.2s ease-in-out infinite !important;
}

/* ===== TODO MODAL STYLES ===== */

/* Modal Backdrop Overlay */
.todo-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

.todo-modal-backdrop.active {
    display: flex;
}

/* Modal Container */
.todo-modal {
    width: 90vw;
    max-width: 500px;
    max-height: 80vh;
    background: white;
    border: none;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

/* Phone: make the To Do modal much taller so it doesn't feel squished. */
@media (max-width: 600px) {
    .todo-modal {
        max-height: calc(100vh - 24px) !important;
        height: calc(100vh - 24px);
        overflow: hidden;
    }

    .todo-modal .todo-list {
        max-height: none !important;
        flex: 1 1 auto;
        overflow-y: auto;
        min-height: 0;
    }

    #todo-modal-backdrop .todo-modal {
        overflow: hidden !important;
    }

    #todo-mobile-pane,
    #schedule-mobile-pane {
        min-height: 0;
        overflow: hidden;
    }

    #schedule-mobile-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }

    #schedule-mobile-content .schedule-preview {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        max-height: 100%;
    }

    #schedule-mobile-content .schedule-preview-steps {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-right: 4px;
        padding-bottom: 4px;
    }

    #schedule-mobile-content .schedule-preview-actions {
        position: sticky;
        bottom: 0;
        justify-content: stretch;
        padding-top: 12px;
        padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.78) 24%, rgba(255,255,255,0.94));
        backdrop-filter: blur(12px) saturate(135%);
        -webkit-backdrop-filter: blur(12px) saturate(135%);
    }

    #schedule-mobile-content .schedule-preview-actions .small-tmr-btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* Modal Header (h3 title) */
.todo-modal .todo-banner {
    margin: 0;
    padding: 16px;
    background: color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
    color: white;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22);
}

.todo-modal .todo-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
        radial-gradient(140% 200% at 50% 120%, rgba(255,255,255,0.20), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%);
    opacity: 0.98;
    pointer-events: none;
}

.todo-modal .todo-banner > * {
    position: relative;
    z-index: 1;
}

.todo-modal .todo-banner h3 {
    margin: 0;
    padding: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.todo-modal .todo-banner button:not(.todo-panel-tab) {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.todo-modal .todo-banner button:not(.todo-panel-tab):hover {
    background: rgba(255, 255, 255, 0.3);
}

.todo-modal .todo-banner button:not(.todo-panel-tab):active {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.todo-modal .todo-banner button:not(.todo-panel-tab):focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 137, 241, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.todo-modal .todo-banner .todo-panel-tab {
    margin-left: 0;
    background: transparent !important;
    border: none !important;
    padding: 6px 10px;
    border-radius: 0 !important;
    box-shadow: inset 0 -2px 0 transparent;
}

/* Input Row (Add Todo section) */
.todo-modal .todo-input-row {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: white;
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Form Labels */
.todo-modal label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

/* Form Inputs */
.todo-modal input[type="text"],
.todo-modal input[type="time"],
.todo-modal input[type="number"],
.todo-modal select,
.todo-modal textarea {
    padding: 10px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

/* Form Focus States */
.todo-modal input[type="text"]:focus,
.todo-modal input[type="time"]:focus,
.todo-modal input[type="number"]:focus,
.todo-modal select:focus,
.todo-modal textarea:focus {
    outline: none;
    border-color: var(--accent-color, #0089f1);
    box-shadow: 0 0 0 3px rgba(0, 137, 241, 0.1);
}

/* Textarea Specific */
.todo-modal textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Form Sections */
.todo-modal > div > div {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Divider Lines */
.todo-modal > div > div[style*="border-top"] {
    border-top: 1px solid #e0e0e0;
    padding-top: 12px !important;
}


/* Buttons Container */
.todo-modal > div > div[style*="display: flex"] {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Modal Buttons */
.todo-modal button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}


/* Save/Edit Buttons (Accent Color) */
#todo-edit-save-btn,
#todo-view-edit-btn {
    background: var(--accent-color, #0089f1);
    color: white;
}

#todo-edit-save-btn:hover,
#todo-view-edit-btn:hover {
    background: var(--accent-hover, #0073d1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 137, 241, 0.3);
}

/* Cancel/Close Buttons (Gray) */
#todo-edit-cancel-btn,
#todo-view-close-btn {
    background: #f0f0f0;
    color: #333;
}

#todo-edit-cancel-btn:hover,
#todo-view-close-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* Modal Slide-Up Animation */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== TODO PANEL STYLES ===== */

/* Desktop Todo Panel Container */
.todo-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.todo-banner {
    margin: 0;
    padding: 16px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22);
}

.todo-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(140% 200% at 50% 120%, rgba(255,255,255,0.20), transparent 60%),
        linear-gradient(135deg, rgba(255,255,255,0.12), transparent 48%);
    pointer-events: none;
}

.todo-banner > * {
    position: relative;
    z-index: 1;
}

/* Desktop-only: tinted frosted-glass panel headers */
@media (min-width: 1025px) {
    .todo-panel .todo-banner {
        padding: 19.5px 16px;
        font-size: 18px;
        font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
        backdrop-filter: blur(18px) saturate(190%);
        -webkit-backdrop-filter: blur(18px) saturate(190%);
        color: #fff;
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.22);
        border-radius: 12px 12px 0 0;
        backdrop-filter: blur(20px) saturate(190%);
        transition: background 0.18s ease, box-shadow 0.24s var(--tmr-settle-ease), filter 0.2s ease;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22);
        transform-origin: center;
        will-change: transform;
        overflow: hidden;
        isolation: isolate;
        font-weight: 600;
        text-align: left;
    }

    /* Desktop panel buttons: tinted frosted-glass */
    #desktop-create-todo-btn,
    .meibot-panel .meibot-form button.small-tmr-btn {
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 82%, transparent);
        color: #fff;
        filter: brightness(1.03);
    }

    #desktop-create-todo-btn:hover,
    .meibot-panel .meibot-form button.small-tmr-btn:hover {
        transform: none !important;
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
            linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
            color-mix(in srgb, var(--accent-color, #0089f1) 78%, transparent) !important;
    }
}

.todo-panel-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px 0;
    margin: 12px 16px 0;
}

.todo-banner .todo-panel-tabs {
    width: 100%;
    padding: 0;
    margin: 0;
}

.todo-modal .todo-banner .todo-panel-tabs,
.todo-panel .todo-banner .todo-panel-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 8px !important;
    flex-direction: row !important;
}

.todo-panel-tabs-header {
    max-width: 420px;
}

.todo-panel-tabs-mobile {
    padding-bottom: 8px;
}

.todo-panel-tab {
    padding: 6px 10px;
    font-size: 15px;
    font-family: var(--font-family, 'Product Sans', 'Roboto', system-ui, -apple-system, sans-serif);
    font-weight: 700;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    border: none;
    border-radius: 0;
    cursor: pointer;
    box-shadow: inset 0 -2px 0 transparent;
    transition: color 0.18s ease, box-shadow 0.18s ease;
    transform-origin: center;
    will-change: transform;
    overflow: hidden;
    isolation: isolate;
    text-align: center;
    width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 10px;
}

.todo-panel-tab.active,
.todo-banner .todo-panel-tab.active,
.todo-modal .todo-banner .todo-panel-tab.active {
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.98);
}

.todo-panel-tab:hover,
.todo-panel-tab:active,
.todo-banner .todo-panel-tab:hover,
.todo-banner .todo-panel-tab:active,
.todo-modal .todo-banner .todo-panel-tab:hover,
.todo-modal .todo-banner .todo-panel-tab:active {
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.72);
}

.todo-panel-tab:focus {
    outline: none;
}

.todo-panel-tab:focus-visible {
    box-shadow: 0 0 0 3px rgba(0,137,241,0.16);
}

.todo-subpanel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.todo-subpanel[hidden] {
    display: none !important;
}

/* Create Todo / Schedule Buttons */
#desktop-create-todo-btn,
#desktop-create-category-btn,
#mobile-create-category-btn,
#desktop-category-back-btn,
#mobile-category-back-btn,
#todo-modal-create-btn,
#desktop-create-schedule-btn,
#mobile-create-schedule-btn,
.schedule-create-btn {
    color: white !important;
    font-weight: 700 !important;
    padding: 12px 16px !important;
    margin: 12px 16px 12px 16px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    cursor: pointer !important;
    font-size: 16px !important;
    width: auto !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 82%, transparent) !important;
    backdrop-filter: blur(20px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22) !important;
    transition: background 0.18s ease, box-shadow 0.24s var(--tmr-settle-ease), filter 0.2s ease !important;
}

#desktop-create-todo-btn {
    margin-bottom: 20px !important;
}

#desktop-create-todo-btn:hover,
#desktop-create-category-btn:hover,
#mobile-create-category-btn:hover,
#desktop-category-back-btn:hover,
#mobile-category-back-btn:hover,
#todo-modal-create-btn:hover,
#desktop-create-schedule-btn:hover,
#mobile-create-schedule-btn:hover,
.schedule-create-btn:hover {
    transform: none !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.48), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.38), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.18), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 82%, transparent) !important;
    filter: brightness(1.03);
}

#desktop-create-todo-btn:active,
#desktop-create-category-btn:active,
#mobile-create-category-btn:active,
#desktop-category-back-btn:active,
#mobile-category-back-btn:active,
#todo-modal-create-btn:active,
#desktop-create-schedule-btn:active,
#mobile-create-schedule-btn:active,
.schedule-create-btn:active {
    transform: translateY(0) !important;
}

.todo-detail-toolbar .todo-back-btn,
.todo-modal .todo-back-btn,
#desktop-category-back-btn,
#mobile-category-back-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-indent: -1px;
}

/* Todo List */
.todo-list {
    list-style: none;
    margin: 0;
    padding: 24px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

/* Todo List Items */
.todo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.todo-item:hover {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22), 0 6px 16px rgba(0, 0, 0, 0.14);
}

/* Checkbox */
.todo-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color, #0089f1);
}

/* Todo Text */
.todo-item .todo-text {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

/* Todo Actions (Buttons) */
.todo-item .todo-actions {
    display: flex;
    gap: 6px;
}

.todo-item .todo-actions button {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
    background: #f0f0f0;
    color: #333;
}

.todo-item .todo-actions button:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.todo-item .todo-actions button:active {
    transform: translateY(0);
}

/* Delete button (✕) styling */
.todo-item button[style*="marginLeft"] {
    background: #fee !important;
    color: #c33 !important;
}

.todo-item button[style*="marginLeft"]:hover {
    background: #fdd !important;
}

.schedule-panel-content {
    padding: 0 16px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
}

.schedule-empty-state,
.schedule-card,
.schedule-preview,
.schedule-active-card {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.68), transparent 62%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.44), transparent 62%),
        linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.42));
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.34);
    box-shadow: 0 14px 34px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.42);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.schedule-empty-state {
    padding: 18px;
    color: #4a5563;
    font-size: 14px;
    line-height: 1.5;
}

.schedule-card,
.schedule-preview,
.schedule-active-card {
    padding: 14px;
}

.schedule-card {
    cursor: pointer;
}

.schedule-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.schedule-card-header,
.schedule-preview-header,
.schedule-active-header,
.schedule-steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.schedule-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: rgba(24, 32, 42, 0.96);
}

.schedule-status-pill,
.schedule-cadence-pill,
.schedule-time-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
}

.schedule-status-pill {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.34), transparent 50%),
        color-mix(in srgb, var(--accent-color, #0089f1) 18%, rgba(255,255,255,0.38));
    color: color-mix(in srgb, var(--accent-color, #0089f1) 82%, #123);
    border: 1px solid rgba(255,255,255,0.42);
}

.schedule-cadence-pill,
.schedule-time-pill {
    background: rgba(255,255,255,0.48);
    color: #334;
    border: 1px solid rgba(255,255,255,0.38);
}

.schedule-meta,
.schedule-submeta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-step-list,
.schedule-active-steps,
.schedule-preview-steps,
.schedule-edit-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-step-row,
.schedule-preview-step,
.schedule-active-step,
.schedule-step-editor {
    display: grid;
    gap: 10px;
    align-items: start;
}

.schedule-preview-step,
.schedule-active-step {
    grid-template-columns: auto 1fr;
}

.schedule-step-number {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(0,137,241,0.12);
    color: var(--accent-color, #0089f1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.schedule-step-main {
    min-width: 0;
}

.schedule-step-name {
    font-size: 14px;
    font-weight: 700;
    color: #223;
}

.schedule-step-notes {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(57, 68, 80, 0.82);
    line-height: 1.4;
}

.schedule-preview-actions,
.schedule-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.schedule-section-heading {
    margin: 2px 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(57, 68, 80, 0.76);
}

.schedule-active-step {
    border: 1px solid rgba(255,255,255,0.34);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.54);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.42);
}

.schedule-active-step.is-complete {
    opacity: 0.7;
    background: rgba(235, 247, 239, 0.72);
}

.schedule-active-step input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--accent-color, #0089f1);
}

.schedule-active-step input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.schedule-completion-note {
    margin-top: 4px;
    font-size: 11px;
    color: rgba(57, 68, 80, 0.76);
}

.schedule-modal-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.schedule-form-grid,
.schedule-form-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.42);
    border: 1px solid rgba(255,255,255,0.32);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.42);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.schedule-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.schedule-field-label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(34, 44, 56, 0.92);
}

.schedule-field-input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 8px;
    padding: 10px 8px;
    box-sizing: border-box;
    font: inherit;
    color: rgba(15,15,15,0.95);
    background: rgba(255,255,255,0.8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
    backdrop-filter: blur(12px) saturate(125%);
    -webkit-backdrop-filter: blur(12px) saturate(125%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.schedule-field-input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent-color, #0089f1) 44%, white);
    box-shadow: 0 0 0 3px rgba(0, 137, 241, 0.12), inset 0 1px 0 rgba(255,255,255,0.62);
}

.schedule-weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-weekday-btn {
    border: 1px solid rgba(255,255,255,0.32);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.36), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.22), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.54), rgba(255,255,255,0.34));
    color: #334;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(12px) saturate(145%);
    -webkit-backdrop-filter: blur(12px) saturate(145%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.42);
}

.schedule-weekday-btn.active {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.28), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 70%, transparent);
    color: #fff;
    border-color: rgba(255,255,255,0.26);
}

.schedule-step-editor {
    grid-template-columns: 88px 1fr auto;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.34);
    background: rgba(255,255,255,0.52);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.42);
}

.schedule-step-editor-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-step-remove {
    align-self: center;
    border: none;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.34), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.22), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.12), transparent 45%),
        rgba(210, 60, 80, 0.84);
    color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 8px 18px rgba(120, 28, 36, 0.18);
}

#schedule-create-edit-modal-backdrop.todo-modal-backdrop {
    background: rgba(0,0,0,0.32);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
}

#todo-category-modal-backdrop.todo-modal-backdrop,
#todo-category-actions-backdrop.todo-modal-backdrop {
    background: rgba(0,0,0,0.32);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
}

#todo-category-modal-backdrop .todo-modal,
#todo-category-actions-backdrop .todo-modal {
    max-width: 420px;
    border-radius: 12px !important;
    height: auto !important;
    max-height: calc(100vh - 32px) !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.72), transparent 60%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.5), transparent 62%),
        linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.44));
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    border: 1px solid rgba(255,255,255,0.34);
    box-shadow: 0 18px 60px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.42);
}

#todo-category-modal-backdrop .todo-modal-content,
#todo-category-actions-backdrop .todo-modal-content {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
}

#todo-category-modal-backdrop .todo-category-modal {
    width: min(320px, calc(100vw - 32px)) !important;
    max-width: min(320px, calc(100vw - 32px)) !important;
}

#todo-category-actions-backdrop .todo-modal {
    max-width: 360px;
}

#todo-category-actions-backdrop .todo-category-actions-modal {
    width: min(280px, calc(100vw - 32px)) !important;
    max-width: min(280px, calc(100vw - 32px)) !important;
}

#todo-category-actions-backdrop .todo-modal-content {
    padding: 14px;
}

#todo-category-actions-backdrop .todo-category-action-list {
    gap: 6px;
}

#todo-category-modal-backdrop .todo-modal > h3,
#todo-category-actions-backdrop .todo-modal > h3 {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.3), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 62%, transparent);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    color: #fff;
}

#todo-category-modal-backdrop .small-tmr-btn,
#todo-category-actions-backdrop .small-tmr-btn {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.3), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 68%, transparent) !important;
    backdrop-filter: blur(14px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(190%) !important;
    border: 1px solid rgba(255,255,255,0.26) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(255,255,255,0.2) !important;
    color: #fff !important;
}

#schedule-create-edit-modal-backdrop .todo-modal {
    width: min(420px, calc(100vw - 32px)) !important;
    max-width: min(420px, calc(100vw - 32px)) !important;
    height: auto !important;
    max-height: calc(100vh - 32px) !important;
    overflow: hidden !important;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.72), transparent 60%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.5), transparent 62%),
        linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.44));
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    border: 1px solid rgba(255,255,255,0.34);
    box-shadow: 0 18px 60px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.42);
}

#schedule-create-edit-modal-backdrop .schedule-modal-content {
    padding: 12px;
    gap: 10px;
}

#schedule-create-edit-modal-backdrop .schedule-form-grid,
#schedule-create-edit-modal-backdrop .schedule-form-section {
    padding: 10px;
    gap: 8px;
}

#schedule-create-edit-modal-backdrop .schedule-inline-grid,
#schedule-create-edit-modal-backdrop .schedule-step-editor-main,
#schedule-create-edit-modal-backdrop .schedule-edit-steps,
#schedule-create-edit-modal-backdrop .schedule-modal-actions {
    gap: 8px;
}

#schedule-create-edit-modal-backdrop .schedule-step-editor {
    padding: 10px;
}

#schedule-create-edit-modal-backdrop .todo-modal > h3 {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.3), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 62%, transparent);
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    color: #fff;
}

#schedule-create-edit-modal-backdrop .small-tmr-btn {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
        radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.3), transparent 55%),
        linear-gradient(135deg, rgba(255,255,255,0.14), transparent 45%),
        color-mix(in srgb, var(--accent-color, #0089f1) 68%, transparent) !important;
    backdrop-filter: blur(14px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(190%) !important;
    border: 1px solid rgba(255,255,255,0.26) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(255,255,255,0.2) !important;
    color: #fff !important;
}

#todo-create-edit-modal-backdrop .todo-modal-content,
#schedule-create-edit-modal-backdrop .todo-modal-content {
    flex: 0 1 auto;
    min-height: auto;
    overflow-y: auto;
}

#schedule-create-edit-modal-backdrop .schedule-step-remove {
    border: 1px solid rgba(255,255,255,0.22);
}

.schedule-preview {
    position: relative;
    overflow: hidden;
}

.schedule-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.28), transparent 35%),
        radial-gradient(110% 130% at 100% 0%, rgba(255,255,255,0.18), transparent 60%);
    opacity: 0.9;
    pointer-events: none;
}

.schedule-preview > * {
    position: relative;
    z-index: 1;
}

.schedule-preview-step {
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.46);
    border: 1px solid rgba(255,255,255,0.34);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

@media (max-width: 1024px) {
    .schedule-panel-content {
        padding-bottom: 20px;
    }

    .schedule-step-editor {
        grid-template-columns: 1fr;
    }

    .schedule-inline-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== THEMES MODAL ===== */
.themes-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.themes-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.themes-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.themes-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.themes-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.themes-close:hover {
    background: #f0f0f0;
    color: #333;
}

.themes-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.themes-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.themes-section label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.accent-picker-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.accent-picker-row input[type="color"] {
    width: 60px;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.accent-picker-row input[type="color"]:hover {
    border-color: var(--accent-color, #0089f1);
    box-shadow: 0 0 0 3px rgba(0, 137, 241, 0.1);
}

.color-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

.themes-modal-footer {
    padding: 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.themes-btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e0e0e0;
    color: #333;
}

.themes-btn-secondary:hover {
    background: #d0d0d0;
}

/* Font Picker */
#font-picker {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#font-picker:hover,
#font-picker:focus {
    border-color: var(--accent-color, #0089f1);
    outline: none;
}

.font-preview {
    margin-top: 12px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    text-align: center;
    color: #333;
    font-size: 16px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Background Image Upload */
.bg-upload-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.bg-upload-row input[type="file"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.bg-upload-row input[type="file"]:focus {
    outline: none;
    border-color: var(--accent-color, #0089f1);
    box-shadow: 0 0 0 3px rgba(0, 137, 241, 0.1);
}

.bg-preview-container {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    height: 150px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-none-text {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Meibot panel background */
.meibot-panel {
    background: transparent !important;
}

@media (min-width: 1025px) {
    .meibot-panel > h3 {
        margin: 0;
        padding: 12px 16px;
        color: #fff;
        font-size: 18px;
        font-weight: 600;
        border-radius: 12px 12px 0 0;
        background: var(--accent-color, #0089f1);
        background: color-mix(in srgb, var(--accent-color, #0089f1) 55%, transparent);
        backdrop-filter: blur(20px) saturate(175%);
        -webkit-backdrop-filter: blur(20px) saturate(175%);
        position: relative;
        overflow: hidden;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.22);
    }

    .meibot-panel > h3::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
            radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.42), transparent 55%),
            radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,0.34), transparent 55%),
            radial-gradient(140% 200% at 50% 120%, rgba(255,255,255,0.20), transparent 60%),
            linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%);
        opacity: 0.85;
        pointer-events: none;
    }

    .meibot-panel > h3 {
        position: relative;
    }
}


/* Bold Toggle */

.bold-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #333;
}

#bold-toggle {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color, #0089f1);
}


