.tool-to-do-list {
  --warn: #f0b84c;
}
/* ---------- Hero: asymmetric two-column, not the centered-badge formula ---------- */
.hero {
  padding: 56px 0 20px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.kicker {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 10px 0 14px;
  max-width: 16ch;
}
.hero p.lede {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 52ch;
  margin: 0 0 20px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.hero-cta:hover {
  color: #fff;
}
.hero-cta svg {
  width: 16px;
  height: 16px;
}
.hero-facts {
  display: flex;
  gap: 22px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.hero-fact b {
  display: block;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.hero-fact span {
  display: block;
  font-size: 11.5px;
  color: var(--muted2);
  margin-top: 2px;
}

/* decorative preview card — a fake little app snippet, built from real markup */
.preview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 30px 70px var(--shadow);
  transform: rotate(1.2deg);
}
.preview-card .pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.preview-card .pc-head span {
  font-size: 11px;
  color: var(--muted2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.preview-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
  margin-bottom: 14px;
}
.preview-bar i {
  display: block;
  height: 100%;
  width: 62%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
}
.preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--surface2);
  font-size: 13px;
}
.preview-row:last-child {
  border-bottom: none;
}
.preview-row .dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--line2);
  flex: none;
}
.preview-row.done .dot {
  background: var(--accent);
  border-color: var(--accent);
  position: relative;
}
.preview-row.done span {
  text-decoration: line-through;
  color: var(--muted2);
}
.preview-row .pri {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  flex: none;
}
.preview-row .pri.high {
  background: rgba(255, 100, 124, 0.15);
  color: #ff9aac;
}
.preview-row .pri.med {
  background: rgba(240, 184, 76, 0.15);
  color: #f3c979;
}

/* ---------- The app itself ---------- */
.app {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 70px var(--shadow);
  overflow: hidden;
  margin: 20px 0 28px;
}
.app-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.progress-wrap {
  flex: 1;
  min-width: 200px;
}
.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 7px;
}
.progress-top strong {
  color: var(--text);
}
.progress-track {
  height: 9px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.3s ease;
  width: 0%;
}
.app-head.celebrate .progress-fill {
  background: linear-gradient(90deg, var(--accent), #7be8c8);
}
.mini-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.mini-stat {
  text-align: center;
}
.mini-stat b {
  display: block;
  font-size: 17px;
}
.mini-stat span {
  display: block;
  font-size: 10px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1px;
}
.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  flex: none;
}
.streak-badge b {
  color: var(--warn);
}

.celebrate-msg {
  display: none;
  text-align: center;
  padding: 10px 22px;
  background: rgba(56, 214, 162, 0.08);
  color: #8eead5;
  font-size: 13px;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}
.app.all-done .celebrate-msg {
  display: block;
}

/* add-task row */
.add-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.add-form input[type="text"] {
  background: var(--surface2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
}
.add-form select,
.add-form input[type="date"] {
  background: var(--surface2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 11px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  color-scheme: dark;
}
.add-form input:focus,
.add-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.add-form button {
  background: var(--accent);
  border: none;
  color: #07110d;
  font-weight: 800;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
}
.add-form button:hover {
  background: #4de6b5;
}

/* filter / sort controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 3px;
}
.filter-tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.filter-tabs button.active {
  background: var(--line2);
  color: var(--text);
}
.controls .right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.controls select {
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
}
.controls .text-btn {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.controls .text-btn:hover {
  color: var(--danger);
}

/* task list */
.task-list {
  list-style: none;
  margin: 0;
  padding: 8px;
}
.task-list:empty {
  display: none;
}
.task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 10px;
  background: transparent;
  transition: background 0.12s;
}
.task:hover {
  background: var(--surface2);
}
.task.dragging {
  opacity: 0.4;
}
.task.overdue .due-chip {
  background: rgba(255, 100, 124, 0.14);
  color: #ff9aac;
  border-color: rgba(255, 100, 124, 0.3);
}
.drag-handle {
  cursor: grab;
  color: var(--muted2);
  flex: none;
  width: 16px;
  text-align: center;
  user-select: none;
}
.task-list.sorted .drag-handle {
  visibility: hidden;
}
.task input[type="checkbox"] {
  width: 19px;
  height: 19px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 50%;
}
.task-text {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}
.task.done .task-text {
  color: var(--muted2);
  text-decoration: line-through;
}
.task-text[contenteditable="true"] {
  white-space: normal;
  outline: 1px dashed var(--accent);
  border-radius: 4px;
  padding: 1px 4px;
}
.pri-chip {
  flex: none;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.pri-chip.low {
  background: rgba(35, 168, 255, 0.12);
  color: #8ecbff;
  border-color: rgba(35, 168, 255, 0.25);
}
.pri-chip.med {
  background: rgba(240, 184, 76, 0.14);
  color: #f3c979;
  border-color: rgba(240, 184, 76, 0.3);
}
.pri-chip.high {
  background: rgba(255, 100, 124, 0.14);
  color: #ff9aac;
  border-color: rgba(255, 100, 124, 0.3);
}
.due-chip {
  flex: none;
  font-size: 11px;
  color: var(--muted2);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
.task-del {
  flex: none;
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  visibility: hidden;
}
.task:hover .task-del {
  visibility: visible;
}
.task-del:hover {
  color: var(--danger);
}
.empty-state {
  padding: 50px 22px;
  text-align: center;
  color: var(--muted2);
}
.empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--line2);
  margin-bottom: 10px;
}
.empty-state p {
  margin: 0;
  font-size: 13.5px;
}

/* ---------- content sections below the app ---------- */
.bottom {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
  margin: 14px 0 28px;
}
.card {
  background: rgba(13, 18, 26, 0.94);
  border: 1px solid #26313e;
  border-radius: 15px;
  padding: 18px;
}
.card-title {
  display: flex;
  justify-content: space-between;
  color: #7f8b9b;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.card p {
  color: #818d9d;
  font-size: 13px;
  line-height: 1.55;
  margin: 11px 0 14px;
}
table.uses {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.uses th,
table.uses td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #1b2530;
}
table.uses th {
  color: #7f8b9b;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
table.uses td {
  color: #c6ceda;
}
table.uses tr:last-child td {
  border-bottom: none;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 40px;
}
.info-section h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.info-section .card p {
  color: #818d9d;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 14px;
}
.info-section ul.plain {
  color: #818d9d;
  font-size: 13px;
  line-height: 1.75;
  margin: 0 0 14px;
  padding-left: 20px;
}
.faq details {
  border-bottom: 1px solid #1b2530;
  padding: 12px 0;
}
.faq details:last-child {
  border-bottom: none;
}
.faq summary {
  cursor: pointer;
  font-weight: 750;
  font-size: 13.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  font-weight: 400;
}
.faq details[open] summary::after {
  content: "–";
}
.faq p {
  color: #8a97a8;
  font-size: 13px;
  line-height: 1.6;
  margin: 10px 0 0;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .preview-card {
    transform: none;
    max-width: 420px;
  }
  .bottom {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .add-form {
    grid-template-columns: 1fr;
  }
  .add-form select,
  .add-form input[type="date"] {
    width: 100%;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .controls .right {
    justify-content: space-between;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.task-del {
  visibility: visible;
  min-width: 32px;
  min-height: 32px;
}
.task:focus-within {
  background: var(--surface2);
}
.task-text {
  white-space: normal;
  overflow-wrap: anywhere;
}
.task-move {
  display: flex;
  gap: 2px;
}
.task-move button {
  background: #151e29;
  border: 1px solid #2b3746;
  border-radius: 5px;
  color: #c6ceda;
  min-width: 28px;
  min-height: 30px;
  cursor: pointer;
}
.task-move button:disabled {
  opacity: 0.4;
  cursor: default;
}
.storage-note {
  padding: 0 22px;
  color: #ffcd8c;
  font-size: 13px;
}
.storage-note:empty {
  display: none;
}
.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 22px;
}
.list-actions .text-btn,
.import-label {
  border: 0;
  background: none;
  color: #8ad7ff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.list-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}
.import-label:focus-within {
  outline: 2px solid #55c8ff;
  outline-offset: 4px;
}
.task-edit {
  width: 100%;
  background: #111821;
  border: 1px solid #38d6a2;
  color: #f3f6fa;
  font: inherit;
  border-radius: 5px;
  padding: 4px;
}
.task .task-text {
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: text;
}
.task.done .task-text {
  color: #9ba8ba;
}
.controls .right {
  flex-wrap: wrap;
}
.add-form button {
  min-height: 42px;
}
.hero h1 {
  max-width: 20ch;
}
.hero-cta:focus-visible {
  outline-offset: 5px;
}
@media (max-width: 600px) {
  .task {
    gap: 7px;
    flex-wrap: wrap;
  }
  .task .task-text {
    flex-basis: calc(100% - 75px);
  }
  .task-move {
    margin-left: 26px;
  }
  .task-del {
    margin-left: auto;
  }
  .due-chip,
  .pri-chip {
    font-size: 11px;
  }
  .progress-wrap {
    min-width: 0;
    width: 100%;
  }
  .app-head {
    gap: 14px;
    padding: 16px;
  }
  .hero {
    padding-top: 38px;
  }
}

/* Contrast and reduced-motion safeguards remain local to the tool. */
main .card p,
main .info-section p,
main .info-section li,
main .info-section ul,
main .info-section ol {
  color: #a4b0c0;
}
main :focus-visible {
  outline: 3px solid #55c8ff;
  outline-offset: 3px;
}
main .card {
  min-width: 0;
}
main table {
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  main *,
  main *::before,
  main *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Give the mobile progress summary a full row before the compact statistics. */
@media (max-width: 600px) {
  .app-head .progress-wrap {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
  }
  .app-head .progress-top {
    gap: 12px;
    flex-wrap: wrap;
    align-items: baseline;
  }
  .app-head .progress-top strong {
    white-space: nowrap;
  }
  .app-head .mini-stats {
    flex: 1;
    gap: 24px;
  }
}
