/* ============ Gridea marketing site — supplemental styles ============ */
/* Loaded AFTER gridea-styles.css. Adds: router pages, nav active states,
   pain-point grid, how-it-works, pricing, comparison table, FAQ, trial page. */

html { scroll-behavior: smooth; }

/* Nav active link */
.nav-links a { position: relative; transition: color 0.15s; }
.nav-links a.active { color: var(--d-text); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}
.nav-mobile-toggle { display: none; }

/* Page transition — always visible; no opacity-gated keyframe (timeline can freeze) */
.route-page { opacity: 1; transform: none; }

/* Generic page hero (lighter than home hero) */
.page-hero {
  position: relative;
  padding: 88px 32px 64px;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, oklch(0.22 0.06 200 / 0.45), transparent 70%), var(--d-bg);
  color: var(--d-text);
  text-align: center;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--d-border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--d-border-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 20%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 20%, black 20%, transparent 70%);
  opacity: 0.4; pointer-events: none;
}
.page-hero-inner { position: relative; max-width: 820px; margin: 0 auto; }
.page-hero h1 {
  font-size: clamp(34px, 4.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 18px 0 0;
  color: var(--d-text);
  text-wrap: balance;
}
.page-hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, var(--brand) 0%, oklch(0.62 0.13 200) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-hero p {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--d-muted);
  max-width: 600px;
  margin: 20px auto 0;
  text-wrap: balance;
}

/* ============ Pain-point grid (the questions) ============ */
.pain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}
.pain-item {
  background: var(--l-surface);
  border: 1px solid var(--l-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pain-item:hover {
  border-color: color-mix(in oklab, var(--brand) 40%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.12);
}
.pain-q {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pain-q .qmark {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: color-mix(in oklab, var(--brand) 14%, transparent);
  color: var(--brand-2);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.pain-a {
  font-size: 14px;
  color: var(--l-muted);
  padding-left: 36px;
}
.pain-a strong { color: var(--brand-2); font-weight: 600; }

/* ============ How it works — 3 steps ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 56px;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 28px; left: 16%; right: 16%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--l-border-strong) 0 8px, transparent 8px 16px);
  z-index: 0;
}
.step { position: relative; z-index: 1; text-align: center; }
.step-num {
  width: 56px; height: 56px;
  border-radius: 99px;
  background: var(--d-bg);
  color: var(--brand);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  margin: 0 auto 20px;
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 6px var(--l-bg);
}
.step h4 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 8px; }
.step p { font-size: 14px; color: var(--l-muted); margin: 0; max-width: 280px; margin: 0 auto; }

/* ============ Feature index (Features page) ============ */
.feature-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.feature-tab {
  font-size: 13px; font-weight: 500;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--d-surface);
  color: var(--d-muted);
  border: 1px solid var(--d-border-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.feature-tab:hover { color: var(--d-text); border-color: var(--d-border); }
.feature-tab.active { background: color-mix(in oklab, var(--brand) 20%, transparent); color: var(--brand); border-color: color-mix(in oklab, var(--brand) 50%, transparent); }

/* ============ Capacity / grid-fine mock ============ */
.cap-gauge {
  position: relative;
  padding: 8px 0;
}
.cap-bar-track {
  height: 14px;
  border-radius: 99px;
  background: var(--l-surface-2);
  position: relative;
  overflow: visible;
}
.dark .cap-bar-track { background: var(--d-surface-2); }
.cap-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--amber) 80%, var(--red) 100%);
  position: relative;
}
.cap-limit-line {
  position: absolute;
  top: -6px; bottom: -6px;
  width: 2px;
  background: var(--red);
}
.cap-limit-line::after {
  content: attr(data-label);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
  font-family: var(--mono);
}

/* ============ Solar/battery payback (interactive) ============ */
.payback-widget {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
}
.payback-controls {
  padding: 24px;
  border-right: 1px solid var(--l-border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dark .payback-controls { border-color: var(--d-border-soft); }
.payback-result { padding: 24px; display: flex; flex-direction: column; }
.payback-slider-row { display: flex; flex-direction: column; gap: 8px; }
.payback-slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.payback-slider-label { font-size: 13px; font-weight: 600; }
.payback-slider-val { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--brand-2); }
.dark .payback-slider-val { color: var(--brand); }
.payback-input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: var(--l-border-strong); outline: none;
}
.dark .payback-input { background: var(--d-border); }
.payback-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 99px;
  background: var(--brand); cursor: grab;
  border: 3px solid var(--l-surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.dark .payback-input::-webkit-slider-thumb { border-color: var(--d-surface); }
.payback-input::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 99px;
  background: var(--brand); cursor: grab; border: 3px solid var(--l-surface);
}

.payback-big {
  font-size: 48px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.payback-big .unit { font-size: 18px; font-weight: 500; color: var(--l-muted); }
.dark .payback-big .unit { color: var(--d-muted); }

.payback-chart { flex: 1; position: relative; margin-top: 20px; min-height: 160px; }

.payback-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px; margin-top: 8px;
}
.payback-stat .l { font-size: 11px; color: var(--l-subtle); text-transform: uppercase; letter-spacing: 0.05em; }
.dark .payback-stat .l { color: var(--d-subtle); }
.payback-stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ============ Spot vs fixed mock ============ */
.svf-legend { display: flex; gap: 16px; font-size: 12px; padding: 12px 16px; }
.svf-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--l-muted); }
.dark .svf-legend-item { color: var(--d-muted); }

/* ============ Pricing ============ */
.pricing-toggle {
  display: inline-flex;
  background: var(--l-surface-2);
  border: 1px solid var(--l-border);
  border-radius: 99px;
  padding: 4px;
  margin: 24px auto 0;
}
.pricing-toggle button {
  font-size: 13px; font-weight: 600;
  padding: 8px 18px;
  border-radius: 99px;
  color: var(--l-muted);
  transition: all 0.15s;
}
.pricing-toggle button.active { background: var(--l-surface); color: var(--l-text); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08)); }
.pricing-toggle .save-badge { font-size: 10px; color: oklch(0.5 0.15 155); margin-left: 6px; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 48px;
  align-items: stretch;
}
.price-card {
  background: var(--l-surface);
  border: 1px solid var(--l-border);
  border-radius: 16px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.price-card.featured {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px var(--brand-2), 0 20px 50px -20px color-mix(in oklab, var(--brand) 40%, transparent);
}
.price-badge {
  position: absolute;
  top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--brand-2);
  color: white;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
}
.price-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.price-desc { font-size: 13px; color: var(--l-muted); margin-top: 4px; min-height: 38px; }
.price-amount {
  display: flex; align-items: baseline; gap: 4px;
  margin: 16px 0 4px;
}
.price-amount .num { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.price-amount .per { font-size: 13px; color: var(--l-muted); }
.price-sub { font-size: 12px; color: var(--l-subtle); min-height: 16px; }
.price-cta { margin: 20px 0; }
.price-cta .btn { width: 100%; justify-content: center; }
.price-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.price-features li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--l-text); }
.price-features li svg { color: var(--brand-2); flex-shrink: 0; margin-top: 2px; }
.price-features li.muted-feat { color: var(--l-subtle); }
.price-features li.muted-feat svg { color: var(--l-border-strong); }

/* Comparison table */
.compare-tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 16px; }
.compare-tbl th, .compare-tbl td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--l-border); }
.compare-tbl thead th {
  font-size: 13px; font-weight: 700;
  background: var(--l-surface-2);
  position: sticky; top: 64px;
}
.compare-tbl thead th:not(:first-child) { text-align: center; width: 140px; }
.compare-tbl td:not(:first-child) { text-align: center; }
.compare-tbl .group-row td {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--l-subtle); background: var(--l-surface-2); padding-top: 18px; padding-bottom: 8px;
}
.compare-tbl .feat-name { font-weight: 500; }
.compare-tbl .feat-sub { font-size: 12px; color: var(--l-muted); }
.compare-check { color: var(--brand-2); }
.compare-dash { color: var(--l-border-strong); }
.compare-tbl tr.highlight-col td:nth-child(3) { background: color-mix(in oklab, var(--brand) 5%, transparent); }

/* ============ FAQ accordion ============ */
.faq-list { max-width: 760px; margin: 40px auto 0; display: flex; flex-direction: column; gap: 0; }
.faq-item { border-bottom: 1px solid var(--l-border); }
.faq-q {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 16px;
  padding: 22px 0;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--l-text);
}
.faq-q .chev { margin-left: auto; transition: transform 0.2s; color: var(--l-muted); flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease, padding 0.25s ease;
  font-size: 14px; color: var(--l-muted); line-height: 1.6;
}
.faq-item.open .faq-a { max-height: 240px; padding-bottom: 22px; }

/* ============ Trial page ============ */
.trial-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1040px;
  margin: 0 auto;
  background: var(--l-surface);
  border: 1px solid var(--l-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.2);
}
.trial-form-side { padding: 44px 40px; }
.trial-benefits-side {
  padding: 44px 40px;
  background: var(--d-bg);
  color: var(--d-text);
  position: relative;
  overflow: hidden;
}
.trial-benefits-side::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--d-border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--d-border-soft) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, black 10%, transparent 70%);
  opacity: 0.4;
}
.trial-benefits-side > * { position: relative; }
.trial-field { margin-bottom: 18px; }
.trial-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.trial-field input, .trial-field select {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--l-border-strong); border-radius: 9px;
  font-size: 15px; background: var(--l-surface); color: var(--l-text); outline: none;
}
.trial-field input:focus, .trial-field select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 18%, transparent);
}
.trial-benefit { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.trial-benefit-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: color-mix(in oklab, var(--brand) 18%, transparent);
  color: var(--brand);
  display: grid; place-items: center; flex-shrink: 0;
}
.trial-benefit h5 { font-size: 15px; font-weight: 600; margin: 0 0 3px; }
.trial-benefit p { font-size: 13px; color: var(--d-muted); margin: 0; }

/* CTA band (light variant) */
.cta-band {
  background: var(--d-bg);
  color: var(--d-text);
  border-radius: 20px;
  padding: 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 0 32px;
}
.cta-band::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, color-mix(in oklab, var(--brand) 25%, transparent), transparent 70%);
}
.cta-band > * { position: relative; }

/* Section headers */
.sh-center { text-align: center; max-width: 680px; margin: 0 auto; }

/* Long-form prose (legal + about pages) */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; margin: 32px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 15px; line-height: 1.7; color: var(--l-text); margin: 0 0 14px; }
.prose ul { margin: 0 0 16px; padding-left: 20px; }
.prose li { font-size: 15px; line-height: 1.65; color: var(--l-text); margin-bottom: 6px; }
.prose .muted-note { font-size: 13px; color: var(--l-subtle); }
.prose strong { font-weight: 600; }
.legal-meta { font-size: 13px; color: var(--l-subtle); margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--l-border); }

/* Contact cards */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; margin: 0 auto; }
.contact-card { background: var(--l-surface); border: 1px solid var(--l-border); border-radius: 14px; padding: 28px; }
.contact-card .ico { width: 44px; height: 44px; border-radius: 10px; background: color-mix(in oklab, var(--brand) 14%, transparent); color: var(--brand-2); display: grid; place-items: center; margin-bottom: 16px; }
.contact-card h4 { font-size: 17px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.contact-card p { font-size: 14px; color: var(--l-muted); margin: 0 0 14px; }
.contact-card a.contact-link { font-size: 14px; font-weight: 600; color: var(--brand-2); display: inline-flex; align-items: center; gap: 6px; }
.contact-card a.contact-link:hover { text-decoration: underline; }
@media (max-width: 680px) { .contact-grid { grid-template-columns: 1fr; } }

/* responsive */
@media (max-width: 960px) {
  .pain-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .steps::before { display: none; }
  .payback-widget { grid-template-columns: 1fr; }
  .payback-controls { border-right: none; border-bottom: 1px solid var(--l-border); }
  .trial-split { grid-template-columns: 1fr; }
  .trial-benefits-side { order: -1; }
}
@media (max-width: 680px) {
  .pain-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

/* ============================================================
   MOBILE  (added 2026-07-22)
   The site previously stopped adapting below 680px: nav links were
   hidden with nothing to replace them, and two grids kept forcing a
   ~523px layout onto a 390px screen.
   ============================================================ */

/* Grid children default to min-width:auto, so a wide child (the feature
   mock-ups) stretches its track and drags the whole page sideways. */
.feature-row > * { min-width: 0; }
.feature-mock img, .feature-mock svg { max-width: 100%; height: auto; }

/* Was an inline `gridTemplateColumns: 1fr 1fr` with no breakpoint. */
.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 56px;
}
.quote-grid > * { min-width: 0; }

/* Hamburger — hidden on desktop, shown below 680px. */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;          /* 44px = minimum comfortable tap target */
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--d-border-soft);
  border-radius: 8px;
  color: var(--d-text);
  cursor: pointer;
}
.nav-toggle-x { transition: transform 0.15s; transform: rotate(45deg); }

.nav-mobile { display: none; }

.nav-login {
  font-size: 14px; font-weight: 500;
  color: var(--d-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;                /* stops "Logi sisse" splitting across lines */
}

@media (max-width: 900px) {
  .quote-grid { grid-template-columns: 1fr; margin-top: 36px; }
}

@media (max-width: 680px) {
  .nav-inner { padding: 0 16px; gap: 12px; }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }         /* moves into the panel below */

  .nav-mobile {
    display: block;
    border-top: 1px solid var(--d-border-soft);
    background: var(--d-bg);
    padding: 8px 16px 16px;
  }
  .nav-mobile[hidden] { display: none; }
  .nav-mobile > a {
    display: flex; align-items: center; gap: 6px;
    min-height: 48px;
    font-size: 15px; font-weight: 500;
    color: var(--d-text);
    border-bottom: 1px solid var(--d-border-soft);
    cursor: pointer;
  }
  .nav-mobile > a.active { color: var(--brand); }
  .nav-mobile > a:last-child {
    border-bottom: none;
    margin-top: 12px;
    justify-content: center;
    color: var(--d-bg);
  }
}

/* Phone. The site jumped straight from 680px to nothing, so everything
   below was still using desktop spacing and type sizes. */
@media (max-width: 480px) {
  .section { padding: 56px 16px; }
  .page-hero { padding: 56px 16px 40px; }

  /* Nothing below 12px — 10-11px body text is unreadable on a phone. */
  body { font-size: 15px; }
  .legal-meta, .muted-note, .quote-author-role, .price-sub { font-size: 12px; }

  .quote-card { padding: 24px; }
  .stat-strip { grid-template-columns: 1fr 1fr; margin-top: 32px; }

  /* Full-width CTAs are easier to hit than side-by-side buttons at 390px. */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; height: 48px; }

  .btn { height: 44px; }
  .btn-sm { height: 38px; }
}

/* The forecast chart's 12 month columns have an intrinsic minimum around 507px.
   Rather than shrink the labels below legibility, let it scroll inside its own
   box on narrow screens — the page itself stays put. */
.forecast-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 680px) {
  .forecast-chart-scroll > .forecast-chart { min-width: 520px; }
}

/* The legend is a flex row with no wrap, so its last item ("2175 MWh · €102.50/MWh")
   pushed the home page to 457px on a phone. Wrapping is safe at every width. */
.forecast-legend { flex-wrap: wrap; }

/* ============================================================
   ASSISTENT — kangelasosa küsimuskast + vestlusaken
   ============================================================ */

/* --- Hero ask-box --- */
.hero-ask { margin-top: 28px; max-width: 560px; }

.hero-ask-form {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--d-bg-2) 80%, transparent);
  border: 1px solid var(--d-border);
  color: var(--brand);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-ask-form:focus-within {
  border-color: color-mix(in oklab, var(--brand) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 12%, transparent);
}
.hero-ask-form input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--d-text); font-size: 15px; height: 40px;
}
.hero-ask-form input::placeholder { color: var(--d-muted); }
.hero-ask-form button {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: none; border-radius: 9px;
  background: var(--brand); color: var(--d-bg);
  cursor: pointer;
}

.hero-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hero-ask-chips button {
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 99px;
  background: transparent;
  border: 1px solid var(--d-border-soft);
  color: var(--d-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.hero-ask-chips button:hover {
  color: var(--d-text);
  border-color: color-mix(in oklab, var(--brand) 50%, transparent);
}

/* --- Floating launcher --- */
.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px;
  border-radius: 99px; border: none;
  background: var(--brand); color: var(--d-bg);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,0.45);
  cursor: pointer;
}

/* --- Chat panel --- */
.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 210;
  width: 380px; max-height: min(620px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: var(--d-bg-2);
  border: 1px solid var(--d-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.55);
  overflow: hidden;
  color: var(--d-text);
}
.chat-panel[hidden] { display: none; }

.chat-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--d-border-soft);
}
.chat-head strong { display: block; font-size: 14px; }
.chat-head span { display: block; font-size: 12px; color: var(--d-muted); margin-top: 2px; }
.chat-head button {
  flex-shrink: 0; width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent; border: none; border-radius: 8px;
  color: var(--d-muted); cursor: pointer;
}
.chat-head button:hover { color: var(--d-text); }
.chat-x { transform: rotate(45deg); }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-intro { font-size: 13px; color: var(--d-muted); line-height: 1.5; }
.chat-chips { display: flex; flex-direction: column; gap: 8px; }
.chat-chips button {
  text-align: left;
  font-size: 13px; line-height: 1.4;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--d-border-soft);
  color: var(--d-text);
  cursor: pointer;
}
.chat-chips button:hover { border-color: color-mix(in oklab, var(--brand) 50%, transparent); }

.chat-msg {
  font-size: 14px; line-height: 1.55;
  padding: 10px 13px;
  border-radius: 12px;
  max-width: 88%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;   /* long EIC codes must not widen the panel */
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--brand); color: var(--d-bg);
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--d-surface, oklch(0.2 0.02 240));
  border: 1px solid var(--d-border-soft);
  border-bottom-left-radius: 4px;
}
.chat-typing { color: var(--d-muted); }
.chat-err {
  font-size: 13px; line-height: 1.5;
  padding: 10px 12px; border-radius: 10px;
  color: oklch(0.8 0.12 25);
  background: oklch(0.3 0.08 25 / 0.35);
  border: 1px solid oklch(0.6 0.18 25 / 0.3);
}

.chat-input {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; border-top: 1px solid var(--d-border-soft);
}
.chat-input input {
  flex: 1; min-width: 0; height: 40px;
  padding: 0 12px;
  background: var(--d-bg); color: var(--d-text);
  border: 1px solid var(--d-border-soft); border-radius: 10px;
  font-size: 14px; outline: none;
}
.chat-input input:focus { border-color: color-mix(in oklab, var(--brand) 55%, transparent); }
.chat-input input::placeholder { color: var(--d-muted); }
.chat-input button {
  flex-shrink: 0; width: 40px; height: 40px;
  display: grid; place-items: center;
  border: none; border-radius: 10px;
  background: var(--brand); color: var(--d-bg);
  cursor: pointer;
}
.chat-input button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Honeypot — off-screen, never seen or tabbed to by a person. */
.chat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.chat-foot {
  padding: 0 16px 14px;
  font-size: 11px; line-height: 1.45;
  color: var(--d-muted);
}

/* Phone: the panel becomes a full-height sheet — a 380px floating card on a
   390px screen is unusable. */
@media (max-width: 680px) {
  .chat-panel {
    right: 0; bottom: 0; left: 0;
    width: auto; max-height: 88vh;
    border-radius: 16px 16px 0 0;
    border-left: none; border-right: none; border-bottom: none;
  }
  .chat-launcher { right: 16px; bottom: 16px; height: 44px; }
  .hero-ask-chips button { font-size: 12px; }
}
