/* SignalUp redesign · Medical-precision visual system
   ───────────────────────────────────────────────── */

:root {
  /* DARK by default — medical-imaging workstation feel.
     Light theme available via [data-theme="light"] for future toggle. */
  --bg:        #0a0e13;
  --paper:     #131822;
  --paper-2:   #1a2030;
  --ink:       #e8ecf0;
  --ink-2:     #aab4c0;
  --ink-3:     #7a8694;
  --ink-4:     #586573;
  --line:      #232c38;
  --line-2:    #1b2330;

  --accent:    #38bdd6;   /* brighter teal — needs to pop on dark bg */
  --accent-2:  #0d2a35;   /* tinted bg for the accent */
  --signal:    #e84a3b;   /* recording / live indicator only */
  --ok:        #2bb673;

  /* Type */
  --sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Radii — small and crisp; medical software, not consumer app */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Sizing */
  --max: 1280px;
  --pad: clamp(20px, 4vw, 56px);

  /* Button — дефолт до того как JS применит палитру */
  --btn-bg:       #0a1f24;
  --btn-fg:       #ffffff;
  --btn-bg-hover: #1a3741;
}

:root[data-theme="light"] {
  /* Original light palette — override only colors. */
  --bg:        #eef2f5;
  --paper:     #ffffff;
  --paper-2:   #f7f9fb;
  --ink:       #0c1620;
  --ink-2:     #364354;
  --ink-3:     #6b7888;
  --ink-4:     #98a3b1;
  --line:      #d6dde4;
  --line-2:    #e6ebef;

  --accent:    #0a6e8c;
  --accent-2:  #d6edf2;
  --signal:    #d63b2e;
  --ok:        #1f8a5b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ───── Layout primitives ───── */
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.row { display: flex; align-items: center; gap: 16px; }
.col { display: flex; flex-direction: column; }

/* ───── Typography ───── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 500;
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  transform: translateY(-1px);
}
.h-display {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.0;
  font-size: clamp(48px, 7.2vw, 112px);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.h-display em {
  font-style: normal;
  color: var(--accent);
}
.h-section {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-size: clamp(36px, 4.5vw, 64px);
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.h-section em {
  font-style: normal;
  color: var(--accent);
}
.lede {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.45;
}
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

/* ───── Hairline / annotation chrome ───── */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  white-space: nowrap;
}
.tag.accent { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); background: var(--accent-2); }

.id-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* corner brackets for technical / viewfinder look */
.brackets { position: relative; }
.brackets::before, .brackets::after,
.brackets > .br-b::before, .brackets > .br-b::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--ink);
  opacity: 0.6;
}
.brackets::before { top: -6px; left: -6px;   border-right: 0; border-bottom: 0; }
.brackets::after  { top: -6px; right: -6px;  border-left: 0;  border-bottom: 0; }
.brackets > .br-b { position: absolute; inset: 0; pointer-events: none; }
.brackets > .br-b::before { bottom: -6px; left: -6px;  border-right: 0; border-top: 0; }
.brackets > .br-b::after  { bottom: -6px; right: -6px; border-left: 0;  border-top: 0; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn .arrow { font-family: var(--mono); font-size: 14px; opacity: 0.9; }

.btn-primary {
  background: #40e0c8 !important;
  color: #0a1f24 !important;
  box-shadow: 0 0 0 0 #40e0c8;
  transition: background 120ms ease, color 120ms ease, box-shadow 200ms ease, transform 80ms ease;
}
.btn-primary:hover {
  background: #2cc8b0 !important;
  box-shadow: 0 6px 18px rgba(64, 224, 200, 0.35);
}
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: color-mix(in oklab, var(--accent) 90%, black); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); }

.btn-sm { padding: 10px 18px; font-size: 13px; border-radius: var(--r-xs); }

/* ───── Header ───── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; height: 64px; gap: 32px; }
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 19px;
}
.brand .signal-mark {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--accent);
  margin-right: 4px;
  transform: translateY(1px);
}
.brand .ver {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  align-self: center;
}
.nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.nav a {
  font-size: 13px;
  color: var(--ink-2);
  transition: color 120ms;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); }
.nav .nav-sep { color: var(--line); }

/* ───── Hero ───── */
.hero {
  padding: clamp(48px, 7vw, 120px) 0 clamp(40px, 6vw, 96px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--bg), color-mix(in oklab, var(--bg) 60%, white) 60%, var(--bg));
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 4vw, 64px);
  align-items: end;
}
.hero-left .eyebrow { margin-bottom: 28px; display: block; }
.hero-left h1 { margin-bottom: 28px; }
.hero-left .lede { margin-bottom: 36px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }

/* Hero inline AI input — primary entry point */
.hero-ai { margin-bottom: 48px; }
.hero-ai-card {
  display: flex;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 1px 0 rgba(12,22,32,0.02), 0 16px 36px -20px rgba(12,22,32,0.25);
  transition: border-color 120ms, box-shadow 120ms;
}
.hero-ai-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(12,22,32,0.02), 0 16px 40px -16px color-mix(in oklab, var(--accent) 50%, transparent);
}
.hero-ai-prefix {
  display: inline-grid; place-items: center;
  width: 44px;
  color: var(--accent);
  flex: 0 0 auto;
}
.hero-ai-card input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 14px 8px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  min-width: 0;
}
.hero-ai-card input::placeholder { color: var(--ink-3); }

.hero-ai-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, transform 80ms;
  white-space: nowrap;
  flex: 0 0 auto;
}
.hero-ai-submit:hover:not(:disabled) { background: var(--btn-bg-hover); }
.hero-ai-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.hero-ai-submit:active:not(:disabled) { transform: translateY(1px); }

.hero-ai-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 0 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-ai-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.hero-ai-alt {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: all 120ms;
}
.hero-ai-alt:hover { color: var(--ink); border-bottom-color: var(--ink); }

@media (max-width: 640px) {
  .hero-ai-card { flex-wrap: wrap; border-radius: 16px; padding: 10px; }
  .hero-ai-prefix { width: 36px; }
  .hero-ai-card input { flex: 1 0 60%; padding: 8px; }
  .hero-ai-submit { width: 100%; justify-content: center; margin-top: 8px; padding: 14px; }
  .hero-ai-meta { padding: 0; }
}

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.hero-stat .num { font-family: var(--sans); font-weight: 600; font-size: 32px; letter-spacing: -0.02em; line-height: 1; }
.hero-stat .lbl { margin-top: 6px; font-size: 12px; color: var(--ink-3); font-family: var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }

/* hero device card */
.device-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: 0 1px 0 rgba(12,22,32,0.02), 0 20px 40px -24px rgba(12,22,32,0.18);
}
.device-photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.device-photo::after {
  /* clinical desaturated overlay */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,22,32,0) 30%, rgba(12,22,32,0.78) 100%);
}

/* Single big metric overlaying the photo */
.device-stat {
  position: absolute;
  left: 24px; right: 24px; bottom: 22px;
  z-index: 2;
  color: #fff;
}
.device-stat-num {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(60px, 7vw, 96px);
  letter-spacing: -0.04em;
  line-height: 0.95;
  display: inline-flex;
  align-items: baseline;
}
.device-stat-num .unit {
  font-size: 0.32em;
  font-weight: 500;
  margin-left: 6px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0;
}
.device-stat-lbl {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}

/* ───── Services ───── */
.section {
  padding: clamp(64px, 8vw, 128px) 0;
  border-bottom: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head .eyebrow { margin-bottom: 16px; display: block; }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.svc-card {
  background: var(--paper);
  padding: 0;
  display: flex; flex-direction: column;
  position: relative;
  transition: background 150ms ease;
}
.svc-card:hover { background: var(--paper-2); }
.svc-photo {
  aspect-ratio: 4 / 3;
  background: var(--paper-2) center/cover no-repeat;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.svc-photo .id-overlay {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: #fff;
  padding: 3px 6px;
  background: rgba(12,22,32,0.72);
  letter-spacing: 0.06em;
  border-radius: 2px;
}
.svc-body {
  padding: 24px;
  display: flex; flex-direction: column;
  flex: 1;
  gap: 12px;
}
.svc-body h3 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 500; }
.svc-body p  { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.svc-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
}
.svc-price { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 500; }
.svc-cta { font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.svc-cta:hover { color: var(--accent); }

/* ───── AI Consultant Section ───── */
.section.consultant-section { background: var(--paper); border-bottom: 1px solid var(--line); }
.consultant-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: stretch;
}
.consultant-aside .eyebrow { display: block; margin-bottom: 16px; }
.consultant-aside h2 { margin: 0 0 16px; }
.consultant-aside p  { color: var(--ink-2); font-size: 15px; }

.suggested {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 24px;
}
.suggested .lbl {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 4px;
}
.sug-btn {
  text-align: left;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 120ms ease;
  display: flex; align-items: center; gap: 10px;
  line-height: 1.35;
}
.sug-btn:hover { border-color: var(--ink); background: var(--paper-2); }
.sug-btn .arrow { font-family: var(--mono); color: var(--ink-3); font-size: 12px; flex: 0 0 auto; }

.chat-frame {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  display: flex; flex-direction: column;
  min-height: 580px;
  position: relative;
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.chat-header .title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.chat-header .status {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chat-header .status .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(31,138,91,0.4);
  animation: pulse 1.8s ease-out infinite;
}
.chat-header.thinking .status .pulse { background: var(--accent); animation: pulse 1.1s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(10,110,140,0.4); }
  60%  { box-shadow: 0 0 0 6px rgba(10,110,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(10,110,140,0); }
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex; flex-direction: column;
  gap: 16px;
  background:
    linear-gradient(var(--paper-2), var(--paper-2)),
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in oklab, var(--line) 50%, transparent) 23px 24px);
  background-blend-mode: normal, multiply;
  background-size: 100% 100%, 100% 24px;
  background-position: 0 0, 0 12px;
  background-repeat: no-repeat, repeat;
}

.msg { max-width: 86%; display: flex; flex-direction: column; gap: 6px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.bot  { align-self: flex-start; }
.msg .bubble {
  font-size: 15px;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: var(--r-md);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.user .bubble {
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.msg.bot .bubble {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 2px;
}
.msg .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.msg .cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cite {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 4px 8px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: all 120ms;
}
.cite:hover { border-color: var(--ink); color: var(--ink); }
.cite .id { color: var(--accent); }

.chat-typing { display: inline-flex; gap: 4px; align-items: center; padding: 16px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); border-bottom-left-radius: 2px; }
.chat-typing .d { width: 6px; height: 6px; background: var(--ink-3); border-radius: 50%; animation: typing 1.2s infinite ease-in-out; }
.chat-typing .d:nth-child(2) { animation-delay: 0.18s; }
.chat-typing .d:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.retrieval-trace {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.retrieval-trace .matched { color: var(--ink); }
.retrieval-trace .chunk { color: var(--accent); }

.chat-input {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  background: var(--paper);
}
.chat-input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 16px 20px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}
.chat-input input::placeholder { color: var(--ink-4); }
.chat-input button {
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms;
}
.chat-input button:hover:not(:disabled) { background: var(--accent); }
.chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }

/* citation preview popover */
.cite-preview {
  position: fixed;
  max-width: 360px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  padding: 16px;
  z-index: 100;
  box-shadow: 0 18px 40px -16px rgba(12,22,32,0.3);
  font-size: 13px;
  line-height: 1.5;
}
.cite-preview .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cite-preview .id { font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.cite-preview .ttl { font-weight: 500; margin-bottom: 6px; }
.cite-preview .body { color: var(--ink-2); }
.cite-preview .close { background: none; border: 0; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0; }

/* ───── AI Hub (unified consultant + calculator) ───── */
.ai-hub.section { background: var(--paper); }

/* Unified AI Helper (Variant B) */
.ai-helper { display: flex; flex-direction: column; gap: 24px; }

.helper-input-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 14px;
  transition: border-color 120ms, background 120ms;
}
.helper-input-card:focus-within {
  border-color: var(--ink);
  background: var(--paper);
}
.helper-input {
  width: 100%;
  resize: vertical;
  border: 0;
  background: transparent;
  outline: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  min-height: 84px;
  padding: 0;
}
.helper-input::placeholder { color: var(--ink-4); }
.helper-input:disabled { opacity: 0.7; }

.helper-input-foot {
  display: flex; align-items: center; gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.helper-hint {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  flex: 1; min-width: 200px;
  line-height: 1.4;
}

.helper-examples { display: flex; flex-direction: column; gap: 10px; }
.helper-examples .lbl {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.helper-examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.helper-status {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-2);
}
.thinking-dots {
  display: inline-flex; gap: 4px; align-items: center;
}
.thinking-dots span {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing 1.2s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.36s; }

/* ── Result card ── */
.result-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 1px 0 rgba(12,22,32,0.02), 0 20px 40px -28px rgba(12,22,32,0.18);
}
.result-head {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-2);
}
.result-tag {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: -0.005em;
}

.result-answer {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.result-notes {
  background: var(--accent-2);
  border-radius: var(--r-sm);
  padding: 14px 18px;
}
.result-notes p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); }

.result-lines { display: flex; flex-direction: column; }
.result-line {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.result-line:last-child { border-bottom: 0; }
.result-line-main { flex: 1; }
.result-line-name { font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.35; margin-bottom: 4px; }
.result-line-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.result-line-sum { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--ink); white-space: nowrap; }

.result-total {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.result-total .lbl,
.result-monthly .lbl {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 4px;
}
.result-monthly { text-align: right; }
.result-cta {
  justify-content: center; padding: 16px;
  font-size: 15px;
}
.result-disclaimer {
  margin: 0; font-size: 11px;
  font-family: var(--mono); letter-spacing: 0.04em;
  color: var(--ink-3); line-height: 1.4;
}

/* ── Sources fold (collapsible) ── */
.sources-fold {
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
}
.sources-fold-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--ink-3);
  padding: 4px 0;
  transition: color 120ms;
}
.sources-fold-toggle:hover { color: var(--ink); }
.sources-fold-toggle svg { color: var(--ink-4); flex: 0 0 auto; }
.sources-fold-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 1px 7px;
}
.sources-fold-list {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.sources-fold-list .cite {
  font-family: var(--sans);
  font-size: 12px;
}

/* ── Source modal ── */
.source-modal-bg {
  position: fixed; inset: 0;
  background: rgba(12,22,32,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 200;
  padding: 24px;
}
.source-modal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px -24px rgba(12,22,32,0.4);
}
.source-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.source-modal-head .id {
  font-family: var(--mono); font-size: 11px;
  color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase;
}
.source-modal-head .close {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-3); font-size: 22px; line-height: 1;
  padding: 4px 8px; border-radius: 4px;
  transition: all 120ms;
}
.source-modal-head .close:hover { background: var(--paper-2); color: var(--ink); }
.source-modal-title { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 10px; }
.source-modal-body { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.source-modal-price {
  margin-top: 12px;
  font-family: var(--mono); font-size: 13px;
  color: var(--accent);
}

/* ── Manual fallback ── */
.helper-manual {
  border-top: 1px solid var(--line-2);
  padding-top: 20px;
}
.helper-manual-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--ink-3);
  padding: 4px 0;
  letter-spacing: 0.01em;
  transition: color 120ms;
}
.helper-manual-toggle:hover { color: var(--ink); }
.helper-manual-body {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.manual-total {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}
.manual-total .lbl {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 4px;
}

@media (max-width: 640px) {
  .helper-examples-grid { grid-template-columns: 1fr; }
  .result-total { flex-direction: column; align-items: flex-start; }
  .result-monthly { text-align: left; }
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.calc-left, .calc-right { display: flex; flex-direction: column; }

.calc-mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  margin-bottom: 20px;
  overflow: hidden;
}
.calc-mode {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 16px;
  background: transparent;
  color: var(--ink-3);
  border: 0;
  cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500;
  transition: background 120ms, color 120ms;
}
.calc-mode + .calc-mode { border-left: 1px solid var(--line); }
.calc-mode.is-active { background: var(--paper); color: var(--ink); }
.calc-mode .mode-id {
  font-family: var(--mono); font-size: 11px;
  display: inline-grid; place-items: center;
  width: 20px; height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-3);
}
.calc-mode.is-active .mode-id { border-color: var(--accent); color: var(--accent); }

/* AI mode */
.calc-ai { display: flex; flex-direction: column; gap: 16px; }
.calc-ai-input {
  width: 100%; resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 15px; line-height: 1.5;
  color: var(--ink);
  outline: 0;
  transition: border-color 120ms;
  min-height: 120px;
}
.calc-ai-input:focus { border-color: var(--ink); background: var(--paper); }
.calc-ai-input::placeholder { color: var(--ink-4); }

.calc-ai-row { display: flex; align-items: center; gap: 12px; }
.calc-ai-hint { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.calc-ai-help { font-size: 12px; color: var(--ink-3); font-family: var(--mono); letter-spacing: 0.04em; line-height: 1.5; }

.calc-examples { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.calc-examples .lbl { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }

.calc-error {
  border: 1px solid var(--signal);
  background: color-mix(in oklab, var(--signal) 8%, var(--paper));
  color: var(--ink);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
}

/* Pick mode */
.calc-pick { display: flex; flex-direction: column; gap: 16px; }

.calc-cats {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.calc-cat {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  transition: all 120ms;
}
.calc-cat:hover { border-color: var(--ink); color: var(--ink); }
.calc-cat.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.calc-items { display: flex; flex-direction: column; }
.calc-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
  transition: background 120ms;
}
.calc-item:last-child { border-bottom: 0; }
.calc-item.is-active { background: color-mix(in oklab, var(--accent) 4%, transparent); margin: 0 -16px; padding: 16px; border-radius: var(--r-sm); }
.calc-item-main { flex: 1; }
.calc-item-name { font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.calc-item-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); }
.calc-item-price { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }

.qty-stepper {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}
.qty-stepper button {
  width: 32px; height: 32px;
  border: 0; background: transparent;
  color: var(--ink); font-size: 16px;
  cursor: pointer;
  transition: background 120ms;
  font-family: var(--sans);
  display: grid; place-items: center;
}
.qty-stepper button:hover:not(:disabled) { background: var(--paper-2); }
.qty-stepper button:disabled { color: var(--ink-4); cursor: not-allowed; }
.qty-stepper .qty-val {
  min-width: 28px; text-align: center;
  font-size: 14px; font-weight: 500;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Estimate panel */
.calc-estimate {
  position: sticky; top: 96px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex; flex-direction: column;
  gap: 16px;
}
.calc-est-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.calc-lines { display: flex; flex-direction: column; min-height: 120px; }
.calc-empty {
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  letter-spacing: 0.04em;
  padding: 24px 0;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
}
.calc-line {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.calc-line:last-child { border-bottom: 0; }
.calc-line-main { flex: 1; }
.calc-line-name { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 4px; line-height: 1.35; }
.calc-line-meta { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.calc-line-sum { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }

.calc-ai-notes {
  background: var(--accent-2);
  border: 1px solid color-mix(in oklab, var(--accent) 25%, var(--line));
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.calc-ai-notes .lbl {
  font-family: var(--mono); font-size: 10px;
  color: var(--accent); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.calc-ai-notes .lbl .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.calc-ai-notes p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink); }

.calc-total {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.calc-total .lbl {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 4px;
}
.calc-total-val {
  font-family: var(--sans);
  font-size: 40px; font-weight: 600;
  letter-spacing: -0.025em; line-height: 1;
  color: var(--ink);
}
.calc-total-val .cur { font-size: 22px; color: var(--ink-3); margin-left: 4px; }
.calc-monthly { text-align: right; }
.calc-monthly-val { font-family: var(--mono); font-size: 14px; color: var(--ink-2); }

.calc-cta { justify-content: center; padding: 16px; font-size: 15px; }
.calc-cta.is-disabled { opacity: 0.4; pointer-events: none; }
.calc-disclaimer { margin: 0; font-size: 11px; color: var(--ink-3); font-family: var(--mono); letter-spacing: 0.04em; line-height: 1.4; }

@media (max-width: 980px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-estimate { position: static; }
}
.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.doc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.doc-photo { aspect-ratio: 4/5; background: var(--paper-2) center/cover no-repeat; border-bottom: 1px solid var(--line); position: relative; }
.doc-photo .id-overlay { position: absolute; top: 12px; left: 12px; font-family: var(--mono); font-size: 10px; color: #fff; padding: 3px 6px; background: rgba(12,22,32,0.72); letter-spacing: 0.06em; border-radius: 2px; }
.doc-body { padding: 20px; }
.doc-body .role { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.doc-body h3 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.02em; font-weight: 500; }
.doc-body p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.doc-stats { display: flex; gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.doc-stats .stat .num { font-family: var(--sans); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; line-height: 1; }
.doc-stats .stat .lbl { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; }

/* ───── Booking strip ───── */
.book-band {
  background: var(--book-bg, var(--ink));
  color: var(--book-fg, #fff);
  position: relative;
}
.book-band::before {
  /* subtle scanline / measurement grid for the "instrument panel" feel */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 400px at 20% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 119px, color-mix(in oklab, var(--book-fg, #fff) 5%, transparent) 119px 120px);
  pointer-events: none;
  opacity: 0.7;
}
.book-band > * { position: relative; }
.book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: clamp(56px, 7vw, 96px) 0;
}
.book-grid h2 { margin: 0 0 16px; color: var(--book-fg, #fff); font-size: clamp(36px, 4vw, 56px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; }
.book-grid h2 em { font-style: normal; color: var(--book-accent, color-mix(in oklab, var(--accent) 70%, white)); }
.book-grid .lede { color: var(--book-fg-muted, rgba(255,255,255,0.7)); }
.book-grid .eyebrow { color: var(--book-fg-muted, rgba(255,255,255,0.5)); display: block; margin-bottom: 16px; }
.book-grid .eyebrow .dot { background: var(--book-accent, color-mix(in oklab, var(--accent) 70%, white)); }
.book-bullets { color: var(--book-fg-muted, rgba(255,255,255,0.6)); }
.book-form {
  background: var(--paper);
  color: var(--ink);
  padding: 32px;
  border-radius: var(--r-md);
  display: grid;
  gap: 16px;
}
.book-form .field label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.book-form .field input, .book-form .field select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  outline: 0;
  transition: border-color 120ms;
}
.book-form .field input:focus, .book-form .field select:focus { border-bottom-color: var(--accent); }
.book-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.book-form .btn { width: 100%; justify-content: center; padding: 16px; }

/* ───── Footer ───── */
.footer { padding: 48px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr auto auto auto; gap: 48px; align-items: start; }
.footer .col h4 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; font-weight: 500; }
.footer .col a, .footer .col .li { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.footer .col a:hover { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 24px; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); font-family: var(--mono); letter-spacing: 0.04em; }

/* ───── Chat-режим AI-консультанта (триаж + booking) ───── */
.helper-chat-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 18px 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.helper-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}
.helper-chat-title {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--ink-2); letter-spacing: -0.005em;
}
.helper-chat-reset {
  background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 12px; color: var(--ink-3);
  padding: 4px 8px; border-radius: 6px;
  transition: color 120ms, background 120ms;
}
.helper-chat-reset:hover:not(:disabled) { color: var(--accent); background: var(--paper); }
.helper-chat-reset:disabled { opacity: 0.5; cursor: not-allowed; }

.helper-chat-scroll {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 520px; overflow-y: auto;
  padding: 4px 2px 8px;
}
.helper-chat-scroll::-webkit-scrollbar { width: 6px; }
.helper-chat-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.chat-bubble { display: flex; max-width: 100%; }
.chat-bubble-user { justify-content: flex-end; }
.chat-bubble-user .chat-bubble-body {
  background: var(--accent);
  color: #0a0e13;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  max-width: 78%;
  white-space: pre-wrap; word-wrap: break-word;
}
.chat-bubble-ai { justify-content: flex-start; width: 100%; }
.chat-bubble-ai > * { width: 100%; }

.result-card-inline {
  padding: 16px 18px;
  gap: 14px;
  box-shadow: none;
  border-radius: 14px 14px 14px 4px;
}
.result-card-inline .result-head { padding-bottom: 10px; }

.helper-chat-card .helper-input-foot {
  border-top: 1px solid var(--line-2);
  padding-top: 12px;
  gap: 10px;
  align-items: flex-end;
}
.helper-chat-card .helper-input {
  min-height: 44px;
  font-size: 15px;
  flex: 1;
}

/* ── Routing card (финал триажа) ── */
.routing-card { gap: 12px; }
.routing-doctor {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.routing-doctor-name { font-family: var(--sans); font-size: 16px; font-weight: 500; color: var(--ink); }
.routing-doctor-spec { font-size: 13px; color: var(--ink-3); }
.routing-urgency {
  margin-top: 6px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase;
  align-self: flex-start;
  padding: 4px 8px; border-radius: 6px;
}
.urgency-urgent  { background: rgba(220, 60, 60, 0.12);  color: #ef6b6b; }
.urgency-soon    { background: rgba(56, 189, 214, 0.14); color: var(--accent); }
.urgency-planned { background: rgba(150, 160, 170, 0.14); color: var(--ink-3); }
.result-tag.urgency-urgent  { color: #ef6b6b; }
.result-tag.urgency-soon    { color: var(--accent); }
.result-tag.urgency-planned { color: var(--ink-3); }

.routing-summary { font-size: 15px; line-height: 1.5; color: var(--ink); margin: 0; }
.routing-price-hint { font-size: 13px; color: var(--ink-3); margin: 0; }

.routing-slots { display: flex; flex-direction: column; gap: 10px; }
.routing-pick { font-size: 13px; color: var(--ink-2); margin: 0; }
.routing-slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.routing-slot {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--sans); font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 120ms, background 120ms, color 120ms;
  text-align: center;
}
.routing-slot:hover { border-color: var(--accent); color: var(--accent); }
.routing-empty { font-size: 14px; color: var(--ink-3); margin: 4px 0; }

.routing-form { display: flex; flex-direction: column; gap: 10px; }
.routing-form-slot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 14px; color: var(--ink-2);
  padding: 8px 12px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px;
}
.routing-form-slot .lbl {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.routing-form-slot strong { color: var(--ink); font-weight: 500; }
.link-btn {
  background: none; border: 0; cursor: pointer;
  color: var(--accent); font-family: var(--sans); font-size: 12px;
  padding: 0; margin-left: auto;
}
.link-btn:hover { text-decoration: underline; }

.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row > span {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.form-row input {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--sans); font-size: 14px;
  color: var(--ink);
  outline: 0;
  transition: border-color 120ms;
}
.form-row input:focus { border-color: var(--accent); }

.routing-error {
  font-size: 13px; color: #ef6b6b;
  padding: 8px 12px;
  background: rgba(220, 60, 60, 0.08);
  border: 1px solid rgba(220, 60, 60, 0.2);
  border-radius: 8px;
}

.routing-success {
  padding: 14px 16px;
  background: rgba(56, 189, 214, 0.08);
  border: 1px solid rgba(56, 189, 214, 0.25);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.routing-success-title { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--accent); }
.routing-success p { margin: 0; font-size: 14px; color: var(--ink); }
.routing-success-hint { font-size: 12px; color: var(--ink-3); }

/* ───── Responsive ───── */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .svc-grid { grid-template-columns: 1fr 1fr; }
  .docs-grid { grid-template-columns: 1fr 1fr; }
  .consultant-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .section-head { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .svc-grid { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stat .num { font-size: 24px; }
}
