/* Public site — kit-local styles on top of colors_and_type.css */

* { box-sizing: border-box; }
body { margin: 0; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.cm-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--cm-rule);
  backdrop-filter: saturate(140%);
}
/* Leaflet's internal panes go up to z-index 700 (popups). Without this,
   the map renders on top of the sticky header when scrolling past it.
   Re-asserted here so Leaflet's container stays in its own stacking context. */
.leaflet-container, .leaflet-pane, .leaflet-top, .leaflet-bottom {
  z-index: auto;
}
.leaflet-pane { z-index: 400 !important; }
.leaflet-tile-pane { z-index: 200 !important; }
.leaflet-overlay-pane { z-index: 400 !important; }
.leaflet-shadow-pane { z-index: 500 !important; }
.leaflet-marker-pane { z-index: 600 !important; }
.leaflet-tooltip-pane { z-index: 650 !important; }
.leaflet-popup-pane { z-index: 700 !important; }
.cm-header .inner {
  max-width: var(--cm-container);
  margin: 0 auto;
  padding: 10px var(--cm-gutter);
  display: flex; align-items: center; gap: 32px;
}
.cm-header .brand img { height: 28px; display: block; }
.cm-header nav { display: flex; gap: 24px; flex: 1; }
.cm-header nav a { color: var(--cm-ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.cm-header nav a:hover { color: var(--cm-navy-700); }
.cm-header nav a.active { color: var(--cm-navy-700); }
.cm-header nav a.cm-nav-new { color: var(--cm-navy-800); font-weight: 600; }
.cm-header nav a.cm-nav-new::after { content: 'NEW'; display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; background: var(--cm-accent-600); color: #fff; padding: 1px 4px; border-radius: 2px; margin-left: 4px; vertical-align: 2px; line-height: 1; white-space: nowrap; }
.cm-header nav a.cm-nav-new { white-space: nowrap; }
.cm-header .right { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.cm-toggle { display: inline-flex; border: 1px solid var(--cm-rule); border-radius: 4px; overflow: hidden; font-family: var(--cm-mono); font-size: 11px; font-weight: 600; flex-shrink: 0; }
.cm-toggle button { padding: 4px 9px; background: #fff; color: var(--cm-ink-soft); border: 0; cursor: pointer; min-width: 26px; }
.cm-toggle button.on { background: var(--cm-navy-700); color: #fff; }

/* Sitewide share button (header). Icon-only, ghost style. Country-aware
   text in the share is set in Base.astro's click handler. */
.cm-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--cm-rule);
  border-radius: 999px;
  background: #fff;
  color: var(--cm-ink);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.cm-share svg { width: 15px; height: 15px; stroke: currentColor; }
.cm-share:hover {
  border-color: var(--cm-accent-600);
  color: var(--cm-accent-700);
  box-shadow: 0 0 0 3px rgba(243, 156, 44, 0.10);
}

/* Header login pill — modern, restrained, ghost-style with subtle hover ring */
.cm-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 11px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--cm-sans);
  color: var(--cm-ink);
  text-decoration: none;
  border: 1px solid var(--cm-rule);
  border-radius: 999px;
  background: #fff;
  transition: border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
  white-space: nowrap;
}
.cm-login svg { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.cm-login:hover {
  border-color: var(--cm-navy-700);
  color: var(--cm-navy-700);
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08);
}
.cm-login::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cm-accent-600);
  flex-shrink: 0;
  margin-right: 1px;
}
/* Signed-in pill: bold colored initial replaces the green dot.
   No circle — just the letter, easier to render correctly on every device. */
.cm-login.signed-in::before { display: none; }
.cm-login.signed-in { gap: 7px; }
.live-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--cm-cyan-700);
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 0;
  /* Most typefaces give capital letters slightly more right-side bearing,
     so a "T" or "A" looks right-biased inside a circle. Nudge it 1px left
     so it visually centers. */
  transform: translateX(-1px);
}
.login-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.live-name {
  font-weight: 600;
  color: var(--cm-ink);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* On narrow phones, show only the initial — the name clips otherwise.
   The pill padding is intentionally asymmetric: most uppercase letters
   (especially "T", "I", "J") read as optically left-of-center when the
   pill is geometrically square — bumping left padding +2px corrects it. */
@media (max-width: 520px) {
  .cm-login.signed-in .live-name { display: none; }
  .cm-login.signed-in { padding: 5px 9px 5px 12px; }
  .live-avatar { font-size: 14px; }
}

/* Container */
.cm-container { max-width: var(--cm-container); margin: 0 auto; padding: 0 var(--cm-gutter); }
.cm-narrow    { max-width: var(--cm-container-narrow); margin: 0 auto; padding: 0 var(--cm-gutter); }

/* Eyebrow row */
.cm-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.cm-section-head h2 { font-family: var(--cm-serif); font-size: 28px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.cm-section-head .more { font-size: 13px; color: var(--cm-navy-700); text-decoration: underline; text-decoration-color: var(--cm-navy-100); }

/* Hero */
.cm-hero { padding: 64px 0 40px; background: var(--cm-navy-700); color: #fff; }
.cm-hero h1 { font-family: var(--cm-sans); font-size: 44px; line-height: 1.1; font-weight: 700; letter-spacing: -.015em; margin: 12px 0 12px; max-width: 760px; color: #fff; }
.cm-hero p.lead { font-size: 16px; color: rgba(255,255,255,0.78); max-width: 620px; line-height: 1.55; }
.cm-hero .source { font-style: normal; font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 14px; }
.cm-hero .cm-eyebrow-tag { color: rgba(255,255,255,0.85); }

.cm-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 32px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
.cm-kpi { background: var(--cm-navy-800); padding: 22px 24px; color: #fff; }
.cm-kpi .eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,0.65); font-weight: 600; }
.cm-kpi .num { font-family: var(--cm-sans); font-size: 38px; line-height: 1; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; color: #fff; }
.cm-kpi .sub { color: rgba(255,255,255,0.6); font-size: 12px; margin-top: 8px; }
.cm-kpi .delta { font-size: 13px; margin-left: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.cm-kpi .delta:not(.down) { color: #6dd49a; }
.cm-kpi .delta.down { color: #f1948a; }
.cm-kpi .delta { font-size: 14px; color: var(--cm-up); margin-left: 8px; font-variant-numeric: tabular-nums; font-weight: 500; }
.cm-kpi .delta.down { color: var(--cm-down); }
.cm-kpi .sub { font-size: 12px; color: var(--cm-ink-soft); margin-top: 8px; }

/* Section */
.cm-section { padding: 64px 0; border-top: 1px solid var(--cm-rule); }
.cm-section .source { font-style: italic; font-size: 12px; color: var(--cm-ink-faint); margin-top: 14px; }

/* Card */
.cm-card { background: #fff; border: 1px solid var(--cm-rule); border-radius: 6px; }
.cm-card .pad { padding: 24px; }

/* Table */
.cm-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums lining-nums; }
.cm-table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cm-ink-faint); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--cm-rule); background: #fff; }
.cm-table td { padding: 12px 14px; border-bottom: 1px solid var(--cm-rule-soft); }
.cm-table tbody tr:hover td { background: var(--cm-paper-cool); }
.cm-table .num { text-align: right; }
.cm-table .pct.up { color: var(--cm-up); }
.cm-table .pct.down { color: var(--cm-down); }
.cm-table tbody tr:last-child td { border-bottom: 0; }

/* Buttons */
.btn { font-family: var(--cm-sans); font-size: 14px; font-weight: 500; padding: 10px 18px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; line-height: 1; transition: background 160ms ease, border-color 160ms ease; text-decoration: none; display: inline-block; }
.btn-primary   { background: var(--cm-navy-700); color: #fff; }
.btn-primary:hover { background: var(--cm-navy-800); }
.btn-secondary { background: #fff; color: var(--cm-ink); border-color: var(--cm-rule); }
.btn-secondary:hover { background: var(--cm-rule-soft); }
.btn-danger { background: var(--cm-down); color: #fff; }

/* Badges */
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 3px; letter-spacing: .02em; }
.badge-default { background: var(--cm-rule-soft); color: var(--cm-ink); }
.badge-info    { background: var(--cm-navy-100); color: var(--cm-navy-800); }
.badge-mock    { background: transparent; color: var(--cm-ink-faint); border: 1px dashed var(--cm-rule); margin-left: 8px; vertical-align: 2px; font-size: 10px; }

/* Heatmap (district grid) */
.cm-heatmap { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--cm-rule); border: 1px solid var(--cm-rule); border-radius: 6px; overflow: hidden; }
.cm-heatmap .cell { aspect-ratio: 1.4 / 1; background: #fff; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: outline 120ms; outline: 0 solid transparent; }
.cm-heatmap .cell:hover { outline: 2px solid var(--cm-navy-700); outline-offset: -2px; }
.cm-heatmap .cell .name { font-size: 13px; font-weight: 600; }
.cm-heatmap .cell .name .el { color: rgba(255,255,255,0.7); margin-left: .35em; font-size: .9em; font-weight: 400; }
.cm-heatmap .cell .v { font-family: var(--cm-serif); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1; }
.cm-heatmap .cell .pct { font-size: 11px; opacity: .85; }

/* Chart */
.cm-chart { height: 280px; position: relative; }
.cm-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cm-chart .axis text { fill: var(--cm-ink-faint); font-family: var(--cm-mono); font-size: 11px; }
.cm-chart .grid { stroke: var(--cm-rule-soft); stroke-width: 1; }

/* Story cards */
.cm-stories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cm-story { background: #fff; border: 1px solid var(--cm-rule); border-radius: 6px; overflow: hidden; }
.cm-story .img { aspect-ratio: 16 / 9; background: var(--cm-navy-700); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.4); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.cm-story .img.b { background: var(--cm-slate-700); }
.cm-story .img.c { background: linear-gradient(0deg, var(--cm-navy-800), var(--cm-navy-700)); }
.cm-story .pad { padding: 18px 20px; }
.cm-story h3 { font-family: var(--cm-serif); font-size: 19px; line-height: 1.25; font-weight: 600; margin: 0 0 8px; }
.cm-story .meta { font-size: 11px; color: var(--cm-ink-faint); letter-spacing: .04em; text-transform: uppercase; }

/* B2B band */
.cm-b2b { background: var(--cm-slate-700); color: #fff; padding: 80px 0; border-top: 0; }
.cm-b2b h2 { color: #fff; }
.cm-b2b p { color: rgba(255,255,255,0.78); max-width: 580px; }
.cm-b2b .btn-primary { background: #fff; color: var(--cm-navy-800); }

/* Footer */
.cm-footer { background: var(--cm-slate-900); color: rgba(255,255,255,0.7); padding: 56px 0 32px; margin-top: auto; }
.cm-footer .grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.cm-footer h4 { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin: 0 0 12px; }
.cm-footer ul { list-style: none; padding: 0; margin: 0; }
.cm-footer li { margin-bottom: 8px; font-size: 13px; }
.cm-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.cm-footer a:hover { color: #fff; text-decoration: underline; }
.cm-footer .colophon { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,0.5); }

/* Eyebrow tag in hero */
.cm-eyebrow-tag { display: inline-flex; gap: 8px; align-items: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cm-ink-faint); font-weight: 600; }
.cm-eyebrow-tag .dot { width: 6px; height: 6px; background: var(--cm-up); border-radius: 50%; }

/* Forms */
.cm-form { display: grid; gap: 14px; }
.cm-form label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--cm-ink-faint); font-weight: 600; margin-bottom: 6px; display: block; }
.cm-form input[type=text], .cm-form input[type=email], .cm-form select, .cm-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--cm-rule); border-radius: 4px; font: inherit; font-family: var(--cm-sans); background: #fff;
}

/* Prose */
.cm-prose { max-width: 680px; }
.cm-prose h2 { font-family: var(--cm-serif); font-size: 26px; font-weight: 600; margin: 36px 0 12px; letter-spacing: -.01em; }
.cm-prose h3 { font-family: var(--cm-sans); font-size: 17px; font-weight: 600; margin: 24px 0 8px; }
.cm-prose p, .cm-prose li { color: var(--cm-ink-soft); line-height: 1.65; font-size: 15px; }
.cm-prose code { font-family: var(--cm-mono); font-size: .92em; background: var(--cm-rule-soft); padding: 1px 5px; border-radius: 3px; }
.cm-prose blockquote { border-left: 2px solid var(--cm-navy-700); margin: 16px 0; padding: 4px 14px; color: var(--cm-ink); font-family: var(--cm-serif); font-size: 17px; }

/* Disclaimer chip */
.cm-disclaimer { background: var(--cm-warn-bg); color: var(--cm-warn); padding: 8px 12px; border-radius: 4px; font-size: 12px; display: inline-flex; gap: 8px; align-items: center; }

/* ---------- Shortlist / favorites buttons ---------- */
/* Small icon-only variant for use inside program cards (e.g. /programmata grid) */
.spas-star-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.85);
  color: var(--cm-ink-soft);
  border: 1px solid var(--cm-rule);
  border-radius: 50%;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms, transform 80ms;
  padding: 0;
  font: inherit;
}
.spas-star-mini:hover {
  background: #fff;
  color: var(--cm-accent-600);
  border-color: var(--cm-accent-500);
}
.spas-star-mini:active { transform: scale(0.92); }
.spas-star-mini .star-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.spas-star-mini.is-on {
  background: var(--cm-accent-600);
  color: #fff;
  border-color: var(--cm-accent-600);
}
.spas-star-mini.is-on .star-icon { fill: currentColor; stroke: currentColor; }

/* Full-width pill variant for use on /sxoli/* and /sxoli-gr/* hero areas */
.spas-star-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background 120ms, border-color 120ms, transform 80ms;
  min-height: 38px;
}
.spas-star-pill:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }
.spas-star-pill:active { transform: scale(0.97); }
.spas-star-pill .star-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.spas-star-pill.is-on {
  background: var(--cm-accent-600);
  border-color: var(--cm-accent-600);
}
.spas-star-pill.is-on .star-icon { fill: currentColor; }

/* Icon-only variant — used for compact pills like the "Επίσημη σελίδα" globe.
   38px square so it stays a comfortable tap target alongside the text pills. */
.spas-star-pill.spas-icon-pill {
  padding: 0;
  width: 38px;
  height: 38px;
  justify-content: center;
  gap: 0;
}
.spas-star-pill.spas-icon-pill .star-icon { width: 16px; height: 16px; }
/* "Hard School" badge — auto-applied by /_hard_schools.js wherever a
   [data-hard-school-marker="CODE"] element exists, when CODE is in the
   computed top-10 hardest 2025 cutoffs. Gold gradient + trophy icon. */
.hard-school-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  color: #44320e;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 2px rgba(0,0,0,0.08);
  border: 1px solid rgba(180,108,12,0.25);
  margin-left: 6px;
}
.hard-school-badge .hsb-trophy { font-size: 10px; line-height: 1; }
.hard-school-badge .hsb-text { line-height: 1; }
/* Larger / more visible variant — used on the /sxoli hero where there's room. */
.hard-school-badge.lg {
  font-size: 11.5px;
  padding: 4px 12px 4px 10px;
  gap: 6px;
}
.hard-school-badge.lg .hsb-trophy { font-size: 13px; }

/* Hide an element visually while keeping it readable for screen-readers.
   Used on icon-only buttons that still need a label for a11y (e.g. the
   save / share pills on /sxoli). Standard "visually-hidden" recipe. */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Share modal ---------- */
#spas-share-modal {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#spas-share-modal .ssm-backdrop {
  position: absolute; inset: 0;
  background: rgba(13, 25, 41, 0.74);
  backdrop-filter: blur(4px);
}
#spas-share-modal .ssm-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 24px 80px -16px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
}
.ssm-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px 8px;
}
.ssm-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--cm-ink); }
.ssm-close {
  background: transparent; border: 0; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--cm-ink-soft);
  width: 32px; height: 32px; border-radius: 50%;
  transition: background 120ms;
}
.ssm-close:hover { background: var(--cm-paper); }
.ssm-preview {
  padding: 8px 18px 0;
}
.ssm-preview img {
  width: 100%; display: block;
  border-radius: 10px;
  border: 1px solid var(--cm-rule);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--cm-paper);
}
.ssm-actions {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 18px 8px;
}
.ssm-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; border: 0;
  transition: background 120ms;
}
.ssm-btn-primary {
  background: var(--cm-accent-600); color: #fff;
}
.ssm-btn-primary:hover { background: var(--cm-accent-700); }
.ssm-btn-secondary {
  background: var(--cm-paper); color: var(--cm-ink); border: 1px solid var(--cm-rule);
}
.ssm-btn-secondary:hover { background: var(--cm-surface); border-color: var(--cm-ink-soft); }
.ssm-hint {
  margin: 0; padding: 4px 18px 18px;
  font-size: 12px; color: var(--cm-ink-faint); text-align: center; line-height: 1.5;
}

/* ---------- Share button (used on results pages) ---------- */
.spas-share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 6px;
  font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms, transform 80ms;
}
.spas-share-btn:hover { background: rgba(255,255,255,0.28); border-color: rgba(255,255,255,0.55); }
.spas-share-btn:active { transform: scale(0.97); }
.spas-share-btn svg { width: 14px; height: 14px; }

/* Icon-only variant for share/save buttons. Used across /grades, /grades-gr,
   /sxoli, /sxoli-gr, /account — anywhere we have a results pill row. The
   text label moves to .sr-only so it remains accessible to screen-readers
   and shows on hover via the title attribute. */
.spas-share-btn.icon-only,
.save-grades-btn.icon-only,
.save-gr-btn.icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  gap: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spas-share-btn.icon-only svg,
.save-grades-btn.icon-only svg,
.save-gr-btn.icon-only svg { width: 15px; height: 15px; }

/* ---------- Global country switch in header ---------- */
.header-country-switch {
  position: relative;
  display: inline-flex;
  background: var(--cm-paper);
  border: 1px solid var(--cm-rule);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}
.hcs-pill {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 0;
  background: transparent;
  color: var(--cm-ink-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  transition: color 200ms;
  min-height: 26px;
}
.hcs-pill:hover { color: var(--cm-ink); }
.hcs-pill.is-active { color: var(--cm-navy-700); }
.hcs-pill .hcs-flag { font-size: 14px; line-height: 1; }
.hcs-thumb {
  position: absolute;
  z-index: 1;
  top: 3px; left: 3px;
  height: calc(100% - 6px);
  width: calc(50% - 3px);
  background: #fff;
  border-radius: 999px;
  transition: transform 240ms cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: 0 1px 3px -1px rgba(0,0,0,0.18);
}
.header-country-switch[data-active="gr"] .hcs-thumb { transform: translateX(100%); }

@media (max-width: 720px) {
  /* Mobile: shrink to flag-only buttons (no labels) to save header room */
  .hcs-pill .hcs-name { display: none; }
  .hcs-pill { padding: 5px 10px; min-height: 24px; }
  .hcs-pill .hcs-flag { font-size: 15px; }
}
@media (max-width: 380px) {
  /* Extra-tight phones: keep the switch visible — students need country pick.
     Use an ultra-compact flag-only form rather than hiding it. */
  .header-country-switch { padding: 2px; }
  .hcs-pill { padding: 4px 7px; min-height: 22px; }
  .hcs-pill .hcs-flag { font-size: 14px; }
}

/* ---------- ARWU 2025 ranking badge ---------- */
.arwu-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  background: linear-gradient(135deg, #b8860b 0%, #ffd700 50%, #ffcd5c 100%);
  color: #2a1d00;
  font-family: var(--cm-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 6px -2px rgba(184, 134, 11, 0.45), inset 0 1px 0 rgba(255,255,255,0.35);
  border: 1px solid rgba(184, 134, 11, 0.4);
  transition: transform 100ms, box-shadow 140ms;
  white-space: nowrap;
}
.arwu-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -2px rgba(184, 134, 11, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.arwu-badge:active { transform: translateY(0); }
.arwu-badge .arwu-trophy { font-size: 13px; line-height: 1; }
.arwu-badge .arwu-rank { font-family: var(--cm-mono); font-size: 10px; opacity: 0.85; }
/* Small icon-only variant for use inside dense card grids (e.g. /programmata) */
.arwu-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  background: linear-gradient(135deg, #b8860b 0%, #ffd700 100%);
  border-radius: 50%;
  font-size: 11px;
  cursor: help;
  text-decoration: none;
  box-shadow: 0 1px 3px -1px rgba(184, 134, 11, 0.5);
  border: 1px solid rgba(184, 134, 11, 0.35);
  vertical-align: middle;
}
.arwu-mini:hover { transform: scale(1.08); }

/* ---------- Center the country switch in the header (desktop only) ---------- */
@media (min-width: 721px) {
  .cm-header .inner { position: relative; }
  .cm-header .header-country-switch {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}

/* ---------- Multi-ranking badge variants ---------- */
/* Base: same shape/size as the existing .arwu-badge.
   Each variant overrides background + border to match the ranking system's "brand" tone. */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  font-family: var(--cm-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 5px -2px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.30);
  transition: transform 100ms, box-shadow 140ms;
}
.rank-badge:hover { transform: translateY(-1px); }
.rank-badge:active { transform: translateY(0); }
.rank-badge .rb-emoji { font-size: 12px; line-height: 1; }
.rank-badge .rb-name { font-weight: 700; }
.rank-badge .rb-rank { font-family: var(--cm-mono); font-size: 10px; opacity: 0.85; }

.rank-badge.tone-gold    { background: linear-gradient(135deg,#b8860b 0%,#ffd700 50%,#ffcd5c 100%); color:#2a1d00; border:1px solid rgba(184,134,11,0.4); }
.rank-badge.tone-bronze  { background: linear-gradient(135deg,#7a4b1e 0%,#cd7f32 50%,#e3a76d 100%); color:#2a1500; border:1px solid rgba(122,75,30,0.45); }
.rank-badge.tone-blue    { background: linear-gradient(135deg,#1e3a8a 0%,#2563eb 50%,#60a5fa 100%); color:#fff; border:1px solid rgba(30,58,138,0.45); }
.rank-badge.tone-blue .rb-rank   { color: rgba(255,255,255,0.92); }
.rank-badge.tone-crimson { background: linear-gradient(135deg,#7f1d1d 0%,#b91c1c 50%,#ef4444 100%); color:#fff; border:1px solid rgba(127,29,29,0.45); }
.rank-badge.tone-crimson .rb-rank { color: rgba(255,255,255,0.92); }

/* Container holding multiple badges — wraps cleanly on narrow screens */
.rank-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ============================================================
 * Lighting + depth utilities — apply for that "polished sticker"
 * feel the logo has. Use individually or stacked via classes.
 * ============================================================ */

/* Top-edge highlight — the subtle bright line on top of buttons/cards
   that mimics light hitting from above. Cheap, works on any background. */
.fx-top-light { box-shadow: inset 0 1px 0 rgba(255,255,255,0.30); }
.fx-top-light-strong { box-shadow: inset 0 1px 0 rgba(255,255,255,0.45); }

/* Soft drop shadow — adds depth without going heavy.
   Use on cards that "float" above the page surface. */
.fx-lift {
  box-shadow:
    0 2px 8px -3px rgba(13,31,58,0.18),
    0 1px 3px -1px rgba(13,31,58,0.10);
}
.fx-lift-hover { transition: box-shadow 180ms, transform 140ms; }
.fx-lift-hover:hover {
  box-shadow:
    0 8px 22px -8px rgba(13,31,58,0.28),
    0 3px 8px -2px rgba(13,31,58,0.14);
  transform: translateY(-1px);
}

/* Glossy gradient overlay — a faint white-to-transparent layer on top of
   colored buttons/cards. Mimics how the logo's circle has a subtle highlight.
   Apply by adding a pseudo-element or stacking gradients in the parent's bg. */
.fx-glossy {
  position: relative;
  isolation: isolate;
}
.fx-glossy::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.02) 50%, rgba(0,0,0,0.05) 100%);
  pointer-events: none;
  z-index: 1;
}
/* Anything inside that should be above the gloss needs z-index: 2 */
.fx-glossy > * { position: relative; z-index: 2; }

/* Cyan-accented focus ring — for inputs/buttons matching the new brand */
.fx-cyan-ring:focus,
.fx-cyan-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,217,214,0.30), inset 0 1px 0 rgba(255,255,255,0.25);
  border-color: var(--cm-cyan-500);
}

/* Subtle inner glow — for hero cards that should feel "luminous" */
.fx-inner-glow {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 0 30px rgba(255,255,255,0.05);
}
