/* ==========================================================================
   DataForge AI — Design system · Amber Accent Variant
   --------------------------------------------------------------------------
   Palette (exact tokens — see color_change.md):
    bg #0A0A0A · surface #12151C · border #1F2430 · text #E5E4E2 · secondary #6B7A8A
   accent #F0A020 (single amber accent: primary action + token/success state)
   red #ef4444 (errors only)
   Kode Mono = all typography (UI + mono)
   Radii: 6px everywhere · 1px hairline borders throughout
   ========================================================================== */

:root {
  --ink: #0a0a0a;
  --steel: #12151c;
  --slate: #1f2430;
  --muted: #6b7a8a;
  --dim: #3e4552;
  --white: #e5e4e2;
  --blue: #f0a020;
  --blue-hover: #FFBA3D; /* matches workspace button hover */
  --blue-light: #f0a020;
  --accent-hover: #FFBA3D; /* unified hover for all amber-filled buttons (matches workspace) */
  --accent-active: #D4901E; /* unified active for all amber-filled buttons (matches workspace) */
  --blue-glow: rgba(240, 160, 32, 0.14);
  --emerald: #10b981; /* success / healthy state (fixes v2) */
  --amber: #f59e0b; /* warnings only (fixes v2) */
  --amber-hover: #fbbf24; /* slightly brighter amber on hover, for the in-panel auth switch button */
  --on-accent: #14100a;
  --red: #ef4444;

  --bg-hover: rgba(107, 114, 128, 0.08);
  --radius-sm: 6px;
  --radius-md: 6px;
  --radius-lg: 6px;

  /* ---------- Motion ----------
     Two tiers cover every hover / toggle / panel transition. The durations are
     the values already dominant in this file (150ms and 200ms) rather than new
     inventions. Longer, deliberate animations — entrance reveals, progress
     fills, the button sheen — keep their own timing on purpose; don't fold them
     into these tokens. */
  --transition-fast: 150ms ease-out;
  --transition-modal: 200ms ease-in-out;

  --font-sans:
    "Kode Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --font-mono:
     "Kode Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas,
    monospace;

  --navbar-h: 52px;
  --tabbar-h: 40px;
  --sidebar-w: 260px;
}


  --lp-bg: #0a0a0c;
  --lp-surface: #0d0d10;
  --lp-line: #27272a;
  --lp-text: #e5e4e2;
  --lp-muted: #8b949e;
  --lp-accent: #f0a020;
  --lp-green: #10b981;
/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must stay authoritative: component rules such as
   .btn { display: inline-flex } are author styles and outrank the UA's
   [hidden] rule, which would leave a "hidden" button visible. */
[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}

::selection {
  background: rgba(240, 160, 32, 0.4);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid rgba(240, 160, 32, 0.6);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}
.mono {
  font-family: var(--font-mono);
}
.dim {
  color: var(--muted);
}
.accent {
  color: var(--blue-light);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--slate);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #2a3140;
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Brand ---------- */

.brand {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--white);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
  margin-right: 2px;
}

.brand-accent {
  color: var(--blue-light);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}
.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-primary:active {
  background: var(--accent-active);
  border-color: var(--accent-active);
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--slate);
  color: var(--white);
}
/* Ghost hover is border-only — no fill change, no shadow. */
.btn-ghost:hover {
  border-color: var(--accent-hover);
}

/* Focus is an outline, never a shadow, on every button surface. 2px rather
   than the spec's 1px: a 1px ring on a dark fill is close to invisible, which
   defeats the point of having one. */
.btn:focus-visible,
.ai-inspect-actions .btn:focus-visible,
.settings-btn-primary:focus-visible,
.settings-plan-btn:focus-visible,
.settings-btn-amber:focus-visible,
.settings-btn-ghost:focus-visible,
.tm-upgrade:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .tm-upgrade,
  .landing .btn-primary,
  .settings-btn-primary,
  .settings-plan-btn,
  .inspect-popup-signup {
    transition: none !important;
  }
}

.btn-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--red);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
  border-radius: var(--radius-sm);
}
.btn-block {
  width: 100%;
}

/* One-time shimmer sweep on the landing "Get started free" CTAs: a light
   diagonal pass in accent tones (never white), 1.2s, runs once per page load.
   The blanket reduced-motion rule collapses it to an imperceptible flash. */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 55%;
  background: linear-gradient(
    100deg,
    transparent 15%,
    rgba(242, 172, 60, 0.55) 50%,
    transparent 85%
  );
  transform: translateX(-160%) skewX(-18deg);
  animation: btn-shimmer-sweep 1.2s ease-out 0.35s 1 both;
  pointer-events: none;
}
@keyframes btn-shimmer-sweep {
  to {
    transform: translateX(340%) skewX(-18deg);
  }
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}
.btn[disabled]:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: none;
}

/* ---------- Tags / pills ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Single-accent system: .tag-blue / .tag-green now render amber */
.tag-blue {
  color: var(--blue-light);
  background: var(--blue-glow);
}
.tag-gray {
  color: var(--muted);
  background: rgba(107, 114, 128, 0.12);
}
.tag-amber {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.14);
}
.tag-green {
  color: var(--emerald);
  background: var(--blue-glow);
}

/* Column type tags — semantic colors (fixes v1: N blue / T gray / D amber / B green) */
.type-tag {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.tt-blue {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.35);
}
.tt-gray {
  color: #9ca3af;
  background: rgba(107, 114, 128, 0.2);
  border: 1px solid rgba(107, 114, 128, 0.3);
}
.tt-amber {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.tt-green {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green {
  background: var(--emerald);
}

/* Low-token warning: amber, stronger signal via pulsing dot */
.dot-amber {
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
  animation: dot-pulse 1.6s ease-out infinite;
}

@keyframes dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
  }
  70% {
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.dot-red {
  background: var(--red);
}

/* ---------- Cards / panels ---------- */

.panel-card {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 16px;
}

.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.panel-card-sub {
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Toasts ---------- */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000; /* above settings modal (9998/9999) so toasts stay visible */
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast .t-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast.ok .t-dot {
  background: var(--emerald);
}
.toast.err {
  border: 1px solid #5a2428;
  background: #2c1618;
}
.toast.err .t-dot {
  background: #ef4444;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: none;
}
.toast.info .t-dot {
  background: var(--blue-light);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.out {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity var(--transition-modal),
    transform var(--transition-modal);
}

/* ==========================================================================
   LANDING
   ========================================================================== */

.landing {
  position: relative;
  height: 100%;
  overflow-y: auto;
  /* .landing is the scroll container on this page (body is overflow:hidden).
     Phones get one explicit guard: nothing in the sections below may widen
     the scroller sideways — verified at iPhone 12/13/14 width (390px). */
  overflow-x: hidden;
  background: var(--ink);
  scroll-behavior: smooth;
}

/* Inside the landing page, the wrapping element owns sticky/fixed stacking.
   Other pages (docs/privacy/terms/help) render .landing-nav directly. */
.landing .landing-nav {
  position: static;
  /* Always-pill header (scoped to the landing page wrapper) */
  pointer-events: auto;
  width: 100%;
  max-width: min(720px, calc(100vw - 32px));
  margin: 16px auto 0;
  height: 56px;
  padding: 0 20px 0 24px;
  border-radius: 9999px;
  background: rgba(24, 24, 27, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(39, 39, 42, 0.9);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  contain: layout style;
  will-change: max-width;
  transition: max-width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 1025px) {
  .landing .landing-nav {
    max-width: min(960px, calc(100vw - 32px));
  }
}

.landing .landing-nav-inner {
  max-width: none;
  padding: 0;
  justify-content: center;
  gap: 0;
}
/* Logo + nav travel together as one group; buttons slide in beside them. */
.landing .brand-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
/* Inside the landing header, links stay with the logo instead of pushing
   the CTA to the far edge — the header centers the whole group. */
.landing .landing-links {
  margin-right: 0;
}

/* Outer fixed container handles the footer fade (transform + opacity, 260ms) */
.landing-header-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px; /* 16px gap + 56px pill */
  pointer-events: none;
  z-index: 50;
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.landing-header-wrap.header-hidden {
  transform: translateY(-100%) scaleY(0.98);
  opacity: 0;
  pointer-events: none;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--navbar-h);
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: rgba(11, 14, 20, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
  border-bottom: 0.5px solid transparent;
  box-shadow: none;
  transition:
    background var(--transition-modal),
    border-color var(--transition-modal),
    height var(--transition-modal);
}

@media (prefers-reduced-motion: reduce) {
  .landing-header-wrap,
  .landing-nav {
    transition: none !important;
  }
}

.landing-nav-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 40px;
}

/* Pill fix: logo and CTA must not shrink inside the narrowed nav */
.brand { min-width: 0; }
.landing-links {
  display: flex;
  gap: 24px;
  margin-right: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.landing-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  transition: color var(--transition-fast);
}

.landing-links a::before {
  content: "_";
  position: absolute;
  top: 0;
  right: calc(100% + 4px);
  font-family: var(--font-mono);
  color: var(--lp-accent);
  opacity: 0;
  transform: translateX(3px);
  pointer-events: none;
  transition:
    opacity 150ms ease-out,
    transform 150ms ease-out;
}

.landing-links a:hover::before,
.landing-links a:focus-visible::before {
  opacity: 1;
  transform: translateX(0);
}

.landing-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.landing-links a:hover::after,
.landing-links a.active::after {
  transform: scaleX(1);
}
.landing-links a:hover {
  color: var(--white);
}
.landing-links a.active {
  color: var(--white);
}

/* --- Header: Resources dropdown (click-to-open, matches account badge) --- */
.nav-dd {
  position: relative;
}
.nav-dd-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}
.nav-dd-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-dd-btn:hover,
.nav-dd-btn[aria-expanded="true"] {
  color: var(--white);
}
.nav-dd-btn:hover::after,
.nav-dd-btn[aria-expanded="true"]::after {
  transform: scaleX(1);
}
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 178px;
  padding: 6px;
  background: #161b22;
  border: 0.5px solid #21262d;
  border-radius: 6px;
  display: none;
  z-index: 60;
}
.nav-dd.open .nav-dd-menu {
  display: block;
}
.nav-dd-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 4px;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}
.nav-dd-menu a::after {
  content: none;
}
.nav-dd-menu a:hover {
  color: var(--white);
  background: var(--bg-hover);
}

.landing-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* --- Landing hamburger (<=1024px) -------------------------------------------
   The pill is centred and capped at min(720px, 100vw - 32px), so from 1024px
   down the six links + both CTAs cannot fit. Rather than overflow (or vanish
   with no way back), the links collapse into this panel. >=1025px keeps the
   untouched desktop nav. */
.landing-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px; /* 3 x 2px bars + 2 x 6px gaps = 18px tall */
  /* Pinned to the pill's right inner edge so the row reads
     logo ... Get started free, hamburger at every phone/tablet width. */
  margin-left: auto;
  flex-shrink: 0;
  width: 44px; /* 44px tap target on every breakpoint */
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}
.landing-hamburger:hover {
  background: var(--bg-hover);
}
.landing-hamburger:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.landing-hamburger span {
  display: block;
  height: 2px;
  width: 24px;
  background: currentColor;
  transition: transform 150ms ease-out, opacity 150ms ease-out;
}
.landing-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.landing-hamburger.open span:nth-child(2) { opacity: 0; }
.landing-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Anchored to .landing-header-wrap (top:100% = below the 72px wrap, i.e. just
   under the pill) so it travels with the header when the wrap slides away.
   pointer-events must be re-enabled: the wrap is pointer-events:none so the
   page stays tappable through the chrome. */
.landing-mobile-panel {
  position: fixed;
  top: 72px;
  left: 16px;
  right: 16px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: #161b22;
  border-radius: 12px;
  border: 0.5px solid #21262d;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease-out, transform 150ms ease-out, visibility 0s linear 150ms;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}
.landing-mobile-panel.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 150ms ease-out, transform 150ms ease-out, visibility 0s;
}
.landing-mobile-panel[hidden] { display: none; }
.landing-mobile-panel a {
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 0;
}
.landing-mobile-panel a:hover { color: var(--muted); }
.landing-mobile-panel a:focus-visible,
.landing-mobile-panel .btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.landing-mobile-panel hr {
  border: none;
  border-top: 1px solid rgba(39, 39, 42, 0.9);
  margin: 8px 0;
}
.landing-mobile-panel .btn {
  width: 100%;
  align-self: stretch;
  min-height: 44px;
  padding: 10px 18px;
}

@media (prefers-reduced-motion: reduce) {
  .landing-hamburger span,
  .landing-mobile-panel {
    transition: none;
  }
  .landing-mobile-panel { transform: none; }
}

@media (max-width: 1024px) {
  .landing-hamburger { display: flex; }
  /* Sign in lives in the panel on tablet — the pill keeps only the primary CTA. */
  #signInBtn { display: none; }
}
@media (max-width: 768px) {
  /* Phone: logo + hamburger only, every CTA reached through the panel. */
  .landing .landing-cta { display: none; }
}


/* ==========================================================================
   WORKSPACE MOBILE/HANDLING
   ========================================================================== */

/* Phone (<768px) - shown when /workspace loads on a phone: full-screen notice */
.app .phone-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: var(--steel);
  border-bottom: 1px solid var(--slate);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--white);
}

.app .phone-notice.open {
  display: flex;
}

.app .phone-notice .btn {
  align-self: center;
}

/* Tablet Portrait (768px - 1023px): sidebar collapses into hamburger by default,
    Before/After preview tables stack vertically */
@media (min-width: 768px) and (max-width: 1023px) {
  .app.sb-collapsed .sidebar,
  .app:not(.sb-collapsed) .sidebar {
    /* Force sidebar to collapse on tablet portrait by default */
  }
  .app .sidebar {
    /* Reduce sidebar width on tablet portrait */
    width: 200px;
  }
  /* Stack Before/After preview tables vertically to avoid side-scroll */
  .ba-grid {
    flex-direction: column !important;
  }
  .ba-card {
    width: 100% !important;
  }
  .ba-table {
    width: 100% !important;
  }
}

/* --- Nav CTA auth skeleton ----------------------------------------------
   The Sign in / Get started free buttons are auth-dependent: painting them
   before Clerk confirms the state shows a logged-out navbar to a signed-in
   visitor (the refresh flash on /). index.html ships them hidden behind this
   neutral skeleton — the same "Loading…" idea as the workspace meter — and
   script.js (revealLandingAuthCtas) swaps the real buttons in once the state
   is known. Sized to the .btn-sm buttons it stands in for. */
.landing-auth-skeleton {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.landing-auth-skeleton[hidden] {
  display: none;
}
.landing-auth-sk {
  display: block;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--steel);
  border: 1px solid var(--slate);
  animation: landingAuthPulse 1.4s ease-in-out infinite;
}
.landing-auth-sk--ghost {
  width: 72px;
}
.landing-auth-sk--primary {
  width: 148px;
}
@keyframes landingAuthPulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Token meter + session list skeletons (replace "Loading…" text) */
.tm-skel {
  display: inline-block;
  width: 72px;
  height: 12px;
  border-radius: 4px;
  background: var(--steel);
  vertical-align: middle;
  animation: landingAuthPulse 1.4s ease-in-out infinite;
}
.tm-skel--short {
  width: 44px;
}
.sb-skel-row {
  display: block;
  height: 32px;
  margin: 6px 0;
  border-radius: var(--radius-sm, 6px);
  background: var(--steel);
  animation: landingAuthPulse 1.4s ease-in-out infinite;
}

/* --- Hero --- */

.hero {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 28px 0;
  overflow: hidden;
  /* 120px top padding clears the 52px sticky nav + safety margin */
}

/* Hero-only gradient, kept subtle — never on UI chrome. Centered behind the
   product badge + workspace screenshot, using the locked glow token. */
.hero::before {
  content: "";
  position: absolute;
  top: 210px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 720px;
  background: radial-gradient(
    ellipse at center,
    var(--blue-glow),
    transparent 65%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--slate);
  border-radius: 999px;
  padding: 5px 14px;
  background: var(--steel);
  margin-bottom: 24px;
}

.hero-title {
/* --- Typewriter Animation --- */
.typewriter-hero {
  position: relative;
  margin: 0 auto;
  max-width: 940px;
  padding: 40px 20px;
}

.typewriter-container {
  position: relative;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.typewriter-state {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.typewriter-state--active {
  opacity: 1;
  transform: translateY(0);
}

.typewriter-state:not(.typewriter-state--active) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.typewriter-state--1 .typewriter-text {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--white);
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 2em;
}

.typewriter-state--1 .typewriter-cursor {
  width: 4px;
  background: var(--emerald);
  height: 1.2em;
  margin-left: 8px;
  animation: typewriterCursor 0.8s step-end infinite;
}

@keyframes typewriterCursor {
  from { opacity: 1; }
  to { opacity: 0; }
}

.typewriter-state--1 {
  animation: typewriterPrompt 4s ease forwards;
}

@keyframes typewriterPrompt {
  0% { opacity: 1; transform: translateY(0); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 0; }
}

.typewriter-state--2 {
  animation: loadingPulse 1s ease forwards,
             fade-in 0.3s ease 1s forwards;
}

@keyframes loadingPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.typewriter-state--3 {
  animation: resultReveal 2s ease forwards 2s;
}

@keyframes resultReveal {
  0% { opacity: 0; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.typewriter-cursor {
  width: 4px;
  background: var(--emerald);
  height: 1.2em;
  margin-left: 8px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0; }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.typewriter-prompt {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.typewriter-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--slate);
  border-top: 3px solid var(--emerald);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .typewriter-state {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .typewriter-state--1 .typewriter-text {
    animation: none;
    content: "Remove duplicates and format revenue as currency";
  }
  .typewriter-state--2 {
    display: none;
  }
  .typewriter-state--3 {
    opacity: 1 !important;
    transition: none;
  }
  .typewriter-spinner {
    animation: none;
    transform: none;
  }
}

  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: var(--white);
}

.hero-accent {
  color: var(--blue-light);
}

.hero-sub {
  max-width: 560px;
  margin: 20px auto 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.hero-meta {
  margin-top: 18px;
  font-size: 12px;
  color: var(--dim);
}

/* Product badge floating above the hero screenshot */
.hero-badge {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 40px auto -14px;
  padding: 6px 16px 6px 8px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 999px;
  box-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.6);
}

.hero-badge-logo {
  width: 18px;
  height: 18px;
}

.hero-badge-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--white);
}

.hero-badge-accent {
  color: var(--blue-light);
}

/* Hero workspace screenshot mockup */
.hero-shot {
  position: relative;
  margin: 0 auto;
  max-width: 940px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-lg);
  background: var(--steel);
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  transform: perspective(1100px) rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
  transition:
    transform var(--transition-modal),
    box-shadow var(--transition-modal),
    border-color var(--transition-modal);
  animation: fade-in 0.8s ease 0.45s backwards;
}

.hero-shot:hover {
  border-color: rgba(240, 160, 32, 0.45);
  box-shadow:
    0 34px 80px -26px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(240, 160, 32, 0.14);
}

/* --- Before/After CSV hero --- */
.before-after-hero {
  padding: 24px 0;
  margin: 0 auto;
  max-width: 940px;
}
.before-after-wrapper {
  display: flex;
  gap: 24px;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
}
.before-card, .after-card {
  flex: 1 1 300px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 20px;
  min-width: 280px;
  position: relative;
}
.before-card {
  border-right: 2px solid var(--emerald);
}
.after-card {
  border-left: 2px solid var(--emerald);
}
.before-title, .after-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate);
}
.before-table, .after-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 8px;
  table-layout: fixed;
}
.before-table th, .after-table th,
.before-table td, .after-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--slate);
  white-space: nowrap;
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.before-table tbody tr td.accent,
.after-table tbody tr td.accent {
  color: var(--emerald);
}
.before-table tbody tr td.accent,
.after-table tbody tr td.accent {
  color: var(--emerald);
}
.before-caption, .after-caption {
  font-size: 10px;
  color: var(--dim);
  text-align: center;
  margin-top: 4px;
}
.before-after-wrapper .arrow {
  flex: 0 0 32px;
  color: var(--emerald);
  font-size: 24px;
  align-self: center;
  user-select: none;
}
.before-after-note {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  margin-top: 16px;
  padding: 0 16px;
}

/* --- Hero callout tags --- */

.callout {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 10;
  opacity: 0.6;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.hero-shot:hover .callout {
  opacity: 1;
}

.callout-tag {
  box-sizing: border-box;
  background: #161b22;
  border: 0.5px solid #21262d;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'Kode Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  color: #e6edf3;
  white-space: nowrap;
  line-height: 1.3;
}

.callout-line {
  flex-shrink: 0;
  background: var(--blue-light);
}

.callout-line--right {
  width: 28px;
  height: 1px;
}

.callout-line--up {
  width: 1px;
  height: 22px;
}

.callout-line--left {
  width: 28px;
  height: 1px;
}

.callout-dot {
  flex-shrink: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue-light);
}

/* Callout 1 — left of AI Query tab, connector right */
.callout-1 {
  top: 140px;
  left: -10px;
}

/* Callout 2 — below token badge, connector up */
.callout-2 {
  top: 50px;
  right: 20px;
  flex-direction: column;
}

/* Callout 3 — right of Result tab, connector left */
.callout-3 {
  top: 140px;
  right: -10px;
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--slate);
  background: var(--ink);
}

.shot-dots {
  display: flex;
  gap: 6px;
}
.shot-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--slate);
}
.shot-dots i:nth-child(1) {
  background: rgba(239, 68, 68, 0.7);
}
.shot-dots i:nth-child(2) {
  background: rgba(240, 160, 32, 0.7);
}
.shot-dots i:nth-child(3) {
  background: rgba(16, 185, 129, 0.7);
}

.shot-url {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--dim);
}

.shot-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--slate);
  border-radius: 999px;
  padding: 3px 9px;
}

.shot-body {
  display: grid;
  grid-template-columns: 190px 1fr;
  min-height: 330px;
}

.shot-sidebar {
  border-right: 1px solid var(--slate);
  padding: 14px 12px;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shot-brand {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.shot-brand-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.shot-sb-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--dim);
  text-transform: uppercase;
  margin: 12px 4px 6px;
}

.shot-sb-file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white);
  padding: 5px 8px;
  border-radius: 6px;
}

.shot-sb-file.active {
  background: var(--blue-glow);
}

.shot-sb-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white);
  padding: 4px 8px;
}

.shot-sb-meter {
  margin-top: auto;
  border: 1px solid var(--slate);
  border-radius: 6px;
  padding: 10px;
  background: var(--steel);
}

.sb-meter-head {
  font-size: 10px;
  color: var(--white);
}
.sb-meter-bar {
  height: 5px;
  background: var(--slate);
  border-radius: 999px;
  margin: 7px 0;
  overflow: hidden;
}
.sb-meter-bar i {
  display: block;
  height: 100%;
  background: var(--emerald);
  border-radius: 999px;
}
.sb-meter-meta {
  font-size: 9px;
  color: var(--dim);
}

.shot-main {
  display: flex;
  flex-direction: column;
  background: var(--ink);
}

.shot-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--slate);
}

.shot-tabs span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 10px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast);
}

.shot-tabs span.active {
  color: var(--white);
  border-bottom-color: var(--blue);
}
.shot-tabs span:hover {
  color: var(--white);
}

.shot-check {
  color: var(--emerald);
  font-style: normal;
}

.shot-table {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.shot-tr {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 0.8fr 0.8fr;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white);
  padding: 6px 10px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.shot-tr:nth-child(even):not(.shot-th) {
  background: rgba(31, 36, 48, 0.35);
}
.shot-tr:not(.shot-th):hover {
  background: rgba(240, 160, 32, 0.08);
}
.shot-th {
  color: var(--dim);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate);
  border-radius: 0;
}

.shot-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--slate);
  font-size: 10.5px;
  color: var(--dim);
}

.shot-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--emerald);
}

.shot-run {
  color: var(--blue-light);
  font-weight: 600;
  background: var(--blue-glow);
  border: 1px solid rgba(240, 160, 32, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  transition:
    background var(--transition-modal),
    color var(--transition-modal);
}

.shot-run:hover {
  background: rgba(240, 160, 32, 0.2);
  color: #ffd28a;
}

/* --- Social proof --- */

.replaces {
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 28px 0;
  text-align: center;
}

.replaces-head {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 22px;
}

.replaces-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.replaces-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--slate);
  border-radius: 999px;
  background: var(--steel);
  padding: 8px 16px 8px 8px;
  font-size: 13px;
  color: var(--muted);
  transition:
    transform var(--transition-modal),
    border-color var(--transition-modal);
}

/* Hover: Slate → accent at 30% only (border + lift, no shadow). */
.replaces-chip:hover {
  transform: translateY(-3px);
  border-color: rgba(240, 160, 32, 0.3);
}

.rc-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--slate);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--blue-light);
  transition:
    transform var(--transition-modal),
    border-color var(--transition-modal);
}

.replaces-chip:hover .rc-icon {
  transform: scale(1.1) rotate(-4deg);
  border-color: rgba(240, 160, 32, 0.3);
}

.rc-cross {
  color: var(--dim);
  font-size: 11px;
  display: inline-block;
  transition:
    transform var(--transition-modal),
    color var(--transition-modal);
}
.replaces-chip:hover .rc-cross {
  transform: rotate(90deg);
  color: var(--muted);
}

/* --- Sections --- */

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 28px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 44px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-light);
}

.section-title {
  margin-top: 10px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--white);
}

.section-sub {
  margin: 12px auto 0;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

/* How it works — icon row */
.how-icon-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 48px;
}

.how-col {
  text-align: center;
}

.how-icon {
  display: block;
  font-size: 24px;
  color: var(--blue-light);
  margin-bottom: 16px;
  line-height: 1;
}

.how-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 8px;
}

.how-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .how-icon-row {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature-card {
  position: relative;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 22px;
  transition:
    transform var(--transition-modal),
    border-color var(--transition-modal),
    box-shadow var(--transition-modal);
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(240, 160, 32, 0.08),
    transparent 65%
  );
  opacity: 0;
  transition: opacity var(--transition-modal);
  pointer-events: none;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 160, 32, 0.45);
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.7);
}

.f-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--blue-glow);
  border: 1px solid rgba(240, 160, 32, 0.25);
  color: var(--blue-light);
  margin-bottom: 16px;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    background var(--transition-modal),
    border-color var(--transition-modal);
}

.feature-card:hover .f-icon {
  transform: translateY(-3px) scale(1.07) rotate(-3deg);
  background: rgba(240, 160, 32, 0.18);
  border-color: rgba(240, 160, 32, 0.5);
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  transition: color var(--transition-modal);
}
.feature-card:hover h3 {
  color: var(--blue-light);
}
.feature-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* Feature category quick-nav — icon-only selectors */
.feature-cats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 26px;
}

.feat-cat {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--steel);
  border: 1px solid var(--slate);
  color: var(--muted);
  cursor: pointer;
  transition:
    background var(--transition-modal),
    border-color var(--transition-modal),
    color var(--transition-modal),
    transform var(--transition-modal);
}

.feat-cat svg {
  width: 16px;
  height: 16px;
}

.feat-cat:hover {
  color: var(--white);
  border-color: var(--slate);
  transform: translateY(-1px);
}

.feat-cat.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-accent);
}

/* Mini interface previews inside feature cards */
.feature-card {
  display: flex;
  flex-direction: column;
}

.feature-card > p {
  flex: 1 1 auto;
}

.feature-card.feat-flash {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue-glow);
  transition: border-color var(--transition-modal), box-shadow var(--transition-modal);
}

.feat-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  min-height: 116px;
  margin: -22px -22px 20px;
  padding: 14px 16px;
  background: var(--ink);
  border-bottom: 1px solid var(--slate);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.feat-preview .fp-cmd,
.feat-preview .fp-lines,
.feat-preview .fp-chips,
.feat-preview .fp-panes,
.feat-preview .fp-chart,
.feat-preview .fp-report,
.feat-preview .fp-meter {
  display: flex;
}

/* Plain English transforms preview: command + ranked rows */
.fp-cmd {
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 6px;
  padding: 7px 10px;
}

.fp-cmd .fp-caret {
  font-style: normal;
  font-size: 9px;
  color: var(--blue);
}

.fp-cmd b {
  font-weight: 500;
  color: var(--white);
}

.fp-lines {
  flex-direction: column;
  gap: 5px;
}

.fp-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 10.5px;
  color: var(--muted);
}

.fp-row i {
  font-style: normal;
  font-size: 9.5px;
  color: var(--dim);
}

.fp-row b {
  color: var(--white);
  font-weight: 500;
}

/* Auto column typing preview: type-tagged column chips */
.fp-chips {
  flex-wrap: wrap;
  gap: 6px;
}

.fp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--white);
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-mono);
}

.fp-note {
  font-size: 9.5px;
  color: var(--dim);
}

/* Before / after preview: two mini panes */
.fp-panes {
  flex-direction: column;
  gap: 6px;
}

.fp-pane {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  color: var(--muted);
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 6px;
  padding: 6px 10px;
}

.fp-pane em {
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.fp-pane b {
  font-weight: 500;
  color: var(--white);
}

.fp-pane--after {
  border-color: rgba(240, 160, 32, 0.35);
}

.fp-pane--after b {
  color: var(--blue-light);
}

/* Auto-picked chart preview: mini bars */
.fp-chart {
  align-items: flex-end;
  gap: 8px;
  height: 66px;
}

.fp-chart i {
  flex: 1;
  height: var(--h);
  background: var(--blue);
  opacity: 0.85;
  border-radius: 3px 3px 0 0;
}

.fp-chart i.on {
  background: var(--emerald);
  opacity: 1;
}

.fp-caption {
  font-size: 9.5px;
  color: var(--dim);
}

/* Change report preview: markdown lines */
.fp-report {
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted);
}

.fp-report-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--white);
}

/* Token-priced preview: mini token meter */
.fp-meter {
  flex-direction: column;
  gap: 7px;
}

.fp-meter-top {
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.fp-meter-top b {
  color: var(--white);
  font-weight: 500;
  font-size: 13px;
}

.fp-meter-bar {
  height: 6px;
  background: var(--slate);
  border-radius: 999px;
  overflow: hidden;
}

.fp-meter-bar i {
  display: block;
  height: 100%;
  background: var(--emerald);
  border-radius: 999px;
}

.fp-meter-meta {
  font-size: 9.5px;
  color: var(--dim);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
  align-items: stretch;
}

.price-card {
  position: relative;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--transition-modal),
    border-color var(--transition-modal),
    box-shadow var(--transition-modal);
}

.price-card:not(.highlight):hover {
  transform: translateY(-4px);
  border-color: rgba(240, 160, 32, 0.35);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7);
}

.price-card.highlight {
  border-color: var(--blue);
  background: #171310;
}

.price-card.highlight:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 56px -24px rgba(240, 160, 32, 0.4),
    0 0 0 1px rgba(240, 160, 32, 0.55);
}

.price-pop {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  animation: float-y 4s ease-in-out infinite;
}

@keyframes float-y {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -4px);
  }
}

.price-name {
  font-size: 29px;
  font-weight: 600;
  color: var(--white);
}

/* Star tagline (2.7) — muted subtitle under the tier name. The tier name is
   always primary; this is flavor, never the label. */
.price-star {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Forge token explainer (2.2) — sits under the pricing grid so the unit is
   defined the first time a visitor reads a token count. */
.pricing-token-note {
  margin: 22px auto 0;
  max-width: 560px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.price-amount {
  margin-top: 14px;
  font-size: 34px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
  transition: color var(--transition-modal);
}
.price-card:hover .price-amount {
  color: var(--blue-light);
}
.price-amount .per {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.price-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.price-feats {
  margin: 22px 0 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.price-feats li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--white);
}

.price-feats li.off {
  color: var(--dim);
}
.price-feats li.off .feat-check {
  background: rgba(107, 114, 128, 0.15);
  border-color: transparent;
}

.feat-check {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue-glow);
  border: 1px solid rgba(240, 160, 32, 0.4);
  position: relative;
  flex-shrink: 0;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.price-feats li:hover .feat-check {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px var(--blue-glow);
}

.feat-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 3px;
  border-left: 1.5px solid var(--emerald);
  border-bottom: 1.5px solid var(--emerald);
  transform: rotate(-45deg);
}

/* FAQ */
.faq-list {
  max-width: 740px;
  margin: 0 auto;
}

/* FAQ is the last landing section (no footer below) — keep a bottom margin
   so the page doesn't end flush against the viewport edge. */
#faq {
  padding-bottom: 96px;
}

.faq-item {
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  background: var(--steel);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-item[open] {
  border-color: rgba(240, 160, 32, 0.25);
}

.faq-q {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color var(--transition-fast);
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--blue-light);
  flex-shrink: 0;
  transition: transform var(--transition-modal);
}

.faq-item[open] .faq-q::after {
  transform: rotate(45deg);
}

.faq-q:hover {
  color: var(--blue-light);
}

.faq-a {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.faq-a a {
  color: var(--blue-light);
  text-decoration: none;
}

.faq-a a:hover {
  text-decoration: underline;
}

.faq-a code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue-light);
  background: rgba(240, 160, 32, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Footer */
#landingAuthActions {
  max-width: 500px;
  opacity: 1;
  margin-left: 24px;
  overflow: hidden;
  transition:
    max-width 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 240ms cubic-bezier(0.4, 0, 0.2, 1),
    margin-left 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
#landingAuthActions.cta-hidden {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #landingAuthActions {
    transition: none;
  }
}
@media (max-width: 640px) {
  #signInBtn {
    display: none;
  }
}

.site-footer {
  position: relative;
}
/* Wrapper owns the clipping + background so the footer's amber glow can
   bleed upward into the last section without a visible band. */
.footer-blend {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}
.site-footer-glow {
  position: absolute;
  left: 0;
  right: 0;
  top: -128px;
  height: 700px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%);
  background: radial-gradient(
    circle 1600px at 50% 120%,
    rgba(245, 158, 11, 0.16),
    transparent 0%
  );
}
.site-footer-inner {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: 56px 24px;
}
.site-footer-compare {
  margin: 20px 0 0;
  font-size: 13px;
  color: #a1a1aa;
}
.site-footer-compare a { color: #d4d4d8; text-decoration: underline; text-underline-offset: 3px; }
.site-footer-compare a:hover { color: #f59e0b; }
.site-footer-rule {
  border: none;
  border-top: 1px solid rgba(24, 24, 27, 0.5);
  margin: 24px 0;
}
.site-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.site-footer-col h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fafafa;
}
.site-footer-col a {
  display: block;
  font-size: 13px;
  color: #d4d4d8;
  padding: 3px 0;
}
.site-footer-col a:hover { color: #f59e0b; }
.site-footer-legal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #a1a1aa;
}
.site-footer-legal a { color: #a1a1aa; }
.site-footer-legal a:hover { color: var(--white); }
.site-footer-legal-right {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.to-top-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #27272a;
  color: #71717a;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background-color 150ms;
}
.to-top-btn:hover {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(24, 24, 27, 0.5);
}
@media (max-width: 640px) {
  .site-footer-cols { grid-template-columns: 1fr; }
  .site-footer-legal { flex-direction: column; gap: 4px; }
  .site-footer-legal-right { align-self: flex-end; }
}

.landing-footer {
  margin-top: 96px;
  border-top: 1px solid var(--slate);
  background: var(--steel);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.footer-tagline {
  font-size: 12.5px;
  color: var(--dim);
  margin-right: auto;
}

.footer-links {
  display: flex;
  gap: 22px;
}
.footer-links a {
  font-size: 12.5px;
  color: var(--muted);
  position: relative;
  transition: color var(--transition-fast);
}
.footer-links a:hover {
  color: var(--white);
}

.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.footer-links a:hover::after {
  transform: scaleX(1);
}

/* ==========================================================================
   AUTH PAGE
   ========================================================================== */

/* ==========================================================================
   Clerk pre-built auth pages — reuse auth-nav/auth-main styles
   ========================================================================== */

.clerk-auth-page {
  height: 100%;
  overflow-y: auto;
  background: var(--ink);
}

.auth {
  height: 100%;
  overflow-y: auto;
  background: var(--ink);
}

.auth-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(11, 14, 20, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slate);
}

.auth-main {
  min-height: calc(100% - var(--navbar-h));
  display: grid;
  place-items: center;
  padding: 48px 20px 72px;
}

.auth-card {
  width: 400px;
  max-width: 100%;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  animation: rise-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
}

.auth-sub {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 26px;
}

.auth-oauth .btn {
  justify-content: flex-start;
  padding-left: 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--slate);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
}

.auth-input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  color: var(--white);
  font: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.auth-input::placeholder {
  color: var(--dim);
}

.auth-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.22);
}

.auth-form .btn {
  margin-top: 6px;
}

.auth-note {
  margin-top: 22px;
  text-align: center;
  font-size: 10.5px;
  color: var(--dim);
}

/* ── Auth modal (popup from workspace) ─────────────────────────────────── */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 20, 0.65);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-modal);
}
.auth-modal-overlay.open {
  opacity: 1;
}
.auth-modal {
  position: relative;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 10px;
  padding: 28px 28px 22px;
  width: 380px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  transform: translateY(12px) scale(0.97);
  transition: transform var(--transition-modal);
}
.auth-modal-overlay.open .auth-modal {
  transform: translateY(0) scale(1);
}
.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.auth-modal-close:hover {
  color: var(--white);
  background: var(--steel);
}
.auth-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

/* ── Profile setup popup (post-signup one-time) ─────────────────────────── */
.profile-setup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 20, 0.65);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-modal);
}
.profile-setup-overlay.open {
  opacity: 1;
}
.profile-setup-card {
  position: relative;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 10px;
  padding: 32px 32px 26px;
  width: 400px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.profile-setup-overlay.open .profile-setup-card {
  transform: scale(1);
}
.profile-setup-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}
.profile-setup-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 22px;
}
.profile-setup-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.profile-setup-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--slate);
  border: 2px solid var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}
.profile-setup-avatar:hover {
  border-color: var(--blue);
}
.profile-setup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-setup-avatar-placeholder {
  color: var(--dim);
  font-size: 24px;
  font-weight: 600;
}
.profile-setup-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-setup-avatar-actions .btn {
  font-size: 11px;
  padding: 5px 10px;
  width: fit-content;
}
.profile-setup-field {
  margin-bottom: 16px;
}
.profile-setup-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.profile-setup-input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--white);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}
.profile-setup-input::placeholder {
  color: var(--dim);
}
.profile-setup-input:focus {
  border-color: var(--blue);
}
.profile-setup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.profile-setup-skip {
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
  padding: 8px 4px;
  transition: color var(--transition-fast);
}
.profile-setup-skip:hover {
  color: var(--muted);
}
.profile-setup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.profile-setup-close:hover {
  color: var(--white);
  background: var(--steel);
}
.profile-setup-avatar-input {
  display: none;
}

/* ── First-time popup (landing → workspace / sign-in choice) ─────────── */
.first-time-popup {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 20, 0.65);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-modal);
}
.first-time-popup.open {
  opacity: 1;
}
.first-time-card {
  position: relative;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 10px;
  padding: 30px 30px 26px;
  width: 400px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.first-time-popup.open .first-time-card {
  transform: scale(1);
}
.first-time-icon {
  font-size: 28px;
  text-align: center;
  margin-bottom: 12px;
}
.first-time-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  margin-bottom: 8px;
}
.first-time-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  margin: 0 0 22px;
}
.first-time-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.first-time-actions .btn {
  width: 100%;
  justify-content: center;
}
.first-time-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.first-time-close:hover {
  color: var(--white);
  background: var(--steel);
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Navbar · 52px */
.app-navbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--navbar-h);
  flex-shrink: 0;
  padding: 0 20px;
  background: var(--ink);
  border-bottom: 1px solid var(--slate);
}

.hamburger {
  display: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.hamburger:hover {
  color: var(--white);
  background: var(--bg-hover);
}

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

.nav-tokens {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--white);
  border: 1px solid var(--slate);
  border-radius: 999px;
  padding: 4px 11px;
  background: var(--steel);
}

.nav-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
}

.nav-user {
  font-size: 11.5px;
  color: var(--white);
}

/* Shell body: sidebar + workspace */
.app-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

/* Sidebar · 260px */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--steel);
  border-right: 1px solid var(--slate);
  overflow: hidden;
}

.app.sb-collapsed .sidebar {
  display: none;
}

.sb-section {
  padding: 14px 12px 4px;
  flex-shrink: 0;
}

.sb-section.sb-scrollable {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

.sb-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 8px 8px;
}

.sb-empty {
  font-size: 12px;
  color: var(--dim);
  padding: 4px 8px 8px;
}

.file-list,
.col-list,
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.col-list {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.file-item:hover {
  background: var(--bg-hover);
}
.file-item.active {
  background: var(--blue-glow);
  border-color: rgba(240, 160, 32, 0.25);
}

/* Metadata-only restore: the name is known, the rows are not. Dim the row and
   label it, so the sidebar never claims a row count it cannot back up. */
.file-item--unavailable {
  background: transparent;
  border-color: var(--slate);
}
.file-item--unavailable .file-name {
  color: var(--dim);
}
.file-unavailable-tag {
  flex-shrink: 0;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Outer frame: fixed visible area. The mask stays put while the inner
   text scrolls through it, so text exits via the faded edges like passing
   off-screen — never chopped mid-glyph at a hard boundary.

   .filename-mask provides overflow:hidden + white-space:nowrap.
   .filename-track provides the inline-block + animation. */
.file-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--white);
  cursor: default;
}

/* Inner text element — display: inline-block for marquee track */
.file-name-text {
  display: inline-block;
}

/* Filename mask + track — exact spec implementation.
   .filename-mask = outer container (overflow: hidden, nowrap, position: relative).
   .filename-track = inner text with scroll animation.
   Short names get no animation — plain static text. */
.filename-mask {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.filename-track {
  display: inline-block;
  animation: filename-scroll 7s linear infinite;
  animation-delay: 2s;
}

/* 0%–8% hold at start (idle, fully visible, zero clipping).
   8%–60% smooth scroll left, linear timing (constant speed).
   60%–75% hold at end (full filename revealed, brief pause).
   75%–100% scroll back to start, then loop repeats. */
@keyframes filename-scroll {
  0%   { transform: translateX(0); }
  8%   { transform: translateX(0); }
  60%  { transform: translateX(calc(-100% + var(--visible-width))); }
  75%  { transform: translateX(calc(-100% + var(--visible-width))); }
  100% { transform: translateX(0); }
}

.file-remove {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 6px;
  color: var(--dim);
  opacity: 0;
  transition:
    opacity var(--transition-fast),
    color var(--transition-fast);
}
.file-item:hover .file-remove {
  opacity: 1;
}
.file-remove:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
}

.add-file {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px dashed var(--slate);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.add-file:hover {
  color: var(--blue-light);
  border-color: rgba(240, 160, 32, 0.5);
  background: var(--blue-glow);
}

.col-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border-radius: 6px;
}

.col-row:hover {
  background: var(--bg-hover);
}

.col-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--white);
}

.hist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.hist-item:hover {
  background: var(--bg-hover);
  color: var(--white);
}
.hist-item .hist-q {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-item .hist-cost {
  font-size: 10px;
  color: var(--dim);
  flex-shrink: 0;
}
.hist-item .hist-time {
  font-size: 10px;
  color: var(--dim);
  flex-shrink: 0;
}

/* ---------- Sessions tab (past transformation history) ----------
   Each entry borrows the sidebar Query History item's language: mono metadata,
   muted by default, hover lifts to white. Only locked tokens are used. */

.sessions-note {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  background: var(--steel);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.session-item:hover:not([disabled]) {
  background: var(--bg-hover);
  border-color: var(--dim);
  color: var(--white);
}

.session-item[disabled] {
  cursor: default;
  opacity: 0.65;
}

/* Locked (deleted or expired): greyed out, but still openable read-only. */
.session-item.is-locked {
  opacity: 0.55;
}

.session-item.is-locked .session-name {
  color: var(--muted);
}

.session-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.session-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
}

.session-item:hover:not([disabled]) .session-name {
  color: var(--blue);
}

.session-when {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--dim);
}

.session-sum {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-dims {
  font-size: 10px;
  color: var(--dim);
}

/* Two small state pills — "current" (this file is open) and "file gone". */
.session-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--slate);
}

.session-pill.is-current {
  color: var(--blue);
  background: var(--blue-glow);
  border-color: rgba(240, 160, 32, 0.35);
}

.session-pill.is-stale {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
}

.session-exp {
  margin-left: auto;
  font-size: 10px;
  color: var(--dim);
}

.session-exp.is-soon {
  color: #fcd34d;
}

.session-pill.is-deleted {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
}

.session-pill.is-expired {
  color: var(--muted);
  background: rgba(139, 147, 167, 0.12);
  border-color: var(--dim);
}

.session-check {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.session-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* Locked session: the dataset controls stay visible but must not look
   clickable, and their tooltip says why. Scoped to the locked state so no
   other disabled button in the app changes appearance. */
.btn[data-stale-disabled],
.btn[data-stale-disabled]:hover,
.btn[data-stale-disabled]:active {
  background: transparent;
  border-color: var(--slate);
  color: var(--dim);
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.query-textarea[data-stale-readonly],
.query-textarea[data-stale-readonly]:focus {
  opacity: 0.6;
  cursor: default;
  border-color: var(--slate);
}

.sessions-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
}

.sessions-empty .sb-empty {
  padding-left: 0;
}

/* ---------- Insight Brief (Result action row + preview modal) ---------- */

.btn-brief {
  color: var(--blue);
  border-color: rgba(240, 160, 32, 0.45);
}

.btn-brief:hover:not(:disabled) {
  background: var(--blue-glow);
  border-color: var(--blue);
}

.brief-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 24px;
}

.brief-modal {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: 86vh;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.brief-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--slate);
}

.brief-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--white);
}

.brief-sub {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--dim);
}

/* The document itself is paper-white so the PDF reads like a document. */
.brief-doc {
  padding: 22px 24px;
  overflow-y: auto;
  background: #ffffff;
  color: #1b1f27;
  font-size: 13.5px;
  line-height: 1.65;
}

.brief-doc .brief-h {
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #11141a;
  border-bottom: 2px solid #f0a020;
  padding-bottom: 3px;
}

.brief-doc .brief-h:first-child {
  margin-top: 0;
}

.brief-doc p {
  margin: 0 0 8px;
}

.brief-doc ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

.brief-doc code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
}

.brief-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--slate);
}

/* Print fallback: only the document being exported is printable. */
@media print {
  body > * {
    display: none !important;
  }

  #briefOverlay,
  #reportPdfDoc {
    display: block !important;
    position: static !important;
    inset: auto !important;
    background: none !important;
    padding: 0 !important;
    z-index: auto !important;
  }

  #briefOverlay .brief-modal {
    width: 100% !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  #briefOverlay .brief-head,
  #briefOverlay .brief-actions {
    display: none !important;
  }

  #briefOverlay .brief-doc {
    overflow: visible !important;
    padding: 0 !important;
  }
}

/* Teaching empty state (fixes v2) */
.hist-try {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--blue-light);
  border: 1px dashed rgba(240, 160, 32, 0.35);
  background: var(--ink);
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}
.hist-try:hover {
  border-color: rgba(240, 160, 32, 0.6);
  background: var(--blue-glow);
}

.sb-history {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

/* Pinned token meter */
.sb-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--slate);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
}

.sb-footer > * {
  margin-top: 0;
  margin-bottom: 0;
}

.token-meter {
  position: relative;
  border: 1px solid #27272a;
  border-radius: 12px;
  background: #161b22;
  padding: 16px;
  margin: 0;
  transition:
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25),
    border-color 0.25s ease,
    background-color 0.3s ease;
}

@media (hover: hover) {
  .token-meter:hover {
    border-color: #f0a020;
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .token-meter {
    transition: none;
  }
  .token-meter:hover {
    transform: none;
  }
}

.tm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tm-head.loading {
  /* Skeleton placeholder: same height as .tm-count + .tm-meta, same width as the inner row */
  /* Hide real content, show shimmer */
  > *:not(.tm-skel):not(:has(.tm-skel)) {
    opacity: 0;
    pointer-events: none;
  }
  .tm-skel {
    flex: 1;
    height: 16px;
    border-radius: 4px;
    animation: tokenMeterShimmer 1.5s ease-in-out infinite;
  }
}

@keyframes tokenMeterShimmer {
  0% {
    background-color: #21262d;
  }
  50% {
    background-color: #3e4249;
  }
  100% {
    background-color: #21262d;
  }
}

.tm-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  color: #e6edf3;
  white-space: nowrap;
}

.tm-count-num {
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #f3f4f6;
}

.tm-count-label {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}

.tm-plan {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
  background: rgba(234, 179, 8, 0.1);
  border-radius: 999px;
  padding: 3px 8px;
  flex-shrink: 0;
}

/* Tier colors: trial = yellow, free = green, pro = blue. */
.tm-plan[data-tier="free"] {
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.tm-plan[data-tier="pro"],
.tm-plan[data-tier="plus"] {
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.1);
}

.tm-plan-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: tm-plan-ripple 2s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

@keyframes tm-plan-ripple {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70% {
    box-shadow: 0 0 0 3px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-plan-dot {
    animation: none;
  }
}

.tm-star {
  margin-top: 4px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.tm-plan.trial {
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
  background: rgba(234, 179, 8, 0.1);
}

.tm-sub {
  display: block;
  margin-top: 8px;
  color: #8b949e;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tm-bar {
  height: 6px;
  background: #27272a;
  border-radius: 99px;
  margin: 14px 0 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.tm-fill {
  position: relative;
  display: block;
  height: 100%;
  background: #f0a020;
  border-radius: 99px;
  width: 0;
  box-shadow: 0 0 10px rgba(240, 160, 32, 0.3);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tm-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  transform: translateX(50%);
  border-radius: 50%;
  background: rgba(240, 160, 32, 0.95);
  box-shadow: 0 0 8px 2px rgba(240, 160, 32, 0.6);
  pointer-events: none;
}

.tm-fill[style*="width: 0%"]::after {
  display: none;
}

.tm-meta {
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  font-style: italic;
}

/* Forge token explainer (2.2) — the meter is where a signed-in user first
   meets the unit, so the definition lives here too, not only on pricing. */
.tm-note {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
}

.tm-inset {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #27272a;
  border-radius: 6px;
  background: #0a0a0c;
}

.tm-inset p {
  margin: 0;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.tm-inset p + p {
  margin-top: 4px;
}

.tm-inset .tm-trust {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #27272a;
  color: #cbd5e1;
  line-height: 1.45;
}

.tm-upgrade {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #f0a020;
  border: 1px solid #f0a020;
  border-radius: 6px;
  background: transparent;
  padding: 8px 16px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tm-upgrade:hover {
  background: #f0a020;
  border-color: #f0a020;
  color: #0a0a0c;
}
.tm-upgrade:active {
  background: #f0a020;
  border-color: #f0a020;
  color: #0a0a0c;
  transform: scale(0.96);
}

.tm-upgrade.is-max,
.tm-upgrade.is-max:hover {
  color: var(--dim);
  border-color: var(--slate);
  background: transparent;
  cursor: default;
}

/* Token meter tooltip ------------------------------------------------------- */
.tm-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--white);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.tm-tooltip.open {
  opacity: 1;
  visibility: visible;
}
.tm-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
  float: left;
}
.tm-tooltip-body {
  overflow: hidden;
  padding-left: 12px;
}
.tm-tooltip-close {
  float: right;
  padding: 2px;
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
}
.tm-tooltip-close:hover {
  color: var(--white);
}

/* Workspace: small-button hovers are the amber brighten, not marketing orange */
#app .btn-primary:hover {
  background: #FFBA3D;
  border-color: #FFBA3D;
}
#app .btn-primary:active {
  background: #D4901E;
  border-color: #D4901E;
  transform: translateY(1px);
}
.sb-foot-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 9px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  color: #8b949e;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.sb-foot-link:hover {
  background: #161b22;
  color: #e6edf3;
}
.sb-foot-link.danger {
  color: #8b949e;
}
.sb-foot-link.danger:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ---------- Workspace + tab bar ---------- */

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--ink);
}

.tabbar {
  display: flex;
  align-items: stretch;
  height: var(--tabbar-h);
  flex-shrink: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--slate);
  background: var(--ink);
  gap: 2px;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  height: 28px;
  padding: 0 14px;
  margin: 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 999px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.tab:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}
/* The sidebar toggle carries its own gold-circle hover on the icon — kill
   the generic pill hover behind it so the two don't stack. */
.tab-sidebar:hover {
  color: var(--muted);
  background: transparent;
}
.tab.active {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.16);
}
.tab {
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tab:disabled {
  opacity: 0.4;
  cursor: default;
}
.tab:disabled:hover {
  color: var(--muted);
  background: transparent;
}

.tab-sidebar {
  padding: 0 10px;
}

/* Sidebar toggle state is mirrored on the icon: ON (sidebar hidden /
   collapsed) shows the gold circle; OFF (sidebar visible) is neutral. */
.tab-sidebar .fi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  transition: transform 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

.tab-sidebar .fi:hover {
  background: rgba(245, 158, 11, 0.08);
}

.app.sb-collapsed .tab-sidebar .fi {
  transform: rotate(180deg);
  color: var(--amber);
  background: rgba(245, 158, 11, 0.16);
}

.app.sb-collapsed .tab-sidebar .fi:hover {
  background: rgba(245, 158, 11, 0.28);
}

.app.sb-collapsed .tab-sidebar {
  color: var(--white);
}

.tab-check {
  color: var(--emerald);
  font-style: normal;
  font-weight: 700;
}

.tabbar-spacer {
  flex: 1;
}

.tabbar-file {
  font-size: 11px;
  align-self: center;
}

/* ---------- Main content ---------- */

.main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 32px 56px;
  position: relative;
}

.panel {
  display: none;
  max-width: 1120px;
  margin: 0 auto;
}
.panel.active {
  display: block;
  animation: panel-in 0.2s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
}

.panel-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Truncation banner (amber, in-workspace notice) ---------- */

.trunc-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  font-size: 13px;
  color: #fcd34d;
}

.trunc-banner svg {
  flex-shrink: 0;
  color: var(--amber);
}

.trunc-close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: rgba(245, 158, 11, 0.7);
  font-size: 13px;
  line-height: 1;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.trunc-close:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

/* In-workspace CSV notice (malformed rows, delimiter notes) */
.csv-notice {
  max-width: 1120px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border: 1px solid #21262d;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.06);
  font-size: 13px;
  color: #fcd34d;
  line-height: 1.5;
}

.csv-notice .cn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.csv-notice svg {
  flex-shrink: 0;
  color: var(--amber);
}

.csv-notice .cn-body {
  flex: 1;
  min-width: 0;
}

.csv-notice b {
  color: #ffe4a8;
  font-weight: 600;
}

.cn-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.cn-spacer {
  width: 25px;
  flex-shrink: 0;
 }

.cn-free {
  font-size: 11px;
  color: var(--emerald);
  white-space: nowrap;
}

.cn-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--dim);
  font-size: 14px;
  flex-shrink: 0;
  margin-left: auto;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.cn-close:hover {
  background: var(--bg-hover);
  color: var(--white);
}

/* ---------- Inline upgrade card (never a blocking modal) ---------- */

.upgrade-inline {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto 16px;
  padding: 16px 18px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  background: var(--steel);
  position: relative;
  animation: panel-in 0.2s ease;
}

.upg-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(240, 160, 32, 0.12);
  border: 1px solid rgba(240, 160, 32, 0.35);
  color: var(--blue-light);
}

.upg-copy {
  flex: 1;
  min-width: 0;
}

.upg-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

.upg-body {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.upg-feats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.upg-feats i {
  font-style: normal;
  color: var(--emerald);
  margin-right: 4px;
}

.upg-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  flex-shrink: 0;
}

.upg-actions .btn {
  min-width: 150px;
}

.upg-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.upg-close:hover {
  background: var(--bg-hover);
  color: var(--white);
}

/* ---------- Upload screen ---------- */

.upload-screen {
  max-width: 1120px;
  margin: 0 auto;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-h) - var(--tabbar-h) - 48px);
  padding: 24px 0;
}

.upload-screen.active {
  display: flex;
}

/* Inline row-limit message */
.upload-limit {
  width: 60%;
  max-width: 620px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.07);
  text-align: left;
}

.ul-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--white);
}

.ul-body {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.ul-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ul-file {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

/* Inline file-read error (fixes v2 — errors belong beside the control) */
.upload-error {
  width: 60%;
  max-width: 620px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.07);
  text-align: left;
}

.ue-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--white);
}

.ue-body {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.ue-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.dropzone {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  width: 60%;
  max-width: 620px;
  text-align: center;
  border: 1px dashed var(--slate);
  border-radius: var(--radius-lg);
  background: var(--steel);
  padding: 64px 40px;
  transition:
    border-color var(--transition-modal),
    background var(--transition-modal);
}

/* Gold glow that tracks the cursor while the pointer is inside */
.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(240, 160, 32, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.dropzone:hover::before {
  opacity: 1;
}
.dropzone > * {
  position: relative;
  z-index: 1;
}

.dz-icon .fi {
  font-size: 26px;
}

.dropzone:hover {
  border-color: rgba(240, 160, 32, 0.5);
}

.dropzone.dragover {
  border-color: var(--blue-light);
  background: rgba(240, 160, 32, 0.1);
}

.dz-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: var(--blue-glow);
  border: 1px solid rgba(240, 160, 32, 0.3);
  color: var(--blue-light);
  margin-bottom: 20px;
}

.dz-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}
.dz-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 24px;
}

.dz-sample {
  display: block;
  margin: 22px auto 0;
  font-size: 12px;
  color: var(--blue-light);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.dz-sample:hover {
  border-bottom-color: var(--blue-light);
}

.dz-meta {
  margin-top: 18px;
  font-size: 10.5px;
  color: var(--dim);
}

/* ---------- Inspect ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}
.stat-value.ok {
  color: var(--muted);
}
.stat-value.warn {
  color: #f59e0b;
}
.stat-value.bad {
  color: var(--red);
}

/* Data tab: ghost "Try sample file" button (fixes v1) */
#resetSampleBtn.btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--slate);
  padding: 5px 12px;
}
#resetSampleBtn.btn:hover {
  color: var(--white);
  border-color: #2a3140;
  background: var(--bg-hover);
}

/* Schema card grid — one card per column, from parsed data (fixes v1) */
.schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.schema-card {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  transition:
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.schema-card:hover {
  border-color: rgba(240, 160, 32, 0.4);
  transform: translateY(-2px);
}

.sc-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-type {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.sc-meta {
  font-size: 12px;
  color: var(--muted);
}

.sc-missing {
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.sc-missing.ok {
  color: var(--dim);
}
.sc-missing.warn {
  color: #f59e0b;
}
.sc-missing.bad {
  color: var(--red);
  font-weight: 600;
}

.sc-stat {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}
.sc-stat b {
  color: var(--muted);
  font-weight: 600;
}

/* Improper/invalid datatype callout on a schema card */
.sc-issue {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--red);
  line-height: 1.45;
}

/* AI data quality report (fixes v1 — costs 3 credits) */
.ai-inspect {
  margin-top: 20px;
}

/* "Instant Actions" section head — mirrors the File overview section */
.ins-actions-head {
  margin-top: 4px;
  margin-bottom: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--slate);
}
.ins-actions-title {
  font-size: 17px;
}

/* Rounded-square action cards — one even row, wraps gracefully narrow */
.ai-inspect-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  position: relative;
}
.ai-inspect-actions .btn {
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--ink);
  border-color: var(--slate);
  color: var(--white);
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}
.ai-inspect-actions .btn:hover {
  border-color: rgba(240, 160, 32, 0.55);
  background: var(--blue-glow);
}
.ai-inspect-actions .btn:active {
  transform: scale(0.97);
}

/* Live counts on the action cards (always shown; red when > 0) */
.count-badge {
  font-size: 11px;
  color: var(--dim);
}
.count-badge.hot {
  color: var(--red);
  font-weight: 600;
}

/* Token cost tooltip on inspect buttons */
.btn-cost-hint {
  position: absolute;
  z-index: 20;
  padding: 5px 10px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--white);
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  pointer-events: none;
  white-space: nowrap;
  animation: hint-pop 0.15s ease, hint-fade 0.25s ease 1.8s forwards;
}
.btn-cost-hint::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 18px;
  width: 8px;
  height: 8px;
  background: var(--steel);
  border-top: 1px solid var(--slate);
  border-left: 1px solid var(--slate);
  transform: rotate(45deg);
}

@keyframes hint-pop {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hint-fade {
  to { opacity: 0; }
}

.ai-confirm {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  background: var(--steel);
  animation: panel-in 0.2s ease;
}

.ai-confirm-text {
  font-size: 13.5px;
  color: var(--white);
}
.ai-confirm-text strong {
  color: var(--amber);
}

.ai-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.ai-report {
  margin-top: 14px;
  background: #0a0d14;
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  color: #a5f3fc;
  animation: panel-in 0.25s ease;
  overflow-x: auto;
}

.air-head {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 8px;
}

.air-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: #e2f5ff;
  margin: 12px 0 4px;
}

.air-line {
  margin: 3px 0;
}
.air-line strong {
  color: var(--white);
}
.air-line code {
  color: #fcd34d;
  background: rgba(240, 160, 32, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- Data table ---------- */

.table-wrap {
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  overflow: auto;
  background: var(--ink);
  max-height: 62vh;
}

/* Data panel: the dataset behind a restored session is gone. Reuses the
   existing inline-alert idiom (border + background contrast, no shadow). */
.data-unavailable {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 20px;
  border: 1px solid var(--slate);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-md);
  background: var(--ink);
}
.data-unavailable-msg {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}
.data-unavailable-hint {
  font-size: 13px;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--steel);
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 9px 14px;
  border-bottom: 1px solid var(--slate);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 7px 14px;
  border-bottom: 1px solid rgba(31, 36, 48, 0.5);
  color: var(--white);
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(31, 36, 48, 0.28);
}
.data-table tbody tr:hover {
  background: rgba(240, 160, 32, 0.08);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .td-dim {
  color: var(--muted);
}
.data-table .td-num {
  color: var(--blue-light);
}

.table-note {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  border-top: 1px solid var(--slate);
  background: var(--steel);
}

/* Paging for the dataset table — icon-only buttons, bottom-right corner. */
.table-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.table-pager-range {
  margin-right: auto;
  font-size: 11px;
  color: var(--dim);
}

.pager-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.pager-btn:hover:not(:disabled) {
  color: var(--white);
  background: var(--bg-hover);
  border-color: var(--dim);
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ---------- AI Query ---------- */

.panel-query {
  max-width: 920px;
}

.query-card {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 24px;
}

.col-hint {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  background: var(--ink);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.col-hint strong {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.col-hint-list {
  color: var(--blue-light);
  font-size: 11px;
}

/* Terminal-style query input: JetBrains Mono + room for the "$" prompt
   (a static span on line 1 — native textarea, so copy/paste stays normal). */
.query-textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  padding: 12px 14px 12px 34px;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.query-textarea::placeholder {
  color: var(--dim);
}

.query-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.22);
}

/* Terminal blip cursor when textarea is empty and not focused */
.query-textarea:not(:focus):empty::after {
  content: "█";
  position: absolute;
  left: 14px;
  top: 14px;
  color: #f0a020;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  animation: blink-cursor 1s step infinite;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

@keyframes blink-cursor {
  from, to { opacity: 1; }
  50% { opacity: 0.4; }
}

/* When focused, native amber caret takes over */
.query-textarea:focus::after {
  content: none;
}

/* Amber caret color */
.query-textarea {
  caret-color: #f0a020;
  font-family: var(--font-mono);
}

.query-terminal {
  position: relative;
}

.terminal-prompt {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--blue);
  pointer-events: none;
  user-select: none;
}

/* Lightweight inline suggestion dropdown — same surface/border/shadow as the
   account switcher menu, so it reads as part of the existing UI. */
.suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 40;
  max-height: 224px;
  overflow-y: auto;
}

.suggest-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--white);
  cursor: pointer;
}

.suggest-item:hover {
  background: var(--bg-hover);
}

.suggest-item .suggest-kind {
  font-size: 10.5px;
  color: var(--dim);
  flex-shrink: 0;
}

.example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.example-chip {
  border: 1px solid var(--slate);
  border-radius: 999px;
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 5px 12px;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.example-chip:hover {
  color: var(--white);
  border-color: rgba(240, 160, 32, 0.5);
  background: var(--blue-glow);
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 36, 48, 0.6);
}

.query-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Token cost estimator shown before running */
.cost-est {
  font-size: 11px;
  color: var(--muted);
  border: 1px dashed var(--slate);
  border-radius: 999px;
  padding: 4px 11px;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--emerald);
  border: 1px solid rgba(240, 160, 32, 0.3);
  border-radius: 999px;
  background: rgba(240, 160, 32, 0.08);
  padding: 5px 12px;
}

/* A query is running — the token count is "in use" right now */
.token-pill.in-use {
  color: var(--blue-light);
  border-color: rgba(240, 160, 32, 0.55);
  background: rgba(240, 160, 32, 0.16);
}
.token-pill.in-use .dot {
  background: var(--blue-light);
}

.token-pill.low {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(240, 160, 32, 0.14);
  font-weight: 600;
}
.token-pill.low .dot {
  background: var(--amber);
}
.token-pill.out {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}
.token-pill.out .dot {
  background: var(--red);
}

.query-actions {
  display: flex;
  gap: 10px;
}

.run-bolt {
  color: var(--on-accent);
}

.forge-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate);
  background: var(--ink);
  font-size: 12px;
  color: var(--muted);
}

.forge-status-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.forge-timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.forge-eta {
  font-size: 11px;
  color: var(--dim);
}

.forge-timer {
  font-size: 11px;
  color: var(--dim);
  transition: color var(--transition-modal);
}

.forge-timer.done {
  color: var(--emerald);
  font-weight: 600;
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(240, 160, 32, 0.25);
  border-top-color: var(--blue-light);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Inline spinner that sits inside a button label */
.spinner-sm {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
  border-color: rgba(20, 16, 10, 0.3);
  border-top-color: var(--on-accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Transformation plan / clarify / inline errors (fixes v2) ---------- */

.inline-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  background: var(--steel);
  animation: panel-in 0.2s ease;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: plan;
}

.plan-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  counter-increment: plan;
  font-size: 13.5px;
  color: var(--white);
}

.plan-list li::before {
  content: counter(plan);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--blue-glow);
  border: 1px solid rgba(240, 160, 32, 0.3);
  color: var(--blue-light);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  transform: translateY(2px);
}

.plan-list code {
  color: var(--blue-light);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.plan-est {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.plan-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Clarification question */
.clarify-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clarify-chip {
  border: 1px solid var(--slate);
  border-radius: 999px;
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 5px 12px;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.clarify-chip:hover {
  color: var(--white);
  border-color: rgba(240, 160, 32, 0.5);
  background: var(--blue-glow);
}

.clarify-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* Inline query error */
.query-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.06);
}
.query-error .card-title {
  color: var(--red);
}

.query-error-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--white);
}
.query-error-body code {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.query-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* Data check panel in Result (fixes v2) */
.data-check {
  margin-bottom: 14px;
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  background: var(--steel);
  padding: 14px 16px;
}

.dc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.dc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px 18px;
}

.dc-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.dc-line b {
  color: var(--white);
  font-weight: 600;
}
.dc-mark {
  font-weight: 700;
  font-family: var(--font-mono);
}
.dc-line.ok .dc-mark {
  color: var(--emerald);
}
.dc-line.warn .dc-mark {
  color: var(--amber);
}
.dc-line.bad .dc-mark {
  color: var(--red);
}
.dc-line.info .dc-mark {
  color: var(--muted);
}
.dc-line.noop .dc-mark {
  color: var(--muted);
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.report-line.report-quote {
  color: var(--muted);
  font-style: italic;
}
.report-line.report-quote .rep-bullet {
  color: var(--blue-light);
  font-style: normal;
}

/* ---------- Result ---------- */

.result-subtabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--slate);
  margin-bottom: 16px;
}

.res-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition-fast);
}

.res-tab:hover {
  color: var(--white);
}
.res-tab.active {
  color: var(--white);
  border-bottom-color: var(--blue);
}

.res-pane {
  display: none;
}
.res-pane.active {
  display: block;
  animation: panel-in 0.2s ease;
}

.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ba-card {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 14px 14px 0;
  min-width: 0;
}

.ba-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
}

.ba-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ba-count {
  font-size: 11px;
  color: var(--muted);
}

.ba-table {
  max-height: 340px;
  margin-bottom: 14px;
}

.chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 8px;
}

/* ---------- inline SVG charts (modules/chart-svg.js) ---------- */

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
}

.chart-table {
  width: 100%;
}

.chart-caption {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.chart-caption:empty {
  display: none;
}

.chart-svg .cx-grid {
  stroke: var(--blue-glow);
  stroke-width: 1;
}

.chart-svg .cx-axis {
  stroke: var(--dim);
  stroke-width: 1;
}

.chart-svg .cx-ax,
.chart-svg .cx-val,
.chart-svg .cx-leg,
.chart-svg .cx-leg-val {
  font-family: var(--font-mono);
}

.chart-svg .cx-ax {
  fill: var(--muted);
  font-size: 10.5px;
}

.chart-svg .cx-ax-name {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.chart-svg .cx-val {
  fill: var(--white);
  font-size: 10.5px;
}

.chart-svg .cx-leg {
  fill: var(--white);
  font-size: 11.5px;
}

.chart-svg .cx-leg-val {
  fill: var(--muted);
  font-size: 11.5px;
}

.chart-svg .cx-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-svg .cx-area {
  fill: var(--blue);
  opacity: 0.1;
}

.chart-svg .cx-dot {
  stroke: var(--steel);
  stroke-width: 1.5;
}

.chart-svg .cx-slice {
  stroke: var(--steel);
  stroke-width: 2;
}


.report {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
}

.report-line {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--white);
}

.report-line .rep-bullet {
  color: var(--blue-light);
  flex-shrink: 0;
}
.report-line.dim-line {
  color: var(--muted);
}

/* Minimal markdown rendering inside the change report */
.report-line.report-head {
  color: var(--blue-light);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.report-line strong {
  color: var(--white);
  font-weight: 600;
}

.report-line code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue-light);
  background: rgba(240, 160, 32, 0.12);
  border: 1px solid rgba(240, 160, 32, 0.2);
  border-radius: 4px;
  padding: 0 5px;
}

.report-card {
  position: relative;
}
.pro-tag {
  cursor: pointer;
}

/* The report carries the actual result table inline (report §2) */
.report .report-table {
  margin: 3px 0 1px;
  max-height: 44vh;
}

/* The one model-written section: everything after "Insights — AI-generated"
   sits in its own labelled block so it can never read as fact. */
.report-ai-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-left: 2px solid rgba(240, 160, 32, 0.35);
  padding-left: 11px;
  margin-left: 1px;
}

.report-line.report-ai-head {
  color: var(--white);
}

.report-ai-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-light);
  background: rgba(240, 160, 32, 0.12);
  border: 1px solid rgba(240, 160, 32, 0.25);
  border-radius: 4px;
  vertical-align: middle;
}

/* ---------- Report PDF ----------
   The on-screen report is dark; the exported sheet is paper. These rules
   are scoped to #reportPdfDoc (the off-screen export sheet) so the PDF
   prints dark-on-light, tables run full height (the screen's scroll caps
   would clip rows in the PDF), and rows don't split across pages. */
.report-pdf-meta {
  font: 11px/1.5 var(--font-mono);
  color: #6b7280;
  margin-bottom: 14px;
}

#reportPdfDoc .report {
  background: transparent;
  border: none;
  padding: 0;
}

/* Typography: Kode Mono throughout (replaces Inter + JetBrains Mono)
   Mono for anything that is data (the result table) or code. The on-screen
   report is mono throughout, but a long printed document reads better with a
   text face — only the export sheet changes. */
#reportPdfDoc .report-line {
  font-family: "Kode Mono", monospace;
  font-size: 12px;
}

#reportPdfDoc .report-line code {
  font-family: var(--font-mono);
}

#reportPdfDoc .report-line,
#reportPdfDoc .report-line strong,
#reportPdfDoc .report-line.report-ai-head {
  color: #1b1f27;
}

#reportPdfDoc .report-line.report-head {
  color: #b45309;
}

#reportPdfDoc .rep-bullet {
  color: #b45309;
}

#reportPdfDoc .report-line.report-quote {
  color: #4b5563;
}

#reportPdfDoc .report-line code {
  color: #b45309;
  background: #fef3c7;
  border-color: #fde68a;
}

#reportPdfDoc .report-ai-block {
  border-left-color: #d97706;
}

#reportPdfDoc .report-ai-badge {
  color: #b45309;
  background: #fef3c7;
  border-color: #fde68a;
}

#reportPdfDoc .table-wrap,
#reportPdfDoc .report .report-table {
  max-height: none !important;
  overflow: visible !important;
  background: #fff;
  border-color: #d1d5db;
}

#reportPdfDoc .data-table thead th {
  position: static;
  background: #f3f4f6;
  color: #374151;
  border-bottom: 1px solid #d1d5db;
  white-space: normal;
  overflow-wrap: anywhere;
  padding-left: 6px;
  padding-right: 6px;
}

#reportPdfDoc .data-table tbody td {
  color: #1b1f27;
  border-bottom: 1px solid #e5e7eb;
  white-space: normal;
  overflow-wrap: anywhere;
  padding-left: 6px;
  padding-right: 6px;
}

#reportPdfDoc .data-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

#reportPdfDoc .data-table tbody tr:hover {
  background: transparent;
}

#reportPdfDoc .data-table .td-num {
  color: #b45309;
}

#reportPdfDoc .data-table .td-dim {
  color: #6b7280;
}

#reportPdfDoc .data-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.dl-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Download: one button, the formats live inside a small menu. It opens upward
   because this row sits at the bottom of a scrolling panel, so a downward
   menu would be clipped by .main-content's overflow. */
.dl-menu-wrap {
  position: relative;
}

.dl-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 176px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.dl-menu-item {
  width: 100%;
  justify-content: flex-start;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  border-color: transparent;
  background: transparent;
  color: var(--white);
  text-align: left;
}

.dl-menu-item:hover:not([disabled]) {
  background: var(--bg-hover);
  border-color: var(--slate);
}

/* Gated formats stay clickable so the click can explain the gate. */
.dl-menu-item.anon-gated {
  pointer-events: auto;
  cursor: pointer;
}

/* --- Semicolon-to-CSV conversion notice --- */

.semicolon-banner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 12px 16px;
  width: 100%;
  font-family: 'Kode Mono', monospace;
  gap: 16px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
}

.semicolon-banner__message {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.semicolon-banner__icon {
  flex-shrink: 0;
}

.semicolon-banner__text {
  font-size: 13px;
  color: #e6edf3;
  white-space: nowrap;
}

.semicolon-banner__text strong {
  font-weight: 600;
  color: #f59e0b;
}

.semicolon-banner__spacer {
  flex: 1;
  min-width: 8px;
}

.semicolon-banner__actions {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.semicolon-banner__convert-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--blue-light);
  color: #e6edf3;
  font-family: 'Kode Mono', monospace;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.semicolon-banner__convert-btn:hover {
  background: rgba(240, 160, 32, 0.1);
  border-color: #60a5fa;
}

.semicolon-banner__convert-btn svg {
  flex-shrink: 0;
}

.semicolon-banner__subtext {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #10b981;
  white-space: nowrap;
}

.semicolon-banner__close {
  background: none;
  border: none;
  color: #8b949e;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.semicolon-banner__close:hover {
  color: #e6edf3;
}

/* --- Code preview modal --- */

.code-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 20, 0.72);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.code-preview-modal {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  width: 90%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: code-modal-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes code-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.code-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate);
}

.code-preview-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

.code-preview-title svg {
  color: var(--blue-light);
}

.code-preview-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 16px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.code-preview-close:hover {
  color: var(--white);
  background: var(--bg-hover);
}

.code-preview-code {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 20px;
  background: var(--ink);
  border: none;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #8b949e;
  white-space: pre;
  tab-size: 4;
}

.code-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--slate);
}

.code-preview-lang {
  font-size: 11px;
  color: var(--dim);
}

/* Code block container & syntax highlighting (Spec 1.13c) */
.code-block-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-radius: 8px;
  border: 1px solid var(--slate);
  background: #09090b;
  overflow: hidden;
  margin: 16px 20px;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--slate);
  background: #18181b;
}

.code-block-lang {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #71717a;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.code-block-copy-btn {
  font-size: 11px;
  color: #a1a1aa;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.code-block-copy-btn:hover {
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.08);
}

.code-block-copy-btn.copied {
  color: #34d399;
}

.code-preview-code.code-block-pre {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 24rem;
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  background: transparent;
  color: #e4e4e7;
  /* Block, not table: Chrome computes overflow-y as *visible* on
     display:table boxes, which silently killed the 24rem scroll cap
     (long code clipped instead of scrolling — spec 1.13c #6). The line
     rows below do the layout instead. */
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.code-block-line {
  display: flex;
}

.code-block-line-num {
  flex: 0 0 2rem;
  padding-right: 16px;
  text-align: right;
  user-select: none;
  -webkit-user-select: none;
  color: #52525b;
  width: 2rem;
  min-width: 2rem;
  font-variant-numeric: tabular-nums;
}

.code-block-line-content {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre;
}

.token.keyword { color: #569cd6; font-weight: 500; }
.token.function { color: #dcdcaa; }
.token.string { color: #ce9178; }
.token.number { color: #b5cea8; }
.token.comment { color: #6a9955; font-style: italic; }
.token.operator { color: #d4d4d4; }
.token.punctuation { color: #d4d4d4; }
.token.boolean { color: #569cd6; font-weight: 500; }
.token.builtin { color: #4ec9b0; }
.token.class-name { color: #4ec9b0; }
.token.variable { color: #9cdcfe; }
.token.plain { color: #e4e4e7; }

/* ==========================================================================
   LANDING INTERACTIONS — polish only, no feature changes
   ========================================================================== */

/* --- Brand logo nudge --- */

.landing .brand-logo {
  transition: transform var(--transition-modal);
}
.landing .brand:hover .brand-logo {
  transform: translateX(2px);
}

/* --- Hero entrance + caret --- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-inner > * {
  animation: rise-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.hero-inner > *:nth-child(2) {
  animation-delay: 0.1s;
}
.hero-inner > *:nth-child(3) {
  animation-delay: 0.18s;
}
.hero-inner > *:nth-child(4) {
  animation-delay: 0.26s;
}
.hero-inner > *:nth-child(5) {
  animation-delay: 0.34s;
}

.hero-tag::after {
  content: "▍";
  margin-left: 7px;
  color: var(--blue-light);
  animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

/* --- CTA buttons: shine sweep + lift --- */

.landing .btn-primary {
  position: relative;
  overflow: hidden;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.landing .btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left 0.5s ease;
}

/* Hover feedback is fill-only: no drop shadow, no lift. The shadow read as a
   floating card rather than a button, and contradicted the flat-chrome spec. */
.landing .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.landing .btn-primary:active {
  background: var(--accent-active);
  border-color: var(--accent-active);
  transform: translateY(1px);
}

.landing .btn-primary:hover::before {
  left: 140%;
}

.landing .btn svg {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.landing .btn:hover svg {
  transform: translateX(3px);
}

/* --- Scroll reveal (class added by JS — content visible without JS) ---
   Animation-based so it never touches the `transition` property
   (hover transitions on cards/steps stay intact). */

@keyframes reveal-in {
  from {
    opacity: 0;
    translate: 0 26px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.reveal {
  opacity: 0;
}
.reveal.in {
  animation: reveal-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Feature cards use the quicker, shorter-travel variant: 150ms fade +
   slight upward slide, staggered 50ms per card by script.js (animationDelay).
   Same rules as above: JS only ever adds .reveal when motion is allowed. */
@keyframes reveal-card-in {
  from {
    opacity: 0;
    translate: 0 12px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
.feature-card.reveal.in {
  animation: reveal-card-in 150ms ease-out both;
}

/* ==========================================================================
   SETTINGS MODAL — same hover language as the landing page
   ========================================================================== */

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  animation: settings-fade-in 0.2s ease;
}
.settings-overlay.settings-fade-out {
  animation: settings-fade-out 0.2s ease forwards;
}

.settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 820px;
  min-height: min(640px, 88vh);
  max-height: 88vh;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  animation: settings-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Preview Code locked (anonymous): blurred body, overlay, no selection */
.preview-code-locked {
  position: relative;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.preview-code-locked * {
  user-select: none !important;
  pointer-events: none !important;
}
.preview-code-overlay,
.preview-code-overlay * {
  pointer-events: auto !important;
  user-select: none !important;
}
.preview-code-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, rgba(9,9,11,0.7), rgba(9,9,11,0.85), rgba(9,9,11,1));
}
.preview-code-overlay-inner {
  max-width: 28rem;
  text-align: center;
  padding: 0 24px;
}

.settings-modal.settings-fade-out {
  animation: settings-out 0.2s ease forwards;
}

.sessions-lock {
  color: var(--amber);
}


/* Anonymous single-panel settings: no nav, quiet token notice */
.settings-modal--anon {
  flex-direction: column;
  overflow-y: auto;
}
.settings-content--anon {
  overflow: visible;
}
.settings-anon-notice {
  margin: 8px 20px;
  padding: 14px 0;
  border-top: 1px solid var(--slate);
  border-bottom: 1px solid var(--slate);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-anon-section {
  padding: 16px 20px 8px;
}
.settings-anon-footer {
  padding: 4px 4px 16px;
}

@keyframes settings-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes settings-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes settings-in {
  from { opacity: 0; transform: translate(-50%, -47%) scale(0.98); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes settings-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -52%) scale(0.98); }
}

/* ── Sidebar panel ── */
.settings-sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--ink);
  border-right: 1px solid var(--slate);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  overflow-y: auto;
}

.settings-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 12px 12px 12px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.settings-close:hover {
  color: var(--white);
  background: var(--bg-hover);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.settings-signout {
  color: #f87171;
  width: calc(100% - 16px);
  margin: 0 8px;
  border-radius: var(--radius-sm);
}
.settings-signout:hover {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}
.settings-nav-item i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
/* Inline arrow icons sit beside the label, not in the leading icon slot —
   scale them to the surrounding text instead of the 15px slot size. */
.settings-nav-item .fi {
  font-size: 0.8em;
  width: auto;
  margin-left: 4px;
  vertical-align: baseline;
}
.settings-nav-item:hover {
  color: var(--white);
  background: var(--bg-hover);
}
.settings-nav-item.active {
  color: var(--white);
  background: var(--bg-hover);
}

.settings-nav-label {
  padding: 18px 16px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.settings-sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--slate);
  padding-top: 8px;
}

/* ── Content panel ── */
.settings-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 32px 36px;
}

.settings-h3 {
  color: var(--white);
  font-size: 14px;
  margin: 0 0 16px 0;
  font-weight: 600;
}

/* Cards — hover lift + amber border + soft shadow (landing card language) */
.settings-card {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 20px;
  transition:
    transform var(--transition-modal),
    border-color var(--transition-modal),
    box-shadow var(--transition-modal);
}
.settings-card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 160, 32, 0.35);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.7);
}

.settings-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.settings-input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  color: var(--white);
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}

/* ── Help center ── */

.help-search {
  position: relative;
  margin-bottom: 24px;
}
.help-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
/* Reuses the existing input component, just makes room for the icon */
.help-search .settings-input {
  padding-left: 34px;
}

.help-category {
  margin-bottom: 24px;
}
.help-category-title {
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px 0;
}

.help-item {
  background: var(--bg-card, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.help-item:hover {
  border-color: #2a3140;
}

.help-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  color: var(--white);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.help-question:hover {
  background: var(--bg-hover);
}
.help-question i {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform var(--transition-modal);
}
.help-item.open .help-question i {
  transform: rotate(180deg);
}

.help-answer {
  display: none;
  padding: 0 14px 12px 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.help-item.open .help-answer {
  display: block;
}

.help-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 32px 0;
}

/* Primary amber button — minimal lift + glow */
.settings-btn-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--blue);
  border: none;
  color: var(--on-accent);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition-modal),
    transform var(--transition-modal),
    box-shadow var(--transition-modal);
}
.settings-btn-primary:hover {
  background: var(--blue-hover);
}
.settings-btn-primary:active {
  background: #D4901E;
  transform: translateY(0) scale(0.98);
}

/* Amber outline button */
.settings-btn-amber {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue-light);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition-modal),
    border-color var(--transition-modal),
    box-shadow var(--transition-modal);
}
.settings-btn-amber:hover {
  background: var(--blue-glow);
  border-color: var(--blue-hover);
}
.settings-btn-amber:active {
  transform: scale(0.98);
}

/* Ghost button (footer Close) */
.settings-btn-ghost {
  background: transparent;
  border: 1px solid var(--slate);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-modal),
    border-color var(--transition-modal);
}
.settings-btn-ghost:hover {
  background: var(--bg-hover);
  border-color: #2a3140;
}
.settings-btn-ghost:active {
  transform: scale(0.98);
}

/* Danger buttons (Logout / Delete account) */
.settings-btn-danger {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--transition-modal),
    border-color var(--transition-modal);
}
.settings-btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
}
.settings-btn-danger:active {
  transform: scale(0.98);
}
.settings-btn-danger + .settings-btn-danger {
  margin-top: 8px;
}

/* Plan card upgrade button */
.settings-plan-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition-modal),
    transform var(--transition-modal),
    box-shadow var(--transition-modal);
}
.settings-plan-btn:hover {
  background: var(--blue-hover);
}
.settings-plan-btn:active {
  background: #D4901E;
  transform: translateY(0) scale(0.98);
}
.settings-plan-btn:disabled {
  border-color: var(--slate);
  background: transparent;
  color: var(--dim);
  cursor: default;
  box-shadow: none;
}
.settings-plan-btn:disabled:hover {
  transform: none;
}

/* Active sessions (Security tab) — Clerk-backed list */
.settings-sessions-note {
  color: var(--muted);
  font-size: 12px;
}

.settings-session-signout {
  background: transparent;
  border: 1px solid var(--slate);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}
.settings-session-signout:hover {
  color: var(--white);
  border-color: var(--dim);
  background: var(--bg-hover);
}
.settings-session-signout:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-title {
    font-size: 44px;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 460px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ba-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 232px;
  }
}

@media (max-width: 1024px) {
  header:has(.landing-hamburger) .landing-links {
    display: none;
  }
}

@media (max-width: 1023px) {
  .landing-links .nav-hide-lg,
  .landing-links .nav-dd {
    display: none;
  }
}

@media (max-width: 768px) {
  .landing-links {
    display: none;
  }
  .hero {
    /* The header wrap is 72px tall (16px offset + 56px pill) and fixed, so a
       56px top pad tucked the first hero element underneath it on phones. */
    padding-top: 84px;
  }
  .hero-title {
    font-size: 36px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }

  /* App: sidebar off-canvas */
  .hamburger {
    display: grid;
  }
  .nav-user {
    display: none;
  }

  .sidebar {
    position: absolute;
    top: var(--navbar-h);
    bottom: 0;
    left: 0;
    z-index: 60;
    width: var(--sidebar-w);
    height: auto;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
  }

  .app.sb-open .sidebar {
    transform: translateX(0);
  }
  .app.sb-open .workspace::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 55;
    background: rgba(11, 14, 20, 0.6);
  }

  /* Desktop collapse toggle is hidden on mobile — hamburger owns the sidebar. */
  .tab-sidebar {
    display: none;
  }
  .app.sb-collapsed .sidebar {
    display: flex;
  }

  .workspace {
    position: relative;
  }
  .main-content {
    padding: 20px 18px 40px;
  }
  .dropzone,
  .upload-limit {
    width: 92%;
  }
  .upgrade-inline {
    flex-direction: column;
  }
  .upg-actions {
    flex-direction: row;
  }
  .upg-actions .btn {
    flex: 1;
  }

  /* Semicolon banner: allow wrap on mobile */
  .semicolon-banner {
    flex-wrap: wrap;
  }
  .semicolon-banner__spacer {
    display: none;
  }
  .semicolon-banner__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  /* Hero callout tags: hide on mobile */
  .callout {
    display: none;
  }
}

@media (max-width: 560px) {
  /* Landing nav: brand + auth skeleton/CTAs used to overflow 375px by ~55px
     (CTA half off-screen). Tighten gap, padding and .btn-sm sizing — the
     skeleton is resized to match the buttons it stands in for. */
  .landing-nav-inner {
    gap: 14px;
    padding: 0 14px;
  }
  .landing-cta {
    gap: 8px;
  }
  .landing-cta .btn-sm {
    padding: 6px 10px;
    font-size: 12.5px;
  }
  .landing-cta .btn-sm svg {
    display: none;
  }
  .landing-auth-sk {
    height: 32px;
  }
  .landing-auth-sk--ghost {
    width: 58px;
  }
  .landing-auth-sk--primary {
    width: 124px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-meta {
    font-size: 11px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .app-navbar-right .btn {
    display: none;
  }
  .shot-body {
    grid-template-columns: 1fr;
  }
  .shot-sidebar {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Semicolon banner: tighten for small phones */
  .semicolon-banner {
    padding: 10px 12px;
  }
  .semicolon-banner__subtext {
    display: none;
  }
  .semicolon-banner__convert-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ---------- Custom confirm modal ---------- */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.15s ease forwards;
}

.confirm-modal {
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 28px 32px 24px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(8px) scale(0.97);
  animation: confirmSlideIn 0.2s ease forwards;
}

.confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 8px;
}

.confirm-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

.confirm-body .mono {
  color: var(--blue);
  font-family: var(--font-mono);
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes confirmSlideIn {
  to { transform: translateY(0) scale(1); }
}

/* ---------- Anonymous trial gating ---------- */
.anon-gated {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}
.anon-gated::after {
  content: "Sign up to unlock";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}
/* Hide the text overlay on tabs and buttons — use lock icon instead */
.tab.anon-gated::after,
.btn.anon-gated::after {
  display: none;
}
.tab.anon-gated::after {
  top: auto;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
}

/* Inspect lock icon — hidden by default, shown only when parent is gated.
   display:none (not opacity) so the icon takes no space and the pill stays
   centered on the "Inspect" text. */
.inspect-lock {
  display: none;
  flex-shrink: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}
/* Show lock icon when parent has gated class */
.tab.anon-gated .inspect-lock {
  display: block;
  opacity: 0.7;
  color: var(--muted);
}
.btn.anon-gated {
  cursor: pointer;
  pointer-events: auto;
}
.btn.anon-gated:hover {
  opacity: 0.9;
}
/* Pro-locked download buttons — dimmed, still clickable so the click can
   explain the Pro gate. */
.pro-lock {
  opacity: 0.7;
  cursor: pointer;
}
.pro-lock:hover {
  opacity: 0.9;
}

/* Hover feedback on gated tab — reads as clickable, not dead */
.tab.anon-gated {
  pointer-events: auto;
  cursor: pointer;
}
.tab.anon-gated:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.03);
}
.tab.anon-gated:hover .inspect-lock {
  opacity: 1;
  color: var(--white);
}
.tab.anon-gated::after {
  display: none;
}

/* ── Get Started Free popup ─────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

.get-started-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--transition-modal);
}
.get-started-popup-overlay.open {
  opacity: 1;
}

.get-started-popup-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 100%;
  max-width: 800px;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  transform: translateY(10px);
  transition: transform var(--transition-modal);
}
.get-started-popup-card.open {
  transform: translateY(0);
}

.get-started-popup-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.5) 50%, transparent 50%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  background-size: 100% 4px, 4px 100%;
  pointer-events: none;
  border-radius: 4px;
}

.get-started-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-dev);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
  min-width: 52px;
  height: 32px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.get-started-popup-close:hover {
  color: var(--amber);
  border-color: var(--amber);
  text-shadow: 0 0 8px var(--amber);
  animation: devBlink 0.15s infinite alternate;
}

@keyframes devBlink {
  0% { transform: scale(1); color: var(--amber); }
  100% { transform: scale(1.2); color: var(--yellow); }
}

.get-started-popup-header {
  padding: 32px 32px 24px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.get-started-popup-header-content {
  flex: 1;
  padding-right: 64px;
}

.get-started-popup-status-line {
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  font-family: var(--font-dev);
}

.get-started-popup-status-line span {
  font-weight: 700;
  text-shadow: 0 0 6px var(--green-glow);
}

.get-started-popup-title {
  font-family: var(--font-dev);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-bright);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
  margin: 0 0 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.get-started-popup-title::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 26px;
  background-color: var(--amber);
  margin-left: 10px;
  animation: blink 1s step-start infinite;
  box-shadow: 0 0 8px var(--amber-glow);
}

@keyframes blink {
  50% { opacity: 0; }
}

.get-started-popup-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
  max-width: 100%;
  font-family: var(--font-dev);
  margin: 0;
}

.get-started-popup-content {
  padding: 32px;
  position: relative;
  z-index: 1;
}

.get-started-popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.get-started-popup-card-col {
  border: 1px dashed var(--border);
  background: transparent;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s;
}

.get-started-popup-card-col:hover {
  border-color: var(--text);
}

.get-started-popup-cross {
  position: absolute;
  font-family: var(--font-dev);
  color: var(--border);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: color 0.2s, text-shadow 0.2s;
  pointer-events: none;
  z-index: 2;
}

.get-started-popup-cross.tl { top: -10px; left: -6px; }
.get-started-popup-cross.tr { top: -10px; right: -6px; }
.get-started-popup-cross.bl { bottom: -10px; left: -6px; }
.get-started-popup-cross.br { bottom: -10px; right: -6px; }

.get-started-popup-card-col:hover .get-started-popup-cross,
.get-started-popup-card-col:focus-within .get-started-popup-cross {
  color: var(--amber);
  text-shadow: 0 0 10px var(--amber), 0 0 20px var(--yellow);
  animation: devBlink 0.15s infinite alternate;
}

.get-started-popup-card-col.primary {
  border-color: var(--amber);
  box-shadow: inset 0 0 20px rgba(240, 160, 32, 0.05);
}

.get-started-popup-card-col.primary .get-started-popup-cross { color: var(--amber); }
.get-started-popup-card-col.primary:hover .get-started-popup-cross {
  color: var(--yellow);
  text-shadow: 0 0 15px var(--yellow);
}

.get-started-popup-card-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  text-transform: uppercase;
  font-family: var(--font-dev);
}

.get-started-popup-card-tag.muted { color: var(--text); }
.get-started-popup-card-tag.amber { color: var(--amber); text-shadow: 0 0 6px var(--amber-glow); }

.get-started-popup-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 24px;
  min-height: 30px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--font-dev);
}

.get-started-popup-features {
  list-style: none;
  margin-bottom: 32px;
  flex-grow: 1;
}

.get-started-popup-features li {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  line-height: 1.5;
  font-family: var(--font-dev);
}

.get-started-popup-features li::before {
  content: '[x]';
  color: var(--green);
  text-shadow: 0 0 4px var(--green-glow);
  font-family: var(--font-dev);
  font-weight: 700;
  margin-right: 12px;
  font-size: 13px;
  flex-shrink: 0;
}

.get-started-popup-btn {
  width: 100%;
  padding: 16px 14px;
  background: transparent;
  color: var(--text-bright);
  border: 1px solid var(--border);
  font-family: var(--font-dev);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
}

.get-started-popup-btn::before { content: '[ '; color: var(--border); margin-right: 8px; transition: color 0.2s; font-weight: 400;}
.get-started-popup-btn::after { content: ' ]'; color: var(--border); margin-left: 8px; transition: color 0.2s; font-weight: 400;}

.get-started-popup-btn:hover, .get-started-popup-btn:active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text);
}

.get-started-popup-btn:hover::before, .get-started-popup-btn:hover::after,
.get-started-popup-btn:active::before, .get-started-popup-btn:active::after { color: var(--text); }

.get-started-popup-card-col.primary .get-started-popup-btn {
  border-color: var(--amber);
  color: var(--amber);
  text-shadow: 0 0 6px var(--amber-glow);
}

.get-started-popup-card-col.primary .get-started-popup-btn::before,
.get-started-popup-card-col.primary .get-started-popup-btn::after { color: var(--amber); font-weight: 400;}

.get-started-popup-card-col.primary .get-started-popup-btn:hover,
.get-started-popup-card-col.primary .get-started-popup-btn:active {
  background: rgba(240, 160, 32, 0.1);
  box-shadow: 0 0 15px rgba(240, 160, 32, 0.2);
}

@media (max-width: 640px) {
  .get-started-popup-overlay { padding: 12px; }
  .get-started-popup-card { max-width: 100%; }
  .get-started-popup-header { padding: 24px 20px 20px; flex-direction: column; }
  .get-started-popup-header-content { padding-right: 0; }
  .get-started-popup-close { top: 10px; right: 10px; height: 28px; min-width: 46px; padding: 0 8px; font-size: 11px; }
  .get-started-popup-content { padding: 20px; }
  .get-started-popup-grid { grid-template-columns: 1fr; gap: 20px; }
  .get-started-popup-card-col { padding: 20px; }
  .get-started-popup-title { font-size: 20px; }
  .get-started-popup-title::after { height: 20px; width: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .get-started-popup-card-col:hover .get-started-popup-cross,
  .get-started-popup-card-col:active .get-started-popup-cross {
    animation: none;
    transform: scale(1.1);
  }
}/* ── Inspect locked popup ─────────────────────────────────────────────── */
.inspect-popup {
  position: fixed;
  min-width: 260px;
  max-width: 300px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  z-index: 9000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
}
.inspect-popup.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.inspect-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.inspect-popup-icon {
  color: var(--amber);
  flex-shrink: 0;
}
.inspect-popup-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}
.inspect-popup-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}
.inspect-popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.inspect-popup-actions .btn {
  padding: 6px 14px;
  font-size: 12.5px;
}
.inspect-popup-actions .btn:active {
  transform: scale(0.97);
}
.inspect-popup-later {
  background: transparent;
  border: 1px solid var(--slate);
  color: var(--muted);
}
.inspect-popup-later:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}
.inspect-popup-signup {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-accent);
}
.inspect-popup-signup:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}
.inspect-popup-signup:active {
  background: #D4901E;
  border-color: #D4901E;
}
@keyframes inspectLockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1.5px); }
  80% { transform: translateX(1.5px); }
}
.inspect-lock.shake {
  animation: inspectLockShake 0.35s ease;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Landing page — subtle looping functional motion
   Four demos, one per product behavior: the hero AI query typing out a
   query and its result table populating, the token meter breathing, the
   before/after panes crossfading, and the auto-picked chart bars growing.
   Nothing here is applied unless script.js adds .fx-armed (never added
   under prefers-reduced-motion) — the authored static styles above ARE the
   reduced-motion / no-JS end-state. .fx-run (toggled per viewport entry)
   un-pauses each root, so off-screen sections stay frozen mid-loop.
   ========================================================================== */

/* --- Hero mockup: AI query line (script.js types rotating example queries
   into .shot-input-text when armed; result rows populate only once a query
   finishes typing, via .fx-query-done on .hero-shot) --- */
.shot-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 14px 0;
  padding: 7px 10px;
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  font-size: 11px;
  line-height: 1.45;
  color: var(--white);
}

.shot-input-text {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
}

.shot-input-caret {
  display: inline-block;
  flex-shrink: 0;
  width: 1.5px;
  height: 12px;
  background: var(--blue);
  border-radius: 1px;
}

/* --- Item 2: token meter fill breathes (active usage) --- */
@keyframes fx-meter-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* --- Item 3: before/after panes crossfade emphasis --- */
@keyframes fx-pane-before {
  0%,
  35% {
    opacity: 1;
  }
  50%,
  85% {
    opacity: 0.45;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fx-pane-after {
  0%,
  35% {
    opacity: 0.45;
  }
  50%,
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0.45;
  }
}

/* --- Item 4: chart bars grow → hold → reset --- */
@keyframes fx-bar-grow {
  0%,
  5% {
    transform: scaleY(0);
  }
  40% {
    transform: scaleY(1);
  }
  88% {
    transform: scaleY(1);
  }
  95%,
  100% {
    transform: scaleY(0);
  }
}

.fx-armed .shot-input-caret {
  animation: caret-blink 1.1s steps(1) infinite;
}

/* Result rows stay hidden until the JS typewriter reports a finished query
   (.fx-query-done), then fade in with a short per-row stagger. */
.fx-armed .shot-tr:not(.shot-th) {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.fx-armed.fx-query-done .shot-tr:not(.shot-th) {
  opacity: 1;
}
.fx-armed .shot-tr:nth-child(3):not(.shot-th) {
  transition-delay: 0.06s;
}
.fx-armed .shot-tr:nth-child(4):not(.shot-th) {
  transition-delay: 0.12s;
}
.fx-armed .shot-tr:nth-child(5):not(.shot-th) {
  transition-delay: 0.18s;
}
.fx-armed .shot-tr:nth-child(6):not(.shot-th) {
  transition-delay: 0.24s;
}

.fx-armed .sb-meter-bar i {
  animation: fx-meter-pulse 5s ease-in-out infinite;
}

.fx-armed .fp-pane:not(.fp-pane--after) {
  animation: fx-pane-before 8s ease-in-out infinite;
}

.fx-armed .fp-pane--after {
  animation: fx-pane-after 8s ease-in-out infinite;
}

.fx-armed .fp-chart i {
  transform-origin: bottom;
  animation: fx-bar-grow 7s ease-in-out infinite backwards;
}
.fx-armed .fp-chart i:nth-child(2) {
  animation-delay: 0.12s;
}
.fx-armed .fp-chart i:nth-child(3) {
  animation-delay: 0.24s;
}
.fx-armed .fp-chart i:nth-child(4) {
  animation-delay: 0.36s;
}
.fx-armed .fp-chart i:nth-child(5) {
  animation-delay: 0.48s;
}

/* Armed = applied but frozen until the section is on-screen (.fx-run). */
.fx-armed .shot-input-caret,
.fx-armed .sb-meter-bar i,
.fx-armed .fp-pane,
.fx-armed .fp-chart i {
  animation-play-state: paused;
}

.fx-run .shot-input-caret,
.fx-run .sb-meter-bar i,
.fx-run .fp-pane,
.fx-run .fp-chart i {
  animation-play-state: running;
}

/* Loops off: static end-state (full query, populated rows, full bars).
   Overrides the blanket 0.01ms reduced-motion rule above so infinite
   keyframes never strobe — animation-name is dropped entirely. */
@media (prefers-reduced-motion: reduce) {
  .fx-armed .shot-input-caret,
  .fx-armed .sb-meter-bar i,
  .fx-armed .fp-pane,
  .fx-armed .fp-chart i {
    animation: none !important;
  }
}

/* ---------- Waitlist modal (payments are not live yet) ----------
   Raised by the pricing CTAs, the settings Billing tab and the workspace's
   inline upgrade card. Amber accent, 6px radii, 1px hairlines — and NO
   shadows (launch spec: flat surfaces only). z-index 11000 keeps it above
   the settings modal (9998/9999) and the toast stack (10000), so either
   page can raise it over its own chrome. */
.waitlist-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(10, 10, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.waitlist-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 26px 26px 22px;
}
.waitlist-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
.waitlist-close:hover {
  color: var(--white);
}
.waitlist-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.waitlist-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--blue-light);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  margin-bottom: 14px;
}
.waitlist-title {
  margin: 0 0 8px;
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
}
.waitlist-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.waitlist-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.waitlist-input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--slate);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 11px 12px;
  margin-bottom: 10px;
}
.waitlist-input::placeholder {
  color: var(--dim);
}
.waitlist-input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-color: var(--blue);
}
.waitlist-error {
  color: var(--red);
  font-size: 12px;
  margin: -4px 0 10px;
}
.waitlist-note {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

/* ---------- Trust & differentiation ("Why DataForge") ----------
   Same surface as .feature-card (steel + hairline slate + 6px radius + amber
   icon chip), minus the mouse-spotlight ::before and minus hover shadows —
   launch spec: flat surfaces only. The grid reuses .feature-grid, so the
   existing 2-col @1024 / 1-col @768 rules stack these cards for free. */
.trust-card {
  position: relative;
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 22px;
  transition:
    transform var(--transition-modal),
    border-color var(--transition-modal);
}
.trust-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 160, 32, 0.45);
}
.trust-card:hover h3 {
  color: var(--blue-light);
}
.trust-card:hover .f-icon {
  transform: translateY(-3px) scale(1.07) rotate(-3deg);
  background: rgba(240, 160, 32, 0.18);
  border-color: rgba(240, 160, 32, 0.5);
}
.trust-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  transition: color var(--transition-modal);
}
.trust-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Chart fallback suggestion chips ----------
   Shown only with the "No chart fits this result shape" message; each chip
   inserts its prompt into the AI Query textarea. */
.chart-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.chart-chips-label {
  font-size: 12px;
  color: var(--dim);
}
.chart-chip {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--steel);
  border: 1px solid var(--slate);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 30px;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.chart-chip:hover {
  color: var(--blue-light);
  border-color: rgba(240, 160, 32, 0.45);
}
.chart-chip:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app,
.settings-modal {
  --ink: #0a0a0c;
  --steel: #121215;
  --slate: #27272a;
  --muted: #8b949e;
  --dim: #52525b;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-card: #0a0a0c;
  --blue-glow: rgba(240, 160, 32, 0.1);
  --radius-sm: 4px;
  --radius-md: 4px;
  --radius-lg: 4px;
}

.app .workspace {
  background-color: var(--ink);
  background-image: radial-gradient(rgba(39, 39, 42, 0.55) 1px, transparent 1px);
  background-size: 24px 24px;
}

.app .app-navbar {
  background: #0a0a0c;
  border-bottom-color: #27272a;
}

.app .brand {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app .nav-tokens {
  border-radius: 2px;
  border-color: #27272a;
  background: #121215;
  padding: 4px 9px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app .tabbar {
  gap: 0;
  padding: 0 20px;
  border-bottom-color: #27272a;
}

.app .tab {
  align-self: stretch;
  height: 100%;
  margin: 0;
  padding: 0 15px;
  border: 1px solid transparent;
  border-top: 2px solid transparent;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app .tab:hover {
  color: #e5e4e2;
  background: #121215;
}

.app .tab.active {
  color: #f0a020;
  background: #121215;
  border-color: #27272a;
  border-top-color: #f0a020;
}

.app .tab:disabled {
  opacity: 0.32;
}

.app .tab-sidebar {
  padding: 0 10px;
  border: 0;
  background: transparent;
}

.app .tab-sidebar:hover {
  color: #8b949e;
  background: transparent;
}

.app .tab-sidebar .fi {
  border-radius: 2px;
}

.app .tab-check {
  color: #f0a020;
}

.app .sidebar {
  background: #121215;
  border-right-color: #27272a;
}

.app .sb-section {
  padding: 16px 12px 6px;
}

.app .sb-label {
  padding: 0 8px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #52525b;
}

.app .sb-label::before {
  content: "[ ";
}

.app .sb-label::after {
  content: " ]";
}

.app .file-list {
  counter-reset: df-file;
}

.app .file-item {
  counter-increment: df-file;
  justify-content: flex-start;
  padding: 8px 8px 8px 10px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 2px;
}

.app .file-item::before {
  content: counter(df-file, decimal-leading-zero);
  width: 18px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #52525b;
}

.app .file-item:hover {
  background: #0a0a0c;
}

.app .file-item.active {
  background: rgba(240, 160, 32, 0.06);
  border-color: #27272a;
  border-left-color: #f0a020;
}

.app .file-item.active::before {
  color: #f0a020;
}

.app .file-remove {
  margin-left: auto;
  border-radius: 2px;
}

.app .add-file {
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app .col-row,
.app .hist-item {
  border-radius: 2px;
}

.app .hist-item:hover {
  background: #0a0a0c;
}

.app .sb-footer {
  gap: 10px;
  padding: 14px 12px 16px;
  border-top-color: #27272a;
}

.app .token-meter {
  padding: 14px;
  border-color: #27272a;
  border-radius: 4px;
  background: #121215;
}

@media (hover: hover) {
  .app .token-meter:hover {
    border-color: #f0a020;
    background: #121215;
    transform: none;
  }
}

.app .tm-count-num {
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: -0.06em;
}

.app .tm-count-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b949e;
}

.app .tm-plan,
.app .tm-plan.trial {
  padding: 3px 6px;
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 2px;
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
  font-family: var(--font-mono);
}

.app .tm-plan[data-tier="free"] {
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.app .tm-plan[data-tier="pro"],
.app .tm-plan[data-tier="plus"] {
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.1);
}

.app .tm-plan::before {
  content: "[";
  margin-right: 4px;
  opacity: 0.7;
}

.app .tm-plan::after {
  content: "]";
  margin-left: 4px;
  opacity: 0.7;
}

/* The JS hides the star for the anonymous trial via the hidden attribute;
   .tm-sub sets display:block, so [hidden] needs an explicit override. */
.tm-sub[hidden] {
  display: none;
}

.app .tm-sub {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #8b949e;
}

.app .tm-sub::before {
  content: "[ ";
}

.app .tm-sub::after {
  content: " ]";
}

.app .tm-bar {
  height: 8px;
  margin-top: 12px;
  border-radius: 0;
  background: repeating-linear-gradient(
    90deg,
    #27272a 0 8px,
    transparent 8px 11px
  );
  box-shadow: none;
}

.app .tm-fill {
  border-radius: 0;
  background: repeating-linear-gradient(
    90deg,
    #f0a020 0 8px,
    transparent 8px 11px
  );
  box-shadow: none;
}

.app .tm-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-style: normal;
  letter-spacing: 0.02em;
  color: #8b949e;
}

.app .tm-inset {
  border-radius: 2px;
  border-color: #27272a;
  background: #0a0a0c;
}

.app .tm-inset p {
  font-size: 10px;
  color: #8b949e;
}

.app .tm-upgrade {
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app .sb-foot-link {
  padding: 9px 10px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app .main-content {
  padding: 22px 30px 52px;
}

.app .panel-head {
  margin-bottom: 16px;
}

.app .panel-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app .panel-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #8b949e;
}

.app .stat-card,
.app .schema-card,
.app .session-item,
.app .query-card,
.app .ba-card,
.app .panel-card,
.app .inline-card,
.app .upgrade-inline,
.app .data-check {
  border-color: #27272a;
  border-radius: 4px;
  background: #121215;
}

.app .stat-label {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: #52525b;
}

.app .schema-card:hover {
  border-color: rgba(240, 160, 32, 0.45);
  transform: none;
}

.app .dropzone {
  border-color: #27272a;
  border-radius: 4px;
  background: #121215;
}

.app .dropzone:hover {
  border-color: rgba(240, 160, 32, 0.5);
}

.app .dropzone::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  opacity: 0.3;
  background:
    linear-gradient(#f0a020, #f0a020) left top / 12px 1px no-repeat,
    linear-gradient(#f0a020, #f0a020) left top / 1px 12px no-repeat,
    linear-gradient(#f0a020, #f0a020) right top / 12px 1px no-repeat,
    linear-gradient(#f0a020, #f0a020) right top / 1px 12px no-repeat,
    linear-gradient(#f0a020, #f0a020) left bottom / 12px 1px no-repeat,
    linear-gradient(#f0a020, #f0a020) left bottom / 1px 12px no-repeat,
    linear-gradient(#f0a020, #f0a020) right bottom / 12px 1px no-repeat,
    linear-gradient(#f0a020, #f0a020) right bottom / 1px 12px no-repeat;
}

.app .dz-icon {
  border-radius: 2px;
}

.app .dz-title {
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app .dz-meta {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app .table-wrap {
  border-color: #27272a;
  border-radius: 4px;
  background: #0a0a0c;
}

.app .data-table {
  font-variant-numeric: tabular-nums;
}

.app .data-table thead th {
  background: #121215;
  border-bottom: 1px solid #27272a;
  color: #8b949e;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.app .data-table thead th:first-child {
  padding-left: 42px;
}

.app .data-table thead th:first-child::before {
  content: "#";
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #52525b;
  font-size: 9px;
}

.app .data-table tbody {
  counter-reset: df-row;
}

.app .data-table tbody tr {
  counter-increment: df-row;
}

.app .data-table tbody td {
  border-bottom-color: #1f1f23;
  color: #d4d4d8;
}

.app .data-table tbody td:first-child {
  position: relative;
  padding-left: 42px;
}

.app .data-table tbody td:first-child::before {
  content: counter(df-row, decimal-leading-zero);
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #52525b;
  font-size: 9px;
}

.app .data-table tbody tr:nth-child(even) {
  background: #121215;
}

.app .data-table tbody tr:hover {
  background: rgba(240, 160, 32, 0.06);
}

.app .data-table .td-num {
  color: #f0a020;
}

.app .table-note {
  border-top-color: #27272a;
  background: #121215;
}

.app .type-tag {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.app .type-tag::before {
  content: "[";
}

.app .type-tag::after {
  content: "]";
}

.app .query-card {
  padding: 20px;
}

.app .query-textarea {
  border-color: #27272a;
  border-radius: 2px;
  background: #0a0a0c;
  font-size: 13px;
}

.app .query-textarea:focus {
  border-color: #f0a020;
  box-shadow:
    inset 0 0 24px rgba(240, 160, 32, 0.08),
    0 0 0 1px rgba(240, 160, 32, 0.4);
}

.app .terminal-prompt {
  color: #f0a020;
  font-weight: 700;
}

.app .col-hint {
  border-color: #27272a;
  border-radius: 2px;
  background: #0a0a0c;
}

.app .example-chip {
  border-radius: 2px;
  background: #0a0a0c;
  font-size: 10.5px;
}

.app .example-chip::before {
  content: "[RUN: ";
  color: #f0a020;
}

.app .example-chip::after {
  content: " ]";
  color: #f0a020;
}

.app .batch-row {
  border-top-color: #27272a;
}

.app .tag {
  border-radius: 2px;
}

.app .result-subtabs {
  gap: 0;
  border-bottom-color: #27272a;
}

.app .res-tab {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-top: 2px solid transparent;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app .res-tab:hover {
  background: #121215;
  color: #e5e4e2;
}

.app .res-tab.active {
  border-color: #27272a;
  border-top-color: #f0a020;
  border-bottom-color: #121215;
  background: #121215;
  color: #f0a020;
}

.app .ba-title,
.app .dc-title,
.app .panel-card-title {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
}

.settings-overlay {
  background: rgba(0, 0, 0, 0.62);
}

.settings-modal {
  width: 800px;
  max-width: 92vw;
  border-color: #27272a;
  border-radius: 4px;
  background: #121215;
}

.settings-sidebar {
  width: 200px;
  min-width: 200px;
  padding: 10px 0;
  border-right-color: #27272a;
  background: #0a0a0c;
}

.settings-close {
  border-radius: 2px;
}

.settings-nav-item {
  padding: 10px 14px;
  border-left: 2px solid transparent;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b949e;
}

.settings-nav-item:hover {
  background: #121215;
  color: #e5e4e2;
}

.settings-nav-item.active {
  border-left-color: #f0a020;
  background: #121215;
  color: #f0a020;
}

.settings-nav-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #52525b;
}

.settings-content {
  padding: 28px 32px;
  background: #121215;
}

.settings-h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8b949e;
}

.settings-card {
  border-color: #27272a;
  border-radius: 4px;
  background: #0a0a0c;
}

.settings-card:hover {
  border-color: #3f3f46;
  box-shadow: none;
  transform: none;
}

.settings-modal .settings-btn-primary,
.settings-modal .settings-btn-amber,
.settings-modal .settings-btn-ghost,
.settings-modal .settings-btn-danger,
.settings-modal .settings-plan-btn,
.settings-modal .settings-session-signout {
  border-radius: 2px;
}

.settings-modal .settings-btn-danger:hover {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.settings-modal .settings-plan-btn {
  color: var(--on-accent);
}

.settings-content [style*="border-radius: 10px"],
.settings-content [style*="border-radius: 8px"],
.settings-content [style*="border-radius: 12px"] {
  border-radius: 4px !important;
}

.settings-anon-notice {
  border-top-color: #27272a;
  border-bottom-color: #27272a;
  color: #8b949e;
}

.settings-content--anon .settings-anon-section > div[style*="margin-bottom"] {
  padding: 14px 16px;
  border: 1px solid #27272a;
  border-radius: 4px;
  background: #0a0a0c;
}

.settings-content--anon .settings-anon-section ul {
  list-style: square;
}

.settings-content--anon .settings-anon-section li::marker {
  color: #f0a020;
}

#clearTrialDataBtn {
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  border-radius: 2px;
  background: transparent;
  color: #ef4444 !important;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#clearTrialDataBtn:hover {
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

/* Section headers inside the anonymous Data & privacy panel: mono,
   uppercase, muted — same language as the sidebar labels. */
.settings-content--anon .settings-anon-section .settings-nav-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #8b949e;
}

/* ==========================================================================
   LANDING — GLYPH REDESIGN
   Technical dashboard surface: square edges, hairline borders, mono labels,
   dot-grid canvas, one amber action colour and one green verification state.
   ========================================================================== */

.landing {
  --lp-bg: #0a0a0c;
  --lp-surface: #0d0d10;
  --lp-surface-raised: #101014;
  --lp-line: #27272a;
  --lp-line-soft: #1c1c20;
  --lp-text: #e5e4e2;
  --lp-muted: #8b949e;
  --lp-dim: #71717a;
  --lp-accent: #f0a020;
  --lp-green: #10b981;

  background-color: var(--lp-bg);
  background-image: radial-gradient(#27272a 1px, transparent 1px);
  background-size: 24px 24px;
  isolation: isolate;
}

.landing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(240, 160, 32, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(
    180px circle at var(--lp-cursor-x, 50%) var(--lp-cursor-y, 50%),
    rgba(0, 0, 0, 0.95),
    rgba(0, 0, 0, 0.35) 45%,
    transparent 72%
  );
  mask-image: radial-gradient(
    180px circle at var(--lp-cursor-x, 50%) var(--lp-cursor-y, 50%),
    rgba(0, 0, 0, 0.95),
    rgba(0, 0, 0, 0.35) 45%,
    transparent 72%
  );
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.landing.lp-pointer-active::before {
  opacity: 1;
}

/* ---------- Top navigation ---------- */

.landing-header-wrap {
  height: 64px;
}

.landing .landing-nav {
  width: 100%;
  max-width: none;
  height: 64px;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--lp-line);
  border-radius: 0;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: none;
}

.landing .landing-nav-inner {
  max-width: 1280px;
  padding: 0 32px;
  justify-content: space-between;
  gap: 24px;
}

.landing .brand-nav {
  gap: 36px;
  min-width: 0;
}

.landing .landing-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  margin-right: 0;
}

.landing .landing-links > a,
.landing .landing-links > .nav-dd,
.landing .landing-links > .nav-dd > .nav-dd-btn {
  margin-left: 0;
  margin-right: 0;
}

.landing .landing-links a,
.landing .nav-dd-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lp-muted);
}

.landing .landing-links a::after,
.landing .nav-dd-btn::after {
  bottom: -7px;
  height: 1px;
  border-radius: 0;
  background: var(--lp-accent);
}

.landing .landing-links a:hover,
.landing .landing-links a.active,
.landing .nav-dd-btn:hover,
.landing .nav-dd-btn[aria-expanded="true"] {
  color: var(--lp-text);
}

.landing .nav-dd-menu {
  top: calc(100% + 18px);
  padding: 4px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: var(--lp-surface);
}

.landing .nav-dd-menu a {
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.landing #landingAuthActions {
  max-width: none;
  margin-left: 0;
  overflow: visible;
}

.landing .btn {
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: none;
}

.landing .btn-sm {
  min-height: 34px;
  padding: 7px 12px;
}

.landing .btn-primary {
  border-color: var(--lp-accent);
  background: var(--lp-accent);
  color: #0a0a0c;
}

.landing .btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  transform: none;
  box-shadow: none;
}

.landing .btn-primary:active {
  border-color: var(--accent-active);
  background: var(--accent-active);
  transform: none;
}

.landing .btn-primary::before {
  display: none;
}

.landing .btn-ghost {
  border: 1px solid var(--lp-line);
  background: transparent;
  color: var(--lp-muted);
}

.landing .btn-ghost:hover {
  border-color: #3f3f46;
  background: var(--lp-surface);
  color: var(--lp-text);
}

.landing .landing-hamburger {
  width: 42px;
  height: 42px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: transparent;
}

.landing .landing-hamburger:hover {
  border-color: #3f3f46;
  background: var(--lp-surface);
}

.landing .landing-mobile-panel {
  top: 64px;
  left: 0;
  right: 0;
  padding: 20px 24px;
  border: 0;
  border-bottom: 1px solid var(--lp-line);
  border-radius: 0;
  background: rgba(10, 10, 12, 0.98);
}

.landing .landing-mobile-panel a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lp-muted);
}

.landing .landing-mobile-panel a:hover {
  color: var(--lp-accent);
}

.landing .landing-mobile-panel hr {
  border-top-color: var(--lp-line);
}

.landing .landing-mobile-panel .btn {
  width: 100%;
}

/* ---------- Hero ---------- */

.lp-hero {
  position: relative;
  padding: 128px 32px 92px;
  overflow: hidden;
}

.lp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 36%, rgba(240, 160, 32, 0.07), transparent 36%),
    radial-gradient(circle at 82% 62%, rgba(16, 185, 129, 0.045), transparent 34%);
  pointer-events: none;
}

.lp-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 64px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

.lp-hero-copy {
  min-width: 0;
}

.lp-hero-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.lp-eyebrow {
  margin-bottom: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--lp-accent);
  text-transform: uppercase;
}

.lp-beta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: rgba(13, 13, 16, 0.72);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--lp-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.lp-hero-title {
  max-width: 780px;
  font-size: clamp(3.1rem, 5.4vw, 4.85rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: #f4f4f5;
  text-wrap: balance;
}

.lp-hero-sub {
  max-width: 560px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--lp-muted);
}

.lp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 34px;
}

.lp-hero .lp-hero-cta {
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid var(--lp-accent);
  background: transparent;
  color: var(--lp-accent);
  font-size: 11px;
  transition:
    background 150ms ease-out,
    color 150ms ease-out,
    border-color 150ms ease-out;
}

.lp-hero .lp-hero-cta:hover {
  border-color: var(--lp-accent);
  background: var(--lp-accent);
  color: #0a0a0c;
}

.lp-hero .lp-hero-cta:active {
  border-color: var(--accent-active);
  background: var(--accent-active);
  color: #0a0a0c;
}

.lp-cta-arrow {
  display: inline-block;
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lp-hero-cta:hover .lp-cta-arrow {
  transform: translateX(3px);
}

.lp-hero-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--lp-muted);
  text-transform: uppercase;
  transition: color 150ms ease-out;
}

.lp-hero-link:hover {
  color: var(--lp-accent);
}

.lp-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.lp-hero-meta .lp-arrow {
  color: #3f3f46;
}

.lp-status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lp-green);
}

/* ---------- Hero terminal ---------- */

.landing .lp-terminal {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: rgba(13, 13, 16, 0.9);
  box-shadow: none;
  transform: none !important;
  animation: none;
  overflow: hidden;
}

.landing .lp-terminal:hover {
  border-color: #3f3f46;
  box-shadow: none;
}

.lp-terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--lp-line);
  background: var(--lp-surface);
}

.lp-terminal-dots {
  display: inline-flex;
  gap: 5px;
}

.lp-terminal-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border: 1px solid #3f3f46;
  border-radius: 50%;
  background: #18181b;
}

.lp-terminal-title,
.lp-terminal-state {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-terminal-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lp-muted);
}

.lp-terminal-body {
  padding: 18px;
}

.lp-terminal-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-prompt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  padding: 13px 12px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: #0a0a0c;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.65;
  color: var(--lp-text);
}

.lp-terminal-stream {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 132px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: #0a0a0c;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--lp-text);
}

.lp-type-line {
  min-width: 0;
  margin: 0;
}

.lp-type-prefix {
  margin-right: 8px;
  color: var(--lp-accent);
}

.lp-type-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lp-type-line--out .lp-type-prefix,
.lp-type-line--out .lp-type-text {
  color: var(--lp-muted);
}

.lp-type-cursor {
  display: inline-block;
  width: 0.56em;
  height: 1.05em;
  flex: 0 0 auto;
  margin-left: 2px;
  vertical-align: -0.18em;
  background: var(--lp-accent);
  animation: lp-caret-blink 1.05s steps(1) infinite;
}

.lp-prompt-char {
  flex: 0 0 auto;
  color: var(--lp-accent);
}

.lp-prompt-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lp-caret {
  display: inline-block;
  width: 6px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 2px;
  background: var(--lp-accent);
  animation: lp-caret-blink 1.1s steps(1) infinite;
}

@keyframes lp-caret-blink {
  50% {
    opacity: 0;
  }
}

.lp-terminal-rule {
  height: 1px;
  margin: 18px 0;
  background: var(--lp-line);
}

.lp-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lp-output-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--lp-green);
  text-transform: uppercase;
}

.lp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 10px;
  table-layout: fixed;
}

.lp-table th,
.lp-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--lp-line-soft);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-table th {
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-table td {
  color: #c4c4c8;
}

.lp-table tbody tr:last-child td {
  border-bottom: 0;
}

.lp-table .lp-col-check,
.lp-table .lp-check {
  width: 28px;
  text-align: right;
}

.lp-check {
  color: var(--lp-green);
}

.lp-terminal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--lp-line);
  background: var(--lp-surface);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-terminal-foot span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--lp-green);
}

/* ---------- Replaces strip ---------- */

.lp-replaces {
  border-top: 1px solid var(--lp-line);
  border-bottom: 1px solid var(--lp-line);
  background: rgba(10, 10, 12, 0.78);
}

.lp-replaces-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 15px 32px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-replaces-label {
  color: var(--lp-accent);
}

.lp-replaces-note {
  margin-left: auto;
  color: var(--lp-green);
}

/* ---------- Shared section chrome ---------- */

.lp-section {
  padding: 96px 32px 0;
  border-top: 1px solid var(--lp-line);
}

.lp-section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.lp-section-head {
  margin-bottom: 32px;
}

.lp-section-label {
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--lp-accent);
  text-transform: uppercase;
}

.lp-section-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  gap: 48px;
  align-items: end;
}

.lp-section-title {
  font-size: clamp(2.1rem, 3.4vw, 3.25rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #f4f4f5;
  text-wrap: balance;
}

.lp-section-sub {
  max-width: 520px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--lp-muted);
}

#faq.lp-section {
  padding-bottom: 96px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .lp-section {
    padding: 64px 32px 0;
  }
  .lp-section-head {
    margin-bottom: 32px;
  }
}

/* ---------- Workflow ---------- */

.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--lp-line);
  background: var(--lp-line);
}

.lp-step {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 26px;
  background: var(--lp-bg);
}

.lp-step-num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--lp-accent);
  text-transform: uppercase;
}

.lp-step h3 {
  margin-top: 20px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--lp-text);
}

.lp-step p {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--lp-muted);
}

.lp-step code {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed var(--lp-line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: var(--lp-dim);
}

/* ---------- Feature bento ---------- */

.lp-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
  gap: 12px;
}

.lp-bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--lp-line);
  background: var(--lp-bg);
  transition: border-color 150ms ease-out;
}

.lp-bento-card:hover,
.lp-bento-card:focus-within {
  border-color: var(--lp-accent);
}

.lp-bento-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background:
    linear-gradient(currentColor, currentColor) left top / 12px 1px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 1px 12px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 12px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 1px 12px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 12px 1px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 1px 12px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 12px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 1px 12px no-repeat;
  color: var(--lp-line);
  transition: color 150ms ease-out;
}

.lp-bento-card:hover::before,
.lp-bento-card:focus-within::before {
  color: var(--lp-accent);
}

.lp-bento-large {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 540px;
  padding: 32px;
}

.lp-bento-medium,
.lp-bento-small {
  min-height: 269px;
}

.lp-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--lp-accent);
  text-transform: uppercase;
}

.lp-bento-card h3 {
  margin-top: 18px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--lp-text);
}

.lp-bento-large h3 {
  font-size: 32px;
}

.lp-bento-card > p {
  max-width: 620px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
  color: var(--lp-muted);
}

.lp-copy-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  appearance: none;
  padding: 6px 8px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: var(--lp-bg);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--lp-muted);
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 150ms ease-out,
    border-color 150ms ease-out,
    background 150ms ease-out;
}

.lp-copy-btn:hover {
  border-color: rgba(240, 160, 32, 0.5);
  background: var(--lp-surface);
  color: var(--lp-accent);
}

.lp-copy-btn.is-copied {
  border-color: rgba(16, 185, 129, 0.55);
  color: var(--lp-green);
}

.lp-code {
  margin: auto 0 0;
  padding: 20px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: var(--lp-surface);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.75;
  color: #c4c4c8;
  overflow-x: auto;
  white-space: pre;
}

.lp-code-key {
  color: var(--lp-accent);
}

.lp-code-fn {
  color: var(--lp-green);
}

.lp-code-comment {
  color: var(--lp-dim);
}

.lp-diff {
  margin-top: auto;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.lp-diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--lp-line);
  background: var(--lp-surface);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-diff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--lp-line-soft);
  color: #c4c4c8;
}

.lp-diff-removed {
  color: #52525b;
  text-decoration: line-through;
}

.lp-diff-head-after {
  color: var(--lp-green);
}

.lp-verify {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: var(--lp-surface);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #c4c4c8;
  text-transform: uppercase;
}

.lp-verify span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lp-verify-note {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--lp-green) !important;
  text-transform: none;
}

/* ---------- Pricing ---------- */

.lp-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: none;
  margin: 0;
  border: 1px solid var(--lp-line);
  background: var(--lp-line);
  align-items: stretch;
}

.landing .lp-price {
  min-height: 440px;
  padding: 26px;
  border: 0;
  border-radius: 0;
  background: var(--lp-bg);
  box-shadow: none;
  transform: none;
}

.landing .lp-price:hover {
  border-color: transparent;
  background: var(--lp-surface);
  box-shadow: none;
  transform: none;
}

.landing .lp-price-featured {
  background: #100e0a;
  border: 0;
  box-shadow: inset 0 1px 0 rgba(240, 160, 32, 0.45);
}

.landing .lp-price-featured:hover {
  background: #14110c;
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(240, 160, 32, 0.6);
}

.lp-price-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.landing .lp-price .price-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--lp-text);
  text-transform: uppercase;
}

.landing .lp-price .price-name::before {
  content: "[ ";
  color: var(--lp-accent);
}

.landing .lp-price .price-name::after {
  content: " ]";
  color: var(--lp-accent);
}

.landing .lp-price .price-star {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.landing .lp-price .price-amount {
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #f4f4f5;
}

.landing .lp-price:hover .price-amount {
  color: #f4f4f5;
}

.landing .lp-price .price-amount .per {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--lp-dim);
}

.landing .lp-price .price-note {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
  color: var(--lp-muted);
}

.landing .lp-price .price-feats {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0 26px;
}

.landing .lp-price .price-feats li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--lp-muted);
  text-transform: uppercase;
}

.landing .lp-price .price-feats .lp-status-dot {
  margin-top: 4px;
}

.landing .lp-price .lp-price-btn {
  width: 100%;
  min-height: 40px;
  margin-top: auto;
}

.landing .lp-price .lp-pop {
  position: absolute;
  top: 0;
  right: 18px;
  left: auto;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--lp-accent);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: #0a0a0c;
  text-transform: uppercase;
  animation: none;
  white-space: nowrap;
}

.lp-pricing-note {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--lp-dim);
  text-align: center;
  text-transform: uppercase;
}

/* ---------- FAQ ---------- */

.lp-faq-section .lp-section-inner {
  max-width: 980px;
}

.landing .lp-faq-list {
  max-width: none;
  border-top: 1px solid var(--lp-line);
}

.landing .lp-faq-list .faq-item {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--lp-line);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.landing .lp-faq-list .faq-item[open] {
  border-color: var(--lp-line);
}

.landing .lp-faq-list .faq-q {
  padding: 18px 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--lp-text);
}

.landing .lp-faq-list .faq-q:hover {
  color: var(--lp-accent);
}

.landing .lp-faq-list .faq-q::after {
  content: "[ + ]";
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--lp-accent);
  transform: none;
}

.landing .lp-faq-list .faq-item[open] .faq-q::after {
  content: "[ - ]";
  transform: none;
}

.landing .lp-faq-list .faq-a {
  max-width: 760px;
  padding: 0 0 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--lp-muted);
}

.landing .lp-faq-list .faq-a a {
  color: var(--lp-accent);
}

.landing .lp-faq-list .faq-a code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
  color: var(--lp-accent);
}

/* ---------- Footer ---------- */

.landing .lp-footer {
  border-top: 1px solid var(--lp-line);
  background: var(--lp-bg);
}

.lp-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px 30px;
}

.lp-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.lp-footer-tagline {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.landing .lp-footer-compare {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.landing .lp-footer-compare a {
  color: var(--lp-muted);
  text-decoration: none;
}

.landing .lp-footer-compare a:hover {
  color: var(--lp-accent);
}

.lp-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 38px;
  padding-top: 34px;
  border-top: 1px solid var(--lp-line);
}

.lp-footer-col h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-footer-col a {
  display: block;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--lp-muted);
  text-transform: uppercase;
  transition: color 150ms ease-out;
}

.lp-footer-col a:hover {
  color: var(--lp-accent);
}

.lp-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--lp-line);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  color: var(--lp-dim);
  text-transform: uppercase;
}

.lp-footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lp-muted);
}

.lp-footer-legal a {
  margin-left: 8px;
  color: var(--lp-muted);
}

.lp-footer-legal a:hover {
  color: var(--lp-accent);
}

.lp-top-btn {
  appearance: none;
  padding: 7px 10px;
  border: 1px solid var(--lp-line);
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--lp-muted);
  text-transform: uppercase;
  transition:
    color 150ms ease-out,
    border-color 150ms ease-out,
    background 150ms ease-out;
}

.lp-top-btn:hover {
  border-color: rgba(240, 160, 32, 0.5);
  background: var(--lp-surface);
  color: var(--lp-accent);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .lp-hero-grid {
    gap: 44px;
  }

  .lp-section-title-row {
    gap: 32px;
  }
}

@media (max-width: 1024px) {
  .lp-hero {
    padding-top: 112px;
  }

  .lp-hero-grid {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .lp-hero-copy {
    max-width: 760px;
  }

  .lp-hero-title {
    max-width: 800px;
  }

  .lp-section-title-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lp-section-sub {
    max-width: 640px;
  }

  .lp-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-bento-large {
    grid-column: span 2;
    grid-row: auto;
    min-height: 440px;
  }

  .lp-bento-medium,
  .lp-bento-small {
    min-height: 300px;
  }

  .landing .lp-pricing-grid {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .landing .lp-price {
    min-height: 0;
  }

  .lp-footer-cols {
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .lp-steps {
    grid-template-columns: 1fr;
  }

  .lp-step {
    min-height: 0;
  }

  .lp-step code {
    margin-top: 18px;
  }
}

@media (max-width: 768px) {
  .landing-header-wrap {
    height: 60px;
  }

  .landing .landing-nav {
    height: 60px;
  }

  .landing .landing-nav-inner {
    padding: 0 20px;
  }

  .landing .landing-mobile-panel {
    top: 60px;
  }

  .lp-hero {
    padding: 102px 20px 64px;
  }

  .lp-hero-title {
    font-size: clamp(2.7rem, 12vw, 4rem);
    letter-spacing: -0.03em;
  }

  .lp-hero-sub {
    font-size: 12px;
  }

  .lp-hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .lp-hero .lp-hero-cta {
    width: 100%;
  }

  .lp-hero-link {
    align-self: center;
  }

  .lp-hero-meta {
    gap: 8px;
    font-size: 8.5px;
  }

  .lp-terminal-body {
    padding: 14px;
  }

  .lp-prompt {
    font-size: 10px;
    padding: 11px;
  }

  .lp-terminal-stream {
    min-height: 142px;
    padding: 11px;
    font-size: 10px;
  }

  .lp-copy-btn {
    top: 14px;
    right: 14px;
  }

  .lp-table {
    font-size: 9px;
  }

  .lp-table th,
  .lp-table td {
    padding: 7px 5px;
  }

  .lp-table .lp-col-product {
    display: none;
  }

  .lp-replaces-inner {
    padding: 14px 20px;
    gap: 12px 16px;
    font-size: 8.5px;
  }

  .lp-replaces-note {
    width: 100%;
    margin-left: 0;
  }

  .lp-section {
    padding: 48px 20px 0;
  }

  .lp-section-head {
    margin-bottom: 32px;
  }

  .lp-section-title {
    font-size: clamp(1.9rem, 8vw, 2.5rem);
  }

  .lp-bento {
    grid-template-columns: 1fr;
  }

  .lp-bento-large,
  .lp-bento-medium,
  .lp-bento-small {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    padding: 24px;
  }

  .lp-bento-large h3 {
    font-size: 26px;
  }

  .lp-bento-card h3 {
    font-size: 21px;
  }

  .lp-code {
    padding: 16px;
    font-size: 9.5px;
  }

  .landing .lp-price {
    padding: 22px;
  }

  .landing .lp-price .price-amount {
    font-size: 34px;
  }

  .lp-pricing-note {
    line-height: 1.7;
  }

  #faq.lp-section {
    padding-bottom: 72px;
  }

  .lp-footer-inner {
    padding: 44px 20px 24px;
  }

  .lp-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .landing .landing-nav-inner {
    padding: 0 14px;
    gap: 12px;
  }

  .landing .brand {
    font-size: 14px;
  }

  .landing .brand-logo {
    width: 21px;
    height: 21px;
  }

  .lp-hero-title {
    font-size: clamp(2.35rem, 12.5vw, 3rem);
  }

  .lp-hero-meta .lp-arrow {
    display: none;
  }

  .lp-terminal-title {
    display: none;
  }

  .lp-terminal-foot {
    font-size: 8px;
  }

  .lp-footer-cols {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .lp-footer-legal a {
    margin-left: 0;
    margin-right: 8px;
  }
}

.landing :is(a, button, summary, input, textarea, select):focus-visible {
  outline: 2px solid #f0a020;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .lp-caret,
  .lp-type-cursor {
    animation: none;
  }

  .landing::before {
    transition: none;
  }

  .lp-hero-link,
  .lp-footer-col a,
  .lp-top-btn,
  .lp-bento-card,
  .lp-bento-card::before,
  .lp-copy-btn,
  .lp-cta-arrow,
  .landing .btn {
    transition: none;
  }
}

/* ==========================================================================
   AI service status label — workspace panel header + landing footer
   ========================================================================== */

.lp-footer-status--paused {
  color: var(--lp-accent);
}
.lp-footer-status--unknown {
  color: var(--lp-dim);
}

.lp-footer-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
  background: var(--lp-green);
  transition: background 0.3s;
}
.lp-footer-status--paused .lp-footer-status-dot {
  background: var(--lp-accent);
}
.lp-footer-status--unknown .lp-footer-status-dot {
  background: var(--lp-dim);
}

.ai-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ai-status--operational {
  color: var(--emerald);
}
.ai-status--paused {
  color: var(--amber);
}
.ai-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
}
.ai-status--operational .ai-status__dot {
  background: var(--emerald);
}
.ai-status--paused .ai-status__dot {
  background: var(--amber);
}

/* Paused state: disable the Run query button and show inline notice */
.query-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- What would you pay for? highlight ---------- */

.lp-what-pay {
  margin: 20px auto 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--lp-text);
  background: rgba(240, 160, 32, 0.06);
  border: 1px solid rgba(240, 160, 32, 0.18);
  border-radius: 6px;
  padding: 10px 18px;
  display: block;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

.lp-what-pay-q {
  color: var(--lp-accent);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.lp-what-pay:hover {
  background: rgba(240, 160, 32, 0.1);
  border-color: rgba(240, 160, 32, 0.35);
}

@media (max-width: 640px) {
  .lp-what-pay {
    white-space: normal;
    max-width: 100%;
    line-height: 1.6;
  }
}
