.todo-page { max-width: 920px; }
.todo-hero { margin-bottom: 38px; }
.todo-hero-icon { display: grid; place-items: center; flex: 0 0 78px; width: 78px; height: 78px; border-radius: 16px; color: white; background: linear-gradient(145deg, #4f1bb0, var(--accent)); font-size: 2.4rem; font-weight: 900; box-shadow: 7px 7px 0 #d9c8f5; }
.todo-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px 18px; }
.todo-details-field small { color: var(--muted); font-size: .82rem; font-weight: 500; }
.todo-form textarea { width: 100%; min-height: 112px; resize: vertical; padding: 15px 17px; border: 1px solid #d8d9e1; border-radius: 9px; color: var(--text); background: #fff; font: inherit; line-height: 1.6; outline: none; }
.todo-form textarea::placeholder { color: #797782; }
.todo-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(120,55,230,.12); }
.todo-schedule-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.todo-schedule-fields select { width: 100%; min-height: 56px; padding: 0 44px 0 16px; border: 1px solid #d8d9e1; border-radius: 9px; color: var(--text); background: #fff; font: inherit; }
.recurrence-options { min-width: 0; margin: 0; }
.recurrence-options[hidden] { display: none; }
.weekday-options { grid-column: 1 / -1; padding: 0; border: 0; }
.weekday-options legend { margin-bottom: 9px; font-weight: 800; }
.recurrence-interval-field { max-width: 240px; margin-bottom: 12px; }
.weekday-checkboxes { display: flex; flex-wrap: wrap; gap: 5px; }
.weekday-checkboxes label { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 34px; min-height: 34px; padding: 0 6px; border: 1px solid #d8d9e1; border-radius: 8px; background: #fff; cursor: pointer; font-size: .8rem; font-weight: 700; }
.weekday-checkboxes label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: #f3edff; }
.weekday-checkboxes input { width: 13px; height: 13px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.monthly-options { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.recurrence-number-control, .monthly-day-control { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.recurrence-number-control input, .monthly-day-control input { width: 100px; }
.todo-form .primary-button { grid-column: 1 / -1; justify-self: end; min-width: 190px; }
.todo-content { min-width: 0; }
.todo-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.todo-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 16px; min-height: 76px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.todo-marker { width: 20px; height: 20px; margin-top: 1px; border: 2px solid #aa9bc6; border-radius: 5px; background: #faf8ff; }
.todo-title { min-width: 0; overflow-wrap: anywhere; font-size: 1.05rem; font-weight: 800; }
.todo-details { margin: 7px 0 0; color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; color: #605b69; font-size: .88rem; font-weight: 700; }
.todo-recurrence { padding: 4px 9px; border-radius: 999px; color: var(--accent); background: #f0e9ff; }
.todo-actions { display: flex; align-items: center; gap: 7px; justify-self: end; }
.todo-complete-button { display: grid; place-items: center; justify-self: end; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px solid #b9a4e8; border-radius: 50%; color: var(--accent); background: #f5f0ff; cursor: pointer; font-size: 1rem; font-weight: 900; }
.todo-complete-button:hover { border-color: var(--accent); background: #ede4ff; }
.todo-complete-button:focus-visible { outline: 3px solid rgba(120,55,230,.2); outline-offset: 3px; }
.todo-delete-button { display: grid; place-items: center; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px solid #e9a8b1; border-radius: 50%; color: #c43f55; background: #fff5f6; cursor: pointer; font-size: 1rem; font-weight: 900; }
.todo-delete-button:hover { border-color: #c43f55; background: #ffe9ec; }
.todo-delete-button:focus-visible { outline: 3px solid rgba(196,63,85,.2); outline-offset: 3px; }
.todo-delete-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

@media (max-width: 620px) {
  .todo-page { width: 100%; padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .todo-page .back-to-hub { margin: 0 4px 20px; }
  .todo-hero { margin: 0 4px 24px; }
  .todo-hero-icon { flex-basis: 54px; width: 54px; height: 54px; font-size: 1.75rem; box-shadow: 4px 4px 0 #d9c8f5; }
  .todo-page .hero-title-row { gap: 15px; }
  .todo-page .hero h1 { font-size: 2rem; }
  .todo-page .panel { border-radius: 14px; }
  .todo-page .section-heading { margin-bottom: 20px; }
  .todo-page .section-title-row { min-width: 0; gap: 14px; }
  .todo-page .section-number { flex-basis: 42px; width: 42px; height: 42px; }
  .todo-form { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .todo-form > .field { min-width: 0; }
  .todo-schedule-fields { grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 16px; padding: 16px; border-radius: 12px; background: #f7f4fc; }
  .todo-schedule-fields > .field { min-width: 0; }
  .todo-schedule-fields input[type="date"] { display: block; width: 100%; min-width: 0; max-width: 100%; inline-size: -webkit-fill-available; min-inline-size: 0; max-inline-size: 100%; }
  .weekday-options { grid-column: 1; }
  .monthly-options { grid-column: 1; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .todo-form .primary-button { width: 100%; }
  .todo-list-heading { align-items: center; gap: 10px; }
  .todo-list-heading h2 { font-size: 1.25rem; }
  .todo-list-heading .count-badge { flex: 0 0 auto; padding: 8px 12px; }
  .todo-item { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }
}
