/* ==========================================================================
   Calc-Info — базовые стили
   ========================================================================== */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --surface-3: #f8fafc;
  --text: #0f172a;
  --text-soft: #243044;
  --muted: #5b6b84;
  --muted-2: #5f7188;
  --line: #e1e8f2;
  --line-strong: #cbd5e1;
  --brand: #2f5bea;
  --brand-dark: #1e40af;
  --brand-soft: #eef3ff;
  --violet: #7c3aed;
  --green: #0f9d76;
  --amber: #f59e0b;
  --rose: #e11d48;
  --cyan: #0891b2;
  --red: #dc2626;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 34px -18px rgba(15, 23, 42, 0.22);
  --shadow-lg: 0 30px 70px -30px rgba(15, 23, 42, 0.35);
  --container: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.search-open {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(47, 91, 234, 0.18);
}

:focus-visible {
  outline: 3px solid rgba(47, 91, 234, 0.4);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(225, 232, 242, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 8px 26px -20px rgba(15, 23, 42, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--text);
}

.logo-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 11px;
  box-shadow: 0 8px 18px -10px rgba(47, 91, 234, 0.7);
}

.logo-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.logo-text strong {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.logo-text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 7px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.site-nav a.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* ---------- Мега-меню: калькуляторы, генераторы, игры ---------- */
.nav-group {
  position: static;
}

.nav-group__head {
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  transition: background 0.15s ease;
}

.nav-group__head:hover,
.nav-group.is-open .nav-group__head {
  background: var(--surface-2);
}

.nav-group.is-active .nav-group__head {
  background: var(--brand-soft);
}

.site-nav .nav-group__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 2px 8px 9px;
  border-radius: 9px 0 0 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav .nav-group__link:hover {
  background: transparent;
  color: var(--text);
}

.nav-group.is-active .nav-group__link {
  color: var(--brand-dark);
}

.nav-group__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px 8px 2px;
  border: 0;
  border-radius: 0 9px 9px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-group__toggle:hover,
.nav-group.is-open .nav-group__toggle {
  background: transparent;
  color: var(--text);
}

.nav-group.is-active .nav-group__toggle {
  color: var(--brand-dark);
}

.nav-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.18s ease;
}

.nav-group.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-group__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 70;
  display: none;
  width: min(1100px, calc(100vw - 32px));
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}

.nav-group__panel::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-group:hover .nav-group__panel,
.nav-group.is-open .nav-group__panel {
  display: block;
}

/* После перехода по ссылке раздела не открываем подменю от «залипшего» hover. */
.nav-group.is-hover-suppressed .nav-group__panel {
  display: none;
}

/* Пока app.js не обработал переход, скрываем возможный «залипший» hover. */
.nav-suppress-pending .nav-group__panel {
  display: none !important;
}

.nav-mega {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 20px 26px;
}

.nav-col__title {
  margin: 0 0 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  white-space: normal;
}

.nav-list a:hover {
  background: var(--surface-2);
  color: var(--brand-dark);
}

.nav-list a.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.nav-list__more a {
  color: var(--brand);
  font-weight: 600;
}

.nav-col--cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-3);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.nav-cta .icon {
  width: 15px;
  height: 15px;
}

.nav-cta--soft {
  color: var(--muted);
  font-weight: 600;
}

.nav-cta__note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.search-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.search-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-3);
}

.search-button .icon {
  width: 17px;
  height: 17px;
}

kbd {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 10px;
  line-height: 1.4;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-button:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.nav-toggle {
  display: none;
}

@media (max-width: 1219px) {
  .site-nav {
    position: absolute;
    top: calc(100% + 6px);
    left: 14px;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 14px;
    font-size: 15px;
  }

  .nav-group {
    width: 100%;
  }

  .nav-group__head {
    width: 100%;
    justify-content: space-between;
  }

  .site-nav .nav-group__link {
    flex: 1;
    padding: 12px 14px;
    font-size: 15px;
  }

  .nav-group__toggle {
    padding: 12px 14px;
  }

  .nav-group__panel {
    position: static;
    display: none;
    width: auto;
    padding: 4px 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .nav-group__panel::before {
    display: none;
  }

  .nav-group:hover .nav-group__panel {
    display: none;
  }

  .nav-group.is-open .nav-group__panel {
    display: block;
  }

  .nav-mega {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav-col__title {
    margin: 6px 0 4px;
    padding-left: 12px;
  }

  .nav-list a {
    padding: 9px 12px;
    font-size: 14px;
  }

  .nav-col--cta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .search-button span,
  .search-button kbd {
    display: none;
  }

  .search-button {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 66px;
  background:
    radial-gradient(900px 460px at 82% -10%, rgba(124, 58, 237, 0.1), transparent 60%),
    radial-gradient(780px 420px at 8% 10%, rgba(47, 91, 234, 0.12), transparent 62%),
    linear-gradient(180deg, #f2f6ff 0%, var(--bg) 100%);
  border-bottom: 1px solid rgba(225, 232, 242, 0.7);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(15, 23, 42, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 70%);
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 54px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(47, 91, 234, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.eyebrow .icon {
  width: 14px;
  height: 14px;
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0 16px;
  font-size: clamp(36px, 4.8vw, 58px);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero__lead {
  max-width: 640px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.62;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 620px;
  padding: 13px 14px 13px 16px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 15px;
  background: #fff;
  color: var(--muted);
  text-align: left;
  box-shadow: 0 10px 30px -20px rgba(15, 23, 42, 0.45);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hero-search:hover {
  border-color: rgba(47, 91, 234, 0.45);
  box-shadow: 0 16px 34px -22px rgba(47, 91, 234, 0.55);
  transform: translateY(-1px);
}

.hero-search .icon {
  width: 20px;
  height: 20px;
  color: var(--brand);
}

.hero-search span {
  flex: 1;
  font-size: 15px;
}

.hero-search kbd {
  flex: 0 0 auto;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  max-width: 620px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  border-color: rgba(47, 91, 234, 0.4);
  background: #fff;
  color: var(--brand-dark);
}

.chip.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin: 34px 0 0;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stats dt {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-stats dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 10px 8px;
}

.hero-preview {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 40px 80px -34px rgba(30, 64, 175, 0.45);
  transform: rotate(-1.5deg);
  backdrop-filter: blur(8px);
}

.hero-preview__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.hero-preview__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.hero-preview__label .icon {
  width: 17px;
  height: 17px;
  color: var(--brand);
}

.pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
}

.hero-preview__value {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-preview__value span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.hero-preview__bar {
  display: flex;
  gap: 2px;
  height: 10px;
  margin: 22px 0 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}

.hero-preview__bar span:first-child {
  background: linear-gradient(90deg, #2f5bea, #4f7cff);
}

.hero-preview__bar span:last-child {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.hero-preview__legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 10.5px;
}

.hero-preview__rows {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.hero-preview__rows div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.hero-preview__rows strong {
  color: var(--text);
  font-size: 12.5px;
}

.hero-preview__foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
}

.hero-float {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}

.hero-float .icon {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.hero-float--one {
  top: 10%;
  left: -6%;
}

.hero-float--two {
  right: -4%;
  bottom: 8%;
  animation-delay: -3s;
}

.hero-float--two .icon {
  color: var(--brand);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@media (max-width: 1023px) {
  .hero {
    padding: 54px 0 48px;
  }

  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 34px;
  }

  .hero__lead {
    font-size: 16px;
  }

  .hero-stats {
    gap: 22px;
  }

  .hero-stats dt {
    font-size: 21px;
  }

  .hero-search span {
    font-size: 13.5px;
  }

  .hero-search kbd {
    display: none;
  }
}

/* ==========================================================================
   Sections and cards
   ========================================================================== */

.section {
  padding: 62px 0;
}

.section--tinted {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(238, 243, 251, 0.7)),
    var(--bg);
  border-top: 1px solid rgba(225, 232, 242, 0.8);
  border-bottom: 1px solid rgba(225, 232, 242, 0.8);
}

.section--last {
  padding-bottom: 72px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: clamp(25px, 2.6vw, 32px);
  letter-spacing: -0.03em;
}

.section-head--spaced {
  margin-top: 54px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.text-link .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.15s ease;
}

.text-link:hover .icon {
  transform: translateX(2px);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.calc-tile {
  display: flex;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.calc-tile:hover {
  border-color: rgba(47, 91, 234, 0.35);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.calc-tile__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.calc-tile__title {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.calc-tile__desc {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.calc-tile__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
}

.calc-tile__more .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.calc-tile:hover .calc-tile__more .icon {
  transform: translateX(3px);
}

.calc-tile--compact {
  padding: 18px;
}

.calc-tile--compact .calc-tile__desc {
  -webkit-line-clamp: 2;
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
}

.icon-tile .icon {
  width: 23px;
  height: 23px;
}

.icon-tile--lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.icon-tile--lg .icon {
  width: 31px;
  height: 31px;
}

.icon-tile--blue {
  background: #e9efff;
  color: #2f5bea;
}

.icon-tile--violet {
  background: #f1ebff;
  color: #7c3aed;
}

.icon-tile--green {
  background: #e5f8f1;
  color: #0f9d76;
}

.icon-tile--amber {
  background: #fff5dd;
  color: #b45309;
}

.icon-tile--rose {
  background: #ffe9ef;
  color: #db2777;
}

.icon-tile--cyan {
  background: #e0f7fb;
  color: #0e7490;
}

.icon-tile--orange {
  background: #ffedd5;
  color: #c2410c;
}

.icon-tile--teal {
  background: #e0f7f4;
  color: #0f766e;
}

.icon-tile--indigo {
  background: #e8e9ff;
  color: #4338ca;
}

.icon-tile--lime {
  background: #eef7d8;
  color: #4d7c0f;
}

.icon-tile--sky {
  background: #e0f2fe;
  color: #0369a1;
}

@media (max-width: 1100px) {
  .calc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .calc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding: 48px 0;
  }
}

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

  .section-head {
    align-items: flex-start;
  }
}

/* Category cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.category-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-card:hover {
  border-color: rgba(47, 91, 234, 0.35);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.category-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-card__title {
  font-size: 17px;
  font-weight: 700;
}

.category-card__desc {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.category-card__count {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.category-card__arrow {
  margin-left: auto;
  color: var(--muted-2);
}

.category-card__arrow .icon {
  width: 17px;
  height: 17px;
}

.category-grid--small {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .category-grid,
  .category-grid--small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .category-grid,
  .category-grid--small {
    grid-template-columns: 1fr;
  }
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.feature h3 {
  margin-bottom: 7px;
  font-size: 16px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* ==========================================================================
   Breadcrumbs and page heads
   ========================================================================== */

.breadcrumbs {
  padding-top: 22px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted-2);
  font-size: 12.5px;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li + li::before {
  content: "/";
  color: #c2cbd9;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.breadcrumbs li[aria-current] {
  color: var(--text-soft);
}

.page-section {
  padding: 26px 0 72px;
}

.page-head {
  margin: 14px 0 30px;
}

.page-head h1 {
  max-width: 880px;
  margin: 10px 0 12px;
  font-size: clamp(31px, 3.9vw, 46px);
  letter-spacing: -0.035em;
}

.page-head .lead {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.62;
}

.page-head--category {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.page-head--category h1 {
  margin-top: 8px;
}

.page-head--category .eyebrow {
  margin-bottom: 2px;
}

.page-narrow {
  max-width: 900px;
}

.page-head--center {
  text-align: center;
}

/* ==========================================================================
   Calculator page
   ========================================================================== */

.calc-page__head {
  margin: 14px 0 30px;
}

.calc-page__head h1 {
  max-width: 900px;
  margin: 10px 0 12px;
  font-size: clamp(31px, 3.9vw, 46px);
  letter-spacing: -0.035em;
}

.calc-page__head .lead {
  max-width: 800px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.category-badge .icon {
  width: 15px;
  height: 15px;
}

.category-badge:hover {
  background: #e3eaff;
  color: var(--brand-dark);
}

.calc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted-2);
  font-size: 12px;
}

.calc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calc-meta .icon {
  width: 15px;
  height: 15px;
}

.page-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.page-toc a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.page-toc a:hover {
  border-color: rgba(47, 91, 234, 0.4);
  color: var(--brand);
}

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 30px;
}

.calc-main {
  min-width: 0;
}

.calc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Пока движок не отрисовал форму, резервируем высоту: контент ниже не должен
   прыгать при появлении калькулятора (CLS). Высота для каждого калькулятора
   задаётся переменными --skeleton-h-* (см. tools/data/skeleton.mjs). */
.calc-card:not(.is-ready) {
  display: grid;
  place-items: center;
  min-height: var(--skeleton-h-xs, 760px);
}

.calc-card:not(.is-ready)::after {
  content: "Загружаем калькулятор…";
  color: var(--muted-2);
  font-size: 0.875rem;
}

@media (min-width: 621px) {
  .calc-card:not(.is-ready) {
    min-height: var(--skeleton-h-sm, 760px);
  }
}

@media (min-width: 861px) {
  .calc-card:not(.is-ready) {
    min-height: var(--skeleton-h-md, 640px);
  }
}

@media (min-width: 1024px) {
  .calc-card:not(.is-ready) {
    min-height: var(--skeleton-h-lg, 640px);
  }
}

.calc-tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  overflow-x: auto;
  background: #f7f9fd;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.calc-tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.calc-tab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.calc-tab.is-active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px -12px rgba(15, 23, 42, 0.3);
}

.calc-body {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  min-height: 400px;
}

.calc-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.field {
  min-width: 0;
}

.field--wide {
  grid-column: span 2;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.field-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.field-hint {
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: right;
}

.control {
  position: relative;
  display: flex;
  align-items: center;
}

.control input {
  width: 100%;
  min-height: 46px;
  padding: 11px 42px 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.control input:hover {
  border-color: var(--line-strong);
}

.control input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.1);
  outline: none;
}

.control input[type="date"] {
  padding-right: 12px;
  font-size: 14px;
  font-weight: 500;
}

.control__unit {
  position: absolute;
  right: 12px;
  color: var(--muted-2);
  font-size: 12.5px;
  pointer-events: none;
}

.select {
  width: 100%;
  min-height: 46px;
  padding: 10px 40px 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background-color: #fbfcfe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6b84' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select:focus {
  border-color: var(--brand);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.1);
  outline: none;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.checkbox__text {
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.4;
}

.calc-results {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(180deg, #f8faff 0%, #fff 62%);
}

.result-hero {
  padding: 18px 20px;
  border: 1px solid #dbe6ff;
  border-radius: 17px;
  background:
    radial-gradient(240px 130px at 100% 0%, rgba(124, 58, 237, 0.13), transparent 70%),
    linear-gradient(135deg, #eef4ff, #f1edff);
}

.result-hero__label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.result-hero__value {
  display: block;
  color: var(--text);
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.result-hero__unit {
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.48em;
  font-weight: 600;
  letter-spacing: 0;
}

.result-rows {
  display: grid;
  gap: 0;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.result-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.result-row__label {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.result-row__value {
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.result-row--accent .result-row__value {
  color: var(--brand);
}

.result-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.calc-error {
  padding: 16px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
}

.calc-error strong {
  display: block;
  margin-bottom: 4px;
}

.calc-error p {
  margin: 0;
}

.calc-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.calc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff;
  box-shadow: 0 8px 20px -12px rgba(47, 91, 234, 0.8);
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(1.04);
}

.btn-secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text-soft);
}

.btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.calc-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 12px 2px 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.calc-disclaimer .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.calc-figure {
  margin: 26px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.calc-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.calc-noscript {
  padding: 20px;
  margin: 0;
  color: var(--red);
  font-size: 14px;
}

/* Charts */
.chart-wrap {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.calc-voxel-host {
  padding: 0 24px 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

.calc-voxel-host .chart-wrap {
  border-top: 0;
  padding-top: 0;
}

@media (max-width: 620px) {
  .calc-voxel-host {
    padding: 0 18px 18px;
  }
}

.chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.donut {
  position: relative;
  width: 168px;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 1;
}

.donut svg {
  width: 100%;
  height: 100%;
  display: block;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  pointer-events: none;
}

.donut-center span {
  max-width: 100px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.2;
}

.donut-center strong {
  max-width: 110px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.chart-legend {
  display: grid;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 3px;
}

.legend-label {
  flex: 1;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-value {
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
}

.legend-value small {
  margin-left: 3px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 500;
}

.legend-item--compact .legend-value {
  font-size: 11px;
}

.stack-bar {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}

.stack-seg {
  display: block;
  height: 100%;
  min-width: 2px;
}

.chart--gauge svg {
  width: 100%;
  height: auto;
  display: block;
}

.gauge-value {
  fill: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
}

.gauge-bound {
  fill: var(--muted-2);
  font-family: var(--font);
  font-size: 10px;
}

.chart--line svg,
.chart--matrix svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart--clock {
  align-items: center;
}

.chart--clock svg {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
}

.clock-face {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 2;
}

.clock-tick {
  stroke: #94a3b8;
  stroke-width: 1;
}

.clock-tick--major {
  stroke: #475569;
  stroke-width: 2.4;
}

.clock-numeral {
  fill: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
}

.chart-axis {
  fill: var(--muted-2);
  font-family: var(--font);
  font-size: 9px;
}

.chart-grid-line,
.chart-axis-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: var(--muted-2);
  opacity: 0.5;
}

.chart-marker {
  stroke: #ef4444;
  stroke-width: 1.3;
  stroke-dasharray: 4 4;
}

.chart-marker-label {
  fill: #ef4444;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
}

.chart-quadrant-label {
  fill: var(--muted-2);
  font-family: var(--font);
  font-size: 8px;
  font-weight: 600;
}

.chart-bubble-label {
  fill: var(--text);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
}

/* Sidebar */
.calc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.sidebar-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sidebar-card h2 {
  margin-bottom: 10px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sidebar-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.sidebar-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-links li {
  border-bottom: 1px solid var(--line);
}

.sidebar-links li:last-child {
  border-bottom: 0;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  color: var(--text-soft);
  font-size: 12.5px;
  text-decoration: none;
}

.sidebar-links a:hover {
  color: var(--brand);
}

.sidebar-links .icon {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.sidebar-card--accent {
  background:
    radial-gradient(240px 120px at 100% 0%, rgba(124, 58, 237, 0.12), transparent 70%),
    linear-gradient(135deg, #eef4ff, #f5f1ff);
  border-color: #dbe6ff;
}

.sidebar-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.sidebar-note {
  display: flex;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f1f5f9;
}

.sidebar-note .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.sidebar-note strong {
  color: var(--text-soft);
}

/* Related */
.related {
  margin-top: 42px;
}

.related .calc-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

  .calc-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .ad-wrap.ad-wrap--sidebar {
    position: static;
    grid-column: span 2;
  }

  .sidebar-note {
    grid-column: span 2;
  }
}

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

  .calc-form {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calc-results {
    min-height: 320px;
  }
}

@media (max-width: 620px) {
  .calc-form {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 16px;
  }

  .field--wide {
    grid-column: span 1;
  }

  .calc-results {
    padding: 18px;
  }

  .calc-actions {
    padding: 12px 18px;
  }

  .calc-actions .btn {
    flex: 1;
    padding-left: 10px;
    padding-right: 10px;
  }

  .calc-sidebar {
    grid-template-columns: 1fr;
  }

  .ad-wrap--sidebar,
  .sidebar-note {
    grid-column: span 1;
  }

  .related .calc-grid {
    grid-template-columns: 1fr;
  }

  .page-head--category {
    flex-direction: column;
    gap: 14px;
  }
}

/* ==========================================================================
   Prose / article
   ========================================================================== */

.prose {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.72;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 36px 0 14px;
  font-size: clamp(23px, 2.4vw, 28px);
  letter-spacing: -0.025em;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 19px;
}

.prose p {
  margin: 0 0 15px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin: 6px 0;
}

.prose li::marker {
  color: var(--brand);
}

.prose a {
  color: var(--brand);
}

.prose strong {
  color: var(--text);
  font-weight: 650;
}

.prose .lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.prose--intro {
  max-width: 900px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 15.5px;
}

.prose--calc {
  margin-top: 38px;
}

.prose--after {
  margin-top: 46px;
}

.prose--after h2:first-child {
  margin-top: 0;
}

.formula {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 18px 0 22px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #0f172a;
  color: #dbeafe;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  overflow-x: auto;
}

.formula span {
  display: block;
  white-space: nowrap;
}

.formula small {
  color: #94a3b8;
  font-family: var(--font);
  font-size: 11.5px;
  white-space: normal;
}

.data-table {
  width: 100%;
  margin: 18px 0 24px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.data-table caption {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.data-table tbody th {
  color: var(--muted);
  font-weight: 500;
}

.data-table tbody td {
  color: var(--text-soft);
  font-weight: 600;
}

.faq {
  margin: 8px 0 20px;
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  position: relative;
  padding: 15px 34px 15px 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:hover {
  color: var(--brand);
}

.faq-answer {
  padding: 0 30px 16px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.faq-answer p {
  margin: 0;
}

/* Home about layout */
.home-about {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr);
  gap: 46px;
  align-items: start;
}

.home-about .prose h2:first-child {
  margin-top: 0;
}

.home-faq {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.home-faq h2 {
  margin-bottom: 12px;
  font-size: 21px;
}

.home-faq .faq {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .home-about {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ==========================================================================
   Catalog / filters
   ========================================================================== */

.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.catalog-search .icon {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
}

.catalog-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  outline: none;
}

.catalog-search input::placeholder {
  color: var(--muted-2);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.catalog-count {
  margin: 14px 2px 16px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.catalog-empty {
  padding: 44px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}

.catalog-empty strong {
  display: block;
  margin-bottom: 4px;
}

.catalog-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* ==========================================================================
   Ads
   ========================================================================== */

.ad-wrap {
  position: relative;
  margin: 30px 0;
  padding: 10px 12px 12px;
  border: 1px dashed #d3dce9;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

/* Сайдбар: слот занимает всю ширину колонки, без внутренних отступов,
   чтобы адаптивный блок получал положенные 300 px. */
.ad-wrap--sidebar {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.ad-wrap--sidebar .ad-slot {
  width: 100%;
  min-height: 600px;
  border-radius: 12px;
  background: #f8fafc;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  overflow: hidden;
}

.ad-slot[data-ad-format="horizontal"] {
  min-height: 120px;
}

.ad-slot[data-ad-format="sidebar"] {
  min-height: 600px;
}

.ad-slot[data-ad-format="feed"] {
  min-height: 340px;
}

.ad-wrap--feed {
  margin: 40px 0 0;
}

/* Лента занимает всю ширину страницы, а не колонку контента. */
.ad-section {
  width: 100%;
  padding: 0 20px;
}

/* Баннер слева на ПК: вне контейнера, закреплён у края экрана. */
.ad-wrap--left {
  position: fixed;
  top: 50%;
  left: max(16px, calc((100vw - var(--container)) / 2 - 328px));
  z-index: 40;
  width: 300px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  transform: translateY(-50%);
}

.ad-wrap--left .ad-slot {
  width: 300px;
  min-height: 600px;
  border-radius: 12px;
  background: #f8fafc;
}

.ad-wrap--left .ad-placeholder {
  min-height: 600px;
  padding: 10px;
}

@media (max-width: 1867px) {
  .ad-wrap--left {
    display: none !important;
  }
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: inherit;
  padding: 18px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(-45deg, rgba(148, 163, 184, 0.07) 0 8px, transparent 8px 16px),
    #f8fafc;
  color: var(--muted-2);
  text-align: center;
  font-size: 11.5px;
}

.ad-placeholder strong {
  color: var(--muted);
  font-size: 12.5px;
}

.ad-placeholder span {
  font-family: var(--mono);
  font-size: 10px;
}

@media (max-width: 1023px) {
  .ad-slot[data-ad-format="sidebar"] {
    min-height: 280px;
  }
}

@media (max-width: 620px) {
  .ad-slot[data-ad-format="feed"] {
    min-height: 280px;
  }
}

/* ==========================================================================
   Search dialog
   ========================================================================== */

.search-dialog {
  width: min(640px, calc(100% - 28px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--text);
}

.search-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.search-dialog__panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.search-dialog__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.search-dialog__icon {
  width: 21px;
  height: 21px;
  color: var(--brand);
}

.search-dialog__head input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  outline: none;
}

.search-dialog__head input::placeholder {
  color: var(--muted-2);
}

.search-results {
  max-height: 420px;
  overflow: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.search-result:hover {
  background: var(--surface-2);
  color: var(--text);
}

.search-result__title {
  font-size: 14px;
  font-weight: 600;
}

.search-result__meta {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 11px;
}

.search-hint {
  margin: 6px 8px 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-empty {
  margin: 0;
  padding: 22px 14px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.search-dialog__hint {
  margin: 0;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 20px;
  padding: 54px 0 22px;
  background: #0f172a;
  color: #cbd5e1;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: 34px;
}

.logo--footer {
  color: #fff;
}

.logo--footer:hover {
  color: #fff;
}

.logo--footer .logo-text small {
  color: #94a3b8;
}

.footer-brand p {
  max-width: 330px;
  margin: 16px 0;
  color: #94a3b8;
  font-size: 12.5px;
  line-height: 1.6;
}

.footer-mail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #dbeafe;
  font-size: 12.5px;
  text-decoration: none;
}

.footer-mail .icon {
  width: 15px;
  height: 15px;
}

.footer-title {
  margin-bottom: 13px;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin: 8px 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-size: 12.5px;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
}

.footer-links span {
  color: #94a3b8;
  font-size: 10px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.footer-bottom p {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: span 2;
  }
}

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

  .footer-brand {
    grid-column: span 1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   Info pages / sitemap / 404
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 30px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.contact-card p {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.contact-card .btn {
  align-self: flex-start;
  margin-top: 4px;
}

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

.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 40px;
}

.sitemap-group h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.sitemap-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sitemap-group li {
  margin: 7px 0;
}

.sitemap-group a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.sitemap-group a:hover {
  color: var(--brand);
}

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

.not-found {
  padding: 70px 0 90px;
}

.not-found__inner {
  max-width: 820px;
  text-align: center;
}

.error-code {
  display: block;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(76px, 13vw, 130px);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 1;
}

.not-found h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 42px);
}

.not-found p {
  max-width: 540px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 15.5px;
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 42px;
}

.not-found .calc-grid {
  text-align: left;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.muted {
  color: var(--muted);
}

.text-center {
  text-align: center;
}

@media (max-width: 700px) {
  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 9px;
  }

  .formula {
    font-size: 12px;
    padding: 15px;
  }

  .prose {
    font-size: 15.5px;
  }

  .prose h2 {
    margin-top: 30px;
  }
}

/* ==========================================================================
   Интерактивные инструменты
   ========================================================================== */

.tool-card:not(.is-ready)::after {
  content: "Загружаем инструмент…";
}

.tool-ui {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 24px;
  min-height: 320px;
}

.tool-ui > * {
  min-width: 0;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tool-head h2 {
  margin: 0 0 5px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.tool-head p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.tool-grid {
  display: grid;
  gap: 12px;
}

.tool-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool-grid--start {
  align-items: start;
}

.tool-stat {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faff;
}

.tool-stat__label {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.3;
}

.tool-stat__value {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tool-stat__value small {
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 600;
  letter-spacing: 0;
}

.tool-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
}

.tool-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.tool-rows {
  display: grid;
  gap: 0;
}

.tool-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.tool-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tool-row span {
  color: var(--muted);
}

.tool-row b {
  color: var(--text-soft);
  text-align: right;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.tool-actions--end {
  justify-content: flex-end;
}

.tool-actions .btn {
  flex: 0 0 auto;
}

.tool-inline-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tool-inline-select .select {
  width: auto;
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 13px;
}

.tool-input,
.tool-textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.tool-textarea {
  min-height: 110px;
  line-height: 1.55;
  resize: vertical;
}

.tool-textarea--result {
  background: #f3f7ff;
  color: var(--text-soft);
}

.tool-input:hover,
.tool-textarea:hover {
  border-color: var(--line-strong);
}

.tool-input:focus,
.tool-textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.1);
  outline: none;
}

.tool-control {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.tool-control output {
  float: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tool-control input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.tool-check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-size: 13.5px;
  cursor: pointer;
}

.tool-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.tool-pad {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  min-height: 250px;
  padding: 24px;
  border: 1.5px dashed #b9c9e6;
  border-radius: 18px;
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(47, 91, 234, 0.1), transparent 70%),
    #f8faff;
  color: var(--text);
  text-align: center;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tool-pad:hover,
.tool-pad:focus-visible {
  border-color: var(--brand);
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(47, 91, 234, 0.16), transparent 70%),
    #f8faff;
  outline: none;
}

.tool-pad--mouse,
.tool-pad--wheel {
  cursor: crosshair;
}

.tool-pad--wheel {
  cursor: ns-resize;
}

.tool-pad--click {
  cursor: pointer;
  font: inherit;
}

.tool-pad--click:active {
  transform: scale(0.995);
}

.tool-hz {
  color: var(--brand);
  font-size: clamp(44px, 8vw, 64px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.tool-hz small {
  font-size: 0.32em;
  font-weight: 700;
  letter-spacing: 0;
}

.tool-pad__hint {
  color: var(--muted);
  font-size: 12.5px;
}

.tool-wheel-icon {
  color: var(--brand);
  font-size: 54px;
  line-height: 1;
}

.tool-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.tool-pad.is-waiting {
  border-color: #f59e0b;
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(245, 158, 11, 0.14), transparent 70%),
    #fffbeb;
  cursor: wait;
}

.tool-pad.is-waiting .tool-hz {
  color: #b45309;
}

.tool-pad.is-ready {
  border-color: #16a34a;
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(22, 163, 74, 0.18), transparent 70%),
    #f0fdf4;
}

.tool-pad.is-ready .tool-hz {
  color: #15803d;
}

.tool-pad.is-error {
  border-color: #ef4444;
  background: #fef2f2;
}

.tool-pad.is-error .tool-hz {
  color: #b91c1c;
}

.tool-meter {
  height: 18px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tool-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444);
  transition: width 0.08s linear;
}

.tool-meter__stats {
  margin-top: 12px;
}

.tool-camera {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #0b1220;
  overflow: hidden;
}

.tool-camera video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-camera video.is-mirrored {
  transform: scaleX(-1);
}

.tool-camera__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.tool-camera__empty[hidden] {
  display: none;
}

.tool-password-panel {
  display: grid;
  gap: 10px;
}

.tool-password {
  display: block;
  padding: 14px;
  border: 1px solid #dbe6ff;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(15px, 2.4vw, 20px);
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.tool-checks {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tool-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-team {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faff;
}

.tool-team h3 {
  margin: 0 0 10px;
  font-size: 13.5px;
}

.tool-team .tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-chip.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tool-drop {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 128px;
  padding: 22px;
  border: 1.5px dashed #b9c9e6;
  border-radius: 16px;
  background: #f8faff;
  color: var(--text-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tool-drop:hover,
.tool-drop.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.tool-drop strong {
  color: var(--text);
  font-size: 14px;
}

.tool-drop span {
  color: var(--muted);
  font-size: 12.5px;
}

.tool-preview {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
  overflow: hidden;
}

.tool-preview img,
.tool-preview video {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border-radius: 10px;
  object-fit: contain;
}

.tool-preview--video {
  background: #0b1220;
}

.tool-audio {
  width: 100%;
}

.tool-seek {
  width: 100%;
  accent-color: var(--brand);
}

.tool-piano-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
  overflow: hidden;
}

.tool-piano {
  display: block;
  width: 100%;
  border-radius: 16px;
}

.tool-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rose);
  box-shadow: 0 0 8px rgba(225, 29, 72, 0.5);
  pointer-events: none;
}

.tool-midi-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-midi-tracks .tool-check {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8faff;
}

.tool-track-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.tool-beats {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.tool-beat {
  width: 14px;
  height: 14px;
  border: 1px solid #c7d8ff;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.08s ease, background 0.08s ease;
}

.tool-beat.is-accent {
  width: 18px;
  height: 18px;
  border-color: var(--brand);
}

.tool-beat.is-active {
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.15);
}

.tool-beat.is-accent.is-active {
  background: var(--rose);
  border-color: var(--rose);
}

.tool-recording {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rose);
  animation: tool-pulse 1s ease-in-out infinite;
}

@keyframes tool-pulse {
  50% {
    opacity: 0.35;
  }
}

.tool-color-row {
  display: flex;
  gap: 8px;
}

.tool-color-row input[type="color"] {
  width: 54px;
  height: 46px;
  padding: 3px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}

.tool-contrast {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.tool-contrast__large {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}

.tool-contrast__normal {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.tool-stat__value.is-pass {
  color: #15803d;
}

.tool-stat__value.is-fail {
  color: #b91c1c;
}

.tool-diff {
  max-height: 560px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.tool-diff__row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tool-diff__row span {
  color: var(--muted-2);
  user-select: none;
}

.tool-diff__row code {
  font: inherit;
}

.tool-diff__row.is-del {
  background: #fef2f2;
  color: #991b1b;
}

.tool-diff__row.is-ins {
  background: #f0fdf4;
  color: #166534;
}

.tool-diff__row.is-same {
  color: var(--muted);
}

.tool-row b.is-pass {
  color: #15803d;
}

.tool-row b.is-fail {
  color: #b91c1c;
}

.tool-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.tool-memory-card {
  aspect-ratio: 1;
  border: 1px solid #c7d8ff;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 55%),
    linear-gradient(135deg, #eef4ff, #e0eaff);
  color: transparent;
  font-size: clamp(22px, 5vw, 34px);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.tool-memory-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
}

.tool-memory-card.is-flipped {
  background: #fff;
  color: var(--text);
}

.tool-memory-card.is-matched {
  border-color: #16a34a;
  background: #f0fdf4;
  color: var(--text);
  cursor: default;
}

.tool-snake-wrap {
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0b1220;
}

.tool-snake {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  touch-action: none;
}

.tool-grid--5 .tool-swatch {
  width: 100%;
  height: 108px;
  border-radius: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px;
}

.tool-swatch span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #111827;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
}

@media (max-width: 620px) {
  .tool-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .tool-midi-tracks {
    grid-template-columns: 1fr;
  }

  .tool-teams {
    grid-template-columns: 1fr;
  }
}

.tool-canvas {
  display: block;
  width: 100%;
  border-radius: 14px;
  background: #0b1220;
  touch-action: none;
  cursor: crosshair;
}

.tool-canvas--sensor {
  height: 360px;
}

.sensor-stage {
  display: grid;
  gap: 12px;
}

.sensor-stage__bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #cbd5e1;
  font-size: 13px;
}

.sensor-stage__actions {
  display: flex;
  gap: 8px;
}

.sensor-stage:fullscreen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #070b15;
}

.sensor-stage:fullscreen .sensor-stage__bar {
  display: flex;
  flex: 0 0 auto;
}

.sensor-stage:fullscreen .tool-canvas--sensor {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.sensor-stage:fullscreen .tool-grid--5 {
  flex: 0 0 auto;
}

.sensor-stage:fullscreen .tool-stat {
  background: rgba(255, 255, 255, 0.06);
}

.sensor-stage:fullscreen .tool-stat__label {
  color: #94a3b8;
}

.sensor-stage:fullscreen .tool-stat__value {
  color: #f8fafc;
}

@media (max-width: 900px) {
  .sensor-stage:fullscreen .tool-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tool-canvas--paper {
  border: 1px solid var(--line);
  background: #fff;
}

.tool-canvas--dark {
  background: #05070c;
}

.tool-canvas--map {
  border: 1px solid #c9d9f5;
  background: #eaf2ff;
}

.tool-screen {
  display: grid;
  place-items: center;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #000;
  cursor: pointer;
  outline: none;
}

.tool-screen:focus-visible {
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.25);
}

.tool-screen:fullscreen {
  border: 0;
  border-radius: 0;
}

.tool-screen__label {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  mix-blend-mode: difference;
  pointer-events: none;
}

.tool-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-swatch {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 9px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tool-swatch:hover {
  transform: translateY(-1px);
}

.tool-swatch.is-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand);
}

.tool-typing {
  min-width: 0;
  min-height: 120px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tool-typing .is-ok {
  color: var(--green);
}

.tool-typing .is-bad {
  border-radius: 3px;
  background: #fee2e2;
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: var(--red);
}

.tool-typing .is-current {
  border-radius: 3px;
  background: var(--brand-soft);
  box-shadow: inset 0 -2px 0 var(--brand);
  color: var(--text);
}

.tool-keyboard {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f1f5fb;
  overflow-x: auto;
  outline: none;
}

.tool-keyboard.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.09);
}

.tool-keyboard__row {
  display: flex;
  gap: 5px;
  min-width: 620px;
}

.tool-key {
  flex: 1 1 0;
  min-width: 34px;
  height: 42px;
  padding: 0 6px;
  border: 1px solid #d4deed;
  border-bottom-width: 2px;
  border-radius: 7px;
  background: #fff;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.1;
  transition: background 0.08s ease, color 0.08s ease, transform 0.08s ease;
}

.tool-key.wide {
  flex: 1.4 1 0;
}

.tool-key.space {
  flex: 5 1 0;
}

.tool-key.is-down {
  transform: translateY(1px);
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tool-log {
  display: grid;
  gap: 3px;
  max-height: 132px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fafc;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
}

.tool-log__row {
  color: var(--text-soft);
}

.tool-log__row b {
  color: var(--brand);
}

.tool-log__empty {
  color: var(--muted-2);
}

.tool-color {
  width: 46px;
  height: 38px;
  padding: 2px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.tool-channels {
  display: flex;
  gap: 8px;
}

.tool-channel {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8faff;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.tool-channel.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.tool-wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 45%, #fff, #eef3fb);
  overflow: hidden;
}

.tool-wheel {
  display: block;
  max-width: 100%;
  border-radius: 50%;
  box-shadow: 0 14px 34px -18px rgba(15, 23, 42, 0.5);
}

.tool-wheel-pointer {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--rose);
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.2));
}

.tool-result-panel {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 16px 18px;
  border: 1px solid #dbe6ff;
  border-radius: 16px;
  background:
    radial-gradient(280px 140px at 100% 0%, rgba(124, 58, 237, 0.1), transparent 70%),
    linear-gradient(135deg, #f2f7ff, #f7f3ff);
}

.tool-result-panel__label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tool-result-panel__empty {
  align-self: center;
  color: var(--muted-2);
  font-size: 13px;
}

.tool-winners {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tool-winner {
  padding: 6px 12px;
  border: 1px solid #c7d8ff;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 700;
}

.tool-winners.is-rolling .tool-winner {
  opacity: 0.6;
}

.tool-numbers,
.tool-emoji-grid,
.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-number {
  min-width: 56px;
  padding: 10px 14px;
  border: 1px solid #c7d8ff;
  border-radius: 12px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.tool-emoji-grid {
  font-size: 30px;
  line-height: 1.2;
}

.tool-emoji-grid span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.tool-emoji-big {
  font-size: 64px;
  line-height: 1.1;
}

.tool-phone-list {
  display: grid;
  gap: 6px;
}

.tool-phone {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tool-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-card-face {
  position: relative;
  width: 104px;
  aspect-ratio: 2.5 / 3.5;
  border: 1px solid #d8e0ec;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 18px -12px rgba(15, 23, 42, 0.4);
  color: #0f172a;
}

.tool-card-face.is-red {
  color: #dc2626;
}

.tool-card-face.is-joker {
  background: linear-gradient(135deg, #fff, #f5f0ff);
}

.tool-card-face__corner {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.tool-card-face__corner--bottom {
  top: auto;
  right: 8px;
  bottom: 7px;
  left: auto;
  transform: rotate(180deg);
}

.tool-card-face__suit {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 38px;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.tool-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tool-date {
  padding: 6px 11px;
  border: 1px solid #c7d8ff;
  border-radius: 9px;
  background: #fff;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.tool-dishes {
  display: grid;
  gap: 10px;
}

.tool-dish {
  padding: 13px 15px;
  border: 1px solid #dbe6ff;
  border-radius: 13px;
  background: #fff;
}

.tool-dish__tag {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tool-dish strong {
  display: block;
  font-size: 15px;
}

.tool-dish p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.tool-signature {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  overflow-x: auto;
}

.tool-code {
  max-height: 220px;
  margin: 0;
  padding: 14px;
  border-radius: 11px;
  background: #0f172a;
  color: #dbeafe;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tool-sheet {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dbe6ff;
  border-radius: 18px;
  background:
    radial-gradient(300px 150px at 100% 0%, rgba(124, 58, 237, 0.1), transparent 70%),
    #fff;
}

.tool-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tool-sheet__head h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.tool-sheet__head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.tool-sheet__label {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-sheet__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tool-sheet__meta span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8faff;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.tool-sheet__meta b {
  color: var(--text);
}

.tool-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.tool-stat--ability {
  gap: 1px;
  padding: 9px 6px;
  text-align: center;
}

.tool-stat--ability .tool-stat__value {
  font-size: 20px;
}

.tool-stat__mod {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.tool-chip {
  padding: 6px 11px;
  border: 1px solid #c7d8ff;
  border-radius: 999px;
  background: #fff;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.tool-chips--names .tool-chip {
  border-radius: 9px;
}

.tool-quote {
  margin: 0;
  color: var(--text-soft);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.tool-quote::before {
  content: "«";
  color: var(--brand);
}

.tool-quote::after {
  content: "»";
  color: var(--brand);
}

.tool-answer {
  display: block;
  color: var(--brand-dark);
  font-size: clamp(38px, 8vw, 64px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.tool-answer.is-waiting {
  opacity: 0.45;
}

.tool-history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  font-size: 11.5px;
}

.tool-history__label {
  color: var(--muted-2);
}

.tool-history__item {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--muted);
  font-weight: 600;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faff;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.tool-result-inline {
  color: var(--muted);
  font-size: 13.5px;
}

.tool-result-inline b {
  color: var(--brand-dark);
}

.tool-barcode {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow-x: auto;
}

.tool-barcode svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.tool-memory__status {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}

.tool-memory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.tool-memory__btn {
  aspect-ratio: 1;
  border: 0;
  border-radius: 20px;
  background: var(--memory-color);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.16), 0 8px 20px -14px rgba(15, 23, 42, 0.7);
  opacity: 0.48;
  transition: opacity 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.tool-memory__btn:not(:disabled):hover {
  opacity: 0.7;
}

.tool-memory__btn.is-lit {
  opacity: 1;
  transform: scale(1.025);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12), 0 0 0 4px #fff, 0 0 0 8px var(--memory-color);
}

.tool-memory__btn.is-error {
  animation: tool-shake 0.35s ease;
}

.tool-memory__btn:disabled {
  cursor: default;
}

.tool-tones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.tool-tone {
  display: grid;
  gap: 3px;
  padding: 18px 8px;
  border: 1.5px solid #c7d8ff;
  border-radius: 15px;
  background: #f8faff;
  color: var(--text-soft);
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.1s ease;
}

.tool-tone span {
  font-size: 15px;
  font-weight: 800;
}

.tool-tone small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
}

.tool-tone:not(:disabled):hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.tool-tone.is-lit {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
}

.tool-tone.is-lit small {
  color: rgba(255, 255, 255, 0.8);
}

.tool-tone.is-error {
  animation: tool-shake 0.35s ease;
}

.tool-tone:disabled {
  cursor: default;
}

@keyframes tool-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.tool-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 80;
  padding: 10px 16px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tool-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 860px) {
  .tool-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-sheet__head {
    display: grid;
  }
}

@media (max-width: 620px) {
  .tool-ui {
    padding: 18px;
    gap: 14px;
  }

  .tool-head {
    display: grid;
    gap: 10px;
  }

  .tool-grid--2,
  .tool-grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-pad {
    min-height: 210px;
  }

  .tool-canvas {
    height: 260px;
  }

  .tool-screen {
    min-height: 250px;
  }

  .tool-tones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-keyboard__row {
    min-width: 560px;
  }

  .tool-card-face {
    width: 88px;
  }

  .tool-answer {
    font-size: 40px;
  }

  .tool-inline-select {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Печать */
@media print {
  .site-header,
  .site-footer,
  .search-dialog,
  .ad-wrap,
  .calc-actions,
  .calc-sidebar,
  .page-toc,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .calc-card,
  .calc-tile,
  .category-card {
    box-shadow: none;
    break-inside: avoid;
  }

  .calc-layout {
    display: block;
  }
}

/* ==========================================================================
   Генераторы: градиент, QR-код, кубики, банковская карта
   ========================================================================== */

.gradient-preview {
  position: relative;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
}

.gradient-preview__label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gradient-stops {
  display: grid;
  gap: 10px;
}

.gradient-stop {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
}

.gradient-stop input[type="color"] {
  width: 46px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.gradient-stop input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.gradient-stop__pos {
  min-width: 46px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.gradient-stop__remove {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.gradient-stop__remove:hover {
  color: var(--rose);
}

.gradient-code {
  width: 100%;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
}

.qr-result {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
}

.qr-result canvas,
.qr-result img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  image-rendering: pixelated;
}

.qr-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.qr-color {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.qr-color input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.dice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 64px;
  align-items: center;
}

.dice-die {
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
}

.dice-die.is-rolling {
  animation: dice-shake 0.18s linear infinite;
  color: var(--muted-2);
}

@keyframes dice-shake {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(4deg); }
  100% { transform: translateY(0) rotate(-3deg); }
}

.dice-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--brand-soft);
}

.dice-total span {
  color: var(--muted);
  font-size: 13px;
}

.dice-total strong {
  color: var(--brand-dark);
  font-size: 26px;
  letter-spacing: -0.03em;
}

.bank-card {
  position: relative;
  display: grid;
  gap: 22px;
  width: min(100%, 430px);
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1e3a8a, #2f5bea 55%, #7c3aed);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bank-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.bank-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.bank-card__chip {
  width: 46px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fde68a, #d97706);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.bank-card__brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bank-card__number {
  position: relative;
  z-index: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(18px, 4.2vw, 23px);
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.bank-card__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.bank-card__label {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bank-card__value {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bank-card__data {
  display: grid;
  gap: 14px;
}

.bank-card__data .tool-row {
  border-bottom-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.bank-card__data .tool-row span {
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 640px) {
  .gradient-stop {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .bank-card {
    padding: 20px;
  }
}

/* ==========================================================================
   Дополнительные элементы инструментов
   ========================================================================== */

.tool-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.chart--grid {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faff;
}

.chart--grid svg {
  width: 100%;
  max-width: 420px;
  height: auto;
  image-rendering: pixelated;
}

.chart--voxel {
  gap: 12px;
}

.voxel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.voxel-button {
  min-width: 34px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.voxel-button:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.voxel-range {
  flex: 1 1 140px;
  min-width: 120px;
  accent-color: var(--brand);
}

.voxel-layer {
  min-width: 72px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.voxel-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.voxel-check input {
  accent-color: var(--brand);
}

.voxel-canvas-wrap {
  width: 100%;
  border: 1px solid #1e293b;
  border-radius: 14px;
  background: #0b1220;
  overflow: hidden;
}

.voxel-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
}

.voxel-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chart-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.result-row__copy {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.result-row__copy:hover,
.result-row__copy.is-copied {
  background: var(--brand-soft);
  border-color: var(--brand);
}

/* Генератор цвета */
.color-preview {
  display: grid;
  place-items: center;
  min-height: 190px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #6366f1;
  transition: background 0.2s ease;
}

.color-preview__value {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.color-code {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
}

.color-code__label {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.color-code b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

.color-code__copy {
  justify-self: start;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.color-history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.color-history__label {
  color: var(--muted);
  font-size: 12px;
}

.color-history__item {
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

/* Карта Таро */
.taro-stage {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.taro-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 280px;
  padding: 22px 18px;
  border: 1px solid #c7b8ff;
  border-radius: 18px;
  background: linear-gradient(160deg, #f5f1ff, #e9e2ff 60%, #dcd2ff);
  color: #3b2a7a;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.taro-card.is-reversed {
  transform: rotate(180deg);
}

.taro-card__number {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #6d5bb3;
}

.taro-card__symbol {
  font-size: 54px;
  line-height: 1;
}

.taro-card__name {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.taro-card__position {
  margin-top: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 42, 122, 0.1);
  font-size: 11.5px;
  font-weight: 600;
}

.taro-reading {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
}

.taro-reading__label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.taro-reading__head b {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.55;
}

.taro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.taro-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.taro-history__label {
  color: var(--muted);
  font-size: 12px;
}

.taro-history__item {
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11.5px;
}

@media (max-width: 900px) {
  .tool-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .taro-stage {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .tool-grid--5 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   GTA 6: прогресс-бар и новости
   ========================================================================== */

.chart--gta {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border: 1px solid rgba(255, 45, 149, 0.38);
  border-radius: 18px;
  background:
    linear-gradient(100deg, rgba(7, 11, 21, 0.97) 0%, rgba(7, 11, 21, 0.82) 52%, rgba(124, 58, 237, 0.4) 100%),
    url('/assets/calc/gta-6-timer.jpg') center / cover no-repeat;
  color: #fff;
  box-shadow: 0 20px 44px -28px rgba(255, 45, 149, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.chart--gta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 12%, rgba(255, 45, 149, 0.32), transparent 46%);
  pointer-events: none;
}

.gta-progress__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.gta-progress__logo {
  color: #ff4fae;
  font-size: 20px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(255, 45, 149, 0.8);
}

.gta-progress__percent {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.55);
}

.gta-progress__track {
  position: relative;
  z-index: 1;
  height: 18px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 10%),
    rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.gta-progress__fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2d95 0%, #d946ef 38%, #7c3aed 68%, #38bdf8 100%);
  box-shadow: 0 0 18px rgba(255, 45, 149, 0.75), 0 0 30px rgba(56, 189, 248, 0.35);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.gta-progress__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.42) 50%, transparent 72%);
}

.gta-progress__labels {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.gta-progress__caption {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.5;
}

/* Новости */
.news-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 4px;
}

.news-item {
  position: relative;
  padding: 15px 18px 15px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faff;
}

.news-item::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(#ff2d95, #7c3aed);
}

.news-item--accent {
  border-color: #f7b7dc;
  background: linear-gradient(135deg, #fff1f8, #f3e8ff);
}

.news-item time {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.news-item h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
  letter-spacing: -0.015em;
}

.news-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  .gta-progress__fill::after {
    animation: none;
    opacity: 0;
  }
}

/* ==========================================================================
   GTA VI: главный прогресс-бар с контрольными точками
   ========================================================================== */

.gta-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 26px;
  padding: 24px 26px 22px;
  border: 1px solid rgba(255, 45, 149, 0.42);
  border-radius: 24px;
  background:
    linear-gradient(100deg, rgba(7, 11, 21, 0.97) 0%, rgba(7, 11, 21, 0.84) 54%, rgba(124, 58, 237, 0.42) 100%),
    url('/assets/calc/gta-6-timer.jpg') center / cover no-repeat;
  color: #fff;
  box-shadow: 0 24px 52px -30px rgba(255, 45, 149, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.gta-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 10%, rgba(255, 45, 149, 0.3), transparent 46%);
  pointer-events: none;
}

.gta-hero__head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.gta-hero__titles {
  margin-right: auto;
}

.gta-hero__logo {
  display: block;
  color: #ff4fae;
  font-size: clamp(26px, 3.2vw, 38px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 45, 149, 0.8);
}

.gta-hero__subtitle {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gta-hero__count {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.gta-hero__count strong {
  color: #fff;
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 0 22px rgba(56, 189, 248, 0.5);
}

.gta-hero__count span {
  max-width: 82px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
}

.gta-hero__fs {
  position: relative;
  z-index: 3;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gta-hero__fs:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
}

.gta-hero__scroll {
  position: relative;
  z-index: 2;
  padding: 48px 0 52px;
}

.gta-hero__track {
  position: relative;
  height: 20px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 10%),
    rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.gta-hero__fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2d95 0%, #d946ef 38%, #7c3aed 68%, #38bdf8 100%);
  box-shadow: 0 0 20px rgba(255, 45, 149, 0.8), 0 0 34px rgba(56, 189, 248, 0.38);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gta-hero__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.42) 50%, transparent 72%);
}

.gta-hero__markers {
  position: absolute;
  inset: 0;
}

.gta-marker {
  position: absolute;
  top: 50%;
  left: var(--pos, 0%);
  z-index: 2;
  transform: translate(-50%, -50%);
}

.gta-marker[hidden] {
  display: none;
}

.gta-marker__dot {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: #0b1220;
  box-shadow: 0 0 0 3px rgba(7, 11, 21, 0.6);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gta-marker.is-done .gta-marker__dot {
  border-color: #fff;
  background: #ff4fae;
  box-shadow: 0 0 0 3px rgba(7, 11, 21, 0.6), 0 0 16px rgba(255, 45, 149, 0.95);
}

.gta-marker--release .gta-marker__dot {
  width: 21px;
  height: 21px;
  border-color: #38bdf8;
}

.gta-marker--release.is-done .gta-marker__dot {
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(7, 11, 21, 0.6), 0 0 20px rgba(56, 189, 248, 0.95);
}

.gta-marker__label {
  position: absolute;
  left: 50%;
  width: max-content;
  max-width: 170px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(7, 11, 21, 0.74);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}

.gta-marker__label small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 9.5px;
  font-weight: 500;
}

.gta-marker:nth-child(odd) .gta-marker__label {
  bottom: 24px;
}

.gta-marker:nth-child(even) .gta-marker__label {
  top: 24px;
}

.gta-marker--first .gta-marker__label {
  left: 0;
  text-align: left;
  transform: none;
}

.gta-marker--last .gta-marker__label {
  right: 0;
  left: auto;
  text-align: right;
  transform: none;
}

.gta-hero__foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.gta-hero__percent {
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 45, 149, 0.55);
}

.gta-hero__caption {
  flex: 1;
  min-width: 190px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
  line-height: 1.45;
}

.gta-hero__dates {
  display: flex;
  gap: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Полноэкранный режим */
.gta-hero.is-faux-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: clamp(28px, 6vw, 90px);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 21, 0.72) 0%, rgba(7, 11, 21, 0.93) 100%),
    url('/assets/calc/gta-6-timer.jpg') center / cover no-repeat;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__logo {
  font-size: clamp(48px, 7vw, 110px);
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__subtitle {
  font-size: 15px;
  letter-spacing: 0.26em;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__count strong {
  font-size: clamp(48px, 6vw, 96px);
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__count span {
  max-width: 120px;
  font-size: 14px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__scroll {
  padding: clamp(70px, 12vh, 150px) 0;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__track {
  height: 34px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-marker__dot {
  width: 22px;
  height: 22px;
  border-width: 3px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-marker--release .gta-marker__dot {
  width: 28px;
  height: 28px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-marker__label {
  max-width: 260px;
  padding: 8px 12px;
  font-size: 16px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-marker__label small {
  font-size: 12.5px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-marker:nth-child(odd) .gta-marker__label {
  bottom: 38px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-marker:nth-child(even) .gta-marker__label {
  top: 38px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__percent {
  font-size: clamp(64px, 8vw, 140px);
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__caption {
  font-size: 16px;
}

.gta-hero:is(:fullscreen, .is-faux-fullscreen) .gta-hero__dates {
  font-size: 14px;
}

@media (max-width: 820px) {
  .gta-hero {
    padding: 18px;
  }

  .gta-hero__head {
    gap: 12px;
  }

  .gta-hero__count strong {
    font-size: 30px;
  }

  .gta-hero__scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 46px 0 50px;
    scrollbar-width: thin;
  }

  .gta-hero__track {
    min-width: 620px;
  }

  .gta-hero__foot {
    align-items: flex-start;
  }

  .gta-hero__percent {
    font-size: 30px;
  }

  .gta-hero__dates {
    width: 100%;
    justify-content: space-between;
  }
}


body.gta-fs-open {
  overflow: hidden;
}

/* ==========================================================================
   Колесо для стрима: ставки, режимы и полноэкранный вид
   ========================================================================== */

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
}

.wheel-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
}

.wheel-editor.is-spinning {
  pointer-events: none;
  opacity: 0.62;
}

.wheel-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wheel-editor__title {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.wheel-bank {
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.wheel-options-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px 46px 28px;
  gap: 8px;
  padding: 0 2px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wheel-options-head span:nth-child(3) {
  text-align: right;
}

.wheel-options {
  display: grid;
  gap: 8px;
  max-height: 342px;
  padding-right: 2px;
  overflow: auto;
}

.wheel-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px 46px 28px;
  gap: 8px;
  align-items: center;
}

.wheel-option .tool-input {
  padding: 8px 10px;
  font-size: 13px;
}

.wheel-option__amount {
  position: relative;
  display: block;
}

.wheel-option__amount .tool-input {
  padding-right: 24px;
}

.wheel-option__amount span {
  position: absolute;
  top: 50%;
  right: 9px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-50%);
}

.wheel-option__chance {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.wheel-option.is-out {
  opacity: 0.45;
}

.wheel-option.is-out .wheel-option__name {
  text-decoration: line-through;
}

.wheel-option.is-out .wheel-option__chance {
  color: var(--rose);
}

.wheel-option__remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.wheel-option__remove:hover {
  background: #fee2e2;
  color: var(--rose);
}

.wheel-add {
  justify-self: start;
}

.wheel-winners {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.wheel-winners__label {
  color: var(--muted);
  font-size: 12px;
}

.wheel-winner {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11.5px;
  font-weight: 600;
}

.wheel-stage {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 40%, #ffffff, #eef3fb);
}

.wheel-stage__bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wheel-stage__info {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.wheel-stage__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.wheel-result {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text-soft);
  font-size: 14px;
  text-align: center;
}

.wheel-result b {
  color: var(--text);
}

/* Полноэкранный режим */
.wheel-stage.is-faux-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 38%, #1e293b, #070b15 72%);
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .wheel-stage__bar {
  display: flex;
  flex: 0 0 auto;
  color: #cbd5e1;
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .wheel-stage__info {
  color: #cbd5e1;
  font-size: 13px;
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .tool-wheel-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .tool-wheel {
  box-shadow: 0 0 70px rgba(47, 91, 234, 0.38);
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .tool-wheel-pointer {
  top: 10px;
  border-top-width: 24px;
  border-right-width: 15px;
  border-left-width: 15px;
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .wheel-result {
  flex: 0 0 auto;
  min-height: 58px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: clamp(16px, 1.8vw, 26px);
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .wheel-result b {
  color: #fff;
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .wheel-stage__foot {
  flex: 0 0 auto;
}

.wheel-stage:is(:fullscreen, .is-faux-fullscreen) .wheel-stage__foot .btn {
  padding: 12px 22px;
  font-size: 15px;
}

body.wheel-fs-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .wheel-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .wheel-options {
    max-height: 300px;
  }

  .wheel-option,
  .wheel-options-head {
    grid-template-columns: minmax(0, 1fr) 96px 40px 28px;
  }
}

@media (max-width: 520px) {
  .wheel-option,
  .wheel-options-head {
    grid-template-columns: minmax(0, 1fr) 84px 36px 26px;
    gap: 6px;
  }

  .wheel-option .tool-input {
    padding: 7px 8px;
    font-size: 12.5px;
  }
}
