/* B31.Si Sovereign Multi-AI Compare & Media Studio v5.0 (r118)
 * Minimalist Luxury Redesign: Obsidian & Champagne Gold · Arena-First Above-the-Fold
 * White-labeled for: 造物主多AI对比 (Creator) & 龍華樹多AI对比 (LongHua ASI) & 5折视频生图工坊
 */
.compare-host-pane {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 18px 32px;
  min-height: 0;
}
.compare-host-pane[hidden] { display: none !important; }
body.creator-compare-mode #messages,
body.creator-compare-mode #welcome,
body.creator-compare-mode .composer-wrap { display: none !important; }
body.creator-compare-mode .conversation-pane.is-empty { justify-content: flex-start !important; }
body.creator-compare-mode .conversation-pane.is-empty .conversation-header {
  position: relative !important;
  flex-shrink: 0 !important;
  border-bottom-color: var(--line, rgba(28, 25, 20, 0.08)) !important;
}
body.creator-compare-mode #compareArenaHost { display: block !important; }

.b31-cmp-root {
  --cmp-bg: #faf8f4;
  --cmp-card: #ffffff;
  --cmp-card-alt: #f5f2ea;
  --cmp-card-bg: #ffffff;
  --cmp-text: #181612;
  --cmp-muted: #6f685c;
  --cmp-border: rgba(28, 25, 20, 0.09);
  --cmp-border-gold: rgba(184, 138, 36, 0.34);
  --cmp-gold: #a67b1b;
  --cmp-gold-bright: #cfa034;
  --cmp-gold-soft: rgba(207, 160, 52, 0.11);
  --cmp-red: #c2332a;
  --cmp-red-soft: rgba(194, 51, 42, 0.09);
  --cmp-green: #15803d;
  --cmp-green-soft: rgba(21, 128, 61, 0.09);
  --cmp-code-bg: #151412;
  --cmp-code-fg: #f3efe6;
  --cmp-shadow: 0 2px 12px rgba(20, 17, 12, 0.045);
  --cmp-shadow-lg: 0 10px 28px rgba(20, 17, 12, 0.08);
  max-width: 1480px;
  margin: 0 auto;
  color: var(--cmp-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

html.dark .b31-cmp-root,
html[data-theme="night"] .b31-cmp-root {
  --cmp-bg: #0e0d0b;
  --cmp-card: #161512;
  --cmp-card-alt: #1f1d18;
  --cmp-card-bg: #161512;
  --cmp-text: #f3efe6;
  --cmp-muted: #9e9686;
  --cmp-border: rgba(255, 255, 255, 0.09);
  --cmp-border-gold: rgba(229, 188, 84, 0.34);
  --cmp-gold: #e5bc54;
  --cmp-gold-bright: #f2cf74;
  --cmp-gold-soft: rgba(229, 188, 84, 0.13);
  --cmp-red: #f87171;
  --cmp-red-soft: rgba(248, 113, 113, 0.12);
  --cmp-green: #4ade80;
  --cmp-green-soft: rgba(74, 222, 128, 0.12);
  --cmp-code-bg: #0b0a08;
  --cmp-code-fg: #f4f0e6;
  --cmp-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  --cmp-shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* 1. Ultra-Clean Single-Row Command Bar (~52px) */
.b31-cmp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 14px;
  padding: 8px 14px;
  margin-bottom: 10px;
  box-shadow: var(--cmp-shadow);
}
.b31-cmp-topbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.b31-cmp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.b31-cmp-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.b31-cmp-badge-50 {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--cmp-red-soft);
  color: var(--cmp-red);
  white-space: nowrap;
}
.b31-cmp-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.b31-cmp-saved-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cmp-green);
  background: var(--cmp-green-soft);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Segmented Mode Tabs */
.b31-cmp-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--cmp-card-alt);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--cmp-border);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.b31-cmp-tabs::-webkit-scrollbar { display: none; }
.b31-cmp-tab {
  border: none;
  background: transparent;
  color: var(--cmp-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.b31-cmp-tab:hover { color: var(--cmp-text); }
.b31-cmp-tab.is-active {
  background: var(--cmp-card);
  color: var(--cmp-text);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Compact Buttons */
.b31-cmp-vip-btn {
  border: 1px solid var(--cmp-border-gold);
  background: linear-gradient(135deg, #cfa034, #a87b16);
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.b31-cmp-vip-btn:hover { opacity: 0.92; }

.b31-cmp-icon-btn {
  border: 1px solid var(--cmp-border);
  background: transparent;
  color: var(--cmp-muted);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.b31-cmp-icon-btn:hover,
.b31-cmp-icon-btn.is-on {
  border-color: var(--cmp-border-gold);
  background: var(--cmp-gold-soft);
  color: var(--cmp-gold);
}

.b31-cmp-preset-btn {
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card);
  color: var(--cmp-text);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.b31-cmp-preset-btn:hover,
.b31-cmp-preset-btn.is-on {
  border-color: var(--cmp-border-gold);
  background: var(--cmp-gold-soft);
  color: var(--cmp-gold);
}

/* 2. Arena Collapsible Lineup Bar (~42px) */
.b31-cmp-lineup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  padding: 6px 12px;
  margin-bottom: 10px;
}
.b31-cmp-lineup-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 1 1 auto;
}
.b31-cmp-lineup-chips::-webkit-scrollbar { display: none; }
.b31-cmp-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--cmp-card-alt);
  border: 1px solid var(--cmp-border);
  font-size: 12.2px;
  font-weight: 600;
  color: var(--cmp-text);
  white-space: nowrap;
  flex-shrink: 0;
}
.b31-cmp-active-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cmp-gold-bright);
  display: inline-block;
}
.b31-cmp-active-chip small {
  color: var(--cmp-muted);
  font-weight: 500;
  font-size: 11px;
}
.b31-cmp-active-chip button {
  border: none;
  background: none;
  color: var(--cmp-muted);
  cursor: pointer;
  padding: 0 0 0 2px;
  font-size: 12px;
  line-height: 1;
}
.b31-cmp-active-chip button:hover { color: var(--cmp-red); }
.b31-cmp-lineup-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.b31-cmp-quick-presets {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Expandable Clean Model Picker Drawer */
.b31-cmp-picker-wrap {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border-gold);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--cmp-shadow-lg);
}
.b31-cmp-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12.2px;
  color: var(--cmp-muted);
}
.b31-cmp-search {
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-text);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  outline: none;
  width: 240px;
  max-width: 100%;
}
.b31-cmp-search:focus { border-color: var(--cmp-gold); }
.b31-cmp-presets-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 10px;
}
.b31-cmp-presets-bar::-webkit-scrollbar { display: none; }
.b31-cmp-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 7px;
  max-height: 248px;
  overflow-y: auto;
  padding-right: 2px;
}
.b31-cmp-model-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.b31-cmp-model-chip:hover { border-color: var(--cmp-border-gold); }
.b31-cmp-model-chip.is-selected {
  border: 1.5px solid var(--cmp-gold);
  background: var(--cmp-gold-soft);
}
.b31-cmp-chip-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.b31-cmp-chip-name {
  font-size: 12.8px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.b31-cmp-check-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--cmp-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  color: transparent;
}
.b31-cmp-model-chip.is-selected .b31-cmp-check-dot {
  background: var(--cmp-gold);
  border-color: var(--cmp-gold);
  color: #fff;
}
.b31-cmp-chip-elo {
  font-size: 11px;
  font-weight: 700;
  color: var(--cmp-gold);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.b31-cmp-chip-price {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.3px;
  color: var(--cmp-muted);
}
.b31-cmp-anchor-strike { text-decoration: line-through; color: var(--cmp-muted); opacity: 0.72; }
.b31-cmp-sale-price { font-weight: 700; color: var(--cmp-red); font-variant-numeric: tabular-nums; }
.b31-cmp-half-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--cmp-red-soft);
  color: var(--cmp-red);
}

/* Slim Notice Bars (Blind Info / Guest / DeepLink / Toast) */
.b31-cmp-blind-note,
.b31-cmp-guest-bar,
.b31-cmp-deeplink-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-radius: 11px;
  padding: 7px 12px;
  margin-bottom: 10px;
  font-size: 12.3px;
}
.b31-cmp-blind-note {
  background: var(--cmp-card-alt);
  border: 1px solid var(--cmp-border);
  color: var(--cmp-muted);
}
.b31-cmp-guest-bar {
  background: var(--cmp-gold-soft);
  border: 1px solid var(--cmp-border-gold);
}
.b31-cmp-deeplink-bar {
  background: var(--cmp-card);
  border: 1px dashed var(--cmp-border-gold);
}
.b31-cmp-toast {
  background: #1b1812;
  color: #f4d378;
  border: 1px solid var(--cmp-border-gold);
  border-radius: 10px;
  padding: 8px 13px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
}

/* 3. Sleek Floating Arena Composer */
.b31-cmp-composer {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 16px;
  padding: 10px 14px 10px;
  box-shadow: var(--cmp-shadow);
  margin-bottom: 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.b31-cmp-composer:focus-within {
  border-color: var(--cmp-border-gold);
  box-shadow: 0 0 0 3px var(--cmp-gold-soft), var(--cmp-shadow);
}
.b31-cmp-starters {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 2px;
}
.b31-cmp-starters::-webkit-scrollbar { display: none; }
.b31-cmp-starter {
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-muted);
  font-size: 11.8px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.b31-cmp-starter:hover { border-color: var(--cmp-border-gold); color: var(--cmp-text); }
.b31-cmp-img-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  margin-bottom: 6px;
  border-radius: 9px;
  background: var(--cmp-card-alt);
  border: 1px solid var(--cmp-border);
  font-size: 12px;
}
.b31-cmp-img-preview img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.b31-cmp-textarea {
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  resize: none;
  min-height: 48px;
  max-height: 180px;
  background: transparent;
  color: var(--cmp-text);
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
}
.b31-cmp-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--cmp-border);
}
.b31-cmp-composer-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.b31-cmp-composer-hint {
  font-size: 11.8px;
  color: var(--cmp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b31-cmp-composer-btns { display: flex; align-items: center; gap: 7px; }

.b31-cmp-btn-primary {
  border: none;
  background: linear-gradient(135deg, #cfa034, #a57714);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(166, 123, 27, 0.24);
  transition: transform 0.12s ease, opacity 0.14s ease;
}
.b31-cmp-btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.b31-cmp-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.b31-cmp-btn-ghost {
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-text);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.b31-cmp-btn-ghost:hover { border-color: var(--cmp-border-gold); color: var(--cmp-gold); }

/* 4. Side-by-Side Arena Stage Grid (Visible Immediately Above the Fold!) */
.b31-cmp-arena-grid { display: grid; gap: 11px; margin-bottom: 12px; }
.b31-cmp-arena-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.b31-cmp-arena-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.b31-cmp-arena-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.b31-cmp-arena-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1380px) {
  .b31-cmp-arena-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .b31-cmp-arena-grid.cols-2,
  .b31-cmp-arena-grid.cols-3,
  .b31-cmp-arena-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
}

.b31-cmp-col {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 204px;
  max-height: 680px;
  box-shadow: var(--cmp-shadow);
  overflow: hidden;
}
.b31-cmp-col.has-content { min-height: 300px; }
.b31-cmp-col.is-winner {
  border: 1.5px solid var(--cmp-gold-bright);
  box-shadow: 0 0 0 3px var(--cmp-gold-soft), var(--cmp-shadow);
}
.b31-cmp-col-head {
  padding: 9px 13px;
  background: var(--cmp-card-alt);
  border-bottom: 1px solid var(--cmp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.b31-cmp-col-title {
  font-size: 13.4px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b31-cmp-col-vendor {
  font-size: 11px;
  font-weight: 500;
  color: var(--cmp-muted);
}
.b31-cmp-col-status { font-size: 11px; color: var(--cmp-muted); white-space: nowrap; flex-shrink: 0; }
.b31-cmp-col-body {
  flex: 1 1 auto;
  padding: 13px 15px;
  overflow-y: auto;
  font-size: 13.8px;
  line-height: 1.66;
  word-break: break-word;
}
.b31-cmp-empty-state {
  height: 100%;
  min-height: 105px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  color: var(--cmp-muted);
  font-size: 12.5px;
}
.b31-cmp-empty-state strong { color: var(--cmp-text); font-size: 13px; font-weight: 600; }

.b31-cmp-turn-user {
  background: var(--cmp-gold-soft);
  border-left: 2.5px solid var(--cmp-gold);
  padding: 7px 11px;
  border-radius: 7px;
  margin: 10px 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.b31-cmp-turn-user:first-child { margin-top: 0; }
.b31-cmp-turn-sep { border: 0; border-top: 1px dashed var(--cmp-border); margin: 11px 0; }
.b31-cmp-col-body h1, .b31-cmp-col-body h2, .b31-cmp-col-body h3 { margin: 10px 0 6px; line-height: 1.35; }
.b31-cmp-col-body p { margin: 0 0 9px; }
.b31-cmp-col-body ul, .b31-cmp-col-body ol { margin: 0 0 9px; padding-left: 20px; }

.b31-cmp-code-wrap {
  margin: 9px 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cmp-code-bg);
  color: var(--cmp-code-fg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.b31-cmp-code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 11.2px;
  background: rgba(255, 255, 255, 0.05);
  color: #b8b3a8;
}
.b31-cmp-code-copy {
  border: none;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.b31-cmp-code-copy.is-run { background: linear-gradient(135deg, #cfa034, #a57714); color: #fff; font-weight: 700; }
.b31-cmp-code-btns { display: inline-flex; align-items: center; gap: 6px; }
.b31-cmp-code-wrap pre {
  margin: 0;
  padding: 11px 13px;
  overflow-x: auto;
  font-size: 12.3px;
  line-height: 1.55;
  font-family: "JetBrains Mono", Consolas, ui-monospace, monospace;
}

.b31-cmp-col-foot {
  padding: 7px 12px;
  border-top: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.2px;
  color: var(--cmp-muted);
}
.b31-cmp-col-acts { display: flex; align-items: center; gap: 5px; }

.b31-cmp-paywall-card {
  border: 1px solid var(--cmp-border-gold);
  background: var(--cmp-gold-soft);
  border-radius: 11px;
  padding: 13px;
  text-align: center;
  margin: 8px 0;
}

/* 5. Modern 2-Column Luxury Cinema Video & HD Image Studio */
.b31-studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .b31-studio-shell { grid-template-columns: minmax(0, 1fr); }
}
.b31-studio-panel {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--cmp-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.b31-studio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.b31-studio-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.015em; }
.b31-studio-sub { font-size: 12.5px; color: var(--cmp-muted); margin-top: 3px; }
.b31-studio-seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--cmp-card-alt);
  border: 1px solid var(--cmp-border);
}
.b31-studio-seg button {
  border: none;
  background: transparent;
  color: var(--cmp-muted);
  font-size: 12.2px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.b31-studio-seg button.is-on {
  background: var(--cmp-card);
  color: var(--cmp-text);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.b31-studio-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-text);
  font-size: 13.8px;
  line-height: 1.55;
  resize: vertical;
  min-height: 108px;
  font-family: inherit;
  outline: none;
}
.b31-studio-textarea:focus { border-color: var(--cmp-gold); background: var(--cmp-card); }
.b31-studio-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}
.b31-studio-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.2px;
  color: var(--cmp-muted);
}
.b31-studio-field select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-text);
  font-size: 12.4px;
  outline: none;
}
.b31-studio-stage {
  background: #12110e;
  border: 1px solid var(--cmp-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 310px;
  color: #d6cfc2;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.b31-studio-stage-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}
.b31-studio-stage-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e5bc54;
  background: rgba(229, 188, 84, 0.14);
  border: 1px solid rgba(229, 188, 84, 0.28);
  padding: 3px 10px;
  border-radius: 999px;
}
.b31-studio-stage video,
.b31-studio-stage img {
  max-width: 100%;
  max-height: 440px;
  border-radius: 10px;
  display: block;
}

/* 6. Blind Vote, Arbiter Synthesis, History & Leaderboard */
.b31-cmp-vote-panel,
.b31-cmp-synth-box,
.b31-cmp-history-box,
.b31-cmp-matrix-box {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border-gold);
  border-radius: 14px;
  padding: 13px 16px;
  margin-bottom: 12px;
  box-shadow: var(--cmp-shadow);
}
.b31-cmp-vote-panel { text-align: center; }
.b31-cmp-vote-title { font-size: 13.5px; font-weight: 700; margin-bottom: 9px; }
.b31-cmp-vote-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.b31-cmp-vote-btn {
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-text);
  font-weight: 600;
  font-size: 12.8px;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
}
.b31-cmp-vote-btn:hover { border-color: var(--cmp-gold); background: var(--cmp-gold-soft); }
.b31-cmp-synth-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.b31-cmp-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
}
.b31-cmp-hist-item {
  text-align: left;
  border: 1px solid var(--cmp-border);
  background: var(--cmp-card-alt);
  color: var(--cmp-text);
  border-radius: 9px;
  padding: 8px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.b31-cmp-hist-item:hover { border-color: var(--cmp-border-gold); }
.b31-cmp-hist-top { display: flex; justify-content: space-between; gap: 6px; font-size: 11.4px; color: var(--cmp-gold); }
.b31-cmp-hist-top span { color: var(--cmp-muted); font-size: 10.5px; flex-shrink: 0; }
.b31-cmp-hist-q { font-size: 12px; color: var(--cmp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.b31-cmp-board-card {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: var(--cmp-shadow);
}
.b31-cmp-table { width: 100%; border-collapse: collapse; font-size: 12.6px; }
.b31-cmp-table th, .b31-cmp-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--cmp-border); }
.b31-cmp-table th { background: var(--cmp-card-alt); font-weight: 700; color: var(--cmp-muted); white-space: nowrap; }
.b31-cmp-winbar { display: inline-block; width: 52px; height: 5px; border-radius: 99px; background: rgba(128,128,128,0.18); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.b31-cmp-winbar > i { display: block; height: 100%; background: var(--cmp-gold-bright); }
.b31-cmp-rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; border-radius: 6px; font-weight: 700; font-size: 11.5px;
  background: var(--cmp-card-alt);
}
.b31-cmp-rank-badge.r-1 { background: linear-gradient(135deg, #f0cb63, #b8881a); color: #1a1405; }
.b31-cmp-rank-badge.r-2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #0f172a; }
.b31-cmp-rank-badge.r-3 { background: linear-gradient(135deg, #e29d52, #a85b18); color: #fff; }

/* 7. Clean Harmonized 50% OFF API Tab */
.b31-cmp-api-grid { display: flex; flex-direction: column; gap: 12px; }
.b31-cmp-api-card {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--cmp-shadow);
}
.b31-cmp-api-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.b31-cmp-roi-box {
  background: var(--cmp-card-alt);
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  padding: 12px 15px;
}
.b31-cmp-roi-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.8px; font-weight: 600; margin-bottom: 6px; }
.b31-cmp-roi-slider { width: 100%; accent-color: #c89b2d; cursor: pointer; margin: 4px 0 10px; }
.b31-cmp-roi-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.b31-cmp-roi-stat {
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: var(--cmp-muted);
}
.b31-cmp-pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.b31-cmp-pack-card {
  background: var(--cmp-card-alt);
  border: 1px solid var(--cmp-border);
  border-radius: 12px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  color: var(--cmp-text);
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.b31-cmp-pack-card:hover { transform: translateY(-1px); border-color: var(--cmp-border-gold); }
.b31-cmp-pack-card.is-hot {
  border: 1.5px solid var(--cmp-gold);
  background: var(--cmp-gold-soft);
}
.b31-cmp-pack-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.8px;
  font-weight: 700;
  background: var(--cmp-card);
  color: var(--cmp-gold);
  border: 1px solid var(--cmp-border-gold);
}
.b31-cmp-pack-card.is-hot .b31-cmp-pack-tag {
  background: linear-gradient(135deg, #cfa034, #a57714);
  color: #fff;
  border-color: transparent;
}
.b31-cmp-pack-price { font-size: 20px; font-weight: 800; color: var(--cmp-text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.b31-cmp-pack-price small { font-size: 11.8px; font-weight: 600; color: var(--cmp-green); margin-left: 5px; }

.b31-cmp-api-langbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.b31-cmp-api-langpills {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}
.b31-cmp-api-langpills::-webkit-scrollbar { display: none; }

.b31-cmp-api-ping {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--cmp-card-alt);
  border: 1px solid var(--cmp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.2px;
}
.b31-cmp-api-ping.is-ok { border-color: rgba(21, 128, 61, 0.4); background: var(--cmp-green-soft); }

/* Modals, WebDev Preview & Creator Sidebar Integration */
.b31-cmp-focus-backdrop {
  position: fixed; inset: 0; z-index: 9999; background: rgba(10, 9, 7, 0.72);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px;
}
.b31-cmp-focus-modal {
  width: min(1040px, 96vw); max-height: 90vh; background: var(--cmp-card);
  border: 1px solid var(--cmp-border-gold); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.b31-cmp-focus-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 22px; font-size: 14.3px; line-height: 1.72; word-break: break-word; }
.b31-cmp-webdev-frame { width: 100%; height: 340px; border: 0; display: block; background: #fff; }
.b31-cmp-webdev-modal-frame { width: 100%; height: 74vh; border: 0; display: block; background: #fff; }
.b31-cmp-winner-bar {
  padding: 7px 12px; border-top: 1px solid var(--cmp-border-gold); background: var(--cmp-gold-soft);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 11.6px;
}
.b31-cmp-badge-win {
  display: inline-block; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700;
  background: var(--cmp-green-soft); color: var(--cmp-green); margin-left: 4px;
}
.mode-tab.is-compare-tab.on {
  background: linear-gradient(135deg, #cfa034, #a57714) !important; color: #fff !important;
}
.sb-menu-item.is-compare {
  border: 1px solid rgba(207, 160, 52, 0.3); background: rgba(207, 160, 52, 0.06); font-weight: 600;
}

/* Mobile 390px Ultra-Clean Zero-Overflow */
@media (max-width: 720px) {
  .compare-host-pane { padding: 8px 10px 26px; }
  .b31-cmp-root { max-width: 100%; overflow-x: clip; }
  .b31-cmp-topbar { padding: 8px 10px; gap: 8px; border-radius: 12px; }
  .b31-cmp-topbar-left { width: 100%; justify-content: space-between; gap: 6px; }
  .b31-cmp-topbar-right { width: 100%; justify-content: flex-end; }
  .b31-cmp-tabs { width: 100%; }
  .b31-cmp-tab { padding: 5px 9px; font-size: 12px; }
  .b31-cmp-quick-presets { display: none; }
  .b31-cmp-lineup-bar { padding: 6px 9px; }
  .b31-cmp-search { width: 100%; }
  .b31-cmp-chips-grid { grid-template-columns: minmax(0, 1fr); max-height: 220px; }
  .b31-cmp-composer { padding: 9px 11px; border-radius: 14px; }
  .b31-cmp-composer-hint { display: none; }
  .b31-cmp-col { min-height: 150px; }
  .b31-cmp-roi-stats, .b31-cmp-pack-grid { grid-template-columns: minmax(0, 1fr); }
  .b31-studio-panel { padding: 14px; }
  .b31-studio-stage { min-height: 210px; padding: 14px; }
  .b31-cmp-table th, .b31-cmp-table td { padding: 8px 7px; font-size: 11.8px; }
}

/* v119: Zero-Flash Creator Boot + Unclipped 4-Chip 1280px Lineup + 3x2 Symmetric Mobile Tabs */
html.boot-compare-mode #welcome,
html.boot-compare-mode #messages,
html.boot-compare-mode .composer-wrap { display: none !important; }
html.boot-compare-mode #compareArenaHost { display: block !important; }
@media (max-width: 1420px) {
  .b31-cmp-quick-presets { display: none !important; }
  .b31-cmp-active-chip small { display: none !important; }
}
@media (max-width: 600px) {
  .b31-cmp-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
    overflow: visible !important;
  }
  .b31-cmp-tab {
    text-align: center !important;
    justify-content: center !important;
    padding: 6px 4px !important;
    font-size: 11.6px !important;
  }
}

/* v121: Jony Ive Zen-Luxury Centered Arena Stage (Zero Box Soup before Turn 1) + Audio Player Stage */
.b31-cmp-topbar.is-slim {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 2px 0 6px;
  margin-bottom: 6px;
}
.b31-zen-stage {
  max-width: 840px;
  margin: 26px auto 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.b31-zen-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.b31-zen-title {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--cmp-text);
}
.b31-zen-sub {
  margin: 0;
  font-size: 13.2px;
  color: var(--cmp-muted);
  line-height: 1.45;
}
.b31-zen-lineup {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}
.b31-zen-composer {
  width: 100%;
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-shadow: 0 8px 30px rgba(24, 22, 18, 0.06);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
html.dark .b31-zen-composer,
html[data-theme="night"] .b31-zen-composer {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
}
.b31-zen-composer:focus-within {
  border-color: var(--cmp-border-gold);
  box-shadow: 0 0 0 3px var(--cmp-gold-soft), 0 10px 32px rgba(24, 22, 18, 0.08);
}
.b31-zen-composer .b31-cmp-textarea {
  min-height: 68px;
  font-size: 14.8px;
}
.b31-zen-prompts {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.b31-zen-prompt-card {
  text-align: left;
  background: var(--cmp-card);
  border: 1px solid var(--cmp-border);
  border-radius: 13px;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.b31-zen-prompt-card:hover {
  border-color: var(--cmp-border-gold);
  transform: translateY(-1px);
  box-shadow: var(--cmp-shadow);
}
.b31-zen-prompt-card b { font-size: 13px; font-weight: 700; color: var(--cmp-text); }
.b31-zen-prompt-card span { font-size: 11.8px; color: var(--cmp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b31-zen-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}
.b31-zen-dock-btn {
  border: 1px solid var(--cmp-border);
  background: transparent;
  color: var(--cmp-muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}
.b31-zen-dock-btn:hover { border-color: var(--cmp-border-gold); background: var(--cmp-gold-soft); color: var(--cmp-gold); }
.b31-studio-audio-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(229, 188, 84, 0.25);
}
.b31-studio-audio-wrap audio { width: 100%; border-radius: 999px; }
@media (max-width: 680px) {
  .b31-zen-stage { margin: 10px auto 8px; gap: 11px; }
  .b31-zen-title { font-size: 20px; }
  .b31-zen-prompts { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .b31-zen-composer { padding: 11px 12px 10px; border-radius: 14px; }
  .b31-zen-composer .b31-cmp-textarea { min-height: 54px; font-size: 14px; }
}

@media (max-width: 680px) { .b31-studio-panel .b31-cmp-starters { flex-wrap: wrap !important; overflow: visible !important; } }
