.todo-body {
  --todo-muted: #766f65;
  --todo-soft: rgba(226, 217, 202, .28);
}

.todo-shell { padding-bottom: 72px; }

.todo-nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.todo-workspace {
  --todo-title-size: clamp(21px, 2.5vw, 25px);
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  margin: 58px auto 0;
  font-family: "Michel Sketch", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.todo-hero h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 56px);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: 1;
}

.todo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 22px;
}

.todo-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.todo-stat span,
.todo-field > span,
.todo-card-kicker {
  color: var(--todo-muted);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
}

.todo-stat strong {
  font-size: 23px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.todo-stat--count { margin-left: 0; }
.todo-stat--count strong { color: var(--ink); }

.todo-compose { padding-top: 24px; }

.todo-form {
  display: block;
  width: 100%;
  padding: 14px 4px 10px;
  border-radius: 8px;
  background: rgba(228, 218, 201, .12);
}

.todo-entry-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 18px;
  align-items: center;
}

.todo-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.todo-field input,
.todo-field select,
.todo-field textarea,
.todo-toolbar select,
.todo-match-select {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, .48);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
}

.todo-field--title input {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-family: "Michel Sketch", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: var(--todo-title-size);
  font-weight: 400;
  line-height: 1.3;
}

.todo-field--title input::placeholder {
  color: #5a554f;
  opacity: 1;
}

.todo-field input:focus-visible,
.todo-field select:focus-visible,
.todo-field textarea:focus-visible,
.todo-toolbar select:focus-visible,
.todo-match-select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.todo-form-actions {
  display: grid;
  place-items: center;
}

.todo-form-actions button {
  width: 28px;
  height: 28px;
  border: 1.5px solid #8f877c;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.todo-form-actions button:hover {
  background: var(--ink);
  color: var(--paper);
}

.todo-form-status {
  display: block;
  margin: 8px 0 0 50px;
  color: var(--todo-muted);
  font-size: 15px;
}
.todo-form-status:empty { display: none; }

.todo-advanced {
  width: calc(100% - 50px);
  margin: 2px 0 0 50px;
}

.todo-advanced summary {
  width: max-content;
  padding: 3px 0;
  color: var(--todo-muted);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}

.todo-advanced summary::-webkit-details-marker { display: none; }
.todo-advanced summary::after { content: " +"; }
.todo-advanced[open] summary::after { content: " −"; }

.todo-advanced-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
  padding: 4px 0 12px;
}

.todo-field--note { grid-column: 1 / -1; }
.todo-field textarea { resize: vertical; }

.todo-list-section { padding-top: 8px; }

.todo-section-heading {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 3px;
}

.todo-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.todo-toolbar select {
  width: auto;
  padding: 6px 24px 6px 8px;
  background-color: transparent;
  color: var(--todo-muted);
  font-size: 18px;
}

.todo-toolbar button,
.todo-delete {
  border: 0;
  padding: 6px 8px;
  background: transparent;
  color: var(--todo-muted);
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}

.todo-form-actions button:disabled,
.todo-toolbar button:disabled { cursor: wait; opacity: .55; }

.todo-sync-note { display: none; }

.todo-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  column-gap: 18px;
  align-items: center;
  padding: 21px 4px;
}

.todo-card + .todo-card { margin-top: 3px; }

.todo-card.is-complete .todo-card-title {
  color: #888076;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.todo-check {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1.5px solid #8f877c;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 16px;
  cursor: pointer;
}

.todo-check[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.todo-card-main { min-width: 0; }
.todo-card-kicker {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
}

.todo-card-title {
  margin: 0;
  font-size: var(--todo-title-size);
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.todo-card-note {
  margin: 8px 0 0;
  color: var(--todo-muted);
  font-size: 16px;
  line-height: 1.5;
}

.todo-progress {
  align-self: center;
  margin-left: 16px;
}

.todo-progress output {
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.todo-matches {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 12px;
  min-width: 0;
  margin-top: 8px;
  line-height: 1.5;
}

.todo-matches-label {
  color: var(--todo-muted);
  font-size: 14px;
}

.todo-match {
  color: var(--ink);
  font-size: 15px;
  text-decoration-color: #b7afa4;
  text-underline-offset: 4px;
  overflow-wrap: break-word;
}

.todo-match small {
  margin-left: 5px;
  color: var(--todo-muted);
  font-size: 13px;
}

.todo-card-manage {
  border: 0;
  padding: 9px 3px 9px 12px;
  background: transparent;
  color: var(--todo-muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.todo-card-manage[aria-expanded="true"] { color: var(--ink); }

.todo-card-options {
  grid-column: 2 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 17px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(45, 45, 45, .12);
}

.todo-card-article-field {
  display: grid;
  gap: 5px;
  width: min(380px, 100%);
  color: var(--todo-muted);
  font-size: 14px;
}

.todo-match-select {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(45, 45, 45, .2);
  background: rgba(255, 254, 249, .74);
  font-size: 16px;
}

.todo-card-actions {
  display: flex;
  justify-content: flex-end;
}

.todo-delete {
  padding: 10px 3px;
  color: #8b5c56;
  font-size: 16px;
}

.todo-empty {
  margin: 0;
  padding: 18px 10px;
  color: var(--todo-muted);
  font-size: 28px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.todo-check:focus-visible,
.todo-form-actions button:focus-visible,
.todo-toolbar button:focus-visible,
.todo-delete:focus-visible,
.todo-advanced summary:focus-visible,
.todo-card-manage:focus-visible,
.todo-match:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (hover: hover) {
  .todo-card:hover { background: rgba(228, 218, 201, .12); }
  .todo-toolbar button:hover,
  .todo-delete:hover,
  .todo-card-manage:hover { color: var(--ink); }
}

@media (max-width: 680px) {
  .todo-workspace { margin-top: 48px; }
  .todo-stat--count { margin-left: 0; }
  .todo-entry-row { grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; }
  .todo-advanced { width: calc(100% - 42px); margin-left: 42px; }
  .todo-form-status { margin-left: 42px; }
  .todo-advanced-fields { grid-template-columns: 1fr; }
  .todo-field--note { grid-column: auto; }
  .todo-card { grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 12px; }
  .todo-card-manage { grid-column: 3; grid-row: 1; }
  .todo-progress { grid-column: 2; grid-row: 2; margin: 8px 0 0; }
  .todo-card-options { grid-column: 2 / -1; }
}

@media (max-width: 440px) {
  .todo-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
  }
  .todo-card { padding-inline: 2px; }
  .todo-card-options { align-items: stretch; flex-direction: column; }
  .todo-card-article-field { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
