/* =====================================================================
   SPORTEVI — Design System
   Built from the official brandbook. "Confident. Clear. Never hype."
   Navy (#0B1A33) for trust · Lime (#CFF23B) for the moment of play.
   Space Grotesk (headings) · Manrope (body) · JetBrains Mono (data).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Ink / navy scale */
  --ink:        #0B1A33;
  --ink-2:      #13284A;
  --ink-3:      #172F54;
  --steel:      #3A4256;

  /* Interactive */
  --blue:       #2B5BE2;
  --accent:     #CFF23B;   /* lime — the moment of play */
  --accent-ink: #0B1A33;
  --coral:      #FF6A3D;
  --teal:       #25E0C5;

  /* Surfaces */
  --bg:         #F6F7F9;
  --surface:    #FFFFFF;
  --surface-2:  #EEF1F6;
  --line:       #DCE0E8;
  --line-2:     #E8EBF2;

  /* Text */
  --muted:      #69728A;
  --muted-2:    #9AA2B2;

  --radius:     3px;
  --radius-lg:  4px;
  --shadow:     0 1px 2px rgba(11,26,51,.06), 0 4px 16px rgba(11,26,51,.05);
  --shadow-md:  0 2px 8px rgba(11,26,51,.08), 0 12px 32px rgba(11,26,51,.08);

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ─────────────── Header / nav ─────────────── */
.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: -.02em; color: #fff; }
.brand .mark {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
.brand .mark svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,.72);
  padding: 8px 12px; border-radius: var(--radius); transition: .15s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav a.on { color: var(--ink); background: var(--accent); }
.header-cta { display: flex; gap: 8px; align-items: center; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-btn { background: transparent; border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.8); font-family: var(--font-mono); font-size: 12px; padding: 6px 10px; border-radius: var(--radius); cursor: pointer; }
.lang-btn:hover { border-color: rgba(255,255,255,.5); color: #fff; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); min-width: 140px; padding: 5px; display: none; z-index: 60; }
.lang-switch:hover .lang-menu { display: block; }
.lang-menu a { display: block; padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--ink); border-radius: var(--radius); }
.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a.on { color: var(--blue); }

/* ─────────────── Buttons ─────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { border-color: rgba(255,255,255,.55); }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─────────────── Badges / chips ─────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: var(--radius); background: var(--surface-2); color: var(--steel);
}
.badge-live { background: var(--coral); color: #fff; }
.badge-live .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.badge-accent { background: var(--accent); color: var(--accent-ink); }
.badge-ink { background: var(--ink); color: #fff; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.seed { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }

/* ─────────────── Cards ─────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }

.section-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

/* ─────────────── Hero ─────────────── */
.hero { background: var(--ink); color: #fff; padding: 60px 0 72px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -80px; top: -40px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(207,242,59,.14), transparent 70%);
}
.hero h1 { font-size: 46px; font-weight: 700; letter-spacing: -.025em; max-width: 720px; }
.hero p { color: rgba(255,255,255,.7); font-size: 17px; max-width: 560px; margin-top: 16px; }
.hero .actions { display: flex; gap: 12px; margin-top: 28px; }
.kpis { display: flex; gap: 36px; margin-top: 40px; }
.kpi .n { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--accent); }
.kpi .l { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 2px; }

/* ─────────────── Event grid ─────────────── */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.event-card { display: flex; flex-direction: column; overflow: hidden; transition: .15s; }
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.event-card .top { height: 96px; background: linear-gradient(135deg, var(--ink-3), var(--ink)); position: relative; display: flex; align-items: flex-end; padding: 12px; }
.event-card .sport-ic { position: absolute; top: 12px; right: 12px; font-size: 22px; }
.event-card .body { padding: 14px 16px 16px; }
.event-card h3 { font-size: 17px; }
.event-card .meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.event-card .meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ─────────────── Tournament header ─────────────── */
.t-head { background: var(--ink); color: #fff; padding: 32px 0 0; }
.t-head .crumb { font-size: 13px; color: rgba(255,255,255,.55); margin-bottom: 14px; }
.t-head .crumb a:hover { color: var(--accent); }
.t-head h1 { font-size: 34px; font-weight: 700; }
.t-head .sub { display: flex; flex-wrap: wrap; gap: 16px; color: rgba(255,255,255,.72); font-size: 14px; margin-top: 12px; }
.t-head .sub span { display: inline-flex; align-items: center; gap: 6px; }
.t-tabs { display: flex; gap: 2px; margin-top: 26px; }
.t-tabs a {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  color: rgba(255,255,255,.6); padding: 12px 16px; border-bottom: 3px solid transparent;
}
.t-tabs a:hover { color: #fff; }
.t-tabs a.on { color: #fff; border-color: var(--accent); }

.page-pad { padding: 28px 0 64px; }

/* ─────────────── Bracket ─────────────── */
.bracket { display: flex; gap: 40px; overflow-x: auto; padding: 8px 2px 24px; }
.round { display: flex; flex-direction: column; justify-content: space-around; min-width: 230px; gap: 14px; }
.round-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 6px; }
.match {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: relative;
}
.match.is-live { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
.match .side {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; font-size: 13.5px;
}
.match .side + .side { border-top: 1px solid var(--line-2); }
.match .side .nm { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .side .sc { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-weight: 500; }
.match .side.win .nm { color: var(--ink); }
.match .side.win .sc { color: var(--ink); font-weight: 700; }
.match .side.lose { color: var(--muted-2); }
.match .side.lose .nm { font-weight: 500; }
.match .side .flag { font-size: 13px; }
.match .side.win::before { content: ""; position: absolute; left: 0; width: 3px; height: 50%; background: var(--accent); }
.match .foot { display: flex; justify-content: space-between; align-items: center; padding: 5px 11px; background: var(--surface-2); border-top: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.match .tbd { color: var(--muted-2); font-style: italic; font-weight: 500; }

/* ─────────────── Match list / schedule ─────────────── */
.mlist { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: grid; grid-template-columns: 78px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; }
.mrow .when { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.mrow .players { display: flex; flex-direction: column; gap: 3px; }
.mrow .players .ln { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.mrow .players .ln.win { color: var(--ink); }
.mrow .players .ln .sc { font-family: var(--font-mono); margin-left: auto; }
.mrow .rt { text-align: right; font-size: 12px; color: var(--muted); }

/* ─────────────── Standings table ─────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 500; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-family: var(--font-mono); text-align: center; }
.table .pos { font-family: var(--font-mono); color: var(--muted); width: 36px; }
.table .qual { box-shadow: inset 3px 0 0 var(--accent); }

/* ─────────────── Layout split ─────────────── */
.split { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 920px) { .split { grid-template-columns: 1fr; } }

/* ─────────────── Footer ─────────────── */
.site-footer { background: var(--ink); color: rgba(255,255,255,.6); padding: 40px 0; margin-top: 40px; font-size: 13px; }
.site-footer .brand { color: #fff; margin-bottom: 8px; }
.site-footer a:hover { color: var(--accent); }

.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* Flash + forms (organizer) */
.flash { padding: 11px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.flash-ok { background: #E4F4EC; color: #1a6644; border: 1px solid #b8e0cc; }
.flash-err { background: #FDECEA; color: #b93322; border: 1px solid #f3c2bc; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.app-head { display: flex; justify-content: space-between; align-items: center; padding-top: 30px; }
.status-pill { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius); }
.status-draft { background: var(--surface-2); color: var(--muted); }
.status-published { background: #E6F1FB; color: var(--blue); }
.status-live { background: var(--coral); color: #fff; }
.status-finished { background: var(--ink); color: #fff; }

/* ═══════════════ Event wizard (RankedIn-inspired flow, Sportevi brand) ═══════════════ */
.wiz-topbar { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; height: 54px; position: sticky; top: 60px; z-index: 40; }
.wiz-topbar .ev { font-size: 13px; color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-topbar .save { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.wiz-topbar .save .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Stepper */
.stepper-wrap { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 28px; }
.stepper { display: flex; align-items: stretch; max-width: 900px; margin: 0 auto; }
.step-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 16px 6px 13px; cursor: pointer; border-bottom: 3px solid transparent; transition: background .15s; text-align: center; }
.step-item:hover { background: var(--bg); }
.step-item.active { border-bottom-color: var(--accent); }
.step-item.done { border-bottom-color: #1a6644; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; margin-bottom: 6px; background: var(--surface-2); border: 1.5px solid var(--line); color: var(--muted); }
.step-item.active .step-num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-item.done .step-num { background: #1a6644; border-color: #1a6644; color: #fff; }
.step-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); line-height: 1.3; }
.step-item.active .step-label { color: var(--ink); }
.step-item.done .step-label { color: #1a6644; }
.step-connector { align-self: center; height: 1px; width: 18px; background: var(--line); margin-bottom: 26px; flex-shrink: 0; }

.wiz-body { max-width: 900px; margin: 0 auto; padding: 32px 24px 90px; }
.step-heading h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.step-heading p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.slug-preview { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.slug-preview .static { padding: 9px 12px; background: var(--surface-2); color: var(--muted); border-right: 1px solid var(--line); white-space: nowrap; font-family: var(--font-mono); font-size: 13px; }
.slug-preview input { border: none; flex: 1; border-radius: 0; }

/* Format selection cards */
.format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .format-grid { grid-template-columns: 1fr; } }
.fo { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; transition: .15s; background: var(--surface); }
.fo:hover { border-color: var(--border2, #ccc9be); }
.fo.sel { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(43,91,226,.15); }
.fo input { display: none; }
.fo .fo-icon { width: 34px; height: 34px; border-radius: var(--radius); background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.fo .fo-name { display: block; font-weight: 700; font-family: var(--font-head); font-size: 14px; }
.fo .fo-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.fo-roadmap { opacity: .6; cursor: not-allowed; }
.fo-roadmap:hover { border-color: var(--line); }
.roadmap-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); color: var(--muted); padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.fam-label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin: 6px 0 10px; }
.fam-label span { color: var(--muted-2); font-weight: 400; text-transform: none; letter-spacing: 0; }
.fmt-opts { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 6px; }
.opts-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.opt-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.opt-sel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.opt-sel select { padding: 6px 26px 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-body); }

/* Step 2 — entry management */
.seed-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-top: 12px; }
.byes-hint { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-left: auto; }
.status-mini { border: none; cursor: pointer; font-family: var(--font-mono); font-size: 10px; padding: 3px 6px; appearance: none; -webkit-appearance: none; }
.add-tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.add-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.add-tab.on { color: var(--ink); border-bottom-color: var(--blue); }
.add-pane { padding-top: 12px; }

/* Player rows */
.plist { display: flex; flex-direction: column; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
.prow .ava { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.prow .pn { flex: 1; font-weight: 600; }
.prow .seed-num { font-family: var(--font-mono); font-size: 12px; color: var(--muted-2); width: 26px; }
.pts-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 700; background: var(--surface-2); padding: 3px 9px; border-radius: var(--radius); }

.wiz-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.info-note { display: flex; gap: 10px; align-items: flex-start; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; font-weight: 600; }
.rs-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
@media (max-width: 640px) { .rs-grid { grid-template-columns: 1fr 1fr; } }
.rs-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.rs-stat .v { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--blue); }
.rs-stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }


/* ───────────── Sponsors ───────────── */
.sponsors { margin: 28px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.sponsors-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
                  color: var(--muted); text-align: center; margin-bottom: 12px; }
.sponsors-row { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: center; }
.sponsor { display: inline-flex; align-items: center; opacity: .85; transition: opacity .15s; }
.sponsor:hover { opacity: 1; }
.sponsor img { max-width: 200px; object-fit: contain; }
.sponsor-name { font-family: var(--font-head); font-weight: 700; color: var(--ink); }

.flash-warn { background:#fff6f3; border:1px solid var(--coral); color:#b03a1f; }

/* ───────────────────────── Mobile-first navigation & polish ───────────────────────── */
/* The header: brand | burger | nav-panel (nav + CTA). On desktop the panel is
   an inline row exactly as before; on mobile it collapses behind a burger. */
.nav-burger { display: none; }
/* display:contents makes this wrapper transparent on desktop, so nav + CTA stay
   direct flex children of .wrap and the original layout is untouched. */
.nav-panel { display: contents; }

@media (max-width: 860px) {
  .site-header .wrap { gap: 12px; position: relative; }
  .nav { flex: 1; }

  /* Burger button — 44px touch target. */
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; margin-left: auto; cursor: pointer; flex-shrink: 0;
  }
  .nav-burger span { display: block; height: 2px; width: 24px; background: #fff; border-radius: 2px; transition: .2s; }

  /* The panel becomes a full-width drawer under the header. */
  .nav-panel {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ink); border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 8px 0 14px; max-height: 0; overflow: hidden;
    box-shadow: var(--shadow-md);
  }
  .nav-toggle:checked ~ .nav-panel { max-height: 88vh; overflow-y: auto; }

  /* Burger animates to an X when open. */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Stacked, large touch targets inside the drawer. */
  .nav-panel .nav { flex-direction: column; gap: 0; padding: 0 12px; }
  .nav-panel .nav a { padding: 13px 12px; font-size: 16px; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .nav-panel .header-cta {
    flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px 0;
  }
  .nav-panel .header-cta .btn { justify-content: center; min-height: 46px; font-size: 15px; }
  .nav-panel .header-cta form { display: flex; }
  .nav-panel .header-cta form .btn { flex: 1; }
  .nav-panel .lang-switch { align-self: flex-start; }
}

/* Never let a page scroll sideways; wide blocks scroll inside themselves. */
@media (max-width: 640px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  /* Wide tables get their own horizontal scroll instead of blowing out the page. */
  .card > table, table.table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  /* Comfortable tap targets for all buttons on touch. */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  h1 { font-size: 24px !important; }
}
