/* Shared look for every tool sub-site. Mirrors the console's tokens. */
:root {
  color-scheme: dark;
  --fg: #3ddc84;
  --fg-dim: #1e7a46;
  --hl: #ffd166;
  --border: #12391f;
  --soft: rgba(255, 255, 255, .78);
  --faint: rgba(255, 255, 255, .5);
  --bg: #000;
  --panel: #050805;
  --sev-critical: #ff3b5c;
  --sev-high: #ff6b3d;
  --sev-medium: #ffb000;
  --sev-low: #4fc3f7;
  --sev-info: #9aa5a0;
  --sev-ok: #3ddc84;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--soft); }
body {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  font: 15px/1.6 var(--mono);
  font-variant-ligatures: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0, rgba(255, 255, 255, .03) 1.5px, transparent 3px);
}
a { color: var(--fg); text-decoration: none; border-bottom: 1px dotted var(--fg-dim); }
a:hover { color: var(--hl); border-bottom-color: var(--hl); }
::selection { background: var(--fg); color: #000; }

/* ---- header / footer ------------------------------------------------------ */
.bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--fg);
}
.bar .brand { font-weight: 700; color: var(--fg); border: 0; }
.bar .caret { display: inline-block; width: .6ch; margin-left: .25ch; animation: blink 1s steps(1, end) infinite; }
@keyframes blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
.bar .crumb { color: var(--soft); }
.bar .spacer { flex: 1; }
.bar nav { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .85em; }
.bar nav a { border: 0; color: var(--faint); }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--fg); }
.foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--border); font-size: .8em; color: var(--faint); }

main.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 1.35rem; color: var(--fg); margin: 0 0 .25rem; font-weight: 700; }
h1 + .lede { margin-top: 0; }
h2 { font-size: 1.05rem; color: var(--fg); margin: 1.6rem 0 .6rem; }
h3 { font-size: .95rem; color: var(--hl); margin: 1.1rem 0 .4rem; }
.lede { color: var(--faint); margin: 0 0 1.2rem; }
h2::before { content: "## "; color: var(--fg-dim); }
h3::before { content: "### "; color: var(--fg-dim); }

/* ---- panels & forms ----------------------------------------------------------- */
.panel { border: 1px solid var(--border); background: var(--panel); padding: 14px; margin: 0 0 14px; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0 0 .6rem; color: var(--fg); }

label { display: block; color: var(--fg); margin: 0 0 .35rem; font-size: .9em; }
input[type="text"], input[type="url"], input[type="search"], input[type="number"], input[type="date"],
input[type="datetime-local"], input:not([type]), textarea, select {
  width: 100%; padding: 9px 10px;
  background: #000; color: var(--soft); border: 1px solid var(--border);
  font: inherit; caret-color: var(--fg); border-radius: 0;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--fg); }
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, .3); }

.field { margin: 0 0 12px; }
.inline { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.inline > input, .inline > select { flex: 1 1 260px; width: auto; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

button, .btn {
  display: inline-flex; align-items: center; gap: .4em; justify-content: center;
  padding: 8px 14px; background: transparent; color: var(--fg);
  border: 1px solid var(--fg-dim); font: inherit; cursor: pointer; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--fg); color: var(--hl); }
button.primary, .btn.primary { background: var(--fg); color: #000; border-color: var(--fg); font-weight: 700; }
button.primary:hover { background: var(--hl); border-color: var(--hl); color: #000; }
button:disabled { opacity: .5; cursor: progress; }
button.small, .btn.small { padding: 3px 8px; font-size: .8em; }
button.link { border: 0; padding: 0; color: var(--fg); text-decoration: underline dotted; }
:focus-visible { outline: 2px dashed var(--hl); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { padding: 2px 10px; border: 1px solid var(--border); color: var(--faint); cursor: pointer; font-size: .85em; background: transparent; }
.chip[aria-pressed="true"], .chip.on { color: #000; background: var(--fg); border-color: var(--fg); }

/* ---- data display --------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--fg-dim); }
.kv dd { margin: 0; word-break: break-word; color: var(--soft); }
table.data { width: 100%; border-collapse: collapse; font-size: .9em; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--fg); font-weight: 400; white-space: nowrap; }
table.data td { word-break: break-word; }
table.data tr:hover td { background: rgba(255, 255, 255, .02); }
.table-wrap { overflow-x: auto; }
pre, code { font-family: var(--mono); }
pre.code {
  margin: 0; padding: 10px; background: #000; border: 1px solid var(--border);
  overflow: auto; white-space: pre-wrap; word-break: break-all; max-height: 420px; color: var(--soft); font-size: .85em;
}
.out-box { padding: 10px; min-height: 2.6em; background: #000; border: 1px solid var(--border); word-break: break-all; white-space: pre-wrap; color: var(--soft); }

.muted { color: var(--faint); }
.dim { color: var(--fg-dim); }
.hl { color: var(--hl); }
.fg { color: var(--fg); }
.err { color: var(--sev-critical); }
.ok { color: var(--sev-ok); }
.small { font-size: .82em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

.badge { display: inline-block; padding: 0 7px; font-size: .78em; border: 1px solid currentColor; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.sev-critical { color: var(--sev-critical); }
.sev-high { color: var(--sev-high); }
.sev-medium { color: var(--sev-medium); }
.sev-low { color: var(--sev-low); }
.sev-info { color: var(--sev-info); }
.sev-ok, .sev-benign { color: var(--sev-ok); }

.note { border-left: 3px solid var(--fg-dim); padding: 6px 12px; color: var(--faint); margin: 0 0 14px; font-size: .9em; }
.note.warn { border-color: var(--sev-medium); }
.note.bad { border-color: var(--sev-critical); }

.spinner::after { content: "⠋"; display: inline-block; animation: spin .8s steps(8) infinite; margin-left: .4em; color: var(--fg); }
@keyframes spin {
  0% { content: "⠋" } 12% { content: "⠙" } 25% { content: "⠹" } 37% { content: "⠸" }
  50% { content: "⠼" } 62% { content: "⠴" } 75% { content: "⠦" } 87% { content: "⠧" }
}

details { border: 1px solid var(--border); margin: 0 0 8px; background: var(--panel); }
details > summary { cursor: pointer; padding: 8px 12px; color: var(--fg); list-style: none; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; color: var(--fg-dim); }
details[open] > summary::before { content: "▾"; }
details > .body { padding: 4px 12px 12px; }

.toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--fg); color: #000; padding: 6px 14px; font-weight: 700; z-index: 50;
  animation: fade 1.6s forwards;
}
@keyframes fade { 0%, 75% { opacity: 1 } 100% { opacity: 0 } }

@media (max-width: 600px) {
  body { font-size: 14px; }
  main.wrap { padding: 14px 12px 32px; }
  .bar nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bar .caret, .spinner::after { animation: none; }
}
@media print {
  body { background: #fff; color: #000; background-image: none; }
  .bar, .foot, .no-print, button { display: none !important; }
}
