/* ============================================================
   Flareform - Professional Design System
   Inspired by: Formspree, Linear, Vercel tool aesthetics
   Font: Geist (Google Fonts)
   Colors: Flareform Orange #f7831e, dark neutrals, clean whites
   Rules: No gradients. No emojis. WCAG 2.2 AA. Zero clutter.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Blacnova Design System Tokens */
  --font-family-primary: 'Poppins';
  --font-family-stack: 'Poppins', sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-md: 13.5px;
  --font-size-lg: 14px;
  --font-size-xl: 20.25px;
  --font-weight-base: 400;
  --font-lineHeight-base: 20.25px;
  
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #484848;
  --color-text-tertiary: #6b7280;
  --color-text-inverse: #ffffff;
  
  --color-surface-base: #ffffff;
  --color-surface-raised: #f3f4f6;
  
  --color-border-muted: #e5e7eb;
  --color-border-strong: #1a1a1a;
  
  --space-1: 1px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 14px;
  --space-7: 15px;
  --space-8: 20px;
  
  --radius-xs: 0px;
  --radius-sm: 0px;
  
  --motion-duration-instant: 120ms;
  --motion-duration-fast: 200ms;
  --motion-duration-normal: 250ms;

  /* Backward Compatibility Mappings */
  --primary: #f7831e;
  --primary-dark: #d96c10;
  --primary-bg: rgba(247,131,30,0.1);
  --text: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-tertiary: var(--color-text-tertiary);
  --bg: var(--color-surface-base);
  --surface: #1a1a1a;
  --surface-hover: #141414;
  --border: var(--color-border-muted);
  --border-strong: var(--color-border-strong);
  --radius: 0px;
  --radius-lg: 0px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.8);
  --font: var(--font-family-stack);
  --mono: 'Geist Mono', 'Courier New', monospace;
  --nav-h: 56px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
b, strong { font-weight: 400; }

body {
  font-family: var(--font-family-stack);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- SKIP LINK ---------- */
.skip-link {
  position: absolute;
  top: -48px; left: 12px;
  z-index: 10000;
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
  text-decoration: none;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-base);
  border-radius: var(--radius-xs);
}
.skip-link:focus-visible { top: 12px; outline: 2px solid var(--color-border-strong); outline-offset: 2px; }

/* ---------- NAVIGATION ---------- */
.site-nav {
  --color-surface-base: #1a1a1a;
  --color-surface-raised: #141414;
  --color-text-primary: #ffffff;
  --color-text-secondary: #d1d5db;
  --color-border-muted: #333333;
  --color-border-strong: rgba(255, 255, 255, 0.82);
  
  height: var(--nav-h);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  grid-column: 1 / -1;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 24px;
  margin-right: 8px;
}

.nav-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-brand-name {
  font-size: 14px;
  font-weight: 400;
  color: #ffffff !important;
  line-height: 1;
}

.nav-brand-sub {
  font-size: 11px;
  font-weight: 400;
  color: #a1a1aa;
  letter-spacing: 0.03em;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 20px;
  flex-shrink: 0;
}

/* Tab nav pills in top bar */
.nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px !important;
  list-style: none;
  flex: 1;
}

.nav-tabs li {
  display: inline-flex;
}

.nav-tab-btn i { display: none; }

input, textarea, select { font-family: "Geist", sans-serif !important; }

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  background: transparent !important;
  border: none !important;
  padding: 0 4px !important;
  font-family: var(--font-family-stack);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-base);
  cursor: pointer;
  transition: all var(--motion-duration-fast);
  color: var(--color-text-secondary);
  border-radius: 0 !important;
}

.nav-tab-btn:hover {
  color: var(--color-text-primary);
  background: transparent !important;
}

.nav-tab-btn.current {
  color: var(--color-text-primary);
  font-weight: 400;
}

.nav-tab-btn:focus-visible {
  outline: none;
}

.nav-tab-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-tab-btn.current .nav-tab-icon { opacity: 1; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 0;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #1a1a1a;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  letter-spacing: 0.01em;
}

.nav-support-btn:hover {
  background: #f7831e !important;
  color: #fff !important;
  border-color: #f7831e !important;
  text-decoration: none !important;
}

.nav-support-btn:hover i {
  color: #fff !important;
}

.nav-support-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- TOAST ---------- */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 36px 12px 14px;
  background: #1a1a1a !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  animation: toastIn 0.2s ease;
  word-break: break-word;
}

.toast.error  { border-left-color: transparent !important; }
.toast.warning { border-left-color: transparent !important; }
.toast.success { border-left-color: transparent !important; }

.toast-close {
  position: absolute;
  top: 8px; right: 10px;
  background: transparent !important;
  border: none !important;
  color: var(--text-tertiary) !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer;
  padding: 0 !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  box-shadow: none !important;
  border-radius: var(--radius-sm) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.toast-close:hover { color: var(--text) !important; }

.toast-hide {
  opacity: 0;
  transform: translateX(16px);
  transition: all 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- MAIN LAYOUT ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.right-sidebar {
  background: #1a1a1a;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 32px 16px 20px;
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.right-sidebar::-webkit-scrollbar,
.docs-sidebar::-webkit-scrollbar,
.fb-detail::-webkit-scrollbar,
#inbox-detail-json::-webkit-scrollbar,
#logs-detail-json::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.right-sidebar::-webkit-scrollbar-track,
.docs-sidebar::-webkit-scrollbar-track,
.fb-detail::-webkit-scrollbar-track,
#inbox-detail-json::-webkit-scrollbar-track,
#logs-detail-json::-webkit-scrollbar-track {
  background: transparent;
}

.right-sidebar::-webkit-scrollbar-thumb,
.docs-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.right-sidebar::-webkit-scrollbar-thumb:hover,
.docs-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.fb-detail::-webkit-scrollbar-thumb,
#inbox-detail-json::-webkit-scrollbar-thumb,
#logs-detail-json::-webkit-scrollbar-thumb {
  background: rgba(26, 26, 26, 0.28);
  border-radius: 999px;
}

.fb-detail,
#inbox-detail-json,
#logs-detail-json {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 26, 26, 0.28) transparent;
}

.right-sidebar .nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px !important;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  margin: 0;
  flex: 1 1 auto;
}

.right-sidebar .nav-tabs li {
  display: flex;
  width: 100%;
}

.right-sidebar .nav-tab-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 12px;
  width: 100%;
  padding: 12px 16px !important;
  color: #fff !important;
  border-radius: var(--radius) !important;
  font-size: 15px;
  background: transparent !important;
  transition: background 0.15s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.right-sidebar .nav-tab-btn i {
  display: none !important;
}

.right-sidebar .nav-tab-btn--account {
  margin: 0;
}

.right-sidebar .nav-tab-btn--account i {
  display: inline-flex !important;
  font-size: 20px;
  color: #fff !important;
  flex-shrink: 0;
}

.right-sidebar .nav-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.right-sidebar .nav-tab-btn.current {
  background: rgba(255, 255, 255, 0.2) !important;
  font-weight: 400;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-copyright {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 4px 8px 0;
}

#main-content {
  grid-column: 2;
  grid-row: 2;
}

/* Tab panels */
section { display: none; margin-top: 0 !important; padding-top: 0 !important; }
section.current {
  display: block;
  animation: fadeIn 0.15s ease;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- PAGE CONTENT ---------- */
.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  width: 100%;
}
.page-content i, .page-content svg { color: #1a1a1a !important; }

/* ---------- PAGE HEADER ---------- */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 32px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 400;
  max-width: 600px;
}

/* ---------- CARD / SECTION BOX ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-section {
  padding: 32px;
  border-bottom: 1px solid var(--border);
}

.card-section:last-child { border-bottom: none; }

.card-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ---------- TEXTAREA ---------- */
textarea {
  width: 100%;
  min-height: 180px;
  background: var(--color-surface-base);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-xs);
  padding: var(--space-6);
  font-family: var(--mono);
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
  resize: vertical;
  display: block;
  transition: all var(--motion-duration-fast);
  line-height: 1.6;
}

textarea::placeholder { color: var(--color-text-tertiary); }

textarea:focus-visible {
  outline: 2px solid var(--color-border-strong);
  outline-offset: -1px;
  border-color: var(--color-border-strong);
}

textarea.drag-over {
  border-color: var(--color-border-strong);
  border-style: dashed;
  background: var(--color-surface-raised);
}

/* ---------- OPTIONS GRID ---------- */
.options {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.options-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.option-item:hover { background: var(--surface); }

.options-row > label,
.format-options-sub label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 0 12px;
  height: 44px !important;
  box-sizing: border-box !important;
  border-radius: var(--radius);
  transition: background 0.1s;
}

.format-options-sub label {
  color: #fff;
}

.options-row > label:hover,
.format-options-sub label:hover { 
  background: var(--surface); 
  color: #fff;
}

.filter-sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.filter-sort-row .control-group {
  margin: 0;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- SELECT / CONTROL ROW ---------- */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 0 4px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.control-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
}

.styled-select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236B6B6B'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.12s;
  min-width: 160px;
}

.styled-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(246,130,31,0.12);
}

/* Custom dropdown */
.custom-dropdown-wrapper {
  position: relative;
  min-width: 160px;
}

.custom-dropdown-trigger {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: "Geist", sans-serif !important;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.12s;
  user-select: none;
  width: 100%;
}

.custom-dropdown-trigger:hover { border-color: var(--border-strong); }

.custom-dropdown-wrapper.open .custom-dropdown-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(246,130,31,0.12);
}

.custom-dropdown-arrow {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-left: 6px;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.custom-dropdown-wrapper.open .custom-dropdown-arrow { transform: rotate(180deg); }

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 300px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  display: none;
  max-height: 220px;
  overflow-y: auto;
}

.custom-dropdown-wrapper.open .custom-dropdown-menu { display: block; }

.custom-dropdown-option {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.08s;
  white-space: nowrap;
}

.custom-dropdown-option:last-child { border-bottom: none; }
.custom-dropdown-option:hover { background: #1a1a1a !important; color: #fff !important; }
.custom-dropdown-option.selected { background: #f3f4f6 !important; color: #1a1a1a !important; font-weight: 400; }

/* ---------- SLIDER ---------- */
.slider-group {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 400;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--text);
  width: 100%;
}

.slider-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 10px;
  line-height: 1.4;
  margin-bottom: 0;
}

input[type="range"] {
  width: 100%;
  accent-color: #1a1a1a;
  height: 4px;
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.sim-val {
  color: #1a1a1a;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* ---------- FORMAT OPTIONS SUB ---------- */
.format-options-sub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2px;
  padding: 12px 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 10px;
}

.format-options-title {
  grid-column: 1 / -1;
  font-weight: 400;
  color: #fff;
  width: 100%;
  margin-bottom: 6px;
  font-size: 13px;
}

/* ---------- BUTTONS ---------- */
.button-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button-group button {
  flex: 1;
  height: 44px !important;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-sm);
  border: 1px solid #1a1a1a;
  font-family: var(--font-family-stack);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-base);
  cursor: pointer;
  transition: all var(--motion-duration-fast);
  white-space: nowrap;
  background: #1a1a1a;
  color: #fff;
}

button:hover { background: #f7831e; color: #fff; border-color: #f7831e; }

button:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

button:disabled { opacity: 0.4; cursor: not-allowed; }

.secondary-btn {
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-muted);
}

.secondary-btn:hover {
  background: var(--color-border-strong);
  color: var(--color-surface-base);
  border-color: var(--color-border-strong);
}

.ink-btn {
  background: #1a1a1a !important;
  color: #ffffff !important;
  border: 1px solid #1a1a1a !important;
}

.ink-btn:hover {
  background: #ffffff !important;
  color: #1a1a1a !important;
  border-color: #1a1a1a !important;
}

/* Upload button */
.mobile-upload-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  margin-top: 12px;
}

.mobile-upload-btn,
.clear-diagnostics-btn {
  width: 100% !important;
  height: 44px !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  border-radius: var(--radius) !important;
  background: #1a1a1a !important;
  color: #fff !important;
  border: 1px solid #1a1a1a !important;
  font-family: var(--font) !important;
  font-weight: 400 !important;
  cursor: pointer;
}

.media-preview-open-btn:disabled,
.media-preview-open-btn {
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  background: #1a1a1a !important;
  opacity: 1 !important;
}
.media-preview-open-btn i {
  color: #fff !important;
  font-size: 18px !important;
}

.mobile-upload-btn:hover,
.clear-diagnostics-btn:hover {
  background: #333 !important;
  color: #fff !important;
  border-color: #333 !important;
}

/* ---------- STATUS / STATS ---------- */
.status-text {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  display: block;
  padding: 6px 0 10px;
}

.stats-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  margin-bottom: 12px;
}

.stats-bar strong { color: var(--primary); font-weight: 400; }

/* ---------- OUTPUT SECTION ---------- */
#output-container,
#folder-output-container {
  display: none;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ---------- CODE / PRE ---------- */
code {
  display: inline;
  background: var(--surface);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  color: #fff;
  word-break: break-word;
}
pre {
  display: block;
  background: var(--surface);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: #fff;
  overflow-x: auto;
}
pre code {
  display: inline;
  padding: 0;
  border: none;
  background: transparent;
}

/* ---------- TYPOGRAPHY ---------- */
h1 {
  margin-top: 0 !important;
  line-height: 1.1 !important;
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

h2 {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
  margin-top: 20px;
}

p {
  font-size: 15px;
  color: var(--color-text-primary);
  line-height: 1.6;
  margin-bottom: 16px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul.info-list {
  padding-left: 18px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.legal-panel {
  max-width: 720px;
}
.legal-lead {
  color: var(--color-text-secondary, #484848);
  margin-bottom: 20px;
}
.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 32px;
  padding: 16px 0;
  border-top: 1px solid var(--color-border-muted, #e5e5e5);
  border-bottom: 1px solid var(--color-border-muted, #e5e5e5);
}
.legal-toc a,
.legal-toc-btn {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 13px;
  border: none;
  border-bottom: 1px solid rgba(26, 26, 26, 0.25);
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.legal-toc a:hover,
.legal-toc-btn:hover {
  border-bottom-color: #f7831e;
  color: #f7831e;
}
.legal-panel h2 {
  margin-top: 36px;
  scroll-margin-top: 80px;
}
.legal-panel h3 {
  margin-top: 20px;
  font-size: 15px;
  font-weight: 600;
}
.legal-list {
  margin: 12px 0 16px 1.25rem;
  padding: 0;
}
.legal-list li {
  margin-bottom: 8px;
}
.legal-note {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-muted, #e5e5e5);
  font-size: 13px;
  color: var(--color-text-secondary, #484848);
}
.sidebar-legal-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sidebar-legal-link:hover {
  color: #f7831e;
}

#s-3 p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

#s-3 h2 {
  font-size: 14px;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text);
}

#s-3 > h1 {
  margin-bottom: 10px !important;
  font-size: 32px !important;
}

section > h1 {
  font-size: 32px;
  font-weight: 400 !important;
  margin-bottom: 16px;
  text-align: center;
}

@media (min-width: 769px) {
  section > h1 {
    font-size: 44px !important;
    text-align: center;
    margin-bottom: 40px !important;
    font-weight: 400 !important;
  }
}

/* ---------- DEMO HEADING ---------- */
.demo-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.1 !important;
}

.demo-heading-icon { 
  background: #f7831e !important;
  border: 0.6px solid #1a1a1a !important;
  border-radius: 50% !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
}
.demo-heading-icon i {
  font-size: 26.3px !important;
  color: #fff !important;
}
.demo-heading--lime { color: var(--text); }

/* ---------- ACTIVITY LOG ---------- */
.activity-log-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
  overflow: hidden;
}

.activity-log-toggle {
  background: #1a1a1a !important;
  color: #fff !important;
  border: 1px solid #1a1a1a !important;
  font-size: 13px;
  font-weight: 400;
  display: inline-flex;
  justify-content: space-between;
  width: auto;
  min-width: 180px;
  margin-top: 16px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm) !important;
  transition: all 0.15s;
}

.activity-log-toggle * { color: #fff !important; }

.activity-log-toggle:hover {
  background: #333 !important;
  border-color: #333 !important;
}

.activity-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  background: var(--surface);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  user-select: none;
  border-bottom: 1px solid transparent;
}

.activity-log-panel.open .activity-log-header { border-bottom-color: var(--border); }
.activity-log-header:hover { color: var(--text); background: var(--surface-hover); }

.activity-log-header:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.activity-log-badge {
  font-size: 10.5px;
  font-weight: 400;
  background: var(--border);
  color: var(--text-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-lg);
}

.activity-log-content {
  max-height: 160px;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  background: var(--bg);
}

.activity-entry { color: var(--text-secondary); }
.activity-entry .timestamp { color: var(--primary); margin-right: 6px; font-weight: 400; }

/* ---------- PROGRESS BAR ---------- */
.gecko-progress-bar-outer {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 8px 0;
}

.gecko-progress-bar-inner {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-sm);
  transition: width 0.15s ease;
}

/* ---------- DROP ZONES ---------- */
.folder-drop-zone,
.media-drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font-size: 13px;
}

.folder-drop-zone:hover,
.media-drop-zone:hover,
.folder-drop-zone.drag-over,
.media-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--text);
}

.folder-drop-zone:focus-visible,
.media-drop-zone:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- TABLES ---------- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  font-weight: 400;
  color: var(--text);
}
td { border: 1px solid var(--border); padding: 7px 12px; color: var(--text); }
tr:nth-child(even) td { background: var(--surface); color: #fff !important; }

.info-table th { font-size: 11.5px; color: var(--text-secondary); }
.info-table code {
  display: inline;
  padding: 1px 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  margin: 0;
}

/* ---------- DEMO PREVIEW MODAL ---------- */
.demo-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.demo-preview-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.demo-preview-close-btn {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-size: 18px !important;
  cursor: pointer;
  padding: 2px !important;
  box-shadow: none !important;
  border-radius: var(--radius-sm) !important;
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
}

.demo-preview-close-btn:hover { color: var(--text) !important; }

/* ---------- MAIN HEADER OVERRIDE (for pages that use it) ---------- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 0 !important;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.main-header h1 { margin: 0; border-bottom: none; padding: 0; }
.gecko-logo { display: none; } /* replaced by nav logo */

/* ---------- SCROLLBAR ---------- */


/* ---------- FOCUS GLOBAL ---------- */
:focus-visible {
  outline: 2px solid var(--color-border-strong);
  outline-offset: 2px;
}

/* ---------- MOBILE MENU ---------- */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  padding: 8px;
  cursor: pointer;
  margin-left: auto;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
}

.mobile-menu-overlay[hidden] {
  display: none;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.mobile-menu-close {
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  padding: 0 8px;
  width: auto !important;
  margin-left: auto;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.mobile-menu-link {
  background: transparent !important;
  border: none !important;
  text-align: left;
  font-size: 22px;
  font-weight: 400 !important;
  color: #1a1a1a !important;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  padding: 4px 0 !important;
  border-radius: 0 !important;
  transition: color 0.15s;
  justify-content: flex-start !important;
}

.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
  color: #666 !important;
  background: transparent !important;
  outline: none;
}

.mobile-menu-support {
  margin-top: 16px;
  color: #1a1a1a !important;
  font-weight: 400 !important;
  font-size: 22px;
}

.mobile-menu-copyright {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 24px;
  text-align: center;
  width: 100%;
}

.mobile-menu-docs {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mobile-menu-docs-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
  width: 100%;
}

.mobile-docs-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #1a1a1a;
  border-bottom: 2px solid #1a1a1a;
  transform: rotate(45deg);
  margin-right: 4px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.mobile-menu-docs-toggle[aria-expanded="true"] .mobile-docs-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.mobile-docs-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px 14px;
  border-left: 2px solid #e5e7eb;
  margin: 2px 0 6px 4px;
}

.mobile-docs-panel[hidden] {
  display: none !important;
}

.mobile-docs-link {
  font-size: 17px !important;
  color: #484848 !important;
  padding: 6px 0 !important;
}

.tool-intro {
  max-width: none;
  margin: 0 0 20px;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .site-nav { 
    padding: 0 16px; 
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
  }

  .nav-logo { width: 36px; height: 36px; }
  .nav-brand-name { font-size: 18px; font-weight: 400; }

  .nav-divider { display: none; }

  .app-shell {
    grid-template-columns: 1fr;
  }
  #main-content {
    grid-column: 1 / -1 !important;
  }
  .right-sidebar {
    display: none;
  }
  .nav-tabs { display: none; }

  .nav-brand-sub { display: none; }
  
  .nav-right .nav-support-btn { display: none; }
  
  .mobile-menu-btn { display: flex; }

  .page-content { padding: 20px 16px 48px; }
  .page-content i { color: #1a1a1a; }

  .page-title { font-size: 17px; }

  textarea { min-height: 140px; }

  .options-row { grid-template-columns: 1fr 1fr; }

  .button-group { flex-direction: column; width: 100%; }

  button:not(.toast-close):not(.clear-diagnostics-btn):not(.demo-preview-close-btn):not(.auth-text-btn):not(.quota-link-btn):not(.legal-toc-btn):not(.api-logs-icon-btn):not(.support-link-btn) {
    width: 100%;
  }
  .mobile-upload-btn {
    width: 100% !important;
    height: 44px !important;
    font-size: 14px !important;
    margin-top: 12px;
  }

  .controls-bar { gap: 8px; }
  
  .filter-sort-row { flex-direction: column; gap: 12px; }
  .filter-sort-row .control-group { width: 100%; flex-direction: column; align-items: flex-start; gap: 6px; }
  .filter-sort-row .styled-select { width: 100%; }

  .custom-dropdown-wrapper { width: 100%; }

  .toast-container {
    top: auto !important;
    bottom: 20px !important;
    left: 12px !important;
    right: 12px !important;
    max-width: none !important;
  }

  .toast {
    width: 100% !important;
    box-sizing: border-box !important;
    animation: toastUp 0.2s ease !important;
  }

  @keyframes toastUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .toast.toast-hide {
    transform: translateY(12px) !important;
    opacity: 0 !important;
  }

  .demo-preview-modal { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .toast-container { right: 10px; left: 10px; max-width: none; }
  .toast { font-size: 12.5px; }
  .page-content { padding: 32px 14px 60px; }
  .demo-heading { font-size: 22px; margin-bottom: 24px; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 8px; }
  .demo-heading-icon { width: 36px !important; height: 36px !important; margin: 0 !important; border-radius: 50% !important; }
  .demo-heading-icon i { font-size: 22px !important; color: #fff !important; }
  .options-row { grid-template-columns: 1fr; }
  .filter-sort-row { flex-direction: column; }
  .control-group { width: 100%; }
  .button-group { flex-direction: column; width: 100%; }
  
  button:not(.toast-close):not(.clear-diagnostics-btn):not(.demo-preview-close-btn):not(.auth-text-btn):not(.quota-link-btn):not(.legal-toc-btn):not(.api-logs-icon-btn):not(.support-link-btn) {
    width: 100%;
  }

  .auth-links {
    flex-wrap: nowrap;
    gap: 16px;
  }

  .auth-text-btn {
    width: auto !important;
    flex: 0 0 auto;
  }

  .nav-brand-name { font-size: 13px; }
  .demo-preview-modal { padding: 20px 16px; }
}

/* ---------- MISSING LAYOUT FIXES ---------- */
.folder-skip-builtins {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.folder-skip-builtins-label {
  font-weight: 400;
  color: var(--text);
  margin-right: 4px;
}

.media-results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 8px;
}

.info-github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.1s;
}

.info-github-link:hover {
  color: #f7831e !important;
  text-decoration: none !important;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.info-math-eq {
  text-align: center;
  font-size: 18px;
  color: #fff;
  font-family: var(--mono);
  margin: 16px 0;
  padding: 0;
  background: transparent;
  border: none;
}

.info-folder-note {
  margin: 8px 0 24px;
}

.info-folder-note__text,
.info-folder-note__skips {
  text-align: left;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 12px;
}

.info-folder-note__skips {
  margin-bottom: 0;
}

.info-folder-note--title-right .info-folder-note__title {
  flex-direction: row;
  justify-content: flex-end;
  text-align: right;
  margin-bottom: 12px;
}

.info-tag {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 8px;
  border: 1px solid var(--border);
  background: #fafafa;
  font-size: 12px;
  color: #484848;
}

/* Quotas & pricing */
.quota-banner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1a1a !important;
  color: #ffffff !important;
  font-size: 13px;
}

.quota-banner [data-quota-label] {
  color: #ffffff !important;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quota-banner-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.quota-link-btn {
  background: transparent;
  border: none;
  color: #f7831e !important;
  padding: 0;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.quota-gate {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1a1a !important;
}

.quota-gate p,
.quota-gate [data-quota-msg] {
  margin: 0 0 12px;
  color: #ffffff !important;
  font-size: 14px;
}

.quota-gate .quota-banner-actions {
  flex-wrap: wrap;
}

/* Shared panels used by tools / API */
.folder-skip-panel {
  border: 1px solid var(--border);
  background: #fff;
  padding: 16px;
  margin: 0;
}

.folder-skip-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.folder-skip-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: #484848;
  line-height: 1.5;
}

.folder-skip-input {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  padding: 10px 12px;
  border-radius: 0;
}

/* Account / auth - match API & Pricing light panels */
.acct-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

#s-9 > h1,
#s-9 > .tool-intro,
#s-9 > #acct-status-text {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

#s-9 > .tool-intro {
  margin-bottom: 16px;
}

.auth-stack {
  max-width: 640px;
}

.auth-card {
  border: 1px solid var(--border);
  background: #fafafa;
  padding: 18px 16px 16px;
  max-width: 640px;
  width: 100%;
  color: #1a1a1a;
}

/* Force [hidden] so display:flex cards cannot bleed when gated */
[hidden] {
  display: none !important;
}

.auth-gate-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
  max-width: 420px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.auth-gate-card[hidden] {
  display: none !important;
}

.auth-gate-card .auth-card-desc {
  min-height: 40px;
}

.auth-gate-card .auth-actions {
  margin-top: auto;
}

.auth-card-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.auth-card-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: #484848;
  line-height: 1.5;
}

.auth-card-meta {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6b7280;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #484848;
}

.auth-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  font-size: 14px;
  border-radius: 0;
}

.auth-input::placeholder {
  color: #9ca3af;
}

.auth-input:focus {
  outline: 2px solid rgba(247, 131, 30, 0.35);
  outline-offset: 1px;
  border-color: #f7831e;
}

.auth-input-code {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 16px;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
  font-size: 13px;
  color: #484848;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.auth-actions-wrap {
  margin-top: 14px;
}

.auth-primary {
  background: #1a1a1a !important;
  color: #fff !important;
  border: 1px solid #1a1a1a !important;
}

.auth-primary:hover {
  background: #f7831e !important;
  border-color: #f7831e !important;
}

.auth-card .secondary-btn {
  background: #fff !important;
  color: #1a1a1a !important;
  border: 1px solid var(--border) !important;
}

.auth-card .secondary-btn:hover {
  border-color: #1a1a1a !important;
  color: #1a1a1a !important;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.auth-text-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: #f7831e;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.acct-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 4px 0 14px;
}

.acct-stat {
  margin: 0;
}

.acct-stat-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 2px;
}

.acct-stat-value {
  font-size: 14px;
  color: #1a1a1a;
}

#acct-status-text {
  display: block;
  margin: 0 0 12px;
  min-height: 1.2em;
  font-size: 13px;
  color: #6b7280;
}

.pricing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 0;
}

.pricing-card {
  border: 1px solid var(--border);
  background: #fafafa;
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}

.pricing-card-name {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.pricing-card-price {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.pricing-card-period {
  font-size: 13px;
  color: #6b7280;
  margin-left: 2px;
  font-weight: 400;
}

.pricing-card-blurb {
  margin: 0;
  font-size: 13px;
  color: #484848;
  line-height: 1.45;
  min-height: 0;
}

.pricing-card-features {
  margin: 6px 0 14px;
  padding-left: 18px;
  color: #484848;
  font-size: 13px;
  flex: 1;
  line-height: 1.45;
}

.pricing-card-features li {
  margin-bottom: 5px;
}

.pricing-card > button {
  margin-top: auto;
  width: 100%;
}

.pricing-fineprint {
  margin-top: 20px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  max-width: 52em;
}

/* API tab */
#api-auth-gate[hidden],
#api-workspace[hidden],
#api-create-row[hidden],
#api-blocked-row[hidden],
#api-key-reveal[hidden],
#api-blocked-secondary[hidden] {
  display: none !important;
}

.api-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.api-panel {
  border: 1px solid var(--border);
  background: #fafafa;
  padding: 18px 16px 16px;
  margin: 0;
}

.api-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.api-panel-header .api-panel-title {
  margin-bottom: 4px;
}

.api-panel-header .api-panel-meta {
  margin-bottom: 0;
}

.api-create-field {
  flex: 1;
  min-width: 160px;
}

.api-blocked-row {
  margin-top: 4px;
}

.api-key-list {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.api-key-list:empty {
  display: none;
}

.api-key-empty {
  margin: 0;
}

.api-key-label-text {
  font-weight: 500;
}

.api-panel-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.api-panel-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: #484848;
  line-height: 1.5;
}

.api-panel-desc--spaced {
  margin-top: 12px;
}

.api-panel-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6b7280;
}

.api-create-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.api-input {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  padding: 10px 12px;
  border-radius: 0;
}

.api-field-label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #484848;
}

.api-mono {
  display: block;
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  border: 1px solid var(--border);
  background: #fff;
  color: #1a1a1a;
  padding: 10px 12px;
  resize: vertical;
}

.api-logs-field {
  position: relative;
}
.api-logs-field .api-mono {
  padding-top: 40px;
  padding-right: 72px;
  min-height: 160px;
}
.api-logs-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  z-index: 3;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 4px;
  pointer-events: none;
}
.api-logs-icon-btn {
  pointer-events: auto;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px !important;
  background: #1a1a1a !important;
  border: 1px solid #1a1a1a !important;
  color: #ffffff !important;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
}
.api-logs-icon-btn:hover {
  background: #333333 !important;
  border-color: #333333 !important;
  color: #ffffff !important;
}
.api-logs-icon-btn i,
.api-logs-icon-btn .ph-fill {
  font-size: 16px;
  line-height: 1;
  color: #ffffff !important;
}

.support-panel {
  max-width: 560px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.support-layout {
  margin-top: 8px;
  width: 100%;
}
.support-form-card {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
#s-12 > h1,
#s-12 > .tool-intro {
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
#s-12 > .tool-intro {
  margin-bottom: 16px;
}
.support-field {
  margin-bottom: 14px;
}
.support-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #484848;
}
.support-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #1a1a1a 50%), linear-gradient(135deg, #1a1a1a 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}
.support-message {
  min-height: 140px;
}
.support-actions {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  width: 100%;
}
.support-actions button {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 160px;
}

.api-usage-panel .api-chart {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
}

.api-usage-svg .chart-axis text {
  fill: #5C5A60;
  font-size: 11px;
}

.api-usage-svg .chart-axis-y .tick line {
  stroke: rgba(92, 90, 96, 0.1);
}

#api-key-list .api-key-row,
.api-key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

#api-key-list .api-key-row:last-child,
.api-key-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#api-key-list .api-key-row:first-child,
.api-key-row:first-child {
  padding-top: 0;
}

.api-key-reveal {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.api-key-reveal .api-mono {
  flex: 1;
  min-width: 0;
}

/* ---------- Docs mode: app nav + docs rail + content ---------- */
.app-shell.docs-mode {
  grid-template-columns: 240px 220px 1fr;
}

.docs-sidebar {
  display: none;
  background: #1a1a1a;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 12px 32px;
  grid-column: 2;
  grid-row: 2;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.app-shell.docs-mode .right-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.app-shell.docs-mode .docs-sidebar {
  display: flex;
  flex-direction: column;
}

.app-shell.docs-mode .docs-sidebar[hidden] {
  display: flex !important;
}

.docs-sidebar-label {
  margin: 0 4px 14px;
  padding: 0 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.docs-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #fff;
  font: inherit;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 0;
}

.docs-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.docs-nav-btn.current {
  background: rgba(255, 255, 255, 0.2);
}

#main-content.page-content {
  min-width: 0;
}

.app-shell.docs-mode #main-content {
  max-width: none;
  margin: 0;
  padding: 0;
  grid-column: 3;
}

section.docs-panel.current {
  display: block;
  height: calc(100vh - var(--nav-h));
  margin: 0 !important;
  padding: 0 !important;
}

.docs-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 980px) {
  .app-shell.docs-mode {
    grid-template-columns: 1fr;
  }
  .app-shell.docs-mode .docs-sidebar {
    display: none !important;
  }
  .app-shell.docs-mode #main-content {
    padding: 0;
    grid-column: 1;
  }
  section.docs-panel.current {
    height: calc(100vh - var(--nav-h) - 8px);
  }
  .auth-stack,
  .auth-card,
  .acct-workspace {
    max-width: none;
  }
  #s-9 > h1,
  #s-9 > .tool-intro,
  #s-9 > #acct-status-text {
    text-align: left;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  .acct-workspace {
    margin-left: 0;
    margin-right: 0;
  }
  .acct-stat-grid {
    grid-template-columns: 1fr;
  }
  .support-panel {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  #s-12 > h1,
  #s-12 > .tool-intro {
    text-align: left;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  .support-actions button {
    width: 100% !important;
    min-width: 0;
  }
}



/* ---------- Flareform dashboard panels ---------- */
.fb-panel {
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.fb-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  width: 100%;
}
.fb-stat-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fb-stat {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-muted);
  padding: 14px 16px;
  min-width: 0;
}
.fb-stat-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.fb-stat-value {
  font-size: 22px;
  color: var(--color-text-primary);
}
.fb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: flex-start;
  margin-bottom: 0;
  width: auto;
  flex: 1 1 auto;
}
.fb-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}
.fb-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}
.fb-export-actions .ink-btn {
  white-space: nowrap;
}
.fb-card-toolbar {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-muted);
}
.fb-chart-card .fb-card-toolbar {
  margin-top: 0;
}
.fb-chart-card .fb-card-toolbar + h2 {
  margin-top: 4px;
}
#projects-create .fb-card-toolbar {
  margin-left: -0;
  margin-right: -0;
}
#projects-create .fb-card-toolbar + .auth-card-title {
  margin-top: 4px;
}
.fb-field-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  min-width: 160px;
}
.fb-field-inline .auth-input,
.fb-field-inline select {
  min-width: 180px;
}
.fb-inbox-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.fb-detail {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 12px);
}
.fb-pre {
  background: #111111;
  color: #f4f4f5;
  border: 1px solid #2a2a2a;
  padding: 12px;
  overflow: auto;
  max-height: 320px;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 12px 0;
}
.fb-table th {
  background: var(--surface);
  color: #fff;
  font-weight: 400;
  padding: 12px;
  text-align: left;
}
.fb-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.fb-table tr.fb-row {
  cursor: pointer;
}
.fb-table tr.fb-row:hover,
.fb-table tr.fb-row.selected {
  background: var(--primary-bg);
}
.fb-chart-card {
  border: 1px solid var(--color-border-muted);
  padding: 14px 16px;
  background: #fff;
  margin-top: 16px;
  width: 100%;
  box-sizing: border-box;
}
.fb-chart-card h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}
.fb-chart-card.is-empty {
  min-height: 0;
}
.fb-chart {
  width: 100%;
  height: auto;
  min-height: 0 !important;
  max-height: none;
}
.fb-chart.has-chart {
  min-height: 200px !important;
}
.fb-empty-msg {
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #484848;
}
.fb-project-card {
  margin-bottom: 12px;
}
.fb-projects-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 900px) {
  .fb-stat-grid--3 {
    grid-template-columns: 1fr;
  }
  .fb-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fb-inbox-layout {
    flex-direction: column;
  }
  .fb-detail {
    width: 100%;
    position: static;
  }
}

/* ---------- Flareform section centering (Geckodupe parity) ---------- */
#s-6 > h1,
#s-6 > .tool-intro,
#s-6 > #acct-status-text {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
#s-6 > .tool-intro { margin-bottom: 16px; }
#s-6 .acct-workspace {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

#s-5 > h1,
#s-5 > .tool-intro,
#s-5 > .pricing-fineprint {
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
#s-5 .pricing-grid {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

#s-8.support-panel {
  max-width: 560px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
#s-8 > h1,
#s-8 > .tool-intro {
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
#s-8 > .tool-intro { margin-bottom: 16px; }

#s-4 > h1,
#s-4 > .tool-intro,
#s-3 > h1,
#s-3 > .tool-intro,
#s-11 > h1,
#s-11 > .tool-intro {
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
#s-3 > .tool-intro,
#s-4 > .tool-intro,
#s-11 > .tool-intro {
  margin-bottom: 16px;
}

#s-3 #analytics-body,
#s-4 #projects-workspace {
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#s-3 .fb-toolbar {
  justify-content: flex-start;
}

#s-4 #projects-create,
#s-4 .fb-project-card,
#s-4 .fb-projects-list {
  max-width: 640px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#s-1 > h1,
#s-1 > .tool-intro,
#s-2 > h1,
#s-2 > .tool-intro {
  text-align: left;
}

.pricing-card > button.secondary-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

#s-4 #projects-auth-gate,
#s-3 #analytics-auth-gate,
#s-2 #inbox-auth-gate,
#s-1 #overview-auth-gate,
#s-9 #logs-auth-gate,
#s-11 #api-auth-gate {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
#s-9 > h1,
#s-9 > .tool-intro {
  text-align: left;
}
#s-4 #projects-list {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 13px;
  color: #484848;
}
