:root {
  color-scheme: light;
  --canvas: #f5f7fb;
  --canvas-2: #eef2f8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --sidebar: rgba(237, 242, 249, 0.86);
  --ink: #1c2636;
  --muted: #718096;
  --faint: #a8b2c2;
  --line: rgba(29, 45, 68, 0.09);
  --line-strong: rgba(29, 45, 68, 0.15);
  --blue: #9b111e;
  --blue-strong: #7d0d17;
  --blue-soft: #f8e8eb;
  --ruby: #9b111e;
  --orange: #ed8a45;
  --jade: #28a882;
  --rose: #d85a73;
  --shadow: 0 18px 55px rgba(55, 72, 105, 0.11), 0 3px 12px rgba(55, 72, 105, 0.06);
  --shadow-soft: 0 8px 28px rgba(55, 72, 105, 0.08);
  --radius: 24px;
  --ease: cubic-bezier(.22, .8, .2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #10141c;
  --canvas-2: #151b25;
  --panel: rgba(25, 31, 42, 0.82);
  --panel-solid: #1b2230;
  --sidebar: rgba(20, 26, 36, 0.9);
  --ink: #edf2fa;
  --muted: #96a4b8;
  --faint: #667287;
  --line: rgba(219, 229, 244, 0.08);
  --line-strong: rgba(219, 229, 244, 0.14);
  --blue: #c52c43;
  --blue-strong: #a6162d;
  --blue-soft: rgba(197, 44, 67, 0.18);
  --ruby: #e05268;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32), 0 3px 12px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(155, 17, 30, 0.08), transparent 28%),
    radial-gradient(circle at 92% 90%, rgba(155, 17, 30, 0.06), transparent 30%),
    var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
textarea { resize: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
kbd { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent); outline-offset: 2px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.hidden { display: none !important; }

.ambient { position: fixed; border-radius: 999px; filter: blur(14px); pointer-events: none; opacity: .6; }
.ambient-one { width: 300px; height: 300px; left: -170px; top: -100px; background: rgba(155, 17, 30, .12); }
.ambient-two { width: 260px; height: 260px; right: -130px; bottom: -110px; background: rgba(155, 17, 30, .1); }

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 256px minmax(420px, 1fr) 344px;
  height: calc(100dvh - 32px);
  max-width: 1540px;
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.12);
}

:root[data-theme="dark"] .app-shell { border-color: rgba(255,255,255,.07); }

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand-row { display: flex; align-items: center; height: 40px; padding: 0 8px; gap: 10px; }
.brand-row strong { font-size: 1.06rem; letter-spacing: -.025em; }
.brand-mark { position: relative; width: 25px; height: 25px; border: 2px solid var(--blue); border-radius: 50%; transform: rotate(-18deg); }
.brand-mark::before { content: ""; position: absolute; inset: 4px; border: 2px solid color-mix(in srgb, var(--blue) 48%, transparent); border-radius: 50%; }
.brand-mark span { position: absolute; width: 5px; height: 5px; top: -2px; right: 1px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--sidebar); }
.sidebar-close { display: none !important; margin-left: auto; }

.search-button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  margin: 22px 0 12px;
  padding: 0 10px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-solid) 66%, transparent);
  color: var(--muted);
  text-align: left;
}
.search-button svg { width: 17px; height: 17px; }
.search-button span { flex: 1; font-size: .9rem; }
.search-button kbd, .add-button kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--faint); font-size: .68rem; background: var(--panel); }

.nav-list { display: grid; gap: 3px; }
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  min-height: 40px;
  padding: 5px 9px;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.nav-item:hover { background: color-mix(in srgb, var(--panel-solid) 55%, transparent); color: var(--ink); }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: var(--panel-solid); box-shadow: 0 3px 12px rgba(55,72,105,.06); color: var(--ink); font-weight: 600; }
.nav-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-icon.inbox { color: #5272a4; background: color-mix(in srgb, #5272a4 12%, transparent); }
.nav-icon.today { color: #e19c2b; background: color-mix(in srgb, #e19c2b 14%, transparent); }
.nav-icon.upcoming { color: #d45f73; background: color-mix(in srgb, #d45f73 13%, transparent); }
.nav-icon.anytime { color: var(--blue); background: var(--blue-soft); }
.nav-icon.someday { color: var(--ruby); background: color-mix(in srgb, var(--ruby) 13%, transparent); }
.nav-icon.logbook { color: var(--jade); background: color-mix(in srgb, var(--jade) 13%, transparent); }
.nav-count { color: var(--faint); font-size: .76rem; font-weight: 500; font-variant-numeric: tabular-nums; }

.sidebar-section { margin-top: 22px; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; padding: 0 9px 8px; color: var(--faint); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mini-button { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.mini-button:hover { background: var(--panel-solid); color: var(--ink); }
.mini-button svg { width: 15px; height: 15px; }
.project-nav { display: grid; gap: 2px; }
.project-item { display: grid; grid-template-columns: 13px 1fr auto; align-items: center; width: 100%; min-height: 37px; padding: 5px 9px; gap: 9px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; }
.project-item:hover, .project-item.active { background: color-mix(in srgb, var(--panel-solid) 62%, transparent); color: var(--ink); }
.project-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 13%, transparent); }
.project-item .nav-count { font-size: .73rem; }

.sidebar-spacer { flex: 1; }
.sidebar-footer { display: grid; gap: 3px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-tool { display: flex; align-items: center; min-height: 38px; padding: 6px 9px; gap: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; }
.sidebar-tool:hover { background: color-mix(in srgb, var(--panel-solid) 55%, transparent); color: var(--ink); }
.sidebar-tool svg { width: 17px; height: 17px; }

.workspace { min-width: 0; display: flex; flex-direction: column; position: relative; background: color-mix(in srgb, var(--panel-solid) 80%, transparent); }
.topbar { display: flex; align-items: center; min-height: 91px; padding: 20px 32px 14px; gap: 14px; }
.date-lockup { min-width: 0; flex: 1; }
.date-lockup > span { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.date-lockup h1 { margin: 3px 0 0; font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-size: clamp(1.65rem, 3vw, 2.05rem); line-height: 1.05; letter-spacing: -.045em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--canvas-2); color: var(--ink); }
.icon-button svg { width: 19px; height: 19px; }
.menu-button { display: none; }
.add-button { display: flex; align-items: center; height: 40px; padding: 0 11px; gap: 8px; border: 0; border-radius: 12px; background: var(--blue); box-shadow: 0 6px 16px color-mix(in srgb, var(--blue) 24%, transparent); color: #fff; font-size: .88rem; font-weight: 650; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.add-button:hover { transform: translateY(-1px); box-shadow: 0 9px 21px color-mix(in srgb, var(--blue) 28%, transparent); }
.add-button svg { width: 17px; height: 17px; }
.add-button kbd { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.13); color: rgba(255,255,255,.8); }

.progress-strip { display: flex; align-items: center; min-height: 78px; margin: 0 32px 8px; padding: 13px 16px; gap: 13px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(110deg, color-mix(in srgb, var(--blue-soft) 74%, var(--panel-solid)), var(--panel-solid)); }
.progress-strip > div:last-child { display: grid; min-width: 0; gap: 3px; }
.progress-strip strong { font-size: .9rem; letter-spacing: -.01em; }
.progress-strip span:not(.day-ring span) { overflow: hidden; color: var(--muted); font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.day-ring { --progress: 0deg; flex: 0 0 auto; position: relative; display: grid; place-items: center; width: 47px; height: 47px; border-radius: 50%; background: conic-gradient(var(--blue) var(--progress), color-mix(in srgb, var(--blue) 13%, transparent) 0); transition: --progress .6s var(--ease); }
.day-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--panel-solid); }
.day-ring span { position: relative; font-size: .72rem; font-weight: 750; font-variant-numeric: tabular-nums; }

@property --progress { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

.task-scroll { flex: 1; overflow: auto; padding: 8px 32px 125px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.task-groups { max-width: 780px; margin: 0 auto; }
.task-section { margin-bottom: 24px; }
.task-section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 8px; }
.task-section-title h2 { margin: 0; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.task-section-title span { color: var(--faint); font-size: .72rem; }
.task-list { display: grid; gap: 5px; }
.task-card { position: relative; display: grid; grid-template-columns: 29px minmax(0,1fr) auto; align-items: start; min-height: 58px; padding: 12px 12px 11px; gap: 8px; border: 1px solid transparent; border-radius: 15px; background: var(--panel-solid); box-shadow: 0 2px 8px rgba(55,72,105,.035); text-align: left; transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .3s var(--ease); }
.task-card:hover { z-index: 1; border-color: var(--line-strong); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.task-card.selected { border-color: color-mix(in srgb, var(--blue) 35%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 9%, transparent); }
.task-card.completing { opacity: 0; transform: translateX(26px) scale(.98); }
.task-check { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; margin: 1px 0 0; padding: 0; border: 1.7px solid var(--faint); border-radius: 50%; background: transparent; color: transparent; transition: all .18s var(--ease); }
.task-check:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.task-check svg { width: 14px; height: 14px; stroke-width: 2.6; }
.task-check.checked { border-color: var(--jade); background: var(--jade); color: #fff; }
.task-check.large { width: 25px; height: 25px; margin-top: 5px; }
.task-copy { min-width: 0; }
.task-title { display: block; overflow: hidden; color: var(--ink); font-size: .96rem; font-weight: 520; line-height: 1.3; letter-spacing: -.012em; text-overflow: ellipsis; white-space: nowrap; }
.task-card.completed .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; align-items: center; min-height: 18px; margin-top: 4px; gap: 6px; overflow: hidden; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.task-meta:empty { display: none; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta svg { width: 13px; height: 13px; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.task-tags { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.task-tag { padding: 2px 7px; border-radius: 99px; background: var(--canvas-2); color: var(--muted); font-size: .66rem; }
.task-project-pin { width: 8px; height: 8px; margin: 8px 3px 0 6px; border-radius: 50%; }
.task-date.overdue { color: var(--rose); font-weight: 650; }
.task-date.today { color: var(--orange); font-weight: 650; }
.task-date.upcoming { color: var(--blue); }

.empty-state { display: grid; justify-items: center; max-width: 390px; margin: 64px auto 0; padding: 20px; text-align: center; }
.empty-state .empty-orbit { margin-bottom: 20px; }
.empty-state h2 { margin: 0; font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-size: 1.25rem; letter-spacing: -.03em; }
.empty-state p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
.empty-state button { margin-top: 18px; }
.empty-orbit { position: relative; width: 68px; height: 68px; border: 1.5px solid color-mix(in srgb, var(--blue) 35%, transparent); border-radius: 50%; }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ruby) 28%, transparent); }
.empty-orbit::before { inset: 10px; }
.empty-orbit::after { inset: 22px; background: var(--blue); border: 0; box-shadow: 0 0 24px color-mix(in srgb, var(--blue) 42%, transparent); }
.empty-orbit span { position: absolute; z-index: 1; width: 8px; height: 8px; top: -4px; left: 29px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--panel-solid); }

.quick-capture-wrap { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; padding: 46px 32px 24px; background: linear-gradient(transparent, color-mix(in srgb, var(--panel-solid) 94%, transparent) 42%); pointer-events: none; }
.quick-capture { display: flex; align-items: center; max-width: 700px; height: 53px; margin: 0 auto; padding: 0 8px 0 15px; gap: 8px; border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line)); border-radius: 17px; background: var(--panel-solid); box-shadow: 0 12px 35px rgba(51,72,110,.14); pointer-events: auto; }
.quick-plus { display: grid; place-items: center; color: var(--blue); }
.quick-plus svg { width: 19px; height: 19px; }
.quick-capture input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.quick-capture input::placeholder { color: var(--faint); }
.quick-capture button { display: grid; place-items: center; width: 37px; height: 37px; padding: 0; border: 0; border-radius: 12px; background: var(--blue); color: #fff; opacity: .35; transition: opacity .18s, transform .18s var(--ease); }
.quick-capture:focus-within button, .quick-capture.has-value button { opacity: 1; }
.quick-capture button:active { transform: scale(.93); }
.quick-capture button svg { width: 17px; height: 17px; }

.inspector { min-width: 0; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--canvas-2) 58%, var(--panel-solid)); }
.inspector-empty { display: grid; height: 100%; place-content: center; justify-items: center; padding: 32px; color: var(--muted); text-align: center; }
.inspector-empty strong { margin-top: 18px; color: var(--ink); font-size: .95rem; }
.inspector-empty p { max-width: 220px; margin: 7px 0 0; font-size: .8rem; line-height: 1.5; }
.inspector-form { display: flex; flex-direction: column; height: 100%; }
.inspector-head { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.inspector-close { visibility: hidden; }
.danger-ghost:hover { background: color-mix(in srgb, var(--rose) 12%, transparent); color: var(--rose); }
.inspector-content { flex: 1; overflow: auto; padding: 22px 22px 70px; }
.title-editor-row { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 8px; }
.title-editor-row textarea { width: 100%; padding: 1px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-size: 1.12rem; font-weight: 650; line-height: 1.35; letter-spacing: -.025em; }
.field-label { display: grid; margin-top: 20px; gap: 8px; color: var(--muted); font-size: .74rem; font-weight: 650; }
.field-label > span { display: flex; align-items: center; gap: 7px; }
.field-label > span svg { width: 14px; height: 14px; }
.field-label textarea, .field-label input, .field-label select { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: color-mix(in srgb, var(--panel-solid) 72%, transparent); color: var(--ink); font-size: .86rem; line-height: 1.45; }
.field-label textarea:focus, .field-label input:focus, .field-label select:focus { border-color: color-mix(in srgb, var(--blue) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 9%, transparent); }
.field-label textarea::placeholder, .field-label input::placeholder { color: var(--faint); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .field-label { min-width: 0; }
.checklist-block { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.checklist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.checklist-header strong { color: var(--muted); font-size: .74rem; }
.checklist-header button { padding: 4px 8px; border: 0; background: transparent; color: var(--blue); font-size: .74rem; font-weight: 650; }
.checklist-row { display: grid; grid-template-columns: 22px 1fr 26px; align-items: center; gap: 6px; min-height: 38px; }
.checklist-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
.checklist-row input[type="text"] { min-width: 0; padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; color: var(--ink); font-size: .83rem; }
.checklist-row button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--faint); }
.checklist-row button:hover { background: color-mix(in srgb, var(--rose) 10%, transparent); color: var(--rose); }
.checklist-row button svg { width: 14px; height: 14px; }
.inspector-save-state { position: absolute; right: 0; bottom: 0; width: 344px; padding: 18px 22px; background: linear-gradient(transparent, color-mix(in srgb, var(--canvas-2) 96%, transparent) 35%); color: var(--faint); font-size: .71rem; text-align: center; pointer-events: none; }

.mobile-nav { display: none; }

.app-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--panel-solid); color: var(--ink); box-shadow: 0 30px 90px rgba(28,38,54,.28); }
.app-dialog::backdrop { background: rgba(18,24,35,.38); backdrop-filter: blur(5px); }
.app-dialog form { padding: 0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 15px; }
.dialog-head > div { display: grid; gap: 3px; }
.dialog-head > div span { color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.dialog-head > div strong { font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-size: 1.2rem; letter-spacing: -.025em; }
.task-dialog form > textarea { width: calc(100% - 48px); margin: 4px 24px 0; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; color: var(--ink); font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-size: 1.22rem; font-weight: 620; line-height: 1.4; }
.task-dialog form > textarea::placeholder { color: var(--faint); }
.task-dialog form > .field-label { margin: 15px 24px 0; }
.composer-chips { display: flex; flex-wrap: wrap; margin: 18px 24px 0; gap: 8px; }
.composer-chips label { display: flex; align-items: center; min-height: 37px; padding: 0 9px; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--muted); }
.composer-chips svg { width: 15px; height: 15px; }
.composer-chips select, .composer-chips input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .78rem; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 24px; }
.dialog-actions > span { color: var(--faint); font-size: .71rem; }
.dialog-actions kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; }
.primary-button { min-height: 40px; padding: 0 17px; border: 0; border-radius: 11px; background: var(--blue); color: #fff; font-size: .86rem; font-weight: 700; }
.primary-button:hover { background: var(--blue-strong); }

.search-dialog { margin-top: max(8vh, 38px); vertical-align: top; }
.search-head { display: flex; align-items: center; height: 64px; padding: 0 15px 0 20px; gap: 10px; border-bottom: 1px solid var(--line); }
.search-head > svg { color: var(--muted); }
.search-head input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.search-results { min-height: 190px; max-height: 52vh; overflow: auto; padding: 8px; }
.search-result { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; width: 100%; min-height: 52px; padding: 8px 11px; gap: 9px; border: 0; border-radius: 11px; background: transparent; text-align: left; }
.search-result:hover, .search-result.focused { background: var(--canvas-2); }
.search-result .task-check { pointer-events: none; }
.search-result-copy { min-width: 0; }
.search-result-copy strong, .search-result-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy strong { font-size: .88rem; }
.search-result-copy small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.search-result > span { color: var(--faint); font-size: .7rem; }
.search-empty { display: grid; place-items: center; min-height: 190px; color: var(--muted); font-size: .85rem; text-align: center; }
.search-footer { display: flex; justify-content: space-between; padding: 11px 17px; border-top: 1px solid var(--line); color: var(--faint); font-size: .68rem; }
.search-footer kbd { padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; }

.compact-dialog { width: min(440px, calc(100vw - 28px)); padding-bottom: 5px; }
.compact-dialog > .field-label, .compact-dialog form > .field-label { margin: 14px 24px 0; }
.dialog-copy { margin: 0; padding: 0 24px 12px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.settings-list, .backup-actions { display: grid; padding: 4px 16px 16px; gap: 5px; }
.settings-list button, .backup-actions button, .backup-actions label, .install-row { display: flex; align-items: center; width: 100%; min-height: 58px; padding: 9px 12px; gap: 12px; border: 0; border-radius: 13px; background: transparent; text-align: left; }
.settings-list button:hover, .backup-actions button:hover, .backup-actions label:hover, .install-row:hover { background: var(--canvas-2); }
.settings-list button span, .backup-actions span, .install-row span { flex: 1; display: grid; gap: 3px; }
.settings-list strong, .backup-actions strong, .install-row strong { font-size: .87rem; }
.settings-list small, .backup-actions small, .install-row small { color: var(--muted); font-size: .72rem; }
.settings-list i { width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.settings-list button.selected i { border: 5px solid var(--blue); }
.backup-actions svg, .install-row > svg { width: 20px; height: 20px; color: var(--blue); }
.backup-actions label input { display: none; }
.install-row { width: calc(100% - 32px); margin: 0 16px 16px; border-top: 1px solid var(--line); }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; justify-content: space-between; min-width: 240px; max-width: min(360px, calc(100vw - 30px)); padding: 13px 16px; gap: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-solid); box-shadow: var(--shadow); color: var(--ink); font-size: .83rem; animation: toast-in .35s var(--ease) both; }
.toast button { padding: 3px 0; border: 0; background: transparent; color: var(--blue); font-size: .78rem; font-weight: 700; pointer-events: auto; }
.toast.removing { animation: toast-out .25s var(--ease) both; }

@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 236px minmax(400px, 1fr); max-width: 1120px; }
  .inspector { position: fixed; z-index: 30; top: 16px; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); border: 1px solid var(--line-strong); border-radius: 24px; box-shadow: var(--shadow); transform: translateX(calc(100% + 30px)); transition: transform .3s var(--ease); }
  .inspector.open { transform: translateX(0); }
  .inspector-empty { display: none; }
  .inspector-form.hidden { display: flex !important; visibility: hidden; }
  .inspector.open .inspector-form.hidden { visibility: visible; }
  .inspector-close { visibility: visible; }
  .inspector-save-state { width: 100%; border-radius: 0 0 24px 24px; }
}

@media (max-width: 760px) {
  body { background: var(--panel-solid); }
  .ambient { display: none; }
  .app-shell { display: block; height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(310px, 88vw); border-right: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(-104%); transition: transform .3s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-grid !important; }
  .workspace { height: 100%; background: var(--panel-solid); }
  .topbar { min-height: 82px; padding: max(15px, env(safe-area-inset-top)) 18px 10px; }
  .menu-button { display: inline-grid; }
  .topbar-actions > .icon-button { display: none; }
  .add-button { display: none; }
  .progress-strip { min-height: 70px; margin: 2px 18px 7px; padding: 10px 12px; border-radius: 16px; }
  .day-ring { width: 43px; height: 43px; }
  .progress-strip strong { font-size: .84rem; }
  .progress-strip span:not(.day-ring span) { font-size: .73rem; }
  .task-scroll { padding: 9px 14px calc(176px + env(safe-area-inset-bottom)); }
  .task-card { min-height: 61px; padding: 13px 11px; border-radius: 14px; box-shadow: none; border-color: var(--line); }
  .task-card:hover { transform: none; box-shadow: none; }
  .task-title { font-size: .97rem; }
  .quick-capture-wrap { bottom: calc(64px + env(safe-area-inset-bottom)); padding: 36px 14px 10px; }
  .quick-capture { height: 50px; border-radius: 15px; }
  .inspector { top: auto; right: 0; bottom: 0; left: 0; width: 100%; height: min(84dvh, 760px); border-width: 1px 0 0; border-radius: 24px 24px 0 0; transform: translateY(105%); }
  .inspector.open { transform: translateY(0); }
  .inspector-save-state { padding-bottom: max(18px, env(safe-area-inset-bottom)); border-radius: 0; }
  .mobile-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; min-height: calc(64px + env(safe-area-inset-bottom)); padding: 7px 8px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel-solid) 94%, transparent); backdrop-filter: blur(18px); }
  .mobile-nav button { display: grid; justify-items: center; align-content: center; min-height: 47px; padding: 3px; gap: 3px; border: 0; border-radius: 10px; background: transparent; color: var(--faint); font-size: .62rem; }
  .mobile-nav button.active { color: var(--blue); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .mobile-nav .mobile-add { align-self: start; width: 48px; height: 48px; min-height: 48px; margin: -18px auto 0; border-radius: 16px; background: var(--blue); box-shadow: 0 8px 22px color-mix(in srgb, var(--blue) 32%, transparent); color: #fff; }
  .mobile-nav .mobile-add svg { width: 23px; height: 23px; }
  .toast-region { right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .date-lockup h1 { font-size: 1.58rem; }
  .progress-strip { margin-inline: 14px; }
  .progress-strip > div:last-child { max-width: calc(100vw - 100px); }
  .task-scroll { padding-inline: 10px; }
  .task-section-title { margin-inline: 7px; }
  .quick-capture-wrap { padding-inline: 10px; }
  .quick-capture input { font-size: .9rem; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .app-dialog { border-radius: 18px; }
  .composer-chips { display: grid; }
  .composer-chips label { width: 100%; }
  .composer-chips select, .composer-chips input { flex: 1; }
}

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

/* Calm native task-paper direction */
:root {
  --canvas: #f4f5f7;
  --canvas-2: #eceef2;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --sidebar: rgba(239, 241, 244, .94);
  --ink: #2f3338;
  --muted: #848991;
  --faint: #b2b6bd;
  --line: rgba(41, 47, 56, .075);
  --line-strong: rgba(41, 47, 56, .13);
  --blue: #9b111e;
  --blue-strong: #7d0d17;
  --blue-soft: rgba(155, 17, 30, .12);
  --shadow: 0 24px 70px rgba(25, 32, 43, .18), 0 4px 18px rgba(25, 32, 43, .08);
  --shadow-soft: 0 5px 18px rgba(25, 32, 43, .07);
}

:root[data-theme="dark"] {
  --canvas: #1b1d21;
  --canvas-2: #24272d;
  --panel: #202226;
  --panel-solid: #222429;
  --sidebar: rgba(35, 37, 42, .96);
  --ink: #f1f1f3;
  --muted: #969aa2;
  --faint: #6f737b;
  --line: rgba(255, 255, 255, .065);
  --line-strong: rgba(255, 255, 255, .12);
  --blue: #c52c43;
  --blue-strong: #a6162d;
  --blue-soft: rgba(197, 44, 67, .18);
  --ruby: #e05268;
}

body { background: var(--panel-solid); }
.ambient { display: none; }

.app-shell {
  grid-template-columns: 250px minmax(420px, 1fr);
  height: 100dvh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--panel-solid);
  box-shadow: none;
  backdrop-filter: none;
  transition: grid-template-columns .28s var(--ease);
}
.app-shell.sidebar-collapsed { grid-template-columns: 0 minmax(420px, 1fr); }
.app-shell.sidebar-collapsed .sidebar { opacity: 0; pointer-events: none; transform: translateX(-100%); }
.app-shell.sidebar-collapsed .menu-button { display: inline-grid; }
.app-shell.sidebar-collapsed .inspector { left: 50vw; }

.sidebar {
  padding: 18px 12px 14px;
  background: var(--sidebar);
  backdrop-filter: blur(28px) saturate(1.2);
  transition: opacity .2s ease, transform .28s var(--ease);
}

.brand-row { height: 32px; padding: 0 8px; gap: 12px; }
.brand-row strong { color: var(--muted); font-size: .82rem; font-weight: 650; letter-spacing: -.01em; }
.brand-mark { display: none; }
.window-dots { display: flex; align-items: center; gap: 7px; }
.window-dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 1px rgba(0,0,0,.09); }
.window-dots i:nth-child(2) { background: #febc2e; }
.window-dots i:nth-child(3) { background: #28c840; }

.search-button {
  height: 34px;
  margin: 17px 2px 10px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.search-button:hover { background: rgba(255,255,255,.55); }
.search-button kbd { display: none; }

.nav-list { gap: 1px; }
.nav-item {
  min-height: 37px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,.42); }
.nav-item.active { background: rgba(255,255,255,.76); box-shadow: 0 1px 4px rgba(34,40,50,.045); color: var(--ink); font-weight: 560; }
.nav-icon { width: 24px; height: 24px; background: transparent !important; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.85; }
.nav-icon.trash { color: #858a92; }
.nav-count { font-size: .73rem; }

.sidebar-section { margin-top: 19px; }
.section-label-row { padding: 0 8px 7px; font-size: .68rem; letter-spacing: .045em; text-transform: none; }
.project-item { min-height: 35px; padding: 4px 9px; border-radius: 8px; font-size: .88rem; }
.project-item:hover, .project-item.active { background: rgba(255,255,255,.48); }
.project-dot { width: 13px; height: 13px; border: 1px solid color-mix(in srgb, var(--project-color, var(--faint)) 42%, transparent); border-radius: 50%; background: conic-gradient(var(--project-color, var(--faint)) var(--project-progress, 0%), transparent 0); box-shadow: none; }
.sidebar-footer { gap: 0; }
.sidebar-tool { min-height: 35px; border-radius: 8px; font-size: .84rem; }

.workspace { background: var(--panel-solid); }
.topbar {
  min-height: 154px;
  padding: 66px max(38px, calc((100% - 700px) / 2)) 22px;
  align-items: flex-end;
}
.date-lockup > span { color: var(--muted); font-size: .72rem; font-weight: 550; letter-spacing: .015em; text-transform: none; }
.date-lockup h1 { margin-top: 6px; font-size: 2.45rem; font-weight: 740; letter-spacing: -.052em; }
.topbar-actions { padding-bottom: 2px; }
.topbar-actions > .icon-button { width: 32px; height: 32px; border-radius: 50%; }
.add-button { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; box-shadow: none; }
.add-button span, .add-button kbd { display: none; }
.add-button:hover { transform: none; box-shadow: 0 3px 10px rgba(155,17,30,.24); }

.progress-strip { display: none !important; }
.task-scroll { padding: 0 max(38px, calc((100% - 700px) / 2)) 108px; }
.task-groups { max-width: 700px; }
.task-section { margin-bottom: 30px; }
.task-section-title { margin: 0 4px 8px 30px; }
.task-section-title h2 { color: var(--muted); font-size: .79rem; font-weight: 670; letter-spacing: .01em; text-transform: none; }
.task-section-title span { font-size: .7rem; }
.task-list { gap: 0; }
.task-card {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 8px 5px 8px 2px;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
}
.task-card::after { content: ""; position: absolute; right: 8px; bottom: 0; left: 34px; height: 1px; background: var(--line); }
.task-card:last-child::after { display: none; }
.task-card:hover { border-color: transparent; background: color-mix(in srgb, var(--canvas-2) 60%, transparent); box-shadow: none; transform: none; }
.task-card.selected { border-color: transparent; background: var(--blue-soft); box-shadow: none; }
.task-check { width: 19px; height: 19px; margin-top: 2px; border-width: 1.4px; }
.task-check svg { width: 12px; height: 12px; }
.task-title { font-size: .98rem; font-weight: 430; line-height: 1.25; }
.task-meta { min-height: 15px; margin-top: 2px; font-size: .7rem; }
.task-tags { margin-top: 4px; }
.task-tag { padding: 1px 5px; background: transparent; color: var(--faint); font-size: .65rem; }
.task-project-pin { width: 6px; height: 6px; margin-top: 7px; }

.empty-state { margin-top: 82px; }
.empty-state .empty-orbit { display: none; }
.empty-state h2 { font-size: 1.08rem; font-weight: 650; }
.empty-state p { max-width: 330px; font-size: .84rem; }
.empty-state button { border-radius: 16px; }

.quick-capture-wrap {
  right: auto;
  left: max(40px, calc((100% - 700px) / 2));
  bottom: 28px;
  display: flex;
  align-items: center;
  width: auto;
  padding: 0;
  gap: 10px;
  background: none;
}
.magic-plus {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 6px 18px rgba(155, 17, 30, .28);
  color: #fff;
  pointer-events: auto;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.magic-plus:hover { transform: scale(1.045); box-shadow: 0 8px 22px rgba(155,17,30,.32); }
.magic-plus svg { width: 22px; height: 22px; stroke-width: 2; }
.quick-capture {
  width: 0;
  height: 48px;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-color: transparent;
  border-radius: 14px;
  opacity: 0;
  box-shadow: var(--shadow-soft);
  transform: translateX(-16px) scale(.98);
  transition: width .3s var(--ease), opacity .2s ease, transform .3s var(--ease), padding .3s var(--ease);
}
.quick-capture-wrap.capture-open .quick-capture { width: min(460px, calc(100vw - 370px)); padding: 0 7px 0 14px; gap: 8px; border-color: var(--line-strong); opacity: 1; transform: translateX(0) scale(1); }
.quick-plus { display: none; }
.quick-capture input { font-size: .94rem; }
.quick-capture button { width: 34px; height: 34px; border-radius: 50%; }

.inspector {
  position: fixed;
  z-index: 45;
  top: 50%;
  right: auto;
  bottom: auto;
  left: calc(250px + (100vw - 250px) / 2);
  width: min(620px, calc(100vw - 330px));
  max-height: min(720px, calc(100dvh - 90px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -47%) scale(.965);
  transition: opacity .18s ease, transform .24s var(--ease);
}
.inspector.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.inspector-empty { display: none; }
.inspector-form { max-height: inherit; }
.inspector-form.hidden { display: none !important; }
.inspector.open .inspector-form { display: flex !important; visibility: visible !important; }
.inspector-head { min-height: 52px; padding: 8px 14px; font-size: .67rem; letter-spacing: .03em; text-transform: none; }
.inspector-close { visibility: visible; }
.inspector-content { padding: 25px 30px 66px; }
.title-editor-row { grid-template-columns: 30px 1fr; gap: 8px; }
.title-editor-row textarea { font-size: 1.22rem; font-weight: 600; }
.field-label { margin-top: 18px; }
.field-label textarea, .field-label input, .field-label select { border-radius: 8px; background: var(--canvas); }
.inspector-save-state { position: absolute; width: 100%; padding: 16px; background: linear-gradient(transparent, var(--panel-solid) 40%); }

.app-dialog { border-radius: 18px; }
.task-dialog { width: min(610px, calc(100vw - 28px)); }
.dialog-head { padding: 19px 23px 13px; }
.task-dialog form > textarea { font-size: 1.18rem; }

:root[data-theme="dark"] .search-button:hover,
:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .project-item:hover,
:root[data-theme="dark"] .project-item.active { background: rgba(255,255,255,.065); }

@media (max-width: 760px) {
  .app-shell { display: block; }
  .app-shell.sidebar-collapsed .sidebar.open { opacity: 1; pointer-events: auto; transform: translateX(0); }
  .sidebar { width: min(300px, 88vw); }
  .window-dots { display: none; }
  .brand-row strong { color: var(--ink); font-size: 1rem; }
  .topbar { min-height: 122px; padding: max(42px, calc(env(safe-area-inset-top) + 24px)) 20px 18px; }
  .topbar-actions > .icon-button { display: none; }
  .date-lockup h1 { font-size: 2.15rem; }
  .task-scroll { padding: 0 15px calc(150px + env(safe-area-inset-bottom)); }
  .task-section-title { margin-left: 30px; }
  .task-card { border: 0; padding-inline: 3px; }
  .quick-capture-wrap { left: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 0; }
  .quick-capture-wrap.capture-open .quick-capture { width: calc(100vw - 96px); }
  .magic-plus { width: 48px; height: 48px; }
  .inspector { top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: 84dvh; border-width: 1px 0 0; border-radius: 22px 22px 0 0; opacity: 1; transform: translateY(105%); }
  .inspector.open { transform: translateY(0); }
}
