:root{
  --bg:#0b0c0d;
  --panel: rgba(255,255,255,.03);
  --text:#fff;
  --muted: rgba(255,255,255,.68);
  --muted2: rgba(255,255,255,.42);
  --border: rgba(255,255,255,.08);
  --accent:#0066ec;
  --accent2:#005ed9;
  --shadow: 0 10px 28px rgba(0,0,0,.45);
  --r:16px;
  --r2:22px;
  --font: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:var(--font); color:var(--text);
  background:
    radial-gradient(900px 600px at 65% 0%, rgba(0,102,236,.18), transparent 60%),
    radial-gradient(700px 520px at 10% 10%, rgba(0,94,217,.10), transparent 55%),
    var(--bg);
}
a{color:inherit; text-decoration:none}
img{display:block; max-width:100%}
.container{max-width:1240px; margin:0 auto; padding:0 18px}

.app{display:flex; min-height:100vh}
.sidebar{
  width:286px;
  padding:18px 14px;
  border-right:1px solid var(--border);
  position:sticky; top:0; height:100vh;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
}
.brand{display:flex; align-items:center; gap:10px; padding:4px 6px 10px}
.brand img{height:34px; width:auto}
.searchbox{
  margin:10px 6px 16px;
  display:flex; align-items:center; gap:10px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
}
.searchbox input{flex:1; border:none; outline:none; background:transparent; color:var(--text)}
.searchbox .hint{
  font-size:12px; color:var(--muted2);
  border:1px solid var(--border); padding:2px 8px; border-radius:10px;
}
.nav{padding:6px}
.nav .label{
  margin:14px 0 6px; color:var(--muted2);
  font-size:12px; text-transform:uppercase; letter-spacing:.08em;
}
.nav a{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px; border-radius:14px;
  border:1px solid transparent;
  color:rgba(255,255,255,.86);
}
.nav a:hover{background:rgba(255,255,255,.03); border-color:var(--border)}
.nav a.active{background:rgba(0,102,236,.14); border-color:rgba(0,102,236,.42)}
.nav a .dot{opacity:.65}
.sidebar-bottom{position:absolute; left:14px; right:14px; bottom:16px}
.support{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 12px; border:1px solid var(--border);
  border-radius:14px; background:rgba(255,255,255,.02);
}
.support small{color:var(--muted2)}

.main{flex:1; min-width:0}
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  /* keep controls away from screen edges (incl. iOS safe areas) */
  padding:18px calc(24px + env(safe-area-inset-right)) 12px calc(24px + env(safe-area-inset-left));
  backdrop-filter: blur(14px);
  background: rgba(11,12,13,.66);
  border-bottom:1px solid var(--border);
}
.leftbar{display:flex; align-items:center; gap:10px}
.burger{
  display:none;
  background:transparent;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  color:var(--text);
  cursor:pointer;
}
.switch{
  display:flex; gap:10px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  padding:6px;
  border-radius:16px;
}
.switch a{
  padding:10px 12px; border-radius:12px;
  font-weight:800; font-size:14px;
  color:rgba(255,255,255,.70);
}
.switch a.on{color:var(--text); background:rgba(0,102,236,.18)}
.actions{display:flex; gap:10px; align-items:center}
.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:900;
}
.btn.primary{
  background:linear-gradient(180deg, rgba(0,102,236,.95), rgba(0,94,217,.95));
  border-color:rgba(0,102,236,.55);
}

.section{padding:18px}
.hero{
  display:grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap:16px;
}
.banner{
  border:1px solid var(--border);
  border-radius:var(--r2);
  overflow:hidden;
  background:rgba(255,255,255,.02);
  box-shadow:var(--shadow);
}
.banner img{width:100%; height:100%; object-fit:cover}

.toolbar{
  margin-top:16px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; flex-wrap:wrap;
}
.filters{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:8px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  border-radius:18px;
}
.fbtn{
  padding:10px 12px;
  border:1px solid transparent;
  border-radius:14px;
  background:transparent;
  color:rgba(255,255,255,.70);
  font-weight:900;
  cursor:pointer;
  display:inline-flex; align-items:center; gap:8px;
}
.fbtn:hover{
  background:rgba(0,102,236,.18);
  border-color:rgba(0,102,236,.28);
  color:#ffffff;
  transform:translateY(-2px);
  box-shadow:0 6px 16px rgba(0,0,0,0.25);
}

.fbtn.on{color:var(--text); background:rgba(0,102,236,.18); border-color:rgba(0,102,236,.28)}
.inline-search{
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--border);
  border-radius:18px;
  padding:10px 12px;
  min-width:300px;
  background:rgba(255,255,255,.02);
}
.inline-search input{flex:1; border:none; outline:none; background:transparent; color:var(--text)}
.h2{font-size:18px; margin:24px 0 14px}

/* Slot cards (portrait like original) */
.grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:14px;
}
.tile{
  border:1px solid var(--border);
  border-radius:22px;
  overflow:hidden;
  background:rgba(255,255,255,.02);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.thumb{
  width:100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  background:#0d0f12;
}
.tile-body{padding:10px 12px 12px}
.tile-title{font-weight:900; font-size:13px; line-height:1.25}
.tile-meta{margin-top:8px; display:flex; align-items:center; justify-content:space-between; gap:10px}
.badge{
  font-size:11px; font-weight:900;
  padding:4px 10px; border-radius:999px;
  border:1px solid var(--border);
  color:rgba(255,255,255,.70);
}
.play{
  padding:8px 14px;
  border-radius:14px;
  border:1px solid rgba(0,102,236,.55);
  background:rgba(0,102,236,.10);
  font-weight:900; font-size:12px;
}

.footer{
  padding:22px 18px 34px;
  color:var(--muted);
  border-top:1px solid var(--border);
}
.footer .cols{display:grid; grid-template-columns:2fr 1fr 1fr; gap:16px}
.small{font-size:12px; line-height:1.55; color:var(--muted)}

/* Responsive */
@media (max-width:1100px){
  .grid{grid-template-columns:repeat(4,1fr)}
  .hero{grid-template-columns: 1.7fr 1fr}
}
@media (max-width:860px){
  .sidebar{
    position:fixed; left:0; top:0;
    width: min(86vw, 320px);
    transform:translateX(-102%);
    transition:transform .2s ease;
    z-index:50;
  }
  .sidebar.open{transform:translateX(0)}
  .burger{display:inline-flex}
  .grid{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:560px){
  .grid{grid-template-columns:repeat(2,1fr)}
  .inline-search{min-width:0; width:100%}
  .footer .cols{grid-template-columns:1fr}
}
/* ===== Content spacing ===== */
.content{
  padding-left: 18px;
  padding-right: 18px;
}

@media (max-width: 560px){
  .content{
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ===== Mobile & tablet polish (only responsive tweaks) ===== */

/* iOS safe areas (sidebar/footer only; topbar handled in its own padding) */
.sidebar,
.footer{
  padding-left: calc(env(safe-area-inset-left, 0px) + 0px);
  padding-right: calc(env(safe-area-inset-right, 0px) + 0px);
}

/* Prevent horizontal scrolling on small screens */
body{ overflow-x:hidden; }

/* Make toolbars usable on phones */
@media (max-width: 860px){
  /* keep space from edges on phones */
  .topbar{
    padding: 12px calc(18px + env(safe-area-inset-right)) 12px calc(18px + env(safe-area-inset-left));
    flex-wrap: wrap;
    gap:10px;
  }
  .section{ padding: 14px 0; }
  .container{ padding: 0 14px; }

  .leftbar{ flex: 1 1 auto; min-width: 220px; }
  .actions{ flex: 0 0 auto; }

  .actions{ gap:8px; }
  .btn{ padding: 9px 12px; border-radius: 12px; }

  .filters{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap:nowrap;
    gap:8px;
  }
  .filters::-webkit-scrollbar{ height:0; }
  .fbtn{ white-space:nowrap; padding: 9px 11px; }

  .inline-search{ width:100%; min-width:0; }
}

/* Hero banners stack nicely */
@media (max-width: 760px){
  .hero{ grid-template-columns: 1fr; }
  .banner{ border-radius: 18px; }
}

/* Slot grid tuning */
@media (max-width: 560px){
  .grid{ gap:12px; }
  .tile{ border-radius: 18px; }
  .tile-body{ padding: 10px 10px 12px; }
  .tile-title{ font-size: 12.5px; }
  .play{ padding: 8px 12px; }
}

@media (max-width: 380px){
  .grid{ grid-template-columns: 1fr; }
}

/* Tables: keep readable on phones */
.table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table-wrap table{ min-width: 560px; }
@media (max-width: 560px){
  .table-wrap table{ min-width: 520px; }
}

/* Sidebar overlay spacing + scroll */
@media (max-width: 860px){
  .sidebar{ width: min(86vw, 320px); height: 100dvh; overflow:auto; padding-bottom: 90px; }
  .sidebar-bottom{ position: sticky; bottom: 10px; }
}

@media (max-width: 420px){
  .brand img{ height: 28px; }
  .switch a{ padding: 9px 10px; font-size: 13px; }
}

/* Typography scale for very small screens */
@media (max-width: 420px){
  .content h1{ font-size: 26px; }
  .content h2{ font-size: 20px; }
  .content h3{ font-size: 16px; }
}
/* ===== Tables: white grid on dark bg ===== */
.table-wrap{
  display: flex;
  justify-content: center; /* центрируем таблицу */
  margin: 18px 0;
}

.table-wrap table{
  border-collapse: collapse;
  width: min(920px, 100%);  /* аккуратно по ширине */
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.35); /* внешняя рамка */
  border-radius: 12px;
  overflow: hidden;
}

.table-wrap th,
.table-wrap td{
  border: 1px solid rgba(255,255,255,0.28); /* сетка */
  padding: 12px 14px;
  vertical-align: top;
}

.table-wrap th{
  color: #fff;
  font-weight: 900;
  background: rgba(255,255,255,0.04);
}

.table-wrap td{
  color: rgba(255,255,255,0.9);
}
/* ===== Typography spacing ===== */
.content h1,
.content h2,
.content h3,
.content p,
.content ul,
.content ol{
  margin-left: 6px;
  margin-right: 6px;
}

.content h1{ margin-top: 8px;  margin-bottom: 14px; }
.content h2{ margin-top: 22px; margin-bottom: 12px; }
.content h3{ margin-top: 18px; margin-bottom: 10px; }
.content p{  margin-top: 0;   margin-bottom: 12px; }
.content ul,
.content ol{ margin-top: 8px; margin-bottom: 14px; }

/* === FIX: tables must scroll horizontally on all mobiles (incl. iOS) === *//*
.table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  touch-action: pan-x;
  display:block;
}
.table-wrap table{
  width:max-content;
  min-width:560px;
  margin:0; /* left aligned so you can always scroll fully to the left 
}*/
/*
@media (max-width: 560px){
  .table-wrap table{ min-width:520px; }
}
*/

/* ===== Tonplay таблицы ===== */

.responsive-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0 22px;
  border-radius: 14px;
  overflow: hidden; /* для скругления */
  background: rgba(244, 245, 246, 0.04);
  border: 1px solid rgba(244, 245, 246, 0.10);
}

/* Ячейки */
.responsive-table td,
.responsive-table th {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid rgba(244, 245, 246, 0.08);
  font-size: 14px;
  line-height: 1.45;
  color: rgba(244, 245, 246, 0.86);
}

/* Если внутри td/th у вас <p> — убираем лишние отступы */
.responsive-table td p,
.responsive-table th p {
  margin: 0;
}

/* Первая строка в tbody — как “шапка” (у вас именно так сделано) */
.responsive-table tbody tr:first-child td {
  font-weight: 700;
  color: rgba(244, 245, 246, 0.92);
  background: rgba(244, 245, 246, 0.06);
  border-bottom: 1px solid rgba(244, 245, 246, 0.10);
}

/* Последняя строка без нижней линии */
.responsive-table tbody tr:last-child td {
  border-bottom: none;
}

/* Небольшой hover на десктопе */
@media (hover: hover) {
  .responsive-table tbody tr:hover td {
    background: rgba(244, 245, 246, 0.05);
  }
}

/* ===== Мобилка: делаем “карточный режим” для таблиц в 2 колонки ===== */
@media (max-width: 640px) {
  /* карточный режим включаем ТОЛЬКО когда таблица двухколоночная
     (у вас таких как минимум 1). */
  .responsive-table.tp-2col tbody tr:first-child {
    display: none; /* скрываем строку “Показатель/Значение” */
  }

  .responsive-table.tp-2col,
  .responsive-table.tp-2col tbody,
  .responsive-table.tp-2col tr,
  .responsive-table.tp-2col td {
    display: block;
    width: 100%;
  }

  .responsive-table.tp-2col tr {
    border-bottom: 1px solid rgba(244, 245, 246, 0.08);
    padding: 10px 12px;
  }

  .responsive-table.tp-2col tr:last-child {
    border-bottom: none;
  }

  .responsive-table.tp-2col td {
    border: none;
    padding: 6px 0;
  }

  /* “левая” ячейка (название) — как подпись */
  .responsive-table.tp-2col td:first-child {
    font-weight: 700;
    color: rgba(244, 245, 246, 0.92);
  }

  /* “правая” ячейка (значение) */
  .responsive-table.tp-2col td:last-child {
    color: rgba(244, 245, 246, 0.86);
  }
}

/*баннеры на амп версии*/
.hero{
  display:grid;          /* или flex — не важно */
  gap:16px;              /* расстояние между баннерами */
}

.banner{
  display:block;
  border-radius:18px;    /* если нужны скругления */
  overflow:hidden;       /* КЛЮЧ: обрезает по границе */
  background:transparent;
  padding:0;
  line-height:0;         /* убирает возможные зазоры */
  text-decoration:none;
}

.banner amp-img{
  display:block;
}

/* В AMP реальная картинка внутри имеет этот класс */
.banner .i-amphtml-fill-content{
  object-fit:cover;
}