/* just-dna registry console. One file, no build step, no framework. */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --panel-2: #f0f2f5; --line: #dfe3e8;
  --fg: #1c2128; --muted: #5c6672; --faint: #8a94a0;
  --accent: #1f8f7c; --accent-fg: #ffffff; --accent-soft: #dff4ef;
  --warn: #b7791f; --warn-soft: #fcefd6; --bad: #c0392b; --bad-soft: #fbe3e0;
  --good: #2e8b57; --good-soft: #def5e6; --info: #2f6db3; --info-soft: #e0ecfa;
  --test: #8e44ad; --test-soft: #efe2f7;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418; --panel: #171d23; --panel-2: #1f262e; --line: #2a333d;
    --fg: #e6ebf0; --muted: #a3adb8; --faint: #6f7a86;
    --accent: #33b5a0; --accent-fg: #06110f; --accent-soft: #143530;
    --warn: #e0a344; --warn-soft: #3a2c12; --bad: #e46a5c; --bad-soft: #3d1c19;
    --good: #57c383; --good-soft: #143421; --info: #6aa3e6; --info-soft: #172a40;
    --test: #c084e0; --test-soft: #2f1a3a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; margin: 8px 0; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
pre code { background: none; padding: 0; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--fg); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.small { padding: 3px 9px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { width: 100%; min-height: 90px; font-family: var(--mono); font-size: 12.5px; }
label { color: var(--muted); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── top bar ──────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 22px; padding: 0 22px; height: 54px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-size: 16px; }
.brand svg { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.nav a.active, .nav a:hover { color: var(--fg); background: var(--panel-2); text-decoration: none; }
.server { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.server .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.server.ok .dot { background: var(--good); } .server.bad .dot { background: var(--bad); } .server.degraded .dot { background: var(--warn); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; border: 1px solid transparent; }
.badge.prod { background: var(--accent-soft); color: var(--accent); }
.badge.test { background: var(--test-soft); color: var(--test); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--panel-2); color: var(--muted); }
.badge.outline { background: transparent; border-color: var(--line); color: var(--muted); }

.view { max-width: 1240px; margin: 0 auto; padding: 22px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 14px 22px 30px; color: var(--faint); font-size: 12px; }
.foot .sep { margin: 0 8px; }

/* ── generic ──────────────────────────────────────────────────────────── */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field input, .field select { min-width: 140px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); font-size: 13px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 12px; }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; }
.info-box { background: var(--info-soft); color: var(--info); border-radius: 8px; padding: 10px 12px; }
.good-box { background: var(--good-soft); color: var(--good); border-radius: 8px; padding: 10px 12px; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.grid tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 8px 12px; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.tabs button:hover { color: var(--fg); }
.tabs button .count { margin-left: 6px; color: var(--faint); font-weight: 400; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: 12px; cursor: pointer; color: var(--fg); }
.chip:hover { border-color: var(--accent); }
.chip.static { cursor: default; }
.chip.static:hover { border-color: var(--line); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tile { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.tile .n { font-size: 20px; font-weight: 700; line-height: 1.1; }
.tile .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); max-width: 420px; }
.toast.bad { border-left-color: var(--bad); } .toast.good { border-left-color: var(--good); } .toast.warn { border-left-color: var(--warn); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); }
details > summary { cursor: pointer; color: var(--muted); }
details[open] > summary { margin-bottom: 8px; }

/* ── catalog ──────────────────────────────────────────────────────────── */
.catalog-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { flex: 1; min-width: 240px; position: relative; }
.search input { width: 100%; padding-left: 34px; height: 38px; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--faint); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .field input, .filters .field select { min-width: 120px; max-width: 170px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); color: var(--fg); position: relative; }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card .head { display: flex; gap: 10px; align-items: center; }
.card .icon { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; overflow: hidden; }
.card .icon img { width: 100%; height: 100%; object-fit: cover; }
.card .title { font-weight: 600; font-size: 15px; line-height: 1.2; }
.card .id { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.card .desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.5em; }
.card .meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--faint); font-size: 12px; margin-top: auto; }
.card .meta b { color: var(--muted); font-weight: 600; }
.card .flags { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }

/* ── module detail ────────────────────────────────────────────────────── */
.mod-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.mod-head .icon { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; overflow: hidden; flex: none; }
.mod-head .icon img { width: 100%; height: 100%; object-fit: cover; }
.mod-head .titles { flex: 1; min-width: 240px; }
.mod-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.md { line-height: 1.6; max-width: 80ch; }
.md h1 { font-size: 20px; margin-top: 18px; } .md h2 { font-size: 17px; margin-top: 16px; } .md h3 { font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--fg); margin-top: 14px; }
.md p { margin: 8px 0; } .md ul, .md ol { padding-left: 22px; } .md blockquote { border-left: 3px solid var(--line); margin: 8px 0; padding: 2px 12px; color: var(--muted); }
.md table { border-collapse: collapse; margin: 8px 0; } .md th, .md td { border: 1px solid var(--line); padding: 4px 8px; }
.md img { max-width: 100%; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.json { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.json details { margin-left: 14px; } .json details > summary { list-style: none; color: var(--fg); }
.json details > summary::before { content: "▸ "; color: var(--faint); } .json details[open] > summary::before { content: "▾ "; }
.json .k { color: var(--info); } .json .s { color: var(--good); } .json .n { color: var(--warn); } .json .b { color: var(--test); } .json .z { color: var(--faint); }
.json .leaf { margin-left: 14px; }
.version-row.yanked td { opacity: .55; text-decoration: line-through; }
.stars { color: var(--warn); letter-spacing: 1px; }
.review { border-top: 1px solid var(--line); padding: 10px 0; }
.review:first-child { border-top: 0; }

/* ── reports ──────────────────────────────────────────────────────────── */
.finding { display: flex; gap: 8px; padding: 3px 0; font-family: var(--mono); font-size: 12.5px; }
.finding .mark { flex: none; width: 14px; font-weight: 700; }
.finding.err .mark { color: var(--bad); } .finding.warn .mark { color: var(--warn); } .finding.info .mark { color: var(--faint); }
.verdict { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.pass { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.pass h4 { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.pass .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; font-size: 12.5px; }
.pass .fields .f { display: flex; gap: 6px; justify-content: space-between; border-bottom: 1px dotted var(--line); }
.pass .fields .f b { font-weight: 600; }
.pass .fields .f.flag b { color: var(--warn); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input[type=file] { display: none; }
.filelist { max-height: 160px; overflow: auto; font-family: var(--mono); font-size: 12px; text-align: left; margin-top: 8px; }
.progress { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
