/* Проверка соединения — /assets/speedtest.css
 * Флюидный полноэкранный виджет: занимает ширину и доступную высоту окна.
 * Мобайл — вертикально; от 720px — адаптивная двухколоночная раскладка.
 * Палитра: ночь #0B111D, панель #111927, линия #1E2A3E,
 * сигнал #57A6FF → аврора #7FE8FF, туман #8FA0B8, снег #F4F8FF.
 * Числа — моноширинные. Кнопка — прозрачная с неоновой рамкой.
 * Только системные шрифты (CSP: без CDN). Все классы с префиксом st-.
 * Для каждого calc() задан px-фолбэк строкой выше.
 */

.st-page,
.st-page *,
.st-card,
.st-card * {
  box-sizing: border-box;
}

html:has(.st-page) {
  min-height: 100%;
  background: #0b111d;
}

.st-page {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(75% 60% at 15% 15%, rgba(87, 166, 255, 0.16), transparent 72%),
    radial-gradient(65% 70% at 88% 30%, rgba(127, 232, 255, 0.1), transparent 72%),
    #0b111d;
  color: #f4f8ff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
}

/* Лёгкое зерно поверх фона — убирает «пластик», добавляет тепла. */
.st-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

.st-page > * {
  position: relative;
  z-index: 1;
}

.st-skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f4f8ff;
  color: #0b111d;
}

.st-skip:focus {
  top: 12px;
}

.st-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(143, 160, 184, 0.18);
  background: rgba(11, 17, 29, 0.84);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

/* Стеклянная шапка с подсветкой: блик сверху, светящаяся кромка снизу. */
.st-topbar--glass {
  border-bottom-color: rgba(127, 232, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 55%),
    linear-gradient(90deg, rgba(87, 166, 255, 0.10), rgba(11, 17, 29, 0) 40%, rgba(127, 232, 255, 0.07)),
    rgba(11, 17, 29, 0.62);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 10px 34px rgba(5, 10, 20, 0.45);
}

.st-topbar-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(127, 232, 255, 0) 0%,
    rgba(87, 166, 255, 0.85) 22%,
    rgba(127, 232, 255, 1) 50%,
    rgba(87, 166, 255, 0.85) 78%,
    rgba(127, 232, 255, 0) 100%);
  box-shadow:
    0 0 10px rgba(127, 232, 255, 0.55),
    0 0 26px rgba(87, 166, 255, 0.35);
  opacity: 0.9;
}

.st-topbar--glass .st-brand {
  color: #dbe7f5;
}

.st-topbar--glass .st-brand img {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(127, 232, 255, 0.55));
}

.st-topbar--glass .st-top-actions a {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.st-topbar--glass .st-top-actions a:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 14px rgba(127, 232, 255, 0.22);
}

.st-topbar-inner {
  width: 100%;
  max-width: 1600px;
  min-height: 56px;
  margin: 0 auto;
  padding: 8px clamp(14px, 2.4vw, 38px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
}

.st-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9aaabd;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.st-brand img {
  width: 20px;
  height: 20px;
  flex: none;
  opacity: 0.82;
}

.st-brand:hover {
  color: #c7d5e4;
}

.st-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.st-top-actions a {
  min-height: 34px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(143, 160, 184, 0.2);
  border-radius: 10px;
  background: transparent;
  color: #aebdce;
  font-size: 0.8rem;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.st-top-actions a:hover {
  background: rgba(127, 232, 255, 0.06);
  border-color: rgba(127, 232, 255, 0.42);
  color: #dff9ff;
}

.st-top-actions a[aria-current="page"] {
  border-color: rgba(127, 232, 255, 0.34);
  background: rgba(127, 232, 255, 0.045);
  color: #d8eef5;
}

.st-main {
  min-height: calc(100vh - 56px);
  min-height: calc(100svh - 56px);
  display: flex;
  flex: none;
}

.st-page .st-card {
  min-height: 0;
  flex: 1;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.st-card {
  --st-night: #0b111d;
  --st-panel: #111927;
  --st-line: #1e2a3e;
  --st-signal: #57a6ff;
  --st-aurora: #7fe8ff;
  --st-fog: #8fa0b8;
  --st-snow: #f4f8ff;
  --st-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  width: 100%;
  min-height: calc(100vh - 32px);
  min-height: calc(100svh - 32px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  padding: 24px 20px 20px;
  padding: calc(18px + 1vw) calc(16px + 1vw) calc(16px + 1vw);
  background:
    radial-gradient(130% 80% at 50% -20%, rgba(87, 166, 255, 0.13), transparent 60%),
    linear-gradient(175deg, var(--st-panel), var(--st-night) 70%);
  border: 1px solid var(--st-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 120px rgba(87, 166, 255, 0.05),
    0 20px 50px rgba(9, 16, 29, 0.25);
  color: var(--st-snow);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Стекло: включается только там, где браузер умеет размытие фона. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .st-card {
    background:
      radial-gradient(130% 80% at 50% -20%, rgba(87, 166, 255, 0.14), transparent 60%),
      linear-gradient(175deg, rgba(17, 25, 39, 0.72), rgba(11, 17, 29, 0.78) 70%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .st-result {
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-color: rgba(127, 232, 255, 0.22);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 0 14px rgba(87, 166, 255, 0.12);
  }

  .st-button {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    background: rgba(127, 232, 255, 0.08);
  }
}

.st-eyebrow {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-size: calc(0.6rem + 0.12vw);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--st-signal);
}

.st-card h1,
.st-card h2 {
  margin: 0 0 18px;
  font-size: 1.45rem;
  font-size: clamp(1.35rem, 1.05rem + 1vw, 2.25rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--st-snow);
}

.st-intro {
  max-width: 62ch;
  margin: -6px 0 0;
  color: var(--st-fog);
  font-size: clamp(0.86rem, 0.8rem + 0.2vw, 1rem);
  line-height: 1.5;
}

.st-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
}

.st-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ---------- Шкала ---------- */

/* Спидометр — сам кнопка запуска: тап по шкале начинает проверку. */
.st-gauge-tap {
  display: block;
  width: 100%;           /* кнопка занимает ячейку сетки; сам SVG центрируется как раньше */
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border-radius: 24px;
}

@media (hover: none) and (pointer: coarse) {
  .st-gauge-tap {
    cursor: pointer;
  }
  .st-gauge-tap:focus-visible {
    outline: 2px solid var(--st-aurora);
    outline-offset: 8px;
  }
  .st-gauge {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); /* пружинный возврат */
  }
  .st-gauge.is-pressed {
    transform: scale(0.93);
    transition: transform 0.12s ease-in;   /* вдавливание — быстрое */
  }
}

.st-gauge {
  display: block;
  width: min(92vw, 420px);
  max-width: 100%;
  margin: 0 auto 2px;
  overflow: visible;   /* свечение дуги выходит за viewBox — не обрезать */
  transition: transform 0.12s ease;
}

/* В покое приглашение зазывает — только на тач-устройствах:
   градиент стрелки, округлый жирный шрифт, дышащий пульс. */
@media (hover: none) and (pointer: coarse) {
  .st-card[data-phase="idle"] .st-gauge-value,
  .st-card[data-phase="done"] .st-gauge-value,
  .st-card[data-phase="error"] .st-gauge-value,
  .st-embed[data-phase="idle"] .st-gauge-value,
  .st-embed[data-phase="done"] .st-gauge-value,
  .st-embed[data-phase="error"] .st-gauge-value {
    fill: #7fe8ff;
    letter-spacing: 0.06em;
    animation: st-invite 3s ease-in-out infinite;
  }
}

@keyframes st-invite {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Цвета SVG заданы и атрибутами в разметке; CSS-переменные их уточняют. */
.st-gauge-track { stroke: var(--st-line); }
.st-ticks-minor { stroke: #223046; }
.st-ticks-major { stroke: #41577c; }
.st-tick-label { fill: var(--st-fog); font-family: var(--st-mono); }
.st-gauge-value { fill: var(--st-snow); font-family: var(--st-mono); }
.st-gauge-label { fill: var(--st-fog); font-family: var(--st-mono); }

/* Дуга без переходов по dasharray: движение ведёт requestAnimationFrame.
   Появление/исчезание полосы — мягкое, по opacity. */
.st-gauge-fill {
  transition: opacity 0.3s ease;
}

/* Ореол вокруг шкалы: мягкое кольцо радиальным градиентом — без фильтров,
   поэтому одинаково дёшев на десктопе и на телефоне. Дышит только opacity. */
/* Дыхание прибора: три слоя пульсируют с разными некратными периодами
   (4.2 / 3.1 / 5.3 c) и разной глубиной — рисунок не зацикливается.
   Анимируется только opacity — дёшево на любом устройстве. */
.st-gauge-halo {
  animation: st-br-halo 4.2s ease-in-out infinite;
}

/* Blur и drop-shadow — только там, где точный указатель (десктоп):
   на телефоне фильтры на перерисовываемом каждый кадр SVG дают рывки
   (проверено Владимиром на iPhone 2026-08-31). Телефону остаются
   градиентный ореол, широкая полупрозрачная дуга и дыхание — они дёшевы. */


@keyframes st-br-halo {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.7; }
}


/* «Активация»: во время замера дыхание чаще и ярче. */
.st-card[data-phase="ping"] .st-gauge-halo,
.st-card[data-phase="download"] .st-gauge-halo,
.st-embed[data-phase="ping"] .st-gauge-halo,
.st-embed[data-phase="download"] .st-gauge-halo {
  animation-duration: 2.9s;
}


/* На нуле скруглённый кончик рисовал бы точку — прячем полосу целиком. */
.st-gauge.is-empty .st-gauge-fill {
  opacity: 0;
}


/* Оттенок по уровню: на высокой скорости — зелёная искра.
   Только десктоп: фильтр на перерисовываемой дуге дорог для телефона. */
@media (hover: hover) and (pointer: fine) {
  .st-gauge[data-level="high"] .st-gauge-fill {
    filter: drop-shadow(0 0 4px rgba(101, 216, 154, 0.7));
  }
}


/* ---------- Результаты ---------- */

.st-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 18px;
}

.st-result {
  border: 1px solid rgba(127, 232, 255, 0.2);
  border-radius: 16px;
  padding: 12px 14px 11px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 14px rgba(87, 166, 255, 0.12);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.st-result:hover {
  border-color: rgba(127, 232, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 22px rgba(87, 166, 255, 0.22);
}

.st-result dt {
  margin: 0 0 3px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--st-fog);
}

.st-result dd {
  margin: 0;
  font-family: var(--st-mono);
  font-size: 1.3rem;
  font-size: clamp(1.15rem, 0.95rem + 0.7vw, 1.85rem);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--st-snow);
}

.st-dots {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  min-height: 5px;
}

.st-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--st-line);
  transition: background 0.2s ease;
}

.st-dot.is-on {
  background: var(--st-aurora);
  box-shadow: 0 0 6px rgba(127, 232, 255, 0.8);
  animation: st-dot-pop 0.35s ease-out;
}

@keyframes st-dot-pop {
  0% { transform: scale(0.6); opacity: 0.4; }
  60% { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- IP и страна: без коробки — светящийся флажок и угасающая линия ---------- */

.st-whoami {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 14px;
  padding: 6px 4px 12px;
  color: var(--st-fog);
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Тонкая линия под строкой: яркая у флажка, тает вправо. */
.st-whoami::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(127, 232, 255, 0.75), rgba(87, 166, 255, 0.35) 40%, rgba(87, 166, 255, 0) 100%);
  box-shadow: 0 0 8px rgba(127, 232, 255, 0.25);
  pointer-events: none;
}

.st-whoami.is-ready {
  opacity: 1;
  transform: none;
}

/* Нет данных (/speed/whoami недоступен) — строка не занимает места. */
.st-whoami[hidden] {
  display: none;
}

.st-whoami-badge {
  display: inline-flex;
  flex: none;
  line-height: 1;
}

.st-whoami-badge:has(.st-whoami-flag:empty) {
  display: none;
}

.st-whoami-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.st-whoami-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  min-width: 0;
}

.st-whoami-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.st-whoami-ip {
  font-family: var(--st-mono);
  font-variant-numeric: tabular-nums;
  color: var(--st-snow);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(127, 232, 255, 0.3);
}

.st-whoami-sep {
  opacity: 0.5;
}

.st-whoami-geo {
  color: #c5d1e1;
}

/* ---------- Статус, примечание, кнопка ---------- */

.st-status {
  min-height: 1.3em;
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-size: calc(0.78rem + 0.15vw);
  color: var(--st-fog);
  text-align: center;
}

.st-card[data-phase="ping"] .st-status::after,
.st-card[data-phase="download"] .st-status::after,
.st-embed[data-phase="ping"] .st-status::after,
.st-embed[data-phase="download"] .st-status::after {
  content: "▍";
  margin-left: 2px;
  color: var(--st-aurora);
  animation: st-blink 1s steps(2, start) infinite;
}

@keyframes st-blink {
  to { visibility: hidden; }
}

.st-note {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-size: calc(0.7rem + 0.12vw);
  color: var(--st-fog);
  text-align: center;
}

.st-button {
  display: block;
  align-self: stretch;
  min-height: 52px;
  border: 1px solid rgba(127, 232, 255, 0.55);
  border-radius: 14px;
  padding: 14px 24px;
  font: inherit;
  font-size: 1rem;
  font-size: calc(0.95rem + 0.15vw);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--st-aurora);
  background: rgba(127, 232, 255, 0.05);
  cursor: pointer;
  box-shadow:
    0 0 16px rgba(127, 232, 255, 0.22),
    inset 0 0 12px rgba(127, 232, 255, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease,
              box-shadow 0.15s ease, transform 0.05s ease;
  touch-action: manipulation;
}

.st-button:hover {
  background: rgba(127, 232, 255, 0.1);
  border-color: var(--st-aurora);
  box-shadow:
    0 0 28px rgba(127, 232, 255, 0.42),
    0 0 60px rgba(87, 166, 255, 0.18),
    inset 0 0 14px rgba(127, 232, 255, 0.1);
}

.st-button:active {
  transform: translateY(1px);
}

.st-button:focus-visible {
  outline: 2px solid var(--st-snow);
  outline-offset: 3px;
}

.st-button:disabled {
  color: var(--st-fog);
  border-color: var(--st-line);
  background: transparent;
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* ---------- Полезное описание под прибором ---------- */

.st-guide {
  border-top: 1px solid rgba(143, 160, 184, 0.16);
  background: rgba(8, 14, 25, 0.5);
}

.st-guide-inner {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(44px, 7vw, 84px) clamp(18px, 4vw, 48px);
}

.st-guide h2,
.st-guide h3 {
  color: var(--st-snow, #f4f8ff);
}

.st-guide h2 {
  max-width: 22ch;
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 1.25rem + 1.4vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.st-guide-lead {
  max-width: 70ch;
  margin: 0;
  color: #aab8ca;
  font-size: clamp(0.98rem, 0.9rem + 0.25vw, 1.12rem);
  line-height: 1.7;
}

.st-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.st-guide-card,
.st-faq-item {
  border: 1px solid #1e2a3e;
  border-radius: 16px;
  background: rgba(17, 25, 39, 0.72);
}

.st-guide-card {
  padding: 22px 20px;
}

.st-guide-card h3,
.st-faq-item h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.st-guide-card p,
.st-faq-item p {
  margin: 0;
  color: #8fa0b8;
  line-height: 1.65;
}

.st-topic-links a {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.st-topic-links a:hover {
  border-color: rgba(127, 232, 255, 0.42);
  transform: translateY(-2px);
}

.st-reading {
  margin-top: clamp(44px, 6vw, 72px);
}

.st-reading-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.st-reading-item {
  padding: 17px 16px;
  border: 1px solid #1e2a3e;
  border-radius: 14px;
  background: rgba(14, 22, 36, 0.72);
}

.st-reading-item strong {
  display: block;
  margin-bottom: 5px;
  color: #7fe8ff;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

.st-reading-item span {
  color: #8fa0b8;
  font-size: 0.9rem;
  line-height: 1.45;
}

.st-faq {
  margin-top: clamp(44px, 6vw, 72px);
}

.st-faq-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.st-faq-item {
  padding: 20px;
}

.st-site-footer {
  border-top: 1px solid rgba(143, 160, 184, 0.16);
  background: #0b111d;
}

.st-site-footer-inner {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #718198;
  font-size: 0.86rem;
}

.st-site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.st-site-footer a {
  color: #8fa0b8;
  text-decoration: none;
}

.st-site-footer a:hover {
  color: #dff9ff;
}

/* ---------- Узкие экраны ---------- */

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

@media (max-width: 719px) {
  .st-card {
    min-height: 100vh;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    padding: clamp(18px, 5vw, 28px) clamp(14px, 4vw, 22px);
    box-shadow: none;
  }

  .st-card h2 {
    margin-bottom: 0;
  }

  .st-card h1 {
    margin-bottom: 0;
  }

  .st-body {
    justify-content: flex-start;
  }

  .st-gauge {
    width: min(88vw, 400px);
    margin-top: clamp(16px, 3vh, 30px);
  }

  .st-panel {
    margin-top: clamp(26px, 4vh, 42px);
  }
}

@media (max-width: 520px) {
  .st-main {
    min-height: calc(100vh - 48px);
    min-height: calc(100svh - 48px);
  }
  .st-topbar-inner {
    min-height: 48px;
    padding-block: 7px;
    padding-inline: 10px;
    gap: 6px;
  }

  .st-brand {
    display: inline-flex;
    flex: none;
    gap: 5px;
    font-size: 0.75rem;
  }

  .st-brand img {
    width: 18px;
    height: 18px;
  }

  .st-top-actions {
    width: auto;
    min-width: 0;
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    gap: 5px;
  }

  .st-top-actions a {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .st-page .st-card {
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .st-intro {
    margin-top: 5px;
  }

  .st-gauge {
    margin-top: 0;
  }

  .st-panel {
    margin-top: 10px;
  }

  .st-guide-grid,
  .st-reading-grid {
    grid-template-columns: 1fr;
  }

  .st-site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 521px) and (max-width: 880px) {
  .st-guide-grid {
    grid-template-columns: 1fr;
  }

  .st-reading-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Широкие экраны: шкала слева, панель справа ---------- */

@media (min-width: 720px) {
  .st-card {
    padding: 34px 36px;
    padding: calc(22px + 1.2vw) calc(20px + 1.6vw);
  }

  .st-card h2 {
    margin-bottom: 26px;
    margin-bottom: calc(18px + 0.8vw);
  }

  .st-body {
    display: grid;
    grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 0.85fr);
    align-items: center;
    justify-items: center;
    gap: clamp(32px, 5vw, 96px);
  }

  .st-gauge {
    width: min(100%, 620px);
    min-width: 0;
    max-width: 620px;
    margin: 0 auto;   /* внутри кнопки-обёртки центрируемся сами (раньше центрировала сетка) */
    transform: translateY(clamp(-80px, -6vh, -42px));
  }

  .st-panel {
    min-width: 0;
    width: 100%;
    max-width: 720px;
    align-self: center;
    justify-content: center;
  }

  .st-results {
    margin-top: 0;
    margin-bottom: 22px;
    gap: 16px;
    gap: calc(12px + 0.5vw);
  }

  .st-result {
    padding: 16px 19px;
    padding: calc(12px + 0.4vw) calc(14px + 0.5vw);
  }

  .st-status,
  .st-note {
    text-align: left;
  }

  .st-button {
    margin-top: 2px;
  }
}

@media (min-width: 1400px) {
  .st-card {
    padding-inline: clamp(48px, 6vw, 120px);
  }

  .st-body {
    grid-template-columns: minmax(420px, 1.2fr) minmax(420px, 0.8fr);
  }

  .st-button {
    min-height: 60px;
  }
}

/* Низкие горизонтальные экраны: не заставляем страницу обрезать содержимое. */
@media (min-width: 720px) and (max-height: 640px) {
  .st-card {
    min-height: calc(100vh - 16px);
    min-height: calc(100svh - 16px);
    padding-block: 18px;
  }

  .st-card h2 {
    margin-bottom: 8px;
  }

  .st-gauge {
    max-width: 360px;
    transform: none;
  }
}

/* ---------- Доступность ---------- */

@media (prefers-reduced-motion: reduce) {
  .st-dot,
  .st-whoami,
  .st-button {
    transition: none;
    animation: none;
  }
  .st-status::after,
  .st-card[data-phase="download"] .st-gauge-halo {
    animation: none;
  }
}


/* ------------------------- Встроенный прибор в статьях ------------------------- */

.st-embed {
  --st-night: #0b111d;
  --st-panel: #111927;
  --st-line: #1e2a3e;
  --st-signal: #57a6ff;
  --st-aurora: #7fe8ff;
  --st-fog: #8fa0b8;
  --st-snow: #f4f8ff;
  --st-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 8px 34px;
  align-items: center;
  margin: 28px 0 6px;
  padding: 22px 24px;
  border: 1px solid var(--st-line);
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 50% -30%, rgba(87, 166, 255, 0.10), transparent 60%),
    rgba(17, 25, 39, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.st-embed .st-gauge {
  width: 100%;
  margin: 0;
}

.st-embed .st-results {
  margin: 0 0 10px;
  gap: 10px;
}

.st-embed .st-result {
  padding: 10px 12px 9px;
}

.st-embed .st-result dd {
  font-size: 1.1rem;
}

.st-embed .st-status {
  text-align: left;
  margin-bottom: 8px;
}

.st-embed .st-note {
  text-align: left;
  margin-bottom: 10px;
}

@media (max-width: 719px) {
  .st-embed {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px 16px;
  }
  .st-embed .st-gauge {
    width: min(76vw, 300px);
    margin: 0 auto;
  }
}
