/* =========================================================
   SMIO × Hexaly — Platform app design system.
   Ported from the marketing site (smiochallenge.com) "FIELD"
   theme: paper background, ink typography, Hexaly orange accent,
   navy as architecture color. Routing as visual language.

   Two layers:
     1. Core system  — tokens + components shared with the
        marketing site (nav, hero, page-header, sections, cards,
        callouts, table.tbl, tags, buttons, formula, footer, prose).
     2. App layer     — adopts the platform's existing semantic
        classes (table.board, .warning/.success, .help, .pill,
        bks-*, .board-tabs, .subnav, .panel, etc.) onto the same
        tokens so runtime/JS hooks survive untouched.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --paper:     oklch(0.985 0.003 80);
  --paper-2:   oklch(0.965 0.004 80);
  --paper-3:   oklch(0.935 0.005 80);
  --ink:       oklch(0.18 0.018 255);
  --ink-2:     oklch(0.32 0.02 255);
  --ink-3:     oklch(0.52 0.015 255);
  --ink-4:     oklch(0.72 0.008 255);
  --rule:      oklch(0.90 0.006 80);
  --rule-2:    oklch(0.82 0.008 80);

  --orange:    #E8793F;     /* Hexaly brand */
  --orange-2:  #D2652F;
  --orange-3:  #FBE4D4;

  --navy:      oklch(0.30 0.06 258);
  --navy-2:    oklch(0.22 0.05 258);

  --teal:      oklch(0.58 0.11 195);
  --teal-2:    oklch(0.95 0.03 195);

  --green:     oklch(0.65 0.13 160);
  --green-2:   oklch(0.95 0.04 160);

  --warn:      oklch(0.62 0.16 55);
  --warn-2:    oklch(0.96 0.04 70);

  /* Type */
  --font-sans: 'Space Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --maxw: 1240px;
  --gutter: 2rem;
  --nav-h: 88px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > .wrap { flex: 1 0 auto; }

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.08;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); letter-spacing: -0.03em; margin-bottom: 0.5em; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.35em; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { margin-bottom: 1em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.eyebrow::before {
  content: '';
  width: 22px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.mono { font-family: var(--font-mono); }

code {
  font-family: var(--font-mono);
  background: var(--paper-3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ---- Layout primitives ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.wrap-narrow { max-width: 760px; }
.section-gap { padding: 3rem 0; }

.rule { height: 1px; background: var(--rule); border: 0; width: 100%; }

/* ---- Navigation ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(253, 252, 249, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.9rem;
  color: var(--ink);
}
.nav-brand img { height: 72px; display: block; }
.nav-brand .nav-brand-hex { height: 48px; }
.nav-brand-home { display: flex; align-items: center; gap: 0.9rem; }
.nav-brand-div {
  width: 1px; height: 32px;
  background: var(--rule-2);
  margin: 0 0.2rem;
}
.nav-links {
  display: flex; align-items: center; gap: 0.15rem;
  list-style: none;
}
.nav-links a {
  position: relative;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0.7rem; right: 0.7rem;
  bottom: -2px;
  height: 2px;
  background: var(--orange);
}
.nav-who {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  padding: 0 0.4rem;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.55rem !important;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  color: var(--ink-3) !important;
}
.nav-lang:hover { border-color: var(--ink); color: var(--ink) !important; background: transparent !important; }
.nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 0.5rem 0.9rem !important;
  border-radius: 6px;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}
.nav-cta:hover { background: var(--orange) !important; color: var(--paper) !important; }
.nav-cta.active::after { display: none; }
.nav-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.4rem; color: var(--ink);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero-bg, .hero .nodeplot {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 65%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 65%, rgba(0,0,0,0) 100%);
}
.hero > .wrap { position: relative; z-index: 1; }

.hero-meta {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; gap: 0.5rem; align-items: center; }
.hero-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); display: inline-block; }

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
  font-weight: 500;
  max-width: 16ch;
  margin-bottom: 1.4rem;
}
.hero-title .accent {
  color: var(--orange);
  font-style: italic;
  font-weight: 400;
}
.hero-sub {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-2);
  max-width: 52ch;
  line-height: 1.5;
  margin-bottom: 2.2rem;
}
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ---- Stat bar ---- */
.statbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-top: 3rem;
}
.statbar-cell {
  padding: 1.5rem 1.2rem;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.statbar-cell:last-child { border-right: 0; }
.statbar-k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.statbar-v {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.3rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: transform 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
}
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
.btn-arrow { font-family: var(--font-mono); font-size: 0.9rem; }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--orange); color: var(--paper); }
.btn-orange {
  background: var(--orange);
  color: var(--paper);
}
.btn-orange:hover { background: var(--orange-2); }
.btn-ghost {
  border-color: var(--rule-2);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-2); }
.btn-danger {
  background: oklch(0.52 0.18 25);
  color: var(--paper);
}
.btn-danger:hover { background: oklch(0.46 0.18 25); }
.btn:disabled, button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Section ---- */
.section { padding: 4rem 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.section-head .eyebrow { margin-bottom: 0.9rem; display: inline-flex; }
.section-head h2 { margin: 0; }
.section-intro { color: var(--ink-2); font-size: 1.05rem; max-width: 55ch; }
.section-alt { background: var(--paper-2); }

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.card {
  padding: 1.8rem 1.6rem;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  transition: background 0.2s;
}
.card:hover { background: var(--paper-2); }
.card h3 { margin-bottom: 0.5em; font-size: 1.2rem; }
.card p { color: var(--ink-2); font-size: 0.95rem; }

/* A standalone bordered panel (not in a grid) */
.panel {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.6rem 1.8rem;
  margin: 1.5rem 0;
}

/* ---- Tag ---- */
.tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.tag-orange { background: var(--orange-3); color: var(--orange-2); }
.tag-navy   { background: oklch(0.93 0.02 255); color: var(--navy); }
.tag-teal   { background: var(--teal-2); color: var(--teal); }
.tag-green  { background: var(--green-2); color: oklch(0.45 0.12 160); }
.tag-ink    { background: var(--paper-3); color: var(--ink-2); }
.tag::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: 0.7;
}

/* ---- Table (shared base) ---- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table.tbl, table.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.tbl th, table.tbl td,
table.board th, table.board td {
  padding: 0.8rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
table.tbl thead th, table.board thead th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.7rem;
  vertical-align: bottom;
}
table.tbl tbody tr:hover, table.board tbody tr:hover { background: var(--paper-2); }
table.board td.num, table.board th.num,
table.tbl td.num, table.tbl th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.board tr.empty td { color: var(--ink-4); font-style: italic; }

/* ---- Callout ---- */
.callout {
  border: 1px solid var(--rule);
  padding: 1.4rem 1.6rem;
  background: var(--paper);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.4rem;
  align-items: flex-start;
}
.callout-n {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--orange);
  letter-spacing: 0.08em;
}
.callout h3 { margin-bottom: 0.3em; font-size: 1.05rem; }
.callout p { color: var(--ink-2); font-size: 0.95rem; }

/* ---- Form ---- */
.form-card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 2.2rem;
  max-width: 640px;
}
form label { display: block; }
.form-row, form > label { margin-bottom: 1.3rem; display: block; }
.field-label, form label.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
input[type="text"], input[type="email"], input[type="number"],
input[type="password"], select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
input[type="file"] { font: inherit; color: var(--ink-2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--paper);
}
textarea { resize: vertical; min-height: 4.5rem; }
.checkbox-row {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-weight: normal;
  margin: 0.75rem 0;
}
.checkbox-row input { margin-top: 0.25rem; width: auto; }
.checkbox-row span { color: var(--ink-2); }

/* Default button styling for bare <button> inside forms */
form button[type="submit"], button.btn-default {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.7rem 1.2rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.15s;
}
form button[type="submit"]:hover, button.btn-default:hover { background: var(--orange); }

/* ---- Banners: success / warning / help ---- */
.success, .warning {
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-size: 0.95rem;
  border-left: 3px solid;
}
.success {
  background: var(--green-2);
  border-left-color: var(--green);
  color: oklch(0.40 0.10 160);
}
.warning {
  background: var(--warn-2);
  border-left-color: var(--warn);
  color: oklch(0.42 0.13 55);
}
.success a, .warning a { color: inherit; border-bottom: 1px solid currentColor; }
.help {
  color: var(--ink-3);
  font-size: 0.88rem;
}

/* ---- Pills (inline status badges) ---- */
.pill {
  display: inline-flex; align-items: center;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.pill.success { background: var(--green-2); color: oklch(0.42 0.11 160); border-left: 0; padding: 0.12rem 0.55rem; }
.pill.warning { background: var(--warn-2); color: oklch(0.45 0.13 55); border-left: 0; padding: 0.12rem 0.55rem; }

/* ---- Footer ---- */
.footer {
  background: var(--ink);
  color: oklch(0.85 0.005 80);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  flex-shrink: 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid oklch(0.28 0.02 255);
}
.footer-brand-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--paper);
  margin-bottom: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.footer-brand-desc { color: oklch(0.65 0.01 80); font-size: 0.88rem; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: oklch(0.65 0.01 80);
  font-weight: 500;
  margin-bottom: 1rem;
}
.footer a { color: oklch(0.85 0.005 80); font-size: 0.92rem; display: block; padding: 0.25rem 0; transition: color 0.15s; }
.footer a:hover { color: var(--orange); }
.footer-bottom {
  display: flex; justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: oklch(0.55 0.01 80);
  flex-wrap: wrap; gap: 1rem;
}
.footer-logos { display: flex; align-items: center; gap: 1.6rem; }
.footer-logos img { height: 36px; opacity: 0.9; }
.footer-logos .hexaly-mark { height: 30px; opacity: 1; }
.footer-logos img.on-light { filter: brightness(0) invert(1); opacity: 0.7; }

/* ---- Page header (subpages) ---- */
.page-header {
  position: relative;
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.page-header > .wrap { position: relative; z-index: 1; }
.page-header .nodeplot {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
}
.page-header h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.035em;
  margin-bottom: 0.2em;
}
.page-header .eyebrow { margin-bottom: 0.9rem; }
.page-header-desc { color: var(--ink-2); font-size: 1.05rem; max-width: 52ch; margin-top: 0.6rem; }

/* The main content region of every app page */
.page-body { padding: 2.5rem 0 1rem; }
.page-body h2 { margin-top: 2.2rem; }
.page-body h2:first-child { margin-top: 0; }
.page-body ul { padding-left: 1.2rem; margin: 0.5rem 0 1rem; }
.page-body ul li { margin-bottom: 0.4rem; }
.page-body > p { margin-bottom: 1rem; }

/* ---- Content typography (prose / reglamento) ---- */
.prose p { color: var(--ink-2); font-size: 1.02rem; line-height: 1.65; margin-bottom: 1.1em; }
.prose p strong { color: var(--ink); }
.prose h3 { margin-top: 2rem; font-size: 1.25rem; }
.prose a { color: var(--orange); border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.prose a:hover { color: var(--ink); }

/* ---- Equation / Formula block ---- */
.formula {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: 1.8rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.8;
  overflow-x: auto;
  border-left: 3px solid var(--orange);
}
.formula .k { color: var(--orange); }
.formula .c { color: var(--ink-3); }

/* ---- Utilities ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.stack > * + * { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.back-link { margin-bottom: 0.6rem; font-size: 0.9rem; }
.back-link a { color: var(--ink-3); }
.back-link a:hover { color: var(--orange); }

.spec-list { display: flex; flex-direction: column; }
.spec-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  padding: 0.9rem 0;
  gap: 1.5rem;
  border-top: 1px solid var(--rule);
}
.spec-row:last-child { border-bottom: 1px solid var(--rule); }
.spec-k {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.spec-v { color: var(--ink); font-size: 0.98rem; }

/* =========================================================
   APP LAYER — platform-specific components
   ========================================================= */

/* Leaderboard / admin sub-navigation (segmented tabs) */
.board-tabs, .subnav {
  display: flex; gap: 0.3rem; flex-wrap: wrap;
  margin: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.board-tabs a, .subnav a {
  position: relative;
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, background 0.15s;
}
.board-tabs a:hover, .subnav a:hover { color: var(--ink); background: var(--paper-2); }
.board-tabs a.active, .subnav a.active { color: var(--ink); }
.board-tabs a.active::after, .subnav a.active::after {
  content: '';
  position: absolute;
  left: 0.95rem; right: 0.95rem; bottom: -1px;
  height: 2px;
  background: var(--orange);
}
.board-help {
  color: var(--ink-3);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

/* Leaderboard cell semantics */
.bks-team { font-weight: 500; }
.bks-cost { font-family: var(--font-mono); }
.bks-gap { font-family: var(--font-mono); }
.bks-established, .bks-superseded { color: var(--ink-3); font-size: 0.9rem; }
table.board tr.current-bks { background: var(--orange-3); }
table.board tr.current-bks:hover { background: var(--orange-3); }
.current-marker {
  color: var(--orange-2);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Per-instance stats definition list */
.instance-stats {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1.4rem;
  margin: 0.5rem 0 1.4rem;
  max-width: 32rem;
}
.instance-stats dt {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  align-self: center;
}
.instance-stats dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.instance-stats dd.num { text-align: left; }

/* Team roster + invitations lists */
.roster { list-style: none; padding: 0; }
.roster li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.roster li:last-child { border-bottom: 0; }

/* BKS metadata cards (team detail) */
.bks-meta-item {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
}
.bks-meta-item h3 { margin: 0 0 0.8rem; font-size: 1.05rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.bks-meta-item input[type="number"] { width: 9rem; font-variant-numeric: tabular-nums; }
.bks-meta-item label { margin-bottom: 0.9rem; }

/* Admin scoring run controls */
.run-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.panel form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.panel form input[type="text"] { flex: 1; min-width: 14rem; margin: 0; }
.panel form button[type="submit"] { margin-top: 0; }
button.final { background: oklch(0.52 0.18 25); }
button.final:hover { background: oklch(0.46 0.18 25); }

/* Inline forms inside table cells (admin override, etc.) */
table.board form, table.tbl form { display: flex; gap: 0.5rem; margin: 0; align-items: center; flex-wrap: wrap; }
table.board form input[type="text"], table.tbl form input[type="text"] { margin: 0; padding: 0.4rem 0.5rem; font-size: 0.85rem; }
table.board form button, table.tbl form button { margin-top: 0; padding: 0.4rem 0.7rem; font-size: 0.85rem; }

/* Submit-page result box reuses .success / .warning; bare box = neutral */
#result > div:not(.success):not(.warning) {
  padding: 0.9rem 1.1rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink-2);
}
#result small { color: var(--ink-3); }

/* ---- Reglamento (rendered markdown + KaTeX) ---- */
.reglamento { max-width: 80ch; }
.reglamento h1 { margin-top: 1rem; font-size: clamp(2rem, 4vw, 2.8rem); }
.reglamento h2 {
  margin-top: 2.6rem; padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.6rem;
}
.reglamento h3 { margin-top: 1.6rem; font-size: 1.2rem; }
.reglamento h4 { margin-top: 1.1rem; font-size: 1rem; }
.reglamento p { color: var(--ink-2); line-height: 1.7; margin-bottom: 1em; max-width: 78ch; }
.reglamento ul, .reglamento ol { padding-left: 1.5rem; margin-bottom: 1em; color: var(--ink-2); }
.reglamento li { margin-bottom: 0.4rem; }
.reglamento a { color: var(--orange); border-bottom: 1px solid currentColor; }
.reglamento a:hover { color: var(--ink); }
.reglamento strong { color: var(--ink); }
.reglamento blockquote {
  border-left: 3px solid var(--orange);
  margin-left: 0; padding-left: 1.1rem;
  color: var(--ink-3);
  background: var(--paper-2);
  padding: 0.8rem 1.1rem;
}
.reglamento table { border-collapse: collapse; margin: 1.2rem 0; width: 100%; font-size: 0.95rem; }
.reglamento th, .reglamento td { border: 1px solid var(--rule-2); padding: 0.5rem 0.8rem; text-align: left; }
.reglamento th { background: var(--paper-2); font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.reglamento hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--rule); }
.reglamento p code, .reglamento li code { background: var(--paper-3); }
.reglamento .math.block { display: block; text-align: center; margin: 1.2rem 0; }

/* ---- Nodemap container ---- */
[data-nodemap] { display: block; width: 100%; height: 100%; min-height: 100%; }
[data-nodemap] svg { display: block; width: 100%; height: 100%; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .section-head { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--paper); flex-direction: column; padding: 1rem;
    border-bottom: 1px solid var(--rule); align-items: stretch; gap: 0.2rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-brand img { height: 56px; }
  .nav-brand .nav-brand-hex { height: 36px; }
  .nav-brand-div { height: 22px; }
  .nav-who { display: none; }
  .hero { padding: 3rem 0 2.5rem; }
  .callout { grid-template-columns: 1fr; gap: 0.5rem; }
  .section { padding: 3rem 0; }
  .spec-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .footer-top { grid-template-columns: 1fr; }
}
