*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #08080e;
  color: #c8d8f0;
}

:root {
  /* Tell the browser this is a dark UI so native controls (dropdown lists,
     scrollbars, date pickers) render dark instead of OS-default white. */
  color-scheme: dark;
  --bg: #08080e;
  --bg-alt: #0c0c16;
  --surface: rgba(96,165,250,.05);
  --surface-hover: rgba(96,165,250,.10);
  --glass: rgba(96,165,250,.06);
  --glass-border: rgba(96,165,250,.12);
  --sidebar-bg: rgba(8,8,14,.95);
  --sidebar-border: rgba(96,165,250,.08);
  --text: #c8d8f0;
  --text-muted: rgba(200,216,240,.4);
  --heading: #e8f0ff;
  --accent: #60a5fa;
  --accent2: #93c5fd;
  --accent3: #3b82f6;
  --success: #6ee7b7;
  --warning: #fde68a;
  --danger: #fca5a5;
  --glow: rgba(96,165,250,.2);
  --glow2: rgba(147,197,253,.12);
  --gradient-1: linear-gradient(135deg, #60a5fa, #93c5fd);
  --gradient-2: linear-gradient(135deg, #3b82f6, #60a5fa);
  --gradient-text: linear-gradient(135deg, #60a5fa, #93c5fd, #3b82f6);
  --glow-text: 0 0 40px rgba(96,165,250,.25);

  /* Spacing / radius / motion scale — shared rhythm so pages stop hand-picking
     one-off values. See foundations.css for the components built on top of these. */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 48px;
  --radius-sm: 8px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 20px; --radius-pill: 999px;
  --ease-standard: cubic-bezier(.4,0,.2,1);
  --dur-fast: .18s; --dur-base: .22s; --dur-slow: .25s;
  --shadow-panel: 0 8px 32px rgba(0,0,0,.35);

  /* Tint tokens — formalize the hand-picked rgba() alpha variants of the
     brand colors that were scattered across landing.css/auth.css/etc. */
  --accent-tint-08: rgba(96,165,250,.08);
  --accent-tint-12: rgba(96,165,250,.12);
  --accent-tint-30: rgba(96,165,250,.3);
  --success-tint: rgba(110,231,183,.1);
  --warning-tint: rgba(253,230,138,.1);
  --danger-tint: rgba(252,165,165,.1);
}

.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.mesh-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}
.mesh-bg .orb:nth-child(1) {
  width: 600px; height: 600px;
  background: rgba(96,165,250,.06);
  top: -15%; left: -10%;
  animation: floatOrb1 20s ease-in-out infinite;
}
.mesh-bg .orb:nth-child(2) {
  width: 500px; height: 500px;
  background: rgba(147,197,253,.04);
  bottom: -10%; right: -5%;
  animation: floatOrb2 25s ease-in-out infinite;
}
.mesh-bg .orb:nth-child(3) {
  width: 400px; height: 400px;
  background: rgba(59,130,246,.02);
  top: 40%; left: 50%;
  animation: floatOrb3 18s ease-in-out infinite;
}
.mesh-bg .grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--glass-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .25;
}
.no-grid-bg .grid-overlay {
  display: none;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.1); }
  66% { transform: translate(-40px, 100px) scale(.95); }
}
@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -80px) scale(1.15); }
  66% { transform: translate(50px, -40px) scale(.9); }
}
@keyframes floatOrb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -50px) scale(1.05); }
  66% { transform: translate(-60px, 30px) scale(.95); }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(96,165,250,.12);
  border-radius: 3px;
  transition: background .35s ease;
}
::-webkit-scrollbar-thumb:hover { background: rgba(96,165,250,.25); }

::selection {
  background: rgba(96,165,250,.3);
  color: #fff;
}

/* Every dropdown on the site is styled dark, but the popup list of options
   still uses the OS palette on some platforms — force it dark globally so
   light text never lands on a white list background. */
select option,
select optgroup {
  background-color: var(--bg-alt);
  color: var(--text);
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  background: var(--gradient-1);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(96,165,250,.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s ease;
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 32px;
  background: rgba(8,8,14,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.app-logo {
  width: 120px;
  height: auto;
  display: block;
}

.app-header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-header-nav a {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s ease;
  font-family: 'Inter', sans-serif;
}

.app-header-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.navbar-user {
  cursor: pointer;
  border: none;
  padding: 0;
}

.navbar-user.is-active {
  box-shadow: 0 0 0 3px var(--accent-tint-30);
}

/* ── Account popover menu ── */
.lx-account { position: relative; }

.lx-account-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 360px;
  background: rgba(12,12,22,.98);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(96,165,250,.04);
  backdrop-filter: blur(24px);
  padding: 14px;
  z-index: 200;
  animation: lxAccPop .16s var(--ease-standard);
  transform-origin: top right;
}

@keyframes lxAccPop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lx-account-menu::before {
  content: '';
  position: absolute;
  top: -6px; right: 14px;
  width: 12px; height: 12px;
  background: rgba(12,12,22,.98);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
  transform: rotate(45deg);
}

.lx-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--glass-border);
}

.lx-account-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-1);
  color: #08080e;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  flex-shrink: 0;
}

.lx-account-idblock { min-width: 0; }

.lx-account-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.lx-plan-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  background: var(--surface);
}
.lx-plan-badge.lx-plan-starter {
  color: var(--accent2);
  border-color: var(--accent-tint-30);
  background: var(--accent-tint-12);
}
.lx-plan-badge.lx-plan-pro {
  color: #08080e;
  border-color: transparent;
  background: var(--gradient-1);
}
/* The trial reads as a countdown, not a tier — amber, so it never looks like
   one of the paid badges above. */
.lx-plan-badge.lx-plan-trial {
  color: #fcd34d;
  border-color: rgba(251,191,36,.3);
  background: rgba(251,191,36,.1);
}

/* ── Free-trial countdown strip (account menu) ──
   The 90-day window is a cap with no usage bar of its own, so it gets one
   here: the meter fills as the trial ELAPSES (unlike the usage bars below,
   which fill as quota is spent — same direction of "running out", so the two
   read consistently). */
.lx-trial-strip {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(251,191,36,.22);
  background: linear-gradient(180deg, rgba(251,191,36,.08), rgba(251,191,36,.03));
}
.lx-trial-strip .lx-usage-track { background: rgba(251,191,36,.14); }
.lx-trial-strip .lx-usage-track i { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.lx-trial-strip.is-warn { border-color: rgba(251,146,60,.35); }
.lx-trial-strip.is-over {
  border-color: rgba(239,68,68,.4);
  background: linear-gradient(180deg, rgba(239,68,68,.1), rgba(239,68,68,.03));
}
.lx-trial-strip.is-over .lx-usage-track { background: rgba(239,68,68,.16); }
.lx-trial-strip.is-over .lx-usage-track i { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.lx-trial-strip.is-over .lx-trial-days,
.lx-trial-strip.is-over .lx-trial-label { color: #fca5a5; }

.lx-trial-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.lx-trial-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fcd34d;
}
.lx-trial-label svg { width: 12px; height: 12px; }
.lx-trial-days {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lx-trial-cta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fcd34d;
  text-decoration: none;
}
.lx-trial-cta:hover { color: #fde68a; }
.lx-trial-cta svg { width: 12px; height: 12px; }
.lx-trial-strip.is-over .lx-trial-cta { color: #fca5a5; }
.lx-trial-strip.is-over .lx-trial-cta:hover { color: #fecaca; }

.lx-account-usage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 0;
}

.lx-usage-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 9px 8px;
  min-width: 0;
  /* Only the public card carries a daily sub-line; the column keeps every
     card's tag on the same baseline so the row doesn't look ragged. */
  display: flex;
  flex-direction: column;
}

.lx-usage-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 8px;
}

.lx-usage-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

.lx-usage-num {
  font-size: 10.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lx-usage-num b {
  font-size: 12.5px;
  color: var(--heading);
  font-weight: 700;
}

.lx-usage-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(96,165,250,.12);
  overflow: hidden;
}
.lx-usage-track i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gradient-1);
  transition: width .35s var(--ease-standard);
}
.lx-usage-track i.is-high { background: linear-gradient(135deg, #fde68a, #fbbf24); }
/* At 100% the bar fills a deep "bloody" red — a hard visual stop. */
.lx-usage-track i.is-full {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 0 8px rgba(220, 38, 38, .55);
}

/* Daily throttle readout under the public-chats bar (trial only). */
.lx-usage-sub {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lx-usage-sub span { color: var(--heading); }
.lx-usage-sub.is-full,
.lx-usage-sub.is-full span { color: #f87171; }

.lx-usage-tag {
  margin-top: auto;
  padding-top: 7px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: .7;
}
.lx-usage-alert {
  color: #f87171;
  font-weight: 700;
  opacity: 1;
}

/* ── Account-on-hold banner (over plan limits after a downgrade) ──
   Fixed, deliberately OUT of document flow: it never shifts the header or any
   page below it, so pages that size sections off calc(100vh - Npx) (workflow
   canvas, widget preview, the new-project wizard) never overflow/clip just
   because this banner is showing. To keep the header (and everything else)
   fully clickable while it's up, it's sized to its own content — a floating
   pill anchored just under the header, not a full-width/full-height overlay
   — so pointer events everywhere else on the page pass straight through. Its
   `top` comes from --lx-header-h, measured off the real header at render
   time (see the inline script right after this block) with a safe fallback
   for the instant before that script runs. */
.lx-hold-banner {
  position: fixed;
  top: calc(var(--lx-header-h, 64px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  width: max-content;
  max-width: min(640px, calc(100vw - 32px));
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(127,29,29,.62), rgba(127,29,29,.5));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(239,68,68,.4);
  box-shadow: 0 8px 28px rgba(0,0,0,.32);
}
.lx-hold-inner {
  padding: 11px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--heading);
}
.lx-hold-ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #f87171;
  margin-top: 2px;
}
.lx-hold-body { min-width: 0; }
.lx-hold-line b { color: #fca5a5; }
.lx-hold-line a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lx-hold-line a:hover { color: #fecaca; }
.lx-hold-toggle {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  color: rgba(255,255,255,.65);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.lx-hold-toggle:hover { color: #fff; }
.lx-hold-toggle svg { width: 12px; height: 12px; transition: transform .15s ease; }
.lx-hold-toggle.is-open svg { transform: rotate(180deg); }
.lx-hold-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: rgba(255,255,255,.8);
  font-size: 12px;
}
.lx-hold-list li { margin: 1px 0; }

/* Live "resolved" state — toggled by account_cleanup.js while enough items
   are selected to clear every violation, so the same persistent banner
   doubles as the page's status readout instead of a separate widget. */
.lx-hold-banner.is-resolved {
  background: linear-gradient(180deg, rgba(6,78,59,.68), rgba(6,78,59,.56));
  border-color: rgba(110,231,183,.45);
}
.lx-hold-banner.is-resolved .lx-hold-ic { color: var(--success); }
.lx-hold-banner.is-resolved .lx-hold-line b,
.lx-hold-banner.is-resolved .lx-hold-line strong { color: var(--success); }

/* ── "Setup changed → start a new chat" banner (playground) ── */
.lx-refresh-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 14px 4px;
  padding: 9px 12px;
  border-radius: var(--radius-md, 10px);
  background: rgba(96, 165, 250, .1);
  border: 1px solid rgba(96, 165, 250, .28);
  color: var(--heading);
  font-size: 12.5px;
  line-height: 1.35;
  animation: lxRefreshIn .25s var(--ease-standard, ease);
}
.lx-refresh-banner > span { flex: 1; }
.lx-refresh-banner-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  border: none;
  border-radius: var(--radius-pill, 999px);
  background: var(--gradient-1, linear-gradient(135deg, #60a5fa, #3b82f6));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.lx-refresh-banner-btn:hover { filter: brightness(1.08); }
.lx-refresh-banner-x {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.lx-refresh-banner-x:hover { color: var(--heading); background: rgba(255, 255, 255, .06); }
@keyframes lxRefreshIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lx-account-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.lx-account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast);
}
.lx-account-btn svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.lx-account-btn:hover { background: var(--surface-hover); color: var(--accent); }
.lx-account-btn-danger:hover { background: var(--danger-tint); color: var(--danger); }

/* ── Legal links footer inside the account menu (Privacy/Terms) — kept
   visually secondary to Profile/Plans/Sign Out so it reads as fine print,
   not another primary action. ── */
.lx-account-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
}
.lx-account-legal a {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--dur-fast) var(--ease-standard);
}
.lx-account-legal a:hover { color: var(--accent); }
.lx-account-legal-dot { color: var(--text-muted); opacity: .5; font-size: 11px; }

@media (max-width: 480px) {
  .lx-account-menu { width: calc(100vw - 32px); right: -8px; }
}

/* ── Help (?) button + FAQ modal (all dashboard pages) ── */
.lx-help-trigger {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  flex-shrink: 0;
}
.lx-help-trigger:hover,
.lx-help-trigger[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent-tint-30);
  background: var(--accent-tint-12);
}

.lx-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(4,4,10,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lxHelpFade .15s ease;
}
/* The [hidden] attribute is how JS opens/closes this — without this rule,
   the display:flex above (an author style) outranks the UA [hidden]
   stylesheet rule and the modal stays visible at all times. */
.lx-help-overlay[hidden] { display: none; }
@keyframes lxHelpFade { from { opacity: 0; } to { opacity: 1; } }

.lx-help-modal {
  width: 100%;
  max-width: 560px;
  max-height: min(680px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: rgba(12,12,22,.98);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(96,165,250,.04);
  backdrop-filter: blur(24px);
  animation: lxAccPop .16s var(--ease-standard);
}

.lx-help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.lx-help-title { font-size: 16px; font-weight: 700; color: var(--heading); }
.lx-help-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.lx-help-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}
.lx-help-close:hover { color: var(--text); background: var(--surface-hover); }

.lx-help-body {
  overflow-y: auto;
  padding: 10px 14px 16px;
}

.lx-help-item {
  border-bottom: 1px solid var(--glass-border);
}
.lx-help-item:last-child { border-bottom: none; }

.lx-help-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 8px;
  background: none;
  border: none;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
}
.lx-help-q svg {
  width: 15px; height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .15s ease;
}
.lx-help-item.is-open .lx-help-q svg { transform: rotate(180deg); color: var(--accent); }

/* Smooth expand/collapse without a hardcoded max-height: the outer element's
   single grid row animates between 0fr (collapsed) and 1fr (fits content),
   while the inner wrapper clips overflow and fades in with it. */
.lx-help-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s var(--ease-standard);
}
.lx-help-item.is-open .lx-help-a { grid-template-rows: 1fr; }
.lx-help-a-inner {
  overflow: hidden;
  opacity: 0;
  transition: opacity .18s ease;
}
.lx-help-item.is-open .lx-help-a-inner { opacity: 1; transition: opacity .25s ease .06s; }
.lx-help-a-inner > p:first-child { margin-top: 0; }
.lx-help-a-inner { padding: 0 8px 15px; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.lx-help-a strong { color: var(--text); }
.lx-help-a code {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent2);
}

.lx-help-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
}
.lx-help-key-row code {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  overflow-x: auto;
  white-space: nowrap;
}
.lx-help-key-copy {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.lx-help-key-copy:hover { border-color: var(--accent-tint-30); color: var(--accent); }

.lx-help-key-script {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre;
}

@media (max-width: 480px) {
  .lx-help-overlay { padding: 12px; }
  .lx-help-key-row { flex-direction: column; align-items: stretch; }
}

/* ── "Widgets paused" quota banner (dashboard) ── */
.lx-widgets-paused {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  background: var(--danger-tint);
  border: 1px solid rgba(252,165,165,.28);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
}
.lx-widgets-paused svg {
  width: 20px; height: 20px;
  color: var(--danger);
  flex-shrink: 0;
}
.lx-widgets-paused strong { color: var(--danger); }
.lx-widgets-paused a { color: var(--accent); font-weight: 600; text-decoration: none; }
.lx-widgets-paused a:hover { text-decoration: underline; }

.navbar-user {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: opacity .2s;
  flex-shrink: 0;
}

.navbar-user:hover {
  opacity: .8;
}

.navbar-user-initials {
  line-height: 1;
}

.navbar-login {
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  text-decoration: none;
  transition: all .2s ease;
  font-family: 'Inter', sans-serif;
}

.navbar-login:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.navbar-link {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s ease;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.navbar-link:hover {
  color: var(--text);
  background: var(--surface);
}

/* ── Shared toast notifications (window.lxToast) ── */
.lx-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 48px));
  pointer-events: none;
}
.lx-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(12, 12, 22, .92);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
}
.lx-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.lx-toast.hide { opacity: 0; transform: translateY(6px) scale(.98); }
.lx-toast-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.lx-toast-icon svg { width: 18px; height: 18px; display: block; }
.lx-toast-body { flex: 1 1 auto; min-width: 0; }
.lx-toast-title { font-weight: 600; color: var(--heading); margin-bottom: 2px; }
.lx-toast-msg { color: var(--text); word-break: break-word; }
.lx-toast-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  line-height: 1;
  font-size: 16px;
  transition: color .15s ease;
}
.lx-toast-close:hover { color: var(--text); }
.lx-toast-success { border-left: 3px solid var(--success); }
.lx-toast-success .lx-toast-icon { color: var(--success); }
.lx-toast-error { border-left: 3px solid var(--danger); }
.lx-toast-error .lx-toast-icon { color: var(--danger); }
.lx-toast-warning { border-left: 3px solid var(--warning); }
.lx-toast-warning .lx-toast-icon { color: var(--warning); }
.lx-toast-info { border-left: 3px solid var(--accent); }
.lx-toast-info .lx-toast-icon { color: var(--accent); }

/* ── Shared confirm modal (window.lxConfirm) ── */
.lx-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 10, .6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .18s ease;
}
.lx-confirm-overlay.show { opacity: 1; }
.lx-confirm {
  width: min(420px, calc(100vw - 40px));
  background: rgba(12, 12, 22, .98);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
  padding: 22px 22px 18px;
  font-family: 'Inter', sans-serif;
  transform: translateY(10px) scale(.98);
  transition: transform .18s ease;
}
.lx-confirm-overlay.show .lx-confirm { transform: translateY(0) scale(1); }
.lx-confirm-title { font-size: 16px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.lx-confirm-msg { font-size: 14px; line-height: 1.5; color: var(--text); margin-bottom: 20px; }
.lx-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.lx-confirm-btn {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.lx-confirm-btn:hover { background: var(--surface-hover); border-color: var(--accent); }
.lx-confirm-btn-primary { border-color: transparent; background: var(--accent); color: #08080e; }
.lx-confirm-btn-primary:hover { background: var(--accent2); border-color: transparent; }
.lx-confirm-btn-danger { border-color: rgba(252, 165, 165, .4); background: rgba(252, 165, 165, .12); color: var(--danger); }
.lx-confirm-btn-danger:hover { background: rgba(252, 165, 165, .2); border-color: var(--danger); color: var(--danger); }
.lx-confirm-btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.lx-confirm-input-wrap { margin: -6px 0 20px; }
.lx-confirm-input-label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.lx-confirm-input-label code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  color: var(--danger);
  background: rgba(252, 165, 165, .1);
  padding: 1px 6px;
  border-radius: 5px;
}
.lx-confirm-input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--heading);
  outline: none;
  transition: border-color .15s ease;
}
.lx-confirm-input:focus { border-color: var(--accent); }
