/* Things 3 light aesthetic — visual layer only. Do not invert in dark mode. */
:root {
  color-scheme: only light;
  --blue: #2b9bf0;
  --blue-press: #1b86d6;
  --blue-text: #007aff;
  --blue-strong: #0a84ff;
  --today: #ffca18;
  --upcoming: #f45c79;
  --anytime: #42ad9d;
  --someday: #b5a055;
  --logbook: #55b96b;
  --complete: #58a55c;
  --overdue: #ff453a;
  --destructive: #ff3b30;
  --tag-text: #3988dc;
  --tag-fill: #e8f1fb;
  --ink: #1d1d1f;
  --ink-soft: #3a3a3c;
  --muted: #8e8e93;
  --faint: #c7c7cc;
  --hairline: rgba(60, 60, 67, 0.12);
  --hairline-soft: rgba(60, 60, 67, 0.08);
  --fill: #f2f2f7;
  --fill-hover: #f5f5f7;
  --row-hover: #f6f6f8;
  --selection: #e4ebf2;
  --event: #f4f4f6;
  --sidebar: rgba(232, 235, 240, 0.78);
  --sidebar-solid: #e8ebf0;
  --sidebar-active: rgba(60, 60, 67, 0.14);
  --sidebar-hover: rgba(60, 60, 67, 0.07);
  --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12), 0 12px 40px rgba(15, 22, 32, 0.14);
  --card-shadow: 0 18px 60px rgba(15, 22, 32, 0.18), 0 2px 8px rgba(15, 22, 32, 0.06);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.2, 0.85, 0.25, 1);
  --check: 22px;
  --check-col: 36px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root,
  html,
  body {
    color-scheme: only light;
    background: #d8dde4;
    color: #1d1d1f;
  }
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
html { color-scheme: only light; }
body {
  margin: 0;
  overflow: hidden;
  background: #d5dae1;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { display: block; }
::selection { background: rgba(43, 155, 240, 0.22); }

.app-window {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}
.t-loading,
.t-save-error {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(15, 22, 32, 0.12);
  pointer-events: none;
}
.t-loading {
  background: rgba(255, 255, 255, 0.94);
  color: #636366;
}
.t-save-error {
  background: #fff2f2;
  color: #d70015;
}

/* ── Sidebar (Things Mac / iPad material) ── */
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 10px 10px;
  background:
    linear-gradient(180deg, rgba(244, 246, 249, 0.72), rgba(228, 232, 238, 0.82));
  border-right: 1px solid rgba(60, 60, 67, 0.1);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  overflow: hidden;
  position: relative;
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 60, 67, 0.18) transparent;
}
.t-sidebar-search {
  position: relative;
  margin: 8px 2px 10px;
  z-index: 4;
}
.t-sidebar-search-input {
  width: 100%;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #ececf0;
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  letter-spacing: -0.01em;
  outline: none;
}
.t-sidebar-search-input::placeholder { color: #8e8e93; }
.t-sidebar-search-input:focus { box-shadow: 0 0 0 3px rgba(43, 155, 240, 0.18); }
.t-sidebar-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(420px, 58vh);
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 22, 32, 0.16);
  padding: 6px;
  z-index: 30;
}
.t-search-section {
  color: #8e8e93;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 8px 4px;
}
.t-search-result {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  padding: 7px 8px;
  cursor: pointer;
}
.t-search-result:hover,
.t-search-result.is-first { background: #f2f4f7; }
.t-search-main {
  font-size: 13.5px;
  letter-spacing: -0.016em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-search-sub {
  font-size: 11px;
  color: #8e8e93;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-search-result mark,
.qf-result-main mark,
.qf-result-sub mark {
  background: #ffe08a;
  color: inherit;
  font-weight: 600;
  padding: 0;
}
.t-search-empty {
  padding: 16px 8px;
  text-align: center;
  color: #c7c7cc;
  font-size: 13px;
}
.t-sidebar-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
.task-row.search-flash .task-surface { background: #e8f3ff; }
.traffic-lights {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 8px 0;
}
.traffic-lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(128, 128, 132, 0.28);
}
.traffic-lights i:nth-child(1) { background: #ff5f57; }
.traffic-lights i:nth-child(2) { background: #febc2e; }
.traffic-lights i:nth-child(3) { background: #28c840; }

.quick-find-trigger {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.14);
  color: #6d7278;
  cursor: pointer;
  margin: 8px 2px 14px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.quick-find-trigger:hover { background: rgba(118, 118, 128, 0.2); color: #55595e; }
.quick-find-trigger:active { transform: scale(0.985); }
.quick-find-trigger svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.quick-find-trigger span { font-size: 13px; font-weight: 400; letter-spacing: -0.01em; }

.sidebar-primary,
.sidebar-areas { display: flex; flex-direction: column; gap: 1px; }

.sidebar-primary::before,
.sidebar-areas::before {
  content: "LISTS";
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: #8e8e93;
  padding: 2px 10px 6px;
  font-family: var(--font);
}

.sidebar-areas::before { content: "AREAS"; padding-top: 2px; }

.sidebar-item {
  min-height: 32px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 6px;
  text-align: left;
  color: #1d1d1f;
  transition: background 0.14s var(--ease);
}
.sidebar-item:hover { background: var(--sidebar-hover); }
.sidebar-item.active { background: var(--sidebar-active); }
.sidebar-item .nav-svg {
  width: 20px;
  height: 20px;
  color: var(--item-color);
  display: grid;
  place-items: center;
}
.sidebar-item .nav-svg svg { width: 18px; height: 18px; }
.sidebar-item .nav-label {
  font-size: 13.5px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.016em;
}
.sidebar-item .nav-count {
  min-width: 12px;
  color: #8e8e93;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  padding-left: 6px;
}
.sidebar-item .due-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--overdue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sidebar-separator {
  height: 1px;
  background: rgba(60, 60, 67, 0.12);
  margin: 12px 8px 10px;
  transform: scaleY(0.5);
}

.area-group { margin-bottom: 6px; }
.area-header .nav-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.014em;
}
.area-header .nav-label::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid #b0b4ba;
  border-bottom: 1.6px solid #b0b4ba;
  transform: rotate(45deg);
  margin-top: -3px;
  flex: 0 0 auto;
  opacity: 0.85;
}
.area-cube { width: 17px; height: 17px; color: #a2acb8; }
.project-item { padding-left: 8px; }
.project-item .nav-label { font-weight: 400; color: #2c2c2e; }
.project-ring {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  position: relative;
  background: var(--item-color, #6b9ecb);
  justify-self: center;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
.project-ring::after { content: none; }

.sidebar-fill { display: none; }
.sidebar-footer {
  flex: 0 0 auto;
  z-index: 2;
  min-height: 36px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 8px 4px 2px;
  background: #e8ebf0;
}
.sidebar-footer button {
  border: 0;
  background: transparent;
  color: #8e8e93;
  cursor: pointer;
  height: 28px;
  border-radius: 7px;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
}
.sidebar-footer button:hover { color: #3a3a3c; background: rgba(60, 60, 67, 0.06); }
.sidebar-footer button:first-child {
  font-size: 13px;
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0 8px;
  font-weight: 400;
}
.sidebar-footer button:first-child span { font-size: 17px; font-weight: 300; line-height: 1; }
.sidebar-footer button:last-child { width: 30px; display: grid; place-items: center; }
.sidebar-footer svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ── Main list ── */
.main-pane { position: relative; min-width: 0; overflow: hidden; background: #fff; }
.mobile-chrome { display: none; }
.list-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 60, 67, 0.22) transparent;
}
.list-scroll::-webkit-scrollbar { width: 9px; }
.list-scroll::-webkit-scrollbar-thumb {
  background: rgba(60, 60, 67, 0.18);
  border-radius: 9px;
  border: 2px solid #fff;
}
.list-content {
  width: min(700px, 100%);
  margin: 0 auto;
  padding: 68px 40px 140px;
}
.list-header { margin-bottom: 10px; }
.title-line { display: flex; align-items: center; min-width: 0; }
.list-glyph {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-right: 8px;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}
.list-glyph svg { width: 28px; height: 28px; }
.title-line h1 {
  font-family: var(--font-display);
  font-size: 31px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.header-more {
  border: 0;
  background: transparent;
  color: #c7c7cc;
  margin: 0 0 0 10px;
  padding: 4px 6px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  cursor: pointer;
  opacity: 0.9;
  border-radius: 8px;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
}
.header-more:hover { color: #8e8e93; background: var(--fill-hover); }
.project-note {
  margin: 12px 0 0 38px;
  max-width: 520px;
  color: #636366;
  font-size: 15px;
  line-height: 1.38;
  white-space: pre-wrap;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0 38px; }
.project-tag {
  color: var(--tag-text);
  background: var(--tag-fill);
  border-radius: 11px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.calendar-events {
  background: var(--event);
  border-radius: 10px;
  padding: 9px 12px;
  margin: 14px 0 18px 38px;
  font-size: 13px;
  line-height: 1.28;
  color: #636366;
  overflow: hidden;
}
.calendar-events:empty { display: none; }
.event-row {
  display: grid;
  grid-template-columns: 3px auto minmax(0, 1fr);
  column-gap: 8px;
  align-items: baseline;
  min-height: 18px;
}
.event-bar {
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--event-color);
  position: relative;
  top: 1px;
}
.event-time {
  color: var(--event-color);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 12px;
}
.event-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Headings ── */
.task-list { display: flex; flex-direction: column; }
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-left: 38px;
  margin-top: 10px;
  padding-top: 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8e8e93;
}
.section-heading .moon {
  color: #5a9fd8;
  font-size: 16px;
  transform: rotate(-18deg);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}
.project-section-heading {
  display: flex;
  align-items: center;
  margin: 28px 0 2px 38px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--hairline);
  color: var(--blue-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.project-section-heading b { flex: 1; font-weight: 600; }
.project-section-heading button {
  border: 0;
  background: transparent;
  color: var(--blue-text);
  font-weight: 800;
  letter-spacing: 1.2px;
  font-size: 12px;
  opacity: 0.55;
  cursor: pointer;
  padding: 4px 2px;
}
.project-section-heading button:hover { opacity: 1; }
.date-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 26px 0 4px 38px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--hairline);
}
.date-heading strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: var(--ink);
}
.date-heading span { color: #8e8e93; font-size: 13px; font-weight: 400; }

/* ── Task rows ── */
.task-row {
  position: relative;
  min-height: 48px;
  overflow: visible;
  touch-action: pan-y;
  user-select: none;
}
.swipe-when {
  position: absolute;
  inset: 2px auto 2px 0;
  width: 78px;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  border-radius: 10px;
  pointer-events: none;
}
.task-row.swiping-right .swipe-when { opacity: 1; }
.task-surface {
  position: relative;
  z-index: 1;
  min-height: 48px;
  display: grid;
  grid-template-columns: var(--check-col) minmax(0, 1fr) auto;
  gap: 4px;
  align-items: start;
  padding: 12px 6px 12px 0;
  background: #fff;
  border-radius: 10px;
  transition: transform 0.18s var(--ease-spring), background 0.16s var(--ease), opacity 0.2s var(--ease);
}
.task-row:not(.last-row) .task-surface::after {
  content: "";
  position: absolute;
  left: var(--check-col);
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(60, 60, 67, 0.12);
  transform: scaleY(0.5);
  transform-origin: bottom;
}
@media (hover: hover) {
  .task-row:hover .task-surface { background: var(--row-hover); }
}
.task-row:active .task-surface { background: #efeff4; }
.task-row.selected .task-surface { background: var(--selection); }
.task-row.selected .task-surface::after { opacity: 0; }
.task-row.dragging .task-surface {
  z-index: 9;
  box-shadow: 0 10px 28px rgba(15, 22, 32, 0.14);
  border-radius: 12px;
  transition: none;
  background: #fff;
}
.task-row.completing .task-surface { opacity: 0.42; }
.task-row.completing .task-title {
  color: #8e8e93;
  text-decoration: line-through;
}

.task-check,
.sheet-checkbox {
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-top: -1px;
}
.task-check i,
.sheet-checkbox i {
  width: var(--check);
  height: var(--check);
  border: 1.5px solid #c9c9ce;
  border-radius: 50%;
  display: block;
  background: #fff;
  position: relative;
  box-sizing: border-box;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.18s var(--ease-spring);
}
.task-check:hover i,
.sheet-checkbox:hover i { border-color: #b0b0b5; }
.task-row.selected .task-check i {
  border-color: #8e9aa8;
  background: rgba(255, 255, 255, 0.7);
}
.task-row.completed .task-check i,
.sheet-checkbox.completed i {
  background: var(--complete);
  border-color: var(--complete);
}
.task-row.completed .task-check i::after,
.sheet-checkbox.completed i::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg);
  left: 7px;
  top: 3.5px;
}
.task-row.completing .task-check i,
.task-row.completed .task-check i {
  animation: check-pop 0.22s var(--ease-spring);
}
@keyframes check-pop {
  0% { transform: scale(0.82); }
  65% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.task-copy { min-width: 0; padding-top: 2px; }
.task-title {
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.022em;
  font-weight: 400;
  color: #1d1d1f;
  min-height: 21px;
  overflow-wrap: anywhere;
}
.task-row.completed .task-title {
  color: #8e8e93;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: #aeaeb2;
}
.task-meta {
  margin-top: 2px;
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-latest-update {
  min-width: 0;
  margin-top: 5px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0;
}
.task-latest-update[hidden] { display: none; }
.latest-update-heading { color: var(--blue-text); font-weight: 600; white-space: nowrap; }
.latest-update-body { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-latest-update time { color: #aeaeb2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meta-checklist { margin-left: 4px; color: #aeaeb2; }
.task-row-tools { min-height: 28px; display: flex; align-items: flex-start; gap: 2px; }
.task-update-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: #8e8e93;
  cursor: pointer;
  opacity: 0;
  transition: color 0.14s var(--ease), background 0.14s var(--ease), opacity 0.14s var(--ease);
}
.task-update-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.task-update-button:hover { color: var(--blue-text); background: #e8f2fc; }
.task-update-button:focus-visible { opacity: 1; outline: 2px solid rgba(43, 155, 240, 0.35); outline-offset: 1px; }
@media (hover: hover) { .task-row:hover .task-update-button { opacity: 1; } }
@media (hover: none) { .task-update-button { opacity: 1; color: #aeaeb2; } }
.task-right-meta {
  font-size: 12px;
  min-width: 0;
  color: var(--overdue);
  align-self: start;
  padding-top: 4px;
  padding-right: 2px;
  white-space: nowrap;
}
.deadline-flag {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  color: var(--overdue);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.deadline-flag svg { width: 10px; height: 10px; fill: currentColor; }

.list-tail {
  margin: 48px 0 0 38px;
  color: #aeaeb2;
  font-size: 13px;
  line-height: 1.35;
}

.empty-message {
  color: #aeaeb2;
  font-size: 13px;
  padding: 20px 0 0 38px;
}
.task-list:has(> .empty-message) {
  min-height: calc(100vh - 260px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-list > .empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #c7c7cc;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-align: center;
}
.task-list > .empty-message::before {
  content: "";
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 50%;
  border: 2px solid #e5e5ea;
  background: transparent;
  box-sizing: border-box;
}

/* ── Magic Plus ── */
.magic-plus {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  box-shadow:
    0 4px 14px rgba(43, 155, 240, 0.38),
    0 1px 3px rgba(15, 22, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  cursor: pointer;
  z-index: 12;
  touch-action: none;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease);
}
.magic-plus:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 18px rgba(43, 155, 240, 0.42),
    0 1px 3px rgba(15, 22, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.magic-plus:active { transform: scale(0.93); }
.magic-plus span::before,
.magic-plus span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transform: translate(-50%, -50%);
}
.magic-plus span::after { transform: translate(-50%, -50%) rotate(90deg); }
.magic-plus.dragging {
  transition: none;
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(43, 155, 240, 0.4);
}
.insertion-line {
  position: fixed;
  height: 2px;
  pointer-events: none;
  z-index: 45;
  display: none;
}
.insertion-line.visible { display: block; }
.insertion-line::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px #fff;
}
.insertion-line i {
  display: block;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
}
.drag-targets {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}
.drag-targets.visible { opacity: 1; }
.drag-target {
  position: absolute;
  bottom: 24px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border-radius: 22px;
  background: rgba(28, 32, 38, 0.86);
  color: #fff;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 20px rgba(15, 22, 32, 0.2);
  transition: background 0.14s var(--ease), transform 0.16s var(--ease-spring);
}
.drag-target svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.inbox-target { left: 20px; }
.heading-target { left: 20px; bottom: 78px; display: none; }
.heading-target.visible { display: flex; }
.drag-target.hot {
  background: var(--blue);
  transform: scale(1.04);
}

/* ── Selection toolbar ── */
.selection-toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 16px);
  height: 56px;
  min-width: 268px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(248, 248, 250, 0.9);
  box-shadow: 0 10px 36px rgba(15, 22, 32, 0.16);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  opacity: 0;
  pointer-events: none;
  z-index: 18;
  transition: opacity 0.18s var(--ease), transform 0.22s var(--ease-spring);
}
.selection-toolbar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.selection-toolbar button {
  width: 76px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #3a3a3c;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border-radius: 10px;
  padding: 4px 0;
}
.selection-toolbar button:active { opacity: 0.55; }
.selection-toolbar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#selectionDelete { color: var(--destructive); }
.selection-done {
  display: none;
  border: 0;
  background: var(--blue);
  color: #fff;
  height: 32px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.016em;
  box-shadow: 0 2px 8px rgba(43, 155, 240, 0.28);
}
.selection-done.visible { display: block; }
.selection-done:active { background: var(--blue-press); }

/* ── Task sheet ── */
.task-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.task-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.task-sheet {
  position: relative;
  width: min(560px, calc(100vw - 36px));
  max-height: min(640px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.24s var(--ease-spring);
}
.task-sheet-backdrop.open .task-sheet { transform: none; }
.task-sheet-grabber { display: none; }
.sheet-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #e8e8ed;
  color: #6e6e73;
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
  cursor: pointer;
  z-index: 4;
  transition: background 0.14s var(--ease);
}
.sheet-close:hover { background: #dcdce1; }
.sheet-main { padding: 26px 48px 16px 22px; overflow-y: auto; min-height: 160px; }
.sheet-title-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.sheet-checkbox { margin-top: 1px; }
.sheet-title-row textarea {
  border: 0;
  outline: 0;
  resize: none;
  padding: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.022em;
  min-height: 26px;
  color: var(--ink);
  overflow: hidden;
  font-family: var(--font-display);
}
.sheet-title-row textarea::placeholder { color: #c7c7cc; font-weight: 500; }
.sheet-notes {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  margin: 8px 0 0 36px;
  padding: 0;
  min-height: 48px;
  color: #636366;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.012em;
}
.sheet-notes::placeholder { color: #c7c7cc; }
.sheet-checklist { margin: 8px 0 0 36px; }
.checklist-row {
  min-height: 36px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--hairline-soft);
}
.checklist-row:first-child { border-top: 0; }
.checklist-toggle {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.checklist-toggle i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.4px solid #64a8e8;
  position: relative;
  box-sizing: border-box;
}
.checklist-row.done .checklist-toggle i { background: #64a8e8; border-color: #64a8e8; }
.checklist-row.done .checklist-toggle i::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 7px;
  border-right: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: rotate(40deg);
  left: 5px;
  top: 2.5px;
}
.checklist-input {
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 0;
  font-size: 15px;
  color: #3a3a3c;
  padding: 6px 0;
  letter-spacing: -0.012em;
}
.checklist-row.done .checklist-input { color: #8e8e93; text-decoration: line-through; }
.checklist-grip { width: 22px; color: #d1d1d6; text-align: center; font-size: 14px; cursor: grab; }
.add-checklist-item {
  margin: 6px 0 0 36px;
  border: 0;
  background: transparent;
  color: #8e8e93;
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
}
.add-checklist-item:hover { color: var(--blue-text); }
.task-activity {
  margin: 18px 0 0 36px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
}
.task-activity[hidden] { display: none; }
.task-activity > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.task-activity > header b { color: #3a3a3c; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.task-activity > header span { color: #aeaeb2; font-size: 11px; font-variant-numeric: tabular-nums; }
.update-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 8px;
  background: #f8f8fa;
}
.update-composer:focus-within { border-color: rgba(43, 155, 240, 0.52); box-shadow: 0 0 0 2px rgba(43, 155, 240, 0.1); }
.update-composer textarea {
  min-width: 0;
  min-height: 38px;
  max-height: 120px;
  border: 0;
  outline: 0;
  resize: vertical;
  padding: 3px 2px;
  background: transparent;
  color: #2c2c2e;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
}
.update-composer textarea::placeholder { color: #aeaeb2; }
.update-composer button {
  height: 32px;
  border: 0;
  border-radius: 7px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.update-composer button:hover { background: #2490e4; }
.update-composer button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.activity-timeline { margin-top: 12px; }
.activity-entry {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 0 0 14px;
  color: #3a3a3c;
}
.activity-entry:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 1px; background: #e0e0e5; }
.activity-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px rgba(43, 155, 240, 0.28); }
.activity-entry.milestone .activity-dot { background: #8e8e93; box-shadow: 0 0 0 1px rgba(142, 142, 147, 0.25); }
.activity-copy { min-width: 0; user-select: text; }
.activity-copy p { margin: 0; color: #3a3a3c; font-size: 13px; line-height: 1.42; letter-spacing: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.activity-entry.milestone .activity-copy p { color: #8e8e93; font-size: 12px; font-weight: 500; }
.activity-author { display: block; margin-top: 3px; color: #aeaeb2; font-size: 10px; }
.activity-entry time { padding-top: 1px; color: #aeaeb2; font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet-toolbar {
  height: 44px;
  margin: 0 14px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--hairline);
}
.sheet-toolbar button {
  width: 40px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #aeaeb2;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
}
.sheet-toolbar button:hover { background: var(--fill-hover); }
.sheet-toolbar button.active { color: var(--blue); }
.sheet-toolbar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sheet-toolbar .toolbar-fill { flex: 1; }
.sheet-toolbar button:last-child span { font-weight: 800; letter-spacing: 1.2px; }
.sheet-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f7f7f8;
  border-top: 1px solid var(--hairline-soft);
}
.sheet-location {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8e8e93;
  padding: 0 6px;
  cursor: pointer;
  text-align: left;
}
.sheet-location span { font-size: 15px; color: #aeaeb2; }
.sheet-location b {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #636366;
}
.sheet-save {
  height: 34px;
  min-width: 68px;
  padding: 0 18px;
  border: 0;
  border-radius: 17px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.016em;
  box-shadow: 0 2px 8px rgba(43, 155, 240, 0.28);
  cursor: pointer;
  transition: background 0.14s var(--ease), transform 0.14s var(--ease);
}
.sheet-save:hover { background: #2490e4; }
.sheet-save:active { background: var(--blue-press); transform: scale(0.97); }

/* ── When picker (Things dark HUD) ── */
.picker-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease);
}
.picker-layer.open { opacity: 1; pointer-events: auto; }
.when-picker {
  width: 312px;
  background: #2c3138;
  color: #f2f3f5;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
  padding: 8px 8px 10px;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s var(--ease-spring);
}
.picker-layer.open .when-picker { transform: none; }
.when-picker header {
  height: 32px;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  text-align: center;
}
.when-picker header b {
  grid-column: 2;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.when-picker header button {
  grid-column: 3;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #1c2026;
  color: #d1d4d8;
  font-size: 17px;
  line-height: 24px;
  cursor: pointer;
}
.picker-shortcuts {
  margin-top: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}
.picker-shortcuts button,
.picker-row {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #f2f3f5;
  display: grid;
  grid-template-columns: 28px 1fr 24px;
  align-items: center;
  text-align: left;
  padding: 0 6px;
  border-radius: 8px;
  cursor: pointer;
}
.picker-shortcuts button:hover,
.picker-row:hover { background: rgba(255, 255, 255, 0.06); }
.picker-shortcuts b,
.picker-row b { font-size: 15px; font-weight: 500; letter-spacing: -0.016em; }
.picker-icon { width: 20px; text-align: center; }
.picker-icon.star { color: #ffd022; font-size: 16px; }
.picker-icon.moon { color: #7db6f3; font-size: 17px; }
.picker-check { color: #5aa8ff; font-style: normal; text-align: right; font-size: 15px; }
.calendar { padding: 8px 4px 4px; }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays span {
  color: #8a919b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 2px 0 6px;
}
.calendar-grid button {
  aspect-ratio: 1.05;
  border: 0;
  background: transparent;
  color: #eef0f3;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.calendar-grid button:hover { background: rgba(255, 255, 255, 0.08); }
.calendar-grid button.dim { color: #6d7480; }
.calendar-grid button.today-date { color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1.5px #5aa8ff; }
.calendar-grid button.selected { background: #4a96ef; color: #fff; box-shadow: none; }
.picker-row { grid-template-columns: 28px 1fr; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.someday-row span { color: #d6c26d; }
.reminder-row { color: #9aa0a8; }
.picker-clear {
  width: 100%;
  height: 34px;
  margin-top: 8px;
  border: 0;
  border-radius: 17px;
  background: #ff2d55;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.picker-clear:active { filter: brightness(0.92); }

/* ── Quick Find ── */
.quick-find-layer {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(20, 24, 30, 0.28);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: min(14vh, 110px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease);
}
.quick-find-layer.open { opacity: 1; pointer-events: auto; }
.quick-find-panel {
  width: min(560px, calc(100vw - 28px));
  max-height: min(640px, 78vh);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.22s var(--ease-spring);
}
.quick-find-layer.open .quick-find-panel { transform: none; }
.quick-find-input {
  height: 56px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  color: #8e8e93;
}
.quick-find-input svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.quick-find-input input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  letter-spacing: -0.02em;
  min-width: 0;
  color: var(--ink);
}
.quick-find-input input::placeholder { color: #c7c7cc; }
.quick-find-input button {
  border: 0;
  background: transparent;
  color: var(--blue-text);
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  padding: 4px 2px;
}
.quick-find-results {
  max-height: calc(min(640px, 78vh) - 56px);
  overflow-y: auto;
  padding: 8px 8px 14px;
}
.qf-section {
  color: #8e8e93;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 12px 12px 4px;
}
.qf-result {
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
.qf-result:hover { background: #f2f4f7; }
.qf-result:active { background: #e8eaed; }
.qf-result-icon { color: var(--blue); font-size: 15px; text-align: center; }
.qf-result-main {
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.018em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qf-result-sub { font-size: 12px; color: #8e8e93; margin-top: 1px; }
.qf-result-tail { color: #c7c7cc; font-size: 16px; }
.quick-find-results .empty-message {
  padding: 36px 16px;
  text-align: center;
  color: #c7c7cc;
  font-size: 15px;
}

/* ── Move sheet ── */
.move-layer {
  position: fixed;
  inset: 0;
  z-index: 82;
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease);
}
.move-layer.open { opacity: 1; pointer-events: auto; }
.move-panel {
  width: min(340px, calc(100vw - 28px));
  max-height: 68vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 6px 6px 10px;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s var(--ease-spring);
}
.move-layer.open .move-panel { transform: none; }
.move-panel header {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 12px;
}
.move-panel header b { font-size: 15px; font-weight: 600; letter-spacing: -0.016em; }
.move-panel header button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #e8e8ed;
  color: #6e6e73;
  font-size: 18px;
  cursor: pointer;
}
.move-dest {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: -0.016em;
}
.move-dest:hover { background: #f2f4f7; }
.move-dest i { width: 18px; color: var(--blue); font-style: normal; text-align: center; }

/* ── Desktop (>=1024): ~260px sidebar, content column max 700px ── */
@media (min-width: 1024px) {
  .app-window { grid-template-columns: 260px minmax(0, 1fr); }
  .list-content { width: min(700px, 100%); }
  .quick-find-trigger { display: none; }
  .mobile-chrome, .mobile-back { display: none; }
}

/* ── iPad (768–1023): visible ~240px sidebar, no back arrow ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-window { grid-template-columns: 240px minmax(0, 1fr); }
  .list-content { width: 100%; padding-left: 28px; padding-right: 28px; }
  .mobile-chrome { display: none; }
  .mobile-back { display: none; }
  .quick-find-trigger { display: none; }
}

/* ── Phone (<768): sidebar hidden, back arrow, bottom sheets ── */
@media (max-width: 767px) {
  .t-sidebar-search { display: none; }
  body { background: #fff; }
  .app-window { display: block; background: #fff; }
  .sidebar {
    position: fixed;
    inset: 0;
    width: 100%;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease-spring);
    border-right: 0;
    padding: max(8px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
    background: #f2f2f7;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .sidebar.mobile-open { transform: none; }
  .traffic-lights { display: none; }
  .quick-find-trigger {
    margin: 48px 0 18px;
    height: 36px;
    border-radius: 10px;
    background: rgba(118, 118, 128, 0.12);
    justify-content: flex-start;
    padding: 0 12px;
    color: #8e8e93;
  }
  .quick-find-trigger span { font-size: 17px; }
  .quick-find-trigger svg { width: 16px; height: 16px; }
  .sidebar-primary::before,
  .sidebar-areas::before {
    font-size: 12px;
    padding: 10px 12px 6px;
  }
  .sidebar-item {
    min-height: 44px;
    border-radius: 12px;
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    padding: 0 12px 0 8px;
  }
  .sidebar-item.active { background: rgba(255, 255, 255, 0.92); box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.04); }
  .sidebar-item .nav-svg { width: 24px; height: 24px; }
  .sidebar-item .nav-svg svg { width: 22px; height: 22px; }
  .sidebar-item .nav-label { font-size: 17px; letter-spacing: -0.022em; }
  .sidebar-item .nav-count { font-size: 16px; }
  .project-ring { width: 9px; height: 9px; }
  .sidebar-separator { margin: 14px 4px 8px; }
  .sidebar-footer {
    min-height: 48px;
    padding-top: 10px;
    background: #f2f2f7;
  }
  .sidebar-footer button:first-child { font-size: 16px; height: 36px; }
  .main-pane { height: 100vh; height: 100dvh; }
  .mobile-chrome {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: calc(48px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    z-index: 14;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 60%, rgba(255, 255, 255, 0));
    pointer-events: none;
  }
  .mobile-chrome button { pointer-events: auto; }
  .mobile-back {
    width: 46px;
    height: 46px;
    border: 0;
    background: transparent;
    color: #c7c7cc;
    display: grid;
    place-items: center;
    padding: 0;
  }
  .mobile-back svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-chrome-spacer { flex: 1; }
  .circle-more {
    width: 32px;
    height: 32px;
    margin-right: 14px;
    border-radius: 50%;
    border: 1px solid #d1d1d6;
    background: rgba(255, 255, 255, 0.86);
    color: #8e8e93;
    display: grid;
    place-items: center;
  }
  .circle-more span { font-size: 11px; font-weight: 800; letter-spacing: 1.1px; margin-top: -2px; }
  .selection-done { margin-right: 10px; height: 32px; }
  .selection-done.visible + .circle-more { display: none; }

  .list-scroll { padding-top: calc(44px + env(safe-area-inset-top)); }
  .list-content { width: 100%; padding: 8px 16px calc(118px + env(safe-area-inset-bottom)); }
  .list-header { margin: 0 0 8px; }
  .list-glyph { width: 28px; height: 28px; margin-right: 6px; }
  .list-glyph svg { width: 26px; height: 26px; }
  .title-line h1 { font-size: 28px; font-weight: 700; }
  .header-more { display: none; }
  .project-note { margin: 10px 0 0 34px; max-width: calc(100% - 34px); font-size: 15px; }
  .project-tags { margin-left: 34px; }
  .calendar-events { margin-left: 0; margin-bottom: 12px; padding: 9px 11px; border-radius: 10px; font-size: 13px; }

  .task-row { min-height: 50px; }
  .task-surface {
    min-height: 50px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    padding: 13px 2px 13px 0;
    border-radius: 0;
  }
  .task-row:not(.last-row) .task-surface::after { left: 32px; }
  .task-title { font-size: 17px; }
  .task-meta { font-size: 13px; }
  .section-heading,
  .project-section-heading,
  .date-heading { margin-left: 34px; }
  .section-heading { min-height: 40px; padding-top: 14px; }
  .project-section-heading { margin-top: 26px; }
  .list-tail { margin-left: 34px; }
  .task-list > .empty-message { padding: 80px 16px 48px; }
  .empty-message:not(.task-list > .empty-message) { margin-left: 0; padding-left: 34px; }

  .magic-plus {
    width: 56px;
    height: 56px;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .drag-target { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .heading-target { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .selection-toolbar {
    bottom: calc(14px + env(safe-area-inset-bottom));
    min-width: 280px;
  }

  .task-sheet-backdrop {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
    background: rgba(0, 0, 0, 0.28);
  }
  .task-sheet {
    width: 100%;
    max-height: 86vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(40px);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.16);
  }
  .task-sheet-backdrop.open .task-sheet { transform: none; }
  .task-sheet-grabber {
    display: block;
    width: 36px;
    height: 5px;
    border-radius: 3px;
    background: #d1d1d6;
    margin: 8px auto 0;
  }
  .sheet-close { top: 10px; right: 12px; }
  .sheet-main { padding: 22px 44px 14px 18px; }
  .sheet-title-row textarea { font-size: 20px; }
  .sheet-notes { font-size: 16px; }
  .sheet-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }

  .picker-layer {
    place-items: end center;
    padding: 0 10px calc(12px + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.28);
  }
  .when-picker {
    width: min(360px, calc(100vw - 20px));
    border-radius: 16px;
  }

  .quick-find-layer {
    padding: env(safe-area-inset-top) 0 0;
    align-items: stretch;
    justify-content: stretch;
    background: #f2f2f7;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .quick-find-panel {
    width: 100%;
    max-height: none;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    background: #f2f2f7;
    display: flex;
    flex-direction: column;
  }
  .quick-find-input {
    height: 56px;
    margin: 18vh 20px 0;
    padding: 0 16px;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 22, 32, 0.08);
  }
  .quick-find-input input { font-size: 22px; letter-spacing: -0.03em; text-align: center; }
  .quick-find-input svg { display: none; }
  .quick-find-results {
    max-height: none;
    flex: 1;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .qf-result {
    min-height: 52px;
    background: #fff;
    margin: 0;
    border-radius: 0;
    box-shadow: inset 0 0.5px 0 rgba(60, 60, 67, 0.1);
  }
  .qf-section + .qf-result {
    border-radius: 12px 12px 0 0;
    box-shadow: none;
  }
  .qf-result:last-child,
  .qf-result:has(+ .qf-section) {
    border-radius: 0 0 12px 12px;
  }
  .qf-section + .qf-result:last-child {
    border-radius: 12px;
  }

  .move-layer {
    place-items: end center;
    padding: 0;
    background: rgba(0, 0, 0, 0.28);
  }
  .move-panel {
    width: 100%;
    max-height: 72vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

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

/* Product controls added after the visual prototype. */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px 36px;
}
.tag-filter-bar[hidden] { display: none; }
.tag-filter-bar button,
.project-tag {
  min-height: 26px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: #f7f7f9;
  color: #636366;
  padding: 3px 9px;
  font-size: 12px;
  letter-spacing: 0;
  cursor: pointer;
}
.tag-filter-bar button { display: inline-flex; align-items: center; gap: 6px; }
.tag-filter-bar button i { width: 7px; height: 7px; border-radius: 50%; background: var(--tag-color); }
.tag-filter-bar button.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.tag-title-glyph { color: var(--tag-text); font-size: 25px; font-weight: 600; }
.event-title small { display: block; margin-top: 2px; color: #8e8e93; font-size: 10px; }
.archived-containers { margin-bottom: 20px; }
.archived-container { min-height: 46px; margin-left: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--hairline-soft); }
.archived-container span { min-width: 0; display: flex; flex-direction: column; }
.archived-container b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.archived-container small { color: #8e8e93; font-size: 11px; }
.archived-container button { height: 28px; border: 0; border-radius: 6px; background: #eef5fc; color: var(--blue-text); padding: 0 10px; cursor: pointer; }

.sheet-main { flex: 1 1 auto; min-height: 120px; }
.sheet-notes-preview {
  margin: 10px 0 0 36px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f7f7f9;
  color: #4a4a4f;
  font-size: 14px;
  line-height: 1.45;
  cursor: text;
}
.sheet-notes-preview h2,.sheet-notes-preview h3,.sheet-notes-preview h4 { margin: 8px 0 4px; letter-spacing: 0; }
.sheet-notes-preview h2 { font-size: 18px; }.sheet-notes-preview h3 { font-size: 16px; }.sheet-notes-preview h4 { font-size: 14px; }
.sheet-notes-preview a { color: var(--blue-text); }
.sheet-notes-preview mark { background: #fff0a8; }
.checklist-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
.checklist-actions { display: flex; align-items: center; }
.checklist-actions button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aeaeb2;
  cursor: pointer;
}
.checklist-actions button:hover { background: #ececf0; color: #636366; }
.task-properties {
  flex: 0 1 auto;
  max-height: 210px;
  overflow-y: auto;
  padding: 4px 18px 10px;
  border-top: 1px solid var(--hairline-soft);
}
.property-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--hairline-soft);
}
.property-row > span { color: #8e8e93; font-size: 12px; }
.property-row select {
  width: 100%;
  height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #3a3a3c;
  font-size: 13px;
}
.segmented { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 2px; padding: 2px; border-radius: 7px; background: #ececf0; }
.segmented button { min-width: 0; height: 26px; overflow: hidden; text-overflow: ellipsis; border: 0; border-radius: 5px; background: transparent; color: #636366; font-size: 11px; cursor: pointer; }
.segmented button.active { color: #1d1d1f; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.people-editor { min-width: 0; display: flex; align-items: center; gap: 4px; }
.people-editor > div { display: flex; gap: 4px; flex-wrap: wrap; }
.people-editor [data-person] { height: 24px; border: 0; border-radius: 6px; padding: 0 7px; background: #e8f1fb; color: #2975bd; font-size: 11px; cursor: pointer; }
.people-editor input { flex: 1; min-width: 90px; height: 28px; border: 0; outline: 0; font-size: 13px; }
.people-editor #addAssignee { width: 28px; height: 28px; border: 0; border-radius: 6px; background: #eef5fc; color: var(--blue-text); cursor: pointer; }
.property-summary { min-height: 18px; padding: 7px 0 0 108px; color: #6e6e73; font-size: 11px; line-height: 1.4; }

.calendar-toolbar { height: 34px; display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; }
.calendar-toolbar button { height: 30px; border: 0; border-radius: 7px; background: transparent; color: #eef0f3; cursor: pointer; font-size: 18px; }
.calendar-toolbar #calendarMonth { font-size: 13px; font-weight: 600; }
.calendar-toolbar button:hover { background: rgba(255,255,255,.08); }
.date-language-input { width: calc(100% - 4px); height: 32px; margin: 2px 2px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 7px; outline: 0; background: #20242a; color: #fff; padding: 0 10px; font-size: 12px; letter-spacing: 0; }
.date-language-input::placeholder { color: #7f8792; }

.tag-layer { position: fixed; inset: 0; z-index: 86; display: grid; place-items: center; padding: 14px; background: rgba(0,0,0,.24); opacity: 0; pointer-events: none; transition: opacity .18s var(--ease); }
.tag-layer.open { opacity: 1; pointer-events: auto; }
.tag-panel { width: min(420px,calc(100vw - 28px)); max-height: min(680px,82vh); overflow: hidden; display: flex; flex-direction: column; border-radius: 12px; background: #fff; box-shadow: var(--card-shadow); }
.tag-panel header { height: 48px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; border-bottom: 1px solid var(--hairline); }
.tag-panel header b { font-size: 16px; }
.tag-panel header button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #e8e8ed; color: #636366; font-size: 19px; cursor: pointer; }
.panel-search { height: 36px; flex: 0 0 auto; margin: 10px; border: 0; border-radius: 7px; outline: 0; background: #ececf0; padding: 0 11px; font-size: 14px; }
.tag-tree { flex: 1; min-height: 120px; overflow-y: auto; padding: 0 8px 8px; }
.tag-option { min-height: 38px; display: grid; grid-template-columns: minmax(0,1fr) 32px; align-items: center; padding-left: calc(var(--tag-depth) * 18px); }
.tag-option.selected { background: #f4f8fc; border-radius: 7px; }
.tag-toggle { min-width: 0; height: 36px; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.tag-toggle i { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border: 1.5px solid var(--tag-color); border-radius: 6px; color: #fff; background: var(--tag-color); font-size: 11px; font-style: normal; }
.tag-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tag-actions { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #aeaeb2; cursor: pointer; }
.tag-actions:hover { background: #ececf0; }
.tag-create { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) 130px 52px; gap: 6px; padding: 10px; border-top: 1px solid var(--hairline); }
.tag-create input,.tag-create select { min-width: 0; height: 32px; border: 1px solid var(--hairline); border-radius: 6px; background: #fff; padding: 0 8px; font-size: 12px; }
.tag-create button { border: 0; border-radius: 6px; background: var(--blue); color: #fff; cursor: pointer; }

.people-layer { position: fixed; inset: 0; z-index: 86; display: grid; place-items: center; padding: 14px; background: rgba(0,0,0,.24); opacity: 0; pointer-events: none; transition: opacity .18s var(--ease); }
.people-layer.open { opacity: 1; pointer-events: auto; }
.people-panel { width: min(460px,calc(100vw - 28px)); max-height: min(720px,86vh); overflow: hidden; display: flex; flex-direction: column; border-radius: 12px; background: #fff; box-shadow: var(--card-shadow); }
.people-panel header { height: 48px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; border-bottom: 1px solid var(--hairline); }
.people-panel header b { font-size: 16px; }
.people-panel header button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #e8e8ed; color: #636366; font-size: 19px; cursor: pointer; }
.people-list { flex: 1; min-height: 120px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.person-card { border: 1px solid var(--hairline); border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.person-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; padding: 0; height: auto; }
.person-card header b { font-size: 14px; }
.person-card .teams-badge { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #2b9bf0; background: #e8f4fd; border-radius: 999px; padding: 2px 7px; }
.person-card input { width: 100%; height: 30px; border: 1px solid var(--hairline); border-radius: 6px; padding: 0 8px; font-size: 12px; }
.person-card-actions { display: flex; justify-content: flex-end; gap: 6px; }
.person-card-actions button { height: 28px; border: 0; border-radius: 6px; background: #ececf0; padding: 0 10px; font-size: 12px; cursor: pointer; }
.person-card-actions button.danger { color: var(--destructive); }
.people-create { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) 58px 52px; gap: 6px; padding: 10px; border-top: 1px solid var(--hairline); }
.people-create input { min-width: 0; height: 32px; border: 1px solid var(--hairline); border-radius: 6px; background: #fff; padding: 0 8px; font-size: 12px; }
.people-create button { border: 0; border-radius: 6px; background: var(--blue); color: #fff; cursor: pointer; }
.people-create #pastePerson { background: #ececf0; color: #1d1d1f; }
.people-paste-hint { flex: 0 0 auto; margin: 0 12px 8px; color: #8e8e93; font-size: 11px; line-height: 1.35; }
.people-lume-row { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) 64px; gap: 6px; padding: 0 10px 8px; }
.people-lume-row input { min-width: 0; height: 32px; border: 1px solid var(--hairline); border-radius: 6px; background: #fff; padding: 0 8px; font-size: 12px; }
.people-lume-row button { border: 0; border-radius: 6px; background: #ececf0; cursor: pointer; font-size: 12px; }
.people-lume-results { flex: 0 0 auto; max-height: 140px; overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.people-lume-results button { min-height: 34px; border: 1px solid var(--hairline); border-radius: 6px; background: #fff; text-align: left; padding: 6px 8px; cursor: pointer; font-size: 12px; }
.people-lume-results .muted { color: #8e8e93; font-size: 12px; padding: 4px 2px; }
.people-editor button[data-linked="1"] { box-shadow: inset 0 0 0 1px #2b9bf0; }

.action-menu { position: fixed; z-index: 220; min-width: 190px; max-width: min(280px,calc(100vw - 16px)); padding: 5px; border: 1px solid rgba(60,60,67,.12); border-radius: 8px; background: rgba(255,255,255,.98); box-shadow: 0 12px 36px rgba(15,22,32,.2); }
.action-menu button { width: 100%; min-height: 34px; border: 0; border-radius: 6px; background: transparent; padding: 6px 10px; text-align: left; font-size: 13px; cursor: pointer; }
.action-menu button:hover { background: #edf2f7; }.action-menu button.danger { color: var(--destructive); }.action-menu button:disabled { opacity: .4; cursor: default; }.action-menu hr { border: 0; border-top: 1px solid var(--hairline); margin: 4px; }
.undo-toast { position: fixed; z-index: 230; left: 50%; bottom: 24px; transform: translateX(-50%); min-width: 230px; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 10px 0 15px; border-radius: 8px; background: #2c3138; color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: 13px; }
.undo-toast[hidden] { display: none; }.undo-toast button { height: 30px; border: 0; border-radius: 6px; background: #4a96ef; color: #fff; padding: 0 12px; cursor: pointer; }
.tooltip { position: fixed; z-index: 300; max-width: 240px; padding: 6px 8px; border-radius: 6px; background: #25292f; color: #fff; font-size: 11px; line-height: 1.3; box-shadow: 0 5px 16px rgba(0,0,0,.22); pointer-events: none; }
.tooltip[hidden] { display: none; }

@media (max-width: 767px) {
  .tag-filter-bar { margin-left: 34px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .task-properties { max-height: 230px; padding-left: 14px; padding-right: 14px; }
  .property-row { grid-template-columns: 86px minmax(0,1fr); }
  .segmented { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .property-summary { padding-left: 96px; }
  .tag-panel { align-self: end; width: 100%; max-height: 86vh; border-radius: 14px 14px 0 0; }
  .tag-layer { padding: 0; place-items: end stretch; }
  .tag-create { grid-template-columns: minmax(0,1fr) 100px 48px; }
  .undo-toast { bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .selection-toolbar { min-width: min(360px,calc(100vw - 24px)); }
  .task-latest-update { grid-template-columns: auto minmax(0, 1fr); }
  .task-latest-update time { display: none; }
  .task-activity { margin-left: 36px; }
  .update-composer { grid-template-columns: minmax(0, 1fr); }
  .update-composer button { justify-self: end; }
  .activity-entry { grid-template-columns: 14px minmax(0, 1fr); }
  .activity-entry time { grid-column: 2; margin-top: -10px; }
}

.login-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(232, 235, 240, 0.96), rgba(242, 242, 247, 0.98));
}
.login-layer[hidden] { display: none !important; }
.login-panel {
  width: min(360px, 100%);
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--card-shadow);
}
.login-panel h1 {
  margin: 0 0 6px;
  font: 600 24px/1.15 var(--font-display);
}
.login-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.login-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}
.login-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font: inherit;
  background: var(--fill);
}
.login-field input:focus {
  outline: none;
  border-color: rgba(43, 155, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(43, 155, 240, 0.15);
}
.login-error {
  margin: 0 0 12px;
  color: var(--destructive);
  font-size: 13px;
}
.login-error[hidden] { display: none; }
#loginSubmit {
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font: 600 15px var(--font);
  cursor: pointer;
}
#loginSubmit:active { background: var(--blue-press); }
body.login-gate .app-window { visibility: hidden; }
