:root {
    --accent: #ee7558;
    --accent-deep: #c85238;
    --accent-soft-light: #fae8e1;
    --accent-soft: var(--accent-soft-light);
    --accent-rgb: 238, 117, 88;
    --canvas: #e9e5de;
    --shell: rgba(249, 247, 243, .9);
    --sidebar: rgba(245, 242, 236, .82);
    --surface: #fdfcf9;
    --surface-raised: #fff;
    --ink: #25231f;
    --ink-soft: #48453f;
    --muted: #817d75;
    --faint: #aaa59b;
    --line: rgba(47, 43, 37, .1);
    --line-strong: rgba(47, 43, 37, .16);
    --success: #5a9d7b;
    --warning: #cf9643;
    --danger: #cf5f5f;
    --shadow-shell: 0 30px 90px rgba(57, 48, 38, .14);
    --shadow-card: 0 12px 36px rgba(57, 48, 38, .075);
    --ease: cubic-bezier(.22, 1, .36, 1);
    color-scheme: light;
}

[data-theme="dark"] {
    --canvas: #11110f;
    --shell: rgba(25, 25, 22, .94);
    --sidebar: rgba(29, 28, 25, .9);
    --surface: #20201d;
    --surface-raised: #272723;
    --ink: #f5f1e9;
    --ink-soft: #d2cec5;
    --muted: #a7a299;
    --faint: #716d66;
    --line: rgba(255, 255, 255, .085);
    --line-strong: rgba(255, 255, 255, .15);
    --accent-soft: rgba(var(--accent-rgb), .14);
    --shadow-shell: 0 30px 100px rgba(0, 0, 0, .45);
    --shadow-card: 0 12px 36px rgba(0, 0, 0, .18);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    padding: 18px;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background .35s ease, color .35s ease;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(var(--accent-rgb), .34); outline-offset: 2px; }
.ambient { position: fixed; z-index: -1; width: 480px; height: 480px; border-radius: 50%; filter: blur(110px); opacity: .15; pointer-events: none; }
.ambient-one { top: -250px; right: -100px; background: var(--accent); }
.ambient-two { bottom: -330px; left: 20%; background: #c5a97a; }

.app-shell {
    display: grid;
    grid-template-columns: 248px minmax(520px, 1fr) 286px;
    width: min(1540px, 100%);
    min-height: calc(100vh - 36px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 28px;
    background: var(--shell);
    box-shadow: var(--shadow-shell);
    backdrop-filter: blur(24px);
}

/* Sidebar */
.sidebar { display: flex; min-width: 0; padding: 28px 20px 22px; flex-direction: column; border-right: 1px solid var(--line); background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 7px 34px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 13px 13px 13px 5px; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--accent), #fff 10%), var(--accent-deep)); box-shadow: 0 10px 22px rgba(var(--accent-rgb), .27); font-size: 20px; font-weight: 750; }
.brand-copy { display: grid; font-size: 21px; font-weight: 760; letter-spacing: -.7px; line-height: 1; }
.brand-copy small { margin-top: 5px; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: 1.15px; text-transform: uppercase; }
.sidebar-cta { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 45px; padding: 0 13px; border: 0; border-radius: 13px; color: #fff; background: var(--ink); box-shadow: 0 10px 24px rgba(30, 28, 24, .14); font-weight: 650; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
[data-theme="dark"] .sidebar-cta { color: #1b1a18; background: #f1ede5; }
.sidebar-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(30, 28, 24, .19); }
.sidebar-cta > span:first-child { color: var(--accent); font-size: 19px; }
.sidebar-cta kbd { margin-left: auto; color: currentColor; opacity: .48; }
.nav-label { margin: 30px 11px 10px; color: var(--faint); font-size: 9px; font-weight: 750; letter-spacing: 1.25px; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; min-height: 43px; padding: 0 12px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; transition: transform .22s var(--ease), background .22s, color .22s; }
.nav-item:hover { color: var(--ink); background: rgba(var(--accent-rgb), .065); transform: translateX(2px); }
.nav-item.active { color: var(--accent-deep); background: var(--accent-soft); font-weight: 650; }
.nav-icon { font-size: 17px; }
.nav-count { display: grid; min-width: 22px; height: 22px; padding: 0 5px; place-items: center; border-radius: 7px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 650; }
.nav-item.active .nav-count { color: var(--accent-deep); background: rgba(255, 255, 255, .5); }
.sidebar-note { display: flex; align-items: center; gap: 12px; margin: auto 4px 22px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .24); }
.sidebar-note strong { font-size: 11px; }
.sidebar-note p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.note-orbit { position: relative; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid rgba(var(--accent-rgb), .3); border-radius: 50%; }
.note-orbit::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(var(--accent-rgb), .35); border-radius: 50%; }
.note-orbit i { position: absolute; top: 3px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 5px; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; transition: transform .25s var(--ease), border-color .25s; }
.icon-button:hover { border-color: var(--accent); transform: rotate(12deg); }
.palette { display: flex; gap: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.palette-dot { width: 13px; height: 13px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.palette-dot[data-accent="coral"] { background: #ee7558; }
.palette-dot[data-accent="violet"] { background: #7c6ce7; }
.palette-dot[data-accent="ocean"] { background: #208f9b; }
.palette-dot[data-accent="sage"] { background: #6fa889; }
.palette-dot[data-accent="amber"] { background: #d89b45; }
.palette-dot.active { transform: scale(.76); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor; }

/* Main workspace */
.workspace { min-width: 0; padding: 42px clamp(28px, 4vw, 58px); }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.date-label { margin: 0 0 7px; color: var(--accent); font-size: 10px; font-weight: 760; letter-spacing: 1.25px; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 3.5vw, 48px); font-weight: 760; letter-spacing: -2.4px; line-height: 1.05; }
.page-subtitle { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.search-box { display: flex; align-items: center; gap: 8px; width: 210px; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 18px rgba(45, 39, 32, .035); transition: width .3s var(--ease), border-color .2s, box-shadow .2s; }
.search-box:focus-within { width: 250px; border-color: rgba(var(--accent-rgb), .5); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-icon { color: var(--muted); font-size: 18px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: var(--faint); }
.search-box kbd, .sidebar-cta kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: transparent; font-size: 8px; white-space: nowrap; }
.search-clear { display: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: var(--line); line-height: 1; cursor: pointer; }
.search-box.has-value .search-clear { display: grid; place-items: center; }

.mobile-overview, .mobile-brandbar, .mobile-nav { display: none; }

/* Composer */
.composer { position: relative; max-height: 0; margin: 0; overflow: hidden; border: 1px solid transparent; border-radius: 21px; opacity: 0; background: var(--surface-raised); transform: translateY(-8px) scale(.99); transition: max-height .48s var(--ease), opacity .28s, transform .4s var(--ease), margin .4s, border-color .3s; }
.composer.open { max-height: 260px; margin-bottom: 24px; border-color: var(--line); opacity: 1; transform: none; box-shadow: var(--shadow-card); }
.composer-accent { position: absolute; top: -50px; left: -40px; width: 150px; height: 120px; border-radius: 50%; background: var(--accent-soft); filter: blur(25px); opacity: .8; pointer-events: none; }
.composer-main { position: relative; display: flex; align-items: center; gap: 14px; padding: 19px 20px 15px; }
.composer-check { width: 23px; height: 23px; flex: 0 0 auto; border: 2px solid var(--accent); border-radius: 8px; box-shadow: inset 0 0 0 4px var(--surface-raised); background: var(--accent-soft); }
.composer-input-wrap { display: grid; flex: 1; gap: 2px; min-width: 0; }
.composer-input-wrap > span { color: var(--faint); font-size: 8px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
#new-task { width: 100%; min-width: 0; padding: 2px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 17px; font-weight: 570; }
#new-task::placeholder { color: var(--faint); }
.add-button { min-height: 40px; padding: 0 15px; border: 0; border-radius: 11px; color: #fff; background: var(--accent); box-shadow: 0 9px 20px rgba(var(--accent-rgb), .22); font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .22s var(--ease), background .2s, box-shadow .2s; }
.add-button:hover { background: var(--accent-deep); box-shadow: 0 13px 24px rgba(var(--accent-rgb), .28); transform: translateY(-2px); }
.add-button span { margin-left: 5px; }
.composer-options { display: flex; align-items: flex-end; gap: 8px; padding: 12px 20px 18px 57px; border-top: 1px solid var(--line); }
.option-field { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.option-field input, .option-field select, .sort-control select { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: var(--surface); font-size: 11px; text-transform: none; }
.priority-group { display: flex; gap: 4px; margin: 0; padding: 0; border: 0; }
.priority-group legend { margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.priority-chip, .quick-dates button { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.priority-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.priority-chip[data-priority="medium"] i { background: var(--warning); }
.priority-chip[data-priority="high"] i { background: var(--danger); }
.priority-chip.active { color: var(--ink); border-color: rgba(var(--accent-rgb), .28); background: var(--accent-soft); font-weight: 650; }
.quick-dates { display: flex; gap: 4px; margin-left: auto; }
.quick-dates button:hover { color: var(--accent-deep); border-color: var(--accent); }

/* Task content */
.content-panel { min-height: 430px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.filter-pills { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--sidebar); }
.filter-btn { min-width: 54px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; cursor: pointer; transition: color .2s, background .2s, box-shadow .2s; }
.filter-btn.active { color: var(--ink); background: var(--surface-raised); box-shadow: 0 4px 12px rgba(45, 39, 32, .07); font-weight: 650; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.sort-control { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 10px; }
.sort-control select { height: 32px; }
.text-button { padding: 7px 0; border: 0; color: var(--faint); background: transparent; font-size: 10px; cursor: pointer; transition: color .2s; }
.text-button:hover { color: var(--danger); }
.summary-row { display: flex; align-items: center; justify-content: space-between; min-height: 47px; }
.summary-row p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .2px; }
.mini-progress { width: 92px; height: 3px; overflow: hidden; border-radius: 99px; background: var(--line); }
.mini-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.task-list { display: grid; gap: 8px; contain: layout style; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 68px; padding: 12px 13px; contain: layout style; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-raised); box-shadow: 0 3px 16px rgba(55, 48, 40, .035); transition: transform .24s var(--ease), border-color .24s, box-shadow .24s; }
.task.animate-in { animation: task-in .38s var(--ease) both; }
.task:hover { border-color: rgba(var(--accent-rgb), .3); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.task.is-overdue { border-left: 3px solid var(--danger); }
.task-check { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 9px; color: transparent; background: transparent; cursor: pointer; transition: transform .2s var(--ease), border-color .2s, background .2s; }
.task-check:hover { border-color: var(--accent); transform: scale(1.06); }
.task.completed .task-check { color: #fff; border-color: var(--success); background: var(--success); }
.task-main { min-width: 0; }
.task-title { margin: 0; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.task.completed .task-title { color: var(--faint); text-decoration: line-through; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 5px; color: var(--muted); font-size: 9px; }
.category-tag { padding: 2px 7px; border-radius: 99px; color: var(--accent-deep); background: var(--accent-soft); font-weight: 650; }
.priority-mark { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.priority-mark.medium { background: var(--warning); }
.priority-mark.high { background: var(--danger); }
.overdue-label { color: var(--danger); font-weight: 700; }
.task-actions { display: flex; gap: 4px; opacity: 0; transform: translateX(4px); transition: opacity .18s, transform .22s var(--ease); }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; transform: none; }
.task-action { display: grid; width: 31px; height: 31px; padding: 0; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; transition: color .2s, background .2s; }
.task-action:hover { color: var(--ink); background: var(--accent-soft); }
.task-action.delete:hover { color: var(--danger); }
.task.editing .task-main { display: flex; }
.edit-input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 9px; outline: 0; color: var(--ink); background: var(--surface); }
.empty-state { display: grid; min-height: 340px; place-items: center; text-align: center; animation: fade-up .45s var(--ease); }
.empty-visual { position: relative; width: 92px; height: 92px; margin: 0 auto 19px; border: 1px solid rgba(var(--accent-rgb), .16); border-radius: 28px; background: var(--accent-soft); transform: rotate(-4deg); }
.empty-visual::before, .empty-visual::after { content: ''; position: absolute; left: 24px; width: 45px; height: 6px; border-radius: 9px; background: rgba(var(--accent-rgb), .42); }
.empty-visual::before { top: 30px; box-shadow: 0 17px 0 rgba(var(--accent-rgb), .25); }
.empty-visual::after { top: 64px; width: 29px; }
.empty-state h3 { margin: 0 0 7px; font-size: 18px; letter-spacing: -.3px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }

/* Insight rail */
.insights { display: flex; min-width: 0; padding: 30px 20px 22px; flex-direction: column; border-left: 1px solid var(--line); background: rgba(255, 255, 255, .18); }
.insights-header { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 22px; color: var(--ink); font-size: 12px; font-weight: 700; }
.live-dot { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 650; text-transform: uppercase; }
.live-dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(90, 157, 123, .12); }
.focus-card { position: relative; padding: 25px 22px 23px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface-raised); box-shadow: var(--shadow-card); }
.focus-glow { position: absolute; width: 170px; height: 170px; top: -95px; right: -75px; border-radius: 50%; background: var(--accent-soft); filter: blur(4px); pointer-events: none; }
.progress-ring { position: relative; display: grid; width: 72px; height: 72px; margin-bottom: 24px; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--progress) * 1%), var(--accent-soft) 0); }
.progress-ring::before { content: ''; position: absolute; width: 57px; height: 57px; border-radius: 50%; background: var(--surface-raised); }
.progress-ring span { position: relative; font-size: 14px; font-weight: 750; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 8px; font-weight: 780; letter-spacing: 1.2px; text-transform: uppercase; }
.focus-card h2 { margin: 0 0 10px; font-size: 20px; font-weight: 750; letter-spacing: -.65px; line-height: 1.28; }
.focus-card > p:last-child { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.stat-card { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stat-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 9px; font-size: 12px; }
.stat-icon.warm { color: var(--accent-deep); background: var(--accent-soft); }
.stat-icon.cool { color: #477b84; background: rgba(32, 143, 155, .12); }
.stat-card div { display: grid; min-width: 0; }
.stat-card strong { font-size: 15px; line-height: 1; }
.stat-card small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ritual-card { margin-top: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(var(--accent-rgb), .075), transparent 70%); }
.ritual-top { display: flex; align-items: center; gap: 7px; color: var(--accent-deep); font-size: 8px; font-weight: 750; letter-spacing: .8px; text-transform: uppercase; }
.ritual-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; background: var(--accent-soft); }
.ritual-card blockquote { margin: 18px 0 11px; color: var(--ink-soft); font-family: Georgia, serif; font-size: 15px; font-style: italic; line-height: 1.5; }
.ritual-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.insights-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 15px 3px 0; color: var(--faint); font-size: 8px; }
.insights-footer span:last-child { color: var(--success); }

.toast { position: fixed; left: 50%; bottom: 25px; z-index: 30; padding: 11px 16px; border-radius: 11px; color: #fff; background: #272621; box-shadow: var(--shadow-shell); opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .25s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes task-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

/* Responsive */
@media (max-width: 1220px) {
    .app-shell { grid-template-columns: 230px minmax(0, 1fr); }
    .insights { display: none; }
}

@media (max-width: 840px) {
    body { padding: 0 0 calc(86px + env(safe-area-inset-bottom)); }
    .app-shell { display: block; min-height: 100vh; overflow: visible; border: 0; border-radius: 0; }
    .workspace { padding: calc(20px + env(safe-area-inset-top)) 18px 44px; }
    .sidebar { display: none; }
    .brand, .nav-label, .sidebar-note, .sidebar-footer { display: none; }
    .nav-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
    .nav-item { display: flex; min-width: 0; min-height: 56px; padding: 4px 2px; flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
    .nav-item:hover { transform: none; }
    .nav-icon { font-size: 16px; line-height: 1; }
    .nav-item > span:nth-child(2) { max-width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
    .nav-count { display: none; }
    .sidebar-cta { display: none; }
    [data-theme="dark"] .sidebar-cta { color: #fff; background: var(--accent); }
    .sidebar-cta > span:first-child { color: #fff; font-size: 25px; }
    .sidebar-cta .cta-label, .sidebar-cta kbd { display: none; }
    .mobile-brandbar { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
    .mobile-brandbar a { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
    .mobile-brandbar a span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px 10px 10px 4px; color: #fff; background: var(--accent); box-shadow: 0 7px 16px rgba(var(--accent-rgb), .24); font-size: 14px; font-weight: 760; }
    .mobile-brandbar a strong { font-size: 17px; letter-spacing: -.6px; }
    .mobile-brand-actions { display: flex; align-items: center; gap: 7px; }
    .mobile-brandbar .mobile-brand-actions > button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); cursor: pointer; }
    .mobile-brandbar .mobile-brand-actions > button[aria-expanded="true"] { border-color: rgba(var(--accent-rgb), .42); background: var(--accent-soft); }
    .mobile-palette-preview { width: 15px; height: 15px; border: 4px solid var(--surface-raised); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .55), 7px 0 0 -4px var(--accent-deep); }
    .mobile-palette-menu { position: absolute; top: 47px; right: 0; z-index: 12; width: min(310px, calc(100vw - 36px)); padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--surface-raised), transparent 2%); box-shadow: 0 20px 50px rgba(25, 22, 18, .2); backdrop-filter: blur(22px); animation: fade-up .24s var(--ease); }
    .mobile-palette-menu[hidden] { display: none; }
    .mobile-palette-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
    .mobile-palette-heading > div { display: grid; gap: 3px; }
    .mobile-palette-heading strong { font-size: 13px; }
    .mobile-palette-heading span { color: var(--muted); font-size: 9px; }
    .mobile-brandbar .mobile-palette-heading button { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: var(--sidebar); font-size: 18px; cursor: pointer; }
    .mobile-palette-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
    .mobile-palette-options .mobile-palette-dot { display: flex; width: auto; height: 58px; padding: 7px 2px 6px; border: 1px solid transparent; border-radius: 12px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: var(--muted); background: transparent; box-shadow: none; transform: none; }
    .mobile-palette-dot > span { width: 19px; height: 19px; border-radius: 50%; background: currentColor; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
    .mobile-palette-dot[data-accent="coral"] { color: #ee7558; }
    .mobile-palette-dot[data-accent="violet"] { color: #7c6ce7; }
    .mobile-palette-dot[data-accent="ocean"] { color: #208f9b; }
    .mobile-palette-dot[data-accent="sage"] { color: #6fa889; }
    .mobile-palette-dot[data-accent="amber"] { color: #d89b45; }
    .mobile-palette-dot small { color: var(--muted); font-size: 7px; font-weight: 650; }
    .mobile-palette-options .mobile-palette-dot.active { border-color: rgba(var(--accent-rgb), .32); background: var(--accent-soft); }
    .mobile-palette-options .mobile-palette-dot.active > span { box-shadow: 0 0 0 3px var(--surface-raised), 0 0 0 5px currentColor; transform: scale(.75); }
    .topbar { position: relative; align-items: center; margin-bottom: 18px; }
    .page-subtitle { display: none; }
    .search-box { width: 44px; min-height: 44px; }
    .search-box:focus-within { position: absolute; z-index: 4; right: 0; width: 100%; }
    .search-box input { width: 0; padding: 0; opacity: 0; pointer-events: none; }
    .search-box kbd { display: none; }
    .search-box:focus-within input { width: 100%; opacity: 1; pointer-events: auto; }
    .search-box.has-value .search-clear { display: none; }
    .search-box:focus-within.has-value .search-clear { display: grid; }
    .mobile-overview { position: relative; display: grid; gap: 14px; margin: 0 0 22px; padding: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-raised); box-shadow: 0 8px 26px rgba(45, 39, 32, .06); }
    .mobile-overview::after { content: ''; position: absolute; top: -64px; right: -55px; width: 145px; height: 145px; border-radius: 50%; background: var(--accent-soft); opacity: .55; pointer-events: none; }
    .mobile-overview-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
    .mobile-overview-head > div { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .1px; }
    .mobile-overview-head > strong { color: var(--accent-deep); font-size: 18px; }
    .mobile-spark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: var(--accent-deep); background: var(--accent-soft); }
    .mobile-progress { position: relative; z-index: 1; height: 5px; overflow: hidden; border-radius: 99px; background: var(--line); }
    .mobile-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); transition: width .5s var(--ease); }
    .mobile-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 13px; background: rgba(var(--accent-rgb), .025); }
    .mobile-metrics > div { display: grid; min-width: 0; gap: 3px; padding: 11px 10px; border-right: 1px solid var(--line); }
    .mobile-metrics > div:last-child { border-right: 0; }
    .mobile-metrics strong { font-size: 16px; line-height: 1; }
    .mobile-metrics span { overflow: hidden; color: var(--muted); font-size: 7px; font-weight: 700; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
    .mobile-next { position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--sidebar); }
    .mobile-next-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: #fff; background: var(--accent); font-size: 12px; }
    .mobile-next div { display: grid; min-width: 0; gap: 2px; }
    .mobile-next small { color: var(--faint); font-size: 7px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
    .mobile-next strong { overflow: hidden; font-size: 11px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-next > span:last-child { color: var(--muted); font-size: 9px; }
    .composer.open { max-height: 520px; }
    .composer-options { flex-wrap: wrap; padding-left: 20px; }
    .quick-dates { margin-left: 0; }
    .content-panel { min-height: 350px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 8px 28px rgba(45, 39, 32, .045); }
    .list-toolbar { padding-bottom: 6px; border-bottom: 0; }
    .summary-row { min-height: 43px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
    .task { min-height: 72px; background: var(--surface-raised); }
    .empty-state { min-height: 260px; }
    .task-actions { opacity: 1; transform: none; }
    .mobile-nav { position: fixed; inset: auto 12px max(10px, env(safe-area-inset-bottom)); z-index: 25; display: grid; grid-template-columns: 1fr 1fr 58px 1fr 1fr; align-items: center; height: 68px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 22px; background: color-mix(in srgb, var(--surface-raised), transparent 5%); box-shadow: 0 16px 42px rgba(25, 22, 18, .2); backdrop-filter: blur(22px); }
    .mobile-nav-item { display: flex; min-width: 0; height: 52px; padding: 5px 2px; border: 0; border-radius: 14px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; color: var(--muted); background: transparent; }
    .mobile-nav-item > span { font-size: 16px; line-height: 1; }
    .mobile-nav-item small { max-width: 100%; overflow: hidden; font-size: 8px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-nav-item.active { color: var(--accent-deep); background: var(--accent-soft); }
    .mobile-create { display: grid; width: 50px; height: 50px; margin: -25px auto 0; padding: 0; place-items: center; border: 4px solid var(--canvas); border-radius: 17px; color: #fff; background: var(--accent); box-shadow: 0 10px 25px rgba(var(--accent-rgb), .38); transition: background .25s, box-shadow .25s, transform .25s var(--ease); }
    .mobile-create span { font-size: 23px; line-height: 1; transition: transform .3s var(--ease); }
    .mobile-create.is-open { background: var(--ink); box-shadow: 0 10px 25px rgba(20, 18, 16, .25); }
    .mobile-create.is-open span { transform: rotate(45deg); }
}

@media (max-width: 560px) {
    .workspace { padding: calc(27px + env(safe-area-inset-top)) 16px 40px; }
    h1 { font-size: 34px; letter-spacing: -1.8px; }
    .topbar { margin-bottom: 17px; }
    .mobile-overview { padding: 15px; border-radius: 17px; }
    .content-panel { padding: 11px; border-radius: 17px; }
    .composer-main { gap: 10px; padding: 16px 13px 13px; }
    .composer-check { width: 20px; height: 20px; }
    #new-task { font-size: 14px; }
    .add-button { padding: 0 12px; font-size: 0; }
    .add-button span { margin: 0; font-size: 16px; }
    .composer-options { padding: 11px 13px 15px; }
    .option-field { width: calc(50% - 4px); }
    .option-field input, .option-field select { width: 100%; }
    .priority-group { width: 100%; }
    .priority-chip { flex: 1; justify-content: center; }
    .list-toolbar { align-items: flex-start; }
    .toolbar-actions { align-items: flex-end; flex-direction: column; gap: 2px; }
    .sort-control > span { display: none; }
    #clear-completed { min-height: 25px; padding: 3px 1px; font-size: 8px; }
    .task { gap: 9px; padding-inline: 10px; }
    .task-actions { gap: 0; }
    .task-action { width: 35px; }
    .category-tag { display: none; }
}

@media (max-width: 360px) {
    .filter-btn { min-width: 46px; padding-inline: 7px; }
    .task-action { width: 32px; }
}

@media (hover: none) {
    .task-actions { opacity: 1; transform: none; }
    .task-action, .icon-button, .quick-dates button { min-width: 44px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
