:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --panel: #ffffff;
  --ink: #1d2520;
  --muted: #647067;
  --line: #dfe6dd;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(39, 59, 50, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(140deg, rgba(15, 118, 110, 0.12), transparent 42%),
    linear-gradient(320deg, rgba(185, 127, 31, 0.12), transparent 36%),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(760px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.app-panel {
  background: var(--panel);
  border: 1px solid rgba(29, 37, 32, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
}

.status {
  min-width: 86px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 11px;
  text-align: center;
}

.status.is-online {
  border-color: rgba(15, 118, 110, 0.32);
  color: var(--accent-dark);
  background: rgba(15, 118, 110, 0.08);
}

.status.is-error {
  border-color: rgba(180, 35, 24, 0.32);
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}

.composer {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.composer label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.composer input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 14px;
  color: var(--ink);
}

.composer input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.composer button,
.filter-button,
.delete-button {
  border: 0;
  border-radius: 7px;
  font-weight: 800;
}

.composer button {
  background: var(--accent);
  color: white;
  padding: 0 20px;
}

.composer button:hover {
  background: var(--accent-dark);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 14px;
}

.filter-button {
  background: #edf2ee;
  color: var(--muted);
  padding: 8px 12px;
}

.filter-button.is-active {
  background: #20352f;
  color: white;
}

.list-area {
  min-height: 170px;
}

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

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

.todo-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.todo-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.todo-check span {
  overflow-wrap: anywhere;
}

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

.delete-button {
  background: #fff1ef;
  color: var(--danger);
  padding: 9px 11px;
}

.delete-button:hover {
  background: #ffe0dc;
}

.empty-state {
  margin: 34px 0 10px;
  color: var(--muted);
  text-align: center;
}

.empty-state.is-hidden {
  display: none;
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 760px);
    align-items: start;
    padding-top: 14px;
  }

  .app-panel {
    padding: 18px;
  }

  .topbar,
  .composer-row,
  .todo-item {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .status {
    justify-self: start;
  }

  .composer button,
  .delete-button {
    min-height: 44px;
  }
}
