@import url('/public/static/fonts/fonts.css'); /* self-hosted (scripts/selfhost_fonts.py) */
/* Weio Public CSS — vermillion / warm-paper design system (Hanken Grotesk + JetBrains Mono) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-sans, 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif); }
::selection { background: var(--accent, #E25535); color: #fff; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

/* ── Design tokens — warm "Claude" palette, unified across Weio ──
   White content surfaces, warm off-white sidebar, terracotta accent.
   Matches the tenant portal (config: dashboard/ui_templates.py _THEMES). */
:root {
  /* ── Brand tokens (BRAND-LOCKUP-STANDARD.md) — the mark's ink + Weio Blue dot.
     The rendered mark is always capital "Weio" + raised --weio-blue dot; these are
     the only colours a brand lockup may use. ── */
  --weio-ink:     #0C0F14;
  --weio-blue:    #3D5AFE;

  /* ── Design-system tokens (vermillion / warm paper) ── */
  --paper:        #F7F5EF;             /* primary page background */
  --card:         #FFFFFF;             /* card background */
  --ink:          #17150F;             /* primary text / dark sections */
  --ink-soft:     #57534A;             /* body text */
  --ink-muted:    #8A857B;             /* captions / labels */
  --ink-faint:    #A8A299;             /* footer meta / placeholders */
  --line:         rgba(23,21,15,0.10); /* hairlines / borders */
  --accent-hover: #C7401E;
  --accent-tint:  rgba(226,85,53,0.10);/* icon chips, soft highlights */
  --accent-on-dark: #F0A089;           /* accent text on the ink background */

  --font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* ── Legacy aliases remapped onto the new palette, so every existing
        component adopts the system without renaming any class ── */
  --bg:        var(--paper);   /* main content background */
  --surface:   var(--card);    /* cards, panels — stay white */
  --surface2:  #F2F0E9;        /* secondary fills, sidebar, chat bubbles */
  --surface3:  #EBE7DE;        /* heavier fills / badges */
  --accent:    #E25535;        /* vermillion — the one accent */
  --accent-h:  #C7401E;
  --accent-soft: var(--accent-tint); /* active nav / selected rows */
  --text:      var(--ink);
  --text-soft: var(--ink-soft);
  --text-sec:  var(--ink-muted);
  --border:    var(--line);
  --border-strong: rgba(23,21,15,0.16);
  --line-strong: rgba(23,21,15,0.16);
  --success:   #3d9a6f;
  --warning:   #c2710c;
  --error:     #c0392b;
  --danger:    #c23b2f;
  --info:      #4f46e5;
  --shadow-sm: 0 1px 3px rgba(23,21,15,.05);
  --shadow-md: 0 4px 16px rgba(23,21,15,.07);
  --shadow-lg: 0 12px 32px rgba(23,21,15,.10);
  --radius:    12px;
  --radius-sm: 10px;
  --radius-lg: 18px;
}
/* ── Theme accent overrides (same set as tenant portal) ──
   Each theme also sets --accent-soft (a 12%-ish tint) for active states. */
:root[data-theme="terracotta"] { --accent: #c96442; --accent-h: #b8572f; --accent-soft: #f7e9e1; }
:root[data-theme="emerald"]    { --accent: #10b981; --accent-h: #059669; --accent-soft: #ddf3ea; }
:root[data-theme="indigo"]     { --accent: #6366f1; --accent-h: #4f46e5; --accent-soft: #e6e7fb; }
:root[data-theme="amber"]      { --accent: #d97706; --accent-h: #b45309; --accent-soft: #fbecd6; }
:root[data-theme="rose"]       { --accent: #e11d48; --accent-h: #be123c; --accent-soft: #fbe0e6; }
:root[data-theme="slate"]      { --accent: #64748b; --accent-h: #475569; --accent-soft: #e9ecf1; }
:root[data-theme="cyan"]       { --accent: #0891b2; --accent-h: #0e7490; --accent-soft: #d9eff4; }

/* Compact density — a light global tightening for users who want more on screen. */
:root[data-density="compact"] { font-size: 14.5px; }
:root[data-density="compact"] .nav { --nav-h: 52px; }
:root[data-density="compact"] .weio-shell .shell-link { padding-top: 5px; padding-bottom: 5px; }

/* ── Base ─────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 15px;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Eyebrow — UPPERCASE mono section label (available for section headers) */
.eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent);
}

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(247,245,239,0.82);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-brand span { color: var(--accent); }
.nav-tier { font-weight: 600; opacity: .85; }
.nav-links { display: flex; gap: 12px; align-items: center; }

/* ── Account menu (replaces the long signed-in button row) ──────── */
.nav-menu { position: relative; }
.nav-menu-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 8px 4px 4px; cursor: pointer;
  color: var(--text); transition: border-color .15s, background .15s;
}
.nav-menu-trigger:hover { border-color: var(--accent); background: var(--surface2, rgba(0,0,0,.03)); }
.nav-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  text-transform: uppercase; line-height: 1;
}
.nav-menu-caret { font-size: 11px; color: var(--text-sec); }
.nav-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,.18); padding: 6px;
  z-index: 200; display: flex; flex-direction: column;
}
.nav-menu-panel[hidden] { display: none; }
.nav-menu-email {
  font-size: 12px; color: var(--text-sec); padding: 8px 12px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
}
.nav-menu-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-sec); padding: 6px 12px 2px;
}
.nav-menu-panel a, .nav-menu-logout {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  padding: 9px 12px; border-radius: 8px; font-size: 14px;
  color: var(--text); text-decoration: none; background: none; border: none;
  cursor: pointer; font-family: inherit;
}
.nav-menu-panel a:hover, .nav-menu-logout:hover { background: var(--accent-soft); color: var(--accent-h); }
.nav-menu-panel a.active { color: var(--accent-h); font-weight: 600; background: var(--accent-soft); }
.nav-menu-logout { color: var(--error); }
.nav-menu-logout:hover { background: var(--error); color: #fff; }
.nav-menu-sep { height: 1px; background: var(--border); margin: 5px 8px; }

/* On the chat app surface, the sidebar carries all nav — drop the global bar
   and reclaim its height so chat is a clean single-topbar app. */
body[data-page="chat"] .nav { display: none; }
body[data-page="chat"] .chat-layout { height: 100vh; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, opacity .15s, transform .15s cubic-bezier(.22,.68,0,1.2), box-shadow .15s;
  white-space: nowrap;
  line-height: 1;
  position: relative;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff; border-color: var(--accent);
  font-weight: 700;
  transition: background .2s ease, border-color .2s ease;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-primary:active:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--ink); border-color: rgba(23,21,15,0.18); transition: background .2s ease, border-color .2s ease; }
.btn-secondary:hover:not(:disabled) { background: rgba(23,21,15,0.05); color: var(--ink); border-color: rgba(23,21,15,0.28); }
.btn-secondary:active:not(:disabled) { background: rgba(23,21,15,0.08); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover:not(:disabled) { background: var(--error); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; width: 100%; }
.btn-google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  gap: 12px;
}
.btn-google:hover:not(:disabled) { background: #f8f8f8; }
.btn-google svg { flex-shrink: 0; }

/* ── Inputs ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-sec); opacity: .7; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Card / Auth box ──────────────────────────────────────── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 32px 16px;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}
.auth-box h1 { font-size: 22px; margin: 0 0 6px; }
.auth-box .sub { color: var(--text-sec); font-size: 14px; margin: 0 0 24px; }
.auth-divider {
  text-align: center;
  color: var(--text-sec);
  font-size: 13px;
  margin: 20px 0;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
/* Shake animation for failed login */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97) both; }

.auth-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-sec);
}
.auth-foot a { color: var(--accent); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.3); color: var(--error); }
.alert-success { background: rgba(22,163,74,.08); border: 1px solid rgba(22,163,74,.3); color: var(--success); }
.alert-info { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-h); }
/* Inline recovery action inside an alert (e.g. "Resend verification email" on /login).
   A real <button> for keyboard/AT semantics, styled as a link so it reads as the next
   step rather than a second form submit. Inherits the alert's colour. */
.alert .alert-action {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.alert .alert-action:hover { opacity: .8; }
.alert .alert-action:disabled { cursor: default; opacity: .6; text-decoration: none; }

/* ── Password strength ────────────────────────────────────── */
.pw-strength { margin-top: 6px; }
.pw-strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.pw-strength-fill { height: 100%; transition: width .3s, background .3s; width: 0; }
.pw-strength-text { font-size: 12px; color: var(--text-sec); }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  max-width: 360px;
  animation: toast-in .2s ease;
}
.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--success); }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ── Spinner ──────────────────────────────────────────────── */
/* Brand loader: the wordmark's blue dot, pulsing — used for loading/thinking/pending.
   The old border-spinner class is remapped to this so every existing usage becomes the dot. */
.spinner, .weio-loader {
  display: inline-block; width: 12px; height: 12px; border: none; border-radius: 50%;
  background: var(--w-brand, #3D5AFE); flex-shrink: 0;
  animation: weio-pulse 1.15s ease-in-out infinite;
}
.spinner-lg, .weio-loader.lg { width: 18px; height: 18px; }
.spinner-sm, .weio-loader.sm { width: 9px; height: 9px; }
@keyframes weio-pulse {
  0%, 100% { transform: scale(0.72); opacity: 0.5; box-shadow: 0 0 0 0 rgba(251,122,60,0); }
  50%      { transform: scale(1);    opacity: 1;   box-shadow: 0 0 0 4px rgba(251,122,60,0.12); }
}
/* keep the old keyframe name defined so nothing referencing `spin` breaks */
@keyframes spin { to { transform: rotate(360deg); } }

/* Wordmark: "weio" + raised blue dot — the only Weio mark (no more W tile). */
.weio-wordmark { font-family: "Geist", "Instrument Sans", sans-serif; font-weight: 800;
  letter-spacing: -0.035em; color: inherit; display: inline-flex; align-items: baseline; line-height: 1; }
.weio-dot { width: 0.24em; height: 0.24em; border-radius: 50%; background: var(--w-brand, #3D5AFE);
  display: inline-block; margin-left: 0.06em; align-self: flex-start; transform: translateY(0.12em); }

/* ── Chat layout ──────────────────────────────────────────── */
.chat-layout {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ── Split-pane artifact dock ─────────────────────────────────────────────── */
.artifact-dock {
  display: none;
  flex-direction: column;
  width: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.chat-layout.artifact-open .artifact-dock {
  display: flex;
  width: min(52%, 760px);
}
.chat-layout.artifact-open .chat-main { min-width: 0; }
.adock-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); flex-wrap: nowrap;
}
.adock-title { font-weight: 600; font-size: 13px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adock-versions { display: flex; gap: 3px; }
.adock-ver {
  font-size: 11px; padding: 2px 7px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-sec);
}
.adock-ver.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.adock-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.adock-seg button { border: none; background: none; cursor: pointer; font-size: 12px; padding: 4px 9px; color: var(--text-sec); font-family: inherit; }
.adock-seg button.active { background: var(--accent-soft); color: var(--accent-h); font-weight: 600; }
.adock-btn {
  border: none; background: none; cursor: pointer; font-size: 14px; color: var(--text-sec);
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
}
.adock-btn:hover { background: var(--accent-soft); color: var(--accent); }
.adock-frame { flex: 1; border: 0; width: 100%; background: #fff; }
.adock-code { flex: 1; margin: 0; overflow: auto; padding: 14px; font-size: 12px; line-height: 1.5; background: #0f172a; color: #e2e8f0; white-space: pre; }

/* ── Document viewer pane (shares the dock layout) ───────────────────────── */
.doc-dock {
  display: none; flex-direction: column; width: 0;
  border-left: 1px solid var(--border); background: var(--surface); overflow: hidden;
}
.chat-layout.doc-open .doc-dock { display: flex; width: min(52%, 760px); }
.chat-layout.doc-open .chat-main { min-width: 0; }
.doc-dock-body { flex: 1; overflow: auto; background: var(--bg); }
.doc-dock-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.doc-dock-body img { display: block; max-width: 100%; margin: 0 auto; }
.doc-dock-body pre { margin: 0; padding: 16px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6; font-family: ui-monospace, 'Courier New', monospace; }
.doc-dock-empty { color: var(--text-sec); padding: 40px; text-align: center; }

/* ── Attachment cards (separate, openable, alongside the message) ─────────── */
.msg-attach-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.msg-row.msg-user .msg-attach-row { justify-content: flex-end; }
.attach-card {
  display: inline-flex; align-items: center; gap: 8px; max-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 11px 7px 8px; cursor: pointer; font-family: inherit; text-align: left;
  transition: border-color .15s, box-shadow .12s;
}
.attach-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.attach-card-thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); background: var(--surface2); flex-shrink: 0; }
.attach-card-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: var(--surface2); border-radius: 6px; flex-shrink: 0; }
.attach-card-meta { display: flex; flex-direction: column; min-width: 0; }
.attach-card-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-card-ext { font-size: 11px; color: var(--text-sec); }

@media (max-width: 820px) {
  /* On mobile the docks take over the full chat area */
  .chat-layout.artifact-open .artifact-dock,
  .chat-layout.doc-open .doc-dock { position: fixed; inset: 0; width: 100vw; z-index: 320; }
}

/* sidebar */
.chat-sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--surface);   /* white — consistent with the app-shell sidebar across the portal */
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s;
}
.chat-sidebar.collapsed { width: 0; }
.sidebar-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-sessions {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
/* Project mode banner — shown above the session list when scoped to a project */
.project-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 8px 8px;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent-h);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.project-mode-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-mode-exit {
  background: transparent;
  border: none;
  color: var(--accent-h);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}
.project-mode-exit:hover { opacity: 0.7; }
.sidebar-sessions::-webkit-scrollbar { width: 4px; }
.sidebar-sessions::-webkit-scrollbar-track { background: transparent; }
.sidebar-sessions::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.session-item {
  padding: 9px 14px;
  cursor: pointer;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sec);
  border-left: 2px solid transparent;
  user-select: none;
  position: relative;
}
.session-item:hover { background: var(--surface3); color: var(--text); }
.session-item.active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent-h); font-weight: 600; }
.session-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-time { font-size: 11px; color: var(--text-sec); opacity:.7; flex-shrink:0; }
.session-del {
  display: none;
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 14px;
  flex-shrink: 0;
}
.session-item:hover .session-del { display: flex; }
.session-menu-btn {
  display: block;
  background: none;
  border: none;
  color: var(--text-sec);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .12s;
}
.session-item:hover .session-menu-btn,
.session-item.active .session-menu-btn { opacity: .6; }
.session-menu-btn:hover { opacity: 1 !important; color: var(--accent); background: var(--surface); }
/* Touch devices have no hover — keep the kebab tappable */
@media (hover: none) { .session-menu-btn { opacity: .55; } }
.session-proj-pop {
  position: fixed;
  z-index: 300;
  width: 212px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  overflow: hidden;
}
.session-proj-pop-head { padding: 9px 12px; font-size: 12px; font-weight: 600; color: var(--text-sec); border-bottom: 1px solid var(--border); }
.session-proj-pop-body { max-height: 260px; overflow-y: auto; padding: 6px; }
.session-proj-opt {
  display: block; width: 100%; text-align: left;
  background: none; border: none; color: var(--text);
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-proj-opt:hover { background: var(--accent-soft); color: var(--accent-h); }
.session-proj-empty { padding: 10px; font-size: 12px; color: var(--text-sec); }
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.upgrade-cta {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  text-align: center;
  color: var(--text-soft);
}
.upgrade-cta a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* chat main */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.chat-topbar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}
.toggle-sidebar {
  background: none;
  border: none;
  color: var(--text-sec);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
}
.toggle-sidebar:hover { color: var(--text); background: var(--surface2); }
.chat-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 6px;
  transition: background .15s;
}
.chat-title:hover { background: var(--surface2); }
.chat-title[contenteditable="true"] {
  outline: 1px solid var(--accent);
  background: var(--surface2);
}
.token-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-sec);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.token-pill.green { border-color: var(--success); color: var(--success); }
.token-pill.yellow { border-color: var(--warning); color: var(--warning); }
.token-pill.red { border-color: var(--error); color: var(--error); }

/* messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.msg-row {
  display: flex;
  gap: 12px;
  padding: 6px 20px;
  animation: msg-in .2s ease;
  width: 100%;
}
@keyframes msg-in { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.msg-row.msg-user { flex-direction: row-reverse; }
.msg-avatar {
  width: 30px; height: 30px;
  background: var(--ink);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-on-dark);
}
/* Design: the user message is a right-aligned accent bubble with no avatar. */
.msg-row.msg-user .msg-avatar { display: none; }
.msg-bubble {
  max-width: min(560px, 82%);
  background: var(--surface2);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-row.msg-user .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
/* Weio (assistant) reads as flowing text — not a boxed bubble — per the design. */
.msg-row.msg-assistant .msg-bubble {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 0;
  max-width: none;
  font-size: 15px;
  line-height: 1.62;
}
.msg-time {
  font-size: 11px;
  color: var(--text-sec);
  opacity: 0;
  margin-top: 4px;
  transition: opacity .15s;
  align-self: flex-end;
}
.msg-row:hover .msg-time { opacity: 1; }

/* Message content wrapper (assistant only — holds bubble + action bar) */
.msg-content { display: flex; flex-direction: column; min-width: 0; flex: 1; }
/* User messages align to the right, Weio (assistant) to the left. */
.msg-row.msg-user .msg-content { align-items: flex-end; }
.msg-row.msg-assistant .msg-content { align-items: flex-start; }
/* Action bar below assistant messages */
.msg-actions { display: flex; gap: 4px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.msg-row:hover .msg-actions { opacity: 1; }
/* Web citations: compact "Sources (N)" dropdown at the bottom of an answer + inline [W#] links. */
.msg-sources { margin-top: 10px; }
.msg-sources > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted);
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); }
.msg-sources > summary::-webkit-details-marker { display: none; }
.msg-sources > summary::after { content: "▾"; font-size: 10px; opacity: .7; }
.msg-sources[open] > summary::after { content: "▴"; }
.msg-sources ol { margin: 9px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.msg-sources ol li { font-size: 12.5px; color: var(--ink-soft); }
.msg-sources ol li a { color: var(--accent); text-decoration: none; word-break: break-word; }
.msg-sources ol li a:hover { text-decoration: underline; }
.web-cite { color: var(--accent); font-weight: 600; text-decoration: none; font-size: .82em; vertical-align: super; padding: 0 1px; }
.web-cite:hover { text-decoration: underline; }
.msg-action-btn {
  background: none; border: 1px solid var(--border); color: var(--text-sec);
  cursor: pointer; width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; padding: 0;
  transition: border-color .15s, color .15s;
}
.msg-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.msg-action-btn.voted-up { color: #16a34a; border-color: #16a34a; }
.msg-action-btn.voted-down { color: var(--error); border-color: var(--error); }

/* Input toolbar (model picker + tool buttons) */
.chat-input-toolbar { display: flex; gap: 6px; align-items: center; padding: 6px 0 2px; flex-wrap: wrap; }
.tool-btn {
  background: none; border: 1px solid var(--border); color: var(--text-sec);
  cursor: pointer; height: 28px; padding: 0 10px;
  border-radius: var(--radius-sm); display: inline-flex; align-items: center;
  gap: 5px; font-size: 12px; white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); }
.tool-btn.tool-locked { opacity: .45; cursor: not-allowed; }
.tool-btn.tool-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.msg-typing .msg-bubble {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.dot { width:7px; height:7px; background:var(--text-sec); border-radius:50%; animation: bounce .9s infinite; }
.dot:nth-child(2) { animation-delay:.15s; }
.dot:nth-child(3) { animation-delay:.3s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0);} 30%{transform:translateY(-6px);} }

/* 429 inline upgrade */
.inline-upgrade {
  margin: 0 20px 8px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-sec);
}
.inline-upgrade a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* empty state */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 32px;
  color: var(--text-sec);
}
/* Greeting uses the UI sans — not the editorial Instrument Serif that h1/h2 default to. */
.chat-empty h2 { font-size: 22px; margin: 0 0 8px; color: var(--text); font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', sans-serif); font-weight: 600; letter-spacing: -0.01em; }
.chat-empty p { margin: 0 0 24px; font-size: 15px; }

/* chat input bar */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  flex-shrink: 0;
  background: var(--bg);
}
.doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
/* Image attachment chip with a thumbnail preview (composer) */
.doc-chip-img { padding-left: 3px; }
.doc-chip-thumb {
  width: 28px; height: 28px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
/* Full-size image lightbox */
.img-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; z-index: 1000; padding: 24px;
}
.img-lightbox.open { display: flex; }
.img-lightbox-img { max-width: 95vw; max-height: 84vh; object-fit: contain; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.img-lightbox-cap { color: #fff; opacity: .85; font-size: 13px; margin-top: 12px; max-width: 90vw; text-align: center; word-break: break-word; }
.img-lightbox-close {
  position: fixed; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; border: none; font-size: 18px; cursor: pointer;
}
.img-lightbox-close:hover { background: rgba(255,255,255,.28); }
.doc-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px 3px 8px;
  font-size: 12px;
  color: var(--text-sec);
  display: flex;
  align-items: center;
  gap: 5px;
}
.doc-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-sec);
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.doc-chip button:hover { color: var(--error); }
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.input-actions { display: flex; gap: 4px; flex-shrink: 0; }
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-sec);
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.chat-textarea {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color .15s;
}
.chat-textarea:focus { border-color: var(--accent); }
.char-counter {
  font-size: 11px;
  color: var(--warning);
  text-align: right;
  margin-top: 3px;
  display: none;
}
.char-counter.show { display: block; }

/* drag-drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: color-mix(in srgb, var(--accent) 12%, rgba(0,0,0,.45));
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.drop-overlay-inner {
  background: var(--surface);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  padding: 48px 64px;
  text-align: center;
  color: var(--accent);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.drop-overlay-inner p { font-size: 16px; font-weight: 600; margin: 0; }

/* upload progress inline bar */
.upload-progress-bar {
  position: fixed; bottom: 80px; right: 20px; z-index: 8000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }

/* doc picker */
.doc-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.doc-picker.show { display: block; }
.doc-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.doc-picker-item:hover { background: var(--surface2); }
.doc-picker-item input[type="checkbox"] { accent-color: var(--accent); flex-shrink: 0; }
.doc-picker-item .doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-picker-item .doc-size { font-size: 11px; color: var(--text-sec); flex-shrink: 0; }
.doc-picker-upload {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* consent banner */
.consent-banner {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-sec);
  flex-wrap: wrap;
}
.consent-banner .consent-text { flex: 1; min-width: 200px; }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* consent modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  display: none;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.modal.modal-wide { max-width: 640px; }
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal p { color: var(--text-sec); font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.modal ul { color: var(--text-sec); font-size: 14px; margin: 8px 0 16px 20px; line-height: 1.8; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-sec); margin-bottom: 5px; }
.form-input {
  width: 100%; background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 14px; outline: none; font-family: inherit;
  transition: border-color .15s; resize: vertical;
}
.form-input:focus { border-color: var(--accent); }
.project-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.project-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.project-card-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.project-card-meta { font-size: 12px; color: var(--text-sec); }
.project-card-actions { display: flex; gap: 6px; margin-top: 8px; }

/* token popover */
.token-popover {
  position: absolute;
  top: 52px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  width: 240px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  display: none;
}
.token-popover.show { display: block; }
.token-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.token-row .label { color: var(--text-sec); }
.token-bar { height: 6px; background: var(--border); border-radius: 3px; margin: 8px 0 12px; overflow: hidden; }
.token-bar-fill { height: 100%; border-radius: 3px; transition: width .4s; }

/* ── Pricing — full-width ink (#17150F) band ──────────────────────────────── */
.pricing-page { position: relative; max-width: 1200px; margin: 0 auto; padding: clamp(56px,8vw,88px) clamp(18px,5vw,40px); }
/* Full-bleed ink background behind the centered content (no markup change) */
.pricing-page::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: var(--ink); z-index: 0; }
.pricing-page > * { position: relative; z-index: 1; }
.pricing-page h1 { text-align: center; font-size: clamp(28px,4.4vw,48px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: #F7F5EF; margin: 0 0 12px; }
.pricing-sub { text-align: center; color: #B7B2A8; font-size: clamp(16px,1.8vw,20px); margin: 0 auto 28px; max-width: 620px; }
.pricing-header { text-align: center; margin-bottom: 48px; }
.pricing-header h1 { font-size: clamp(28px,4.4vw,48px); color: #F7F5EF; margin: 0 0 12px; }
.pricing-header p { color: #B7B2A8; font-size: 17px; margin: 0 0 28px; }
/* Billing toggle — pill button group */
.billing-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}
.billing-pill {
  display: inline-flex;
  background: rgba(247,245,239,0.08);
  border: 1px solid rgba(247,245,239,0.16);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.billing-pill-opt {
  background: none;
  border: none;
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 14px;
  font-weight: 500;
  color: #B7B2A8;
  cursor: pointer;
  transition: background .2s, color .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.billing-pill-opt.active {
  background: var(--paper);
  color: var(--ink);
}
.billing-pill-opt:hover:not(.active) { color: #F7F5EF; }
.badge-save {
  display: inline-block;
  background: rgba(226,85,53,.16);
  color: #F0A089;
  border: 1px solid rgba(226,85,53,.32);
  border-radius: 999px;
  padding: 1px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
}
.billing-pill-opt.active .badge-save { color: var(--accent-hover); }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}
.pricing-card {
  background: rgba(247,245,239,0.05);
  border: 1px solid rgba(247,245,239,0.14);
  border-radius: 18px;
  padding: 32px 26px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  color: #D8D3C8;
  box-shadow: none;
  transition: border-color .2s ease, background .2s ease;
  cursor: default;
}
.pricing-card:hover {
  border-color: rgba(247,245,239,0.28);
  background: rgba(247,245,239,0.08);
}
/* Featured: solid white card, 2px accent border, soft accent shadow */
.pricing-card.popular {
  background: var(--card);
  color: var(--ink-soft);
  border: 2px solid var(--accent);
  box-shadow: 0 18px 50px rgba(226,85,53,0.22);
}
.pricing-card.popular:hover {
  border-color: var(--accent);
  background: var(--card);
}
/* "POPULAR" mono pill, top-right of the featured card */
.popular-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  transform: none;
  background: var(--accent-tint);
  color: var(--accent-hover);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: none;
}

/* Pricing card content — rendered by pricing.js */
.pricing-tier {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--accent-on-dark);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px;
}
.pricing-card.popular .pricing-tier { color: var(--accent); }
.pricing-price {
  font-size: 40px; font-weight: 800; line-height: 1;
  color: #F7F5EF; margin: 0 0 2px;
}
.pricing-card.popular .pricing-price { color: var(--ink); }
.pricing-period { font-size: 16px; font-weight: 500; color: #B7B2A8; }
.pricing-card.popular .pricing-period { color: var(--ink-muted); }
.pricing-tokens { font-size: 13px; color: #B7B2A8; margin: 6px 0 20px; font-weight: 500; }
.pricing-card.popular .pricing-tokens { color: var(--ink-muted); }
.tier-name { font-size: 14px; font-weight: 700; color: var(--text-sec); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 12px; }
.tier-price { margin-bottom: 4px; }
.tier-price .amount { font-size: 36px; font-weight: 800; }
.tier-price .period { font-size: 14px; color: var(--text-sec); }
.tier-price .annual-price { display: none; }
.annual-active .tier-price .monthly-price { display: none; }
.annual-active .tier-price .annual-price { display: inline; }
.tier-desc { font-size: 13px; color: var(--text-sec); margin-bottom: 20px; min-height: 36px; }
.tier-features { list-style: none; margin: 0 0 24px; padding: 0; flex: 1; }
.tier-features li {
  font-size: 13.5px;
  color: #D8D3C8;
  padding: 7px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(247,245,239,0.12);
}
.tier-features li:last-child { border-bottom: none; }
.tier-features li::before { content: "✓"; color: var(--accent-on-dark); font-weight: 700; flex-shrink: 0; }
/* Featured (white) card: dark feature text, accent checks, hairline divider */
.pricing-card.popular .tier-features li { color: var(--ink-soft); border-bottom-color: var(--line); }
.pricing-card.popular .tier-features li::before { color: var(--accent); }
/* Ghost CTA on the dark standard cards uses translucent-white treatment */
.pricing-card:not(.popular) .btn-secondary { color: #F7F5EF; border-color: rgba(247,245,239,0.30); }
.pricing-card:not(.popular) .btn-secondary:hover:not(:disabled) { background: rgba(247,245,239,0.10); color: #fff; border-color: rgba(247,245,239,0.5); }
.training-badge {
  font-size: 11px;
  background: rgba(194,113,12,.10);
  border: 1px solid rgba(194,113,12,.30);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
  display: inline-block;
}
.current-plan-badge {
  background: rgba(61,154,111,.12);
  border: 1px solid rgba(61,154,111,.30);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ── Billing success/cancel ───────────────────────────────── */
.billing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 32px 20px;
}
.billing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.billing-card .icon { font-size: 56px; margin-bottom: 20px; }
.billing-card h1 { font-size: 24px; margin: 0 0 10px; }
.billing-card p { color: var(--text-sec); font-size: 15px; margin: 0 0 28px; }
.billing-links { display: flex; flex-direction: column; gap: 10px; }

/* ── Verify / callback pages ──────────────────────────────── */
.status-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  text-align: center;
  padding: 32px 20px;
}
.status-page h1 { font-size: 24px; margin: 0 0 10px; }
.status-page p { color: var(--text-sec); margin: 0 0 24px; }

/* ── Responsive ───────────────────────────────────────────── */
/* ── Mobile layout ── */
@media (max-width: 768px) {
  /* Sidebar becomes a full-height overlay drawer */
  .chat-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: min(280px, 85vw);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 32px rgba(0,0,0,.18);
    /* remove the width-based collapse */
    flex-shrink: unset;
    overflow-y: auto;
  }
  .chat-sidebar.mobile-open { transform: translateX(0); }
  /* desktop collapsed class must not fight mobile drawer */
  .chat-sidebar.collapsed { transform: translateX(-100%); width: min(280px, 85vw); }

  /* Scrim behind open drawer */
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.42);
    z-index: 299;
    cursor: pointer;
  }
  .sidebar-backdrop.show { display: block; }

  /* Chat topbar: compact */
  .chat-topbar { padding: 8px 12px; gap: 8px; }

  /* Message bubbles: allow more width on mobile */
  .msg-bubble { max-width: 90%; }
  .msg-row { padding: 5px 12px; }

  /* Input area: tighter */
  .chat-input-area { padding: 10px 12px 14px; }
  .chat-input-toolbar { gap: 4px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .chat-input-toolbar::-webkit-scrollbar { display: none; }

  /* Prevent iOS from zooming in on textarea focus */
  .chat-textarea { font-size: 16px !important; }

  /* Touch-friendly button targets */
  .send-btn { width: 40px; height: 40px; flex-shrink: 0; }
  .doc-attach-btn { width: 36px; height: 36px; }

  /* Modals: full-width minus safe margins */
  .modal { max-width: calc(100vw - 24px); margin: 12px; }
  .modal.modal-wide { max-width: calc(100vw - 24px); }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin: 0; max-width: 100vw; max-height: 90vh; overflow-y: auto; }

  /* Token pill: compact */
  .token-pill { font-size: 11px; padding: 3px 8px; }

  /* Pricing grid */
  .pricing-grid { grid-template-columns: 1fr 1fr; }

  /* Consent banner */
  .consent-banner-inner { flex-direction: column; }

  /* Global nav: tighter on mobile; keep the account menu panel on-screen */
  .nav { padding: 0 14px; }
  .nav-menu-panel { right: 0; min-width: 200px; max-width: calc(100vw - 28px); }
}

@media (max-width: 540px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .auth-box { padding: 24px 18px; }
  .billing-card { padding: 28px 20px; }
  .tier-badge { display: none; }
  .chat-title { font-size: 14px; }
  /* Empty state: less padding */
  .chat-empty { padding: 24px 16px; }
  .chat-empty h2 { font-size: 19px; }
  /* Session list items */
  .session-item { padding: 10px 12px; }
  /* Sidebar feature nav */
  .sidebar-feature-btn { padding: 8px 10px; font-size: 13px; }
  /* Settings: let label + control stack instead of cramping on one row */
  .settings-row-between { flex-wrap: wrap; }
  .settings-page { padding: 24px 16px 64px; }
}

/* ── Fixes: missing aliases + buttons ────────────────────────── */

/* btn-full: used in chat sidebar new-chat button */
.btn-full { width: 100%; }

/* btn-secondary = neutral ghost: ink text, subtle hairline, soft gray hover */
.btn-secondary { color: var(--ink); border-color: rgba(23,21,15,0.18); }
.btn-secondary:hover:not(:disabled) { background: rgba(23,21,15,0.05); color: var(--ink); border-color: rgba(23,21,15,0.28); }

/* html/body full-height for chat layout */
html, body { height: 100%; }

/* sidebar class aliases (HTML uses these names) */
.sidebar-top { padding: 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-feature-nav { padding: 8px 8px 0; flex-shrink: 0; }
.sidebar-feature-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-sec); padding: 6px 6px 4px; }
.sidebar-feature-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px; border-radius: 6px;
  border: none; background: none; color: var(--text); font-size: 13px;
  cursor: pointer; text-align: left; text-decoration: none;
  transition: background .12s, color .12s;
}
.sidebar-feature-btn:hover { background: var(--surface2); color: var(--accent); }
.sidebar-feature-btn .feat-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-feature-soon { font-size: 10px; opacity: .55; margin-left: auto; background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 8px 0; flex-shrink: 0; }
.sidebar-toggle { background: none; border: none; color: var(--text-sec); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; flex-shrink: 0; }
.sidebar-toggle:hover { color: var(--text); background: var(--surface2); }
.sidebar-email { font-size: 12px; color: var(--text-sec); display: block; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-empty { padding: 12px 14px; font-size: 13px; color: var(--text-sec); }
.session-loading { padding: 12px 14px; font-size: 13px; color: var(--text-sec); }

/* doc attach + send buttons */
.doc-attach-btn { background: none; border: 1px solid var(--border); color: var(--text-sec); cursor: pointer; width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: border-color .15s, color .15s; }
.doc-attach-btn:hover { border-color: var(--accent); color: var(--accent); }
.send-btn { background: var(--accent); border: 1px solid var(--accent); color: #fff; cursor: pointer; width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.send-btn:hover:not(:disabled) { background: var(--accent-h); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }

/* sidebar upgrade CTA — blue variant (overrides inline-upgrade red) */
#upgrade-cta .inline-upgrade {
  margin: 0 0 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
  font-size: 13px;
}
#upgrade-cta .inline-upgrade strong { color: var(--accent-h); font-size: 14px; }
#upgrade-cta .inline-upgrade p { color: var(--text-sec); font-size: 12px; margin: 4px 0 10px; }
#upgrade-cta .inline-upgrade a:not(.btn) { color: var(--accent-h); font-weight: 600; text-decoration: none; }
#upgrade-cta .inline-upgrade a:not(.btn):hover { text-decoration: underline; }
#upgrade-cta .inline-upgrade .btn-primary { color: #fff !important; text-decoration: none; }

/* auth-sub alias */
.auth-sub { color: var(--text-sec); font-size: 14px; margin: 0 0 24px; }

/* modal header/body/close */
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close { background: none; border: none; color: var(--text-sec); cursor: pointer; font-size: 22px; line-height: 1; padding: 0 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { overflow-y: auto; max-height: 60vh; }
.modal-section-title { font-size: 12px; color: var(--text-sec); text-transform: uppercase; letter-spacing: .5px; margin: 16px 0 8px; font-weight: 600; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* upload area */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 24px; text-align: center; color: var(--text-sec); font-size: 14px; cursor: pointer; transition: border-color .15s; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--accent); }
.upload-area p { margin: 0 0 12px; }
.upload-hint { font-size: 12px; color: var(--text-sec); opacity: .7; margin-top: 8px !important; }
.upload-label { cursor: pointer; }
#upload-progress { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 14px; color: var(--text-sec); }

/* doc list in modal */
.doc-list-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.doc-list-item:hover { background: var(--surface2); }
.doc-list-item.selected { background: var(--accent-soft); }
.doc-list-item .doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list-item .doc-size { font-size: 11px; color: var(--text-sec); flex-shrink: 0; }

/* consent banner inner */
.consent-banner-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 1100px; margin: 0 auto; width: 100%; }
.consent-text { flex: 1; min-width: 220px; }
.consent-text a { color: var(--accent); text-decoration: underline; }

/* typing-dots alias for chat.js usage */
.typing-dots { display: flex; gap: 4px; align-items: center; }

/* Fix modal-overlay double display declaration */
.modal-overlay { display: none !important; }
.modal-overlay.show, .modal-overlay[style*="flex"] { display: flex !important; }

/* msg-error */
.msg-bubble.msg-error { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.3); color: var(--error); }

/* pre/code in chat bubbles */
.msg-bubble pre { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.msg-bubble code { font-family: ui-monospace, 'Courier New', monospace; font-size: 13px; }
.msg-bubble pre code { background: none; }
/* code blocks inside user bubble (accent bg) need distinct treatment */
.msg-row.msg-user .msg-bubble pre { background: rgba(0,0,0,.15); border-color: rgba(255,255,255,.2); }

/* ── Theme picker (matches tenant portal .theme-pick) ── */
.theme-pick {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; padding: 5px 8px; cursor: pointer; outline: none;
  transition: border-color .15s;
}
.theme-pick:hover, .theme-pick:focus { border-color: var(--accent); }
.rail-theme { display: flex; align-items: center; gap: 8px; padding: 8px 0 4px; flex-shrink: 0; }
.rail-theme label { font-size: 11px; color: var(--text-sec); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

/* ── Settings page ───────────────────────────────────────────── */
.settings-page { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }
.settings-title { font-size: 28px; font-weight: 800; margin: 0 0 24px; letter-spacing: -.4px; }
.settings-loading { color: var(--text-sec); display: flex; align-items: center; gap: 10px; padding: 24px 0; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.settings-h2 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.settings-help { font-size: 13px; color: var(--text-sec); margin: 0 0 16px; line-height: 1.6; }
.settings-row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.settings-counter { font-size: 12px; color: var(--text-sec); }
.settings-upgrade-hint { font-size: 12px; color: var(--text-sec); margin: 10px 0 0; }
.settings-upgrade-hint a, .settings-help a { color: var(--accent); font-weight: 600; }

/* Appearance & notifications controls */
.settings-sub { display:block; font-size:12.5px; font-weight:700; color:var(--text-sec); margin-bottom:8px; }
.accent-row { display:flex; gap:10px; flex-wrap:wrap; }
.accent-sw { width:30px; height:30px; border-radius:50%; background:var(--sw,#ccc); border:2px solid transparent; cursor:pointer; padding:0; box-shadow:0 0 0 1px rgba(0,0,0,.08) inset; transition:transform .1s; }
.accent-sw:hover { transform:scale(1.08); }
.accent-sw.sel { border-color:var(--text); box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--sw,#ccc); }
.seg-row { display:inline-flex; border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.seg-btn { background:var(--surface); border:none; padding:8px 16px; font-size:13px; font-weight:600; color:var(--text-sec); cursor:pointer; }
.seg-btn + .seg-btn { border-left:1px solid var(--border); }
.seg-btn.sel { background:var(--accent); color:#fff; }
.avatar-row { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.avatar-preview { width:46px; height:46px; border-radius:50%; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:700; flex-shrink:0; }
.settings-toggle-row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:9px 0; font-size:13.5px; color:var(--text); border-top:1px solid var(--border); }
.settings-toggle-row:first-of-type { border-top:none; }
.settings-toggle { width:18px; height:18px; accent-color:var(--accent); cursor:pointer; flex-shrink:0; }
.credit-packs { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
/* Collapsed "Billing & usage" section — accessible but not prominent. */
details#billing-card { cursor:default; }
.settings-billing-summary { cursor:pointer; font-size:16px; font-weight:700; color:var(--text); list-style:none; display:flex; align-items:center; gap:8px; }
.settings-billing-summary::-webkit-details-marker { display:none; }
.settings-billing-summary::before { content:"›"; display:inline-block; transition:transform .15s; color:var(--text-sec); font-size:18px; }
details#billing-card[open] .settings-billing-summary::before { transform:rotate(90deg); }

/* storage bar */
.storage-bar { height: 8px; background: var(--surface3); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.storage-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }

/* CLI keys */
.key-value { display: block; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-family: ui-monospace, monospace; font-size: 12px; margin: 8px 0; word-break: break-all; }
.key-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.key-name { font-weight: 600; font-size: 13px; margin-right: 10px; }
.key-prefix { font-family: ui-monospace, monospace; font-size: 12px; color: var(--text-sec); }
.cli-install { margin-top: 16px; }
.cli-install summary { font-size: 13px; color: var(--accent); cursor: pointer; font-weight: 600; }
.cli-code { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: ui-monospace, monospace; font-size: 12px; overflow-x: auto; margin-top: 10px; line-height: 1.6; }
.cli-tabs { display: flex; gap: 4px; margin-top: 10px; }
.cli-tab { background: none; border: 1px solid var(--border); color: var(--text-sec); border-radius: var(--radius-sm);
  padding: 4px 12px; font-size: 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.cli-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cli-tab:hover { border-color: var(--accent); color: var(--accent); }

/* ── Mandatory data-consent modal (no dismiss) ───────────────── */
.consent-gate {
  position: fixed; inset: 0; background: rgba(31,30,29,.55); z-index: 9000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.consent-gate.show { display: flex; }
.consent-gate-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; max-width: 480px; width: 100%; box-shadow: var(--shadow-lg);
}
.consent-gate-box h2 { font-size: 20px; margin: 0 0 12px; }
.consent-gate-box p { font-size: 14px; color: var(--text-soft); line-height: 1.6; margin: 0 0 12px; }
.consent-gate-box ul { font-size: 13px; color: var(--text-sec); margin: 0 0 18px 18px; line-height: 1.7; }
.consent-gate-actions { display: flex; justify-content: flex-end; }

/* ── Weio UI primitives: branded dialogs (alert/confirm/prompt/modal) ──── */
#weio-ui-root { position: relative; z-index: 10000; }
.weio-dialog-overlay {
  position: fixed; inset: 0; background: rgba(31,30,29,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity .16s ease; z-index: 10000;
}
.weio-dialog-overlay.show { opacity: 1; }
.weio-dialog {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(.98); transition: transform .16s ease;
  overflow: hidden;
}
.weio-dialog-overlay.show .weio-dialog { transform: none; }
.weio-dialog-head {
  font-size: 16px; font-weight: 700; color: var(--text);
  padding: 20px 22px 0; letter-spacing: -.2px;
}
.weio-dialog-body { padding: 14px 22px 4px; }
.weio-dialog-msg { font-size: 14px; color: var(--text-soft); line-height: 1.6; margin: 0; }
.weio-dialog-body .form-control { margin-top: 12px; }
.weio-dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 18px 22px 20px;
}
@media (max-width: 480px) { .weio-dialog { max-width: 100%; } }

/* ── Tier-aware chat elements ────────────────────────────────── */
.tier-badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: var(--radius-full, 9999px);
  background: var(--accent-soft); color: var(--accent-h); letter-spacing: .2px;
  text-transform: none; flex-shrink: 0;
}
.model-pick {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px; padding: 4px 8px; cursor: pointer;
  outline: none; flex-shrink: 0;
}
.model-pick:hover, .model-pick:focus { border-color: var(--accent); }
.preview-banner {
  background: var(--accent-soft); color: var(--accent-h); text-align: center;
  font-size: 13px; padding: 7px 16px; border-bottom: 1px solid var(--accent);
}
.preview-banner strong { font-weight: 700; }

/* ── Marketing homepage ──────────────────────────────────────── */
.home-hero { padding: clamp(56px,9vw,92px) clamp(18px,5vw,40px) clamp(40px,6vw,64px); text-align: center; background: var(--paper); }
.home-hero-inner { max-width: 760px; margin: 0 auto; }
.home-title { font-size: clamp(38px, 6vw, 66px); line-height: 1.02; font-weight: 800; letter-spacing: -.035em;
  margin: 0 0 18px; color: var(--ink); }
.home-sub { font-size: clamp(16px, 1.8vw, 20px); line-height: 1.5; color: var(--ink-soft); margin: 0 auto 28px; max-width: 620px; }
.home-sub-center { font-size: clamp(16px, 1.8vw, 20px); color: var(--ink-soft); text-align: center; margin: 0 0 28px; }
.home-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-lg-inline { padding: 15px 26px; font-size: 16px; border-radius: 12px; }
.home-note { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em; color: var(--ink-muted); margin-top: 14px; }

.home-section { max-width: 1200px; margin: 0 auto; padding: clamp(36px,5vw,64px) clamp(18px,5vw,40px); }
.home-h2 { font-size: clamp(28px, 4.4vw, 48px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; text-align: center; color: var(--ink); margin: 0 0 36px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.home-card {
  background: var(--card); border: 1px solid rgba(23,21,15,0.09); border-radius: 18px;
  padding: 28px; box-shadow: none;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.home-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(23,21,15,0.18);
}
/* Icon chip — 42px square, accent-tint, glyph centered */
.home-card-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-tint); font-size: 22px; line-height: 1; margin-bottom: 16px;
}
.home-card h3 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; color: var(--ink); }
.home-card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

.home-plans { background: var(--surface2); border-radius: var(--radius-lg); }
.home-plan-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 28px; }
.home-plan {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 18px; text-align: center; cursor: pointer; text-decoration: none; color: inherit; display: block;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.home-plan:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(23,21,15,0.18);
  color: inherit; text-decoration: none;
}
.home-plan.home-plan-pop { box-shadow: var(--shadow-sm); }
.home-plan strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.home-plan span {
  display: block; font-size: 22px; font-weight: 800; margin: 6px 0 4px;
  color: var(--accent);
}
.home-plan em { font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }

.home-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 8px; }
.home-footer { max-width: none; padding: 28px clamp(18px,5vw,40px); display: flex;
  justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-muted); }
.home-foot-links a { color: #3A372F; }
@media (max-width: 640px) { .home-hero { padding: 56px 18px 44px; } }

/* ── Help / support page ─────────────────────────────────────────── */
.help-page { max-width: 860px; margin: 0 auto; padding: 0 24px 80px; }
.help-hero { text-align: center; padding: 56px 0 40px; }
.help-hero h1 { font-size: 36px; margin: 0 0 10px; }
.help-sub { font-size: 16px; color: var(--text-sec); margin: 0 0 24px; }
.help-search-wrap { max-width: 480px; margin: 0 auto; }
.help-search { width: 100%; padding: 10px 16px; font-size: 15px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface2); color: var(--text); outline: none; }
.help-search:focus { border-color: var(--accent); }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 56px; }
.help-card { display: block; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .15s; }
.help-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--accent); }
.help-card-icon { font-size: 28px; margin-bottom: 10px; }
.help-card h3 { font-size: 15px; margin: 0 0 6px; }
.help-card p { font-size: 13px; color: var(--text-sec); margin: 0; line-height: 1.5; }
.help-body { display: flex; flex-direction: column; gap: 48px; }
.help-section h2 { font-size: 22px; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.help-article { margin-bottom: 24px; }
.help-article h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.help-article p, .help-article li { font-size: 14px; color: var(--text-sec); line-height: 1.65; }
.help-article ul { padding-left: 18px; margin: 6px 0; }
.help-article pre.cli-code { margin-top: 8px; }
.help-contact { text-align: center; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 24px; }
.help-contact h2 { font-size: 22px; margin: 0 0 10px; }
.help-contact p { color: var(--text-sec); font-size: 15px; margin: 0 0 24px; }
.help-contact-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 600px) { .help-hero h1 { font-size: 28px; } .help-cards { grid-template-columns: 1fr 1fr; } }

/* ════════════════════════════════════════════════════════════════════════
   Marketing pages — imported from Claude Design (Weio.dc.html). Vermillion
   system, inline-style design translated to classes. Home page.
   ════════════════════════════════════════════════════════════════════════ */
@keyframes weioFloat { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-9px);} }
@keyframes weioCaret { 0%,100%{opacity:1;} 50%{opacity:0;} }

.mk-btn { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; transition:background .2s ease, border-color .2s ease; }
.mk-btn-primary { padding:15px 26px; border-radius:12px; background:var(--accent); color:#fff; font-weight:700; font-size:15px; }
.mk-btn-primary:hover { background:var(--accent-hover); }
.mk-btn-ghost { padding:15px 24px; border-radius:12px; border:1px solid rgba(23,21,15,.18); color:var(--ink); font-weight:600; font-size:15px; }
.mk-btn-ghost:hover { background:rgba(23,21,15,.05); }
.mk-btn-ink { padding:15px 26px; border-radius:12px; background:var(--ink); color:var(--paper); font-weight:700; font-size:15px; }
.mk-btn-ink:hover { background:#000; }
.mk-btn-ghost-dark { padding:15px 24px; border-radius:12px; border:1px solid rgba(255,255,255,.45); color:#fff; font-weight:600; font-size:15px; }
.mk-btn-ghost-dark:hover { background:rgba(255,255,255,.12); }

/* Hero */
.mk-hero { max-width:1200px; margin:0 auto; padding:clamp(48px,8vw,92px) clamp(18px,5vw,40px) clamp(36px,5vw,56px); display:flex; flex-wrap:wrap; gap:clamp(32px,5vw,64px); align-items:center; }
.mk-hero-copy { flex:1 1 420px; min-width:320px; }
.mk-h1 { font-size:clamp(38px,6vw,66px); font-weight:800; line-height:1.02; letter-spacing:-.035em; margin:0 0 22px; color:var(--ink); }
.mk-lead { font-size:clamp(16px,1.8vw,20px); line-height:1.5; color:var(--ink-soft); max-width:520px; margin:0 0 30px; }
.mk-cta-row { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.mk-note { font-family:var(--font-mono); font-size:12.5px; color:var(--ink-muted); margin-top:20px; }
.mk-hero-art { flex:1 1 420px; min-width:320px; display:flex; justify-content:center; }
.mk-preview { width:100%; max-width:480px; animation:weioFloat 6s ease-in-out infinite; background:var(--card); border:1px solid var(--line); border-radius:20px; box-shadow:0 24px 60px -28px rgba(23,21,15,.28); overflow:hidden; }
.mk-preview-bar { display:flex; align-items:center; gap:7px; padding:13px 16px; border-bottom:1px solid rgba(23,21,15,.08); }
.mk-dot { width:9px; height:9px; border-radius:50%; background:rgba(23,21,15,.14); }
.mk-dot-accent { background:var(--accent); }
.mk-preview-tab { margin-left:8px; font-family:var(--font-mono); font-size:11.5px; color:var(--ink-muted); }
.mk-preview-body { padding:18px 18px 8px; display:flex; flex-direction:column; gap:14px; }
.mk-bubble-user { align-self:flex-end; max-width:78%; background:var(--accent); color:#fff; padding:10px 14px; border-radius:14px 14px 4px 14px; font-size:14px; }
.mk-bubble-ai { align-self:flex-start; max-width:88%; background:var(--surface); padding:12px 14px; border-radius:14px 14px 14px 4px; font-size:14px; color:var(--ink-soft); line-height:1.55; }
.mk-caret { display:inline-block; width:7px; height:15px; background:var(--accent); margin-left:2px; vertical-align:-2px; animation:weioCaret 1s step-end infinite; }
.mk-preview-input { margin:8px 16px 16px; border:1px solid var(--line); border-radius:13px; padding:11px 13px; display:flex; align-items:center; gap:10px; }
.mk-preview-ph { font-size:14px; color:var(--ink-faint); flex:1; }
.mk-preview-send { width:30px; height:30px; border-radius:9px; background:var(--accent); display:flex; align-items:center; justify-content:center; }

/* Sections */
.mk-section { max-width:1200px; margin:0 auto; padding:clamp(36px,5vw,64px) clamp(18px,5vw,40px); }
.mk-h2 { font-size:clamp(28px,4.4vw,48px); font-weight:800; line-height:1.05; letter-spacing:-.03em; margin:0 0 36px; max-width:640px; color:var(--ink); }
.mk-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:16px; }
.mk-card { background:var(--card); border:1px solid rgba(23,21,15,.08); border-radius:18px; padding:26px; transition:border-color .2s ease; }
.mk-card:hover { border-color:var(--line); }
.mk-card h3 { font-size:19px; font-weight:700; letter-spacing:-.02em; margin:0 0 8px; color:var(--ink); }
.mk-card p { font-size:14.5px; color:var(--ink-soft); line-height:1.55; margin:0; }
.mk-chip { width:42px; height:42px; border-radius:11px; background:var(--accent-tint); display:flex; align-items:center; justify-content:center; margin-bottom:16px; color:var(--accent); }
.mk-chip svg { width:20px; height:20px; }

/* Plans strip */
.mk-section-head { display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:16px; margin-bottom:28px; }
.mk-link-mono { font-family:var(--font-mono); font-size:13px; color:var(--ink); border-bottom:1.5px solid var(--accent); padding-bottom:2px; text-decoration:none; }
.mk-plan-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; }
.mk-plan { background:var(--card); border:1px solid rgba(23,21,15,.08); border-radius:18px; padding:24px; display:flex; flex-direction:column; gap:6px; color:inherit; text-decoration:none; transition:border-color .2s ease; }
.mk-plan:hover { border-color:var(--line); }
.mk-plan-name { font-family:var(--font-mono); font-size:12.5px; color:var(--accent); text-transform:uppercase; letter-spacing:.08em; }
.mk-plan-price { font-size:30px; font-weight:800; letter-spacing:-.03em; color:var(--ink); }
.mk-plan-price span { font-size:14px; font-weight:500; color:var(--ink-muted); }
.mk-plan p { font-size:14px; color:var(--ink-soft); margin:4px 0 0; line-height:1.5; }

/* CTA band */
.mk-cta-wrap { padding-bottom:clamp(48px,7vw,88px); }
.mk-cta-band { background:var(--accent); border-radius:26px; padding:clamp(36px,6vw,64px); display:flex; flex-wrap:wrap; gap:24px; align-items:center; justify-content:space-between; }
.mk-cta-text { max-width:520px; }
.mk-cta-text h2 { font-size:clamp(28px,4.4vw,44px); font-weight:800; letter-spacing:-.03em; line-height:1.06; color:#fff; margin:0 0 10px; }
.mk-cta-text p { color:rgba(255,255,255,.86); font-size:16px; line-height:1.5; margin:0; }
.mk-cta-actions { display:flex; gap:12px; flex-wrap:wrap; }

/* Footer */
.mk-footer { background:var(--surface); border-top:1px solid var(--line); }
.mk-footer-inner { max-width:1200px; margin:0 auto; padding:clamp(40px,5vw,56px) clamp(18px,5vw,40px) 28px; }
.mk-footer-cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:32px; margin-bottom:40px; }
.mk-footer-brand { min-width:180px; }
.mk-foot-logo { font-weight:800; font-size:18px; letter-spacing:-.02em; margin-bottom:12px; color:var(--ink); }
/* (dead accent-dot ::before removed — the mark's only dot is the raised Weio Blue dot,
   BRAND-LOCKUP-STANDARD.md) */
.mk-footer-brand p { font-size:13.5px; color:var(--ink-muted); line-height:1.5; max-width:240px; margin:0; }
.mk-foot-head { font-family:var(--font-mono); font-size:11.5px; text-transform:uppercase; letter-spacing:.12em; color:var(--ink-faint); margin-bottom:14px; }
.mk-foot-links { display:flex; flex-direction:column; gap:10px; }
.mk-foot-links a { font-size:14px; color:#3A372F; text-decoration:none; transition:color .15s; }
.mk-foot-links a:hover { color:var(--accent); }
.mk-footer-bottom { display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; align-items:center; padding-top:22px; border-top:1px solid var(--line); font-family:var(--font-mono); font-size:12px; color:var(--ink-muted); }

/* ── Pricing page — design import (paper header → ink band → FAQ) ──────────── */
.pricing-page { max-width:none; margin:0; padding:0; position:static; }
.pricing-page::before { display:none !important; }
.pricing-head { background:var(--paper); text-align:center; max-width:780px; margin:0 auto; padding:clamp(48px,7vw,80px) clamp(18px,5vw,40px) clamp(28px,4vw,40px); }
.pricing-head .eyebrow { display:block; margin-bottom:16px; }
.pricing-head h1 { color:var(--ink); font-size:clamp(38px,6vw,60px); font-weight:800; letter-spacing:-.035em; line-height:1.04; margin:0 0 16px; }
.pricing-head .pricing-sub { color:var(--ink-soft); font-size:clamp(16px,1.8vw,19px); max-width:560px; margin:0 auto 30px; }
.pricing-head .billing-pill { background:var(--surface); border:1px solid var(--line); }
.pricing-head .billing-pill-opt { color:var(--ink-muted); }
.pricing-head .billing-pill-opt:hover:not(.active) { color:var(--ink); }
.pricing-head .billing-pill-opt.active { background:var(--card); color:var(--ink); box-shadow:0 1px 3px rgba(23,21,15,.1); }
.pricing-band { background:var(--ink); padding:clamp(40px,6vw,72px) 0; }
.pricing-band-inner { max-width:1200px; margin:0 auto; padding:0 clamp(18px,5vw,40px); }
.pricing-band .pricing-grid { grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:16px; align-items:stretch; }

/* FAQ accordion */
.pricing-faq { max-width:760px; margin:0 auto; padding:clamp(40px,6vw,72px) clamp(18px,5vw,40px); }
.pricing-faq h2 { font-size:clamp(26px,3.6vw,36px); font-weight:800; letter-spacing:-.03em; margin:0 0 28px; text-align:center; color:var(--ink); }
.faq-item { border-bottom:1px solid var(--line); }
.faq-item summary { list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 2px; font-size:16px; font-weight:600; color:var(--ink); }
.faq-item summary::-webkit-details-marker { display:none; }
.faq-sign { font-size:0; flex-shrink:0; }
.faq-sign::after { content:"+"; font-family:var(--font-mono); font-size:22px; color:var(--accent); line-height:1; }
.faq-item[open] .faq-sign::after { content:"\2212"; }
.faq-item p { font-size:14.5px; color:var(--ink-soft); line-height:1.6; margin:0; padding:0 2px 22px; max-width:640px; }

/* ── Block 1: shared marketing nav (design) ───────────────────────────────── */
.nav-brand { display:inline-flex; align-items:center; gap:9px; color:var(--ink); font-size:19px; font-weight:800; letter-spacing:-.02em; text-decoration:none; }
.nav-brand svg { display:block; flex-shrink:0; }
.nav-brand span { color:var(--ink); }
.nav-center { display:flex; gap:26px; margin-left:14px; }
.nav-center a { color:var(--ink-soft); font-weight:500; font-size:15px; text-decoration:none; transition:color .15s; }
.nav-center a:hover { color:var(--ink); }
.nav .nav-links#nav-auth { margin-left:auto; }
@media (max-width:760px){ .nav-center{ display:none; } }

/* Vermillion = the brand default, also selectable as an explicit app theme */
:root[data-theme="vermillion"] { --accent:#E25535; --accent-h:#C7401E; --accent-soft:var(--accent-tint); }

/* ── Block 5: message/artifact action bar — de-crammed icon buttons (design) ── */
.msg-actions { gap: 6px; }
.msg-action-btn { width:30px; height:30px; border-radius:9px; border:1px solid transparent; background:transparent; color:var(--ink-muted); }
.msg-action-btn svg { width:15px; height:15px; }
.msg-action-btn:hover { background:rgba(23,21,15,.06); color:var(--ink); border-color:transparent; }
.msg-action-btn.voted-up { color:#16a34a; background:rgba(22,163,74,.10); border-color:transparent; }
.msg-action-btn.voted-down { color:var(--error); background:rgba(192,57,43,.10); border-color:transparent; }

/* ── Block 5: chat composer — rounded input card (design) ─────────────────── */
.chat-input-area { max-width:760px; margin:0 auto; width:100%; border-top:none; background:transparent; padding:6px 16px 20px; }
.chat-input-toolbar { max-width:none; padding:2px 2px 8px; }
.chat-input-row { background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:0 8px 30px -18px rgba(23,21,15,.22); padding:10px 12px; gap:8px; align-items:flex-end; }
.chat-textarea { background:transparent; border:none !important; border-radius:0; padding:8px 6px; box-shadow:none !important; outline:none; }
.chat-textarea:focus { border:none !important; box-shadow:none !important; }
.doc-attach-btn { border:1px solid var(--line); border-radius:10px; color:var(--ink-soft); }
.doc-attach-btn:hover { background:rgba(23,21,15,.05); color:var(--ink); border-color:var(--line); }
.send-btn { border-radius:11px; }
.tool-btn { border-radius:999px; border-color:var(--line); }

/* ── Block 4: shared app-page header polish (design) ──────────────────────── */
.app-page h1 { font-size:clamp(24px,3vw,30px); font-weight:800; letter-spacing:-.025em; color:var(--ink); }
.app-page .app-sub, .app-page p.sub { color:var(--ink-muted); font-size:14px; margin-top:2px; }

/* ── Block 4: app-page body polish (empty states, header, lists) ──────────── */
.app-page .app-head { margin-bottom: 18px; align-items: flex-start; }
.app-page .app-head h1 { margin: 0; }
.app-page .app-empty { padding: clamp(32px,5vw,52px); font-size: 14.5px; line-height: 1.6; color: var(--ink-muted); box-shadow: 0 1px 3px rgba(23,21,15,.04); }
.app-page .app-empty a { color: var(--accent); font-weight: 600; text-decoration: none; }
.app-page .app-empty a:hover { color: var(--accent-hover); }

/* ── Block 4: shared app-page card + input polish (design scale) ──────────── */
.app-page .file-card, .app-page .app-card, .app-page .task-card, .app-page .tm-card, .app-page .card { border-radius: 16px; }
.app-page .file-card, .app-page .app-card, .app-page .task-card { transition: border-color .2s ease, box-shadow .2s ease; }
.app-page .file-card:hover, .app-page .app-card:hover, .app-page .task-card:hover { border-color: rgba(23,21,15,.18); box-shadow: 0 1px 3px rgba(23,21,15,.05); }
.app-page input, .app-page select, .app-page textarea, .app-page .weio-select-btn { border-radius: 11px; }
.app-page .folder-item { border-radius: 9px; }

/* ── Unify chat sidebar with the app shell (brand, icons, locks, account) ──── */
.sb-brand { display:flex; align-items:center; gap:9px; color:var(--ink); font-weight:800; font-size:18px; letter-spacing:-.02em; text-decoration:none; padding:2px 6px 10px; }
.sb-brand svg { flex-shrink:0; }
.sb-account { display:flex; align-items:center; gap:9px; width:100%; padding:8px; border:1px solid var(--border); border-radius:10px; background:var(--surface); cursor:pointer; text-align:left; font-family:inherit; color:var(--text); }
.sb-account:hover { background:var(--accent-soft); border-color:var(--accent-soft); }
.sb-account .sidebar-email { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.sb-account-caret { color:var(--text-sec); font-size:13px; flex-shrink:0; }
.sb-avatar { width:28px; height:28px; border-radius:50%; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; text-transform:uppercase; flex-shrink:0; }
.sidebar-feature-btn .feat-icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; flex-shrink:0; opacity:.9; }
.sidebar-feature-btn .feat-icon svg { width:18px; height:18px; }
.sidebar-feature-btn .feat-lbl { flex:1; text-align:left; }
.sidebar-feature-btn.locked { color:var(--ink-faint); }
.sidebar-feature-btn .feat-lock { margin-left:auto; display:inline-flex; color:var(--ink-faint); flex-shrink:0; }
.sidebar-feature-btn.locked:hover { background:var(--accent-soft); color:var(--accent-h); }

/* ── Chat message feedback box (after thumbs up/down) ─────────────────────── */
.msg-feedback { margin-top:8px; max-width:560px; display:flex; flex-direction:column; gap:8px; animation:msg-in .2s ease; }
.msg-feedback-input { width:100%; border:1px solid var(--line); border-radius:12px; padding:10px 12px; font-size:13.5px; font-family:inherit; color:var(--ink); background:var(--card); outline:none; resize:vertical; }
.msg-feedback-input:focus { border-color:var(--accent); }
.msg-feedback-row { display:flex; align-items:center; gap:10px; }
.msg-feedback-skip { background:none; border:none; color:var(--ink-muted); font-size:13px; cursor:pointer; font-family:inherit; padding:4px 6px; }
.msg-feedback-skip:hover { color:var(--ink); }
.msg-feedback-thanks { font-size:13px; color:var(--ink-muted); }

/* ── Onboarding: starter prompts on the chat empty state ──────────────────── */
.starter-prompts { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:24px; max-width:540px; }
.starter-chip { background:var(--card); border:1px solid var(--line); border-radius:999px; padding:9px 16px; font-size:13.5px; font-weight:500; color:var(--ink-soft); cursor:pointer; font-family:inherit; transition:border-color .15s, background .15s, color .15s; }
.starter-chip:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-tint); }

/* ── Error state: one-click retry on transient chat failures ──────────────── */
.msg-retry-btn { align-self:flex-start; margin-top:6px; background:transparent; border:1px solid var(--line); color:var(--ink-soft); border-radius:9px; padding:5px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; transition:border-color .15s, color .15s, background .15s; }
.msg-retry-btn:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-tint); }

/* ── Free-tier ad slot (v1) — subtle sidebar placement, never inline ──────── */
.weio-ad { margin-bottom:10px; border:1px solid var(--line); border-radius:12px; background:var(--card); overflow:hidden; }
.weio-ad-label { font-family:var(--font-mono); font-size:9.5px; text-transform:uppercase; letter-spacing:.12em; color:var(--ink-faint); padding:7px 11px 0; }
.weio-ad-slot { padding:7px 11px 11px; min-height:40px; }
.weio-ad-placeholder { display:block; font-size:12.5px; color:var(--ink-soft); text-decoration:none; line-height:1.4; }
.weio-ad-placeholder:hover { color:var(--accent); }

/* ── Support contact form ─────────────────────────────────────────────────── */
.support-form { max-width:560px; margin:0 auto 18px; display:flex; flex-direction:column; gap:10px; text-align:left; }
.support-form-row { display:flex; gap:10px; flex-wrap:wrap; }
.support-form-row input { flex:1; min-width:180px; }
.support-form input, .support-form textarea { width:100%; border:1px solid var(--line); border-radius:11px; padding:11px 13px; font-size:14px; font-family:inherit; color:var(--ink); background:var(--card); outline:none; box-sizing:border-box; }
.support-form input:focus, .support-form textarea:focus { border-color:var(--accent); }
.support-form textarea { resize:vertical; }
.support-form-foot { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.support-form-status { font-size:13px; color:var(--ink-muted); }
.support-form-status.ok { color:var(--success); }
.support-form-status.err { color:var(--error); }

/* Clarifying-question widget (interactive multiple-choice + free-form, like Claude) */
.weio-q{margin-top:12px;border:1px solid var(--border);border-radius:14px;padding:14px;background:var(--surface)}
.weio-q-title{font-weight:600;font-size:14px;margin-bottom:10px;line-height:1.4}
.weio-q-opts{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.weio-q-opt{border:1px solid var(--border);background:var(--bg,#fff);color:var(--text);border-radius:999px;padding:7px 14px;font-size:13px;cursor:pointer;font-family:inherit;transition:all .12s}
.weio-q-opt:hover{border-color:var(--accent)}
.weio-q-opt.on{background:var(--accent);border-color:var(--accent);color:#fff}
.weio-q-other{width:100%;box-sizing:border-box;padding:8px 11px;border:1px solid var(--border);border-radius:9px;background:var(--bg,#fff);color:var(--text);font-size:13px;font-family:inherit;margin-bottom:10px}
.weio-q-actions{display:flex;align-items:center;gap:10px}
.weio-q-hint{font-size:12px;color:var(--text-sec)}
.weio-q.answered{opacity:.7}
.weio-q-chosen{margin-top:8px;font-size:12.5px;color:var(--accent-h,var(--accent));font-weight:600}

/* Connected-app action proposal card (propose → approve → execute, in chat) */
.weio-act{margin-top:12px;border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:14px;padding:14px;background:var(--surface)}
.weio-act-head{display:flex;align-items:center;gap:9px;font-size:14px;margin-bottom:4px}
.weio-act-badge{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:var(--accent-soft);color:var(--accent-h,var(--accent));padding:2px 8px;border-radius:999px}
.weio-act-sum{font-size:13px;color:var(--text-sec);margin-bottom:9px}
.weio-act-preview{font-size:13px;line-height:1.5;white-space:pre-wrap;background:var(--bg,#f7f5ef);border:1px solid var(--border);border-radius:9px;padding:10px 12px;margin-bottom:10px;max-height:240px;overflow:auto}
.weio-act-actions{display:flex;gap:8px}
.weio-act.done{opacity:.85}
.weio-act-result{margin-top:9px;font-size:13px;font-weight:600}

/* Clickable in-chat references → connector records / uploaded docs */
.weio-ref{color:var(--accent);font-weight:600;text-decoration:none;border-bottom:1px dashed var(--accent);cursor:pointer;padding:0 1px;border-radius:3px;transition:background .12s}
.weio-ref:hover{background:var(--accent-soft);border-bottom-style:solid}
.weio-ref::after{content:"↗";font-size:.78em;opacity:.6;margin-left:2px;vertical-align:super}

/* Chat: regenerate spinner, variant navigation, inline edit */
.msg-action-btn.spinning svg{animation:weio-spin .8s linear infinite}
@keyframes weio-spin{to{transform:rotate(360deg)}}
.msg-variant-nav{display:inline-flex;align-items:center;gap:2px;margin-left:4px;vertical-align:middle}
.msg-variant-btn{border:none;background:none;cursor:pointer;color:var(--text-sec);font-size:15px;line-height:1;padding:0 4px;border-radius:5px}
.msg-variant-btn:hover:not(:disabled){background:var(--border);color:var(--text)}
.msg-variant-btn:disabled{opacity:.3;cursor:default}
.msg-variant-lab{font-size:11.5px;color:var(--text-sec);min-width:26px;text-align:center}
.msg-actions-user{justify-content:flex-end;opacity:0;transition:opacity .12s}
.msg-row:hover .msg-actions-user{opacity:1}
.msg-edit{margin-top:6px}
.msg-edit-ta{width:100%;box-sizing:border-box;min-height:60px;padding:10px 12px;border:1px solid var(--accent);border-radius:12px;font-family:inherit;font-size:14px;background:var(--surface);color:var(--text);resize:vertical}
.msg-edit-bar{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}

/* Sidebar workspace switcher (personal ⇄ teams) */
#shell-ws{margin:0 8px 10px}
.shell-ws-cur{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border);border-radius:10px;cursor:pointer;font-size:13px;background:var(--surface)}
.shell-ws-cur:hover{background:var(--bg)}
.shell-ws-ic{font-size:14px}
.shell-ws-cur .shell-ws-name{flex:1;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shell-ws-caret{color:var(--text-sec);font-size:11px}
.shell-ws-menu{margin-top:4px;border:1px solid var(--border);border-radius:10px;background:var(--surface);overflow:hidden;box-shadow:0 6px 20px rgba(0,0,0,.08)}
.shell-ws-item{display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;text-align:left;border:none;background:none;cursor:pointer;padding:8px 11px;color:var(--text)}
.shell-ws-item:hover{background:var(--bg)}
.shell-ws-item.on{background:var(--accent-soft)}
.shell-ws-item .shell-ws-name{font-weight:600;font-size:13px}
.shell-ws-kind{font-size:11px;color:var(--text-sec)}

/* Unified sidebar: the app-shell sidebar replaces the chat page's native one,
   so the same sidebar appears on every signed-in page. */
body.has-shell .chat-sidebar { display: none !important; }
body.has-shell #sidebar-toggle { display: none !important; }
@media (max-width: 820px) {
  /* Make room for the floating weio-logo toggle and make the bar tall enough that its
     bottom border sits BELOW the logo (so the line never cuts through it). */
  body.has-shell .chat-topbar { padding-left: 62px; min-height: 58px; box-sizing: border-box; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LUMEN unification for public pages (Patrick 2026-07-14): every customer-reachable
   page moves to the post-login portal theme. Token layer + page restyles below.
   ═══════════════════════════════════════════════════════════════════════════════ */
:root {
  --w-bg-page: #FAF9F6; --w-bg-surface: #FFFFFF; --w-bg-raised: #F6F4EF; --w-bg-sunken: #EFEDE7;
  --w-text-primary: #16181D; --w-text-secondary: #5B5F68; --w-text-muted: #8A8E98;
  --w-border-line: #E7E3DB; --w-border-strong: #D9D5CC;
  --w-accent: #16181D; --w-accent-on: #FFFFFF; --w-accent-tint: #F1EFE9;
  --w-cta: #3D5AFE; --w-cta-hover: #2A3ECC; --w-cta-on: #FFFFFF; --w-cta-tint: #EEF0FF;
  --w-brand: #3D5AFE; --w-success: #12A150;
  --w-radius-sm: 8px; --w-radius-md: 12px; --w-radius-lg: 20px; --w-radius-pill: 999px;
  --w-shadow-2: 0 2px 16px rgba(22,24,29,.06); --w-shadow-3: 0 14px 36px rgba(22,24,29,.14);
  --w-font-ui: "Geist","Instrument Sans","Helvetica Neue",sans-serif;
}

/* Pricing → light Lumen surface (drop the dark ink band) */
.pricing-page { background: var(--w-bg-page); }
.pricing-page::before { display: none !important; }
.pricing-head h1, .pricing-page h1 { color: var(--w-text-primary); }
.pricing-sub { color: var(--w-text-secondary); }
.pricing-band { background: transparent; }
.pricing-card { background: var(--w-bg-surface); border: 1px solid var(--w-border-line);
  border-radius: var(--w-radius-lg); color: var(--w-text-primary); box-shadow: var(--w-shadow-2); }
.pricing-card:hover { border-color: var(--w-border-strong); background: var(--w-bg-surface); }
.pricing-card.popular { border: 2px solid var(--w-cta); box-shadow: 0 18px 50px rgba(234,88,12,.16); }
.pricing-tier { color: var(--w-text-secondary); }
.pricing-price, .pricing-card.popular .pricing-price { color: var(--w-text-primary); }
.pricing-period, .pricing-tokens { color: var(--w-text-secondary); }
.pricing-card .tier-features li { color: var(--w-text-secondary); border-bottom-color: var(--w-border-line); }
.pricing-card .tier-features li::before { color: var(--w-cta); }
.pricing-faq h2 { color: var(--w-text-primary); }
.faq-item { border-color: var(--w-border-line); }
.faq-item summary { color: var(--w-text-primary); }
.faq-item p { color: var(--w-text-secondary); }
.billing-pill { background: var(--w-bg-raised); border: 1px solid var(--w-border-line); }
.billing-pill-opt { color: var(--w-text-secondary); }
.billing-pill-opt.active { background: var(--w-bg-surface); color: var(--w-text-primary); box-shadow: var(--w-shadow-2); }

/* Usage packs section */
.usage-packs { max-width: 1000px; margin: 8px auto 0; padding: 8px 18px 8px; }
.usage-packs h2 { text-align: center; font-size: clamp(22px,3vw,30px); font-weight: 800; letter-spacing: -.02em; color: var(--w-text-primary); margin: 0 0 6px; }
.usage-packs .up-sub { text-align: center; color: var(--w-text-secondary); font-size: 15px; margin: 0 auto 22px; max-width: 560px; }
.usage-packs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; }
.up-card { background: var(--w-bg-surface); border: 1px solid var(--w-border-line); border-radius: var(--w-radius-lg); padding: 20px 22px; box-shadow: var(--w-shadow-2); }
.up-card h3 { margin: 0 0 4px; font-size: 16px; color: var(--w-text-primary); }
.up-card .up-price { font-size: 26px; font-weight: 800; color: var(--w-text-primary); letter-spacing: -.02em; }
.up-card .up-price small { font-size: 13px; font-weight: 600; color: var(--w-text-secondary); }
.up-card p { font-size: 13px; color: var(--w-text-secondary); line-height: 1.55; margin: 8px 0 0; }
