* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  color-scheme: light;
}

body.customer-surface {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f4f8fb;
  color: var(--rn-ink);
  font-family: var(--rn-font);
  font-size: 15px;
}

body.customer-surface :is(button, textarea, input) {
  font: inherit;
}

body.customer-surface :is(a, button) {
  touch-action: manipulation;
}

body.customer-surface :is(a, button, textarea):focus-visible {
  outline: 3px solid rgba(32, 165, 218, 0.28);
  outline-offset: 2px;
}

@keyframes rnSurfaceEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rnHeaderEnter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rn-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid #e0e9f0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 12px rgba(21, 59, 118, 0.05);
  animation: rnHeaderEnter var(--rn-motion-slow) var(--rn-ease-out) both;
}

.rn-header-inner {
  width: min(var(--rn-content-max), calc(100vw - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.rn-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--rn-brand-strong);
  text-decoration: none;
}

.rn-brand-logo {
  display: block;
  width: 144px;
  height: auto;
  flex: 0 0 auto;
}

.rn-product-name {
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--rn-line);
}

.rn-product-name strong,
.rn-product-name span {
  display: block;
}

.rn-product-name strong {
  color: var(--rn-brand);
  font-size: 15px;
  line-height: 1.35;
}

.rn-product-name span {
  margin-top: 2px;
  color: var(--rn-muted);
  font-size: 11px;
  line-height: 1.3;
}

.rn-site-nav {
  display: flex;
  align-items: center;
  gap: 25px;
  white-space: nowrap;
}

.rn-site-nav a {
  position: relative;
  color: var(--rn-brand);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--rn-motion-fast) ease;
}

.rn-site-nav a:hover {
  color: var(--rn-accent);
}

.rn-site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--rn-accent);
  transform: translateX(-50%);
}

.rn-header-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rn-brand);
  border-radius: var(--rn-radius-md);
  padding: 7px 12px;
  color: var(--rn-brand);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--rn-motion-fast) var(--rn-ease-out),
    color var(--rn-motion-fast) ease,
    border-color var(--rn-motion-fast) ease,
    background var(--rn-motion-fast) ease;
}

.rn-header-action:hover {
  transform: translateY(-1px);
  border-color: var(--rn-accent);
  color: var(--rn-brand-strong);
  background: var(--rn-accent-soft);
}

.rn-eyebrow {
  margin: 0 0 8px;
  color: var(--rn-accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.rn-page-title {
  margin: 0;
  color: var(--rn-brand-strong);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.22;
}

.rn-lead {
  margin: 14px 0 0;
  color: var(--rn-muted);
  font-size: 14px;
  line-height: 1.8;
}

.rn-section-kicker {
  margin: 0;
  color: var(--rn-brand);
  font-size: 18px;
  font-weight: 700;
}

.rn-site-footer {
  border-top: 1px solid #dfe8ee;
  background: #edf4f8;
}

.rn-footer-inner {
  width: min(var(--rn-content-max), calc(100vw - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--rn-muted);
  font-size: 12px;
}

.rn-footer-inner a {
  color: var(--rn-brand);
  text-decoration: none;
}

/* Standalone consultation page */
.standalone-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.standalone-main {
  width: min(var(--rn-content-max), calc(100vw - 40px));
  min-height: 0;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
}

.consultation-rail,
.standalone-chat-stage,
.inline-intro,
.inline-workspace,
.floating-intro-band,
.service-directory {
  animation: rnSurfaceEnter var(--rn-motion-slow) var(--rn-ease-out) both;
}

.standalone-chat-stage,
.inline-workspace,
.service-directory {
  animation-delay: 70ms;
}

.consultation-rail {
  min-width: 0;
  padding: 10px 26px 10px 2px;
  border-right: 1px solid var(--rn-line);
}

.consultation-rail .rn-page-title {
  font-size: 30px;
}

.consultation-scope {
  margin: 24px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--rn-line);
  border-bottom: 1px solid var(--rn-line);
  color: var(--rn-muted);
  font-size: 12px;
  line-height: 1.7;
}

.consultation-scope strong {
  display: block;
  margin-bottom: 2px;
  color: var(--rn-brand-strong);
  font-size: 13px;
}

.consultation-kiki {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--rn-line);
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
}

.consultation-kiki img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transform-origin: 42% 82%;
  filter: drop-shadow(0 5px 8px rgba(21, 59, 118, 0.14));
  transition: transform var(--rn-motion-base) var(--rn-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .consultation-kiki:hover img {
    transform: translateY(-2px) rotate(-2deg);
  }
}

.consultation-kiki figcaption {
  color: var(--rn-muted);
  font-size: 12px;
  line-height: 1.55;
}

.consultation-kiki strong {
  display: block;
  margin-bottom: 3px;
  color: var(--rn-brand);
  font-size: 13px;
}

.standalone-chat-stage {
  min-width: 0;
  min-height: 0;
}

#ribonext-standalone-chat,
#ribonext-inline-chat {
  min-width: 0;
  height: 100%;
}

#ribonext-standalone-chat ribonext-chat-widget,
#ribonext-inline-chat ribonext-chat-widget {
  --rnw-font: var(--rn-font);
  display: block;
  height: 100%;
}

/* Inline full-width service-page component */
.inline-page {
  background: #fff;
}

.inline-main {
  width: min(var(--rn-content-max), calc(100vw - 40px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.inline-intro {
  max-width: 820px;
  padding-bottom: 24px;
}

.inline-intro .rn-page-title {
  font-size: clamp(26px, 3vw, 36px);
}

.inline-workspace {
  min-height: 650px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  border: 1px solid var(--rn-line);
  border-radius: var(--rn-radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--rn-shadow-sm);
}

.inline-topic-rail {
  padding: 22px 18px;
  border-right: 1px solid var(--rn-line);
  background: #f3f8fb;
}

.inline-topic-rail h2 {
  margin: 0 0 6px;
  color: var(--rn-brand-strong);
  font-size: 16px;
}

.inline-topic-rail > p {
  margin: 0 0 18px;
  color: var(--rn-muted);
  font-size: 12px;
  line-height: 1.55;
}

.inline-topic-list {
  display: grid;
  gap: 8px;
}

.inline-topic-list button {
  min-height: 44px;
  border: 1px solid #d5e3ec;
  border-radius: var(--rn-radius-md);
  padding: 9px 10px;
  color: var(--rn-brand-strong);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--rn-motion-fast) var(--rn-ease-out),
    border-color var(--rn-motion-fast) ease,
    background var(--rn-motion-fast) ease;
}

.inline-topic-list button:hover {
  transform: translateX(2px);
  border-color: rgba(32, 165, 218, 0.72);
  background: #f7fcfe;
}

.inline-topic-list button:active {
  transform: translateX(1px) scale(0.992);
}

.inline-chat-stage {
  min-width: 0;
  min-height: 0;
  padding: 0;
}

/* Floating-widget host page */
.floating-page {
  min-height: 150vh;
  background: #f6f9fb;
}

.floating-main {
  width: min(var(--rn-content-max), calc(100vw - 40px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

.floating-intro-band {
  min-height: 280px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rn-line);
}

.floating-intro-copy {
  max-width: 820px;
}

.service-directory {
  padding-top: 32px;
}

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

.service-directory-head p {
  margin: 0;
  color: var(--rn-muted);
  font-size: 12px;
}

.service-row {
  min-height: 92px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  border-top: 1px solid var(--rn-line);
  padding: 18px 0;
  transition: background var(--rn-motion-fast) ease;
}

.service-row:last-child {
  border-bottom: 1px solid var(--rn-line);
}

.service-row strong {
  color: var(--rn-brand-strong);
  font-size: 16px;
}

.service-row span {
  color: var(--rn-muted);
  font-size: 13px;
  line-height: 1.65;
}

.service-row a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: var(--rn-brand);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition:
    color var(--rn-motion-fast) ease,
    transform var(--rn-motion-fast) var(--rn-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .rn-site-nav a:hover,
  .rn-footer-inner a:hover {
    color: var(--rn-accent);
  }

  .rn-header-action:hover {
    color: #fff;
    background: var(--rn-brand);
  }

  .inline-topic-list button:hover {
    border-color: var(--rn-accent);
    background: #f8fcfe;
  }

  .service-row:hover {
    background: #f8fbfd;
  }

  .service-row:hover a {
    color: var(--rn-accent);
    transform: translateX(2px);
  }
}

@media (max-width: 1020px) {
  .rn-product-name,
  .rn-header-action {
    display: none;
  }

  .standalone-main {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
  }

  .consultation-rail {
    padding-right: 18px;
  }
}

@media (max-width: 780px) {
  .rn-header-inner,
  .standalone-main,
  .inline-main,
  .floating-main,
  .rn-footer-inner {
    width: calc(100vw - 24px);
  }

  .rn-header-inner {
    min-height: 64px;
  }

  .rn-brand-logo {
    width: 132px;
  }

  .rn-site-nav {
    display: none;
  }

  .standalone-main {
    padding: 14px 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .consultation-rail {
    padding: 2px 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--rn-line);
  }

  .consultation-rail .rn-page-title {
    font-size: 24px;
  }

  .consultation-rail .rn-lead {
    margin-top: 8px;
    line-height: 1.65;
  }

  .consultation-scope,
  .consultation-kiki {
    display: none;
  }

  .standalone-chat-stage {
    min-height: calc(100dvh - 260px);
  }

  .inline-main {
    padding: 22px 0 28px;
  }

  .inline-intro {
    padding-bottom: 18px;
  }

  .inline-workspace {
    min-height: 720px;
    grid-template-columns: 1fr;
  }

  .inline-topic-rail {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--rn-line);
  }

  .inline-topic-rail > p {
    margin-bottom: 10px;
  }

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

  .inline-topic-list button {
    font-size: 12px;
    text-align: center;
  }

  .floating-main {
    padding-top: 18px;
  }

  .floating-intro-band {
    min-height: 250px;
  }

  .floating-intro-band .rn-page-title {
    font-size: 30px;
  }

  .service-row {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
  }

  .service-row a {
    display: none;
  }

  .rn-footer-inner {
    min-height: 58px;
  }
}

@media (max-width: 520px) {
  .rn-product-name {
    display: none;
  }

  .rn-page-title {
    font-size: 26px;
  }

  .inline-topic-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .inline-topic-list button {
    min-height: 44px;
    padding: 6px;
    font-size: 11px;
  }

  .standalone-chat-stage {
    min-height: calc(100dvh - 206px);
  }

  .inline-workspace {
    min-height: 680px;
  }

  .floating-intro-band {
    min-height: 270px;
  }

  .service-directory-head {
    align-items: start;
    flex-direction: column;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .rn-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 12px 0;
  }
}

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