:root {
  color-scheme: light;
  --ink: #10162f;
  --muted: #68708a;
  --line: #dfe3ed;
  --soft: #f4f6fb;
  --blue: #1647d9;
  --blue-dark: #0c318f;
  --blue-pale: #e9efff;
  --coral: #e14c3c;
  --coral-pale: #fff0ed;
  --green: #17845b;
  --green-pale: #e7f7f0;
  --yellow: #d08b00;
  --shadow: 0 16px 40px rgba(31, 43, 84, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0 26rem, #f6f8fc 26rem 100%);
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
}
.brand > span:last-child span { color: var(--blue); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--blue); }
.brand-mark svg { width: 23px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.header-note { margin: 0; color: var(--muted); font-size: 0.875rem; }

main { width: min(1180px, 90vw); margin: 0 auto; padding: 54px 0 70px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 34px; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--blue); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; }
h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 4.4rem); line-height: 0.98; letter-spacing: -0.06em; }
.intro-copy { margin: 15px 0 0; color: var(--muted); font-size: 1rem; }
.today-card { min-width: 184px; padding: 15px 18px; border-left: 3px solid var(--blue); background: var(--blue-pale); }
.today-card span { display: block; margin-bottom: 4px; color: var(--blue); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; }
.today-card strong { font-size: 1rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #bac3d9; box-shadow: 0 8px 20px rgba(31,43,84,.07); }
.stat-card.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22,71,217,.08); }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; font-weight: 900; }
.stat-icon.blue { color: var(--blue); background: var(--blue-pale); }
.stat-icon.coral { color: var(--coral); background: var(--coral-pale); }
.stat-icon.green { color: var(--green); background: var(--green-pale); }
.stat-card strong, .stat-card small { display: block; }
.stat-card strong { font-size: 1.25rem; line-height: 1.1; }
.stat-card small { margin-top: 3px; color: var(--muted); font-size: 0.78rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); align-items: start; gap: 22px; }
.task-panel, .add-panel { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.task-panel { min-height: 460px; padding: 28px; }
.add-panel { padding: 28px; }
.panel-heading, .add-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .add-heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.035em; }
.task-total { padding: 6px 10px; border-radius: 99px; color: var(--muted); background: var(--soft); font-size: 0.75rem; font-weight: 700; }
.plus-badge { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--blue); font-size: 1.6rem; line-height: 1; }
.add-heading { justify-content: flex-start; }

.empty-state { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 20px; text-align: center; }
.empty-icon { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 22px; background: var(--blue-pale); transform: rotate(-3deg); }
.empty-icon svg { width: 42px; fill: none; stroke: var(--blue); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3 { margin: 20px 0 6px; font-size: 1.15rem; }
.empty-state p { margin: 0; color: var(--muted); font-size: .9rem; }
.text-button { margin-top: 18px; padding: 6px; border: 0; color: var(--blue); background: none; font-weight: 800; cursor: pointer; }
.text-button span { display: inline-block; margin-left: 4px; transition: transform 150ms ease; }
.text-button:hover span { transform: translateX(3px); }

form { padding-top: 23px; }
.field { margin-bottom: 20px; }
.field label, .field legend { display: flex; justify-content: space-between; margin-bottom: 8px; color: #303750; font-size: .84rem; font-weight: 750; }
.field label span { color: #9298aa; font-size: .75rem; font-weight: 500; }
input[type="text"], input[type="date"], textarea {
  width: 100%;
  border: 1px solid #cfd5e2;
  border-radius: 9px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea { min-height: 82px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,71,217,.12); }
::placeholder { color: #9ba1b1; }
.priority-field { padding: 0; border: 0; }
.priority-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.priority-options input { position: absolute; opacity: 0; pointer-events: none; }
.priority-options label { justify-content: center; align-items: center; gap: 6px; margin: 0; padding: 10px 5px; border: 1px solid #d9deea; border-radius: 8px; cursor: pointer; font-size: .78rem; }
.priority-options input:checked + label { border-color: var(--blue); background: var(--blue-pale); color: var(--blue-dark); }
.priority-options input:focus-visible + label { outline: 3px solid rgba(22,71,217,.25); }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.low { background: var(--green); }.dot.medium { background: var(--yellow); }.dot.high { background: var(--coral); }
.add-button { width: 100%; min-height: 48px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(22,71,217,.2); transition: background 150ms ease, transform 150ms ease; }
.add-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.add-button:disabled { cursor: wait; opacity: .65; transform: none; }

.task-list { display: grid; gap: 10px; padding-top: 18px; }
.task-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 13px; align-items: start; padding: 17px; border: 1px solid var(--line); border-radius: 11px; }
.task-item.overdue { border-left: 3px solid var(--coral); }
.check-button { width: 22px; height: 22px; margin-top: 2px; border: 2px solid #b8bfd0; border-radius: 6px; background: #fff; cursor: pointer; }
.check-button:hover { border-color: var(--green); }
.task-item.completed .check-button { display: grid; place-items: center; border-color: var(--green); color: #fff; background: var(--green); }
.task-item.completed .task-title { color: #70778a; text-decoration: line-through; }
.task-title { margin: 0; font-size: .98rem; line-height: 1.4; }
.task-notes { margin: 5px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.task-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; color: #5e6578; background: var(--soft); font-size: .7rem; font-weight: 700; }
.pill.priority-high { color: #a92c22; background: var(--coral-pale); }
.pill.priority-medium { color: #885c02; background: #fff6d9; }
.pill.priority-low { color: #116846; background: var(--green-pale); }
.delete-button { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #848b9d; background: transparent; cursor: pointer; font-size: 1.1rem; }
.delete-button:hover { color: var(--coral); background: var(--coral-pale); }

footer { padding: 26px 5vw; border-top: 1px solid var(--line); color: var(--muted); background: #fff; text-align: center; font-size: .8rem; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 10; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 8px; color: #fff; background: var(--ink); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; font-size: .85rem; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 820px) {
  main { width: min(92vw, 680px); padding-top: 38px; }
  .workspace { grid-template-columns: 1fr; }
  .add-panel { grid-row: 1; }
}

@media (max-width: 560px) {
  .site-header { min-height: 64px; padding-inline: 4vw; }
  .header-note { display: none; }
  main { width: 92vw; padding: 32px 0 48px; }
  .intro { align-items: flex-start; flex-direction: column; margin-bottom: 26px; }
  .today-card { width: 100%; }
  .stats { gap: 7px; }
  .stat-card { justify-content: center; padding: 12px 8px; gap: 8px; }
  .stat-icon { width: 31px; height: 31px; }
  .stat-card strong { font-size: 1.05rem; }
  .task-panel, .add-panel { padding: 20px; border-radius: 13px; }
  .task-panel { min-height: 380px; }
  .task-item { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
