/* =============================================================
   WaxFrame v2 — style.css
   Build: 20260415-001
   Author: WeirDave (R David Paine III) | License: AGPL-3.0
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ══════════════════════════════════════
   RESET & BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ══════════════════════════════════════
   THEME VARIABLES
══════════════════════════════════════ */
/* Dark (default) */
:root {
  --bg:           #0a0c12;
  --surface:      #111318;
  --surface2:     #181b24;
  --surface3:     #1e2130;
  --border:       #252838;
  --border2:      #2e3348;
  --text:         #e8ecf4;
  --text-dim:     #9aa3b8;
  --muted:        #4a5270;
  --accent:       #f5a623;
  --accent-dim:   rgba(245,166,35,0.10);
  --accent-hover: #f7b84a;
  --blue:         #4d8aff;
  --blue-dim:     rgba(77,138,255,0.10);
  --purple:       #a78bfa;
  --purple-dim:   rgba(167,139,250,0.10);
  --green:        #00b300;
  --green-dim:    rgba(0,179,0,0.10);
  --red:          #f87171;
  --red-dim:      rgba(248,113,113,0.10);
  --amber:        #fbbf24;
  --line-stripe:  rgba(255,255,255,0.04);
  --font:         'DM Sans', system-ui, sans-serif;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-mono:    'Courier New', Courier, monospace;
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:    0 16px 64px rgba(0,0,0,0.6);
  --glow:         0 0 24px rgba(245,166,35,0.15);
}

/* Light theme */
[data-theme="light"] {
  --bg:           #f2f4f8;
  --surface:      #ffffff;
  --surface2:     #f0f2f8;
  --surface3:     #e4e7f4;
  --border:       #d0d4e8;
  --border2:      #b8bdd8;
  --text:         #0f1221;
  --text-dim:     #384060;
  --muted:        #555d80;
  --accent:       #c97c06;
  --accent-dim:   rgba(201,124,6,0.12);
  --accent-hover: #d98a10;
  --blue:         #2563eb;
  --blue-dim:     rgba(37,99,235,0.12);
  --purple:       #7c3aed;
  --purple-dim:   rgba(124,58,237,0.10);
  --green:        #059669;
  --green-dim:    rgba(5,150,105,0.12);
  --red:          #b91c1c;
  --red-dim:      rgba(185,28,28,0.10);
  --amber:        #b45309;
  --line-stripe:  rgba(0,0,0,0.04);
  --shadow-sm:    0 2px 12px rgba(0,0,0,0.14);
  --shadow-md:    0 8px 32px rgba(0,0,0,0.18);
  --shadow-lg:    0 16px 64px rgba(0,0,0,0.22);
  --glow:         0 0 24px rgba(201,124,6,0.15);
}

/* Auto theme (follows OS) */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg:           #f2f4f8;
    --surface:      #ffffff;
    --surface2:     #f0f2f8;
    --surface3:     #e4e7f4;
    --border:       #d0d4e8;
    --border2:      #b8bdd8;
    --text:         #0f1221;
    --text-dim:     #384060;
    --muted:        #7880a0;
    --accent:       #c97c06;
    --accent-dim:   rgba(201,124,6,0.12);
    --accent-hover: #d98a10;
    --blue:         #1d4ed8;
    --blue-dim:     rgba(29,78,216,0.10);
    --purple:       #7c3aed;
    --purple-dim:   rgba(124,58,237,0.10);
    --green:        #059669;
    --green-dim:    rgba(5,150,105,0.12);
    --red:          #b91c1c;
    --red-dim:      rgba(185,28,28,0.10);
    --amber:        #b45309;
    --line-stripe:  rgba(0,0,0,0.04);
    --shadow-sm:    0 2px 12px rgba(0,0,0,0.14);
    --shadow-md:    0 8px 32px rgba(0,0,0,0.18);
    --shadow-lg:    0 16px 64px rgba(0,0,0,0.22);
    --glow:         0 0 24px rgba(201,124,6,0.15);
  }
}

/* ── BASE ── */
html, body {
  height: 100%;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    url('images/WaxFrame_Honeycomb_BG_Dark.png');
  background-size: auto, 300px auto;
  background-repeat: repeat, repeat;
}
[data-theme="light"] body {
  background-image:
    linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.25)),
    url('images/WaxFrame_Honeycomb_BG_Light.png');
  background-size: auto, 300px auto;
  background-repeat: repeat, repeat;
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] body {
    background-image:
      linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.25)),
      url('images/WaxFrame_Honeycomb_BG_Light.png');
    background-size: auto, 300px auto;
    background-repeat: repeat, repeat;
  }
}

::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── SCREENS ── */
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.screen.active {
  display: flex;
  opacity: 1;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  padding: 7px 14px;
  transition: all 0.12s;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* Ghost — visible over honeycomb */
.btn-ghost {
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.4);
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover {
  border-color: var(--accent);
  border-style: solid;
  color: var(--accent);
  background: rgba(0,0,0,0.5);
}

/* Accent (filled) — always readable */
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0c12;
  font-weight: 700;
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245,166,35,0.35);
  color: #0a0c12;
}
/* Light/auto: darken on hover so text stays readable */
[data-theme="light"] .btn-accent:hover { background: #a06000; border-color: #a06000; color: #fff; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .btn-accent:hover { background: #a06000; border-color: #a06000; color: #fff; }
}

.btn-sm { font-size: 12px; padding: 5px 11px; }
.btn-lg { font-size: 15px; padding: 12px 28px; border-radius: var(--radius-md); }
.btn-cta { min-width: 320px; justify-content: center; }

/* ── THEME TOGGLE ── */
.theme-opt {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  transition: all 0.12s;
  white-space: nowrap;
}
.theme-opt.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0c12;
  font-weight: 700;
  cursor: default;
}
.theme-opt:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}
/* Mute button — sits left of theme toggles, separated by a small gap */
.mute-btn { margin-right: 4px; }
.mute-btn.is-muted {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ══════════════════════════════════════
   SCREEN 1 — WELCOME
══════════════════════════════════════ */

.screen#screen-welcome {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.welcome-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
}

.welcome-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  align-items: center;
}

.welcome-logo {
  display: flex;
  align-items: center;
  gap: 18px;
}
.welcome-logo-anim {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  overflow: visible;
}
.welcome-logo-static {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
}
.welcome-bee-fly {
  position: absolute;
  width: 78px;
  height: 78px;
  object-fit: contain;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}
.screen#screen-welcome.active .welcome-bee-fly {
  animation: beeExit 7s ease-in-out infinite;
}
@keyframes beeExit {
  /* Start hidden in the hive */
  0%   { transform: translate(-50%, -50%) scale(0) scaleX(1);     opacity: 0; }
  /* Pop out of hive */
  8%   { transform: translate(-50%, -50%) scale(1) scaleX(1);     opacity: 1; }
  /* Fly straight right to end of title */
  38%  { transform: translate(370px, -50%) scale(1) scaleX(1);    opacity: 1; }
  /* Pause at the end — holds for ~2s */
  40%  { transform: translate(380px, -50%) scale(1) scaleX(1);    opacity: 1; }
  60%  { transform: translate(380px, -50%) scale(1) scaleX(1);    opacity: 1; }
  /* Flip to face left */
  63%  { transform: translate(380px, -50%) scale(1) scaleX(-1);   opacity: 1; }
  /* Rocket up-left at 45 degrees off the top of the screen */
  85%  { transform: translate(100px, -600px) scale(1) scaleX(-1); opacity: 0; }
  /* Reset hidden for next loop */
  100% { transform: translate(-50%, -50%) scale(0) scaleX(1);     opacity: 0; }
}
.welcome-version {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

.welcome-brand h1 {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.welcome-brand p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.welcome-pitch {
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.7;
  max-width: 500px;
}
.welcome-pitch strong { color: var(--text); }

.welcome-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.welcome-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border2);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.12s;
}
.welcome-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.welcome-card.free {
  background: rgba(59, 130, 246, 0.07);
  border-color: rgba(59, 130, 246, 0.35);
}
.welcome-card.free:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.65);
  color: #7ab8ff;
}
.welcome-card.pro {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.35);
}
.welcome-card.pro:hover {
  background: rgba(245, 158, 11, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}

.welcome-card-icon {
  font-size: 28px;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}
.welcome-card-body { flex: 1; }
.welcome-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}
.welcome-card-arrow {
  font-size: 18px;
  color: var(--text-dim);
}

.badge-api {
  background: var(--accent);
  color: #0a0c12;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  font-family: var(--font);
}

.welcome-info-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.welcome-info-btn:hover { opacity: 1; }

.welcome-info-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 6px;
}
.welcome-info-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.welcome-info-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  line-height: 1.4;
}
.welcome-info-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text2);
}
.welcome-info-body strong {
  color: var(--text);
  font-size: 13px;
}
.welcome-info-note {
  font-size: 12px;
  color: var(--text2);
  opacity: 0.8;
}

.welcome-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

/* ══════════════════════════════════════
   SCREENS 2 & 3 — SETUP LAYOUT
══════════════════════════════════════ */

.screen#screen-api-setup,
.screen#screen-project {
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 900px) {
  
  
  
}



/* ── AI Setup Grid ── */
.ai-setup-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-setup-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 12px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all 0.12s;
}
.ai-setup-row:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.ai-setup-row.checked {
  border-color: rgba(0,179,0,0.4);
  background: rgba(0,179,0,0.06);
}
.ai-setup-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ai-setup-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.ai-setup-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}
.ai-setup-key-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.ai-setup-key {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  transition: all 0.15s;
}
.ai-setup-key:focus { border-color: var(--accent); }
.ai-setup-key[type="text"] {
  background: var(--surface3);
  border-color: var(--accent);
}
.ai-setup-key:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ai-info-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  text-decoration: none;
  flex-shrink: 0;
}
.ai-info-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Builder Pick ── */
.builder-pick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.builder-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px 14px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
  position: relative;
  min-width: 100px;
  cursor: pointer;
}
.builder-pick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.builder-pick-btn.selected {
  border: 2px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}
.builder-pick-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.builder-pick-name {
  font-size: 13px;
  font-weight: 600;
}
.builder-selected-badge {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}



.custom-ai-form {
  margin-top: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.custom-ai-form input {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
}
.custom-ai-form input:focus { border-color: var(--accent); }
.field-lg, .field-sm, .field-goal, 
.field-sm { width: 180px; min-width: 0; }
.field-lg:focus, .field-sm:focus, .field-goal:focus, .field-doc:focus { border-color: var(--accent); }

/* ── Doc input tabs ── */
.doc-input-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.doc-tab {
  background: transparent !important;
  border: 1px solid var(--border2) !important;
  color: var(--text-dim) !important;
}
.doc-tab:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: transparent !important;
}
.doc-tab.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  border-style: solid !important;
  color: #0a0c12 !important;
  font-weight: 700 !important;
}

.doc-tab-panel { display: none; }
.doc-tab-panel.active { display: block; }

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--surface);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.drop-zone-icon { font-size: 36px; margin-bottom: 10px; }
.drop-zone-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.drop-zone-sub  { font-size: 12px; color: var(--text-dim); }

.file-status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.file-status--loading  { background: var(--blue-dim);   border-color: var(--blue);   color: var(--blue);   }
.file-status--success  { background: var(--green-dim);  border-color: var(--green);  color: var(--green);  }
.file-status--warn     { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.file-status--error    { background: var(--red-dim);    border-color: var(--red);    color: var(--red);    }
.file-status-line      { font-size: 11px; margin-top: 4px; opacity: 0.85; }
.quota-warn-btn        { margin: 4px 0 4px 90px; font-size: 11px; }
.file-clear-row        { margin-top: 6px; }

/* ══════════════════════════════════════
   SCREEN 4 — WORK SCREEN
══════════════════════════════════════ */
.screen#screen-work { overflow: hidden; }

/* TOP BAR */
.work-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #0a0c12;
  border-bottom: none;
  gap: 12px;
  flex-shrink: 0;
}
[data-theme="light"] .work-topbar { background: #ffffff; }
@media (prefers-color-scheme: light) { [data-theme="auto"] .work-topbar { background: #ffffff; } }
.work-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.work-topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.work-topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
}
.work-project-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.work-project-info:hover {
  background: var(--surface2);
}
.work-project-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-project-version {
  font-size: 11px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 20px;
  color: var(--accent);
  padding: 1px 8px;
  font-weight: 700;
  flex-shrink: 0;
}
.work-start-mode {
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text-dim);
  padding: 1px 8px;
  flex-shrink: 0;
}

/* Phase bar now in topbar — inline layout */
/* .work-phase-pill kept — used by history modal tabs */
.work-phase-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s;
}
.work-phase-pill:hover { border-color: var(--accent); color: var(--accent); }
.work-round-badge {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(145deg, #0a0c12, #151820);
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  padding: 5px 28px;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.14em;
  pointer-events: none;
  user-select: none;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.8),
    0 2px 8px rgba(0,0,0,0.5),
    0 0 14px rgba(245,166,35,0.18);
  text-shadow: 0 0 10px rgba(245,166,35,0.5);
}
[data-theme="light"] .work-round-badge {
  background: #ffffff;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(245,166,35,0.2);
  text-shadow: none;
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .work-round-badge {
    background: #ffffff;
    border: 2px solid var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(245,166,35,0.2);
    text-shadow: none;
  }
}

/* ══════════════════════════════════════
   WORK SCREEN — HAMBURGER NAV
══════════════════════════════════════ */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
}
.nav-hamburger:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.nav-hamburger span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: background 0.15s;
}
.nav-hamburger:hover span {
  background: var(--accent);
}
.welcome-hamburger {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
}
.welcome-menu-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 12px 4px 6px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  transition: border-color 0.15s, background 0.15s;
}
.welcome-menu-btn:hover {
  border-color: var(--accent);
  background: var(--bg2);
}
.welcome-menu-btn .nav-hamburger {
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  pointer-events: none;
  flex-shrink: 0;
}
.welcome-menu-btn:hover .nav-hamburger {
  border: none;
  background: transparent;
}
.welcome-menu-btn:hover .nav-hamburger span {
  background: var(--accent);
}
.welcome-menu-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  transition: color 0.15s;
}
.welcome-menu-btn:hover .welcome-menu-label {
  color: var(--accent);
}
.welcome-menu-hint {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 16px 0;
  opacity: 0.8;
}

/* Backdrop */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.nav-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
[data-theme="light"] .nav-backdrop { background: rgba(0,0,0,0.25); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .nav-backdrop { background: rgba(0,0,0,0.25); }
}

/* Panel */
.nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #0d1017;
  border-right: 1px solid var(--border2);
  z-index: 901;
  display: flex;
  flex-direction: column;
  padding: 0 0 24px;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  overflow: hidden;
}
.nav-panel.open {
  transform: translateX(0);
}
[data-theme="light"] .nav-panel {
  background: #ffffff;
  border-right-color: #e5e7eb;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .nav-panel {
    background: #ffffff;
    border-right-color: #e5e7eb;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
}

/* Panel header */
.nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
}
[data-theme="light"] .nav-panel-header { border-bottom-color: #e5e7eb; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .nav-panel-header { border-bottom-color: #e5e7eb; }
}
.nav-panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-panel-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.nav-panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-close-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-close-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}

/* Section labels */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 16px 16px 6px;
}

/* Nav body — scrollable item list below the fixed header */
.nav-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  padding-bottom: 16px;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}
[data-theme="light"] .nav-item { color: #374151; }
[data-theme="light"] .nav-item:hover { background: rgba(245,166,35,0.08); color: var(--accent); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .nav-item { color: #374151; }
  [data-theme="auto"] .nav-item:hover { background: rgba(245,166,35,0.08); color: var(--accent); }
}

/* Divider */
.nav-divider {
  height: 1px;
  background: var(--border2);
  margin: 8px 16px;
}
[data-theme="light"] .nav-divider { background: #e5e7eb; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .nav-divider { background: #e5e7eb; }
}

/* ══════════════════════════════════════
   WORK SCREEN — 3-COLUMN + FOOTER LAYOUT
══════════════════════════════════════ */
.work-layout {
  display: grid;
  grid-template-rows: 52px 1fr 64px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* MAIN AREA — 5-column grid, body bg shows through.
   Left and right panels are symmetrical (equal min/max). Doc panel is the fixed star (80ch).
   Gap columns absorb surplus at ultra-wide only after panels reach max. */
.work-main {
  display: grid;
  grid-template-columns: minmax(320px, 640px) minmax(0, 0.5fr) auto minmax(0, 0.5fr) minmax(320px, 640px);
  overflow: hidden;
  min-height: 0;
  background: transparent;
}

/* Gap columns — transparent, body honeycomb shows through */
.work-gap {
  min-width: 0;
  background: transparent;
}

/* Floating card header — used over honeycomb background */
.honeycomb-header {
  margin: 6px 8px 4px !important;
  background: rgba(0,0,0,0.55) !important;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 8px 12px !important;
}
.honeycomb-header .work-section-title { color: #ffffff !important; }
[data-theme="light"] .honeycomb-header .work-section-title { color: #ffffff !important; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .honeycomb-header .work-section-title { color: #ffffff !important; }
}

/* ══ LEFT PANEL — transparent, body bg shows through ══ */
.work-left-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  max-width: 640px;
  background: transparent;
}
.left-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 6px 8px 2px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.left-panel-section-border {
  margin-top: 8px;
}

/* Custom AI slots */
/* ── BEE CARDS — horizontal two-zone layout (big screen) ── */
.hex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 6px 10px 4px;
  flex-shrink: 0;
}

.hex-cell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
  min-height: 44px;
  background: var(--surface2);
  cursor: default;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

/* Left status strip */
.hex-cell::before {
  content: '';
  display: block;
  width: 4px;
  flex-shrink: 0;
  background: var(--border2);
  transition: background 0.2s;
}

/* Body — icon + name + status */
.hex-cell-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  flex: 1;
  min-width: 0;
}

/* hex-icon-wrap: no-op on big screen — icon sits directly in body */
.hex-icon-wrap {
  display: contents;
}

.hex-cell.is-builder  { border-color: var(--accent); box-shadow: 0 0 8px rgba(245,166,35,0.25); }
.hex-cell.is-builder::before  { background: var(--accent); }
.hex-cell.is-active { border-color: var(--border2); }
.hex-cell.is-active::before { background: var(--border2); }
.hex-cell.is-working,
.hex-cell.is-sending {
  border-color: var(--blue);
  animation: cardPulse 1s ease-in-out infinite alternate;
}
.hex-cell.is-working::before,
.hex-cell.is-sending::before { background: var(--blue); }
.hex-cell.is-responding {
  border-color: var(--purple);
  animation: cardPulse 1s ease-in-out infinite alternate;
}
.hex-cell.is-responding::before { background: var(--purple); }
.hex-cell.is-done { border-color: #00b300; }
.hex-cell.is-done::before { background: #00b300; }
.hex-cell.is-error { border-color: #f87171; }
.hex-cell.is-error::before { background: #f87171; }
.hex-cell.is-inactive { opacity: 0.38; }
.hex-cell.is-inactive::before { background: transparent; }

@keyframes cardPulse {
  from { box-shadow: 0 0 4px rgba(96,165,250,0.3); }
  to   { box-shadow: 0 0 14px rgba(96,165,250,0.75); }
}

.hex-toggle {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.hex-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}
/* Icon initial avatar — shown when real icon fails or is missing */
.hex-icon-avatar {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}
.hex-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.hex-status {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hex-cell.is-working    .hex-status,
.hex-cell.is-sending    .hex-status { color: var(--blue); }
.hex-cell.is-responding .hex-status { color: var(--purple); }
.hex-cell.is-done       .hex-status { color: #00b300; }
.hex-cell.is-error      .hex-status { color: #f87171; }
.hex-cell.is-builder    .hex-status { color: var(--accent); }
.hex-builder-tag {
  font-size: 8px;
  font-weight: 800;
  color: #0a0c12;
  background: var(--accent);
  border-radius: 3px;
  padding: 1px 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* ── Edit Hive button — hidden on big screens ── */
.hive-edit-btn { display: none; }

/* ── Dot strip — hidden on big screens, shown at laptop ── */
.bee-dot-strip { display: none; }

/* ── Edit Hive modal ── */
.edit-hive-modal { max-width: 360px; width: 90vw; }
.edit-hive-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 20px;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.edit-hive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
}
.edit-hive-row.is-builder-row { border-color: rgba(245,166,35,0.4); }
.edit-hive-avatar {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
  object-fit: contain;
}
.edit-hive-avatar-letter {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  user-select: none;
}
.edit-hive-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.edit-hive-tag {
  font-size: 8px;
  font-weight: 800;
  color: #0a0c12;
  background: var(--accent);
  border-radius: 3px;
  padding: 2px 5px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.edit-hive-toggle {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── At laptop viewport: show dot strip + Edit Hive button, hide card grid ── */
@media (max-width: 1600px) {
  .hex-grid        { display: none; }
  .bee-dot-strip   {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 7px 10px 7px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.45);
    border-radius: 8px;
    margin: 2px 8px 4px;
  }
  [data-theme="light"] .bee-dot-strip,
  .bee-dot-strip-light { background: rgba(0,0,0,0.12); }
  .hive-edit-btn   { display: inline-flex; }

  /* Dot — one per AI, icon in a glowing circle */
  .bee-dot {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
  }
  .bee-dot img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; display: block; }
  .bee-dot .bee-dot-avatar {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
  }

  /* State colours for dots */
  .bee-dot.is-builder  {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(245,166,35,0.6);
  }
  .bee-dot.is-active   { border-color: var(--border2); }
  .bee-dot.is-inactive { border-color: transparent; opacity: 0.3; }
  .bee-dot.is-sending,
  .bee-dot.is-working  { border-color: var(--blue); animation: dotPulse 1s ease-in-out infinite alternate; }
  .bee-dot.is-responding { border-color: var(--purple); animation: dotPulse 1s ease-in-out infinite alternate; }
  .bee-dot.is-done     { border-color: #00b300; box-shadow: 0 0 6px rgba(0,179,0,0.5); }
  .bee-dot.is-error    { border-color: #f87171; }

  @keyframes dotPulse {
    from { box-shadow: 0 0 3px rgba(96,165,250,0.3); }
    to   { box-shadow: 0 0 10px rgba(96,165,250,0.85); }
  }
}

/* ══ CENTER PANEL — floats as card over honeycomb ══ */
/* ══════════════════════════════════════
   WORKING DOCUMENT PANEL — clean rewrite
══════════════════════════════════════ */

/* Outer card — floats over honeycomb */
.work-doc-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  width: calc(44px + 80ch + 8px + 12px + 32px);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  flex-shrink: 0;
  margin: 8px 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.work-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0,0,0,0.4);
  flex-shrink: 0;
  border-radius: 12px 12px 0 0;
}
[data-theme="light"] .work-panel-header { background: #ffffff; }
[data-theme="light"] .work-panel-header .work-section-title { color: var(--text); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .work-panel-header { background: #ffffff; }
  [data-theme="auto"] .work-panel-header .work-section-title { color: var(--text); }
}
/* ══ DOC EDITOR ══ */
/* ══ DOC EDITOR — single scroll container, notebook paper background ══ */
.work-doc-editor {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 0 0 12px 12px;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.work-doc-editor::-webkit-scrollbar { width: 8px; }
.work-doc-editor::-webkit-scrollbar-track { background: transparent; }
.work-doc-editor::-webkit-scrollbar-thumb { background: rgba(120,120,140,0.55); border-radius: 8px; }

/* Flex row containing gutter + textarea — grows to content height, paper background lives here */
.work-doc-scroll {
  display: flex;
  align-items: flex-start;
  min-height: 100%;
  /* Notebook paper — on the content layer so it scrolls with text */
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, transparent 44px, rgba(220,50,50,0.25) 44px, rgba(220,50,50,0.25) 46px, transparent 46px),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 20px,
      rgba(80,140,220,0.18) 20px,
      rgba(80,140,220,0.18) 21px
    );
  background-position: 0 0;
}

/* Gutter — sticky so it stays visible as paper scrolls */
.work-line-numbers {
  position: sticky;
  left: 0;
  top: 0;
  width: 44px;
  flex: 0 0 44px;
  align-self: stretch;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 21px;
  color: var(--muted);
  text-align: right;
  padding: 0 6px 0 0;
  user-select: none;
  background: transparent;
  border-right: 1px solid var(--border2);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: visible;
  z-index: 1;
}
.work-line-numbers::-webkit-scrollbar { display: none; }
.work-line-numbers div {
  height: 21px;
  line-height: 21px;
  box-sizing: border-box;
  flex-shrink: 0;
  padding-right: 6px;
}
.work-line-numbers div.line-highlight {
  color: var(--amber);
  font-weight: 700;
  animation: lineNumPulse 0.8s ease-in-out infinite;
}
@keyframes lineNumPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* Inner wrapper — no scroll, just sizes the textarea correctly */
.work-doc-inner {
  flex: 0 0 auto;
  position: relative;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  background: transparent;
  box-sizing: border-box;
  width: calc(80ch + 8px + 12px);
}

.work-doc-ta {
  position: relative;
  z-index: 1;
  display: block;
  /* EXACT text box: 80ch + only left/right text padding */
  width: calc(80ch + 8px + 12px);
  min-width: calc(80ch + 8px + 12px);
  max-width: calc(80ch + 8px + 12px);
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0 12px 0 8px;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
  background: transparent;
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 21px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  tab-size: 4;
}

.work-doc-rules { display: none; }
.work-doc-right-margin { display: none; }

/* ══ RIGHT PANEL — transparent, body bg shows through ══ */
.work-right-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border: none;
  max-width: 640px;
  background: transparent;
}

/* 3D Digital Clock */
.work-right-logo {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 14px;
  margin: 8px 8px 4px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.work-right-logo-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(245,166,35,0.5));
  flex-shrink: 0;
}
.work-right-logo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}
.work-right-logo-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}
.work-right-logo-tag {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
/* ══ RESPONSIVE BREAKPOINTS ══
   Doc panel is the fixed star at all sizes.
   Side panels compress; gaps absorb surplus at ultra-wide.
   ══════════════════════════════════════════════════════ */

/* Ultra-wide (4K / 5K / curved widescreen) — let gaps soak up extra space naturally,
   panels already capped at 640px so nothing stretches beyond that. No overrides needed. */

/* Laptop — panels compress, logo shrinks, gaps collapse */
@media (max-width: 1700px) {
  .work-right-logo-img { width: 100px; height: 100px; }
  .work-right-logo-name { font-size: 22px; }
  .work-right-logo-tag { font-size: 11px; }
}
@media (max-width: 1500px) {
  .work-right-logo-img { width: 72px; height: 72px; }
  .work-right-logo-name { font-size: 18px; }
  .work-right-logo-tag { font-size: 10px; letter-spacing: 0.06em; }
  .work-right-logo { padding: 8px 10px; margin: 6px 6px 3px; }
  .left-panel-header { padding: 6px 10px; margin: 5px 6px 2px; }
}
@media (max-width: 1600px) {
  /* At laptop (1470px) — panels compress, setup page 2 optimized */
  .work-main {
    grid-template-columns: minmax(300px, 380px) 0 auto 0 minmax(300px, 380px);
  }
  .work-right-logo-img { width: 56px; height: 56px; }
  .work-right-logo-name { font-size: 15px; }
  .work-right-logo-tag { display: none; }
  .work-right-logo { padding: 6px 8px; gap: 8px; margin: 5px 5px 3px; }
  .dcw-digits { font-size: 16px; }
  .dcw-label-top { font-size: 9px; }
  .dcw-label-bot { font-size: 9px; }
  .left-panel-header { padding: 5px 8px; margin: 4px 5px 2px; }
  /* Setup Page 2 — hide bee, tighten padding */
  .proj-left-scroll > .setup-card-bee { display: none; }
  .proj-static-top { padding: 12px 16px 6px; }
  .proj-goal-flex { padding: 0 16px 0; }
  /* Compress length constraint box */
  .length-constraint-desc { display: none; }
  .length-constraint-header { margin-bottom: 4px; }
  /* Hide refine preview panel — not critical at laptop size */
  .goal-split-right { display: none; }
  .goal-split-left { flex: 1; min-width: 0; }
  /* Compress launch requirements: smaller text, no wrap, truncate doc label */
  .launch-requirements { gap: 8px; font-size: 12px; flex-wrap: nowrap; overflow: hidden; }
  .launch-req-item { font-size: 11px; white-space: nowrap; }
  .launch-req-title { font-size: 11px; }
  /* Truncate the long document requirement label */
  #req-doc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
  /* Shrink setup page 1 action buttons */
  .bee-controls-row-setup .btn-lg { font-size: 12px; padding: 7px 14px; }

  /* ── Overlay animations — scale to ~50% at laptop viewport ── */

  /* Smoker bee */
  .smoker-hero-img { width: 210px; height: 210px; margin-top: 20px; }
  .smoker-overlay-label { font-size: 16px; }
  .smoker-subtitle { font-size: 11px; max-width: 280px; }

  /* Builder station */
  .builder-scene-wrap { width: 380px; }
  .builder-stage { padding: 16px 18px 12px; gap: 6px; }
  .builder-belt-track { height: 35px; bottom: 30%; }
  .builder-block { width: 55px; height: 30px; gap: 2px; border-radius: 4px; }
  .builder-block-icon { width: 12px; height: 12px; }
  .builder-block-name { font-size: 7px; }
  .builder-station-sparks { width: 70px; height: 70px; left: calc(80% + 10px); top: 63%; }
  .builder-station-sparks span { width: 3px; height: 3px; }
  .builder-station-sparks span:nth-child(1)  { --dx:  9px;  --dy:  30px; }
  .builder-station-sparks span:nth-child(2)  { --dx:  14px; --dy:  40px; }
  .builder-station-sparks span:nth-child(3)  { --dx:  32px; --dy:  15px; }
  .builder-station-sparks span:nth-child(4)  { --dx:  22px; --dy:  35px; }
  .builder-station-sparks span:nth-child(5)  { --dx:  5px;  --dy:  50px; }
  .builder-station-sparks span:nth-child(6)  { --dx: -20px; --dy:  22px; }
  .builder-station-sparks span:nth-child(7)  { --dx:  11px; --dy:  37px; }
  .builder-station-sparks span:nth-child(8)  { --dx:  17px; --dy:  47px; }
  .builder-station-sparks span:nth-child(9)  { --dx:  35px; --dy:  12px; }
  .builder-station-sparks span:nth-child(10) { --dx:  23px; --dy:  55px; }
  .builder-station-sparks span:nth-child(11) { --dx:  13px; --dy:  32px; }
  .builder-station-sparks span:nth-child(12) { --dx: -15px; --dy:  27px; }
  .builder-overlay-label { font-size: 14px; }

  /* Builder belt block exit keyframe scale — blocks start/end positions halved */
  @keyframes builderBlockExit {
    from { transform: translateX(330px); opacity: 0; }
    6%   { opacity: 1; }
    70%  { opacity: 1; }
    85%  { opacity: 0; }
    to   { transform: translateX(-70px); opacity: 0; }
  }

  /* Hive finish approved bee */
  .hive-finish-bee-img { width: min(85vw, 290px); }
  .hive-finish-tagline { font-size: clamp(1rem, 2.5vw, 1.4rem); }
}

/* ══ UNIFIED DUAL-FACE CLOCK WIDGET ══ */
.dual-clock-widget {
  margin: 4px 8px 2px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 6px 8px;
}
.dcw-bezel {
  background: linear-gradient(145deg, #0a0c12, #151820);
  border-radius: 8px;
  border: 1px solid #1a1d2a;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.8),
    inset 0 -1px 2px rgba(255,255,255,0.05),
    0 4px 12px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.08);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 8px 10px;
  gap: 0;
}
.dcw-face {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}
.dcw-divider {
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.12), transparent);
  margin: 2px 0;
  flex-shrink: 0;
}
.dcw-label-top {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #9aa3b8;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
}
.dcw-screen {
  background: linear-gradient(180deg, #050608 0%, #0a0d14 100%);
  border-radius: 4px;
  padding: 5px 10px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.9), inset 0 0 16px rgba(245,166,35,0.03);
  border: 1px solid #0d0f18;
  width: 100%;
  text-align: center;
}
/* dcw-digits — JS adds/removes .running and .paused on these by ID */
.dcw-digits {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: #4a5270;
  letter-spacing: 0.1em;
  transition: color 0.3s, text-shadow 0.3s;
  display: block;
  white-space: nowrap;
}
.dcw-digits.running {
  color: #00b300;
  text-shadow: 0 0 10px rgba(0,179,0,0.6), 0 0 28px rgba(0,179,0,0.2);
}
/* Round clock status label */
.dcw-label-bot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #6a7090;
  text-transform: uppercase;
  transition: color 0.3s;
  text-align: center;
}
.dcw-label-bot.running { color: #00b300; }
/* Project clock — amber digits when running */
.dcw-digits-project.running {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(245,166,35,0.6), 0 0 28px rgba(245,166,35,0.2);
}
/* Project clock paused — slow amber flash */
.dcw-digits-project.paused {
  color: var(--accent);
  animation: projClockPausedFlash 1.4s ease-in-out infinite;
}
@keyframes projClockPausedFlash {
  0%   { opacity: 1; }
  50%  { opacity: 0.25; }
  100% { opacity: 1; }
}
/* Project clock controls */
.dcw-controls {
  display: flex;
  justify-content: center;
  gap: 5px;
}
.dcw-ctrl-btn {
  background: transparent;
  border: 1px solid #2a2d3a;
  border-radius: 4px;
  color: #4a5270;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: var(--font-mono);
  line-height: 1.4;
}
.dcw-ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
.dcw-ctrl-btn.active { border-color: #00b300; color: #00b300; }

/* Light theme overrides */
[data-theme="light"] .dual-clock-widget { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .dcw-bezel { background: linear-gradient(145deg, #e8eaf0, #ffffff); border-color: #d0d4e8; box-shadow: inset 0 2px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.1); }
[data-theme="light"] .dcw-screen { background: linear-gradient(180deg, #f0f2f8 0%, #e8eaf4 100%); border-color: #d0d4e8; box-shadow: inset 0 1px 4px rgba(0,0,0,0.1); }
[data-theme="light"] .dcw-digits { color: #1a1d2a; }
[data-theme="light"] .dcw-digits.running { color: #047857; text-shadow: 0 0 8px rgba(4,120,87,0.4); }
[data-theme="light"] .dcw-digits-project.running { color: #a06000; text-shadow: 0 0 8px rgba(160,96,0,0.4); }
[data-theme="light"] .dcw-label-top { color: #384060; }
[data-theme="light"] .dcw-label-bot { color: #384060; }
[data-theme="light"] .dcw-label-bot.running { color: #047857; }
[data-theme="light"] .dcw-ctrl-btn { border-color: #d0d4e8; color: #7880a0; }
[data-theme="light"] .dcw-ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="light"] .dcw-divider { background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.12), transparent); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .dual-clock-widget { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.1); }
  [data-theme="auto"] .dcw-bezel { background: linear-gradient(145deg, #e8eaf0, #ffffff); border-color: #d0d4e8; }
  [data-theme="auto"] .dcw-screen { background: linear-gradient(180deg, #f0f2f8 0%, #e8eaf4 100%); border-color: #d0d4e8; }
  [data-theme="auto"] .dcw-digits { color: #1a1d2a; }
  [data-theme="auto"] .dcw-digits.running { color: #047857; text-shadow: 0 0 8px rgba(4,120,87,0.4); }
  [data-theme="auto"] .dcw-digits-project.running { color: #a06000; text-shadow: 0 0 8px rgba(160,96,0,0.4); }
  [data-theme="auto"] .dcw-label-top { color: #7880a0; }
  [data-theme="auto"] .dcw-label-bot { color: #7880a0; }
  [data-theme="auto"] .dcw-ctrl-btn { border-color: #d0d4e8; color: #7880a0; }
  [data-theme="auto"] .dcw-divider { background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.12), transparent); }
}

/* ── FOOTER BAR ── */
.work-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  background: #0a0c12;
  border-top: none;
  gap: 16px;
}
[data-theme="light"] .work-footer { background: #ffffff; }
@media (prefers-color-scheme: light) { [data-theme="auto"] .work-footer { background: #ffffff; } }

/* ── LIGHT MODE BUTTONS — split by background context ──────────────────
   Dark-bg headers (left-panel, honeycomb/console): white text, amber fill hover
   Light-bg headers (work-panel, topbar): dark text, amber fill hover
   Footer smoke: always white text (filled amber button)
   ─────────────────────────────────────────────────────────────────── */

/* Dark-background headers — white text */
[data-theme="light"] .left-panel-header .btn,
[data-theme="light"] .honeycomb-header .btn {
  color: #ffffff; border-color: rgba(255,255,255,0.5); background: transparent;
}
[data-theme="light"] .left-panel-header .btn:hover,
[data-theme="light"] .honeycomb-header .btn:hover {
  color: #0a0c12; border-color: var(--accent); background: var(--accent);
}
/* Light-background headers — dark text, amber fill hover */
[data-theme="light"] .work-topbar .btn,
[data-theme="light"] .work-panel-header .btn {
  color: #1a1d2a; border-color: #9aa3b8; background: transparent;
}
[data-theme="light"] .work-topbar .btn:hover,
[data-theme="light"] .work-panel-header .btn:hover {
  color: #0a0c12; border-color: var(--accent); background: var(--accent);
}
/* Footer buttons */
[data-theme="light"] .footer-btn { color: #1a1d2a; border-color: #9aa3b8; }
[data-theme="light"] .footer-btn:hover { color: #0a0c12; border-color: var(--accent); background: var(--accent-dim); }
[data-theme="light"] .footer-btn-smoke { color: #ffffff; }
[data-theme="light"] .footer-btn-smoke span { color: #ffffff; }

@media (prefers-color-scheme: light) {
  [data-theme="auto"] .left-panel-header .btn,
  [data-theme="auto"] .honeycomb-header .btn {
    color: #ffffff; border-color: rgba(255,255,255,0.5); background: transparent;
  }
  [data-theme="auto"] .left-panel-header .btn:hover,
  [data-theme="auto"] .honeycomb-header .btn:hover {
    color: #0a0c12; border-color: var(--accent); background: var(--accent);
  }
  [data-theme="auto"] .work-topbar .btn,
  [data-theme="auto"] .work-panel-header .btn {
    color: #1a1d2a; border-color: #9aa3b8; background: transparent;
  }
  [data-theme="auto"] .work-topbar .btn:hover,
  [data-theme="auto"] .work-panel-header .btn:hover {
    color: #0a0c12; border-color: var(--accent); background: var(--accent);
  }
  [data-theme="auto"] .footer-btn { color: #1a1d2a; border-color: #9aa3b8; }
  [data-theme="auto"] .footer-btn:hover { color: #0a0c12; border-color: var(--accent); background: var(--accent-dim); }
  [data-theme="auto"] .footer-btn-smoke { color: #ffffff; }
  [data-theme="auto"] .footer-btn-smoke span { color: #ffffff; }
}

/* Console header has both classes — honeycomb wins for button color */
[data-theme="light"] .work-panel-header.honeycomb-header .btn {
  color: #ffffff; border-color: rgba(255,255,255,0.5); background: transparent;
}
[data-theme="light"] .work-panel-header.honeycomb-header .btn:hover {
  color: #0a0c12; border-color: var(--accent); background: var(--accent);
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .work-panel-header.honeycomb-header .btn {
    color: #ffffff; border-color: rgba(255,255,255,0.5); background: transparent;
  }
  [data-theme="auto"] .work-panel-header.honeycomb-header .btn:hover {
    color: #0a0c12; border-color: var(--accent); background: var(--accent);
  }
}
.footer-status {
  font-size: 13px;
  font-style: italic;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="light"] .footer-status { color: #0a0c12; }
@media (prefers-color-scheme: light) { [data-theme="auto"] .footer-status { color: #0a0c12; } }
.footer-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 40px;
  transition: all 0.15s;
  min-width: 200px;
}
.footer-btn:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.footer-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.footer-btn-smoke {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 40px;
  min-width: 200px;
  transition: all 0.15s;
}
.footer-btn-smoke:hover {
  background: #ffffff;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245,166,35,0.5);
}
.footer-btn-smoke:hover span { color: var(--accent); }
.footer-btn-smoke:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.footer-btn-smoke.running {
  animation: shakePulse 0.8s ease-in-out infinite alternate;
}
.footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}



.bee-status-card.is-active { border-color: var(--border2); }
.bee-status-card.is-inactive { opacity: 0.45; }
.bee-status-card.is-builder { border-color: var(--accent); background: var(--accent-dim); }
.bee-status-card.is-working    { border-color: var(--blue);    background: var(--blue-dim); }
.bee-status-card.is-sending    { border-color: var(--blue);    background: var(--blue-dim); }
.bee-status-card.is-responding { border-color: var(--purple);  background: var(--purple-dim); }
.bee-status-card.is-done       { border-color: var(--green); }
.bee-status-card.is-error      { border-color: var(--red);     background: var(--red-dim); }


/* ROUND HISTORY */
.round-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.round-history-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 16px 0; }

/* STATUS BAR */

.setup-body-single > *:not(.page-watermark) {
  position: relative;
  z-index: 1;
}

/* ── SETUP STEP BADGE ── */
.setup-step-badge {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
}

/* ── BEE CONTROLS ROW ── */
.bee-controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* ── BUILDER PICK GRID LARGE ── */
.builder-pick-grid-large {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.builder-pick-grid-large .builder-pick-btn {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px 14px;
  font-size: 14px;
  text-align: center;
  justify-content: center;
}

/* ── SECTION BEE IMAGE ── */

/* ── CUSTOM AI FORM ── */
.custom-ai-form-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
}
.custom-ai-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.custom-ai-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.custom-ai-field-wrap label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.custom-ai-field-wrap input,
.custom-ai-select {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.12s;
  width: 100%;
}
.custom-ai-field-wrap input:focus,
.custom-ai-select:focus { border-color: var(--accent); }

/* ── Add Custom AI Modal ── */
.custom-ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.custom-ai-modal-overlay.active { display: flex; }
/* Import server modal overrides overlay padding so it can go full-bleed */
.custom-ai-modal-overlay:has(.import-server-modal) {
  padding: 0;
}
.custom-ai-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 32px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.custom-ai-modal-hdr {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border2);
}
.custom-ai-modal-bee { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.custom-ai-modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text); }
.custom-ai-modal-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.custom-ai-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.field-required { color: var(--red); }
.field-optional { color: var(--muted); font-weight: 400; }

.custom-ai-field-wrap--model { flex: 1; }

.custom-ai-quickadd-row { align-items: flex-end; }
.custom-ai-field-wrap--keylinkwrap { flex: 0 0 auto; min-width: 0; }

.custom-ai-key-link {
  display: block;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 0;
}
.custom-ai-key-link:hover { text-decoration: underline; }

.custom-ai-model-input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}
.custom-ai-model-input-wrap input,
.custom-ai-model-input-wrap select { flex: 1; min-width: 0; }

.custom-ai-key-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}
.custom-ai-key-wrap input { flex: 1; min-width: 0; }

.custom-ai-test-status {
  flex: 1;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  align-self: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.custom-ai-test-status.testing { color: var(--muted); }
.custom-ai-test-status.pass    { color: var(--green); }
.custom-ai-test-status.fail    { color: var(--red); }

.custom-ai-raw-panel {
  margin-top: 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.custom-ai-raw-row {
  display: flex;
  border-bottom: 1px solid var(--border2);
}
.custom-ai-raw-row:last-child { border-bottom: none; }
.custom-ai-raw-label {
  flex-shrink: 0;
  width: 80px;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--surface2);
  border-right: 1px solid var(--border2);
  display: flex;
  align-items: flex-start;
  padding-top: 10px;
}
.custom-ai-raw-pre {
  flex: 1;
  margin: 0;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-dim);
  background: transparent;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}
.import-server-raw-received {
  max-height: 160px;
}

.ai-setup-key-status {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.12s;
}
.ai-setup-key-status.has-key { opacity: 1; }
.ai-eye-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  padding: 4px 6px;
  transition: all 0.12s;
  flex-shrink: 0;
  line-height: 1;
}
.ai-clear-key-btn {
  background: transparent;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  transition: all 0.12s;
  flex-shrink: 0;
  line-height: 1;
  white-space: nowrap;
}
.ai-clear-key-btn:hover { background: var(--red-dim); }
.ai-test-btn {
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 7px;
  transition: all 0.12s;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
}
.ai-test-btn:hover { background: var(--blue-dim); }
.ai-test-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── IMPORT FROM MODEL SERVER ── */
.import-server-modal {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.import-server-close-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s;
}
.import-server-close-btn:hover { border-color: var(--accent); color: var(--accent); }
.import-server-fetch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.import-server-checklist {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.import-server-checklist-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.import-server-checklist-actions {
  display: flex;
  gap: 6px;
}
.import-server-checklist-items {
  overflow-y: auto;
  flex: 1;
  max-height: 340px;
}
.import-server-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.import-server-item:last-child { border-bottom: none; }
.import-server-item:hover { background: var(--surface2); }
.import-server-check {
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.import-server-item-label {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  flex: 1 1 260px;
  min-width: 0;
  word-break: break-all;
  cursor: pointer;
}
.import-server-name-input {
  flex: 1 1 200px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 4px 8px;
  min-width: 0;
}
.import-server-name-input:focus { outline: none; border-color: var(--accent); }

/* ── MODEL SELECTOR ── */
.model-select {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  min-width: 220px;
  max-width: 340px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.model-select:focus { border-color: var(--accent); outline: none; }
.model-select-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-remove-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  padding: 5px 7px;
  transition: all 0.12s;
  flex-shrink: 0;
}
.ai-remove-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

.ai-hide-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  padding: 5px 9px;
  transition: all 0.12s;
  flex-shrink: 0;
}
.ai-hide-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.ai-hidden-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-dim);
}
.ai-hidden-restore-btn {
  margin-left: auto;
  font-size: 12px;
  padding: 4px 12px;
}

/* ── KBD TAG ── */
kbd {
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
}

/* ── PROJECT FIELD CLEAR BUTTONS ── */
.project-field-wrap .field-lg { width: 100%; }
.project-field-wrap:nth-child(2) .field-sm { width: 150px; }

/* ── PROJECT FIELDS — clean stacked layout ── */
.project-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 480px;
}
.proj-field-full {
  width: 100%;
}
.proj-field-ver {
  width: 180px;
}
.proj-clear-row {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}
.proj-clear-row--bottom {
  justify-content: flex-end;
}
.proj-clear-btn {
  font-size: 12px;
  padding: 5px 14px;
}

/* ── GOAL INFO BUTTON & MODAL ── */
.goal-info-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  opacity: 0.9;
  transition: opacity 0.12s;
}
.goal-info-btn img { width: 28px; height: 28px; display: block; }
.goal-info-btn-img { width: 28px; height: 28px; display: block; flex-shrink: 0; opacity: 0.9; }
.goal-info-btn:hover { opacity: 1; }
.goal-info-modal {
  max-width: 520px;
  text-align: left;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.goal-info-icon {
  font-size: 32px;
  text-align: center;
  margin-bottom: 4px;
}
.goal-info-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 16px;
}
.goal-info-body p { margin: 0; }
.goal-info-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.info-label {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  width: 56px;
  text-align: center;
  margin-top: 1px;
  letter-spacing: 0.04em;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
}
.about-modal-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: -8px 0 4px;
}
.goal-info-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.goal-info-tip {
  font-size: 13px;
  color: var(--text);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}

/* ── GOAL HEADING ── */
/* ── Length Constraint ── */
.length-constraint-row {
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 14px;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
}
.length-constraint-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.length-constraint-optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 6px;
}
.length-constraint-hint {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.length-constraint-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 10px;
}
.length-constraint-fields {
  display: flex;
  gap: 8px;
  align-items: center;
}
.length-limit-input {
  width: 110px;
  padding: 7px 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  transition: border-color 0.12s;
}
.length-limit-input:focus {
  outline: none;
  border-color: var(--accent);
}
.length-limit-input::placeholder { color: var(--text-dim); opacity: 0.6; }
.length-unit-select {
  padding: 7px 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.length-unit-select:focus { outline: none; border-color: var(--accent); }
[data-theme="light"] .length-limit-input,
[data-theme="light"] .length-unit-select {
  background: #ffffff;
  border-color: var(--border2);
}

.proj-goal-heading {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ── GOAL COUNTER STATS ── */
#goalCounter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.goal-stat {
  color: var(--text-dim);
  font-size: 11px;
}
.goal-stat-label {
  color: var(--muted);
  font-size: 11px;
}
.goal-stat-warn {
  color: var(--amber);
}
.goal-stat-sep {
  color: var(--border2);
  font-size: 11px;
}

/* ── EXPORT MASK ROW ── */
.export-mask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.export-mask-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.export-mask-input {
  width: 480px;
  flex: 0 0 480px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
  transition: border-color 0.15s;
}
.export-mask-input:focus { border-color: var(--accent); }
.export-mask-preview {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── LIVE CONSOLE ── */
.console-body-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: 4px solid rgba(0,179,0,0.45);
  border-radius: var(--radius-sm);
  margin: 4px 8px 8px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(0,179,0,0.07);
}
.live-console {
  flex: 1;
  overflow-y: auto;
  background: #0a0c12;
  border: none;
  border-radius: 0;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,179,0,0.3) transparent;
  min-height: 160px;
  margin: 0;
}
/* Console — white in light mode */
[data-theme="light"] .live-console { background: #ffffff; color: #0f1221; }
[data-theme="light"] .console-body-wrap { border-color: #00b300; }
[data-theme="light"] .console-legend { background: #f0f2f8; border-bottom-color: rgba(0,179,0,0.3); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .live-console { background: #ffffff; color: #0f1221; }
  [data-theme="auto"] .console-body-wrap { border-color: #00b300; }
  [data-theme="auto"] .console-legend { background: #f0f2f8; border-bottom-color: rgba(0,179,0,0.3); }
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .live-console { background: #0a0c12; }
}
.console-entry {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 1px 0;
  word-break: break-word;
}
.console-time {
  flex-shrink: 0;
  min-width: 90px;
  color: #4a5270;
  margin-right: 6px;
  user-select: none;
}
.console-entry span:last-child {
  flex: 1;
  min-width: 0;
}
.console-info    { color: #9aa3b8; }
.console-success { color: #00b300; }
.console-warn    { color: #fbbf24; }
.console-error   { color: #f87171; }
.console-divider { color: #f5a623; font-weight: 700; margin: 4px 0 2px; }
.console-send    { color: #60a5fa; }
.console-preview { color: #a78bfa; }

/* ── Console Legend ── */
.console-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px 8px;
  background: #111318;
  border-bottom: 1px solid rgba(0,179,0,0.2);
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  align-items: center;
  flex-shrink: 0;
}
.legend-item {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.legend-label {
  font-weight: 700;
  color: var(--text-dim);
  font-size: 11px;
  margin-right: 4px;
}

/* ── SECTION TITLES (larger headers) ── */
.work-section-title {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: none;
}

/* ── LOGO ROW (right-aligned, top of right panel) ── */

.bee-card.is-builder { border-color: var(--accent); background: var(--accent-dim); }
.bee-card.is-active  { border-color: var(--border2); }
.bee-card.is-inactive { opacity: 0.4; }
.bee-card.is-working { border-color: var(--blue); background: var(--blue-dim); }
.bee-card.is-done    { border-color: var(--green); background: var(--green-dim); }
.bee-card.is-error   { border-color: var(--red); background: var(--red-dim); }

.bee-card.is-working 
.bee-card.is-done    
.bee-card.is-error   
.bee-card.is-builder 

.work-notes-panel .work-panel-header {
  background: var(--surface2);
}

/* ══════════════════════════════════════
   FULLSCREEN LAYOUT (Setup Screens 2 & 3)
══════════════════════════════════════ */
.fullscreen-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ── Full-screen header bar ── */
.fs-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: var(--surface2);
  flex-shrink: 0;
}
.fs-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.fs-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(245,166,35,0.4));
}
.fs-logo-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.fs-logo-tag {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Two-column body ── */
.fs-body {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  background: var(--surface2);
  padding: 0 16px 0 16px;
  gap: 0;
}

.project-card 
.project-card .fs-col-header {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  margin-bottom: 0;
}
.project-card .doc-input-tabs {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}
.project-card .fs-col-sub {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

/* Each column = surface2 container holding two cards */
.fs-col {
  background: var(--surface2);
  border-radius: var(--radius-md);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 6px;
  padding: 0 0 6px 0;
}
/* .fs-col-left reserved */
/* .fs-col-right reserved */

/* Main content card */
.fs-col-main {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Center bar */
.fs-divider {
  width: 32px;
  flex-shrink: 0;
  background: var(--surface2);
}

/* Scrollable content inside main card */
.fs-col-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* Tip — separate card below main card */
.setup-col-tip {
  flex-shrink: 0;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  line-height: 1.6;
  margin: 0 0;
}

.fs-col-header { margin-bottom: 20px; }
.fs-col-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.fs-col-sub { font-size: 14px; color: var(--text-dim); line-height: 1.7; }
.fs-col-tip { font-size: 13px; color: var(--text); font-style: italic; line-height: 1.6; margin-top: 10px; }

/* Bee — fixed block above scroll area, not absolute */
.setup-card-bee {
  display: block;
  width: 260px;
  height: 260px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
  align-self: center;
  flex-shrink: 0;
  padding-top: 12px;
}
/* Content stays above bee — no longer needed since bee is not absolute */
.fs-col-scroll > * { position: relative; z-index: 1; }

/* Controls row */
.bee-controls-row-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
/* ── Footer ── */
.fs-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 14px 32px;
  border-top: none;
  background: var(--surface2);
  flex-shrink: 0;
}
.fs-footer-spacer {
  display: block;
}
.fs-footer .btn-cta {
  justify-self: end;
  width: fit-content;
}
.btn-cta:not(.btn-accent) {
  border: 1px solid var(--border2);
  border-style: solid;
  color: var(--text-dim);
  background: transparent;
}

/* proj-right-scroll — same as fs-col-scroll, no bee on right side of step 2 */
/* .proj-right-scroll reserved */

/* ── PROJECT NOTEBOOK (paste + scratch panels) ── */
.proj-notebook {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 320px;
  align-items: flex-start;
  /* Notebook paper: blue ruled lines + red margin */
  background-color: var(--surface);
  background-image:
    /* Red margin line at left edge of text area */
    linear-gradient(to right, transparent 44px, rgba(220,50,50,0.25) 44px, rgba(220,50,50,0.25) 46px, transparent 46px),
    /* Blue ruled lines */
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 20px,
      rgba(80,140,220,0.18) 20px,
      rgba(80,140,220,0.18) 21px
    );
}
.proj-notebook-nums {
  width: 44px;
  flex-shrink: 0;
  align-self: flex-start;
  background: transparent;
  border-right: 1px solid var(--border2);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 21px;
  color: var(--muted);
  text-align: right;
  padding: 0 6px 0 0;
  user-select: none;
  overflow: hidden;
}
.proj-notebook-nums div { line-height: 21px; height: 21px; font-size: 13px; }
.proj-notebook-ta {
  width: 80ch;
  min-width: 80ch;
  max-width: 80ch;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 21px;
  padding: 0 12px;
  resize: none;
  outline: none;
  overflow: hidden;
  height: auto;
  min-height: 100%;
}
/* Goal textarea — full width of container, monospace to match other editors */
.proj-goal-ta {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 21px;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  align-self: stretch;
}
.proj-notebook-goal {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: flex-start;
  font-family: var(--font-mono);
  font-size: 13px;
  width: 100%;
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, transparent 44px, rgba(220,50,50,0.25) 44px, rgba(220,50,50,0.25) 46px, transparent 46px),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 20px,
      rgba(80,140,220,0.18) 20px,
      rgba(80,140,220,0.18) 21px
    );
}
.proj-notebook-scratch {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  min-height: 280px;
}
.proj-scratch-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
}
.proj-scratch-icon { font-size: 40px; }
.proj-scratch-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.proj-scratch-msg {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 380px;
}

/* ══════════════════════════════════════
   SETUP SCREEN — BEE IMAGES & DIVIDER
══════════════════════════════════════ */

/* Make sure col content sits above the image */
.fs-col > *:not(.setup-section-img) { position: relative; z-index: 1; }
.fs-body-single > *:not(.setup-section-img) { position: relative; z-index: 1; }
.fs-body-single 
.fs-body-single .fs-col-header {
  max-width: 680px;
  padding: 0 20px;
}

/* ── ROUND HISTORY CARDS ── */
.round-hist-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 0.12s;
}
.round-hist-item:hover { border-color: var(--border2); }
.round-hist-item--failed {
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.05);
  opacity: 0.85;
}
.round-hist-item--failed:hover { border-color: rgba(251,191,36,0.7); opacity: 1; }
.round-hist-badge--failed {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.6);
  color: #fbbf24;
}
.round-hist-stats--failed { color: #fbbf24; opacity: 0.8; }
.round-hist-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 8px;
}
.round-hist-hdr-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}
.round-hist-hdr-right {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.round-hist-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 20px;
  padding: 1px 8px;
  white-space: nowrap;
}
.round-hist-meta {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
}
.round-hist-stats {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
.round-hist-view-btn {
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.round-hist-view-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.round-hist-restore-btn {
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.round-hist-restore-btn:hover { background: var(--accent-dim); border-style: solid; }

/* ── HISTORY DOC MODAL ── */
.hist-doc-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.hist-doc-modal-inner {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 1100px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hist-doc-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  gap: 10px;
}
.hist-doc-modal-ta {
  flex: 1;
  background: var(--surface2);
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.8;
  padding: 24px 28px;
  resize: none;
  outline: none;
  overflow-y: auto;
}

/* ── Full-width Shake the Hive button ── */

/* ── Two-button row ── */
.builder-only-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  pointer-events: none;
}
.btn-shake-wide.running {
  animation: shakePulse 0.8s ease-in-out infinite alternate;
}
@keyframes shakePulse {
  from { box-shadow: 0 0 6px rgba(245,166,35,0.4); }
  to   { box-shadow: 0 0 18px rgba(245,166,35,0.9); }
}
.shake-wide-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  color: #0a0c12;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* ── Console Clock ── */
.console-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0c12;
  border: 1px solid #1a7a3a;
  border-radius: var(--radius-sm);
  margin: 4px 10px;
  padding: 6px 12px;
  font-family: var(--font-mono);
}
.console-clock.running .console-clock-time {
  color: var(--amber);
}
.console-clock.running .console-clock-label {
  color: var(--amber);
  opacity: 0.7;
}

/* ── Round Timer Widget ── */
.round-timer-clock.running {
  color: #00b300;
  text-shadow: 0 0 8px rgba(0,179,0,0.4);
}

/* ── Compact bee rows ── */

/* ── NOTES 1/3, HISTORY 2/3 SPLIT ── */

.work-notes-panel .round-history {
  flex: 0 0 auto;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* ══════════════════════════════════════
   CONFLICTS PANEL
══════════════════════════════════════ */

.conflicts-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #0a0c12;
  border: 4px solid rgba(245,166,35,0.5);
  border-radius: var(--radius-sm);
  margin: 4px 10px 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #9aa3b8;
  box-shadow: 0 0 12px rgba(245,166,35,0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(245,166,35,0.4) transparent;
}
[data-theme="light"] .conflicts-panel {
  background: #ffffff;
  border-color: var(--accent);
  color: #0f1221;
  box-shadow: 0 0 12px rgba(201,124,6,0.10);
  scrollbar-color: var(--accent) transparent;
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .conflicts-panel {
    background: #ffffff;
    border-color: var(--accent);
    color: #0f1221;
    box-shadow: 0 0 12px rgba(201,124,6,0.10);
    scrollbar-color: var(--accent) transparent;
  }
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .conflicts-panel {
    background: #0a0c12;
    border-color: rgba(245,166,35,0.5);
    color: #9aa3b8;
  }
}

.conflicts-empty {
  color: var(--text);
  font-size: 12px;
  font-style: italic;
  padding: 4px 0;
}
.conflicts-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.builder-resolved-header {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green);
}
.user-decisions-header {
  background: rgba(245,166,35,0.1);
  color: var(--amber);
  border: 1px solid var(--amber);
}
.convergence-header {
  background: rgba(0,179,0,0.08);
  color: var(--text);
  border: 1px solid #00b300;
}
.convergence-card {
  border-color: #00b300 !important;
}
.convergence-card.declined {
  border-color: #f87171 !important;
}
.convergence-card.declined .convergence-ai-badge {
  color: var(--muted);
}
.convergence-card.custom-selected {
  border-color: var(--amber) !important;
}
.decision-opt-btn.selected.decline-btn {
  border-color: #f87171 !important;
  background: rgba(248,113,113,0.08) !important;
}
.decision-opt-btn.selected.decline-btn .decision-opt-num {
  background: rgba(248,113,113,0.15) !important;
  color: #f87171 !important;
}
.decision-opt-btn.selected.custom-btn {
  border-color: var(--amber) !important;
  background: rgba(245,166,35,0.08) !important;
}
.decision-opt-btn.selected.custom-btn .decision-opt-num {
  background: rgba(245,166,35,0.15) !important;
  color: var(--amber) !important;
}
.convergence-ai-badge {
  font-size: 11px;
  font-weight: 700;
  color: #00b300;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.convergence-suggestion {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 8px 0 12px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
}
.convergence-footer {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.convergence-footer strong {
  color: var(--text);
}

.conflicts-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: #e8ecf4;
}
[data-theme="light"] .conflicts-body { color: #0f1221; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .conflicts-body { color: #0f1221; }
}

/* ── USER DECISION CARDS ── */
.decision-card {
  background: var(--surface2);
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.decision-card.resolved {
  border-color: #00b300;
}
/* Repeat offender — hot card (3+ appearances) */
.decision-card.decision-card-hot {
  border-color: #f87171;
  background: rgba(239,68,68,0.06);
}
[data-theme="light"] .decision-card.decision-card-hot { background: rgba(239,68,68,0.04); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .decision-card.decision-card-hot { background: rgba(239,68,68,0.04); }
}
.decision-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.decision-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.decision-card.resolved .decision-badge {
  color: #00b300;
}
/* Repeat badge — shown when conflict appears 2+ times */
.conflict-repeat-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.4);
  color: var(--amber);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
/* Hot badge — 3+ appearances */
.conflict-repeat-badge.conflict-repeat-hot {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.5);
  color: #f87171;
}
[data-theme="light"] .conflict-repeat-badge { background: rgba(245,166,35,0.08); }
[data-theme="light"] .conflict-repeat-badge.conflict-repeat-hot { background: rgba(239,68,68,0.08); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .conflict-repeat-badge { background: rgba(245,166,35,0.08); }
  [data-theme="auto"] .conflict-repeat-badge.conflict-repeat-hot { background: rgba(239,68,68,0.08); }
}
/* Repeat offender summary warning banner */
.conflict-repeat-warning {
  background: rgba(239,68,68,0.08);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.4);
  margin-bottom: 10px;
}
[data-theme="light"] .conflict-repeat-warning { background: rgba(239,68,68,0.05); }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .conflict-repeat-warning { background: rgba(239,68,68,0.05); }
}
.decision-question {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.decision-current {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-style: italic;
}
.decision-current-clickable {
  cursor: pointer;
}
.decision-current-clickable:hover {
  color: var(--accent);
}
.decision-label {
  font-weight: 700;
  font-style: normal;
  color: var(--text);
}
.decision-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.decision-opt-btn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.decision-opt-btn:hover {
  border-color: var(--amber);
  background: var(--surface3);
}
.decision-opt-btn.selected {
  border-color: #00b300;
  background: rgba(52, 211, 153, 0.08);
}
.decision-opt-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  background: var(--surface3);
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
  line-height: 1.6;
  margin-top: 1px;
}
/* decision-opt-num selected colours now handled per-variant below */
.decision-opt-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  min-width: 0;
  flex: 1;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.decision-opt-custom {
  border-style: dashed;
}
.decision-opt-custom.selected {
  border-color: var(--amber) !important;
  background: rgba(245,166,35,0.08) !important;
}

.decision-opt-bypass {
  border-style: dashed;
  opacity: 0.6;
}
.decision-opt-bypass:hover { opacity: 1; }
.decision-opt-bypass.selected {
  border-color: var(--text-dim) !important;
  background: rgba(255,255,255,0.04) !important;
  opacity: 1;
}

.decision-card.bypassed {
  border-color: var(--border2) !important;
  opacity: 0.65;
}
.decision-card.bypassed .decision-badge {
  background: var(--surface3) !important;
  color: var(--text-dim) !important;
}
.decision-custom-wrap {
  margin-top: 8px;
}
.decision-custom-ta {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  resize: vertical;
  min-height: 60px;
  outline: none;
  box-sizing: border-box;
}
.decision-custom-ta:focus {
  border-color: var(--accent-hover);
}
.decision-opt-ais {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  white-space: normal;
  line-height: 1.4;
  padding-bottom: 1px;
  display: block;
  margin-top: 2px;
}
/* ── APPLY DECISIONS BUTTON ── */
.btn-apply-decisions {
  width: 100%;
  padding: 12px;
  background: #00b300;
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0c12;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.15s;
}
.btn-apply-decisions:hover:not(:disabled) {
  background: #10b981;
  transform: translateY(-1px);
}
.btn-apply-decisions:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── BUILDER DECISIONS (informational) ── */
.builder-decisions-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}
.builder-decisions-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.builder-decision-item {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--blue);
  line-height: 1.5;
}

/* ── SMOKER OVERLAY ── */
.smoker-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8000;
  display: none;
  pointer-events: none;
}
.smoker-overlay.active {
  display: block;
}
.smoker-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-lg);
  padding: 148px 32px 48px;
  width: 760px;
  max-height: 90vh;
  overflow: hidden;
}
.smoker-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.98);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: -1;
  pointer-events: none;
}
.smoker-hero-img {
  position: relative;
  z-index: 1;
  width: 420px;
  height: 420px;
  object-fit: contain;
  margin-top: 40px;
  filter: drop-shadow(0 0 40px rgba(245,166,35,0.6));
  animation: smokerBob 2s ease-in-out infinite;
}
@keyframes smokerBob {
  0%   { transform: translateY(0) rotate(-2deg); }
  50%  { transform: translateY(-12px) rotate(2deg); }
  100% { transform: translateY(0) rotate(-2deg); }
}
.smoker-overlay-label {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(245,166,35,0.5);
  animation: smokerPulse 1.5s ease-in-out infinite;
}
@keyframes smokerPulse {
  0%   { opacity: 0.7; }
  50%  { opacity: 1; }
  100% { opacity: 0.7; }
}
.smoker-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  text-align: center;
  max-width: 420px;
  font-style: italic;
  opacity: 0;
  animation: smokerExplanationFadeIn 0.8s ease-out 1.5s forwards;
}
@keyframes smokerExplanationFadeIn {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}


/* ══════════════════════════════════════
   BUILDER OVERLAY — belt + end station
   ══════════════════════════════════════ */
.builder-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8000;
  display: none;
  pointer-events: none;
}
.builder-overlay.active {
  display: block;
}
.builder-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-lg);
  padding: 28px 32px 20px;
  overflow: visible;
}
.builder-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.98);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: -1;
  pointer-events: none;
}

/* Scene wrap — image with blocks sliding out left */
.builder-scene-wrap {
  position: relative;
  width: 760px;
  overflow: visible;
}

/* Image full width */
.builder-station-img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.3));
}

/* Belt segments — silver blocks IN the belt surface, create movement illusion */

/* AI blocks track — sits above the belt */
.builder-belt-track {
  position: absolute;
  bottom: 32%;
  left: 0;
  right: 0;
  height: 70px;
  overflow: visible;
  pointer-events: none;
}

/* AI branded blocks — icon + name, exit right to left */
.builder-block {
  position: absolute;
  top: 0;
  width: 110px;
  height: 60px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(56,210,210,0.40);
  background: linear-gradient(180deg, rgba(20,22,32,0.88), rgba(10,12,18,0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 14px rgba(0,0,0,0.5);
  animation: builderBlockExit var(--belt-dur, 8s) linear var(--belt-delay, 0s) infinite;
  white-space: nowrap;
  overflow: hidden;
}
.builder-block-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.builder-block-name {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #eafcff;
}

/* Sparks at drill tip */
.builder-station-sparks {
  position: absolute;
  top: 63%;
  left: calc(80% + 20px);
  width: 140px;
  height: 140px;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}
.builder-station-sparks span {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe566 35%, var(--accent) 68%, transparent 100%);
  box-shadow: 0 0 8px rgba(255,220,80,0.95);
  transform: translate(0, 0);
  transform-origin: center;
  animation: builderSparkBurst var(--spark-dur, 0.85s) ease-out var(--spark-delay, 0s) infinite;
  opacity: 0;
}
.builder-station-sparks span:nth-child(1)  { --dx:  18px; --dy:  60px; --spark-dur: .55s; --spark-delay: .00s; }
.builder-station-sparks span:nth-child(2)  { --dx:  28px; --dy:  80px; --spark-dur: .65s; --spark-delay: .05s; }
.builder-station-sparks span:nth-child(3)  { --dx:  65px; --dy:  30px; --spark-dur: .70s; --spark-delay: .10s; }
.builder-station-sparks span:nth-child(4)  { --dx:  44px; --dy:  70px; --spark-dur: .75s; --spark-delay: .15s; }
.builder-station-sparks span:nth-child(5)  { --dx:  10px; --dy: 100px; --spark-dur: .80s; --spark-delay: .20s; }
.builder-station-sparks span:nth-child(6)  { --dx: -40px; --dy:  45px; --spark-dur: .85s; --spark-delay: .03s; }
.builder-station-sparks span:nth-child(7)  { --dx:  22px; --dy:  75px; --spark-dur: .60s; --spark-delay: .08s; }
.builder-station-sparks span:nth-child(8)  { --dx:  34px; --dy:  95px; --spark-dur: .72s; --spark-delay: .12s; }
.builder-station-sparks span:nth-child(9)  { --dx:  70px; --dy:  25px; --spark-dur: .82s; --spark-delay: .18s; }
.builder-station-sparks span:nth-child(10) { --dx:  46px; --dy: 110px; --spark-dur: .90s; --spark-delay: .24s; }
.builder-station-sparks span:nth-child(11) { --dx:  26px; --dy:  65px; --spark-dur: .68s; --spark-delay: .28s; }
.builder-station-sparks span:nth-child(12) { --dx: -30px; --dy:  55px; --spark-dur: .78s; --spark-delay: .32s; }

/* Label */
.builder-overlay-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-shadow: 0 0 16px rgba(245,166,35,0.5);
  animation: smokerPulse 1.5s ease-in-out infinite;
}

/* Keyframes — blocks exit left from bee workstation */
@keyframes builderBlockExit {
  from { transform: translateX(660px); opacity: 0; }
  6%   { opacity: 1; }
  70%  { opacity: 1; }
  85%  { opacity: 0; }
  to   { transform: translateX(-140px); opacity: 0; }
}
@keyframes builderSegMove {
  from { transform: translateX(760px); }
  to   { transform: translateX(-80px); }
}
@keyframes builderSparkBurst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  35%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.15); opacity: 0; }
}

/* Smoke particles — out the top of the nozzle */
.smoke-particles {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-86%);
  width: 180px;
  height: 160px;
  pointer-events: none;
  z-index: 2;
}
.smoke-puff {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(210,210,230,0.85) 0%, rgba(190,190,210,0.5) 40%, transparent 70%);
  opacity: 0;
  animation: smokePuff var(--dur, 2.5s) ease-out var(--delay, 0s) infinite;
}
@keyframes smokePuff {
  0%   { transform: translate(var(--ox, 0), 0) scale(0.15); opacity: 1; }
  30%  { transform: translate(calc(var(--ox, 0) * 0.6), -40px) scale(0.6); opacity: 0.9; }
  65%  { transform: translate(calc(var(--ox, 0) * 0.3), -90px) scale(1.8); opacity: 0.5; }
  100% { transform: translate(0, -150px) scale(3.5); opacity: 0; }
}

/* ── NOTES DRAWER ── */
.notes-drawer {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: 720px;
  max-width: calc(100vw - 48px);
  z-index: 7000;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--accent-dim);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
  visibility: hidden;
}
.notes-drawer.active {
  transform: translateX(-50%) translateY(0%);
  pointer-events: all;
  visibility: visible;
}
.notes-drawer-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notes-drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.notes-drawer-sub {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}
.notes-drawer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.notes-drawer-ta {
  background: var(--surface2);
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 21px;
  padding: 12px 16px;
  resize: none;
  outline: none;
  height: 280px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.notes-drawer-ta:focus { background: var(--surface3); }

/* ── ROUND HISTORY MODAL ── */
.hist-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.hist-modal-overlay.active {
  display: flex;
}
.hist-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hist-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
  gap: 16px;
}
.hist-modal-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hist-modal-bee {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
  flex-shrink: 0;
  margin-bottom: -60px;
}
.hist-modal-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.hist-modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.hist-modal .round-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* ══════════════════════════════════════
   FINISH MODAL
══════════════════════════════════════ */

.finish-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  overflow-y: auto;
}
/* When modal content is taller than viewport, stick to top */
.finish-modal-overlay.active {
  display: flex;
  align-items: flex-start;
}

.finish-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 48px 36px;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.finish-modal-bee {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.finish-modal-logo {
  width: 288px;
  height: 288px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(245,166,35,0.5));
}

.finish-modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.finish-modal-msg {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

.finish-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.finish-modal-btn {
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.finish-modal-btn-export {
  border: 1px dashed var(--accent);
  color: var(--accent);
}
.finish-modal-btn-export:hover {
  background: var(--accent-dim);
  border-style: solid;
}

.finish-modal-btn-new {
  border: 1px dashed var(--green);
  color: var(--green);
}
.finish-modal-btn-new:hover {
  background: var(--green-dim);
  border-style: solid;
}

.finish-modal-footer-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.finish-modal-cancel {
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 16px;
  transition: all 0.12s;
  font-family: var(--font);
}
.finish-modal-cancel:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ══════════════════════════════════════
   LICENSE BADGE + MODAL
══════════════════════════════════════ */

.license-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: none;
  color: #e8ecf4;
  background: #c0152a;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
  box-shadow: 0 0 8px rgba(192,21,42,0.5);
}
.license-badge:hover { background: #e01830; box-shadow: 0 0 12px rgba(192,21,42,0.7); }
.license-badge.licensed {
  background: var(--green-dim);
  border: 1px solid var(--green);
  color: var(--green);
  box-shadow: none;
  cursor: default;
}
.license-badge.licensed:hover { background: var(--green-dim); }

.license-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.license-modal-overlay.active { display: flex; }

.license-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(245,166,35,0.12);
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.license-modal-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(245,166,35,0.5));
}
.license-modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.license-modal-msg {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}
.license-modal-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 14px;
  outline: none;
  text-align: center;
  letter-spacing: 0.05em;
  transition: border-color 0.15s;
}
.license-modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.license-modal-error {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
}
.license-modal-btn {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0c12;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.license-modal-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,166,35,0.35);
}
.license-modal-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.license-modal-buy {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s;
}
.license-modal-buy:hover { color: var(--accent); }

/* ── DOC STATS ── */
.doc-stats {
  font-size: 11px;
  color: var(--accent);
  font-family: var(--font-mono);
  white-space: nowrap;
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.doc-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 12px 4px;
  min-height: 20px;
  background: rgba(0,0,0,0.4);
}
[data-theme="light"] .doc-stats-row { background: #ffffff; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .doc-stats-row { background: #ffffff; }
}
[data-theme="light"] .doc-stats {
  color: var(--accent);
  border-color: var(--accent);
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .doc-stats { color: var(--accent); border-color: var(--accent); }
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .doc-stats { color: var(--accent); border-color: var(--border); }
}

/* ── PDF RE-EXTRACT BANNER ── */
.reextract-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(245,166,35,0.08);
  border-bottom: 1px solid rgba(245,166,35,0.3);
  flex-shrink: 0;
  flex-wrap: wrap;
}
[data-theme="light"] .reextract-banner {
  background: rgba(245,166,35,0.06);
  border-bottom-color: rgba(245,166,35,0.4);
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .reextract-banner {
    background: rgba(245,166,35,0.06);
    border-bottom-color: rgba(245,166,35,0.4);
  }
}
.reextract-banner-text {
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
}
[data-theme="light"] .reextract-banner-text { color: #4b5563; }
@media (prefers-color-scheme: light) {
  [data-theme="auto"] .reextract-banner-text { color: #4b5563; }
}
.reextract-dismiss {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.12s;
}
.reextract-dismiss:hover { color: var(--text); }

/* ══════════════════════════════════════
   UTILITY CLASSES
══════════════════════════════════════ */
.flex-row           { display: flex; gap: 6px; }
.flex-row-sm        { display: flex; gap: 4px; }
.link-accent        { color: var(--accent); text-decoration: none; transition: all 0.12s; }
.link-accent:hover  { color: var(--accent-hover); text-decoration: underline; }

.bee-btn-img { width: 48px; height: 48px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.full-width         { width: 100%; }
.change-builder-modal {
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* ── Round Error Modal ── */
.round-error-modal       { max-width: 520px; }
.round-error-title       { color: var(--warn, #fbbf24); }
.round-error-body        { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.round-error-msg         { font-size: 15px; line-height: 1.6; margin: 0; color: var(--text); }
.round-error-details     { font-family: var(--font-mono); font-size: 12px; background: var(--surface2, rgba(0,0,0,0.2)); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-dim); line-height: 1.7; display: none; }
.round-error-details.visible { display: block; }
.round-error-note        { font-size: 12px; color: var(--text-dim); background: var(--accent-dim); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 12px; line-height: 1.6; }
.round-error-actions     { display: flex; gap: 10px; margin-bottom: 12px; }
.round-error-retry-btn   { flex: 1; }
.round-error-builder-btn { flex: 1; }
[data-theme="light"] .round-error-details { background: rgba(0,0,0,0.06); }

/* ── LAUNCH REQUIREMENTS ── */
.launch-requirements {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 16px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: center;
}
.launch-req-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dim);
  white-space: nowrap;
}
.launch-req-item {
  white-space: nowrap;
  color: var(--red, #f87171);
  font-weight: 600;
  transition: color 0.2s;
}
.launch-req-item.met {
  color: #00b300;
}

/* ══════════════════════════════════════
   HELPER PAGES
   tokens-explainer, api-details, prompt-editor
══════════════════════════════════════ */

/* ── Helper page body ── */
.helper-body {
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: auto;
}
.helper-body a { color: var(--accent); text-decoration: none; transition: all 0.12s; }
.helper-body a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Close button (helper pages) ── */
.close-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px dashed var(--border2);
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-family: var(--font); font-size: 13px;
  padding: 8px 16px; cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.close-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Helper page header ── */
.page-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface2);
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.page-header-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.page-header-logo {
  width: 80px; height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(245,166,35,0.4));
  flex-shrink: 0;
}
.page-header-name {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  color: var(--text); line-height: 1;
}
.page-header-tag {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; margin-top: 2px;
}
.page-header-spacer {
  width: 80px;
  flex-shrink: 0;
}
.page-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Helper page layout ── */
.page-main { flex: 1; display: flex; flex-direction: column; }
.api-intro-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 16px 0;
  justify-content: center;
}
.api-intro-bee-wrap {
  flex-shrink: 0;
}
.api-intro-text { max-width: 520px; }
.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 16px 16px 16px; gap: 32px;
  flex: 1;
}
.col {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-md); padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; padding: 12px; }
  .page-header { padding: 14px 20px; }
}

/* ── Column bee (tokens/api left column) ── */
.col-bee {
  display: block;
  width: 260px; height: 260px;
  object-fit: contain;
  margin: 0 auto 4px;
  align-self: center;
  flex-shrink: 0;
  padding-top: 12px;
  pointer-events: none;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
}

/* ── Section title ── */
.section-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

/* ── Cards (tokens page) ── */
.card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 22px;
}
.card.accent { border-left: 4px solid var(--accent); }
.card.amber  { border-left: 4px solid var(--amber); }
.card.green  { border-left: 4px solid var(--green); padding: 0; overflow: hidden; }
.card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.card p { color: var(--text-dim); font-size: 14px; line-height: 1.75; margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card strong { color: var(--text); }

/* ── Table (tokens page) ── */
.ai-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ai-table th {
  text-align: left; color: var(--muted); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 10px 14px; border-bottom: 1px solid var(--border2); background: var(--surface2);
}
.ai-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
.ai-table tr:last-child td { border-bottom: none; }
.ai-table strong { color: var(--text); }

/* ── Info cards (api page) ── */
.info-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md); padding: 16px 20px;
}
.info-card.green {
  background: var(--green-dim); border: 1px solid var(--green);
  border-left: 4px solid var(--green);
}
.info-card h2 { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.info-card h3 { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--green); }
.info-card p { color: var(--text-dim); font-size: 14px; line-height: 1.7; margin-bottom: 8px; }
.info-card p:last-child { margin-bottom: 0; }

/* ── AI cards (api page) ── */
.ai-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ai-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface3);
}
.ai-card-header img { border-radius: 6px; height: 28px; width: 28px; object-fit: contain; flex-shrink: 0; }
.ai-card-name { flex: 1; font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.ai-card-body { padding: 14px; }
.badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.badge-free    { background: var(--green-dim); border: 1px solid var(--green); color: var(--green); }
.badge-paid    { background: var(--amber-dim); border: 1px solid var(--amber); color: var(--amber); }
.badge-limited { background: var(--blue-dim);  border: 1px solid var(--blue);  color: var(--blue); }

/* ── Steps (api page) ── */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 7px; list-style: none; padding-left: 0; }
.steps li {
  position: relative;
  padding-left: 30px;
  color: var(--text-dim); counter-increment: step; font-size: 13px; line-height: 1.6;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 50%; color: var(--accent); font-size: 10px; font-weight: 700;
}

/* ── Note boxes (api page) ── */
.note-box {
  background: var(--amber-dim); border: 1px solid var(--amber);
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-size: 13px; margin-top: 10px; padding: 10px 13px; line-height: 1.6;
}
.note-box.green { background: var(--green-dim); border-color: var(--green); }

/* ── Model line (api page) ── */
.model-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 11px;
  margin-bottom: 12px; padding: 7px 11px;
}
.model-label { color: var(--muted); font-weight: 600; flex-shrink: 0; }
.model-note { color: var(--muted); }

/* ── Prompt editor save bar ── */
.save-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 16px 24px; flex-shrink: 0; gap: 16px;
}
.save-bar-left { display: flex; align-items: center; gap: 20px; }
.save-bar-center { display: none; }
.save-bar-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }
.save-bar-bee {
  width: 180px; height: 180px; object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
  flex-shrink: 0;
}
.save-bar-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.save-bar-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Prompt editor groups ── */
.prompts-grid { display: flex; flex-direction: column; gap: 16px; }
.prompt-group {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-md); overflow: hidden;
}
.prompt-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.prompt-group-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text); }
.prompt-group-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.prompt-group-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.badge-reviewer { background: var(--blue-dim); border: 1px solid var(--blue); color: var(--blue); }
.badge-builder  { background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent); }
.prompt-block { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.prompt-block:last-child { border-bottom: none; }
.prompt-block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.prompt-block-label { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.prompt-block-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.prompt-reset-btn {
  font-size: 11px; background: transparent; border: 1px dashed var(--border2);
  border-radius: 4px; color: var(--muted); padding: 3px 8px; cursor: pointer;
  transition: all 0.12s; font-family: var(--font);
}
.prompt-reset-btn:hover { border-color: var(--red); color: var(--red); }
.prompt-ta {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-mono);
  font-size: 12px; line-height: 1.7; padding: 12px 14px; resize: vertical;
  outline: none; transition: border-color 0.15s; min-height: 180px;
}
.prompt-ta:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.prompt-ta.modified { border-color: var(--accent); }
.modified-badge {
  display: none; font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; background: var(--accent-dim); border: 1px solid var(--accent);
  color: var(--accent); margin-left: 8px;
}
.modified-badge.show { display: inline-block; }

/* ── Status toast (prompt editor) ── */
.status-toast {
  display: none; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; padding: 6px 14px;
  border-radius: var(--radius-sm); border: 1px solid;
}
.status-toast.show { display: inline-flex; }
.status-toast.saved { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.status-toast.reset { background: var(--red-dim); border-color: var(--red); color: var(--red); }

.hist-resp-panel { display: none; flex: 1; min-height: 0; }
.hist-resp-panel.active { display: flex; flex-direction: column; }
.hist-resp-tab.active { background: var(--accent) !important; border-color: var(--accent) !important; color: #0a0c12 !important; font-weight: 700 !important; cursor: default; }

/* ── Shared footer (helper pages) ── */
.page-footer {
  background: var(--surface2);
  padding: 14px 32px; margin-top: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-shrink: 0;
}
.page-footer-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.api-intro-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
}
.api-intro-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}
.helper-note-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.helper-note-card .helper-note {
  margin: 0;
}
.helper-info-img {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto;
}
.helper-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 8px;
}
.card-push-bottom {
  margin-top: auto;
}
.footer-note { color: var(--text-dim); font-size: 13px; }


/* =========================================
   WAXFRAME FINISH ANIMATION — Bee Fly-In
   ========================================= */

.hive-finish-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}
.hive-finish-overlay.is-active {
  opacity: 1;
  visibility: visible;
}
.hive-finish-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(244,185,66,0.06) 0%, rgba(10,10,12,0) 60%),
              linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.55));
  backdrop-filter: blur(2px);
}
.hive-finish-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hive-finish-smoke {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hive-smoke-particle {
  position: absolute;
  bottom: 10%;
  left: 50%;
  width: var(--size);
  height: var(--size);
  margin-left: calc(var(--size) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.7), rgba(255,255,255,0.2) 52%, rgba(255,255,255,0) 72%);
  filter: blur(10px);
  opacity: 0;
  animation: hiveSmokeRise var(--dur) ease-out forwards;
}
.hive-finish-bee-img {
  position: relative;
  width: min(85vw, 580px);
  height: auto;
  opacity: 0;
  transform: translateX(-120vw) rotate(-12deg);
  filter: drop-shadow(0 0 40px rgba(244,185,66,0.5)) drop-shadow(0 20px 60px rgba(0,0,0,0.5));
  z-index: 2;
}
.hive-finish-overlay.is-active .hive-finish-bee-img {
  animation: hiveBeeSwingIn 900ms cubic-bezier(.18,.89,.32,1.28) 100ms forwards;
}
.hive-finish-tagline {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display, sans-serif);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent, #f5a623);
  text-shadow: 0 0 20px rgba(244,185,66,0.6), 0 2px 8px rgba(0,0,0,0.8);
  opacity: 0;
  white-space: nowrap;
}
.hive-finish-overlay.is-active .hive-finish-tagline {
  animation: hiveTaglineFade 600ms ease-out 700ms forwards;
}
@keyframes hiveBeeSwingIn {
  0%   { opacity: 0; transform: translateX(-120vw) rotate(-12deg) scale(0.8); }
  60%  { opacity: 1; transform: translateX(8px) rotate(3deg) scale(1.05); }
  80%  { transform: translateX(-4px) rotate(-1deg) scale(1.02); }
  100% { opacity: 1; transform: translateX(0) rotate(0deg) scale(1); }
}
@keyframes hiveTaglineFade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes hiveSmokeRise {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.72); }
  12%  { opacity: var(--opacity, 0.35); }
  100% { opacity: 0; transform: translate3d(var(--x, 0), var(--y, -240px), 0) scale(1.55); }
}
@media (prefers-reduced-motion: reduce) {
  .hive-finish-overlay, .hive-finish-overlay * { animation: none !important; transition: none !important; }
  .hive-finish-overlay.is-active { opacity: 1; visibility: visible; }
  .hive-finish-bee-img, .hive-finish-tagline { opacity: 1 !important; transform: none !important; }
}

/* ══════════════════════════════════════
   DEV TOOLBAR — dev mode only
   ══════════════════════════════════════ */
.dev-toolbar {
  position: fixed;
  top: 80px;
  right: 160px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,12,18,0.92);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  box-shadow: 0 0 12px rgba(245,166,35,0.3);
  pointer-events: all;
  user-select: none;
}
.dev-toolbar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-right: 4px;
  border-right: 1px solid var(--border2);
  margin-right: 2px;
  cursor: grab;
}
.dev-toolbar-label:active {
  cursor: grabbing;
}
.dev-toolbar button {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.dev-toolbar button:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}


/* ══════════════════════════════════════
   MOBILE NOT SUPPORTED OVERLAY
   Hidden on desktop, shown on small screens.
   No JS required — pure CSS media query.
══════════════════════════════════════ */
.mobile-overlay {
  display: none;
}

@media (max-width: 768px) {
  .mobile-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg, #0d0f17);
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  /* Hide everything else behind the overlay */
  body > *:not(.mobile-overlay) {
    display: none !important;
  }
}

.mobile-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 320px;
}
.mobile-overlay-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 4px;
}
.mobile-overlay-title {
  font-family: var(--font, sans-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text, #e8eaf0);
  margin: 0;
  letter-spacing: 0.5px;
}
.mobile-overlay-msg {
  font-family: var(--font, sans-serif);
  font-size: 16px;
  color: var(--text, #e8eaf0);
  margin: 0;
  line-height: 1.5;
}
.mobile-overlay-sub {
  font-family: var(--font, sans-serif);
  font-size: 14px;
  color: var(--text-dim, #8b90a0);
  margin: 0;
  line-height: 1.5;
}
.mobile-overlay-link {
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 12px;
  color: var(--accent, #f5a623);
  text-decoration: none;
  margin-top: 8px;
  opacity: 0.8;
}
.mobile-overlay-link:hover {
  opacity: 1;
  text-decoration: underline;
}


/* ══════════════════════════════════════
   INLINE STYLE MIGRATIONS
   All classes moved from inline styles in index.html / app.js
══════════════════════════════════════ */

/* ── Info button images ── */
.info-btn-img    { width: 22px; height: 22px; display: block; }
.info-btn-img-lg { width: 36px; height: 36px; display: block; }

/* ── Tip icon images (inline in paragraph text) ── */
.tip-icon-img { width: 18px; height: 18px; vertical-align: middle; margin-right: 4px; }

/* ── Goal field — counter row ── */
.goal-counter-row  { display: flex; justify-content: flex-start; align-items: center; gap: 4.5em; margin-bottom: 0; width: 100%; }
.goal-counter-text { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

/* ── Goal field — refine preview box ── */
.goal-refine-preview-hdr   { background: var(--accent-dim); padding: 5px 10px; display: flex; justify-content: space-between; align-items: center; }
.goal-refine-preview-label { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; }
.goal-refine-preview-count { font-size: 11px; color: var(--accent); font-family: var(--font-mono); }
.goal-refine-preview-text  { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--text-dim); padding: 8px 10px; white-space: normal; word-break: break-word; }

/* ── Left column layout — static top, flex goal area ── */
.proj-left-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.proj-left-scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.proj-static-top {
  flex-shrink: 0;
  padding: 20px 28px 12px;
}
.proj-static-top .fs-col-header { margin-bottom: 12px; }
.proj-static-top .project-fields { margin-top: 10px; margin-bottom: 8px; }

.proj-goal-flex {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 28px 0;
}

/* ── Goal split layout ── */
.goal-split-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex: 1;
  min-height: 0;
}
.goal-split-left {
  flex: 3;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.goal-split-right {
  flex: 1;
  min-width: 160px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.goal-refine-preview-panel {
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.goal-refine-preview-sub {
  font-size: 11px;
  color: var(--accent);
  opacity: 0.8;
  line-height: 1.5;
  padding: 6px 10px 4px;
  margin: 0;
  border-bottom: 1px dashed rgba(245,166,35,0.2);
  font-style: italic;
}
.goal-refine-preview-panel .goal-refine-preview-text {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(245,166,35,0.4) transparent;
}
/* ── Inline style replacements ── */
.goal-modal-textarea:focus  { border-color: var(--accent); }
.goal-modal-refine-wrap     { margin-top: 10px; }
.text-green                 { color: #00b300; }
.text-accent                { color: var(--accent); }
.text-warn                  { color: #fbbf24; }
.text-error                 { color: #f87171; }
.text-send                  { color: #60a5fa; }
.text-preview               { color: #a78bfa; }
.text-divider               { color: #f5a623; }

.goal-refine-preview-empty {
  padding: 12px 10px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.7;
  font-style: italic;
  line-height: 1.6;
}
.proj-clear-row--bottom {
  flex-shrink: 0;
  padding: 10px 0 16px;
  border-top: 1px dashed var(--border);
  margin-top: 10px;
}

/* ── Work topbar — project info clickable ── */
.work-project-info-clickable { cursor: pointer; }

/* ── Finish modal extras ── */
.finish-history-row        { display: flex; gap: 8px; align-items: center; }
.finish-modal-btn-transcript { border-color: var(--blue) !important; color: var(--blue) !important; }
.finish-modal-goal         { max-width: 600px; text-align: left; }
.finish-modal-title-goal   { margin-bottom: 6px; }
.finish-modal-cancel-accent { border-color: var(--accent) !important; color: var(--accent) !important; }

/* ── Project goal modal ── */
.goal-modal-name         { font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.goal-modal-meta         { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.goal-modal-label        { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.goal-modal-label-note   { font-style: italic; font-weight: 400; }
.goal-modal-textarea     { width: 100%; min-height: 160px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--text); background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 14px; resize: vertical; outline: none; box-sizing: border-box; transition: border-color 0.15s; }
.goal-modal-refine-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.goal-modal-refine-text  { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--text-dim); background: var(--surface2); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 14px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; }
.goal-modal-footer       { display: flex; gap: 10px; margin-top: 16px; align-items: center; }

/* ── About modal logo ── */
.about-modal-logo { width: 80px; height: 80px; object-fit: contain; margin-bottom: 8px; }

/* ── Goal info modal icon ── */
.goal-info-modal-icon { width: 72px; height: 72px; }

/* ── Builder picker card ── */
.builder-pick-card-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; }
.builder-pick-icon       { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.builder-pick-name       { font-size: 12px; font-weight: 700; }
.builder-pick-current    { font-size: 10px; color: var(--accent); }

/* ── Continue to project button bee image ── */
.btn-bee-img { width: 36px; height: 36px; object-fit: contain; vertical-align: middle; margin-right: 8px; }

/* ── Convergence card extras ── */
.convergence-count-badge { margin-left: 8px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── Decision option num span variants ── */
/* Default (unselected): all num spans use base .decision-opt-num colours */
/* Apply — green when selected via .decision-opt-btn.selected */
/* Decline/Custom/Bypass — dim by default, styled on selected via existing CSS */
.decision-opt-num-decline,
.decision-opt-num-custom,
.decision-opt-num-bypass { background: var(--surface3); color: var(--muted); }

/* Apply starts dim like the others — goes green only on .selected */
.decision-opt-num-apply  { background: var(--surface3); color: var(--muted); }
.decision-opt-btn.selected .decision-opt-num-apply   { background: rgba(0,179,0,0.15); color: #00b300; }
.decision-opt-btn.selected .decision-opt-num-decline { background: rgba(248,113,113,0.15); color: #f87171; }
.decision-opt-btn.selected .decision-opt-num-custom  { background: rgba(245,166,35,0.15); color: var(--amber); }
.decision-opt-btn.selected .decision-opt-num-bypass  { background: rgba(255,255,255,0.08); color: var(--text-dim); }

/* ── Decision option dim text (custom / bypass labels) ── */
.decision-opt-text-dim { color: var(--muted); font-style: italic; }

/* ── Raw conflict fallback labels ── */
.raw-conflict-ud { color: var(--amber); font-weight: 700; }
.raw-conflict-bd { color: var(--blue);  font-weight: 700; }

/* ── View round doc tab layout ── */
.view-round-tab-row { display: flex; gap: 6px; }
.view-round-tab-bar { display: flex; gap: 6px; padding: 10px 16px; flex-wrap: wrap; background: var(--surface2); flex-shrink: 0; border-bottom: 1px solid var(--border); }

.goal-info-modal-icon-wrap { text-align: center; margin-bottom: 8px; }

/* ── Helper pages — tip icon image (20px, used in wh-tip-icon / kyh-tip-icon) ── */
.helper-tip-icon-img { width: 20px; height: 20px; display: block; }

/* ── api-details.html — General Tips section ── */
.info-card-tips      { margin-top: 32px; }
.kyh-tips-title      { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.kyh-tips-p          { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 10px; }
.kyh-tips-p-last     { margin-bottom: 0; }
.kyh-tips-strong     { color: var(--text); }

/* ── api-details.html — Azure intro paragraph ── */
.api-azure-intro     { margin: 10px 0 6px; }

/* ── Finish modal button subtitles ── */
.finish-modal-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.finish-modal-btn-sub { font-size: 11px; font-weight: 400; opacity: 0.7; line-height: 1.4; }
.finish-modal-btn-snapshot { border-color: #00b300 !important; color: #00b300 !important; }
.finish-modal-btn-new { flex-direction: row; gap: 8px; }

/* ── Finish modal button disabled / done states ── */
.finish-modal-btn-disabled {
  border-color: #f87171 !important;
  color: #f87171 !important;
  opacity: 0.55;
  cursor: not-allowed;
}
.finish-modal-btn-disabled:hover {
  background: transparent !important;
}
.finish-modal-btn-done {
  opacity: 0.5;
  cursor: default;
}

/* ── Bee card — no changes needed star ── */
.hex-cell.is-clean .hex-status,
.hex-cell.is-clean {
  border-color: #00b300;
  position: relative;
}
.hex-cell.is-clean::after {
  content: '★';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: var(--accent);
  opacity: 0.85;
  pointer-events: none;
  line-height: 1;
}
[data-theme="light"] .hex-cell.is-clean::after,
[data-theme="auto"] .hex-cell.is-clean::after { color: #d97706; opacity: 1; }


/* ── USER MANUAL PAGE (waxframe-user-manual.html) ── */
.wh-intro { display:flex; align-items:center; gap:24px; background:var(--surface); border:1px solid var(--border2); border-radius:var(--radius-lg); padding:24px 28px; margin-bottom:32px; }
.wh-intro-text h2 { font-family:var(--font-display); font-size:20px; font-weight:800; color:var(--text); margin-bottom:6px; }
.wh-intro-text p { font-size:14px; color:var(--text-dim); line-height:1.6; margin:0; }
.wh-bee { width:80px; flex-shrink:0; }

.wh-toc { background:var(--surface); border:1px solid var(--border2); border-radius:var(--radius-lg); padding:20px 24px; margin-bottom:32px; }
.wh-toc-title { font-family:var(--font-display); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:var(--accent); margin-bottom:12px; }
.wh-toc-list { display:flex; flex-wrap:wrap; gap:8px; }
.wh-toc-link { font-size:13px; color:var(--text-dim); text-decoration:none; padding:4px 12px; border:1px dashed var(--border2); border-radius:20px; transition:all 0.12s; }
.wh-toc-link:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-dim); }

.wh-section { margin-bottom:32px; scroll-margin-top:72px; }
.wh-section-hdr { display:flex; align-items:center; gap:14px; margin-bottom:16px; padding-bottom:10px; border-bottom:1px solid var(--border2); }
.wh-section-icon { font-size:24px; width:40px; text-align:center; flex-shrink:0; }
.wh-section-title { font-family:var(--font-display); font-size:17px; font-weight:800; color:var(--text); }

.wh-block { background:var(--surface); border:1px solid var(--border2); border-radius:var(--radius-lg); padding:18px 22px; margin-bottom:12px; }
.wh-block-title { font-family:var(--font-display); font-size:14px; font-weight:700; color:var(--text); margin-bottom:8px; }
.wh-block p { font-size:13px; color:var(--text-dim); line-height:1.7; margin:0 0 8px; }
.wh-block p:last-child { margin-bottom:0; }

.wh-tip { display:flex; gap:10px; align-items:flex-start; background:var(--accent-dim); border:1px solid rgba(245,158,11,0.3); border-radius:var(--radius-md); padding:12px 14px; margin-top:10px; }
.wh-tip-icon { flex-shrink:0; margin-top:1px; display:flex; align-items:center; }
.wh-tip p { font-size:12px; color:var(--text-dim); line-height:1.5; margin:0; font-style:italic; }

.wh-warn { display:flex; gap:10px; align-items:flex-start; background:rgba(239,68,68,0.07); border:1px solid rgba(239,68,68,0.3); border-radius:var(--radius-md); padding:12px 14px; margin-top:10px; }
.wh-warn p { font-size:12px; color:#f87171; line-height:1.5; margin:0; }

.wh-table { width:100%; border-collapse:collapse; font-size:12px; margin-top:10px; margin-bottom:4px; }
.wh-table th { background:var(--bg3); color:var(--text); font-weight:700; text-align:left; padding:7px 10px; border:1px solid var(--border2); }
.wh-table td { padding:6px 10px; border:1px solid var(--border2); color:var(--text-dim); vertical-align:top; line-height:1.5; }
.wh-table tr:nth-child(even) td { background:var(--bg2); }
.wh-table td code { font-family:Courier New,monospace; font-size:11px; background:var(--bg3); padding:1px 4px; border-radius:3px; }

.wh-steps { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.wh-step { display:flex; gap:12px; align-items:flex-start; font-size:13px; color:var(--text-dim); line-height:1.6; }
.wh-step-num { background:var(--accent); color:#0a0c12; font-size:11px; font-weight:800; border-radius:50%; width:22px; height:22px; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; font-family:var(--font-display); }

.wh-tag { display:inline-block; font-size:11px; font-weight:700; padding:2px 8px; border-radius:20px; letter-spacing:0.04em; margin-right:4px; }
.wh-tag-amber { background:var(--accent-dim); border:1px solid var(--accent); color:var(--accent); }
.wh-tag-green { background:rgba(0,179,0,0.12); border:1px solid rgba(0,179,0,0.4); color:#00b300; }
.wh-tag-red { background:rgba(239,68,68,0.08); border:1px solid rgba(239,68,68,0.4); color:#f87171; }

.wh-back-top { display:block; text-align:right; font-size:12px; color:var(--text-dim); text-decoration:none; padding:6px 0 2px; transition:color 0.12s; }
.wh-back-top:hover { color:var(--accent); }

.print-header { display:none; text-align:center; padding:16px 0 24px; border-bottom:2px solid #ccc; margin-bottom:24px; }
.print-header-title { font-size:22px; font-weight:800; color:#111; margin-bottom:4px; }
.print-header-sub { font-size:13px; color:#666; }

[data-theme="light"] .wh-intro,
[data-theme="light"] .wh-toc,
[data-theme="light"] .wh-block { background:#ffffff; }
[data-theme="light"] .wh-back-top { color:#333; }
[data-theme="light"] .wh-back-top:hover { color:var(--accent); }
@media (prefers-color-scheme:light) {
  [data-theme="auto"] .wh-intro,
  [data-theme="auto"] .wh-toc,
  [data-theme="auto"] .wh-block { background:#ffffff; }
  [data-theme="auto"] .wh-back-top { color:#333; }
  [data-theme="auto"] .wh-back-top:hover { color:var(--accent); }
}

@media print {
  body { background:#fff !important; color:#111 !important; }
  .page-header, .page-footer, .wh-back-top { display:none !important; }
  .page-main { padding:0 !important; max-width:100% !important; }
  .wh-intro, .wh-toc, .wh-block { background:#fff !important; border:1px solid #ccc !important; box-shadow:none !important; break-inside:avoid; }
  .wh-section { break-inside:avoid; }
  .wh-section-title, .wh-block-title { color:#111 !important; }
  .wh-toc-link { color:#333 !important; border-color:#ccc !important; }
  .wh-tip { background:#fffbea !important; border-color:#e5c84a !important; }
  .wh-tip p, .wh-block p, .wh-step { color:#333 !important; }
  .wh-warn { background:#fff0f0 !important; }
  .wh-warn p { color:#c00 !important; }
  .wh-step-num { background:#b87a00 !important; color:#fff !important; }
  code { background:#f0f0f0 !important; color:#333 !important; }
  a { color:#333 !important; text-decoration:none !important; }
  .print-header { display:block !important; }
}

/* ============================================================
   DEV TOOLS NAV ITEM
   ============================================================ */
.nav-item-dev {
  color: var(--accent);
  opacity: 0.6;
  font-size: 11px;
}
.nav-item-dev:hover { opacity: 1; }
.nav-item-accent {
  color: var(--accent);
  font-weight: 700;
}
.nav-item-accent:hover {
  background: var(--accent) !important;
  color: #000 !important;
}
.nav-dev-section { display: none; }
.nav-dev-section.active { display: block; }
.nav-item-exit-dev {
  color: var(--danger, #c0392b);
  opacity: 0.6;
  font-size: 11px;
}
.nav-item-exit-dev:hover { opacity: 1; }

/* ============================================================
   DEV PASSWORD MODAL
   ============================================================ */
.dev-pw-modal {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.dev-pw-modal .license-modal-input {
  width: 100%;
}

/* ============================================================
   LICENSE UNLOCK SCENE
   ============================================================ */
.unlock-scene {
  position: fixed;
  inset: 0;
  background: rgb(0,0,0);
  z-index: 999998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  gap: 32px;
  transition: opacity 0.4s ease;
}
.unlock-scene.active { pointer-events: all; }
.unlock-stage {
  position: relative;
  width: 480px;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unlock-logo {
  width: 440px;
  height: 440px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  transition: opacity 0.2s ease;
}
.unlock-canvas {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
}
.unlock-bee {
  position: fixed;
  width: 380px;
  height: 380px;
  object-fit: contain;
  top: calc(50% - 580px);
  right: -400px;
  z-index: 999999;
  opacity: 0;
}
.unlock-title {
  font-family: 'Syne', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(12px);
}
.unlock-sub {
  font-size: 19px;
  color: rgba(255,255,255,0.75);
  opacity: 0;
  transform: translateY(8px);
  margin-top: -20px;
}

/* ══ TEST ALL KEYS PANEL ══ */
.test-keys-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 360px;
  max-height: 420px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 9000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.test-keys-panel.active { display: flex; }
.tkp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tkp-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.tkp-dismiss {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.12s;
  display: none;
}
.tkp-dismiss.tkp-done { display: block; }
.tkp-dismiss:hover { border-color: var(--accent); color: var(--accent); }
.tkp-rows {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}
.tkp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.tkp-row:last-child { border-bottom: none; }
.tkp-ai-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.tkp-status {
  font-size: 11px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkp-pending { color: var(--text-dim); }
.tkp-pass { color: var(--green, #00b300); }
.tkp-fail { color: var(--red, #e53e3e); }

/* ══ SETUP PAGE 2 LAPTOP FIXES ══ */
@media (max-width: 1600px) {
  /* Shrink bee on setup pages to recover vertical space */
  .setup-card-bee {
    width: 160px;
    height: 160px;
    padding-top: 6px;
  }
  /* Compress footer padding at laptop size */
  .fs-footer {
    padding: 8px 24px;
  }
  /* Ensure left scroll column scrolls visibly */
  .fs-col-scroll {
    padding: 14px 20px 24px;
  }
}

/* ══ AI SETUP ROW — model-select alignment fix ══ */
/* model-select-wrap now aligns to the key row indent, not the old icon+110px name offset */
.model-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 0 24px;
  width: 100%;
  flex-shrink: 0;
  flex-wrap: wrap;
  box-sizing: border-box;
}

/* ══ IMPORT SERVER CHECKLIST OVERLAY ══ */
.import-checklist-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: var(--bg);
  display: none;
  flex-direction: column;
}
.import-checklist-overlay.active { display: flex; }
.import-checklist-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
.import-checklist-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
  gap: 16px;
  flex-wrap: wrap;
}
.import-checklist-hdr-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.import-checklist-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.import-checklist-count {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.import-checklist-hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.import-checklist-close-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.12s;
}
.import-checklist-close-btn:hover { border-color: var(--accent); color: var(--accent); }
.import-checklist-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.import-checklist-items {
  display: flex;
  flex-direction: column;
}
.import-checklist-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface2);
  border-top: 1px solid var(--border2);
  flex-shrink: 0;
}
