/* build/tuning.css
 * ---------------------------------------------------------------
 * Blank-canvas tuning page chrome. Phase A.2a.
 *
 * Goal (per bud, 2026-05-12):
 *   - Same cyberpunk look as welcome.html, but using the new
 *     tuning-bg.png (shop / Scarecrow lift scene).
 *   - LIGHTER vignette so the image stays fully visible.
 *   - Floating ARC-TUNING wordmark at the top — no bar behind it.
 *   - Everything BELOW the header is a true blank canvas.
 *
 * No JS attached on purpose. View at:
 *   http://localhost:8787/tuning.html
 * --------------------------------------------------------------- */

:root {
  --bg: #060606;
  --ink: #e8e6e0;
  --bit-cool: rgba(120, 220, 255, 0.95);
  --bit-warm: rgba(180, 255, 200, 1);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: #060606;
  background-image: url('bg/tuning-bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow-x: hidden;
}

/* LIGHTER vignette — image stays the hero. Just a soft darken at the
   corners so future on-screen text has a hint of contrast. */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0)     0%,
    rgba(0, 0, 0, 0.12) 70%,
    rgba(0, 0, 0, 0.40) 100%);
}

/* Floating ARC-TUNING wordmark at top — no bar, no panel, just glow.
   2026-05-12 update (bud):
     - 300% larger (~3x font-size)
     - bold weight
     - pulsing blue glow (1.6s breath)
     - flush left instead of centered */
.arc-header {
  position: fixed;
  top: 22px;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: left;
  padding-left: 24px;
  pointer-events: none;
}
.arc-header .wordmark {
  font-family: var(--font-mono);
  font-size: clamp(48px, 6.6vw, 78px);
  font-weight: 900;
  letter-spacing: 0.32em;
  /* Near-white hot core. The blue glow lives in the shadows, not the fill. */
  color: #f4fbff;
  -webkit-text-stroke: 1px rgba(120, 200, 255, 0.55);
  user-select: none;
  /* Pulse halved to 3.2s per bud 2026-05-12 */
  animation: arc-wordmark-pulse 3.2s ease-in-out infinite;
}
/* LED neon bulb glow:
     - tight white core (the "hot tube")
     - layered cyan/blue rings (the gas glow)
     - constant 3D drop shadow underneath (lifts the text off the bg)
   Pulse swings the gas glow + opacity; the 3D drop is kept constant
   in both keyframes so the depth doesn't breathe. */
@keyframes arc-wordmark-pulse {
  0%, 100% {
    opacity: 0.88;
    text-shadow:
      /* hot tube core */
      0 0 3px  rgba(255, 255, 255, 0.85),
      0 0 6px  rgba(190, 232, 255, 0.75),
      /* mid blue gas */
      0 0 14px rgba(62, 168, 255, 0.65),
      0 0 28px rgba(62, 168, 255, 0.45),
      /* outer halo */
      0 0 60px  rgba(62, 168, 255, 0.28),
      0 0 120px rgba(62, 168, 255, 0.14),
      /* 3D depth */
      0 4px 6px  rgba(0, 0, 0, 0.55),
      0 8px 22px rgba(0, 20, 40, 0.60);
  }
  50% {
    opacity: 1;
    text-shadow:
      /* brighter hot tube core */
      0 0 5px  rgba(255, 255, 255, 1.00),
      0 0 10px rgba(190, 232, 255, 1.00),
      /* wider gas glow */
      0 0 22px rgba(62, 168, 255, 1.00),
      0 0 48px rgba(62, 168, 255, 0.85),
      /* broader halo */
      0 0 100px rgba(62, 168, 255, 0.55),
      0 0 180px rgba(62, 168, 255, 0.32),
      /* 3D depth (same as dim frame) */
      0 4px 6px  rgba(0, 0, 0, 0.55),
      0 8px 22px rgba(0, 20, 40, 0.60);
  }
}

/* Blank workspace below the header. Nothing here yet — by design.
   Future content (mode picker, pre-flight gate, stage picker, etc.)
   lands inside .canvas. */
.canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  padding-top: 180px;     /* clear the now-much-larger header */
  padding-bottom: 60px;
  display: flex;          /* lets us push the options to the bottom */
  flex-direction: column;
}

/* ============================================================
 * TUNE-ACTIONS — right-side column of action buttons.
 * Lives in every room (BASIC / TEACHING / PRO). The middle of
 * the screen stays empty on purpose (reserved for a future
 * "mirror window" panel — do not fill it in here).
 *
 * Color theme follows body[data-tune-mode] so each room's
 * buttons match its mode color.
 * ============================================================ */
.tune-actions {
  position: fixed;
  top: 180px;            /* clear of the ARC-TUNING header */
  right: 24px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 220px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  border-radius: 30px;
  border: 2px solid rgba(62, 168, 255, 0.70);
  background: linear-gradient(180deg, rgba(62,168,255,0.18) 0%, rgba(62,168,255,0.04) 100%);
  color: #3ea8ff;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(0);
  transition:
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 200ms cubic-bezier(0.22, 1, 0.36, 1),
    background 200ms,
    color 200ms,
    border-color 200ms;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 0 0 1px #3ea8ff,
    0 0 14px rgba(62,168,255,0.42),
    0 6px 18px rgba(0,0,0,0.50);
}
.action-btn:hover {
  transform: translateY(-2px);
  color: #ffffff;
  background: linear-gradient(180deg, rgba(62,168,255,0.30) 0%, rgba(62,168,255,0.10) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.26),
    0 0 0 1px #3ea8ff,
    0 0 22px rgba(62,168,255,0.65),
    0 10px 24px rgba(0,0,0,0.60);
}
.action-btn:active {
  transform: translateY(1px) scale(0.985);
}

/* BACK pill — quieter than the primary action pills. Same theme color,
   but no fill, smaller text, less glow. Used inside the picker screen. */
.action-btn.back {
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.24em;
  background: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 0 1px rgba(62,168,255,0.55),
    0 0 8px rgba(62,168,255,0.20),
    0 3px 10px rgba(0,0,0,0.40);
}
body[data-tune-mode="teaching"] .action-btn.back {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 0 1px rgba(63,185,80,0.55),
    0 0 8px rgba(63,185,80,0.20),
    0 3px 10px rgba(0,0,0,0.40);
}
body[data-tune-mode="pro"] .action-btn.back {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 0 1px rgba(255,69,69,0.55),
    0 0 8px rgba(255,69,69,0.20),
    0 3px 10px rgba(0,0,0,0.40);
}

/* ============================================================
 * UPLOAD DROP-ZONE — appears in the right column when the user
 * picks UPLOAD CSV. Wider than the other screens to give a real
 * dropping target. Theme-aware via body[data-tune-mode].
 * ============================================================ */
.tune-actions[data-screen="upload"],
.tune-actions[data-screen="tune-upload"] {
  width: 380px;
}

.tune-drop-zone {
  /* 2026-05-15: matched to action-btn pill shape + neon-blue border.
     Per-dropzone color tint comes from data-action below. */
  position: relative;
  padding: 28px 22px;
  border: 2px solid #00d6ff;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(0,214,255,0.10) 0%, rgba(0,214,255,0.02) 100%);
  text-align: center;
  cursor: pointer;
  font-family: var(--font-mono);
  color: #f0fbff;
  transition: border-color 200ms, background 200ms, transform 200ms, box-shadow 200ms;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px #00d6ff,
    0 0 18px rgba(0, 214, 255, 0.42),
    0 6px 18px rgba(0, 0, 0, 0.50);
}
/* LOAD LOG dropzone (csv) -- cyan neon text */
.tune-drop-zone[data-action="dropzone"] .tune-drop-title {
  color: #f0fbff;
  text-shadow:
    0 0 2px #ffffff,
    0 0 8px rgba(0, 214, 255, 1.00),
    0 0 18px rgba(0, 214, 255, 0.85),
    0 0 32px rgba(0, 214, 255, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.75);
}
/* LOAD CAL dropzone (.hpt/.ols/.bin) -- lime neon text */
.tune-drop-zone[data-action="tune-dropzone"] .tune-drop-title {
  color: #f4fff5;
  text-shadow:
    0 0 2px #ffffff,
    0 0 8px rgba(63, 255, 96, 1.00),
    0 0 18px rgba(63, 255, 96, 0.85),
    0 0 32px rgba(63, 255, 96, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.75);
}
.tune-drop-zone:hover,
.tune-drop-zone:focus-visible {
  outline: none;
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(0,214,255,0.20) 0%, rgba(0,214,255,0.04) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 0 0 1px #00d6ff,
    0 0 28px rgba(0, 214, 255, 0.75),
    0 10px 24px rgba(0, 0, 0, 0.60);
}
.tune-drop-zone.dragover {
  border-color: rgba(62, 168, 255, 1.0);
  background: rgba(62, 168, 255, 0.18);
  border-style: solid;
  box-shadow:
    inset 0 0 0 2px rgba(62, 168, 255, 0.55),
    0 0 26px rgba(62, 168, 255, 0.55),
    0 10px 22px rgba(0, 0, 0, 0.50);
}
.tune-drop-zone.busy {
  border-style: solid;
  border-color: rgba(62, 168, 255, 0.85);
  cursor: progress;
}
.tune-drop-zone.success {
  border-style: solid;
  border-color: rgba(63, 185, 80, 1.0);
  background: rgba(63, 185, 80, 0.12);
  box-shadow: 0 0 18px rgba(63, 185, 80, 0.40), 0 10px 22px rgba(0, 0, 0, 0.50);
}
.tune-drop-zone.error {
  border-color: rgba(255, 69, 69, 1.0);
  background: rgba(255, 69, 69, 0.10);
  box-shadow: 0 0 18px rgba(255, 69, 69, 0.40), 0 10px 22px rgba(0, 0, 0, 0.50);
}

.tune-drop-icon {
  font-family: var(--font-mono);
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
  color: #3ea8ff;
  text-shadow: 0 0 12px rgba(62, 168, 255, 0.65);
}
.tune-drop-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.32em;
  margin-bottom: 4px;
  color: #3ea8ff;
  text-shadow: 0 0 10px rgba(62, 168, 255, 0.45);
}
.tune-drop-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 230, 224, 0.55);
}
.tune-drop-status {
  margin-top: 12px;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.5px;
  color: rgba(232, 230, 224, 0.78);
}
.tune-drop-zone.success .tune-drop-status { color: #3fb950; }
.tune-drop-zone.error   .tune-drop-status { color: #ff4545; }

/* ---- TEACHING (green) theme overrides ---- */
body[data-tune-mode="teaching"] .tune-drop-zone {
  border-color: rgba(63, 185, 80, 0.55);
}
body[data-tune-mode="teaching"] .tune-drop-zone:hover,
body[data-tune-mode="teaching"] .tune-drop-zone:focus-visible {
  border-color: rgba(63, 185, 80, 1.0);
  background: rgba(63, 185, 80, 0.10);
  box-shadow: 0 0 18px rgba(63, 185, 80, 0.35), 0 10px 22px rgba(0, 0, 0, 0.50);
}
body[data-tune-mode="teaching"] .tune-drop-zone.dragover {
  background: rgba(63, 185, 80, 0.18);
  box-shadow:
    inset 0 0 0 2px rgba(63, 185, 80, 0.55),
    0 0 26px rgba(63, 185, 80, 0.55),
    0 10px 22px rgba(0, 0, 0, 0.50);
}
body[data-tune-mode="teaching"] .tune-drop-icon,
body[data-tune-mode="teaching"] .tune-drop-title {
  color: #3fb950;
  text-shadow: 0 0 10px rgba(63, 185, 80, 0.55);
}

/* ---- PRO (red) theme overrides ---- */
body[data-tune-mode="pro"] .tune-drop-zone {
  border-color: rgba(255, 69, 69, 0.55);
}
body[data-tune-mode="pro"] .tune-drop-zone:hover,
body[data-tune-mode="pro"] .tune-drop-zone:focus-visible {
  border-color: rgba(255, 69, 69, 1.0);
  background: rgba(255, 69, 69, 0.10);
  box-shadow: 0 0 18px rgba(255, 69, 69, 0.35), 0 10px 22px rgba(0, 0, 0, 0.50);
}
body[data-tune-mode="pro"] .tune-drop-zone.dragover {
  background: rgba(255, 69, 69, 0.18);
  box-shadow:
    inset 0 0 0 2px rgba(255, 69, 69, 0.55),
    0 0 26px rgba(255, 69, 69, 0.55),
    0 10px 22px rgba(0, 0, 0, 0.50);
}
body[data-tune-mode="pro"] .tune-drop-icon,
body[data-tune-mode="pro"] .tune-drop-title {
  color: #ff4545;
  text-shadow: 0 0 10px rgba(255, 69, 69, 0.55);
}

/* TEACHING room — green theme */
body[data-tune-mode="teaching"] .action-btn {
  border-color: rgba(63, 185, 80, 0.70);
  background: linear-gradient(180deg, rgba(63,185,80,0.18) 0%, rgba(63,185,80,0.04) 100%);
  color: #3fb950;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 0 0 1px #3fb950,
    0 0 14px rgba(63,185,80,0.42),
    0 6px 18px rgba(0,0,0,0.50);
}
body[data-tune-mode="teaching"] .action-btn:hover {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(63,185,80,0.30) 0%, rgba(63,185,80,0.10) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.26),
    0 0 0 1px #3fb950,
    0 0 22px rgba(63,185,80,0.65),
    0 10px 24px rgba(0,0,0,0.60);
}

/* PRO room — red theme */
body[data-tune-mode="pro"] .action-btn {
  border-color: rgba(255, 69, 69, 0.70);
  background: linear-gradient(180deg, rgba(255,69,69,0.18) 0%, rgba(255,69,69,0.04) 100%);
  color: #ff4545;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 0 0 1px #ff4545,
    0 0 14px rgba(255,69,69,0.42),
    0 6px 18px rgba(0,0,0,0.50);
}
body[data-tune-mode="pro"] .action-btn:hover {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(255,69,69,0.30) 0%, rgba(255,69,69,0.10) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.26),
    0 0 0 1px #ff4545,
    0 0 22px rgba(255,69,69,0.65),
    0 10px 24px rgba(0,0,0,0.60);
}

/* ============================================================
 * TUNE-CHAT — wired Scarecrow chat box (mirrors veh-chat).
 * Bordered panel with translucent gradient bg, scrolling transcript,
 * textarea + SEND button row. The brain in tuning_chat.js renders
 * messages, types out replies with a blinking cursor, and POSTs the
 * conversation to /v1/messages through the local proxy.
 * ============================================================ */
.tune-chat {
  position: relative;
  /* Top-left under ARC-TUNING — aligned with the wordmark's 24px left
     padding, narrower so it sits clearly off-center to the left. */
  align-self: flex-start;
  max-width: 580px;
  width: calc(100% - 48px);
  margin: 0 0 0 24px;
  padding: 14px 16px;
  border: 1px solid rgba(62, 168, 255, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 14, 22, 0.55) 0%, rgba(8, 10, 16, 0.72) 100%);
  backdrop-filter: blur(6px);
  z-index: 5;
}
.tune-chat-transcript {
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 6px 12px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.tune-chat-message {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tune-chat-message.ai {
  align-self: flex-start;
  background: rgba(62, 168, 255, 0.08);
  border-left: 2px solid #3ea8ff;
  color: var(--ink);
}
.tune-chat-message.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
.tune-chat-message.thinking { opacity: 0.55; font-style: italic; }
.tune-chat-message.error {
  align-self: flex-start;
  background: rgba(255, 69, 69, 0.10);
  border-left: 2px solid #ff4545;
  color: rgba(255, 220, 220, 0.92);
}
.tune-chat-cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1.05em;
  vertical-align: text-bottom;
  margin-left: 1px;
  background: #3ea8ff;
  box-shadow: 0 0 10px rgba(62, 168, 255, 0.65);
  animation: tune-chat-blink 900ms steps(2, end) infinite;
}
@keyframes tune-chat-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.tune-chat-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 6px;
}
.tune-chat-input {
  flex: 1;
  resize: vertical;
  min-height: 52px;
  max-height: 140px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.36);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
}
.tune-chat-input:focus {
  outline: none;
  border-color: #3ea8ff;
  background: rgba(0, 0, 0, 0.44);
  box-shadow: 0 0 0 1px #3ea8ff, 0 0 14px rgba(62, 168, 255, 0.30);
}
.tune-chat-send {
  align-self: center;
  padding: 12px 26px;
  border: 2px solid #3ea8ff;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(62,168,255,0.18) 0%, rgba(62,168,255,0.04) 100%);
  color: #3ea8ff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms, background 200ms, color 200ms;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 0 0 1px #3ea8ff,
    0 0 14px rgba(62,168,255,0.45),
    0 6px 18px rgba(0,0,0,0.50);
}
.tune-chat-send:hover:not(:disabled) {
  transform: translateY(-2px);
  color: #ffffff;
  background: linear-gradient(180deg, rgba(62,168,255,0.30) 0%, rgba(62,168,255,0.10) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 0 0 1px #3ea8ff,
    0 0 22px rgba(62,168,255,0.70),
    0 10px 22px rgba(0,0,0,0.6);
}
.tune-chat-send:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}
.tune-chat-send:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ============================================================
 * OPTION CARDS — BASIC / TEACHING / PRO
 * Carved-glass pill style, mirrors intent.css .intent-card.
 * 3D feel: inset highlight + outer glow + drop shadow.
 * Hover: lift -3px, brighten. Press: scale + sink.
 * Always-on pulse so they "breathe" the same way the intent buttons do.
 * ============================================================ */
.tuning-options {
  max-width: 1280px;
  width: 100%;
  margin: auto auto 0;   /* margin-top:auto pushes the row to the bottom */
  padding: 0 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;             /* more space between the three buttons */
  position: relative;
  z-index: 5;
}
@media (max-width: 820px) {
  .tuning-options {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 24px;
  }
}

.option-card {
  border-radius: 35px;
  padding: 36px 28px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
  font-size: clamp(22px, 2.7vw, 32px);
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  /* Positioning context for .card-info popovers below. */
  position: relative;
  overflow: visible;
  /* Start hidden — bounce-in (below) reveals each card in series. */
  opacity: 0;
  transform: translateY(0);
  transition:
    transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 240ms cubic-bezier(0.22, 1, 0.36, 1),
    background 200ms,
    border-color 200ms,
    color 200ms;
}

/* ============================================================
 * CARD INFO TOOLTIPS — explanatory popover above each option
 * on hover. ~400% larger than the original tiny tooltip, with
 * each popup fully themed in its card's color (gradient bg,
 * tinted text, matching border + glow).
 * Hidden once the user has clicked-to-pick a mode.
 * ============================================================ */
.card-info {
  position: absolute;
  bottom: calc(100% + 22px);
  left: 50%;
  width: max-content;
  max-width: 880px;
  padding: 32px 44px;
  border: 2px solid rgba(255, 255, 255, 0.20);
  border-radius: 24px;
  background: rgba(8, 12, 20, 0.96);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: clamp(26px, 2.4vw, 38px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.4px;
  text-transform: none;
  text-align: left;
  color: rgba(232, 230, 224, 0.95);
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.option-card:hover:not(.active) .card-info {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- BASIC tooltip — blue theme top to bottom ---- */
.option-card.basic .card-info {
  border-color: #3ea8ff;
  background:
    linear-gradient(180deg,
      rgba(8, 18, 32, 0.97) 0%,
      rgba(62, 168, 255, 0.22) 100%);
  color: rgba(220, 240, 255, 0.96);
  text-shadow: 0 0 10px rgba(62, 168, 255, 0.55),
               0 2px 4px rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 0 0 1px #3ea8ff,
    0 0 30px rgba(62, 168, 255, 0.65),
    0 0 80px rgba(62, 168, 255, 0.32),
    0 18px 44px rgba(0, 0, 0, 0.70);
}

/* ---- TEACHING tooltip — green theme top to bottom ---- */
.option-card.teach .card-info {
  border-color: #3fb950;
  background:
    linear-gradient(180deg,
      rgba(8, 22, 14, 0.97) 0%,
      rgba(63, 185, 80, 0.22) 100%);
  color: rgba(220, 255, 230, 0.96);
  text-shadow: 0 0 10px rgba(63, 185, 80, 0.55),
               0 2px 4px rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 0 0 1px #3fb950,
    0 0 30px rgba(63, 185, 80, 0.65),
    0 0 80px rgba(63, 185, 80, 0.32),
    0 18px 44px rgba(0, 0, 0, 0.70);
}

/* ---- PRO tooltip — red theme top to bottom ---- */
.option-card.pro .card-info {
  border-color: #ff4545;
  background:
    linear-gradient(180deg,
      rgba(28, 8, 10, 0.97) 0%,
      rgba(255, 69, 69, 0.22) 100%);
  color: rgba(255, 220, 220, 0.96);
  text-shadow: 0 0 10px rgba(255, 69, 69, 0.55),
               0 2px 4px rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 0 0 1px #ff4545,
    0 0 30px rgba(255, 69, 69, 0.65),
    0 0 80px rgba(255, 69, 69, 0.32),
    0 18px 44px rgba(0, 0, 0, 0.70);
}

/* Staggered bounce-in entry animation — drops each card up from below
   with a slight overshoot. BASIC bounces first (0.3s), TEACHING next
   (0.6s), PRO last (0.9s). The infinite color pulse starts a moment
   AFTER each card lands. */
@keyframes opt-bounce-in {
  0%   { opacity: 0; transform: translateY(80px) scale(0.7); }
  60%  { opacity: 1; transform: translateY(-18px) scale(1.08); }
  80%  {              transform: translateY(8px)  scale(0.96); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Repeating idle bounce — every 2.5 seconds each card bounces in place.
   Cards are staggered 0.3s apart so it reads as a wave (BASIC → TEACHING
   → PRO), then a pause, then the wave again. Holds at rest most of the
   cycle, bumps up at ~80%, settles at 100%. */
@keyframes opt-bounce-idle {
  0%, 78%, 100% { transform: translateY(0) scale(1); }
  86%           { transform: translateY(-14px) scale(1.05); }
  93%           { transform: translateY(5px) scale(0.97); }
}

/* Pause the wave-bounce on hover/active so the hover-lift transform
   isn't fighting the animation. The infinite color pulse also pauses,
   which is fine — those frames are box-shadow only and the user only
   sees the paused state momentarily. */
.option-card:hover:not(.active),
.option-card.active {
  animation-play-state: paused;
}

/* ---- BASIC — bright blue (matches the ARC-TUNING header glow) ---- */
.option-card.basic {
  border: 2px solid #3ea8ff;
  background: linear-gradient(180deg, rgba(62,168,255,0.18) 0%, rgba(62,168,255,0.04) 100%);
  color: #3ea8ff;
  text-shadow: 0 0 18px rgba(62,168,255,0.55), 0 2px 18px rgba(0,0,0,0.9);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.16) inset,
    0 0 0 1px #3ea8ff,
    0 0 14px rgba(62,168,255,0.45),
    0 0 28px rgba(62,168,255,0.22),
    0 6px 18px rgba(0,0,0,0.50);
  animation:
    opt-bounce-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards,
    opt-bounce-idle 2.5s ease-in-out 1.1s infinite,
    opt-pulse-blue  2.6s cubic-bezier(0.22, 1, 0.36, 1) 1.1s infinite;
}
.option-card.basic:hover:not(.active) {
  transform: translateY(-3px);
  color: #ffffff;
  background: linear-gradient(180deg, rgba(62,168,255,0.28) 0%, rgba(62,168,255,0.10) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 0 0 1px #3ea8ff,
    0 0 22px rgba(62,168,255,0.65),
    0 0 44px rgba(62,168,255,0.32),
    0 14px 28px rgba(0,0,0,0.6);
}
.option-card.basic:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.6) inset,
    0 0 0 1px #3ea8ff,
    0 0 18px rgba(62,168,255,0.55);
}
.option-card.basic.active {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(62,168,255,0.32) 0%, rgba(62,168,255,0.12) 100%);
}

/* ---- TEACHING — green (growth / instruction) ---- */
.option-card.teach {
  border: 2px solid #3fb950;
  background: linear-gradient(180deg, rgba(63,185,80,0.18) 0%, rgba(63,185,80,0.04) 100%);
  color: #3fb950;
  text-shadow: 0 0 18px rgba(63,185,80,0.55), 0 2px 18px rgba(0,0,0,0.9);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.16) inset,
    0 0 0 1px #3fb950,
    0 0 14px rgba(63,185,80,0.45),
    0 0 28px rgba(63,185,80,0.22),
    0 6px 18px rgba(0,0,0,0.50);
  animation:
    opt-bounce-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s forwards,
    opt-bounce-idle 2.5s ease-in-out 1.4s infinite,
    opt-pulse-green 2.6s cubic-bezier(0.22, 1, 0.36, 1) 1.4s infinite;
}
.option-card.teach:hover:not(.active) {
  transform: translateY(-3px);
  color: #ffffff;
  background: linear-gradient(180deg, rgba(63,185,80,0.28) 0%, rgba(63,185,80,0.10) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 0 0 1px #3fb950,
    0 0 22px rgba(63,185,80,0.65),
    0 0 44px rgba(63,185,80,0.32),
    0 14px 28px rgba(0,0,0,0.6);
}
.option-card.teach:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.6) inset,
    0 0 0 1px #3fb950,
    0 0 18px rgba(63,185,80,0.55);
}
.option-card.teach.active {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(63,185,80,0.32) 0%, rgba(63,185,80,0.12) 100%);
}

/* ---- PRO — red (power / expert) ---- */
.option-card.pro {
  border: 2px solid #ff4545;
  background: linear-gradient(180deg, rgba(255,69,69,0.18) 0%, rgba(255,69,69,0.04) 100%);
  color: #ff4545;
  text-shadow: 0 0 18px rgba(255,69,69,0.55), 0 2px 18px rgba(0,0,0,0.9);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.16) inset,
    0 0 0 1px #ff4545,
    0 0 14px rgba(255,69,69,0.45),
    0 0 28px rgba(255,69,69,0.22),
    0 6px 18px rgba(0,0,0,0.50);
  animation:
    opt-bounce-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s forwards,
    opt-bounce-idle 2.5s ease-in-out 1.7s infinite,
    opt-pulse-red   2.6s cubic-bezier(0.22, 1, 0.36, 1) 1.7s infinite;
}
.option-card.pro:hover:not(.active) {
  transform: translateY(-3px);
  color: #ffffff;
  background: linear-gradient(180deg, rgba(255,69,69,0.28) 0%, rgba(255,69,69,0.10) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 0 0 1px #ff4545,
    0 0 22px rgba(255,69,69,0.65),
    0 0 44px rgba(255,69,69,0.32),
    0 14px 28px rgba(0,0,0,0.6);
}
.option-card.pro:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.6) inset,
    0 0 0 1px #ff4545,
    0 0 18px rgba(255,69,69,0.55);
}
.option-card.pro.active {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(255,69,69,0.32) 0%, rgba(255,69,69,0.12) 100%);
}

@keyframes opt-pulse-blue {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.16) inset,
      0 0 0 1px #3ea8ff,
      0 0 14px rgba(62,168,255,0.45),
      0 0 28px rgba(62,168,255,0.18),
      0 6px 18px rgba(0,0,0,0.50);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.22) inset,
      0 0 0 1px #3ea8ff,
      0 0 20px rgba(62,168,255,0.65),
      0 0 40px rgba(62,168,255,0.32),
      0 6px 18px rgba(0,0,0,0.55);
  }
}
@keyframes opt-pulse-green {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.16) inset,
      0 0 0 1px #3fb950,
      0 0 14px rgba(63,185,80,0.45),
      0 0 28px rgba(63,185,80,0.18),
      0 6px 18px rgba(0,0,0,0.50);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.22) inset,
      0 0 0 1px #3fb950,
      0 0 20px rgba(63,185,80,0.65),
      0 0 40px rgba(63,185,80,0.32),
      0 6px 18px rgba(0,0,0,0.55);
  }
}
@keyframes opt-pulse-red {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.16) inset,
      0 0 0 1px #ff4545,
      0 0 14px rgba(255,69,69,0.45),
      0 0 28px rgba(255,69,69,0.18),
      0 6px 18px rgba(0,0,0,0.50);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255,255,255,0.22) inset,
      0 0 0 1px #ff4545,
      0 0 20px rgba(255,69,69,0.65),
      0 0 40px rgba(255,69,69,0.32),
      0 6px 18px rgba(0,0,0,0.55);
  }
}

/* ============================================================
 * LOG LIBRARY — panel under the chat box.
 * Always visible in BASIC / TEACHING / PRO rooms. Lists CSVs in
 * 01_bridge/logs/incoming/. Cap 25 logs (server-enforced).
 *   filename ORANGE = raw (uploaded, not analyzed)
 *   filename GREEN  = analyzed (Scarecrow has reviewed it)
 * Click a card → analyze (turns green). Click X → delete.
 * Drag a .csv directly onto the panel → uploads here.
 * ============================================================ */
.log-library {
  position: relative;
  align-self: flex-start;
  max-width: 580px;
  width: calc(100% - 48px);
  margin: 18px 0 0 24px;
  padding: 12px 14px;
  border: 1px solid rgba(62, 168, 255, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 14, 22, 0.55) 0%, rgba(8, 10, 16, 0.72) 100%);
  backdrop-filter: blur(6px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  transition: border-color 200ms, box-shadow 200ms, background 200ms;
}
.log-library.dragover {
  border-color: rgba(62, 168, 255, 0.95);
  background: linear-gradient(180deg, rgba(62, 168, 255, 0.18) 0%, rgba(8, 10, 16, 0.72) 100%);
  box-shadow: 0 0 22px rgba(62, 168, 255, 0.55), 0 0 60px rgba(62, 168, 255, 0.25);
}

.log-library-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.log-library-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.34em;
  color: rgba(62, 168, 255, 0.85);
  text-transform: uppercase;
  flex: 1;
}
.log-library-count {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(232, 230, 224, 0.5);
}
.log-library-refresh {
  background: transparent;
  border: 1px solid rgba(62, 168, 255, 0.40);
  color: #3ea8ff;
  width: 26px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 150ms, border-color 150ms;
}
.log-library-refresh:hover {
  background: rgba(62, 168, 255, 0.18);
  border-color: rgba(62, 168, 255, 0.85);
}

.log-library-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.log-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.30);
  transition: border-color 150ms, background 150ms, opacity 200ms;
}
.log-item:hover { border-color: rgba(62, 168, 255, 0.70); }
.log-item.deleting { opacity: 0.4; pointer-events: none; }

.log-item-body {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-mono);
}
.log-item-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
  word-break: break-all;
  /* default — overridden by status colors below */
  color: #ff9500;
  text-shadow: 0 0 6px rgba(255, 149, 0, 0.30);
}
.log-item[data-status="analyzed"] .log-item-name {
  color: #3fb950;
  text-shadow: 0 0 6px rgba(63, 185, 80, 0.35);
}
.log-item[data-status="raw"] .log-item-name {
  color: #ff9500;
  text-shadow: 0 0 6px rgba(255, 149, 0, 0.30);
}
.log-item-meta {
  font-size: 10px;
  letter-spacing: 0.6px;
  color: rgba(232, 230, 224, 0.50);
  text-transform: uppercase;
}

.log-item-delete {
  flex: 0 0 auto;
  width: 28px;
  border: 0;
  background: transparent;
  color: rgba(232, 230, 224, 0.45);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  border-radius: 0 8px 8px 0;
  transition: background 150ms, color 150ms;
}
.log-item-delete:hover {
  background: rgba(255, 69, 69, 0.18);
  color: #ff4545;
}

.log-library-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(232, 230, 224, 0.50);
  text-align: center;
  padding: 10px 4px 4px;
  min-height: 16px;
}
.log-library[data-state="loaded"] .log-library-status { display: none; }
.log-library[data-state="error"] .log-library-status { color: #ff4545; }

/* TEACHING (green) theme — borders and chrome tinted green */
body[data-tune-mode="teaching"] .log-library { border-color: rgba(63, 185, 80, 0.32); }
body[data-tune-mode="teaching"] .log-library.dragover {
  border-color: rgba(63, 185, 80, 0.95);
  background: linear-gradient(180deg, rgba(63, 185, 80, 0.18) 0%, rgba(8, 10, 16, 0.72) 100%);
  box-shadow: 0 0 22px rgba(63, 185, 80, 0.55), 0 0 60px rgba(63, 185, 80, 0.25);
}
body[data-tune-mode="teaching"] .log-library-title { color: rgba(63, 185, 80, 0.85); }
body[data-tune-mode="teaching"] .log-library-refresh { border-color: rgba(63, 185, 80, 0.40); color: #3fb950; }
body[data-tune-mode="teaching"] .log-library-refresh:hover { background: rgba(63, 185, 80, 0.18); border-color: rgba(63, 185, 80, 0.85); }
body[data-tune-mode="teaching"] .log-item:hover { border-color: rgba(63, 185, 80, 0.70); }

/* PRO (red) theme — borders and chrome tinted red */
body[data-tune-mode="pro"] .log-library { border-color: rgba(255, 69, 69, 0.32); }
body[data-tune-mode="pro"] .log-library.dragover {
  border-color: rgba(255, 69, 69, 0.95);
  background: linear-gradient(180deg, rgba(255, 69, 69, 0.18) 0%, rgba(8, 10, 16, 0.72) 100%);
  box-shadow: 0 0 22px rgba(255, 69, 69, 0.55), 0 0 60px rgba(255, 69, 69, 0.25);
}
body[data-tune-mode="pro"] .log-library-title { color: rgba(255, 69, 69, 0.85); }
body[data-tune-mode="pro"] .log-library-refresh { border-color: rgba(255, 69, 69, 0.40); color: #ff4545; }
body[data-tune-mode="pro"] .log-library-refresh:hover { background: rgba(255, 69, 69, 0.18); border-color: rgba(255, 69, 69, 0.85); }
body[data-tune-mode="pro"] .log-item:hover { border-color: rgba(255, 69, 69, 0.70); }
