/* TRXAI – modern dark theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-hover: #1c1c28;
  --border: #27272f;
  --border-focus: #6366f1;
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-muted: rgba(99, 102, 241, 0.15);
  --accent: #22c55e;
  --accent-muted: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.12);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.theme-dark {
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}

/* Icons */
.icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-xs {
  width: 14px;
  height: 14px;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

.icon-md {
  width: 20px;
  height: 20px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.icon-xl {
  width: 28px;
  height: 28px;
}

.btn .icon,
.nav-link-icon {
  margin-right: 8px;
}

.nav-link-icon:last-child {
  margin-right: 0;
  margin-left: 8px;
}

/* Header */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo:hover {
  color: var(--text);
}

.logo .icon {
  color: var(--primary);
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-main a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-main a:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-main a.btn-primary {
  color: white;
  background: var(--primary);
}

.nav-main a.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
}

/* Nav toggle: hidden on desktop, shown only in @media (max-width: 768px) */
.nav-toggle {
  display: none;
}

.nav-main a .icon {
  margin-right: 8px;
}

.nav-main a .icon:last-child {
  margin-right: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition-fast);
  font-family: inherit;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-outline.btn-danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-muted);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8125rem;
}

.btn-sm .icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-lg .icon {
  margin-right: 10px;
}

.btn-block {
  width: 100%;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.35s ease;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

.card h3 {
  margin: 0 0 12px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card h3 .icon {
  color: var(--text-muted);
}

.card-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--primary-muted);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.card-icon-wrap .icon {
  width: 24px;
  height: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Landing page (modern) */
.lp-root {
  --lp-bg: #060605;
  --lp-surface: #0e0e0c;
  --lp-surface2: #141411;
  --lp-line: #2c2b26;
  --lp-accent: #3b82f6;
  --lp-accent-soft: rgba(59, 130, 246, 0.16);
  --lp-warm: #f4d58d;
  --lp-text: #f3f1ea;
  --lp-muted: #949089;
  --lp-faint: #5c5952;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--lp-bg);
  color: var(--lp-text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.lp-root .lp-display,
.lp-root h1,
.lp-root h2,
.lp-root h3,
.lp-root .logo span {
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
}

.lp-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 85% -10%, rgba(59, 130, 246, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 10% 30%, rgba(244, 213, 141, 0.06), transparent 45%),
    linear-gradient(180deg, var(--lp-bg) 0%, #0a0908 100%);
  z-index: 0;
}

.lp-root > :not(.lp-bg) {
  position: relative;
  z-index: 1;
}

.lp-root .site-header {
  background: rgba(10, 10, 8, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 12px 0;
}

.lp-root .logo {
  color: var(--lp-text);
}

.lp-root .logo .icon {
  color: var(--lp-accent);
}

.lp-root .header-inner {
  gap: 16px;
  align-items: center;
}

/* Landing nav: same “command bar” treatment as docs */
.lp-root .nav-main {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  padding: 5px 6px;
  max-width: min(100%, 960px);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(19, 19, 17, 0.55) 45%,
    rgba(12, 12, 10, 0.75) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 32px rgba(0, 0, 0, 0.28);
}

.lp-root .nav-main a:not(.btn) {
  color: var(--lp-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.lp-root .nav-main a:not(.btn):hover {
  color: var(--lp-text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.lp-root .nav-main a:not(.btn) .icon {
  width: 17px;
  height: 17px;
  margin-right: 0;
  margin-inline-end: 8px;
  opacity: 0.92;
  flex-shrink: 0;
  color: var(--lp-accent);
}

.lp-root .nav-main a:not(.btn):hover .icon {
  opacity: 1;
}

.lp-root .nav-main a:not(.btn):focus-visible {
  outline: 2px solid var(--lp-accent);
  outline-offset: 2px;
}

.lp-root .nav-main > a[href="/login"] {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.lp-root .nav-main > a.btn.lp-btn-primary {
  margin-left: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 20px rgba(59, 130, 246, 0.35);
}

.lp-root .nav-main > a.btn.lp-btn-primary:focus-visible {
  outline: 2px solid var(--lp-accent);
  outline-offset: 2px;
}

.lp-btn-primary {
  background: var(--lp-accent) !important;
  color: #f8fafc !important;
  border: none !important;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
}

.lp-btn-primary:hover {
  filter: brightness(1.08);
  color: #ffffff !important;
}

.lp-btn-ghost {
  background: transparent !important;
  border: 1px solid var(--lp-line) !important;
  color: var(--lp-text) !important;
}

.lp-btn-ghost:hover {
  border-color: var(--lp-muted) !important;
  background: var(--lp-surface2) !important;
}

.lp-btn-outline {
  background: transparent !important;
  border: 1px solid var(--lp-line) !important;
  color: var(--lp-text) !important;
}

.lp-btn-outline:hover {
  border-color: var(--lp-accent) !important;
  color: var(--lp-accent) !important;
}

.lp-flash.flash-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.lp-main {
  padding-bottom: 0;
}

.lp-hero {
  padding: 48px 0 72px;
}

@media (min-width: 900px) {
  .lp-hero {
    padding: 72px 0 96px;
  }
}

.lp-hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 980px) {
  .lp-hero-grid {
    grid-template-columns: 1fr 1.05fr;
    gap: 64px;
  }
}

.lp-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lp-warm);
  margin: 0 0 16px 0;
}

.lp-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 20px 0;
  max-width: 14ch;
}

@media (min-width: 980px) {
  .lp-title {
    max-width: 12ch;
  }
}

.lp-lead {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--lp-muted);
  margin: 0 0 28px 0;
  max-width: 36rem;
}

.lp-lead strong {
  color: var(--lp-text);
  font-weight: 600;
}

.lp-inline-cta {
  color: var(--lp-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.lp-inline-cta:hover {
  filter: brightness(1.15);
}

.lp-lead .lp-inline-cta {
  color: var(--lp-accent);
}

.lp-strip-link {
  color: var(--lp-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lp-strip-link:hover {
  color: var(--lp-accent);
}

.lp-header .nav-main a:has(.nav-pill) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lp-header .nav-pill {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.nav-badge-soft {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary-muted);
  color: var(--primary-hover);
  vertical-align: middle;
}

.lp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.lp-hero-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--lp-faint);
}

@media (min-width: 600px) {
  .lp-hero-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 20px;
  }
}

.lp-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lp-accent);
  margin-right: 8px;
  vertical-align: middle;
  opacity: 0.85;
}

.lp-hero-visual {
  position: relative;
}

.lp-terminal {
  border-radius: 16px;
  border: 1px solid var(--lp-line);
  background: var(--lp-surface);
  overflow: hidden;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform: rotate(-0.8deg);
}

@media (prefers-reduced-motion: no-preference) {
  .lp-terminal {
    animation: lp-float 7s ease-in-out infinite;
  }
}

@keyframes lp-float {
  0%, 100% { transform: rotate(-0.8deg) translateY(0); }
  50% { transform: rotate(-0.5deg) translateY(-6px); }
}

.lp-terminal-bar {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  background: var(--lp-surface2);
  border-bottom: 1px solid var(--lp-line);
}

.lp-terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lp-faint);
  opacity: 0.6;
}

.lp-terminal-bar span:nth-child(1) { background: #c94c4c; opacity: 1; }
.lp-terminal-bar span:nth-child(2) { background: #d4a827; opacity: 1; }
.lp-terminal-bar span:nth-child(3) { background: var(--lp-accent); opacity: 0.85; }

.lp-terminal-body {
  margin: 0;
  padding: 18px 16px 20px;
  font-size: 0.72rem;
  line-height: 1.55;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
}

@media (min-width: 640px) {
  .lp-terminal-body {
    font-size: 0.78rem;
    padding: 20px 20px 22px;
  }
}

.lp-t-muted { color: var(--lp-faint); }
.lp-t-k { color: #9bdc9b; }
.lp-t-s { color: #e8b86d; }

.lp-hero-badge {
  position: absolute;
  right: -4px;
  bottom: -20px;
}

@media (max-width: 979px) {
  .lp-hero-badge {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 16px;
  }
}

.lp-hero-badge-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--lp-line);
  background: rgba(20, 20, 17, 0.92);
  font-size: 0.8125rem;
  color: var(--lp-muted);
  backdrop-filter: blur(10px);
}

.lp-hero-badge-inner .icon {
  color: var(--lp-accent);
}

.lp-strip {
  border-top: 1px solid var(--lp-line);
  border-bottom: 1px solid var(--lp-line);
  background: rgba(14, 14, 12, 0.55);
}

.lp-strip-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
}

@media (min-width: 900px) {
  .lp-strip-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
  }
}

.lp-strip-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lp-faint);
  white-space: nowrap;
}

.lp-strip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.875rem;
  color: var(--lp-muted);
}

.lp-strip-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lp-strip-list .icon {
  color: var(--lp-accent);
  opacity: 0.85;
}

.lp-section {
  padding: 72px 0;
}

@media (min-width: 900px) {
  .lp-section {
    padding: 96px 0;
  }
}

.lp-section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}

.lp-section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 12px 0;
}

.lp-section-desc {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--lp-muted);
}

.lp-bento {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .lp-bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .lp-bento {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(120px, auto);
  }

  .lp-bento-wide {
    grid-column: span 2;
  }

  .lp-bento-tall {
    grid-row: span 2;
  }
}

.lp-card {
  border: 1px solid var(--lp-line);
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(165deg, var(--lp-surface) 0%, var(--lp-bg) 100%);
  transition: border-color 0.2s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .lp-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-terminal,
  .lp-price-card:hover,
  .lp-card:hover {
    transform: none;
    animation: none;
  }
}

.lp-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lp-accent-soft);
  color: var(--lp-accent);
  margin-bottom: 16px;
}

.lp-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.lp-card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--lp-muted);
}

.lp-card-foot {
  margin-top: 12px !important;
  font-size: 0.8125rem !important;
  color: var(--lp-faint) !important;
}

.lp-inline-code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--lp-surface2);
  border: 1px solid var(--lp-line);
  color: var(--lp-warm);
}

.lp-api {
  border-top: 1px solid var(--lp-line);
}

.lp-api-layout {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 900px) {
  .lp-api-layout {
    grid-template-columns: 1fr 1.1fr;
    gap: 56px;
    align-items: center;
  }
}

.lp-api-copy .lp-section-title {
  text-align: left;
  margin-bottom: 14px;
}

.lp-api-copy .lp-section-desc {
  text-align: left;
  margin-bottom: 20px;
}

.lp-checklist {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
}

.lp-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9375rem;
  color: var(--lp-muted);
}

.lp-checklist .icon {
  color: var(--lp-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.lp-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--lp-accent);
}

.lp-link-arrow:hover {
  color: var(--lp-text);
}

.lp-api-panel {
  border-radius: 18px;
  border: 1px solid var(--lp-line);
  background: var(--lp-surface);
  overflow: hidden;
}

.lp-api-panel-head {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lp-line);
  background: var(--lp-surface2);
}

.lp-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lp-accent-soft);
  color: var(--lp-accent);
}

.lp-pill-muted {
  background: rgba(148, 144, 137, 0.12);
  color: var(--lp-muted);
}

.lp-code-block {
  margin: 0;
  padding: 18px 16px 22px;
  font-size: 0.75rem;
  line-height: 1.55;
  overflow-x: auto;
  font-family: ui-monospace, monospace;
}

@media (min-width: 640px) {
  .lp-code-block {
    font-size: 0.8125rem;
    padding: 22px 20px;
  }
}

.lp-pricing-wrap {
  background: rgba(14, 14, 12, 0.35);
  border-top: 1px solid var(--lp-line);
}

.lp-pricing-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  max-width: 1040px;
  margin: 0 auto;
}

@media (min-width: 800px) {
  .lp-pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

.lp-price-card {
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  border-radius: 20px;
  border: 1px solid var(--lp-line);
  background: var(--lp-surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.lp-price-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .lp-price-card:hover {
    transform: translateY(-4px);
  }
}

.lp-price-card-free {
  background: linear-gradient(180deg, var(--lp-surface) 0%, rgba(20, 20, 17, 0.6) 100%);
}

.lp-price-top {
  margin-bottom: 8px;
}

.lp-price-icon {
  display: inline-flex;
  padding: 10px;
  border-radius: 14px;
  background: var(--lp-accent-soft);
  color: var(--lp-accent);
  margin-bottom: 14px;
}

.lp-price-card-free .lp-price-icon {
  background: rgba(244, 213, 141, 0.12);
  color: var(--lp-warm);
}

.lp-price-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.lp-price-tagline {
  margin: 0;
  font-size: 0.875rem;
  color: var(--lp-faint);
}

.lp-price-amount {
  margin: 20px 0 20px;
}

.lp-price-num {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lp-price-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--lp-muted);
  margin-left: 2px;
}

.lp-price-features {
  list-style: none;
  margin: 0 0 24px 0;
  padding: 0;
  flex: 1;
}

.lp-price-features li {
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 8px 0;
  border-bottom: 1px solid var(--lp-line);
  color: var(--lp-muted);
}

.lp-price-features li:last-child {
  border-bottom: none;
}

.lp-price-highlight {
  color: var(--lp-text) !important;
}

.lp-price-highlight::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lp-accent);
  margin-right: 8px;
  vertical-align: middle;
}

.lp-price-muted {
  color: var(--lp-faint) !important;
}

.lp-price-cta {
  margin-top: auto;
}

.lp-cta {
  padding: 80px 0;
  text-align: center;
}

.lp-cta-inner {
  max-width: 640px;
  margin: 0 auto;
}

.lp-cta-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px 0;
}

.lp-cta-desc {
  margin: 0 0 28px 0;
  color: var(--lp-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.lp-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.lp-footer {
  border-top: 1px solid var(--lp-line);
  padding: 32px 0 40px;
  background: var(--lp-bg);
}

.lp-footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.lp-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  color: var(--lp-text);
}

.lp-footer-brand .icon {
  color: var(--lp-accent);
  flex-shrink: 0;
}

.lp-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 22px;
}

.lp-footer-nav a {
  color: var(--lp-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.lp-footer-nav a:hover {
  color: var(--lp-accent);
}

.lp-footer-copy {
  margin: 0;
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--lp-muted);
  text-align: center;
}

@media (min-width: 780px) {
  .lp-footer-inner {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
    column-gap: clamp(20px, 4vw, 48px);
    row-gap: 0;
    justify-items: stretch;
    align-items: center;
  }

  .lp-footer-brand {
    justify-self: start;
    text-align: left;
  }

  .lp-footer-copy {
    justify-self: center;
    text-align: center;
    max-width: 24rem;
    padding: 0 8px;
  }

  .lp-footer-nav {
    justify-self: end;
    justify-content: flex-end;
  }
}

/* Auth */
.main-content {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

/* Playground: main full width, no centering, so chat uses whole site */
.main-content:has(.pg-page) {
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: calc(100vh - 57px);
}

/* Login / register – modern blue shell */
body.auth-layout {
  --auth-bg: #060605;
  --auth-surface: #0e0e0c;
  --auth-elevated: #131311;
  --auth-border: #2a2926;
  --auth-accent: #3b82f6;
  --auth-accent-hover: #60a5fa;
  --auth-accent-soft: rgba(59, 130, 246, 0.16);
  --auth-accent-glow: rgba(59, 130, 246, 0.22);
  --auth-text: #f3f1ea;
  --auth-muted: #949089;
  --auth-faint: #5c5952;
  background: var(--auth-bg);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

body.auth-layout .site-header {
  background: rgba(10, 10, 8, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--auth-border);
}

body.auth-layout .logo {
  color: var(--auth-text);
}

body.auth-layout .logo .icon {
  color: var(--auth-accent);
}

body.auth-layout .nav-main a:not(.btn) {
  color: var(--auth-muted);
}

body.auth-layout .nav-main a:not(.btn):hover {
  color: var(--auth-text);
}

body.auth-layout .nav-main .btn-primary {
  background: var(--auth-accent);
  border-color: transparent;
  color: #f8fafc;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

body.auth-layout .nav-main .btn-primary:hover {
  background: var(--auth-accent-hover);
  color: #fff;
}

body.auth-layout .site-footer {
  background: var(--auth-bg);
  border-top-color: var(--auth-border);
}

body.auth-layout .site-footer a {
  color: var(--auth-muted);
}

body.auth-layout .site-footer a:hover {
  color: var(--auth-accent);
}

.main-content:has(.auth-shell) {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 140px);
  padding: clamp(28px, 5vw, 48px) 24px;
  background:
    radial-gradient(ellipse 55% 45% at 50% -15%, rgba(59, 130, 246, 0.12), transparent 55%),
    radial-gradient(ellipse 40% 35% at 95% 60%, rgba(59, 130, 246, 0.06), transparent 50%),
    linear-gradient(180deg, var(--auth-bg) 0%, #0a0908 100%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.auth-page {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  padding: 40px 36px 36px;
  border-radius: 20px;
  border: 1px solid var(--auth-border);
  background: linear-gradient(165deg, var(--auth-surface) 0%, var(--auth-bg) 100%);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.auth-eyebrow {
  margin: 0 0 10px 0;
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--auth-accent);
  text-align: center;
}

.auth-title {
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 10px 0;
  text-align: center;
  color: var(--auth-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--auth-accent-soft);
  color: var(--auth-accent);
  box-shadow: 0 0 0 1px var(--auth-accent-glow);
}

.auth-title-icon .icon {
  color: var(--auth-accent);
}

.auth-sub {
  margin: 0 0 28px 0;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--auth-muted);
  letter-spacing: 0.02em;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="number"] {
  width: 100%;
  padding: 13px 16px;
  font-size: 1rem;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: var(--auth-elevated);
  color: var(--auth-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form .input-wrapper {
  position: relative;
}

.auth-form .input-wrapper input {
  padding-left: 46px;
}

.auth-form .input-wrapper .input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-faint);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-form .input-wrapper .input-icon .icon {
  width: 20px;
  height: 20px;
}

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

.auth-form input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-accent-soft);
}

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

.auth-btn-primary {
  background: var(--auth-accent) !important;
  border: none !important;
  color: #f8fafc !important;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28);
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

.auth-btn-primary:hover {
  background: var(--auth-accent-hover) !important;
  color: #fff !important;
}

.auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.9375rem;
  color: var(--auth-muted);
}

.auth-footer a {
  font-weight: 600;
  color: var(--auth-accent);
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--auth-accent-hover);
}

/* Flash */
.flash-container {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
  width: 90%;
}

@media (max-width: 768px) {
  .flash-container {
    top: 72px;
    width: calc(100% - 32px);
    max-width: none;
  }
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.flash-error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.flash-close {
  background: none;
  border: none;
  color: inherit;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.flash-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.flash-close .icon {
  width: 18px;
  height: 18px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer a:hover {
  color: var(--text-secondary);
}

/* Dashboard – modern blue theme */
.dashboard-layout {
  --dash-bg: #060605;
  --dash-surface: #0e0e0c;
  --dash-elevated: #131311;
  --dash-border: #2a2926;
  --dash-accent: #3b82f6;
  --dash-accent-hover: #60a5fa;
  --dash-accent-soft: rgba(59, 130, 246, 0.14);
  --dash-accent-glow: rgba(59, 130, 246, 0.22);
  --dash-text: #f3f1ea;
  --dash-muted: #949089;
  --dash-faint: #5c5952;
  --dash-sidebar: #0a0a08;
  --dash-radius: 16px;
  --dash-radius-sm: 12px;
  display: flex;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--dash-bg);
  color: var(--dash-text);
}

.dashboard-layout h1,
.dashboard-layout h2,
.dashboard-layout h3,
.dashboard-layout .sidebar-logo {
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
}

.dashboard-content .text-muted a,
.dashboard-content p a:not(.btn):not(.link-muted) {
  color: var(--dash-accent);
}

.dashboard-content .text-muted a:hover,
.dashboard-content p a:not(.btn):not(.link-muted):hover {
  color: var(--dash-accent-hover);
}

.dashboard-sidebar {
  width: 268px;
  background: linear-gradient(180deg, var(--dash-sidebar) 0%, #060605 100%);
  border-right: 1px solid var(--dash-border);
  display: flex;
  flex-direction: column;
  padding: 22px 0 20px;
  flex-shrink: 0;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.35);
}

.sidebar-logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  padding: 0 18px 22px;
  margin: 0 12px 18px;
  color: var(--dash-text);
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo:hover {
  color: var(--dash-text);
}

.sidebar-logo .icon {
  color: var(--dash-accent);
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
}

.sidebar-nav-group + .sidebar-nav-group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--dash-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-nav-title {
  margin: 0 0 10px 2px;
  padding: 0 12px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--dash-faint);
  line-height: 1.2;
}

.sidebar-nav-group:first-child .sidebar-nav-title {
  margin-top: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: var(--dash-radius-sm);
  color: var(--dash-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  border-left: none;
}

.sidebar-nav a .icon {
  margin-right: 12px;
  color: var(--dash-faint);
}

.sidebar-nav a:hover {
  color: var(--dash-text);
  background: rgba(59, 130, 246, 0.06);
}

.sidebar-nav a:hover .icon {
  color: var(--dash-accent);
}

.sidebar-nav a.active {
  color: var(--dash-text);
  background: var(--dash-accent-soft);
  box-shadow: 0 0 0 1px var(--dash-accent-glow);
}

.sidebar-nav a.active .icon {
  color: var(--dash-accent);
}

.sidebar-footer {
  padding: 16px 12px 0;
  margin: 12px 12px 0;
  border-top: 1px solid var(--dash-border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: var(--dash-radius-sm);
  color: var(--dash-faint);
  font-size: 0.875rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-footer a .icon {
  margin-right: 10px;
}

.sidebar-footer a:hover {
  color: var(--dash-muted);
  background: rgba(255, 255, 255, 0.04);
}

.dashboard-main {
  flex: 1;
  position: relative;
  padding: 32px clamp(20px, 4vw, 40px);
  overflow: auto;
  min-width: 0;
}

.dashboard-main-bg {
  pointer-events: none;
  position: fixed;
  top: 0;
  right: 0;
  width: min(55vw, 720px);
  height: min(50vh, 480px);
  background: radial-gradient(ellipse at top right, rgba(59, 130, 246, 0.11), transparent 65%);
  z-index: 0;
}

.dashboard-header,
.dashboard-content {
  position: relative;
  z-index: 1;
}

.dashboard-header {
  margin-bottom: 28px;
}

.dashboard-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-header-docs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.875rem;
}

.dashboard-page-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
  color: var(--dash-text);
}

.dashboard-content {
  max-width: 1080px;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.dashboard-layout .card {
  background: linear-gradient(165deg, var(--dash-surface) 0%, var(--dash-bg) 100%);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.dashboard-layout .card:hover {
  border-color: rgba(59, 130, 246, 0.28);
}

.dashboard-layout .card h3 {
  color: var(--dash-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-layout .card h3 .icon {
  color: var(--dash-accent);
  opacity: 0.9;
}

.stat-card {
  position: relative;
}

a.stat-card.dashboard-playground-card {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

a.stat-card.dashboard-playground-card:hover {
  border-color: var(--dash-accent);
  box-shadow:
    0 0 0 1px var(--dash-accent-glow),
    0 20px 44px rgba(0, 0, 0, 0.32);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  a.stat-card.dashboard-playground-card:hover {
    transform: none;
  }
}

.stat-card .icon-wrap {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--dash-accent);
  opacity: 0.55;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 12px 0 0 0;
  color: var(--dash-text);
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
}

.stat-card .link-muted {
  font-size: 0.875rem;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dash-muted);
}

.dashboard-layout .link-muted {
  color: var(--dash-muted);
}

.dashboard-layout .link-muted:hover {
  color: var(--dash-accent);
}

.dashboard-layout .text-muted {
  color: var(--dash-muted);
}

.dashboard-layout code {
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--dash-elevated);
  border: 1px solid var(--dash-border);
  color: #93c5fd;
}

.dashboard-layout .btn-primary {
  background: var(--dash-accent);
  border-color: transparent;
  color: #f8fafc;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.dashboard-layout .btn-primary:hover {
  background: var(--dash-accent-hover);
  color: #fff;
}

.dashboard-layout .btn-outline {
  border-color: var(--dash-border);
  color: var(--dash-text);
  background: transparent;
}

.dashboard-layout .btn-outline:hover {
  border-color: var(--dash-accent);
  color: var(--dash-accent);
  background: rgba(59, 130, 246, 0.06);
}

.dashboard-layout .btn-danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.dashboard-layout .api-key-value {
  background: var(--dash-elevated);
  border-color: var(--dash-border);
  color: var(--dash-muted);
}

.dashboard-layout .api-key-toggle {
  border-color: var(--dash-border);
  color: var(--dash-text);
}

.dashboard-layout .api-key-value--secret[data-masked="true"] {
  color: var(--dash-faint);
}

/* Dashboard — Plans (/dashboard/plans) */
.dashboard-layout .plans-page {
  max-width: 1100px;
}

.dashboard-layout .plans-intro {
  margin-bottom: clamp(28px, 4vw, 40px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--dash-border);
}

.dashboard-layout .plans-intro__eyebrow {
  margin: 0 0 8px 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dash-accent);
}

.dashboard-layout .plans-intro__lead {
  margin: 0;
  max-width: 52ch;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--dash-muted);
}

.dashboard-layout .plans-page .plans-grid {
  gap: clamp(20px, 3vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dashboard-layout .plans-page .plan-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: clamp(22px, 3vw, 28px);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, var(--dash-bg) 48%, var(--dash-surface) 100%);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-layout .plans-page .plan-card:hover {
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
}

.dashboard-layout .plans-page .plan-card.plan-current {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.35),
    0 20px 52px rgba(59, 130, 246, 0.12);
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.08) 0%, var(--dash-bg) 45%, var(--dash-surface) 100%);
}

.dashboard-layout .plan-card__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-layout .plan-card__icon-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--dash-accent);
}

.dashboard-layout .plan-card__name {
  margin: 0;
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--dash-text);
  text-transform: none;
}

.dashboard-layout .plan-card__features {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-layout .plan-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--dash-muted);
}

.dashboard-layout .plan-card__features li .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--dash-accent);
  opacity: 0.85;
}

.dashboard-layout .plan-card__features--muted {
  opacity: 0.75;
}

.dashboard-layout .plan-card__features--muted .icon {
  opacity: 0.5;
}

.dashboard-layout .plan-card__hint {
  font-size: 0.8125rem;
  color: var(--dash-faint);
  font-weight: 400;
}

.dashboard-layout .plan-card__price-block {
  margin-bottom: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--dash-border);
}

.dashboard-layout .plan-card__price {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--dash-text);
  font-variant-numeric: tabular-nums;
}

.dashboard-layout .plan-card__currency {
  font-size: 0.65em;
  font-weight: 700;
  vertical-align: super;
  margin-right: 2px;
  color: var(--dash-muted);
}

.dashboard-layout .plan-card__period {
  font-size: 0.45em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--dash-faint);
  margin-left: 4px;
}

.dashboard-layout .plan-card__price--free .plan-card__period {
  color: var(--dash-muted);
}

.dashboard-layout .plan-card__actions {
  margin-top: auto;
}

.dashboard-layout .plan-card__badge {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  font-size: 0.8125rem;
}

.dashboard-layout .data-table th {
  color: var(--dash-faint);
}

.dashboard-layout .data-table td {
  border-bottom-color: var(--dash-border);
  color: var(--dash-muted);
}

.dashboard-layout .data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.dashboard-layout .table-card > h3 {
  color: var(--dash-muted);
}

.dashboard-layout .flash-container .flash {
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border);
}

.dashboard-layout .flash-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.35);
}

.dashboard-layout .flash-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}

.dashboard-layout .billing-plan-name {
  color: var(--dash-text);
}

.dashboard-layout .billing-table th,
.dashboard-layout .billing-table td {
  border-bottom-color: var(--dash-border);
  color: var(--dash-muted);
}

.dashboard-layout .billing-table th {
  color: var(--dash-faint);
}

.dashboard-layout .badge-secondary {
  background: var(--dash-elevated);
  color: var(--dash-muted);
  border: 1px solid var(--dash-border);
}

.api-key-preview,
.api-key-row {
  margin-top: 16px;
}

.api-key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.api-key-value {
  font-size: 0.8125rem;
  background: var(--bg-elevated);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.api-key-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.api-key-value--secret[data-masked="true"] {
  letter-spacing: 0.04em;
  user-select: none;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.mt-2 { margin-top: 20px; }

/* Plans */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.plan-card {
  text-align: center;
  transition: border-color var(--transition);
}

.plan-card.plan-current {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.plan-limit {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

.plan-price {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-success {
  background: var(--accent-muted);
  color: var(--accent);
}

.badge-danger {
  background: var(--danger-muted);
  color: #f87171;
}

/* Tables */
.table-card {
  overflow-x: auto;
  padding: 0;
}

.table-card > h3 {
  padding: 24px 24px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tr.row-disabled {
  opacity: 0.6;
}

.actions-cell {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.form-inline-plan {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.form-inline-plan select {
  padding: 8px 12px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  min-width: 100px;
}

.input-sm {
  width: 88px;
  padding: 8px 12px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
}

.form-create-plan {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}

.form-create-plan input[type="text"],
.form-create-plan input[type="number"] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9375rem;
  min-width: 120px;
}

.form-edit-plan {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Error page */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.error-page .icon {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.error-page h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text);
}

.error-page p {
  margin: 0 0 28px 0;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* Responsive – mobile first breakpoints */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    border: 1px solid var(--border);
  }

  .nav-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
  }

  .nav-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  .nav-toggle-icon {
    display: block;
    color: inherit;
  }

  .nav-toggle-close {
    display: none;
  }

  .site-header.nav-open .nav-toggle {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border);
  }

  .site-header.nav-open .nav-toggle-menu {
    display: none;
  }

  .site-header.nav-open .nav-toggle-close {
    display: block;
  }

  .nav-main {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99;
    background: var(--bg-elevated);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 72px 24px 24px;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    overflow-y: auto;
  }

  .site-header.nav-open .nav-main {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-header.nav-open .nav-toggle {
    position: relative;
    z-index: 101;
  }

  .nav-main a {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .nav-main a.btn-primary {
    margin-top: 8px;
    justify-content: center;
  }

  /* Dashboard layout */
  .dashboard-sidebar {
    width: 72px;
    min-width: 72px;
    padding: 14px 0;
  }

  .dashboard-layout .sidebar-logo {
    margin: 0 8px 14px;
    padding: 0 8px 14px;
    justify-content: center;
  }

  .dashboard-layout .sidebar-nav {
    padding: 0 8px;
  }

  .dashboard-layout .sidebar-nav-group + .sidebar-nav-group {
    margin-top: 14px;
    padding-top: 14px;
  }

  .dashboard-layout .sidebar-footer {
    margin: 8px 8px 0;
    padding: 12px 8px 0;
  }

  .sidebar-logo .nav-label,
  .sidebar-nav .nav-label,
  .sidebar-nav .sidebar-nav-title,
  .sidebar-footer .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }

  .sidebar-logo {
    justify-content: center;
    padding: 0 12px 16px;
    min-height: 48px;
  }

  .sidebar-logo .icon {
    margin-right: 0;
  }

  .sidebar-nav a {
    justify-content: center;
    padding: 14px;
    min-height: 48px;
  }

  .sidebar-nav a .icon {
    margin-right: 0;
  }

  .sidebar-footer a {
    justify-content: center;
    padding: 12px;
    min-height: 48px;
  }

  .sidebar-footer a .icon {
    margin-right: 0;
  }

  .dashboard-main {
    padding: 20px 16px;
  }

  .dashboard-page-title {
    font-size: 1.25rem;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Landing (modern) mobile */
  .lp-hero-actions .btn,
  .lp-cta-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .lp-section {
    padding: 56px 0;
  }

  .lp-section-head {
    margin-bottom: 36px;
  }

  .lp-price-card {
    padding: 22px 18px;
  }

  .site-footer {
    padding: 24px 16px;
  }

  .footer-inner {
    gap: 16px;
  }

  .site-footer a {
    min-height: 44px;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .lp-title {
    font-size: 2rem;
  }

  .lp-terminal {
    transform: none;
  }

  .lp-terminal,
  .lp-price-card:hover {
    transform: none;
  }

  .card {
    padding: 20px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .auth-title {
    font-size: 1.25rem;
  }

  .flash-container {
    width: calc(100% - 32px);
    left: 16px;
    transform: none;
  }

  .table-card {
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .table-card > h3 {
    padding: 20px 16px 0;
  }

  .data-table th,
  .data-table td {
    padding: 12px 16px;
    font-size: 0.875rem;
  }

  .form-inline-plan {
    flex-wrap: wrap;
  }

  .form-create-plan {
    flex-direction: column;
    align-items: stretch;
  }

  .form-create-plan input[type="text"],
  .form-create-plan input[type="number"] {
    min-width: 0;
  }

  .plans-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .api-key-row {
    flex-direction: column;
    align-items: stretch;
  }

  .api-key-value {
    min-width: 0;
  }
}

/* Tables – horizontal scroll with touch */
.table-card {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}

/* Touch-friendly buttons and inputs */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 40px;
  }

  .auth-form input[type="email"],
  .auth-form input[type="password"],
  .auth-form input[type="text"],
  .auth-form input[type="number"] {
    min-height: 48px;
    font-size: 16px; /* avoids zoom on iOS */
  }
}

/* Docs – modern blue theme (aligned with landing / auth / dashboard) */
body.docs-layout {
  --docs-bg: #060605;
  --docs-surface: #0e0e0c;
  --docs-elevated: #131311;
  --docs-card: #10100e;
  --docs-border: #2a2926;
  --docs-accent: #3b82f6;
  --docs-accent-hover: #60a5fa;
  --docs-accent-soft: rgba(59, 130, 246, 0.16);
  --docs-accent-glow: rgba(59, 130, 246, 0.22);
  --docs-text: #f3f1ea;
  --docs-muted: #949089;
  --docs-faint: #5c5952;
  --docs-header-offset: 80px;
  background: var(--docs-bg);
  color: var(--docs-text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  scroll-padding-top: calc(var(--docs-header-offset) + 12px);
}

body.docs-layout .site-header {
  background: rgba(10, 10, 8, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 12px 0;
}

body.docs-layout .logo {
  color: var(--docs-text);
}

body.docs-layout .logo .icon {
  color: var(--docs-accent);
}

body.docs-layout .header-inner {
  gap: 16px;
  align-items: center;
}

/* Primary nav: compact “command bar” — docs only */
body.docs-layout .nav-main {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  padding: 5px 6px;
  max-width: min(100%, 960px);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(19, 19, 17, 0.55) 45%,
    rgba(12, 12, 10, 0.75) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 32px rgba(0, 0, 0, 0.28);
}

body.docs-layout .nav-main a:not(.btn) {
  color: var(--docs-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

body.docs-layout .nav-main a:not(.btn):hover {
  color: var(--docs-text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

body.docs-layout .nav-main a:not(.btn) .icon {
  width: 17px;
  height: 17px;
  margin-right: 0;
  margin-inline-end: 8px;
  opacity: 0.92;
  flex-shrink: 0;
  color: var(--docs-accent);
}

body.docs-layout .nav-main a:not(.btn):hover .icon {
  opacity: 1;
}

body.docs-layout .nav-main a:not(.btn):focus-visible {
  outline: 2px solid var(--docs-accent);
  outline-offset: 2px;
}

/* Admin zone */
body.docs-layout .nav-main > a[href="/admin"] {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(59, 130, 246, 0.35);
}

/* Account exit */
body.docs-layout .nav-main > a[href="/logout"] {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(243, 241, 234, 0.82);
}

body.docs-layout .nav-main > a[href="/logout"]:hover {
  color: var(--docs-text);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.22);
}

body.docs-layout .nav-main > a[href="/logout"] .icon {
  color: rgba(248, 113, 113, 0.85);
}

body.docs-layout .nav-main .btn-primary {
  background: var(--docs-accent);
  border-color: transparent;
  color: #f8fafc;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

body.docs-layout .nav-main .btn-primary:hover {
  background: var(--docs-accent-hover);
  color: #fff;
}

body.docs-layout .site-footer {
  background: var(--docs-bg);
  border-top-color: var(--docs-border);
}

body.docs-layout .site-footer a {
  color: var(--docs-muted);
}

body.docs-layout .site-footer a:hover {
  color: var(--docs-accent);
}

.main-content:has(.docs-shell) {
  position: relative;
  padding: clamp(24px, 4vw, 40px) 20px clamp(48px, 6vw, 72px);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 55% 40% at 50% -10%, var(--docs-accent-glow), transparent 55%),
    radial-gradient(ellipse 38% 32% at 92% 45%, rgba(59, 130, 246, 0.06), transparent 50%),
    linear-gradient(180deg, var(--docs-bg) 0%, #0a0908 100%);
}

body.docs-layout .docs-shell {
  width: min(1180px, 100%);
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
  min-width: 0;
  box-sizing: border-box;
}

body.docs-layout .docs-sidebar {
  position: sticky;
  top: var(--docs-header-offset);
  align-self: start;
  background:
    linear-gradient(165deg, var(--docs-accent-soft) 0%, rgba(19, 19, 17, 0.92) 45%, rgba(14, 14, 12, 0.97) 100%);
  border: 1px solid var(--docs-border);
  border-radius: 16px;
  padding: 18px 14px 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 20px 50px rgba(0, 0, 0, 0.35);
}

body.docs-layout .docs-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--docs-text);
}

body.docs-layout .docs-sidebar-brand .icon {
  color: var(--docs-accent);
  flex-shrink: 0;
}

body.docs-layout .docs-sidebar-label {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--docs-faint);
}

body.docs-layout .docs-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.docs-layout .docs-toc a {
  display: block;
  color: var(--docs-muted);
  text-decoration: none;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

body.docs-layout .docs-toc a:hover {
  color: var(--docs-text);
  background: rgba(255, 255, 255, 0.05);
}

body.docs-layout .docs-toc a:focus-visible {
  outline: 2px solid var(--docs-accent);
  outline-offset: 2px;
}

body.docs-layout .docs-content {
  max-width: 920px;
  min-width: 0;
  margin: 0;
  padding: 0 0 48px;
}

body.docs-layout .docs-content section[id] {
  scroll-margin-top: calc(var(--docs-header-offset) + 16px);
}

body.docs-layout .docs-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0 0 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--docs-border);
}

body.docs-layout .docs-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--docs-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

body.docs-layout .docs-nav a:hover {
  color: var(--docs-accent);
}

body.docs-layout .docs-nav a .icon {
  color: var(--docs-faint);
  transition: color 0.15s ease;
}

body.docs-layout .docs-nav a:hover .icon {
  color: var(--docs-accent);
}

body.docs-layout .docs-modern {
  max-width: none;
  padding: 0;
}

body.docs-layout .docs-content h1 {
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--docs-text);
  line-height: 1.12;
}

body.docs-layout .docs-lead {
  font-size: 1.08rem;
  color: var(--docs-muted);
  margin: 0 0 8px;
  line-height: 1.65;
  max-width: 52ch;
}

body.docs-layout .docs-inline-link {
  color: var(--docs-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.docs-layout .docs-inline-link:hover {
  filter: brightness(1.12);
}

body.docs-layout .docs-content h2 {
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  color: var(--docs-text);
}

body.docs-layout .docs-content h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 22px 0 10px;
  color: var(--docs-text);
}

body.docs-layout .docs-content h3:first-child {
  margin-top: 0;
}

body.docs-layout .docs-content p {
  margin: 0 0 14px;
  color: var(--docs-muted);
  line-height: 1.68;
}

body.docs-layout .docs-content ul,
body.docs-layout .docs-content ol {
  margin: 0 0 14px;
  padding-left: 1.35em;
  color: var(--docs-muted);
  line-height: 1.68;
}

body.docs-layout .docs-content li {
  margin-bottom: 6px;
}

body.docs-layout .docs-content code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.84em;
  background: var(--docs-elevated);
  color: var(--docs-accent-hover);
  padding: 2px 7px;
  border-radius: 7px;
  border: 1px solid var(--docs-border);
}

body.docs-layout .docs-content pre {
  margin: 16px 0;
  padding: 18px 20px;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(6, 6, 5, 0.85);
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.58;
  color: #e8e6df;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

body.docs-layout .docs-content pre code {
  background: none;
  padding: 0;
  border: 0;
  color: inherit;
}

body.docs-layout .docs-content .card {
  margin: 16px 0;
}

body.docs-layout .docs-content .btn {
  margin-top: 8px;
}

body.docs-layout .docs-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 92% 0%, var(--docs-accent-glow), transparent 58%),
    radial-gradient(circle at 12% 88%, rgba(59, 130, 246, 0.08), transparent 45%),
    linear-gradient(155deg, var(--docs-surface) 0%, var(--docs-card) 100%);
  border: 1px solid var(--docs-border);
  border-radius: 18px;
  padding: clamp(22px, 4vw, 32px);
  margin-bottom: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px rgba(0, 0, 0, 0.32);
}

body.docs-layout .docs-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(59, 130, 246, 0.04) 100%);
  pointer-events: none;
  border-radius: inherit;
}

body.docs-layout .docs-kicker {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--docs-accent);
  margin: 0 0 12px;
}

body.docs-layout .docs-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

body.docs-layout .docs-chip {
  border: 1px solid var(--docs-border);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--docs-muted);
}

body.docs-layout .docs-chip code {
  font-size: 0.88em;
  margin-left: 2px;
}

body.docs-layout .docs-section-card {
  border: 1px solid var(--docs-border);
  background: linear-gradient(180deg, var(--docs-surface) 0%, var(--docs-card) 100%);
  border-radius: 16px;
  padding: clamp(20px, 3vw, 26px);
  margin-bottom: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

body.docs-layout .docs-callout {
  border-left: 4px solid var(--docs-accent);
  background: linear-gradient(100deg, var(--docs-accent-soft) 0%, rgba(16, 16, 14, 0.4) 52%, transparent 100%);
}

body.docs-layout .docs-callout-snippet {
  margin: 12px 0;
}

body.docs-layout .docs-point {
  font-size: 1.02rem;
  color: var(--docs-text);
  margin-bottom: 0;
}

body.docs-layout .docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.9rem;
}

body.docs-layout .docs-table th,
body.docs-layout .docs-table td {
  border: 1px solid var(--docs-border);
  padding: 11px 14px;
  text-align: left;
}

body.docs-layout .docs-table th {
  background: var(--docs-elevated);
  color: var(--docs-muted);
  font-weight: 600;
}

body.docs-layout .docs-table td {
  color: var(--docs-muted);
}

body.docs-layout .docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.docs-layout .docs-tile {
  border: 1px solid var(--docs-border);
  border-radius: 14px;
  background: var(--docs-elevated);
  padding: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.docs-layout .docs-tile:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

body.docs-layout .docs-tile h3 {
  margin-top: 0;
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  font-size: 1.05rem;
}

body.docs-layout .docs-models {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding-left: 0;
  list-style: none;
}

body.docs-layout .docs-models li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  background: var(--docs-elevated);
  color: var(--docs-muted);
}

body.docs-layout .docs-models li span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--docs-accent);
}

@media (max-width: 980px) {
  body.docs-layout .docs-shell {
    grid-template-columns: 1fr;
  }

  body.docs-layout .docs-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    padding: 16px;
  }

  body.docs-layout .docs-sidebar-brand,
  body.docs-layout .docs-sidebar-label {
    grid-column: 1 / -1;
  }

  body.docs-layout .docs-toc {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.docs-layout .docs-toc a {
    flex: 1 1 auto;
    min-width: calc(50% - 6px);
    text-align: center;
    padding: 9px 10px;
    font-size: 0.82rem;
  }

  body.docs-layout .docs-grid {
    grid-template-columns: 1fr;
  }

  body.docs-layout .docs-models {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.docs-layout {
    --docs-header-offset: 72px;
  }

  body.docs-layout .docs-content pre {
    padding: 14px 16px;
    font-size: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  body.docs-layout .docs-nav {
    gap: 10px 14px;
    margin-bottom: 22px;
  }

  body.docs-layout .nav-toggle {
    color: var(--docs-text);
    border-color: var(--docs-border);
    background: var(--docs-elevated);
  }

  body.docs-layout .nav-toggle:hover {
    background: var(--docs-surface);
    color: var(--docs-text);
  }

  body.docs-layout .nav-toggle:focus-visible {
    outline-color: var(--docs-accent);
  }

  body.docs-layout .nav-main {
    max-width: none;
    margin: 0;
    padding: 76px 22px 32px;
    gap: 6px;
    border-radius: 0;
    border: none;
    background: linear-gradient(180deg, rgba(8, 8, 7, 0.98) 0%, rgba(12, 11, 9, 0.99) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: none;
    align-items: stretch;
    justify-content: flex-start;
  }

  body.docs-layout .site-header.nav-open .nav-toggle {
    background: var(--docs-elevated);
    border-color: var(--docs-border);
    color: var(--docs-text);
  }

  body.docs-layout .nav-main a:not(.btn) {
    color: var(--docs-muted);
    font-size: 0.9375rem;
    padding: 14px 16px;
    border-radius: 12px;
    justify-content: flex-start;
    min-height: 48px;
  }

  body.docs-layout .nav-main a:not(.btn):hover {
    color: var(--docs-text);
    background: rgba(255, 255, 255, 0.06);
    border-color: transparent;
    box-shadow: none;
  }

  body.docs-layout .nav-main a:not(.btn) .icon {
    width: 20px;
    height: 20px;
  }

  body.docs-layout .nav-main > a[href="/admin"] {
    margin-left: 0;
    padding-left: 16px;
    border-left: none;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(59, 130, 246, 0.35);
  }

  body.docs-layout .nav-main > a[href="/logout"] {
    margin-left: 0;
    padding-left: 16px;
    border-left: none;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Landing (home) — match docs mobile nav polish */
  .lp-root .nav-toggle {
    color: var(--lp-text);
    border-color: var(--lp-line);
    background: var(--lp-surface2);
  }

  .lp-root .nav-toggle:hover {
    background: var(--lp-surface);
    color: var(--lp-text);
  }

  .lp-root .nav-toggle:focus-visible {
    outline-color: var(--lp-accent);
  }

  .lp-root .site-header.nav-open .nav-toggle {
    background: var(--lp-surface2);
    border-color: var(--lp-line);
    color: var(--lp-text);
  }

  .lp-root .nav-main {
    max-width: none;
    margin: 0;
    padding: 76px 22px 32px;
    gap: 6px;
    border-radius: 0;
    border: none;
    background: linear-gradient(180deg, rgba(8, 8, 7, 0.98) 0%, rgba(12, 11, 9, 0.99) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: none;
    align-items: stretch;
    justify-content: flex-start;
  }

  .lp-root .nav-main a:not(.btn) {
    font-size: 0.9375rem;
    padding: 14px 16px;
    border-radius: 12px;
    min-height: 48px;
    justify-content: flex-start;
  }

  .lp-root .nav-main a:not(.btn):hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: transparent;
    box-shadow: none;
  }

  .lp-root .nav-main a:not(.btn) .icon {
    width: 20px;
    height: 20px;
  }

  .lp-root .nav-main > a[href="/login"] {
    margin-left: 0;
    padding-left: 16px;
    border-left: none;
    margin-top: 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .lp-root .nav-main > a.btn.lp-btn-primary {
    margin-left: 0;
    margin-top: 10px;
    justify-content: center;
    width: 100%;
    padding: 14px 18px;
    font-size: 0.9375rem;
  }
}

/* Playground – full-screen ChatGPT-style (sidebar + main, no top nav) */
body.pg-fullscreen {
  overflow: hidden;
}

.pg-flash.flash-container {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* Left sidebar – ChatGPT #202123 style */
.pg-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: #202123;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.pg-sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 0;
}

.pg-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.pg-sidebar-logo:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.pg-sidebar-logo .icon {
  color: var(--primary);
}

.pg-sidebar-new-chat {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 12px 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.pg-sidebar-new-chat:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.pg-sidebar-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 24px);
  margin: 12px 12px 0;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pg-sidebar-search:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.pg-sidebar-section {
  margin-top: 24px;
  padding: 0 16px;
}

.pg-sidebar-heading {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

.pg-sidebar-hint,
.pg-sidebar-empty {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.pg-sidebar-chats {
  flex: 1;
  min-height: 80px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pg-sidebar-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.pg-sidebar-chat-list li {
  margin: 0;
  padding: 0;
}

.pg-sidebar-chat-list a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.pg-sidebar-chat-list a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.pg-sidebar-chat-list a.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.pg-sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.pg-sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.pg-sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pg-sidebar-username {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pg-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pg-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* Main content area (right of sidebar) – fixed height so feed can scroll */
.pg-main {
  margin-left: 260px;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.pg-page {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.pg-backdrop {
  position: fixed;
  inset: 0;
  left: 260px;
  background: var(--bg);
  pointer-events: none;
  z-index: 0;
}

.pg-app {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

/* Minimal top bar */
.pg-header {
  flex-shrink: 0;
  padding: 16px 0 12px;
}

.pg-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pg-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.pg-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pg-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.pg-sidebar-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.pg-header-back {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
}

.pg-header-back:hover {
  color: var(--text);
}

.pg-brand-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.pg-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hidden native select – value synced by custom dropdown */
.pg-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  appearance: none;
  opacity: 0;
  pointer-events: none;
}

.pg-select {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 36px 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pg-select:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.pg-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

/* Custom model dropdown */
.pg-model-dropdown {
  position: relative;
}

.pg-model-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pg-model-trigger:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.pg-model-trigger:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.pg-model-trigger-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pg-model-trigger-icon-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.pg-model-trigger-icon-wrap .icon {
  color: var(--text-muted);
}

.pg-model-chevron {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.pg-model-dropdown.is-open .pg-model-chevron {
  transform: rotate(180deg);
}

.pg-model-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: #25262a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  padding: 6px;
  z-index: 100;
  -webkit-overflow-scrolling: touch;
}

.pg-model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pg-model-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.pg-model-option[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.pg-model-option-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.pg-model-option-icon .icon {
  width: 18px;
  height: 18px;
}

.pg-model-option-id {
  font-weight: 500;
  word-break: break-word;
}

/* Centered message feed (ChatGPT-style max-width) */
.pg-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

.pg-feed > .pg-msg {
  width: 100%;
  max-width: 48rem;
}

/* Empty state – centered greeting; fully hidden when messages exist */
.pg-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  text-align: center;
  padding: 48px 24px;
}

.pg-empty[hidden],
#chat-welcome[hidden] {
  display: none !important;
  flex: none;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.pg-empty-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pg-empty-headline {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.pg-empty-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 400px;
  margin: 0;
}

/* Message rows – avatar + content, ChatGPT layout */
.pg-msg {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pg-msg:last-child {
  border-bottom: none;
}

.pg-msg--user {
  flex-direction: row-reverse;
}

/* Circular avatars */
.pg-msg-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pg-msg-avatar-inner {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pg-msg--user .pg-msg-avatar {
  background: var(--primary);
  color: white;
}

.pg-msg--user .pg-msg-avatar-inner {
  color: white;
}

.pg-msg--assistant .pg-msg-avatar {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.pg-msg-body {
  flex: 1;
  min-width: 0;
}

.pg-msg-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* User: right-aligned, subtle bubble (ChatGPT white/5 style) */
.pg-msg--user .pg-msg-text {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  margin-left: auto;
  max-width: 85%;
}

.pg-msg--loading .pg-msg-text {
  color: var(--text-muted);
}

.pg-msg-text--error {
  color: #f87171;
}

/* Markdown-rendered assistant text: code blocks, lists, etc. */
.pg-msg-text--md {
  white-space: normal;
}

.pg-msg-text--md p {
  margin: 0 0 0.75em;
}

.pg-msg-text--md p:last-child {
  margin-bottom: 0;
}

.pg-msg-text--md code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  word-break: break-word;
}

.pg-msg-text--md pre {
  margin: 0.75em 0;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pg-msg-text--md pre code {
  padding: 0;
  background: none;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.pg-msg-text--md ul,
.pg-msg-text--md ol {
  margin: 0.75em 0;
  padding-left: 1.5em;
}

.pg-msg-text--md li {
  margin: 0.25em 0;
}

.pg-msg-text--md blockquote {
  margin: 0.75em 0;
  padding-left: 1em;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
}

.pg-msg-text--md h1, .pg-msg-text--md h2, .pg-msg-text--md h3 {
  margin: 1em 0 0.5em;
  font-weight: 600;
}

.pg-msg-text--md h1 { font-size: 1.25rem; }
.pg-msg-text--md h2 { font-size: 1.125rem; }
.pg-msg-text--md h3 { font-size: 1rem; }

/* Composer – pill shape, centered, minimal space below (ChatGPT-style) */
.pg-footer {
  flex-shrink: 0;
  padding: 12px 0 12px;
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pg-composer-wrap {
  width: 100%;
  max-width: 48rem;
}

.pg-footer-disclaimer {
  margin: 10px 0 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.8;
}

.pg-composer {
  width: 100%;
}

.pg-composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pg-composer-inner:focus-within {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pg-composer-input {
  flex: 1;
  min-height: 24px;
  max-height: 200px;
  padding: 8px 0;
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text);
  background: none;
  border: none;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
}

.pg-composer-input::placeholder {
  color: var(--text-muted);
}

.pg-composer-input:focus {
  outline: none;
}

/* Send – circular, subtle (ChatGPT: white circle with dark arrow in dark mode) */
.pg-composer-send {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-fast), opacity var(--transition-fast);
}

.pg-composer-send:hover:not(:disabled) {
  background: var(--text-secondary);
  color: var(--bg);
}

.pg-composer-send:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .pg-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .pg-page.pg-sidebar-open .pg-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }

  .pg-page.pg-sidebar-open .pg-backdrop {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.45);
    z-index: 49;
    left: 0;
  }

  .pg-sidebar-toggle {
    display: inline-flex;
  }

  .pg-main {
    margin-left: 0;
  }

  .pg-backdrop {
    left: 0;
  }

  .pg-header-back {
    display: flex;
  }

  .pg-composer-input {
    font-size: 1rem;
  }

  .pg-app {
    padding: 0 16px;
  }

  .pg-header {
    padding: 12px 0;
  }

  .pg-feed {
    padding: 16px 0 12px;
  }

  .pg-feed > .pg-msg {
    max-width: 100%;
  }

  .pg-empty {
    min-height: 280px;
    padding: 32px 16px;
  }

  .pg-empty-avatar {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
  }

  .pg-empty-headline {
    font-size: 1.375rem;
  }

  .pg-msg {
    padding: 20px 0;
    gap: 12px;
  }

  .pg-msg--user .pg-msg-text {
    max-width: 92%;
  }

  .pg-footer {
    padding: 10px 0 10px;
  }

  .pg-footer-disclaimer {
    margin-top: 8px;
    font-size: 0.625rem;
  }

  .pg-composer-wrap {
    max-width: 100%;
  }

  .pg-composer-inner {
    padding: 10px 14px 10px 16px;
    border-radius: 22px;
  }
}
