/* Plan — panel arayüzü. Bootstrap 5 üzerine ince bir katman. */

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e4e8ee;
    --border-strong: #cfd6e0;
    --text: #1c2733;
    --muted: #667385;
    --accent: #173f69;
    --accent-dark: #0f2c4c;
    --accent-soft: #e8eff7;
    --amber: #e8960c;
    --amber-soft: #fff4dc;
    --green: #2a8a5a;
    --green-soft: #e3f4ea;
    --danger: #c0392b;
    --danger-soft: #fdeceb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --sidebar-w: 248px;
    color-scheme: light;
}

html { font-size: 15px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 650; letter-spacing: -.01em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--accent) !important; }
.text-danger { color: var(--danger) !important; }
:focus-visible { outline: 3px solid rgba(23, 63, 105, .35) !important; outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }

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

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 22px 14px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 4px 10px 22px;
    text-decoration: none; color: var(--text); font-weight: 650; font-size: 1.05rem;
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: .95rem;
}

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 9px;
    color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.side-nav a i { width: 18px; text-align: center; font-size: .95rem; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side-nav .nav-label { margin: 18px 12px 6px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8b96a5; }

.side-user {
    margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.side-user .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; color: var(--text); }
.avatar {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 650;
}
.side-user .name { font-weight: 550; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
    border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 8px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }

.main { flex: 1; min-width: 0; }
.content { max-width: 1120px; margin: 0 auto; padding: 36px 36px 56px; }

.topbar { display: none; }

.guest-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.guest-brand { margin-bottom: 22px; }
.guest-card { width: 100%; max-width: 410px; }

@media (max-width: 991.98px) {
    .app-shell { display: block; }
    .topbar {
        display: flex; align-items: center; justify-content: space-between;
        position: sticky; top: 0; z-index: 30;
        background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px;
    }
    .topbar .brand { padding: 0; }
    .sidebar {
        position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; height: auto;
        transform: translateX(-100%); transition: transform .2s ease; box-shadow: none;
    }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(16, 24, 40, .25); }
    .scrim { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 35; }
    body.nav-open .scrim { display: block; }
    .content { padding: 22px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- Page pieces ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: 1.75rem; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .back { font-size: .85rem; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.page-head .back:hover { color: var(--accent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-body { padding: 22px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; font-size: 1rem; }
.panel-title .count { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; }

.form-card { max-width: 560px; margin: 8px auto 0; }
.form-card h1 { font-size: 1.4rem; margin: 0 0 20px; }

.empty-state {
    background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
    padding: 40px 24px; text-align: center; color: var(--muted);
}
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.9rem; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.stat.late .value { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
    --bs-btn-border-radius: var(--radius-sm); --bs-btn-font-weight: 550;
    --bs-btn-padding-x: .95rem; --bs-btn-padding-y: .5rem; --bs-btn-font-size: .9rem;
    box-shadow: none !important;
}
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .32rem; --bs-btn-font-size: .82rem; }
.btn-primary {
    --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark); --bs-btn-active-color: #fff;
}
.btn-outline-primary {
    --bs-btn-color: var(--accent); --bs-btn-border-color: #b8c7da;
    --bs-btn-hover-bg: var(--accent-soft); --bs-btn-hover-color: var(--accent); --bs-btn-hover-border-color: var(--accent);
    --bs-btn-active-bg: var(--accent-soft); --bs-btn-active-color: var(--accent); --bs-btn-active-border-color: var(--accent);
}
.btn-outline-secondary {
    --bs-btn-color: var(--text); --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: #b3bdca;
    --bs-btn-active-bg: var(--surface-2); --bs-btn-active-color: var(--text); --bs-btn-active-border-color: #b3bdca;
}
.btn-outline-danger {
    --bs-btn-color: var(--danger); --bs-btn-border-color: #e8b9b4;
    --bs-btn-hover-bg: var(--danger); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--danger);
    --bs-btn-active-bg: var(--danger); --bs-btn-active-color: #fff; --bs-btn-active-border-color: var(--danger);
}
.btn-link { --bs-btn-color: var(--accent); --bs-btn-hover-color: var(--accent-dark); text-decoration: none; }

/* ---------- Forms ---------- */
.form-label { font-size: .85rem; font-weight: 550; color: #3d4b5c; margin-bottom: .3rem; }
.form-control, .form-select {
    border-radius: var(--radius-sm); border-color: var(--border-strong); background-color: #fff;
    padding: .55rem .75rem; font-size: .95rem;
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(23, 63, 105, .14); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(23, 63, 105, .14); border-color: var(--accent); }

/* ---------- Alerts & badges ---------- */
.alert { border-radius: var(--radius-sm); border: 1px solid; font-size: .92rem; padding: .7rem 1rem; }
.alert-success { background: var(--green-soft); border-color: #b9e0c9; color: #1f6b46; }
.alert-danger { background: var(--danger-soft); border-color: #f1c4c0; color: #99281d; }

.badge { font-weight: 600; font-size: .72rem; padding: .32em .65em; border-radius: 999px; }
.badge.bg-danger { background: var(--danger-soft) !important; color: var(--danger) !important; }
.badge.bg-warning { background: var(--amber-soft) !important; color: #a86500 !important; }
.badge.bg-secondary { background: #edf0f4 !important; color: #5a6676 !important; }

/* ---------- Task rows (dashboard) ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: 0; }
.task-row .main { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.task-row .title { font-weight: 550; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.task-row .title:hover { color: var(--accent); text-decoration: underline; }
.task-row .project { font-size: .8rem; color: var(--muted); }
.task-row .when { font-size: .82rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-row .when.late { color: var(--danger); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 991.98px) { .dash-grid { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 20px; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.project-card .card-body { display: flex; flex-direction: column; height: 100%; }
.project-card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.progress { height: 6px; border-radius: 999px; background: #e9edf3; }
.progress-bar { background: var(--accent); border-radius: 999px; }

/* ---------- Todo board ---------- */
.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 767.98px) { .board { grid-template-columns: 1fr; } }
.board h2 { font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.board-list {
    min-height: 220px; padding: 10px; border-radius: var(--radius);
    background: #eaeef4; border: 1px dashed var(--border-strong);
}
.todo-card { cursor: grab; border-radius: 10px; margin-bottom: 8px; border-left: 4px solid #c4ccd8; box-shadow: var(--shadow); }
.todo-card.prio-high { border-left-color: var(--danger); }
.todo-card.prio-mid { border-left-color: var(--amber); }
.todo-card .card-body { padding: 12px 14px; }
.todo-card h3 { font-size: .98rem; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.todo-card.sortable-ghost { opacity: .4; }
.todo-card .meta { font-size: .78rem; color: var(--muted); }
.btn-check-complete { background: none; border: 0; padding: 0; font-size: 1.15rem; line-height: 1; color: var(--accent); min-width: 24px; }
.btn-check-complete:hover { color: var(--green); }
.todo-card .grip { color: #aab3c0; font-size: .8rem; }

/* ---------- Calendar ---------- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-header { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; padding: 4px 0 6px; font-weight: 600; }
.calendar-cell { min-height: 118px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.calendar-cell-empty { background: transparent; border: 0; }
.calendar-cell-today { background: var(--accent-soft); border-color: var(--accent); }
.calendar-day-number { font-weight: 650; font-size: .95rem; margin-bottom: 6px; }
.calendar-cell-today .calendar-day-number { color: var(--accent); }
.calendar-todo { font-size: .72rem !important; line-height: 1.5; font-weight: 550; text-align: left; border-radius: 6px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; text-decoration: none; margin-bottom: 4px; }
.calendar-more { font-size: .75rem; color: var(--muted); }
.calendar-more summary { cursor: pointer; }
.calendar-agenda { display: none; }
@media (max-width: 767.98px) {
    .calendar-grid { display: none; }
    .calendar-agenda { display: block; }
    .agenda-day { border-top: 1px solid var(--border); padding: 14px 0; }
    .agenda-day h3 { font-size: 1rem; margin-bottom: 6px; }
    .agenda-day a { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
    .agenda-day time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
}

/* ---------- Topics / streaks ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.topic-card { border-top: 4px solid var(--topic, var(--accent)); }
.topic-card .card-body { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.topic-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topic-name { font-size: 1.1rem; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
.topic-name a { color: var(--text); text-decoration: none; }
.topic-name a:hover { color: var(--accent); }
.streak { display: flex; align-items: baseline; gap: 8px; }
.streak .flame { color: #c4ccd8; font-size: 1.25rem; align-self: center; }
.streak.alive .flame { color: var(--amber); }
.streak .big { font-size: 2.4rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.streak .unit { color: var(--muted); font-size: .9rem; }
.topic-meta { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.topic-meta b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.risk-note { font-size: .8rem; color: #a86500; background: var(--amber-soft); border-radius: 6px; padding: 4px 10px; }
.risk-note[hidden] { display: none; }

.btn-check-in { width: 100%; }
.btn-check-in.is-done { --bs-btn-bg: var(--green-soft); --bs-btn-border-color: #b9e0c9; --bs-btn-color: #1f6b46; --bs-btn-hover-bg: #d4eddf; --bs-btn-hover-border-color: #9fd2b6; --bs-btn-hover-color: #1f6b46; --bs-btn-active-bg: #d4eddf; --bs-btn-active-color: #1f6b46; }

.strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.strip i { display: block; aspect-ratio: 1; border-radius: 4px; background: #e9edf3; }
.strip i.is-done { background: var(--topic, var(--accent)); }
.strip i.is-today { outline: 2px solid var(--text); outline-offset: 1px; }

.heat-wrap { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; --cell: 17px; }
.heat-days { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: 4px; margin-top: 22px; font-size: .68rem; color: var(--muted); line-height: var(--cell); }
.heat-body { display: flex; flex-direction: column; gap: 4px; }
.heat-months { display: grid; grid-auto-flow: column; grid-auto-columns: var(--cell); gap: 4px; height: 18px; font-size: .7rem; color: var(--muted); }
.heat-months span { white-space: nowrap; overflow: visible; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell)); grid-auto-columns: var(--cell); gap: 4px; }
.heat-cell { width: var(--cell); height: var(--cell); border-radius: 4px; background: #e9edf3; border: 0; padding: 0; }
.heat-cell.is-done { background: var(--topic, var(--accent)); }
.heat-cell.is-future { visibility: hidden; }
.heat-cell.is-today { outline: 2px solid var(--text); outline-offset: 1px; }
.heat-cell:not(.is-future):hover { outline: 2px solid var(--topic, var(--accent)); outline-offset: 1px; cursor: pointer; }
@media (max-width: 575.98px) { .heat-wrap { --cell: 14px; } }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 14px; align-items: baseline; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: 0; }
.history time { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.history .note { flex: 1; overflow-wrap: anywhere; }
.history .note.empty { color: #9aa5b3; font-style: italic; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches input { position: absolute; opacity: 0; }
.swatches label { width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.swatches input:checked + label { box-shadow: 0 0 0 2px var(--text); }
.swatches input:focus-visible + label { outline: 3px solid rgba(23, 63, 105, .35); outline-offset: 2px; }

/* ---------- Reminders ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.time-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 6px 5px 15px; font-weight: 650; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.time-chip button { border: 0; background: none; color: var(--accent); width: 26px; height: 26px; border-radius: 50%; line-height: 1; }
.time-chip button:hover { background: #fff; color: var(--danger); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 7px; }
.status-dot.off { background: #aab3c0; }

/* ---------- Lists (users) ---------- */
.list-group { border-radius: var(--radius); box-shadow: var(--shadow); }
.list-group-item { background: var(--surface); border-color: var(--border); padding: 14px 18px; gap: 12px; flex-wrap: wrap; }

/* An empty validation summary must not render as a red box. */
.validation-summary-valid { display: none; }
.swatches { position: relative; }
.page-head .actions form { margin: 0; }

/* ---------- Contexts, quick add, task rows ---------- */
.new-task-btn { margin: 0 4px 16px; display: flex; justify-content: center; gap: 8px; }
.context-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.context-chip i, .filter-chips a i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.task-row.is-done .title { text-decoration: line-through; color: var(--muted); }

.quick-add { display: flex; flex-direction: column; gap: 10px; }
.quick-add .qa-extra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 120px) minmax(0, 1fr) auto; gap: 8px; }
.quick-add .qa-extra:has(> input[type=hidden]) { grid-template-columns: minmax(0, 140px) minmax(0, 1fr) auto; }
@media (max-width: 575.98px) {
    .quick-add .qa-extra, .quick-add .qa-extra:has(> input[type=hidden]) { grid-template-columns: 1fr 1fr; }
    .quick-add .qa-extra .btn { grid-column: 1 / -1; }
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chips a {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; font-size: .86rem; font-weight: 550;
}
.filter-chips a:hover { background: var(--surface-2); }
.filter-chips a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chips a.manage { color: var(--muted); }
details.card > summary { cursor: pointer; list-style: none; display: flex; }
details.card > summary::-webkit-details-marker { display: none; }

/* ---------- Toasts ---------- */
.toast-zone { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); }
.app-toast {
    display: flex; align-items: center; gap: 12px; background: var(--text); color: #fff; border-radius: 10px;
    padding: 10px 10px 10px 16px; box-shadow: 0 8px 24px rgba(16, 24, 40, .25); font-size: .9rem;
}
.app-toast > span { flex: 1; }
.app-toast form { margin: 0; }
.app-toast .btn-link { --bs-btn-color: #9cc3ff; --bs-btn-hover-color: #fff; font-weight: 650; }
.app-toast .icon-btn { color: #c8d0da; width: 28px; height: 28px; }
.app-toast .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Calendar (drag & drop) ---------- */
.calendar-cell { display: flex; flex-direction: column; min-width: 0; }
.calendar-cell-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.calendar-cell-head .calendar-day-number { margin: 0; color: var(--text); text-decoration: none; border-radius: 6px; padding: 0 5px; margin-left: -5px; }
.calendar-cell-head .calendar-day-number:hover { background: var(--accent-soft); color: var(--accent); }
.calendar-add { color: #aab3c0; font-size: .75rem; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; opacity: 0; }
.calendar-cell:hover .calendar-add, .calendar-add:focus-visible { opacity: 1; }
.calendar-add:hover { background: var(--accent-soft); color: var(--accent); }
@media (hover: none) { .calendar-add { opacity: 1; } }
.cal-tasks { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 24px; }
.cal-task {
    display: flex; gap: 5px; align-items: baseline; font-size: .74rem; line-height: 1.35; padding: 3px 6px; border-radius: 6px;
    background: var(--surface-2); border-left: 3px solid var(--c); color: var(--text); text-decoration: none; cursor: grab; min-width: 0;
}
.cal-task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.cal-task time { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cal-task:hover { background: var(--accent-soft); color: var(--text); }
.cal-task.is-done span { text-decoration: line-through; color: var(--muted); }
.cal-task.is-high span::before { content: "!"; color: var(--danger); font-weight: 700; margin-right: 3px; }
.cal-task.is-dragging { opacity: .4; }
.calendar-cell.is-drop-target { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }

/* ---------- Contexts page ---------- */
.context-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.context-row:last-child { border-bottom: 0; }
.context-row .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: 0 0 14px; }
.context-row .name { font-weight: 600; flex: 1; min-width: 120px; }
.context-row .meta { font-size: .82rem; color: var(--muted); display: flex; gap: 12px; }
.context-row details { width: 100%; }
.context-row details summary { cursor: pointer; color: var(--accent); font-size: .85rem; display: inline; }

/* ---------- Notes ---------- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.note-card { text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 8px; height: 100%; }
.note-card:hover { border-color: var(--border-strong); color: var(--text); }
.note-card .card-body { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.note-card h2 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.note-card .excerpt { font-size: .88rem; color: #46525f; white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.note-card .foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--muted); }
.note-card .pin { color: var(--amber); }
.note-editor .title-input { font-size: 1.35rem; font-weight: 650; border: 0; padding: 4px 0; box-shadow: none !important; background: transparent; }
.note-editor textarea { min-height: 320px; border: 0; padding: 4px 0; box-shadow: none !important; resize: none; font-size: 1rem; line-height: 1.65; background: transparent; }
.note-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.note-toolbar .form-select { width: auto; min-width: 160px; }
.note-toolbar .status { font-size: .82rem; color: var(--muted); margin-left: auto; }
