/* RelsibCloud — современный дизайн */
:root {
  --font-main: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Премиальная светлая палитра */
  --accent: #0e9fe9;
  --accent-dark: #0369a1;
  --accent-soft: rgba(14, 159, 233, 0.08);
  --text: #18181b;
  --text-muted: #71717a;
  --text-light: #a1a1aa;
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-tint: #f5f7fa;
  --border: #e4e4e7;
  --radius: 32px;
  --radius-pill: 999px;
  --radius-sm: 16px;
  /* Типографика */
  --font-size-hero: clamp(34px, 3.6vw, 60px);
  --font-size-display: clamp(30px, 4vw, 52px);
  --font-size-page: clamp(26px, 3.1vw, 36px);
  --font-size-h3: 24px;
  --font-size-body-lg: 22px;
  --font-size-body: 19px;
  --font-size-body-sm: 17px;
  --font-size-caption: 15px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-body: 1.6;
  --line-height-loose: 1.7;
  --section-padding: 100px 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  overflow-x: hidden;
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--text);
  background: linear-gradient(180deg, #fafafa 0%, var(--bg-tint) 50%, #fafafa 100%);
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === LOADER — полноэкранный лоадер с анимацией квадратов === */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader.loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
}

.loader__box {
  position: relative;
  width: 96px;
  height: 96px;
  transform: rotate(45deg);
  z-index: 1;
}

.loader__square {
  position: absolute;
  width: 28px;
  height: 28px;
  top: 0;
  left: 0;
  margin: 2px;
  background: var(--accent);
  animation: loader-square 10s ease-in-out infinite both;
}

.loader__square:nth-child(1) { animation-delay: 0s; }
.loader__square:nth-child(2) { animation-delay: -1.43s; }
.loader__square:nth-child(3) { animation-delay: -2.86s; }
.loader__square:nth-child(4) { animation-delay: -4.29s; }
.loader__square:nth-child(5) { animation-delay: -5.71s; }
.loader__square:nth-child(6) { animation-delay: -7.14s; }
.loader__square:nth-child(7) { animation-delay: -8.57s; }

@keyframes loader-square {
  0% { left: 0; top: 0; }
  10.5% { left: 0; top: 0; }
  12.5% { left: 32px; top: 0; }
  23% { left: 32px; top: 0; }
  25% { left: 64px; top: 0; }
  35.5% { left: 64px; top: 0; }
  37.5% { left: 64px; top: 32px; }
  48% { left: 64px; top: 32px; }
  50% { left: 32px; top: 32px; }
  60.5% { left: 32px; top: 32px; }
  62.5% { left: 32px; top: 64px; }
  73% { left: 32px; top: 64px; }
  75% { left: 0; top: 64px; }
  85.5% { left: 0; top: 64px; }
  87.5% { left: 0; top: 32px; }
  98% { left: 0; top: 32px; }
  100% { left: 0; top: 0; }
}

/* === HEADER — pill menu (поверх hero) === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 24px;
}

.header__pill {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  min-width: 0;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-main);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-page);
  color: var(--text);
  flex-shrink: 0;
  line-height: 1;
}

.header__logo-img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.header__logo-text {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-body-lg);
  color: var(--text);
  line-height: 1;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.header__nav-item {
  font-family: var(--font-main);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body);
  color: var(--text-muted);
  padding: 6px 10px;
  white-space: nowrap;
  transition: color 0.2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.header__nav-item:hover {
  color: var(--text);
}

.header__nav-item--active {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

.header__sep {
  width: 4px;
  height: 4px;
  background: var(--text-light);
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.header__icon:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.header__right .btn--primary {
  padding: 10px 20px;
}

/* Бургер и мобильное меню */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  border-radius: 12px;
  transition: background 0.2s;
}
.header__burger:hover {
  background: var(--accent-soft);
}
.header__burger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  margin: 3px 0;
  transition: transform 0.25s, opacity 0.25s;
}
.header--menu-open .header__burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.header--menu-open .header__burger-line:nth-child(2) {
  opacity: 0;
}
.header--menu-open .header__burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.header__menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.header__menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 340px;
  background: var(--bg-card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 200;
  padding: 24px;
  overflow-y: auto;
  flex-direction: column;
  gap: 0;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
}
.header__menu-close {
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s, color 0.2s;
}
.header__menu-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.header__menu-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.header__menu-link {
  display: block;
  padding: 14px 16px;
  font-family: var(--font-main);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body-sm);
  color: var(--text);
  border-radius: 14px;
  transition: background 0.2s, color 0.2s;
}
.header__menu-link:hover,
.header__menu-link--active {
  background: var(--accent-soft);
  color: var(--accent);
}
.header__menu-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}
.header__menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.header__menu-icon:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn--outline:hover {
  background: var(--accent-soft);
}

.btn--small {
  padding: 10px 18px;
  font-size: var(--font-size-caption);
}

.btn--large {
  padding: 16px 32px;
  font-size: var(--font-size-body-sm);
}

/* === HERO — 50/50: mockup left, text right === */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: min(92vh, 880px);
  min-height: 640px;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: #f3f4f6;
  align-items: center;
  padding: 0 clamp(24px, 4vw, 72px) 0 clamp(72px, 12vw, 200px);
  border-bottom-left-radius: clamp(40px, 6vw, 80px);
  border-bottom-right-radius: clamp(40px, 6vw, 80px);
}

.hero__image {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-right: 8px;
  margin-left: clamp(24px, 4vw, 64px);
}

.hero__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__image--ecosystem img {
  position: static;
  top: auto;
  left: auto;
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.hero__image--ecosystem .hero-eco-node__logo {
  width: 88px;
  height: 88px;
}

.hero__image--mockup {
  background: transparent;
}

.hero__image--mockup img {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 76%;
  object-fit: contain;
  object-position: center right;
  padding: 0;
  transform: translateX(4%);
}

.hero__image--ecosystem {
  justify-content: center;
  align-items: center;
  padding-right: 0;
  overflow: visible;
}

.hero:has(.hero__image--ecosystem) {
  height: min(92vh, 820px);
  min-height: 560px;
  overflow: hidden;
  padding-top: clamp(80px, 10vh, 112px);
  padding-bottom: clamp(28px, 4vh, 48px);
  background: #f3f4f6;
}

.hero:has(.hero__image--ecosystem) .hero__content {
  padding-top: 20px;
  padding-bottom: 20px;
}

.hero-ecosystem {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 14px);
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.hero-eco-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 140px;
  text-align: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.hero-eco-node img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.hero-eco-node__logo {
  width: 88px;
  height: 88px;
}

.hero-eco-node > strong {
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  color: var(--text);
}

.hero-eco-node > span {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-muted);
}

.hero-eco-node--cloud > strong {
  color: var(--accent-dark);
}

.hero-eco-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 4px 10px;
  align-items: start;
  justify-items: center;
  max-width: 260px;
}

.hero-eco-group .hero-eco-node {
  max-width: 120px;
}

.hero-eco-group .hero-eco-node img {
  width: 96px;
  height: 96px;
}

.hero-eco-or {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-align: center;
}

.hero-eco-node--wifi {
  grid-column: 1 / -1;
  max-width: 110px;
}

.hero-eco-node--wifi img {
  width: 84px;
  height: 84px;
}

.hero-eco-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: rgba(14, 159, 233, 0.55);
  align-self: center;
  margin-top: -28px;
}

.hero:has(.hero__image--ecosystem) .hero__content {
  padding-top: 20px;
  padding-bottom: 20px;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 80px clamp(16px, 3vw, 40px) 80px clamp(40px, 5vw, 72px);
  min-width: 0;
  max-width: 100%;
  height: 100%;
  background: transparent;
  color: var(--text);
  box-sizing: border-box;
  margin-left: clamp(8px, 2vw, 32px);
}

.hero__content--blue {
  background: transparent;
  color: var(--text);
}

.hero__content--blue .hero__title {
  color: var(--text);
}

.hero__content--blue .hero__subtitle {
  color: var(--text-muted);
}

.hero__title {
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-hero);
  line-height: 1.3;
  margin: 0 0 24px;
  letter-spacing: 0em;
  max-width: 480px;
  min-width: 0;
  color: var(--text);
}

.hero__subtitle {
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-loose);
  margin: 0 0 40px;
  max-width: 440px;
  min-width: 0;
  color: var(--text-muted);
}

.btn--hero {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
}

.btn--hero:hover {
  background: var(--accent-dark);
  color: #fff;
}

/* Hero pill button with icon (Войти в Relsibcloud.com) */
.btn--pill-icon {
  position: relative;
  height: 56px;
  min-height: 56px;
  padding-left: 28px;
  padding-right: 72px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: padding 0.35s ease, color 0.25s ease, background 0.25s ease;
}
.btn--pill-icon:hover {
  padding-left: 72px;
  padding-right: 28px;
}
.btn__pill-text {
  position: relative;
  z-index: 2;
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
  transition: opacity 0.2s ease;
}
.btn__pill-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: right 0.35s ease, transform 0.35s ease, background 0.25s ease;
}
.btn--hero .btn__pill-icon {
  background: #fff;
  color: var(--accent);
}
.btn--hero:hover .btn__pill-icon {
  background: #fff;
  color: var(--accent-dark);
}
.btn--pill-icon:hover .btn__pill-icon {
  right: calc(100% - 50px);
  transform: translateY(-50%) rotate(45deg);
}
.btn__pill-icon svg {
  flex-shrink: 0;
}

/* === SECTIONS === */
section {
  position: relative;
  min-width: 0;
  overflow-x: hidden;
}

main {
  min-width: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.section-title {
  font-family: var(--font-main);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-display);
  line-height: var(--line-height-tight);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 24px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-family: var(--font-main);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-regular);
  color: var(--text-muted);
  text-align: center;
  max-width: 750px;
  margin: 0 auto 48px;
  line-height: var(--line-height-loose);
}

.section-subtitle:empty {
  display: none;
  margin: 0;
}

/* Подзаголовки блоков внутри секций */
.subsection-title,
.app-ways__title,
.app-mockup__title,
.app-benefits__title,
.ecosystem__title,
.devices__cta h3 {
  font-family: var(--font-main);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text);
}

.app-ways__title,
.app-mockup__title,
.app-benefits__title {
  margin: 0 0 24px;
  text-align: center;
}

.devices__cta h3 {
  margin: 0 0 12px;
  text-align: center;
}

/* === SOLUTIONS — Для дома / Для бизнеса === */
.solutions {
  padding: var(--section-padding);
  background: transparent;
  position: relative;
}
.solutions__inner {
  position: relative;
  z-index: 0;
  max-width: 1400px;
  margin: 0 auto;
}

.selector {
  display: inline-flex;
  align-items: stretch;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin: 0 auto 48px;
  box-sizing: border-box;
  min-height: 48px;
}

.selector__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  z-index: 0;
  transition: left 0.3s ease, width 0.3s ease;
  pointer-events: none;
}

.selector__btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 28px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s ease;
  box-sizing: border-box;
}

.selector__btn:hover {
  color: var(--text);
}

.selector__btn--active {
  color: var(--text);
}

.solutions__panels {
  position: relative;
}

.solutions__panel {
  display: none;
}

.solutions__panel--active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.solutions__nav {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.solutions__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.solution-card {
  position: relative;
  aspect-ratio: 3 / 6;
  border-radius: 56px;
  overflow: visible;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.solution-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.solution-card__image {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.solution-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
}

.solution-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.solution-card__image {
  background: var(--bg);
}

.solution-card__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.solution-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.solution-card__title {
  font-family: var(--font-main);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 10px;
  color: #fff;
}

.solution-card__text {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-regular);
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 20px;
  line-height: var(--line-height-body);
  flex: 1;
}

.solution-card__btn {
  display: inline-flex;
  align-self: flex-start;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-pill);
  transition: background 0.2s;
}

.solution-card:hover .solution-card__btn {
  background: var(--accent-dark);
}

@media (max-width: 1024px) {
  .solutions__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .selector {
    width: 100%;
    display: flex;
  }

  .selector__btn {
    flex: 1;
  }
}

/* === SCHEMA — схема: дом (PNG) + SVG поверх === */
.schema {
  padding: var(--section-padding);
  background: var(--bg);
  color: var(--text);
}
.schema .section-title { color: var(--text); }
.schema .section-subtitle { color: var(--text-muted); }

.schema__wrap {
  position: relative;
  max-width: min(1000px, 90vw);
  margin: 48px auto 0;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
}

.schema__house {
  position: absolute;
  inset: 0;
  background: url("Images/Shema/dom.png") center / contain no-repeat;
}

.schema__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

@media (max-width: 600px) {
  .schema__wrap { margin-top: 32px; }
}

/* === FEATURES — преимущества сразу после hero === */
.features {
  padding: var(--section-padding);
  max-width: none;
  margin: 0;
  width: 100%;
  background: transparent;
  box-sizing: border-box;
}

.features .section-title {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 40px;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 28px 40px;
  min-height: 320px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  border-color: var(--accent);
}

.feature-card__icon {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 12px;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.feature-card__icon img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
}

.feature-card__icon svg {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.feature-card:hover .feature-card__icon {
  color: var(--accent-dark);
  transform: translateY(-3px);
}

.feature-card__title {
  font-family: var(--font-main);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 8px;
  color: var(--text);
}

.feature-card__subtitle {
  font-family: var(--font-main);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 16px;
}

.feature-card__text {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: var(--line-height-body);
}

.feature-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  font-size: 0;
  text-decoration: none;
  transition: opacity 0.2s;
}

.feature-card__link:hover {
  opacity: 1;
}

/* === PROTOCOLS — accordion + visual (Yandex style) === */
.protocols {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-top: 100px;
  margin-bottom: 100px;
  padding: 0 0px 0 270px;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  --protocols-anim: 0.3s;
  --protocols-item-collapsed: 56px;
}

.protocols::before {
  display: none;
}

.protocols__inner {
  max-width: none;
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(320px, 580px) 1fr;
  gap: 80px;
  align-items: stretch;
  position: relative;
  z-index: 0;
  min-height: 480px;
}

.protocols__content {
  max-width: 580px;
  padding-top: 100px;
  padding-bottom: 100px;
}

.protocols__title {
  font-family: var(--font-main);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-display);
  line-height: var(--line-height-tight);
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: left;
}

.protocols__lead {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-regular);
  color: var(--text-muted);
  margin: 0 0 40px;
  line-height: var(--line-height-body);
  max-width: 36em;
}

.protocols__connections {
  margin-top: 8px;
}

.protocols__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.protocols__list-item {
  height: var(--protocols-item-collapsed);
  overflow: hidden;
  transition: height var(--protocols-anim) ease-out;
  border-bottom: 1px solid var(--border);
}

.protocols__list-item.active[data-connection="bluetooth"] {
  height: 132px;
}

.protocols__list-item.active[data-connection="rs485"] {
  height: 166px;
}

.protocols__list-item.active[data-connection="wifi"] {
  height: 128px;
}

.protocols__list-item.active[data-connection="gateways"] {
  height: 148px;
}

.protocols__list-item:first-child {
  border-top: 1px solid var(--border);
}

.protocols__item-title {
  margin: 0;
  padding: 16px 32px 16px 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.protocols__item-title:hover {
  color: var(--accent-dark);
}

.protocols__item-title:focus {
  outline: none;
}

.protocols__item-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.protocols__item-title::after {
  content: "";
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: center;
  transform: rotate(180deg);
  transition: transform var(--protocols-anim) ease-out;
}

.protocols__list-item.active .protocols__item-title::after {
  transform: rotate(0);
}

.protocols__item-text {
  margin: 0;
  padding: 0 32px 16px 0;
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  color: var(--text-muted);
}

.protocols__item-link {
  display: inline-block;
  margin: 0 0 16px;
  padding: 0 46px 16px 0;
  font-family: var(--font-main);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='10' fill='none' stroke='%230e9fe9' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4-4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  transition: color 0.2s, opacity 0.2s;
}

.protocols__item-link:hover {
  color: var(--accent-dark);
}

/* Visual block */
.protocols__visual {
  position: relative;
  min-height: 480px;
  align-self: stretch;
  background: var(--bg-tint);
}

.protocols__image {
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: auto;
  height: 100%;
  min-height: 480px;
  background: transparent;
  position: absolute;
  inset: 0;
}

.protocols__image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Когда загружена своя картинка — плейсхолдер скрыт */
.protocols__image:has(.protocols__image-img[src]) .protocols__image-placeholder {
  display: none;
}

.protocols__image-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
}

.protocols__image-placeholder svg {
  opacity: 0.4;
  color: var(--accent);
}

/* Placeholder: можно заменить на <img src="..." alt=""> когда будет фото */

/* === APP SECTION (стиль Rubetek) === */
.app-section {
  padding: var(--section-padding);
  background: transparent;
}

/* Способы работы */
.app-ways {
  max-width: 1000px;
  margin: 0 auto 64px;
}

.app-ways__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.app-way-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.app-way-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.app-way-card__icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
  margin-bottom: 16px;
}

.app-way-card__icon svg {
  width: 100%;
  height: 100%;
}

.app-way-card__icon--pulse svg {
  animation: schemaPulse 2s ease-in-out infinite;
}

.app-way-card__title {
  font-family: var(--font-main);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 8px;
  color: var(--text);
}

.app-way-card__text {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: var(--line-height-body);
  flex: 1;
}

.app-way-card__link {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--accent);
  transition: color 0.2s;
}

.app-way-card:hover .app-way-card__link {
  color: var(--accent-dark);
}

/* Мокап App-uni (два телефона с экранами приложения) */
.app-mockup {
  margin-bottom: 64px;
  text-align: center;
}

.app-mockup__title {
  margin: 0 0 8px;
}

.app-mockup__lead {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: var(--line-height-body);
}

.app-mockup__image-wrap {
  max-width: 1500px;
  margin: 0 auto;
}

.app-mockup__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

/* Преимущества */
.app-benefits {
  max-width: 800px;
  margin: 0 auto 64px;
}

.app-benefits__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.app-benefit {
  padding: 12px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  transition: border-color 0.2s;
}

.app-benefit:hover {
  border-color: var(--accent);
}

/* Карточки экосистемы (legacy, keep for safety) */
.app-features {
  max-width: 1400px;
  margin: 0 auto 48px;
}

.app-features__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.app-feature {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.app-feature:hover {
  border-color: var(--accent);
}

.app-feature__title {
  font-family: var(--font-main);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 8px;
  color: var(--text);
}

.app-feature__text {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: var(--line-height-body);
}

.app-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* === Ecosystem data flow === */
.ecosystem {
  max-width: 1120px;
  margin: 0 auto;
}

.ecosystem__title {
  margin: 0 0 12px;
  text-align: center;
  font-size: var(--font-size-page);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  letter-spacing: -0.02em;
}

.ecosystem__lead {
  margin: 0 auto 18px;
  max-width: 44em;
  text-align: center;
  font-size: var(--font-size-body-sm);
  color: var(--text-light);
  line-height: var(--line-height-body);
}

.ecosystem__modes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 30px;
}

.ecosystem__mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 16px;
  border: 1px solid rgba(14, 159, 233, 0.18);
  border-radius: 999px;
  background: rgba(14, 159, 233, 0.08);
  font: inherit;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ecosystem__mode:hover {
  border-color: rgba(14, 159, 233, 0.34);
}

.ecosystem__mode.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.ecosystem__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.32fr);
  gap: 56px;
  align-items: center;
}

.ecosystem__flow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 0.75fr) minmax(150px, 0.9fr) minmax(132px, 0.75fr) minmax(150px, 0.9fr);
  gap: 34px;
  align-items: center;
  min-height: 330px;
  padding: 22px 0;
  background: transparent;
}

.ecosystem__flow::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(14, 159, 233, 0), rgba(14, 159, 233, 0.52), rgba(14, 159, 233, 0));
  transform: translateY(-50%);
}

.ecosystem__flow::after {
  content: "";
  position: absolute;
  right: 6.5%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-top: 1.5px solid rgba(14, 159, 233, 0.58);
  border-right: 1.5px solid rgba(14, 159, 233, 0.58);
  transform: translateY(-50%) rotate(45deg);
}

.ecosystem__split {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 46px;
}

.ecosystem__split::before,
.ecosystem__split::after {
  content: "";
  position: absolute;
  left: -34px;
  width: 34px;
  height: 1px;
  background: rgba(14, 159, 233, 0.25);
}

.ecosystem__split::before {
  top: 25%;
}

.ecosystem__split::after {
  bottom: 25%;
}

.ecosystem__split--out::before,
.ecosystem__split--out::after {
  left: auto;
  right: -34px;
}

.ecosystem__node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  min-height: 0;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  box-shadow: none;
  transition: opacity 0.25s ease, transform 0.2s ease;
}

.ecosystem__node:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.ecosystem__node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
  border-radius: 16px;
}

.ecosystem__flow[data-eco-mode-active="in"] .ecosystem__node[data-eco-mode="out"],
.ecosystem__flow[data-eco-mode-active="out"] .ecosystem__node[data-eco-mode="in"] {
  opacity: 0.26;
}

.ecosystem__node.is-active {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: none;
}

.ecosystem__node--cloud {
  min-height: 0;
  padding: 0;
  background: transparent;
  border-color: transparent;
}

.ecosystem__step {
  order: -1;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: rgba(14, 159, 233, 0.65);
  letter-spacing: 0.04em;
}

.ecosystem__node-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(14, 159, 233, 0.16);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.ecosystem__node--cloud .ecosystem__node-media {
  width: 82px;
  height: 82px;
  background: radial-gradient(circle at 50% 35%, #fff 0%, #eef9ff 100%);
  border-color: rgba(14, 159, 233, 0.28);
  box-shadow: 0 18px 46px rgba(14, 159, 233, 0.12);
}

.ecosystem__node:hover .ecosystem__node-media,
.ecosystem__node.is-active .ecosystem__node-media {
  color: var(--accent);
  border-color: rgba(14, 159, 233, 0.5);
  box-shadow: 0 16px 34px rgba(14, 159, 233, 0.12);
}

.ecosystem__node-media img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.ecosystem__node-media svg {
  display: block;
  flex-shrink: 0;
}

.ecosystem__node-label {
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  line-height: 1.25;
  max-width: 9em;
}

.ecosystem__node-text {
  max-width: 13em;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ecosystem__detail {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 10px 0 10px 28px;
  border: none;
  border-left: 1px solid rgba(14, 159, 233, 0.18);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ecosystem__detail::after {
  content: "";
  display: block;
  height: 2px;
  width: 44px;
  margin-top: auto;
  border-radius: 999px;
  background: var(--accent);
}

.ecosystem__detail.is-updating {
  opacity: 0.62;
}

.ecosystem__detail-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.ecosystem__detail-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  letter-spacing: -0.02em;
}

.ecosystem__detail-text {
  margin: 0 0 20px;
  max-width: 28em;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: 1.65;
}

.ecosystem__detail-link {
  display: inline-flex;
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-medium);
  color: var(--accent-dark);
  transition: color 0.2s ease;
}

.ecosystem__detail-link:hover {
  color: var(--accent);
}

.ecosystem__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
}

@media (max-width: 900px) {
  .ecosystem__layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ecosystem__flow {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 28px;
    padding: 6px 0;
  }

  .ecosystem__flow::before,
  .ecosystem__flow::after,
  .ecosystem__split::before,
  .ecosystem__split::after {
    display: none;
  }

  .ecosystem__split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .ecosystem__detail {
    order: 2;
    min-height: 0;
    padding: 24px 0 0;
    border-left: none;
    border-top: 1px solid rgba(14, 159, 233, 0.18);
  }
}

@media (max-width: 640px) {
  .ecosystem__lead { margin-bottom: 12px; }
  .ecosystem__modes { margin-bottom: 20px; }

  .ecosystem__node {
    min-height: 0;
  }

  .ecosystem__flow {
    gap: 26px;
  }

  .ecosystem__split {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ecosystem__node-media,
  .ecosystem__node--cloud .ecosystem__node-media {
    width: 56px;
    height: 56px;
    border-radius: 50%;
  }

  .ecosystem__node-media img {
    width: 32px;
    height: 32px;
  }

  .ecosystem__node-media svg {
    width: 22px;
    height: 22px;
  }

  .ecosystem__node-label {
    font-size: 15px;
  }

  .ecosystem__detail {
    padding: 22px 0 0;
  }

  .ecosystem__actions {
    margin-top: 28px;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecosystem__node,
  .ecosystem__links line {
    transition: none;
  }
}

/* === Mobile web promo (phone mockup) === */
.mobile-web {
  padding: var(--section-padding);
  max-width: 1400px;
  margin: 0 auto;
}

.mobile-web__inner {
  max-width: 1120px;
  margin: 0 auto;
}

.mobile-web__headline {
  font-family: var(--font-main);
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 28px;
}

.mobile-web__card {
  position: relative;
  display: flex;
  align-items: center;
  height: 480px;
  padding: 48px 400px 48px 72px;
  background: #f0f2f5;
  border-radius: 48px;
  overflow: hidden;
}

.mobile-web__content {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.mobile-web__brand {
  width: 88px;
  height: 88px;
  margin-bottom: 22px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mobile-web__brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.mobile-web__title {
  font-family: var(--font-main);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: var(--font-weight-semibold);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 12px;
}

.mobile-web__text {
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0 0 28px;
  max-width: 360px;
}

.mobile-web__phone {
  position: absolute;
  right: 72px;
  bottom: 0;
  z-index: 2;
  width: 350px;
  transform: translateY(42%);
  pointer-events: none;
  filter: drop-shadow(0 24px 40px rgba(15, 23, 42, 0.2));
}

.mobile-web__phone img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 1100px) {
  .mobile-web__card {
    height: 440px;
    padding: 40px 300px 40px 48px;
    border-radius: 40px;
  }

  .mobile-web__phone {
    right: 48px;
    width: 300px;
    transform: translateY(38%);
  }
}

@media (max-width: 900px) {
  .mobile-web__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    padding: 40px 28px 0;
    text-align: center;
  }

  .mobile-web__content {
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }

  .mobile-web__text {
    max-width: 420px;
  }

  .mobile-web__phone {
    position: relative;
    right: auto;
    bottom: auto;
    transform: none;
    width: min(64vw, 250px);
    margin: 0 auto -56px;
  }
}

@media (max-width: 560px) {
  .mobile-web__headline {
    margin-bottom: 20px;
  }

  .mobile-web__card {
    padding: 32px 16px 0;
    border-radius: 32px;
  }

  .mobile-web__brand {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
  }

  .mobile-web__brand img {
    width: 42px;
    height: 42px;
  }

  .mobile-web__phone {
    width: min(62vw, 210px);
    margin-bottom: -40px;
  }
}

/* === DEVICES === */
.devices {
  padding: var(--section-padding);
  background: transparent;
}

.devices__viewport {
  overflow: hidden;
  padding: 16px 0 28px;
}

.devices__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  will-change: transform;
}

.devices__track > .device-card {
  flex: 0 0 auto;
  min-width: 0;
  box-sizing: border-box;
}

.device-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 0;
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: visible;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.device-card.is-dropdown-open {
  z-index: 50;
}

.device-card:hover {
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.device-card__media {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.device-card__tags {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
}

.device-card__tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1.2;
}

.device-card__image {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  display: block;
  overflow: hidden;
}

.device-card__image::after {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  background: var(--border);
  border-radius: 12px;
  margin: 24px auto;
}

.device-card__image:has(img)::after {
  display: none;
}

.device-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.device-card__title {
  font-family: var(--font-main);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  margin: 0 24px 6px;
  color: var(--text);
  line-height: var(--line-height-tight);
}

.device-card__desc {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 24px 20px;
  line-height: var(--line-height-body);
  flex: 1;
}

.device-card__spec {
  margin: 0 24px 20px;
  padding: 0;
  list-style: none;
  font-family: var(--font-main);
  font-size: var(--font-size-caption);
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}
.device-card__spec li {
  margin-bottom: 2px;
}
.device-card__spec li:last-child {
  margin-bottom: 0;
}

.device-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px 24px;
}

.device-card__link {
  display: inline-block;
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  background: var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.device-card__link:hover {
  background: var(--text-light);
  color: var(--text);
}

.device-card__dropdown {
  position: relative;
}

.device-card__dropdown-btn {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: #fff;
  background: var(--accent);
  border: none;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.device-card__dropdown-btn:hover {
  background: var(--accent-dark);
  color: #fff;
}

.device-card__dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin: 0 0 8px;
  padding: 8px 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  list-style: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 100;
}

.device-card__dropdown.is-open .device-card__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.device-card__dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.device-card__dropdown-menu a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.device-card__menu-logo {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.device-card__menu-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.devices__slider-wrap {
  position: relative;
  max-width: 1400px;
  margin: 0 auto 56px;
  padding: 0 64px;
}

.devices__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.devices__nav-btn--prev { left: 0; }
.devices__nav-btn--next { right: 0; }
.devices__nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.devices__nav-btn svg { flex-shrink: 0; }

.devices__nav {
  display: contents;
}

.devices__cta {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.devices__cta p {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

/* === ZIGBEE / INSTRUCTIONS === */
.zigbee {
  padding: var(--section-padding);
  background: transparent;
}

.zigbee__features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.zigbee__features--guides {
  grid-template-columns: repeat(2, 1fr);
  max-width: 760px;
  align-items: stretch;
}

.zigbee-feature {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px 28px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.zigbee-feature--link {
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.zigbee-feature--link:hover {
  border-color: var(--accent);
}

.zigbee-feature__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.zigbee-feature:hover {
  border-color: var(--accent);
}

.zigbee-feature h4 {
  font-family: var(--font-main);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 12px;
  color: var(--text);
}

.zigbee-feature p {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: var(--line-height-body);
  flex: 1;
}

.zigbee-feature a,
.protocol-card__link {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--accent);
  transition: color 0.2s;
}

.zigbee-feature a:hover,
.protocol-card__link:hover,
.zigbee-feature--link:hover .protocol-card__link {
  color: var(--accent-dark);
}

@media (max-width: 960px) {
  .zigbee__features--guides {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

/* === FOOTER === */
.footer {
  background: var(--text);
  color: #d4d4d8;
  padding: 44px 24px 22px;
  border-top-left-radius: clamp(40px, 6vw, 80px);
  border-top-right-radius: clamp(40px, 6vw, 80px);
}

.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 0.8fr)) minmax(0, 0.85fr);
  gap: 28px 36px;
  align-items: start;
}

.footer__col {
  min-width: 0;
}

.footer__title {
  margin: 0 0 4px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
  color: #fff;
}

.footer__legal-name {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.4;
  color: #71717a;
}

.footer__col--company p {
  margin: 0 0 5px;
  font-family: var(--font-main);
  font-size: 12px;
  line-height: 1.5;
  color: #a1a1aa;
}

.footer__ids {
  margin-top: 2px !important;
  color: #71717a !important;
  font-size: 11px !important;
  letter-spacing: 0.01em;
}

.footer__col--company a {
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.2s;
}

.footer__col--company a:hover {
  color: var(--accent);
}

.footer__heading {
  margin: 2px 0 10px;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #71717a;
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer__nav a {
  font-family: var(--font-main);
  font-size: 12px;
  line-height: 1.35;
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.2s;
}

.footer__nav a:hover {
  color: #fff;
}

.footer__col--brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 0;
  text-decoration: none;
}

.footer__logo-img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  opacity: 0.95;
}

.footer__logo-text {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.footer__logo:hover .footer__logo-img {
  opacity: 1;
}

.footer__brand-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #52525b;
  max-width: 180px;
}

.footer__ext {
  font-size: 12px;
  color: #71717a;
  text-decoration: none;
  transition: color 0.2s;
}

.footer__ext:hover {
  color: var(--accent);
}

.footer__bottom {
  max-width: 1400px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer__copyright {
  font-family: var(--font-main);
  font-size: 11px;
  color: #71717a;
  margin: 0;
  text-align: left;
  flex-shrink: 0;
}

.footer__pdn {
  margin: 0;
  font-family: var(--font-main);
  font-size: 11px;
  line-height: 1.5;
  color: #52525b;
  max-width: 720px;
}

.footer__pdn a {
  color: #71717a;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.footer__pdn a:hover {
  color: #a1a1aa;
}

/* === PAGE — подстраницы (devices.html и др.) === */
.page {
  padding: 120px 24px 100px;
  background: var(--bg);
}

.page__inner {
  max-width: 900px;
  margin: 0 auto;
}

.breadcrumb {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin-bottom: 32px;
}

.breadcrumb a {
  color: var(--accent);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--accent-dark);
}

.breadcrumb__sep {
  margin: 0 8px;
  color: var(--text-light);
}

/* === CATALOG (devices.html — каталог с фильтрами) === */
.page--catalog .page__inner {
  max-width: 1400px;
}

.catalog-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.catalog-header__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.catalog-header__back:hover {
  background: var(--bg);
  color: var(--accent);
}

.catalog-header__title {
  font-family: var(--font-main);
  font-size: var(--font-size-page);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin: 0;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

.catalog-hero__lead {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: var(--line-height-body);
  padding-left: 56px;
}

.catalog-chips-wrap {
  margin-bottom: 20px;
}

.catalog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.catalog-chip {
  font-family: var(--font-main);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.catalog-chip:hover {
  border-color: var(--text-light);
  background: #e2e8f0;
}

.catalog-chip--active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.catalog-chip--active:hover {
  background: var(--text-muted);
  border-color: var(--text-muted);
  color: #fff;
}

.catalog-dropdowns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.catalog-dropdown {
  position: relative;
}

.catalog-dropdown__icon {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  color: var(--text-muted);
  vertical-align: middle;
}

.catalog-dropdown__btn {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 24px 8px 0;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.catalog-dropdown__btn:hover {
  color: var(--accent);
}

.catalog-dropdown__btn::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  border: 5px solid transparent;
  border-top-color: currentColor;
  border-bottom: none;
  vertical-align: middle;
  opacity: 0.7;
}

.catalog-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 6px 0 0;
  min-width: 200px;
  padding: 8px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  list-style: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

.catalog-dropdown__menu[hidden] {
  display: none;
}

.catalog-dropdown__menu li {
  padding: 10px 18px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.catalog-dropdown__menu li:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.catalog-reset {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: 8px 0;
  transition: color 0.2s;
}

.catalog-reset:hover {
  color: var(--accent);
}

.catalog-count {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.catalog-card {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.catalog-card--hidden {
  display: none;
}

.catalog-card .device-card__type {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 24px 4px;
  font-weight: 400;
}

.page__content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 48px 40px;
  border: 1px solid var(--border);
}

.page__title {
  font-family: var(--font-main);
  font-size: var(--font-size-page);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin: 0 0 16px;
  line-height: var(--line-height-tight);
}

.page__lead {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 0 40px;
  line-height: var(--line-height-body);
}

.devices-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.devices-group__title {
  font-family: var(--font-main);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin: 0 0 8px;
}

.devices-group__desc {
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: var(--line-height-body);
}

.devices-table-wrap {
  margin: 24px 0 8px;
  width: 100%;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 768px) {
  .devices-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.devices-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-family: var(--font-main);
  font-size: var(--font-size-body-sm);
}

.devices-table th,
.devices-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.devices-table tbody tr:last-child td {
  border-bottom: none;
}

.devices-table th {
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  background: var(--bg);
  white-space: nowrap;
}

.devices-table td {
  color: var(--text-muted);
}

.devices-table td:first-child {
  font-weight: var(--font-weight-medium);
  color: var(--text);
  white-space: nowrap;
}

.devices-table td:last-child {
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}

.devices-table__buy {
  position: relative;
  overflow: visible;
}

.devices-table .device-card__dropdown {
  display: inline-block;
}

.devices-table .device-card__dropdown-btn {
  padding: 8px 14px;
  font-size: 14px;
}

.devices-table .device-card__dropdown-menu {
  bottom: auto;
  top: 100%;
  left: auto;
  right: 0;
  margin: 8px 0 0;
  z-index: 40;
}

.devices-table tr.is-dropdown-open {
  position: relative;
  z-index: 50;
}

.devices-table tr.is-dropdown-open td {
  background: var(--accent-soft);
}

.devices-table__group th {
  padding: 22px 18px 12px;
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: normal;
}

.devices-table tbody tr:not(.devices-table__group):hover td {
  background: var(--accent-soft);
}

.devices-list__gateways {
  margin: 0;
  padding-left: 24px;
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
}

.devices-list__gateways li {
  margin-bottom: 8px;
}

.page__cta {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.page__cta p {
  margin: 0;
  font-size: 17px;
  color: var(--text-muted);
}

.page__cta p a {
  color: var(--accent);
}

.page__cta .btn {
  color: #fff;
}

.page__cta .btn:hover {
  color: #fff;
}

/* === RESPONSIVE === */

/* ---- Tablet (≤1024px) ---- */
@media (max-width: 1024px) {
  /* Header: hide nav, show burger, compact layout */
  .header__nav {
    display: none !important;
    flex: none;
  }
  .header__burger { display: flex; }
  .header__auth-btn,
  .header__auth-link { display: none; }
  .header__menu-overlay,
  .header__menu { display: flex; }
  .header--menu-open .header__menu-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .header--menu-open .header__menu {
    transform: translateX(0);
  }

  .header__pill {
    padding: 14px 16px;
    gap: 12px;
  }
  .header__right {
    margin-left: auto;
    gap: 8px;
  }

  /* Sections */
  .protocols {
    width: auto;
    left: auto;
    margin-left: 0;
    margin-top: 100px;
    margin-bottom: 0;
    padding: 0 24px 100px 24px;
  }
  .architecture-protocols .protocols,
  .protocols.protocols--nested {
    width: 100%;
    margin-top: 32px;
    padding: 0;
  }
  .protocols--nested .protocols__inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .architecture-protocols .protocols__content,
  .protocols--nested .protocols__content {
    padding: 40px 24px;
  }
  .protocols__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    width: 100%;
    margin: 0;
  }
  .protocols__inner { min-height: 0; }
  .protocols__content { padding-top: 48px; padding-bottom: 48px; }
  .protocols__visual {
    order: -1;
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
    min-height: 360px;
  }
  .protocols__image {
    position: relative;
    height: auto;
    min-height: 360px;
    aspect-ratio: 16/9;
    border-radius: 0;
    background: var(--bg);
    width: 100%;
  }

  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .app-features__grid { grid-template-columns: repeat(2, 1fr); }
  .app-ways__grid { grid-template-columns: 1fr; }

  .solutions__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Small tablet / large phone (≤900px) ---- */
@media (max-width: 900px) {
  :root {
    --section-padding: 64px 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    width: 100%;
  }
  .hero__image { min-height: 360px; }
  .hero__image--mockup img {
    max-width: 88%;
    max-height: 85%;
  }
  .hero__content {
    padding: 40px 24px 48px;
    max-width: 100%;
    height: auto;
    align-items: stretch;
  }
  .hero__title { max-width: 100%; }
  .hero__subtitle { max-width: 100%; }
  .section-title { font-size: clamp(24px, 5vw, 40px); margin-bottom: 20px; }
  .section-subtitle { font-size: var(--font-size-body); margin-bottom: 32px; }

  .protocols { padding: 0 20px 64px 20px; }
  .protocols__visual { margin-left: -20px; margin-right: -20px; width: calc(100% + 40px); }
  .hero {
    padding: 0;
  }
}

/* ---- Phone (≤768px) ---- */
@media (max-width: 768px) {
  .header {
    padding: 15px 15px;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .header__pill {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 14px;
    box-sizing: border-box;
  }
  .header__right {
    gap: 8px;
  }
  .header__logo {
    font-size: 18px;
    gap: 8px;
  }
  .header__logo-img {
    height: 30px;
    width: 30px;
    max-width: none;
  }
  .header__logo-text { font-size: 16px; }
  .header__icon {
    width: 36px;
    height: 36px;
  }
  .header__burger {
    width: 38px;
    height: 38px;
  }

  /* Hero */
  .hero {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  .hero__image { min-height: 300px; }
  .hero__content {
    padding: 28px 16px 24px;
    max-width: 100%;
  }
  .hero__title { font-size: clamp(22px, 5vw, 32px); max-width: 100%; margin-bottom: 16px; }
  .hero__subtitle { font-size: 16px; margin-bottom: 24px; max-width: 100%; }
  .btn--hero {
    align-self: stretch;
    text-align: center;
  }

  /* Solutions */
  .selector {
    width: 100%;
    display: flex;
  }
  .selector__btn { flex: 1; padding: 10px 8px; font-size: 14px; }
  .solutions__grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    gap: 16px;
    grid-template-columns: unset;
    padding: 16px 0 28px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .solutions__grid::-webkit-scrollbar {
    display: none;
  }

  .solution-card {
    flex: 0 0 85%;
    min-width: 280px;
    max-width: 320px;
    scroll-snap-align: start;
    aspect-ratio: 3 / 4;
  }

  .solutions__slider-wrap { position: relative; }
  .solutions__nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
  }
  .solutions__nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }
  .solutions__nav-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  .solutions__nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .solutions__nav-btn svg { flex-shrink: 0; }

  /* Grids to 1 column */
  .features__grid,
  .protocols__grid,
  .app-features__grid {
    grid-template-columns: 1fr;
  }
  .zigbee__features { grid-template-columns: 1fr; }
  .zigbee__features--guides { grid-template-columns: 1fr; }

  /* App section */
  .app-buttons { flex-direction: column; }
  .app-mockup { margin-bottom: 48px; }
  .app-mockup__title { font-size: 20px; }
  .app-mockup__lead { font-size: 15px; margin-bottom: 24px; }

  /* Device cards */
  .device-card__title { font-size: 16px; margin: 0 16px 4px; }
  .device-card__desc { font-size: 14px; margin: 0 16px 16px; }
  .device-card__spec { font-size: 13px; margin: 0 16px 16px; }
  .device-card__actions { padding: 0 16px 16px; gap: 8px; }
  .device-card__link,
  .device-card__dropdown-btn { font-size: 14px; padding: 8px 16px; }

  /* Devices slider — mobile */
  .devices__slider-wrap {
    padding: 0;
  }
  .devices__track {
    gap: 16px;
  }
  .devices__nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
  }
  .devices__nav-btn {
    position: static;
    transform: none;
  }

  /* Footer */
  .footer { padding: 36px 20px 20px; }
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 22px 20px;
  }
  .footer__col--company {
    grid-column: 1 / -1;
  }
  .footer__col--brand {
    align-items: flex-start;
  }
  .footer__bottom {
    margin-top: 22px;
    flex-direction: column;
    gap: 6px;
  }

  /* Catalog page */
  .page { padding: 80px 16px 60px; }
  .page__content { padding: 28px 16px; }
  .catalog-hero__lead { padding-left: 0; font-size: 15px; }
  .catalog-header { margin-bottom: 8px; }
  .catalog-chips { gap: 8px; }
  .catalog-chip { padding: 8px 14px; font-size: 13px; }
  .catalog-dropdowns {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .catalog-reset { margin-left: 0; }
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Tables */
  .devices-table th,
  .devices-table td {
    padding: 10px 12px;
    font-size: 14px;
  }
  .devices-table-wrap { overflow-x: auto; }
}

/* ---- Small phone (≤480px) ---- */
@media (max-width: 480px) {
  :root {
    --section-padding: 48px 16px;
  }

  .header { padding: 8px 8px; }
  .header__pill { padding: 8px 12px; }
  .header__logo { font-size: 16px; gap: 6px; }
  .header__logo-img { height: 26px; width: 26px; max-width: none; }
  .header__logo-text { font-size: 13px; }
  .header__right { gap: 6px; }

  .protocols { padding: 0 16px 48px 16px; }
  .protocols__visual { margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); }
  .hero { padding: 0; }

  .hero__image { min-height: 200px; }
  .hero__content { padding: 28px 16px 24px; }
  .hero__title { font-size: 22px; margin-bottom: 16px; }
  .hero__subtitle { font-size: 15px; line-height: 1.5; margin-bottom: 20px; }

  .section-title { font-size: 22px; }
  .section-subtitle { font-size: 16px; }

  .solution-card__body { padding: 16px 16px 20px; }
  .solution-card__title { font-size: 17px; }
  .solution-card__text { font-size: 14px; }
  .solution-card__btn { padding: 10px 18px; font-size: 14px; }
  .solutions__grid .solution-card { flex: 0 0 90%; min-width: 260px; }

  .feature-card { padding: 24px 20px; }
  .feature-card__title { font-size: 19px; }
  .feature-card__text { font-size: 15px; }

  .page { padding: 72px 12px 48px; }
  .catalog-header__title { font-size: 22px; }

  .footer { padding: 32px 16px 20px; }
  .footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .footer__col--company { grid-column: auto; }
  .footer__nav a { font-size: 14px; }
  .footer__copyright { font-size: 13px; }
  .footer__pdn { font-size: 12px; }
}

/* === Scroll reveal (index) === */
body.scroll-reveal--enabled .scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

body.scroll-reveal--enabled .scroll-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  body.scroll-reveal--enabled .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}

/* === Anchor scroll offset (fixed header) === */
#architecture,
#how-it-works,
#use-cases,
#devices,
#instructions,
#faq {
  scroll-margin-top: 96px;
}

/* === Architecture === */
.architecture {
  padding: var(--section-padding);
  max-width: 1400px;
  margin: 0 auto;
}

.architecture-sub {
  margin-bottom: 56px;
}

.architecture-sub:last-child {
  margin-bottom: 0;
}

/* === Schematic diagrams === */
.schematic {
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.schematic img,
.schematic svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.schematic--wide {
  max-width: 100%;
}

.schematic--narrow {
  max-width: 440px;
}

.schematic--portrait {
  max-width: 960px;
}

/* === System stack diagram (3 levels, interactive accordion) === */
.system-stack__lead {
  margin: 0 auto 48px;
  max-width: 640px;
  text-align: center;
  font-size: var(--font-size-body);
  color: var(--text-light);
  line-height: var(--line-height-body);
}

.system-stack {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}

.system-stack__line {
  position: absolute;
  top: 0;
  height: 0;
  left: 11px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(14, 159, 233, 0.35),
    rgba(14, 159, 233, 0.08)
  );
  pointer-events: none;
  z-index: 0;
  transition: height 0.4s ease;
}

.system-stack__row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding: 36px 0;
  border-top: 1px solid rgba(24, 24, 27, 0.06);
  transition: opacity 0.35s ease;
}

.system-stack__row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.system-stack__row:last-of-type {
  padding-bottom: 0;
}

.system-stack:has(.system-stack__row.is-open) .system-stack__row:not(.is-open) {
  opacity: 0.45;
}

.system-stack__level {
  flex: 1;
  min-width: 0;
}

.system-stack__trigger {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.system-stack__trigger:hover .system-stack__title {
  color: var(--accent-dark);
}

.system-stack__trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.system-stack__visual {
  flex: 0 0 auto;
  width: min(42%, 360px);
  align-self: flex-start;
  padding-top: 8px;
  opacity: 0.92;
  transition: opacity 0.35s ease;
}

.system-stack__row.is-open .system-stack__visual {
  opacity: 1;
}

.system-stack__visual--wide {
  width: min(40%, 420px);
}

.system-stack__visual img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.system-stack__visual--hardware img {
  mix-blend-mode: screen;
}

.system-stack__visual--stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.system-stack__visual--stack .system-stack__visual-photo,
.system-stack__visual-photo {
  mix-blend-mode: normal;
  width: 100%;
  border-radius: 12px;
}

.system-stack__row[data-level="upper"] .system-stack__visual {
  width: min(52%, 560px);
}

.system-stack__row[data-level="middle"] .system-stack__visual {
  width: min(38%, 300px);
}

.system-stack__row[data-level="lower"] .system-stack__visual {
  width: min(44%, 400px);
}

.system-stack__track {
  position: relative;
  z-index: 1;
  flex: 0 0 24px;
  display: flex;
  justify-content: center;
  align-self: flex-start;
  padding-top: 14px;
}

.system-stack__node {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--bg);
  box-sizing: border-box;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.system-stack__row.is-open .system-stack__node {
  background: var(--accent);
  transform: scale(1.15);
}

.system-stack__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 10px;
}

.system-stack__index {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  display: inline;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.system-stack__row.is-open .system-stack__index {
  background: transparent;
  color: var(--accent-dark);
}

.system-stack__head-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.system-stack__title {
  margin: 0;
  display: block;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  transition: color 0.25s ease;
}

.system-stack__hint {
  margin: 0;
  display: block;
  font-size: var(--font-size-body-sm);
  color: var(--text-light);
  font-weight: var(--font-weight-regular);
}

.system-stack__chevron {
  display: none;
}

.system-stack__text {
  margin: 0;
  max-width: 34em;
  font-size: var(--font-size-body);
  color: var(--text-muted);
  line-height: 1.65;
}

.system-stack__panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
  transition:
    grid-template-rows 0.4s ease,
    opacity 0.3s ease;
}

.system-stack__row.is-open .system-stack__panel {
  grid-template-rows: 1fr;
  opacity: 1;
  border: none;
  pointer-events: auto;
}

.system-stack__panel-inner {
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.system-stack__row.is-open .system-stack__panel-inner {
  padding: 28px 0 4px;
}

.system-stack__details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}

.system-stack__panel-text {
  margin: 0 0 20px;
  max-width: 36em;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-body);
}

.system-stack__details--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  row-gap: 24px;
}

.system-stack__details li {
  display: grid;
  gap: 6px;
  padding: 0;
  padding-left: 0;
  position: relative;
}

.system-stack__details li::before {
  display: none;
}

.system-stack__details strong {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  letter-spacing: -0.01em;
}

.system-stack__details span {
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: 1.55;
}

.system-stack__gateway-types {
  display: grid;
  gap: 20px;
}

.system-stack__gateway-type {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.system-stack__gateway-type + .system-stack__gateway-type {
  padding-top: 20px;
  border-top: 1px solid rgba(24, 24, 27, 0.06);
}

.system-stack__gateway-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--accent-dark);
  background: linear-gradient(160deg, rgba(14, 159, 233, 0.12) 0%, rgba(14, 159, 233, 0.05) 100%);
  box-shadow: inset 0 0 0 1px rgba(14, 159, 233, 0.1);
}

.system-stack__gateway-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.system-stack__gateway-type strong {
  display: block;
  margin: 0 0 5px;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.system-stack__gateway-type p {
  margin: 0;
  max-width: 38em;
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
  color: var(--text-muted);
}

.system-stack__details--links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  column-gap: 32px;
}

.system-stack__details--links li {
  padding: 16px 0;
  border-top: 1px solid rgba(24, 24, 27, 0.06);
}

.system-stack__details--links li:nth-child(-n+2) {
  border-top: none;
  padding-top: 0;
}

.system-stack__details--links a {
  display: grid;
  gap: 6px;
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: color 0.2s ease;
}

.system-stack__details--links a:hover strong {
  color: var(--accent-dark);
}

.system-stack__details--links a:hover {
  border: none;
  background: transparent;
  transform: none;
}

.system-stack__details--links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.system-stack__table-wrap {
  overflow-x: auto;
  border: none;
  border-radius: 0;
  background: transparent;
}

.system-stack__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
}

.system-stack__table th,
.system-stack__table td {
  padding: 14px 0;
  padding-right: 28px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(24, 24, 27, 0.06);
  background: transparent;
}

.system-stack__table th {
  padding-top: 0;
  padding-bottom: 10px;
  color: var(--text-light);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
}

.system-stack__table td:first-child {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.system-stack__table tr:last-child td {
  border-bottom: none;
  padding-bottom: 0;
}

.system-stack__note {
  margin: 24px 0 0;
  padding: 0;
  max-width: 36em;
  border-radius: 0;
  background: transparent;
  font-size: var(--font-size-body-sm);
  color: var(--text-light);
  line-height: 1.6;
}

.system-stack__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 28px;
  padding-top: 0;
  border-top: none;
}

.system-stack__link {
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-medium);
  color: var(--accent-dark);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.system-stack__link:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .system-stack__lead {
    margin-bottom: 32px;
    font-size: var(--font-size-body-sm);
    text-align: left;
  }

  .system-stack__line,
  .system-stack__track {
    display: none;
  }

  .system-stack__row {
    flex-direction: column;
    gap: 20px;
    padding: 28px 0;
  }

  .system-stack__row + .system-stack__row {
    margin-top: 0;
  }

  .system-stack__trigger {
    padding: 0;
  }

  .system-stack__row.is-open .system-stack__panel-inner {
    padding: 22px 0 0;
  }

  .system-stack__visual {
    width: 100%;
    max-width: 260px;
    margin: 0;
    padding-top: 0;
  }

  .system-stack__row[data-level="upper"] .system-stack__visual,
  .system-stack__row[data-level="middle"] .system-stack__visual {
    max-width: 100%;
  }

  .system-stack__head {
    gap: 12px;
  }

  .system-stack__title {
    font-size: 22px;
  }

  .system-stack__text {
    font-size: var(--font-size-body-sm);
  }

  .system-stack__details--compact,
  .system-stack__details--links {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .system-stack__details--links li:nth-child(-n+2) {
    border-top: 1px solid rgba(24, 24, 27, 0.06);
    padding-top: 16px;
  }

  .system-stack__details--links li:first-child {
    border-top: none;
    padding-top: 0;
  }

  .system-stack:has(.system-stack__row.is-open) .system-stack__row:not(.is-open) {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .system-stack__panel,
  .system-stack__chevron,
  .system-stack__node,
  .system-stack__visual,
  .system-stack__row,
  .system-stack__line {
    transition: none;
  }
}

/* === Instruction guide pages === */
.page--guide .page__inner {
  max-width: 960px;
}

.guide {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.guide__section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.guide__heading {
  margin: 0 0 12px;
  font-family: var(--font-main);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.guide__subheading {
  margin: 24px 0 12px;
  font-family: var(--font-main);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.guide__lead {
  margin: 0 0 20px;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-body);
}

.guide__figure {
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  background: #f4f4f5;
}

.guide__figure img {
  display: block;
  width: 100%;
  height: auto;
}

.guide__figure--icons {
  max-width: 420px;
  background: #f8fafc;
}

.guide__figure--icons img {
  width: auto;
  max-width: 100%;
  margin: 16px auto;
}

.guide__figure figcaption {
  margin: 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #fff;
}

.guide__path {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: guide-path;
}

.guide__path li {
  counter-increment: guide-path;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: #fff;
  font-size: var(--font-size-body);
  color: var(--text);
}

.guide__path li::before {
  content: counter(guide-path);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.guide__path a {
  color: var(--text);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

.guide__path a:hover {
  color: var(--accent-dark);
}

.guide__toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 20px 0 0;
}

.guide__toc a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--text);
  text-decoration: none;
  background: #fff;
  transition: border-color 0.2s, color 0.2s;
}

.guide__toc a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.guide__section[id] {
  scroll-margin-top: 96px;
}

.guide__video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  background: #0f172a;
}

.guide__video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.guide__video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--font-size-body-sm);
}

.guide__video-placeholder p {
  margin: 0;
}

.guide__steps {
  margin: 0;
  padding-left: 1.25em;
  font-size: var(--font-size-body);
  color: var(--text-muted);
  line-height: var(--line-height-loose);
}

.guide__steps li + li {
  margin-top: 12px;
}

.guide__steps ul {
  margin: 10px 0 0;
  padding-left: 1.2em;
}

.guide__steps ul li + li {
  margin-top: 6px;
}

.guide__steps a {
  color: var(--accent);
  text-decoration: none;
}

.guide__steps a:hover {
  text-decoration: underline;
}

.guide__steps strong {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

.guide__more {
  margin: 24px 0 0;
  font-size: var(--font-size-body-sm);
}

.guide__more a {
  color: var(--accent);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.guide__more a:hover {
  text-decoration: underline;
}

.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.guide-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.guide-nav__link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .guide__section {
    padding: 24px 20px;
  }

  .guide-nav {
    flex-direction: column;
  }

  .guide-nav__link {
    justify-content: center;
  }
}

.how-it-works__schematic {
  max-width: 960px;
}

.architecture-sub .subsection-title {
  margin: 0 0 24px;
  text-align: center;
}

.architecture-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.architecture-level {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.architecture-level__title {
  font-family: var(--font-main);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin: 0 0 12px;
}

.architecture-level__text {
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-body);
  margin: 0;
}

.architecture-protocols {
  margin-bottom: 56px;
}

.architecture-protocols .protocols,
.protocols.protocols--nested {
  width: 100%;
  position: relative;
  left: auto;
  margin-left: 0;
  margin-top: 56px;
  margin-bottom: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: none;
}

.architecture-protocols .protocols::before,
.protocols.protocols--nested::before {
  display: none;
}

.protocols--nested .protocols__inner {
  max-width: none;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 0;
  min-height: 440px;
}

.architecture-protocols .protocols__content,
.protocols--nested .protocols__content {
  padding: 56px 48px 56px 56px;
  max-width: none;
}

.architecture-protocols .protocols__title,
.protocols--nested .protocols__title {
  font-size: clamp(24px, 2.5vw, 36px);
}

.architecture-protocols .protocols__lead,
.protocols--nested .protocols__lead {
  margin-bottom: 44px;
}

.architecture-protocols .protocols__visual,
.protocols--nested .protocols__visual {
  min-height: 440px;
  background: var(--bg-tint);
}

.architecture-protocols .protocols__image,
.protocols--nested .protocols__image {
  position: absolute;
  inset: 0;
  min-height: 100%;
}

.architecture-protocols .protocols__image-img,
.protocols--nested .protocols__image-img {
  object-fit: cover;
  object-position: center;
}

.architecture-terms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.architecture-term {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.architecture-term__title {
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 10px;
  color: var(--text);
}

.architecture-term__text {
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-body);
  margin: 0;
}

.architecture-tree {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.architecture-tree__lead {
  margin: 0 0 24px;
  font-size: var(--font-size-body-sm);
  color: var(--text);
}

.architecture-tree__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.architecture-tree__col h4 {
  margin: 0 0 8px;
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
}

.architecture-tree__objects {
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  margin: 0 0 12px;
}

.architecture-tree__zones {
  margin: 0;
  padding-left: 18px;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-loose);
}

.architecture-tree__zones li + li {
  margin-top: 8px;
}

.architecture-sub--upper .section-subtitle {
  margin-bottom: 32px;
}

/* === Cloud tree (interactive hierarchy) === */
.cloud-tree {
  width: 100%;
  max-width: 100%;
}

.cloud-tree__glossary {
  display: none;
}

.cloud-tree__type-def {
  padding: 16px 18px;
  margin-bottom: 20px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.cloud-tree__type-text {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.55;
}

.cloud-tree__type-text strong {
  color: var(--accent);
  font-weight: var(--font-weight-semibold);
}

.cloud-tree__detail-body {
  flex: 0 0 auto;
}

.cloud-tree__nav.is-hidden {
  display: none;
}

.cloud-tree__panel--zone-open,
.cloud-tree__panel--object-open,
.cloud-tree__panel--app-open {
  padding: 0;
}

.cloud-tree__panel--app-open .zone-ui,
.cloud-tree__panel--zone-open .zone-ui,
.cloud-tree__panel--object-open .object-ui {
  border: none;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}

.cloud-tree__zone-app,
.cloud-tree__object-app {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: cloudZoneIn 0.35s ease;
  min-width: 0;
}

.cloud-tree__zone-app.is-hidden,
.cloud-tree__object-app.is-hidden {
  display: none;
}

.cloud-tree__layout--app-open,
.cloud-tree__layout--zone-open {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

/* === Zone UI (interactive demo) === */
.zone-ui {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 18px 18px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 20px;
  min-width: 0;
}

.zone-ui__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin: 0;
  padding: 2px 0;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: #0ea5e9;
  cursor: pointer;
}

.zone-ui__back:hover {
  opacity: 0.8;
}

.zone-ui__back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.zone-ui__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zone-ui__header-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: #8b8b93;
}

.zone-ui__breadcrumb {
  margin: 0;
}

.zone-ui__updated {
  margin: 0;
  white-space: nowrap;
  font-size: 12px;
}

.zone-ui__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.zone-ui__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #18181b;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.zone-ui__id {
  font-size: 12px;
  color: #71717a;
  background: #f4f4f5;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #e4e4e7;
}

.zone-ui__status {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  padding: 5px 12px;
  border-radius: 999px;
}

.zone-ui__status--ok {
  color: #16a34a;
  background: #e8f8ee;
}

.zone-ui__status--off {
  color: #71717a;
  background: #f4f4f5;
}

.zone-ui__status--alarm {
  color: #dc2626;
  background: #fde8e8;
}

.zone-ui__panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.zone-ui__panel.is-active {
  display: flex;
  animation: cloudZoneShot 0.25s ease;
}

.zone-ui__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.zone-ui__metric {
  padding: 16px 18px;
  background: #e8f6fd;
  border: 1px solid #d7eef9;
  border-radius: 18px;
}

.zone-ui__metric--alarm {
  background: #fde8e8;
  border-color: #f7c8c8;
}

.zone-ui__metric--alarm .zone-ui__metric-icon {
  color: #dc2626;
}

.zone-ui__metric--alarm .zone-ui__metric-icon--co {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.zone-ui__metric--off {
  background: #f4f4f5;
  border-color: #e4e4e7;
}

.zone-ui__metric--off .zone-ui__metric-icon {
  color: #71717a;
}

.zone-ui__metric-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.zone-ui__metric-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #0ea5e9;
}

.zone-ui__metric-icon--co {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 28px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.zone-ui__metric-label {
  display: block;
  font-size: 13px;
  color: #71717a;
  text-transform: lowercase;
}

.zone-ui__metric-value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.zone-ui__metric-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #18181b;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.zone-ui__metric-value small {
  font-size: 16px;
  font-weight: 500;
  color: #71717a;
}

.zone-ui__metric-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
}

.zone-ui__metric-status--alarm {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
}

.zone-ui__metric-status--off {
  color: #71717a;
  background: rgba(113, 113, 122, 0.12);
}

.zone-ui__metric-norm {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #a1a1aa;
}

.zone-ui__status.is-hidden {
  display: none;
}

.zone-ui__period {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zone-ui__period-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #3f3f46;
}

.zone-ui__range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.zone-ui__range-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 100%;
}

.zone-ui__dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.zone-ui__date-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #71717a;
}

.zone-ui__input--date {
  width: 148px;
  padding: 9px 12px;
  font-size: 13px;
}

.zone-ui__select {
  min-width: 168px;
  padding: 9px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  font-family: var(--font-main);
  font-size: 13px;
  color: #71717a;
  background: #fff;
}

.zone-ui__pill {
  padding: 8px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-main);
  font-size: 13px;
  color: #71717a;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zone-ui__pill:hover {
  border-color: #0ea5e9;
  color: #0ea5e9;
}

.zone-ui__pill.is-active {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
}

.zone-ui__export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 18px;
}

.zone-ui__export-text {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.zone-ui__export-icon {
  flex: 0 0 auto;
  display: inline-flex;
}

.zone-ui__export-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.zone-ui__export-copy strong {
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
}

.zone-ui__export-copy span {
  font-size: 13px;
  color: #71717a;
}

.zone-ui__chart-wrap {
  padding: 14px 16px 16px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.zone-ui__chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.zone-ui__chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
}

.zone-ui__chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #71717a;
}

.zone-ui__legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 10px;
}

.zone-ui__chart {
  width: 100%;
  height: 160px;
  display: block;
}

.zone-ui__chart-grid {
  stroke: #ececef;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.zone-ui__chart-line {
  fill: none;
  stroke: #0ea5e9;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  transition: d 0.4s ease;
}

.zone-ui__chart-area {
  stroke: none;
  fill: rgba(14, 165, 233, 0.14);
  transition: d 0.4s ease;
}

.zone-ui__toast {
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border-radius: 16px;
}

.zone-ui__toast.is-hidden {
  display: none;
}

.zone-ui__btn {
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.zone-ui__btn--primary {
  background: #0ea5e9;
  color: #fff;
}

.zone-ui__btn--primary:hover {
  background: #0284c7;
}

.zone-ui__btn--outline {
  background: #fff;
  color: #0ea5e9;
  border: 1px solid #0ea5e9;
}

.zone-ui__btn--ghost {
  background: transparent;
  color: #0ea5e9;
  padding: 4px 0;
  font-size: 14px;
}

.zone-ui__btn--save {
  align-self: flex-start;
  margin-top: 8px;
}

.zone-ui__card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.zone-ui__form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.zone-ui__form-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #18181b;
}

.zone-ui__edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: #0ea5e9;
  cursor: pointer;
}

.zone-ui__edit-btn:hover {
  opacity: 0.85;
}

.zone-ui__edit-icon {
  flex: 0 0 auto;
}

.zone-ui__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: #71717a;
}

.zone-ui__field > span {
  display: block;
  line-height: 1.3;
}

.zone-ui__field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
}

.zone-ui__field-row .zone-ui__input,
.zone-ui__threshold-fields .zone-ui__input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.zone-ui__input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  font-family: var(--font-main);
  font-size: 15px;
  color: #18181b;
  background: #fff;
}

.zone-ui__input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.zone-ui__input[type="number"]::-webkit-outer-spin-button,
.zone-ui__input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.zone-ui__input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.zone-ui__input--sm {
  width: 64px;
  padding: 8px 10px;
  text-align: center;
}

.zone-ui__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.zone-ui__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #3f3f46;
  cursor: pointer;
}

.zone-ui__params-title {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: #18181b;
}

.zone-ui__params-table {
  margin: 0;
  padding: 0;
  list-style: none;
}

.zone-ui__param-row {
  display: grid;
  grid-template-columns: 1fr 72px 28px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f1f3;
}

.zone-ui__param-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.zone-ui__param-name {
  font-size: 14px;
  color: #18181b;
}

.zone-ui__param-unit {
  font-size: 14px;
  color: #71717a;
}

.zone-ui__param-menu {
  justify-self: end;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #a1a1aa;
  font-size: 18px;
  line-height: 1;
  cursor: default;
}

.zone-ui__notify-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 16px;
  align-items: stretch;
}

.zone-ui__notify-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 92px;
  padding: 14px 16px;
  background: #fafafa;
  border: 1px solid #f1f1f3;
  border-radius: 18px;
  box-sizing: border-box;
}

.zone-ui__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #a1a1aa;
}

.zone-ui__switch {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  column-gap: 12px;
  cursor: pointer;
}

.zone-ui__switch-text {
  grid-column: 2;
  grid-row: 1;
  font-size: 14px;
  font-weight: 500;
  color: #18181b;
  line-height: 1.35;
}

.zone-ui__notify-box > .zone-ui__hint {
  margin-left: 58px;
}

.zone-ui__notify-box--color > .zone-ui__hint {
  margin-left: 0;
}

.zone-ui__switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.zone-ui__switch-ui {
  grid-column: 1;
  grid-row: 1;
  width: 46px;
  height: 26px;
  background: #d4d4d8;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.zone-ui__switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.zone-ui__switch input:checked + .zone-ui__switch-ui {
  background: #0ea5e9;
}

.zone-ui__switch input:checked + .zone-ui__switch-ui::after {
  transform: translateX(20px);
}

.zone-ui__switch input:disabled + .zone-ui__switch-ui {
  opacity: 0.55;
}

.zone-ui__notify-box--color .zone-ui__field--color {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.zone-ui__notify-box--color .zone-ui__field--color > span {
  flex: 1;
  min-height: 0;
  font-size: 14px;
  font-weight: 500;
  color: #18181b;
}

.zone-ui__field--color .zone-ui__color {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.zone-ui__field--color .zone-ui__color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.zone-ui__field--color .zone-ui__color::-webkit-color-swatch {
  border: none;
  border-radius: 9px;
}

.zone-ui__field--color .zone-ui__color::-moz-color-swatch {
  border: none;
  border-radius: 9px;
}

.zone-ui__thresholds {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zone-ui__threshold-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zone-ui__threshold-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zone-ui__threshold-name {
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
  text-transform: lowercase;
}

.zone-ui__threshold-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
}

.zone-ui__threshold-fields .zone-ui__field {
  margin: 0;
}

.zone-ui__threshold-fields .zone-ui__field > span {
  min-height: 0;
}

.zone-ui__field-row .zone-ui__field > span {
  min-height: 2.6em;
}

.zone-ui__btn--save.is-hidden,
.zone-ui__toast.is-hidden {
  display: none;
}

.cloud-tree__zone-wrap {
  display: flex;
  align-items: stretch;
  margin: 3px 0;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.cloud-tree__zone-wrap .cloud-tree__row {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.cloud-tree__zone-wrap.is-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(14, 159, 233, 0.35);
}

.cloud-tree__zone-wrap.is-active .cloud-tree__row {
  background: transparent;
  box-shadow: none;
}

.cloud-tree__zone-wrap.is-active .cloud-tree__row:hover {
  background: transparent;
}

.cloud-tree__zone-wrap.is-active .cloud-tree__status {
  display: none;
}

.cloud-tree__zone-open {
  display: none;
  flex-shrink: 0;
  align-self: center;
  margin: 0 10px 0 0;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.cloud-tree__zone-wrap.is-active .cloud-tree__zone-open {
  display: block;
}

.cloud-tree__zone-open:hover {
  background: rgba(14, 159, 233, 0.12);
}

.cloud-tree__zone-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cloud-tree__object-wrap {
  display: flex;
  align-items: stretch;
  margin: 3px 0;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.cloud-tree__object-wrap .cloud-tree__row {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.cloud-tree__object-wrap.is-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(14, 159, 233, 0.35);
}

.cloud-tree__object-wrap.is-active .cloud-tree__row {
  background: transparent;
  box-shadow: none;
}

.cloud-tree__object-wrap.is-active .cloud-tree__row:hover {
  background: transparent;
}

.cloud-tree__object-open {
  display: none;
  flex-shrink: 0;
  align-self: center;
  margin: 0 10px 0 0;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.cloud-tree__object-wrap.is-active .cloud-tree__object-open {
  display: block;
}

.cloud-tree__object-open:hover {
  background: rgba(14, 159, 233, 0.12);
}

.cloud-tree__object-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === Object UI === */
.object-ui {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
  overflow: visible;
}

.object-ui__back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin: 0;
  padding: 4px 0 2px;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--accent);
  cursor: pointer;
}

.object-ui__section {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.object-ui__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.object-ui__title {
  margin: 0;
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
}

.object-ui__id {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.object-ui__address {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.object-ui__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.object-ui__stat {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.object-ui__stat-value {
  display: block;
  font-size: 22px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

.object-ui__stat-value--ok { color: #15803d; }
.object-ui__stat-value--warn { color: #c2410c; }

.object-ui__stat-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.object-ui__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.object-ui__tab {
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.object-ui__tab.is-active {
  color: #fff;
  background: var(--accent);
}

.object-ui__panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.object-ui__panel.is-active {
  display: flex;
}

.object-ui__devices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.object-ui__device {
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.object-ui__device--off {
  opacity: 0.72;
}

.object-ui__device-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.object-ui__device-info {
  min-width: 0;
  flex: 1;
}

.object-ui__device-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-bottom: 2px;
}

.object-ui__device-name {
  font-weight: var(--font-weight-semibold);
  font-size: 13px;
  color: #111827;
  line-height: 1.25;
}

.object-ui__device-star {
  color: #eab308;
  font-size: 11px;
  line-height: 1;
}

.object-ui__device-id {
  font-size: 10px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 999px;
}

.object-ui__device-location {
  margin: 0 0 2px;
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-ui__device-model-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-bottom: 2px;
}

.object-ui__device-model {
  font-size: 11px;
  color: #4b5563;
}

.object-ui__device-time {
  margin: 0;
  font-size: 10px;
  color: #9ca3af;
}

.object-ui__device-status {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 1px;
}

.object-ui__device-battery {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  color: #16a34a;
}

.object-ui__device--off .object-ui__device-battery,
.object-ui__device--alarm .object-ui__device-battery {
  color: #6b7280;
}

.object-ui__device-battery svg {
  display: block;
  width: 14px;
  height: 9px;
}

.object-ui__device-signal {
  display: block;
  width: 12px;
  height: 10px;
  color: #4b5563;
}

.object-ui__device--off .object-ui__device-signal {
  color: #9ca3af;
}

.object-ui__device-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.object-ui__device-dot--alarm {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.object-ui__device-dot--off {
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}

.object-ui__device-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.object-ui__device-metric {
  padding: 8px 10px;
  background: #f5f5f5;
  border-radius: 12px;
  min-width: 0;
}

.object-ui__device-metric-label {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  color: #9ca3af;
  text-transform: lowercase;
}

.object-ui__device-metric-value {
  display: block;
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  color: #111827;
  line-height: 1.2;
}

.object-ui__empty {
  padding: 32px 16px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.object-ui__empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
  font-size: 24px;
  line-height: 48px;
}

.object-ui__empty-title {
  margin: 0 0 4px;
  font-weight: var(--font-weight-semibold);
}

.object-ui__empty-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.object-ui__problem-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.object-ui__problem {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
}

.object-ui__problem + .object-ui__problem {
  margin-top: 8px;
}

.object-ui__problem span {
  font-size: 12px;
  color: var(--text-muted);
}

.object-ui__problem p {
  margin: 6px 0 0;
  font-size: 13px;
}

.object-ui__charts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.object-ui__zones-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-main);
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}

.object-ui__range-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.object-ui__pill {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-main);
  font-size: 12px;
  cursor: pointer;
}

.object-ui__pill.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.object-ui__chart-block {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.object-ui__chart-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.object-ui__chart {
  display: block;
  width: 100%;
  height: 100px;
}

.object-ui__chart-grid {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.object-ui__chart-line {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.object-ui__btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.object-ui__btn--primary {
  color: #fff;
  background: var(--accent);
}

.object-ui__btn--ghost {
  background: transparent;
  color: var(--accent);
}

.object-ui__btn--save.is-hidden,
.object-ui__toast.is-hidden {
  display: none;
}

.object-ui__toast {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border-radius: var(--radius-sm);
}

.object-ui__form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.object-ui__form-title {
  margin: 0;
  font-size: 15px;
}

.object-ui__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.object-ui__input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 14px;
  background: var(--bg-card);
}

.object-ui__checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.object-ui__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.object-ui__scheme {
  position: relative;
  min-height: 280px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f3f4f6;
}

.object-ui__scheme-bg {
  position: absolute;
  inset: 0;
  background-color: #f3f4f6;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  filter: contrast(1.05);
}

.object-ui__scheme-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.object-ui__scheme-widgets {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.object-ui__scheme-widget {
  position: absolute;
  min-width: 108px;
  max-width: 140px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #22c55e;
  border-radius: 14px;
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  transform: translate(-50%, -50%);
}

.object-ui__scheme-widget--alarm {
  border-color: #ef4444;
}

.object-ui__scheme-widget--off {
  border-color: #94a3b8;
}

.object-ui__scheme-widget strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #111827;
}

.object-ui__scheme-widget span {
  display: block;
  color: #6b7280;
  line-height: 1.35;
}

@keyframes cloudZoneIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cloudZoneShot {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cloud-tree__zone-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px;
  background: #f4f4f5;
  border-radius: 999px;
  border: 1px solid #e4e4e7;
}

.cloud-tree__zone-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: #71717a;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.cloud-tree__zone-tab:hover {
  color: #18181b;
  background: rgba(255, 255, 255, 0.7);
}

.cloud-tree__zone-tab.is-active {
  color: #fff;
  background: #0ea5e9;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.28);
}

.cloud-tree__zone-tab:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.cloud-tree__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.cloud-tree__panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px 14px;
  overflow: visible;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.cloud-tree__branch.is-collapsed > .cloud-tree__children {
  display: none;
}

.cloud-tree__branch.is-collapsed > .cloud-tree__row .cloud-tree__chevron,
.cloud-tree__branch.is-collapsed > .cloud-tree__object-wrap .cloud-tree__chevron {
  transform: rotate(-90deg);
}

.cloud-tree__children {
  margin-left: 20px;
  padding-left: 0;
}

.cloud-tree__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 3px 0;
  padding: 14px 16px 14px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-main);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.cloud-tree__row:hover {
  background: var(--accent-soft);
}

.cloud-tree__row.is-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(14, 159, 233, 0.35);
}

.cloud-tree__row:focus {
  outline: none;
}

.cloud-tree__row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cloud-tree__chevron {
  flex: 0 0 16px;
  width: 16px;
  height: 20px;
  margin-top: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='1.75'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s ease;
}

.cloud-tree__chevron--leaf {
  visibility: hidden;
}

.cloud-tree__icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
}

.cloud-tree__icon svg {
  width: 20px;
  height: 20px;
}

.cloud-tree__icon--section {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.cloud-tree__icon--object {
  color: var(--text-muted);
  background: var(--bg-tint);
}

.cloud-tree__icon--zone {
  color: var(--accent);
  background: var(--accent-soft);
}

.cloud-tree__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.cloud-tree__level {
  width: 100%;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
}

.cloud-tree__name {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  line-height: 1.35;
}

.cloud-tree__badge {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--accent);
  background: rgba(14, 159, 233, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.4;
}

.cloud-tree__meta,
.cloud-tree__id {
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  color: var(--text-muted);
  line-height: 1.4;
}

.cloud-tree__id {
  width: auto;
  font-weight: var(--font-weight-semibold);
  color: var(--accent);
}

.cloud-tree__body--zone {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.cloud-tree__zone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  width: 100%;
}

.cloud-tree__zone-head .cloud-tree__name {
  margin-right: 2px;
}

.cloud-tree__zone-head .cloud-tree__status {
  margin-left: auto;
}

.cloud-tree__metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  width: 100%;
}

.cloud-tree__metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.35;
}

.cloud-tree__metric-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-light);
}

.cloud-tree__metric-label {
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-light);
  letter-spacing: 0.01em;
}

.cloud-tree__status {
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.4;
}

.cloud-tree__status--ok {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.cloud-tree__status--off {
  color: var(--text-muted);
  background: var(--bg-tint);
}

.cloud-tree__status--alarm {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

.cloud-tree__metric--empty {
  color: var(--text-light);
}

.cloud-tree__glossary-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.cloud-tree__glossary-tag--section {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.cloud-tree__glossary-tag--object {
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.cloud-tree__glossary-tag--zone {
  color: var(--accent);
  background: var(--accent-soft);
}

.cloud-tree__detail {
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-height: none;
  overflow: visible;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: opacity 0.2s ease;
}

.cloud-tree__detail.is-updating {
  opacity: 0.55;
}

.cloud-tree__detail-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.cloud-tree__detail-title {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  line-height: var(--line-height-tight);
}

.cloud-tree__detail-lead {
  margin: 0 0 16px;
  font-size: var(--font-size-body);
  color: var(--text);
  line-height: var(--line-height-body);
}

.cloud-tree__detail-list {
  margin: 0 0 18px;
  padding-left: 20px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.55;
}

.cloud-tree__detail-list li + li {
  margin-top: 6px;
}

.cloud-tree__detail-example {
  margin-top: auto;
  padding: 16px 18px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}

.cloud-tree__detail-example-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.cloud-tree__detail-example-text {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.55;
}

.cloud-tree__legend {
  margin: 24px 0 0;
  text-align: center;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-body);
}

@media (max-width: 900px) {
  .cloud-tree__layout,
  .cloud-tree__layout--app-open,
  .cloud-tree__layout--zone-open {
    grid-template-columns: 1fr;
  }

  .cloud-tree__detail {
    position: static;
  }

  .object-ui__devices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zone-ui__metrics {
    grid-template-columns: 1fr;
  }

  .zone-ui__notify-top {
    grid-template-columns: 1fr;
  }

  .zone-ui__dates {
    flex-direction: column;
    align-items: stretch;
  }

  .zone-ui__input--date,
  .zone-ui__select {
    width: 100%;
    min-width: 0;
  }

  .zone-ui__field-row,
  .zone-ui__threshold-fields {
    grid-template-columns: 1fr;
  }

  .zone-ui__export {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .object-ui__devices {
    grid-template-columns: 1fr;
  }
}

/* === How it works === */
.how-it-works {
  padding: var(--section-padding);
  max-width: 1100px;
  margin: 0 auto;
}

.how-it-works .section-subtitle {
  margin-bottom: 32px;
}

/* === Use cases === */
.use-cases.solutions {
  padding: var(--section-padding);
}

.use-case-study {
  max-width: 900px;
  margin: 0 auto 32px;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-loose);
}

.use-case-study__title {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin: 0 0 8px;
}

.use-case-study__lead {
  font-size: var(--font-size-body-lg);
  color: var(--text);
  margin: 0 0 16px;
}

.use-case-study__subtitle {
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin: 24px 0 12px;
}

.use-case-study__benefits {
  margin: 0;
  padding-left: 20px;
}

.use-case-study__benefits li + li {
  margin-top: 6px;
}

.use-case-study__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.use-case-study--compact {
  margin-bottom: 16px;
}

.schema__wrap--use-case {
  max-width: 700px;
  margin: 0 auto 32px;
}

/* === FAQ === */
.faq {
  padding: var(--section-padding);
  max-width: 800px;
  margin: 0 auto;
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq__item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.35s ease;
}

.faq__item[open] {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-family: var(--font-main);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-medium);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: padding-bottom 0.35s ease;
}

.faq__item[open] .faq__question {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question-text {
  flex: 1;
  min-width: 0;
}

.faq__icon {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.faq__icon::before {
  width: 14px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.faq__icon::after {
  width: 2px;
  height: 14px;
  transform: translate(-50%, -50%);
}

.faq__item[open] .faq__icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) scaleY(0);
}

.faq__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq__item[open] .faq__body {
  grid-template-rows: 1fr;
}

.faq__body-inner {
  overflow: hidden;
}

.faq__answer {
  margin: 0;
  padding: 16px 20px 18px;
  font-size: var(--font-size-body-sm);
  color: var(--text-muted);
  line-height: var(--line-height-loose);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.faq__item[open] .faq__answer {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease 0.08s, transform 0.35s ease 0.08s;
}

@media (prefers-reduced-motion: reduce) {
  .faq__item,
  .faq__question,
  .faq__body,
  .faq__answer,
  .faq__icon::before,
  .faq__icon::after {
    transition: none !important;
  }

  .faq__answer {
    opacity: 1;
    transform: none;
  }
}

.faq__answer a {
  color: var(--accent);
  text-decoration: none;
}

.faq__answer a:hover {
  text-decoration: underline;
}

/* === Catalog cloud ID === */
.device-card__cloud-id {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 24px 8px;
  font-weight: 500;
}

.device-card__cloud-id span {
  color: var(--text);
  font-weight: 600;
}

.catalog-chips--protocol {
  margin-top: 12px;
}

@media (max-width: 1024px) {
  .architecture-levels,
  .architecture-terms,
  .architecture-tree__cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #architecture,
  #how-it-works,
  #use-cases,
  #devices,
  #instructions,
  #faq {
    scroll-margin-top: 72px;
  }

  .schematic {
    padding: 0;
  }

  .architecture-sub {
    margin-bottom: 40px;
  }
}

/* === Mobile polish pass === */
@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  :root {
    --section-padding: 56px 22px;
    --font-size-body: 17px;
    --font-size-body-sm: 15px;
    --font-size-body-lg: 18px;
  }

  #architecture,
  #how-it-works,
  #use-cases,
  #devices,
  #instructions,
  #faq,
  #cloud-tree {
    scroll-margin-top: 96px;
  }

  .header {
    padding: 14px 16px;
  }

  .header__pill {
    min-height: 58px;
    padding: 9px 12px;
    border-radius: 16px;
  }

  .header__icon {
    width: 34px;
    height: 34px;
  }

  .header__burger {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding-top: 92px;
    overflow: visible;
  }

  .hero__image {
    min-height: 220px;
    height: 220px;
    overflow: hidden;
    align-items: flex-end;
    justify-content: center;
  }

  .hero__image--mockup img {
    width: min(680px, 132vw);
    max-width: none;
    max-height: none;
    transform: translateX(3%);
  }

  .hero__content {
    padding: 28px 26px 40px;
  }

  .hero__title {
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 18px;
  }

  .hero__subtitle {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 26px;
  }

  .btn--pill-icon {
    width: 100%;
    justify-content: center;
    min-height: 56px;
    padding-left: 22px;
    padding-right: 68px;
    box-sizing: border-box;
  }

  .features {
    padding-top: 58px;
  }

  .features__grid {
    gap: 16px;
  }

  .feature-card {
    min-height: auto;
    padding: 22px;
  }

  .feature-card__icon {
    margin-bottom: 18px;
  }

  .feature-card__icon img {
    width: 96px;
    height: 96px;
  }

  .architecture {
    padding: 56px 22px;
  }

  .system-stack__lead {
    margin: 0 0 32px;
    text-align: left;
    font-size: 16px;
  }

  .system-stack__row {
    padding: 28px 0;
    gap: 22px;
  }

  .system-stack__head {
    align-items: flex-start;
    gap: 12px;
  }

  .system-stack__index {
    min-width: 18px;
    padding-top: 3px;
  }

  .system-stack__title {
    font-size: 24px;
  }

  .system-stack__hint {
    font-size: 15px;
  }

  .system-stack__text {
    font-size: 16px;
    line-height: 1.65;
  }

  .system-stack__details--compact,
  .system-stack__details--links {
    gap: 22px;
  }

  .system-stack__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .system-stack__visual,
  .system-stack__row[data-level="upper"] .system-stack__visual,
  .system-stack__row[data-level="middle"] .system-stack__visual,
  .system-stack__row[data-level="lower"] .system-stack__visual {
    width: 100%;
    max-width: 100%;
  }

  .system-stack__visual img {
    max-height: 220px;
    object-fit: contain;
    object-position: center;
  }

  .architecture-protocols {
    margin: 8px 0 48px;
  }

  .architecture-protocols .protocols,
  .protocols.protocols--nested {
    margin-top: 0;
  }

  .protocols--nested .protocols__inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
  }

  .protocols__visual {
    order: 0;
    width: 100%;
    min-height: 0;
    margin: 0;
    background: #f4f7fa;
  }

  .protocols__image {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-radius: 0;
  }

  .protocols__image-img {
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .protocols--nested .protocols__content,
  .architecture-protocols .protocols__content {
    order: 1;
    max-width: none;
    padding: 24px 20px 22px;
  }

  .protocols__title {
    font-size: 25px;
    margin-bottom: 14px;
  }

  .protocols__lead {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .protocols__list-item,
  .protocols__list-item.active[data-connection] {
    height: auto;
  }

  .protocols__item-title {
    padding: 15px 0;
    font-size: 18px;
  }

  .protocols__item-text,
  .protocols__item-link {
    display: none;
    padding-right: 0;
    font-size: 15px;
    line-height: 1.6;
  }

  .protocols__list-item.active .protocols__item-text,
  .protocols__list-item.active .protocols__item-link {
    display: block;
  }

  .subsection-title {
    font-size: 25px;
    line-height: 1.2;
    margin-bottom: 24px;
  }

  .cloud-tree__layout {
    gap: 16px;
  }

  .cloud-tree__panel {
    padding: 10px;
    border-radius: 24px;
  }

  .cloud-tree__children {
    margin-left: 10px;
  }

  .cloud-tree__row {
    gap: 9px;
    padding: 12px 8px;
  }

  .cloud-tree__chevron {
    flex-basis: 14px;
    width: 14px;
  }

  .cloud-tree__icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .cloud-tree__name {
    font-size: 16px;
    line-height: 1.3;
  }

  .cloud-tree__level {
    font-size: 10px;
  }

  .cloud-tree__badge,
  .cloud-tree__status,
  .cloud-tree__id {
    font-size: 12px;
  }

  .cloud-tree__meta,
  .cloud-tree__metric {
    font-size: 13px;
  }

  .cloud-tree__zone-head {
    gap: 6px 8px;
  }

  .cloud-tree__zone-head .cloud-tree__status {
    margin-left: 0;
  }

  .cloud-tree__metrics {
    gap: 6px 12px;
  }

  .cloud-tree__zone-wrap,
  .cloud-tree__object-wrap {
    display: block;
  }

  .cloud-tree__zone-wrap.is-active .cloud-tree__zone-open,
  .cloud-tree__object-wrap.is-active .cloud-tree__object-open {
    display: block;
    width: calc(100% - 16px);
    margin: 0 8px 8px;
    text-align: left;
  }

  .cloud-tree__detail {
    padding: 18px;
    border-radius: 20px;
  }

  .cloud-tree__detail-title {
    font-size: 22px;
  }

  .cloud-tree__detail-lead {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 48px 16px;
  }

  .header {
    padding: 8px 16px;
  }

  .hero {
    padding-top: 86px;
  }

  .hero__image {
    height: 210px;
    min-height: 210px;
  }

  .hero__image--mockup img {
    width: 138vw;
    transform: translateX(5%);
  }

  .hero__content {
    padding: 26px 26px 38px;
  }

  .architecture {
    padding: 48px 22px;
  }

  .system-stack__visual img {
    max-height: 190px;
  }

  .protocols__image {
    aspect-ratio: 4 / 3;
  }

  .protocols--nested .protocols__content,
  .architecture-protocols .protocols__content {
    padding: 22px 18px 20px;
  }

  .cloud-tree__panel {
    margin-left: -2px;
    margin-right: -2px;
  }

  .cloud-tree__children {
    margin-left: 6px;
  }

  .cloud-tree__row {
    padding: 11px 6px;
  }
}

/* === Mobile final tuning: hero, feature icons, menu === */
@media (max-width: 768px) {
  .hero__image {
    height: 184px;
    min-height: 184px;
    margin: 0;
    padding: 0;
    align-items: flex-end;
    overflow: hidden;
  }

  .hero__image--mockup img {
    width: min(520px, 108vw);
    max-width: none;
    max-height: none;
    transform: translateX(0);
    object-position: center bottom;
  }

  .features {
    padding-top: 52px;
  }

  .features__grid {
    gap: 18px;
  }

  .feature-card {
    min-height: auto;
    padding: 26px 22px 30px;
  }

  .feature-card__icon {
    width: 138px;
    height: 138px;
    justify-content: center;
    margin: 0 auto 22px;
  }

  .feature-card__icon img {
    width: 138px;
    height: 138px;
  }

  .feature-card__title {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .feature-card__subtitle {
    font-size: 13px;
    line-height: 1.35;
    margin-bottom: 16px;
  }

  .feature-card__text {
    font-size: 16px;
    line-height: 1.55;
  }

  .header__menu-overlay {
    background: rgba(24, 24, 27, 0.42);
    backdrop-filter: blur(3px);
  }

  .header__menu {
    left: 16px;
    right: 16px;
    top: 88px;
    bottom: auto;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 112px);
    padding: 18px;
    border: 1px solid rgba(24, 24, 27, 0.08);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    transform: translateY(-14px) scale(0.98);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
  }

  .header--menu-open .header__menu {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .header__menu::before {
    content: "Меню";
    display: block;
    padding: 2px 52px 16px 4px;
    font-size: 22px;
    font-weight: var(--font-weight-semibold);
    color: var(--text);
  }

  .header__menu-close {
    position: absolute;
    top: 14px;
    right: 14px;
    margin: 0;
    width: 40px;
    height: 40px;
    background: var(--bg-tint);
  }

  .header__menu-nav {
    gap: 6px;
    flex: 0 0 auto;
  }

  .header__menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    font-size: 16px;
    border: 1px solid transparent;
  }

  .header__menu-nav .header__menu-link::after {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    opacity: 0.35;
    transform: rotate(45deg);
  }

  .header__menu-link:hover,
  .header__menu-link--active {
    border-color: rgba(14, 159, 233, 0.18);
  }

  .header__menu-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
  }

  .header__menu-right .btn,
  .header__menu-right .header__menu-link {
    min-height: 46px;
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .hero__image {
    height: 172px;
    min-height: 172px;
  }

  .hero__image--mockup img {
    width: 112vw;
  }

  .feature-card__icon,
  .feature-card__icon img {
    width: 132px;
    height: 132px;
  }

  .header__menu {
    left: 14px;
    right: 14px;
    top: 78px;
    max-height: calc(100dvh - 96px);
  }
}

/* Keep the mobile hero mockup clear of the fixed header. */
@media (max-width: 768px) {
  .hero {
    padding-top: 104px;
  }

  .hero__image {
    height: 190px;
    min-height: 190px;
    align-items: flex-start;
    padding-top: 18px;
  }

  .hero__image--mockup img {
    width: min(470px, 98vw);
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 98px;
  }

  .hero__image {
    height: 184px;
    min-height: 184px;
    padding-top: 16px;
  }

  .hero__image--mockup img {
    width: 102vw;
  }
}

/* Show the full laptop mockup on phones. */
@media (max-width: 768px) {
  .hero {
    padding-top: 104px;
  }

  .hero__image {
    height: auto;
    min-height: 0;
    padding: 22px 18px 10px;
    overflow: visible;
    align-items: center;
    justify-content: center;
  }

  .hero__image--mockup img {
    display: block;
    width: min(420px, 92vw);
    height: auto;
    max-width: 100%;
    max-height: none;
    transform: none;
    object-fit: contain;
    object-position: center;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 96px;
  }

  .hero__image {
    padding: 20px 18px 8px;
  }

  .hero__image--mockup img {
    width: 90vw;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    padding-left: clamp(24px, 4vw, 56px);
  }

  .hero__image--ecosystem {
    margin-left: 0;
  }

  .hero-ecosystem {
    max-width: 640px;
  }

  .hero-eco-node img {
    width: 96px;
    height: 96px;
  }

  .hero-eco-group .hero-eco-node img {
    width: 84px;
    height: 84px;
  }
}

@media (max-width: 900px) {
  .hero:has(.hero__image--ecosystem) {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 96px 20px 40px;
  }

  .hero:has(.hero__image--ecosystem) .hero__content {
    order: 1;
    width: 100%;
    margin-left: 0;
    padding: 0 0 28px;
    align-items: stretch;
  }

  .hero:has(.hero__image--ecosystem) .hero__image--ecosystem {
    order: 2;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
  }

  .hero:has(.hero__image--ecosystem) .hero__title,
  .hero:has(.hero__image--ecosystem) .hero__subtitle {
    max-width: 100%;
  }

  .hero-ecosystem {
    flex-direction: column;
    max-width: 420px;
    gap: 8px;
  }

  .hero-eco-arrow {
    margin-top: 0;
    transform: rotate(90deg);
  }

  .hero-eco-node {
    max-width: none;
  }

  .hero-eco-group {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero:has(.hero__image--ecosystem) {
    padding: 88px 14px 28px;
  }

  .hero-eco-node img,
  .hero__image--ecosystem img {
    width: 88px;
    height: 88px;
  }

  .hero-eco-group .hero-eco-node img {
    width: 76px;
    height: 76px;
  }

  .hero-eco-node__logo,
  .hero__image--ecosystem .hero-eco-node__logo {
    width: 68px;
    height: 68px;
  }
}
