:root {
  --brand-primary: #4c5e6b;
  --brand-accent: #fce9a5;
  --bg-page: #f7f9fb;
  --bg-surface: #ffffff;
  --bg-soft: #eef2f5;
  --bg-accent-soft: #fff7da;
  --text-primary: #1f2a33;
  --text-secondary: #5f6f7a;
  --text-muted: #8a98a3;
  --border-light: #e4e9ee;
  --border-default: #d3dce3;
  --border-strong: #b7c4ce;
  --success: #1f9d72;
  --warning: #e6a23c;
  --error: #d64545;
  --info: #3a7ca5;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, rgba(252, 233, 165, 0.65), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(58, 124, 165, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(247, 249, 251, 1));
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: 2rem auto auto 50%;
  width: 28rem;
  height: 28rem;
  border-radius: 9999px;
  background: rgba(252, 233, 165, 0.25);
  filter: blur(90px);
  transform: translateX(-10%);
  z-index: -1;
}

.stack-card {
  border: 1px solid var(--border-default);
  border-radius: 1.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  padding: 1.5rem;
}

.stack-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.stack-title {
  margin-top: 0.85rem;
  color: var(--text-primary);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.stack-copy {
  margin-top: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.flow-card {
  border: 1px solid var(--border-default);
  border-radius: 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  padding: 1.25rem;
}

.flow-index {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.flow-title {
  margin-top: 0.8rem;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
}

.flow-copy {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.projection-card {
  border-radius: 1.5rem;
  padding: 1.25rem;
}

.projection-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.projection-value {
  margin-top: 0.75rem;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
}

a[class*="bg-white"][class*="text-brand-primary"],
button[class*="bg-white"][class*="text-brand-primary"] {
  border: 1.5px solid var(--brand-primary);
}

a[class*="bg-white"][class*="text-brand-secondary"],
button[class*="bg-white"][class*="text-brand-secondary"] {
  border: 1.5px solid var(--text-secondary);
}

a[class*="bg-white"][class*="text-brand-muted"],
button[class*="bg-white"][class*="text-brand-muted"] {
  border: 1.5px solid var(--text-muted);
}

a[class*="bg-white"][class*="text-brand-ink"],
button[class*="bg-white"][class*="text-brand-ink"] {
  border: 1.5px solid var(--text-primary);
}

.infinirya-login-mark {
  display: inline-flex;
  width: 1.25em;
  height: 0.7em;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: currentColor;
  transform: translateY(0.02em);
}

.infinirya-login-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.login-action-button {
  min-height: 1.75rem !important;
  gap: 0.3rem !important;
  padding: 0.32rem 0.75rem !important;
  line-height: 1 !important;
}

.login-action-button .infinirya-login-mark {
  width: 2.56rem;
  height: 1.52rem;
  transform: translateY(0);
}

.robot-advisor-bubble {
  --robot-bubble-bg: #1f6f8a;
  --robot-bubble-border: #0d2d3a;
  position: relative;
  display: flex;
  max-width: min(100%, 34rem);
  align-items: flex-start;
  gap: 0.75rem;
  border: 2px solid var(--robot-bubble-border);
  border-radius: 0.95rem;
  background: var(--robot-bubble-bg);
  padding: 0.85rem 1rem;
  color: #fff;
  box-shadow: 0 14px 28px rgba(31, 42, 51, 0.16);
}

.robot-advisor-bubble.hidden {
  display: none;
}

.robot-advisor-bubble--plain {
  display: block;
  max-width: min(100%, 34rem);
  border: 0;
  background: transparent;
  padding: 0 !important;
  color: #41576a;
  box-shadow: none;
}

.robot-advisor-bubble::before,
.robot-advisor-bubble::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.robot-advisor-bubble--tail-up::before {
  top: -1rem;
  left: 1.75rem;
  border-right: 1rem solid transparent;
  border-bottom: 1rem solid var(--robot-bubble-border);
  border-left: 1rem solid transparent;
}

.robot-advisor-bubble--tail-up::after {
  top: -0.7rem;
  left: 1.95rem;
  border-right: 0.8rem solid transparent;
  border-bottom: 0.8rem solid var(--robot-bubble-bg);
  border-left: 0.8rem solid transparent;
}

.robot-advisor-bubble--tail-down::before {
  bottom: -1rem;
  left: 1.75rem;
  border-top: 1rem solid var(--robot-bubble-border);
  border-right: 1rem solid transparent;
  border-left: 1rem solid transparent;
}

.robot-advisor-bubble--tail-down::after {
  bottom: -0.7rem;
  left: 1.95rem;
  border-top: 0.8rem solid var(--robot-bubble-bg);
  border-right: 0.8rem solid transparent;
  border-left: 0.8rem solid transparent;
}

.robot-advisor-bubble--tail-right::before {
  left: auto;
  right: 1.75rem;
}

.robot-advisor-bubble--tail-right::after {
  left: auto;
  right: 1.95rem;
}

.robot-advisor-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  display: inline-flex;
  width: 1.85rem;
  height: 1.85rem;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.robot-advisor-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.robot-advisor-bubble--plain .robot-advisor-close,
.robot-advisor-bubble--plain .robot-advisor-icon {
  display: none;
}

.robot-advisor-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1rem;
  line-height: 1;
}

.robot-advisor-text {
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.55;
}

.robot-advisor-bubble--plain .robot-advisor-text {
  padding: 0;
  font-weight: 600;
  color: #41576a;
}

.public-robot-hint {
  --robot-bubble-bg: #1f6f8a;
  --robot-bubble-border: #0d2d3a;
  --public-robot-hint-tail-left: 50%;
  position: fixed;
  z-index: 75;
  width: max-content;
  max-width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.85rem 3rem 0.85rem 1rem;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 120ms ease, transform 120ms ease;
}

.public-robot-hint[hidden] {
  display: none;
}

.public-robot-hint.is-visible {
  opacity: 1;
}

.public-robot-hint::before,
.public-robot-hint::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.public-robot-hint--tail-down::before {
  bottom: -1rem;
  left: calc(var(--public-robot-hint-tail-left) - 1rem);
  border-top: 1rem solid var(--robot-bubble-border);
  border-right: 1rem solid transparent;
  border-left: 1rem solid transparent;
}

.public-robot-hint--tail-down::after {
  bottom: -0.7rem;
  left: calc(var(--public-robot-hint-tail-left) - 0.8rem);
  border-top: 0.8rem solid var(--robot-bubble-bg);
  border-right: 0.8rem solid transparent;
  border-left: 0.8rem solid transparent;
}

.public-robot-hint--tail-up::before {
  top: -1rem;
  left: calc(var(--public-robot-hint-tail-left) - 1rem);
  border-right: 1rem solid transparent;
  border-bottom: 1rem solid var(--robot-bubble-border);
  border-left: 1rem solid transparent;
}

.public-robot-hint--tail-up::after {
  top: -0.7rem;
  left: calc(var(--public-robot-hint-tail-left) - 0.8rem);
  border-right: 0.8rem solid transparent;
  border-bottom: 0.8rem solid var(--robot-bubble-bg);
  border-left: 0.8rem solid transparent;
}

.client-space-navigation-tour {
  --client-space-tour-tail-left: 50%;
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 6.5rem);
  z-index: 55;
  width: min(28rem, calc(100vw - 1.5rem));
  pointer-events: none;
  transform: translateX(-50%);
  animation: client-space-tour-enter 260ms ease-out both;
}

.client-space-navigation-tour.hidden {
  display: none;
}

.client-space-navigation-tour-bubble {
  --client-space-tour-bg: #1f6f8a;
  --client-space-tour-border: #0d2d3a;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 2px solid var(--client-space-tour-border);
  border-radius: 0.95rem;
  background: var(--client-space-tour-bg);
  padding: 0.9rem 3rem 0.9rem 1rem;
  color: #fff;
  box-shadow: 0 18px 42px rgba(31, 42, 51, 0.18);
}

.client-space-navigation-tour-bubble::before,
.client-space-navigation-tour-bubble::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  left: var(--client-space-tour-tail-left);
}

.client-space-navigation-tour-bubble::before {
  bottom: -1rem;
  margin-left: -1rem;
  border-top: 1rem solid var(--client-space-tour-border);
  border-right: 1rem solid transparent;
  border-left: 1rem solid transparent;
}

.client-space-navigation-tour-bubble::after {
  bottom: -0.68rem;
  margin-left: -0.8rem;
  border-top: 0.8rem solid var(--client-space-tour-bg);
  border-right: 0.8rem solid transparent;
  border-left: 0.8rem solid transparent;
}

.client-space-navigation-tour-robot {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.client-space-navigation-tour-text {
  min-width: 0;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.client-space-navigation-tour-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: auto;
  box-shadow: 0 10px 24px rgba(31, 42, 51, 0.28);
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.client-space-navigation-tour-close:hover,
.client-space-navigation-tour-close:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 28px rgba(31, 42, 51, 0.24);
  transform: translateY(-1px);
  outline: none;
}

.client-space-tour-highlight {
  border-color: #4c5e6b !important;
  background: #4c5e6b !important;
  color: #fff !important;
  opacity: 1 !important;
  box-shadow: 0 18px 36px rgba(31, 42, 51, 0.2) !important;
  transform: translateY(-0.25rem) scale(1.05);
}

.client-space-tour-highlight img {
  filter: brightness(0) invert(1);
}

.client-space-next-arrow-blink {
  animation: client-space-next-arrow-blink 0.95s ease-in-out 8;
  transform-origin: center;
}

@keyframes client-space-next-arrow-blink {
  0%,
  100% {
    box-shadow: 0 8px 18px rgba(31, 42, 51, 0.12);
    transform: translateY(0) scale(1);
  }
  45% {
    box-shadow:
      0 0 0 6px rgba(31, 111, 138, 0.18),
      0 16px 34px rgba(31, 42, 51, 0.22);
    transform: translateY(-0.08rem) scale(1.13);
  }
}

@keyframes client-space-tour-enter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(0.8rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@media (max-width: 639px) {
  .client-space-navigation-tour {
    width: min(22rem, calc(100vw - 1rem));
  }

  .client-space-navigation-tour-bubble {
    gap: 0.6rem;
    padding: 0.75rem 2.8rem 0.75rem 0.85rem;
  }

  .client-space-navigation-tour-text {
    font-size: 0.78rem;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .client-space-next-arrow-blink {
    animation: none;
    outline: 2px solid rgba(31, 111, 138, 0.55);
    outline-offset: 3px;
  }
}

.ai-markdown > * + * {
  margin-top: 0.6rem;
}

.ai-markdown h1,
.ai-markdown h2 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.ai-markdown h3,
.ai-markdown h4,
.ai-markdown h5,
.ai-markdown h6 {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.ai-markdown p {
  margin: 0;
}

.ai-markdown ul,
.ai-markdown ol {
  margin-left: 1.1rem;
  padding-left: 0.2rem;
}

.ai-markdown ul {
  list-style: disc;
}

.ai-markdown ol {
  list-style: decimal;
}

.ai-markdown li + li {
  margin-top: 0.25rem;
}

.ai-markdown blockquote {
  border-left: 2px solid var(--border-default);
  padding-left: 0.8rem;
  color: var(--text-muted);
}

.ai-markdown table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: 0.7rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.ai-markdown th,
.ai-markdown td {
  border-top: 1px solid var(--border-light);
  padding: 0.45rem 0.55rem;
  vertical-align: top;
}

.ai-markdown th {
  border-top: 0;
  background: var(--bg-soft);
  color: var(--text-primary);
  font-weight: 800;
}

.ai-markdown code {
  border-radius: 0.35rem;
  background: var(--bg-soft);
  padding: 0.08rem 0.28rem;
  color: var(--text-primary);
  font-size: 0.78rem;
}

.ai-markdown pre {
  overflow-x: auto;
  border-radius: 0.7rem;
  background: var(--bg-soft);
  padding: 0.7rem;
}

.ai-markdown pre code {
  background: transparent;
  padding: 0;
}
