:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --border: #e2e6ec;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
             font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

header {
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 12px 28px;
}
header .header-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 1400px; margin: 0 auto;
}
header h1 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
header .header-versions { display: flex; gap: 4px; }
.ver-pill {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
  background: #f1f5f9; color: var(--muted); letter-spacing: 0.02em;
}
.ver-pill-vich { background: #fef3c7; color: #92400e; }
.ver-pill-emdr { background: #dbeafe; color: #1e3a8a; }
.ver-pill-faers { background: #dcfce7; color: #166534; }
header .header-info ul { margin: 8px 0 0; padding-left: 20px; }
header .header-info li { margin: 4px 0; }
header .header-info { margin-left: auto; font-size: 12px; }
header .header-info summary {
  cursor: pointer; color: var(--accent); list-style: none;
  user-select: none; padding: 4px 8px; border-radius: 4px;
}
header .header-info summary:hover { background: #f1f5f9; }
header .header-info summary::-webkit-details-marker { display: none; }
header .header-info[open] summary { color: var(--accent-hover); }
header .header-info p {
  margin: 8px 0 0; padding: 12px; background: #f8fafc; border-radius: 6px;
  border: 1px solid var(--border); color: var(--muted); font-size: 12px;
  max-width: 1400px; line-height: 1.5;
}
header .sub { margin: 8px 0 0; color: var(--muted); font-size: 13px; max-width: 1400px; }

main { padding: 24px 28px; max-width: 1400px; margin: 0 auto; }

/* ---------- Input section ---------- */
.input { background: var(--panel); border: 1px solid var(--border);
         border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab { background: transparent; border: none; padding: 8px 14px; border-radius: 6px;
       cursor: pointer; color: var(--muted); font-size: 14px; }
.tab.active { background: var(--bg); color: var(--text); font-weight: 600; }

.panel.hidden { display: none; }
textarea {
  width: 100%; min-height: 280px; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; font-family: var(--mono); font-size: 12.5px; resize: vertical;
  background: #fafbfc;
}
input[type=file] { padding: 8px 0; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
button { background: var(--accent); color: white; border: none; border-radius: 6px;
         padding: 9px 16px; font-size: 14px; cursor: pointer; }
button:hover { background: var(--accent-hover); }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }
button.secondary:hover { background: #f1f5f9; }
.status { color: var(--muted); font-size: 13px; }

/* ---------- Report section ---------- */
.report.hidden { display: none; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }

/* ---------- Classified report ---------- */
.classified { margin: 6px 0 16px; }
.classified.hidden { display: none; }
.classified h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted);
                 text-transform: uppercase; letter-spacing: 0.04em; }
.classified-grid { display: grid;
                   grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
                   gap: 10px; }
.cls-card { background: var(--panel); border: 1px solid var(--border);
            border-radius: 8px; padding: 10px 12px; cursor: pointer;
            transition: border-color 0.12s, box-shadow 0.12s; }
.cls-card:hover { border-color: var(--accent);
                  box-shadow: 0 0 0 1px var(--accent) inset; }
.cls-head { display: flex; align-items: center; justify-content: space-between;
            gap: 8px; margin-bottom: 4px; }
.cls-src { font-weight: 600; font-size: 13px; color: var(--text); }
.cls-total { font-size: 18px; font-weight: 700; color: var(--text);
             background: #f1f5f9; padding: 2px 10px; border-radius: 999px; min-width: 32px; text-align: center; }
.cls-sub { display: flex; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.cls-err { color: var(--err); font-weight: 600; }
.cls-warn { color: var(--warn); font-weight: 600; }
.cls-rules { margin: 0; padding: 0; list-style: none; font-size: 11px; }
.cls-rules li { display: flex; justify-content: space-between; padding: 2px 0;
                border-top: 1px dashed var(--border); color: var(--muted); }
.cls-rules li:first-child { border-top: none; }
.cls-rule { font-family: var(--mono); word-break: break-all; }
.cls-count { flex-shrink: 0; margin-left: 8px; font-weight: 600; color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
        padding: 14px; text-align: center; }
.card span { display: block; font-size: 28px; font-weight: 700; line-height: 1; }
.card label { display: block; margin-top: 6px; color: var(--muted); font-size: 12px;
              text-transform: uppercase; letter-spacing: 0.04em; }
.ok-card span.ok { color: var(--ok); }
.ok-card span.fail { color: var(--err); }
.err-card { background: var(--err-bg); }
.err-card span { color: var(--err); }
.warn-card { background: var(--warn-bg); }
.warn-card span { color: var(--warn); }

.filters { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; }
.filters label { font-size: 13px; color: var(--muted); }
#f-search { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
            font-size: 13px; }

table.issues { width: 100%; border-collapse: collapse; background: var(--panel);
               border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
table.issues th, table.issues td { padding: 8px 10px; border-bottom: 1px solid var(--border);
                                   text-align: left; font-size: 12.5px; vertical-align: top; }
table.issues th { background: #f1f5f9; font-weight: 600; color: var(--muted);
                  text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; }
table.issues tr.error td { background: var(--err-bg); }
table.issues tr.warning td { background: var(--warn-bg); }
table.issues td.sev { font-weight: 700; text-transform: uppercase; font-size: 11px; }
table.issues tr.error td.sev { color: var(--err); }
table.issues tr.warning td.sev { color: var(--warn); }
table.issues td.mono, table.issues td.xpath { font-family: var(--mono); font-size: 11.5px;
                                              color: var(--muted); word-break: break-all; }
.no-issues { text-align: center; padding: 30px; color: var(--ok); font-weight: 600; }

footer { padding: 18px 28px; color: var(--muted); font-size: 12px;
         border-top: 1px solid var(--border); margin-top: 30px; background: var(--panel); }
