/* ===== Self-hosted web fonts ===== */
/* Caveat 500 normal — latin-ext */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/caveat-latin-ext.f438d3567fa1.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Caveat 500 normal — latin */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/caveat-latin.1fde3bbfa795.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;
}

/* Caveat 700 normal — latin-ext */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/caveat-latin-ext.f438d3567fa1.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Caveat 700 normal — latin */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/caveat-latin.1fde3bbfa795.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;
}

/* ===== Zephlet shared base styles ===== */
:root {
  --bg: #F1ECDE;
  --bg-2: #E6DFC9;
  --ink: #1F2118;
  --ink-soft: #2F3326;
  --muted: #5A5D52;
  --line: #1B1D14;
  --rule: #C9C0A6;
  --orange: #E55A1F;
  --orange-soft: #FFE2CC;
  /* Darker orange for filled buttons so white label text meets WCAG AA
     (4.9:1). The brighter --orange stays for icons, underlines, and large text. */
  --orange-btn: #C9430F;
  /* Even darker orange for small orange TEXT on light backgrounds (AA 4.6:1). */
  --orange-text: #BD3E0C;
  --dark: #2B2419;
  --dark-2: #3A2F22;
  --leaf: #3F6E4F;
  --leaf-deep: #2F5B3F;
  /* Darker green for body text on the moss/green panels so it meets WCAG AA. */
  --leaf-text: #234A35;
  --moss: #BFCFAE;
  --paper: #FAF5E6;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  /* Mobile safety net: never let a rogue wide element scroll the whole page sideways. */
  overflow-x: hidden;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* ===== Header ===== */
header.site {
  padding: 28px 0 12px;
  /* Sits above the mobile-menu overlay so the hamburger/X stays tappable and
     visually anchored while the menu is open — otherwise the panel covers it. */
  position: relative;
  z-index: 100;
  background: var(--bg);
}
.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 25px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo .logo-badge {
  height: 32px;
  width: auto;
  display: block;
  transition: transform 200ms ease;
}
.logo:hover .logo-badge { transform: rotate(-4deg) scale(1.04); }
.logo .logo-word { line-height: 1; }

nav.primary {
  display: flex;
  gap: 38px;
  align-items: center;
  justify-content: center;
}
nav.primary a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
}
nav.primary a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}
nav.primary a:hover::after,
nav.primary a[aria-current="page"]::after { transform: scaleX(1); }
nav.primary a[aria-current="page"] { color: var(--orange); font-weight: 700; }

.header-cta { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.nav-welcome {
  font-size: 16px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-welcome::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--leaf);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(63, 110, 79, 0.18);
  flex: 0 0 9px;
}
.nav-welcome strong { color: var(--ink); font-weight: 700; }

/* ===== Mobile menu (hamburger + slide-down panel) =====
   Hidden on desktop, revealed at ≤640px alongside the existing nav.primary
   hide. The panel slides down from the top with an Apple-style cubic-bezier
   ease and the links stagger-fade in. */
.hamburger {
  display: none;
  background: transparent;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  margin-left: 4px;
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  justify-content: center;
}
.hamburger-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}
.hamburger-bars span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transform-origin: center;
  transition:
    transform 280ms cubic-bezier(0.32, 0.72, 0, 1),
    opacity 180ms ease;
}
.hamburger[aria-expanded="true"] .hamburger-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger-bars span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.4);
}
.hamburger[aria-expanded="true"] .hamburger-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  visibility: hidden;
  /* Defer hiding visibility until the panel + backdrop fade has fully run on
     close so nothing snaps mid-animation. */
  transition: visibility 0s linear 340ms;
}
.mobile-menu.open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}
.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 33, 24, 0.38);
  opacity: 0;
  transition: opacity 280ms ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.mobile-menu.open .mobile-menu-backdrop { opacity: 1; }

/* Apple-style fluid reveal: the panel sits just below the header, fades in,
   and drops the last few pixels into place. No big slide from off-screen —
   it just appears with intent. */
.mobile-menu-panel {
  position: absolute;
  top: 76px;
  left: 0; right: 0;
  background: var(--bg);
  border-top: 1px solid var(--rule);
  border-bottom: 1.5px solid var(--ink);
  padding: 12px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 28px 36px -24px rgba(31, 33, 24, 0.35);
}
.mobile-menu.open .mobile-menu-panel { opacity: 1; transform: translateY(0); }

.mobile-menu-panel a {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 16px 4px;
  border-bottom: 1px dashed var(--rule);
  display: block;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 240ms ease,
    transform 240ms cubic-bezier(0.32, 0.72, 0, 1),
    color 160ms ease;
}
.mobile-menu-panel a[aria-current="page"] { color: var(--orange); }
.mobile-menu.open .mobile-menu-panel a { opacity: 1; transform: translateY(0); }
.mobile-menu-panel a:nth-child(1) { transition-delay:  80ms,  80ms, 0s; }
.mobile-menu-panel a:nth-child(2) { transition-delay: 110ms, 110ms, 0s; }
.mobile-menu-panel a:nth-child(3) { transition-delay: 140ms, 140ms, 0s; }
.mobile-menu-panel a:nth-child(4) { transition-delay: 170ms, 170ms, 0s; }
.mobile-menu-panel a:nth-child(5) { transition-delay: 200ms, 200ms, 0s; }
.mobile-menu-panel a:nth-child(6) { transition-delay: 230ms, 230ms, 0s; }
.mobile-menu-panel .mm-login {
  margin-top: 18px;
  border-bottom: 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 4px;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-panel,
  .mobile-menu-backdrop,
  .mobile-menu-panel a,
  .hamburger-bars span { transition: none; }
}

/* ===== Buttons (smooth, no offset shadow, 14px radius) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: transparent;
  line-height: 1;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--orange-btn);
  color: #fff;
  border-color: var(--orange-btn);
}
.btn-primary:hover { background: #B23C0D; border-color: #B23C0D; }
.btn-ghost {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--orange-soft);
}
.btn-ghost:hover { background: #FFD3B3; }
.btn .arrow { transition: transform 200ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== Page hero (interior pages) ===== */
.page-hero { padding-top: 50px; padding-bottom: 40px; }
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--ink-soft);
}
.eyebrow .u {
  color: var(--orange-text);
  border-bottom: 2px solid var(--orange-text);
  padding-bottom: 3px;
}
h1.page-h {
  font-size: 56px;
  line-height: 1.05;
  margin: 0 0 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  max-width: 880px;
}
h1.page-h .accent { color: var(--orange); position: relative; display: inline-block; }
h1.page-h .accent::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%; bottom: -6px;
  height: 4px;
  background: var(--orange);
  border-radius: 4px;
  transform: skewX(-8deg);
}
.page-lede {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0;
}

/* ===== Section header ===== */
.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
h2.section-h {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  line-height: 1.15;
}
h2.section-h .accent { color: var(--orange); }
.rule { height: 1px; background: var(--rule); margin: 36px 0; }

/* ===== Cards ===== */
.card {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 26px;
}
.card.dark { background: var(--dark); color: #F5EFE5; border-color: var(--dark); }
.card.dark h3, .card.dark h4 { color: #fff; }
.card.dark p { color: #C7C2B6; }
.card .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--orange-soft);
  color: var(--orange);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ===== Footer ===== */
footer.site {
  border-top: 1.5px solid var(--leaf);
  padding: 22px 0 36px;
  margin-top: 40px;
}
.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  font-size: 13px;
  flex-wrap: wrap;
}
.foot-left { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); }
.foot-left .code { color: var(--orange); }
.foot-right {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--ink-soft);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.foot-right a { transition: color 180ms ease; }
.foot-right a:hover { color: var(--orange); }

@media (max-width: 700px) {
  .foot-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .foot-right { justify-content: flex-start; gap: 14px 22px; }
}

/* ===== Utility ===== */
.kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.note-handwritten { font-family: 'Caveat', cursive; font-weight: 500; font-size: 22px; line-height: 1.15; }

@media (max-width: 1080px) {
  h1.page-h { font-size: 42px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  nav.primary { display: none; }
  .header-row { grid-template-columns: 1fr auto; gap: 12px; }
  h1.page-h { font-size: 34px; }
  .page-hero { padding-top: 44px; padding-bottom: 36px; }
  .page-lede { font-size: 15.5px; line-height: 1.65; }
  h2.section-h { font-size: 24px; margin-bottom: 18px; }
  .eyebrow { font-size: 11.5px; margin-bottom: 12px; letter-spacing: 0.16em; }

  /* Header-only fixes so the orange CTA stops bleeding past the right edge.
     Scoped to .header-cta .btn so other buttons on the page are unaffected. */
  .nav-welcome { display: none; }
  .logo { font-size: 21px; }
  .logo .logo-badge { height: 26px; }
  .header-cta .btn { padding: 11px 16px; font-size: 13.5px; gap: 8px; }
  header.site { padding: 18px 0 8px; }
  .hamburger { display: inline-flex; }

  /* Footer: pulls its links into a clean grid that wraps gracefully on
     narrow widths instead of running off the edge. */
  footer.site { padding: 18px 0 28px; margin-top: 24px; }
  .foot-right { gap: 12px 18px; font-size: 12.5px; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 14px; }
  h1.page-h { font-size: 28px; }
  .header-cta .btn { padding: 10px 14px; font-size: 13px; }
  .logo { font-size: 19px; }
}

/* Touch devices: kill the nav-link underline-on-hover sticky state. */
@media (hover: none) {
  nav.primary a:hover::after { transform: scaleX(0); }
  nav.primary a[aria-current="page"]::after { transform: scaleX(1); }
}

/* ===== Promo banner (admin-controlled, site-wide) ===== */
.promo-banner {
  position: sticky;
  top: 0;
  /* Above the header (100) so it stays pinned while the page scrolls under it. */
  z-index: 110;
  background: linear-gradient(90deg, #e4c678 0%, #f2e5c2 50%, #e8d199 100%);
  color: var(--ink);
  border-bottom: 1px solid rgba(31, 33, 24, 0.10);
}
.promo-track {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 46px;
  /* Right padding leaves room for the absolutely-positioned dots. */
  padding: 9px 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.promo-slide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  text-align: center;
}
/* The class selector outranks the UA [hidden] rule, so restore it explicitly. */
.promo-slide[hidden] { display: none; }
.promo-msg {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.promo-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease;
}
.promo-btn:hover { background: #34372b; transform: translateY(-1px); }
.promo-dots {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}
/* 24x24 tappable area (a11y), with a small visual dot centered inside. */
.promo-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.promo-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(31, 33, 24, 0.28);
  transition: background 140ms ease, transform 140ms ease;
}
.promo-dot:hover::before { background: rgba(31, 33, 24, 0.5); }
.promo-dot.is-active::before { background: var(--ink); transform: scale(1.05); }

/* ===== Promo popup modal ===== */
.promo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.promo-modal[hidden] { display: none; }
.promo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 12, 0.55);
  opacity: 0;
  transition: opacity 200ms ease;
}
.promo-modal.open .promo-modal-backdrop { opacity: 1; }
.promo-modal-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 22px;
  padding: 44px 48px 40px;
  box-shadow: 0 30px 80px rgba(20, 18, 12, 0.35);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 220ms ease, transform 220ms ease;
}
.promo-modal.open .promo-modal-card { opacity: 1; transform: none; }
.promo-modal-x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 140ms ease, background 140ms ease;
}
.promo-modal-x:hover { opacity: 1; background: rgba(31, 33, 24, 0.07); }
.promo-modal-title {
  margin: 0 0 18px;
  padding-right: 28px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.promo-modal-body { font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.promo-modal-body h2 { font-size: 20px; margin: 22px 0 8px; color: var(--ink); }
.promo-modal-body h3 { font-size: 16px; margin: 18px 0 6px; color: var(--ink); }
.promo-modal-body p { margin: 0 0 12px; }
.promo-modal-body a { color: var(--orange); text-decoration: underline; }
.promo-modal-body ul, .promo-modal-body ol { margin: 0 0 12px; padding-left: 20px; }

@media (max-width: 640px) {
  .promo-track { padding: 9px 60px; }
  .promo-msg { font-size: 13px; }
  .promo-modal-card { padding: 38px 24px 30px; border-radius: 18px; }
  .promo-modal-title { font-size: 24px; }
}

/* ===== Assist bar (sticky footer) + chat ===== */
/* Reserve just enough space at the page bottom so the fixed bar clears the
   footer links (bar reaches ~60px up). Only on pages that show the bar. */
.has-assist-bar { padding-bottom: 78px; }
.assist-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: calc(100vw - 24px);
}
.assist-ask {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(20, 18, 12, 0.16);
  transition: transform 140ms ease, box-shadow 140ms ease;
  min-width: 0;
}
.assist-ask:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(20, 18, 12, 0.22); }
.assist-ask__icon { color: var(--muted); flex: none; }
.assist-ask__label { font-weight: 600; flex: none; }
.assist-ask__rotator { overflow: hidden; max-width: 230px; }
.assist-ask__q {
  color: var(--muted);
  white-space: nowrap;
  transition: opacity 200ms ease;
  display: inline-block;
}
.assist-ask__go {
  flex: none;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--muted);
}
.assist-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--orange-btn);
  color: var(--paper);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(20, 18, 12, 0.16);
  transition: transform 140ms ease, background 140ms ease;
}
.assist-cta:hover { background: #B23C0D; transform: translateY(-1px); }

.assist-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 540px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(20, 18, 12, 0.35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 200ms ease, transform 200ms ease;
}
.assist-panel[hidden] { display: none; }
.assist-panel.open { opacity: 1; transform: none; }
.assist-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.assist-title { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--ink); }
.assist-title__badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.assist-x {
  border: 0; background: transparent; color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.assist-x:hover { background: var(--bg-2); color: var(--ink); }

.assist-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.assist-msg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.assist-msg--bot { align-self: flex-start; background: var(--bg-2); color: var(--ink); border-bottom-left-radius: 4px; }
.assist-msg--user { align-self: flex-end; background: var(--orange-btn); color: var(--paper); border-bottom-right-radius: 4px; }
.assist-msg--bot a { color: var(--orange-text); text-decoration: underline; }
.assist-typing { display: inline-flex; gap: 4px; align-items: center; }
.assist-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: assistBlink 1.2s infinite ease-in-out;
}
.assist-typing span:nth-child(2) { animation-delay: 0.2s; }
.assist-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes assistBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.assist-chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.assist-chip {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms ease;
}
.assist-chip:hover { background: var(--bg-2); }

.assist-compose { display: flex; gap: 8px; padding: 12px 14px 6px; border-top: 1px solid var(--rule); }
.assist-text {
  flex: 1;
  min-width: 0;            /* let the flex input shrink instead of overflowing */
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.assist-text:focus { border-color: var(--orange-btn); }
.assist-send {
  flex: none;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: var(--orange-btn); color: var(--paper);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.assist-send:hover { background: #B23C0D; }
.assist-disclaimer { margin: 0; padding: 2px 16px 12px; font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 640px) {
  .has-assist-bar { padding-bottom: 70px; }
  .assist-bar { bottom: 12px; gap: 8px; width: calc(100vw - 20px); }
  .assist-ask__rotator { display: none; }
  .assist-ask { flex: 1; justify-content: center; }
  /* Full-screen sheet on mobile (slides up). 100dvh avoids the 100vh chrome
     bug that pushed the input off-screen. */
  .assist-panel {
    inset: 0;
    width: auto;          /* left:0/right:0 define width — keeps the close X on-screen */
    max-width: none;
    height: 100vh;        /* fallback */
    height: 100dvh;       /* visual viewport — keeps the input above browser chrome */
    max-height: none;
    border: 0;
    border-radius: 0;
    transform: translateY(100%);
  }
  /* 16px input prevents iOS Safari from auto-zooming the page on focus. */
  .assist-text { font-size: 16px; }
  .assist-log { overscroll-behavior: contain; }
}
