:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e4e1da;
  --accent: #c2410c;
  --accent-soft: #fdeee6;
  --warn-bg: #fff6db;
  --warn-text: #7a5a00;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --card: #1c1c19;
    --text: #ecebe7;
    --muted: #9a978f;
    --line: #2d2c28;
    --accent: #fb923c;
    --accent-soft: #33221a;
    --warn-bg: #2e2712;
    --warn-text: #f1d27a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.topo, main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.topo { padding-top: 20px; padding-bottom: 4px; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; }
.sub { margin: 4px 0 0; color: var(--muted); }

.dia { margin: 18px 0 28px; }
.dia > summary {
  list-style: none; cursor: pointer; user-select: none;
  font-weight: 650; font-size: 1.05rem; padding: 10px 0;
  border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px;
}
.dia > summary::-webkit-details-marker { display: none; }
.dia > summary .conta { color: var(--muted); font-weight: 500; }
.dia > summary::after { content: "▾"; color: var(--muted); }
.dia:not([open]) > summary::after { content: "▸"; }

.aviso {
  margin: 12px 0; padding: 10px 12px; border-radius: var(--radius);
  background: var(--accent-soft); font-size: 0.93rem;
}
.aviso.falha { background: var(--warn-bg); color: var(--warn-text); }

.tema {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin: 12px 0; padding: 6px 14px 8px;
}
.tema h2 {
  font-size: 1rem; margin: 8px 0 4px; display: flex; align-items: baseline; gap: 8px;
}
.tema h2 .n {
  font-size: 0.78rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 8px;
}
.tema ul { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.tema ul .item:first-child { border-top: 0; }
.item .corpo { flex: 1; min-width: 0; }
.item a {
  color: var(--text); text-decoration: none; font-weight: 520;
  overflow-wrap: anywhere;
}
.item a:visited { color: var(--muted); }
.item a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.fechar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 0.9rem; cursor: pointer;
}
.fechar:hover { color: var(--accent); border-color: var(--accent); }
.mais {
  display: block; width: 100%; margin: 4px 0 2px; padding: 8px;
  border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.vazio { color: var(--muted); padding: 24px 0; text-align: center; }
.rodape { color: var(--muted); font-size: 0.8rem; text-align: center; margin: 32px 0; }
.rodape button {
  font: inherit; color: var(--accent); background: none; border: 0; cursor: pointer; text-decoration: underline;
}
