:root {
  color-scheme: light;
  --ink: #20251f;
  --muted: #767970;
  --paper: #f6f3ec;
  --card: #fffdf8;
  --line: #dedbd2;
  --accent: #d85b35;
  --accent-dark: #b94322;
  --green: #49614c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(216, 91, 53, 0.08), transparent 25rem),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 88px 0 64px;
}

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-bar .eyebrow {
  margin: 0;
}

.auth-control {
  min-height: 38px;
}

.google-button,
.sign-out {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.google-button:hover,
.sign-out:hover {
  border-color: #b9b6ad;
  background: white;
}

.google-mark {
  color: #4285f4;
  font-size: 1rem;
  font-weight: 800;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 34px;
  height: 34px;
  object-fit: cover;
  background: #e6ebe3;
  border-radius: 50%;
}

.user-copy {
  display: grid;
  max-width: 145px;
}

.user-name,
.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 800;
}

.user-email {
  color: var(--muted);
  font-size: 0.7rem;
}

.sign-out {
  min-height: 32px;
  padding: 0 10px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.intro {
  margin: 22px 0 38px;
  color: var(--muted);
  font-size: 1.05rem;
}

.auth-error {
  margin: -22px 0 28px;
  padding: 11px 13px;
  color: #8b321c;
  background: rgba(216, 91, 53, 0.09);
  border-radius: 9px;
  font-size: 0.85rem;
}

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

.task-form input {
  min-width: 0;
  padding: 17px 19px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  box-shadow: 0 8px 30px rgba(42, 39, 31, 0.04);
}

.task-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 91, 53, 0.13);
}

.task-form button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  color: white;
  font-weight: 750;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
}

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

.task-form button span {
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
}

.list-card {
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(42, 39, 31, 0.06);
}

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

.list-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 500;
}

.task-count {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.85rem;
}

.filters {
  display: flex;
  gap: 4px;
  margin: 24px 0 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.filter {
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.filter:hover,
.filter.active {
  color: var(--ink);
  background: #eeeae0;
}

.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 15px 2px;
  border-bottom: 1px solid #ebe7de;
}

.task:last-child {
  border-bottom: 0;
}

.check {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: transparent;
  background: transparent;
  border: 1.5px solid #a9aca4;
  border-radius: 50%;
}

.task.completed .check {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.task-text {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.task.completed .task-text {
  color: #979990;
  text-decoration: line-through;
}

.delete {
  width: 34px;
  height: 34px;
  color: #979990;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 1.25rem;
  opacity: 0;
  transition: opacity 120ms, background 120ms, color 120ms;
}

.task:hover .delete,
.delete:focus-visible {
  opacity: 1;
}

.delete:hover {
  color: var(--accent);
  background: rgba(216, 91, 53, 0.08);
}

.empty-state {
  padding: 44px 20px 34px;
  color: var(--muted);
  text-align: center;
}

.empty-state span {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--green);
  background: #e6ebe3;
  border-radius: 50%;
}

.empty-state p {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.empty-state small {
  font-size: 0.84rem;
}

.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: 540px) {
  .app {
    width: min(100% - 24px, 680px);
    padding-top: 54px;
  }

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

  .auth-bar {
    align-items: flex-start;
  }

  .user-copy {
    display: none;
  }

  .google-button {
    font-size: 0;
  }

  .google-button::after {
    content: "Sign in";
    font-size: 0.82rem;
  }

  .task-form button {
    justify-content: center;
    min-height: 50px;
  }

  .list-card {
    padding: 20px;
  }

  .delete {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .task {
    animation: arrive 180ms ease-out;
  }

  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
  }
}
