/* ============================================
   ESKIL — Application styles on top of Scouterna tokens
   ============================================ */

/* Layout primitives */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The SPA root is a column so the app footer sits at the bottom even on
   short pages. Fullscreen views (splash, startscreen, ceremony) are the only
   child and stretch to fill. */
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > .page { flex: 1; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-5);
}
.brand {
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--scout-blue);
  text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-sub {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  color: var(--fg3);
  margin-left: var(--sp-2);
  border-left: 1px solid var(--border);
  padding-left: var(--sp-3);
}
/* Slot for competition-specific buttons (Offentlig sida + Startskärm).
   `margin-left: auto` consumes the space between brand and the right-hand
   cluster, effectively pushing the slot + topbar-right all the way right. */
.topbar-comp {
  margin-left: auto;
  display: flex; align-items: center; gap: var(--sp-2);
  min-width: 0;
}
.topbar-comp:empty { margin-left: auto; }  /* still pushes when empty */
/* Current competition — persistent context + one click to its start page. */
.topbar-comp-name {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--scout-blue); text-decoration: none;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 10px; border-radius: var(--r-md);
}
.topbar-comp-name:hover { background: var(--scout-blue-100); }
.topbar-right {
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: 14px;
}

/* Mobile topbar: drop the decorative bits, keep every action reachable. */
@media (max-width: 900px) {
  .brand-sub { display: none; }
  .topbar-email { display: none; }
}
@media (max-width: 760px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
    padding: 10px var(--sp-4);
  }
  .topbar-comp-name { max-width: 46vw; }
  .page { padding: var(--sp-6) var(--sp-4); }
}

/* App footer — the signed-in app's route back to the public start page. */
.app-foot {
  border-top: 1px solid var(--border);
  background: var(--white);
}
.app-foot-inner {
  max-width: 1200px; margin: 0 auto;
  padding: var(--sp-4) var(--sp-6);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
  font-size: 13px; color: var(--fg3);
}
.app-foot a { color: var(--scout-blue); text-decoration: none; }
.app-foot a:hover { text-decoration: underline; }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
  width: 100%;
}
.page-narrow { max-width: 820px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}
.page-head h1 { margin: var(--sp-2) 0 0; }   /* small gap after the eyebrow */
.page-head .t-over { color: var(--scout-blue); }

/* Tabs */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-8);
  overflow-x: auto;
}
.tabs a {
  padding: var(--sp-3) var(--sp-5);
  color: var(--fg2);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--dur-base) var(--ease);
}
.tabs a:hover { color: var(--scout-blue); }
.tabs a.active {
  color: var(--scout-blue);
  border-bottom-color: var(--scout-blue);
}
/* Mobile: the bar scrolls; hide the scrollbar (the active tab is centered
   into view by nav.js and a cut-off label signals more content). */
.tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
/* The admin-only settings tab sits on its own at the far end. */
.tabs a.tab-end {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
}

/* Local section tabs (pills) — same idea as .tabs but for in-page sections
   (e.g. competition settings), visually distinct from route navigation. */
.tabs-sub {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.tabs-sub a {
  padding: 8px 14px; border-radius: var(--r-full);
  border: 1px solid var(--border);
  color: var(--fg2); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  white-space: nowrap;
  transition: all var(--dur-base) var(--ease);
}
.tabs-sub a:hover { color: var(--scout-blue); border-color: var(--scout-blue); }
.tabs-sub a.active { background: var(--scout-blue); color: var(--white); border-color: var(--scout-blue); }

/* Breadcrumbs — the "du är här"-trail above every page heading. */
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  min-width: 0;
}
.crumbs a { color: var(--scout-blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-current] { color: var(--fg3); }
.crumbs-sep { color: var(--fg3); user-select: none; }
.page-head .crumbs { margin-bottom: var(--sp-1); }

/* Cards & lists */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--sp-4); }
/* Grid already spaces children via `gap` — kill the vertical margin inside
   grids so the second column doesn't get shoved down 16px below the first. */
.grid > .card + .card,
.grid-2 > .card + .card,
.grid-3 > .card + .card { margin-top: 0; }
/* Default to top alignment so columns start evenly instead of stretching. */
.grid, .grid-2, .grid-3 { align-items: start; }
.card h3, .card h4 { margin-top: 0; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Buttons (extend design tokens) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--dur-base) var(--ease);
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--white); color: var(--scout-blue); border-color: var(--scout-blue); }
.btn-secondary:hover { background: var(--scout-blue-50); }
.btn-ghost { background: transparent; color: var(--scout-blue); }
.btn-ghost:hover { background: var(--scout-blue-100); }
.btn-accent { background: var(--avent-orange); color: var(--white); }
.btn-accent:hover { background: #cf5210; box-shadow: var(--shadow-md); }
.btn-danger { background: var(--utm-pink); color: white; }
.btn-danger:hover { background: #b3004e; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 18px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn[data-busy="1"] { opacity: 0.85; cursor: progress; }
.btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* Lucide SVG icons — inherit currentColor, align with surrounding text */
.lucide {
  display: inline-block;
  vertical-align: -0.125em;     /* matches baseline better than flex-center */
  flex-shrink: 0;
}

/* Spinner — works in any button context, inherits currentColor */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-full);
  font-family: var(--font-display);
}
.badge-blue   { background: var(--scout-blue-100); color: var(--scout-blue); }
.badge-green  { background: #e3f4dd; color: #2d7a1c; }
.badge-orange { background: #fde5d4; color: #b84a0a; }
.badge-pink   { background: #fad4e2; color: #a6004a; }
.badge-yellow { background: #f8f6c0; color: #6a6303; }
.badge-gray   { background: var(--gray-100); color: var(--fg2); }
.badge-rover  { background: #fff8a6; color: var(--rover-dark); }
.badge-up     { background: #d5f1fc; color: #006b8f; }

/* Avdelning colors */
.avd-sp { color: var(--spaer-green); }
.avd-up { color: var(--upp-blue); }
.avd-av { color: var(--avent-orange); }
.avd-ut { color: var(--utm-pink); }
.avd-ro { color: var(--rover-dark); }
.avd-le { color: var(--fg2); }

.dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 6px; vertical-align: middle;
}
.dot.sp { background: var(--spaer-green); }
.dot.up { background: var(--upp-blue); }
.dot.av { background: var(--avent-orange); }
.dot.ut { background: var(--utm-pink); }
.dot.ro { background: var(--rover-yellow); }
.dot.le { background: var(--fg2); }

/* Forms */
.field-group { display: grid; gap: var(--sp-4); }
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--fg1); margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--fg3); margin-top: 4px; }

.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: 15px;
  background: var(--white); color: var(--fg1);
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--scout-blue);
  box-shadow: var(--shadow-ring);
}
.textarea { min-height: 96px; resize: vertical; font-family: var(--font-sans); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%23525252'%3E%3Cpath d='M5 8l5 5 5-5H5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

/* Tables */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); }
table.t {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
table.t th, table.t td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.t th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg2);
  background: var(--bg-muted);
  user-select: none;
}
table.t th.sortable { cursor: pointer; }
table.t th.sortable:hover { color: var(--scout-blue); }
table.t th .arrow { display: inline-block; margin-left: 4px; opacity: 0.5; }
table.t tr:last-child td { border-bottom: none; }
table.t tr:hover td { background: var(--scout-blue-50); }
table.t td.num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
table.t th.num { text-align: right; }
table.t th.num .arrow { margin-left: 4px; }
table.t td.actions { text-align: right; white-space: nowrap; }
table.t th.actions { text-align: right; }
table.t .row-link { color: var(--scout-blue); font-weight: 600; text-decoration: none; }
table.t .row-link:hover { text-decoration: underline; }

/* Drag & drop (SortableJS) */
table.t td.drag-col {
  cursor: grab;
  color: var(--fg3);
  padding: 12px 4px 12px 12px;
  user-select: none;
  touch-action: none;
}
table.t td.drag-col:active { cursor: grabbing; }
table.t td.drag-col:hover { color: var(--scout-blue); }
table.t td.time-col {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--scout-blue);
}
tr.drag-ghost {
  opacity: 0.4;
  background: var(--scout-blue-100) !important;
}
tr.drag-chosen {
  background: var(--scout-blue-50) !important;
  box-shadow: 0 4px 12px rgba(0, 54, 96, 0.12);
}

/* Start/finish pseudo-rows in the controls table */
table.t tr.sf-row td {
  background: #fffde6;       /* tint of rover-yellow */
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table.t tr.sf-row.park-row td {
  background: var(--scout-blue-50);   /* tint of scout-blue */
}

/* Collapsible "Placeringsregler"-info shown above ranked tables */
.rules-info {
  background: var(--scout-blue-50);
  border: 1px solid var(--scout-blue-200);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: var(--sp-4);
  font-size: 14px;
  color: var(--fg1);
}
.rules-info summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--scout-blue);
  list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.rules-info summary::-webkit-details-marker { display: none; }
.rules-info summary::before {
  content: '';
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--scout-blue);
  color: #fff;
  text-align: center;
  line-height: 18px;
  font-size: 12px;
  font-style: italic;
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 700;
}
.rules-info summary::before { content: 'i'; }
.rules-info[open] summary { margin-bottom: 8px; }
.rules-info ol {
  margin: 0; padding-left: 20px;
  color: var(--fg2);
}
.rules-info ol li { margin: 4px 0; }
.rules-info ol strong { color: var(--fg1); }

/* Empty states */
.empty {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  color: var(--fg3);
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-muted);
}
.empty h3 { color: var(--fg1); margin-top: 0; }

/* Toasts / messages */
.toast-wrap {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%);
  z-index: 1400; /* above modals (1100) — feedback must always be visible */
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  background: var(--scout-blue-900); color: var(--white);
  padding: 12px 20px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  pointer-events: auto;
  animation: fadeInUp var(--dur-base) var(--ease);
  max-width: 420px;
}
.toast.error { background: var(--utm-pink); }
.toast.success { background: var(--spaer-green); }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 36, 63, 0.55);
  backdrop-filter: blur(4px);
  /* Above Leaflet's internal z-indexes (panes 400–700, controls 1000) so an
     inline map can never paint on top of a modal. Toasts sit above at 1400. */
  z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn var(--dur-base) var(--ease);
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}
.modal-head {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 { margin: 0; }
.modal-body { padding: var(--sp-6); }
.modal-foot {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex; gap: var(--sp-3); justify-content: flex-end;
  background: var(--bg-muted);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.icon-btn {
  background: transparent; border: none; cursor: pointer;
  padding: var(--sp-2); color: var(--fg2); border-radius: var(--r-md);
  line-height: 0;
}
.icon-btn:hover { background: var(--scout-blue-100); color: var(--scout-blue); }

/* Login / marketing */
.splash {
  min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--scout-blue) 0%, var(--scout-blue-800) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.splash-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  pointer-events: none;
}
.splash-inner {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: var(--sp-12) var(--sp-6);
  max-width: 520px; margin: 0 auto; width: 100%;
}
.splash .eyebrow { color: var(--rover-yellow); font-weight: 700; }
.splash h1 { margin: var(--sp-4) 0 var(--sp-5); font-family: var(--font-display); font-weight: 200; font-size: 64px; line-height: 1; letter-spacing: -0.02em; }
.splash h1 em { font-family: var(--font-serif); font-weight: 500; font-style: italic; color: var(--rover-yellow); }
.splash .lede { font-family: var(--font-serif); font-size: 19px; line-height: 1.5; color: #d2dde8; margin-bottom: var(--sp-8); }
.splash-logo { display: block; width: min(320px, 70%); height: auto; }
.login-card {
  background: var(--white); color: var(--fg1);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-lg);
}

/* Scoreboard */
.scoreboard-controls {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  margin-bottom: var(--sp-5); align-items: center;
}
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-8); }
.kpi {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.kpi .k-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--fg3); }
.kpi .k-value { font-family: var(--font-display); font-weight: 200; font-size: 40px; line-height: 1.1; margin-top: var(--sp-2); color: var(--scout-blue); }

/* Map container */
.map {
  height: 320px; width: 100%;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border);
}

/* Utility */
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--fg3); }
.mono { font-family: var(--font-mono); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

/* Focus */
:focus-visible {
  outline: 3px solid var(--upp-blue);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* --- Spårdragning (track editor) ------------------------------------------ */
.track-wrap {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.track-map { height: calc(100vh - 320px); min-height: 460px; }
.track-wrap:fullscreen { border: none; border-radius: 0; }
.track-wrap:fullscreen .track-map { height: 100vh; min-height: 100vh; }

.track-panel {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 20;
  width: 280px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.12));
  padding: 12px 14px;
}
.track-fs {
  position: absolute;
  bottom: 24px; right: 12px;
  z-index: 20;
}

.track-totals { margin-top: 8px; border-top: 1px solid var(--border); }
.track-totals > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.track-totals .track-grand strong { color: var(--scout-blue); font-size: 16px; }

.track-legs { margin-top: 8px; display: grid; gap: 3px; }
.track-leg {
  display: grid; grid-template-columns: 1fr auto auto 14px; gap: 8px; align-items: baseline;
  width: 100%; text-align: left;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; padding: 4px 8px; font: inherit; font-size: 14px; cursor: pointer;
}
.track-leg:hover { background: var(--bg-muted); }
.track-leg.active { border-color: var(--avent-orange); background: #fdf1e8; }
.track-leg-name { font-weight: 700; color: var(--scout-blue); white-space: nowrap; }

@media (max-width: 720px) {
  .track-map { height: 62vh; min-height: 380px; }
  .track-panel { position: static; width: auto; max-height: none; border-radius: 0; border: none; border-top: 1px solid var(--border); }
  .track-wrap { display: flex; flex-direction: column; }
  .track-fs { display: none; }
}

/* --- Prisutdelningsläge (ceremony) ------------------------------------------ */
.ceremony {
  position: fixed; inset: 0; z-index: 500;
  background: var(--scout-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  cursor: default; user-select: none;
  overflow: hidden;
}
.cer-loading { font-size: 22px; color: #a7bccf; }
/* Exit affordance — the ceremony must never be a dead end. */
.cer-close {
  position: absolute; top: 16px; right: 20px; z-index: 10;
  color: rgba(255,255,255,.55); font-size: 24px; line-height: 1;
  text-decoration: none; padding: 10px 14px; border-radius: var(--r-md);
}
.cer-close:hover { color: #fff; background: rgba(255,255,255,.12); }
.cer-menu, .cer-stage { text-align: center; max-width: 900px; padding: 32px; }
.cer-eyebrow { color: var(--rover-yellow); font-weight: 800; letter-spacing: .18em; font-size: clamp(12px, 1.4vw, 16px); text-transform: uppercase; }
.cer-title { font-size: clamp(34px, 5vw, 64px); font-weight: 200; margin: 12px 0 4px; }
.cer-cat-title { font-size: clamp(38px, 6vw, 72px); font-weight: 300; margin: 18px 0; display: flex; align-items: center; justify-content: center; gap: 16px; }
.cer-sub { color: #d2dde8; font-size: clamp(16px, 2vw, 24px); }
.cer-hint { color: #7d99b5; font-size: 14px; margin-top: 40px; }
.cer-dnf {
  display: inline-block;
  vertical-align: middle;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #b9cbdd;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: .35em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-left: 10px;
}
.cer-warn {
  display: inline-block;
  margin-top: 22px;
  background: rgba(233, 95, 19, .18);
  border: 1.5px solid var(--avent-orange);
  color: #ffb56b;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 600;
}
.cer-cats { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; align-items: center; }
.cer-cat {
  display: inline-flex; align-items: center; gap: 12px;
  font: inherit; font-size: clamp(18px, 2.2vw, 26px); font-weight: 600;
  color: #fff; background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.25); border-radius: 14px;
  padding: 14px 30px; cursor: pointer; min-width: min(480px, 80vw);
  justify-content: center;
}
.cer-cat:hover { background: rgba(255,255,255,.15); }
.cer-cat.is-done { opacity: .55; }
.cer-check { color: var(--spaer-green); font-weight: 800; }
.cer-place-label { font-size: clamp(24px, 3.5vw, 44px); color: var(--rover-yellow); font-weight: 300; animation: cer-in .5s ease-out; }
.cer-reveal { display: flex; flex-direction: column; gap: 18px; align-items: center; margin-top: 30px; animation: cer-pop .6s cubic-bezier(.2, 1.4, .4, 1); }
.cer-winner { display: flex; align-items: center; gap: 24px; text-align: left; }
.cer-medal {
  width: clamp(64px, 8vw, 110px); height: clamp(64px, 8vw, 110px); border-radius: 50%;
  background: #eef2f6; color: var(--scout-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(34px, 4.5vw, 60px); font-weight: 800; flex-shrink: 0;
  box-shadow: 0 6px 30px rgba(0,0,0,.35);
}
.cer-reveal.is-gold .cer-medal { background: var(--rover-yellow); }
.cer-name { font-size: clamp(36px, 6vw, 84px); font-weight: 700; line-height: 1.05; }
.cer-reveal.is-gold .cer-name { color: var(--rover-yellow); }
.cer-meta { color: #a7bccf; font-size: clamp(15px, 1.8vw, 24px); }
.cer-podium-title { font-size: clamp(34px, 5vw, 60px); font-weight: 300; color: var(--rover-yellow); margin: 10px 0 26px; }
.cer-podium { display: flex; flex-direction: column; gap: 10px; align-items: stretch; max-width: 700px; margin: 0 auto; }
.cer-podium-row {
  display: grid; grid-template-columns: 54px 1fr auto auto; gap: 16px; align-items: center;
  background: rgba(255,255,255,.07); border-radius: 12px; padding: 12px 20px; text-align: left;
}
.cer-podium-row.rank-1 { background: rgba(226,224,0,.16); border: 1px solid rgba(226,224,0,.5); }
.cer-medal.small { width: 44px; height: 44px; font-size: 22px; }
.cer-podium-row.rank-1 .cer-medal { background: var(--rover-yellow); }
.cer-name-sm { font-size: clamp(18px, 2.4vw, 30px); font-weight: 700; }
.cer-points { font-size: clamp(16px, 2vw, 24px); font-weight: 700; color: var(--rover-yellow); }
.cer-pulse { animation: cer-pulse 1.6s ease-in-out infinite; }
@keyframes cer-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes cer-pop { from { opacity: 0; transform: scale(.7); } }
@keyframes cer-pulse { 50% { opacity: .5; } }

/* --- Super-admin systemhubb ------------------------------------------------- */
.sys-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); }
.sys-info > div { display: flex; flex-direction: column; gap: 2px; }
.sys-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-2); }
.sys-link {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); background: var(--bg-muted);
}
.sys-link:hover { border-color: var(--scout-blue); background: var(--white); }
.sys-link-label { font-weight: 700; color: var(--scout-blue); display: flex; align-items: center; gap: 6px; }
.sys-map td { vertical-align: top; }
.sys-map td:first-child { white-space: nowrap; }
.sys-map code, .sys-info code { font-size: 12px; background: var(--bg-muted); padding: 1px 5px; border-radius: 4px; }
.sys-config { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
.sys-config .field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
