/* =====================================================
   Taia · Glassmorphism Dark Theme
   ===================================================== */

:root {
    --bg-deep:        #090d16;
    --bg-base:        #0d1117;
    --glass-bg:       rgba(255, 255, 255, 0.03);
    --glass-border:   rgba(255, 255, 255, 0.08);
    --glass-shadow:   0 8px 32px rgba(0, 0, 0, 0.37);
    --txt-primary:    #e6edf3;
    --txt-muted:      #9ba9b8;
    --txt-dim:        #6e7681;
    --accent-cyan:    #7ee8fa;
    --accent-purple:  #b794f6;
    --accent-pink:    #f687b3;
    --accent-green:   #68d391;
    --accent-red:     #fc8181;
    --accent-orange:  #f6ad55;
    --radius-lg:      16px;
    --radius-md:      12px;
    --radius-sm:      8px;
    --gap:            16px;
    --gap-lg:         24px;
    --transition:     220ms cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', 'BPG Arial', system-ui, -apple-system, sans-serif;
    color: var(--txt-primary);
    background: var(--bg-base);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(ellipse at top left,  rgba(126,232,250,0.10), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(183,148,246,0.08), transparent 50%),
        linear-gradient(180deg, var(--bg-deep), var(--bg-base));
    background-attachment: fixed;
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== Floating background orbs ========== */
.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.orb {
    position: absolute;
    width: 480px; height: 480px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: float 18s ease-in-out infinite;
}
.orb-cyan   { background: #2563eb; top: -120px; left: -160px; }
.orb-purple { background: #7c3aed; bottom: -180px; right: -140px; animation-delay: -6s; }
.orb-pink   { background: #db2777; top: 40%; right: 30%; opacity: 0.15; animation-delay: -12s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(40px, -30px) scale(1.08); }
}

/* ========== Glass card primitive ========== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 1;
}
.pad   { padding: var(--gap-lg); }
.mt    { margin-top: var(--gap); }

/* ========== Brand ========== */
.brand {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    background: linear-gradient(120deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand.small { font-size: 20px; }
.brand-dot {
    color: var(--accent-pink);
    -webkit-text-fill-color: var(--accent-pink);
}

/* ========== Typography ========== */
.muted { color: var(--txt-muted); }
.small { font-size: 13px; }
.section-title {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--txt-primary);
    letter-spacing: 0.3px;
}

/* ========== Login page ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-card { padding: 36px; }
.login-card .brand { text-align: center; }
.login-card .muted { text-align: center; margin: 4px 0 24px 0; }

/* ========== Topbar ========== */
.topbar {
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding: 14px 22px;
    margin: 20px;
    border-radius: var(--radius-lg);
}
.topnav {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    flex: 1;
    overflow-x: auto;
}
.tab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--txt-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.tab:hover {
    color: var(--txt-primary);
    background: rgba(255, 255, 255, 0.04);
}
.tab.active {
    color: var(--accent-cyan);
    background: rgba(126, 232, 250, 0.08);
    border-color: rgba(126, 232, 250, 0.18);
    box-shadow: 0 0 18px rgba(126, 232, 250, 0.12);
}
.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========== Layout ========== */
.layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: var(--gap-lg);
    padding: 0 20px 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}
.col-left  { display: flex; flex-direction: column; gap: var(--gap); }
.col-right { display: flex; flex-direction: column; gap: var(--gap); }

/* ========== Forms ========== */
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 120px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field > span { color: var(--txt-muted); letter-spacing: 0.3px; }

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 8px 0;
    font-size: 13px;
    color: var(--txt-muted);
    cursor: pointer;
    user-select: none;
}
.remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent, #58a6ff);
    cursor: pointer;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.25);
    color: var(--txt-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}
input[type="color"] {
    width: 48px; height: 38px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(126, 232, 250, 0.12);
}

.channels { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.channels legend { color: var(--txt-muted); font-size: 13px; padding: 0 0 6px 0; }
.check {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--txt-primary);
    cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent-cyan); }

.row-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.row-form input[type="text"] { flex: 1; min-width: 140px; }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #0d1117;
    font-weight: 600;
    border: 0;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(126, 232, 250, 0.25);
}

.btn-secondary {
    background: rgba(183, 148, 246, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(183, 148, 246, 0.25);
}
.btn-secondary:hover {
    background: rgba(183, 148, 246, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--txt-muted);
    border: 1px solid var(--glass-border);
}
.btn-ghost:hover { color: var(--txt-primary); background: rgba(255, 255, 255, 0.04); }

.btn-danger {
    background: rgba(252, 129, 129, 0.10);
    color: var(--accent-red);
    border: 1px solid rgba(252, 129, 129, 0.25);
}
.btn-danger:hover { background: rgba(252, 129, 129, 0.18); }

/* ========== Alerts ========== */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin: 0 0 16px 0;
    font-size: 14px;
}
.alert-error { background: rgba(252, 129, 129, 0.10); color: var(--accent-red); border: 1px solid rgba(252,129,129,0.25); }

/* ========== Tabs / Panels ========== */
.tab-panel { display: none; animation: fadeIn 240ms ease; }
.tab-panel.active { display: block; }

/* ---- Quick-add inner tabs (reminder / idea) ---- */
.quick-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--glass-border);
}
.quick-tab {
    flex: 1;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: var(--txt-muted);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.quick-tab:hover {
    color: var(--txt-primary);
    background: rgba(255, 255, 255, 0.05);
}
.quick-tab.active {
    color: var(--accent-cyan);
    background: color-mix(in srgb, var(--accent-cyan) 12%, transparent);
    border-color: color-mix(in srgb, var(--accent-cyan) 45%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent-cyan) 20%, transparent);
}
.quick-tab[data-quick-tab="idea"].active {
    color: var(--accent-purple);
    background: color-mix(in srgb, var(--accent-purple) 12%, transparent);
    border-color: color-mix(in srgb, var(--accent-purple) 45%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent-purple) 20%, transparent);
}
.quick-panel { display: none; animation: fadeIn 240ms ease; }
.quick-panel.active { display: block; }

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

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

/* ========== Cards lists ========== */
.cards-list { display: flex; flex-direction: column; gap: 12px; }

.date-group-header {
    width: 100%;
    display: flex; align-items: center; gap: 9px;
    font-size: 13px; font-weight: 600;
    font-family: inherit;
    color: var(--accent-cyan);
    text-align: left;
    cursor: pointer;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    user-select: none;
    transition: var(--transition);
}
.date-group-header:hover {
    background: color-mix(in srgb, var(--accent-cyan) 9%, transparent);
    border-color: color-mix(in srgb, var(--accent-cyan) 35%, transparent);
}
.date-group-header .chevron {
    font-size: 11px;
    transition: transform 180ms ease;
    flex-shrink: 0;
}
.date-group-header.expanded .chevron { transform: rotate(90deg); }
.date-group-header .date-label { color: var(--txt-primary); }
.date-group-header .count-badge {
    margin-left: auto;
    min-width: 22px;
    text-align: center;
    font-size: 12px;
    padding: 1px 8px;
    border-radius: 999px;
    color: var(--accent-cyan);
    background: color-mix(in srgb, var(--accent-cyan) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-cyan) 35%, transparent);
}
.date-group-header .today-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    color: var(--bg-deep);
    background: var(--accent-cyan);
}
.date-group-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---- Completed (done) events ---- */
.done-divider {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; font-weight: 600;
    color: var(--accent-green);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.done-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent-green) 24%, transparent), transparent);
}
.reminder-card.done {
    background: rgba(255, 255, 255, 0.012);
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.06);
}
.reminder-card.done:hover { background: rgba(255, 255, 255, 0.03); transform: none; }
.reminder-card.done .title {
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--accent-green) 60%, transparent);
    color: var(--txt-dim);
}
.reminder-card.done .meta,
.reminder-card.done .desc { color: var(--txt-dim); }
.reminder-card.done .color-bar { opacity: 0.3; }
.badge.badge-done {
    background: rgba(104, 211, 145, 0.18);
    color: var(--accent-green);
    border-color: rgba(104, 211, 145, 0.45);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.reminder-card {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
    position: relative;
    animation: cardIn 260ms ease;
}
.reminder-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(126, 232, 250, 0.18);
    transform: translateY(-1px);
}

.reminder-card.dragging {
    opacity: 0.5;
    border-color: var(--accent-cyan);
}
.reminder-card .drag-handle {
    display: flex;
    align-items: center;
    color: var(--txt-dim);
    cursor: grab;
    font-size: 15px;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
}
.reminder-card .drag-handle:active { cursor: grabbing; }

.reminder-card .color-bar {
    width: 4px;
    border-radius: 4px;
    background: var(--accent-cyan);
    flex-shrink: 0;
}

.reminder-card .body { flex: 1; min-width: 0; }
.reminder-card .title { font-weight: 600; margin: 0 0 4px 0; word-break: break-word; }
.reminder-card .meta {
    font-size: 12px;
    color: var(--txt-muted);
    display: flex; gap: 10px; flex-wrap: wrap;
}
.reminder-card .desc {
    font-size: 13px;
    color: var(--txt-muted);
    margin-top: 6px;
    line-height: 1.5;
    word-break: break-word;
}
.reminder-card .badges { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(126, 232, 250, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(126, 232, 250, 0.2);
}
.badge.email   { background: rgba(246, 173, 85, 0.1); color: var(--accent-orange); border-color: rgba(246, 173, 85, 0.25); }
.badge.gcal    { background: rgba(104, 211, 145, 0.1); color: var(--accent-green); border-color: rgba(104, 211, 145, 0.25); }
.badge.status-failed { background: rgba(252, 129, 129, 0.1); color: var(--accent-red); border-color: rgba(252, 129, 129, 0.25); }
.badge.status-sent   { background: rgba(155, 169, 184, 0.1); color: var(--txt-muted); border-color: rgba(155, 169, 184, 0.25); }
.badge.recur         { background: rgba(183, 148, 246, 0.1); color: var(--accent-purple); border-color: rgba(183, 148, 246, 0.25); }

.reminder-card .actions {
    display: flex; flex-direction: row; gap: 6px;
    align-items: flex-start;
    align-self: flex-start;
    flex-shrink: 0;
}

/* ========== Multi-time: card times + progress ========== */
.reminder-card .times {
    display: flex; flex-direction: column; gap: 4px;
    margin-top: 8px;
}
.time-row {
    display: flex; align-items: stretch;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.time-toggle {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px;
    background: transparent; border: 0;
    color: var(--txt-primary); font-size: 13px;
    text-align: left; cursor: pointer;
    transition: background 140ms ease;
}
.time-toggle:hover { background: rgba(255, 255, 255, 0.05); }
.time-snooze {
    flex-shrink: 0;
    padding: 5px 10px;
    background: transparent; border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--txt-muted); font-size: 14px; cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}
.time-snooze:hover { background: rgba(255, 255, 255, 0.05); color: var(--accent-cyan); }
.snooze-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.time-row .time-check {
    width: 18px; height: 18px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}
.time-row.done .time-check {
    background: var(--accent-green, #68d391);
    border-color: var(--accent-green, #68d391);
    color: #06210f;
}
.time-row .time-hm { font-variant-numeric: tabular-nums; font-weight: 600; }
.time-row.snoozed .time-hm { text-decoration: line-through; color: var(--txt-dim); font-weight: 500; }
.time-snoozed {
    font-variant-numeric: tabular-nums; font-weight: 600;
    color: var(--accent-orange, #f6ad55);
    font-size: 12px;
}
.time-row .time-label { color: var(--txt-muted); }
.time-row.done .time-hm,
.time-row.done .time-label { text-decoration: line-through; color: var(--txt-dim); }

.progress-wrap { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.progress-track {
    flex: 1; height: 7px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.08); overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-cyan, #7ee8fa), var(--accent-green, #68d391));
    transition: width 260ms ease;
}
.progress-text { font-size: 11px; color: var(--txt-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ========== Multi-time: form time rows ========== */
.time-rows { display: flex; flex-direction: column; gap: 6px; }
.time-row-edit { display: flex; align-items: center; gap: 6px; }
.time-row-edit .time-input { width: auto; flex-shrink: 0; }
.time-row-edit .time-label-input { flex: 1; min-width: 0; }
.time-row-edit .time-remove {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.2);
    color: var(--txt-muted);
    cursor: pointer;
}
.time-row-edit .time-remove:hover { color: var(--accent-red, #fc8181); border-color: rgba(252, 129, 129, 0.4); }
.add-time-btn { align-self: flex-start; margin-top: 6px; }

/* ========== Google Calendar settings ========== */
.gcal-state { margin: 4px 0 12px; }
.gcal-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
[hidden] { display: none !important; }

/* ========== Period switcher + month navigator ========== */
.period-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 14px;
}
.period-chip {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--txt-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.period-chip:hover {
    color: var(--txt-primary);
    border-color: color-mix(in srgb, var(--accent-cyan) 40%, transparent);
    background: color-mix(in srgb, var(--accent-cyan) 8%, transparent);
}
.period-chip.active {
    color: color-mix(in srgb, var(--accent-cyan) 72%, white);
    background: color-mix(in srgb, var(--accent-cyan) 16%, transparent);
    border-color: color-mix(in srgb, var(--accent-cyan) 55%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--accent-cyan) 26%, transparent);
}
.month-nav {
    display: inline-flex; align-items: center; gap: 4px;
}
.month-nav .navbtn {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--txt-muted);
    font-size: 16px; line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}
.month-nav .navbtn:hover {
    color: var(--txt-primary);
    border-color: color-mix(in srgb, var(--accent-cyan) 45%, transparent);
    background: color-mix(in srgb, var(--accent-cyan) 10%, transparent);
}
.month-label {
    min-width: 132px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--txt-primary);
}

/* ========== Recurrence filter (right side of the period bar) ========== */
.recur-filter {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-left: auto;
}
.recur-chip {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--txt-muted);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.recur-chip:hover {
    color: var(--txt-primary);
    border-color: color-mix(in srgb, var(--accent-purple) 40%, transparent);
}
.recur-chip.active {
    color: color-mix(in srgb, var(--accent-purple) 75%, white);
    background: color-mix(in srgb, var(--accent-purple) 16%, transparent);
    border-color: color-mix(in srgb, var(--accent-purple) 55%, transparent);
}

/* ========== Category filter bar ========== */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
}
.filter-chip {
    --chip-color: var(--accent-cyan);
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid color-mix(in srgb, var(--chip-color) 22%, transparent);
    color: var(--txt-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.filter-chip .dot {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
    background: var(--chip-color);
    box-shadow: 0 0 7px color-mix(in srgb, var(--chip-color) 70%, transparent);
}
.filter-chip:hover {
    color: var(--txt-primary);
    border-color: color-mix(in srgb, var(--chip-color) 45%, transparent);
    background: color-mix(in srgb, var(--chip-color) 9%, transparent);
}
.filter-chip.active {
    color: color-mix(in srgb, var(--chip-color) 72%, white);
    background: color-mix(in srgb, var(--chip-color) 17%, transparent);
    border-color: color-mix(in srgb, var(--chip-color) 55%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--chip-color) 28%, transparent);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardOut {
    to { opacity: 0; transform: translateX(20px); height: 0; padding: 0; margin: 0; }
}
.removing { animation: cardOut 250ms ease forwards; pointer-events: none; }

/* ========== Ideas grid ========== */
.ideas-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.idea-card {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
    animation: cardIn 260ms ease;
}
.idea-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(183, 148, 246, 0.28);
    transform: translateY(-1px);
}
.idea-card .color-bar {
    width: 4px;
    border-radius: 4px;
    background: var(--accent-purple);
    flex-shrink: 0;
}
.idea-card .body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.idea-card .content {
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    color: var(--txt-primary);
}
.idea-card .date { font-size: 11px; color: var(--txt-dim); }
.idea-card .actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: flex-start;
    align-self: flex-start;
    flex-shrink: 0;
}
.idea-title {
    margin: 0;
    font-size: 15px; font-weight: 600;
    color: var(--txt-primary);
    word-break: break-word;
}
.idea-cat-chip {
    --chip-color: var(--accent-purple);
    display: inline-flex; align-items: center; gap: 6px;
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    color: color-mix(in srgb, var(--chip-color) 80%, white);
    background: color-mix(in srgb, var(--chip-color) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--chip-color) 45%, transparent);
}
.idea-cat-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color); flex-shrink: 0; }

/* ---- Idea modal: category select + inline manager ---- */
.idea-modal { max-width: 560px; }
.cat-select-row { display: flex; gap: 8px; align-items: center; }
.cat-select-row select { flex: 1; }
.cat-select-row .btn { white-space: nowrap; flex-shrink: 0; }
.idea-cat-manager {
    margin: -2px 0 2px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
}
.idea-cat-manager .row-form { margin-bottom: 8px; }

/* ---- Rich text editor (idea modal) ---- */
.rt-toolbar {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: rgba(0, 0, 0, 0.25);
}
.rt-toolbar button {
    min-width: 30px; height: 30px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--txt-primary);
    font-size: 13px; cursor: pointer;
    transition: var(--transition);
}
.rt-toolbar button:hover {
    background: color-mix(in srgb, var(--accent-cyan) 14%, transparent);
    border-color: color-mix(in srgb, var(--accent-cyan) 40%, transparent);
}
.rt-sep { width: 1px; align-self: stretch; margin: 2px 3px; background: rgba(255, 255, 255, 0.1); }
.rt-editor {
    min-height: 120px; max-height: 320px; overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
    color: var(--txt-primary);
    font-size: 14px; line-height: 1.55;
}
.rt-editor:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(126, 232, 250, 0.12); }
.rt-editor.empty::before {
    content: attr(data-placeholder);
    color: var(--txt-dim);
    pointer-events: none;
}
.rt-editor h3 { margin: 8px 0 4px; font-size: 16px; }
.rt-editor ul, .rt-editor ol { margin: 4px 0; padding-left: 22px; }
.rt-editor blockquote {
    margin: 6px 0; padding: 4px 12px;
    border-left: 3px solid color-mix(in srgb, var(--accent-purple) 60%, transparent);
    color: var(--txt-muted);
}
.rt-editor pre {
    margin: 6px 0; padding: 8px 12px;
    background: rgba(0, 0, 0, 0.35); border-radius: 6px;
    font-family: ui-monospace, monospace; font-size: 13px;
    white-space: pre-wrap; word-break: break-word;
}
.rt-editor a { color: var(--accent-cyan); }

/* ---- Link rows (idea modal) ---- */
.link-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.link-row { display: flex; gap: 6px; }
.link-row .link-title { flex: 0 0 38%; }
.link-row .link-url { flex: 1; min-width: 0; }
.link-row .link-del { flex-shrink: 0; }

/* ---- YouTube chips (editor) + thumbnails (card) ---- */
.yt-list, .idea-yt { display: flex; flex-wrap: wrap; gap: 8px; }
.yt-list { margin-top: 8px; }
.yt-chip, .yt-thumb {
    position: relative; display: inline-block; line-height: 0;
    border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.yt-chip img { width: 120px; height: 68px; object-fit: cover; display: block; }
.yt-thumb img { width: 160px; height: 90px; object-fit: cover; display: block; transition: var(--transition); }
.yt-thumb:hover img { transform: scale(1.04); }
.yt-chip .yt-play, .yt-thumb .yt-play {
    position: absolute; inset: 0; margin: auto;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.6); color: #fff; border-radius: 50%;
    font-size: 12px; pointer-events: none;
}
.yt-chip .yt-del {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px;
    border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, 0.7); color: #fff;
    cursor: pointer; font-size: 13px; line-height: 1;
}

/* ---- Idea card: rich body + links ---- */
.idea-card .content.rich h3 { font-size: 15px; margin: 6px 0 3px; }
.idea-card .content.rich ul, .idea-card .content.rich ol { margin: 4px 0; padding-left: 20px; }
.idea-card .content.rich blockquote {
    margin: 5px 0; padding: 3px 10px;
    border-left: 3px solid color-mix(in srgb, var(--accent-purple) 55%, transparent);
    color: var(--txt-muted);
}
.idea-card .content.rich pre {
    margin: 5px 0; padding: 7px 10px; background: rgba(0, 0, 0, 0.3);
    border-radius: 6px; font-family: ui-monospace, monospace; font-size: 12px;
    white-space: pre-wrap; word-break: break-word;
}
.idea-card .content a, .idea-card .content.rich a { color: var(--accent-cyan); word-break: break-word; }
.idea-links { display: flex; flex-direction: column; gap: 4px; }
.idea-link { font-size: 12px; color: var(--accent-cyan); word-break: break-all; }

/* ---- Reminder bell on idea cards: faded = off (default), bright = linked ---- */
.idea-card .js-convert { opacity: 0.4; transition: var(--transition); }
.idea-card .js-convert:hover { opacity: 0.9; }
.idea-card .js-convert.active {
    opacity: 1;
    color: var(--accent-orange);
    border-color: color-mix(in srgb, var(--accent-orange) 45%, transparent);
    background: color-mix(in srgb, var(--accent-orange) 14%, transparent);
}

/* ---- Image thumbnails (idea modal) ---- */
.img-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.img-thumbs:not(:empty) { margin-bottom: 8px; }
.img-add-btn { align-self: flex-start; cursor: pointer; }
.img-thumb {
    position: relative; width: 84px; height: 84px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb .img-del {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px; border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, 0.7); color: #fff; cursor: pointer;
    font-size: 14px; line-height: 1;
}

/* ---- Idea card images + lightbox ---- */
.idea-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-img {
    width: 110px; height: 110px; object-fit: cover;
    border-radius: 8px; cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}
.idea-img:hover { transform: scale(1.03); border-color: rgba(183, 148, 246, 0.4); }
.lightbox {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0, 0, 0, 0.85);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; cursor: zoom-out;
    animation: fadeIn 160ms ease;
}
.lightbox[hidden] { display: none !important; }
.lightbox img {
    max-width: 95vw; max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

/* ---- Pin (idea cards) ---- */
.idea-card .js-pin { opacity: 0.4; transition: var(--transition); }
.idea-card .js-pin:hover { opacity: 0.9; }
.idea-card .js-pin.active {
    opacity: 1;
    color: var(--accent-cyan);
    border-color: color-mix(in srgb, var(--accent-cyan) 45%, transparent);
    background: color-mix(in srgb, var(--accent-cyan) 14%, transparent);
}
.idea-card.pinned { border-color: color-mix(in srgb, var(--accent-cyan) 30%, transparent); }

/* ---- Idea search box ---- */
.idea-search { margin-bottom: 12px; }

/* ---- Checklist: modal editor rows ---- */
.checklist-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row .check-text { flex: 1; min-width: 0; }
.check-row .check-done { width: 16px; height: 16px; accent-color: var(--accent-cyan); flex-shrink: 0; }
.check-row .check-del { flex-shrink: 0; }

/* ---- Checklist: on idea card ---- */
.idea-checklist { display: flex; flex-direction: column; gap: 3px; }
.checklist-progress { font-size: 11px; font-weight: 600; color: var(--accent-green); }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check-item input { width: 15px; height: 15px; accent-color: var(--accent-green); flex-shrink: 0; }
.check-item.done span { text-decoration: line-through; color: var(--txt-dim); }

/* ========== Categories tags ========== */
.tags-list {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 8px;
}
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    animation: cardIn 220ms ease;
}
.cat-chip.dragging {
    opacity: 0.45;
    border-color: var(--accent-cyan);
}
.cat-chip .drag-handle {
    cursor: grab;
    color: var(--txt-dim);
    font-size: 14px;
    line-height: 1;
    user-select: none;
}
.cat-chip .drag-handle:active { cursor: grabbing; }
.cat-chip .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cat-chip .edit,
.cat-chip .del {
    background: none; border: 0; color: var(--txt-dim);
    cursor: pointer; padding: 0; line-height: 1;
    font-size: 14px; transition: var(--transition);
}
.cat-chip .del { font-size: 16px; }
.cat-chip .edit:hover { color: var(--accent-cyan); }
.cat-chip .del:hover { color: var(--accent-red); }

/* ========== Modal ========== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: fadeIn 180ms ease;
}
.modal-backdrop[hidden] {
    display: none !important;
}
.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal h3 { margin: 0 0 16px 0; color: var(--accent-cyan); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 200;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    color: var(--txt-primary);
    font-size: 14px;
    box-shadow: var(--glass-shadow);
    animation: toastIn 240ms ease;
    pointer-events: auto;
    max-width: 320px;
}
.toast.success { border-color: rgba(104, 211, 145, 0.4); }
.toast.error   { border-color: rgba(252, 129, 129, 0.4); }

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

/* ========== Scrollbar (subtle) ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); }

/* ========== Responsive ========== */
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .topbar { flex-wrap: wrap; }
    .topnav { width: 100%; margin-left: 0; }
    .user-box { width: 100%; justify-content: space-between; }
}
@media (max-width: 600px) {
    .topbar { margin: 12px; padding: 12px; }
    .layout { padding: 0 12px 24px 12px; gap: 14px; }
    .pad { padding: 18px; }
    .brand { font-size: 22px; }
    .reminder-card, .idea-card { flex-direction: column; }
    .reminder-card .actions, .idea-card .actions { flex-direction: row; align-self: flex-start; }
}
