:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: #d8d8dc;
  --soft: #ededf0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.app-header,
.app-footer,
.app-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
}

.app-header {
  min-height: 160px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 42px 0 24px;
  border-bottom: 1px solid var(--line);
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(42px, 8vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
}

.header-note,
.todo-count,
.empty-state,
.app-footer {
  color: var(--muted);
}

.app-shell {
  padding: 28px 0 48px;
}

.todo-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.todo-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.todo-input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
}

.todo-input:focus {
  border-color: #111111;
  outline: 2px solid #111111;
  outline-offset: 2px;
}

.button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 16px;
  font-weight: 650;
  cursor: pointer;
}

.button-primary {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

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

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfd;
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #111111;
}

.todo-text {
  overflow-wrap: anywhere;
}

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

.delete-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
}

.delete-button:hover,
.delete-button:focus {
  color: var(--text);
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfbfd;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.app-footer {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
}

code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 640px) {
  .app-header,
  .app-footer,
  .app-shell {
    width: min(100% - 24px, 760px);
  }

  .app-header,
  .section-header,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

