.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

#site-main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 74px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(237, 244, 242, 0.18)),
    transparent;
}

#site-footer {
  position: relative;
  z-index: 1;
}

body.ui-theme-dark #site-main {
  background:
    linear-gradient(180deg, rgba(15, 23, 26, 0.48), rgba(15, 23, 26, 0.24)),
    transparent;
}

.section {
  position: relative;
  isolation: isolate;
  padding: 92px 0;
}

.section::before,
.section::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.section::before {
  background:
    radial-gradient(circle at 12% 22%, rgba(10, 168, 150, 0.16), transparent 36%),
    radial-gradient(circle at 88% 82%, rgba(52, 95, 116, 0.15), transparent 40%),
    linear-gradient(90deg, rgba(8, 123, 112, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(52, 95, 116, 0.055) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 52px 52px, 52px 52px;
  opacity: 0.95;
  animation: sectionBackgroundFlow 32s linear infinite;
}

.section::after {
  background:
    linear-gradient(100deg, transparent 0 28%, rgba(82, 205, 191, 0.16) 38%, transparent 52%),
    linear-gradient(180deg, transparent 0 46%, rgba(56, 170, 184, 0.18) 49%, transparent 52%),
    repeating-linear-gradient(115deg, transparent 0 88px, rgba(216, 166, 58, 0.12) 88px 90px, transparent 90px 176px);
  background-size: 520px 100%, 100% 260px, 360px 360px;
  opacity: 0.72;
  transform: translateX(-18%);
  animation: sectionSignalSweep 11s ease-in-out infinite;
}

.section > .container {
  position: relative;
  z-index: 2;
}

.section img {
  background:
    linear-gradient(135deg, rgba(10, 168, 150, 0.16), rgba(52, 95, 116, 0.14)),
    var(--surface-warm);
}

body.ui-theme-dark .section::before {
  background:
    radial-gradient(circle at 12% 22%, rgba(82, 205, 191, 0.18), transparent 36%),
    radial-gradient(circle at 88% 82%, rgba(120, 164, 182, 0.17), transparent 40%),
    linear-gradient(90deg, rgba(82, 205, 191, 0.085) 1px, transparent 1px),
    linear-gradient(rgba(120, 164, 182, 0.065) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 52px 52px, 52px 52px;
  opacity: 1;
}

body.ui-theme-dark .section::after {
  background:
    linear-gradient(100deg, transparent 0 28%, rgba(121, 213, 223, 0.2) 38%, transparent 52%),
    linear-gradient(180deg, transparent 0 46%, rgba(82, 205, 191, 0.2) 49%, transparent 52%),
    repeating-linear-gradient(115deg, transparent 0 88px, rgba(228, 195, 107, 0.13) 88px 90px, transparent 90px 176px);
  opacity: 0.85;
}

body.ui-theme-dark .section img {
  background:
    linear-gradient(135deg, rgba(82, 205, 191, 0.12), rgba(120, 164, 182, 0.12)),
    var(--surface-warm);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.6fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 34px;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before {
  display: inline-block;
  width: 28px;
  height: 2px;
  margin-right: 9px;
  vertical-align: middle;
  content: "";
  background: currentColor;
}

.section-title {
  margin: 8px 0 0;
  font-size: 2.2rem;
  line-height: 1.15;
}

.section-copy {
  margin: 0;
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(20, 33, 38, 0.08);
  transition: transform 240ms ease, background 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.button::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
  transform: translateX(-120%);
  transition: transform 560ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button:hover::after,
.button:focus-visible::after {
  transform: translateX(120%);
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--panel-teal), var(--panel-steel));
  border-color: rgba(255, 255, 255, 0);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--panel-dark);
  border-color: var(--panel-dark);
}

.button-light {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.button-light:hover,
.button-light:focus-visible {
  color: #142126;
  background: #ffffff;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 920ms ease, transform 920ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.route-shell {
  opacity: 1;
}

.route-shell.route-enter {
  animation: routeEnter 860ms cubic-bezier(0.22, 0.74, 0.2, 1) both;
}

.route-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 130;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.route-transition::before {
  position: absolute;
  top: 0;
  left: -42%;
  width: 42%;
  height: 100%;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--teal), var(--cyan), var(--amber), transparent);
  box-shadow: 0 0 16px rgba(10, 168, 150, 0.32);
}

.route-transition.is-active {
  opacity: 1;
}

.route-transition.is-active::before {
  animation: routeSweep 920ms cubic-bezier(0.16, 0.78, 0.32, 1) both;
}

.auto-chat-shell {
  position: fixed;
  left: 16px;
  right: auto;
  bottom: 16px;
  z-index: 120;
  width: min(380px, calc(100vw - 32px));
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.auto-chat-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--panel-teal), var(--panel-steel));
  box-shadow: 0 16px 36px rgba(10, 24, 31, 0.34);
  pointer-events: auto;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.auto-chat-trigger:hover,
.auto-chat-trigger:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.auto-chat-trigger-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.auto-chat-trigger-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.auto-chat-panel {
  width: min(100%, 360px);
  max-height: min(76vh, 620px);
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  gap: 8px;
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(20, 33, 38, 0.1);
  border-radius: 22px;
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom left;
  transition: opacity 280ms ease, transform 320ms cubic-bezier(0.22, 0.74, 0.2, 1);
}

body.ui-theme-dark .auto-chat-panel {
  background: rgba(14, 23, 29, 0.97);
  border-color: rgba(255, 255, 255, 0.14);
}

.auto-chat-shell.is-open .auto-chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.auto-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(20, 33, 38, 0.08);
}

.auto-chat-title {
  margin: 4px 0 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.auto-chat-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.auto-chat-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.auto-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(10, 168, 150, 0.16);
}

.auto-chat-close {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(20, 33, 38, 0.14);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1;
}

body.ui-theme-dark .auto-chat-close {
  border-color: rgba(255, 255, 255, 0.18);
  color: #d8e4ea;
  background: rgba(255, 255, 255, 0.08);
}

.auto-chat-close:hover,
.auto-chat-close:focus-visible {
  color: var(--teal-dark);
  border-color: rgba(8, 123, 112, 0.35);
  background: #ffffff;
}

.auto-chat-messages {
  min-height: 140px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 9px;
  padding-right: 4px;
  margin-top: 2px;
}

.auto-chat-message {
  max-width: 92%;
  padding: 10px 11px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-line;
}

.auto-chat-message-bot {
  justify-self: start;
  color: var(--ink);
  background: rgba(10, 168, 150, 0.1);
  border: 1px solid rgba(10, 168, 150, 0.2);
}

.auto-chat-message-user {
  justify-self: end;
  color: #ffffff;
  background: linear-gradient(135deg, var(--panel-steel), var(--panel-teal));
}

.auto-chat-message.is-typing {
  font-style: italic;
  color: var(--muted);
}

.auto-chat-quick-label {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auto-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.auto-chat-quick {
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(20, 33, 38, 0.14);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #f6f9f8;
  font-size: 0.8rem;
  font-weight: 700;
  transition: border-color 220ms ease, color 220ms ease, transform 220ms ease, background 220ms ease;
}

body.ui-theme-dark .auto-chat-quick {
  border-color: rgba(255, 255, 255, 0.16);
  color: #d2dfe5;
  background: rgba(255, 255, 255, 0.08);
}

.auto-chat-quick:hover,
.auto-chat-quick:focus-visible {
  border-color: rgba(8, 123, 112, 0.45);
  color: var(--teal-dark);
  background: #ffffff;
  transform: translateY(-1px);
}

.auto-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.auto-chat-input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

body.ui-theme-dark .auto-chat-input {
  color: #ecf3f6;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.auto-chat-input:focus {
  outline: 2px solid rgba(10, 168, 150, 0.16);
  border-color: var(--teal);
}

.auto-chat-send {
  min-height: 42px;
  padding: 8px 15px;
  border: 0;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, var(--panel-teal), var(--panel-steel));
  font-weight: 700;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.auto-chat-send:hover,
.auto-chat-send:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(10, 24, 31, 0.24);
}

body.is-menu-open .auto-chat-shell {
  opacity: 0;
  pointer-events: none;
}

@keyframes routeEnter {
  from {
    opacity: 0.35;
    transform: translateY(18px) scale(0.994);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes routeSweep {
  from {
    left: -42%;
  }
  to {
    left: 112%;
  }
}

@keyframes sectionBackgroundFlow {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 0 0, 0 0, 52px 52px, 52px 52px;
  }
}

@keyframes sectionSignalSweep {
  0%, 45% {
    opacity: 0.32;
    transform: translateX(-22%);
    background-position: -360px 0, 0 -180px, 0 0;
  }
  62% {
    opacity: 0.86;
  }
  100% {
    opacity: 0.36;
    transform: translateX(18%);
    background-position: 520px 0, 0 180px, 360px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

body.ui-reduced-motion .route-shell.route-enter,
body.ui-reduced-motion .route-transition.is-active::before {
  animation: none !important;
}

body.ui-reduced-motion .route-transition {
  display: none;
}

@media (max-width: 820px) {
  .section {
    padding: 64px 0;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-title {
    font-size: 1.85rem;
  }

  .auto-chat-shell {
    left: 12px;
    right: auto;
    bottom: 12px;
    width: min(350px, calc(100vw - 24px));
  }

  .auto-chat-trigger-text {
    position: absolute;
  }

  .auto-chat-trigger {
    width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
  }

  .auto-chat-panel {
    width: 100%;
    max-height: 72vh;
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .section {
    padding: 54px 0;
  }

  .section-title {
    font-size: 1.58rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .section-copy {
    font-size: 0.94rem;
  }

  .button {
    width: 100%;
  }

  .auto-chat-shell {
    left: 10px;
    right: auto;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .auto-chat-panel {
    width: min(96vw, 332px);
    padding: 12px;
  }
}
