/* ==========================================================================
   JORIE DAILY — checklists.css · Phase 41 · My Checklists ♡
   Loaded by checklists.html only (after style.css / refresh.css / profile.css,
   before notifications.css / design-system.css / winter-arc.css, like every
   feature stylesheet). Presentation only.
   • Colours come only from the four brand colours and the tokens derived from
     them (burgundy #4B1923 · pink #EBC8CD · white · beige #F0E6E1).
   • Frosted surfaces follow the Today overview (Phase 40) recipe.
   • New, gentle animations: owner-tab slide, task check-off, progress fill,
     “everything’s checked” hearts, finalize / restore, rows arriving and
     leaving, empty-state float. All switched off for reduced motion; no
     existing animation is touched.
   Contents
   01. Tokens & page
   02. Owner tabs (Marjorie | Scotty) & Active | Archived
   03. Overview cards
   04. Empty, loading & error states
   05. Editor sheet & header
   06. Category picker, share switch, badges
   07. Progress & celebration
   08. Tasks (rows, check, handle, drag)
   09. Add task, actions bar, notices
   10. Toast & dialogs
   11. Small screens
   12. Reduced motion
   ========================================================================== */

/* ---------- 01. TOKENS & PAGE -------------------------------------------- */
.cl-page {
  --cl-glass: radial-gradient(90% 120% at 0% 0%, rgb(var(--white-rgb) / 0.72), transparent 60%),
              linear-gradient(135deg, rgb(var(--white-rgb) / 0.55), rgb(var(--pink-rgb) / 0.26));
  --cl-glass-border: rgb(var(--white-rgb) / 0.75);
  --cl-glass-hi: 0 1px 0 rgb(var(--white-rgb) / 0.85) inset;
  --cl-tint: rgb(var(--pink-rgb) / 0.5);
  --cl-tint-soft: rgb(var(--pink-rgb) / 0.26);
  --cl-done: var(--ink-3);
  --cl-radius: var(--jd-radius-card, var(--radius-lg));
  --cl-inner: var(--jd-radius-inner, var(--radius-md));
  --cl-ease: var(--jd-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  --cl-spring: var(--jd-spring, cubic-bezier(0.34, 1.4, 0.64, 1));
}
:root[data-theme="dark"] .cl-page {
  --cl-glass: radial-gradient(90% 120% at 0% 0%, rgb(var(--pink-rgb) / 0.09), transparent 60%),
              linear-gradient(135deg, rgb(var(--pink-rgb) / 0.07), rgb(var(--pink-rgb) / 0.03));
  --cl-glass-border: rgb(var(--pink-rgb) / 0.13);
  --cl-glass-hi: 0 1px 0 rgb(var(--pink-rgb) / 0.07) inset;
  --cl-tint: rgb(var(--pink-rgb) / 0.16);
  --cl-tint-soft: rgb(var(--pink-rgb) / 0.08);
}
.cl-app { display: grid; gap: clamp(16px, 2vw, 22px); min-width: 0; }
.cl-app .icon { width: 18px; height: 18px; }
.cl-page .card.cl-card,
.cl-page .card.cl-sheet,
.cl-page .card.cl-empty,
.cl-page .card.cl-draftbar {
  background: var(--cl-glass), var(--surface);
  border: 1px solid var(--cl-glass-border);
  box-shadow: var(--cl-glass-hi), var(--shadow-sm);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .cl-page .card.cl-card,
  .cl-page .card.cl-sheet,
  .cl-page .card.cl-empty {
    background: var(--cl-glass), rgb(var(--white-rgb) / 0.5);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
    backdrop-filter: blur(14px) saturate(1.08);
  }
  :root[data-theme="dark"] .cl-page .card.cl-card,
  :root[data-theme="dark"] .cl-page .card.cl-sheet,
  :root[data-theme="dark"] .cl-page .card.cl-empty { background: var(--cl-glass), rgb(var(--burgundy-rgb) / 0.55); }
}

/* ---------- 02. OWNER TABS & ACTIVE | ARCHIVED -------------------------- */
.cl-owner {
  --idx: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 440px);
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--cl-glass);
  border: 1px solid var(--cl-glass-border);
  box-shadow: var(--cl-glass-hi), var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
}
.cl-owner__ind {
  position: absolute;
  top: 5px; bottom: 5px; left: 5px;
  width: calc((100% - 10px) / 2);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  box-shadow: 0 10px 22px -14px rgb(var(--burgundy-rgb) / 0.8);
  transform: translateX(calc(100% * var(--idx)));
  transition: transform 520ms var(--cl-ease);
}
.cl-owner__tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 320ms ease;
}
.cl-owner__tab[aria-selected="true"] { color: var(--btn-ink); }
.cl-owner__tab:hover:not([aria-selected="true"]) { color: var(--ink); }
.cl-owner__tab:focus-visible { outline-offset: -3px; }
.cl-owner__avatar {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgb(var(--pink-rgb) / 0.7);
  color: var(--burgundy);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  transition: background-color 320ms ease, transform 420ms var(--cl-spring);
}
.cl-owner__tab[aria-selected="true"] .cl-owner__avatar { background: var(--btn-ink); color: var(--btn-bg); transform: scale(1.06); }
.cl-owner__you {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgb(var(--pink-rgb) / 0.45);
  color: var(--burgundy);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cl-owner__tab[aria-selected="true"] .cl-owner__you { background: rgb(var(--beige-rgb) / 0.2); color: var(--btn-ink); }
:root[data-theme="dark"] .cl-owner__tab[aria-selected="true"] .cl-owner__you { background: rgb(var(--burgundy-rgb) / 0.14); }

.cl-panel { display: grid; gap: clamp(14px, 1.8vw, 18px); min-width: 0; }
.cl-panel.is-in-next { animation: clPanelNext 460ms var(--cl-ease) both; }
.cl-panel.is-in-prev { animation: clPanelPrev 460ms var(--cl-ease) both; }
.cl-panel.is-in-fade { animation: clFadeUp 380ms var(--cl-ease) both; }
@keyframes clPanelNext { from { opacity: 0; transform: translateX(18px); } }
@keyframes clPanelPrev { from { opacity: 0; transform: translateX(-18px); } }
@keyframes clFadeUp { from { opacity: 0; transform: translateY(8px); } }

.cl-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cl-seg {
  --idx: 0;
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgb(var(--pink-rgb) / 0.22);
  border: 1px solid var(--line);
}
.cl-seg__ind {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / 2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 6px 16px -10px rgb(var(--burgundy-rgb) / 0.55), 0 0 0 1px var(--line);
  transform: translateX(calc(100% * var(--idx)));
  transition: transform 420ms var(--cl-ease);
}
.cl-seg__btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  min-width: 118px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.cl-seg__btn[aria-pressed="true"] { color: var(--ink); }
.cl-seg__n {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgb(var(--pink-rgb) / 0.5);
  color: var(--ink);
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .cl-seg__n { background: rgb(var(--pink-rgb) / 0.16); }
.cl-new .icon { width: 16px; height: 16px; }
.cl-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--cl-inner);
  background: var(--cl-tint-soft);
  border: 1px dashed var(--line-2);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.cl-note .icon { flex: none; margin-top: 1px; color: var(--ink); }

/* ---------- 03. OVERVIEW CARDS ------------------------------------------ */
.cl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: clamp(12px, 1.6vw, 18px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cl-cell { display: grid; min-width: 0; animation: clFadeUp 520ms var(--cl-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.cl-grid.is-static .cl-cell, .cl-grid.is-static .cl-progress__fill { animation: none; }
.cl-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  min-width: 0;
  padding: clamp(16px, 2vw, 20px);
  border-radius: var(--cl-radius);
  transition: transform 420ms var(--cl-ease), box-shadow 420ms var(--cl-ease), border-color 260ms ease;
}
@media (hover: hover) {
  .cl-card:hover { transform: translateY(-4px); box-shadow: var(--cl-glass-hi), var(--shadow-lg); }
  .cl-card:hover .cl-card__go { gap: 9px; color: var(--ink); }
}
.cl-card:has(.cl-card__open:focus-visible) { box-shadow: var(--jd-ring, 0 0 0 3px var(--focus-ring)); }
.cl-card__open {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}
.cl-card__open:focus-visible { outline: none; }
.cl-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cl-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1rem + 0.45vw, 1.3rem);
  font-weight: 700;
  font-variation-settings: "SOFT" 100;
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.cl-card__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-xs);
}
.cl-card__count strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cl-card__date { color: var(--ink-3); }
.cl-card__go {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: gap 320ms var(--cl-ease), color 200ms ease;
}
.cl-card__go .icon { width: 14px; height: 14px; }
.icon--flip { transform: scaleX(-1); }
.cl-card--archived .cl-card__title { color: var(--ink-2); }
.cl-card.is-flash { animation: clFlash 1.6s var(--cl-ease) 200ms both; }
@keyframes clFlash { 0% { box-shadow: 0 0 0 0 rgb(var(--pink-rgb) / 0.9); } 40% { box-shadow: 0 0 0 8px rgb(var(--pink-rgb) / 0.55); } 100% { box-shadow: var(--cl-glass-hi), var(--shadow-sm); } }

/* ---------- 04. EMPTY, LOADING & ERROR STATES --------------------------- */
.cl-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(28px, 5vw, 48px) var(--pad-card);
  text-align: center;
  border-radius: var(--cl-radius);
}
.cl-empty__art {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--cl-tint);
  color: var(--ink);
  animation: clFloatIn 760ms var(--cl-spring) both, clFloat 5.5s var(--ease-in-out, ease-in-out) 900ms infinite;
}
.cl-empty__art .icon { width: 28px; height: 28px; }
@keyframes clFloatIn { from { opacity: 0; transform: translateY(10px) scale(0.85); } }
@keyframes clFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.cl-empty__title {
  margin: 0;
  max-width: 28ch;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  text-wrap: balance;
}
.cl-empty__text { margin: 0 0 6px; max-width: 46ch; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; }
.cl-state {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 18px 20px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.cl-state__dot {
  flex: none;
  width: 10px; height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: clPulse 1.4s ease-in-out infinite;
}
@keyframes clPulse { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
.cl-state--error { color: var(--ink); background: var(--ds-attn-bg, rgb(var(--pink-rgb) / 0.45)); }
.cl-state--error > .icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.cl-state__title { margin: 0 0 2px; font-weight: 700; color: var(--ink); }
.cl-state__text { margin: 0 0 10px; color: var(--ink-2); }
.cl-state__row { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-draftbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 18px;
  border-radius: var(--cl-inner);
  border-style: dashed !important;
}
.cl-draftbar > .icon { flex: none; }
.cl-draftbar p { flex: 1 1 260px; margin: 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; }
.cl-draftbar strong { color: var(--ink); }
.cl-draftbar__actions { display: flex; gap: 8px; }

/* ---------- 05. EDITOR SHEET & HEADER ----------------------------------- */
.cl-editor { display: grid; gap: 12px; width: min(100%, 880px); margin-inline: auto; animation: clFadeUp 420ms var(--cl-ease) both; min-width: 0; }
.cl-editor__nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.cl-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 14px 0 8px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.cl-back:hover { background: rgb(var(--pink-rgb) / 0.35); }
.cl-back .icon { transition: transform 320ms var(--cl-ease); }
.cl-back:hover .icon { transform: translateX(-3px); }
.cl-editor__crumb { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.cl-sheet {
  position: relative;
  display: grid;
  gap: clamp(14px, 1.8vw, 20px);
  padding: clamp(18px, 3vw, 34px);
  padding-bottom: 0;
  border-radius: var(--cl-radius);
  min-width: 0;
}
.cl-sheet.is-finalized { animation: clFinal 900ms var(--cl-ease) both; }
.cl-sheet.is-restored { animation: clRestore 700ms var(--cl-spring) both; }
@keyframes clFinal {
  0% { transform: scale(1); filter: saturate(1); }
  35% { transform: scale(0.975) translateY(6px); filter: saturate(0.7); }
  100% { transform: none; filter: none; }
}
@keyframes clRestore { from { opacity: 0.4; transform: translateY(14px) scale(0.98); } }
.cl-sheet:focus { outline: none; }
.cl-sheet__head { display: grid; gap: 14px; min-width: 0; }
.cl-sheet__fields { display: grid; gap: 16px; min-width: 0; }
.cl-titlefield .input.cl-title-input {
  min-height: 52px;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cl-req { color: var(--ink-3); }
.cl-sheet__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.cl-sheet__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.6rem);
  font-weight: 800;
  font-variation-settings: "SOFT" 100;
  letter-spacing: -0.035em;
  line-height: 1.04;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.cl-sheet__title:focus { outline: none; }
.cl-sheet__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.cl-sheet__meta strong { color: var(--ink); }
.cl-final { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.cl-final .icon { width: 16px; height: 16px; }

/* ---------- 06. CATEGORY PICKER, SHARE SWITCH, BADGES ------------------- */
.cl-cat {
  --cl-cat-mix: 46%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 11px 5px 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--pink) var(--cl-cat-mix), transparent);
  color: var(--burgundy);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cl-cat > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-cat .icon { width: 16px; height: 16px; }
.cl-cat--sm { padding: 4px 10px 4px 7px; }
:root[data-theme="dark"] .cl-cat { background: color-mix(in srgb, var(--pink) calc(var(--cl-cat-mix) * 0.38), transparent); color: var(--beige); }
/* Subtle distinction between categories: the same pink, a different depth. */
.cl-cat[data-cat="diet-workout"]   { --cl-cat-mix: 58%; }
.cl-cat[data-cat="graphic-design"] { --cl-cat-mix: 36%; }
.cl-cat[data-cat="web-design"]     { --cl-cat-mix: 30%; }
.cl-cat[data-cat="german"]         { --cl-cat-mix: 52%; }
.cl-cat[data-cat="illustration"]   { --cl-cat-mix: 42%; }
.cl-cat[data-cat="reading"]        { --cl-cat-mix: 48%; }
.cl-cat[data-cat="sukie"]          { --cl-cat-mix: 64%; }
.cl-cat[data-cat="travel"]         { --cl-cat-mix: 40%; }
.cl-cat[data-cat="cleaning"]       { --cl-cat-mix: 34%; }
.cl-cat[data-cat="other"]          { --cl-cat-mix: 26%; }

.cl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cl-badge .icon { width: 14px; height: 14px; }
.cl-badge--shared { border-color: transparent; background: var(--ink); color: var(--bg); }
.cl-badge--archived { background: var(--cl-tint-soft); }

.cl-catrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cl-catrow .field__label { margin: 0; }
.cl-cats { margin: 0; padding: 0; border: 0; min-width: 0; }
.cl-cats legend { padding: 0; margin-bottom: 8px; }
.cl-cats__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 8px; }
.cl-catopt { position: relative; display: grid; min-width: 0; }
.cl-catopt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cl-catopt__face {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: var(--cl-inner);
  border: 1.5px solid var(--line-2);
  background: rgb(var(--white-rgb) / 0.4);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.25;
  transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease, transform 260ms var(--cl-spring), box-shadow 260ms ease;
}
:root[data-theme="dark"] .cl-catopt__face { background: rgb(var(--pink-rgb) / 0.04); }
.cl-catopt__face .icon { width: 18px; height: 18px; flex: none; }
.cl-catopt:hover .cl-catopt__face { border-color: var(--ink-3); }
.cl-catopt input:checked + .cl-catopt__face {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-ink);
  box-shadow: 0 10px 20px -14px rgb(var(--burgundy-rgb) / 0.8);
  animation: jdSettle 360ms var(--cl-spring);
}
.cl-catopt input:focus-visible + .cl-catopt__face { box-shadow: var(--jd-ring, 0 0 0 3px var(--focus-ring)); }
.cl-catopt input:disabled + .cl-catopt__face { opacity: 0.6; }

.cl-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.cl-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 14px 0 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.cl-switch:hover:not(:disabled) { border-color: var(--ink); }
.cl-switch__track {
  position: relative;
  width: 44px; height: 26px;
  border-radius: var(--radius-pill);
  background: rgb(var(--pink-rgb) / 0.55);
  transition: background-color 280ms ease;
}
.cl-switch__knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px -2px rgb(var(--burgundy-rgb) / 0.6);
  transition: transform 420ms var(--cl-spring), background-color 280ms ease;
}
.cl-switch[aria-checked="true"] .cl-switch__track { background: var(--btn-bg); }
.cl-switch[aria-checked="true"] .cl-switch__knob { transform: translateX(18px); background: var(--btn-ink); }
.cl-switch:disabled { opacity: 0.55; }
.cl-share__hint { margin: 0; color: var(--ink-3); font-size: var(--fs-xs); }

/* ---------- 07. PROGRESS & CELEBRATION ---------------------------------- */
.cl-progress {
  position: relative;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgb(var(--pink-rgb) / 0.42);
  overflow: hidden;
}
:root[data-theme="dark"] .cl-progress { background: rgb(var(--pink-rgb) / 0.14); }
.cl-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(var(--burgundy-rgb) / 0.55), var(--burgundy));
  transition: width 700ms var(--cl-ease);
}
:root[data-theme="dark"] .cl-progress__fill { background: linear-gradient(90deg, rgb(var(--pink-rgb) / 0.55), var(--pink)); }
.cl-cell .cl-progress__fill { animation: clGrow 900ms var(--cl-ease) both; animation-delay: calc(var(--i, 0) * 45ms + 160ms); }
@keyframes clGrow { from { width: 0; } }
.cl-progress.is-full .cl-progress__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgb(var(--white-rgb) / 0.45) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: clShine 2.4s ease-in-out 500ms 2;
}
@keyframes clShine { to { transform: translateX(100%); } }

.cl-progressbox { position: relative; display: grid; gap: 8px; }
.cl-progressbox .cl-progress { height: 10px; }
.cl-progressbox__text { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
.cl-progressbox__text strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cl-progressbox__yay { color: var(--ink); font-weight: 600; }
.cl-burst { position: absolute; right: 6px; top: -6px; width: 1px; height: 1px; pointer-events: none; }
.cl-burst i {
  position: absolute;
  left: 0; top: 0;
  font-style: normal;
  font-size: 15px;
  color: var(--ink);
  opacity: 0;
}
.cl-progressbox.is-celebrating .cl-burst i { animation: clHeart 1300ms var(--cl-ease) both; }
.cl-progressbox.is-celebrating .cl-burst i:nth-child(1) { --x: -38px; --y: -26px; animation-delay: 0ms; }
.cl-progressbox.is-celebrating .cl-burst i:nth-child(2) { --x: -12px; --y: -40px; animation-delay: 80ms; font-size: 12px; }
.cl-progressbox.is-celebrating .cl-burst i:nth-child(3) { --x: 10px; --y: -30px; animation-delay: 140ms; }
.cl-progressbox.is-celebrating .cl-burst i:nth-child(4) { --x: -60px; --y: -14px; animation-delay: 200ms; font-size: 11px; }
.cl-progressbox.is-celebrating .cl-burst i:nth-child(5) { --x: -26px; --y: -52px; animation-delay: 260ms; font-size: 10px; }
@keyframes clHeart {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.15); }
}

/* ---------- 08. TASKS ----------------------------------------------------- */
.cl-items { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.cl-items.is-sorting { user-select: none; }
.cl-item {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 4px 6px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  transition: background-color 260ms ease, box-shadow 260ms ease, opacity 200ms ease;
}
.cl-item:hover, .cl-item:focus-within { background: rgb(var(--pink-rgb) / 0.16); }
:root[data-theme="dark"] .cl-item:hover, :root[data-theme="dark"] .cl-item:focus-within { background: rgb(var(--pink-rgb) / 0.05); }
.cl-item.is-new::before {
  content: "";
  position: absolute;
  left: -2px; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--pink);
}
.cl-item.is-enter { animation: clRowIn 420ms var(--cl-ease) both; }
@keyframes clRowIn { from { opacity: 0; transform: translateY(-6px); background: rgb(var(--pink-rgb) / 0.5); } }
.cl-item.is-leaving { opacity: 0; transform: translateX(14px); transition: opacity 180ms ease, transform 180ms ease; }
.cl-item.is-remote { animation: clRemote 1.8s ease both; }
@keyframes clRemote { 0%, 30% { background: rgb(var(--pink-rgb) / 0.55); } 100% { background: transparent; } }
.cl-item.is-dragging {
  z-index: 5;
  background: var(--surface);
  border-radius: var(--cl-inner);
  box-shadow: 0 18px 36px -18px rgb(var(--burgundy-rgb) / 0.6), 0 0 0 1px var(--line);
  transition: none;
}
.cl-item.is-empty .cl-text { box-shadow: inset 0 -1.5px 0 var(--ink-3); }

.cl-handle,
.cl-del,
.cl-mini {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: var(--tap);
  border-radius: 12px;
  color: var(--ink-3);
}
.cl-handle { width: 26px; cursor: grab; touch-action: none; }
.cl-handle .icon { width: 18px; height: 18px; }
.cl-handle .icon--dots circle { fill: currentColor; stroke: none; }
.cl-item.is-dragging .cl-handle { cursor: grabbing; color: var(--ink); }
.cl-handle:hover, .cl-del:hover, .cl-mini:hover:not(:disabled) { color: var(--ink); background: rgb(var(--pink-rgb) / 0.35); }
.cl-del .icon { width: 17px; height: 17px; }
.cl-mini { width: 30px; }
.cl-mini .icon { width: 16px; height: 16px; }
.cl-mini:disabled { opacity: 0.3; cursor: default; }
.cl-item__moves { display: inline-flex; opacity: 0; transition: opacity 200ms ease; }
.cl-item:hover .cl-item__moves, .cl-item:focus-within .cl-item__moves { opacity: 1; }
.cl-handle:disabled, .cl-del:disabled { opacity: 0.4; cursor: default; }

.cl-check {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin: 0 -4px;
  border-radius: 50%;
}
.cl-check .icon {
  width: 26px; height: 26px;
  padding: 3px;
  border-radius: 9px;
  border: 1.75px solid var(--ink-3);
  background: rgb(var(--white-rgb) / 0.55);
  color: transparent;
  stroke-width: 2.4;
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease;
}
:root[data-theme="dark"] .cl-check:not([aria-checked="true"]):not(.is-static) .icon,
:root[data-theme="dark"] .cl-item--ro:not(.is-done) .cl-check .icon { background: transparent; }
.cl-check .cl-tick { stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 360ms var(--cl-ease) 60ms; }
.cl-check:hover .icon { border-color: var(--ink); }
.cl-check[aria-checked="true"] .icon,
.cl-item--ro.is-done .cl-check .icon { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.cl-check[aria-checked="true"] .cl-tick,
.cl-item--ro.is-done .cl-tick { stroke-dashoffset: 0; }
.cl-check.is-pop .icon { animation: jdSettle 420ms var(--cl-spring); }
.cl-check.is-static { cursor: default; }
.cl-check:disabled { cursor: default; }

.cl-text {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin: 0;
  padding: 11px 8px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-base);
  line-height: 1.45;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-decoration-line: none;
  text-decoration-thickness: 1.5px;
  text-decoration-color: transparent;
  transition: color 320ms ease, text-decoration-color 320ms ease, background-color 200ms ease, box-shadow 200ms ease;
}
.cl-text:focus { outline: none; background: rgb(var(--white-rgb) / 0.7); box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px var(--focus-halo); }
:root[data-theme="dark"] .cl-text:focus { background: rgb(var(--pink-rgb) / 0.06); }
.cl-item.is-done .cl-text { color: var(--cl-done); text-decoration-line: line-through; text-decoration-color: rgb(var(--burgundy-rgb) / 0.45); }
:root[data-theme="dark"] .cl-item.is-done .cl-text { text-decoration-color: rgb(var(--pink-rgb) / 0.45); }
.cl-text[readonly] { cursor: default; }
.cl-text--ro { padding: 11px 8px 9px; white-space: pre-wrap; }
.cl-item--ro { grid-template-columns: auto minmax(0, 1fr); padding-left: 6px; }
.cl-items__empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 12px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--cl-inner);
  color: var(--ink-2);
  text-align: center;
  font-size: var(--fs-sm);
}
.cl-items__empty p { margin: 0; }
.cl-items__empty .icon { width: 26px; height: 26px; color: var(--ink-3); animation: clFloatIn 600ms var(--cl-spring) both; }

/* ---------- 09. ADD TASK, ACTIONS BAR, NOTICES ---------------------------- */
.cl-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px dashed var(--line-2);
  background: rgb(var(--white-rgb) / 0.35);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}
:root[data-theme="dark"] .cl-add { background: rgb(var(--pink-rgb) / 0.03); }
.cl-add:focus-within { border-style: solid; border-color: var(--ink); box-shadow: 0 0 0 4px var(--focus-halo); }
.cl-add__plus { display: grid; place-items: center; color: var(--ink-3); }
.cl-add__input.input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.cl-add__input.input:focus { box-shadow: none; background: transparent; }
.cl-add__input.is-shake { animation: clShake 380ms ease; }
@keyframes clShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.cl-add__btn { flex: none; }
.cl-add__err { margin: -6px 0 0 14px; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }

.cl-savebar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 calc(-1 * clamp(18px, 3vw, 34px));
  padding: 12px clamp(18px, 3vw, 34px) calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(var(--beige-rgb) / 0.8), rgb(var(--beige-rgb) / 0.94));
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
}
:root[data-theme="dark"] .cl-savebar { background: linear-gradient(180deg, rgb(var(--burgundy-rgb) / 0.8), rgb(var(--burgundy-rgb) / 0.94)); }
.cl-savebar .btn { gap: 8px; }
.cl-more { display: grid; gap: 10px; padding-bottom: clamp(18px, 3vw, 30px); }
.cl-more__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cl-more .btn { gap: 7px; }
.cl-savestate { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--fs-sm); }
.cl-savestate.is-flash { animation: jdSettle 420ms var(--cl-spring); }
.cl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ink-3); }
.cl-dot--ok { background: var(--ink); box-shadow: 0 0 0 3px rgb(var(--pink-rgb) / 0.6); }
.cl-dot--draft { background: transparent; border: 2px solid var(--ink); }
.cl-dot--busy { background: var(--accent); animation: clPulse 1s ease-in-out infinite; }
.cl-dot--err { background: var(--ink); animation: clPulse 1.4s ease-in-out infinite; }
.cl-more__hint { margin: 0; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.45; }
.cl-finalize[aria-disabled="true"] { opacity: 0.55; }
.cl-finalize.is-ready { border-color: var(--ink); background: rgb(var(--pink-rgb) / 0.45); animation: jdSettle 520ms var(--cl-spring); }
.cl-finalize.is-ready .icon { color: var(--ink); animation: jdHeartBeat 2.2s ease-in-out 600ms 2; }
.cl-danger {
  border: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent);
  background: transparent;
  color: var(--ink);
  gap: 7px;
}
.cl-danger:hover:not(:disabled) { background: var(--ink); border-style: solid; border-color: var(--ink); color: var(--bg); }
.cl-danger--solid { border-style: solid; border-color: var(--ink); background: var(--ink); color: var(--bg); }
.cl-danger--solid:hover { box-shadow: 0 16px 30px -16px rgb(var(--burgundy-rgb) / 0.7); }
.cl-err {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ds-attn-bg, rgb(var(--pink-rgb) / 0.45));
  color: var(--ink);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.cl-err[hidden] { display: none; }
.cl-err p { margin: 0; }
.cl-err .icon { flex: none; margin-top: 1px; }
.cl-err:focus { outline: none; box-shadow: 0 0 0 2px var(--ink); }

.cl-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  padding: 12px 16px;
  border-radius: var(--cl-inner);
  background: var(--cl-tint-soft);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  animation: clFadeUp 360ms var(--cl-ease) both;
}
.cl-notice > .icon { flex: none; margin-top: 1px; color: var(--ink); }
.cl-notice p { margin: 0; flex: 1 1 240px; }
.cl-notice > div { flex: 1 1 240px; display: grid; gap: 6px; }
.cl-notice ul { margin: 0; padding-left: 18px; }
.cl-notice strong { color: var(--ink); }
.cl-notice--conflict { background: var(--ds-attn-bg, rgb(var(--pink-rgb) / 0.45)); border-style: dashed; }
.cl-notice--conflict:focus { outline: none; }
.cl-link {
  justify-self: start;
  padding: 0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 10. TOAST & DIALOGS ------------------------------------------ */
.cl-toast {
  position: fixed;
  left: 50%;
  bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 6px 12px;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 10px 10px 18px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 20px 40px -18px rgb(var(--burgundy-rgb) / 0.75);
  font-size: var(--fs-sm);
  transform: translateX(-50%);
}
.cl-toast[hidden] { display: none; }
.cl-toast.is-in { animation: clToastIn 420ms var(--cl-spring) both; }
@keyframes clToastIn { from { opacity: 0; transform: translate(-50%, 14px) scale(0.96); } }
.cl-toast p { margin: 0; line-height: 1.4; }
.cl-toast__undo {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--pink);
  color: var(--burgundy);
  font-weight: 700;
}
.cl-toast__x { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1; opacity: 0.75; }
.cl-toast__x:hover { opacity: 1; background: rgb(var(--beige-rgb) / 0.12); }
.cl-confirm .confirm__inner { max-width: 100%; }
.cl-confirm .confirm__actions .btn { gap: 8px; }
.cl-confirm__note { font-size: var(--fs-sm); color: var(--ink-3); }
.cl-confirm--danger .confirm__icon { background: var(--ink); color: var(--bg); }

/* ---------- 11. SMALL SCREENS --------------------------------------------- */
@media (min-width: 900px) {
  /* Desktop: a quiet corner, clear of the sheet's buttons. */
  .cl-toast { left: auto; right: 28px; bottom: 28px; transform: none; }
  .cl-toast.is-in { animation-name: clToastInCorner; }
  @keyframes clToastInCorner { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
}
@media (max-width: 899px) {
  .cl-toast { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 599px) {
  .cl-owner { width: 100%; }
  .cl-toolbar { gap: 10px; }
  .cl-seg { flex: 1 1 auto; }
  .cl-seg__btn { min-width: 0; padding: 0 10px; }
  .cl-new { flex: 1 1 auto; }
  .cl-cats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-catopt__face { min-height: 44px; padding: 7px 9px; font-size: var(--fs-xs); gap: 6px; }
  .cl-item { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 2px 2px; }
  .cl-item__moves { display: none; grid-column: 3 / -1; justify-self: end; opacity: 1; }
  .cl-item:focus-within .cl-item__moves { display: inline-flex; }
  .cl-del { width: 36px; }
  .cl-text { padding-inline: 6px; }
  .cl-savebar { gap: 6px 12px; }
  .cl-savebar .cl-save, .cl-savebar--ro .btn { flex: 1 1 auto; }
  .cl-savestate { flex: 1 1 100%; justify-content: center; font-size: var(--fs-xs); }
  .cl-more__row .btn { flex: 1 1 calc(50% - 6px); padding-inline: 10px; }
  .cl-more__row .cl-finalize { flex-basis: 100%; }
  .cl-share { align-items: flex-start; }
  .cl-confirm .confirm__actions .btn { flex: 1 1 100%; }
  .cl-toast { width: calc(100vw - 32px); }
}
@media (max-width: 340px) {
  .cl-owner__you { display: none; }
  .cl-cats__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 12. REDUCED MOTION -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cl-owner__ind, .cl-seg__ind, .cl-progress__fill, .cl-switch__knob, .cl-card, .cl-check .cl-tick, .cl-text { transition: none; }
  .cl-panel.is-in-next, .cl-panel.is-in-prev, .cl-panel.is-in-fade, .cl-cell, .cl-cell .cl-progress__fill, .cl-editor,
  .cl-empty__art, .cl-items__empty .icon, .cl-item.is-enter, .cl-item.is-remote, .cl-check.is-pop .icon, .cl-sheet.is-finalized, .cl-sheet.is-restored,
  .cl-notice, .cl-toast.is-in, .cl-card.is-flash, .cl-finalize.is-ready, .cl-finalize.is-ready .icon, .cl-savestate.is-flash,
  .cl-add__input.is-shake, .cl-progress.is-full .cl-progress__fill::after, .cl-state__dot, .cl-dot--busy, .cl-dot--err,
  .cl-catopt input:checked + .cl-catopt__face { animation: none; }
  .cl-progressbox.is-celebrating .cl-burst i { animation: none; opacity: 0; }
  .cl-item.is-leaving { transition: none; }
  @media (hover: hover) { .cl-card:hover { transform: none; } }
}
@media print {
  .cl-savebar, .cl-more, .cl-add, .cl-toast, .cl-handle, .cl-del, .cl-item__moves { display: none !important; }
}
