:root {
  /* AI Code All palette. Logo colors (sampled from static/logo.png):
     cyan-blue #018efa, blue #0266fc, violet #8606fa, ink navy #091326.
     Dark backgrounds are tinted toward the logo's navy. */
  --bg: #0b1220;
  --panel: #111a2b;
  --panel-2: #172235;
  --border: #26324a;
  --text: #e8edf7;
  --muted: #8d9ab0;
  /* Lighter tints of the logo blue/violet -- pass WCAG AA on --bg/--panel
     (#5aa0ff 7.0:1, #b47cff 6.5:1 on #0b1220). */
  --accent: #5aa0ff;
  --accent-2: #b47cff;
  --on-accent: #06111f;            /* text on a solid --accent fill */
  --success: #2ecf8e;
  --danger: #ff6b6b;
  --warn: #f5a623;
  --brand-blue: #0266fc;
  --brand-purple: #b47cff;         /* was --brand-orange: badges, highlights */
  --brand-ink: #e8edf7;            /* the logo's navy "CODE", made light for dark mode */
  /* The logo's own gradient -- decorative text, bars, borders. */
  --brand-gradient: linear-gradient(135deg, #018efa 0%, #0266fc 50%, #8606fa 100%);
  /* A slightly deeper cut of the same gradient for filled buttons, so white
     text on it passes AA (>= 4.7:1 at every stop). */
  --brand-gradient-btn: linear-gradient(135deg, #0570e0 0%, #0257e0 50%, #7a05e6 100%);
  --brand-glow: rgba(2, 102, 252, 0.35);
  font-size: 15px;
}

/* Light mode -- same variable names, swapped palette. Applied via
   data-theme="light" on <html>, set by the inline script in base.html
   (before first paint) and toggled by #theme-toggle-btn in app.js. */
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #eceff6;
  --border: #d5dbe7;
  --text: #121a2b;
  --muted: #566178;
  /* Darker shades of the logo blue/violet -- pass AA on white
     (#0057d9 6.2:1, #6d0bd8 7.8:1). */
  --accent: #0057d9;
  --accent-2: #6d0bd8;
  --on-accent: #ffffff;
  --success: #137a50;
  --danger: #d63c3c;
  --warn: #b9750f;
  --brand-purple: #6d0bd8;
  --brand-ink: #0b1628;            /* the logo's navy "CODE" */
  --brand-glow: rgba(2, 102, 252, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.maintenance-banner {
  background: rgba(245,166,35,0.15);
  color: var(--warn);
  border-bottom: 1px solid rgba(245,166,35,0.3);
  padding: 8px 16px;
  text-align: center;
  font-size: 0.85rem;
}

/* ---- Topbar ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.hamburger-btn {
  display: none;
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer;
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; font-size: 1.15rem; display: flex; align-items: center; }
.brand-mark { letter-spacing: 0.02em; }
.brand-accent { color: var(--accent); }
.brand-logo { height: 43px; width: auto; display: block; }
@media (max-width: 640px) { .brand-logo { height: 29px; } }

/* Two logical rows (see base.html) so we can force a break between them
   on narrow screens without disturbing the single-row desktop look. */
.topbar-right { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; column-gap: 20px; }
.topbar-row { display: flex; align-items: center; gap: 14px; }
.topbar-right a { color: var(--muted); text-decoration: none; }
.topbar-right a:hover { color: var(--text); }
.topbar-right a.cta { background: var(--brand-gradient-btn); color: #fff; padding: 6px 14px; border-radius: 6px; font-weight: 600; }

/* "For Teams" nav link (business page): styled like the other top-bar links
   (Project Board). Also used in the mobile drawer (.sidebar-mobile-extras). */
.topbar-right a.nav-corporate-link { font-weight: 600; }
.topbar-right a.nav-corporate-link.active { color: var(--text); }

/* "Get a Demo" pill -- a fixed brand gradient rather than the theme's
   --accent, so it reads the same (and stays legible) in both light and
   dark mode instead of shifting with the palette. Also not scoped to
   .topbar-right, for the same reason as .nav-corporate-link above. */
a.btn-demo-pill {
  background: var(--brand-gradient-btn);
  color: #ffffff;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 999px;
  box-shadow: 0 2px 10px var(--brand-glow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: inline-block;
}
a.btn-demo-pill:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--brand-glow);
}

.theme-toggle-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; width: 32px; height: 32px; font-size: 1rem; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle-btn:hover { background: var(--panel-2); }

.token-pill {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: 0.85rem; color: var(--accent-2);
}
.admin-pill {
  background: rgba(90,160,255,0.15); border: 1px solid rgba(90,160,255,0.35); color: var(--accent);
  border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; font-weight: 600;
}

/* Below this width the topbar keeps only the theme toggle plus the one
   account action that always applies (Log out, or Log in/Sign up).
   Everything else -- Help/Admin/Buy tokens (.nav-desktop-only) and the
   whole secondary row (token balance, Corporate, Get a Demo) -- moves
   into the hamburger drawer instead (see .sidebar-mobile-extras below),
   so the logo and that one action always share a single line. */
@media (max-width: 860px) {
  .topbar-row-secondary { display: none; }
  .nav-desktop-only { display: none; }
}

/* ---- App shell / sidebar ---- */
.app-shell { display: flex; min-height: calc(100vh - 204px); }
.app-shell.no-sidebar { display: block; }
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border);
  padding: 18px 0; position: sticky; top: 136px; align-self: flex-start; height: calc(100vh - 136px);
  overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-nav a {
  color: var(--muted); text-decoration: none; padding: 9px 22px; font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.sidebar-nav a.sub { padding-left: 34px; font-size: 0.85rem; }
.sidebar-nav a:hover { color: var(--text); background: var(--panel-2); }
.sidebar-nav a.active { color: var(--text); border-left-color: var(--accent); background: var(--panel-2); font-weight: 600; }
.sidebar-group-label {
  color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 16px 22px 4px;
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 15; }
.sidebar-overlay.open { display: block; }

@media (max-width: 860px) {
  .hamburger-btn { display: inline-block; }
  .sidebar {
    position: fixed; left: -240px; top: 0; height: 100vh; z-index: 25; transition: left 0.2s ease;
    padding-top: 144px;
  }
  .sidebar.open { left: 0; }
}

/* Anonymous users' drawer (see base.html) -- always "drawer" positioned,
   not just below 860px, so it never becomes a persistent desktop column
   the way the signed-in .sidebar does above. In practice it's only ever
   reachable below 860px anyway, since that's the only width where the
   hamburger button that opens it is visible. */
.sidebar-drawer {
  position: fixed; left: -240px; top: 0; height: 100vh; z-index: 25; transition: left 0.2s ease;
  padding-top: 144px;
}
.sidebar-drawer.open { left: 0; }

/* Token balance / Corporate / Get a Demo, repeated inside the hamburger
   drawer so they're still reachable once the topbar hides them below
   860px (see .nav-desktop-only and .topbar-row-secondary above). Hidden
   above that width since the topbar already shows the real ones there. */
.sidebar-mobile-extras {
  display: none;
}
@media (max-width: 860px) {
  .sidebar-mobile-extras {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 0 22px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  }
}
/* Re-assert color/padding at higher specificity than the generic
   ".sidebar-nav a" rule below (same specificity, later in the file, so
   it would otherwise win and flatten these back to plain muted links). */
.sidebar-mobile-extras a.nav-corporate-link { font-weight: 600; }
.sidebar-mobile-extras a.btn-demo-pill { color: #ffffff; padding: 6px 16px; }

.container { flex: 1; min-width: 0; max-width: 1000px; margin: 0 auto; padding: 32px 20px 80px; width: 100%; }
.container-anon { max-width: 1000px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 24px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

h1 { margin-top: 0; font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

label { display: block; margin-bottom: 14px; font-size: 0.85rem; color: var(--muted); }
input, select, textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text);
  font-size: 0.95rem; font-family: inherit;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
input[type="checkbox"] { width: auto; display: inline-block; margin: 0 8px 0 0; vertical-align: middle; }
input[type="file"] { padding: 8px; cursor: pointer; }

.btn-primary, .btn-secondary, .btn-danger, .link-btn {
  border: none; border-radius: 6px; padding: 10px 18px; font-weight: 600; cursor: pointer;
  font-size: 0.9rem; text-decoration: none; display: inline-block;
}
.btn-primary { background: var(--brand-gradient-btn); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(255,107,107,0.15); color: var(--danger); border: 1px solid rgba(255,107,107,0.35); }
.link-btn { background: none; color: var(--muted); padding: 0; font-weight: 400; text-decoration: underline; }
.inline-form { display: inline; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }

.auth-card { max-width: 380px; margin: 40px auto; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 28px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 0.9rem; }

.flash-stack { margin-bottom: 20px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 0.9rem; }
.flash-error { background: rgba(255,107,107,0.12); color: var(--danger); border: 1px solid rgba(255,107,107,0.3); }
.flash-success { background: rgba(46,207,142,0.12); color: var(--success); border: 1px solid rgba(46,207,142,0.3); }

.result-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.file-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.file-tab {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  padding: 5px 10px; border-radius: 5px; font-size: 0.78rem; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.file-tab.active { color: var(--text); border-color: var(--accent); }

.code-block {
  background: #070d18; border: 1px solid var(--border); border-radius: 8px; padding: 16px;
  overflow-x: auto; max-height: 480px; font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word;
}
.diff-old { color: var(--danger); display: block; }
.diff-new { color: var(--success); display: block; }
.diff-ctx { color: var(--muted); display: block; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.data-table th, table.data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.data-table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; display: inline-block; }
.badge-success { background: rgba(46,207,142,0.15); color: var(--success); }
.badge-error { background: rgba(255,107,107,0.15); color: var(--danger); }
.badge-idle { background: rgba(140,149,163,0.15); color: var(--muted); }
.badge-info { background: rgba(90,160,255,0.15); color: var(--accent); }
.badge-warn { background: rgba(245,166,35,0.15); color: var(--warn); }

.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) { .pack-grid { grid-template-columns: 1fr; } }
.pack-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 18px; text-align: center; position: relative; }
.pack-card.popular { border-color: var(--accent); }
.pack-popular-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--on-accent); font-size: 0.7rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
}
.pack-tokens { color: var(--accent-2); font-weight: 600; }
.pack-price { font-size: 1.6rem; font-weight: 700; margin: 4px 0 14px; }
.pack-blurb { color: var(--muted); font-size: 0.82rem; margin-bottom: 14px; min-height: 2.4em; }

.amount-pos { color: var(--success); }
.amount-neg { color: var(--danger); }

.hint {
  margin: -8px 0 14px; font-size: 0.82rem; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
}
.hint:empty { display: none; }

.help-block { margin-bottom: 18px; }
.help-block h3 { margin-bottom: 4px; font-size: 1rem; color: var(--accent); }
.help-block p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---- Pill toggle (New / Improve) ---- */
.pill-toggle { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 18px; }
.pill-toggle-btn { background: none; border: none; color: var(--muted); padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; cursor: pointer; font-weight: 600; }
.pill-toggle-btn.active { background: var(--accent); color: var(--on-accent); }

/* ---- Deployment pipeline ---- */
.pipeline { display: flex; gap: 16px; margin: 20px 0; flex-wrap: wrap; }
.pipeline-stage { flex: 1; min-width: 200px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.pipeline-stage.running { border-color: var(--accent); }
.pipeline-stage.completed { border-color: var(--success); }
.pipeline-stage.failed { border-color: var(--danger); }
.pipeline-stage h3 { display: flex; justify-content: space-between; align-items: center; }
.log-box { background: #070d18; border: 1px solid var(--border); border-radius: 6px; padding: 10px; margin-top: 10px; max-height: 220px; overflow-y: auto; font-size: 0.76rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.log-info { color: var(--muted); }
.log-success { color: var(--success); }
.log-error { color: var(--danger); }
.log-warn { color: var(--warn); }

/* ---- Tabs (Admin Center) ---- */
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn { background: none; border: none; color: var(--muted); padding: 10px 16px; cursor: pointer; font-size: 0.9rem; border-bottom: 2px solid transparent; text-decoration: none; }
.tab-btn.active, a.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; text-align: center; }
.stat-val { font-size: 1.5rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.78rem; margin-top: 4px; }

/* ---- Accordion (FAQ) ---- */
.accordion-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.accordion-header { background: var(--panel-2); padding: 14px 16px; cursor: pointer; font-weight: 600; }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.2s ease; padding: 0 16px; color: var(--muted); }
.accordion-body.open { max-height: 400px; padding: 14px 16px; }

/* ---- Toasts ---- */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: 0.85rem; box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.toast-success { border-color: var(--success); color: var(--success); }
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-info { border-color: var(--accent); color: var(--accent); }

/* ---- Modal ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 50; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 24px; max-width: 480px; width: 90%; max-height: 85vh; overflow-y: auto; }

.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 20px 20px 40px; }

/* ---- Marketing homepage ---- */
.btn-lg { padding: 13px 26px; font-size: 1rem; }

.hero { text-align: center; padding: 48px 0 40px; }
.hero-eyebrow {
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem;
  font-weight: 600; margin: 0 0 14px;
}
.hero h1 { font-size: 2.2rem; line-height: 1.25; margin: 0 0 16px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.hero-trust { color: var(--muted); font-size: 0.82rem; max-width: 560px; margin: 0 auto; }

.landing-section { padding: 40px 0; border-top: 1px solid var(--border); }
.landing-heading { text-align: center; font-size: 1.3rem; margin: 0 0 28px; }
.fm-security p { text-align: center; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1rem; color: var(--accent); }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { text-align: center; padding: 0 10px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 999px; background: rgba(90,160,255,0.15); color: var(--accent); font-weight: 700;
  margin-bottom: 10px;
}
.step h3 { margin: 0 0 6px; font-size: 0.95rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.85rem; }

.pull-quote-section { padding: 44px 0; border-top: 1px solid var(--border); text-align: center; }
.pull-quote {
  font-size: 1.5rem; font-weight: 600; font-style: normal; max-width: 640px;
  margin: 0 auto; color: var(--text);
}
.pull-quote::before { content: "\201C"; color: var(--accent); }
.pull-quote::after { content: "\201D"; color: var(--accent); }

.landing-cta { text-align: center; padding: 40px 0 20px; border-top: 1px solid var(--border); }
.landing-cta h2 { font-size: 1.3rem; margin: 0 0 10px; }
.landing-cta .muted { margin: 0 0 22px; }
.landing-cta .muted a { color: var(--accent); }

/* "Built to enhance, not replace" reassurance section -- upgraded to a
   bolder, more "banner"-like treatment (gradient wordmark text, a glowing
   badge, and the AI Code All "A" mark centered above the badge) so it
   reads as a statement rather than a quiet aside. Reused
   on both home.html and business.html. */
.reassurance-section {
  position: relative; overflow: hidden;
  padding: 40px 32px; margin: 8px 0 40px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(134,6,250,0.14) 0%, rgba(2,102,252,0.08) 100%);
  border: 1px solid rgba(134,6,250,0.35);
  box-shadow: 0 8px 40px rgba(134,6,250,0.12);
}
.reassurance-section::before {
  content: ""; position: absolute; top: -60%; left: 8%; width: 60%; height: 220%;
  background: radial-gradient(circle, rgba(134,6,250,0.18) 0%, rgba(134,6,250,0) 70%);
  pointer-events: none;
}
.reassurance-inner {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; max-width: 900px; margin: 0 auto;
}
.reassurance-content { width: 100%; min-width: 0; text-align: center; }
/* Mark sits above the badge, 30% smaller than the old side-by-side 120px. */
.reassurance-mascot {
  width: 84px; height: auto; flex-shrink: 0;
  filter: drop-shadow(0 8px 20px rgba(134,6,250,0.35));
}
.reassurance-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; background: var(--brand-gradient-btn);
  border: none; border-radius: 999px; padding: 6px 16px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  margin: 0 0 16px;
  box-shadow: 0 4px 16px rgba(134,6,250,0.4);
}
.reassurance-badge::before { content: "\26A1\FE0E"; }
.reassurance-heading {
  font-size: 1.9rem; font-weight: 800; margin: 0 0 14px; line-height: 1.25;
  color: var(--brand-purple);
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
@supports not (background-clip: text) {
  .reassurance-heading { -webkit-text-fill-color: initial; background: none; color: var(--brand-purple); }
}
.reassurance-sub { color: var(--muted); font-size: 1rem; max-width: 560px; margin: 0 auto; }
@media (max-width: 700px) {
  .reassurance-mascot { width: 64px; }
  .reassurance-heading { font-size: 1.5rem; }
}

/* Exit-intent banner (see base.html/app.js) -- a "fly in" card from the
   bottom-right, not a full-screen modal, so it reassures without blocking
   the page. Off-screen by default; .show slides it into view. */
.exit-banner {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 340px; max-width: calc(100vw - 40px);
  background: var(--panel); border: 1px solid rgba(134,6,250,0.4); border-radius: 12px;
  padding: 20px 20px 22px; box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  transform: translateY(140%); transition: transform 0.35s ease;
}
.exit-banner.show { transform: translateY(0); }
.exit-banner-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--muted);
  font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px;
}
.exit-banner-close:hover { color: var(--text); }
.exit-banner-badge {
  color: var(--brand-purple); font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; margin: 0 0 8px;
}
.exit-banner-body { color: var(--muted); font-size: 0.87rem; margin: 0 0 16px; padding-right: 10px; }
.exit-banner-cta { display: inline-block; width: 100%; text-align: center; }
@media (max-width: 480px) {
  .exit-banner { left: 20px; right: 20px; width: auto; }
}

/* Refer a Friend page (referral.html) -- the copy-link box, and the small
   "you were invited" note on the register page for a ?ref= link. */
.referral-link-row { display: flex; gap: 10px; flex-wrap: wrap; }
.referral-link-input {
  flex: 1; min-width: 220px; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 10px 12px; font-family: monospace; font-size: 0.85rem;
}
.referral-note {
  color: var(--brand-purple); background: rgba(134,6,250,0.1); border: 1px solid rgba(134,6,250,0.3);
  border-radius: 8px; padding: 10px 14px; font-size: 0.88rem; margin: 0 0 16px;
}
.reward-preference-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.reward-preference-option {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; width: 100%;
  max-width: 560px; font-weight: 400;
}
.reward-preference-option input { margin-top: 3px; }
.reward-preference-option.selected { border-color: var(--brand-purple); background: rgba(134,6,250,0.08); }
.reward-preference-option span { color: var(--text); font-size: 0.9rem; }

/* --- Share graphics (referral banner kit) --- */
.banner-kit-group { margin-bottom: 28px; }
.banner-kit-group:last-child { margin-bottom: 0; }
.banner-kit-group h3 { margin: 0 0 4px; font-size: 1rem; }
.banner-kit-group .muted { margin: 0 0 14px; font-size: 0.88rem; }
.banner-kit-row { display: flex; flex-wrap: wrap; gap: 16px; }
.banner-kit-item {
  flex: 1 1 220px; max-width: 260px; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--panel-2);
}
.banner-kit-item img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--border); }
.banner-kit-item-meta { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.banner-kit-item-label { font-size: 0.82rem; color: var(--muted); }
.banner-kit-item-meta a { font-size: 0.82rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.banner-kit-item-meta a:hover { text-decoration: underline; }

.role-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; display: inline-block; }
.role-badge-owner { background: rgba(134,6,250,0.15); color: var(--brand-purple); }
.role-badge-admin { background: rgba(90,160,255,0.15); color: var(--accent); }
.role-badge-member { background: rgba(140,149,163,0.15); color: var(--muted); }

.org-key-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.org-key-value { font-family: ui-monospace, monospace; background: var(--panel-2); border: 1px solid var(--border);
                  border-radius: 6px; padding: 4px 10px; font-size: 0.85rem; letter-spacing: 0.05em; }

.seat-meter { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.seat-meter-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.seat-meter-fill { height: 100%; background: var(--success); }
.seat-meter-fill.seat-meter-over { background: var(--danger); }

/* --- PWA install link (menu) --- */
.nav-install-link { color: var(--text); opacity: 0.85; font-size: 0.9rem; text-decoration: none; }
.nav-install-link:hover { opacity: 1; text-decoration: underline; }

/* --- footer legal links --- */
.footer-links { margin-top: 10px; font-size: 0.85rem; }
.footer-links a { color: inherit; opacity: 0.85; text-decoration: underline; }
.footer-links a:hover { opacity: 1; }

/* --- register legal note --- */
.auth-legal { margin-top: 12px; font-size: 0.8rem; opacity: 0.8; text-align: center; }
.auth-legal a { color: inherit; text-decoration: underline; }

/* mascot images use the square "A" mark */
.reassurance-mascot { object-fit: contain; }


/* referral-brand-v2: share-graphics grid (images keep their own aspect ratio) */
.banner-kit-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.banner-kit-item { margin: 0; padding: 0; background: var(--panel, transparent); border: 1px solid var(--border, rgba(128,128,128,.25)); border-radius: 12px; overflow: hidden; display: block; min-height: 0; height: auto; }
.banner-kit-item.bk-wide { grid-column: span 6; }
.banner-kit-item.bk-tall { grid-column: span 3; }
.banner-kit-item.bk-square { grid-column: span 4; }
.banner-kit-thumb { display: block; line-height: 0; }
.banner-kit-item img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; background: none; }
.banner-kit-item-meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: .9rem; }
@media (max-width: 760px) {
  .banner-kit-item.bk-wide { grid-column: span 12; }
  .banner-kit-item.bk-tall, .banner-kit-item.bk-square { grid-column: span 6; }
}


/* Display font (headings in the feature map / exit popup / offer banner). */
@font-face { font-family: "Exo 2 Logo"; font-style: italic; font-weight: 900; font-display: swap;
  src: url("/static/fonts/exo-2-latin-900-italic.woff2") format("woff2"); }
@font-face { font-family: "Exo 2 Logo"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("/static/fonts/exo-2-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: "Exo 2 Logo"; font-style: italic; font-weight: 600; font-display: swap;
  src: url("/static/fonts/exo-2-latin-600-italic.woff2") format("woff2"); }

/* aicodeall-brand-v1: header brand = the "A" mark image + "AI Code All" wordmark.
   The mark has navy "<>" brackets, so dark mode swaps in a variant with light
   brackets; "AI Code" uses --brand-ink (the logo navy in light mode, light in
   dark mode) and "All" carries the logo gradient, as in the logo. */
.brand { gap: 10px; }
.brand-mark-img { height: 40px; width: auto; display: block; }
.brand-mark-img.brand-mark-dark { display: block; }
.brand-mark-img.brand-mark-light { display: none; }
:root[data-theme="light"] .brand-mark-img.brand-mark-dark { display: none; }
:root[data-theme="light"] .brand-mark-img.brand-mark-light { display: block; }
.brand-word { display: inline-flex; align-items: baseline; gap: 0.28em; white-space: nowrap; line-height: 1;
  font-weight: 800; font-size: 1.45rem; letter-spacing: -0.01em; color: var(--brand-ink); }
.brand-all { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent); }
@supports not (background-clip: text) { .brand-all { -webkit-text-fill-color: initial; background: none; } }
@media (max-width: 640px) { .brand-mark-img { height: 32px; } .brand-word { font-size: 1.15rem; } }
@media (max-width: 420px) { .brand-word { display: none; } .brand-mark-img { height: 36px; } }

/* Gradient text helper (hero heading highlight, etc.). */
.brand-gradient-text { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent); }
@supports not (background-clip: text) { .brand-gradient-text { -webkit-text-fill-color: initial; background: none; } }

/* aicodeall-codeblock-contrast: code blocks keep a dark background in both themes, so their text must stay light */
.code-block, .code-block code { color: #e6edf3; }

/* aicodeall-intro-pricing */
.intro-price-banner{margin:0 0 18px;padding:12px 16px;border-left:4px solid var(--brand-blue);border-radius:8px;background:rgba(134,6,250,.09);font-size:.95em;line-height:1.45}
.intro-price-banner strong{font-weight:700}
.intro-price-banner a{margin-left:6px;text-decoration:underline}

/* aicodeall-intro-banners */
.intro-price-banner--page{max-width:760px;margin:0 auto 20px}

/* aicodeall-css-version */
.intro-price-banner a{color:inherit;font-weight:600}

/* aicodeall-offer-hero */
.offer-hero{position:relative;display:flex;align-items:center;gap:24px;flex-wrap:wrap;margin:0 auto 24px;max-width:960px;padding:26px 32px;border-radius:18px;color:#f3f5f8;background:radial-gradient(520px 260px at 90% 0%,rgba(1,142,250,.30),transparent 60%),radial-gradient(420px 260px at 0% 100%,rgba(134,6,250,.24),transparent 60%),#0b1220;border:1px solid rgba(255,255,255,.10);box-shadow:0 10px 30px rgba(0,0,0,.22)}
.offer-hero__text{flex:1 1 420px;min-width:0}
.offer-hero__eyebrow{font-size:.78rem;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:#b47cff;margin-bottom:8px}
.offer-hero__price{font-family:'Exo 2 Logo',system-ui,sans-serif;font-weight:800;font-size:clamp(1.8rem,4.2vw,2.6rem);line-height:1.08;letter-spacing:-.01em;color:#fff}
.offer-hero__sub{margin:10px 0 0;font-size:1rem;line-height:1.5;color:#b9c4d8}
.offer-hero .offer-hero__cta{display:inline-block;background:var(--brand-gradient-btn);color:#fff;font-weight:800;padding:14px 26px;border-radius:999px;text-decoration:none;white-space:nowrap}
.offer-hero .offer-hero__cta:hover{filter:brightness(1.08)}
.offer-hero .offer-hero__fine{margin-left:6px;color:#b9c4d8;text-decoration:underline;font-size:.9rem;white-space:nowrap}
@media (max-width:560px){.offer-hero{padding:20px 20px}.offer-hero .offer-hero__cta{width:100%;text-align:center}}


/* aicodeall-offer-compact: introductory-price banner at roughly half size */
.offer-hero { gap: 12px; margin: 0 auto 12px; padding: 13px 18px; border-radius: 12px; max-width: 760px; }
.offer-hero__text { flex: 1 1 300px; }
.offer-hero__eyebrow { font-size: .6rem; margin-bottom: 3px; letter-spacing: .14em; }
.offer-hero__price { font-size: clamp(1rem, 2.2vw, 1.3rem); }
.offer-hero__sub { margin: 4px 0 0; font-size: .78rem; line-height: 1.4; }
.offer-hero .offer-hero__cta { padding: 8px 16px; font-size: .85rem; }
.offer-hero .offer-hero__fine { font-size: .75rem; }
@media (max-width: 560px) { .offer-hero { padding: 12px 14px; } .offer-hero .offer-hero__cta { padding: 9px 14px; } }

/* aicodeall-nonaffil: footer disclaimer */
.footer .footer-disclaimer { margin-top: 10px; font-size: .75rem; opacity: .85; }


/* aicodeall-ui-tweaks */
/* 1) $29 banner: same width as the reassurance tile (full content width); height unchanged */
.offer-hero { max-width: none; width: 100%; box-sizing: border-box; }
@media (min-width: 700px) { .offer-hero { min-height: 103px; } }

/* 2) reassurance tile + exit banner: logo blue and violet */
.reassurance-section {
  background: linear-gradient(135deg, rgba(134,6,250,0.10) 0%, rgba(2,102,252,0.10) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(2,102,252,0.10);
}
.reassurance-section::before { background: radial-gradient(circle, rgba(2,102,252,0.14) 0%, rgba(2,102,252,0) 70%); }
.reassurance-mascot { filter: drop-shadow(0 8px 20px rgba(2,102,252,0.30)); }
.reassurance-badge, .exit-banner-badge {
  color: #fff; background: var(--brand-gradient-btn);
  border: none; box-shadow: 0 4px 16px rgba(134,6,250,0.35);
}
.exit-banner-badge { display: inline-block; border-radius: 999px; padding: 5px 14px; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.reassurance-heading { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@supports not (background-clip: text) { .reassurance-heading { -webkit-text-fill-color: initial; background: none; color: var(--accent); } }
.exit-banner { border-color: rgba(134,6,250,0.40); }

/* 3) Android / iPhone links */
.app-links { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; }
.app-links__label { font-size: .95rem; font-weight: 700; color: var(--text); }
.app-link { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px; border: 2px solid var(--accent);
  background: var(--panel-2); color: var(--text); font-weight: 800; font-size: 1rem; text-decoration: none; }
.app-link:hover { background: var(--accent); color: var(--on-accent); }
.app-link svg { width: 18px; height: 18px; flex: none; }
.app-links__note { flex-basis: 100%; text-align: center; font-size: .8rem; color: var(--muted); margin: 2px 0 0; }
.app-links--compact { margin: 14px 0 6px; }
.app-links--compact .app-link { padding: 9px 16px; font-size: .95rem; }

/* aicodeall-app-links-below */
.app-links--below { margin: -22px 0 36px; }

/* ===== aicodeall-menu-v1: collapsible side menu ===== */
:root {
  --nav-bg: #1b2638;        /* lighter than the dark page (--bg #0b1220, --panel #111a2b) */
  --nav-bg-hover: #243149;
  --nav-head: #283652;
  --nav-text: #eef2f9;
  --nav-muted: #b0bccf;
  --nav-border: #2f3d57;
}
:root[data-theme="light"] {
  --nav-bg: #e2e7f1;        /* slightly darker than the light page (--bg #f4f6fb, --panel #fff) */
  --nav-bg-hover: #d4dbe9;
  --nav-head: #cad3e4;
  --nav-text: #121a2b;
  --nav-muted: #46526a;
  --nav-border: #c2cbdc;
}
.sidebar, .sidebar-drawer {
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  color: var(--nav-text);
}
.sidebar-nav .nav-item {
  display: block; padding: 10px 18px 10px 32px; color: var(--nav-muted);
  text-decoration: none; font-size: 0.9rem; border-left: 3px solid transparent;
}
.sidebar-nav .nav-item:hover { color: var(--nav-text); background: var(--nav-bg-hover); }
.sidebar-nav .nav-item.active {
  color: var(--nav-text); background: var(--nav-bg-hover);
  border-left-color: var(--accent); font-weight: 600;
}
.sidebar-nav .nav-item.nav-top { padding-left: 18px; color: var(--nav-text); font-weight: 700; font-size: 0.95rem; }
.sidebar-nav .nav-item.nav-top.active { font-weight: 700; }
.nav-single { border-top: 1px solid var(--nav-border); }
.nav-sec { border-top: 1px solid var(--nav-border); }
.nav-sec-head { display: flex; align-items: stretch; }
.sidebar-nav .nav-sec-title {
  flex: 1; display: block; text-align: left; background: none; margin: 0;
  color: var(--nav-text); font: inherit; font-weight: 700; font-size: 0.95rem;
  padding: 12px 18px 12px 18px; border: 0; border-left: 3px solid transparent;
  cursor: pointer; text-decoration: none;
}
.nav-sec-head:hover .nav-sec-title, .nav-sec-head:hover .nav-sec-chev { background: var(--nav-bg-hover); }
.nav-sec-chev {
  position: relative; width: 46px; flex: none; background: none; border: 0; margin: 0;
  padding: 0; cursor: pointer; color: var(--nav-muted);
}
.nav-sec-head:hover .nav-sec-chev { color: var(--nav-text); }
.nav-sec-chev::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translate(-50%, -30%) rotate(225deg); transition: transform 0.2s ease; /* open: points up */
}
.nav-sec.collapsed .nav-sec-chev::before { transform: translate(-50%, -70%) rotate(45deg); } /* closed: points down */
.nav-sec-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.22s ease; }
.nav-sec.collapsed .nav-sec-body { grid-template-rows: 0fr; }
.nav-sec-inner { overflow: hidden; min-height: 0; padding-bottom: 6px; }
.nav-sec.collapsed .nav-sec-inner { padding-bottom: 0; }
.nav-sec-title:focus-visible, .nav-sec-chev:focus-visible, .sidebar-nav .nav-item:focus-visible,
.nav-drawer-close:focus-visible, .nav-drawer-account:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.nav-drawer-head { display: none; }
@media (prefers-reduced-motion: reduce) {
  .nav-sec-body, .nav-sec-chev::before, .sidebar, .sidebar-drawer { transition: none !important; }
}
@media (max-width: 860px) {
  .sidebar, .sidebar-drawer {
    position: fixed; top: 0; bottom: 0; left: 0; height: auto;
    width: min(86vw, 340px); max-width: 340px; overflow-y: auto; z-index: 60;
    transform: translateX(-105%); visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
    box-shadow: none; padding: 0;
  }
  .sidebar.open, .sidebar-drawer.open {
    transform: none; left: 0; visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.35);
  }
  .sidebar-overlay { z-index: 55; }
  body.nav-open { overflow: hidden; }
  .nav-drawer-head {
    display: block; position: relative; background: var(--nav-head);
    padding: 16px 20px 18px; border-bottom: 1px solid var(--nav-border);
  }
  .nav-drawer-account { position: absolute; top: 14px; right: 56px; color: var(--nav-text); font-size: 0.9rem; text-decoration: none; }
  .nav-drawer-close {
    position: absolute; top: 6px; right: 8px; width: 40px; height: 40px; border: 0;
    background: none; color: var(--nav-text); font-size: 1.8rem; line-height: 1; cursor: pointer;
  }
  .nav-drawer-browse { display: block; margin-top: 26px; color: var(--nav-muted); font-size: 0.95rem; }
  .nav-drawer-name { display: block; color: var(--nav-text); font-size: 1.7rem; font-weight: 700; letter-spacing: 0.01em; }
  .sidebar-nav .nav-sec-title { font-size: 1.05rem; padding: 16px 20px 16px 17px; }
  .nav-sec-chev { width: 56px; }
  .sidebar-nav .nav-item { font-size: 1rem; padding: 14px 20px 14px 36px; }
  .sidebar-nav .nav-item.nav-top { padding: 16px 20px 16px 17px; font-size: 1.05rem; }
  .sidebar-mobile-extras { padding: 12px 20px; }
}
.sidebar-nav .nav-sec-title.active { background: var(--nav-bg-hover); border-left-color: var(--accent); }

/* aicodeall-projects-v1:css: Project Board ---------------------------------------- */
.pb { display: flex; flex-direction: column; gap: 0; }
.pb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.pb-head h1 { margin-bottom: 6px; }
.pb-lede { max-width: 620px; margin: 0; line-height: 1.5; }
.pb-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text); text-decoration: none; font-size: 0.85rem; cursor: pointer; margin: 0; }
.pb-chip:hover { border-color: var(--accent); }
.pb-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.pb-chip-check input { margin: 0; }
.pb-chip-check:has(input:checked) { border-color: var(--accent); background: rgba(90,160,255,0.12); font-weight: 600; }
.pb-project { display: flex; gap: 24px; justify-content: space-between; margin-bottom: 16px; }
.pb-project-main { min-width: 0; flex: 1; }
.pb-project-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 14px; min-width: 190px; }
.pb-project-side > div { display: flex; flex-direction: column; gap: 3px; }
.pb-meta { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pb-meta strong { color: var(--text); font-weight: 600; }
.pb-title { font-size: 1.15rem; margin: 6px 0 8px; }
.pb-title a { color: var(--text); text-decoration: none; }
.pb-title a:hover { color: var(--accent); }
.pb-desc { color: var(--muted); margin: 0 0 12px; line-height: 1.55; }
.pb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.pb-tag { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.pb-budget { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.pb-bidcount { color: var(--brand-purple); font-weight: 600; font-size: 0.85rem; }
.pb-empty { text-align: center; color: var(--muted); }
.pb-back { color: var(--accent); text-decoration: none; font-weight: 600; margin-bottom: 16px; display: inline-block; }
.pb-detail { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.pb-detail-main { min-width: 0; }
.pb-h1 { font-size: 1.5rem; margin: 6px 0 10px; }
.pb-body { white-space: pre-wrap; line-height: 1.6; margin: 14px 0 6px; overflow-wrap: anywhere; }
.pb-body-sm { font-size: 0.9rem; margin: 6px 0; color: var(--muted); }
.pb-label { margin: 18px 0 8px; font-size: 0.95rem; }
.pb-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pb-checks li { padding-left: 24px; position: relative; line-height: 1.5; }
.pb-checks li::before { content: "\2713"; position: absolute; left: 2px; color: var(--success); font-weight: 700; }
.pb-side { display: flex; flex-direction: column; gap: 0; }
.pb-facts { display: flex; flex-direction: column; gap: 14px; }
.pb-facts > div { display: flex; flex-direction: column; gap: 2px; }
.pb-fact-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.pb-safety ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.pb-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pb-section-head h2 { margin: 0; }
.pb-ai-btn { background: rgba(90,160,255,0.12); color: var(--accent); border: 1px solid rgba(90,160,255,0.4); border-radius: 6px; padding: 7px 12px; font-weight: 600; font-size: 0.82rem; cursor: pointer; }
.pb-ai-btn:hover { background: rgba(90,160,255,0.2); }
.pb-ai-btn:disabled { opacity: 0.6; cursor: default; }
.pb-ai-out { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 6px; padding: 14px; margin: 10px 0 16px; }
.pb-ai-text { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.55; }
.pb-ai-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pb-bid { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.pb-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.pb-bid-name { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pb-bid-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.pb-report-inline summary, .pb-report summary { cursor: pointer; color: var(--muted); font-size: 0.8rem; }
.pb-report-inline form, .pb-report form { margin-top: 10px; }
.pb-report { padding: 16px 24px; }
.pb-close { margin-top: 14px; }
.pb-note { color: var(--muted); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pb-ok { background: rgba(46,207,142,0.12); color: var(--success); border: 1px solid rgba(46,207,142,0.3); border-radius: 6px; padding: 10px 14px; font-size: 0.9rem; }
.pb-contact { border-color: rgba(46,207,142,0.45); }
.pb-contact h2 { margin-top: 0; }
.pb-contact-line { font-size: 1.05rem; }
.pb-form label { margin-bottom: 14px; }
.pb-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.pb-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; margin-top: 14px; }
.pb-field-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.pb-field-row label { margin: 0; }
.pb-fieldset { border: none; padding: 0; margin: 0 0 14px; }
.pb-fieldset legend { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; padding: 0; }
.pb-fieldset .pb-chips { margin-bottom: 0; }
.pb-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pb-small { font-size: 0.8rem; margin: 0 0 14px; }
.pb-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.pb-admin-text { font-size: 0.8rem; color: var(--muted); margin-top: 4px; max-width: 360px; }
.pb-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pb-admin-actions form { margin: 0; }
.pb-admin-reason { width: 150px; margin: 0; padding: 5px 8px; font-size: 0.8rem; }
@media (max-width: 860px) {
  .pb-detail { grid-template-columns: 1fr; }
  .pb-project { flex-direction: column; gap: 12px; }
  .pb-project-side { flex-direction: row; align-items: center; justify-content: space-between; min-width: 0; width: 100%; }
  .pb-grid-2, .pb-grid-3 { grid-template-columns: 1fr; }
  .pb-bid { grid-template-columns: 1fr; }
  .pb-avatar { display: none; }
  .pb-bid-side { align-items: flex-start; text-align: left; }
}
.topbar-right a.nav-board-link { font-weight: 600; }
.topbar-right a.nav-board-link.active { color: var(--text); }
.pb a:not([class]), .pb-admin a:not([class]) { color: var(--accent); }
.pb-form textarea { font-family: inherit; line-height: 1.5; }
.pb-chip-check { margin: 0; line-height: 1.2; }
.pb-chip-check input[type="checkbox"] { width: auto; height: auto; padding: 0; margin: 0; }

/* aicodeall-projects-v1:css11: example projects */
.pb-examples-head { margin: 28px 0 14px; }
.pb-examples-head h2 { margin: 0 0 4px; }
.pb-examples-head p { margin: 0; }
.pb-project-example { border-style: dashed; }
.pb-example-note { justify-content: space-between; }
.pb .pb-title a { color: var(--text); }
.pb .pb-title a:hover { color: var(--accent); }

/* aicodeall-wizard-v1:css: Code Generator wizard ------------------------------------- */
.wz-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.wz-head h1 { margin: 0; }
.wz-steps { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; font-size: 0.82rem; color: var(--muted); flex-wrap: wrap; }
.wz-steps li { display: flex; align-items: center; gap: 6px; }
.wz-steps span { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; }
.wz-steps li.is-on { color: var(--text); font-weight: 600; }
.wz-steps li.is-on span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wz-steps li.is-done span { border-color: var(--success); color: var(--success); }
.wz-q { font-size: 1.2rem; margin: 22px 0 14px; }
.wz-back { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; display: inline-block; margin-top: 14px; }
.wz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wz-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.wz-card { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.wz-card:hover, .wz-card:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.wz-card strong { font-size: 1rem; }
.wz-card span { color: var(--muted); font-size: 0.87rem; line-height: 1.45; }
.wz-card-big { padding: 26px; gap: 10px; }
.wz-card-big strong { font-size: 1.15rem; }
.wz-icon { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.3rem !important; color: var(--accent) !important; font-weight: 700; }
.wz-cost { font-style: normal; font-size: 0.75rem; color: var(--accent-2); margin-top: auto; padding-top: 6px; }
.wz-foot { margin-top: 18px; }
.wz-foot a { color: var(--accent); }
.wz-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; margin-bottom: 18px; }
.wz-bar a { color: var(--accent); text-decoration: none; }
.wz-bar a:hover { text-decoration: underline; }
.wz-here { color: var(--text); font-weight: 600; }
.wz-sep { opacity: 0.6; }
.wz-change { margin-left: auto; font-weight: 600; }

/* aicodeall-github-connect-v1:css: GitHub card + pull box ---------------------------- */
.gh-head { display: flex; align-items: center; gap: 10px; }
.gh-head h3 { margin: 0; }
.gh-card code, .gh-pull code { font-size: 0.85em; }
.gh-table { margin: 12px 0 6px; }
.gh-sub { margin: 18px 0 8px; font-size: 0.95rem; }
.gh-repos { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.gh-repos li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gh-link-form { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.gh-link-form label { flex: 1 1 280px; margin-bottom: 0; }
.gh-link-form .gh-small { flex-basis: 100%; }
.gh-connect { margin-top: 14px; }
.gh-small { font-size: 0.8rem; margin: 0; }
.gh-card a:not([class]) { color: var(--accent); }
.gh-pull { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 6px 0 16px; background: var(--panel-2); }
.gh-pull summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.gh-pull[open] summary { margin-bottom: 12px; }
.gh-pull-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.gh-pull select[size] { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; margin: 0 0 10px; }
.gh-pull-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .gh-pull-grid { grid-template-columns: 1fr; } }

/* GitHub help page, step-2 callout, Help Center tiles ------------------------------- */
.gh-head .gh-help { margin-left: auto; font-size: 0.85rem; color: var(--accent); }
.gh-callout { border: 1px solid rgba(245,166,35,0.45); background: rgba(245,166,35,0.10); border-left: 4px solid var(--warn); border-radius: 8px; padding: 12px 14px; margin: 4px 0 14px; font-size: 0.9rem; line-height: 1.5; }
.gh-callout a { color: var(--accent); white-space: nowrap; }
.gh-callout-sm { margin: 6px 0 16px; }
.gh-help-inline { margin-left: auto; color: var(--accent); }
.help-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.help-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--text); text-decoration: none; }
.help-tile:hover { border-color: var(--accent); }
.help-tile strong { color: var(--accent); }
.help-tile span { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.hg-back { color: var(--accent); text-decoration: none; font-weight: 600; display: inline-block; margin-bottom: 16px; }
.hg-lead { font-size: 1rem; line-height: 1.6; }
.hg-flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hg-flow-step { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); font-weight: 600; font-size: 0.9rem; }
.hg-flow-step span { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; }
.hg-flow-arrow { color: var(--muted); }
.hg-steps, .hg-list { line-height: 1.6; padding-left: 22px; }
.hg-steps li, .hg-list li { margin-bottom: 8px; }
.hg-note { color: var(--muted); font-size: 0.88rem; border-left: 3px solid var(--border); padding-left: 12px; margin: 12px 0 0; }
.hg-important { border-color: rgba(245,166,35,0.45); }
.hg-pill { font-size: 0.72rem; font-weight: 700; color: var(--warn); border: 1px solid rgba(245,166,35,0.45); border-radius: 999px; padding: 2px 8px; vertical-align: middle; margin-left: 6px; }
.hg-table th { width: 140px; vertical-align: top; }
.hg a:not([class]) { color: var(--accent); }

/* GitHub part 2: Send to GitHub panel + deploy override ---------------------------- */
.gh-send { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--panel-2); }
.gh-send-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.gh-send-head .gh-small { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.gh-send p { margin: 6px 0; }
.gh-send-result { margin-top: 10px; }
.gh-send-ok a { color: var(--accent); font-weight: 600; }
.gh-send-bad { color: var(--danger); font-weight: 600; }
.gh-send-pre { white-space: pre-wrap; font-size: 0.8rem; max-height: 220px; overflow: auto; }
.gh-override { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.gh-override label { margin: 0; }

/* ---- Code Generator menu: Start here + tool list (aicodeall-menu-tools-v1) ---- */
.sidebar-nav .nav-item.nav-start { color: var(--nav-text); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sidebar-nav .nav-item.nav-start .nav-start-star { color: var(--brand-purple); }
.sidebar-nav .nav-item.nav-start .nav-start-hint {
  margin-left: auto; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px;
}
.nav-sub-label {
  color: var(--nav-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 12px 18px 4px 32px;
}
.wz-start {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--border); border-left: 4px solid var(--brand-purple); border-radius: 10px;
  background: var(--panel); padding: 12px 16px; margin: 4px 0 18px;
}
.wz-start p { margin: 0; flex: 1 1 260px; }
.wz-start-badge {
  font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #fff; background: var(--brand-purple); border-radius: 999px; padding: 4px 12px; white-space: nowrap;
}

/* ---- Desktop menu header + hide/show menu (aicodeall-nav-collapse-v1) ---- */
.nav-desk-head {
  display: flex; align-items: center; gap: 6px; padding: 0 8px 12px 12px; margin-top: -6px;
  border-bottom: 1px solid var(--nav-border);
}
.nav-desk-account {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px;
  color: var(--nav-text); text-decoration: none;
}
.nav-desk-account:hover, .nav-desk-account.active { background: var(--nav-bg-hover); }
.nav-desk-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.85rem;
}
.nav-desk-who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nav-desk-who strong { font-size: 0.9rem; }
.nav-desk-who small { color: var(--nav-muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-collapse-btn {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: none; color: var(--nav-muted); cursor: pointer; padding: 0;
}
.nav-collapse-btn:hover { background: var(--nav-bg-hover); color: var(--nav-text); }
.nav-collapse-btn:focus-visible, .nav-desk-account:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-collapse-chev { transition: transform 0.2s ease; transform-origin: 14.5px 12px; }
@media (min-width: 861px) {
  html.nav-animating .sidebar { transition: width 0.22s ease; }
  html.nav-collapsed .sidebar { width: 52px; overflow: hidden; }
  html.nav-collapsed .sidebar-nav, html.nav-collapsed .nav-desk-account { display: none; }
  html.nav-collapsed .nav-desk-head { justify-content: center; padding: 0 0 12px; border-bottom: 0; }
  html.nav-collapsed .nav-collapse-chev { transform: rotate(180deg); }
}
@media (max-width: 860px) { .nav-desk-head { display: none; } }
@media (prefers-reduced-motion: reduce) { html.nav-animating .sidebar, .nav-collapse-chev { transition: none; } }

/* ---- Guided ship-it path (aicodeall-ship-path-v1) ---- */
.ship { border-top: 3px solid var(--accent); }
.ship-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ship-head h2 { margin: 0; }
.ship-count { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.ship-count.is-finished { color: #1a9e5c; }
.ship-for { margin: 4px 0 14px; }
.ship-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.ship-step { flex: 1 1 0; min-width: 104px; position: relative; }
.ship-step + .ship-step::before {
  content: ""; position: absolute; top: 19px; left: -6px; width: 6px; height: 2px; background: var(--border);
}
.ship-step button {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 6px 10px;
  color: var(--text); cursor: pointer; font: inherit;
}
.ship-step button:hover { border-color: var(--accent); }
.ship-step button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ship-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700;
  border: 2px solid var(--border); color: var(--muted); background: var(--panel);
}
.ship-label { font-size: 0.82rem; font-weight: 600; line-height: 1.2; }
.ship-sub { font-size: 0.7rem; color: var(--muted); min-height: 1em; text-transform: uppercase; letter-spacing: 0.04em; }
.ship-step.is-done .ship-dot { background: #1a9e5c; border-color: #1a9e5c; color: #fff; }
.ship-step.is-failed .ship-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.ship-step.is-warn .ship-dot { background: var(--warn); border-color: var(--warn); color: #1a1a1a; }
.ship-step.is-optional .ship-label, .ship-step.is-skipped .ship-label { color: var(--muted); font-weight: 500; }
.ship-step.is-current .ship-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px rgba(2, 102, 252, 0.25); }
.ship-step.is-current .ship-sub { color: var(--accent); font-weight: 700; }
.ship-step.is-shown button { border-color: var(--accent); background: var(--panel); box-shadow: inset 0 -3px 0 var(--accent); }
.ship-panel { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--panel); }
.ship-panel-head { display: flex; align-items: center; gap: 10px; }
.ship-panel-head h3 { margin: 0; }
.ship-panel > p { margin: 6px 0 10px; }
.ship-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ship-actions a { text-decoration: none; }
.ship-tips { margin: 6px 0 10px; padding-left: 20px; }
.ship-tips li { margin: 3px 0; }
.ship-sub-head { font-weight: 600; margin: 12px 0 2px; }
.ship-files details { border: 1px solid var(--border); border-radius: 8px; margin: 6px 0; }
.ship-files summary { cursor: pointer; padding: 8px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.ship-files pre { margin: 0; max-height: 380px; overflow: auto; border-radius: 0 0 8px 8px; }
.ship-finished { color: #1a9e5c; font-weight: 600; margin-top: 12px; }
.ship-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--accent); }
.ship-cta-text { display: flex; flex-direction: column; gap: 6px; flex: 1 1 320px; }
.ship-cta-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; font-size: 0.8rem; }
.ship-cta-steps li { color: var(--muted); }
.ship-cta-steps li + li::before { content: "\2192"; margin-right: 4px; }
.ship-cta-steps li.is-done { color: #1a9e5c; font-weight: 600; }
.ship-cta .btn-primary { text-decoration: none; white-space: nowrap; }
@media (max-width: 720px) { .ship-steps { flex-wrap: nowrap; } .ship-step { min-width: 92px; } }

/* ---- Single sign-on (aicodeall-sso-v1) ---- */
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; margin: 14px 0 10px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-sso-btn { display: block; text-align: center; text-decoration: none; }
.sso-card .sso-small { font-size: 0.88em; }
.sso-copy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.sso-copy code, .sso-dns code { word-break: break-all; }
.sso-form { max-width: 560px; }
.sso-inline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sso-inline input { flex: 1 1 220px; width: auto; margin: 0; }
.sso-check { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; margin: 10px 0; }
.sso-check input { width: auto; margin-top: 4px; flex: none; }
.sso-domains td { vertical-align: top; }
.sso-actions { white-space: nowrap; }
.sso-actions .inline-form { display: inline-block; margin-right: 6px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* ---- Demo-request free trial (aicodeall-demo-trial-v1) ---- */
.trial-note { border: 1px solid var(--border); border-left: 4px solid #1a9e5c; border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; background: var(--panel); }
.trial-small { font-size: 0.85em; margin-top: 6px; }
.demo-trial-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.demo-trial-form label { margin: 0; }
.demo-trial-form .dt-toggle { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.demo-trial-form .dt-toggle input { width: auto; }

/* ---- Light/dark switch (aicodeall-theme-switch-v1) ---- */
.theme-switch {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; margin: 0;
  background: none; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; color: var(--muted);
  line-height: 1;
}
.theme-switch:hover { background: var(--panel-2); }
.theme-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-switch .ts-icon { flex: none; transition: color 0.2s ease, opacity 0.2s ease; opacity: 0.55; }
.theme-switch .ts-track {
  position: relative; width: 34px; height: 18px; border-radius: 999px; flex: none;
  background: var(--panel-2); border: 1px solid var(--border); transition: background 0.2s ease;
}
.theme-switch .ts-knob {
  position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #f5b301; box-shadow: 0 1px 3px rgba(0,0,0,0.35); transition: transform 0.2s ease, background 0.2s ease;
}
.theme-switch[aria-checked="false"] .ts-sun { color: #e59a00; opacity: 1; }
.theme-switch[aria-checked="true"] .ts-moon { color: var(--accent); opacity: 1; }
.theme-switch[aria-checked="true"] .ts-track { background: var(--accent); border-color: var(--accent); }
.theme-switch[aria-checked="true"] .ts-knob { transform: translateX(16px); background: #ffffff; }
@media (prefers-reduced-motion: reduce) { .theme-switch .ts-knob, .theme-switch .ts-track { transition: none; } }

/* ---- Admin: AI rules (aicodeall-learned-rules-v1) ---- */
.rules-settings { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.rules-settings label { margin: 0; }
.rules-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rules-add input[type=text] { flex: 1 1 360px; width: auto; margin: 0; }
.rules-add select { width: auto; margin: 0; }
.rules-table td { vertical-align: top; }
.rule-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; min-width: 320px; }
.rule-edit textarea { flex: 1 1 100%; margin: 0; font-family: inherit; }
.rule-edit select { width: auto; margin: 0; }
.rule-src { margin-top: 6px; font-size: 0.85em; }
.rule-src code { display: block; white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.rule-actions { white-space: nowrap; }
.rule-actions .inline-form { display: inline-block; margin-right: 6px; }
tr.rule-off td { opacity: 0.6; }
.rule-err { max-width: 420px; word-break: break-word; }

/* ---- Team coding rules (aicodeall-team-rules-v1) ---- */
.tr .tr-note { border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 8px; padding: 10px 14px; background: var(--panel); }
.tr-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tr-add input[type=text] { flex: 1 1 380px; width: auto; margin: 0; }
.tr-add select { width: auto; margin: 0; }
.tr-table td { vertical-align: top; }
.tr-grid { align-items: start; }
.tr-form { display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin-bottom: 10px; }
.tr-form label { margin: 0; }
.tr-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tr-error { color: var(--danger); }
.tr-ghlist ul { margin: 8px 0 0; padding-left: 20px; }
.tr-ghlist li { margin: 3px 0; }

/* ---- Phone menu: scrollable drawer (aicodeall-mobile-menu-v1) ----
   The desktop sidebar uses align-self:flex-start inside the .app-shell flex row. On a fixed
   element that makes it shrink to its content height instead of stretching between top:0
   and bottom:0, so long menus ran off the bottom of the screen with nothing to scroll. */
@media (max-width: 860px) {
  .sidebar, .sidebar-drawer {
    align-self: stretch; max-height: 100vh; max-height: 100dvh;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
}

/* ---- Account icon menu for logged-out visitors on phones (aicodeall-account-menu-v1) ---- */
.acct-menu { display: none; position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 2px;
  color: var(--text); cursor: pointer; font: inherit; line-height: 1;
}
.acct-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.acct-label { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.acct-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 220px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.acct-pop::before { content: ""; position: absolute; top: -10px; right: 0; left: 0; height: 10px; } /* hover bridge */
.acct-menu.open .acct-pop { display: block; }
@media (hover: hover) { .acct-menu:hover .acct-pop { display: block; } }
.acct-pop a.acct-primary {
  display: block; text-align: center; background: var(--accent); color: var(--on-accent); font-weight: 700;
  padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.acct-pop a.acct-primary:hover { color: var(--on-accent); filter: brightness(1.05); }
.acct-new { margin: 12px 0 0; font-size: 0.85rem; color: var(--muted); text-align: center; }
.acct-new a { color: var(--accent); font-weight: 600; }
.acct-sso { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); text-align: center; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 860px) {
  .topbar-right a.nav-auth-link { display: none; }
  .acct-menu { display: block; }
}
@media (max-width: 380px) { .acct-label { display: none; } }
/* Wide tables scroll sideways on phones instead of widening (and zooming out) the whole page. */
@media (max-width: 860px) { table.data-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } }

/* ---- Plans page + Pro workspace (aicodeall-pro-plan-v1) ---- */
.pp-head { text-align: center; max-width: 760px; margin: 10px auto 26px; }
.pp-eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; margin: 0 0 6px; }
.pp-head h1 { margin: 0 0 12px; }
.pp-intro { display: inline-block; border: 1px solid var(--border); border-left: 4px solid var(--brand-purple); border-radius: 8px; padding: 8px 14px; background: var(--panel); margin: 0; }
.pp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
@media (max-width: 960px) { .pp-grid { grid-template-columns: 1fr; } }
.pp-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px 22px; display: flex; flex-direction: column; }
.pp-card h2 { margin: 0 0 6px; }
.pp-featured { border: 2px solid var(--accent); box-shadow: 0 10px 30px rgba(2, 102, 252, 0.18); }
.pp-badge { position: absolute; top: -12px; left: 22px; background: var(--accent); color: var(--on-accent); font-size: 0.75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.pp-price { margin: 4px 0 0; color: var(--muted); }
.pp-price span { font-size: 2rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.pp-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.pp-std { margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; }
.pp-choice { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.pp-opt { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.pp-or { text-align: center; color: var(--muted); font-size: 0.8rem; margin: -2px 0; }
.pp-everything { margin: 14px 0 4px; font-weight: 600; font-size: 0.9rem; }
.pp-list { margin: 6px 0 18px; padding-left: 18px; flex: 1; }
.pp-list li { margin: 6px 0; font-size: 0.92rem; }
.pp-btn { display: block; width: 100%; text-align: center; text-decoration: none; margin-top: 8px; box-sizing: border-box; }
.pp-forms { display: flex; flex-direction: column; gap: 4px; }
.pp-fine { color: var(--muted); font-size: 0.8rem; margin: 10px 0 0; text-align: center; }
.pp-current { font-weight: 600; color: #1a9e5c; margin: 0; }
.pp-legal { text-align: center; margin-top: 18px; font-size: 0.82rem; }
.pro-ws-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.pro-ws-head h2 { margin: 0 0 4px; }
.pro-ws-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.pro-ws-team { margin: 12px 0 0; font-size: 0.88rem; }
.pro-upsell { border-left: 4px solid var(--accent); }

/* ---- Team insights + Premium support (aicodeall-team-insights-v1, aicodeall-premium-support-v1) ---- */
.ti-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ti-head h1 { margin: 0 0 4px; }
.ti-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ti-periods { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.ti-periods a { padding: 6px 14px; text-decoration: none; color: var(--muted); font-size: 0.88rem; }
.ti-periods a.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.ti-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0 0 18px; }
.ti-more summary { cursor: pointer; margin: 10px 0; color: var(--accent); font-weight: 600; }
.ps-status-select { min-width: 120px; }
.ti-tile { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.ti-tile.ti-warn { border-left: 4px solid var(--warn); }
.ti-num { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.ti-num small { font-size: 0.55em; color: var(--muted); font-weight: 600; margin-left: 2px; }
.ti-lbl { color: var(--muted); font-size: 0.85rem; }
.ti-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ti-bar { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 2px; }
.ti-bar-ok { display: block; background: var(--accent); border-radius: 2px 2px 0 0; }
.ti-bar-failed { display: block; background: var(--danger); }
.ti-axis { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.78rem; margin-top: 4px; flex-wrap: wrap; }
.ti-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin: 0 3px 0 8px; }
.ti-key-ok { background: var(--accent); } .ti-key-failed { background: var(--danger); }
.ti-tools { margin: 10px 0 0; }
.ti-bad { color: var(--danger); }
.ti-err { max-width: 460px; word-break: break-word; font-size: 0.88rem; }
.ti-note { font-size: 0.85rem; margin-top: 8px; }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tt-grid p { margin: 4px 0 8px; }
.ps-setup { border: 1px solid var(--border); border-left: 4px solid #1a9e5c; border-radius: 8px; padding: 10px 14px; margin: 12px 0 16px; display: flex; flex-direction: column; gap: 4px; background: var(--panel); }
.ps-form { max-width: 720px; display: flex; flex-direction: column; gap: 10px; }
.ps-form label { margin: 0; }
.ps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .ps-row { grid-template-columns: 1fr; } }
.ps-status { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.ps-check { margin-top: 10px; }
.ps-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ps-add input[type=text], .ps-add input[type=tel] { width: auto; flex: 1 1 180px; margin: 0; }
.ps-small { font-size: 0.85rem; }
.ps-body { white-space: pre-wrap; margin-top: 6px; font-size: 0.9rem; }

/* ---- Team home (aicodeall-teams-area-v1) ---- */
.th-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.th-head h1 { margin: 0 0 6px; }
.th-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.th-flash { margin: 0 0 16px; }
.th-check-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.th-check-head h2 { margin: 0; }
.th-check-head a { color: var(--accent); font-weight: 600; text-decoration: none; }
.th-progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.th-progress span { display: block; height: 100%; background: #1a9e5c; border-radius: 999px; }
.th-checklist { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; }
.th-checklist li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.th-checklist li:last-child { border-bottom: 0; }
.th-tick { flex: 0 0 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.th-checklist li.done .th-tick { background: #1a9e5c; border-color: #1a9e5c; color: #fff; }
.th-checklist li.pending .th-tick { border-color: var(--accent); color: var(--accent); }
.th-checklist li.done .th-item strong { color: var(--muted); }
.th-item { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.th-item .muted { font-size: 0.88rem; }
.th-checklist .btn-sm { flex: 0 0 auto; }
.th-tiles { margin: 12px 0 0; }
.th-tools-title { margin: 22px 0 10px; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.th-tool { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.th-tool:hover, .th-tool:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.th-tool strong { color: var(--accent); }
.th-tool span { color: var(--muted); font-size: 0.9rem; }
.th-small { font-size: 0.88rem; margin-top: 14px; }
.th-hero { max-width: 760px; }
.th-points { margin: 12px 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.th-create { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.th-create label { flex: 1 1 260px; margin: 0; }
@media (max-width: 640px) { .th-checklist li { flex-wrap: wrap; } .th-checklist .btn-sm { margin-left: 42px; } }

/* ---- Home feature map + exit popup (aicodeall-feature-map-v1, aicodeall-exit-intent-v1) ---- */
.fm { --plan: #b7791f; --build: var(--accent); --ship: var(--accent-2);
  margin: 28px 0 8px; padding: 32px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--panel); }
:root:not([data-theme="light"]) .fm { --plan: #e3a948; }
.fm-top { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.fm-intro h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.18; letter-spacing: -0.015em; margin: 0 0 14px; max-width: 20ch; }
.fm-sub { color: var(--muted); font-size: 1.05rem; line-height: 1.55; margin: 0 0 22px; max-width: 46ch; }
.fm-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fm-actions a { text-decoration: none; }
.fm-trust { color: var(--muted); font-size: 0.85rem; margin: 0; max-width: 52ch; }
.fm-why { border-left: 3px solid var(--accent); padding: 2px 0 2px 26px; }
.fm-why h2 { font-family: "Exo 2 Logo", "Arial Black", system-ui, sans-serif; font-style: italic; font-weight: 800;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 8px; }
.fm-why-lead { margin: 0 0 14px; font-size: 1.02rem; }
.fm-why-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.fm-why-list li { position: relative; padding-left: 26px; color: var(--muted); line-height: 1.5; font-size: 0.95rem; }
.fm-why-list li strong { color: var(--text); }
.fm-why-list li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 16px; height: 16px; border-radius: 50%;
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.3l2.6 2.5L12 5.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

.fm-map { position: relative; margin-top: 30px; padding: 22px 22px 26px; border-radius: 14px; background: var(--panel-2);
  display: grid; grid-template-columns: minmax(190px, 235px) minmax(220px, 1fr) minmax(190px, 235px);
  grid-template-areas: "plan core build" "ship ship ship"; column-gap: clamp(28px, 6vw, 72px); row-gap: 44px; }
.fm-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.fm-line { fill: none; stroke-width: 1.6; opacity: .45; transition: opacity .15s, stroke-width .15s; }
.fm-line-plan { stroke: var(--plan); } .fm-line-build { stroke: var(--build); } .fm-line-ship { stroke: var(--ship); }
.fm-line.on { opacity: 1; stroke-width: 2.6; }
.fm-group { position: relative; z-index: 1; }
.fm-plan { grid-area: plan; } .fm-build { grid-area: build; } .fm-ship { grid-area: ship; }
.fm-phase { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 0.95rem; font-weight: 700; }
.fm-build .fm-phase { justify-content: flex-end; }
.fm-ship .fm-phase { justify-content: center; }
.fm-step { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.78rem; color: #fff; }
.fm-plan .fm-step { background: var(--plan); } .fm-build .fm-step { background: var(--build); } .fm-ship .fm-step { background: var(--ship); }
.fm-nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.fm-ship .fm-nodes { flex-direction: row; gap: 10px; }
.fm-ship .fm-nodes li { flex: 1 1 0; min-width: 0; }
.fm-node { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 999px; background: var(--panel);
  border: 1.5px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; line-height: 1.2; height: 100%; box-sizing: border-box; }
.fm-ship .fm-node { border-radius: 12px; }
.fm-dot { flex: 0 0 10px; height: 10px; border-radius: 50%; }
.fm-plan .fm-dot { background: var(--plan); } .fm-build .fm-dot { background: var(--build); } .fm-ship .fm-dot { background: var(--ship); }
.fm-plan .fm-node:hover, .fm-plan .fm-node:focus-visible { border-color: var(--plan); }
.fm-build .fm-node:hover, .fm-build .fm-node:focus-visible { border-color: var(--build); }
.fm-ship .fm-node:hover, .fm-ship .fm-node:focus-visible { border-color: var(--ship); }
.fm-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fm-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.fm-badge { font-size: 0.68rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; white-space: nowrap; }
.fm-desc { display: none; }
.fm-core { grid-area: core; position: relative; z-index: 1; align-self: center; justify-self: center; width: 100%; max-width: 320px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fm-code { width: 100%; border-radius: 12px; background: #0d1626; border: 1px solid #22314a; box-shadow: 0 14px 40px -18px rgba(2, 60, 160, .55); overflow: hidden; }
.fm-code-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #142036; color: #8ea3c2; font-size: 0.74rem; }
.fm-code-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2c3d5a; }
.fm-code-bar span { margin-left: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fm-code pre { margin: 0; padding: 14px 16px 16px; color: #d6e2f5; font: 0.74rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; overflow: hidden; }
.fm-code .k { color: #7fb4ff; } .fm-code .f { color: #c79bff; }
.fm-core-label { margin: 0; font-family: "Exo 2 Logo", "Arial Black", system-ui, sans-serif; font-style: italic; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }
.fm-hint { margin: 14px 0 0; padding: 11px 14px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 0.9rem; text-align: center; min-height: 1.4em; }
.fm-hint strong { color: var(--text); }
.fm-security { max-width: 760px; margin-left: auto; margin-right: auto; }

@media (max-width: 980px) {
  .fm-code pre { font-size: 0.66rem; padding: 12px; }
  .fm-ship .fm-nodes { flex-wrap: wrap; }
  .fm-ship .fm-nodes li { flex: 1 1 30%; }
}
@media (max-width: 860px) {
  .fm { padding: 22px 16px; border-radius: 14px; }
  .fm-top { grid-template-columns: 1fr; gap: 26px; }
  .fm-why { padding-left: 16px; }
  .fm-map { grid-template-columns: 1fr; grid-template-areas: "core" "plan" "build" "ship"; row-gap: 22px; padding: 18px 14px; }
  .fm-lines { display: none; }
  .fm-build .fm-phase, .fm-ship .fm-phase { justify-content: flex-start; }
  .fm-nodes, .fm-ship .fm-nodes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fm-node { border-radius: 12px; align-items: flex-start; padding: 9px 10px; font-size: 0.86rem; }
  .fm-dot { margin-top: 3px; flex-basis: 8px; height: 8px; }
  .fm-label { flex: 1 1 0; }
  .fm-core { max-width: 340px; }
  .fm-code pre { font-size: 0.8rem; }
  .fm-hint { display: none; }
}

.xi { max-width: 460px; width: calc(100% - 32px); padding: 30px 28px 20px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--panel); color: var(--text); text-align: center; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.xi::backdrop { background: rgba(8, 12, 20, .55); }
.xi[open] { animation: xi-in .22s ease-out; }
@keyframes xi-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.xi-close-form { position: absolute; top: 8px; right: 10px; margin: 0; }
.xi-close { background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.xi-close:hover, .xi-close:focus-visible { color: var(--text); background: var(--panel-2); }
.xi-bot { width: 84px; height: 84px; margin: 0 auto 6px; display: block; }
.xi h2 { font-family: "Exo 2 Logo", "Arial Black", system-ui, sans-serif; font-style: italic; font-weight: 800; font-size: 1.55rem; line-height: 1.12; margin: 0 0 10px; }
.xi p { color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.xi p strong { color: var(--text); }
.xi-offer { background: var(--panel-2); border-radius: 10px; padding: 9px 12px; font-size: 0.92rem; }
.xi-actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 6px; }
.xi-actions a { text-decoration: none; text-align: center; }
.xi-later { font-size: 0.88rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .xi[open] { animation: none; } }

/* ---- Home: language list (aicodeall-languages-v1) ---- */
.lang-chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lang-chip { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.lang-chip:hover, .lang-chip:focus-visible { border-color: var(--accent); color: var(--accent); }

/* ===== Website Builder (website_builder.py) ============================================== */
.wb-small { font-size: 0.82rem; }
.wb-ok { color: var(--success); }
.wb-bad { color: var(--danger); }
.wb-warn { color: var(--warn); }
.sidebar-nav .nav-item.nav-website { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.nav-new {
  margin-left: auto; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff; background: var(--brand-gradient-btn); border-radius: 999px; padding: 2px 8px;
}

/* "Building a website?" call-out */
.wb-callout {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center;
  margin: 8px 0 40px; padding: 32px; border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(1,142,250,0.12) 0%, rgba(134,6,250,0.12) 100%), var(--panel);
  border: 1px solid rgba(2,102,252,0.45);
  box-shadow: 0 10px 40px rgba(2,102,252,0.12);
}
.wb-callout .wb-callout-kicker {
  display: inline-block; margin: 0 0 10px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: #fff; background: var(--brand-gradient-btn); padding: 4px 12px; border-radius: 999px;
}
.wb-callout h2 { font-size: 2rem; margin: 0 0 10px; line-height: 1.2; }
.wb-callout p { margin: 0 0 14px; color: var(--muted); font-size: 1.02rem; }
.wb-callout-points { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.wb-callout-points li { position: relative; padding-left: 26px; color: var(--text); }
.wb-callout-points li::before {
  content: "\2713"; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: #fff; background: var(--brand-gradient-btn);
}
.wb-callout-cta { display: inline-block; }
.wb-callout-note { margin: 10px 0 0 !important; }
.wb-callout-note a { color: var(--accent); }
.wbv-window { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); box-shadow: 0 14px 40px rgba(0,0,0,0.25); }
.wbv-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.wbv-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.wbv-bar em { margin-left: 8px; font: 0.72rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-style: normal; }
.wbv-body { display: grid; grid-template-columns: 1fr 1.1fr; min-height: 190px; }
.wbv-code { padding: 14px 12px; background: #0b1220; display: flex; flex-direction: column; gap: 4px; }
.wbv-code code { font: 0.7rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #d6e2f5; white-space: nowrap; overflow: hidden; }
.wbv-code b { color: #7fb4ff; font-weight: 400; } .wbv-code i { color: #c79bff; font-style: normal; } .wbv-code s { color: #7ee2b8; text-decoration: none; }
.wbv-site { padding: 10px; background: #fdf8f1; display: flex; flex-direction: column; gap: 8px; }
.wbv-nav { display: flex; gap: 6px; justify-content: flex-end; }
.wbv-nav span { width: 22px; height: 5px; border-radius: 3px; background: #c9b59a; }
.wbv-hero { border-radius: 8px; padding: 14px 10px; background: linear-gradient(135deg, #8a5a2b, #c98b4b); color: #fff; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.wbv-hero strong { font-size: 0.86rem; } .wbv-hero span { font-size: 0.66rem; opacity: 0.9; }
.wbv-hero em { margin-top: 4px; font-style: normal; font-size: 0.62rem; font-weight: 700; background: #fff; color: #8a5a2b; padding: 2px 8px; border-radius: 999px; }
.wbv-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wbv-cards span { height: 34px; border-radius: 6px; background: #efe3d2; }
@media (max-width: 860px) {
  .wb-callout { grid-template-columns: 1fr; padding: 24px 20px; gap: 22px; }
  .wb-callout h2 { font-size: 1.6rem; }
}

/* Builder home */
.wb-page h1 { margin-top: 4px; }
.wb-kicker { margin: 0; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.wb-hero-card { border-color: rgba(2,102,252,0.4); }
.wb-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.wb-span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .wb-form-grid { grid-template-columns: 1fr; } }
.wb-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.wb-progress { margin: 12px 0 0; }
.wb-site-list, .wb-conn-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.wb-site-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--text); text-decoration: none; }
.wb-site-link:hover { border-color: var(--accent); }
.wb-conn { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--panel-2); }
.wb-conn-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.wb-conn-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 8px; }
.wb-conn-edit { flex-basis: auto; }
.wb-conn-edit[open] { flex-basis: 100%; }
.wb-conn-edit > summary, .wb-add-conn > summary, .wb-import > summary { list-style: none; display: inline-block; cursor: pointer; }
.wb-conn-edit > summary::-webkit-details-marker, .wb-add-conn > summary::-webkit-details-marker, .wb-import > summary::-webkit-details-marker { display: none; }
.wb-conn-form { margin-top: 12px; padding: 14px; border: 1px dashed var(--border); border-radius: 10px; background: var(--panel); }
.wb-conn-result { margin: 8px 0 0; overflow-wrap: anywhere; }
.wb-more { margin: 0 0 12px; }
.wb-more > summary { cursor: pointer; color: var(--accent); font-size: 0.85rem; margin-bottom: 10px; }
label.check { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); }
label.check input { margin-top: 3px; }
.hint-inline { display: block; margin-top: 4px; font-size: 0.78rem; }
.wb-import, .wb-add-conn { margin-top: 10px; }
.wb-import form { margin-top: 12px; }

/* Editor */
.wb-editor { max-width: none; }
.wb-topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 14px; }
.wb-back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.wb-name { flex: 1 1 220px; max-width: 420px; font-size: 1.15rem; font-weight: 700; margin: 0; }
.wb-topbar-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.wb-topbar-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.wb-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .wb-split { grid-template-columns: 1fr; } }
.wb-pane { min-width: 0; }
.wb-preview-pane { position: sticky; top: 76px; }
@media (max-width: 1100px) { .wb-preview-pane { position: static; } }
.wb-preview-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.wb-inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.wb-inline select { width: auto; max-width: 220px; margin: 0; }
.wb-devices { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.wb-device { background: var(--panel-2); color: var(--muted); border: 0; border-radius: 0; padding: 6px 10px; font-size: 0.78rem; cursor: pointer; }
.wb-device + .wb-device { border-left: 1px solid var(--border); }
.wb-device.active { background: var(--accent); color: #fff; }
.wb-frame-wrap { border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); overflow: hidden; height: min(72vh, 760px); min-height: 360px; display: flex; justify-content: center; }
.wb-frame-box { position: relative; overflow: hidden; flex: 0 0 auto; max-width: 100%; box-shadow: 0 6px 24px rgba(0,0,0,0.18); }
#wb-frame { position: absolute; top: 0; left: 0; border: 0; background: #fff; display: block; transform-origin: 0 0; }
.wb-console { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.wb-console > summary { cursor: pointer; padding: 8px 12px; font-size: 0.85rem; color: var(--muted); }
.wb-console-list { margin: 0; padding: 4px 12px 10px 32px; max-height: 180px; overflow: auto; font: 0.76rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.wb-console-list li { overflow-wrap: anywhere; }
.wb-console-error { color: var(--danger); } .wb-console-warn { color: var(--warn); }
.wb-file-tabs { margin-top: 0; }
.wb-file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 8px; }
.wb-live { margin: 0 0 0 auto; }
.wb-code {
  width: 100%; min-height: 420px; height: 52vh; margin: 0; tab-size: 2; white-space: pre; overflow: auto;
  font: 0.82rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: #0b1220; color: #d6e2f5; border-color: var(--border);
}
.wb-ask { margin: 14px 0 0; padding: 16px; }
.wb-ask label { color: var(--text); margin-bottom: 8px; }
.wb-ask textarea { font-family: inherit; }
#wb-refine-summary { margin: 10px 0 0; }
.wb-publish { margin-top: 20px; }
.wb-publish-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.wb-log { margin: 10px 0; padding: 10px 12px 10px 32px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); max-height: 240px; overflow: auto; font: 0.78rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.wb-history { margin: 8px 0 14px; }
.wb-history summary { cursor: pointer; color: var(--muted); }
.wb-servers { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.wb-delete-site { margin-top: 18px; text-align: right; }

/* Public intro page */
.wb-landing-hero h1 { font-size: 2.4rem; }
.wb-grad { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.wb-list { padding-left: 1.2em; line-height: 1.8; max-width: 760px; margin: 0 auto; }
.wb-faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.wb-faq details { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: var(--panel); }
.wb-faq summary { cursor: pointer; font-weight: 600; }
.wb-faq p { margin: 10px 0 0; color: var(--muted); }
@media (max-width: 640px) { .wb-landing-hero h1 { font-size: 1.8rem; } .wb-code { min-height: 320px; } }
.wb-page .muted a, .wb-publish .muted a, .wb-servers .muted a { color: var(--accent); }

/* ===== Website templates (site_templates.py) ============================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tpl-hero { text-align: center; max-width: 780px; margin: 8px auto 24px; }
.tpl-hero h1 { font-size: 2.2rem; margin: 6px 0 12px; }
.tpl-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 24px; }
.tpl-chip { background: var(--panel); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.tpl-chip:hover { color: var(--text); border-color: var(--accent); }
.tpl-chip.active { background: var(--brand-gradient-btn); color: #fff; border-color: transparent; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 22px; }
.tpl-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.tpl-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.18); }
.tpl-card[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tpl-card, .tpl-card:hover { transition: none; transform: none; } }
.tpl-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.tpl-thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; transform: scale(var(--tpl-scale, 0.25)); pointer-events: none; background: #fff; }
.tpl-thumb-shade { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(11,18,32,0); transition: background 0.2s; }
.tpl-thumb-shade span { opacity: 0; color: #fff; font-weight: 700; font-size: 0.9rem; padding: 8px 16px; border-radius: 999px; background: var(--brand-gradient-btn); transition: opacity 0.2s; }
.tpl-thumb:hover .tpl-thumb-shade, .tpl-thumb:focus-visible .tpl-thumb-shade { background: rgba(11,18,32,0.35); }
.tpl-thumb:hover .tpl-thumb-shade span, .tpl-thumb:focus-visible .tpl-thumb-shade span { opacity: 1; }
.tpl-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tpl-cat { margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tpl-card h3 { margin: 0; font-size: 1.1rem; }
.tpl-card h3 a { color: var(--text); text-decoration: none; }
.tpl-card h3 a:hover { color: var(--accent); }
.tpl-desc { margin: 0; font-size: 0.92rem; }
.tpl-features { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-features li { font-size: 0.75rem; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.tpl-card-body .wb-small { margin: 0; }
.tpl-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.tpl-card-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.tpl-grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tpl-bottom { text-align: center; margin: 36px auto 8px; max-width: 720px; }
.tpl-bottom h2 { margin-top: 0; }

.tpl-detail-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: end; margin: 10px 0 18px; }
.tpl-detail-head h1 { margin: 4px 0 8px; font-size: 2rem; }
.tpl-detail-head p { margin: 0; }
.tpl-facts { list-style: none; padding: 14px 16px; margin: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); display: grid; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.tpl-facts strong { color: var(--text); }
@media (max-width: 860px) { .tpl-detail-head { grid-template-columns: 1fr; } }
.tpl-frame-wrap { height: min(70vh, 720px); }
#tpl-frame { position: absolute; top: 0; left: 0; border: 0; background: #fff; display: block; transform-origin: 0 0; }
.tpl-live .wb-small { margin: 8px 0 0; }
.tpl-use { margin: 26px 0; }
.tpl-use-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .tpl-use-grid { grid-template-columns: 1fr; } }
.tpl-use-card h3 { margin-top: 0; }
.tpl-personalize { border-color: rgba(2,102,252,0.45); }
.tpl-signup { text-align: center; }
.tpl-signup .btn-primary, .tpl-signup .btn-secondary { display: inline-block; margin: 6px 4px; text-decoration: none; }
.tpl-more h2 { font-size: 1.3rem; }
.wb-tpl-strip { margin-bottom: 20px; }
.wb-tpl-strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wb-tpl-strip-head h2 { margin: 0; }
.wb-tpl-strip .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; margin-top: 14px; }
.wb-tpl-strip .tpl-card-body { padding: 10px 12px 12px; }
.wb-tpl-strip .tpl-card h3 { font-size: 0.95rem; }
.wb-callout-alt { margin-left: 14px; color: var(--accent); font-weight: 600; }

/* Visual builder entry on the Website Builder home */
.wb-visual-card { border-color: rgba(2,102,252,0.5); background: linear-gradient(135deg, rgba(1,142,250,0.10), rgba(134,6,250,0.10)), var(--panel); }
.wb-visual-card h1 { margin: 4px 0 10px; }
.wb-visual-points { margin: 0 0 18px; padding-left: 1.2em; color: var(--text); line-height: 1.7; }
.wb-visual-card .btn-lg { display: inline-block; text-decoration: none; }
.wb-hero-card h2 { margin: 4px 0 10px; }
.wb-kind { font-size: 0.68rem; vertical-align: middle; margin-left: 6px; }
