/* /tour — поверх компонентов (этап 5–6 группа 2B). */

.tour-page .hero.tour-hero {
  margin-block-start: var(--s-2);
  padding: var(--tour-inset, var(--s-4));
  position: relative;
  overflow: hidden;
  border-bottom: none;
  text-align: start;
  gap: var(--s-3);
  grid-template-columns: 1fr;
}
.tour-page .hero.tour-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 80% 0%,
    color-mix(in srgb, var(--accent) 8%, transparent) 0%,
    transparent 55%
  );
  pointer-events: none;
}
.tour-page .tour-hero .hero__meta,
.tour-page .tour-hero .hero__title,
.tour-page .tour-hero .hero__sub {
  position: relative;
  z-index: 1;
}
.tour-page .tour-hero .hero__title {
  font-size: var(--d-h2);
  color: var(--accent);
  margin: 0;
}
.tour-page .tour-hero .hero__sub {
  max-width: none;
  font-size: var(--t-caption);
  letter-spacing: var(--ls-tight, 0.04em);
  text-transform: uppercase;
}
.tour-page .stat-panel.tour-meta {
  margin: 0;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 639px) {
  .tour-page .stat-panel.tour-meta {
    grid-template-columns: 1fr 1fr;
  }
  .tour-page .tour-hero .hero__title {
    font-size: var(--d-h3);
  }
}
.tour-page .standings-wrap .tbl-card,
.tour-page #forecast-wrap .tbl-card,
.tour-page #current-round-wrap .tbl-card {
  box-shadow: none;
  border: none;
  background: transparent;
}
/* table.css прячет .tbl-card > .tbl при container <640px (ждёт .tbl-cards).
   На tour карточек нет — всегда показываем таблицу. */
.tour-page .standings-wrap .tbl-card > .tbl,
.tour-page #forecast-wrap .tbl-card > .tbl,
.tour-page #current-round-wrap .tbl-card > .tbl {
  display: table;
  width: 100%;
}
.tour-page .standings-wrap .tbl,
.tour-page .standings {
  width: 100%;
}

/* scroll-top (was inline in tour.html) */
.tour-page #scroll-top {
  position: fixed;
  inset-block-end: var(--s-5);
  inset-inline-end: var(--s-4);
  z-index: 500;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-family: var(--font);
  font-size: var(--t-body-lg);
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, border-color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}
.tour-page #scroll-top.visible {
  display: flex;
}
.tour-page #scroll-top:hover {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}
.tour-page #scroll-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ============================================================
   EV RACE — pages/tour.css (stage 5-6 group 2B)
   Requires: CSS/arcade.css + CSS/operator.css + CSS/home-v2.css
   ============================================================ */

body.tour-page {
  overflow-x: clip;
  max-width: 100%;
}
html:has(body.tour-page) {
  overflow-x: clip;
}

.tour-page .page-wrap {
  color: var(--home-text);
  overflow-x: hidden;
  --tour-inset: var(--s-4);
  --tour-gap: var(--s-3);
}

/* ── breadcrumbs (shell как loc, без JSON-LD) ── */
.tour-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: var(--ls-tight);
  color: var(--home-text-dim);
  margin: var(--s-2) 0 var(--s-3);
  text-transform: uppercase;
}
.tour-breadcrumbs a {
  color: var(--green);
  text-decoration: none;
}
.tour-breadcrumbs a:hover { text-decoration: underline; }
.tour-bc-sep { opacity: 0.45; }
.tour-bc-cur { color: var(--yellow); }

/* ── хроника круга (факт | смысл) ── */
.tour-chronicle-blk[hidden] { display: none; }

.chronicle-grid {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 60%);
  align-items: stretch;
  gap: var(--s-3);
  padding: var(--tour-inset);
  min-width: 0;
  box-sizing: border-box;
}
.chronicle-grid--solo {
  grid-template-columns: 1fr;
}

.chronicle-fact {
  --ch-stripe: var(--ch-accent, var(--accent));
  /* единый каркас: кромка border-left + полный radius */
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ch-stripe);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: var(--tour-inset);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}
.chronicle-fact-label,
.chronicle-letter-title {
  font-family: var(--font-display);
  font-size: clamp(8px, 1vw, 10px);
  letter-spacing: 0.04em;
  line-height: 1.55;
  color: var(--dc);
  text-transform: uppercase;
}
.chronicle-fact-label {
  align-self: stretch;
  text-align: left;
  margin-bottom: var(--tour-gap);
}
.chronicle-letter-title {
  margin-bottom: 6px;
}
.chronicle-stations {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--tour-gap);
}
.chronicle-stations-num {
  font-family: var(--font-display);
  font-size: clamp(33px, 6vw, 57px);
  line-height: 1;
  color: var(--dc);
}
.chronicle-stations-unit {
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: var(--ls-tight);
  color: var(--dc);
  text-transform: uppercase;
}
.chronicle-op {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.45vw, 14px);
  line-height: 1.45;
  margin-bottom: 2px;
  text-transform: none;
}
.chronicle-achievement {
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.55;
  color: var(--home-text-dim);
  letter-spacing: var(--ls-tight);
  align-self: stretch;
  max-width: 100%;
}

.chronicle-meaning {
  padding: var(--tour-inset);
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.chronicle-letter-head {
  margin-bottom: var(--tour-inset);
}
.chronicle-letter-meta {
  font-family: var(--font-display);
  font-size: clamp(7px, 0.85vw, 9px);
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--dc);
  opacity: 0.38;
  text-transform: uppercase;
}
.chronicle-letter-text {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--dc);
  max-width: 42em;
}

/* ── hero ── */
.tour-hero {
  margin-top: var(--s-2);
  padding: var(--tour-inset);
  position: relative;
  overflow: hidden;
}
.tour-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 0%, color-mix(in srgb, var(--accent) 5%, transparent) 0%, transparent 55%);
  pointer-events: none;
}
.tour-hero-tag,
.tour-hero-title,
.tour-hero-sub {
  position: relative;
  z-index: 1;
}
.tour-hero-tag {
  font-family: var(--font);
  font-size: 10px;
  color: var(--home-text-dim);
  letter-spacing: var(--ls);
  margin-bottom: 8px;
}
.tour-hero-title {
  font-family: var(--font-display);
  font-size: clamp(14px, 3.2vw, 22px);
  color: var(--green);
  line-height: 1.55;
  margin: 0 0 10px;
  text-shadow: 0 0 14px var(--home-bg-glow);
}
.tour-hero-sub {
  font-family: var(--font);
  font-size: 11px;
  color: var(--home-text-mid);
  letter-spacing: var(--ls-tight);
  line-height: 1.7;
}

/* ── meta strip ── */
.tour-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--tour-gap);
  padding: var(--tour-inset);
}
.tour-meta-item {
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  border: 1px solid var(--home-bdr);
  border-radius: 3px;
  padding: var(--tour-gap) 6px;
  text-align: center;
}
.tour-meta-lbl {
  font-family: var(--font);
  font-size: 9px;
  color: var(--home-text-dim);
  letter-spacing: var(--ls-tight);
  margin-bottom: 6px;
}
.tour-meta-val {
  font-family: var(--font-display);
  font-size: clamp(8px, 1.6vw, 11px);
  color: var(--yellow);
  line-height: 1.55;
  text-shadow: 0 0 8px color-mix(in srgb, var(--dc) 35%, transparent);
}

/* ── unified blk inset (контент ниже разделителя hdr) ── */
.tour-page .page-wrap .blk-hdr {
  padding: var(--tour-gap) var(--tour-inset);
}

.tour-blk-body,
.tour-page .page-wrap .standings-wrap,
.tour-page .page-wrap #forecast-wrap,
.tour-page .page-wrap #history-wrap {
  padding: var(--tour-inset);
}

/* WAVE2 CLS: typical heights (5 ops, 3G late + ~5–10px) */
.tour-page .page-wrap #current-round-wrap { min-height: 96px; box-sizing: border-box; }
.tour-page .page-wrap #forecast-wrap { min-height: 400px; box-sizing: border-box; }
.tour-page .page-wrap #standings-stations-wrap { min-height: 260px; box-sizing: border-box; }
.tour-page .page-wrap #standings-power-wrap { min-height: 288px; box-sizing: border-box; }

.tour-blk-body > .loading {
  padding: var(--tour-gap) 0;
  text-align: center;
  font-family: var(--font);
  font-size: 12px;
  color: var(--home-text-dim);
}

.blk-hdr .tour-hdr-sub {
  font-family: var(--font);
  font-size: 9px;
  color: var(--home-text-dim);
  letter-spacing: var(--ls-tight);
  margin-left: auto;
}

/* ── current round (единый жёлтый blk, без inner-рамки и ::before) ── */
.tour-page .page-wrap .tour-cur-blk {
  border-color: color-mix(in srgb, var(--dc) 40%, transparent);
  background: color-mix(in srgb, var(--dc) 6%, transparent);
}
.tour-page .page-wrap .tour-cur-blk .blk-hdr {
  border-bottom-color: color-mix(in srgb, var(--dc) 22%, transparent);
}
.tour-page .page-wrap .tour-cur-blk .blk-title {
  color: var(--dc);
}

.tour-page .page-wrap .cur-round {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  position: static;
}
.tour-page .page-wrap .cur-round::before {
  content: none;
  display: none;
}
.tour-page .page-wrap .cur-round-header {
  margin-bottom: var(--tour-gap);
}
.tour-page .page-wrap .cur-round-num {
  font-size: clamp(14px, 3vw, 20px);
}
.tour-page .page-wrap .cur-round-dates {
  color: var(--home-text-mid);
}
.tour-page .page-wrap .cur-round-table th {
  border-bottom-color: color-mix(in srgb, var(--dc) 15%, transparent);
  color: var(--home-text-dim);
}
.tour-page .page-wrap .cur-round-table td {
  border-bottom-color: var(--home-bdr);
}
.tour-page .page-wrap .cur-no-data {
  color: var(--home-text-dim);
  padding: 0;
  margin: 0;
}

/* ── standings ── */
.tour-page .page-wrap .standings {
  margin-bottom: 0;
  font-size: 13px;
}
.tour-page .page-wrap .standings th {
  color: var(--home-text-dim);
  border-bottom-color: var(--home-bdr);
  background: var(--surface-2);
}
.tour-page .page-wrap .standings th.th-pts {
  background: transparent;
  color: var(--dc);
  text-align: right;
}
html[data-theme="arcade"] .tour-page .page-wrap .standings th.th-pts {
  background: var(--dc-bg);
}
.tour-page .page-wrap .standings td {
  border-bottom-color: var(--home-bdr);
}

/* ── forecast ── */
.tour-page .page-wrap .forecast-section {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
}
.tour-page .page-wrap .forecast-hint {
  border-bottom-color: var(--home-bdr);
  color: var(--home-text-dim);
}

/* ── history ── */
.tour-page .page-wrap .hist-grid-wrap {
  padding: 0;
}
.tour-page .page-wrap .hist-row {
  border-bottom-color: var(--home-bdr);
}
.tour-page .page-wrap .hist-toggle-btn {
  margin: var(--tour-gap) 0 0;
  width: 100%;
  border-color: var(--home-bdr);
  border-radius: 3px;
}

/* ── round result cards ── */
.tour-page .page-wrap .rounds-legend {
  padding: var(--tour-inset) var(--tour-inset) 0;
  color: var(--home-text-dim);
}
.tour-page .page-wrap #rounds-grid {
  padding: var(--tour-gap) var(--tour-inset) var(--tour-inset);
}
.tour-page .page-wrap .rounds-grid {
  gap: 8px;
}
.tour-page .page-wrap .round-cell {
  background: var(--home-card);
  border: 1px solid var(--home-bdr);
  border-radius: 3px;
  padding: 10px 6px 8px;
  position: relative;
  overflow: hidden;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.tour-page .page-wrap .round-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rc-accent, transparent);
}
.tour-page .page-wrap .round-cell.active {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 6%, transparent);
}
.tour-page .page-wrap .round-cell .r-num {
  color: var(--home-text-mid);
  margin-bottom: 2px;
}
.tour-page .page-wrap .round-cell .r-win {
  font-size: 9px;
  line-height: 1.45;
}
.tour-page .page-wrap .round-cell .r-date {
  color: var(--home-text-dim);
  margin-top: 2px;
}
.tour-page .page-wrap .rounds-grid-wrap .rounds-grid-fade,
.tour-page .page-wrap .hist-grid-wrap .hist-grid-fade {
  background: linear-gradient(transparent, var(--home-card));
}
.tour-page .page-wrap .rounds-toggle-btn {
  margin: var(--s-2) 0 0;
  border-color: var(--home-bdr);
  border-radius: 3px;
}

/* ── rules ── */
.tour-page .page-wrap .rules-section {
  border: none;
  background: transparent;
  padding: var(--tour-inset);
  margin: 0;
}
.tour-page .page-wrap .rule-h {
  border-bottom-color: var(--home-bdr);
  color: var(--green);
}
.tour-page .page-wrap .rule-t {
  color: var(--home-text-mid);
}

/* ── mobile ── */
@media (max-width: 639px) {
  .tour-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tour-hero-title {
    font-size: 13px;
  }
  .tour-page .page-wrap .rounds-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .tour-page .page-wrap .standings {
    font-size: 11px;
  }
  .tour-page .page-wrap .standings th {
    font-size: 8px;
    padding: 7px 4px;
  }
  .tour-page .page-wrap .standings td {
    padding: 8px 4px;
  }
  .tour-page .page-wrap .cur-round-table {
    font-size: 11px;
  }
  .blk-hdr .tour-hdr-sub {
    width: 100%;
    margin-left: 0;
    margin-top: 2px;
  }
  .chronicle-grid {
    grid-template-columns: 1fr;
  }
  .chronicle-fact {
    border-bottom: none;
  }
  .chronicle-meaning {
    justify-content: flex-start;
    min-height: 0;
  }
  .chronicle-stations-num {
    font-size: clamp(36px, 13vw, 50px);
  }
  .chronicle-op {
    font-size: clamp(9px, 3.2vw, 12px);
  }
  .chronicle-letter-text {
    max-width: none;
  }
}

/* ── TESLA overrides ── */
html[data-theme="light"] .tour-page .page-wrap,
html[data-theme="dark"] .tour-page .page-wrap {
  color: var(--text);
}
html[data-theme="light"] .tour-page .page-wrap .tour-meta-item,
html[data-theme="dark"] .tour-page .page-wrap .tour-meta-item {
  background: rgba(0, 0, 0, 0.02);
}
html[data-theme="light"] .tour-page .page-wrap .round-cell.active,
html[data-theme="dark"] .tour-page .page-wrap .round-cell.active {
  background: rgba(0, 128, 0, 0.06);
  box-shadow: none;
}
html[data-theme="light"] .tour-page .page-wrap .tour-cur-blk,
html[data-theme="dark"] .tour-page .page-wrap .tour-cur-blk {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-bg);
}
html[data-theme="light"] .tour-page .page-wrap .tour-cur-blk .blk-hdr,
html[data-theme="dark"] .tour-page .page-wrap .tour-cur-blk .blk-hdr {
  border-bottom-color: color-mix(in srgb, var(--accent) 25%, transparent);
}
html[data-theme="light"] .tour-page .page-wrap .tour-cur-blk .blk-title,
html[data-theme="dark"] .tour-page .page-wrap .tour-cur-blk .blk-title {
  color: var(--accent);
}
html[data-theme="light"] .tour-page .page-wrap .cur-round-table th,
html[data-theme="dark"] .tour-page .page-wrap .cur-round-table th {
  border-bottom-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

html[data-theme="light"] .tour-breadcrumbs,
html[data-theme="dark"] .tour-breadcrumbs {
  color: var(--text-dim);
}
html[data-theme="light"] .tour-breadcrumbs a,
html[data-theme="dark"] .tour-breadcrumbs a {
  color: var(--text);
}
html[data-theme="light"] .tour-bc-cur,
html[data-theme="dark"] .tour-bc-cur {
  color: var(--text);
  font-weight: 600;
}
html[data-theme="light"] .chronicle-fact-label,
html[data-theme="dark"] .chronicle-fact-label,
html[data-theme="light"] .chronicle-letter-title,
html[data-theme="dark"] .chronicle-letter-title,
html[data-theme="light"] .chronicle-letter-text,
html[data-theme="dark"] .chronicle-letter-text {
  color: var(--accent);
}
html[data-theme="light"] .chronicle-letter-meta,
html[data-theme="dark"] .chronicle-letter-meta {
  color: var(--fg-3);
  opacity: 1;
}
html[data-theme="light"] .chronicle-stations-num,
html[data-theme="dark"] .chronicle-stations-num,
html[data-theme="light"] .chronicle-stations-unit,
html[data-theme="dark"] .chronicle-stations-unit {
  color: var(--accent);
}
html[data-theme="light"] .chronicle-fact,
html[data-theme="dark"] .chronicle-fact {
  border-left-color: var(--ch-stripe);
  background: var(--surface);
}
html[data-theme="light"] .chronicle-meaning,
html[data-theme="dark"] .chronicle-meaning {
  background: var(--surface);
}

html[data-theme="light"] .fx-toggle,
html[data-theme="dark"] .fx-toggle {
  display: none;
}

/* точки и имена операторов через .op-* (--c из theme.css) */
.tour-page .dot[class*="op-"] { background: var(--c); }
.tour-page .op-bf,
.tour-page .op-fo,
.tour-page .op-za,
.tour-page .op-uc,
.tour-page .op-cs { color: var(--c); }
.tour-page .hist-dim { color: var(--fg-3); }
