:root {
  --bg: #f3f5f8; --card: #ffffff; --fg: #10202e; --muted: #5b6b79; --line: #d4dbe2;
  --accent: #0f5fa8; --accent-fg: #ffffff; --ok: #12692f; --warn: #9a5600; --ko: #b71c1c;
  --ok-bg: #e3f3e7; --warn-bg: #fdf0d9; --ko-bg: #fde5e3; --info-bg: #e8edf2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1218; --card: #141e27; --fg: #e8eef3; --muted: #9aabb9; --line: #2b3a47;
    --accent: #5aa9f0; --accent-fg: #06121c; --ok: #6fd28b; --warn: #f2b45a; --ko: #ff8078;
    --ok-bg: #12301c; --warn-bg: #3a2a0c; --ko-bg: #3d1614; --info-bg: #1f2c37;
  }
}
* { box-sizing: border-box; }
html { font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); padding-bottom: env(safe-area-inset-bottom); }
main { max-width: 900px; margin: 0 auto; padding: 12px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #0f2a43; color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand i { font-style: normal; }
.brand span { font-weight: 400; opacity: 0.8; font-size: 0.95rem; margin-left: 6px; }
.net { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
h1 { font-size: 1.4rem; margin: 0 0 10px; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
h3 { font-size: 1.05rem; margin: 18px 0 6px; }
p { margin: 0 0 10px; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 12px 0 4px; min-width: 0; }
legend { font-weight: 700; padding: 0 8px 0 0; }
label { display: block; margin-bottom: 12px; font-size: 0.95rem; color: var(--muted); }
label small, .hint { color: var(--muted); font-size: 0.85rem; }
input, select, button, .button { font: inherit; }
input:not([type=checkbox]), select {
  display: block; width: 100%; min-height: 48px; margin-top: 4px; padding: 8px 12px;
  color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input:disabled { opacity: 0.5; }
.grid { display: grid; gap: 0 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--fg); flex-wrap: wrap; }
.check input { width: 24px; height: 24px; flex: none; }

.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.suggest:empty { display: none; }
.chip { min-height: 40px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }

button.primary, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 10px 20px; margin: 4px 6px 8px 0;
  border-radius: 12px; border: 1px solid var(--accent); color: var(--accent); background: transparent; text-decoration: none; font-weight: 700; cursor: pointer;
}
button.primary, .button.primary { background: var(--accent); color: var(--accent-fg); }
button.primary { width: 100%; margin: 8px 0 0; }
button:disabled { opacity: 0.6; }
.htmx-indicator { display: none; color: var(--muted); margin: 10px 0 0; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { display: block; }

.verdict { text-align: center; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.03em; padding: 12px; border-radius: 12px; margin: 10px 0; border: 2px solid; }
.ok { color: var(--ok); background: var(--ok-bg); }
.warn { color: var(--warn); background: var(--warn-bg); }
.ko { color: var(--ko); background: var(--ko-bg); }
.info { color: var(--muted); background: var(--info-bg); }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.sim { color: var(--warn); font-weight: 700; }
.alert { border-color: var(--ko); color: var(--ko); background: var(--ko-bg); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpis div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--muted); font-size: 0.85rem; }
.kpis b { display: block; color: var(--fg); font-size: 1.25rem; }

table { border-collapse: collapse; width: 100%; }
.checks th { text-align: left; white-space: nowrap; padding: 8px 10px 8px 0; vertical-align: top; }
.checks td { padding: 8px 10px 8px 0; vertical-align: top; border: 0; }
.checks tr { border-top: 1px solid var(--line); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data th, .data td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.data th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.data th:first-child, .data td:first-child { text-align: left; }

.list { list-style: none; margin: 0 0 8px; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.list a { flex: 1; display: block; padding: 12px 0; color: var(--fg); text-decoration: none; min-height: 48px; }
.list a span { display: block; color: var(--muted); font-size: 0.85rem; }
.sources { margin: 0 0 10px; padding-left: 18px; font-size: 0.9rem; }
.disclaimer { max-width: 900px; margin: 0 auto; padding: 4px 16px 20px; color: var(--muted); font-size: 0.82rem; }
.disclaimer.inline { padding: 10px 0 0; border-top: 1px solid var(--line); margin-top: 12px; }
