:root { --bg: #f4f6f5; --card: #fff; --text: #17211d; --sub: #586660; --main: #0b6b4f; --line: #d5ddd9; --bad: #a32020; --warn: #8a5800; }
@media (prefers-color-scheme: dark) { :root { --bg: #101614; --card: #18211d; --text: #eaf1ee; --sub: #9fb0a8; --main: #14805f; --line: #2c3a34; --bad: #ff8f8f; --warn: #f0b95a; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, sans-serif; }
main, header { max-width: 980px; margin: 0 auto; padding: 16px; }
header { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; border-bottom: 1px solid var(--line); }
header strong { font-size: 18px; margin-right: auto; }
a { color: inherit; text-underline-offset: 4px; }
nav a, header a { text-decoration: none; padding: 10px 2px; border-bottom: 2px solid transparent; }
a[aria-current] { border-color: var(--main); font-weight: 600; }
nav { display: flex; gap: 20px; overflow-x: auto; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
nav a { white-space: nowrap; }
h1 { font-size: 24px; margin: 8px 0 12px; overflow-wrap: anywhere; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--sub); margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 8vh auto; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.split { justify-content: space-between; }
a.item { display: flex; text-decoration: none; padding: 14px 0; }
a.item + a.item { border-top: 1px solid var(--line); }
a.item:hover strong { text-decoration: underline; }
.item small, td small { display: block; color: var(--sub); }
.tag { font-size: 13px; font-weight: 600; padding: 2px 10px; border: 1px solid currentColor; border-radius: 99px; white-space: nowrap; }
.good { color: var(--main); } .bad { color: var(--bad); } .warn { color: var(--warn); } .off { color: var(--sub); }
@media (prefers-color-scheme: dark) { .good { color: #56c9a1; } }
label { display: block; font-weight: 600; margin-bottom: 14px; }
label small { display: block; font-weight: 400; color: var(--sub); }
input, textarea, select { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input[type=checkbox] { display: inline; width: auto; margin: 0 8px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 14px; max-height: 240px; overflow: auto; }
fieldset label { font-weight: 400; margin: 4px 0; overflow-wrap: anywhere; }
button { padding: 10px 16px; min-height: 44px; border-radius: 8px; border: 1px solid var(--main); background: var(--main); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
button.alt { background: transparent; color: var(--text); border-color: var(--line); }
button.danger { background: transparent; color: var(--bad); border-color: currentColor; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--main); outline-offset: 2px; }
dl { display: grid; grid-template-columns: minmax(110px, 200px) 1fr; gap: 8px 16px; margin: 0 0 16px; }
dt { color: var(--sub); } dd { margin: 0; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--sub); font-weight: 600; font-size: 14px; white-space: nowrap; }
code { font: 14px/1.5 ui-monospace, monospace; overflow-wrap: anywhere; }
dialog { width: min(520px, calc(100vw - 32px)); background: var(--card); color: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
dialog::backdrop { background: #0008; }
dialog code { display: block; padding: 12px; margin-bottom: 16px; background: var(--bg); border-radius: 8px; user-select: all; }
.error { color: var(--bad); margin: 0 0 12px; }
.error:empty { display: none; }
#toast { position: fixed; inset: auto 16px 16px; margin: auto; width: fit-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 8px; background: var(--text); color: var(--bg); }
#toast:empty { display: none; }
fieldset label { display: flex; align-items: baseline; }
fieldset input { flex: none; }
fieldset label { min-width: 0; }
@media (max-width: 600px) {
  header strong { flex-basis: 100%; }
  /* Tabela vira lista: rolando de lado, o botão da última coluna sumia. */
  thead { display: none; }
  tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  td { display: block; padding: 3px 0; border: 0; }
  td:empty { display: none; }
}
