/* ================================================================
   DESIGN SYSTEM — Unmoth-inspired brutalist minimalist
   Palette: near-black bg, white type, muted grey secondary, subtle accent
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Tokens ── */
:root {
    --bg-primary:    #08090a;
    --bg-surface:    #111213;
    --bg-elevated:   #161718;
    --bg-hover:      #1e1f21;

    --border-subtle: #1e1f20;
    --border-default:#2a2b2c;
    --border-hover:  #3a3b3c;

    --text-primary:  #f0f0f0;
    --text-secondary:#b0b1b3;
    --text-muted:    #808183;
    --text-ghost:    #606163;

    --accent:        #6ee7a0;
    --accent-dim:    #5cc98a;
    --accent-glow:   rgba(110, 231, 160, 0.08);
    --accent-ghost:  rgba(110, 231, 160, 0.04);

    --danger:        #ff4444;
    --danger-dim:    rgba(255, 68, 68, 0.1);

    --font-body:     'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:  'Space Grotesk', 'Geist', sans-serif;

    --radius-sm:     4px;
    --radius-md:     8px;
    --radius-lg:     12px;

    --transition:    150ms ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ── Layout ── */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 0 48px;
    }
}

/* ── Header ── */
.site-header {
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.logo-mark {
    width: 28px;
    height: 28px;
    background: var(--text-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-mark i {
    width: 16px;
    height: 16px;
    color: var(--bg-primary);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* ── Nav Tabs ── */
.nav-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color var(--transition);
    position: relative;
}

.nav-tab i {
    width: 15px;
    height: 15px;
}

.nav-tab:hover {
    color: var(--text-secondary);
}

.nav-tab.active {
    color: var(--text-primary);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 16px;
    right: 16px;
    height: 1px;
    background: var(--text-primary);
}

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

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: color var(--transition), background var(--transition);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.icon-btn i {
    width: 18px;
    height: 18px;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.view-home {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0 60px;
    gap: 48px;
    min-height: calc(100vh - 56px - 48px);
    width: 100%;
}

.view-home.hidden {
    display: none;
}

/* Desktop absolute top-right scratchpad */
@media (min-width: 1025px) {
    .home-scratchpad-wrapper {
        position: absolute;
        top: 24px;
        right: 32px;
        width: 280px;
        margin: 0;
        z-index: 10;
    }
}

/* Mobile responsive fallback: stack normally */
@media (max-width: 1024px) {
    .home-scratchpad-wrapper {
        width: 100%;
        max-width: 720px;
        margin-top: 16px;
    }
}

/* ── Clock Section ── */
.clock-section {
    text-align: center;
}

.clock-display {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1;
    display: inline-flex;
    position: relative;
    justify-content: center;
    align-items: baseline;
}

.clock-display .ampm {
    position: absolute;
    left: calc(100% + 4px);
    bottom: 0.45em;
    font-size: 0.3em;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.date-display {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 12px;
}

.greeting-display {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ── Search Bar ── */
.search-wrapper {
    width: 100%;
    max-width: 600px;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-engine-toggle {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    transition: border-color var(--transition);
    z-index: 2;
}

.search-engine-toggle:hover {
    border-color: var(--border-hover);
}

.search-engine-toggle .chevron {
    width: 12px;
    height: 12px;
    color: var(--text-ghost);
}

.search-input {
    width: 100%;
    padding: 14px 48px 14px 80px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    transition: border-color var(--transition);
}

.search-input::placeholder {
    color: var(--text-ghost);
}

.search-input:focus {
    border-color: var(--border-hover);
}

.search-submit {
    position: absolute;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color var(--transition);
}

.search-submit:hover {
    color: var(--text-primary);
}

.search-submit i {
    width: 18px;
    height: 18px;
}

/* ── Engine Dropdown ── */
.engine-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 14px;
    width: 180px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 4px;
    z-index: 20;
    animation: dropIn 120ms ease-out;
}

.engine-dropdown.hidden {
    display: none;
}

.engine-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    text-align: left;
}

.engine-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.engine-option .engine-letter {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    width: 20px;
    text-align: center;
    color: var(--text-primary);
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.quick-links-section {
    width: 100%;
    max-width: 720px;
}

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

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-ghost);
}

.section-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: opacity var(--transition);
}

.section-action:hover {
    opacity: 0.8;
}

.section-action i {
    width: 13px;
    height: 13px;
}

/* ── Quick Link Cards ── */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (min-width: 480px) {
    .quick-links-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.quick-link-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.quick-link-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.quick-link-card:hover .ql-icon {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.quick-link-card:hover .ql-label {
    color: var(--text-primary);
}

.ql-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color var(--transition), border-color var(--transition);
}

.ql-icon i {
    width: 17px;
    height: 17px;
}

.ql-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: color var(--transition);
}

.ql-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-ghost);
    transition: opacity var(--transition), color var(--transition), background var(--transition);
}

.quick-link-card:hover .ql-delete {
    opacity: 1;
}

.ql-delete:hover {
    color: var(--danger);
    background: var(--danger-dim);
}

.ql-delete i {
    width: 12px;
    height: 12px;
}

/* ── Tracker View ── */
.view-tracker {
    padding: 16px 0 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.view-tracker.hidden {
    display: none;
}

/* ── Tracker Header ── */
.tracker-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    margin-bottom: 4px;
}

.tracker-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tracker-title h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.tracker-title i {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.tracker-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tracker-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn i {
    width: 14px;
    height: 14px;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #d4d4d4;
}

.btn-danger-outline {
    border: 1px solid rgba(255, 68, 68, 0.2);
    color: #ff6b6b;
    background: transparent;
}

.btn-danger-outline:hover {
    border-color: rgba(255, 68, 68, 0.4);
    background: var(--danger-dim);
}

.btn-ghost {
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

/* ── KPI Grid ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kpi-card {
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.kpi-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-ghost);
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: -0.02em;
}

.kpi-value.green  { color: var(--text-primary); }
.kpi-value.white  { color: var(--text-primary); }
.kpi-value.muted  { color: var(--text-secondary); }

.kpi-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-ghost);
}

.kpi-sub i {
    width: 12px;
    height: 12px;
}

.kpi-watermark {
    position: absolute;
    right: -8px;
    bottom: -8px;
    opacity: 0.03;
    color: var(--text-primary);
}

.kpi-watermark i {
    width: 72px;
    height: 72px;
}

.sweeps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 768px) {
    .sweeps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Sweep Card (compact row) ── */
.sweep-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--transition);
}

.sweep-card:hover {
    border-color: var(--border-hover);
}

.sweep-card.claimed {
    opacity: 0.5;
}

.sweep-card.claimed:hover {
    border-color: var(--border-subtle);
}

.sweep-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    color: var(--bg-primary);
    background: var(--text-secondary);
    transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

a.sweep-avatar:hover {
    transform: scale(1.08);
    background: var(--text-primary);
}

.sweep-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.sweep-info a {
    display: inline-flex;
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
}

.sweep-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition);
}

.sweep-info a:hover h4 {
    color: var(--accent);
}

.sweep-value-amount {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.sweep-status {
    flex-shrink: 0;
}

/* ── Status Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge i {
    width: 10px;
    height: 10px;
}

.badge-ready {
    background: var(--accent-ghost);
    border: 1px solid rgba(110, 231, 160, 0.12);
    color: var(--text-secondary);
}

.badge-ready .pulse-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-glow 2s ease-in-out infinite;
}
.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse-glow 2s ease-in-out infinite;
    display: inline-block;
}

.badge-locked {
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-ghost);
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Sweep Claim Button (inline) ── */
.btn-claim {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition);
}

.btn-claim:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

.btn-claim i {
    width: 12px;
    height: 12px;
}

.btn-claim.claimed {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-ghost);
    cursor: pointer;
}

.btn-claim.claimed:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.sweep-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.sweep-edit, .sweep-delete, .sweep-reset {
    opacity: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-ghost);
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition), color var(--transition), background var(--transition);
}

.sweep-card:hover .sweep-edit,
.sweep-card:hover .sweep-delete,
.sweep-card:hover .sweep-reset {
    opacity: 1;
}

.sweep-edit:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sweep-delete:hover {
    color: var(--danger);
    background: var(--danger-dim);
}

.sweep-reset:hover {
    color: var(--accent);
    background: var(--accent-ghost);
}

.sweep-edit i, .sweep-delete i, .sweep-reset i {
    width: 12px;
    height: 12px;
}

/* ── Modal Tabs ── */
.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.modal-tab {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
}

.modal-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.modal-tab.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.hidden {
    display: none !important;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 16px 0;
}

.footer-inner {
    text-align: center;
    font-size: 11px;
    color: var(--text-ghost);
    line-height: 1.6;
}

/* ── Modals ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.75);
}

.modal-overlay.open {
    display: flex;
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-ghost);
    transition: color var(--transition), background var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.modal-close i {
    width: 16px;
    height: 16px;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.modal-title i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* ── Form Elements ── */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-ghost);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color var(--transition);
}

.form-input::placeholder {
    color: var(--text-ghost);
}

.form-input:focus {
    border-color: var(--border-hover);
}

.form-hint {
    font-size: 10px;
    color: var(--text-ghost);
    margin-top: 4px;
}

.form-hint a {
    color: var(--text-secondary);
}

.form-hint a:hover {
    text-decoration: underline;
}

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

.form-input-prefix {
    position: relative;
}

.form-input-prefix .prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--text-ghost);
    font-size: 14px;
}

.form-input-prefix .form-input {
    padding-left: 28px;
}

.form-submit {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: var(--text-primary);
    color: var(--bg-primary);
    transition: background var(--transition);
}

.form-submit:hover {
    background: #d4d4d4;
}

/* ── Settings-specific ── */
.settings-row {
    display: flex;
    gap: 8px;
}

/* ── Calendar Widget ── */
.calendar-section {
    width: 100%;
    animation: fadeIn 300ms ease-out;
}

.calendar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-ghost);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.calendar-day-cell {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: default;
    transition: background var(--transition), color var(--transition);
}

.calendar-day-cell.today {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
    box-shadow: 0 0 10px var(--accent-glow);
}

.calendar-day-cell.other-month {
    color: var(--text-ghost);
    opacity: 0.4;
}

.calendar-day-cell:hover:not(.today):not(.other-month) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-apply {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.settings-apply:hover {
    background: #d4d4d4;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 18px 0;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.preset-thumb {
    height: 36px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-subtle);
    transition: border-color var(--transition);
    cursor: pointer;
}

.preset-thumb:hover {
    border-color: var(--border-hover);
}

.preset-reset {
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-ghost);
    transition: border-color var(--transition), color var(--transition);
    cursor: pointer;
}

.preset-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.storage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.storage-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.storage-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.storage-sub {
    font-size: 10px;
    color: var(--text-ghost);
}

.storage-actions {
    display: flex;
    gap: 6px;
}

.storage-btn {
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.storage-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* ── Transitions ── */
.fade-in {
    animation: fadeIn 300ms ease-out;
}

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

/* ── Background overlay (for custom bg feature) ── */
.bg-overlay {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0;
    transition: opacity 500ms ease;
}

/* ── Upgrades: Color Themes, Search Suggestions, Scratchpad, Resets Timeline ── */

/* Theme Presets buttons styles */
.theme-preset-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
    padding: 0;
    margin: 0;
    display: inline-block;
}
.theme-preset-btn:hover {
    transform: scale(1.1);
}
.theme-preset-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
    box-shadow: 0 0 8px var(--accent);
}

/* Autocomplete Suggestions drop-down list */
.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    padding: 6px 0;
}
.suggestion-item {
    width: 100%;
    border: none;
    background: none;
    padding: 10px 16px;
    font-size: 13px;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 150ms ease, color 150ms ease;
}
.suggestion-item:hover, .suggestion-item.active {
    background: var(--bg-hover);
    color: var(--accent);
}

/* Homepage Scratchpad notes */
.scratchpad-section {
    margin-top: 24px;
    animation: fadeIn 300ms ease-out;
}
.scratchpad-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.scratchpad-card:focus-within {
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
}
.scratchpad-textarea {
    width: 100%;
    height: 120px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

/* Upcoming Resets Timeline Bar */
.resets-timeline-section {
    margin: 8px 0 24px 0;
    width: 100%;
    animation: fadeIn 300ms ease-out;
}

.timeline-bar-wrapper {
    position: relative;
    padding: 12px 0 20px 0;
    width: 100%;
}

.timeline-track {
    height: 6px;
    background: linear-gradient(to right, rgba(110, 231, 160, 0.12) 0%, rgba(110, 231, 160, 0.12) 15%, var(--bg-elevated) 15%, var(--bg-elevated) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    position: relative;
}

.timeline-labels {
    position: relative;
    margin-top: 8px;
    height: 12px;
    width: 100%;
}

.timeline-label-tick {
    position: absolute;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    color: var(--text-ghost);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Timeline marker representation */
.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
    z-index: 10;
}

.timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.25);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 50;
}

.timeline-marker img {
    width: 12px;
    height: 12px;
    object-fit: contain;
    border-radius: 2px;
}

.timeline-marker .marker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.timeline-marker.ready {
    border-color: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

.timeline-marker.ready::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: 0.4;
    animation: markerPulse 2s infinite ease-out;
}

@keyframes markerPulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Tooltip popup styling */
.timeline-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease, transform 150ms ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
}

.timeline-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--border-default) transparent transparent transparent;
}

.timeline-marker:hover .timeline-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}



