:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #242626;
  --muted: #66706d;
  --line: #d7e0dc;
  --accent: #0f766e;
  --accent-dark: #0a5d57;
  --accent-soft: #d7f1ec;
  --danger: #a93434;
  --shadow: 0 22px 70px rgba(38, 35, 30, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12) 0%, transparent 34%),
    linear-gradient(160deg, #f6f8fb 0%, #edf8f4 50%, #fff4f0 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.shell {
  width: min(100%, 780px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 18px;
  display: grid;
  place-items: center;
}

.panel {
  width: min(100%, 620px);
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

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

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.progress {
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  text-align: center;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.add-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.add-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15);
}

.primary-button,
.ghost-button,
.tab,
.delete-button {
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.primary-button {
  min-width: 86px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.tab {
  min-width: 70px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.tab.is-active {
  background: var(--ink);
  color: white;
}

.ghost-button {
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 750;
}

.ghost-button:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.task {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 10px 10px 12px;
  border: 1px solid rgba(215, 224, 220, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.check-wrap {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.task-check {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.custom-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  display: grid;
  place-items: center;
}

.custom-check::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}

.task-check:checked + .custom-check {
  border-color: var(--accent);
  background: var(--accent);
}

.task-check:checked + .custom-check::after {
  opacity: 1;
}

.task-title {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  line-height: 1.35;
}

.task.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.delete-button {
  min-width: 76px;
  padding: 0 12px;
  background: transparent;
  color: var(--danger);
  font-weight: 750;
}

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

.empty-state {
  margin: 16px 0 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.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: 560px) {
  .shell {
    padding: 18px 12px;
    align-items: stretch;
  }

  .panel {
    min-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
  }

  .header,
  .toolbar {
    align-items: stretch;
  }

  .header {
    flex-direction: column;
  }

  .progress {
    width: 100%;
  }

  .add-form,
  .toolbar,
  .task {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
  }

  .tabs {
    width: 100%;
  }

  .ghost-button,
  .delete-button,
  .primary-button {
    width: 100%;
  }

  .task {
    gap: 8px;
  }
}
