/* REZVIVO: warm paper, forest green, real rides. System fonts; no external assets. */

/* ================================================================
   1. CSS-переменные: цвета, типографика, отступы
   ================================================================ */
:root {
  /* Основные цвета */
  --bg:           #f6f3eb;
  --bg-alt:       #ede9df;
  --bg-dark:      #293e35;
  --bg-dark-alt:  #354f43;

  /* Текст */
  --fg:           #28362f;
  --fg-muted:     #5c665e;
  --fg-faint:     #73786e;
  --fg-on-dark:   #fffdf7;
  --fg-muted-on-dark: #bdc9bd;

  /* Muted green UI accents; the original blue logo keeps its colours. */
  --accent:       #3f654d;
  --accent-dim:   #2e503b;
  --accent-fg:    #fffdf7;
  --line:         #354f43;

  /* Бордеры на светлом */
  --border:       #d8d8cb;
  --border-strong:#28362f;

  /* Семантика */
  --ok:           #2e7d3a;
  --warn:         #d97706;
  --err:          #c0322a;
  --info:         #1f5fbf;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(10,14,10,.04), 0 1px 1px rgba(10,14,10,.03);
  --shadow-md: 0 4px 12px rgba(10,14,10,.06), 0 2px 4px rgba(10,14,10,.04);
  --shadow-lg: 0 12px 32px rgba(10,14,10,.08), 0 4px 12px rgba(10,14,10,.05);
  --shadow-card: none;

  /* Типографика — системные стеки, без внешних зависимостей. */
  --font-display: -apple-system, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-body:    -apple-system, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", "Source Code Pro", "Roboto Mono", Consolas, "Courier New", monospace;

  /* Размеры */
  --maxw: 1200px;
  --r-sm:  4px;
  --r-md:  5px;
  --r-lg:  7px;
  --r-xl:  10px;
}

/* ================================================================
   2. Базовые сбросы и типографика
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--fg);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1em; }

a {
  color: var(--fg);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
a:hover { color: var(--accent-dim); text-decoration: underline; }

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

::selection { background: var(--accent); color: var(--accent-fg); }

.muted { color: var(--fg-muted); }
.lead  {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 60ch;
  line-height: 1.6;
}

/* ================================================================
   3. Контейнеры, шапка, подвал
   ================================================================ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 1.5rem;
  padding-block: .85rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo img {
  height: 38px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--fg-muted);
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.nav a:hover { color: var(--fg); text-decoration: none; }
.nav a:hover::after { transform: scaleX(1); }

.nav-cta {
  background: var(--fg);
  color: var(--bg) !important;
  padding: .55rem 1rem;
  border-radius: var(--r-md);
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font: inherit;
  display: inline-block;
  text-decoration: none;
  transition: all .15s ease;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--accent); color: var(--accent-fg) !important; text-decoration: none; }

.nav-form { display: inline; margin: 0; }
.as-link {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
}

/* Подвал */
.site-footer {
  background: var(--bg-alt);
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--fg); text-decoration: underline; }
.site-footer a:hover { color: var(--accent); }

.main-content {
  padding: 2rem 1.25rem 4rem;
  min-height: calc(100vh - 64px - 130px);
}

/* ================================================================
   4. Кнопки
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -0.005em;
  border-radius: var(--r-md);
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  text-decoration: none;
  user-select: none;
  white-space: normal;
  text-align: center;
  min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: none;
}
.btn-primary:hover {
  background: var(--accent-dim);
  color: var(--accent-fg);
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--fg);
  color: var(--bg);
}

.link-btn {
  background: none;
  border: 1px solid var(--border);
  padding: .35rem .75rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg-muted);
  transition: all .15s ease;
}
.link-btn:hover { border-color: var(--fg); color: var(--fg); }
.link-btn.danger:hover { border-color: var(--err); color: var(--err); }

/* Public pages: editorial layout, original game screenshots. */
.eyebrow { font-size: .76rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-dim); margin-bottom: 1.15rem; }
.home-intro { display: grid; grid-template-columns: .88fr 1.25fr; gap: 3.25rem; align-items: center; padding: 2.5rem 0 4rem; }
.home-intro > *, .ride-stories > *, .download-layout > * { min-width: 0; }
.home-intro h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(2.7rem, 4.2vw, 3.8rem); letter-spacing: -.035em; line-height: 1.08; max-width: 13ch; margin-bottom: 1.35rem; }
.home-intro .lead { font-size: 1.05rem; line-height: 1.7; }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.3rem; margin-top: 1.6rem; }
.text-link { font-weight: 600; text-decoration: underline; text-underline-offset: 5px; }
.home-start-note { color: var(--fg-muted); font-size: .83rem; margin: 1rem 0 0; max-width: 43ch; }
.ride-photo { margin: 0; }
.ride-photo > a { display: block; border-radius: var(--r-sm); overflow: hidden; }
.ride-photo img { display: block; width: 100%; height: auto; background: var(--bg-alt); }
.home-intro .ride-photo img { aspect-ratio: 1.18; object-fit: cover; object-position: 61% 50%; }
.ride-photo figcaption { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-size: .76rem; color: var(--fg-muted); margin-top: .75rem; }
.ride-stories { display: grid; grid-template-columns: 1.15fr 1fr; gap: 5rem; padding: 3.5rem 0 4rem; border-top: 1px solid var(--border); align-items: center; }
.ride-story-visual h2 { font-size: 2rem; font-weight: 500; margin-bottom: 1.75rem; }
.ride-options article { padding: 1.4rem 0; border-bottom: 1px solid var(--border); }
.ride-options article:first-child { padding-top: 0; }
.ride-options article:last-child { border-bottom: 0; padding-bottom: 0; }
.ride-options h3 { font-size: 1.15rem; font-weight: 650; margin-bottom: .6rem; }
.ride-options p { color: var(--fg-muted); margin: 0; line-height: 1.75; }
.open-source { scroll-margin-top: 6rem; display: grid; grid-template-columns: 1.2fr 1fr; gap: 5rem; padding: 2.75rem; background: #e8eddf; border-top: 3px solid #829571; border-radius: var(--r-sm); }
.open-source h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.open-source p:not(.eyebrow) { color: #4f5e4a; line-height: 1.75; }
.project-note { border-inline-start: 1px solid #c4ceb9; padding-inline-start: 2.25rem; }
.project-note h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.project-note .text-link { display: inline-block; margin-inline-end: 1.2rem; margin-bottom: .5rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.download-page { padding-top: 1.5rem; }
.download-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4rem; margin-top: 2.5rem; }
.download-release { padding: 2rem; background: #fffdf7; }
.download-release h2 { font-size: 1.5rem; overflow-wrap: anywhere; }
.release-notes { white-space: pre-wrap; margin-top: 1.5rem; color: var(--fg-muted); }
.checksum { display: block; overflow-wrap: anywhere; font-size: .8rem; margin-top: .75rem; }
summary { cursor: pointer; padding-block: .6rem; }
.version-check { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: .5rem; }
.version-check .form { border: 0; padding: 1rem 0; margin: 0; max-width: none; background: transparent; }
.download-aside h2 { font-size: 1.25rem; }
.download-aside h2:not(:first-child) { margin-top: 2rem; }
.download-aside p { color: var(--fg-muted); }
.skip-link { position: fixed; inset-block-start: .5rem; inset-inline-start: 1rem; transform: translateY(-200%); padding: .6rem 1rem; background: var(--fg); color: white; z-index: 1000; }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid #95672d; outline-offset: 4px; }
#main-content:focus { outline: none; }

/* ================================================================
   6. Карточки (универсальные)
   ================================================================ */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease, transform .15s ease;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ================================================================
   7. Формы
   ================================================================ */
.form, .form-wide {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}
.form-wide { max-width: 720px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-grid > .form-row.full { grid-column: span 2; }

.form-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}
.form-row label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--fg-muted);
}
.form-row input, .form-row select, .form-row textarea {
  font: inherit;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--fg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 0;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(10,14,10,.06);
}

.form-row.checkbox, .form-check {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
}
.form-row.checkbox label, .form-check label {
  margin: 0;
  font-size: .95rem;
  color: var(--fg);
  cursor: pointer;
}

.form-error {
  background: #fef2f0;
  border: 1px solid #f5c2bc;
  color: var(--err);
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.form-ok {
  background: #effaf0;
  border: 1px solid #b7e3bc;
  color: var(--ok);
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.form-aux {
  margin-top: 1rem;
  font-size: .9rem;
  text-align: center;
  color: var(--fg-muted);
}

/* ================================================================
   8. Таблицы
   ================================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}
th, td {
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border);
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--bg-alt); }

.row-link { cursor: pointer; }
.row-current { background: #e1eadc !important; }
.row-current td { font-weight: 600; }

td.cell-ua { font-family: var(--font-mono); font-size: .85rem; }

/* Numeric cells (mono) */
.rides-table td:nth-child(2),
.rides-table td:nth-child(3),
.rides-table td:nth-child(4),
.rides-table td:nth-child(5),
.sessions-table td:nth-child(3) {
  font-family: var(--font-mono);
  font-size: .9rem;
}

/* ================================================================
   9. Бэйджи, badges, статусы
   ================================================================ */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  border-radius: var(--r-md);
  background: var(--bg-alt);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
}
.badge-ok   { background: #effaf0; color: var(--ok);   border-color: #b7e3bc; }
.badge-info { background: #eaf2fc; color: var(--info); border-color: #c2d6ec; }
.badge-err  { background: #fef2f0; color: var(--err);  border-color: #f5c2bc; }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fg-muted);
  margin-right: .35rem;
  vertical-align: middle;
}

/* ================================================================
   10. Flash-уведомления и баннеры
   ================================================================ */
.flash {
  padding: .85rem 1.25rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: .95rem;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.flash::before {
  content: '●';
  font-size: 1.2rem;
  line-height: 0;
}
.flash-success { background: #effaf0; color: var(--ok);   border-color: #b7e3bc; }
.flash-error   { background: #fef2f0; color: var(--err);  border-color: #f5c2bc; }
.flash-info    { background: #eaf2fc; color: var(--info); border-color: #c2d6ec; }

.banner {
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
  font-size: .95rem;
  border-left: 3px solid;
}
.banner-info {
  background: #eaf2fc;
  border-left-color: var(--info);
  color: #163a73;
}
.banner-warn {
  background: #fef6e7;
  border-left-color: var(--warn);
  color: #7a4500;
}

/* ================================================================
   11. Дашборд / профиль
   ================================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-head h1, .page-head h2 { margin: 0; }

.dashboard, .profile-page, .security-page, .rides-page, .events-page, .pricing-page, .auth-page, .admin-page, .leaderboard-page, .live-page, .ride-detail, .event-detail {
  max-width: var(--maxw);
}

.summary, .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.summary-block {
  background: var(--bg-alt);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.summary-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-bottom: .35rem;
}
.summary .summary-block strong,
.summary-block strong {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  display: block;
  color: var(--accent);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.metric {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  text-align: center;
}
.m-label {
  font-size: .75rem;
  color: var(--fg-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: .35rem;
}
.m-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
}

/* ================================================================
   12. Тарифы (Pricing)
   ================================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.plan-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card h3 {
  font-size: 1.5rem;
  margin: 0;
}
.plan-card .price {
  display: flex;
  align-items: baseline;
  gap: .35rem;
}
.plan-card .amount {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.plan-card .period {
  font-size: 1rem;
  color: var(--fg-muted);
}
.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plan-card li {
  padding: .5rem 0;
  border-top: 1px dashed var(--border);
  font-size: .95rem;
}
.plan-card li:first-child { border-top: 0; }
.plan-card li::before {
  content: '→';
  color: var(--accent-dim);
  font-weight: 700;
  margin-right: .5rem;
}
.plan-card .btn { margin-top: auto; }

/* Highlight middle/recommended plan */
.plan-card:nth-child(2) {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  border-color: var(--bg-dark);
  transform: scale(1.02);
}
.plan-card:nth-child(2) h3,
.plan-card:nth-child(2) .amount { color: var(--fg-on-dark); }
.plan-card:nth-child(2) .period { color: var(--fg-muted-on-dark); }
.plan-card:nth-child(2) li { border-color: rgba(245,245,244,.15); }
.plan-card:nth-child(2) .btn-secondary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.plan-card:nth-child(2) .btn-secondary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--accent-fg);
}

.pricing-info {
  margin-top: 2rem;
  font-size: .9rem;
  color: var(--fg-muted);
  max-width: 60ch;
}

/* ================================================================
   13. События (Events)
   ================================================================ */
.event-list {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}
.event-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.event-card:hover { border-color: var(--fg); box-shadow: var(--shadow-md); transform: translateX(2px); }

.event-when {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .9rem;
  background: var(--accent);
  color: var(--accent-fg);
  padding: .5rem .85rem;
  border-radius: var(--r-md);
  white-space: nowrap;
}
.event-card h3 {
  margin: 0 0 .25rem;
  font-size: 1.15rem;
}
.event-meta {
  font-size: .85rem;
  color: var(--fg-muted);
}

.event-detail {
  margin: 2rem 0;
}

/* ================================================================
   14. Лидерборды
   ================================================================ */
.leaderboard-page table tbody tr:nth-child(1) td:first-child::before { content: '🥇 '; }
.leaderboard-page table tbody tr:nth-child(2) td:first-child::before { content: '🥈 '; }
.leaderboard-page table tbody tr:nth-child(3) td:first-child::before { content: '🥉 '; }

/* ================================================================
   15. Realtime / Live
   ================================================================ */
.live-page {
  margin: 2rem 0;
}
.live-counter {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: .9rem;
}
.live-counter::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--err);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(0.8); }
}
.live-empty {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
}

/* ================================================================
   16. Уведомления
   ================================================================ */
.notif-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.notif-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin-bottom: .5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: border-color .15s ease;
}
.notif-item:hover { border-color: var(--fg); }
.notif-item.unread { border-left: 3px solid var(--accent-dim); background: #e9eee3; }
.notif-title { font-weight: 600; }
.notif-body { font-size: .9rem; color: var(--fg-muted); }
.notif-meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--fg-faint);
}
.notif-link {
  color: var(--accent-dim);
  font-weight: 500;
  font-size: .85rem;
  margin-top: .25rem;
}

/* ================================================================
   17. Лента активности (feed)
   ================================================================ */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.feed-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
}
.feed-meta {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--fg-faint);
  margin-bottom: .35rem;
}

/* ================================================================
   18. Интеграции
   ================================================================ */
.integrations-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.integration-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.integration-card h3 { margin: 0; font-size: 1.1rem; }

/* ================================================================
   19. Чарты — простые столбцы (если есть)
   ================================================================ */
.charts {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}
.chart-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  gap: 1rem;
  align-items: center;
  padding: .5rem 0;
}
.chart-row .bar {
  background: var(--bg-alt);
  border-radius: var(--r-sm);
  height: 24px;
  overflow: hidden;
  position: relative;
}
.chart-row .bar-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  height: 100%;
}

/* ================================================================
   20. 404, ошибки
   ================================================================ */
.error-page {
  text-align: center;
  padding: 5rem 1rem;
}
.error-page h1 {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  margin-bottom: 0;
  background: linear-gradient(135deg, var(--fg), var(--accent-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.error-page h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

/* ================================================================
   21. Аутентификация
   ================================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px - 200px);
  padding: 2rem 1.25rem;
}
.auth-page .form { width: 100%; max-width: 380px; }

/* ================================================================
   22. Пагинация
   ================================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin: 2rem 0;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: .9rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-family: var(--font-mono);
}
.pagination a:hover { border-color: var(--fg); color: var(--fg); }
.pagination .current,
.pagination span.current {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ================================================================
   23. Inline блоки (детали заезда и т.п.)
   ================================================================ */
.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

/* ================================================================
   24. Адаптивность
   ================================================================ */
@media (max-width: 768px) {
  .header-inner { align-items: flex-start; gap: 1rem; }
  .logo img { height: 30px; }
  .nav { gap: .7rem 1rem; }
  .nav a { font-size: .85rem; }
  .nav-form { display: inline; }

  .home-intro, .ride-stories, .open-source, .download-layout { grid-template-columns: 1fr; gap: 2rem; }
  .home-intro { padding: 1rem 0 2.5rem; }
  .home-intro h1 { max-width: 19ch; }
  .home-intro .ride-photo img { aspect-ratio: 1.58; }
  .ride-stories { padding: 2.5rem 0; }
  .open-source { padding: 1.5rem; }
  .project-note { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid #c4ceb9; padding-top: 1.5rem; }
  .download-layout { margin-top: 1.5rem; }
  .download-release { padding: 1.25rem; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .form-row.full { grid-column: span 1; }

  .event-card { grid-template-columns: 1fr; }
  .event-card .btn { width: 100%; }

  .plan-card:nth-child(2) { transform: none; }

  table { font-size: .85rem; }
  th, td { padding: .65rem .5rem; }

  .summary, .summary-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .header-inner { flex-direction: column; gap: .6rem; }
  .nav { justify-content: flex-start; gap: .6rem 1rem; width: 100%; }
  .site-header { position: relative; }
  .main-content { padding-top: 1.25rem; }
  .summary, .summary-grid, .metrics { grid-template-columns: 1fr; }
}

/* ================================================================
   25. Reduced motion
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================
   26. Селектор языка в шапке
   ================================================================ */
.lang-switcher {
    position: relative;
    display: inline-block;
}
.lang-current {
    background: transparent;
    border: 1px solid var(--border);
    padding: .4rem .65rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    color: var(--fg-muted);
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: border-color .15s ease, color .15s ease;
}
.lang-current:hover { border-color: var(--fg); color: var(--fg); }
.lang-caret { font-size: .7em; opacity: .7; }

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: .35rem;
    margin: 0;
    list-style: none;
    min-width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 100;
}
.lang-menu[hidden] { display: none; }

.lang-form { margin: 0; }

.lang-option {
    width: 100%;
    background: transparent;
    border: 0;
    padding: .5rem .65rem;
    text-align: left;
    cursor: pointer;
    font: inherit;
    border-radius: var(--r-sm);
    color: var(--fg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    transition: background .12s ease;
}
.lang-option:hover { background: var(--bg-alt); }
.lang-option-active {
    background: var(--bg-alt);
    font-weight: 600;
}
.lang-option-active::after {
    content: '✓';
    color: var(--accent-dim);
    font-weight: 700;
}
.lang-native {
    font-weight: 500;
}
.lang-name {
    font-size: .8rem;
    color: var(--fg-muted);
}

/* RTL поддержка */
[dir="rtl"] .lang-menu { left: 0; right: auto; }

[dir="rtl"] .lang-option { text-align: right; }

@media (max-width: 480px) {
  .nav { position: relative; }
  .lang-switcher { position: static; }
  .lang-menu, [dir="rtl"] .lang-menu {
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    max-width: 100%;
  }
}
