/* =========================================================
   Sunshine Board — production stylesheet
   Design tokens copied verbatim from the approved
   watercolor demo (jojo-sunshine-demo.html). Palette,
   fonts, cards, columns, magic panel, archive, mobile —
   pixel-for-pixel. New rules at the bottom are additive
   (loading / empty / error / toasts / draft confirm).
========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&family=Caveat:wght@400;500;600;700&display=swap');

:root {
    --bg-warm: #faf6f1;
    --bg-cream: #f5efe8;
    --card-bg: rgba(255, 253, 250, 0.95);
    --text-primary: #2d2418;
    --text-secondary: #8a7a6a;
    --accent-coral: #e07a5f;
    --accent-gold: #e9c46a;
    --accent-sage: #81b29a;
    --accent-sky: #7eb8d6;
    --accent-lavender: #b8a9c9;
    --accent-peach: #f4a261;
    --shadow-soft: 0 2px 12px rgba(45, 36, 24, 0.06);
    --shadow-hover: 0 8px 30px rgba(45, 36, 24, 0.1);
    --radius: 18px;
    --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-warm);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* top app bar (replaces demo-nav; same warmth) */
.demo-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: rgba(255, 253, 250, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    z-index: 2000;
}
.demo-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.05rem;
}
.demo-nav-left .mini-sun {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-coral));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(224, 122, 95, 0.25);
}
.demo-nav-tabs { display: flex; gap: 6px; }
.nav-tab {
    padding: 7px 16px;
    border-radius: 20px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.nav-tab:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.nav-tab.active {
    background: rgba(224, 122, 95, 0.1);
    color: var(--accent-coral);
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.nav-logout {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 16px;
    transition: all 0.2s;
}
.nav-logout:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }

/* per-user avatar (color comes from /api/me, set inline) */
.card-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; color: white; font-weight: 700;
    flex-shrink: 0;
}

/* =========================================================
   SCREEN SWITCHING
========================================================= */
.screen {
    display: none;
    padding-top: 56px;
    animation: fadeScreen 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.screen.active { display: block; }
@keyframes fadeScreen {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   LOGIN SCREEN
========================================================= */
#screen-login {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
}
#screen-login.active { display: flex; }
.login-bg {
    position: fixed;
    inset: 56px 0 0 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(233,196,106,0.22), transparent 42%),
        radial-gradient(circle at 82% 18%, rgba(224,122,95,0.18), transparent 40%),
        radial-gradient(circle at 70% 85%, rgba(129,178,154,0.18), transparent 45%),
        radial-gradient(circle at 25% 80%, rgba(126,184,214,0.16), transparent 42%),
        var(--bg-warm);
    z-index: -1;
}
.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 44px 40px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(45, 36, 24, 0.12);
    border: 1px solid rgba(0,0,0,0.03);
    text-align: center;
}
.login-sun {
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-coral));
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    box-shadow: 0 6px 20px rgba(224, 122, 95, 0.3);
}
.login-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}
.login-card p.sub {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 28px;
    line-height: 1.5;
}
.login-card .form-input {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(0,0,0,0.08);
    font-family: inherit;
    font-size: 0.98rem;
    transition: border-color 0.2s;
    background: white;
    margin-bottom: 14px;
}
.login-card .form-input:focus { outline: none; border-color: var(--accent-coral); }
.btn-full {
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--accent-coral);
    color: white;
    box-shadow: 0 2px 8px rgba(224, 122, 95, 0.3);
}
.btn-full:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(224, 122, 95, 0.4); }
.btn-full:disabled { opacity: 0.7; cursor: default; }
.lock-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 22px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.login-confirm { display: none; }
.login-confirm.show { display: block; }
.login-confirm .check-sun {
    font-size: 44px;
    margin-bottom: 14px;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.fake-email {
    margin-top: 22px;
    background: var(--bg-cream);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: left;
    font-size: 0.84rem;
    color: var(--text-secondary);
    border: 1px solid rgba(0,0,0,0.04);
}
.fake-email strong { color: var(--text-primary); }
.login-back {
    margin-top: 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
}
.login-back:hover { color: var(--accent-coral); }
.login-error {
    display: none;
    margin: -4px 0 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(224,122,95,0.1);
    color: var(--accent-coral);
    font-size: 0.82rem;
    font-weight: 600;
}
.login-error.show { display: block; }

/* =========================================================
   APP LAYOUT (sidebar + main)
========================================================= */
.app-wrap { position: relative; }

.sidebar {
    position: fixed;
    left: 0; top: 56px; bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, #fff 0%, #faf6f1 100%);
    border-right: 1px solid rgba(0,0,0,0.04);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}
.logo {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 32px; padding: 0 8px;
}
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-coral));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(224, 122, 95, 0.25);
}
.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; font-weight: 600; color: var(--text-primary);
}
.logo-sub { font-size: 0.7rem; color: var(--text-secondary); margin-top: -2px; letter-spacing: 0.5px; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-title {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-secondary); margin-bottom: 10px; padding: 0 8px; font-weight: 600;
}
.board-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; font-size: 0.9rem; font-weight: 500;
    position: relative;
}
.board-item:hover { background: rgba(0,0,0,0.03); }
.board-item.active { background: rgba(224, 122, 95, 0.08); color: var(--accent-coral); }
.board-item .board-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.board-item .board-edit {
    opacity: 0; font-size: 0.85rem; color: var(--text-secondary);
    background: none; border: none; cursor: pointer; padding: 2px 4px; transition: opacity 0.15s;
}
.board-item:hover .board-edit { opacity: 0.7; }
.board-item .board-edit:hover { opacity: 1; color: var(--accent-coral); }
.add-board-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; color: var(--text-secondary); font-size: 0.9rem;
    transition: all 0.2s; border: 2px dashed rgba(0,0,0,0.08); margin-top: 4px;
}
.add-board-btn:hover { border-color: var(--accent-coral); color: var(--accent-coral); }

.sidebar-foot {
    margin-top: auto;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    background: rgba(129,178,154,0.1);
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.sidebar-foot .who { display: flex; gap: 6px; margin-top: 8px; }

.main {
    margin-left: 260px;
    min-height: calc(100vh - 56px);
}
.top-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 32px; border-bottom: 1px solid rgba(0,0,0,0.04);
    gap: 16px; flex-wrap: wrap;
}
.board-title { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 600; }
.board-title small { display:block; font-family:'Inter',sans-serif; font-size:0.8rem; font-weight:400; color:var(--text-secondary); margin-top:2px;}
.board-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
    padding: 10px 20px; border-radius: var(--radius-sm); border: none;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--accent-coral); color: white; box-shadow: 0 2px 8px rgba(224, 122, 95, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(224, 122, 95, 0.4); }
.btn-secondary { background: rgba(0,0,0,0.04); color: var(--text-secondary); }
.btn-secondary:hover:not(:disabled) { background: rgba(0,0,0,0.08); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.btn-magic {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-coral));
    color: white;
    box-shadow: 0 2px 10px rgba(224, 122, 95, 0.35);
}
.btn-magic:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(224, 122, 95, 0.45); }
.btn-danger { background: rgba(224,122,95,0.1); color: var(--accent-coral); }
.btn-danger:hover:not(:disabled) { background: rgba(224,122,95,0.18); }

.board-area { padding: 24px 32px; overflow-x: auto; }
.columns { display: flex; gap: 20px; min-width: fit-content; align-items: flex-start; }
.column { width: 300px; flex-shrink: 0; }
.column-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; padding: 0 4px;
}
.column-title-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.column-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.column-name {
    font-weight: 600; font-size: 0.95rem; cursor: text;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.column-name:hover { color: var(--accent-coral); }
.column-count {
    background: rgba(0,0,0,0.05); padding: 3px 10px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
}
.column-menu {
    background: none; border: none; cursor: pointer; color: var(--text-secondary);
    font-size: 1.1rem; line-height: 1; padding: 0 4px; opacity: 0; transition: opacity 0.15s;
}
.column:hover .column-menu { opacity: 0.6; }
.column-menu:hover { opacity: 1; color: var(--accent-coral); }
.column-actions { display: flex; align-items: center; gap: 4px; }
.column-cards {
    display: flex; flex-direction: column; gap: 10px;
    min-height: 120px; padding: 4px;
}

.card {
    background: var(--card-bg); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow-soft); cursor: grab;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.03); position: relative;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; border-radius: var(--radius) var(--radius) 0 0;
    background: var(--col-accent, var(--accent-coral));
}
.card.dragging { opacity: 0.6; transform: rotate(2deg) scale(0.97); cursor: grabbing; box-shadow: var(--shadow-hover); }
.card.pending { opacity: 0.55; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card-title { font-weight: 600; font-size: 0.95rem; line-height: 1.4; margin-bottom: 8px; }
.card-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; white-space: pre-wrap; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    font-size: 0.7rem; padding: 3px 10px; border-radius: 8px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    background: rgba(224, 122, 95, 0.12); color: var(--accent-coral);
}
.card-meta { display: flex; align-items: center; gap: 8px; }
.card-date { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }
.card-date.overdue { color: var(--accent-coral); font-weight: 600; }

.add-card-btn {
    padding: 12px; border-radius: var(--radius-sm);
    border: 2px dashed rgba(0,0,0,0.08); background: transparent;
    color: var(--text-secondary); font-size: 0.85rem; cursor: pointer;
    text-align: center; transition: all 0.2s; font-weight: 500; width: 100%;
}
.add-card-btn:hover { border-color: var(--accent-coral); color: var(--accent-coral); background: rgba(224, 122, 95, 0.03); }
.add-column-btn {
    width: 300px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    padding: 20px; border-radius: var(--radius); border: 2px dashed rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.4); color: var(--text-secondary); font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s; font-weight: 500; height: fit-content;
}
.add-column-btn:hover { border-color: var(--accent-coral); color: var(--accent-coral); }
.column.drag-over .column-cards {
    background: rgba(224, 122, 95, 0.04); border-radius: var(--radius);
    box-shadow: inset 0 0 0 2px rgba(224, 122, 95, 0.15);
}

/* card arrival animation (magic intake) */
@keyframes cardArrive {
    from { opacity: 0; transform: translateY(-16px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card.arriving { animation: cardArrive 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* empty column hint */
.column-empty {
    font-size: 0.82rem; color: var(--text-secondary); text-align: center;
    padding: 18px 8px; opacity: 0.7; font-style: italic;
}

/* =========================================================
   MODALS (magic intake + generic card editor)
========================================================= */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(45,36,24,0.32);
    backdrop-filter: blur(4px); display: none;
    align-items: center; justify-content: center; z-index: 1500;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.magic-panel {
    background: white; border-radius: var(--radius); padding: 30px;
    width: 92%; max-width: 540px;
    box-shadow: 0 24px 70px rgba(45,36,24,0.22);
    max-height: 92vh; overflow-y: auto;
    position: relative;
}
.magic-panel h2 {
    font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 4px;
}
.magic-panel .magic-sub { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 22px; }
.source-chips { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.source-chip {
    padding: 8px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600;
    border: 1.5px solid rgba(0,0,0,0.08); cursor: pointer; transition: all 0.2s;
    background: white; color: var(--text-secondary);
}
.source-chip.active { border-color: var(--accent-coral); color: var(--accent-coral); background: rgba(224,122,95,0.06); }
.source-chip:hover { border-color: var(--accent-coral); }

/* intake source bodies */
.intake-body { display: none; }
.intake-body.active { display: block; }

/* the faux handwritten note (now a real dropzone) */
.note-paper {
    position: relative;
    background: #fffdf6;
    border-radius: var(--radius-sm);
    padding: 26px 28px 30px;
    box-shadow: 0 6px 22px rgba(45,36,24,0.12), inset 0 0 0 1px rgba(0,0,0,0.03);
    transform: rotate(-1.2deg);
    background-image: repeating-linear-gradient(
        transparent, transparent 33px, rgba(126,184,214,0.25) 33px, rgba(126,184,214,0.25) 34px);
    margin-bottom: 22px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 150px;
}
.note-paper:hover { transform: rotate(-1.2deg) translateY(-2px); box-shadow: 0 10px 28px rgba(45,36,24,0.16), inset 0 0 0 1px rgba(0,0,0,0.03); }
.note-paper.dragover { box-shadow: 0 10px 28px rgba(224,122,95,0.3), inset 0 0 0 2px var(--accent-coral); }
.note-paper::before {
    content: ''; position: absolute; left: 34px; top: 0; bottom: 0;
    width: 1.5px; background: rgba(224,122,95,0.3);
}
.note-paper h4 {
    font-family: 'Caveat', cursive; font-size: 1.5rem; font-weight: 700;
    color: var(--accent-coral); margin-bottom: 6px; padding-left: 14px;
}
.note-paper .note-hint {
    font-family: 'Caveat', cursive; font-size: 1.35rem; line-height: 34px;
    color: #3a4a55; padding-left: 14px;
}
.note-paper .note-filename {
    font-family: 'Caveat', cursive; font-size: 1.45rem; line-height: 34px;
    color: var(--accent-coral); padding-left: 14px; word-break: break-all;
}
.note-thumb {
    max-width: 100%; border-radius: 8px; margin: 8px 0 0 14px;
    max-height: 200px; box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

/* textarea for typed intake */
.intake-textarea {
    width: 100%; min-height: 150px; padding: 18px 20px;
    border-radius: var(--radius-sm); border: 1.5px solid rgba(0,0,0,0.08);
    font-family: 'Caveat', cursive; font-size: 1.35rem; line-height: 1.5;
    color: #3a4a55; background: #fffdf6; resize: vertical; margin-bottom: 22px;
    background-image: repeating-linear-gradient(
        transparent, transparent 33px, rgba(126,184,214,0.18) 33px, rgba(126,184,214,0.18) 34px);
    line-height: 34px;
}
.intake-textarea:focus { outline: none; border-color: var(--accent-coral); }

.magic-go {
    width: 100%; padding: 14px; border-radius: var(--radius-sm); border: none;
    font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-coral));
    color: white; box-shadow: 0 4px 14px rgba(224,122,95,0.35); transition: all 0.2s;
}
.magic-go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(224,122,95,0.45); }
.magic-go:disabled { cursor: default; opacity: 0.92; }
.reading-state { display: none; text-align: center; padding: 14px 0 4px; }
.reading-state.show { display: block; }
.shimmer {
    display: inline-block; font-size: 0.95rem; font-weight: 600; color: var(--accent-coral);
    background: linear-gradient(90deg, var(--accent-coral) 25%, var(--accent-gold) 50%, var(--accent-coral) 75%);
    background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerMove 1.1s linear infinite;
}
@keyframes shimmerMove { to { background-position: -200% center; } }
.magic-close {
    position: absolute; top: 18px; right: 22px; font-size: 1.4rem;
    color: var(--text-secondary); cursor: pointer; background: none; border: none; line-height: 1;
    z-index: 2;
}
.magic-error {
    display: none; margin-bottom: 16px; padding: 12px 16px;
    border-radius: var(--radius-sm); background: rgba(224,122,95,0.1);
    color: var(--accent-coral); font-size: 0.84rem; font-weight: 600;
}
.magic-error.show { display: block; }

/* draft confirm step (slide in) */
@keyframes draftSlide {
    from { opacity: 0; transform: translateX(18px); }
    to   { opacity: 1; transform: translateX(0); }
}
.draft-step { display: none; }
.draft-step.show { display: block; }
.draft-list { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 20px; }
.draft-card {
    background: #fffdf6; border-radius: var(--radius-sm); padding: 14px 16px;
    border: 1px solid rgba(0,0,0,0.06); box-shadow: var(--shadow-soft);
    position: relative; animation: draftSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.draft-card.removed { display: none; }
.draft-card .draft-title-input {
    width: 100%; font-weight: 600; font-size: 0.95rem; border: none; background: transparent;
    font-family: inherit; color: var(--text-primary); margin-bottom: 6px;
}
.draft-card .draft-title-input:focus { outline: none; border-bottom: 1.5px solid var(--accent-coral); }
.draft-card .draft-desc-input {
    width: 100%; font-size: 0.82rem; color: var(--text-secondary); border: none; background: transparent;
    font-family: inherit; resize: vertical; min-height: 18px; line-height: 1.5;
}
.draft-card .draft-desc-input:focus { outline: none; }
.draft-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.draft-row select, .draft-row input[type=text], .draft-row input[type=date] {
    font-family: inherit; font-size: 0.78rem; padding: 5px 8px; border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1); background: white; color: var(--text-primary);
}
.draft-remove {
    position: absolute; top: 10px; right: 12px; background: none; border: none;
    color: var(--text-secondary); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.draft-remove:hover { color: var(--accent-coral); }
.draft-actions { display: flex; gap: 10px; }
.draft-actions .magic-go { flex: 1; }

/* generic card editor fields */
.field-group { margin-bottom: 16px; text-align: left; }
.field-group label {
    display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px;
    font-weight: 700; color: var(--text-secondary); margin-bottom: 6px;
}
.field-group input, .field-group textarea, .field-group select {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid rgba(0,0,0,0.08); font-family: inherit; font-size: 0.92rem;
    background: white; color: var(--text-primary);
}
.field-group textarea { min-height: 80px; resize: vertical; }
.field-group input:focus, .field-group textarea:focus, .field-group select:focus {
    outline: none; border-color: var(--accent-coral);
}
.editor-foot { display: flex; gap: 10px; margin-top: 20px; }
.editor-foot .btn { flex: 1; }

/* =========================================================
   ARCHIVE
========================================================= */
.archive-wrap { max-width: 760px; margin: 0 auto; padding: 36px 32px 60px; }
.archive-head { text-align: center; margin-bottom: 8px; }
.archive-head h1 { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 600; }
.archive-head p { color: var(--text-secondary); font-size: 0.95rem; margin-top: 6px; }
.archive-search {
    width: 100%; padding: 13px 18px; margin: 26px 0 30px;
    border-radius: 24px; border: 1.5px solid rgba(0,0,0,0.08);
    font-family: inherit; font-size: 0.95rem; background: white;
}
.archive-search:focus { outline: none; border-color: var(--accent-sage); }
.archive-month { margin-bottom: 28px; }
.archive-month-label {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.5px;
    font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; padding-left: 4px;
}
.archive-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--card-bg); border-radius: var(--radius-sm);
    padding: 14px 18px; margin-bottom: 8px; box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.03);
}
.archive-check {
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(129,178,154,0.18); color: var(--accent-sage);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; flex-shrink: 0; font-weight: 700;
}
.archive-item .title { flex: 1; font-size: 0.9rem; font-weight: 500; }
.archive-item .when { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }
.archive-restore {
    background: none; border: none; color: var(--accent-coral); cursor: pointer;
    font-size: 0.78rem; font-weight: 600; padding: 4px 8px; border-radius: 12px; transition: background 0.15s;
}
.archive-restore:hover { background: rgba(224,122,95,0.08); }

/* =========================================================
   GENERIC STATES — loading / empty / error
========================================================= */
.state-block {
    text-align: center; padding: 60px 24px; color: var(--text-secondary);
}
.state-block .state-emoji { font-size: 2.6rem; margin-bottom: 14px; display: block; }
.state-block h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--text-primary); margin-bottom: 8px; font-weight: 600; }
.state-block p { font-size: 0.92rem; line-height: 1.5; max-width: 380px; margin: 0 auto 18px; }

.spinner {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid rgba(224,122,95,0.15); border-top-color: var(--accent-coral);
    animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* skeleton cards while a board loads */
.skeleton-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow-soft); border: 1px solid rgba(0,0,0,0.03);
    height: 86px; position: relative; overflow: hidden;
}
.skeleton-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: translateX(-100%); animation: shimmerSweep 1.3s infinite;
}
@keyframes shimmerSweep { to { transform: translateX(100%); } }

/* =========================================================
   TOASTS (errors + confirmations)
========================================================= */
.toast-wrap {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: center;
    pointer-events: none;
}
.toast {
    background: white; border-radius: 14px; padding: 13px 20px;
    box-shadow: 0 10px 34px rgba(45,36,24,0.2); font-size: 0.88rem; font-weight: 600;
    display: flex; align-items: center; gap: 10px; max-width: 92vw;
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    pointer-events: auto; border: 1px solid rgba(0,0,0,0.04);
}
.toast.leaving { animation: toastOut 0.3s ease forwards; }
.toast.err { color: var(--accent-coral); }
.toast.ok { color: var(--accent-sage); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(14px); } }

/* mobile menu toggle (sidebar drawer on small screens) */
.menu-toggle {
    display: none; background: none; border: none; font-size: 1.4rem;
    cursor: pointer; color: var(--text-primary); padding: 0 6px;
}
.sidebar-backdrop {
    display: none; position: fixed; inset: 56px 0 0 0; background: rgba(45,36,24,0.3);
    z-index: 99; backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 900px) {
    .sidebar { width: 220px; }
    .main { margin-left: 220px; }
    .column { width: 280px; }
}
@media (max-width: 768px) {
    .demo-nav-tabs .nav-tab span.tab-label { display: none; }
    .menu-toggle { display: inline-block; }
    .sidebar {
        transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: 8px 0 30px rgba(45,36,24,0.12); width: 260px;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .top-bar { padding: 18px 18px; }
    .board-area { padding: 18px 16px; }
    .board-title { font-size: 1.4rem; }
    .column { width: 84vw; max-width: 320px; }
    .add-column-btn { width: 84vw; max-width: 320px; }
    .archive-wrap { padding: 24px 18px 50px; }
}

/* =========================================================
   Guest demo mode — peek link (login) + sandbox banner (board).
   Uses the existing watercolor tokens only; additive, no overrides.
========================================================= */
.demo-peek {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.9rem;
    color: var(--accent-coral);
    text-decoration: none;
    border-bottom: 1px dashed rgba(224, 122, 95, 0.4);
    padding-bottom: 1px;
    transition: opacity 0.18s ease, border-color 0.18s ease;
}
.demo-peek:hover {
    opacity: 0.82;
    border-color: var(--accent-coral);
}

.demo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 4px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(233, 196, 106, 0.18), rgba(126, 184, 214, 0.16));
    border: 1px solid rgba(233, 196, 106, 0.45);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
}
.demo-banner-text {
    flex: 1 1 auto;
    font-size: 0.92rem;
    line-height: 1.4;
}
.demo-banner-close {
    flex: 0 0 auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
    transition: color 0.18s ease, background 0.18s ease;
}
.demo-banner-close:hover {
    color: var(--accent-coral);
    background: rgba(224, 122, 95, 0.08);
}

/* In demo mode, the "+ New Board" affordance becomes a gentle, non-clickable
   note rather than a live action (guests can't create real boards). */
.add-board-btn.demo-locked {
    opacity: 0.55;
    cursor: default;
    font-style: italic;
}
