/* ==========================================================================
   Weio UI components  v2.0  (2026-11-28)  gold and grey I/O
   Requires tokens.css. Class prefix: .w-
   Covers: base, type, buttons, site header + phone menu, footer, app shell
   (sidebar, phone drawer, top bar, bottom tab bar), cards, plan cards,
   forms, chips, segmented control, badges, modal, composer, chat messages,
   FAQ, prose (legal/help), toast, banner.
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--w-paper);
  color: var(--w-ink);
  font: var(--w-fw-reg) var(--w-fs-body)/var(--w-lh-body) var(--w-sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
img, svg { display: block; max-width: 100%; }
:where(svg[aria-hidden="true"]) { width: 1.2em; height: 1.2em; flex: none; }  /* default icon size */
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--w-gold-ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--w-focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--w-gold-tint); color: var(--w-ink); }
.w-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.w-skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--w-solid); color: var(--w-on-solid); padding: 10px 14px; border-radius: var(--w-r-sm); }
.w-skip:focus { top: 12px; }

/* ---------- Layout ---------- */
.w-wrap { width: 100%; max-width: calc(var(--w-max) + 2 * var(--w-gutter)); margin: 0 auto; padding: 0 var(--w-gutter); }
.w-wrap--prose { max-width: calc(var(--w-max-prose) + 2 * var(--w-gutter)); }
.w-section { padding: var(--w-s10) 0; }
.w-section--tight { padding: var(--w-s9) 0; }
.w-stack > * + * { margin-top: var(--w-s4); }
.w-row { display: flex; gap: var(--w-s3); align-items: center; flex-wrap: wrap; }
.w-grid { display: grid; gap: var(--w-s4); }
.w-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.w-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.w-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .w-grid-3, .w-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .w-grid-2, .w-grid-3, .w-grid-4 { grid-template-columns: 1fr; } .w-section { padding: var(--w-s9) 0; } }

/* ---------- Type ---------- */
.w-eyebrow {
  margin: 0; font: var(--w-fw-med) var(--w-fs-eyebrow)/1.3 var(--w-sans);
  letter-spacing: var(--w-track-eyebrow); color: var(--w-gold-ink);
}
.w-eyebrow--gold { color: var(--w-gold-ink); }
.w-eyebrow--quiet { color: var(--w-ink-3); }
.w-display, .w-h1, .w-h2, .w-h3, .w-h4 { margin: 0; color: var(--w-ink); text-wrap: balance; }
.w-display { font-size: var(--w-fs-display); font-weight: var(--w-fw-med); line-height: var(--w-lh-tight); letter-spacing: var(--w-track-display); }
.w-h1 { font-size: var(--w-fs-h1); font-weight: var(--w-fw-med); line-height: 1.08; letter-spacing: var(--w-track-display); }
.w-h2 { font-size: var(--w-fs-h2); font-weight: var(--w-fw-med); line-height: var(--w-lh-head); letter-spacing: var(--w-track-head); }
.w-h3 { font-size: var(--w-fs-h3); font-weight: var(--w-fw-semi); line-height: 1.3; letter-spacing: -0.01em; }
.w-h4 { font-size: var(--w-fs-h4); font-weight: var(--w-fw-semi); line-height: 1.35; }
.w-lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--w-ink-2); max-width: 60ch; margin: 0; text-wrap: pretty; }
.w-muted { color: var(--w-ink-2); }
.w-meta { color: var(--w-ink-3); font-size: var(--w-fs-sm); }
.w-mono { font-family: var(--w-mono); }
.w-num { font-family: var(--w-mono); font-variant-numeric: tabular-nums; }
.w-gold-text { color: var(--w-gold-ink); }

/* ---------- Brand: the I/O mark ----------
   Grey terminal frame (In) with a gold cursor (Out), then "Weio" in the UI sans.
   Production uses the live /brand/weio-wordmark*.svg files; this inline version
   follows currentColor for the word so it works on both themes. */
.w-logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--w-ink); font: var(--w-fw-med) 21px/1 var(--w-sans); letter-spacing: -0.035em; }
.w-logo:hover { color: var(--w-ink); }
.w-logo:hover .w-mark-cursor, .w-logo:focus-visible .w-mark-cursor { animation: w-dash 1.05s steps(1) infinite; }
.w-logo svg { width: 1.24em; height: 1.24em; flex: none; }
.w-logo--sm { font-size: 18px; gap: 8px; }
.w-logo--sm svg { width: 1.22em; height: 1.22em; }
.w-mark-frame { stroke: var(--w-io-in); }
.w-mark-cursor { fill: var(--w-gold); }
.w-appicon { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--w-sunk); box-shadow: var(--w-ring); }
.w-appicon svg { width: 20px; height: 20px; }

/* ---------- Buttons ---------- */
.w-btn {
  --_bg: var(--w-raise); --_fg: var(--w-ink); --_bd: var(--w-line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--w-tap); padding: 0 18px;
  border: 1px solid var(--_bd); border-radius: var(--w-r-pill);
  background: var(--_bg); color: var(--_fg);
  font: var(--w-fw-semi) var(--w-fs-ui)/1 var(--w-sans); letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--w-dur-1) var(--w-ease), border-color var(--w-dur-1) var(--w-ease), transform var(--w-dur-1) var(--w-ease);
}
.w-btn:hover { color: var(--_fg); border-color: var(--w-ink-3); }
.w-btn:active { transform: translateY(1px); }
.w-btn[disabled], .w-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.w-btn--primary { --_bg: var(--w-gold); --_fg: var(--w-on-gold); --_bd: var(--w-gold); }
.w-btn--primary:hover { background: var(--w-gold-hover); border-color: var(--w-gold-hover); }
.w-btn--solid { --_bg: var(--w-solid); --_fg: var(--w-on-solid); --_bd: var(--w-solid); }
.w-btn--solid:hover { background: var(--w-solid-hover); border-color: var(--w-solid-hover); }
.w-btn--ghost { --_bg: transparent; }
.w-btn--quiet { --_bg: transparent; --_bd: transparent; padding: 0 12px; }
.w-btn--quiet:hover { background: var(--w-sunk); border-color: transparent; }
.w-btn--danger { --_bg: var(--w-err); --_fg: #fff; --_bd: var(--w-err); }
.w-btn--sm { min-height: 36px; padding: 0 14px; font-size: var(--w-fs-sm); }
.w-btn--lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.w-btn--block { width: 100%; }
.w-iconbtn {
  display: inline-grid; place-items: center; width: var(--w-tap); height: var(--w-tap); flex: none;
  border: 0; border-radius: var(--w-r-sm); background: transparent; color: var(--w-ink-2); cursor: pointer;
}
.w-iconbtn:hover { background: var(--w-sunk); color: var(--w-ink); }
.w-iconbtn svg { width: 20px; height: 20px; }
.w-kbd { font: var(--w-fw-med) 11.5px/1 var(--w-mono); padding: 4px 6px; border: 1px solid var(--w-line-2); border-radius: 6px; color: var(--w-ink-3); background: var(--w-surface); }

/* ---------- Site header (weio.ai, legal, help, app signed-out) ---------- */
.w-header {
  position: sticky; top: 0; z-index: var(--w-z-header);
  height: var(--w-header-h);
  background: var(--w-header-bg);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--w-line);
}
.w-header__in { height: 100%; display: flex; align-items: center; gap: var(--w-s5); }
.w-nav { display: flex; gap: 2px; align-items: center; margin-left: var(--w-s4); }
.w-nav a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--w-r-pill);
  color: var(--w-ink-2); text-decoration: none; font-size: var(--w-fs-ui); font-weight: var(--w-fw-med);
}
.w-nav a:hover { color: var(--w-ink); background: var(--w-sunk); }
.w-nav a[aria-current="page"] { color: var(--w-on-solid); background: var(--w-solid); }
.w-header__end { margin-left: auto; display: flex; gap: var(--w-s2); align-items: center; }
.w-header__menu { display: none; }
@media (max-width: 900px) {
  .w-nav, .w-header__end .w-hide-phone { display: none; }
  .w-header__menu { display: inline-grid; }
}
/* Phone menu sheet (signed-out site): drops from the header, not full page */
.w-menusheet {
  position: fixed; inset: var(--w-header-h) 0 auto 0; z-index: var(--w-z-drawer);
  background: var(--w-surface); border-bottom: 1px solid var(--w-line); box-shadow: var(--w-shadow-2);
  padding: var(--w-s3) var(--w-gutter) var(--w-s5);
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity var(--w-dur-2) var(--w-ease), transform var(--w-dur-2) var(--w-ease), visibility 0s linear var(--w-dur-2);
}
.w-menusheet[data-open="true"] { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.w-menusheet a.w-menusheet__link { display: flex; align-items: center; min-height: 48px; text-decoration: none; font-size: 17px; font-weight: var(--w-fw-semi); border-bottom: 1px solid var(--w-line); }
.w-menusheet .w-row { margin-top: var(--w-s4); }
.w-menusheet .w-row .w-btn { flex: 1; }

/* ---------- Footer (one footer for site, legal, help, app signed-out) ---------- */
.w-footer { border-top: 1px solid var(--w-line); padding: var(--w-s9) 0 var(--w-s7); color: var(--w-ink-2); font-size: var(--w-fs-sm); }
.w-footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--w-s7); }
.w-footer h4 { margin: 0 0 var(--w-s3); }
.w-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.w-footer a { text-decoration: none; color: var(--w-ink-2); }
.w-footer a:hover { color: var(--w-ink); }
.w-footer__line { margin-top: var(--w-s4); max-width: 34ch; color: var(--w-ink-2); }
.w-footer__base { margin-top: var(--w-s8); padding-top: var(--w-s5); border-top: 1px solid var(--w-line); display: flex; gap: var(--w-s4); justify-content: space-between; flex-wrap: wrap; color: var(--w-ink-3); }
@media (max-width: 900px) { .w-footer__grid { grid-template-columns: 1fr 1fr; } .w-footer__brand { grid-column: 1 / -1; } }

/* ---------- App shell (chat + portal, signed in) ----------
   Desktop >= 900px: persistent left sidebar (272px) + main.
   Below 900px: sidebar becomes a LEFT drawer, width min(320px, 85vw),
   opened by the menu button at the LEFT of the top bar, with a scrim.
   It never covers the full page. Phone also gets the bottom tab bar.     */
.w-app { display: grid; grid-template-columns: var(--w-sidebar-w) minmax(0, 1fr); min-height: 100dvh; background: var(--w-paper); }
.w-sidebar {
  position: sticky; top: 0; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--w-s1);
  background: var(--w-surface); border-right: 1px solid var(--w-line);
  padding: var(--w-s3) var(--w-s3) var(--w-s3);
}
.w-sidebar__top { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 var(--w-s2) 0 var(--w-s2); }
.w-sidebar__scroll { overflow-y: auto; flex: 1; margin: 0 calc(-1 * var(--w-s3)); padding: 0 var(--w-s3); scrollbar-width: thin; }
.w-sidebar__foot { border-top: 1px solid var(--w-line); padding-top: var(--w-s3); }
.w-side-label { display: flex; align-items: center; justify-content: space-between; padding: var(--w-s4) var(--w-s3) var(--w-s2); }
.w-side-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 var(--w-s3);
  border-radius: var(--w-r-sm); color: var(--w-ink-2); text-decoration: none;
  font-size: var(--w-fs-ui); font-weight: var(--w-fw-med); white-space: nowrap; overflow: hidden;
}
.w-side-item span.w-trunc { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.w-side-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.w-side-item:hover { background: var(--w-sunk); color: var(--w-ink); }
.w-side-item[aria-current="page"] { background: var(--w-gold-tint); color: var(--w-gold-ink); font-weight: var(--w-fw-semi); }
.w-side-item .w-meta { margin-left: auto; font-size: 12px; font-family: var(--w-mono); }
.w-side-item--sub { min-height: 34px; padding-left: 40px; font-size: var(--w-fs-sm); }
.w-side-item[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.w-soon { font: var(--w-fw-med) 10.5px/1 var(--w-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--w-ink-3); border: 1px solid var(--w-line-2); border-radius: var(--w-r-pill); padding: 3px 6px; margin-left: auto; }
.w-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--w-gold); flex: none; }

.w-main { min-width: 0; display: flex; flex-direction: column; }
.w-app--chat .w-main { height: 100dvh; overflow: hidden; }
.w-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.w-topbar {
  position: sticky; top: 0; z-index: var(--w-z-header); height: var(--w-header-h);
  display: flex; align-items: center; gap: var(--w-s2); padding: 0 var(--w-s5);
  background: color-mix(in srgb, var(--w-paper) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--w-line);
}
.w-topbar__menu { display: none; }
.w-topbar__title { min-width: 0; flex: 1; display: flex; align-items: center; gap: var(--w-s2); }
.w-topbar__title h1 { margin: 0; font-size: 16px; font-weight: var(--w-fw-semi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-topbar__end { display: flex; gap: var(--w-s1); align-items: center; }
.w-content { padding: var(--w-s7) var(--w-s7) var(--w-s9); max-width: 1180px; width: 100%; margin: 0 auto; }

.w-scrim { position: fixed; inset: 0; z-index: calc(var(--w-z-drawer) - 1); background: var(--w-scrim); opacity: 0; visibility: hidden; transition: opacity var(--w-dur-2) var(--w-ease), visibility 0s linear var(--w-dur-2); }

@media (max-width: 899.98px) {
  .w-app { grid-template-columns: minmax(0, 1fr); }
  .w-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: var(--w-z-drawer);
    width: var(--w-drawer-w); height: 100dvh;
    box-shadow: var(--w-shadow-3); border-right: 0;
    border-radius: 0 var(--w-r-lg) var(--w-r-lg) 0;
    transform: translateX(-104%); transition: transform var(--w-dur-2) var(--w-ease);
    padding-top: max(var(--w-s3), env(safe-area-inset-top));
  }
  .w-app[data-drawer="open"] .w-sidebar { transform: none; }
  .w-app[data-drawer="open"] .w-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
  .w-topbar { padding: 0 var(--w-s2); }
  .w-topbar__menu { display: inline-grid; }
  .w-content { padding: var(--w-s5) var(--w-s4) calc(var(--w-tabbar-h) + var(--w-s8)); }
}

/* Phone bottom tab bar */
.w-tabbar { display: none; }
@media (max-width: 899.98px) {
  .w-tabbar {
    display: flex; position: fixed; z-index: var(--w-z-tabbar);
    left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    height: var(--w-tabbar-h); padding: 6px;
    background: color-mix(in srgb, var(--w-raise) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--w-line); border-radius: var(--w-r-pill); box-shadow: var(--w-shadow-2);
  }
  .w-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border-radius: var(--w-r-pill); text-decoration: none; color: var(--w-ink-3);
    font: var(--w-fw-med) 11px/1 var(--w-sans);
  }
  .w-tabbar a svg { width: 20px; height: 20px; }
  .w-tabbar a[aria-current="page"] { color: var(--w-gold-ink); background: var(--w-gold-tint); }
  .w-app--chat .w-tabbar { display: none; } /* inside a conversation the composer owns the bottom */
}

/* ---------- Cards ---------- */
.w-card { background: var(--w-card); border: 0; box-shadow: var(--w-ring), var(--w-shadow-1); border-radius: var(--w-r-lg); padding: var(--w-s5); }
.w-card--raise { background: var(--w-raise); }
.w-card--tint { background: var(--w-gold-tint); box-shadow: var(--w-gold-ring); }
.w-card--flat { box-shadow: var(--w-ring); }
.w-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--w-s3); margin-bottom: var(--w-s4); }
.w-quick { display: flex; flex-direction: column; gap: var(--w-s3); text-decoration: none; min-height: 120px; transition: border-color var(--w-dur-1) var(--w-ease), transform var(--w-dur-1) var(--w-ease); }
.w-quick:hover { box-shadow: var(--w-ring-2), var(--w-shadow-1); transform: translateY(-1px); color: inherit; }
.w-quick__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--w-gold-tint); color: var(--w-gold-ink); }
.w-quick__icon svg { width: 18px; height: 18px; }
.w-list { list-style: none; margin: 0; padding: 0; }
.w-list li + li { border-top: 1px solid var(--w-line); }
.w-list a, .w-list .w-list__row { display: flex; align-items: center; gap: var(--w-s3); min-height: 48px; padding: 0 var(--w-s1); text-decoration: none; }
.w-list .w-trunc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-stat { font: var(--w-fw-bold) 28px/1 var(--w-sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.w-bars { display: flex; align-items: flex-end; gap: 4px; height: 56px; margin-top: var(--w-s3); }
.w-bars i { flex: 1; background: var(--w-gold); opacity: .85; border-radius: 3px 3px 1px 1px; min-height: 3px; }
.w-bars i.is-low { background: var(--w-line-2); opacity: 1; }
.w-progress { height: 6px; border-radius: 99px; background: var(--w-sunk); overflow: hidden; }
.w-progress > i { display: block; height: 100%; background: var(--w-gold); border-radius: inherit; }

/* ---------- Plan cards ---------- */
.w-band { background: var(--w-band); color: var(--w-band-ink); }
.w-band .w-meta, .w-band .w-muted { color: color-mix(in srgb, var(--w-band-ink) 72%, transparent); }
.w-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--w-s4); align-items: stretch; }
@media (max-width: 1100px) { .w-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .w-plans { grid-template-columns: 1fr; } }
.w-plan {
  position: relative; display: flex; flex-direction: column; gap: var(--w-s4);
  padding: var(--w-s6); border-radius: var(--w-r-lg);
  background: color-mix(in srgb, var(--w-band-ink) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--w-band-ink) 14%, transparent);
  color: var(--w-band-ink);
}
.w-plan__name { font: var(--w-fw-bold) 20px/1.2 var(--w-sans); letter-spacing: -0.01em; }
.w-plan__price { display: flex; align-items: baseline; gap: 6px; }
.w-plan__price b { font: var(--w-fw-heavy) 44px/1 var(--w-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.w-plan__price span { font-size: var(--w-fs-sm); opacity: .72; }
.w-plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: var(--w-fs-sm); }
.w-plan li { display: flex; gap: 10px; align-items: flex-start; }
.w-plan li::before { content: ""; width: 14px; height: 14px; margin-top: 3px; flex: none; border-radius: 50%; background: var(--w-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2 4-4.4' fill='none' stroke='%231A1204' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.w-plan .w-btn { margin-top: auto; }
.w-plan--featured { background: var(--w-raise); color: var(--w-ink); border: 2px solid var(--w-gold); box-shadow: var(--w-shadow-3); }
[data-theme="dark"] .w-plan--featured { background: var(--w-raise); }
.w-plan__flag { position: absolute; top: -12px; left: var(--w-s6); background: var(--w-gold); color: var(--w-on-gold); font: var(--w-fw-semi) 11px/1 var(--w-mono); letter-spacing: .1em; text-transform: uppercase; padding: 7px 10px; border-radius: var(--w-r-pill); }
/* light-surface plan card (used inside the app on /plans) */
.w-plan--light { background: var(--w-card); color: var(--w-ink); border: 0; box-shadow: var(--w-ring); }
.w-plan--current { outline: 2px solid var(--w-ink); outline-offset: -2px; }

/* ---------- Forms ---------- */
.w-field { display: grid; gap: 6px; }
.w-label { font-size: var(--w-fs-sm); font-weight: var(--w-fw-semi); color: var(--w-ink); }
.w-help { font-size: var(--w-fs-xs); color: var(--w-ink-3); }
.w-input, .w-select, .w-textarea {
  width: 100%; min-height: var(--w-tap); padding: 10px 14px;
  border: 1px solid var(--w-line-2); border-radius: var(--w-r-sm);
  background: var(--w-raise); color: var(--w-ink); font: var(--w-fs-ui)/1.4 var(--w-sans);
}
.w-textarea { min-height: 96px; resize: vertical; }
.w-input::placeholder, .w-textarea::placeholder { color: var(--w-ink-3); }
.w-input:focus, .w-select:focus, .w-textarea:focus { outline: none; border-color: var(--w-focus); box-shadow: 0 0 0 3px var(--w-gold-tint); }
.w-field--error .w-input { border-color: var(--w-err); }
.w-field--error .w-help { color: var(--w-err); }
.w-check { display: flex; gap: 10px; align-items: center; min-height: 40px; font-size: var(--w-fs-ui); cursor: pointer; }
.w-check input { width: 18px; height: 18px; accent-color: var(--w-gold); }
.w-divider { display: flex; align-items: center; gap: var(--w-s3); color: var(--w-ink-3); font-size: var(--w-fs-sm); }
.w-divider::before, .w-divider::after { content: ""; flex: 1; height: 1px; background: var(--w-line-2); }

/* ---------- Chips, segmented, badges, tags ---------- */
.w-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--w-r-pill); border: 1px solid var(--w-line-2); background: var(--w-raise); color: var(--w-ink-2); font-size: var(--w-fs-sm); font-weight: var(--w-fw-med); text-decoration: none; cursor: pointer; white-space: nowrap; }
.w-chip[aria-pressed="true"] { background: var(--w-solid); color: var(--w-on-solid); border-color: var(--w-solid); }
.w-seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--w-sunk); border-radius: var(--w-r-pill); }
.w-seg button { border: 0; background: transparent; height: 36px; padding: 0 16px; border-radius: var(--w-r-pill); font-size: var(--w-fs-sm); font-weight: var(--w-fw-semi); color: var(--w-ink-2); cursor: pointer; }
.w-seg button[aria-pressed="true"] { background: var(--w-raise); color: var(--w-ink); box-shadow: var(--w-shadow-1); }
.w-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--w-r-pill); font: var(--w-fw-semi) 12px/1 var(--w-sans); background: var(--w-sunk); color: var(--w-ink-2); }
.w-badge--gold { background: var(--w-gold-tint); color: var(--w-gold-ink); }
.w-badge--ok { background: var(--w-ok-tint); color: var(--w-ok); }
.w-badge--warn { background: var(--w-warn-tint); color: var(--w-warn); }
.w-badge--err { background: var(--w-err-tint); color: var(--w-err); }
.w-badge--info { background: var(--w-info-tint); color: var(--w-info); }

/* ---------- Modal ----------
   Desktop: centered, max 520px. Phone (<600px): bottom sheet.            */
.w-modal-wrap { position: fixed; inset: 0; z-index: var(--w-z-modal); display: grid; place-items: center; padding: var(--w-s4); background: var(--w-scrim); }
.w-modal-wrap[hidden] { display: none; }
.w-modal { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--w-raise); border-radius: var(--w-r-lg); box-shadow: var(--w-shadow-3); border: 1px solid var(--w-line); }
.w-modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--w-s3); padding: var(--w-s5) var(--w-s6) 0; }
.w-modal__head h2 { margin: 0; font-size: 19px; font-weight: var(--w-fw-bold); letter-spacing: -0.01em; }
.w-modal__body { padding: var(--w-s5) var(--w-s6); display: grid; gap: var(--w-s4); }
.w-modal__foot { padding: var(--w-s4) var(--w-s6) var(--w-s5); display: flex; justify-content: flex-end; gap: var(--w-s2); border-top: 1px solid var(--w-line); }
@media (max-width: 600px) {
  .w-modal-wrap { place-items: end stretch; padding: 0; }
  .w-modal { width: 100%; border-radius: var(--w-r-lg) var(--w-r-lg) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .w-modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--w-line-2); margin: 10px auto 0; }
  .w-modal__foot .w-btn { flex: 1; }
}

/* ---------- Chat ---------- */
.w-thread { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: var(--w-s7) var(--w-s5) var(--w-s4); display: flex; flex-direction: column; gap: var(--w-s6); }
.w-msg { display: flex; gap: var(--w-s3); align-items: flex-start; }
.w-msg__body { min-width: 0; font-size: 16px; line-height: 1.6; }
.w-msg__body p { margin: 0 0 .7em; } .w-msg__body p:last-child { margin-bottom: 0; }
.w-msg--user { justify-content: flex-end; }
.w-msg--user .w-msg__body { background: var(--w-sunk); padding: 12px 16px; border-radius: 18px 18px 6px 18px; max-width: 78%; }
.w-msg__actions { display: flex; gap: 2px; margin-top: 6px; color: var(--w-ink-3); }
.w-msg__actions .w-iconbtn { width: 34px; height: 34px; }
.w-msg__actions .w-iconbtn svg { width: 16px; height: 16px; }
.w-attach { display: inline-flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border: 1px solid var(--w-line-2); border-radius: var(--w-r-sm); background: var(--w-raise); font-size: var(--w-fs-sm); }
.w-attach__thumb { width: 40px; height: 40px; border-radius: 8px; background: linear-gradient(135deg, var(--w-gold-tint), var(--w-gold)); flex: none; }
.w-code { font: 13.5px/1.55 var(--w-mono); background: var(--w-sunk); border: 1px solid var(--w-line); border-radius: var(--w-r-sm); padding: 12px 14px; overflow-x: auto; }

.w-composer-dock { position: sticky; bottom: 0; padding: var(--w-s3) var(--w-s4) max(var(--w-s4), env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--w-paper) 70%, transparent); }
.w-composer {
  max-width: 760px; margin: 0 auto; display: grid; gap: var(--w-s2);
  background: var(--w-raise); border: 0; border-radius: 20px;
  padding: 10px 10px 10px 16px; box-shadow: var(--w-ring-2), var(--w-shadow-2);
  transition: box-shadow var(--w-dur-2) var(--w-ease);
}
.w-composer:focus-within { box-shadow: inset 0 0 0 1px var(--w-gold), 0 0 0 4px color-mix(in srgb, var(--w-gold) 40%, transparent), var(--w-shadow-2); }
.w-composer textarea { caret-color: var(--w-gold); border: 0; outline: 0; resize: none; background: transparent; color: var(--w-ink); font: 16px/1.5 var(--w-sans); min-height: 28px; max-height: 40dvh; padding: 6px 0; }
.w-composer__row { display: flex; align-items: center; gap: 4px; }
.w-composer__row .w-iconbtn { width: 38px; height: 38px; }
.w-send { margin-left: auto; width: 38px; height: 38px; border-radius: 12px; border: 0; display: grid; place-items: center; background: var(--w-solid); color: var(--w-on-solid); cursor: pointer; }
.w-send svg { width: 18px; height: 18px; }
.w-composer__note { text-align: center; font-size: 12px; color: var(--w-ink-3); margin-top: 8px; }

/* ---------- FAQ ---------- */
.w-faq details { border-top: 1px solid var(--w-line); }
.w-faq details:last-child { border-bottom: 1px solid var(--w-line); }
.w-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--w-s4); padding: var(--w-s5) 0; font-weight: var(--w-fw-semi); font-size: 17px; }
.w-faq summary::-webkit-details-marker { display: none; }
.w-faq summary::after { content: "+"; font: 400 22px/1 var(--w-mono); color: var(--w-ink-3); }
.w-faq details[open] summary::after { content: "−"; }
.w-faq details > div { padding: 0 0 var(--w-s5); color: var(--w-ink-2); max-width: 68ch; }

/* ---------- Prose (legal, help articles) ---------- */
.w-prose { color: var(--w-ink); font-size: 16.5px; line-height: 1.7; max-width: 68ch; }
.w-prose h2 { font-size: 22px; font-weight: var(--w-fw-bold); letter-spacing: -0.01em; margin: 2.2em 0 .6em; scroll-margin-top: calc(var(--w-header-h) + 16px); }
.w-prose h3 { font-size: 18px; font-weight: var(--w-fw-semi); margin: 1.8em 0 .5em; }
.w-prose p, .w-prose ul, .w-prose ol { margin: 0 0 1em; }
.w-prose li + li { margin-top: .35em; }
.w-prose a { color: var(--w-gold-ink); }
.w-prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1em 0 1.4em; display: block; overflow-x: auto; }
.w-prose th, .w-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--w-line); white-space: nowrap; }
.w-prose th { font: var(--w-fw-semi) 12px/1.2 var(--w-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--w-ink-3); }
.w-toc { position: sticky; top: calc(var(--w-header-h) + 24px); display: grid; gap: 2px; font-size: var(--w-fs-sm); }
.w-toc a { display: block; padding: 6px 12px; border-left: 2px solid var(--w-line); color: var(--w-ink-2); text-decoration: none; }
.w-toc a[aria-current="true"] { border-left-color: var(--w-gold); color: var(--w-ink); font-weight: var(--w-fw-semi); }

/* ---------- Banner + toast ---------- */
.w-banner { background: var(--w-solid); color: var(--w-on-solid); font-size: var(--w-fs-sm); }
.w-banner__in { display: flex; align-items: center; gap: var(--w-s3); min-height: 44px; }
.w-banner a { color: inherit; font-weight: var(--w-fw-semi); }
.w-banner .w-iconbtn { margin-left: auto; color: inherit; width: 36px; height: 36px; }
.w-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: var(--w-z-toast); background: var(--w-solid); color: var(--w-on-solid); padding: 12px 16px; border-radius: var(--w-r-sm); box-shadow: var(--w-shadow-2); font-size: var(--w-fs-sm); }
.w-note { display: flex; gap: var(--w-s3); padding: var(--w-s4); border-radius: var(--w-r-sm); background: var(--w-info-tint); color: var(--w-ink); font-size: var(--w-fs-sm); }
.w-note--warn { background: var(--w-warn-tint); }

/* ---------- Utilities ---------- */
.w-hide { display: none !important; }
@media (max-width: 899.98px) { .w-hide-phone { display: none !important; } }
@media (min-width: 900px) { .w-hide-desk { display: none !important; } }
.w-center { text-align: center; }
.w-mt-0 { margin-top: 0; } .w-mt-2 { margin-top: var(--w-s2); } .w-mt-4 { margin-top: var(--w-s4); } .w-mt-6 { margin-top: var(--w-s6); } .w-mt-8 { margin-top: var(--w-s8); }


/* ==========================================================================
   I/O hero  (kept from the live weio.ai home, polished)
   Headline: "Requests [In]." grey box, "Results [Out]." gold box.
   Ledger: typed IN/OUT rows that rise and fade at the top, with a gold
   underscore cursor. Prompt box underneath.
   ========================================================================== */
.w-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(56px, 9vw, 120px) 0 var(--w-s9); text-align: center; }
.w-hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--w-glow); pointer-events: none; animation: w-breathe 9s var(--w-ease) infinite alternate; }
.w-hero::after { /* gold horizon hairline */
  content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 1px; z-index: -1;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--w-gold) 55%, transparent), transparent);
}
.w-hero__field { /* fine dot grid, faded out from the centre */
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--w-ink) 9%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px; background-position: center top;
  -webkit-mask-image: radial-gradient(60% 55% at 50% 38%, #000, transparent 75%);
          mask-image: radial-gradient(60% 55% at 50% 38%, #000, transparent 75%);
}
.w-io-head { margin: 0 auto; font: var(--w-fw-med) var(--w-fs-display)/1.04 var(--w-sans); letter-spacing: var(--w-track-display); color: var(--w-ink); font-feature-settings: "ss01", "cv11"; }
.w-io-head > span { display: block; animation: w-rise .8s var(--w-ease-out, cubic-bezier(.2,.7,.2,1)) both; }
.w-io-head > span + span { animation-delay: .14s; }
.w-iobox {
  position: relative; display: inline-block; padding: 0 calc(.13em + .045em) .05em .13em; margin-left: .04em;
  border-radius: .12em; letter-spacing: -0.045em; transition: color .4s var(--w-ease), text-shadow .5s var(--w-ease);
}
.w-iobox::before { /* tint that lights up while its side of the ledger is typing */
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity .5s var(--w-ease);
}
.w-iobox::after { /* the box itself, drawn on entry */
  content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 .04em currentColor;
  animation: w-draw .9s cubic-bezier(.65,0,.35,1) .45s both;
}
.w-io-head > span + span .w-iobox::after { animation-delay: .62s; }
.w-iobox--in { color: var(--w-io-in); }
.w-iobox--out { color: var(--w-gold); }
[data-theme="light"] .w-iobox--out { color: var(--w-gold-ink); }
.w-hero[data-io="in"] .w-iobox--in::before { opacity: .12; }
.w-hero[data-io="out"] .w-iobox--out::before { opacity: .12; }
.w-hero[data-io="out"] .w-iobox--out { text-shadow: 0 0 .45em color-mix(in srgb, var(--w-gold) 38%, transparent); }
.w-io-head--sm { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; }
.w-io-head--sm > span, .w-io-head--sm .w-iobox::after { animation: none; }

.w-ledger {
  position: relative; max-width: 640px; margin: var(--w-s7) auto 0; text-align: left;
  height: clamp(230px, 31vh, 310px); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,.25) 22%, rgba(0,0,0,.7) 48%, #000 72%);
          mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,.25) 22%, rgba(0,0,0,.7) 48%, #000 72%);
}
.w-ledger__in { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 14px; padding-bottom: 4px; }
.w-io-row { display: flex; gap: 14px; align-items: baseline; font-size: clamp(16px, 1.35vw, 18px); line-height: 1.45; color: var(--w-ink); animation: w-rowin var(--w-dur-2) var(--w-ease) both; }
.w-io-row--out { color: var(--w-ink-2); }
.w-iotag {
  flex: none; width: 38px; text-align: center; padding: 3px 0 2px; border-radius: 5px;
  font: var(--w-fw-semi) 10.5px/1 var(--w-mono); letter-spacing: .06em;
  color: var(--w-io-in); box-shadow: inset 0 0 0 1.25px currentColor; transform: translateY(-1px);
}
[data-theme="light"] .w-iotag { color: var(--w-ink-3); }
.w-io-row--out .w-iotag { color: var(--w-gold-ink); }
.w-iotag { transition: background .3s var(--w-ease); }
.w-io-row.is-typing .w-iotag { background: color-mix(in srgb, currentColor 16%, transparent); }
.w-io-row > span { min-width: 0; text-wrap: pretty; }
.w-io-row.is-typing > span::after, .w-cursor::after {
  content: ""; display: inline-block; width: .55em; height: 2px; margin-left: 2px; vertical-align: baseline;
  background: var(--w-gold); animation: w-dash 1.05s steps(1) infinite;
}
@keyframes w-dash { 50% { opacity: 0; } }
@keyframes w-rise { from { opacity: 0; transform: translateY(.18em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes w-draw { from { clip-path: inset(0 100% 0 0 round .12em); } to { clip-path: inset(0 0 0 0 round .12em); } }
@keyframes w-breathe { from { opacity: .78; } to { opacity: 1; } }
@keyframes w-rowin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.w-wbox {
  display: flex; align-items: flex-end; gap: 10px; max-width: 640px; margin: var(--w-s6) auto 0; padding: 10px 10px 10px 18px;
  border-radius: 20px; background: var(--w-raise); box-shadow: var(--w-ring-2), var(--w-shadow-2); text-align: left;
}
.w-wbox:focus-within { box-shadow: inset 0 0 0 1px var(--w-gold), 0 0 0 4px color-mix(in srgb, var(--w-gold) 40%, transparent), var(--w-shadow-2); }
.w-wbox textarea { caret-color: var(--w-gold); flex: 1; min-height: 38px; max-height: 160px; padding: 8px 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--w-ink); font: var(--w-fs-body)/1.45 var(--w-sans); }
.w-wbox textarea::placeholder { color: var(--w-ink-3); }
.w-wbox .w-send { width: 38px; height: 38px; border-radius: 12px; }
.w-hero__cta { margin-top: var(--w-s6); justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .w-io-row, .w-io-head > span, .w-iobox::after, .w-hero::before { animation: none; }
  .w-iobox, .w-iobox::before, .w-iotag { transition: none; }
  .w-logo:hover .w-mark-cursor, .w-logo:focus-visible .w-mark-cursor { animation: none; }
  .w-io-row.is-typing > span::after, .w-cursor::after { animation: none; }
  .w-quick:hover, .w-btn:active { transform: none; }
}

/* Lit stage: the hero glow for any top-of-page block (pricing, help, sign in, errors). */
.w-lit { position: relative; isolation: isolate; }
.w-lit::before { content: ""; position: absolute; inset: 0 0 auto; height: min(560px, 100%); z-index: -1; background: var(--w-glow); pointer-events: none; }
/* Featured plan: gold ring with a soft halo. */
.w-plan--featured { border: 1px solid var(--w-gold); box-shadow: 0 18px 60px -20px color-mix(in srgb, var(--w-gold) 45%, transparent), var(--w-shadow-3); }
/* Static IN/OUT pair, for errors, empty states and feature cards. */
.w-io-pair { display: grid; gap: 10px; text-align: left; }
.w-io-pair .w-io-row { animation: none; }
