:root {
  color-scheme: dark;
  --bg: #14120e;
  --card: #1c1914;
  --ink: #f4efe6;
  --muted: #b3a794;
  --faint: #8c8172;
  --line: #3a332a;
  --copper: #e3924a;
  --copper-ink: #2a1608;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --sans: "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(227, 146, 74, 0.18), transparent 55%),
    radial-gradient(680px 360px at 100% 0%, rgba(143, 191, 159, 0.1), transparent 48%),
    var(--bg);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--copper);
  color: var(--copper-ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 6;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px 0 18px;
}

.brand { display: flex; gap: 12px; align-items: center; }
.brand img { border-radius: 12px; }

.word {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.tag, .source, .k, .h, .fine, .lede, .foot p { margin: 0; }

.tag { color: var(--muted); margin-top: 4px; font-size: 14px; }

.top-actions { display: flex; gap: 12px; align-items: center; }

.source {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
}

.nav {
  display: flex;
  gap: 4px;
  background: #241e18;
  padding: 4px;
  border-radius: 999px;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
}

.nav-btn.is-on { background: var(--ink); color: #1a1612; }

.banner {
  background: #3a2a1c;
  border: 1px solid var(--copper);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
}

.banner.static { margin: 16px; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top-width: 3px;
  border-radius: 16px;
  padding: 14px 16px 16px;
}

.card-created { border-top-color: var(--copper); }
.card-suspended { border-top-color: #e2c16b; }
.card-active { border-top-color: #8fbf9f; }
.card-total { border-top-color: #d7cbb8; }

.k {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.n {
  margin: 10px 0 8px;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.h { color: var(--faint); font-size: 13px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  background: rgba(28, 25, 20, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 18px;
}

.panel-h, .btn-row, .interval {
  display: flex;
  gap: 10px;
  align-items: center;
}

.panel-h { justify-content: space-between; }
.panel-h h2, .panel h2 { margin: 0; font-size: 18px; font-weight: 600; }

.lede { color: var(--muted); margin-top: 8px; line-height: 1.45; }
.fine { color: var(--faint); font-size: 13px; line-height: 1.45; }
.stack-gap { display: flex; flex-direction: column; gap: 12px; }
.stack-gap + .stack-gap, #view-ajustes .panel + .panel { margin-top: 14px; }

.feed { margin-top: 6px; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.user {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.pill {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 700;
}

.pill-ativa { color: #143126; background: #8fbf9f; }
.pill-suspensa { color: #2a2108; background: #e2c16b; }
.pill-falha { color: #3a120e; background: #e07a68; }

time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 16px 0 8px; }

.error-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.error-count {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #3a120e;
  background: #e07a68;
  border-radius: 999px;
  padding: 4px 8px;
  font-variant-numeric: tabular-nums;
}
.error-msg { margin: 0; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.body-real .source { color: #8fbf9f; }


.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #241e18;
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
}

.knob {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #5c5348;
}

.switch[aria-checked="true"] { border-color: #8fbf9f; }
.switch[aria-checked="true"] .knob { background: #8fbf9f; }

.interval { margin: 14px 0; color: var(--muted); }
.interval input, .stack input {
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}

.interval input { width: 5.5rem; }

.stack { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.stack input { width: 100%; }

.btn-row { flex-wrap: wrap; }

.primary, .ghost {
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
}

.primary {
  background: var(--copper);
  color: var(--copper-ink);
  border: 0;
  font-weight: 700;
}

.ghost { background: transparent; border: 1px solid var(--line); }

.note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.note p { margin: 0; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--ink); }

.foot { color: var(--faint); font-size: 13px; line-height: 1.45; padding: 18px 0 32px; }

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  margin: 0;
  background: #f4efe6;
  color: #1a1612;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { width: min(1080px, calc(100% - 24px)); }
  .top { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: space-between; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row time { grid-column: 1 / -1; }
  .error-row { grid-template-columns: auto minmax(0, 1fr); }
  .error-row time { grid-column: 1 / -1; }
  .n { font-size: 34px; }
  .word { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

body.login-page .wrap { width: min(420px, calc(100% - 32px)); }
.login-panel { margin-top: 12vh; padding: 28px 24px 24px; }
.login-brand { margin-bottom: 22px; }
.login-panel .primary { width: 100%; margin-top: 6px; }
.login-error { margin: 0; color: #f2b4a8; font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#logout { min-height: 36px; padding: 6px 12px; font-size: 14px; }
