/* ==========================================================================
   P3 RCM Solutions — site styles
   One stylesheet for the home page and all /platforms pages.
   Type colours: --ink (primary), --ink-muted (secondary), --accent (one accent).
   ========================================================================== */

:root {
  /* Surfaces (light theme) */
  --paper: #fff;
  --paper-soft: #f7fbff;
  --tint: #e8f4fd;
  --tint-strong: #d0eaf9;
  --rule: #dbe5f1;

  /* Type colours */
  --ink: #1a2e46;
  --ink-muted: #4d637f;
  --accent: #1a6fb5;
  --accent-strong: #14578f;

  /* Brand wordmark + status only */
  --brand: #5b21b6;
  --ok: #22a96a;

  /* On dark (footer, CTA) */
  --on-dark: #fff;
  --on-dark-muted: rgba(255, 255, 255, 0.68);
  --on-dark-rule: rgba(255, 255, 255, 0.14);

  /* Type */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;

  /* Layout */
  --nav-h: 72px;
  --pad-x: max(5%, calc((100vw - 1240px) / 2));
  --pad-y: clamp(4rem, 8vw, 7rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--paper-soft); }
::-webkit-scrollbar-thumb { background: var(--accent); }

section { padding: var(--pad-y) var(--pad-x); }

/* ---------- Type ---------- */
h1, h2, h3, h4, h5 { font-feature-settings: "kern" 1, "liga" 1; }

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-label::before { content: ''; width: 2rem; height: 1px; background: currentColor; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-sub {
  max-width: 38rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

/* Asymmetric section header: title left, supporting copy right */
.section-head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 2rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head .section-label { grid-column: 1 / -1; }
.section-head .section-title { grid-column: 1 / 8; }
.section-head .section-sub { grid-column: 9 / -1; }
.section-head .section-title:last-child { grid-column: 1 / -1; }

/* ---------- Buttons ---------- */
.btn-primary,
.btn-outline,
.btn-outline-white {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border: 1.5px solid var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-outline,
.btn-outline-white { background: transparent; color: var(--accent); }
.btn-outline:hover,
.btn-outline-white:hover { background: var(--accent); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Navigation ---------- */
nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow 0.25s;
}
nav.is-scrolled { box-shadow: 0 10px 24px -18px rgba(26, 46, 70, 0.35); }

.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { display: none; } /* legacy hidden logo node */
.logo-text-block { display: flex; flex-direction: column; }
.logo-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand);
}
.logo-tm { font-size: 0.75rem; vertical-align: super; color: var(--ink); }
.logo-tagline-wrap { display: flex; gap: 0.25rem; margin-top: 0.125rem; white-space: nowrap; }
.logo-tagline-wrap span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.logo-tagline-wrap .logo-tagline-violet { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.nav-links li { position: relative; }
.nav-links > li > a,
.nav-pill {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links > li > a:hover,
.nav-pill:hover { color: var(--accent); }

.nav-links > li > a.nav-cta,
.nav-cta {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.625rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 0.2s;
}
.nav-links > li > a.nav-cta:hover,
.nav-cta:hover { background: var(--accent-strong); color: #fff; }

.nav-links-right { display: flex; align-items: center; gap: 0.25rem; }

.dropdown {
  display: none;
  position: absolute;
  top: 100%;           /* flush with the trigger: no hover gap */
  left: 0;
  min-width: 14.5rem;
  padding: 0.5rem 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent);
  box-shadow: 0 18px 32px -20px rgba(26, 46, 70, 0.35);
  z-index: 210;
}
.nav-links li:hover > .dropdown,
.nav-links li:focus-within > .dropdown { display: block; }
.dropdown a {
  display: block;
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  text-decoration: none;
}
.dropdown a:hover { color: var(--accent); background: var(--paper-soft); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0.5rem;
  background: none;
  border: 0;
}
.hamburger span { width: 24px; height: 2px; background: var(--ink); }

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  z-index: 199;
  padding: 0.5rem var(--pad-x) 1rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
}
.mobile-menu a:last-child { border-bottom: 0; color: var(--accent); font-weight: 600; }

/* ---------- Hero (home) ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-top: calc(var(--nav-h) + 4rem);
  padding-bottom: 5rem;
  background: var(--tint);
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero h1 {
  margin-bottom: 1.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.hero h1 em { font-style: italic; color: var(--accent); }

.hero-intro {
  max-width: 34rem;
  margin-bottom: 2.25rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3.5rem; }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.stat-card { padding: 1.25rem 1.25rem 0 0; }
.stat-card + .stat-card { padding-left: 1.25rem; border-left: 1px solid var(--tint-strong); }
.stat-num {
  display: block;
  margin-bottom: 0.375rem;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.stat-label { font-size: 0.8125rem; line-height: 1.5; color: var(--ink-muted); }

.hero-right { display: flex; justify-content: center; }
.hero-img-container { position: relative; width: 100%; max-width: 31rem; margin-left: auto; }
.hero-img-container::before {
  content: '';
  position: absolute;
  inset: 2.5rem -1.5rem -1.5rem 2.5rem;
  background: var(--tint-strong);
}
.hero-visual-card { position: relative; }
.hero-img {
  width: 100%;
  height: clamp(20rem, 40vw, 30rem);
  object-fit: cover;
  object-position: center 20%;
}

.floating-badge-1,
.floating-badge-2,
.floating-badge-3 {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem 0.625rem 0.625rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.floating-badge-1 { top: 2rem; right: -1.25rem; }
.floating-badge-2 { bottom: 3.5rem; left: -2rem; }
.floating-badge-3 { top: 46%; right: -1.25rem; }
.badge-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background: var(--tint);
  color: var(--accent);
}

/* ---------- Icons: one colour, inherited ---------- */
.service-icon, .why-point-icon, .software-logo, .contact-item-icon, .workflow-icon,
.compliance-box svg { color: var(--accent); }
.service-icon, .why-point-icon, .software-logo, .contact-item-icon, .workflow-icon { display: flex; flex-shrink: 0; }

/* ---------- Services ---------- */
.services-section, .software-section { background: var(--paper-soft); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.5rem 3rem;
}
.service-card { padding-top: 1.5rem; border-top: 1px solid var(--ink); }
.service-card:nth-child(3n + 2) { margin-top: 3rem; } /* deliberate stagger */
.service-icon { margin-bottom: 1.25rem; }
.service-icon svg { width: 1.75rem; height: 1.75rem; }
.service-card h3 {
  margin-bottom: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.service-card p { font-size: 0.9375rem; line-height: 1.65; color: var(--ink-muted); }
.service-tag {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Why us ---------- */
.why-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}
.why-grid .section-sub { margin-top: 1.25rem; }
.why-points { margin-top: 2.5rem; border-bottom: 1px solid var(--rule); }
.why-point {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.375rem 0;
  border-top: 1px solid var(--rule);
}
.why-point-icon { padding-top: 0.125rem; }
.why-point-icon svg { width: 1.5rem; height: 1.5rem; }
.why-point h4 { margin-bottom: 0.25rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.why-point p { font-size: 0.9375rem; line-height: 1.6; color: var(--ink-muted); }

.why-image-side { position: sticky; top: calc(var(--nav-h) + 2rem); }
.why-img { width: 100%; height: clamp(20rem, 36vw, 28rem); object-fit: cover; }
.why-metrics { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ink); }
.why-metric { padding: 1.25rem 1.25rem 1.25rem 0; }
.why-metric + .why-metric { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.why-metric-mark { font-family: var(--font-mono); font-size: 0.875rem; font-weight: 500; color: var(--accent); }
.why-metric-label { font-size: 0.9375rem; font-weight: 600; }

/* ---------- Platforms (home) ---------- */
.platform-toggle {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}
.platform-details { max-width: 44rem; margin: 0 0 3rem; }
.platform-accordion { border-top: 1px solid var(--ink); }
.platform-item { border-bottom: 1px solid var(--rule); cursor: pointer; }
.platform-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
}
.platform-arrow { font-size: 0.875rem; color: var(--accent); transition: transform 0.2s; }
.platform-item.open .platform-arrow { transform: rotate(90deg); }
.platform-item-body { display: none; padding: 0 0 1.25rem; font-size: 0.9375rem; line-height: 1.7; color: var(--ink-muted); }
.platform-item.open .platform-item-body { display: block; }

.software-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.software-card { position: relative; padding: 2rem 1.5rem; transition: background-color 0.2s; }
.software-card + .software-card { border-left: 1px solid var(--rule); }
.software-card:hover { background: var(--tint); }
.software-logo { margin-bottom: 1.25rem; }
.software-logo svg { width: 2rem; height: 2rem; }
.software-card h4 { margin-bottom: 0.25rem; font-size: 1rem; font-weight: 600; }
.software-card h4 a { text-decoration: none; }
.software-card h4 a::after { content: ''; position: absolute; inset: 0; } /* whole tile is the link */
.software-card p { font-size: 0.875rem; color: var(--ink-muted); }

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; align-items: start; }
.process-step { padding-top: 1.25rem; border-top: 1px solid var(--ink); }
.process-step:nth-child(2) { margin-top: 1.5rem; }
.process-step:nth-child(3) { margin-top: 3rem; }
.process-step:nth-child(4) { margin-top: 4.5rem; }
.step-num {
  margin-bottom: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.process-step h3 {
  margin-bottom: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.process-step p { font-size: 0.9375rem; line-height: 1.65; color: var(--ink-muted); }

/* ---------- Contact ---------- */
.contact-section { border-top: 1px solid var(--rule); }
.contact-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.375rem 0;
  border-top: 1px solid var(--rule);
}
.contact-item:first-child { border-top-color: var(--ink); }
.contact-item-icon svg { width: 1.375rem; height: 1.375rem; }
.contact-item h4 { margin-bottom: 0.125rem; font-size: 1rem; font-weight: 600; }
.contact-item p { font-size: 0.9375rem; color: var(--ink-muted); }
.contact-photo { margin-top: 1.5rem; }
.contact-photo img { width: 100%; height: 13.75rem; object-fit: cover; }

.contact-form {
  padding: clamp(1.75rem, 4vw, 3rem);
  background: var(--paper-soft);
  border-top: 3px solid var(--accent);
}
.contact-form h3 {
  margin-bottom: 2rem;
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-muted);
  border-radius: 0;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--ink-muted); opacity: 0.7; }
.form-group textarea { min-height: 6.5rem; resize: vertical; }
.form-note { margin-top: 1rem; font-size: 0.8125rem; text-align: center; color: var(--ink-muted); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Footer ---------- */
footer { padding: 4.5rem var(--pad-x) 1.5rem; background: var(--ink); color: var(--on-dark); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; padding-bottom: 3.5rem; }
.footer-logo-row { display: flex; align-items: center; gap: 1.125rem; margin-bottom: 1.25rem; }
.footer-logo-img { height: 4rem; width: auto; padding: 0.5rem; background: var(--paper); object-fit: contain; flex-shrink: 0; }
.footer-logo-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--on-dark); }
.footer-logo-tm { font-size: 0.6875rem; vertical-align: super; color: var(--on-dark); }
.footer-tagline-wrap { display: flex; gap: 0.25rem; margin-top: 0.125rem; }
.footer-tagline-wrap span { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; color: var(--on-dark-muted); }
.footer-tagline-wrap .footer-tagline-black,
.footer-tagline-wrap .footer-tagline-violet { color: var(--on-dark); }

.footer-col h5 {
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.footer-col a {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  color: var(--on-dark);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.footer-col a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 0.25em; }
.footer-col p { max-width: 24rem; font-size: 0.9375rem; line-height: 1.7; color: var(--on-dark-muted); }

.footer-bottom, .footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.footer-bottom { align-items: center; padding-top: 1.5rem; border-top: 1px solid var(--on-dark-rule); font-size: 0.8125rem; color: var(--on-dark-muted); }
.footer-inner { align-items: center; padding-bottom: 1.75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { font-size: 0.8125rem; font-weight: 500; color: var(--on-dark-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--on-dark); }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease, ease), transform 0.6s var(--ease, ease);
}
.js .fade-up.visible { opacity: 1; transform: none; }

/* ---------- Chat widget ---------- */
#chatbot-bubble { position: fixed; right: 2rem; bottom: 2rem; z-index: 500; }
#chat-toggle {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--accent);
  border: 0;
  font-size: 1.5rem;
  color: #fff;
  transition: background-color 0.2s;
}
#chat-toggle:hover { background: var(--accent-strong); }
.chat-notification {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
}

#chat-window {
  display: none;
  position: fixed;
  right: 2rem;
  bottom: 6.5rem;
  z-index: 500;
  flex-direction: column;
  width: 23.75rem;
  height: min(38.75rem, calc(100svh - 8rem));
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  box-shadow: 0 28px 56px -24px rgba(26, 46, 70, 0.4);
}
#chat-window.open { display: flex; }

.chat-header { display: flex; align-items: center; gap: 0.875rem; padding: 1rem 1.25rem; background: var(--accent); color: #fff; }
.chat-avatar { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; background: rgba(255, 255, 255, 0.18); flex-shrink: 0; }
.chat-header-info h4 { margin-bottom: 0.125rem; font-size: 1rem; font-weight: 600; }
.chat-online { display: flex; align-items: center; gap: 0.375rem; font-size: 0.6875rem; }
.chat-online-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: pulse 2s infinite; }
.chat-close { margin-left: auto; padding: 0.25rem 0.5rem; background: none; border: 0; font-size: 1.25rem; color: #fff; opacity: 0.8; }
.chat-close:hover { opacity: 1; }

.chat-messages { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.875rem; padding: 1.125rem; overflow-y: auto; }
.msg { max-width: 86%; animation: msg-in 0.3s ease; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg-bot { align-self: flex-start; }
.msg-user { align-self: flex-end; }
.msg-bubble { padding: 0.75rem 1rem; font-size: 0.875rem; line-height: 1.55; overflow-wrap: anywhere; }
.msg-bot .msg-bubble { background: var(--tint); color: var(--ink); }
.msg-user .msg-bubble { background: var(--accent); color: #fff; }
.msg-time { margin-top: 0.25rem; font-size: 0.6875rem; color: var(--ink-muted); }
.msg-user .msg-time { text-align: right; }

.quick-questions { max-height: 7.5rem; overflow-y: auto; padding: 0.875rem 1.125rem; background: var(--paper-soft); border-top: 1px solid var(--rule); }
.quick-questions p { margin-bottom: 0.625rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.quick-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quick-btn { padding: 0.375rem 0.75rem; background: var(--paper); border: 1px solid var(--accent); font-size: 0.75rem; font-weight: 600; color: var(--accent); transition: background-color 0.2s, color 0.2s; }
.quick-btn:hover { background: var(--accent); color: #fff; }

.chat-input-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.125rem; border-top: 1px solid var(--rule); }
#chat-input { flex: 1; min-width: 0; padding: 0.625rem 0; background: transparent; border: 0; border-bottom: 1px solid var(--ink-muted); font-size: 0.875rem; outline: none; }
#chat-input:focus { border-color: var(--accent); }
#chat-send { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; background: var(--accent); border: 0; color: #fff; flex-shrink: 0; transition: background-color 0.2s; }
#chat-send:hover { background: var(--accent-strong); }

.typing-indicator { display: flex; align-items: center; gap: 0.375rem; width: fit-content; padding: 0.875rem 1rem; background: var(--tint); }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); animation: typing 1.2s ease infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.4; } 40% { opacity: 1; } }

/* ==========================================================================
   Platform pages
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: var(--nav-h);
  padding: 1rem var(--pad-x);
  border-bottom: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.breadcrumb a { color: var(--accent); font-weight: 500; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-current { color: var(--ink); font-weight: 600; }

.platform-hero { padding: clamp(3.5rem, 7vw, 5.5rem) var(--pad-x); background: var(--tint); }
.hero-inner { max-width: 54rem; }
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.platform-hero h1 {
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.125rem, 4.4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.platform-hero h1 em { font-style: italic; color: var(--accent); }
.platform-hero-sub { max-width: 40rem; margin-bottom: 2.25rem; font-size: 1.0625rem; line-height: 1.75; color: var(--ink-muted); }
.platform-hero .hero-actions { margin-bottom: 0; }

.page-content { padding: clamp(3rem, 6vw, 5rem) var(--pad-x); }
.content-grid { display: grid; grid-template-columns: 1fr 20rem; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.content-grid .section-title { margin-bottom: 0.875rem; font-size: clamp(1.75rem, 3vw, 2.375rem); }
.content-grid .section-sub { margin-bottom: 2.5rem; font-size: 1rem; }

.workflows-title { margin-bottom: 0.5rem; font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.workflow-grid { border-bottom: 1px solid var(--rule); }
.workflow-card { display: flex; align-items: flex-start; gap: 1.25rem; padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.workflow-card:first-child { border-top-color: var(--ink); }
.workflow-icon { padding-top: 0.125rem; }
.workflow-icon svg { width: 1.375rem; height: 1.375rem; }
.workflow-text h4 { margin-bottom: 0.25rem; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.workflow-text p { font-size: 0.9375rem; line-height: 1.6; color: var(--ink-muted); }

.accent-callout { margin-top: 2.5rem; padding: 1.5rem 1.75rem; background: var(--tint); border-left: 3px solid var(--accent); }
.accent-callout p { font-size: 1.0625rem; font-weight: 500; line-height: 1.6; color: var(--ink); }

.sidebar { display: flex; flex-direction: column; gap: 2rem; position: sticky; top: calc(var(--nav-h) + 2rem); }
.sidebar-card { padding-top: 1.25rem; border-top: 1px solid var(--ink); }
.sidebar-card h3 { margin-bottom: 0.875rem; font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; }
.platform-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0 0.625rem 0.875rem;
  border-left: 2px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.platform-link:hover { color: var(--accent); }
.platform-link.active { border-left-color: var(--accent); color: var(--accent); font-weight: 600; }
.platform-link-icon { display: grid; place-items: center; width: 1.75rem; font-size: 0.9375rem; }

.cta-box { padding: 1.75rem 1.5rem; background: var(--ink); color: var(--on-dark); }
.cta-box h3 { margin-bottom: 0.625rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.cta-box p { margin-bottom: 1.25rem; font-size: 0.875rem; line-height: 1.6; color: var(--on-dark-muted); }
.cta-box a { display: block; padding: 0.75rem 1.25rem; background: var(--paper); color: var(--ink); font-size: 0.9375rem; font-weight: 600; text-align: center; text-decoration: none; transition: background-color 0.2s; }
.cta-box a:hover { background: var(--tint); }

.compliance-box { display: flex; align-items: center; gap: 0.75rem; }
.compliance-box svg { flex-shrink: 0; }
.compliance-box p { font-size: 0.8125rem; font-weight: 500; line-height: 1.5; color: var(--ink-muted); }

.advantage-section { padding: clamp(3rem, 6vw, 5rem) var(--pad-x); background: var(--paper-soft); border-top: 1px solid var(--rule); }
.advantage-inner { max-width: 50rem; }
.advantage-label { margin-bottom: 0.875rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.advantage-title { margin-bottom: 1.125rem; font-family: var(--font-display); font-size: clamp(1.625rem, 2.8vw, 2.25rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.advantage-text { max-width: 42rem; font-size: 1.0625rem; line-height: 1.75; color: var(--ink-muted); }

footer .footer-logo-name { font-size: 1.25rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .software-grid { grid-template-columns: repeat(3, 1fr); }
  .software-card:nth-child(3n + 1) { border-left: 0; }
  .software-card:nth-child(n + 4) { border-top: 1px solid var(--rule); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card:nth-child(3n + 2) { margin-top: 0; }
  .service-card:nth-child(even) { margin-top: 3rem; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .process-step:nth-child(n) { margin-top: 0; }
  .process-step:nth-child(even) { margin-top: 2rem; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .section-head .section-title,
  .section-head .section-sub { grid-column: 1 / -1; }
  .section-head .section-sub { margin-top: 1.25rem; }

  .hero { grid-template-columns: 1fr; padding-top: calc(var(--nav-h) + 3rem); }
  .hero-right { display: none; }
  .why-grid, .contact-grid { grid-template-columns: 1fr; }
  .why-image-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }

  .content-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .cta-box { grid-column: 1 / -1; }

  #chatbot-bubble { right: 1.25rem; bottom: 1.25rem; }
  #chat-window { right: 1.25rem; bottom: 5.5rem; width: calc(100vw - 2.5rem); }
}

@media (max-width: 600px) {
  .services-grid, .process-grid { grid-template-columns: 1fr; }
  .service-card:nth-child(n), .process-step:nth-child(n) { margin-top: 0; }
  .software-grid { grid-template-columns: 1fr 1fr; }
  .software-card:nth-child(n) { border-left: 0; border-top: 1px solid var(--rule); }
  .software-card:nth-child(-n + 2) { border-top: 0; }
  .software-card:nth-child(even) { border-left: 1px solid var(--rule); }
  .hero-stats { grid-template-columns: 1fr; }
  .stat-card:nth-child(n) { padding: 1rem 0; border-left: 0; }
  .stat-card + .stat-card { border-top: 1px solid var(--tint-strong); }
  .footer-grid, .form-row, .sidebar { grid-template-columns: 1fr; }
  .form-row { gap: 0; }
  .nav-pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
