:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d232b; --muted: #5d6773; --line: #dde1e6;
  --accent: #b3122e; --accent-text: #fff; --warn: #9a5b00; --warn-bg: #fff3dc;
  --high: #1d6b3a; --high-bg: #e2f4e8; --mid: #7a5a00; --mid-bg: #fdf3d0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; font-size: 15px; }
main { max-width: 1400px; margin: 0 auto; padding: 0 16px 40px; }
h1 { font-size: 1.25rem; margin: 0; }
a { color: #0b4f9c; }
.muted { color: var(--muted); font-size: .9em; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
       background: var(--card); border-bottom: 3px solid var(--accent); margin-bottom: 16px; }
.top form { margin: 0; }
button, .button { display: inline-block; font: inherit; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; min-height: 40px; }
.button.secondary { background: var(--card); color: var(--text); border-color: var(--line); }
button.link { background: none; border: none; color: #0b4f9c; padding: 4px; text-decoration: underline; min-height: 0; }
input, select { font: inherit; padding: 7px 8px; border: 1px solid #b8bfc8; border-radius: 6px; width: 100%;
  background: #fff; color: var(--text); min-height: 40px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: .95rem; }
label.check input { width: auto; min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0; padding: 6px 10px 10px;
  display: flex; flex-wrap: wrap; gap: 4px 18px; }
legend { font-size: .9rem; color: var(--muted); padding: 0 4px; }
.notice, .alert, .about, .filter-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 0 0 12px; }
.alert { background: var(--warn-bg); border-color: #f0c674; color: #5c3a00; }
.about summary, .filter-box summary { cursor: pointer; font-weight: 600; }
.about p { margin: 8px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.grid .wide { grid-column: 1 / -1; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.pair label { min-width: 0; }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 8px; }
.summary p { margin: 0; }
.exports { display: flex; gap: 8px; }
.results { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.results th, .results td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--line); }
.results th { background: #eef0f3; font-size: .85rem; color: var(--muted); font-weight: 600; }
.firm a { font-weight: 600; }
.firm .muted { display: block; }
.code { font-variant-numeric: tabular-nums; font-weight: 600; }
.people ul { list-style: none; margin: 0; padding: 0; }
.people li { margin-bottom: 6px; }
.people li:last-child { margin-bottom: 0; }
.who { font-weight: 600; margin-right: 4px; }
.reason { display: block; color: var(--muted); font-size: .8rem; }
.tag { display: inline-block; font-size: .78rem; padding: 1px 7px; border-radius: 10px; background: #eceff3; white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.c-PL { background: #fde3e7; color: #8c0f25; }
.tag.conf-2 { background: var(--high-bg); color: var(--high); }
.tag.conf-1 { background: var(--mid-bg); color: var(--mid); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0; }
.login { max-width: 360px; margin: 12vh auto; background: var(--card); padding: 24px; border-radius: 10px; border: 1px solid var(--line); }
.login h1 { margin-bottom: 16px; }
.login form { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .results, .results tbody, .results tr, .results td { display: block; width: 100%; }
  .results { background: none; border: none; }
  .results thead { display: none; }
  .results tr { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; padding: 4px 0; }
  .results td { border: none; padding: 4px 12px; }
  .results td[data-label] { display: flex; gap: 8px; }
  .results td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .85rem; min-width: 92px; flex-shrink: 0; }
  .results td.people { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
}
.nowrap { white-space: nowrap; }
