/* Syna³ — visual theme ported from Sollos³: clean neutral zinc SaaS, a
   confident near-black primary, indigo used sparingly for focus/links, and a
   dark sidebar. Typeface: Inter. Content-forward, no gimmicks. */
:root {
    --bg: #fafafa;
    --panel: #ffffff;
    --panel-2: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #18181b;
    --muted: #71717a;
    --faint: #a1a1aa;
    --accent: #6366f1;
    --accent-soft: #eef2ff;
    --accent-ink: #4f46e5;
    --primary: #18181b;
    --primary-ink: #27272a;
    --primary-fg: #ffffff;
    --green: #059669;
    --amber: #b45309;
    --red: #dc2626;
    --shadow: 0 1px 2px rgba(24,24,27,.05);
    --radius: 10px;
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Dark sidebar even in light mode — a Sollos signature. */
    --sidebar-bg: #18181b;
    --sidebar-fg: #d4d4d8;
    --sidebar-fg-strong: #ffffff;
    --sidebar-active-bg: #27272a;
    --sidebar-active-fg: #ffffff;
    --sidebar-border: #27272a;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #09090b; --panel: #18181b; --panel-2: #27272a;
        --border: #27272a; --border-strong: #3f3f46; --text: #fafafa;
        --muted: #a1a1aa; --faint: #71717a;
        --accent: #818cf8; --accent-soft: #1e1b3a; --accent-ink: #a5b4fc;
        --primary: #fafafa; --primary-ink: #e4e4e7; --primary-fg: #18181b;
        --green: #34d399; --amber: #fbbf24; --red: #f87171;
        --shadow: 0 1px 2px rgba(0,0,0,.4);
        --sidebar-bg: #09090b; --sidebar-fg: #d4d4d8; --sidebar-fg-strong: #fafafa;
        --sidebar-active-bg: #27272a; --sidebar-active-fg: #fafafa; --sidebar-border: #27272a;
    }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: var(--sans);
    font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
    text-rendering: optimizeLegibility;
    font-variant-numeric: tabular-nums;
}

/* ── App shell ─────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 208px; flex-shrink: 0; background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border); padding: 18px 14px;
    display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px; }
.brand-dot {
    width: 15px; height: 15px; border-radius: 5px;
    background: var(--accent);
}
.brand-name { font-weight: 700; letter-spacing: -.02em; font-size: 16px; color: var(--text); }
.sidebar .brand-name { color: var(--sidebar-fg-strong); }
.brand-exp { font-size: .6em; font-weight: 700; color: var(--accent);
    vertical-align: super; line-height: 0; margin-left: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: 8px; color: var(--sidebar-fg); text-decoration: none; font-weight: 500;
}
.nav-item:hover { background: var(--sidebar-active-bg); color: var(--sidebar-fg-strong); }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-fg); }
.nav-ico { font-size: 13px; width: 16px; text-align: center; }
.sidebar-foot { margin-top: auto; color: #71717a; font-size: 12px; padding: 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.topbar-title h1 { margin: 0; font-weight: 700; font-size: 21px; letter-spacing: -.03em; }
.topbar-sub { color: var(--muted); font-size: 12.5px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--panel); border: 1px solid var(--border-strong); color: var(--text);
    padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all .12s ease;
}
.btn:hover { border-color: var(--border-strong); background: var(--panel-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn.primary:hover { background: var(--primary-ink); border-color: var(--primary-ink); color: var(--primary-fg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--red); background: var(--panel-2); }

.banner {
    margin: 14px 24px 0; padding: 10px 14px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; font-size: 13px;
}

.btn.ai { border-color: transparent; color: #fff;
    background: linear-gradient(135deg, #7a5cff, #b96bff); }
.btn.ai:hover { filter: brightness(1.08); color: #fff; }

.ai-note {
    margin: 14px 24px 0; padding: 12px 14px; border-radius: 11px; font-size: 13.5px;
    line-height: 1.5; color: var(--text);
    background: linear-gradient(135deg, rgba(122,92,255,.10), rgba(185,107,255,.08));
    border: 1px solid rgba(122,92,255,.25);
}
.ai-badge {
    display: inline-block; font-weight: 700; font-size: 11px; margin-right: 8px;
    padding: 1px 8px; border-radius: 999px; color: #fff;
    background: linear-gradient(135deg, #7a5cff, #b96bff);
}

/* ── Layout: tasks + calendar ──────────────────────────────── */
.layout { display: flex; gap: 20px; padding: 20px 24px; flex: 1; min-height: 0; }
.tasks-panel { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.calendar-panel { flex: 1; min-width: 0; }

/* ── Quick add ─────────────────────────────────────────────── */
.quickadd {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.quickadd input[type=text] {
    width: 100%; border: none; font-size: 15px; font-weight: 500; padding: 4px 2px;
    background: transparent; color: var(--text); outline: none;
}
.quickadd-row { display: flex; gap: 6px; align-items: center; }
.quickadd-row select, .quickadd-row input {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 8px; padding: 6px 8px; font-size: 12.5px; min-width: 0;
}
.quickadd-row input[type=number] { width: 62px; }
.quickadd-row input[type=datetime-local] { flex: 1; }
.quickadd-row .btn { padding: 7px 12px; }

/* ── Task list ─────────────────────────────────────────────── */
.tasks-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700; padding: 0 4px;
}
.tasks-head .count { color: var(--faint); }
.tasklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto; }
.task {
    display: flex; align-items: flex-start; gap: 10px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; box-shadow: var(--shadow);
}
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }
.chk-form, .del-form { margin: 0; }
.chk {
    width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border-strong);
    background: var(--panel); cursor: pointer; margin-top: 1px; flex-shrink: 0; transition: all .12s;
}
.chk:hover { border-color: var(--accent); }
.chk.on { background: var(--green); border-color: var(--green); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 550; word-break: break-word; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.est { color: var(--muted); font-size: 12px; }
.due { color: var(--amber); font-size: 12px; }
.del { border: none; background: none; color: var(--faint); font-size: 18px; line-height: 1;
    cursor: pointer; padding: 0 2px; }
.del:hover { color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 18px; font-size: 13px; }

/* Priority pills */
.pill { font-size: 10.5px; font-weight: 700; text-transform: capitalize;
    padding: 2px 8px; border-radius: 999px; }
.p-1 { color: var(--muted); background: rgba(124,131,152,.14); }
.p-2 { color: var(--accent-ink); background: var(--accent-soft); }
.p-3 { color: var(--amber); background: rgba(217,147,43,.14); }
.p-4 { color: var(--red); background: rgba(229,72,77,.14); }

/* Projects */
.proj-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.proj-pill-wrap { display: inline-flex; align-items: center; }
.proj-pill {
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
    border: 1px solid var(--border); background: var(--panel); color: var(--text);
    border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600;
}
.proj-pill:hover { border-color: var(--accent); }
.proj-pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.proj-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.proj-count { color: var(--muted); font-size: 11px; }
.proj-del-form { margin: 0; }
.proj-del { border: none; background: none; color: var(--faint); font-size: 15px;
    line-height: 1; cursor: pointer; padding: 0 2px; }
.proj-del:hover { color: var(--red); }
.proj-chip {
    display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600;
    padding: 2px 8px; border-radius: 999px; color: var(--pc, var(--muted));
    background: color-mix(in srgb, var(--pc, #888) 15%, transparent);
}

/* ── Calendar grid ─────────────────────────────────────────── */
.views-bar {
    display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.view-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.view-pill-wrap { display: inline-flex; align-items: center; }
.view-pill {
    display: inline-flex; align-items: center; text-decoration: none;
    border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
    border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600;
}
.view-pill:hover { border-color: var(--accent); }
.view-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.view-del-form { margin: 0; }
.view-del { border: none; background: none; color: var(--faint); font-size: 14px; cursor: pointer; padding: 0 2px; }
.view-del:hover { color: var(--red); }

.newview-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.newview-form input[type=text] {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 8px; padding: 6px 10px; font-size: 12.5px; width: 120px;
}
.newview-form select {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 8px; padding: 6px 8px; font-size: 12.5px;
}
.newview-form .btn { padding: 6px 12px; font-size: 12.5px; }
.mini-days { display: inline-flex; gap: 3px; }
.mini-day { position: relative; cursor: pointer; }
.mini-day input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.mini-day span {
    display: block; width: 26px; text-align: center; padding: 5px 0; border-radius: 6px;
    border: 1px solid var(--border-strong); font-size: 11px; font-weight: 600; color: var(--muted);
}
.mini-day input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }

.meeting-form {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 12px; box-shadow: var(--shadow);
}
.meeting-form input {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; min-width: 0;
}
.meeting-form input[type=text] { flex: 1 1 160px; font-weight: 500; }
.meeting-form input[type=email] { flex: 1 1 150px; }
.meeting-form input[type=number] { width: 68px; }
.meeting-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,92,245,.16); }
.meeting-form .btn { padding: 8px 14px; }

/* ── Calendar toolbar ──────────────────────────────────────── */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-navbtn {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
    border: 1px solid var(--border-strong); border-radius: 8px; text-decoration: none;
    color: var(--text); font-size: 18px; line-height: 1; background: var(--panel);
}
.cal-navbtn:hover { border-color: var(--accent); color: var(--accent-ink); }
.cal-today {
    border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 12px;
    text-decoration: none; color: var(--text); font-size: 13px; font-weight: 600; background: var(--panel);
}
.cal-today:hover { border-color: var(--accent); }
.cal-label { font-size: 15px; font-weight: 600; letter-spacing: -.02em; margin-left: 8px; }
.cal-modes { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.cal-mode { padding: 6px 14px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600;
    border-right: 1px solid var(--border); }
.cal-mode:last-child { border-right: none; }
.cal-mode:hover { background: var(--panel-2); color: var(--text); }
.cal-mode.active { background: var(--accent); color: #fff; }

.cal {
    display: flex; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    --rowpx: 46px;
}
.cal-scroll { max-height: 640px; overflow-y: auto; }
.cal-times { width: 52px; flex-shrink: 0; padding-top: 40px; border-right: 1px solid var(--border); }
.cal-hour { height: var(--rowpx); position: relative; }
.cal-hour span { position: absolute; top: -7px; right: 8px; font-size: 10.5px; color: var(--faint); }
.cal-days { display: flex; flex: 1; min-width: 0; }
.cal-day { flex: 1; min-width: 0; border-right: 1px solid var(--border); }
.cal-day:last-child { border-right: none; }
.cal-day-head {
    height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 5;
}
.cal-day-head.today { background: var(--accent-soft); }
.cd-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.cd-num { font-size: 15px; font-weight: 700; }
.cal-day-body {
    position: relative; height: calc(24 * var(--rowpx));
    background-image: repeating-linear-gradient(
        to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent var(--rowpx));
}

.cal-item {
    position: absolute; box-sizing: border-box; border-radius: 6px; padding: 2px 6px;
    overflow: hidden; font-size: 11px; min-height: 15px;
    text-decoration: none; color: inherit;
}
.cal-item.linkout { display: block; cursor: pointer; }
.cal-item.linkout:hover { box-shadow: 0 0 0 2px var(--accent) inset; }
.ci-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-time { font-size: 10px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Busy = existing calendar events — solid & readable */
.cal-item.busy {
    background: var(--panel-2); color: var(--text);
    border: 1px solid var(--border-strong); border-left: 3px solid var(--faint); z-index: 1;
}
/* Meeting = a real meeting (has a Meet link or created by motion-lite) */
.cal-item.meeting {
    background: rgba(34,165,101,.15); color: var(--green);
    border: 1px solid transparent; border-left: 3px solid var(--green); z-index: 3;
}
/* Plan blocks = the scheduler's proposal, colored by priority */
.cal-item.plan { z-index: 2; background: var(--accent-soft); color: var(--accent-ink);
    border: 1px solid transparent; border-left: 3px solid var(--accent); }
.cal-item.plan.p-1 { background: rgba(124,131,152,.16); color: var(--text); border-left-color: var(--faint); }
.cal-item.plan.p-3 { background: rgba(217,147,43,.15); color: var(--amber); border-left-color: var(--amber); }
.cal-item.plan.p-4 { background: rgba(229,72,77,.15); color: var(--red); border-left-color: var(--red); }

.cal-placeholder {
    background: var(--panel); border: 1px dashed var(--border-strong); border-radius: var(--radius);
    padding: 40px; text-align: center; color: var(--muted);
}
.cal-placeholder code { background: var(--panel-2); padding: 2px 6px; border-radius: 5px; }

/* ── Calendar skeleton (shown while the grid loads) ────────────── */
.cal-skeleton { display: flex; flex-direction: column; gap: 14px; }
.cal-skel-toolbar { height: 34px; width: 260px; border-radius: 9px; }
.cal-skel-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 560px; }
.cal-skel-toolbar, .cal-skel-col { border-radius: var(--radius);
    background: linear-gradient(100deg, var(--panel-2) 30%, var(--border) 50%, var(--panel-2) 70%);
    background-size: 220% 100%; animation: cal-shimmer 1.25s ease-in-out infinite; }
@keyframes cal-shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
@media (prefers-reduced-motion: reduce) { .cal-skel-toolbar, .cal-skel-col { animation: none; } }

/* At-risk */
.atrisk { margin-top: 16px; background: var(--panel); border: 1px solid var(--border);
    border-left: 3px solid var(--red); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.atrisk-head { font-weight: 700; color: var(--red); margin-bottom: 6px; font-size: 13px; }
.atrisk-row { display: flex; gap: 10px; padding: 3px 0; font-size: 13px; }
.ar-title { font-weight: 600; }
.ar-reason { color: var(--muted); }

/* ── Month grid ────────────────────────────────────────────── */
.month { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; }
.month-dow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.month-dow div { padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700; }
.month-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-cell { min-height: 104px; border-right: 1px solid var(--border); border-top: 1px solid var(--border);
    padding: 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.month-cell:nth-child(7n) { border-right: none; }
.month-cell.muted { background: var(--panel-2); }
.month-cell.muted .mc-num { color: var(--faint); }
.month-cell.today .mc-num {
    background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
}
.mc-num { font-size: 12.5px; font-weight: 700; color: var(--text); }
.mc-chip {
    font-size: 10.5px; padding: 2px 6px; border-radius: 5px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.mc-chip { text-decoration: none; display: block; }
.mc-chip.busy { background: rgba(124,131,152,.16); color: var(--text); }
.mc-chip.meeting { background: rgba(34,165,101,.16); color: var(--green); font-weight: 600; }
.mc-chip.plan { background: var(--accent-soft); color: var(--accent-ink); }
.mc-chip.linkout:hover { filter: brightness(0.95); }
.mc-chip.plan.p-3 { background: rgba(217,147,43,.15); color: var(--amber); }
.mc-chip.plan.p-4 { background: rgba(229,72,77,.15); color: var(--red); }
.mc-more { font-size: 10px; color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .tasks-panel { width: auto; }
    .sidebar { width: 60px; padding: 14px 8px; }
    .brand-name, .nav-item span:not(.nav-ico), .sidebar-foot { display: none; }
}

/* ── Public booking page ───────────────────────────────────────────── */
.book-body { display: flex; justify-content: center; padding: 32px 16px; }
.book-card {
    width: 100%; max-width: 560px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
    padding: 26px 28px;
}
.book-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.book-head h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.book-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.book-head .brand-dot { margin-top: 5px; flex-shrink: 0; }

.book-step { font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); margin: 20px 0 10px;
    display: flex; align-items: center; gap: 8px; }
.stepnum { display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft);
    color: var(--accent-ink); font-size: 12px; }

.day-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.day-tab {
    border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
    border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.day-tab:hover { border-color: var(--accent); }
.day-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slot span {
    display: block; text-align: center; padding: 10px 0; border-radius: 9px;
    border: 1px solid var(--border-strong); font-size: 14px; font-weight: 600;
    color: var(--text); transition: all .1s;
}
.slot input:hover + span { border-color: var(--accent); }
.slot input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }

.book-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.book-fields label { flex: 1 1 200px; display: flex; flex-direction: column; gap: 5px;
    font-size: 12px; color: var(--muted); font-weight: 500; }
.book-fields input {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 9px; padding: 10px 12px; font-size: 14px; outline: none;
}
.book-fields input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,92,245,.16); }

.book-submit { width: 100%; margin-top: 18px; padding: 12px; font-size: 15px; }
.book-note { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.book-note a { color: var(--accent); text-decoration: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.booked-card { text-align: center; }
.booked-check {
    width: 56px; height: 56px; border-radius: 50%; margin: 6px auto 14px;
    background: var(--green); color: #fff; font-size: 30px; line-height: 56px; font-weight: 700;
}
.booked-when { font-size: 17px; font-weight: 600; margin: 0 0 4px; }

/* ── Settings page ─────────────────────────────────────────── */
.settings { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.set-card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.set-row { margin-bottom: 14px; }
.set-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daybox { position: relative; cursor: pointer; }
.daybox input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.daybox span {
    display: block; min-width: 46px; text-align: center; padding: 8px 0; border-radius: 9px;
    border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; color: var(--muted);
}
.daybox input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.set-grid label, .set-row label:not(.daybox) {
    display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500;
}
.set-grid label.wide { grid-column: 1 / -1; }
.set-grid input {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 9px; padding: 9px 11px; font-size: 14px; outline: none;
}
.set-grid input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,92,245,.16); }
.set-save { align-self: flex-start; padding: 11px 22px; }

/* ── Click-to-edit ─────────────────────────────────────────── */
.clickable { cursor: pointer; }
.cal-item.clickable:hover { box-shadow: 0 0 0 2px var(--accent) inset; }
.task-body.clickable:hover .task-title { color: var(--accent-ink); }
.banner a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.banner a:hover { text-decoration: underline; }

.modal[hidden] { display: none; }
.modal {
    position: fixed; inset: 0; z-index: 50; display: flex;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(12,15,25,.5); }
.modal-card {
    position: relative; width: 100%; max-width: 460px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
    padding: 20px 22px;
    /* Never exceed the viewport — scroll inside the card instead of spilling
       off the top (fallback vh first, then dynamic dvh for mobile chrome). */
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}
/* Keep the title + close button in view while the form scrolls. */
.modal-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
    position: sticky; top: -20px; background: var(--panel);
    padding-top: 20px; margin-top: -20px; z-index: 1;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-x { border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-x:hover { color: var(--text); }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
/* The class rule above beats the UA `[hidden]{display:none}`, so hidden forms
   still rendered (stacking all of them). Restore hiding explicitly. */
.modal-form[hidden] { display: none; }
.modal-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.modal-form input, .modal-form select {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 9px; padding: 9px 11px; font-size: 14px; outline: none;
}
.modal-form input:focus, .modal-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,92,245,.16); }
.modal-row { display: flex; gap: 10px; }
.modal-row label { flex: 1; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.modal-spacer { flex: 1; }

/* Event modal specifics */
.evt-typebar { display: flex; align-items: center; gap: 10px; }
.evt-badge {
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
    background: rgba(124,131,152,.16); color: var(--muted);
}
.evt-badge.video { background: rgba(34,165,101,.16); color: var(--green); }
.evt-badge.inperson { background: rgba(217,147,43,.16); color: var(--amber); }
.evt-when { color: var(--muted); font-size: 13px; }
.evt-cta { display: flex; align-items: center; gap: 10px; }
.evt-hint { color: var(--faint); font-size: 11px; }
.evt-attendees { color: var(--muted); font-size: 13px; }
.evt-readonly { color: var(--amber); font-size: 12px; margin: 0; }
.modal-form input:read-only { opacity: .7; cursor: default; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Agenda (day-grouped checklist) ────────────────────────── */
.agenda { padding: 20px 24px; max-width: 720px; display: flex; flex-direction: column; gap: 18px; }
.agenda-day { display: flex; flex-direction: column; gap: 8px; }
.agenda-dayhead {
    font-size: 13px; font-weight: 700; color: var(--text);
    border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.agenda-dayhead.unscheduled { color: var(--muted); }
.agenda-hint { font-weight: 500; color: var(--faint); font-size: 12px; }
.agenda-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agenda-item {
    display: flex; align-items: center; gap: 10px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; box-shadow: var(--shadow);
}
.agenda-item.done { opacity: .55; }
.agenda-item.done .agenda-title { text-decoration: line-through; }
.agenda-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agenda-body.clickable:hover .agenda-title { color: var(--accent-ink); }
.agenda-title { font-weight: 550; }

/* ── AI notetaker panel (in the event modal) ───────────────── */
.evt-note {
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--panel-2); padding: 10px 12px;
    display: flex; flex-direction: column; gap: 8px;
}
.evt-note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.evt-note-title { font-size: 12px; font-weight: 700; color: var(--text); }
.evt-note-status {
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
    background: rgba(124,131,152,.16); color: var(--muted);
}
.evt-note-status.s-recording { background: rgba(229,72,77,.16); color: var(--red); }
.evt-note-status.s-transcribing { background: rgba(217,147,43,.16); color: var(--amber); }
.evt-note-status.s-done { background: rgba(34,165,101,.16); color: var(--green); }
.evt-note-status.s-failed { background: rgba(229,72,77,.16); color: var(--red); }
.evt-note-tldr { margin: 0; font-size: 13px; color: var(--text); line-height: 1.45; }
.evt-note-link { font-size: 12px; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.evt-note-link:hover { text-decoration: underline; }

/* ── Notes page ────────────────────────────────────────────── */
.notes-list { padding: 20px 24px; max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.note-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.note-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note-card-title { margin: 0; font-size: 15px; }
.note-card-when { color: var(--muted); font-size: 12px; }
.note-card-tldr { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.note-detail summary {
    cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent-ink);
    list-style: none; padding: 4px 0;
}
.note-detail summary::-webkit-details-marker { display: none; }
.note-detail summary::before { content: "▸ "; }
.note-detail[open] summary::before { content: "▾ "; }
.note-body {
    white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5;
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px 14px; margin: 6px 0 0; max-height: 420px; overflow-y: auto;
    font-family: inherit; color: var(--text);
}
.note-transcript { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--muted); }

/* ── Global "＋ New" menu (sidebar) ─────────────────────────── */
.newwrap { position: relative; }
.newbtn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 12px; border: none; border-radius: 8px; cursor: pointer;
    background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
}
.newbtn:hover { background: var(--accent-ink); }
.newbtn-plus { font-size: 16px; line-height: 1; }
.newmenu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
    background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px;
    box-shadow: 0 8px 28px rgba(20,23,40,.18); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
/* The display:flex above beats the `hidden` attribute — restore collapsing so
   the menu only appears when ＋New is clicked (not plainly in the sidebar). */
.newmenu[hidden] { display: none; }
.newmenu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 9px 10px; border: none; background: none; border-radius: 8px; cursor: pointer;
    color: var(--text); font-size: 13.5px; font-weight: 550;
}
.newmenu-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nmi-ico { width: 18px; text-align: center; font-size: 14px; }

/* Collapsed sidebar (narrow screens): show just the plus */
@media (max-width: 720px) {
    .newbtn { padding: 9px 0; }
    .newbtn span:not(.newbtn-plus) { display: none; }
    .newmenu { left: 0; right: auto; width: 190px; }
}

/* ── "Now" line: where you are in the day ──────────────────── */
.now-line {
    position: absolute; left: 0; right: 0; top: 0; height: 0; z-index: 20;
    border-top: 3px solid #f7c400;                 /* big & bright yellow */
    box-shadow: 0 0 7px rgba(247,196,0,.75);
    pointer-events: none;                          /* never blocks clicking events */
}
.now-dot {
    position: absolute; left: -5px; top: -6px; width: 11px; height: 11px;
    border-radius: 50%; background: #f7c400;
    box-shadow: 0 0 0 3px rgba(247,196,0,.28), 0 0 6px rgba(247,196,0,.9);
}

/* ── AI assistant (chat) ───────────────────────────────────── */
.chat { display: flex; flex-direction: column; height: calc(100vh - 120px); max-width: 760px; padding: 0 24px 16px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 2px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-bubble {
    max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5;
    white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .chat-bubble {
    background: var(--panel); border: 1px solid var(--border); color: var(--text);
    border-bottom-left-radius: 4px; box-shadow: var(--shadow);
}
.chat-bubble.thinking { color: var(--muted); font-style: italic; }
.chat-empty { color: var(--muted); font-size: 14px; margin: auto 0; }
.chat-empty ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.chat-empty li { line-height: 1.5; }
.chat-input { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.chat-input input {
    flex: 1; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
    border-radius: 10px; padding: 11px 14px; font-size: 14px; outline: none;
}
.chat-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,92,245,.16); }

/* ── Docs / Wiki workspace ─────────────────────────────────── */
.docs { display: flex; flex: 1; min-height: 0; }
.docs-tree {
    width: 250px; flex-shrink: 0; border-right: 1px solid var(--border);
    background: var(--panel); padding: 14px; display: flex; flex-direction: column; gap: 12px;
    overflow-y: auto;
}
.doc-new { display: flex; flex-direction: column; gap: 6px; }
.doc-new input {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none;
}
.doc-new input:focus { border-color: var(--accent); }
.doc-new .btn { padding: 7px 10px; justify-content: center; }
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-group { display: flex; flex-direction: column; gap: 2px; }
.doc-folder { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
    letter-spacing: .05em; padding: 4px 6px; }
.doc-item {
    display: block; padding: 7px 10px; border-radius: 8px; color: var(--text);
    text-decoration: none; font-size: 13.5px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-item:hover { background: var(--panel-2); }
.doc-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.doc-empty { color: var(--muted); font-size: 13px; padding: 6px; }

.docs-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px 20px; overflow-y: auto; }
.docs-blank { margin: auto; max-width: 420px; }
#doc-form { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.doc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-title {
    flex: 1; min-width: 180px; border: none; background: transparent; color: var(--text);
    font-size: 22px; font-weight: 700; letter-spacing: -.02em; outline: none; padding: 2px 0;
}
.doc-folder-input {
    width: 150px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
    border-radius: 8px; padding: 6px 9px; font-size: 12.5px; outline: none;
}
.doc-updated { color: var(--faint); font-size: 12px; }

.ai-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 12px; border-radius: 10px;
    background: linear-gradient(135deg, rgba(122,92,255,.08), rgba(185,107,255,.06));
    border: 1px solid rgba(122,92,255,.22);
}
.ai-toolbar .btn { padding: 6px 11px; font-size: 12.5px; }
.ai-toolbar #ai-instruction {
    flex: 1; min-width: 160px; border: 1px solid var(--border-strong); background: var(--panel);
    color: var(--text); border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none;
}
.ai-status { color: var(--muted); font-size: 12px; font-style: italic; }

.doc-split { display: flex; gap: 14px; flex: 1; min-height: 320px; }
.doc-content {
    flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 14px;
    background: var(--panel); color: var(--text); resize: none; outline: none;
    font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.6;
}
.doc-content:focus { border-color: var(--accent); }
.doc-preview {
    flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px;
    background: var(--panel-2); overflow-y: auto; font-size: 14px; line-height: 1.6;
}
.doc-preview h1, .doc-preview h2, .doc-preview h3 { margin: 14px 0 8px; line-height: 1.3; }
.doc-preview h1 { font-size: 22px; } .doc-preview h2 { font-size: 18px; } .doc-preview h3 { font-size: 15px; }
.doc-preview p { margin: 8px 0; }
.doc-preview ul, .doc-preview ol { margin: 8px 0; padding-left: 22px; }
.doc-preview li { margin: 3px 0; }
.doc-preview code { background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
    padding: 1px 5px; font-size: 12.5px; }
.doc-preview pre { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; overflow-x: auto; }
.doc-preview pre code { border: none; padding: 0; background: none; }
.doc-preview blockquote { border-left: 3px solid var(--border-strong); margin: 8px 0; padding: 2px 12px;
    color: var(--muted); }
.doc-preview a { color: var(--accent-ink); }
.doc-preview hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

@media (max-width: 900px) {
    .doc-split { flex-direction: column; }
    .docs-tree { width: 200px; }
}

/* ── Phase 4: recurrence + subtask chips ───────────────────── */
.recur-chip { font-size: 11px; font-weight: 600; color: var(--accent-ink);
    background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; }
.sub-chip { font-size: 11px; font-weight: 600; color: var(--muted);
    background: rgba(124,131,152,.14); padding: 1px 7px; border-radius: 999px; }

/* Subtask checklist (in the task modal) */
.subtasks { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
    background: var(--panel-2); display: flex; flex-direction: column; gap: 8px; }
.subtasks-head { font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); }
.subtask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.subtask { display: flex; align-items: center; gap: 9px; }
.subtask-box { width: 16px; height: 16px; flex-shrink: 0; border-radius: 5px;
    border: 1.5px solid var(--border-strong); background: var(--panel); cursor: pointer; padding: 0; }
.subtask-box:hover { border-color: var(--accent); }
.subtask-box.on { background: var(--green); border-color: var(--green); }
.subtask-title { flex: 1; font-size: 13.5px; color: var(--text); word-break: break-word; }
.subtask.done .subtask-title { text-decoration: line-through; color: var(--muted); }
.subtask-del { border: none; background: none; color: var(--faint); font-size: 16px;
    line-height: 1; cursor: pointer; padding: 0 2px; }
.subtask-del:hover { color: var(--red); }
.subtask-add { display: flex; gap: 6px; }
.subtask-add input { flex: 1; border: 1px solid var(--border); background: var(--panel);
    color: var(--text); border-radius: 8px; padding: 6px 9px; font-size: 13px; outline: none; }
.subtask-add input:focus { border-color: var(--accent); }
.subtask-add .btn { padding: 6px 12px; }

/* Doc project tag in the tree */
.doc-proj { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
    color: var(--accent-ink); background: var(--accent-soft); padding: 0 6px;
    border-radius: 999px; vertical-align: middle; }

/* ── Phase 5: agenda email settings ────────────────────────── */
.set-note { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; line-height: 1.5; }
.set-note code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
.set-toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; cursor: pointer; margin-bottom: 12px; }
.set-toggle input { width: 16px; height: 16px; }
.set-actions { display: flex; }
.set-sendnow { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.set-sendnow .set-note { margin: 0; }

/* ── Drag-to-move + click-to-create on the calendar ────────── */
.cal-item.draggable { cursor: grab; }
.cal-item.dragging { cursor: grabbing; opacity: .85; z-index: 40;
    box-shadow: 0 6px 18px rgba(20,23,40,.28); }
.cal-day-body.clickable-grid { cursor: copy; }
.cal-day-body.clickable-grid .cal-item { cursor: pointer; }
.cal-item.draggable { cursor: grab; }

/* ── Mobile navigation: hamburger + slide-out drawer ───────── */
.nav-toggle {
    display: none; position: fixed; top: 10px; left: 10px; z-index: 90;
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-strong);
    background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer;
    align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.nav-backdrop { display: none; }

@media (max-width: 720px) {
    .nav-toggle { display: flex; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 100;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: 0 0 40px rgba(0,0,0,.4); padding: 18px 14px; gap: 18px; overflow-y: auto;
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .nav-backdrop {
        display: block; position: fixed; inset: 0; z-index: 95;
        background: rgba(12,15,25,.5); opacity: 0; pointer-events: none; transition: opacity .22s ease;
    }
    body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
    /* Restore full labels inside the drawer (override the old icon-only rules). */
    .brand-name { display: inline; }
    .sidebar-foot { display: block; }
    .nav-item span:not(.nav-ico) { display: inline; }
    .newbtn { padding: 9px 12px; }
    .newbtn span:not(.newbtn-plus) { display: inline; }
    .newmenu { left: 0; right: 0; width: auto; }
    /* Room for the floating hamburger so it doesn't cover the page title. */
    .topbar { padding-left: 60px; }
}

/* ── Destination pages: Projects & Views ───────────────────── */
.dest-page { padding: 20px 24px; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.dest-new {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px; box-shadow: var(--shadow);
}
.dest-new input[type=text] {
    flex: 1; min-width: 160px; border: 1px solid var(--border); background: var(--panel-2);
    color: var(--text); border-radius: 9px; padding: 9px 11px; font-size: 14px; outline: none;
}
.dest-new input[type=text]:focus { border-color: var(--accent); }
.dest-new select {
    border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 8px; padding: 8px 10px; font-size: 13px;
}

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.proj-card, .view-card {
    display: flex; align-items: center; background: var(--panel);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.proj-card-main, .view-card-main {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
    padding: 13px 14px; text-decoration: none; color: var(--text);
}
.proj-card-main { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.proj-card-name, .view-card-name { font-weight: 650; font-size: 14.5px; }
.proj-card-meta, .view-card-meta { color: var(--muted); font-size: 12.5px; }
.proj-card-main:hover .proj-card-name, .view-card-main:hover .view-card-name { color: var(--accent-ink); }
.proj-card .proj-del, .view-card .proj-del {
    border: none; background: none; color: var(--faint); font-size: 20px; line-height: 1;
    cursor: pointer; padding: 0 12px; align-self: stretch;
}
.proj-card .proj-del:hover, .view-card .proj-del:hover { color: var(--red); }
.proj-card form, .view-card form { margin: 0; display: flex; }

.view-cards { display: flex; flex-direction: column; gap: 10px; }

/* ── Perceived responsiveness: instant click feedback ──────── */
#nav-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999;
    background: linear-gradient(90deg, var(--accent), #b96bff);
    box-shadow: 0 0 8px rgba(122,92,255,.6); opacity: 0; pointer-events: none;
}

/* Tactile press — controls physically depress on click */
.btn, .cal-navbtn, .cal-mode, .cal-today, .view-pill, .proj-pill,
.nav-item, .newmenu-item, .newbtn, .chk {
    transition: transform .07s ease, background .12s ease, color .12s ease,
        border-color .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active, .cal-navbtn:active, .cal-mode:active, .cal-today:active,
.view-pill:active, .proj-pill:active, .newmenu-item:active, .newbtn:active {
    transform: translateY(1px) scale(.985);
}
.nav-item:active { transform: translateX(2px); }
.cal-item.clickable:active { transform: scale(.99); filter: brightness(.97); }

/* Submit-in-progress spinner on the pressed button */
.btn.is-loading { opacity: .8; cursor: wait; pointer-events: none; }
.btn.is-loading::after {
    content: ""; width: 12px; height: 12px; margin-left: 8px; flex: none;
    border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
    display: inline-block; vertical-align: -2px; animation: ml-spin .6s linear infinite;
}
@keyframes ml-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    #nav-progress { display: none; }
    .btn, .cal-mode, .view-pill, .nav-item, .cal-navbtn { transition: none; }
}

/* ── Notetaker → tasks row ─────────────────────────────────── */
.note-tasks-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-tasks-chip {
    font-size: 12.5px; font-weight: 600; color: var(--green); text-decoration: none;
    background: rgba(34,165,101,.14); padding: 4px 10px; border-radius: 999px;
}
.note-tasks-chip:hover { text-decoration: underline; }
.note-tasks-row .btn { padding: 6px 11px; font-size: 12.5px; }

/* ── AI Project planner form ───────────────────────────────── */
.ai-plan-form {
    background: linear-gradient(135deg, rgba(122,92,255,.08), rgba(185,107,255,.06));
    border: 1px solid rgba(122,92,255,.28); border-radius: var(--radius);
    padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.ai-plan-head { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ai-plan-form textarea {
    width: 100%; border: 1px solid var(--border); background: var(--panel); color: var(--text);
    border-radius: 9px; padding: 10px 12px; font-size: 14px; font-family: inherit;
    resize: vertical; outline: none;
}
.ai-plan-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,92,245,.16); }
.ai-plan-form .btn { align-self: flex-start; }

/* ── Auto-reschedule status dot ────────────────────────────── */
.auto-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--green); margin-right: 4px; vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(34,165,101,.5); animation: auto-pulse 2.2s infinite;
}
@keyframes auto-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,165,101,.5); }
    70% { box-shadow: 0 0 0 6px rgba(34,165,101,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,165,101,0); }
}

/* ── On-device recorder ────────────────────────────────────── */
.rec-body { display: flex; flex-direction: column; gap: 14px; }
.rec-title { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.rec-title input { border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
    border-radius: 9px; padding: 9px 11px; font-size: 14px; outline: none; }
.rec-stage { display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 22px 16px; text-align: center; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--border-strong); }
.rec-dot.on { background: var(--red); animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229,72,77,.5); }
    50% { opacity: .6; box-shadow: 0 0 0 8px rgba(229,72,77,0); } }
.rec-timer { font-size: 30px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.rec-status { color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 380px; }
.rec-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); }
.rec-consent input { margin-top: 2px; }

/* ── Auth (login / signup) ─────────────────────────────────── */
/* Auth page: Sollos-style subtle wash + faint dot grid behind a clean card. */
.auth-wrap { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); }
.auth-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(currentColor 1px, transparent 1px);
    background-size: 24px 24px; color: rgba(24,24,27,.045); }
@media (prefers-color-scheme: dark) {
    .auth-wrap { background: linear-gradient(180deg, #101012 0%, var(--bg) 100%); }
    .auth-wrap::before { color: rgba(255,255,255,.05); }
}
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow); padding: 28px 26px; display: flex; flex-direction: column; gap: 6px; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.auth-title { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.03em; }
.auth-sub { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.auth-notice { background: rgba(229,72,77,.12); color: var(--red); font-size: 13px;
    padding: 9px 12px; border-radius: 9px; margin: 4px 0; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.auth-form input { border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--text);
    border-radius: 10px; padding: 11px 13px; font-size: 14px; outline: none; }
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-submit { justify-content: center; padding: 11px; margin-top: 4px; font-size: 14px; }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.auth-alt a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* Account chip in the sidebar */
/* Account chip + install button live on the dark sidebar → light-on-dark. */
.acct { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-top: 1px solid var(--sidebar-border); margin-top: 4px; }
.acct-avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; }
.acct-who { flex: 1; min-width: 0; }
.acct-name { font-size: 12.5px; font-weight: 600; color: var(--sidebar-fg-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-plan { font-size: 11px; color: #71717a; text-transform: capitalize; }
.acct-out { border: none; background: none; color: #a1a1aa; cursor: pointer; font-size: 15px; padding: 2px 4px; }
.acct-out:hover { color: var(--red); }

/* The "Install app" button sits directly in the dark sidebar (not the popover). */
#pwa-install { color: var(--sidebar-fg); }
#pwa-install:hover { background: var(--sidebar-active-bg); color: var(--sidebar-fg-strong); }
