.checklist {
  --checklist-tone: 87, 189, 241;
  --checklist-lead: 32px;
  --checklist-gap: 12px;
  --checklist-line: 20px;
  --checklist-space: 20px;
  width: 100%;
  box-sizing: border-box;
  padding: 20px 22px 22px;
  border-radius: var(--radius-panel);
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(var(--checklist-tone), 0.16), transparent 60%),
    rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), var(--memory-inner-shadow);
}

.checklist[data-tone="lilac"] { --checklist-tone: 201, 134, 237; }

.checklist[data-tone="coral"] { --checklist-tone: 255, 161, 111; }

.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--checklist-gap);
}

.checklist-title {
  display: grid;
  grid-template-columns: var(--checklist-lead) minmax(0, 1fr);
  column-gap: var(--checklist-gap);
  align-items: center;
  min-width: 0;
}

.checklist-mark {
  display: grid;
  place-items: center;
  width: var(--checklist-lead);
  height: var(--checklist-lead);
  border-radius: 10px;
  background: var(--mesh-icon-sky);
  box-shadow: var(--modal-icon-raised-shadow);
  color: #FFFFFF;
}

.checklist[data-tone="lilac"] .checklist-mark { background: var(--mesh-icon-lilac); }

.checklist[data-tone="coral"] .checklist-mark { background: var(--mesh-icon-coral); }

.checklist-mark > svg { width: 16px; height: 16px; fill: currentColor; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12)); }

.checklist-mark > .icon { width: 17px; height: 17px; background: currentColor; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12)); }

.checklist[data-brand] { --checklist-tone: var(--brand-rgb); }

.checklist[data-brand] .checklist-mark { background: var(--brand-mesh); }

.checklist-label { display: grid; gap: 1px; min-width: 0; }

.checklist-label > strong {
  color: var(--section-heading-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.checklist-label > span {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.checklist-time {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--section-heading-surface);
  box-shadow: var(--section-heading-shadow);
  color: var(--section-heading-ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

@property --checklist-fill {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.checklist-progress {
  --checklist-fill: var(--checklist-progress, 0);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.7) 70%, #FFFFFF) 0 0 / calc(var(--checklist-fill) * 100%) 100% no-repeat,
    linear-gradient(rgba(52, 71, 97, 0.05), rgba(52, 71, 97, 0.05)),
    var(--section-heading-surface);
  animation: checklist-progress-fill 1.1s var(--ease-expo) 0.25s both;
}

.checklist-progress[data-state="complete"] {
  gap: 6px;
  background: var(--done-surface);
  padding-left: 10px;
  color: var(--done-ink);
}

.checklist-progress[data-state="complete"] > .icon { width: 14px; height: 14px; background: currentColor; }

@keyframes checklist-progress-fill {
  from { --checklist-fill: 0; }
}

.checklist-time > .icon { width: 12px; height: 12px; background: currentColor; opacity: 0.8; }

.checklist-items {
  display: grid;
  gap: var(--checklist-space);
  margin: var(--checklist-space) 0 0;
  padding: 0;
  list-style: none;
}

.checklist-items > li {
  display: grid;
  grid-template-columns: var(--checklist-lead) minmax(0, 1fr);
  column-gap: var(--checklist-gap);
  align-items: start;
}

.checklist-box.o-checkbox-indicator {
  --checkbox-side: 24px;
  justify-self: center;
  margin-top: calc((var(--checklist-line) - var(--checkbox-side)) / 2);
  border-radius: 50%;
}

.checklist-number {
  position: absolute;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s ease;
}

.checklist-box[data-checked="true"] > .checklist-number { opacity: 0; }

.checklist-items > li[data-denied="true"] .checklist-box > svg {
  stroke: var(--ink-faint);
  opacity: 1;
  transform: none;
}

.checklist-items > li[data-denied="true"] .checklist-text > strong { color: var(--ink-soft); }

.checklist-text { display: grid; gap: 2px; min-width: 0; }

.checklist-text > strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: var(--checklist-line);
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.checklist-text > span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
}

.checklist-items > li[data-checked="true"] .checklist-text > strong { color: var(--ink-soft); }

@media (max-width: 560px) {
  .checklist { padding: 18px; }

  .checklist-time { padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .checklist-number, .checklist-text > strong { transition: none; }
}

.checklist-items > li[data-access] .checklist-text { min-height: calc(var(--checklist-line) + 2px + 36px); align-content: start; }

.checklist-box > .icon[data-access] { position: relative; width: 12px; height: 12px; background: var(--on-ink); }

.checklist-items > li[data-access="read"] .checklist-box {
  --checkbox-accent: #3274D5;
  --checkbox-gradient: var(--mesh-icon-sky);
  --checkbox-rim: inset 0 0 0 0.5px rgba(255, 255, 255, 0.45);
}

.checklist-items > li[data-access="write"] .checklist-box {
  --checkbox-accent: #7959D6;
  --checkbox-gradient: var(--mesh-icon-lilac);
  --checkbox-rim: inset 0 0 0 0.5px rgba(255, 255, 255, 0.45);
}

@property --checklist-fade {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.checklist-items[data-folded] {
  --checklist-bleed: 8px;
  --checklist-fade: 0px;
  position: relative;
  max-height: var(--checklist-full, none);
  margin: calc(var(--checklist-space) - var(--checklist-bleed)) calc(var(--checklist-bleed) * -1) 0;
  padding: var(--checklist-bleed) var(--checklist-bleed) 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--checklist-fade)), rgba(0, 0, 0, 0.88) calc(100% - var(--checklist-fade) * 0.65), rgba(0, 0, 0, 0.3) calc(100% - var(--checklist-fade) * 0.25), transparent 100%);
  mask-image: linear-gradient(180deg, #000 calc(100% - var(--checklist-fade)), rgba(0, 0, 0, 0.88) calc(100% - var(--checklist-fade) * 0.65), rgba(0, 0, 0, 0.3) calc(100% - var(--checklist-fade) * 0.25), transparent 100%);
  transition: max-height 0.6s var(--ease-expo), --checklist-fade 0.45s var(--ease-quint);
}

.checklist-items[data-folded="true"] {
  --checklist-fade: var(--content-preview-fade, 96px);
  max-height: var(--checklist-fold, 280px);
  transition: max-height 0.5s var(--ease-quint), --checklist-fade 0.3s ease 0.1s;
}

.checklist-items[data-folded] > li[data-fold-row] {
  transition: opacity 0.45s ease calc(var(--checklist-row, 0) * 40ms + 0.08s), transform 0.6s var(--ease-expo) calc(var(--checklist-row, 0) * 40ms + 0.08s);
}

.checklist-items[data-folded="true"] > li[data-fold-row] {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.checklist-fold {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px auto 0;
  padding: 4px 6px 4px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--section-heading-surface);
  box-shadow: var(--section-heading-shadow);
  color: var(--section-heading-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-expo);
}

.checklist-fold:active { transform: scale(0.97); }

.checklist-fold > svg {
  width: 20px;
  height: 20px;
  padding: 5px;
  box-sizing: border-box;
  border-radius: 50%;
  background: rgba(52, 71, 97, 0.08);
  fill: currentColor;
  transition: transform 0.5s var(--ease-expo);
}

.checklist-fold[aria-expanded="true"] > svg { transform: rotate(-180deg); }

.checklist-fold:focus-visible { outline: 2px solid var(--section-heading-ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .checklist-items[data-folded], .checklist-items[data-folded] > li[data-fold-row], .checklist-fold, .checklist-fold > svg { transition: none; }

  .checklist-progress { animation: none; }
}
