:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #eeede8;
  --surface-strong: #e8e7e1;
  --surface-hover: #dddbd3;
  --ink: #292823;
  --muted: #706e65;
  --line: #dcd9d0;
  --line-strong: #bbb7ac;
  --accent: #a63f27;
  --accent-bright: #a63f27;
  --accent-fill: #f07c5d;
  --accent-soft: #f7e3da;
  --blue: #756b5d;
  --blue-soft: #e8e3da;
  --danger: #ae4340;
  --danger-soft: #f5dfda;
  --warning: #875a17;
  --warning-soft: #f5eacd;
  --shadow: 0 14px 42px rgba(41, 40, 35, 0.12);
  --radius: 18px;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --z-content-overlay: 10;
  --z-popover: 40;
  --z-modal: 50;
  --z-tooltip: 70;
  --z-toast: 90;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1f1d;
  --surface: #282825;
  --surface-strong: #30302c;
  --surface-hover: #383834;
  --ink: #eeeDE8;
  --muted: #aaa8a0;
  --line: #3d3c37;
  --line-strong: #56544d;
  --accent: #d97757;
  --accent-bright: #e48b6d;
  --accent-fill: #f07c5d;
  --accent-soft: #402d25;
  --blue: #beb4a7;
  --blue-soft: #393631;
  --danger: #e58b84;
  --danger-soft: #492d2b;
  --warning: #d8ad69;
  --warning-soft: #443723;
  --shadow: 0 14px 42px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 240ms var(--ease-standard), color 240ms var(--ease-standard);
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, input, select, textarea { color: inherit; }
button, input, select, textarea, summary { transition: color 180ms var(--ease-standard), background-color 180ms var(--ease-standard), border-color 180ms var(--ease-standard), box-shadow 180ms var(--ease-standard), transform 220ms var(--ease-spring), opacity 180ms var(--ease-standard); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

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

.app-shell { min-height: 100vh; }

.view-actions, .modal-footer { display: flex; align-items: center; gap: 0.65rem; }

.primary-button, .secondary-button, .danger-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 780;
}

.primary-button {
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 20%, transparent);
}

:root[data-theme="dark"] .primary-button { color: #07120f; background: var(--accent); }

.primary-button:hover { transform: translateY(-1px); }

.secondary-button, .danger-button {
  padding: 0.64rem 0.95rem;
  background: var(--surface-strong);
  border-color: transparent;
}

.secondary-button:hover { background: var(--surface-hover); }
.danger-button { color: var(--danger); }
.danger-button:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

.icon-button {
  width: 44px;
  padding: 0;
  background: transparent;
  border-color: transparent;
}

.icon-button:hover { background: var(--surface-hover); }

.workspace {
  display: grid;
  grid-template-columns: minmax(235px, 290px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 2.25rem) 4vw 5rem;
}

.project-bar { width: 100%; padding: 0.55rem 4vw 0; }
.project-bar-inner { position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr) 170px; align-items: center; width: min(1480px, 100%); margin: 0 auto; }
.project-carousel-window { position: relative; grid-column: 2; min-width: 0; }
.project-carousel-window::before,
.project-carousel-window::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 2.25rem;
  pointer-events: none;
  content: "";
  opacity: 0;
  transition: opacity 180ms var(--ease-standard);
}
.project-carousel-window::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.project-carousel-window::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.project-carousel-window.can-scroll-left::before,
.project-carousel-window.can-scroll-right::after { opacity: 1; }
.project-actions { display: flex; grid-column: 3; justify-content: flex-end; gap: 0.15rem; }
.project-color-controls { position: relative; }
.project-color-picker { position: absolute; z-index: var(--z-popover); top: calc(100% + 8px); right: 0; display: grid; grid-template-columns: repeat(3, 32px); gap: 0.4rem; padding: 0.55rem; border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.project-color-picker[hidden] { display: none; }
.project-color-picker button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--swatch); color: #292823; opacity: 0.68; transition: opacity 180ms var(--ease-standard), transform 220ms var(--ease-spring), outline-color 180ms var(--ease-standard); }
.project-color-picker button:hover, .project-color-picker button:focus-visible { opacity: 1; transform: scale(1.08); }
.project-color-picker button.is-active { outline: 2px solid var(--ink); outline-offset: 2px; opacity: 1; }
.project-color-picker svg { width: 0.9rem; height: 0.9rem; stroke-width: 3; }

.sidebar { position: sticky; top: 101px; align-self: start; display: grid; gap: 1.6rem; min-width: 0; }

.progress-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.55rem 1rem;
  padding: 0.2rem 0.7rem;
}
.progress-copy p { margin: 0; color: var(--ink); font-size: 0.82rem; font-weight: 790; }
.progress-copy span { color: var(--muted); font-size: 0.76rem; }
.progress-card > strong { color: var(--muted); font-size: 0.78rem; }
.progress-track { grid-column: 1 / -1; height: 3px; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 260ms var(--ease-standard); }
.eyebrow, .section-label { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }

.filter-nav, .tag-filter, .category-filter, .owner-filter { display: grid; gap: 0.45rem; }
.section-label { margin: 0 0 0.35rem 0.8rem; }

.filter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.56rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.filter-link span { display: flex; align-items: center; gap: 0.7rem; font-weight: 720; }
.filter-link svg { width: 1.1rem; height: 1.1rem; }
.filter-link strong { min-width: 1.8rem; padding: 0.12rem 0.45rem; border-radius: 99px; background: var(--surface-strong); color: var(--muted); font-size: 0.76rem; text-align: center; }
.filter-link:hover { background: var(--surface-hover); color: var(--ink); }
.filter-link.is-active { background: color-mix(in srgb, var(--surface) 28%, transparent); color: var(--accent-bright); }
.filter-link.is-active strong { background: transparent; color: inherit; }
:root[data-theme="dark"] .filter-link.is-active { background: color-mix(in srgb, var(--surface) 28%, transparent); color: var(--accent-bright); }

.section-heading { display: flex; align-items: center; justify-content: space-between; }
.tag-filter, .category-filter, .owner-filter { border-top: 0; padding-top: 0.75rem; }
.tag-filter summary, .category-filter summary, .owner-filter summary { display: flex; align-items: center; justify-content: space-between; padding: 0 0.7rem; color: var(--muted); font-size: 0.8rem; font-weight: 760; cursor: pointer; list-style: none; }
.tag-filter summary::-webkit-details-marker, .category-filter summary::-webkit-details-marker, .owner-filter summary::-webkit-details-marker { display: none; }
.tag-filter[open] summary span:last-child, .category-filter[open] summary span:last-child, .owner-filter[open] summary span:last-child { transform: rotate(45deg); }
.tag-filter .tag-list { margin-top: 0.6rem; }
.category-filter .category-list { margin-top: 0.55rem; }
.owner-filter .owner-list { margin-top: 0.55rem; }
.advanced-filters { border-top: 0; padding-top: 0.75rem; }
.advanced-filters > summary { display: flex; align-items: center; justify-content: space-between; padding: 0 0.7rem; color: var(--muted); font-size: 0.8rem; font-weight: 760; cursor: pointer; list-style: none; }
.advanced-filters > summary::-webkit-details-marker { display: none; }
.advanced-filters > summary span:last-child { transition: transform 240ms var(--ease-spring); }
.advanced-filters[open] > summary span:last-child { transform: rotate(45deg); }
.advanced-filter-group { display: grid; gap: 0.45rem; margin-top: 0.9rem; }
.advanced-filter-group .section-label { margin-left: 0; }
.owner-list { display: flex; gap: 0.4rem; }
.owner-filter-button { display: inline-flex; align-items: center; justify-content: center; gap: 0.38rem; min-width: 54px; min-height: 36px; padding: 0.4rem 0.6rem; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 0.8rem; font-weight: 760; }
.owner-filter-button:hover { background: var(--surface-hover); color: var(--ink); }
.owner-filter-button.is-active { border-color: transparent; background: var(--accent-soft); color: var(--ink); }
.owner-filter-button svg { width: 1rem; height: 1rem; }
.owner-filter-button small { color: inherit; font-size: 0.7rem; }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 0.78rem; font-weight: 800; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.category-list { display: grid; gap: 0.38rem; }
.category-filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 0.42rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 730;
  text-align: left;
}
.category-filter-button span { display: flex; align-items: center; gap: 0.55rem; }
.category-filter-button svg { width: 1rem; height: 1rem; color: var(--category-color); }
.category-filter-button small { color: inherit; }
.category-filter-button:hover, .category-filter-button.is-active { background: var(--surface-hover); color: var(--ink); }
.category-filter-button.is-active { background: var(--accent-soft); box-shadow: none; }
.tag-filter-button, .tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0.28rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}
.tag-filter-button:hover { color: var(--accent); background: var(--accent-soft); }
.tag-filter-button.is-active { border-color: transparent; color: var(--accent); background: var(--accent-soft); }
.tag-filter-button i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.storage-note { display: flex; align-items: flex-start; gap: 0.55rem; margin: 0; padding: 0 0.6rem; color: var(--muted); font-size: 0.78rem; }
.storage-note svg { width: 1rem; height: 1rem; flex: 0 0 auto; margin-top: 0.08rem; }

.task-panel { min-width: 0; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.panel-heading h1 { margin: 0.18rem 0 0; font-size: clamp(1.75rem, 3vw, 2.65rem); line-height: 1.04; letter-spacing: -0.055em; }
.project-list { display: flex; align-items: center; justify-content: center; gap: 0.2rem; width: 100%; overflow-x: auto; padding: 0.15rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.project-carousel-window.is-overflowing .project-list { justify-content: flex-start; padding-right: 2rem; }
.project-list::-webkit-scrollbar { display: none; }
.project-list button { display: inline-flex; align-items: center; gap: 0.38rem; flex: 0 0 auto; min-width: 0; min-height: 40px; padding: 0.42rem 0.58rem; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 760; opacity: 0.3; scroll-snap-align: start; }
.project-list button:hover { background: var(--project-soft); color: var(--ink); opacity: 0.72; }
.project-list button.is-active { background: var(--project-soft); color: var(--ink); opacity: 1; }
:root[data-theme="dark"] .project-list button.is-active { color: #fff; }
.project-list button svg { flex: 0 0 auto; width: 0.82rem; height: 0.82rem; }
.project-list button span { white-space: nowrap; }
.project-list button small { flex: 0 0 auto; padding: 0.04rem 0.28rem; border-radius: 99px; background: color-mix(in srgb, currentColor 13%, transparent); color: inherit; font-size: 0.65rem; }
.project-action { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); opacity: 0.38; }
.project-action:hover, .project-action:focus-visible { background: var(--surface-hover); color: var(--ink); opacity: 1; transform: translateY(-1px); }
.project-action svg { width: 1rem; height: 1rem; }
.theme-icons { position: relative; display: block; width: 1rem; height: 1rem; }
.theme-icons svg { position: absolute; inset: 0; transition: opacity 200ms var(--ease-standard), transform 300ms var(--ease-spring); }
.theme-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme="light"] .theme-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme="light"] .theme-moon { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="light"] .category-filter-button svg,
:root[data-theme="light"] .task-category { color: color-mix(in srgb, var(--category-color) 48%, var(--ink)); }

.search-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: min(28vw, 330px);
  min-height: 44px;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
}
.search-field:focus-within { border-color: transparent; background: var(--surface-strong); box-shadow: none; }
.search-field svg { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; color: var(--muted); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
.search-field kbd { padding: 0.12rem 0.38rem; border: 0; border-radius: 5px; color: var(--muted); background: var(--surface-strong); font-size: 0.72rem; }

.select-wrap select, .form-field select {
  min-height: 44px;
  padding: 0.6rem 2rem 0.6rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface);
}

.choice-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }
.choice-picker > button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.55rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; opacity: 0.52; }
.choice-picker > button:hover, .choice-picker > button:focus-visible { background: var(--surface-hover); color: var(--ink); opacity: 1; transform: translateY(-1px); }
.choice-picker > button.is-active { border-color: transparent; background: var(--accent-soft); color: var(--accent-bright); opacity: 1; }
.choice-picker svg { width: 1rem; height: 1rem; }
.sort-picker { flex-wrap: nowrap; padding: 0.2rem; border-radius: 12px; background: transparent; }
.sort-picker > button { min-width: 34px; width: 34px; height: 36px; padding: 0; background: transparent; font-size: 0.74rem; }
.category-choice { grid-column: 1 / -1; }
.category-choice .choice-picker > button { flex: 1 0 40px; }
.choice-field { min-width: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 0.38rem; padding: 0; color: var(--muted); font-size: 0.82rem; font-weight: 790; }
.level-bars { display: inline-flex; align-items: end; gap: 2px; height: 15px; }
.level-bars i { display: block; width: 3px; border-radius: 2px; background: currentColor; }
.level-bars i:nth-child(1) { height: 6px; }
.level-bars i:nth-child(2) { height: 10px; }
.level-bars i:nth-child(3) { height: 14px; }

.quick-add {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  box-shadow: none;
}
.quick-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 1.25rem; font-weight: 500; }
.quick-add input { min-width: 0; min-height: 38px; border: 0; outline: 0; background: transparent; font-weight: 650; }
.quick-more { border: 0; background: transparent; color: var(--accent); font-size: 0.84rem; font-weight: 800; }
.quick-more svg { width: 1rem; height: 1rem; }
.content-toolbar { display: flex; align-items: center; gap: 0.18rem; }
.content-toolbar button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); opacity: 0.5; }
.content-toolbar button:hover, .content-toolbar button:focus-visible { background: var(--surface-hover); color: var(--accent-bright); opacity: 1; transform: translateY(-1px); }
.content-toolbar svg { width: 1rem; height: 1rem; }
.quick-content { position: relative; margin: -0.55rem 0 1rem 3.25rem; animation: brief-in 220ms var(--ease-spring); }
.quick-content[hidden] { display: none; }
.quick-content textarea { width: 100%; min-height: 92px; padding: 0.7rem 3rem 0.7rem 0.8rem; border: 0; border-radius: 11px; background: var(--surface); color: var(--ink); outline: 0; resize: vertical; line-height: 1.5; }
.quick-content textarea:focus { background: var(--surface-strong); }
.quick-save { position: absolute; right: 0.5rem; bottom: 0.5rem; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: var(--accent-fill); color: #17140a; }
.quick-save:hover { background: var(--accent-bright); transform: translateY(-1px); }
.quick-save svg { width: 1rem; height: 1rem; }

.active-filters { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.85rem; }
.active-filter { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.6rem; border: 1px solid transparent; border-radius: 999px; background: var(--accent-soft); color: var(--muted); font-size: 0.78rem; }
.active-filter button { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; }

.task-list { display: grid; gap: 0.42rem; overflow: visible; border: 0; border-radius: 14px; background: transparent; }
.task-card {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
  padding: 0.72rem 0.8rem;
  border: 0;
  border-bottom: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
  transition: background 180ms var(--ease-standard), opacity 180ms var(--ease-standard), box-shadow 220ms var(--ease-standard), transform 220ms var(--ease-spring);
}
.task-card:last-child { border-bottom: 0; }
.task-card::before { position: absolute; inset: 16px auto 16px 0; width: 2px; border-radius: 0 4px 4px 0; background: var(--priority-color, var(--line)); content: ""; }
.task-card:hover { background: var(--surface-strong); }
.task-card:hover, .task-card:focus-within { z-index: var(--z-content-overlay); }
.task-card.is-expanded { background: var(--surface-strong); box-shadow: none; }
.task-card.is-done { opacity: 0.68; }
.task-card.is-done .task-title { text-decoration: line-through; }
.task-card.is-overdue:not(.is-done) { border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); }

.task-check { position: relative; margin-top: 0.12rem; }
.task-check input { position: absolute; opacity: 0; pointer-events: none; }
.task-check span { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid transparent; border-radius: 8px; background: var(--surface-hover); color: transparent; transition: color 180ms var(--ease-standard), background 180ms var(--ease-standard), border-color 180ms var(--ease-standard), transform 220ms var(--ease-spring); }
.task-check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 2px; }
.task-check input:checked + span { border-color: transparent; background: var(--accent-fill); color: #07120f; transform: scale(1.04); }
.task-check svg { width: 0.9rem; height: 0.9rem; stroke-width: 3; }
.task-order {
  display: grid;
  place-items: center;
  min-width: 1.85rem;
  height: 24px;
  margin-top: 0.12rem;
  padding: 0 0.35rem;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.task-main { min-width: 0; }
.task-line { display: flex; align-items: center; gap: 0.65rem; min-height: 28px; }
.task-title-button { min-width: 0; flex: 1; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.task-title { overflow: hidden; margin: 0; font-size: 0.94rem; font-weight: 690; line-height: 1.38; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.task-details { display: block; max-height: 0; overflow: hidden; padding: 0; opacity: 0; visibility: hidden; transform: translateY(-5px); transition: max-height 420ms var(--ease-spring), opacity 220ms var(--ease-standard), transform 320ms var(--ease-spring), padding 320ms var(--ease-standard), visibility 0s linear 420ms; }
.task-card.is-expanded .task-details { max-height: 3200px; padding: 0.45rem 0 0.16rem; opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; }
.task-card.is-expanded .task-title { white-space: normal; }
.task-notes { margin: 0.3rem 0 0; color: color-mix(in srgb, var(--ink) 88%, var(--muted)); font-size: 0.88rem; line-height: 1.52; }
.task-notes p { margin: 0.35rem 0; }
.task-notes-list { display: grid; gap: 0.28rem; margin: 0.42rem 0; padding-left: 1.2rem; }
.task-notes-list li { padding-left: 0.18rem; line-height: 1.48; }
.task-notes-list li::marker { color: var(--accent); }
.subtasks { margin-top: 0.78rem; }
.subtasks-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.72rem; font-weight: 790; }
.subtasks-heading small { color: inherit; font-size: inherit; }
.subtask-list { display: grid; gap: 0.18rem; margin: 0; padding: 0 0 0 0.45rem; list-style: none; }
.subtask-item label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 0.55rem; padding: 0.34rem 0.4rem; border-radius: 8px; color: var(--ink); cursor: pointer; transition: color 180ms var(--ease-standard), background 180ms var(--ease-standard), transform 220ms var(--ease-spring); }
.subtask-item label:hover { background: var(--surface-hover); transform: translateX(2px); }
.subtask-item input { position: absolute; opacity: 0; pointer-events: none; }
.subtask-check { display: grid; place-items: center; width: 18px; height: 18px; margin-top: 0.08rem; border-radius: 6px; background: var(--surface); color: transparent; transition: color 180ms var(--ease-standard), background 180ms var(--ease-standard), transform 240ms var(--ease-spring); }
.subtask-check svg { width: 0.72rem; height: 0.72rem; stroke-width: 3; }
.subtask-item input:focus-visible + .subtask-check { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 2px; }
.subtask-item input:checked + .subtask-check { background: var(--accent-fill); color: #07120f; transform: scale(1.06); }
.subtask-item.is-done .subtask-title { color: var(--muted); text-decoration: line-through; }
.subtask-title { min-width: 0; font-size: 0.82rem; line-height: 1.45; }
.task-progress-preview { margin: 0.48rem 0 0; padding-left: 0.62rem; border-left: 2px solid var(--accent); color: var(--muted); font-size: 0.8rem; }
.task-progress-preview strong { color: var(--accent); }
.task-detail-actions { display: flex; justify-content: flex-end; margin-top: 0.72rem; padding-top: 0.2rem; border-top: 0; }
.copy-prompt-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; min-height: 34px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); }
.copy-prompt-button:hover { color: var(--accent-bright); background: var(--accent-soft); transform: translateY(-1px); }
.copy-prompt-button svg { width: 0.92rem; height: 0.92rem; }
.llm-brief { margin-top: 0.72rem; border-radius: 10px; background: color-mix(in srgb, var(--surface) 58%, transparent); }
.llm-brief summary { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; min-height: 38px; padding: 0.42rem 0.6rem; border-radius: inherit; color: var(--muted); cursor: pointer; list-style: none; }
.llm-brief summary::-webkit-details-marker { display: none; }
.llm-brief summary:hover { background: var(--surface-hover); color: var(--ink); }
.llm-brief summary > span, .llm-brief summary > small { display: inline-flex; align-items: center; gap: 0.4rem; }
.llm-brief summary svg { width: 0.9rem; height: 0.9rem; }
.llm-brief summary small { color: var(--muted); font-size: 0.7rem; font-weight: 800; }
.llm-brief-chevron { transition: transform 260ms var(--ease-spring); }
.llm-brief[open] .llm-brief-chevron { transform: rotate(180deg); }
.llm-brief-body { padding: 0.25rem 0.6rem 0.6rem; animation: brief-in 260ms var(--ease-spring); }
.llm-brief-body > p { margin: 0.2rem 0 0.65rem; color: var(--muted); font-size: 0.76rem; }
.llm-brief pre { max-width: 100%; max-height: 280px; overflow: auto; overflow-wrap: anywhere; margin: 0; padding: 0.7rem; border: 0; border-radius: 9px; background: var(--bg); color: var(--muted); font: 0.72rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.42rem; margin-top: 0.7rem; }
.task-status, .task-due, .task-category, .task-effort { display: inline-flex; align-items: center; gap: 0.32rem; min-height: 27px; padding: 0.2rem 0.5rem; border-radius: 7px; background: var(--surface-hover); color: var(--muted); font-size: 0.74rem; font-weight: 760; }
.task-status, .task-category { justify-content: center; width: 27px; padding: 0; }
.task-status svg, .task-due svg, .task-category svg, .task-effort svg { width: 0.9rem; height: 0.9rem; }
.task-category { flex: 0 0 auto; min-height: 23px; width: 23px; color: var(--category-color); }
.owner-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 25px; min-height: 23px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: var(--surface-hover); color: var(--muted); }
.owner-badge svg { width: 0.9rem; height: 0.9rem; }
.owner-badge[data-owner="user"] { color: var(--accent-bright); }
.task-status[data-status="progress"] { background: var(--blue-soft); color: var(--blue); }
.task-status[data-status="done"] { background: var(--accent-soft); color: var(--accent); }
.task-due.is-overdue { background: var(--danger-soft); color: var(--danger); }
.tag-chip { min-height: 27px; padding: 0.18rem 0.5rem; border: 0; background: var(--surface-strong); font-size: 0.74rem; }

.task-menu { width: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.task-menu:hover { background: var(--surface-hover); color: var(--ink); }
.task-menu svg { width: 1.15rem; }
.task-actions { display: flex; align-items: center; align-self: center; gap: 0.15rem; opacity: 0; transform: translateX(4px); transition: opacity 180ms var(--ease-standard), transform 240ms var(--ease-spring); }
.task-card:hover .task-actions, .task-card:focus-within .task-actions, .task-card.is-expanded .task-actions { opacity: 1; }
.task-card:hover .task-actions, .task-card:focus-within .task-actions, .task-card.is-expanded .task-actions { transform: translateX(0); }
.task-actions .task-menu { width: 30px; min-height: 28px; }
.order-button { display: grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: var(--surface-hover); color: var(--muted); }
.order-button:hover { color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.order-button svg { width: 0.85rem; height: 0.85rem; }

.has-tooltip { position: relative; }
.has-tooltip::after {
  position: absolute;
  z-index: var(--z-tooltip);
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(240px, 70vw);
  padding: 0.34rem 0.5rem;
  border-radius: 7px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
  content: attr(data-tooltip);
  font-size: 0.7rem;
  font-weight: 720;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) scale(0.98);
  transform-origin: bottom center;
  transition: opacity 160ms var(--ease-standard), transform 200ms var(--ease-spring);
  white-space: normal;
}
.has-tooltip:hover::after, .has-tooltip:focus-visible::after, .has-tooltip:focus-within::after { opacity: 1; transform: translate(-50%, 0) scale(1); }
.project-actions .has-tooltip::after { top: calc(100% + 8px); right: 0; bottom: auto; left: auto; transform: translateY(-4px) scale(0.98); transform-origin: top right; }
.project-actions .has-tooltip:hover::after, .project-actions .has-tooltip:focus-visible::after, .project-actions .has-tooltip:focus-within::after { transform: translateY(0) scale(1); }
.task-detail-actions .has-tooltip::after { right: 0; left: auto; transform: translateY(4px) scale(0.98); transform-origin: bottom right; }
.task-detail-actions .has-tooltip:hover::after, .task-detail-actions .has-tooltip:focus-visible::after, .task-detail-actions .has-tooltip:focus-within::after { transform: translateY(0) scale(1); }

.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-check { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 1rem; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-size: 1.8rem; font-weight: 900; transform: rotate(-5deg); }
.empty-state h2 { margin: 0; font-size: 1.35rem; }
.empty-state p { margin: 0.35rem 0 1.2rem; color: var(--muted); }

.modal-backdrop { position: fixed; z-index: var(--z-modal); inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(12, 12, 11, 0.66); backdrop-filter: blur(7px); animation: fade-in 180ms var(--ease-standard); }
.modal-backdrop[hidden] { display: none; }
.task-modal { width: min(650px, 100%); max-height: calc(100dvh - 2rem); overflow: auto; border: 1px solid transparent; border-radius: 24px; background: var(--surface); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.32); animation: modal-in 320ms var(--ease-spring); }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.25rem 0.6rem; }
.modal-header h2 { margin: 0.15rem 0 0; font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -0.04em; }
#taskForm { padding: 0.7rem 1.25rem 1.25rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { display: grid; gap: 0.38rem; margin-bottom: 1rem; }
.form-field > span { color: var(--muted); font-size: 0.82rem; font-weight: 790; }
.form-field em { font-style: normal; font-weight: 550; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-height: 46px; padding: 0.68rem 0.78rem; border: 1px solid transparent; border-radius: 11px; background: transparent; outline: 0; }
.form-field textarea { resize: vertical; min-height: 95px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: transparent; background: var(--surface-hover); box-shadow: none; }
.form-field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 1em; color: var(--danger); font-size: 0.75rem; }
.modal-content-toolbar { justify-content: flex-end; margin: -0.72rem 0 0.85rem; }
.additional-details { margin: 0.1rem 0 0.8rem; border-radius: 14px; background: color-mix(in srgb, var(--surface-strong) 54%, transparent); }
.additional-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0.65rem 0.78rem; color: var(--muted); cursor: pointer; list-style: none; font-size: 0.82rem; font-weight: 790; }
.additional-details > summary::-webkit-details-marker { display: none; }
.additional-details > summary svg { width: 1rem; height: 1rem; transition: transform 240ms var(--ease-spring); }
.additional-details[open] > summary svg { transform: rotate(180deg); }
.additional-details > .form-grid, .additional-details > .progress-log { margin-right: 0.65rem; margin-left: 0.65rem; }
.additional-details[open] > .form-grid, .additional-details[open] > .progress-log { animation: brief-in 220ms var(--ease-spring); }
.done-last-toggle.is-active { background: var(--accent-soft); color: var(--accent-bright); opacity: 1; }
.progress-log { margin: 0.2rem 0 1.1rem; padding: 1rem; border: 1px solid transparent; border-radius: 14px; background: var(--surface-strong); }
.progress-log-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.progress-log-heading h3 { margin: 0.12rem 0 0; font-size: 1rem; }
.progress-log-heading > span { color: var(--muted); font-size: 0.76rem; }
.progress-entries { display: grid; gap: 0.5rem; max-height: 155px; overflow: auto; margin-bottom: 0.75rem; }
.progress-entry { display: grid; grid-template-columns: auto 1fr; gap: 0.65rem; padding: 0.55rem 0.65rem; border-radius: 9px; background: var(--surface); }
.progress-entry time { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.progress-entry p { margin: 0; font-size: 0.82rem; }
.progress-empty { margin: 0; color: var(--muted); font-size: 0.82rem; }
.progress-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.55rem; }
.progress-add input { min-width: 0; min-height: 42px; padding: 0.6rem 0.7rem; border: 1px solid transparent; border-radius: 10px; background: transparent; }
.progress-add input:focus { border-color: transparent; background: var(--surface-hover); }
.modal-footer { padding-top: 0.4rem; border-top: 0; }
.modal-footer button { width: 44px; padding: 0; }
.modal-spacer { flex: 1; }

.toast { position: fixed; z-index: var(--z-toast); right: 1rem; bottom: 1rem; max-width: min(360px, calc(100vw - 2rem)); padding: 0.8rem 1rem; border: 0; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); font-weight: 720; animation: toast-in 260ms var(--ease-spring); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes brief-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .filter-nav { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .filter-nav .section-label { grid-column: 1 / -1; }
  .filter-link { background: transparent; border-color: transparent; }
  .storage-note { align-self: center; }
}

/* ---------- sync status, account, auth (all widths) ---------- */

.project-status { grid-column: 1; grid-row: 1; display: flex; align-items: center; min-width: 0; }
.sync-indicator { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 36px; padding: 0.3rem 0.6rem; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 760; }
.sync-indicator[hidden] { display: none; }
button.sync-indicator:hover, button.sync-indicator:focus-visible { background: var(--surface-hover); color: var(--ink); }
.project-status .has-tooltip::after { top: calc(100% + 8px); bottom: auto; left: 0; transform: translateY(-4px) scale(0.98); transform-origin: top left; }
.project-status .has-tooltip:hover::after, .project-status .has-tooltip:focus-visible::after { transform: translateY(0) scale(1); }
.sync-dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
[data-sync-status][data-state="synced"] .sync-dot { background: #7fae6a; }
[data-sync-status][data-state="saving"] .sync-dot { background: var(--warning); animation: pulse 1s var(--ease-standard) infinite alternate; }
[data-sync-status][data-state="offline"] .sync-dot { background: var(--danger); }
.sync-inline { margin-left: auto; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.35; } }

.migrate-button { justify-self: start; gap: 0.5rem; margin: 0 0.6rem; font-size: 0.84rem; }
.migrate-button[hidden] { display: none; }
.migrate-button svg { width: 1.05rem; height: 1.05rem; }

body.is-auth { overflow: hidden; }
body.is-auth .app-shell, body.is-auth .bottom-nav { visibility: hidden; }
.auth-screen { position: fixed; z-index: var(--z-modal); inset: 0; display: grid; place-items: center; overflow: auto; padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom)); background: var(--bg); }
.auth-card { display: grid; gap: 0.9rem; width: min(400px, 100%); padding: 1.6rem 1.4rem; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.auth-logo { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.auth-logo svg { width: 1.6rem; height: 1.6rem; stroke-width: 2.6; }
.auth-card h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.04em; }
.auth-lead { margin: 0; color: var(--muted); font-size: 0.92rem; }
.auth-wide { width: 100%; gap: 0.55rem; }
.auth-divider { display: flex; align-items: center; gap: 0.7rem; margin: 0; color: var(--muted); font-size: 0.78rem; }
.auth-divider::before, .auth-divider::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.auth-email { display: grid; gap: 0.5rem; text-align: left; }
.auth-email label { color: var(--muted); font-size: 0.82rem; font-weight: 790; }
.auth-email input, .token-form input[type="text"] { width: 100%; min-height: 46px; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); outline: 0; font-size: 16px; }
.auth-email input:focus, .token-form input[type="text"]:focus { border-color: var(--accent); }
.auth-message { min-height: 1.4em; margin: 0; color: var(--muted); font-size: 0.86rem; }
.auth-sent { display: grid; gap: 0.55rem; padding: 1rem; border-radius: 14px; background: var(--accent-soft); text-align: left; }
.auth-sent strong { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; }
.auth-sent strong svg { color: var(--accent); }
.auth-sent p { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.auth-sent .auth-sent-note { color: var(--muted); font-size: 0.82rem; }
.auth-sent-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.2rem; }
.auth-sent-actions .secondary-button:disabled { cursor: default; opacity: 0.7; }

body.has-dialog { overflow: hidden; }
.cloud-dialog-backdrop { position: fixed; z-index: calc(var(--z-modal) + 2); inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(12, 12, 11, 0.66); backdrop-filter: blur(7px); animation: fade-in 180ms var(--ease-standard); }
.cloud-dialog { width: min(620px, 100%); max-height: calc(100dvh - 2rem); overflow: auto; border-radius: 22px; background: var(--surface); box-shadow: 0 30px 100px rgba(0, 0, 0, 0.32); animation: modal-in 320ms var(--ease-spring); }
.cloud-dialog-header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 0.5rem 1.25rem; background: var(--surface); }
.cloud-dialog-header h2 { margin: 0; font-size: 1.3rem; letter-spacing: -0.03em; }
.cloud-dialog-body { display: grid; gap: 1.1rem; padding: 0.25rem 1.25rem 1.4rem; }
.dialog-lead { margin: 0; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dialog-actions button, .account-section > .secondary-button, .account-buttons button, .passkey-suggestion button, .conflict-bar button, .cloud-dialog-body .primary-button { gap: 0.5rem; }
.account-section { display: grid; gap: 0.6rem; }
.account-section h3 { margin: 0; font-size: 1rem; }
.account-email { margin: 0; font-weight: 780; overflow-wrap: anywhere; }
.account-sync { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--muted); font-size: 0.84rem; }
.account-hint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.account-hint code { font-size: 0.78rem; }
.account-list { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.account-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 11px; background: var(--surface-strong); }
.account-list li > div:first-child { display: grid; min-width: 0; }
.account-list strong { font-size: 0.9rem; overflow-wrap: anywhere; }
.account-list small { color: var(--muted); font-size: 0.76rem; }
.account-list .account-empty { display: block; color: var(--muted); font-size: 0.84rem; }
.account-row-actions { display: flex; flex: 0 0 auto; gap: 0.4rem; }
.account-row-actions .text-button { min-height: 36px; padding: 0 0.3rem; }
.danger-text { color: var(--danger); }
.account-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.token-form { display: grid; gap: 0.45rem; }
.token-form > label { color: var(--muted); font-size: 0.82rem; font-weight: 790; }
.token-form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; }
.token-options { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; color: var(--muted); font-size: 0.84rem; }
.token-options label { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 32px; }
.token-options input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent-fill); }
.token-created { display: grid; gap: 0.6rem; padding: 0.85rem; border-radius: 13px; background: var(--accent-soft); }
.token-created p { margin: 0; font-size: 0.86rem; }
.token-snippet { position: relative; display: grid; gap: 0.25rem; }
.token-snippet span { color: var(--muted); font-size: 0.76rem; font-weight: 780; }
.token-snippet pre { margin: 0; padding: 0.6rem 2.6rem 0.6rem 0.65rem; border-radius: 9px; background: var(--bg); font: 0.74rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.token-snippet button { position: absolute; right: 0.25rem; bottom: 0.25rem; }

.conflict-bar, .passkey-suggestion { position: fixed; z-index: calc(var(--z-modal) - 1); right: 1rem; bottom: 1rem; left: auto; display: grid; gap: 0.6rem; width: min(460px, calc(100vw - 2rem)); padding: 0.9rem 1rem; border-radius: 16px; background: var(--surface-strong); box-shadow: var(--shadow); animation: toast-in 260ms var(--ease-spring); }
.conflict-bar p, .passkey-suggestion p { display: grid; gap: 0.2rem; margin: 0; font-size: 0.86rem; }
.conflict-bar span, .passkey-suggestion span { color: var(--muted); overflow-wrap: anywhere; }
.conflict-bar > div, .passkey-suggestion > div { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.conflict-bar { border-left: 3px solid var(--warning); }

.task-glance { display: none; }
.search-close { display: none; }

/* ---------- phone layout (bottom navigation and sheets) ---------- */

.mobile-bar, .bottom-nav { display: none; }
.sheet-backdrop[hidden] { display: none; }

@media (max-width: 720px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .project-bar { display: none; }
  .mobile-bar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: max(0.4rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.4rem max(0.6rem, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
  .mobile-project-button { display: inline-flex; align-items: center; gap: 0.55rem; min-width: 0; min-height: 44px; padding: 0.35rem 0.6rem; border: 0; border-radius: 12px; background: transparent; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
  .mobile-project-button i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fill); }
  .mobile-project-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-project-button svg { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; color: var(--muted); }
  .mobile-project-button:active { background: var(--surface-hover); }
  .mobile-bar .sync-indicator { min-width: 44px; justify-content: center; }
  body:not(.is-cloud) .mobile-bar .sync-indicator { display: none; }

  .workspace { display: block; overflow-x: hidden; padding: 0.35rem 1rem 1.5rem; }
  .workspace > .sidebar { display: none; }
  .panel-heading { display: none; margin-bottom: 0.75rem; }
  body.mobile-search-open .panel-heading { display: block; }
  .panel-heading > div:first-child { display: none; }
  .view-actions { display: flex; align-items: center; gap: 0.35rem; }
  .view-actions .search-field { flex: 1; }
  .search-close { display: inline-flex; flex: 0 0 auto; width: 48px; min-height: 48px; }
  .search-field { min-width: 0; min-height: 48px; background: var(--surface); }
  .search-field input { font-size: 16px; }
  .search-field kbd { display: none; }
  .quick-add, .quick-content { display: none !important; }

  .task-list { gap: 0.35rem; }
  .task-card { grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: center; padding: 0.3rem 0.6rem 0.3rem 0.35rem; }
  .task-card::before { inset: 14px auto 14px 0; }
  .task-card .task-order, .task-card .task-actions, .task-card .task-category, .task-card .owner-badge { display: none; }
  .task-check { display: grid; place-items: center; width: 44px; height: 44px; margin: 0; cursor: pointer; }
  .task-check span { width: 26px; height: 26px; }
  .task-title-button { display: grid; gap: 0.1rem; min-height: 48px; align-content: center; padding: 0.35rem 0; }
  .task-title { font-size: 1rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .task-glance { display: flex; gap: 0.65rem; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
  .task-glance .is-overdue { color: var(--danger); }
  .task-line { min-height: 0; }
  .task-card .task-details { display: none; }
  .task-card:hover { background: var(--surface); }
  .task-card.is-expanded { background: var(--surface); }
  .active-filters { margin-bottom: 0.6rem; }
  .empty-state { padding: 3rem 1rem; }

  .bottom-nav { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: 0.35rem max(0.5rem, env(safe-area-inset-right)) max(0.35rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); box-shadow: 0 -1px 0 var(--line); }
  .bottom-nav button { display: grid; justify-items: center; gap: 0.1rem; min-height: 56px; padding: 0.3rem 0; border: 0; background: transparent; color: var(--muted); font-size: 0.72rem; font-weight: 760; }
  .bottom-nav button svg { width: 1.35rem; height: 1.35rem; }
  .bottom-nav button.is-active { color: var(--ink); }
  .bottom-nav button.is-active svg { color: var(--accent-bright); }
  .bottom-nav .bottom-nav-add { justify-self: center; align-self: center; width: 56px; height: 56px; min-height: 56px; place-items: center; border-radius: 18px; background: var(--accent-fill); color: #1b1712; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent-fill) 35%, transparent); }
  .bottom-nav .bottom-nav-add svg { width: 1.6rem; height: 1.6rem; stroke-width: 2.4; }
  body.is-typing .bottom-nav, body.has-sheet .bottom-nav { display: none; }

  .sheet-backdrop { position: fixed; z-index: var(--z-modal); inset: 0; display: flex; align-items: flex-end; background: rgba(12, 12, 11, 0.55); animation: fade-in 180ms var(--ease-standard); }
  .sheet { display: flex; flex-direction: column; width: 100%; max-height: min(88dvh, 100%); border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.3); animation: sheet-in 300ms var(--ease-spring); }
  .sheet-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0.6rem 0.35rem 1.1rem; }
  .sheet-handle { position: absolute; top: 0.4rem; left: 50%; width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); transform: translateX(-50%); }
  .sheet-header h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
  .sheet-body { display: grid; gap: 1.2rem; overflow: auto; overscroll-behavior: contain; padding: 0.25rem 1rem max(1.2rem, env(safe-area-inset-bottom)); }
  .sheet-body > .sidebar { position: static; display: grid; gap: 1rem; }
  .sheet-body .filter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
  .sheet-body .filter-nav .section-label { grid-column: 1 / -1; margin-left: 0; }
  .sheet-body .filter-link { min-height: 48px; background: var(--surface-strong); }
  .sheet-body .filter-link.is-active { background: var(--accent-soft); }
  .sheet-body .advanced-filters { padding-top: 0; }
  .sheet-body .advanced-filters > summary { min-height: 44px; padding: 0; }
  .sheet-body .category-list { display: flex; flex-wrap: wrap; }
  .sheet-body .category-filter-button { width: auto; background: var(--surface-strong); }
  .sheet-body .storage-note { padding: 0; }
  .sheet-body .migrate-button { margin: 0; }
  .sheet-group { display: grid; gap: 0.45rem; }
  .sheet-group .section-label { margin: 0; }
  .sheet-sort .sort-picker { flex-wrap: wrap; gap: 0.35rem; padding: 0; }
  .sheet-sort .sort-picker > button { width: 48px; height: 44px; background: var(--surface-strong); opacity: 0.8; font-size: 0.9rem; }
  .sheet-sort .has-tooltip::after { display: none; }
  .sheet-row { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 50px; padding: 0.6rem 0.8rem; border: 0; border-radius: 12px; background: var(--surface-strong); font-weight: 720; text-align: left; }
  .sheet-row svg { width: 1.15rem; height: 1.15rem; color: var(--muted); }
  .sheet-project-list { display: grid; gap: 0.35rem; }
  .sheet-project-list button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; min-height: 52px; padding: 0.55rem 0.8rem; border: 0; border-radius: 12px; background: var(--surface-strong); font-weight: 740; text-align: left; }
  .sheet-project-list button.is-active { background: var(--accent-soft); }
  .sheet-project-list i { width: 12px; height: 12px; border-radius: 50%; background: var(--project-accent); }
  .sheet-project-list small { color: var(--muted); font-size: 0.76rem; }
  .sheet-empty { margin: 0; color: var(--muted); }
  .sheet-actions { display: grid; gap: 0.35rem; }
  .sheet-colors { display: flex; align-items: center; gap: 0.8rem; min-height: 52px; padding: 0.4rem 0.8rem; border-radius: 12px; background: var(--surface-strong); }
  .sheet-colors > span { color: var(--muted); font-weight: 720; }
  .sheet-color-picker { display: flex; flex-wrap: wrap; gap: 0.45rem; }
  .sheet-color-picker button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--swatch); color: #292823; }
  .sheet-color-picker button.is-active { outline: 2px solid var(--ink); outline-offset: 2px; }
  .sheet-color-picker svg { width: 0.9rem; height: 0.9rem; stroke-width: 3; }

  .task-card.is-sheet-card { display: block; padding: 0; background: transparent; }
  .task-card.is-sheet-card::before { display: none; }
  .task-card.is-sheet-card .task-check { position: absolute; top: 0; left: -0.5rem; }
  .task-card.is-sheet-card .task-line { padding-left: 2.6rem; }
  .task-card.is-sheet-card .task-title { font-size: 1.15rem; -webkit-line-clamp: unset; display: block; }
  .task-card.is-sheet-card .task-glance { display: none; }
  .task-card.is-sheet-card .task-title-button { pointer-events: none; }
  .task-card.is-sheet-card .task-details { display: block; max-height: none; }
  .task-card.is-sheet-card .task-category, .task-card.is-sheet-card .owner-badge { display: inline-flex; }
  .task-card.is-sheet-card .subtask-item label { min-height: 44px; align-items: center; }
  .task-card.is-sheet-card .subtask-check { width: 22px; height: 22px; }
  .task-card.is-sheet-card .subtask-title { font-size: 0.92rem; }
  .task-card.is-sheet-card .has-tooltip::after { display: none; }
  .sheet-task-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem; }
  .sheet-task-actions .primary-button { gap: 0.5rem; }
  .sheet-task-actions .secondary-button { width: 48px; padding: 0; }

  .modal-backdrop { align-items: end; padding: 0; }
  .task-modal { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; }
  .modal-header { padding: 1rem 1rem 0.3rem; }
  #taskForm { padding: 0.5rem 1rem 1rem; }
  .form-field input, .form-field textarea, .progress-add input { font-size: 16px; background: var(--surface-strong); }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .progress-add { grid-template-columns: minmax(0, 1fr) auto; }
  .modal-footer { position: sticky; z-index: 1; bottom: -1rem; margin: 0 -1rem -1rem; padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom)); background: var(--surface); }
  .modal-footer button { width: 48px; min-height: 48px; }
  .task-modal .has-tooltip::after { display: none; }
  .cloud-dialog-backdrop { align-items: end; padding: 0; }
  .cloud-dialog { max-height: 94dvh; border-radius: 22px 22px 0 0; }
  .cloud-dialog-body { padding-bottom: max(1.4rem, env(safe-area-inset-bottom)); }

  .toast { right: 1rem; bottom: calc(84px + env(safe-area-inset-bottom)); left: 1rem; max-width: none; }
  .conflict-bar, .passkey-suggestion { right: 0.75rem; bottom: calc(80px + env(safe-area-inset-bottom)); left: 0.75rem; width: auto; }
  body.has-sheet .toast { bottom: calc(1rem + env(safe-area-inset-bottom)); }
}

@keyframes sheet-in { from { transform: translateY(40px); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
