/* Kloom - CSS Styles */

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Scandinavian palette */
    --accent: #8BA5B8;
    --accent-light: #A3B8C7;
    --accent-dark: #6F8A9D;
    --success: #8FA88D;
    --success-light: #B0C4AE;
    --warning: #C9B896;
    --danger: #B88B8A;

    /* Cool neutrals */
    --cream: #f7f8f9;
    --sand: #e8eaed;
    --stone: #cfd3d8;
    --warm-gray: #9ba3ab;
    --bark: #5a6570;
    --charcoal: #3d3d40;

    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 2px 8px rgba(107, 94, 84, 0.08);
    --shadow-md: 0 4px 16px rgba(107, 94, 84, 0.12);
    --shadow-lg: 0 8px 32px rgba(107, 94, 84, 0.16);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--cream);
    color: var(--charcoal);
    line-height: 1.5;
    min-height: 100vh;
    padding: 0 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--sand);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: var(--bark);
    border-radius: 999px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.nav-links a:hover {
    background: var(--sand);
    color: var(--charcoal);
}

.nav-links a.active {
    background: var(--charcoal);
    color: white;
}

.badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--sand);
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.user-profile-link:hover .user-name {
    color: var(--charcoal);
}

.user-profile-link:hover .user-avatar {
    border-color: var(--stone);
}

.user-name {
    color: var(--bark);
    font-size: 0.875rem;
    font-weight: 500;
}

.logout-btn {
    color: var(--warm-gray);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--sand);
    color: var(--danger);
}

/* Announcement banner */
.announcement-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(139, 165, 184, 0.12) 0%, rgba(143, 168, 141, 0.10) 100%);
    border: 1px solid var(--accent-light);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--charcoal);
    line-height: 1.45;
}

.announcement-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.announcement-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1.45;
}

.announcement-text strong {
    color: var(--accent-dark);
}

.announcement-dismiss {
    background: none;
    border: none;
    color: var(--warm-gray);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.announcement-dismiss:hover {
    color: var(--charcoal);
    background: rgba(0, 0, 0, 0.05);
}

/* Container */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
    transition: padding-bottom 0.2s ease;
}

.container.has-bulk-bar {
    padding-bottom: 6rem;
}

/* Page header */
.page-header {
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--charcoal);
    letter-spacing: -0.5px;
}

.date-display, .task-count {
    color: var(--warm-gray);
    font-size: 0.9375rem;
    margin-top: 0.25rem;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Progress bar */
.progress-bar {
    background: var(--sand);
    border-radius: 999px;
    height: 1.75rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--success) 0%, var(--success-light) 100%);
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 999px;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--charcoal);
}

/* Empty state hint for recurring tab */
.recurring-empty-hint {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--stone);
    font-size: 0.875rem;
    opacity: 0.6;
    font-style: italic;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--sand);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--sand);
}

.tab-button {
    background: none;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--stone);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tab-button:hover {
    color: var(--charcoal);
    background: var(--cream);
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-count {
    font-size: 0.8125rem;
    color: var(--stone);
    opacity: 0.7;
}

.tab-button.active .tab-count {
    color: var(--accent);
    opacity: 1;
}

.recurring-icon-inline {
    font-size: 1rem;
    color: var(--accent);
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

/* Task list */
.task-list {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: visible;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 0.375rem 1rem 0.375rem 0.5rem;
    border-bottom: 1px solid var(--sand);
    gap: 0;
    transition: background 0.2s;
    position: relative;
}

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

.task-item:hover {
    background: var(--cream);
    z-index: 11;
}

.task-item.completed {
    background: var(--cream);
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--warm-gray);
}

.task-title {
    flex: 1;
    font-size: 1rem;
    color: var(--charcoal);
    margin-left: 0.5rem;
    margin-right: 1rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-title.editable {
    cursor: text;
    padding: 0.125rem 0.5rem;
    margin: 0;
    border-radius: var(--radius);
    transition: background 0.2s;
    line-height: 1.5;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
}

.task-title.editable:hover {
    background: var(--sand);
}

/* Links in task titles */
.task-title a {
    color: #4A90E2;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: opacity 0.2s;
    word-break: break-word;
}

.task-title a:hover {
    opacity: 0.7;
}

/* Prevent link click from triggering drag */
.task-item a {
    pointer-events: auto;
}

.task-edit-input {
    flex: 1;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    outline: none;
    background: white;
    margin-right: 0.5rem;
    max-width: calc(100% - 200px);
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    padding: 0.125rem;
    margin-right: 0.125rem; /* Very close to checkbox */
    color: var(--stone);
    user-select: none;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: all 0.15s;
    opacity: 0; /* Hidden by default on desktop */
}

/* Show drag handle on task item hover (desktop) */
.task-item:hover .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    color: var(--warm-gray);
    background: var(--sand);
}

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

.drag-handle svg {
    width: 18px;
    height: 18px;
}

/* Sortable states */
.task-ghost {
    opacity: 0.5;
    background: var(--sand);
}

.task-chosen {
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
}

.task-drag {
    opacity: 0;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-right: 0.75rem; /* Space before task title */
    -webkit-tap-highlight-color: transparent;
}

.checkmark {
    height: 24px;
    width: 24px;
    background-color: white;
    border: 2px solid var(--stone);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-container:hover .checkmark {
    border-color: var(--success);
    background: var(--success-light);
}

.checkbox-container input:checked ~ .checkmark,
.checkmark.checked {
    background-color: var(--success);
    border-color: var(--success);
}

.checkbox-container input:checked ~ .checkmark::after,
.checkmark.checked::after {
    content: '\2713';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Status icon for history */
.status-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.task-item.completed .status-icon {
    color: var(--success);
}

.task-item:not(.completed) .status-icon {
    color: var(--danger);
}

/* Task actions */
.task-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-action {
    padding: 0 0.625rem;
    border: none;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: lowercase;
    line-height: 1;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-daily {
    background: var(--accent);
    color: white;
}

.btn-daily:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-tasks {
    background: var(--sand);
    color: var(--bark);
}

.btn-tasks:hover {
    background: var(--stone);
}

.btn-drop {
    background: transparent;
    color: var(--stone);
    border: 1px solid var(--sand);
    position: relative;
}

.btn-drop:hover {
    border-color: var(--stone);
    color: var(--bark);
}

/* Tooltip for drop button */
.btn-drop::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: white;
    color: var(--bark);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--sand);
    text-transform: none;
}

.btn-drop:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.btn-delete {
    background: transparent;
    color: var(--stone);
    padding: 0.25rem;
    border: 1px solid transparent;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    transition: all 0.15s;
    position: relative;
}

.btn-delete::after {
    content: "Delete";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: white;
    color: var(--bark);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--sand);
}

.btn-delete:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.btn-delete:hover {
    background: var(--cream);
    color: var(--danger);
}

/* Recurring frequency dropdown */
.recurring-dropdown {
    position: relative;
    display: inline-block;
}

.recurring-dropdown .dropdown-trigger {
    background: transparent;
    color: var(--stone);
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 28px;
    height: 24px;
}

.recurring-dropdown .dropdown-trigger:hover {
    background: var(--cream);
    border-color: var(--sand);
    color: var(--accent);
}

.recurring-dropdown .dropdown-trigger.active {
    background: var(--cream);
    border-color: var(--sand);
    color: var(--accent);
}

.recurring-dropdown .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
    top: calc(100% + 0.25rem);
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    width: 250px;
    max-height: 460px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.recurring-dropdown.open .dropdown-menu {
    display: block;
}

.recurring-dropdown .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.875rem;
}

.recurring-dropdown .dropdown-menu .dropdown-item:hover {
    background: var(--sand);
}

.recurring-dropdown .dropdown-menu .dropdown-item.selected {
    background: rgba(139, 165, 184, 0.1);
    color: var(--accent);
    font-weight: 600;
}

.recurring-dropdown .dropdown-menu .dropdown-item .radio-mark {
    width: 14px;
    height: 14px;
    border: 2px solid var(--stone);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recurring-dropdown .dropdown-menu .dropdown-item.selected .radio-mark {
    border-color: var(--accent);
}

.recurring-dropdown .dropdown-menu .dropdown-item.selected .radio-mark::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* Weekly day picker */
.weekly-picker {
    display: none;
    flex-direction: row;
    gap: 4px;
    padding: 0.375rem 0.5rem;
    justify-content: center;
}

.weekly-picker .day-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--stone);
    background: white;
    color: var(--bark);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s;
}

.weekly-picker .day-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.weekly-picker .day-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.weekly-picker.shake .day-btn,
.monthly-picker.shake .monthly-option,
.monthly-picker.shake .day-cell {
    border-color: var(--accent);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

/* Monthly picker */
.monthly-picker {
    display: none;
    padding: 0.25rem 0.5rem 0.375rem;
}

.monthly-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.25rem 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--bark);
    transition: background 0.15s, border-color 0.15s;
    border-left: 3px solid transparent;
}

.monthly-option:hover {
    background: var(--sand);
}

.monthly-option.active {
    background: rgba(139, 165, 184, 0.15);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.monthly-day-input {
    width: 44px;
    padding: 2px 4px;
    border: 1.5px solid var(--stone);
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
    font-family: inherit;
    color: var(--charcoal);
}

.monthly-day-input:focus {
    outline: none;
    border-color: var(--accent);
}

.monthly-day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    padding: 4px 0;
}

.monthly-day-grid .day-cell {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--stone);
    background: white;
    color: var(--charcoal);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.monthly-day-grid .day-cell:hover {
    border-color: var(--accent);
    background: rgba(139, 165, 184, 0.1);
}

.monthly-day-grid .day-cell.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 700;
}

.monthly-calendar-option {
    flex-direction: column;
    align-items: flex-start;
}

.monthly-calendar-option .monthly-calendar-label {
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.monthly-nth-select,
.monthly-dow-select {
    padding: 2px 4px;
    border: 1.5px solid var(--stone);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--charcoal);
    background: white;
    cursor: pointer;
}

.monthly-nth-select:focus,
.monthly-dow-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Dim inactive monthly option's controls */
.monthly-option:not(.active) {
    opacity: 0.45;
}

.monthly-option:not(.active):hover {
    opacity: 0.7;
}

.monthly-or-divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.125rem 0;
    color: var(--warm-gray);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.monthly-or-divider::before,
.monthly-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--sand);
}

.monthly-option:not(.active) .day-cell.active {
    background: var(--stone);
    border-color: var(--stone);
}

/* Save button at bottom of recurring dropdown */
.picker-save-btn {
    display: block;
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 0.375rem;
    transition: background 0.15s;
}

.picker-save-btn:hover {
    background: var(--accent-dark);
}

/* Frequency badge on recurring tab */
.recurring-frequency-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(139, 165, 184, 0.15);
    color: var(--accent-dark);
    margin-left: 0.375rem;
    vertical-align: middle;
    white-space: nowrap;
}

/* Recurring task visual indicator */
.task-title.recurring-task::before {
    content: "⟳";
    color: var(--accent);
    margin-right: 0.375rem;
    font-size: 1rem;
    opacity: 1;
    font-weight: 600;
}

/* Recurring indicator as separate element (for tooltips) */
.recurring-indicator {
    color: var(--accent);
    margin-right: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: help;
    display: inline-flex;
    align-items: center;
    position: relative;
}

/* CSS tooltip for recurring indicator */
.recurring-indicator::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: white;
    color: var(--bark);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--sand);
}

.recurring-indicator:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Add task form */
.add-task-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.add-task-input-wrapper {
    position: relative;
    width: 100%;
}

.add-task-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    font-size: 1rem;
    background: white;
    transition: all 0.2s;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    height: 46px;
    overflow: hidden;
    box-sizing: border-box;
}

.add-task-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 165, 184, 0.15);
}

.add-task-form textarea::placeholder {
    color: var(--warm-gray);
}

.add-task-hint {
    font-size: 0.75rem;
    color: var(--warm-gray);
    margin-top: 0.25rem;
}

.add-task-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
}

/* Compact category selector */
.category-selector-compact {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-selector-compact .category-button {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--charcoal);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    height: 46px;
    box-sizing: border-box;
    min-width: 140px;
}

.category-selector-compact .category-button .category-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 6rem;
    text-align: left;
}

.category-selector-compact .category-button .category-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-selector-compact .category-button .dropdown-arrow {
    margin-left: auto;
    flex-shrink: 0;
}

.category-selector-compact .category-button:hover {
    border-color: var(--accent);
    background: var(--cream);
}

.category-selector-compact .category-button svg {
    color: var(--stone);
}

.category-selector-compact.open .category-button {
    border-color: var(--accent);
    background: var(--cream);
}


.category-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.category-selector-compact.open .category-dropdown-menu {
    display: block;
}

.btn-add-task {
    padding: 0 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    height: 46px;
    box-sizing: border-box;
}

.btn-add-task:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .add-task-controls {
        gap: 0.5rem;
    }

    .add-task-form .category-selector-compact .category-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
    }

    .add-task-form .btn-add-task {
        padding: 0 0.5rem !important;
        font-size: 0.8125rem;
        flex-shrink: 0;
        width: auto;
    }
}

/* Empty state */
.empty-state {
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--warm-gray);
}

.empty-state p {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.empty-state .hint {
    font-size: 0.9375rem;
    color: var(--stone);
}

.empty-state.success {
    color: var(--success);
}

/* History list */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.history-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.history-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.date-day {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--charcoal);
    line-height: 1;
}

.date-month {
    font-size: 0.75rem;
    color: var(--warm-gray);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.date-year {
    font-size: 0.625rem;
    color: var(--stone);
}

.history-stats {
    flex: 1;
}

.history-count {
    font-size: 0.875rem;
    color: var(--bark);
}

.history-rate {
    font-size: 1.25rem;
    font-weight: 800;
}

.history-rate.perfect { color: var(--success); }
.history-rate.good { color: var(--success); }
.history-rate.fair { color: var(--warning); }
.history-rate.low { color: var(--danger); }

.history-bar {
    width: 100px;
    height: 8px;
    background: var(--sand);
    border-radius: 999px;
    overflow: hidden;
}

.history-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--success-light) 100%);
    border-radius: 999px;
}

/* Login page */
.login-page {
    background: linear-gradient(145deg, var(--accent-light) 0%, var(--accent) 50%, var(--accent-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-container {
    text-align: center;
}

.login-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 380px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--charcoal);
    font-weight: 700;
}

.login-card p {
    color: var(--warm-gray);
    margin-bottom: 1.5rem;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    color: var(--charcoal);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.google-btn:hover {
    border-color: var(--stone);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 2.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Routine pages */
.routine-container {
    max-width: 560px;
    margin: -0.5rem auto 0;
}

.routine-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.routine-header h1 {
    font-size: 1.5rem;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
    font-weight: 800;
}

.routine-progress {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.routine-progress .step {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 999px;
    background: var(--sand);
    color: var(--warm-gray);
    font-weight: 600;
}

.routine-progress .step.active {
    background: var(--accent);
    color: white;
}

.routine-progress .step.done {
    background: var(--success);
    color: white;
}

.routine-content h2 {
    font-size: 1.25rem;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.routine-description {
    color: var(--bark);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.routine-actions {
    margin-top: 1rem;
    text-align: center;
}

.routine-actions .hint {
    color: var(--warm-gray);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.routine-actions .hint.warning {
    color: var(--warning);
}

.routine-actions .hint.commitment strong {
    color: var(--accent);
}

.routine-actions-sticky {
    position: sticky;
    bottom: 0;
    background: var(--cream);
    padding: 0.75rem 0;
    margin: 1rem -1rem 0;
    padding-left: 1rem;
    padding-right: 1rem;
    border-top: 1px solid var(--sand);
    z-index: 20;
}

.routine-actions .btn-large {
    padding: 0.625rem 1.5rem;
    font-size: 0.9375rem;
}

/* Processed tasks collapsible section */
#processed-tasks {
    margin-top: 1.5rem !important;
}

.processed-tasks-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--stone);
    text-align: left;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.processed-tasks-toggle:hover {
    background: var(--sand);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.processed-tasks-toggle.expanded {
    background: var(--sand);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.toggle-icon {
    transition: transform 0.2s ease;
    color: var(--stone);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toggle-icon svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.processed-tasks-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.toggle-label {
    flex: 1;
    color: var(--stone);
    font-size: 0.8125rem;
}

.processed-count-badge {
    background: var(--warm-gray);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.processed-tasks-content {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease, box-shadow 0.25s ease;
}

.processed-tasks-content.expanded {
    grid-template-rows: 1fr;
}

.processed-tasks-content > div {
    overflow: hidden;
}

.processed-tasks-content .task-list {
    padding: 0;
}

/* Processed task items styling */
.processed-tasks-content .task-item {
    opacity: 0.85;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid var(--sand);
    padding: 0.5rem 0.75rem;
}

.processed-tasks-content .task-item:last-child {
    border-bottom: none;
}

.processed-tasks-content .task-item:hover {
    opacity: 1;
    background: var(--cream);
}

.processed-tasks-content .category-group {
    margin-bottom: 0;
}

.processed-tasks-content .category-header {
    position: static !important;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--cream);
    border-radius: 0;
    box-shadow: none !important;
    border-left-width: 3px;
    cursor: default;
    user-select: auto;
}

.processed-tasks-content .category-group:first-child .category-header {
    border-top: none;
}

/* Recurring task preview in daily confirmation */
.recurring-preview {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--sand);
}

.recurring-preview h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--stone);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-list-preview {
    background: var(--cream);
}

.task-item-preview {
    background: transparent;
}

.task-item-preview .recurring-icon {
    font-size: 1rem;
    color: var(--accent);
    margin-right: 0.5rem;
}

.task-item-preview .task-title {
    color: var(--charcoal);
}

/* Recurring badge in cleanup */
.recurring-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(139, 165, 184, 0.15);
    color: var(--accent);
    vertical-align: middle;
    white-space: nowrap;
}

/* Cleanup processed sections */
.processed-section {
    margin-bottom: 1rem;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.section-header {
    padding: 0.875rem 1.25rem;
    background: var(--sand);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--charcoal);
    user-select: none;
    transition: background 0.2s;
}

.section-header:hover {
    background: var(--stone);
}

.section-header .toggle-icon {
    color: var(--warm-gray);
    font-size: 0.875rem;
}

.section-content {
    display: none;
}

.processed-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--sand);
}

.processed-task-item:last-child {
    border-bottom: none;
}

.processed-task-title {
    flex: 1;
    color: var(--warm-gray);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--stone);
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: 1rem 2.25rem;
    font-size: 1.125rem;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: color-mix(in srgb, var(--success) 85%, black);
}

/* Read-only list */
.task-list.read-only .task-item {
    cursor: default;
}

.task-list.read-only .task-item:hover {
    background: inherit;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        font-size: 15px;
        padding: 0 0.5rem;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 0.5rem;
        border-top: 1px solid var(--sand);
    }

    .nav-links a {
        padding: 0.375rem 0.875rem;
        font-size: 0.875rem;
    }

    .nav-user {
        gap: 0.5rem;
    }

    .user-name {
        display: none;
    }

    .container {
        padding: 0.75rem;
    }

    .page-header {
        margin-bottom: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .task-count {
        font-size: 0.75rem;
    }

    /* Add task form - stack on mobile */
    .add-task-form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .add-task-form input[type="text"] {
        width: 100%;
    }

    .add-task-form .custom-dropdown {
        width: 100%;
    }


    /* Task items - better mobile layout */
    .task-item {
        padding: 0.625rem 0.875rem 0.625rem 0.5rem; /* Reduced padding for more density */
        gap: 0;
        position: relative;
    }

    /* Always show drag handle on mobile for long-press dragging */
    .drag-handle {
        opacity: 1;
    }

    .task-select-checkbox {
        margin-right: 0.75rem;
    }

    .task-title {
        font-size: 0.9375rem;
        min-width: 0;
        word-break: break-word;
    }

    /* Category select - smaller on mobile */
    .task-category-select {
        font-size: 0.8125rem;
        padding: 0.375rem 0.5rem;
        min-width: 80px;
        max-width: 120px;
    }

    /* Task actions - make smaller and wrap */
    .task-actions {
        gap: 0.375rem;
    }

    .task-actions .btn-action {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    /* Sticky category headers on mobile */
    .category-header,
    .routine-content .category-header {
        top: 110px !important; /* Adjusted for mobile wrapped navbar */
        position: -webkit-sticky !important; /* Safari support */
        position: sticky !important;
        z-index: 30 !important;
        margin-top: 0.5rem !important; /* Space before header when sticky */
        box-shadow: 0 -0.5rem 0 0 var(--cream), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        background: var(--sand) !important;
    }

    /* Ensure routine actions button stays above category headers */
    .routine-actions-sticky {
        z-index: 40 !important;
    }

    /* Hide delete button on mobile (use swipe instead) */
    .btn-delete {
        display: none;
    }

    /* Completion checkbox on daily page */
    .checkbox-container {
        width: 20px;
        height: 20px;
    }

    .checkmark {
        width: 20px;
        height: 20px;
    }

    /* Category dropdown */
    .custom-dropdown .dropdown-menu {
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
    }

    /* Category modal - full screen on mobile */
    .category-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .category-modal-header {
        padding: 1rem;
    }

    .category-modal-header h3 {
        font-size: 1.25rem;
    }

    .category-modal-add {
        padding: 0.875rem 1rem;
    }

    .category-modal-list {
        padding: 0.5rem 1rem;
    }

    .category-modal-item {
        padding: 0.875rem;
    }

    /* Bulk action bar */
    .bulk-action-bar {
        padding: 0.875rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .bulk-action-bar .bulk-actions {
        width: 100%;
    }

    .bulk-action-bar button {
        flex: 1;
    }

    /* History items */
    .history-item {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .history-date {
        font-size: 0.875rem;
    }

    .history-bar {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Progress bar */
    .progress-bar {
        height: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .progress-text {
        font-size: 0.8125rem;
    }

    /* Login page */
    .login-header h1 {
        font-size: 2.5rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    /* Routine pages */
    .routine-step-cards {
        gap: 1rem;
    }

    .routine-card {
        padding: 1rem;
    }

    .routine-card h3 {
        font-size: 1rem;
    }

    /* FAB on mobile */
    .fab {
        width: 56px;
        height: 56px;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.5rem;
    }

    /* Quick add modal on mobile */
    .quick-add-modal {
        width: 95%;
        max-width: none;
    }

    .quick-add-header {
        padding: 1rem;
    }

    .quick-add-header h3 {
        font-size: 1.125rem;
    }

    .quick-add-form {
        padding: 1rem;
    }

    .quick-add-form .form-actions {
        gap: 0.5rem;
    }

    /* Cancel button on its own row, category and add on top row */
    .quick-add-form .btn-cancel {
        order: 3;
        width: 100%;
    }

    .quick-add-form .category-selector-compact {
        order: 1;
        flex: 1;
        min-width: 0;
    }

    .quick-add-form .split-submit {
        order: 2;
        flex: 1;
        min-width: 0;
    }

    .quick-add-form .split-submit .btn-submit {
        flex: 1;
    }

    .split-submit-menu {
        min-width: 100%;
    }

    .quick-add-form .category-selector-compact .category-button {
        width: 100%;
        justify-content: space-between;
    }
}

/* Category styles */

/* Custom dropdown */
.custom-dropdown {
    position: relative;
    min-width: 140px;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: white;
    cursor: pointer;
    text-align: left;
    color: var(--charcoal);
}

.dropdown-trigger:hover {
    border-color: var(--stone);
}

.custom-dropdown.open .dropdown-trigger {
    border-color: var(--accent);
}

.dropdown-arrow {
    color: var(--warm-gray);
    transition: transform 0.2s;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    overflow: hidden;
}

.custom-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-items-scroll {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.dropdown-items-scroll::-webkit-scrollbar {
    width: 6px;
}

.dropdown-items-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-items-scroll::-webkit-scrollbar-thumb {
    background: var(--sand);
    border-radius: 3px;
}

.dropdown-items-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--warm-gray);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--sand);
}

.dropdown-item.selected {
    background: var(--cream);
    color: var(--accent);
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}

.dropdown-item.selected .category-color-dot {
    box-shadow: 0 0 0 2px var(--accent);
}

.dropdown-item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-footer {
    border-top: 1px solid var(--sand);
    background: linear-gradient(to bottom, var(--cream), white);
    position: relative;
}

.dropdown-footer::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.04), transparent);
    pointer-events: none;
}

.dropdown-manage-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: var(--warm-gray);
    cursor: pointer;
    transition: all 0.15s;
}

.dropdown-manage-link:hover {
    color: var(--accent);
}

.dropdown-manage-link svg {
    width: 14px;
    height: 14px;
}

/* Category Management Modal */
.category-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.category-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.category-modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 360px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.category-modal-overlay.open .category-modal {
    transform: scale(1);
}

.category-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sand);
}

.category-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.category-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--warm-gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.category-modal-close:hover {
    color: var(--charcoal);
}

.category-modal-add {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.25rem;
    background: var(--cream);
    border-bottom: 1px solid var(--sand);
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-modal-add input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.category-modal-add input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.category-modal-add input::placeholder {
    color: var(--warm-gray);
}

.category-modal-add button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.category-modal-add button:hover {
    background: var(--accent-dark);
}

.category-modal-add button:active {
    transform: scale(0.95);
}

.category-modal-add button svg {
    width: 20px;
    height: 20px;
}

.category-modal-list {
    padding: 0.5rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.category-modal-list::-webkit-scrollbar {
    width: 6px;
}

.category-modal-list::-webkit-scrollbar-track {
    background: transparent;
}

.category-modal-list::-webkit-scrollbar-thumb {
    background: var(--sand);
    border-radius: 3px;
}

.category-modal-list::-webkit-scrollbar-thumb:hover {
    background: var(--warm-gray);
}

.category-modal-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
}

.category-modal-item .category-color-dot {
    width: 12px;
    height: 12px;
}

.category-modal-item-name {
    flex: 1;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.category-modal-delete {
    background: transparent;
    border: none;
    color: var(--stone);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.25rem;
    transition: all 0.15s;
}

.category-modal-delete:hover {
    background: rgba(209, 96, 94, 0.1);
    color: var(--danger);
}

.category-modal-delete svg {
    width: 16px;
    height: 16px;
    display: block;
}

.category-modal-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--warm-gray);
    font-size: 0.875rem;
}

/* Task selection checkbox */
.task-select-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.125rem;
    margin-right: 0.75rem; /* Space before completion circle or task title */
}

.task-select-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.task-checkbox-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--stone);
    border-radius: 4px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-select-checkbox:hover .task-checkbox-mark {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.task-select-checkbox input:checked ~ .task-checkbox-mark {
    background: var(--accent);
    border-color: var(--accent);
}

.task-select-checkbox input:checked ~ .task-checkbox-mark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.task-item.selected {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Bulk action bar */
.bulk-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--charcoal);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.2s ease;
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.bulk-action-bar.visible {
    transform: translateY(0);
}

.bulk-action-bar .selection-count {
    font-weight: 600;
    font-size: 0.9375rem;
}

.bulk-action-bar .bulk-actions {
    display: flex;
    gap: 0.75rem;
}

.bulk-action-bar button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.bulk-action-bar .btn-bulk-delete {
    background: var(--danger);
    color: white;
}

.bulk-action-bar .btn-bulk-delete:hover {
    background: #b8504e;
}

.bulk-action-bar .btn-bulk-cancel {
    background: transparent;
    color: var(--stone);
    border: 1px solid var(--stone);
}

.bulk-action-bar .btn-bulk-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: white;
}

/* Highlight animation for newly added items */
@keyframes highlight-fade {
    0% { background-color: var(--accent-light); }
    100% { background-color: transparent; }
}

.category-modal-item.highlight {
    animation: highlight-fade 1.5s ease-out;
}

/* Category modal - inactive items */
.category-modal-item.inactive {
    opacity: 0.5;
}

/* Category toggle switch (iOS-style) */
.category-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
}

.category-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.category-toggle .toggle-track {
    position: absolute;
    inset: 0;
    background: var(--stone);
    border-radius: 999px;
    transition: background 0.2s;
}

.category-toggle input:checked + .toggle-track {
    background: var(--success);
}

.category-toggle .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.category-toggle input:checked + .toggle-track::after {
    transform: translateX(16px);
}

/* Category name inline edit input */
.category-name-input {
    flex: 1;
    font-size: 0.9375rem;
    font-family: inherit;
    padding: 0.2rem 0.4rem;
    border: 2px solid var(--accent);
    border-radius: 6px;
    outline: none;
    background: white;
    min-width: 0;
}

/* Category color clickable dot */
.category-color-clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.category-color-clickable:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

/* Inline color picker */
.category-color-picker {
    display: flex;
    gap: 0.375rem;
    padding: 0.375rem 0;
    flex-shrink: 0;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    border: 2px solid transparent;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    border-color: var(--charcoal);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--charcoal);
}

/* Bulk recategorize */
.bulk-recategorize-wrapper {
    position: relative;
}

.btn-bulk-move {
    background: var(--accent) !important;
    color: white !important;
}

.btn-bulk-move:hover {
    background: var(--accent-dark) !important;
}

.bulk-recategorize-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.375rem 0;
    display: none;
    z-index: 210;
    margin-bottom: 0.5rem;
}

.bulk-recategorize-menu.open {
    display: block;
}

.bulk-recat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--charcoal);
    transition: background 0.1s;
}

.bulk-recat-item:hover {
    background: var(--sand);
}

.bulk-recat-item .category-color-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* Loading Indicator */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 9999;
    transition: transform 0.3s ease;
}

.loading-bar.active {
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    50% {
        transform: scaleX(0.5);
        transform-origin: left;
    }
    51% {
        transform: scaleX(0.5);
        transform-origin: right;
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid var(--sand);
    border-top-color: var(--accent);
    border-radius: 50%;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.active {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(139, 165, 184, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    z-index: 100;
    transition: all 0.2s ease;
}

.fab:hover {
    background: var(--accent-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 165, 184, 0.5);
}

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

/* Quick Add Modal */
.quick-add-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.quick-add-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.quick-add-modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: visible;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.2s ease;
}

.quick-add-overlay.open .quick-add-modal {
    transform: scale(1) translateY(0);
}

.quick-add-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sand);
}

.quick-add-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--charcoal);
    margin: 0;
}

.quick-add-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--stone);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.quick-add-close:hover {
    background: var(--sand);
    color: var(--charcoal);
}

.quick-add-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-add-input-wrapper {
    position: relative;
}

.quick-add-form textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    resize: none;
    overflow-y: auto;
    transition: border-color 0.15s;
}

.quick-add-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 165, 184, 0.15);
}

.quick-add-form .form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.quick-add-form button {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.quick-add-form .btn-submit {
    background: var(--accent);
    color: white;
}

.quick-add-form .btn-submit:hover {
    background: var(--accent-dark);
}

/* Split submit button */
.split-submit {
    display: flex;
    position: relative;
}

.split-submit .btn-submit {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
    min-width: 0;
}

.split-submit .btn-split-toggle {
    background: var(--accent);
    color: white;
    border: none;
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.split-submit .btn-split-toggle:hover {
    background: var(--accent-dark);
}

.split-submit-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--sand);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 10;
    min-width: 170px;
}

.split-submit-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.split-submit-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--charcoal);
    white-space: nowrap;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.split-submit-option:hover {
    background: var(--sand);
}

.split-submit-check {
    opacity: 0;
    flex-shrink: 0;
}

.split-submit-option.active .split-submit-check {
    opacity: 1;
    color: var(--accent);
}

.quick-add-form .btn-cancel {
    background: var(--sand);
    color: var(--charcoal);
}

.quick-add-form .btn-cancel:hover {
    background: var(--stone);
    color: white;
}

/* Make category button match other buttons in modal */
.quick-add-form .category-selector-compact .category-button {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    height: auto;
}

/* Quick add modal: constrain dropdown within modal */
.quick-add-form .category-dropdown-menu {
    max-height: 200px;
    bottom: auto;
    top: calc(100% + 0.5rem);
}

@media (max-width: 640px) {
    .quick-add-form .form-actions {
        flex-direction: column;
    }
    .quick-add-form .form-actions > * {
        width: 100%;
    }
    .quick-add-form .category-selector-compact {
        width: 100%;
    }
    .quick-add-form .category-selector-compact .category-button {
        width: 100%;
        min-width: 0 !important;
    }
    .quick-add-form .category-dropdown-menu {
        width: 100%;
    }
}

/* Quick add uses the same category-selector-compact from Intray */

.category-select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

.category-select:focus {
    outline: none;
    border-color: var(--accent);
}

#categories-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-section {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    overflow: visible;
    transition: margin-bottom 0.25s ease, padding-bottom 0.25s ease;
}

.category-section.collapsed,
.category-group.collapsed {
    margin-bottom: 0;
    padding-bottom: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: var(--sand);
    border-radius: 6px;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid currentColor;
    position: sticky;
    top: 80px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, margin-bottom 0.25s ease, border-radius 0.25s ease;
}

.category-header:hover {
    background: #e0e2e6;
}

.collapsed .category-header {
    margin-bottom: 0;
}


.category-drag-handle {
    cursor: grab;
    padding: 0.25rem;
    color: var(--warm-gray);
    user-select: none;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: all 0.15s;
    opacity: 0; /* Hidden by default on desktop */
}

/* Show category drag handle on header hover (desktop) */
.category-header:hover .category-drag-handle {
    opacity: 1;
}

.category-drag-handle:hover {
    color: var(--charcoal);
    background: var(--stone);
}

.category-drag-handle:active {
    cursor: grabbing;
}

.category-drag-handle svg {
    width: 16px;
    height: 16px;
}

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

.category-name {
    font-weight: 600;
    color: var(--charcoal);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

.category-count {
    color: var(--stone);
    font-size: 0.6875rem;
    margin-left: auto;
}

.btn-category-delete {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--stone);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    transition: all 0.15s;
}

.btn-category-delete:hover {
    color: var(--danger);
    background: rgba(209, 96, 94, 0.1);
}

.category-tasks {
    min-height: 8px;
}

/* Collapsible category content */
.category-collapse-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.25s ease;
}

.collapsed .category-collapse-wrapper {
    grid-template-rows: 0fr;
}

.collapsed .category-collapse-wrapper > * {
    overflow: hidden;
}

.category-collapse-icon {
    margin-left: auto;
    display: flex;
    align-items: center;
    color: var(--warm-gray);
    opacity: 0.5;
    transition: transform 0.25s ease, opacity 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.category-header:hover .category-collapse-icon {
    opacity: 0.85;
    color: var(--charcoal);
}

.category-collapse-icon svg {
    width: 14px;
    height: 14px;
}

.collapsed .category-collapse-icon {
    transform: rotate(-180deg);
    opacity: 0.7;
}

/* Move category-count margin-left:auto only when no collapse icon */
.category-header:has(.category-collapse-icon) .category-count {
    margin-left: 0;
}

.category-tasks:empty {
    min-height: 40px;
    position: relative;
}

.category-tasks:empty::after {
    content: 'Drop tasks here';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stone);
    font-size: 0.875rem;
    font-style: italic;
}

/* Uncategorized section styling */
#categories-container > .category-tasks {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: visible;
}

#categories-container > .category-tasks:empty {
    display: none;
}

/* Category ghost state for dragging */
.category-ghost {
    opacity: 0.5;
    background: var(--sand);
}

/* Hide the sticky backdrop shadow on the header while dragging a category */
.category-section.sortable-drag .category-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-sortable {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Task inline category selector */
.task-category-dropdown {
    flex-shrink: 0;
    min-width: 0;
}

/* Daily page task actions container */
.task-actions-daily {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.task-category-dropdown .dropdown-trigger {
    padding: 0.25rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--stone);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 28px;
    height: 24px;
}

.task-category-dropdown .dropdown-trigger:hover {
    background: var(--cream);
    border-color: var(--sand);
}

.task-category-dropdown.open .dropdown-trigger {
    border-color: var(--accent);
    background: white;
    color: var(--accent);
}

.task-category-dropdown .category-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-category-dropdown .category-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.task-category-dropdown .dropdown-menu {
    min-width: 150px;
    right: 0;
    left: auto;
}

.task-item.completed .task-category-dropdown {
    opacity: 0.6;
}

.task-item.completed .task-category-dropdown.open {
    opacity: 1;
}

/* Ensure dropdown doesn't get clipped in completed tasks */
.task-item.completed {
    position: relative;
    z-index: 1;
}

.task-item.completed.has-open-dropdown {
    z-index: 100;
    overflow: visible;
}

/* Hide old task-category-select if it exists */
.task-category-select {
    display: none;
}

/* Onboarding animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Onboarding pages */
.onboarding-page {
    background: linear-gradient(145deg, var(--accent-light) 0%, var(--accent) 50%, var(--accent-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.8s ease;
}

.onboarding-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: 700px;
}

.onboarding-nav-left,
.onboarding-nav-right {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    animation: fadeIn 0.8s ease 1.6s both;
}

.onboarding-nav-left:hover,
.onboarding-nav-right:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.onboarding-nav-left svg,
.onboarding-nav-right svg {
    width: 28px;
    height: 28px;
}

.onboarding-nav-left:not([href]),
.onboarding-nav-right:not([href]) {
    visibility: hidden;
}

.onboarding-main {
    flex: 1;
    max-width: 480px;
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    animation: fadeIn 0.8s ease 0.3s both;
}

.onboarding-progress .step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-progress .step.active {
    background: white;
    color: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

.onboarding-progress .step.done {
    background: rgba(255, 255, 255, 0.5);
    color: white;
}

.onboarding-content {
    text-align: center;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.onboarding-content h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.125rem;
    letter-spacing: -0.5px;
}

.onboarding-content .tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.onboarding-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    text-align: left;
    animation: scaleIn 0.8s ease 0.6s both;
}

.onboarding-card h2 {
    font-size: 1rem;
    color: var(--charcoal);
    margin-bottom: 0.375rem;
    font-weight: 700;
}

.onboarding-card p {
    color: var(--bark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.onboarding-card .hint {
    color: var(--warm-gray);
    font-size: 0.8125rem;
    margin-bottom: 0;
    text-align: center;
}

/* Workflow steps */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0.5rem 0;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    animation: slideInLeft 0.6s ease both;
}

.workflow-step:nth-child(1) { animation-delay: 0.8s; }
.workflow-step:nth-child(2) { animation-delay: 1.0s; }
.workflow-step:nth-child(3) { animation-delay: 1.2s; }
.workflow-step:nth-child(4) { animation-delay: 1.4s; }

.workflow-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    flex-shrink: 0;
}

.workflow-text {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.workflow-text strong {
    color: var(--charcoal);
    font-size: 0.8125rem;
}

.workflow-text span {
    color: var(--warm-gray);
    font-size: 0.75rem;
}

/* Key points */
.key-points {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0.5rem 0;
}

.key-point {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.point-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--sand);
    color: var(--bark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.625rem;
    flex-shrink: 0;
}

.key-point span {
    color: var(--bark);
    font-size: 0.8125rem;
    line-height: 1.3;
}

/* Decision grid */
.decision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.decision-card {
    padding: 0.625rem;
    border-radius: var(--radius);
    text-align: center;
}

.decision-card.today {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 2px solid var(--accent);
}

.decision-card.later {
    background: var(--sand);
    border: 2px solid var(--stone);
}

.decision-label {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.decision-card.today .decision-label {
    color: var(--accent);
}

.decision-card.later .decision-label {
    color: var(--bark);
}

.decision-card p {
    font-size: 0.75rem;
    margin-bottom: 0;
    color: var(--bark);
    line-height: 1.3;
}

/* Routine steps preview (onboarding step 3) */
.routine-steps-preview {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0.5rem 0;
}

.routine-step-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    animation: slideInLeft 0.6s ease both;
}

.routine-step-item:nth-child(1) { animation-delay: 0.8s; }
.routine-step-item:nth-child(2) { animation-delay: 1.0s; }
.routine-step-item:nth-child(3) { animation-delay: 1.2s; }
.routine-step-item:nth-child(4) { animation-delay: 1.4s; }

.routine-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6875rem;
    flex-shrink: 0;
}

.routine-step-detail {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.routine-step-detail strong {
    color: var(--charcoal);
    font-size: 0.8125rem;
}

.routine-step-detail span {
    color: var(--warm-gray);
    font-size: 0.75rem;
}

/* Safety net callout */
.safety-net-callout {
    background: color-mix(in srgb, var(--success) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin: 0.625rem 0;
    font-size: 0.8125rem;
    color: var(--bark);
    line-height: 1.4;
}

/* Daily list preview (onboarding step 3) */
.daily-preview {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 0.625rem 0.75rem;
    margin-top: 0.375rem;
}

.daily-preview-progress {
    height: 6px;
    background: var(--sand);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.daily-preview-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--success-light) 100%);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.daily-preview-label {
    font-size: 0.6875rem;
    color: var(--warm-gray);
    margin-bottom: 0.375rem;
}

.daily-preview-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.daily-preview-task {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--charcoal);
}

.daily-preview-task.completed {
    color: var(--warm-gray);
    text-decoration: line-through;
}

.daily-preview-check {
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 700;
    width: 16px;
    text-align: center;
}

.daily-preview-circle {
    width: 12px;
    height: 12px;
    border: 2px solid var(--stone);
    border-radius: 50%;
    margin-left: 2px;
}

/* Routine transition hint (onboarding step 4) */
.routine-transition-hint {
    font-size: 0.8125rem;
    color: var(--warm-gray);
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Onboarding illustrations */
.onboarding-illustration {
    margin: 0.5rem 0;
    display: flex;
    justify-content: center;
}

.intray-demo {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 0.5rem;
    width: 220px;
    box-shadow: var(--shadow);
}

.demo-header {
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
}

.demo-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.demo-item {
    background: white;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--charcoal);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.demo-item.typing {
    color: var(--warm-gray);
    border: 1px dashed var(--stone);
    background: transparent;
}

.routine-demo {
    background: white;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    width: 260px;
    box-shadow: var(--shadow);
}

.demo-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.task-text {
    font-size: 0.8125rem;
    color: var(--charcoal);
}

.task-choices {
    display: flex;
    gap: 0.375rem;
}

.choice-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.choice-btn.today {
    background: var(--accent);
    color: white;
}

.choice-btn.later {
    background: var(--sand);
    color: var(--bark);
}

/* First task form */
.first-task-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.first-task-input {
    padding: 1rem 1.25rem;
    border: 2px solid var(--sand);
    border-radius: var(--radius);
    font-size: 1.125rem;
    background: white;
    transition: all 0.2s;
}

.first-task-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.first-task-input::placeholder {
    color: var(--warm-gray);
}

/* Onboarding actions */
.onboarding-actions {
    display: none; /* Replaced by side navigation */
}

.btn-secondary {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Onboarding task input */
.onboarding-task-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.onboarding-task-input .first-task-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
}

.onboarding-task-input .btn-add-task {
    padding: 0.625rem 1rem;
}

/* Onboarding task list */
.onboarding-task-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    max-height: 140px;
    overflow-y: auto;
}

.onboarding-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.625rem;
    background: var(--cream);
    border-radius: var(--radius);
    gap: 0.75rem;
}

.onboarding-task-item .task-title {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--charcoal);
}

.btn-remove-task {
    background: transparent;
    border: none;
    color: var(--warm-gray);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-remove-task:hover {
    color: var(--danger);
    background: rgba(209, 96, 94, 0.1);
}

/* Onboarding start actions */
.onboarding-start-actions {
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--sand);
    margin-top: 0.5rem;
}

.onboarding-start-actions .btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* Skip button */
.btn-skip {
    display: inline-block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    margin-top: 0.75rem;
    transition: all 0.2s;
}

.btn-skip:hover {
    color: white;
    text-decoration: underline;
}

/* Routine prompt banner */
.routine-prompt-banner {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-md);
}

.routine-prompt-banner p {
    margin: 0;
    font-weight: 500;
}

.routine-prompt-banner .btn-start-routine {
    background: white;
    color: var(--accent);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.routine-prompt-banner .btn-start-routine:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 640px) {
    .onboarding-main {
        padding: 1.5rem 1rem;
    }

    .onboarding-content h1 {
        font-size: 1.75rem;
    }

    .onboarding-content .tagline {
        font-size: 1rem;
    }

    .onboarding-card {
        padding: 1.25rem;
    }

    .onboarding-card h2 {
        font-size: 1.125rem;
    }

    .workflow-steps {
        gap: 1rem;
    }

    .workflow-step {
        gap: 0.75rem;
    }

    .workflow-icon {
        min-width: 32px;
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .workflow-text strong {
        font-size: 0.9375rem;
    }

    .workflow-text span {
        font-size: 0.8125rem;
    }

    .decision-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .decision-option {
        padding: 1rem;
    }

    .routine-steps-preview {
        gap: 0.5rem;
    }

    .routine-step-item {
        gap: 0.75rem;
    }

    .routine-step-num {
        min-width: 28px;
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }

    .routine-step-detail strong {
        font-size: 0.875rem;
    }

    .routine-step-detail span {
        font-size: 0.8125rem;
    }

    .routine-step-detail {
        flex-direction: column;
        gap: 0;
    }

    .intray-demo,
    .routine-demo {
        width: 100%;
    }

    .demo-task {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .onboarding-layout {
        flex-direction: column;
        gap: 0.75rem;
    }

    .onboarding-nav-left,
    .onboarding-nav-right {
        width: 48px;
        height: 48px;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    .onboarding-nav-left {
        left: 0.5rem;
    }

    .onboarding-nav-right {
        right: 0.5rem;
    }

    .onboarding-progress {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .onboarding-progress .step {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .onboarding-task-input {
        flex-direction: column;
    }

    .routine-prompt-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* Empty routine prompt */
.empty-routine-prompt {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-routine-prompt .empty-icon {
    color: var(--stone);
    margin-bottom: 1.5rem;
}

.empty-routine-prompt h2 {
    font-size: 1.5rem;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
}

.empty-routine-prompt .routine-description {
    max-width: 400px;
    margin: 0 auto 2rem;
}

/* Processed Tasks - Enhanced UX */
#processed-tasks {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2.5rem;
    box-shadow: var(--shadow);
    border: 2px dashed var(--sand);
}

#processed-tasks h3 {
    font-size: 0.75rem;
    color: var(--warm-gray);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#processed-tasks h3::before {
    content: '✓';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--sand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
}

#processed-list .task-item {
    animation: slideInFromRight 0.3s ease-out;
    background: var(--cream);
    border: 1px solid var(--sand);
    margin-bottom: 0.625rem;
    transition: all 0.2s ease;
}

#processed-list .task-item:hover {
    background: white;
    box-shadow: var(--shadow);
    transform: translateX(2px);
}

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

/* Action badges - shows current state */
.processed-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.75rem;
    white-space: nowrap;
}

.processed-action-badge.action-complete {
    background: rgba(109, 180, 119, 0.15);
    color: var(--success);
}

.processed-action-badge.action-today {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
}

.processed-action-badge.action-later {
    background: rgba(168, 159, 148, 0.15);
    color: var(--warm-gray);
}

.processed-action-badge.action-drop {
    background: rgba(168, 159, 148, 0.1);
    color: var(--stone);
}

.processed-action-badge .action-icon {
    font-size: 0.875rem;
    line-height: 1;
}

/* Step origin badge */
.step-origin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    opacity: 0.6;
    background: var(--sand);
    color: var(--bark);
}

/* Processed task layout */
#processed-list .task-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
}

#processed-list .task-status {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#processed-list .task-title {
    flex: 1;
    font-size: 0.875rem;
    color: var(--bark);
    min-width: 0;
}

#processed-list .task-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Revision buttons - smaller, more subtle */
#processed-list .btn-action {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

#processed-list .btn-action:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* Button styling remains but gets more subtle in processed list */
#processed-list .btn-success {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
    border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}

#processed-list .btn-success:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

#processed-list .btn-daily {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

#processed-list .btn-daily:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

#processed-list .btn-tasks {
    background: rgba(168, 159, 148, 0.12);
    color: var(--warm-gray);
    border: 1px solid rgba(168, 159, 148, 0.3);
}

#processed-list .btn-tasks:hover {
    background: var(--warm-gray);
    color: white;
    border-color: var(--warm-gray);
}

#processed-list .btn-drop {
    background: rgba(168, 159, 148, 0.08);
    color: var(--stone);
    border: 1px solid rgba(168, 159, 148, 0.25);
}

#processed-list .btn-drop:hover {
    background: var(--stone);
    color: white;
    border-color: var(--stone);
}

/* Empty state for processed */
#processed-list:empty::after {
    content: 'Tasks you process will appear here';
    display: block;
    text-align: center;
    color: var(--stone);
    font-size: 0.875rem;
    padding: 2rem;
    font-style: italic;
}

/* Category groups in routine */
.routine-content .category-group {
    margin-bottom: 0.5rem;
}

.routine-content .category-group.collapsed {
    margin-bottom: 0;
}

.routine-content .category-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    background: var(--sand);
    border-radius: 6px;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid currentColor;
    position: sticky;
    top: 80px;
    z-index: 10;
    box-shadow: 0 -1.25rem 0 0 var(--cream), 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    user-select: none;
}


.routine-content .category-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.routine-content .category-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: 0.01em;
}

.routine-content .category-count {
    font-size: 0.6875rem;
    color: var(--stone);
    margin-left: auto;
}

/* Compact routine task items */
#cleanup-tasks .task-item,
#intray-review-tasks .task-item,
#tasks-review .task-item {
    padding: 0.375rem 0.625rem;
    gap: 0.5rem;
    font-size: 0.875rem;
}

#cleanup-tasks .task-title,
#intray-review-tasks .task-title,
#tasks-review .task-title {
    font-size: 0.875rem;
    margin-left: 0;
}

/* Compact action buttons in routine */
#cleanup-tasks .task-actions,
#intray-review-tasks .task-actions,
#tasks-review .task-actions {
    justify-content: flex-end;
}

#cleanup-tasks .btn-action,
#intray-review-tasks .btn-action,
#tasks-review .btn-action {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    min-height: 0;
}

/* Compact processed tasks section */
#processed-tasks {
    margin-top: 1rem !important;
}

#processed-tasks .task-item {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
}

#processed-tasks .task-title {
    font-size: 0.875rem;
}

#processed-tasks .btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ============================================
   Landing Page
   ============================================ */

.landing-body {
    max-width: 100%;
    padding: 0;
}

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--sand);
}

.landing-nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.landing-nav-signin {
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.landing-nav-signin:hover {
    background: var(--accent-dark);
}

/* Hero */
.landing-hero {
    max-width: 1060px;
    margin: 0 auto;
    padding: 4rem 2rem 4rem;
    display: flex;
    align-items: center;
    gap: 3rem;
    background: radial-gradient(ellipse 60% 80% at 75% 50%, rgba(94, 106, 210, 0.06), transparent 70%);
}

.landing-hero-text {
    flex: 1;
    min-width: 0;
}

.landing-hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--charcoal);
    letter-spacing: -0.5px;
    margin-bottom: 1.25rem;
    text-align: left;
}

.landing-hero-tagline {
    font-size: 1.2rem;
    color: var(--bark);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    text-align: left;
}

.landing-cta-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.15s ease;
}

.landing-cta-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* Problem */
.landing-problem {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.landing-problem h2,
.landing-steps h2,
.landing-features h2,
.landing-cta-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--charcoal);
    margin-bottom: 2.5rem;
}

.landing-problem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.landing-problem-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.landing-problem-icon {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-problem-card p {
    color: var(--bark);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Steps */
.landing-steps {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.landing-steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
}

.landing-step {
    flex: 1;
    max-width: 240px;
    text-align: center;
}

.landing-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.landing-step h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.landing-step p {
    color: var(--bark);
    font-size: 0.9rem;
    line-height: 1.6;
}

.landing-step-arrow {
    font-size: 1.5rem;
    color: var(--stone);
    margin-top: 0.5rem;
    flex-shrink: 0;
}

/* Features */
.landing-features {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.landing-feature-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.landing-feature-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.landing-feature-card p {
    color: var(--bark);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* CTA Section */
.landing-cta-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.landing-cta-section p {
    color: var(--bark);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}


/* Footer */
.landing-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--sand);
    color: var(--warm-gray);
    font-size: 0.875rem;
}

.landing-footer a {
    color: var(--warm-gray);
    text-decoration: none;
    transition: color 0.15s;
}

.landing-footer a:hover {
    color: var(--charcoal);
}

/* Legal pages */
.legal-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.legal-page h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
}

.legal-effective {
    color: var(--warm-gray);
    font-size: 0.875rem;
    margin-bottom: 2.5rem;
}

.legal-page h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-page p {
    color: var(--bark);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-page ul {
    color: var(--bark);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.legal-page li {
    margin-bottom: 0.25rem;
}

/* Login legal links */
.login-legal-links {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.login-legal-links a {
    color: var(--warm-gray);
    text-decoration: none;
    transition: color 0.15s;
}

.login-legal-links a:hover {
    color: var(--charcoal);
}

/* Landing page responsive */
@media (max-width: 768px) {
    .landing-hero {
        flex-direction: column;
        padding: 3rem 1.25rem 2.5rem;
        text-align: center;
        background: none;
    }

    .landing-hero-text {
        text-align: center;
    }

    .landing-hero h1 {
        font-size: 1.875rem;
        text-align: center;
    }

    .landing-hero-tagline {
        font-size: 1.05rem;
        text-align: center;
    }

    .landing-problem-grid {
        grid-template-columns: 1fr;
    }

    .landing-steps-grid {
        flex-direction: column;
        align-items: center;
    }

    .landing-step-arrow {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }

    .landing-features-grid {
        grid-template-columns: 1fr;
    }

}
