:root {
  --red: #c90018;
  --red-soft: #fdeef0;
  --ink: #171615;
  --muted: #716d68;
  --line: #e3dfd8;
  --paper: #f7f5f1;
  --card: #ffffff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 24px 16px 60px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.page { max-width: 1180px; margin: 0 auto; }

header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--red); color: #fff; font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
h1 { margin: 4px 0 2px; font-size: clamp(20px, 4.5vw, 26px); line-height: 1.2; }
.subtitle { margin: 0; color: var(--muted); font-size: 12.5px; }

nav { display: flex; gap: 6px; margin: 20px 0 12px; flex-wrap: wrap; }
nav a {
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--card);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 12.5px;
}
nav a.is-active { background: var(--red); border-color: var(--red); color: #fff; }

.toolbar {
  display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; align-items: center;
}
.toolbar .search {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--card); color: var(--ink);
}
.toolbar .search:focus { outline: 2px solid var(--red); outline-offset: -1px; border-color: var(--red); }
.toolbar a, .toolbar button {
  padding: 10px 14px; border: 1px solid var(--ink); border-radius: 10px; background: var(--card);
  color: var(--ink); font: inherit; font-weight: 600; font-size: 12.5px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.toolbar a:hover, .toolbar button:hover { background: var(--ink); color: #fff; }
.result-count { margin: 0 0 10px; color: var(--muted); font-size: 12px; }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--paper);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
tbody tr:last-child td { border-bottom: none; }
tr { break-inside: avoid; }

.country-row td {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
}
.uni-name { font-weight: 700; font-size: 14.5px; }
.uni-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.uni-meta a { overflow-wrap: anywhere; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; font-size: 12.5px; }
.early {
  display: inline-block; margin-top: 4px;
  padding: 2px 8px; border-radius: 99px;
  background: var(--red); color: #fff;
  font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
}
.conditions { max-width: 340px; font-size: 12.5px; }
footer { margin-top: 20px; color: var(--muted); font-size: 11.5px; }
a.site-link { color: var(--red); }
.no-results { padding: 26px 16px; text-align: center; color: var(--muted); display: none; }
td.is-empty-value { color: var(--line); }

/* ── Mobile: table becomes stacked cards ─────────────────────────── */
@media (max-width: 760px) {
  body { padding: 16px 10px 48px; }
  .table-wrap { background: none; border: none; border-radius: 0; overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr {
    background: var(--card);
    border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 10px;
  }
  tbody tr.country-row {
    background: none; border: none; border-radius: 0;
    padding: 14px 2px 4px; margin-bottom: 2px;
  }
  .country-row td { background: none; padding: 0; }
  td { border: none; padding: 4px 0; }
  td.is-empty, td.is-empty-value { display: none; }
  td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--muted); margin-bottom: 1px;
  }
  .conditions { max-width: none; }
  .toolbar a, .toolbar button { flex: 1 1 auto; text-align: center; }
}

/* ── Print / save as PDF: compact table ──────────────────────────── */
@media print {
  body { padding: 0; font-size: 10.5px; background: #fff; }
  nav, .toolbar, .result-count { display: none; }
  .table-wrap { border: none; border-radius: 0; }
  a.site-link { color: inherit; text-decoration: none; }
  th, td { padding: 5px 6px; }
  thead th { position: static; }
  .early { background: none; color: var(--red); padding: 0; }
  .country-row td { background: none; border-top: 2px solid var(--ink); color: var(--ink); }
}
