/* Orion Media shared styles. Layout: a star atlas. Hero pairs the pitch with a drawn Orion; the four corner stars are the four AI agent services, the three belt stars are the three steps. */
/* Fonts are self-hosted (latin subset, OFL): Playfair Display for headings and the brand name, Fraunces (variable, automatic optical size) for everything else. */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/assets/fonts/playfair-display-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/fraunces-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/fraunces-italic-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Metric-matched fallbacks (Georgia scaled to each web font's width, measured in Chrome) so text does not reflow when the fonts arrive. */
@font-face { font-family: "Playfair Fallback"; src: local("Georgia Bold"), local("Georgia-Bold"), local("Georgia"); font-weight: 600 800; size-adjust: 88.5%; }
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia"); font-style: normal; font-weight: 400 500; size-adjust: 104.8%; }
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia Bold"), local("Georgia-Bold"); font-style: normal; font-weight: 600 700; size-adjust: 93.3%; }
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia Italic"), local("Georgia-Italic"); font-style: italic; font-weight: 400 600; size-adjust: 97.4%; }

:root {
  color-scheme: dark;
  --sky: #0A0F24;
  --sky-2: #121A38;
  --ink: #ECEAF2;
  --ink-dim: #A3A9C4;
  --line: #2A3360;
  --betel: #FF8A4C;
  --rigel: #A9CBFF;
  --belt: #D9E4FF;
  --star-dot: #FFFFFF;
  --on-accent: #06002A;
  --accent: #00DCB1;
  --link: #00DCB1;
  --deco: #00DCB1;
  --logo-icon: #00DCB1;
  --logo-word: #FFFFFF;

  --f-display: "Playfair Display", "Playfair Fallback", Georgia, "Times New Roman", serif;
  --f-body: "Fraunces", "Fraunces Fallback", Georgia, "Times New Roman", serif;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1.0625rem;
  --t-lg: 1.375rem;
  --t-xl: clamp(1.75rem, 3.2vw, 2.5rem);
  --t-hero: clamp(1.9rem, 3.4vw, 2.75rem);

  --wrap: 72rem;
  --radius: 14px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --sky: #F1F2F6;
    --sky-2: #E3E6F0;
    --ink: #121733;
    --ink-dim: #4B5275;
    --line: #C3C8DA;
    --betel: #B9471A;
    --rigel: #2D5BAA;
    --belt: #3A4A7A;
    --star-dot: #1E2650;
    --on-accent: #FFFFFF;
    --accent: #561EFC;
    --link: #561EFC;
    --deco: #00DCB1;
    --logo-icon: #00DCB1;
    --logo-word: #561EFC;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --sky: #F1F2F6;
  --sky-2: #E3E6F0;
  --ink: #121733;
  --ink-dim: #4B5275;
  --line: #C3C8DA;
  --betel: #B9471A;
  --rigel: #2D5BAA;
  --belt: #3A4A7A;
  --star-dot: #1E2650;
  --on-accent: #FFFFFF;
  --accent: #561EFC;
  --link: #561EFC;
  --deco: #00DCB1;
  --logo-icon: #00DCB1;
  --logo-word: #561EFC;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-optical-sizing: auto;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--sky);
}
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }
}
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.08; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

.label {
  font-family: var(--f-body);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--sky) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
}
.brand { color: var(--logo-word); }
.brand svg { width: auto; height: 30px; flex: none; fill: var(--logo-icon); }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a {
  text-decoration: none;
  font-size: var(--t-sm);
  color: var(--ink-dim);
  transition: color .2s;
}
.nav a:hover { color: var(--ink); }
.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang a {
  font: 600 var(--t-xs)/1 var(--f-body);
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
}
.lang a { text-decoration: none; display: inline-block; }
.lang a[aria-current="page"] { background: var(--ink); color: var(--sky); }
@media (max-width: 640px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding-block: clamp(48px, 8vw, 96px);
}
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.hero h1 {
  font-size: var(--t-hero);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: normal; color: var(--betel); }
.hero .lede { color: var(--ink-dim); max-width: 34em; font-size: 1.125rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--t-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-dim); }

.chart { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.chart svg { width: 100%; max-width: 440px; height: auto; overflow: visible; }
.chart figcaption { text-align: center; }
.c-line {
  stroke: var(--ink-dim);
  stroke-opacity: .55;
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 1.6s ease-out both;
}
.c-line:nth-child(2) { animation-delay: .1s; }
.c-line:nth-child(3) { animation-delay: .2s; }
.c-line:nth-child(4) { animation-delay: .3s; }
.c-line:nth-child(5) { animation-delay: .4s; }
.c-line:nth-child(6) { animation-delay: .5s; }
.c-line:nth-child(7) { animation-delay: .6s; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.star { transform-box: fill-box; transform-origin: center; transition: transform .35s ease; }
.star .glow { opacity: .35; }
.star.lit { transform: scale(1.6); }
.c-name { font-family: var(--f-body); font-size: 11px; fill: var(--ink-dim); letter-spacing: .04em; }
.c-svc { font-family: var(--f-body); font-size: 13px; font-weight: 600; fill: var(--ink); }
.c-link { cursor: pointer; }
.c-link .c-name { fill: var(--rigel); text-decoration: underline; text-underline-offset: 3px; transition: fill .2s; }
.c-link:hover .c-name, .c-link:focus-visible .c-name { fill: var(--ink); }
.c-link:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.s-betel { fill: var(--betel); }
.s-rigel { fill: var(--rigel); }
.s-belt { fill: var(--belt); }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .chart svg { max-width: 360px; }
}

/* Sections */
section { scroll-margin-top: 72px; }
.section .wrap { padding-block: clamp(56px, 9vw, 104px); display: flex; flex-direction: column; gap: 40px; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 40rem; }
.section-head h2 { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.01em; }
.section-head p { color: var(--ink-dim); }

/* Services */
.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.svc {
  background: var(--sky);
  padding: clamp(24px, 3.5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background .25s;
}
.svc:hover, .svc:focus-within { background: var(--sky-2); }
.svc-meta { display: flex; align-items: center; gap: 10px; }
.svc-meta .label { text-transform: none; letter-spacing: 0.04em; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 12px currentColor; }
.dot.betel { background: var(--betel); color: var(--betel); }
.dot.rigel { background: var(--rigel); color: var(--rigel); }
.svc h3 { font-size: var(--t-lg); font-weight: 700; }
.svc p { color: var(--ink-dim); max-width: 34em; }
.coords { font-family: var(--f-body); font-size: var(--t-xs); color: var(--ink-dim); font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.tag {
  font-family: var(--f-body);
  font-size: var(--t-xs);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
}
@media (max-width: 720px) {
  .services { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .coords { display: none; }
}

/* Steps: Orion's Belt */
.belt-section { background: var(--sky-2); border-block: 1px solid var(--line); }
.belt {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  position: relative;
}
.belt::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 7px;
  height: 1px;
  background: var(--deco);
  opacity: .7;
}
.belt li { position: relative; display: flex; flex-direction: column; gap: 10px; padding-top: 34px; }
.belt li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--belt);
  box-shadow: 0 0 0 5px var(--sky-2), 0 0 16px var(--belt);
}
.belt h3 { font-size: var(--t-lg); font-weight: 700; }
.belt p { color: var(--ink-dim); }
.step-no { font-family: var(--f-body); font-size: var(--t-xs); color: var(--ink-dim); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .belt { grid-template-columns: 1fr; gap: 28px; }
  .belt::before { left: 7px; right: auto; top: 7px; bottom: 7px; width: 1px; height: auto; }
  .belt li { padding-top: 0; padding-left: 40px; }
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.contact h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; }
.contact .lede { color: var(--ink-dim); max-width: 30em; }
.contact-copy { display: flex; flex-direction: column; gap: 18px; }
.channels { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.channel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.channel-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.channel-value {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.channel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.channel-actions .btn { padding: 10px 18px; }
@media (max-width: 820px) {
  .contact { grid-template-columns: 1fr; }
}

footer { border-top: 1px solid var(--line); }
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 28px;
  color: var(--ink-dim);
  font-size: var(--t-sm);
}


/* Service lines */
.line-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.line-head h3 { font-size: var(--t-lg); font-weight: 700; }
.line-head p { color: var(--ink-dim); flex-basis: 100%; max-width: 40rem; }
.svc-line { display: flex; flex-direction: column; gap: 20px; }
.svc-line + .svc-line { padding-top: 16px; }

/* Generic cards and grids */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.grid-4 { --cols: 4; }
.grid-2 { --cols: 2; }
@media (max-width: 960px) { .grid-4 { --cols: 2; } .grid { --cols: 2; } }
@media (max-width: 600px) { .grid, .grid-4, .grid-2 { --cols: 1; } }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--sky);
  transition: border-color .2s, background .2s;
}
.card:hover { border-color: var(--ink-dim); }
.card h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.card p { color: var(--ink-dim); font-size: var(--t-sm); }
.card .label { color: var(--rigel); }

/* AI-ready checklist */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 4px 12px; align-items: start; }
.checks li::before {
  content: "";
  grid-row: span 2;
  width: 11px; height: 11px; margin-top: 8px;
  border-radius: 50%;
  background: var(--rigel);
  box-shadow: 0 0 10px var(--rigel);
}
.checks strong { font-family: var(--f-body); font-weight: 600; font-size: 1.0625rem; }
.checks span { color: var(--ink-dim); font-size: var(--t-sm); }
@media (max-width: 720px) { .checks { grid-template-columns: 1fr; } }
.note {
  border-left: 2px solid var(--betel);
  padding: 4px 0 4px 16px;
  color: var(--ink-dim);
  font-size: var(--t-sm);
  font-style: italic;
  max-width: 44rem;
}

/* Pricing */
.pilot {
  border: 1px solid var(--betel);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 32px;
  align-items: center;
  background: color-mix(in srgb, var(--betel) 7%, var(--sky));
}
.pilot h3 { font-size: var(--t-lg); font-weight: 700; }
.pilot p { color: var(--ink-dim); margin-top: 8px; max-width: 36em; }
@media (max-width: 720px) { .pilot { grid-template-columns: 1fr; } }
.price { font-family: var(--f-body); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.price small { font-family: var(--f-body); font-weight: 400; font-size: var(--t-sm); color: var(--ink-dim); }
.tier .price { margin-top: 4px; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.tier ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-dim); font-size: var(--t-sm); display: grid; gap: 6px; }
.tier.featured { border-color: var(--rigel); }
.quote { font-family: var(--f-body); font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); margin-top: auto; padding-top: 6px; }
.quote.free { color: var(--betel); }
.subhead { font-size: var(--t-lg); font-weight: 700; }

/* FAQ */
.faq { border-top: 1px solid var(--line); max-width: 52rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 36px 20px 0;
  position: relative;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 4px; top: 18px;
  font-family: var(--f-body); font-size: 1.6rem; line-height: 1; color: var(--betel);
}
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-dim); padding: 0 0 22px; max-width: 44em; }

/* Footer links */
.ft-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ft-links a { color: var(--ink-dim); text-decoration: none; }
.ft-links a:hover { color: var(--ink); text-decoration: underline; }

/* Floating WhatsApp button: discreet, sits above the safe area */
.wa-float {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 25;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 28px; height: 28px; }
@media (min-width: 821px) { .wa-float { width: 46px; height: 46px; opacity: .9; } .wa-float svg { width: 24px; height: 24px; } }
footer { padding-bottom: 72px; }
@media (min-width: 821px) { footer { padding-bottom: 0; } }
.btn-wa { border-color: #25D366; color: var(--ink); }
.btn-wa:hover { border-color: #25D366; background: color-mix(in srgb, #25D366 14%, transparent); }

/* Legal pages */
.draft-banner {
  background: var(--betel);
  color: var(--on-accent);
  font-family: var(--f-body);
  font-size: var(--t-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 16px;
}
.legal .wrap { max-width: 50rem; padding-block: clamp(40px, 7vw, 80px); display: flex; flex-direction: column; gap: 18px; }
.legal h1 { font-size: var(--t-xl); font-weight: 800; }
.legal h2 { font-size: 1.25rem; font-weight: 700; margin-top: 18px; }
.legal p, .legal li { color: var(--ink-dim); }
.legal strong { color: var(--ink); }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal a, .note a { color: var(--link); text-underline-offset: 3px; }
.tbd { background: color-mix(in srgb, var(--betel) 22%, transparent); color: var(--ink); padding: 0 4px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .c-line { animation: none; }
  .star, .btn, .svc, .card { transition: none; }
}

/* Chat assistant (assets/chat.js) */
.chat-launch {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 64px);
  z-index: 26;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 0;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .2s;
}
.chat-launch:hover { transform: scale(1.06); }
.chat-launch svg { width: 26px; height: 26px; }
.chat-launch:focus-visible, .chat-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 821px) {
  .chat-launch { width: 46px; height: 46px; bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 58px); }
  .chat-launch svg { width: 22px; height: 22px; }
}
.chat-panel {
  position: fixed;
  z-index: 30;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 128px);
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 160px));
  display: flex; flex-direction: column;
  background: var(--sky);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
  font-family: var(--f-body);
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }
@media (max-width: 820px) {
  .chat-panel { inset: auto 0 0 0; width: 100%; height: min(100dvh, 640px); border-radius: var(--radius) var(--radius) 0 0; border-inline: 0; border-bottom: 0; }
  .chat-open .chat-launch, .chat-open .wa-float { display: none; }
}
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); background: var(--sky-2); }
.chat-title { margin: 0; flex: 1; min-width: 0; font-family: var(--f-display); font-weight: 700; font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-restart, .chat-close { background: none; border: 0; color: var(--ink-dim); font: inherit; cursor: pointer; border-radius: 8px; }
.chat-restart { font-size: var(--t-xs); text-decoration: underline; padding: 6px; }
.chat-close { font-size: 1.5rem; line-height: 1; width: 36px; height: 36px; }
.chat-restart:hover, .chat-close:hover { color: var(--ink); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: var(--t-sm); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.assistant { align-self: flex-start; background: var(--sky-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.chat-msg.system { align-self: center; max-width: 95%; font-size: var(--t-xs); color: var(--ink-dim); text-align: center; background: none; }
.chat-msg.typing { color: var(--ink-dim); font-style: italic; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-actions .btn { padding: 9px 16px; }
.chat-actions .btn:not(.btn-wa) { border-color: var(--line); color: var(--ink); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 6px; border-top: 1px solid var(--line); }
.chat-form textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 120px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--sky-2); color: var(--ink);
  font: inherit; font-size: 16px; /* 16px stops iOS from zooming in */
}
.chat-send { padding: 10px 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; font-size: var(--t-sm); cursor: pointer; }
.chat-send:disabled { opacity: .55; cursor: wait; }
.chat-note { margin: 0; padding: 4px 14px 10px; font-size: 0.6875rem; color: var(--ink-dim); text-align: center; }
@media (prefers-reduced-motion: reduce) { .chat-launch { transition: none; } }
