/*
  Art direction: Piano tuner small business, Moscow
  Tone: Warm, artisanal, trustworthy, calm
  Palette: Warm wood tones — cream surfaces, walnut brown accents, warm off-white
  Typography: Cormorant Garamond (display, serif elegance) + Inter (body, clean sans)
  Density: Spacious — service business needs breathing room
*/

/* ===== DESIGN TOKENS ===== */
:root {
  /* Surfaces — warm cream / parchment */
  --color-bg:              #f8f5ef;
  --color-surface:         #faf8f3;
  --color-surface-2:       #fdfcf9;
  --color-surface-offset:  #f1ece2;
  --color-surface-dynamic: #e8e0d0;
  --color-divider:         #ddd5c4;
  --color-border:          #d0c7b4;

  /* Text */
  --color-text:            #2a2118;
  --color-text-muted:      #6e5f4a;
  --color-text-faint:      #b0a08a;
  --color-text-inverse:    #faf8f3;

  /* Primary accent — warm walnut brown */
  --color-primary:         #7a4e2d;
  --color-primary-hover:   #5c3920;
  --color-primary-active:  #3e2612;
  --color-primary-highlight: #e8d9ca;

  /* Secondary — muted gold */
  --color-gold:            #c4923a;
  --color-gold-light:      #f5e8d0;

  /* Radius */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  /* Shadows — warm-tinted */
  --shadow-sm: 0 1px 3px oklch(0.25 0.04 60 / 0.08);
  --shadow-md: 0 4px 16px oklch(0.25 0.04 60 / 0.10);
  --shadow-lg: 0 12px 40px oklch(0.25 0.04 60 / 0.14);

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.1rem,   1rem    + 4vw,    5rem);

  /* Fonts */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Inter', 'system-ui', sans-serif;

  /* Layout */
  --content-default: 1100px;
  --nav-width: 240px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== BASE RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-8);
  overflow-x: hidden; /* корневой скролл-контейнер: гасит любой горизонтальный выход за экран */
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  display: flex;
  overflow-x: hidden; /* страховка от любого горизонтального выхода за экран */
  max-width: 100%;
}

img, picture { display: block; max-width: 100%; height: auto; }
ul[role="list"], ol[role="list"] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); overflow-wrap: break-word; hyphens: auto; }
p, li { text-wrap: pretty; overflow-wrap: break-word; }
button { cursor: pointer; background: none; border: none; }

a, button, [role="button"] {
  transition: color var(--transition), background var(--transition),
              border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
}

::selection { background: var(--color-primary-highlight); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== LAYOUT — SIDEBAR + CONTENT ===== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100dvh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: var(--space-8) var(--space-6);
  z-index: 100;
  overflow-y: auto;
}

.site-content {
  margin-left: var(--nav-width);
  flex: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===== NAV LOGO ===== */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  margin-bottom: var(--space-10);
}

.nav-logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  object-fit: cover;
}

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

.nav-logo-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.nav-logo-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

/* ===== NAV LINKS ===== */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  position: relative;
}

.nav-link:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.nav-link.active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-link.active svg { opacity: 1; }

/* ===== NAV CTA ===== */
.nav-cta {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.nav-phone {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.nav-phone a {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-phone a:hover { color: var(--color-primary-hover); }

/* ===== HAMBURGER (mobile) ===== */
.menu-toggle {
  display: none;
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 200;
  width: 44px;
  height: 44px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.menu-toggle svg { width: 20px; height: 20px; }
.nav-overlay { display: none; }

/* ===== MAIN ===== */
main { flex: 1; overflow-x: hidden; }

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(var(--space-12), 8vw, var(--space-20)) clamp(var(--space-8), 5vw, var(--space-16));
  padding-right: var(--space-8);
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: var(--space-8);
  line-height: 1.6;
  font-family: var(--font-body);
}

.hero-image {
  position: relative;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--color-bg) 0%, transparent 20%);
  pointer-events: none;
}

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary-highlight);
}

/* ===== SECTION ===== */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-20)) clamp(var(--space-6), 5vw, var(--space-16));
}

.section-alt {
  background: var(--color-surface);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.section-lead {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-bottom: var(--space-10);
  line-height: 1.7;
}

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-6);
}

.card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.card-icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  color: var(--color-primary);
}

.card-icon svg { width: 20px; height: 20px; }

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.card-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--color-divider);
  margin: 0 clamp(var(--space-6), 5vw, var(--space-16));
}

/* ===== PAGE HEADER (interior pages) ===== */
.page-header {
  padding: clamp(var(--space-12), 8vw, var(--space-20)) clamp(var(--space-6), 5vw, var(--space-16));
  padding-bottom: var(--space-12);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}

.page-header-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.page-header-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.page-header-lead {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: 1.7;
}

/* ===== PRICES TABLE ===== */
.price-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}

.price-card-header {
  padding: var(--space-6) var(--space-8);
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.price-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.price-badge {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.price-card-body {
  padding: var(--space-6) var(--space-8);
}

.price-card-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.65;
}

.price-note {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
}

.prices-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
  gap: var(--space-4);
}

.price-row:last-child { border-bottom: none; }

.price-row-name {
  font-size: var(--text-base);
  color: var(--color-text);
}

.price-row-price {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

/* ===== WHY PAGE ===== */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-8);
  margin-top: var(--space-10);
}

.why-item {
  display: flex;
  gap: var(--space-5);
}

.why-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary-highlight);
  line-height: 1;
  flex-shrink: 0;
  width: 48px;
}

.why-item-content {}

.why-item-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.why-item-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ===== CONTACT PAGE ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
  margin-top: var(--space-8);
}

.contact-info-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-divider);
}

.contact-info-item:last-child { border-bottom: none; }

.contact-info-icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.contact-info-icon svg { width: 18px; height: 18px; }

.contact-info-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-1);
}

.contact-info-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.contact-info-value:hover { color: var(--color-primary); }

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.form-input, .form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--color-text-faint);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-text);
  color: var(--color-text-inverse);
  padding: var(--space-12) clamp(var(--space-6), 5vw, var(--space-16));
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid oklch(from var(--color-text-inverse) l c h / 0.12);
  margin-bottom: var(--space-8);
  align-items: start;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-inverse);
  margin-bottom: var(--space-2);
}

.footer-brand-desc {
  font-size: var(--text-sm);
  color: oklch(from var(--color-text-inverse) l c h / 0.55);
  max-width: 36ch;
  line-height: 1.6;
}

.footer-nav-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: oklch(from var(--color-text-inverse) l c h / 0.45);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: var(--text-sm);
  color: oklch(from var(--color-text-inverse) l c h / 0.65);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-text-inverse);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.footer-copy {
  font-size: var(--text-xs);
  color: oklch(from var(--color-text-inverse) l c h / 0.4);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-legal a {
  font-size: var(--text-xs);
  color: oklch(from var(--color-text-inverse) l c h / 0.5);
  text-decoration: none;
}

.footer-legal a:hover {
  color: oklch(from var(--color-text-inverse) l c h / 0.85);
  text-decoration: underline;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  body { display: block; }

  .site-nav {
    position: fixed;
    left: 0;
    width: min(var(--nav-width), 80vw);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }

  .site-nav.open { transform: translateX(0); }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: oklch(0.1 0.02 60 / 0.4);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .nav-overlay.open { opacity: 1; pointer-events: all; }

  .menu-toggle { display: flex; }

  .site-content { margin-left: 0; padding-top: var(--space-16); }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-image {
    height: 55vw;
    min-height: 240px;
    order: -1;
  }

  .hero-image::after {
    background: linear-gradient(to bottom, transparent 60%, var(--color-bg) 100%);
  }

  .hero-content { padding: var(--space-8) var(--space-5); }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .price-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

/* ===== REQUEST MODAL ===== */
.request-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.request-modal.is-open {
  display: flex;
}

.request-modal-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.1 0.02 60 / 0.55);
}

.request-modal-dialog {
  position: relative;
  max-width: 480px;
  width: 100%;
  background: var(--color-surface-2);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  z-index: 301;
}

.request-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  line-height: 1;
  color: var(--color-text-muted);
}

.request-modal-close:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

@media (max-width: 480px) {
  .request-modal-dialog {
    margin: 0 var(--space-4);
    padding: var(--space-6);
  }
}

/* ===== PHOTO CAROUSEL ===== */
.photo-carousel-section {
  padding: clamp(var(--space-10), 6vw, var(--space-16)) clamp(var(--space-6), 5vw, var(--space-16));
  background: var(--color-bg);
  overflow: hidden;
}

.photo-carousel-wrap {
  position: relative;
}

.photo-carousel-track-outer {
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.photo-carousel-track {
  display: flex;
  gap: var(--space-4);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.photo-carousel-slide {
  flex: 0 0 auto;
  aspect-ratio: 4/3;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-surface-dynamic);
  /* ширина выставляется через JS */
}

.photo-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  cursor: pointer;
  z-index: 10;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.photo-carousel-btn:hover {
  background: var(--color-surface-offset);
  box-shadow: var(--shadow-lg);
  transform: translateY(-50%) scale(1.05);
}

.photo-carousel-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.photo-carousel-btn-next {
  right: -20px;
}

.photo-carousel-btn-prev {
  left: -20px;
}

@media (max-width: 768px) {
  .photo-carousel-btn-next { right: -14px; }
  .photo-carousel-btn-prev { left: -14px; }
}

/* ===== REVIEWS CAROUSEL ===== */
.reviews-section {
  padding: clamp(var(--space-12), 8vw, var(--space-20)) clamp(var(--space-6), 5vw, var(--space-16));
  background: var(--color-surface);
  overflow: hidden;
}

.reviews-carousel-wrap {
  position: relative;
  margin-top: var(--space-10);
}

.reviews-track-outer {
  overflow: hidden;
}

.reviews-track {
  display: flex;
  gap: var(--space-5);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  align-items: stretch;
}

.review-card {
  flex: 0 0 auto; /* ширина выставляется через JS */
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-8);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

.review-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.review-meta {
  flex: 1;
  min-width: 0;
}

.review-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-date-role {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

.review-stars {
  color: var(--color-gold);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.review-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  flex: 1;
  /* Ограничиваем длинные отзывы */
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-service {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-3);
  margin-top: auto;
}

.reviews-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  justify-content: flex-end;
}

.reviews-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.reviews-nav-btn:hover {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.reviews-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.reviews-nav-btn svg { width: 16px; height: 16px; }

.reviews-counter {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  min-width: 48px;
  text-align: center;
}

@media (max-width: 580px) {
  .reviews-nav { justify-content: center; }
}

/* ===== STATS ROW OVERFLOW FIX ===== */
.stats-row {
  overflow: hidden;
}

/* ===== MODERN REFRESH ===== */
.card {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-highlight);
}

.photo-carousel-slide img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.photo-carousel-slide:hover img { transform: scale(1.05); }

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-5);
}
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs span { color: var(--color-text-faint); }
.breadcrumbs .breadcrumbs-current { color: var(--color-text); }

/* ===== ARTICLE BODY ===== */
.article-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}
.article-prose {
  max-width: 72ch;
}
.article-prose > p {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: var(--space-5);
}
.article-prose > p:last-child { margin-bottom: 0; }
.article-prose strong { color: var(--color-text); font-weight: 600; }

.article-h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  line-height: 1.2;
}
.article-prose > .article-h2:first-child { margin-top: 0; }

.article-list {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.article-list li {
  position: relative;
  padding-left: var(--space-6);
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.7;
}
.article-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

/* ===== ARTICLE CTA BOX ===== */
.article-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}
.article-cta-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: var(--space-1) 0 var(--space-2);
}
.article-cta-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 52ch;
  line-height: 1.6;
}
.article-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  flex-shrink: 0;
}

.article-back {
  font-size: var(--text-sm);
}
.article-back a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.article-back a:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* ===== ARTICLES INDEX ===== */
.articles-group-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin: var(--space-10) 0 var(--space-5);
}
.articles-group-title:first-child { margin-top: 0; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.article-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-highlight);
}
.article-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.25;
}
.article-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-more {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin-top: var(--space-1);
}

@media (max-width: 580px) {
  .article-cta { flex-direction: column; align-items: flex-start; }
  .article-cta-actions { width: 100%; }
  .article-cta-actions .btn { flex: 1; justify-content: center; }
}

/* =====================================================================
   LIVELY REFRESH v3  —  светлее, современнее, живее + анимации + виджет
   ===================================================================== */
:root {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --primary-grad: linear-gradient(135deg, #8a5a34 0%, #6e4326 100%);
  --gold-grad: linear-gradient(135deg, #e0b45c 0%, #c4923a 100%);
  --shadow-soft: 0 2px 8px oklch(0.25 0.04 60 / 0.06), 0 12px 32px oklch(0.25 0.04 60 / 0.08);
  --shadow-hover: 0 6px 16px oklch(0.25 0.04 60 / 0.10), 0 20px 48px oklch(0.25 0.04 60 / 0.14);
}

/* Тёплый «живой» фон с очень мягким свечением */
body {
  background:
    radial-gradient(1200px 600px at 100% -5%, oklch(0.9 0.05 75 / 0.45), transparent 60%),
    radial-gradient(900px 500px at -5% 105%, oklch(0.9 0.04 60 / 0.35), transparent 55%),
    var(--color-bg);
  background-attachment: fixed;
}

/* Акцентная «засечка» перед лейблами секций */
.section-label, .page-header-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
}
.section-label::before, .page-header-label::before {
  content: '';
  width: 26px; height: 2px;
  border-radius: 2px;
  background: var(--gold-grad);
}

/* Кнопки — мягкий градиент + «живой» отклик */
.btn { transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition); }
.btn-primary {
  background: var(--primary-grad);
  box-shadow: 0 4px 14px oklch(0.4 0.08 55 / 0.25);
}
.btn-primary:hover { box-shadow: 0 8px 22px oklch(0.4 0.08 55 / 0.32); transform: translateY(-2px); }
.btn-outline:hover { transform: translateY(-2px); }
.btn svg { transition: transform var(--transition); }
.btn:hover svg { transform: translateX(2px); }

/* Hero — тёплое свечение за фото */
.hero::before {
  content: '';
  position: absolute;
  top: -10%; right: -5%;
  width: 55%; height: 70%;
  background: radial-gradient(circle, oklch(0.85 0.09 70 / 0.5), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.hero-title .accent {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Карточки — чуть мягче и «дороже» */
.card, .article-card, .price-card, .contact-form, .article-cta { box-shadow: var(--shadow-soft); }
.card:hover, .article-card:hover { box-shadow: var(--shadow-hover); }

/* ===== ABOUT INTRO + STATS / TRUST TRIGGERS =====
   Блок «Кто приедет к вашему инструменту» и статистика РАНЬШЕ жили в
   инлайновом <style> внутри about.html. SPA-роутер подменяет только
   #main-content и выбрасывает <head> загружаемой страницы, поэтому при
   переходе эти стили терялись — фото грузилось «без стилей» (полный размер).
   Теперь всё здесь, в общем style.css: применяется одинаково при любом
   способе перехода и до первой отрисовки. Никаких per-page инлайн-стилей. */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-12);
  align-items: start;
}
.about-intro-text { min-width: 0; }
.about-intro-text p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  line-height: 1.75;
  max-width: 65ch;
}
.about-photo {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3/4;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-divider);
}
.stats-row .stat-item { text-align: center; min-width: 0; }
.stats-row .stat-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-xs); max-width: none; }

@media (max-width: 768px) {
  .about-intro { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 4/3; max-height: 280px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; gap: var(--space-4); }
  .stats-row .stat-item { text-align: left; display: flex; gap: var(--space-4); align-items: baseline; }
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  background: var(--primary-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 20ch;
  line-height: 1.4;
}

.trust-strip {
  padding: clamp(var(--space-10), 6vw, var(--space-16)) clamp(var(--space-6), 5vw, var(--space-16));
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: var(--space-4);
}
.trust-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.trust-card .stat-number { font-size: var(--text-xl); }
.trust-card .stat-label { margin: 0 auto; }

/* ===== STEPS — «Как проходит настройка» ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: var(--space-6);
  margin-top: var(--space-10);
}
.step {
  position: relative;
  padding: var(--space-6);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.step-num {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
}
.step-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.step-text { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }

/* ===== FAQ (аккордеон) ===== */
.faq { max-width: 780px; margin-top: var(--space-8); }
.faq-item { border-bottom: 1px solid var(--color-divider); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  background: none; border: none; cursor: pointer;
}
.faq-q:hover { color: var(--color-primary); }
.faq-ic {
  flex-shrink: 0;
  width: 28px; height: 28px;
  position: relative;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  transition: background var(--transition), transform var(--transition);
}
.faq-ic::before, .faq-ic::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
  transform: translate(-50%, -50%);
  transition: transform var(--transition), opacity var(--transition);
}
.faq-ic::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item.open .faq-ic { transform: rotate(180deg); }
.faq-item.open .faq-ic::after { opacity: 0; }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p {
  padding-bottom: var(--space-5);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ===== MESSENGER BUTTONS ===== */
.messengers { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.msg-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.msg-btn svg { width: 18px; height: 18px; }
.msg-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); filter: brightness(1.05); }
.msg-btn.wa { background: #25D366; }
.msg-btn.tg { background: #2AABEE; }

/* Мессенджеры в боковом меню */
.nav-messengers { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.nav-messengers a {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  color: #fff;
  transition: transform var(--transition), filter var(--transition);
}
.nav-messengers a svg { width: 18px; height: 18px; }
.nav-messengers a:hover { transform: translateY(-2px); filter: brightness(1.05); }
.nav-messengers .wa { background: #25D366; }
.nav-messengers .tg { background: #2AABEE; }

/* =====================================================================
   ANIMATIONS — появление при скролле + вход hero
   Контент виден по умолчанию; скрытие/анимация — только при .js на <html>.
   ===================================================================== */
html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* Каскад для групп: контейнер [data-stagger] получает .is-visible — дети въезжают по очереди */
html.js [data-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
html.js [data-stagger].is-visible > * { opacity: 1; transform: none; }
html.js [data-stagger].is-visible > *:nth-child(1) { transition-delay: 0s; }
html.js [data-stagger].is-visible > *:nth-child(2) { transition-delay: 0.07s; }
html.js [data-stagger].is-visible > *:nth-child(3) { transition-delay: 0.14s; }
html.js [data-stagger].is-visible > *:nth-child(4) { transition-delay: 0.21s; }
html.js [data-stagger].is-visible > *:nth-child(5) { transition-delay: 0.28s; }
html.js [data-stagger].is-visible > *:nth-child(6) { transition-delay: 0.35s; }
html.js [data-stagger].is-visible > *:nth-child(n+7) { transition-delay: 0.42s; }

/* Вход hero при загрузке */
html.js .hero-content > * { opacity: 0; animation: heroIn 0.75s var(--ease-out) both; }
html.js .hero-content > *:nth-child(1) { animation-delay: 0.05s; }
html.js .hero-content > *:nth-child(2) { animation-delay: 0.13s; }
html.js .hero-content > *:nth-child(3) { animation-delay: 0.21s; }
html.js .hero-content > *:nth-child(4) { animation-delay: 0.29s; }
html.js .hero-content > *:nth-child(5) { animation-delay: 0.37s; }
html.js .hero-image { opacity: 0; animation: heroImg 0.9s var(--ease-out) 0.1s both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes heroImg { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  html.js .hero-content > *, html.js .hero-image { opacity: 1 !important; animation: none !important; }
}

/* =====================================================================
   CHAT WIDGET  (в стиле Jivo, собственная лёгкая реализация)
   ===================================================================== */
.cw-launcher {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 62px; height: 62px;
  border-radius: var(--radius-full);
  background: var(--primary-grad);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 400;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px oklch(0.35 0.08 55 / 0.35);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.cw-launcher:hover { transform: scale(1.06); box-shadow: 0 12px 30px oklch(0.35 0.08 55 / 0.45); }
.cw-launcher svg { width: 28px; height: 28px; transition: transform 0.3s var(--ease); }
.cw-launcher .cw-ic-close { position: absolute; opacity: 0; transform: scale(0.5) rotate(-45deg); }
.cw-root.open .cw-launcher .cw-ic-chat { opacity: 0; transform: scale(0.5) rotate(45deg); }
.cw-root.open .cw-launcher .cw-ic-close { opacity: 1; transform: scale(1) rotate(0); }

/* Пульсация раз в ~10 сек */
.cw-launcher::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  border: 2px solid var(--color-gold);
  opacity: 0;
  animation: cwPulse 10s ease-out infinite;
}
.cw-root.open .cw-launcher::after { animation: none; }
@keyframes cwPulse {
  0%, 92% { opacity: 0; transform: scale(1); }
  94% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Подсказка-облачко */
.cw-bubble {
  position: fixed;
  right: 20px; bottom: 92px;
  max-width: 240px;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-8) var(--space-4) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  z-index: 399;
  opacity: 0; transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.cw-bubble.show { opacity: 1; transform: none; pointer-events: auto; }
.cw-bubble-close {
  position: absolute; top: 4px; right: 6px;
  width: 22px; height: 22px; line-height: 1;
  border: none; background: none; cursor: pointer;
  color: var(--color-text-faint); font-size: 18px;
}
.cw-bubble-close:hover { color: var(--color-text); }

/* Панель чата */
.cw-panel {
  position: fixed;
  right: 20px; bottom: 92px;
  width: 370px; max-width: calc(100vw - 40px);
  height: 560px; max-height: calc(100dvh - 120px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px oklch(0.25 0.04 60 / 0.28);
  z-index: 400;
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.cw-root.open .cw-panel { opacity: 1; transform: none; pointer-events: auto; }

.cw-header {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--primary-grad);
  color: #fff;
}
.cw-avatar {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: var(--radius-full);
  background: oklch(1 0 0 / 0.18);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg);
  overflow: hidden;
}
.cw-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cw-hmeta { flex: 1; min-width: 0; }
.cw-hname { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); }
.cw-hstatus { font-size: var(--text-xs); opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.cw-hstatus::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #7CFC9B; box-shadow: 0 0 0 0 #7CFC9B; }
.cw-hclose { background: none; border: none; color: #fff; cursor: pointer; opacity: 0.85; font-size: 22px; line-height: 1; width: 28px; height: 28px; }
.cw-hclose:hover { opacity: 1; }

.cw-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
  background:
    radial-gradient(600px 300px at 100% 0%, oklch(0.92 0.03 75 / 0.5), transparent 70%),
    var(--color-surface);
  scroll-behavior: smooth;
}
.cw-msg {
  max-width: 82%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  animation: cwMsgIn 0.35s var(--ease-out) both;
}
.cw-msg.bot {
  align-self: flex-start;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
  color: var(--color-text);
}
.cw-msg.user {
  align-self: flex-end;
  background: var(--primary-grad);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.cw-msg a { color: inherit; text-decoration: underline; }
@keyframes cwMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Индикатор «печатает…» */
.cw-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: var(--space-4); background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-lg); border-bottom-left-radius: 4px; }
.cw-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-faint); animation: cwDot 1.2s infinite ease-in-out; }
.cw-typing span:nth-child(2) { animation-delay: 0.2s; }
.cw-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cwDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Быстрые ответы + композер */
.cw-foot { border-top: 1px solid var(--color-divider); padding: var(--space-3) var(--space-4); background: var(--color-surface); }
.cw-quick { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cw-chip {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  font-size: var(--text-sm); font-weight: 600; cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.cw-chip:hover { background: var(--color-primary-highlight); transform: translateY(-1px); }
.cw-inrow { display: flex; gap: var(--space-2); align-items: center; }
.cw-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.cw-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-highlight); }
.cw-send {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--primary-grad);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cw-send:disabled { opacity: 0.4; cursor: default; }
.cw-send svg { width: 18px; height: 18px; }
.cw-consent { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-2); line-height: 1.4; }
.cw-consent input { margin-top: 2px; flex-shrink: 0; }
.cw-consent a { color: var(--color-primary); }
.cw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 480px) {
  .cw-panel {
    right: 0; bottom: 0;
    width: 100vw; max-width: 100vw;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0;
  }
  .cw-bubble { bottom: 90px; right: 16px; }
  .cw-launcher { right: 16px; bottom: 16px; }
}

/* ===== СОГЛАСИЕ НА ОБРАБОТКУ ПДн (чекбокс в формах) ===== */
.form-consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-4);
  cursor: pointer;
}
.form-consent input {
  width: 18px; height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.form-consent a { color: var(--color-primary); text-decoration: underline; }

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== ЮРИДИЧЕСКИЕ СТРАНИЦЫ ===== */
.legal-doc { max-width: 820px; }
.legal-doc h2 {
  font-size: var(--text-lg);
  color: var(--color-text);
  margin: var(--space-8) 0 var(--space-3);
}
.legal-doc p, .legal-doc li { color: var(--color-text-muted); margin-bottom: var(--space-3); }
.legal-doc ul { padding-left: 1.2em; margin-bottom: var(--space-4); }
.legal-doc a { color: var(--color-primary); text-decoration: underline; }
.legal-updated { font-size: var(--text-sm); color: var(--color-text-faint); margin-bottom: var(--space-6); }

/* ===== COOKIE-БАННЕР ===== */
.cookie-banner {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  max-width: 640px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  z-index: 350;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease, ease), transform 0.3s var(--ease, ease);
}
.cookie-banner.show { opacity: 1; transform: none; }
.cookie-banner p { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; margin: 0; flex: 1; min-width: 200px; }
.cookie-banner a { color: var(--color-primary); text-decoration: underline; }
.cookie-banner .btn { flex-shrink: 0; }
@media (max-width: 480px) {
  .cookie-banner { padding: var(--space-4); }
  .cookie-banner .btn { width: 100%; justify-content: center; }
}

/* ===== ВАЛИДАЦИЯ ФОРМ ===== */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
  pointer-events: none;
}
.form-input.is-invalid, .form-textarea.is-invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}
.form-error { color: #c0392b; font-size: var(--text-xs); margin-top: 4px; }
.form-msg {
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}
.form-msg-ok {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  color: var(--color-text);
}
.form-msg-err {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: #8a231b;
}
.form-msg-err a { color: inherit; text-decoration: underline; font-weight: 600; }

/* ===== ПОХОЖИЕ СТАТЬИ (внутренняя перелинковка) ===== */
.article-related {
  margin: var(--space-10) 0 var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}
.article-related-title { font-size: var(--text-lg); margin-bottom: var(--space-4); }
.article-related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.article-related a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  gap: var(--space-2);
}
.article-related a::before { content: '→'; color: var(--color-gold); }
.article-related a:hover { text-decoration: underline; }
