/* Tasks section styles — a Google-Tasks (iOS) look built on vaakya's theme
   tokens. Every selector is scoped under .tasks-root (or the body class the
   drag code toggles) so nothing here leaks into other pages.

   Layout is phone-first: the measurements mirror the iOS Google Tasks app
   (56px header, 48px tab strip, 56px rows, 56px rounded-square FAB,
   28px-radius bottom sheets). Above 768px the page becomes a centered
   column and sheets become centered dialogs. */

.tasks-root {
  /* List color palette — keys stored on TaskList.color. Dark-theme shades
     are the lighter Material tones so they stay readable on dark cards. */
  --tl-red: #d93025;
  --tl-orange: #e8710a;
  --tl-yellow: #e0a800;
  --tl-green: #188038;
  --tl-teal: #129eaf;
  --tl-blue: #1a73e8;
  --tl-purple: #8430ce;
  --tl-pink: #d01884;
  --tk-overdue: #d93025;
  --tk-sheet-bg: #f0f4f9;
  --tk-shadow-float: 0 1px 6px rgba(0, 0, 0, 0.18);
  --tk-shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.2);
  --tk-snack-bg: #323232;
  --tk-snack-text: #ffffff;
  --tk-snack-action: #8ab4f8;

  position: relative;
  /* #__next is a flex row (style.css), so without an explicit width this
     page would shrink-wrap its content instead of filling the viewport. */
  width: 100%;
  min-height: 100vh;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #111);
  font-family: 'Poppins', "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .tasks-root {
  --tl-red: #f28b82;
  --tl-orange: #fcad70;
  --tl-yellow: #fdd663;
  --tl-green: #81c995;
  --tl-teal: #78d9ec;
  --tl-blue: #8ab4f8;
  --tl-purple: #c58af9;
  --tl-pink: #ff8bcb;
  --tk-overdue: #f28b82;
  --tk-sheet-bg: var(--bg-surface, #1a1a24);
  --tk-shadow-float: 0 1px 6px rgba(0, 0, 0, 0.5);
  --tk-shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.6);
  --tk-snack-bg: #e8eaed;
  --tk-snack-text: #202124;
  --tk-snack-action: #1a73e8;
}

.tasks-root *,
.tasks-root *::before,
.tasks-root *::after {
  box-sizing: border-box;
}

/* Neutralise style.css's global <button> (green, 5px right margin) and
   its focus-visible halo on inputs — Google's text fields have no box. */
.tasks-root button {
  margin: 0;
  font-family: inherit;
  cursor: pointer;
}

.tasks-root input,
.tasks-root textarea,
.tasks-root select {
  font-family: inherit;
  color: inherit;
}
.tasks-root input:focus,
.tasks-root input:focus-visible,
.tasks-root textarea:focus,
.tasks-root textarea:focus-visible {
  outline: none;
  box-shadow: none;
}
.tasks-root button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 52, 59, 224), 0.28);
}

/* List color → one variable the components read. */
.tasks-root .tk-color-red    { --tk-list-color: var(--tl-red); }
.tasks-root .tk-color-orange { --tk-list-color: var(--tl-orange); }
.tasks-root .tk-color-yellow { --tk-list-color: var(--tl-yellow); }
.tasks-root .tk-color-green  { --tk-list-color: var(--tl-green); }
.tasks-root .tk-color-teal   { --tk-list-color: var(--tl-teal); }
.tasks-root .tk-color-blue   { --tk-list-color: var(--tl-blue); }
.tasks-root .tk-color-purple { --tk-list-color: var(--tl-purple); }
.tasks-root .tk-color-pink   { --tk-list-color: var(--tl-pink); }

/* ---------- Shared bits ---------- */

.tasks-root .tk-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-icon, #6f6f6f);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
/* Hover only for real pointers — on touch a :hover would stick after a tap. */
@media (hover: hover) {
  .tasks-root .tk-icon-btn:hover { background: var(--bg-hover, #f7f7fa); }
}
.tasks-root .tk-icon-btn:active { background: var(--accent-bg); }

.tasks-root .tk-text-btn {
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted, #555);
  white-space: nowrap;
}
.tasks-root .tk-text-btn.is-primary { color: var(--accent); }
.tasks-root .tk-text-btn.is-danger { color: var(--tk-overdue); }
.tasks-root .tk-text-btn:disabled { color: var(--text-placeholder, #aaa); cursor: default; }
.tasks-root .tk-text-btn:not(:disabled):active { background: var(--accent-bg); }

.tasks-root .tk-round-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--bg-card, #fff);
  box-shadow: var(--tk-shadow-float);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tasks-root .tk-pill-group {
  display: inline-flex;
  height: 44px;
  border-radius: 999px;
  background: var(--bg-card, #fff);
  box-shadow: var(--tk-shadow-float);
  overflow: hidden;
}
.tasks-root .tk-pill-btn {
  width: 50px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tasks-root .tk-pill-btn.is-on { color: var(--accent); }

.tasks-root .tk-done-pill {
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--bg-card, #fff);
  box-shadow: var(--tk-shadow-float);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-placeholder, #aaa);
  flex-shrink: 0;
}
.tasks-root .tk-done-pill.is-enabled { color: var(--accent); }
.tasks-root .tk-done-pill:disabled { cursor: default; }

/* ---------- Header ---------- */

/* Brand cluster left, gear right — matches the other section headers
   (the ledger header uses 12px 20px; the gear's own 40px hit area makes
   16px read the same here). */
.tasks-root .tk-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 56px;
  padding: 0 12px 0 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-card, #fff);
}
.tasks-root .tk-header-center {
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}
.tasks-root .tk-header-side { display: flex; justify-content: flex-end; }

/* ---------- Tabs ---------- */

.tasks-root .tk-tabs {
  display: flex;
  align-items: stretch;
  height: 48px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border-light, #eee);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 56px;
  z-index: 19;
  background: var(--bg-card, #fff);
}
.tasks-root .tk-tabs::-webkit-scrollbar { display: none; }

.tasks-root .tk-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted, #555);
  white-space: nowrap;
  flex-shrink: 0;
}
.tasks-root .tk-tab.is-active { color: var(--accent); }
.tasks-root .tk-tab.is-active.tk-color-red,
.tasks-root .tk-tab.is-active.tk-color-orange,
.tasks-root .tk-tab.is-active.tk-color-yellow,
.tasks-root .tk-tab.is-active.tk-color-green,
.tasks-root .tk-tab.is-active.tk-color-teal,
.tasks-root .tk-tab.is-active.tk-color-blue,
.tasks-root .tk-tab.is-active.tk-color-purple,
.tasks-root .tk-tab.is-active.tk-color-pink { color: var(--tk-list-color); }
.tasks-root .tk-tab.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
}
.tasks-root .tk-tab-dot,
.tasks-root .tk-list-title-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tk-list-color, var(--accent));
  flex-shrink: 0;
}
.tasks-root .tk-tab-count {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 13px;
  background: var(--border-light, #e3e3e3);
  color: var(--text-secondary, #222);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tasks-root .tk-tab--new { color: var(--text-muted); font-weight: 500; }
/* Shared-list glyph on a tab (owner sharing out, or a list shared in). */
.tasks-root .tk-tab-shared { opacity: 0.7; flex-shrink: 0; }

/* "Shared by …" / "Shared with …" caption under the list title. For the
   owner it's a button into the share sheet; for members it's inert. */
.tasks-root .tk-list-shared {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px 16px 6px;
  padding: 4px 10px 4px 8px;
  border: none;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  max-width: calc(100% - 32px);
}
.tasks-root .tk-list-shared span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tasks-root .tk-list-shared:not([title]) { cursor: default; }

/* Assignee avatar on a row (shared lists): initials in a small disc,
   tinted with the list color; accent-filled when it's assigned to you. */
.tasks-root .tk-row-assignee {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--tk-list-color, var(--accent));
  background: color-mix(in srgb, var(--tk-list-color, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tk-list-color, var(--accent)) 35%, transparent);
}
.tasks-root .tk-row-assignee.is-you {
  color: #fff;
  background: var(--tk-list-color, var(--accent));
  border-color: transparent;
}
.tasks-root .tk-row.is-completed .tk-row-assignee { opacity: 0.55; }
.tasks-root .tk-chip--assignee { padding-left: 12px; }

/* ---------- History sheet ---------- */

.tasks-root .tk-history { display: flex; flex-direction: column; }
.tasks-root .tk-history-row {
  padding: 10px 2px;
  border-bottom: 1px solid var(--border-light, #eee);
}
.tasks-root .tk-history-row:last-child { border-bottom: none; }
.tasks-root .tk-history-main { font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.tasks-root .tk-history-actor { font-weight: 600; }
.tasks-root .tk-history-when { margin-top: 2px; font-size: 12px; color: var(--text-faint, #777); }

/* ---------- Share sheet ---------- */

.tasks-root .tk-share-hint {
  margin: 2px 0 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.tasks-root .tk-share-list { display: flex; flex-direction: column; }
.tasks-root .tk-share-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 4px;
  border: none;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  color: var(--text-primary);
}
.tasks-root .tk-share-row:active { background: var(--accent-bg); }
.tasks-root .tk-share-check { color: var(--text-icon); display: inline-flex; flex-shrink: 0; }
.tasks-root .tk-share-row.is-on .tk-share-check { color: var(--accent); }
.tasks-root .tk-share-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tasks-root .tk-share-name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-root .tk-share-email { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-root .tk-share-flag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--border-light);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- List title row ---------- */

.tasks-root .tk-list { padding-bottom: 120px; }

.tasks-root .tk-list-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 4px 16px;
}
.tasks-root .tk-list-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Rows ---------- */

.tasks-root .tk-rows { position: relative; }
.tasks-root .tk-row-wrap { position: relative; }

.tasks-root .tk-group-label {
  padding: 14px 16px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tasks-root .tk-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 12px 13px 16px;
  min-height: 56px;
  background: var(--bg-card, #fff);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
.tasks-root .tk-row.is-subtask { padding-left: 56px; }
.tasks-root .tk-row.is-lifted {
  border-radius: 12px;
  box-shadow: var(--tk-shadow-lift);
  background: var(--bg-card, #fff);
}
body.tk-dragging {
  -webkit-user-select: none;
  user-select: none;
  cursor: grabbing;
}

.tasks-root .tk-row-check {
  width: 26px;
  height: 26px;
  padding: 0;
  margin-top: 0;
  border: none;
  background: transparent;
  color: var(--text-icon, #70757a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tasks-root .tk-list.tk-color-red .tk-row-check,
.tasks-root .tk-list.tk-color-orange .tk-row-check,
.tasks-root .tk-list.tk-color-yellow .tk-row-check,
.tasks-root .tk-list.tk-color-green .tk-row-check,
.tasks-root .tk-list.tk-color-teal .tk-row-check,
.tasks-root .tk-list.tk-color-blue .tk-row-check,
.tasks-root .tk-list.tk-color-purple .tk-row-check,
.tasks-root .tk-list.tk-color-pink .tk-row-check { color: var(--tk-list-color); }
.tasks-root .tk-row.is-completed .tk-row-check,
.tasks-root .tk-list .tk-row.is-completed .tk-row-check { color: var(--accent); }

/* Tick animation. TaskRow adds .is-ticking for the hold between the tap
   and the real toggle (see TICK_HOLD_MS); the freshly mounted check /
   circle icon pops in so the state change is visible before the row
   moves into or out of the Completed group. */
.tasks-root .tk-row-check.is-ticking svg {
  animation: tk-tick-pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.35) both;
}
@keyframes tk-tick-pop {
  0%   { transform: scale(0.35); opacity: 0.2; }
  65%  { transform: scale(1.2);  opacity: 1; }
  100% { transform: scale(1); }
}

.tasks-root .tk-row-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  color: inherit;
}
.tasks-root .tk-row-title {
  font-size: 15px;
  line-height: 22px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  /* Eases the strike-through colour change during the tick hold. */
  transition: color 0.2s ease-out;
}
.tasks-root .tk-row.is-completed .tk-row-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
/* "by Bhavna" — provenance, not status: faint, a step smaller than the
   title, like the ledger's shared-tag. Inline after the title on wide
   screens; its own line under the title on phones. */
.tasks-root .tk-row-by,
.tasks-root .tk-detail-by {
  display: block;
  margin-top: 1px;
  color: var(--text-faint, #777);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.tasks-root .tk-detail-by { margin: -8px 0 14px; font-size: 13px; }
@media (min-width: 769px) {
  .tasks-root .tk-row-by { display: inline; margin: 0 0 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tasks-root .tk-row-check.is-ticking svg { animation: none; }
  .tasks-root .tk-row-title { transition: none; }
}
.tasks-root .tk-row-details,
.tasks-root .tk-row-parent {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tasks-root .tk-row-parent::before { content: "↳ "; }
.tasks-root .tk-row-completed-at {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-muted);
}
.tasks-root .tk-row-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.tasks-root .tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--border-medium, #ddd);
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--text-muted);
  white-space: nowrap;
}
.tasks-root .tk-chip.is-overdue { color: var(--tk-overdue); border-color: var(--tk-overdue); }
.tasks-root .tk-chip-repeat { flex-shrink: 0; }
.tasks-root .tk-chip.is-removable { padding-right: 4px; }
.tasks-root .tk-chip-remove {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tasks-root .tk-row-star {
  width: 40px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-icon, #70757a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tasks-root .tk-row-star.is-on { color: var(--accent); }
.tasks-root .tk-row-grip {
  color: var(--text-icon);
  display: inline-flex;
  align-items: center;
  height: 26px;
  flex-shrink: 0;
}

/* ---------- Completed group ---------- */

.tasks-root .tk-completed { margin-top: 8px; border-top: 1px solid var(--border-light, #eee); }
.tasks-root .tk-completed-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 16px 16px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-primary);
  text-align: left;
}
.tasks-root .tk-completed-chevron { color: var(--text-icon); transition: transform 0.2s; }
.tasks-root .tk-completed-toggle.is-open .tk-completed-chevron { transform: rotate(180deg); }
.tasks-root .tk-rows--completed .tk-row { touch-action: auto; }

/* ---------- Empty states ---------- */

.tasks-root .tk-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}
.tasks-root .tk-empty--loading { padding: 40px 24px; font-size: 14px; }
.tasks-root .tk-empty--done { padding: 28px 24px 8px; }
.tasks-root .tk-empty-art { color: var(--accent); opacity: 0.8; margin-bottom: 12px; }
.tasks-root .tk-empty-title { margin: 0 0 4px; font-size: 16px; font-weight: 500; color: var(--text-primary); }
.tasks-root .tk-empty-sub { margin: 0; font-size: 13px; }

/* ---------- FAB ---------- */

/* The button's gradient + glow. Defaults are the app accent fading into
   the purple the Settings toggles use; an element carrying a tk-color-*
   class (the FAB on a colored list, and the add sheet's morph skin) re-
   derives both stops from that list color instead. color-mix() has been
   in every evergreen browser and iOS since 2023; older engines simply get
   the flat list color as the second stop via the fallback declaration. */
.tasks-root {
  --tk-fab-a: var(--accent);
  --tk-fab-b: #a855f7;
  --tk-fab-glow: rgba(var(--accent-rgb, 52, 59, 224), 0.45);
}
.tasks-root [class*="tk-color-"] {
  --tk-fab-a: var(--tk-list-color);
  --tk-fab-b: var(--tk-list-color);
  --tk-fab-b: color-mix(in srgb, var(--tk-list-color) 62%, #ffffff);
  --tk-fab-glow: color-mix(in srgb, var(--tk-list-color) 48%, transparent);
}
[data-theme="dark"] .tasks-root [class*="tk-color-"] {
  --tk-fab-b: color-mix(in srgb, var(--tk-list-color) 70%, #ffffff);
}

.tasks-root .tk-fab {
  position: fixed;
  right: 20px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tk-fab-a), var(--tk-fab-b));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 22px var(--tk-fab-glow),
    0 2px 6px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  z-index: 50;
  /* Overshooting ease so the return from "away" lands with a small bounce. */
  transition:
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.16s ease-out,
    box-shadow 0.2s;
  /* `backwards`, not `both`: a forwards fill would pin the keyframe's final
     transform on the element and override the .is-away slide and :active
     press scale below. */
  animation: tk-fab-pop 0.34s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.tasks-root .tk-fab:active { transform: scale(0.92); }
/* Scrolled down a long list: slide below the viewport edge. */
.tasks-root .tk-fab.is-away {
  transform: translateY(calc(100% + 56px));
  pointer-events: none;
  transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
}
/* While the add sheet is open the sheet IS the button. Opacity rather than
   a transform so the sheet can still measure the button's true rectangle
   when it shrinks back. Removing the class replays the pop keyframes. */
.tasks-root .tk-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  animation: none;
  transition: none;
}
@keyframes tk-fab-pop {
  from { transform: scale(0.4); opacity: 0; }
  60% { opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tasks-root .tk-fab { animation: none; transition: opacity 0.16s; }
}

/* ---------- Sheet (bottom sheet on phones, dialog on desktop) ---------- */

.tasks-root .tk-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.22s ease-out;
}
.tasks-root .tk-sheet-overlay.is-visible { opacity: 1; }
/* Closed-but-mounted (the add-task sheet): invisible and inert, but the
   panel keeps its layout so its input can still receive focus. */
.tasks-root .tk-sheet-overlay.is-hidden { opacity: 0; pointer-events: none; }

.tasks-root .tk-sheet {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--tk-sheet-bg);
  color: var(--text-primary);
  border-radius: 28px 28px 0 0;
  padding: 0 20px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  will-change: transform;
}
/* Morph skin: the FAB's gradient laid over the whole panel. Sheet.js fades
   it out as the panel grows out of the button and back in as it shrinks. */
.tasks-root .tk-sheet-skin {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--tk-fab-a), var(--tk-fab-b));
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.tasks-root .tk-sheet.is-morph { overflow: hidden; }
.tasks-root .tk-sheet-body { position: relative; }
.tasks-root .tk-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  touch-action: none;
  cursor: grab;
}
.tasks-root .tk-sheet-grabber {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-default, #ccc);
}

/* ---------- Add task sheet ---------- */

.tasks-root .tk-add-title {
  width: 100%;
  padding: 10px 0 8px;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1.3;
  outline: none;
  caret-color: var(--accent);
}
.tasks-root .tk-add-title::placeholder { color: var(--text-placeholder, #aaa); }
.tasks-root .tk-add-details {
  width: 100%;
  padding: 4px 0 8px;
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  outline: none;
}
.tasks-root .tk-add-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 8px; }
.tasks-root .tk-add-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
}
.tasks-root .tk-add-icon {
  width: 44px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tasks-root .tk-add-icon.is-on { background: var(--accent-bg); }
.tasks-root .tk-add-spacer { flex: 1 1 auto; }
.tasks-root .tk-add-save { padding-right: 0; }

/* ---------- Menus & confirm ---------- */

.tasks-root .tk-menu-title {
  padding: 6px 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.tasks-root .tk-menu { display: flex; flex-direction: column; padding-bottom: 4px; }
.tasks-root .tk-menu-item {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 14px 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary);
  text-align: left;
}
.tasks-root .tk-menu-item:active { background: var(--accent-bg); }
.tasks-root .tk-menu-item:disabled { opacity: 0.45; cursor: default; }
.tasks-root .tk-menu-item.is-danger { color: var(--tk-overdue); }
.tasks-root .tk-menu-icon { color: var(--text-icon); display: inline-flex; }
.tasks-root .tk-menu-item.is-danger .tk-menu-icon { color: inherit; }
.tasks-root .tk-menu-label { flex: 1 1 auto; }
.tasks-root .tk-menu-check { color: var(--accent); display: inline-flex; }

.tasks-root .tk-confirm-title { margin: 8px 0 8px; font-size: 17px; font-weight: 500; }
.tasks-root .tk-confirm-message { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.tasks-root .tk-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Date / time / repeat pickers ---------- */

.tasks-root .tk-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 6px;
}
.tasks-root .tk-picker-head .tk-text-btn { padding-left: 0; padding-right: 0; }
.tasks-root .tk-picker-title { font-size: 15px; font-weight: 600; }

.tasks-root .tk-cal { padding: 4px 0 8px; }
.tasks-root .tk-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.tasks-root .tk-cal-month { font-size: 15px; font-weight: 600; }
.tasks-root .tk-cal-weekdays,
.tasks-root .tk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
}
.tasks-root .tk-cal-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}
.tasks-root .tk-cal-day {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tasks-root .tk-cal-day.is-today { color: var(--accent); font-weight: 600; }
.tasks-root .tk-cal-day.is-selected { background: var(--accent); color: #fff; font-weight: 600; }

.tasks-root .tk-picker-rows { border-top: 1px solid var(--border-light); }
.tasks-root .tk-picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.tasks-root .tk-picker-row-icon { color: var(--text-icon); flex-shrink: 0; }
.tasks-root .tk-picker-row-btn {
  flex: 1 1 auto;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary);
  text-align: left;
}
.tasks-root .tk-picker-row-value { flex: 1 1 auto; font-size: 15px; }
.tasks-root .tk-time-input {
  font-size: 16px;
  padding: 6px 8px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-card);
}
.tasks-root .tk-picker-foot { padding-top: 8px; }
.tasks-root .tk-picker-foot .tk-text-btn { padding-left: 0; }

.tasks-root .tk-repeat-custom {
  border-top: 1px solid var(--border-light);
  padding: 12px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tasks-root .tk-repeat-row { display: flex; align-items: center; gap: 10px; }
.tasks-root .tk-repeat-label { font-size: 14px; font-weight: 600; color: var(--text-muted); min-width: 44px; }
.tasks-root .tk-repeat-number {
  width: 68px;
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 16px;
}
.tasks-root .tk-repeat-select,
.tasks-root .tk-repeat-date {
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 16px;
}
.tasks-root .tk-repeat-days { display: flex; gap: 8px; justify-content: space-between; }
.tasks-root .tk-repeat-day {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-medium);
  border-radius: 50%;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.tasks-root .tk-repeat-day.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tasks-root .tk-repeat-ends { display: flex; flex-direction: column; gap: 10px; }
.tasks-root .tk-repeat-end-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.tasks-root .tk-repeat-end-option input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.tasks-root .tk-repeat-hint { margin: 0; font-size: 12px; color: var(--text-muted); }

/* ---------- Task detail page ---------- */

.tasks-root .tk-detail,
.tasks-root .tk-list-editor {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.tasks-root .tk-detail { padding-bottom: 110px; }

.tasks-root .tk-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-card, #fff);
}
.tasks-root .tk-detail-body { padding: 6px 20px 0; }
.tasks-root .tk-detail-list {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}
.tasks-root .tk-detail-list .tk-list-title-dot { background: var(--tk-list-color, var(--accent)); }
.tasks-root .tk-detail-title {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  resize: none;
  overflow: hidden;
  outline: none;
  caret-color: var(--accent);
}
.tasks-root .tk-detail-title.is-completed { text-decoration: line-through; color: var(--text-muted); }
.tasks-root .tk-detail-rows { display: flex; flex-direction: column; }
.tasks-root .tk-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 12px 0;
}
.tasks-root .tk-detail-row-icon { color: var(--text-icon); flex-shrink: 0; margin-top: 1px; }
.tasks-root .tk-detail-row-btn {
  flex: 1 1 auto;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 22px;
  color: var(--text-muted);
  text-align: left;
}
.tasks-root .tk-detail-details {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 24px;
  resize: none;
  overflow: hidden;
  outline: none;
}
.tasks-root .tk-detail-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tasks-root .tk-detail-chips .tk-chip { font-size: 13px; padding: 5px 6px 5px 12px; border-radius: 10px; }
.tasks-root .tk-detail-repeat { font-size: 12px; color: var(--text-muted); }

.tasks-root .tk-subtasks { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tasks-root .tk-subtask {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 40px;
}
.tasks-root .tk-subtask-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 0;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 22px;
  color: var(--text-primary);
  text-align: left;
  overflow-wrap: anywhere;
}
.tasks-root .tk-subtask.is-completed .tk-subtask-title { text-decoration: line-through; color: var(--text-muted); }
.tasks-root .tk-subtask.is-completed .tk-row-check { color: var(--accent); }
.tasks-root .tk-subtask-remove { width: 32px; height: 32px; opacity: 0.7; }
.tasks-root .tk-subtask-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 0;
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 22px;
  outline: none;
  caret-color: var(--accent);
}
.tasks-root .tk-subtasks .tk-detail-row-btn { padding-top: 8px; }

.tasks-root .tk-detail-foot {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
}
/* Plain blue text, as in Google Tasks — no pill. */
.tasks-root .tk-detail-complete {
  font-size: 15px;
  padding: 10px 12px;
  background: transparent;
}

/* ---------- List editor page ---------- */

.tasks-root .tk-list-editor-heading {
  flex: 1 1 auto;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
}
.tasks-root .tk-list-editor-body { padding: 8px 20px; }
.tasks-root .tk-list-editor-input {
  width: 100%;
  padding: 12px 0;
  border: none;
  background: transparent;
  font-size: 20px;
  outline: none;
  caret-color: var(--accent);
}
.tasks-root .tk-list-editor-input::placeholder { color: var(--text-placeholder, #aaa); }
.tasks-root .tk-form-error { margin: 4px 0 0; font-size: 13px; color: var(--tk-overdue); }
.tasks-root .tk-color-row { margin-top: 28px; }
.tasks-root .tk-color-label {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tasks-root .tk-color-swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.tasks-root .tk-swatch {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--tk-list-color);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tasks-root .tk-swatch.is-on { box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px var(--tk-list-color, var(--border-default)); }
.tasks-root .tk-swatch:active { transform: scale(0.92); }
.tasks-root .tk-swatch--none {
  background: transparent;
  border: 2px solid var(--border-default);
  color: var(--text-muted);
}

/* ---------- Snackbar ---------- */

.tasks-root .tk-snackbar {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  /* Below the sheets (100+): an open menu or picker covers the snackbar. */
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--tk-snack-bg);
  color: var(--tk-snack-text);
  font-size: 13px;
  line-height: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: tk-snack-in 0.18s ease-out;
}
.tasks-root .tk-snackbar-text { flex: 1 1 auto; }
.tasks-root .tk-snackbar-action {
  padding: 4px 6px;
  border: none;
  background: transparent;
  color: var(--tk-snack-action);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
@keyframes tk-snack-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Inline "Add a task" row (desktop) ---------- */

/* Rendered by InlineAddRow.js under the list title on wide screens, in
   place of the phone FAB + bottom sheet. An elevated card: filled surface
   with a soft shadow at rest; on focus (or while holding a draft) it lifts
   a little and gains an accent ring. The plus is a small gradient badge
   built from the same --tk-fab-* tokens as the phone button, so both tint
   with the list color. */
.tasks-root .tk-inline-add {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 16px 10px;
  padding: 6px 8px 6px 8px;
  border: 1px solid var(--border-light, #eee);
  border-radius: 14px;
  background: var(--bg-card, #fff);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.tasks-root .tk-inline-add:hover {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 8px 22px rgba(0, 0, 0, 0.1);
}
.tasks-root .tk-inline-add:focus-within,
.tasks-root .tk-inline-add.is-active {
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 2px var(--tk-fab-a, var(--accent)),
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 10px 26px var(--tk-fab-glow);
}
[data-theme="dark"] .tasks-root .tk-inline-add {
  background: var(--bg-surface, #1a1a24);
  border-color: var(--border-medium, #333346);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 4px 14px rgba(0, 0, 0, 0.35);
}
/* Same specificity as the dark rest rule above, so it must come after it
   or the ring never shows in dark mode. */
[data-theme="dark"] .tasks-root .tk-inline-add:focus-within,
[data-theme="dark"] .tasks-root .tk-inline-add.is-active {
  border-color: transparent;
  box-shadow:
    0 0 0 2px var(--tk-fab-a, var(--accent)),
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 10px 26px var(--tk-fab-glow);
}
.tasks-root .tk-inline-add-badge {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tk-fab-a), var(--tk-fab-b));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 3px 10px var(--tk-fab-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tasks-root .tk-inline-add:focus-within .tk-inline-add-badge,
.tasks-root .tk-inline-add.is-active .tk-inline-add-badge {
  transform: scale(1.06);
}
.tasks-root .tk-inline-add-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  caret-color: var(--accent);
}
.tasks-root .tk-inline-add-input::placeholder { color: var(--text-placeholder, #aaa); }
.tasks-root .tk-inline-add-chip { flex-shrink: 0; }
.tasks-root .tk-inline-add-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.tasks-root .tk-inline-add-btn { width: 36px; height: 36px; }
.tasks-root .tk-inline-add-btn.is-on { color: var(--accent); }
.tasks-root .tk-inline-add-save { padding: 6px 10px; font-size: 14px; }
.tasks-root .tk-inline-add-save:disabled { opacity: 0.45; cursor: default; }

/* ---------- Desktop / tablet landscape ---------- */

/* Tablet (769–1024px): the phone layout in a centred 760px column. */
@media (min-width: 769px) {
  .tasks-root {
    max-width: 760px;
    margin: 0 auto;
    border-left: 1px solid var(--border-light, #eee);
    border-right: 1px solid var(--border-light, #eee);
  }
  .tasks-root .tk-fab {
    /* Hug the column's right edge instead of the viewport's. */
    right: max(20px, calc(50% - 380px + 24px));
  }
  .tasks-root .tk-detail-foot {
    right: max(20px, calc(50% - 380px + 24px));
  }
  .tasks-root .tk-sheet-overlay { align-items: center; padding: 24px; }
  .tasks-root .tk-sheet {
    max-width: 480px;
    max-height: calc(100vh - 48px);
    border-radius: 20px;
    padding: 8px 24px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  }
  .tasks-root .tk-sheet-handle { display: none; }
}

/* Desktop (≥1025px, `.is-wide` set by pages/tasks/index.js): the ledger's
   frame — page background behind a 1160px container of cards — with the
   list card on the left and the task detail card on the right. Keep the
   breakpoint in sync with WIDE_MIN_WIDTH in pages/tasks/index.js. */
@media (min-width: 1025px) {
  .tasks-root.is-wide {
    max-width: none;
    margin: 0;
    border-left: none;
    border-right: none;
    background: var(--bg-body, #f4f6fa);
  }

  /* Header: ledger shape — brand cluster left, settings gear right. */
  .tasks-root.is-wide .tk-header {
    padding: 0 16px;
    border-bottom: 1px solid var(--border-default, #e5e5ea);
  }

  .tasks-root.is-wide .tk-shell {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 24px 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 20px;
    align-items: start;
  }
  .tasks-root.is-wide .tk-pane {
    min-width: 0;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #eee);
    border-radius: 12px;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(16, 24, 40, 0.08));
  }
  .tasks-root.is-wide .tk-pane--list { min-height: 480px; }
  /* Detail card stays in view while the (longer) list scrolls; its own
     content scrolls inside the card. 80px = header (56) + shell padding. */
  .tasks-root.is-wide .tk-pane--detail {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  /* Tabs top the list card: no longer sticky (the header is), rounded to
     match the card. */
  .tasks-root.is-wide .tk-tabs {
    position: static;
    border-radius: 12px 12px 0 0;
  }
  .tasks-root.is-wide .tk-list { padding-bottom: 16px; }
  .tasks-root.is-wide .tk-list-title-row { padding-top: 14px; }
  .tasks-root.is-wide .tk-empty { padding: 72px 24px; }

  /* Task detail inside the right card: footer becomes a normal row at the
     bottom instead of a fixed viewport button. */
  .tasks-root.is-wide .tk-detail {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .tasks-root.is-wide .tk-detail-bar {
    position: sticky;
    top: 0;
    border-radius: 12px 12px 0 0;
  }
  .tasks-root.is-wide .tk-detail-body { flex: 1 1 auto; padding-bottom: 12px; }
  .tasks-root.is-wide .tk-detail-foot {
    position: static;
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px;
    border-top: 1px solid var(--border-light, #eee);
  }
  .tasks-root.is-wide .tk-list-editor { min-height: 0; }

  /* Right card with nothing open. */
  .tasks-root.is-wide .tk-detail-empty {
    padding: 88px 28px;
    text-align: center;
    color: var(--text-muted);
  }
  .tasks-root.is-wide .tk-detail-empty-art {
    color: var(--accent);
    opacity: 0.55;
    margin-bottom: 12px;
  }
  .tasks-root.is-wide .tk-detail-empty-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
  }
  .tasks-root.is-wide .tk-detail-empty-sub { margin: 0; font-size: 13px; }

  /* Rows get a hover tint on a real pointer, like the ledger tables. */
  .tasks-root.is-wide .tk-row:not(.is-lifted):hover { background: var(--bg-hover, #f7f7fa); }

  /* ---- Desktop type scale ----
     The phone sizes are touch-friendly; beside the ledger (table cells
     .92rem ≈ 14.7px, secondary .84–.88rem ≈ 13.5px, section headings
     1.15rem ≈ 18px) they read a step too big. Pull everything down one
     notch and tighten row padding + icons to match. Inputs stay ≥ 14px —
     iOS zoom is a phone concern, not a desktop one. */
  .tasks-root.is-wide .tk-tab { font-size: 14px; padding: 0 14px; }
  .tasks-root.is-wide .tk-tab-count { min-width: 22px; height: 22px; font-size: 12px; }
  .tasks-root.is-wide .tk-list-title { font-size: 18px; }
  .tasks-root.is-wide .tk-group-label { font-size: 11.5px; }
  .tasks-root.is-wide .tk-text-btn { font-size: 14px; }

  .tasks-root.is-wide .tk-row { padding: 10px 12px 10px 16px; min-height: 48px; gap: 12px; }
  .tasks-root.is-wide .tk-row-title { font-size: 14px; line-height: 22px; }
  .tasks-root.is-wide .tk-row-details,
  .tasks-root.is-wide .tk-row-parent,
  .tasks-root.is-wide .tk-row-completed-at { font-size: 12.5px; line-height: 17px; }
  .tasks-root.is-wide .tk-chip { font-size: 11.5px; line-height: 15px; padding: 2px 8px; }
  .tasks-root.is-wide .tk-row-check { width: 24px; height: 22px; }
  .tasks-root.is-wide .tk-row-check svg { width: 20px; height: 20px; }
  .tasks-root.is-wide .tk-row-star { height: 22px; }
  .tasks-root.is-wide .tk-row-star svg { width: 20px; height: 20px; }
  .tasks-root.is-wide .tk-completed-toggle { font-size: 14px; padding: 12px 12px 12px 16px; }
  .tasks-root.is-wide .tk-empty-title { font-size: 15px; }
  .tasks-root.is-wide .tk-empty-sub { font-size: 12.5px; }

  .tasks-root.is-wide .tk-inline-add-input { font-size: 14px; height: 36px; }
  .tasks-root.is-wide .tk-inline-add-save { font-size: 13px; }

  .tasks-root.is-wide .tk-detail-list { font-size: 14px; }
  .tasks-root.is-wide .tk-detail-title { font-size: 21px; }
  .tasks-root.is-wide .tk-detail-row { gap: 16px; padding: 10px 0; }
  .tasks-root.is-wide .tk-detail-row-icon svg { width: 20px; height: 20px; }
  .tasks-root.is-wide .tk-detail-row-btn,
  .tasks-root.is-wide .tk-detail-details { font-size: 14px; line-height: 22px; }
  .tasks-root.is-wide .tk-detail-chips .tk-chip { font-size: 12.5px; }
  .tasks-root.is-wide .tk-detail-repeat { font-size: 12px; }
  .tasks-root.is-wide .tk-subtask { min-height: 36px; }
  .tasks-root.is-wide .tk-subtask-title,
  .tasks-root.is-wide .tk-subtask-input { font-size: 14px; line-height: 20px; }
  .tasks-root.is-wide .tk-detail-complete { font-size: 14px; }
  .tasks-root.is-wide .tk-detail-empty-title { font-size: 15px; }
  .tasks-root.is-wide .tk-detail-empty-sub { font-size: 12.5px; }

  .tasks-root.is-wide .tk-list-editor-heading { font-size: 16px; }
  .tasks-root.is-wide .tk-list-editor-input { font-size: 18px; }
  .tasks-root.is-wide .tk-menu-item { font-size: 14px; }
  .tasks-root.is-wide .tk-menu-title { font-size: 12.5px; }
}

@media (hover: hover) {
  .tasks-root .tk-row-check:hover,
  .tasks-root .tk-row-star:hover { color: var(--accent); }
  .tasks-root .tk-cal-day:not(.is-selected):hover { background: var(--bg-hover); }
  .tasks-root .tk-chip-remove:hover { background: var(--bg-hover); }
}
