:root {
  --bg: #f6f7f9; --surface: #fff; --surface-2: #f1f3f5; --line: #e2e5e9; --ink: #16191d; --ink-2: #5b636d; --ink-3: #8a929b;
  --brand: #0f766e; --brand-ink: #fff; --brand-soft: #e6f4f2;
  --critical: #b91c1c; --high: #c2410c; --medium: #a16207; --low: #4d7c0f;
  --critical-bg: #fde8e8; --high-bg: #feeddf; --medium-bg: #fdf3d7; --low-bg: #ecf5dc;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: system-ui, -apple-system, "Segoe UI", Rubik, Arial, sans-serif; color: var(--ink); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1214; --surface: #171b1f; --surface-2: #1e2328; --line: #2a3036; --ink: #e8eaed; --ink-2: #a7afb7; --ink-3: #7d858d;
    --brand: #2dd4bf; --brand-ink: #062a27; --brand-soft: #0f2e2b;
    --critical-bg: #3a1414; --high-bg: #3a2010; --medium-bg: #332a0c; --low-bg: #1f2c0e; --critical: #f87171; --high: #fb923c; --medium: #facc15; --low: #a3e635; }
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.5; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand img { width: 24px; height: 24px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); }
.topbar nav a.active, .topbar nav a:hover { background: var(--surface-2); color: var(--ink); }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: none; padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.lang-switch button.on { background: var(--brand); color: var(--brand-ink); }

main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; direction: ltr; unicode-bidi: plaintext; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: start; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--critical); border-color: var(--critical); }
.btn.ghost { border-color: transparent; background: none; }
.btn:disabled { opacity: .55; cursor: default; }

label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 120px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.auth { max-width: 380px; margin: 10vh auto; }
.error { color: var(--critical); font-size: 14px; min-height: 1.2em; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--brand); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .n { opacity: .7; margin-inline-start: 4px; }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.sev-critical { background: var(--critical-bg); color: var(--critical); }
.sev-high { background: var(--high-bg); color: var(--high); }
.sev-medium { background: var(--medium-bg); color: var(--medium); }
.sev-low { background: var(--low-bg); color: var(--low); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #16a34a; } .dot.error { background: var(--critical); } .dot.unknown { background: var(--ink-3); }

.layout-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1000px) { .layout-split.has-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.list-item:first-child { border-top: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item.active { background: var(--brand-soft); }
.list-item .t { font-weight: 500; overflow-wrap: anywhere; }
.list-item .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.bulkbar { position: sticky; top: 52px; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px; border-radius: var(--radius); background: var(--ink); color: var(--surface); }
.bulkbar .btn { background: transparent; color: inherit; border-color: rgba(255,255,255,.3); }

.detail { position: sticky; top: 68px; max-height: calc(100vh - 90px); overflow: auto; }
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; }
.md ol, .md ul { margin: 0 0 8px; padding-inline-start: 22px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.evidence { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; display: block; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); transition: width .4s; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: start; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--ink-2); font-weight: 500; font-size: 13px; }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(520px, 94vw); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog.wide { width: min(720px, 94vw); }
dialog .t { width: 100%; }
dialog select { max-width: 100%; }
#toast { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
[dir=ltr] #toast { transform: translateX(-50%); }
#toast.show { opacity: 1; }
.secret-box { background: var(--surface-2); border: 1px dashed var(--line); padding: 10px; border-radius: 8px; word-break: break-all; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }
@media (max-width: 640px) { .topbar { flex-wrap: wrap; } main { padding: 16px 12px 60px; } }
.frames { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.frame { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.frame img { width: 100%; height: 150px; object-fit: cover; object-position: top; border-radius: 6px; background: var(--surface-2); }
