/* Paleta de cinzas no estilo Google (Material), com contraste suave. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --title: #202124;
  --ink: #3c4043;
  --muted: #80868b;
  --line: #e8eaed;
  --field: #f1f3f4;
  /* --accent, --tonal, --tonal-ink: cor do tema, em theme.css */
  --shadow: 0 1px 3px rgba(60, 64, 67, .15), 0 4px 12px rgba(60, 64, 67, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202124; --surface: #292a2d; --title: #e8eaed; --ink: #bdc1c6;
    --muted: #9aa0a6; --line: #3c4043; --field: #303134;
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom));
}

/* topo */
.top { margin-bottom: 14px; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.icon-btn {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
}
.top h1 { margin: 6px 0 0; font-size: 1.75rem; font-weight: 400; color: var(--title); }
.summary { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.status { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.status--ok { background: var(--muted); }
.status--down { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }

/* campos (16px evita zoom automático no iOS) */
input {
  width: 100%; min-width: 0;
  padding: 11px 14px; font: inherit; font-size: 16px;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--field); color: var(--ink);
  transition: border-color .15s, background-color .15s;
}
input::placeholder { color: var(--muted); }
input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
button {
  cursor: pointer; border: 0; border-radius: 12px;
  font: inherit; background: none; color: inherit;
  transition: background-color .15s, opacity .15s;
}
button:active { opacity: .6; }
button:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }

/* nova tarefa */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.add-btn {
  flex: none; width: 44px; padding: 0;
  display: grid; place-items: center;
  background: var(--tonal); color: var(--tonal-ink);
}

/* filtros */
.chips { display: flex; gap: 8px; margin-bottom: 8px; }
.chip {
  padding: 6px 14px; font-size: .875rem; border-radius: 8px;
  border: 1px solid var(--line); color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--tonal); border-color: var(--tonal); color: var(--tonal-ink); font-weight: 500; }

/* lista */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 4px 0; min-height: 52px; }
.item + .item { border-top: 1px solid var(--line); }

.check {
  flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
}
.check .ring {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid currentColor; display: grid; place-items: center;
}
.check svg { opacity: 0; }
.item.done .check { color: var(--accent); }
.item.done .check .ring { background: var(--accent); }
.item.done .check svg { opacity: 1; color: var(--bg); }

.title {
  flex: 1; min-width: 0; padding: 8px 0; text-align: left;
  overflow-wrap: anywhere; border-radius: 6px;
}
.item.done .title { color: var(--muted); text-decoration: line-through; }
.edit-input { flex: 1; padding: 8px 12px; }

.del {
  flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
}
@media (hover: hover) {
  .del { opacity: 0; }
  .item:hover .del, .del:focus-visible { opacity: 1; }
  .del:hover, .check:hover { background: var(--field); }
}

.empty { color: var(--muted); text-align: center; padding: 48px 0; line-height: 1.6; }

.text-btn { padding: 8px 10px; color: var(--muted); font-size: .9rem; }
.clear { display: block; margin: 12px auto 0; }

/* avisos */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 40px); padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: .9rem; z-index: 10;
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
