:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --text: #17212b;
  --muted: #66717d;
  --line: #d8dee4;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --focus: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.stats {
  display: flex;
  gap: 10px;
  color: var(--muted);
}

.stats span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.composer,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.composer {
  padding: 16px;
}

form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.composer-detail[hidden] {
  display: none;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 25%, transparent);
  border-color: var(--focus);
}

form button,
.segment {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 16px;
}

form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0;
}

.segments {
  display: flex;
  gap: 8px;
}

.segment.active {
  border-color: var(--accent);
  background: #dff4f0;
  color: var(--accent-dark);
  font-weight: 700;
}

#searchInput {
  max-width: 320px;
}

.list-panel {
  min-height: 260px;
  padding: 8px;
}

.todo-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.todo-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e6eaee;
  border-radius: 8px;
  background: #fff;
}

.todo-item.completed {
  background: #f7faf9;
}

.todo-item.completed .todo-title {
  color: var(--muted);
  text-decoration: line-through;
}

.check {
  display: grid;
  place-items: center;
}

.check input {
  width: 22px;
  min-height: 22px;
}

.todo-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.todo-title {
  border: 0;
  min-height: 30px;
  padding: 0;
  font-weight: 700;
}

.todo-notes {
  border: 0;
  min-height: 28px;
  padding: 0;
  color: var(--muted);
}

.todo-meta {
  display: flex;
  gap: 8px;
}

.todo-notes[hidden],
.todo-meta[hidden],
.todo-priority[hidden],
.todo-due[hidden] {
  display: none;
}

.todo-priority,
.todo-due {
  width: auto;
  min-height: 34px;
}

.delete-button {
  min-height: 36px;
  border: 1px solid #f0c7c2;
  border-radius: 7px;
  background: #fff5f3;
  color: var(--danger);
  padding: 0 12px;
}

.empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
}

.empty[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 680px);
    padding-top: 18px;
  }

  .topbar,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 34px;
  }

  form {
    grid-template-columns: 1fr;
  }

  #searchInput {
    max-width: none;
  }

  .todo-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .delete-button {
    grid-column: 2;
    justify-self: start;
  }
}
