/* Import themes and components first (must precede all other rules) */
@import "themes.css";
@import "components.css";

/* Add-task button: accent border and subtle shadow for visibility in all themes */
.btn-add {
    border: 2px solid var(--color-accent-primary);
    box-shadow: 0 2px 8px rgba(140, 146, 172, 0.12);
    font-weight: 700;
    letter-spacing: 0.02em;
    outline: none;
}

/* Extra contrast for dark theme */
[data-theme="dark"] .btn-add {
    background: var(--color-bg-secondary, #23243a);
    color: var(--color-text-primary, #fff);
    border-color: #fff;
}

/* Snackbar notification popup */
.snackbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Drag-and-drop animations */
.todo-item.dragging {
    opacity: 0.7;
    will-change: transform;
    pointer-events: none;
    z-index: 1001;
}

.todo-item.drag-over {
    transform: translateY(-5px);
    transition: transform 0.2s ease;
    background-color: rgba(140, 146, 172, 0.1);
}

.todo-item.settling {
    animation: settleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes settleIn {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/*GENERAL*/
li {
    list-style: none;
}

/* MOBILE: Stack panels vertically */
@media (max-width: 600px) {
    .main-scroll-container {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }

    .scroll-panel {
        flex: 0 0 100%;
        min-height: 100%;
        min-width: unset;
        scroll-snap-align: start;
    }

    /* Hide slide navigation dots on small screens where they overlap UI or are difficult to tap */
    .slide-nav {
        display: none;
    }
}

/* =========================
   Slide Navigation (Dots)
   ========================= */
.slide-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--slide-dot-gap);
    padding: var(--spacing-md) 0;
    background-color: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border);
}

.slide-dot {
    width: var(--slide-dot-size);
    height: var(--slide-dot-size);
    border-radius: 50%;
    border: none;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color var(--slide-dot-color-duration) ease, opacity var(--slide-dot-opacity-duration) ease, transform var(--slide-dot-transform-duration) ease;
    padding: 0;
    outline: none;
    flex-shrink: 0;
}

.slide-dot:hover {
    background-color: #999;
    transform: scale(var(--slide-dot-hover-scale));
}

.slide-dot.active {
    background-color: var(--color-fab-bg);
    transform: scale(var(--slide-dot-active-scale));
}

.slide-dot:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 0.25rem;
}

/* Pomodoro app stylesheet — optimized, refactored, non-breaking */

/* =========================
   Design Tokens
   ========================= */
:root {
    --base-font-size: 1rem;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --header-height: 4rem;

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Typography */
    --type-xxl: 6rem;
    --type-xl: 4.5rem;
    --type-lg: 2rem;
    --type-md: 1rem;

    --transition: all 200ms ease-out;

    /* Blur */
    --blur-amount: 12px;

    /* Slide Dots - Global Variables */
    --slide-dot-size: 0.75rem;
    /* 20% bigger from 0.625rem */
    --slide-dot-gap: 0.875rem;
    /* Extra spacing between dots */
    --slide-dot-hover-scale: 1.15;
    --slide-dot-active-scale: 1.25;
    --slide-dot-color-duration: 300ms;
    --slide-dot-opacity-duration: 300ms;
    --slide-dot-transform-duration: 200ms;

    /* Layout tokens (used to calculate safe bottom padding for scrollable areas) */
    --footer-height: 72px;
    --action-bar-space: 2.5rem;

    /* Button sizes (defaults can be overridden by themes) */
    --btn-min-width: 8rem;
    --btn-height: 2.5rem;
    --btn-min-width-sm: 6.5rem;
    /* small-screen fallback */
    /* distance from bottom for the action bar (can be reduced for mobile) */
    --action-bar-bottom: 1rem;
}

/* =========================
   Base / Reset
   ========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Keep border/box-shadow removal limited to pseudo-elements only */
*::before,
*::after {
    border: none !important;
    box-shadow: none !important;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
    font-size: var(--type-md);
    line-height: 1.5;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
}

/* .mini-timer-display {
    background: var(--color-bg-primary);

} */

/* =========================
   Header
   ========================= */
.app-header {
    background: var(--color-bg-primary);
    padding: 0.5rem var(--spacing-lg);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-text-primary);
}

.header-title a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: opacity 150ms ease;
}

.header-title a:hover {
    opacity: 0.75;
}

.todos-items {
    padding: 0 1rem;
    margin: 0;
}

.settings-btn,
.btn-fab {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Use a dedicated FAB background token and a contrasting foreground token */
    background: var(--color-fab-bg, var(--color-accent-primary));
    color: var(--color-fab-foreground, var(--color-text-on-accent));
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

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

.settings-btn:hover,
.btn-fab:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.settings-btn:focus,
.btn-fab:focus {
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* =========================
   Layout
   ========================= */
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow: hidden;
}

#mainContent,
.main-content {
    /* Flex container for scrollable content below fixed header + sticky bar */
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    padding-bottom: calc(4rem + max(2rem, env(safe-area-inset-bottom)));
}

.main-scroll-container {
    /* Horizontal scroll container for panels (Timer, Tasks, About) */
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.main-scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-panel {
    /* Each panel (timer-view, todo-section, about-section) */
    flex: 0 0 100%;
    min-width: 100%;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-align: start;
    box-sizing: border-box;
}

/* =========================
   Timer
   ========================= */
.timer-view {
    /* Timer view is a scroll-panel: fill entire scroll container */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    box-sizing: border-box;
    /* Extra bottom padding for mobile action bar/buttons */
    padding-bottom: max(7rem, env(safe-area-inset-bottom, 2rem));
}

.timer-display {
    font-size: var(--type-xxl);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    user-select: none;
    cursor: pointer;
    transition: opacity 200ms ease;
    color: var(--color-text);
}

.timer-display:hover {
    opacity: 0.85;
}

.timer-display:active {
    opacity: 0.7;
}

/* Fullscreen timer on desktop when the Timer view is active */
@media (min-width: 1024px) {

    /* Increase the timer size for emphasis on desktop */
    body.timer-active .timer-display {
        font-size: calc(var(--type-xxl) * 1.5);
    }

    @media (min-width: 1400px) {
        body.timer-active .timer-display {
            font-size: calc(var(--type-xxl) * 2);
        }
    }
}

/* Timer mode indicators */
.timer-display.timer--work {
    color: var(--color-text);
}

.timer-display.timer--break {
    color: var(--color-text-secondary);
}

/* =========================
   Navigation Hints (in Action Bar)
   ========================= */
.nav-hints-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    z-index: 10000;
    pointer-events: none;
}

.nav-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-align: center;
    animation: pulse-hint 2s ease-in-out infinite;
}

.nav-hint.hidden {
    display: none;
}

.nav-hint__arrow {
    font-size: 1rem;
    display: block;
    line-height: 1;
    animation: bounce-arrow 2s ease-in-out infinite;
}

.nav-hint__text {
    opacity: 0.8;
    font-weight: 500;
    white-space: nowrap;
}

.nav-hint--timer .nav-hint__arrow,
.nav-hint--todos .nav-hint__arrow,
.nav-hint--about .nav-hint__arrow {
    animation: bounce-arrow-up 2s ease-in-out infinite;
}

@keyframes pulse-hint {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@keyframes bounce-arrow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(2px);
    }
}

@keyframes bounce-arrow-down {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(2px);
    }
}

@keyframes bounce-arrow-up {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* Hide swipe hints on desktop devices */
@media (hover: hover) {
    .nav-hints-container {
        display: none;
    }
}

/* =========================
   Action Bar
   ========================= */

.action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--action-bar-bottom);
    width: 100vw;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 1.2rem 1.2rem 1.2rem;
    gap: calc(var(--spacing-md) * 2);
    pointer-events: none;
    z-index: 99999;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .action-bar {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        padding-bottom: 0.7rem;
    }
}

@media (max-width: 600px) {
    .action-bar {
        padding-bottom: 0.7rem;
    }
}

/* Defensive: ensure FAB and settings are visible and accessible */
.settings-btn,
/* Action-bar FABs visibility override */
.action-bar .btn-fab {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.action-bar>* {
    pointer-events: auto;
}

/* While dragging, disable page scrolling and overscroll chaining */
body.dragging-active {
    /* Prevent scroll chaining and touch interactions while dragging */
    overscroll-behavior: none;
    touch-action: none;
}

/* Ensure panels don't scroll while dragging */
body.dragging-active .main-scroll-container {
    overflow: hidden !important;
}

/* Force a consistent pointer/hand cursor while dragging to avoid the
   browser showing the 'not-allowed' cursor on some platforms. Use
   !important to override native drag cursors during drag operations. */
body.dragging-active,
body.dragging-active * {
    cursor: pointer !important;
}

.mini-timer {
    display: none !important;
    min-width: auto;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    z-index: 9;
    box-shadow: none;
    flex-shrink: 0;
}

/* Show mini-timer only on non-timer views */
body.todo-active #miniTimerTodos,
body.about-active #miniTimerAbout {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Hide mini-timer on timer view */
body.timer-active #miniTimerAbout,
body.timer-active #miniTimerTodos {
    display: none !important;
}

/* =========================
   Todos
   ========================= */
.todos-section {

    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 1px 0 var(--color-shadow);
    margin-bottom: 1.75rem;
}

.section-header {
    padding: var(--spacing-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--color-bg-secondary);

    cursor: pointer;
}

.todo-item {
    padding: var(--spacing-md) 0;
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    touch-action: manipulation;
    user-select: none;
    -webkit-touch-callout: none;

    transition: var(--transition);
}

.todo-item:hover {
    background: var(--color-bg-secondary);
}

.todo-item.deleting {
    opacity: 0.6 !important;
    background-color: rgba(220, 38, 38, 0.3) !important;
    border-left: 4px solid #dc2626 !important;
    transition: all 0.4s ease-out !important;
}

.todo-empty-state {
    padding: var(--spacing-md) 0;
    color: var(--color-text-secondary);
    list-style: none;
    text-align: center;
}

/* Hide empty state while dragging */
body.dragging-active .todo-empty-state {
    display: none !important;
}

.todo-placeholder {
    padding: 0;
    margin: 0;
    list-style: none;
    background: rgba(150, 150, 150, 0.1);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

/* Drag handle (reorder button) */
.drag-handle {
    background: inherit;
    /* use surrounding surface color */
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: inherit;
}

.drag-handle:active,
.drag-handle.dragging {
    cursor: grabbing;
}

.drag-handle:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

.drag-handle svg {
    display: block;
}

/* Drag & drop visual feedback */
.todo-item.long-press-active {
    background-color: var(--color-bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: all 150ms ease;
}

.todo-item.dragging {
    opacity: 0.5;
    background: var(--color-bg-secondary);
    border-left: 4px solid var(--color-accent-primary);
    padding-left: calc(var(--spacing-md) - 4px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    transition: all 100ms ease;
}

.todo-item.drag-over {
    border-top: 3px solid var(--color-accent-primary);
    padding-top: calc(var(--spacing-md) - 3px);
    background-color: var(--color-bg-secondary);
}

.todo-item.drag-over::before {
    content: '';
    position: absolute;
    left: 0;
    top: -3px;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent-primary) 0%, var(--color-accent-primary) 100%);
    box-shadow: 0 2px 8px var(--color-accent-primary);
}

.todo-drag-placeholder {
    background: linear-gradient(90deg,
            transparent 0%,
            var(--color-accent-primary) 25%,
            var(--color-accent-primary) 75%,
            transparent 100%);
    margin: 4px 0;
    border-radius: 4px;
    opacity: 0.6;
    animation: placeholder-pulse 1.2s ease-in-out infinite;
    transition: all 150ms ease;
}

@keyframes placeholder-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.todo-item.done {
    text-decoration: line-through;
    color: var(--color-text-secondary);
}

/* =========================
   Buttons
   ========================= */
button {
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.btn {
    /* Fixed-size primary shape (responsive): use min-width to avoid truncation on small screens */
    min-width: var(--btn-min-width, 8rem);
    height: var(--btn-height, 2.5rem);
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;

    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    /* Use surface background so buttons look like buttons */
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    transition: background 150ms ease, transform 120ms ease, box-shadow 120ms ease;
    touch-action: manipulation;
}

/* Smaller screens: reduce the fixed size so labels fit without overflowing */
@media (max-width: 420px) {
    .btn {
        min-width: var(--btn-min-width-sm, 6.5rem);
    }
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.btn-primary {
    background: var(--color-accent-primary);
    color: #fff;
}

/* =========================
   Modal / Overlay (DEDUPED)
   ========================= */
.add-task-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    z-index: 3000;
    transition: opacity 200ms ease-out;
    backdrop-filter: blur(var(--blur-amount)) saturate(85%);
}

.add-task-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Settings overlay */
.settings-overlay {
    z-index: 999;
    background: #0006;
    justify-content: center;
    align-items: center;
    display: none;
    position: fixed;
    inset: 0;
    pointer-events: none;
    backdrop-filter: blur(var(--blur-amount)) saturate(85%);
}

.settings-overlay[aria-hidden=false] {
    display: flex;
    pointer-events: auto
}

.settings-overlay[aria-hidden=true] {
    pointer-events: none
}

.settings-sheet-content {
    background: var(--color-bg-primary);
    width: 100%;
    max-width: 560px;
    padding: var(--spacing-lg);
    max-height: 85vh;
    box-shadow: none;
    border-radius: var(--radius-lg);
    position: relative;
    overflow-y: auto
}

.google-icon,
.facebook-icon {
    width: 1.4rem;
    height: 1.4rem;
    color: inherit;
    display: inline-block
}

.add-task-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    z-index: 3001;
    display: none;
}

.add-task-modal.visible {
    display: block;
}

/* =========================
   Footer
   ========================= */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

/* Footer timer (top of footer) */
.footer-timer {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    padding: .25rem 0;
    order: 0;
    /* first element */
}

.footer-timer .footer-timer-display {
    font-variant-numeric: tabular-nums;
}

/* Footer mini-timer should not show lines or shadows */
.site-footer .mini-timer {
    box-shadow: none !important;
    background: transparent;
    display: block;
    /* occupy its own row */
    width: 100%;
    text-align: center;
    order: 1;
    /* sit below footerTimer */
    margin-bottom: .25rem;
}

/* Footer links should appear on the third row */
.site-footer .footer-inner {
    order: 2;
    display: none;
    gap: var(--spacing-sm);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.75rem;
    max-width: 90%;
}

/* Show footer links only on About view (mobile) */
body.about-active .site-footer .footer-inner {
    display: flex;
}

/* Always show footer links on desktop */
@media (min-width: 1024px) {
    .site-footer .footer-inner {
        display: flex;
    }
}

/* Footer timer visibility: removed (footer timer no longer in use) */
.footer-timer {
    display: none !important;
}

.timer-active .site-footer .footer-inner {
    display: none !important;
}

.site-footer .footer-inner a {
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 0.09rem 0.4rem;
    border-radius: 6px;
    font-weight: 600;
    transition: color .12s ease, background .12s ease, transform .08s ease;
    display: inline-block;
}

.site-footer .footer-inner a:hover,
.site-footer .footer-inner a:focus {
    color: var(--color-accent-primary);
    text-decoration: underline;
    outline: none;
}

.site-footer .footer-inner a.footer-copyright {
    font-weight: 700;
    color: var(--color-accent-primary);
}

/* =========================
   About Section
   ========================= */
/* Consolidated with todo-section above (lines 1200-1215) */

/* Make the about content area flexible and scrollable */
.about-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    /* allow internal scrolling inside flex item */
}

.about-body {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    /* Add comfortable padding on both sides and modest vertical spacing */
    padding: var(--spacing-md) var(--spacing-sm);
}

/* Center the About content and increase horizontal margins on desktop for readability */
@media (min-width: 1024px) {
    .about-body {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
        max-width: 1100px;
        margin: 0 auto;
    }
}

/* Make the about header horizontally scrollable for small screens */
.about-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    /* allow horizontal scroll when content is wide */
    -webkit-overflow-scrolling: touch;
    gap: var(--spacing-md);
}

/* Prevent child elements from shrinking when header scrolls */
.about-header>* {
    flex: 0 0 auto;
}

.about-header h2 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 1.5rem;
}

.about-body h3 {
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
    font-size: 1.2rem;
}

/* Extra spacing for About headings */
.about h3 {
    /* make headings more prominent by increasing the top spacing */
    margin-top: calc(var(--spacing-lg) * 1.6);
}

/* Removed unused .header-url rules — no DOM references found. Reintroduce if About header links are added. */

.about-intro p {
    line-height: 1.7;
    color: var(--color-text-primary);
    margin-bottom: calc(var(--spacing-lg) * 1.2);
    font-size: 1.08rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: calc(var(--spacing-lg) * 0.8);
    margin-bottom: calc(var(--spacing-lg) * 1.2);
}

.feature-item {
    /* visual frame delegated to `.card` utility for reuse */
    padding: calc(var(--spacing-md) * 1.2) calc(var(--spacing-lg) * 0.8);
    background: var(--color-bg-primary);
    border-radius: 14px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 0;
    border: 1px solid var(--color-border);
}

.feature-item h4 {
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--color-text-primary);
    font-size: 1rem;
}

.feature-item p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.how-to-steps {
    counter-reset: step-counter;
    padding-left: 0;
    list-style: none;
}

.how-to-steps li {
    counter-increment: step-counter;
    margin-bottom: calc(var(--spacing-md) * 1.2);
    padding: calc(var(--spacing-sm) * 1.2) calc(var(--spacing-md) * 0.8);
    background: var(--color-bg-primary);
    border-left: 4px solid var(--color-accent-primary);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.03);
}

.how-to-steps li::before {
    content: counter(step-counter);
    display: inline-block;
    width: 2rem;
    height: 2rem;
    /* Step number bubble: white background on light theme for contrast */
    background: var(--color-fab-bg, var(--color-accent-primary));
    color: var(--color-text-primary);
    /* Add subtle border so bubble remains visible on white surfaces */
    border: 1px solid var(--color-border);
    border-radius: 50%;
    text-align: center;
    line-height: 2rem;
    font-weight: bold;
    margin-right: var(--spacing-md);
    vertical-align: top;
}

/* Removed unused .benefits-list rule — no DOM references found. */

/* Dark theme adjustments for about section */
[data-theme="dark"] .feature-item,
[data-theme="dark"] .how-to-steps li {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
}

/* Ensure step number bubble remains visible in dark theme */
[data-theme="dark"] .how-to-steps li::before {
    background: #ffffff;
    color: #000000;
    /* force black numbers on dark theme */
    border: 1px solid var(--color-border);
}

/* Ensure step number bubble is black in the light theme (inverted colors) */
[data-theme="light"] .how-to-steps li::before {
    background: #000000;
    color: #ffffff;
    border: 1px solid var(--color-border);
}

/* Ensure the todo and about sections expand to fill available vertical space */
.todo-section,
.about-section {
    /* allow section to grow and take full height inside .main-content */
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    /* keep existing positioning behavior */
    overflow: hidden;
    /* child will scroll */
}

/* The scrollable content area within todos should fill remaining space */
.todo-content {
    flex: 1 1 auto;
    overflow: auto;
    padding: var(--spacing-md) var(--spacing-sm);
}

/* =========================
   Utilities
   ========================= */
.hidden {
    display: none !important;
}

/* Override hidden on scroll-panels to maintain layout flow for scrolling */
.scroll-panel.hidden {
    display: none;
    /* Still hide it, but won't break scroll layout since we'll use scrollIntoView */
}

@media (max-width: 600px) {
    .main-content {
        padding: var(--spacing-md);
    }

    .timer-display {
        font-size: var(--type-xl);
    }
}

/* Ensure nav hints are visible on touch devices (swipe hints) 
   and visible on desktop (keyboard hints) but managed by JS/specific media queries. */
@media (hover:none) {
    .nav-hints-container {
        display: flex;
    }
}