/* Tasks workspace — intentionally follows Life's light application theme. */
#tasksPage.tasks-route-page {
  --tasks-page: #f4f7fb;
  --tasks-panel: #ffffff;
  --tasks-panel-muted: #f8fafc;
  --tasks-ink: #172033;
  --tasks-muted: #64748b;
  --tasks-faint: #94a3b8;
  --tasks-line: #dfe7f1;
  --tasks-line-strong: #cbd5e1;
  --tasks-accent: #315efb;
  --tasks-accent-hover: #2449d8;
  --tasks-accent-soft: #edf2ff;
  --tasks-success: #15803d;
  --tasks-success-soft: #ecfdf3;
  --tasks-danger: #c62828;
  --tasks-danger-soft: #fff1f2;
  --tasks-warning: #a16207;
  --tasks-warning-soft: #fffbeb;
  --tasks-shadow: 0 16px 40px rgba(15, 23, 42, .07);
  background: var(--tasks-page) !important;
}

body[data-active-route="tasks"] #tasksPage.route-page {
  display: flex !important;
}

#tasksPage.tasks-route-page,
#tasksPage.tasks-route-page .tasks-page-content {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

#tasksPage.tasks-route-page .tasks-page-content {
  max-width: none;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(circle at 90% 0, rgba(49, 94, 251, .055), transparent 28rem),
    var(--tasks-page) !important;
}

.tasks-shell {
  box-sizing: border-box;
  width: min(100%, 1080px);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(12px, 2.3vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--tasks-ink);
}

.tasks-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tasks-search-box {
  min-width: 0;
  min-height: 48px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--tasks-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.tasks-search-box:focus-within {
  border-color: #91a8ff;
  box-shadow: 0 0 0 4px rgba(49, 94, 251, .11);
}

.tasks-search-box .material-symbols-rounded {
  flex: 0 0 auto;
  color: var(--tasks-faint);
  font-size: 22px;
}

.tasks-search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tasks-ink);
  font: inherit;
}

.tasks-search-box input::placeholder { color: var(--tasks-faint); }

.tasks-icon-button,
.tasks-quick-option,
.task-drag-handle,
.task-check,
.task-star,
.task-add-subtask,
.task-move-button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tasks-icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tasks-line);
  border-radius: 14px;
  background: var(--tasks-panel);
  color: #475569;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .035);
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .12s ease;
}

.tasks-icon-button:hover {
  border-color: #b8c6ff;
  background: var(--tasks-accent-soft);
  color: var(--tasks-accent);
}

.tasks-icon-button:active { transform: scale(.96); }
.tasks-icon-button .material-symbols-rounded { font-size: 22px; }

.tasks-lists-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.tasks-lists-label {
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tasks-list-tabs {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 2px 2px 5px;
  scroll-snap-type: x proximity;
}

.tasks-list-tabs::-webkit-scrollbar { display: none; }

.tasks-list-tab {
  flex: 0 0 auto;
  min-height: 40px;
  max-width: 230px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--tasks-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .12s ease;
}

.tasks-list-tab:hover {
  border-color: #bac7f8;
  background: #f7f9ff;
  color: #243b86;
}

.tasks-list-tab:active { transform: scale(.98); }
.tasks-list-tab > span:not(.material-symbols-rounded) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-list-tab .material-symbols-rounded { font-size: 17px; }

.tasks-list-tab b {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf1f7;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1;
}

.tasks-list-tab.active {
  border-color: #b7c6ff;
  background: var(--tasks-accent-soft);
  color: #2449d8;
  box-shadow: inset 0 0 0 1px rgba(49, 94, 251, .06);
}

.tasks-list-tab.active b { background: var(--tasks-accent); color: #fff; }
.tasks-new-list-tab { border-style: dashed; color: var(--tasks-accent); }

.tasks-list-card {
  width: 100%;
  min-height: 250px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tasks-line);
  border-radius: 21px;
  background: var(--tasks-panel);
  box-shadow: var(--tasks-shadow);
}

/* Legacy app CSS styles every semantic <header> as the global route banner.
   Tasks has nested card, section, dialog, and menu headers, so reset that
   banner contract explicitly before applying their local layouts. */
#tasksPage .tasks-list-card-header,
#tasksPage .tasks-section-header,
#task-dialog-host .task-dialog-header,
#task-dialog-host .task-list-menu > header {
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  flex-direction: row !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#tasksPage .tasks-list-card-header {
  min-height: 0 !important;
  position: static !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 17px 18px 13px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf1f6 !important;
  background: linear-gradient(180deg, #fff, #fcfdff) !important;
}

.tasks-list-card-header > div:first-child { min-width: 0; }

.tasks-eyebrow {
  margin: 0 0 4px;
  color: var(--tasks-accent);
  font-size: 9px;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .14em;
}

.tasks-list-card-header h3 {
  margin: 0;
  overflow: hidden;
  color: var(--tasks-ink);
  font-size: clamp(1.2rem, 2.5vw, 1.52rem);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-list-summary {
  margin: 5px 0 0;
  color: var(--tasks-muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.tasks-header-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.tasks-header-actions .tasks-icon-button { width: 40px; height: 40px; min-width: 40px; flex-basis: 40px; border-radius: 12px; }

.tasks-feedback {
  margin: 11px 13px 2px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #f0d38c;
  border-radius: 12px;
  background: var(--tasks-warning-soft);
  color: #713f12;
  font-size: 11.5px;
  line-height: 1.4;
}

.tasks-feedback::before,
.tasks-feedback-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 19px;
  color: var(--tasks-warning);
}

.tasks-feedback::before { content: 'cloud_off'; }
.tasks-feedback:has(.tasks-feedback-icon)::before { display: none; }
.tasks-feedback-copy { min-width: 0; display: grid; gap: 1px; }
.tasks-feedback-copy strong { color: #713f12; }
.tasks-feedback-actions { display: inline-flex; align-items: center; gap: 6px; }
.tasks-feedback.hidden { display: none; }

.tasks-feedback button {
  min-height: 32px;
  border: 1px solid #e6c66f;
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
  color: #854d0e;
  padding: 0 10px;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.tasks-feedback button:hover { background: #fff; }

.tasks-feedback-auth {
  border-color: #b9c7ff;
  background: var(--tasks-accent-soft);
  color: #243b86;
}

.tasks-feedback-auth .tasks-feedback-icon,
.tasks-feedback-auth .tasks-feedback-copy strong { color: var(--tasks-accent); }
.tasks-feedback-auth button { border-color: #bdc9f5; color: #2449d8; }

.tasks-list {
  min-width: 0;
  padding: 8px 10px 13px;
}

.tasks-section,
.tasks-active-section { min-width: 0; }
.tasks-section + .tasks-section { margin-top: 15px; }

#tasksPage .tasks-section-header {
  min-height: 32px !important;
  height: 32px !important;
  max-height: 32px !important;
  position: static !important;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 2px 8px 4px !important;
  border: 0 !important;
  background: transparent !important;
  color: #475569;
}

.tasks-section-header h4 {
  margin: 0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tasks-section-count {
  min-width: 21px;
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf1f7;
  color: #64748b;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 850;
}

.task-row {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 36px 34px;
  align-items: center;
  gap: 2px;
  margin: 2px 0;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease, transform .15s ease;
}

.task-row:hover,
.task-row:focus-within {
  border-color: #e5eaf2;
  background: var(--tasks-panel-muted);
}

/* Target structure used by the drag/reorder UI. */
.task-row:has(> .task-drag-handle) {
  grid-template-columns: 28px 38px minmax(0, 1fr) auto;
  grid-template-areas: 'drag check body actions';
}

.task-row > .task-drag-handle { grid-area: drag; }
.task-row > .task-check { grid-area: check; }
.task-row > .task-row-body { grid-area: body; }
.task-row > .task-row-actions { grid-area: actions; }

.task-row-subtask {
  min-height: 50px;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  margin-left: 27px;
  padding-left: 9px;
}

.task-row-subtask:has(> .task-drag-handle) {
  grid-template-columns: 25px 36px minmax(0, 1fr) auto;
}

.task-row-subtask .task-add-subtask { display: none; }

.task-subtasks {
  position: relative;
  margin-left: 16px;
  padding-left: 4px;
}

.task-subtasks::before {
  content: '';
  position: absolute;
  left: 13px;
  top: -5px;
  bottom: 11px;
  width: 2px;
  border-radius: 2px;
  background: #dce4ef;
}

.task-drag-handle,
.task-check,
.task-star,
.task-add-subtask,
.task-move-button,
.task-row-body,
.task-row-actions > button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.task-drag-handle {
  width: 28px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #a0aec0;
  cursor: grab;
  touch-action: none;
}

.task-drag-handle:active { cursor: grabbing; }
.task-drag-handle:hover { background: #eef2f7; color: #64748b; }
.task-drag-handle .material-symbols-rounded { font-size: 19px; }

.task-check,
.task-star,
.task-add-subtask,
.task-move-button,
.task-row-actions > button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
}

.task-check { color: #64748b; }
.task-check:hover { background: var(--tasks-accent-soft); color: var(--tasks-accent); }
.task-check .material-symbols-rounded { font-size: 25px; }
.task-check[aria-disabled="true"], .task-check:disabled { color: #a8b3c3; cursor: not-allowed; }
.task-check[aria-disabled="true"] .material-symbols-rounded, .task-check:disabled .material-symbols-rounded { font-variation-settings: 'FILL' 0; }

.task-star { color: #9aa8bb; }
.task-star.active { color: #e59b17; }
.task-star:hover,
.task-add-subtask:hover,
.task-move-button:hover,
.task-row-actions > button:hover { background: #edf1f7; color: #475569; }
.task-add-subtask { color: #8291a6; }
.task-add-subtask .material-symbols-rounded,
.task-move-button .material-symbols-rounded { font-size: 20px; }

.task-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}

.task-row-more { display: none !important; }

.task-row.completion-blocked .task-check {
  color: #b7791f;
}

.task-row.completion-blocked .task-check:hover {
  background: var(--tasks-warning-soft);
  color: #92400e;
}

.task-row-body {
  min-width: 0;
  padding: 7px 6px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-title {
  color: #243044;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--tasks-muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.task-meta > span { display: inline-flex; align-items: center; gap: 3px; }
.task-meta .material-symbols-rounded { font-size: 14px; }
.task-due { color: var(--tasks-accent); }
.task-due.overdue { color: var(--tasks-danger); }
.task-subtask-progress { color: #53657e; }
.task-subtask-progress.complete { color: var(--tasks-success); }

.task-row.completed { opacity: .82; }
.task-row.completed .task-title { color: #7b899d; text-decoration: line-through; text-decoration-thickness: 1px; }
.task-row.completed .task-check { color: var(--tasks-success); }

.task-row.task-dragging {
  z-index: 4;
  opacity: .54;
  border-color: #a9bbff;
  background: var(--tasks-accent-soft);
  transform: scale(.99);
}

.task-row.task-drop-before::before,
.task-row.task-drop-after::after {
  content: '';
  position: absolute;
  z-index: 5;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 3px;
  background: var(--tasks-accent);
  box-shadow: 0 0 0 3px rgba(49, 94, 251, .1);
}

.task-row.task-drop-before::before { top: -3px; }
.task-row.task-drop-after::after { bottom: -3px; }
.task-row.task-drop-inside { border-color: #91a8ff; background: var(--tasks-accent-soft); box-shadow: inset 0 0 0 1px rgba(49, 94, 251, .12); }
.tasks-drop-root { outline: 2px dashed #9eb0f8; outline-offset: -6px; background: #f7f9ff; }

.tasks-completed-section {
  margin-top: 15px;
  padding-top: 11px;
  border-top: 1px solid #dfe6ef;
}

.tasks-completed-section > h4 {
  margin: 0 8px 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tasks-completed-toggle {
  min-height: 38px;
  margin: 0 14px 13px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.tasks-completed-toggle:hover { background: #f1f5f9; color: #334155; }
.tasks-completed-toggle.hidden { display: none; }
.tasks-completed-toggle .material-symbols-rounded { font-size: 19px; }

.tasks-empty {
  min-height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  color: var(--tasks-muted);
  padding: 24px;
}

.tasks-empty > .material-symbols-rounded {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: var(--tasks-accent-soft);
  color: var(--tasks-accent);
  font-size: 25px;
}

.tasks-empty h4 { margin: 5px 0 0; color: #334155; font-size: 15px; }
.tasks-empty p { max-width: 380px; margin: 0; font-size: 11.5px; line-height: 1.45; }

.tasks-empty button {
  min-height: 36px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--tasks-accent);
  color: #fff;
  padding: 0 14px;
  font-weight: 780;
  cursor: pointer;
}

.tasks-empty button:hover { background: var(--tasks-accent-hover); }

.tasks-empty-compact { min-height: 190px; }
.tasks-empty-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.tasks-empty .tasks-secondary-action { background: #eef2f7; color: #334155; }
.tasks-empty .tasks-secondary-action:hover { background: #e2e8f0; }

.tasks-section-empty {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 4px;
  border: 1px dashed var(--tasks-line);
  border-radius: 12px;
  background: var(--tasks-panel-muted);
  color: var(--tasks-muted);
  padding: 12px 14px;
  font-size: 12px;
}

.tasks-section-empty .material-symbols-rounded { color: var(--tasks-faint); font-size: 20px; }

.tasks-loading { min-height: 150px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tasks-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--tasks-accent); animation: tasks-pulse 1s infinite ease-in-out; }
.tasks-loading span:nth-child(2) { animation-delay: .14s; }
.tasks-loading span:nth-child(3) { animation-delay: .28s; }

@keyframes tasks-pulse {
  0%, 80%, 100% { transform: scale(.65); opacity: .35; }
  40% { transform: scale(1); opacity: 1; }
}

.task-quick-add {
  position: sticky;
  z-index: 8;
  bottom: max(8px, env(safe-area-inset-bottom));
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 15px;
  border: 1px solid var(--tasks-line-strong);
  border-radius: 17px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 15px 35px rgba(15, 23, 42, .13);
  backdrop-filter: blur(14px);
}

.task-quick-add:focus-within { border-color: #91a8ff; box-shadow: 0 0 0 4px rgba(49, 94, 251, .1), 0 15px 35px rgba(15, 23, 42, .13); }
.task-quick-add > .material-symbols-rounded { color: var(--tasks-accent); }

.task-quick-add input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tasks-ink);
  font: inherit;
}

.task-quick-add input::placeholder { color: #8291a6; }

.tasks-quick-option {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.tasks-quick-option:hover { background: #f1f5f9; color: #334155; }

.tasks-quick-save {
  height: 40px;
  min-width: 65px;
  border: 0;
  border-radius: 11px;
  padding: 0 16px;
  background: var(--tasks-accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tasks-quick-save:hover { background: var(--tasks-accent-hover); }
.tasks-quick-save:disabled { opacity: .55; cursor: default; }

body.tasks-dialog-open { overflow: hidden; }

.task-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(7px);
}

.task-dialog {
  width: min(100%, 570px);
  max-height: min(88dvh, 760px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 22px;
  background: #fff;
  color: var(--tasks-ink);
  box-shadow: 0 30px 80px rgba(15, 23, 42, .3);
  -webkit-overflow-scrolling: touch;
}

#task-dialog-host .task-dialog-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 2;
  min-height: 70px !important;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 10px !important;
  padding: 9px 13px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf1f6 !important;
  background: rgba(255, 255, 255, .96) !important;
  backdrop-filter: blur(14px);
}

.task-dialog-header > div { min-width: 0; }
.task-dialog-header > div p { margin: 0 0 3px; color: var(--tasks-accent); font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.task-dialog-header h3 { margin: 0; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }

.tasks-dialog-save {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  padding: 0 15px;
  background: var(--tasks-accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tasks-dialog-save:disabled { opacity: .55; }
.task-dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 19px; }

.tasks-reconnect-intro {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  border: 1px solid #c9d4ff;
  border-radius: 14px;
  background: var(--tasks-accent-soft);
  padding: 13px;
}

.tasks-reconnect-intro > .material-symbols-rounded {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  color: var(--tasks-accent);
}

.tasks-reconnect-intro strong { color: #243b86; font-size: 13px; }
.tasks-reconnect-intro p { margin: 3px 0 0; color: #526389; font-size: 11.5px; line-height: 1.45; }
.tasks-reconnect-error { margin: -4px 0 0; color: var(--tasks-danger); font-size: 12px; font-weight: 700; }
.tasks-reconnect-error.hidden { display: none; }
.task-field { display: flex; flex-direction: column; gap: 7px; }
.task-field > span { color: #475569; font-size: 10.5px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }

.task-field input,
.task-field select,
.task-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--tasks-line-strong);
  border-radius: 12px;
  background: var(--tasks-panel-muted);
  color: var(--tasks-ink);
  padding: 11px 13px;
  font: inherit;
  outline: none;
}

.task-field textarea { min-height: 100px; resize: vertical; }
.task-field input:focus,
.task-field select:focus,
.task-field textarea:focus { border-color: var(--tasks-accent); background: #fff; box-shadow: 0 0 0 3px rgba(49, 94, 251, .11); }
.task-field small { color: var(--tasks-muted); font-size: 11px; line-height: 1.45; }
.task-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.task-switch {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--tasks-line);
  border-radius: 12px;
  padding: 0 13px;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}

.task-switch input { accent-color: var(--tasks-accent); }
.task-switch .material-symbols-rounded { color: #e59b17; }
.task-editor-subtasks { border-top: 1px solid var(--tasks-line); padding-top: 14px; }
.task-editor-subtasks h4 { margin: 0 0 8px; color: #475569; font-size: 12px; }

.task-editor-subtasks button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  padding: 9px;
  text-align: left;
  cursor: pointer;
}

.task-editor-subtasks button:hover { background: var(--tasks-panel-muted); }
.task-editor-subtasks .material-symbols-rounded { color: #64748b; font-size: 20px; }

.task-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 19px 19px;
}

.tasks-secondary-action,
.tasks-danger-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 11px;
  padding: 0 13px;
  background: #f1f5f9;
  color: #334155;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.tasks-danger-action { background: var(--tasks-danger-soft); color: var(--tasks-danger); }
.tasks-secondary-action .material-symbols-rounded,
.tasks-danger-action .material-symbols-rounded { font-size: 18px; }

.task-list-menu { padding: 10px; }
#task-dialog-host .task-list-menu > header { min-height: 0 !important; position: static !important; display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 14px !important; padding: 5px 4px 12px 12px !important; border: 0 !important; background: transparent !important; }
.task-list-menu h3 { margin: 0; }

.task-list-menu > button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #334155;
  padding: 0 12px;
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.task-list-menu > button:hover { background: var(--tasks-panel-muted); }
.task-list-menu > button.danger { color: var(--tasks-danger); }
.task-list-menu > button:disabled { opacity: .42; cursor: not-allowed; }
.task-actions-menu header > div { min-width: 0; }
.task-actions-menu header h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 840px) {
  .tasks-shell { padding-inline: clamp(20px, 4vw, 46px); }
  .tasks-list-card { min-height: 300px; }
  .tasks-list { padding: 10px 15px 16px; }
  .task-row { min-height: 60px; padding-inline: 7px; }
  .task-row-subtask { margin-left: 34px; }
}

@media (max-width: 720px) {
  .tasks-shell { padding: 10px 10px max(12px, env(safe-area-inset-bottom)); gap: 10px; }
  .tasks-lists-bar { grid-template-columns: 1fr; gap: 2px; }
  .tasks-lists-label { padding-left: 3px; }
  .tasks-list-card { min-height: 220px; border-radius: 18px; box-shadow: 0 10px 26px rgba(15, 23, 42, .065); }
  .tasks-list-card-header { padding: 14px 12px 11px; }
  .tasks-list { padding-inline: 5px; }
  .tasks-feedback { margin-inline: 8px; }
  .task-row { grid-template-columns: 36px minmax(0, 1fr) 34px 31px; padding-inline: 2px; }
  .task-row:has(> .task-drag-handle) { grid-template-columns: 24px 36px minmax(0, 1fr) auto; }
  .task-row-subtask { margin-left: 17px; padding-left: 5px; }
  .task-subtasks { margin-left: 8px; }
  .task-subtasks::before { left: 8px; }
  .task-row-actions > button:not(.task-row-more) { display: none; }
  .task-row-actions > .task-row-more { display: inline-flex !important; }
  .task-quick-add { bottom: max(6px, env(safe-area-inset-bottom)); }
  .task-dialog-overlay { align-items: flex-end; padding: 0; }
  .task-dialog { width: 100%; max-height: min(92dvh, 820px); border-radius: 22px 22px 0 0; }
}

@media (max-width: 430px) {
  .tasks-search-box { min-height: 44px; padding-inline: 12px; }
  .tasks-topbar > .tasks-icon-button { width: 42px; height: 42px; min-width: 42px; flex-basis: 42px; }
  .tasks-list-tab { min-height: 38px; padding: 7px 11px; }
  .tasks-eyebrow { display: none; }
  .tasks-list-card-header h3 { font-size: 1.15rem; }
  .tasks-list-summary { margin-top: 3px; }
  .tasks-header-actions .tasks-icon-button:first-child { display: none; }
  .task-title { font-size: 13.5px; }
  .task-star { display: none; }
  .task-row:not(:has(> .task-drag-handle)) { grid-template-columns: 36px minmax(0, 1fr) 32px; }
  .task-row:not(:has(> .task-drag-handle)) > .task-add-subtask { display: inline-flex; }
  .task-quick-add { padding-left: 12px; }
  .task-quick-add > .material-symbols-rounded { display: none; }
  .tasks-quick-save { min-width: 58px; padding-inline: 13px; }
  .task-field-grid { grid-template-columns: 1fr; }
  .tasks-feedback { grid-template-columns: auto minmax(0, 1fr); }
  .tasks-feedback > button,
  .tasks-feedback-actions { grid-column: 2; justify-self: start; }
}

@media (pointer: coarse) {
  .task-row { min-height: 60px; }
  .task-drag-handle { min-height: 42px; }
  .task-check,
  .task-star,
  .task-add-subtask,
  .task-move-button,
  .task-row-actions > button { min-width: 38px; min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .tasks-icon-button,
  .tasks-list-tab,
  .task-row,
  .tasks-loading span { transition: none; animation: none; }
}

.tasks-icon-button:focus-visible,
.tasks-list-tab:focus-visible,
.task-check:focus-visible,
.task-row-body:focus-visible,
.task-star:focus-visible,
.task-add-subtask:focus-visible,
.task-drag-handle:focus-visible,
.task-move-button:focus-visible,
.tasks-completed-toggle:focus-visible,
.tasks-quick-option:focus-visible,
.tasks-quick-save:focus-visible,
.tasks-dialog-save:focus-visible,
.task-list-menu > button:focus-visible {
  outline: 3px solid rgba(49, 94, 251, .3);
  outline-offset: 2px;
}
