:root {
  color-scheme: light;
  --bg: #f5f6fc;
  --surface: #ffffff;
  --text: #20213a;
  --muted: #7c809a;
  --line: #ececf4;
  --primary: #4f46e5;
  --primary-dark: #4038c9;
  --primary-soft: #eeedff;
  --green: #14966b;
  --danger: #d84c5b;
  --shadow: 0 24px 70px rgba(43, 43, 94, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  padding: 52px 18px 32px;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(124, 116, 255, .13), transparent 36%),
    radial-gradient(ellipse at 100% 30%, rgba(117, 220, 190, .12), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .28);
  outline-offset: 3px;
}
.app { width: min(100%, 720px); margin: 0 auto; }
.app-header { display: flex; align-items: center; gap: 16px; margin: 0 0 30px 8px; }
.brand-mark {
  display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 58px;
  border-radius: 18px; background: var(--primary); color: white; font-size: 31px; font-weight: 800;
  box-shadow: 0 10px 24px rgba(79, 70, 229, .25);
}
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 38px); line-height: 1; letter-spacing: -.055em; }
h1 span { color: var(--primary); }
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.task-card {
  overflow: hidden; padding: clamp(20px, 5vw, 36px); background: var(--surface);
  border: 1px solid rgba(232, 232, 244, .85); border-radius: 26px; box-shadow: var(--shadow);
}
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 24px; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.date-pill { padding: 9px 12px; border-radius: 999px; background: #f7f7fc; color: var(--muted); font-size: 12px; white-space: nowrap; }
.task-form { display: flex; gap: 10px; }
.task-form input, .edit-dialog input {
  min-width: 0; width: 100%; padding: 14px 15px; border: 1px solid #e7e7f1; border-radius: 12px;
  color: var(--text); background: #fbfbfe; transition: border-color .2s, box-shadow .2s;
}
.task-form input:focus, .edit-dialog input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(79, 70, 229, .08); }
.task-form input::placeholder { color: #a3a5b9; }
.primary-btn, .secondary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 13px 17px;
  border: 0; border-radius: 12px; font-size: 13px; font-weight: 750; white-space: nowrap; transition: .18s ease;
}
.primary-btn { background: var(--primary); color: white; box-shadow: 0 6px 14px rgba(79, 70, 229, .17); }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.primary-btn span { font-size: 18px; line-height: 12px; }
.secondary-btn { background: #f1f1f8; color: var(--text); }
.secondary-btn:hover { background: #e8e8f2; }
.form-message { min-height: 18px; margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 28px; }
.summary-item { display: flex; flex-direction: column; gap: 4px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 15px; background: #fdfdff; }
.summary-number { font-size: 25px; font-weight: 800; letter-spacing: -.05em; }
.summary-label { color: var(--muted); font-size: 11px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px; border-radius: 12px; background: #f6f6fb; }
.filter-btn { padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.filter-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 7px rgba(30, 30, 70, .08); }
.text-btn { padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.text-btn:hover { color: var(--danger); }
.task-list { display: grid; gap: 9px; margin: 0; padding: 16px 0 0; list-style: none; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 14px; background: white; animation: arrive .2s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.check-btn {
  display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; padding: 0;
  border: 1.5px solid #d7d8e8; border-radius: 7px; background: white; color: white; font-size: 13px;
}
.task-item.completed .check-btn { border-color: var(--green); background: var(--green); }
.task-text { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.task-item.completed .task-text { color: #a0a2b4; text-decoration: line-through; }
.task-actions { display: flex; gap: 3px; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: #9699ae; font-size: 15px; }
.icon-btn:hover { background: #f2f1ff; color: var(--primary); }
.icon-btn.delete:hover { background: #fff0f1; color: var(--danger); }
.empty-state { padding: 34px 14px 26px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 15px; background: var(--primary-soft); color: var(--primary); font-size: 24px; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; }
.empty-state p { max-width: 280px; margin: 0 auto; color: var(--muted); font-size: 12px; line-height: 1.6; }
.card-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #1dbb83; vertical-align: 1px; }
.app-credit { margin: 20px 0 0; color: #9699ae; font-size: 11px; text-align: center; }
.app-credit strong { color: #666982; }
.edit-dialog { width: min(calc(100% - 32px), 420px); padding: 26px; border: 1px solid var(--line); border-radius: 20px; color: var(--text); box-shadow: 0 25px 90px rgba(24, 24, 55, .25); }
.edit-dialog::backdrop { background: rgba(27, 28, 52, .4); backdrop-filter: blur(3px); }
.edit-dialog h2 { margin-bottom: 20px; }
.edit-dialog label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.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; }

@media (max-width: 520px) {
  body { padding: 28px 12px 22px; }
  .app-header { margin-left: 3px; margin-bottom: 22px; }
  .brand-mark { width: 49px; height: 49px; flex-basis: 49px; border-radius: 15px; font-size: 27px; }
  .task-card { border-radius: 20px; }
  .task-form { flex-direction: column; }
  .task-form .primary-btn { width: 100%; }
  .summary { gap: 7px; }
  .summary-item { padding: 12px 10px; }
  .summary-number { font-size: 22px; }
  .summary-label { font-size: 10px; }
  .list-toolbar { align-items: flex-start; flex-direction: column; }
  .text-btn { align-self: flex-end; }
  .date-pill { font-size: 10px; padding: 8px 9px; }
  .task-item { gap: 9px; padding: 11px 9px; }
  .icon-btn { width: 29px; }
}
