/* AI Builder — scoped under body.ai-builder so the optimizer is untouched */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

body.ai-builder {
  background: #060b18;
}

body.ai-builder #content-wrapper,
body.ai-builder #content {
  background: transparent;
}

body.ai-builder .ai-builder-wrap {
  min-height: 100vh;
}

body.ai-builder #content-wrapper {
  padding-bottom: 120px; /* clearance for fixed AI runner */
}

body.ai-builder .sticky-footer {
  margin-bottom: 0;
  padding: 1rem 0;
  background: transparent;
  border-top: none;
}

body.ai-builder .sticky-footer .copyright,
body.ai-builder .sticky-footer .copyright span {
  color: #94a3b8 !important;
  font-weight: 600;
  font-size: 13px !important;
}

/* Tabs */
body.ai-builder .ai-builder-tabs.op-window li {
  background: #12182b;
  color: #a8b4cc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

body.ai-builder .ai-builder-tabs.op-window li:hover {
  background: #1a2240;
  color: #e0e7ff;
}

body.ai-builder .ai-builder-tabs.op-window .selected-window {
  background: #0C1B46;
  color: #ffffff;
  border-bottom: 4px solid #22d3ee;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}

body.ai-builder .mobile-op-menu .op-button {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #e0e7ff;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

body.ai-builder .mobile-op-menu .op-options {
  color: #22d3ee;
}

/* ---------- High-tech nav (scoped; does not edit shared navbar markup) ---------- */
body.ai-builder .topbar,
body.ai-builder .topbar-sims {
  background: linear-gradient(90deg, #030712 0%, #0b1224 40%, #15103a 75%, #0a1628 100%) !important;
  border-bottom: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
  position: relative;
}

body.ai-builder .topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.7), rgba(167, 139, 250, 0.5), transparent);
  pointer-events: none;
}

body.ai-builder .tool-links a {
  letter-spacing: 0.2px;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

body.ai-builder .tool-links a.selected-tool {
  color: #22d3ee !important;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
}

body.ai-builder .tool-links a:hover {
  color: #a5f3fc !important;
}

body.ai-builder .tool-links .selected-tool .fa-robot,
body.ai-builder .tool-links a .fa-robot {
  margin-right: 4px;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.7));
}

body.ai-builder .pp-settings .form-select,
body.ai-builder #slate-select {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 6px;
}

body.ai-builder .pp-settings .form-select:focus,
body.ai-builder #slate-select:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 0.15rem rgba(34, 211, 238, 0.2);
}

body.ai-builder .site-selection.selected-site {
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.55));
}

/* Schedule strip */
body.ai-builder .sched-btn,
body.ai-builder #horizontal-schedule {
  filter: saturate(1.05);
}

body.ai-builder #horizontal-schedule li .event,
body.ai-builder .game-info {
  border-color: rgba(34, 211, 238, 0.25) !important;
}

body.ai-builder .included-game {
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2);
}

/* ---------- Player pool high-tech accents ---------- */
body.ai-builder #main-op.op-table {
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.08), 0 8px 24px rgba(0, 0, 0, 0.35);
  background: #0a1020;
}

body.ai-builder #main-op .op-header th {
  background: linear-gradient(180deg, #0f2744 0%, #123a5c 100%) !important;
  color: #e0f2fe !important;
  border-bottom: 2px solid rgba(34, 211, 238, 0.55) !important;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.25);
  letter-spacing: 0.2px;
}

body.ai-builder #main-op .filters-weight td {
  background: linear-gradient(90deg, #1e1b4b 0%, #0e3a5c 50%, #1e1b4b 100%) !important;
  border-bottom: 1px solid rgba(167, 139, 250, 0.35) !important;
}

body.ai-builder #main-op #player-search-box {
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 6px;
  padding: 4px 8px;
}

body.ai-builder #main-op #player-search-box::placeholder {
  color: #64748b;
}

body.ai-builder #main-op #pos-filter,
body.ai-builder #main-op #teams-filter,
body.ai-builder #main-op #status-filter {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 5px;
}

body.ai-builder #main-op .weight-inputs {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 4px;
}

body.ai-builder #main-op .weight-inputs.source-in-use {
  background-color: #abffd5 !important;
  color: #064e3b !important;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.35);
}

body.ai-builder #main-op .op-player td {
  background: #0b1224;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  transition: background 0.12s ease;
}

body.ai-builder #main-op .op-player:hover td {
  background: #121a33;
}

body.ai-builder #main-op .op-player .player-name {
  color: #7dd3fc !important;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}

/* Locked rows: opaque dark teal instead of neon green wash */
body.ai-builder #main-op tr.locked-player,
body.ai-builder #main-op .locked-player {
  background-color: #0c1f16 !important;
}

body.ai-builder #main-op .op-player.locked-player td {
  background: #10281c !important;
  color: #ecfdf5 !important;
  box-shadow: inset 3px 0 0 #34d399;
}

body.ai-builder #main-op .op-player.locked-player:hover td {
  background: #143324 !important;
}

body.ai-builder #main-op .op-player.locked-player .player-name {
  color: #6ee7b7 !important;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.35);
}

body.ai-builder #main-op .op-player.excluded-player td {
  opacity: 0.45;
}

/* Lock icons: shared CSS sets opacity .3 — override for AI Builder */
body.ai-builder #main-op .player-lock {
  opacity: 1 !important;
  color: #94a3b8 !important;
  font-size: 1.1em;
  filter: none;
}

body.ai-builder #main-op .player-lock:hover {
  color: #e2e8f0 !important;
}

/* Showdown/single: "Exposure" under lock/exclude is blue on dark — unreadable without override */
body.ai-builder #main-op .expo-btn {
  color: #7dd3fc !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.ai-builder #main-op .expo-btn:hover {
  color: #e0f2fe !important;
}

body.ai-builder #main-op .expo-pencil {
  color: #fbbf24 !important;
}

body.ai-builder #main-op .exposure-inputs {
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 3px;
}

body.ai-builder #main-op .fa-lock.player-lock,
body.ai-builder #main-op .locked-player .player-lock {
  color: #34d399 !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.75));
}

body.ai-builder #main-op .p-check {
  color: #22d3ee;
  filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.35));
}

body.ai-builder #main-op .ai-dvp {
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
  vertical-align: middle;
}

/* Soft grid overlay behind pool area */
body.ai-builder .container-fluid {
  position: relative;
}

body.ai-builder .container-fluid::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 85%);
}

body.ai-builder .container-fluid > .col-md-12 {
  position: relative;
  z-index: 1;
}

/* Misc panes */
body.ai-builder .misc-op-views {
  background: #0d1428;
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #e2e8f0;
}

body.ai-builder .misc-op-views h4 {
  color: #e2e8f0 !important;
}

body.ai-builder .stax .list-group-item {
  background: #12182b;
  color: #e2e8f0;
  border-color: rgba(99, 102, 241, 0.3);
}

body.ai-builder .locks-exclusions .tags-container {
  background-color: #12182b !important;
}

/* Fixed AI runner — session-aware control bar (not the optimizer clone) */
#fixed-ai-runner.ai-runner {
  position: fixed;
  left: auto;
  right: 12px;
  bottom: 12px;
  width: min(520px, calc(100vw - 24px));
  max-width: none;
  z-index: 1040;
  padding: 0;
  border-radius: 16px;
  border: 2px solid rgba(255, 107, 66, 0.55);
  background: linear-gradient(120deg, #0b1220 0%, #14102a 48%, #0f1f36 100%);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 28px rgba(255, 107, 66, 0.18);
  overflow: visible;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.35s cubic-bezier(0.22, 1.2, 0.36, 1), opacity 0.2s ease;
}

/* Briefly hidden on first paint so local session hint can apply before opacity fades in. */
#fixed-ai-runner.ai-runner.is-booting {
  opacity: 0;
  pointer-events: none;
}

#fixed-ai-runner.ai-runner .ai-runner-sheen {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 90% at 8% 20%, rgba(255, 107, 66, 0.16), transparent 55%),
    radial-gradient(ellipse 40% 80% at 92% 80%, rgba(34, 211, 238, 0.08), transparent 50%);
  pointer-events: none;
}

#fixed-ai-runner.ai-runner .ai-runner-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#fixed-ai-runner.ai-runner .ai-runner-progress span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, #ff6b42, #ffb39a, transparent);
  transform: translateX(-120%);
}

#fixed-ai-runner.ai-runner[data-state="generating"] .ai-runner-progress {
  opacity: 1;
}

#fixed-ai-runner.ai-runner[data-state="generating"] .ai-runner-progress span {
  animation: ai-runner-progress-slide 1.6s ease-in-out infinite;
}

#fixed-ai-runner.ai-runner .ai-runner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

#fixed-ai-runner.ai-runner .ai-runner-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

#fixed-ai-runner.ai-runner .ai-runner-orb {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 107, 66, 0.14);
  color: #ff6b42;
  border: 1px solid rgba(255, 107, 66, 0.35);
  font-size: 16px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

#fixed-ai-runner.ai-runner .ai-runner-kicker {
  color: #f8fafc;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

#fixed-ai-runner.ai-runner .ai-runner-sub {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
  line-height: 1.35;
}

#fixed-ai-runner.ai-runner .ai-runner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#fixed-ai-runner.ai-runner .ai-runner-primary {
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: 14px;
  color: #0b1220;
  background: linear-gradient(90deg, #ff6b42 0%, #ff8a66 100%);
  box-shadow: 0 6px 18px rgba(255, 107, 66, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}

#fixed-ai-runner.ai-runner .ai-runner-primary:hover,
#fixed-ai-runner.ai-runner .ai-runner-primary:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 107, 66, 0.45);
  color: #0b1220;
  outline: none;
  filter: brightness(1.05);
}

#fixed-ai-runner.ai-runner .ai-runner-history {
  -webkit-appearance: none;
  appearance: none;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#fixed-ai-runner.ai-runner .ai-runner-history:hover,
#fixed-ai-runner.ai-runner .ai-runner-history:focus,
#fixed-ai-runner.ai-runner .ai-runner-history.is-open {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(34, 211, 238, 0.45);
  color: #67e8f9;
  outline: none;
}

#fixed-ai-runner.ai-runner .ai-runner-history-menu {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 48px));
  max-height: min(320px, 50vh);
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(11, 18, 32, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 2;
  padding: 8px;
}

#fixed-ai-runner.ai-runner .ai-runner-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#fixed-ai-runner.ai-runner .ai-runner-history-empty {
  padding: 16px 10px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

#fixed-ai-runner.ai-runner .ai-runner-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  padding: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#fixed-ai-runner.ai-runner .ai-runner-history-item:hover,
#fixed-ai-runner.ai-runner .ai-runner-history-item:focus {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.25);
  outline: none;
}

#fixed-ai-runner.ai-runner .ai-runner-history-item.is-active {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

#fixed-ai-runner.ai-runner .ai-runner-history-item.is-live {
  border-color: rgba(255, 107, 66, 0.4);
}

#fixed-ai-runner.ai-runner .ai-runner-history-item-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

#fixed-ai-runner.ai-runner .ai-runner-history-time {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
}

#fixed-ai-runner.ai-runner .ai-runner-history-meta {
  margin-top: 0;
  font-size: 11px;
  color: #94a3b8;
}

#fixed-ai-runner.ai-runner .ai-runner-history-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

#fixed-ai-runner.ai-runner .ai-runner-history-badge.is-ready {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.1);
}

#fixed-ai-runner.ai-runner .ai-runner-history-badge.is-running {
  border-color: rgba(255, 107, 66, 0.45);
  color: #ffb39a;
  background: rgba(255, 107, 66, 0.12);
}

#fixed-ai-runner.ai-runner .ai-runner-history-badge.is-failed {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}

.ai-results-portfolio-summary .ai-summary-caret {
  display: inline-block;
  margin-left: 1px;
  color: #67e8f9;
  animation: ai-summary-caret-blink 0.7s steps(1) infinite;
}

@keyframes ai-summary-caret-blink {
  50% { opacity: 0; }
}

/* Session states */
#fixed-ai-runner.ai-runner[data-state="generating"] {
  border-color: #ff6b42;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(255, 107, 66, 0.32);
}

#fixed-ai-runner.ai-runner[data-state="generating"] .ai-runner-orb {
  animation: ai-runner-orb-pulse 1.4s ease-in-out infinite;
}

#fixed-ai-runner.ai-runner[data-state="generating"] .ai-runner-sub {
  color: #ffb39a;
}

#fixed-ai-runner.ai-runner[data-state="results"] {
  border-color: #34d399;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(52, 211, 153, 0.28);
}

#fixed-ai-runner.ai-runner[data-state="results"] .ai-runner-orb {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #34d399;
}

#fixed-ai-runner.ai-runner[data-state="results"] .ai-runner-sub {
  color: #6ee7b7;
}

#fixed-ai-runner.ai-runner[data-state="results"] .ai-runner-primary {
  background: linear-gradient(90deg, #34d399 0%, #6ee7b7 100%);
  box-shadow: 0 6px 18px rgba(52, 211, 153, 0.35);
  color: #06281c;
}

#fixed-ai-runner.ai-runner[data-state="error"] {
  border-color: #f87171;
}

#fixed-ai-runner.ai-runner[data-state="error"] .ai-runner-orb {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

#fixed-ai-runner.ai-runner[data-state="error"] .ai-runner-sub {
  color: #fca5a5;
}

#fixed-ai-runner.ai-runner[data-state="purchase"] {
  border-color: #fbbf24;
}

#fixed-ai-runner.ai-runner[data-state="purchase"] .ai-runner-orb {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}

#fixed-ai-runner.ai-runner[data-state="purchase"] .ai-runner-sub {
  color: #fcd34d;
}

#fixed-ai-runner.ai-runner.is-locked {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

#fixed-ai-runner.ai-runner.is-locked .ai-runner-orb {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.35);
  color: #94a3b8;
}

#fixed-ai-runner.ai-runner.is-session-pulse {
  animation: ai-runner-session-in 0.55s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes ai-runner-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@keyframes ai-runner-orb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 66, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255, 107, 66, 0); }
}

@keyframes ai-runner-session-in {
  0% { transform: translateY(18px); opacity: 0.65; }
  65% { transform: translateY(-3px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 767px) {
  #fixed-ai-runner.ai-runner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  #fixed-ai-runner.ai-runner .ai-runner-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px 14px;
  }

  #fixed-ai-runner.ai-runner .ai-runner-sub {
    max-width: calc(100vw - 90px);
    white-space: normal;
  }

  #fixed-ai-runner.ai-runner .ai-runner-actions {
    width: 100%;
  }

  #fixed-ai-runner.ai-runner .ai-runner-primary {
    flex: 1;
    justify-content: center;
  }

  body.ai-builder #content-wrapper {
    padding-bottom: 160px;
  }
  body.ai-builder .sticky-footer {
    margin-bottom: 0;
  }
}

/* Floating dock retired — session lives on the sticky runner */
.ai-wizard-minimized {
  display: none !important;
}

@media (max-width: 575.98px) {
  .ai-wizard-minimized {
    display: none !important;
  }
}

/* Wizard modal */
#ai-wizard-modal .ai-wizard-dialog {
  max-width: 1100px;
  width: calc(100% - 24px);
  margin: 12px auto;
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

#ai-wizard-modal .ai-wizard-content {
  background: #0b1224;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  color: #e2e8f0;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.35);
  height: 100%;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#ai-wizard-modal .ai-wizard-scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
}

/* Header must stack above body so Load AI Configuration menu can overflow the header edge */
#ai-wizard-modal .modal-header {
  position: relative;
  z-index: 5;
}

#ai-wizard-modal .modal-body,
#ai-wizard-modal .modal-footer {
  position: relative;
  z-index: 1;
}

#ai-wizard-modal .ai-wizard-header {
  background: linear-gradient(90deg, #0e1a33 0%, #1e1b4b 50%, #0e2a4a 100%);
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
  padding: 0.85rem 1.25rem;
  flex: 0 0 auto;
}

#ai-wizard-modal .ai-wizard-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

#ai-wizard-modal .ai-wizard-header h3 i {
  color: #22d3ee;
  margin-right: 8px;
}

#ai-wizard-modal .ai-wizard-subtitle {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 4px;
}

#ai-wizard-modal .ai-wizard-body {
  padding: 1rem 1.25rem;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}

#ai-wizard-modal .ai-wizard-body.is-generating {
  overflow: hidden;
  scroll-behavior: auto;
}

#ai-wizard-modal .ai-wizard-body.is-generating .ai-wizard-layout {
  visibility: hidden;
  pointer-events: none;
}

#ai-wizard-modal .ai-wizard-generating {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px 18px;
  overflow: auto;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(34, 211, 238, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(167, 139, 250, 0.12) 0%, transparent 50%),
    rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(2px);
}

#ai-wizard-modal .ai-gen-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  animation: ai-gen-grid-drift 10s linear infinite;
  pointer-events: none;
}

#ai-wizard-modal .ai-gen-core {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-wizard-modal .ai-gen-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

#ai-wizard-modal .ai-gen-ring-a {
  inset: 0;
  border-top-color: #22d3ee;
  border-right-color: rgba(34, 211, 238, 0.25);
  animation: ai-gen-spin 2.4s linear infinite;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}

#ai-wizard-modal .ai-gen-ring-b {
  inset: 14px;
  border-bottom-color: #a78bfa;
  border-left-color: rgba(167, 139, 250, 0.35);
  animation: ai-gen-spin-rev 3.2s linear infinite;
}

#ai-wizard-modal .ai-gen-ring-c {
  inset: 28px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  animation: ai-gen-spin 6s linear infinite;
}

#ai-wizard-modal .ai-gen-orb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.9));
  border: 1px solid rgba(34, 211, 238, 0.55);
  box-shadow:
    0 0 24px rgba(34, 211, 238, 0.35),
    inset 0 0 16px rgba(167, 139, 250, 0.2);
  animation: ai-gen-pulse 1.8s ease-in-out infinite;
  z-index: 1;
}

#ai-wizard-modal .ai-gen-orb i {
  color: #67e8f9;
  font-size: 22px;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

#ai-wizard-modal .ai-gen-copy {
  position: relative;
  z-index: 1;
  width: min(440px, 92%);
  text-align: center;
}

#ai-wizard-modal .ai-gen-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #e0e7ff;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.45);
  margin-bottom: 8px;
}

#ai-wizard-modal .ai-gen-status {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #67e8f9;
  min-height: 1.4em;
  margin-bottom: 14px;
}

#ai-wizard-modal .ai-gen-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.7);
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(34, 211, 238, 0.25);
}

#ai-wizard-modal .ai-gen-bar span {
  display: block;
  height: 100%;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #22d3ee);
  background-size: 200% 100%;
  animation: ai-gen-bar 2.2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
}

#ai-wizard-modal .ai-gen-log {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.55;
  text-align: left;
  color: #94a3b8;
  max-height: 148px;
  overflow: hidden;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.65);
  box-shadow: inset 0 0 20px rgba(34, 211, 238, 0.05);
}

#ai-wizard-modal .ai-gen-log .ai-gen-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ai-wizard-modal .ai-gen-log .ai-gen-line::before {
  content: "> ";
  color: #22d3ee;
}

#ai-wizard-modal .ai-gen-log .ai-gen-line.is-live {
  color: #e2e8f0;
}

#ai-wizard-modal .ai-gen-elapsed {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
}

#ai-wizard-modal .ai-gen-elapsed-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #67e8f9;
  text-transform: uppercase;
  opacity: 0.85;
}

#ai-wizard-modal .ai-gen-elapsed .ai-digital-clock {
  font-size: 2.15rem;
  line-height: 1;
  min-width: 5.5ch;
}

#ai-wizard-modal .ai-digital-clock {
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  font-weight: 400;
  color: #a5f3fc;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  text-shadow:
    0 0 1px rgba(165, 243, 252, 0.9),
    0 0 8px rgba(34, 211, 238, 0.45);
}

#ai-wizard-modal .ai-wizard-header-clock {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.12);
}

#ai-wizard-modal .ai-wizard-header-clock .ai-digital-clock {
  font-size: 1.4rem;
  line-height: 1.1;
  min-width: 8.5ch;
}

@keyframes ai-gen-spin {
  to { transform: rotate(360deg); }
}

@keyframes ai-gen-spin-rev {
  to { transform: rotate(-360deg); }
}

@keyframes ai-gen-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(34, 211, 238, 0.3), inset 0 0 14px rgba(167, 139, 250, 0.15); }
  50% { transform: scale(1.06); box-shadow: 0 0 32px rgba(34, 211, 238, 0.55), inset 0 0 18px rgba(167, 139, 250, 0.28); }
}

@keyframes ai-gen-bar {
  0% { width: 12%; background-position: 0% 50%; }
  50% { width: 78%; background-position: 100% 50%; }
  100% { width: 18%; background-position: 0% 50%; }
}

@keyframes ai-gen-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 28px 28px, 28px 28px; }
}

#ai-wizard-modal .ai-wizard-layout {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

#ai-wizard-modal .ai-wizard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px 12px;
}

#ai-wizard-modal .ai-wizard-header-main {
  flex: 1 1 auto;
  min-width: 0;
  order: 1;
}

#ai-wizard-modal .ai-wizard-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  order: 2;
  margin-left: auto; /* keep Load + chrome grouped on the right */
}

#ai-wizard-modal .ai-wizard-header-chrome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  order: 3;
}

#ai-wizard-modal .ai-wizard-chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  height: 30px;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#ai-wizard-modal .ai-wizard-chrome-btn:hover,
#ai-wizard-modal .ai-wizard-chrome-btn:focus {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.55);
  color: #7dd3fc;
  outline: none;
}

#ai-wizard-modal #ai-wizard-close-btn:hover,
#ai-wizard-modal #ai-wizard-close-btn:focus {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

/* Floating dock markup kept for compatibility; styles retired — session lives on runner */

#ai-wizard-modal .ai-load-strategy-wrap {
  position: relative;
}

#ai-wizard-modal .ai-load-strategy-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  max-width: 320px;
  max-height: 280px;
  overflow: auto;
  z-index: 30;
  background: #0b1224;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 6px;
}

#ai-wizard-modal .ai-load-strategy-menu .ai-strategy-menu-item {
  display: block;
  width: 100%;
  text-align: right;
  background: transparent;
  border: 0;
  color: #e2e8f0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

#ai-wizard-modal .ai-load-strategy-menu .ai-strategy-menu-item:hover {
  background: rgba(34, 211, 238, 0.12);
  color: #7dd3fc;
}

#ai-wizard-modal .ai-load-strategy-menu .ai-strategy-menu-empty,
#ai-wizard-modal .ai-load-strategy-menu .ai-strategy-menu-loading {
  color: #94a3b8;
  font-size: 12px;
  padding: 8px 10px;
  text-align: right;
}

#ai-wizard-modal .ai-load-strategy-menu .ai-strategy-menu-loading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#ai-wizard-modal .ai-load-strategy-menu .ai-strategy-menu-loading i {
  color: #67e8f9;
}

#ai-wizard-modal .ai-wizard-section {
  background: rgba(8, 12, 28, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 8px;
  padding: 8px 10px;
}

#ai-wizard-modal .ai-section-title {
  color: #e0e7ff;
  font-size: 0.82rem;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

#ai-wizard-modal .ai-section-hint {
  color: #64748b;
  font-weight: 600;
  font-size: 0.72rem;
  margin-left: 4px;
}

#ai-wizard-modal .ai-field-label {
  font-size: 10px;
  margin-bottom: 2px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#ai-wizard-modal .ai-field-label-strong {
  color: #e2e8f0;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#ai-wizard-modal .ai-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #7dd3fc;
  padding: 0;
  margin: 0;
  line-height: 1;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

#ai-wizard-modal .ai-help-btn:hover,
#ai-wizard-modal .ai-help-btn:focus {
  color: #bae6fd;
  outline: none;
}

#ai-wizard-modal .ai-help-btn > i {
  font-size: 12px;
}

#ai-payout-help-modal {
  z-index: 1080;
}

#ai-payout-help-modal .ai-payout-help-content {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

#ai-payout-help-modal .ai-payout-help-header {
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px 10px 0 0;
}

#ai-payout-help-modal .ai-payout-help-header .close {
  color: #334155;
  opacity: 0.7;
  text-shadow: none;
}

#ai-payout-help-modal .ai-payout-help-header .close:hover {
  opacity: 1;
}

#ai-payout-help-modal .ai-payout-help-body {
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}

#ai-payout-help-modal .ai-payout-help-body p {
  margin: 0 0 12px;
}

#ai-payout-help-modal .ai-payout-help-examples {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

#ai-payout-help-modal .ai-payout-help-examples figure {
  margin: 0;
}

#ai-payout-help-modal .ai-payout-help-examples img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

#ai-payout-help-modal .ai-payout-help-examples figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

#ai-payout-help-modal .ai-payout-help-footer {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 0 0 10px 10px;
}

#ai-wizard-modal .ai-strategy-char-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

#ai-wizard-modal .ai-strategy-char-count {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

#ai-wizard-modal .ai-strategy-char-count.is-near-limit {
  color: #fbbf24;
}

#ai-wizard-modal .ai-strategy-char-count.is-over-limit {
  color: #fca5a5;
}

#ai-wizard-modal .ai-field-hint {
  color: #64748b;
  font-size: 11px;
}

#ai-wizard-modal .ai-field-input.form-control-sm,
#ai-wizard-modal .form-control-sm.ai-field-input {
  height: 30px;
  padding: 0.2rem 0.45rem;
  font-size: 12px;
  border-radius: 6px;
}

#ai-wizard-modal .ai-config-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

#ai-wizard-modal .ai-config-right-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ai-wizard-modal .ai-contest-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px 8px;
}

#ai-wizard-modal .ai-portfolio-grid {
  display: grid;
  grid-template-columns: minmax(100px, 160px);
  gap: 6px;
}

#ai-wizard-modal .ai-strategy-textarea {
  min-height: 108px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.35;
}

#ai-wizard-modal .ai-constraint-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

#ai-wizard-modal .ai-constraint-card {
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 6px;
  padding: 6px 8px;
  min-height: 0;
}

#ai-wizard-modal .ai-constraint-card h5 {
  font-size: 11px;
  margin: 0 0 4px;
  color: #cbd5e1;
  font-weight: 700;
}

#ai-wizard-modal .ai-constraint-card-wide {
  grid-column: 1 / -1;
}

#ai-wizard-modal .ai-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 96px;
  overflow: auto;
}

#ai-wizard-modal .ai-chip,
#ai-wizard-modal .ai-empty-chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  line-height: 1.35;
}

#ai-wizard-modal .ai-payout-upload-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

#ai-wizard-modal .ai-payout-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

#ai-wizard-modal .ai-payout-add-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 0 0 auto;
}

#ai-wizard-modal .ai-payout-paste-hint {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  line-height: 1.2;
  padding-left: 2px;
}

#ai-wizard-modal .ai-payout-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
}

#ai-wizard-modal .ai-payout-upload-row #ai-payout-parse-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

#ai-wizard-modal .ai-payout-structure-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

#ai-wizard-modal .ai-payout-thumb {
  position: relative;
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #020617;
}

#ai-wizard-modal .ai-payout-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#ai-wizard-modal .ai-payout-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(127, 29, 29, 0.9);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 0;
}

#ai-wizard-modal .ai-payout-status {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 4px;
  min-height: 14px;
}

#ai-wizard-modal .ai-payout-status.is-error {
  color: #fca5a5;
}

#ai-wizard-modal .ai-payout-parsed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#ai-wizard-modal .ai-payout-parsed-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #86efac;
}

#ai-wizard-modal .ai-payout-parsed-label i {
  margin-right: 4px;
}

#ai-wizard-modal .ai-payout-panel {
  margin-top: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(8, 14, 28, 0.55);
  overflow: hidden;
  padding: 8px 10px;
}

#ai-wizard-modal .ai-payout-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 8px 0;
  margin: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

#ai-wizard-modal .ai-payout-tabs .nav-link {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  text-decoration: none;
}

#ai-wizard-modal .ai-payout-tabs .nav-link:hover {
  color: #e2e8f0;
  text-decoration: none;
}

#ai-wizard-modal .ai-payout-tabs .nav-link.active {
  color: #7dd3fc;
  background: rgba(14, 116, 144, 0.2);
  border-color: rgba(125, 211, 252, 0.25);
  border-bottom-color: transparent;
}

#ai-wizard-modal .ai-payout-tab-pane {
  padding: 8px 10px;
}

#ai-wizard-modal .ai-payout-summary {
  font-size: 11px;
  color: #7dd3fc;
  line-height: 1.45;
}

#ai-wizard-modal .ai-payout-structure-wrap {
  max-height: 180px;
  overflow: auto;
}

#ai-wizard-modal .ai-payout-structure-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

#ai-wizard-modal .ai-payout-structure-table th,
#ai-wizard-modal .ai-payout-structure-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
}

#ai-wizard-modal .ai-payout-structure-table th {
  color: #94a3b8;
  font-weight: 700;
  position: sticky;
  top: 0;
  background: rgba(8, 14, 28, 0.95);
}

#ai-wizard-modal .ai-payout-structure-table td {
  color: #e2e8f0;
}

#ai-wizard-modal .ai-payout-structure-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #a5f3fc;
}

@media (max-width: 900px) {
  #ai-wizard-modal .ai-config-top-row {
    grid-template-columns: 1fr;
  }
  #ai-wizard-modal .ai-contest-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #ai-wizard-modal .ai-constraint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  #ai-wizard-modal .ai-wizard-dialog {
    margin: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
  }
  #ai-wizard-modal .ai-wizard-content {
    border-radius: 0;
    max-height: 100vh;
  }

  /* Mobile: title + chrome on row 1, subtitle, then full-width Load */
  #ai-wizard-modal .ai-wizard-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title chrome"
      "subtitle subtitle"
      "actions actions";
    column-gap: 8px;
    row-gap: 8px;
    align-items: start;
    padding: 0.7rem 0.85rem;
  }
  #ai-wizard-modal .ai-wizard-header-main {
    display: contents;
  }
  #ai-wizard-modal .ai-wizard-header h3 {
    grid-area: title;
    font-size: 1.05rem;
    line-height: 1.25;
    margin: 0;
  }
  #ai-wizard-modal .ai-wizard-subtitle {
    grid-area: subtitle;
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
  }
  #ai-wizard-modal .ai-wizard-header-chrome {
    grid-area: chrome;
    margin-left: 0;
    order: initial;
    align-self: start;
  }
  #ai-wizard-modal .ai-wizard-header-actions {
    grid-area: actions;
    order: initial;
    margin-left: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  #ai-wizard-modal .ai-wizard-header-clock {
    order: 0;
  }
  #ai-wizard-modal .ai-load-strategy-wrap {
    flex: 1 1 100%;
    width: 100%;
  }
  #ai-wizard-modal #ai-load-strategy-btn {
    width: 100%;
    justify-content: center;
  }
  #ai-wizard-modal .ai-load-strategy-menu {
    left: 0;
    right: 0;
    max-width: none;
  }
}

@media (max-width: 576px) {
  #ai-wizard-modal .ai-contest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #ai-wizard-modal .ai-constraint-grid {
    grid-template-columns: 1fr;
  }
}

#ai-wizard-modal .ai-section-title i {
  color: #22d3ee;
  margin-right: 6px;
}

#ai-wizard-modal .ai-wizard-help {
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 0.4rem;
}

#ai-wizard-modal .ai-chip-lock {
  background: linear-gradient(135deg, #065f46, #059669);
  color: #ecfdf5;
}

#ai-wizard-modal .ai-chip-exclude {
  background: linear-gradient(135deg, #7f1d1d, #dc2626);
  color: #fef2f2;
}

#ai-wizard-modal .ai-chip-stack {
  background: linear-gradient(135deg, #312e81, #6366f1);
  color: #eef2ff;
}

#ai-wizard-modal .ai-chip-expo {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  color: #ecfeff;
}

#ai-wizard-modal .ai-global-expo {
  margin-bottom: 8px;
}

#ai-wizard-modal .ai-global-expo-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

#ai-wizard-modal .ai-global-expo-label {
  user-select: none;
}

#ai-wizard-modal .ai-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: #334155;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#ai-wizard-modal .ai-toggle.is-on {
  background: #0891b2;
  border-color: rgba(34, 211, 238, 0.65);
}

#ai-wizard-modal .ai-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

#ai-wizard-modal .ai-toggle.is-on .ai-toggle-knob {
  transform: translateX(18px);
}

#ai-wizard-modal .ai-global-expo-input {
  width: 64px;
  display: inline-block;
  padding: 2px 6px;
  height: 28px;
}

/* AI Builder: hide Rules tab + pane (global exposure lives in the wizard) */
body.ai-builder .ai-builder-tabs > #rules,
body.ai-builder .mobile-op-menu #rules,
body.ai-builder .rules.misc-op-views {
  display: none !important;
}

#ai-wizard-modal .ai-field-input {
  background: #0f172a;
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #f1f5f9;
}

#ai-wizard-modal .ai-field-input:focus {
  background: #0f172a;
  color: #fff;
  border-color: #22d3ee;
  box-shadow: 0 0 0 0.15rem rgba(34, 211, 238, 0.25);
}

#ai-wizard-modal .ai-muted {
  color: #64748b;
}

#ai-wizard-modal .ai-coming-soon {
  text-align: center;
  padding: 18px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(34, 211, 238, 0.35);
  border-radius: 10px;
}

#ai-wizard-modal .ai-coming-soon-icon {
  font-size: 40px;
  color: #22d3ee;
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.7);
  margin-bottom: 8px;
}

#ai-wizard-modal .ai-coming-soon h4 {
  color: #e0e7ff;
  font-weight: 800;
}

#ai-wizard-modal .ai-coming-soon p {
  color: #94a3b8;
}

#ai-wizard-modal .ai-payload-preview {
  text-align: left;
  max-height: 180px;
  overflow: auto;
  background: #020617;
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
  margin-top: 12px;
}

#ai-wizard-modal .ai-prompt-preview-pre {
  max-height: min(42vh, 480px);
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  margin-top: 8px;
}

#ai-wizard-modal .ai-prompt-preview-block {
  margin-bottom: 14px;
}

#ai-wizard-modal .ai-prompt-preview-block h5 {
  color: #22d3ee;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

#ai-wizard-modal .ai-preview-error {
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

#ai-wizard-modal .ai-preview-error a.ai-usage-link {
  color: #67e8f9;
  font-weight: 700;
  text-decoration: underline;
}

#ai-wizard-modal .ai-wizard-purchase {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(52vh, 420px);
  padding: 1rem 0.5rem;
}

#ai-wizard-modal .ai-purchase-panel {
  width: 100%;
  max-width: 440px;
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(8, 14, 28, 0.98) 100%);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 14px;
  padding: 28px 24px 24px;
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.12);
}

#ai-wizard-modal .ai-purchase-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

#ai-wizard-modal .ai-purchase-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #22d3ee;
  font-size: 1.35rem;
}

#ai-wizard-modal .ai-purchase-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid rgba(34, 197, 94, 0.65);
  color: #4ade80;
  font-size: 2rem;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.25);
  animation: ai-purchase-success-pop 0.45s ease-out;
}

@keyframes ai-purchase-success-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

#ai-wizard-modal .ai-purchase-success-balance {
  color: #cbd5e1;
  font-size: 0.95rem;
}

#ai-wizard-modal .ai-purchase-success-balance strong {
  color: #4ade80;
  font-size: 1.25rem;
}

#ai-wizard-modal .ai-purchase-success-actions {
  border-top: none;
  padding-top: 8px;
  margin-top: 8px;
}

#ai-wizard-modal .ai-purchase-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

#ai-wizard-modal .ai-purchase-stat {
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 10px;
  padding: 12px 10px;
}

#ai-wizard-modal .ai-purchase-stat-label {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

#ai-wizard-modal .ai-purchase-stat-value {
  display: block;
  color: #e2e8f0;
  font-size: 1.35rem;
  font-weight: 800;
}

#ai-wizard-modal .ai-purchase-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  text-decoration: none;
}

#ai-wizard-modal .ai-purchase-cta:hover {
  text-decoration: none;
}

#ai-wizard-modal .ai-purchase-hint {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

#ai-wizard-modal .ai-purchase-pack {
  color: #cbd5e1;
  font-size: 13px;
}

#ai-wizard-modal .ai-deposit-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#ai-wizard-modal .ai-deposit-amount-btn {
  appearance: none;
  border: 1px solid rgba(71, 85, 105, 0.95);
  background: #0f172a;
  color: #e2e8f0;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
}

#ai-wizard-modal .ai-deposit-amount-btn:hover {
  border-color: #22d3ee;
}

#ai-wizard-modal .ai-deposit-amount-btn.is-active {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
  box-shadow: inset 0 0 0 1px #22d3ee;
}

#ai-wizard-modal .ai-deposit-other-wrap label {
  color: #94a3b8;
  display: block;
}

#ai-wizard-modal .ai-deposit-other-wrap .form-control,
#ai-wizard-modal .ai-deposit-other-wrap .input-group-text {
  background: #020617;
  border-color: rgba(51, 65, 85, 0.9);
  color: #e2e8f0;
}

#ai-wizard-modal .ai-deposit-other-wrap .text-muted {
  color: #64748b !important;
}

#ai-wizard-modal .ai-purchase-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  margin: 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#ai-wizard-modal .ai-purchase-divider::before,
#ai-wizard-modal .ai-purchase-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(51, 65, 85, 0.8);
}

#ai-wizard-modal .ai-deposit-method {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

#ai-wizard-modal .ai-deposit-method-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.65);
  cursor: pointer;
  font-weight: 700;
  color: #e2e8f0;
}

#ai-wizard-modal .ai-deposit-method-option:hover {
  border-color: rgba(125, 211, 252, 0.45);
  background: rgba(15, 23, 42, 0.9);
}

#ai-wizard-modal .ai-deposit-method-option input {
  margin: 0;
  flex-shrink: 0;
}

#ai-wizard-modal .ai-deposit-method-option:has(input:checked) {
  border-color: rgba(45, 212, 191, 0.7);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
  background: rgba(8, 47, 45, 0.55);
}

#ai-wizard-modal .ai-deposit-method-text {
  line-height: 1.3;
}

#ai-wizard-modal .ai-wizard-card-element {
  background: #020617;
  border: 1px solid rgba(51, 65, 85, 0.9);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 44px;
}

#ai-wizard-modal .ai-wizard-card-errors {
  min-height: 18px;
  margin-top: 8px;
  color: #fca5a5;
  font-size: 12px;
  text-align: left;
}

#ai-wizard-modal .ai-wizard-deposit-status {
  min-height: 18px;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
}

#ai-wizard-modal .ai-wizard-deposit-status.is-ok {
  color: #6ee7b7;
}

#ai-wizard-modal .ai-purchase-terms {
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
}

#ai-wizard-modal .ai-purchase-terms .custom-control-label {
  color: #cbd5e1;
  line-height: 1.45;
}

#ai-wizard-modal .ai-deposit-terms-link {
  color: #7dd3fc;
  font-weight: 800;
  text-decoration: underline;
}

#ai-wizard-modal .ai-deposit-terms-link:hover {
  color: #bae6fd;
}

.ai-deposit-terms-iframe {
  display: block;
  width: 100%;
  height: min(70vh, 560px);
  border: 0;
  background: #fff;
}

#ai-deposit-terms-modal {
  z-index: 1075;
}

#ai-deposit-terms-modal .ai-deposit-terms-modal-content {
  background: #0b1224;
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

#ai-deposit-terms-modal .ai-deposit-terms-modal-header,
#ai-deposit-terms-modal .ai-deposit-terms-modal-footer {
  border-color: rgba(51, 65, 85, 0.8);
}

#ai-deposit-terms-modal .ai-deposit-terms-modal-header h5 {
  color: #e2e8f0;
  font-weight: 800;
}

#ai-deposit-terms-modal .ai-deposit-terms-modal-close {
  color: #94a3b8;
  text-shadow: none;
  opacity: 1;
}

#ai-wizard-modal .ai-purchase-panel {
  max-width: 480px;
}

#ai-wizard-modal .ai-results-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 0 auto;
  justify-content: flex-end;
}

#ai-wizard-modal .ai-results-usage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

#ai-wizard-modal .ai-results-usage-chip i {
  opacity: 0.9;
}

#ai-wizard-modal .ai-results-usage-chip.is-lineups {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(139, 92, 246, 0.12);
  color: #ddd6fe;
}

#ai-wizard-modal .ai-results-usage-chip.is-lineups i {
  color: #a78bfa;
}

#ai-wizard-modal .ai-results-usage-chip.is-cost {
  border-color: rgba(255, 107, 66, 0.45);
  background: rgba(255, 107, 66, 0.12);
  color: #ffd4c4;
}

#ai-wizard-modal .ai-results-usage-chip.is-cost i {
  color: #ff6b42;
}

#ai-wizard-modal .ai-results-usage-chip.is-balance {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
  color: #bbf7d0;
}

#ai-wizard-modal .ai-results-usage-chip.is-balance i {
  color: #34d399;
}

#ai-wizard-modal .ai-results-usage-chip.is-build {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
}

#ai-wizard-modal .ai-results-usage-chip.is-build i {
  color: #60a5fa;
}

#ai-wizard-modal .ai-results-usage-detail {
  opacity: 0.85;
  font-weight: 500;
}

#ai-wizard-modal .ai-results-portfolio-summary {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
}

#ai-wizard-modal #ai-tab-summary .ai-results-portfolio-summary:last-child,
#ai-wizard-modal #ai-tab-summary .ai-results-strategy-thoughts:last-child {
  margin-bottom: 0;
}

#ai-wizard-modal .ai-results-strategy-thoughts {
  background: rgba(30, 27, 75, 0.45);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
}

#ai-wizard-modal .ai-results-strategy-thoughts-label {
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

#ai-wizard-modal .ai-results-strategy-thoughts-body {
  color: #e2e8f0;
}

#ai-wizard-modal .ai-assistant-log {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  background: rgba(11, 18, 32, 0.55);
  overflow: hidden;
}

#ai-wizard-modal .ai-assistant-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
}

#ai-wizard-modal .ai-assistant-msg {
  max-width: 85%;
  width: fit-content;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

@media (max-width: 767.98px) {
  #ai-wizard-modal .ai-assistant-msg {
    max-width: 92%;
  }
}

#ai-wizard-modal .ai-assistant-msg.is-assistant {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.92);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

#ai-wizard-modal .ai-assistant-msg.is-pool_diff {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(14, 165, 233, 0.12);
}

#ai-wizard-modal .ai-assistant-msg.is-pool_diff .ai-assistant-msg-label {
  color: #7dd3fc;
}

#ai-wizard-modal .ai-assistant-msg.is-user {
  align-self: flex-end;
  background: rgba(255, 107, 66, 0.2);
  border-color: rgba(255, 107, 66, 0.4);
  color: #ffedd5;
  border-bottom-right-radius: 4px;
}

#ai-wizard-modal .ai-assistant-msg-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}

#ai-wizard-modal .ai-assistant-msg.is-user .ai-assistant-msg-label {
  color: #fdba74;
  text-align: right;
}

#ai-wizard-modal .ai-assistant-msg-body {
  font-size: 13px;
  line-height: 1.55;
  white-space: normal;
}

#ai-wizard-modal .ai-assistant-choice-row {
  align-self: flex-end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 85%;
}

@media (max-width: 767.98px) {
  #ai-wizard-modal .ai-assistant-choice-row {
    max-width: 92%;
  }
}

#ai-wizard-modal .ai-assistant-action {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 6px 13px;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#ai-wizard-modal .ai-assistant-action i {
  font-size: 11px;
  margin-right: 5px;
  opacity: 0.9;
}

#ai-wizard-modal .ai-assistant-action.is-modify {
  border: 1px solid rgba(255, 107, 66, 0.45);
  background: rgba(255, 107, 66, 0.12);
  color: #ffb39a;
}

#ai-wizard-modal .ai-assistant-action.is-modify:hover,
#ai-wizard-modal .ai-assistant-action.is-modify:focus {
  border-color: rgba(255, 107, 66, 0.75);
  background: rgba(255, 107, 66, 0.22);
  color: #ffedd5;
  outline: none;
}

#ai-wizard-modal .ai-assistant-action.is-followup {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
}

#ai-wizard-modal .ai-assistant-action.is-followup:hover,
#ai-wizard-modal .ai-assistant-action.is-followup:focus {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(14, 165, 233, 0.22);
  color: #e0f2fe;
  outline: none;
}

#ai-wizard-modal .ai-assistant-action.is-results {
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

#ai-wizard-modal .ai-assistant-action.is-results:hover,
#ai-wizard-modal .ai-assistant-action.is-results:focus {
  border-color: rgba(52, 211, 153, 0.7);
  background: rgba(16, 185, 129, 0.22);
  color: #d1fae5;
  outline: none;
}

#ai-wizard-modal .ai-assistant-composer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.72));
}

#ai-wizard-modal .ai-assistant-composer-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#ai-wizard-modal .ai-assistant-composer-shell:focus-within {
  border-color: rgba(255, 107, 66, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 107, 66, 0.12);
}

#ai-wizard-modal .ai-assistant-composer textarea {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #e2e8f0;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  min-height: 36px;
  max-height: 120px;
  padding: 8px 4px 8px 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

#ai-wizard-modal .ai-assistant-composer textarea::-webkit-scrollbar {
  width: 6px;
}

#ai-wizard-modal .ai-assistant-composer textarea::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

#ai-wizard-modal .ai-assistant-composer textarea::placeholder {
  color: #64748b;
}

#ai-wizard-modal .ai-assistant-composer textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#ai-wizard-modal .ai-assistant-send {
  flex: 0 0 auto;
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b42, #f97316);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

#ai-wizard-modal .ai-assistant-send:hover:not(:disabled),
#ai-wizard-modal .ai-assistant-send:focus:not(:disabled) {
  filter: brightness(1.08);
  outline: none;
}

#ai-wizard-modal .ai-assistant-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

#ai-wizard-modal .ai-assistant-send i {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 13px;
  line-height: 1;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  /* FA paper-plane glyph is optically biased up/right — nudge back to center */
  transform: translate(-58%, -42%);
}

#ai-wizard-modal .ai-portfolio-versions-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-right: 4px;
}

#ai-wizard-modal .ai-portfolio-version-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#ai-wizard-modal .ai-portfolio-version-btn.is-active,
#ai-wizard-modal .ai-portfolio-version-btn:hover:not(.is-new) {
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.12);
}

#ai-wizard-modal .ai-results-shell-head {
  margin-bottom: 12px;
}

#ai-wizard-modal .ai-results-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 12px;
}

#ai-wizard-modal .ai-portfolio-versions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  flex: 0 1 auto;
}

#ai-wizard-modal .ai-portfolio-version-btn.is-new {
  border-style: solid;
  border-color: rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.14);
}

#ai-wizard-modal .ai-portfolio-version-btn.is-new:hover {
  border-color: rgba(56, 189, 248, 0.8);
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.24);
}

#ai-wizard-modal .ai-results-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

#ai-wizard-modal .ai-results-tab-actions {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#ai-wizard-modal .ai-results-inline-btn {
  white-space: nowrap;
  font-size: 12.5px !important;
  padding: 0.4rem 0.75rem !important;
  line-height: 1.35;
  font-weight: 700;
}

#ai-wizard-modal .ai-results-inline-btn i {
  font-size: 12px;
}

#ai-wizard-modal .ai-results-inline-btn.is-export {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
}

#ai-wizard-modal .ai-results-inline-btn.is-export:hover,
#ai-wizard-modal .ai-results-inline-btn.is-export:focus {
  border-color: rgba(52, 211, 153, 0.7);
  background: rgba(16, 185, 129, 0.26);
  color: #ecfdf5;
}

#ai-wizard-modal .ai-results-primary-tabs .nav-link.is-loading,
#ai-wizard-modal .ai-results-tabs .nav-link.is-loading {
  opacity: 0.75;
}

#ai-wizard-modal .tab-pane.is-tab-loading {
  position: relative;
  min-height: 80px;
}

#ai-wizard-modal .ai-tab-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 28, 0.45);
  color: #e2e8f0;
  font-size: 18px;
  border-radius: 8px;
  pointer-events: none;
}

#ai-wizard-modal .ai-lineups-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
}

#ai-wizard-modal .ai-lineups-view-toggle {
  display: inline-flex;
  gap: 0;
  margin-bottom: 0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.55);
  flex: 0 0 auto;
}

#ai-wizard-modal .ai-lineups-portfolio-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-left: auto;
  min-width: 0;
}

#ai-wizard-modal .ai-lineups-stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.3;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.28);
  white-space: nowrap;
}

#ai-wizard-modal .ai-lineups-stat-chip .ai-lineups-stat-label {
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 10px;
}

#ai-wizard-modal .ai-lineups-stat-chip .ai-lineups-stat-value {
  color: #e2e8f0;
  font-weight: 800;
}

#ai-wizard-modal .ai-lineups-stat-chip.is-top {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

#ai-wizard-modal .ai-lineups-stat-chip.is-top .ai-lineups-stat-value {
  color: #a7f3d0;
}

#ai-wizard-modal .ai-lineups-stat-chip.is-bottom {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

#ai-wizard-modal .ai-lineups-stat-chip.is-bottom .ai-lineups-stat-value {
  color: #fecaca;
}

#ai-wizard-modal .ai-lineups-view-btn {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  line-height: 1.3;
}

#ai-wizard-modal .ai-lineups-view-btn.is-active {
  background: rgba(34, 211, 238, 0.18);
  color: #e0f2fe;
}

#ai-wizard-modal .ai-lineups-view-btn:hover:not(.is-active) {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.1);
}

#ai-wizard-modal .ai-exposure-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#ai-wizard-modal .ai-exposure-spot-modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.85);
}

#ai-wizard-modal .ai-exposure-spot-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1.2;
}

#ai-wizard-modal .ai-exposure-spot-btn:hover:not(.is-active) {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.1);
}

#ai-wizard-modal .ai-exposure-spot-btn.is-active {
  color: #ecfeff;
  background: rgba(14, 116, 144, 0.55);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35);
}

#ai-wizard-modal .ai-exposure-filter-input {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 280px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(71, 85, 105, 0.85);
  color: #e2e8f0;
}

#ai-wizard-modal .ai-exposure-filter-select {
  flex: 0 1 140px;
  min-width: 110px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(71, 85, 105, 0.85);
  color: #e2e8f0;
}

#ai-wizard-modal .ai-team-logo {
  vertical-align: middle;
  margin-right: 4px;
}

#ai-wizard-modal .ai-exposure-team-cell {
  white-space: nowrap;
}

#ai-wizard-modal .ai-exposure-team-abbr {
  color: #94a3b8;
  font-size: 11px;
}

#ai-wizard-modal .ai-stack-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

#ai-wizard-modal .ai-stacks-cell {
  line-height: 1.45;
}

#ai-wizard-modal .ai-results-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 8px;
}

#ai-wizard-modal .ai-results-detail-body {
  min-height: 0;
  overflow: auto;
}

#ai-wizard-modal .ai-results-table {
  color: #e2e8f0;
  margin-bottom: 0;
  font-size: 12px;
}

#ai-wizard-modal .ai-results-table thead th {
  position: sticky;
  top: 0;
  background: #0f172a;
  color: #94a3b8;
  border-color: rgba(51, 65, 85, 0.8);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 1;
}

#ai-wizard-modal .ai-results-table td {
  border-color: rgba(51, 65, 85, 0.55);
  vertical-align: top;
}

#ai-wizard-modal .ai-results-players {
  max-width: 420px;
  white-space: normal;
}

#ai-wizard-modal .ai-results-note {
  max-width: 280px;
  color: #94a3b8;
  white-space: normal;
}

#ai-wizard-modal .ai-wizard-footer {
  background: #080e1c;
  border-top: 1px solid rgba(51, 65, 85, 0.7);
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#ai-wizard-modal .ai-wizard-footer > .btn {
  margin: 0;
}

#ai-wizard-modal .ai-btn-label-short {
  display: none;
}

@media (max-width: 767px) {
  #ai-wizard-modal .ai-wizard-footer {
    justify-content: stretch;
    padding: 0.65rem 0.75rem;
    gap: 8px;
  }
  #ai-wizard-modal .ai-wizard-footer > .btn {
    flex: 1 1 0;
    min-width: 0;
    font-size: 12px;
    line-height: 1.2;
    padding: 8px 10px;
    white-space: nowrap;
  }
  #ai-wizard-modal .ai-wizard-footer > .btn i {
    margin-right: 4px;
  }
  #ai-wizard-modal .ai-btn-label-full {
    display: none;
  }
  #ai-wizard-modal .ai-btn-label-short {
    display: inline;
  }
}

#ai-wizard-modal .ai-btn-primary,
body.ai-builder .ai-btn-primary {
  background: linear-gradient(90deg, #22d3ee 0%, #a78bfa 100%);
  border: none;
  color: #ffffff;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 8px;
}

#ai-wizard-modal .ai-btn-primary:hover,
#ai-wizard-modal .ai-btn-primary:focus,
body.ai-builder .ai-btn-primary:hover,
body.ai-builder .ai-btn-primary:focus {
  color: #ffffff;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

#ai-wizard-modal .ai-btn-primary:disabled,
#ai-wizard-modal .ai-btn-primary.disabled,
body.ai-builder .ai-btn-primary:disabled,
body.ai-builder .ai-btn-primary.disabled {
  color: #ffffff;
  opacity: 0.55;
}

#ai-wizard-modal .ai-btn-secondary,
body.ai-builder .ai-btn-secondary {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 16px;
}

#ai-wizard-modal .ai-btn-secondary:hover,
body.ai-builder .ai-btn-secondary:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #fff;
}

/* Mobile sidebar accent for AI Builder accordion */
.overlay-content .standard-dd-cyan {
  color: #22d3ee;
}

/* Keep site mobile nav above the sticky AI runner / minimized dock */
body.ai-builder .overlay-content {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1055;
}

/* Blur page behind configure wizard */
body.ai-builder.modal-open #wrapper,
body.ai-builder.modal-open #fixed-ai-runner {
  filter: blur(5px);
  transition: filter 0.2s ease;
}

body.ai-builder .modal-backdrop {
  background-color: rgba(2, 6, 23, 0.72) !important;
}

body.ai-builder .modal-backdrop.show {
  opacity: 1;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Nested modals (save / alert / payout help) over the wizard */
body.ai-builder.ai-nested-modal-open #ai-wizard-modal.show .ai-wizard-content {
  filter: blur(3.5px) brightness(0.62);
  transition: filter 0.18s ease;
}

body.ai-builder.ai-nested-modal-open #ai-wizard-modal.show .ai-wizard-content::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.52);
  pointer-events: none;
}

/* Alert sitting on top of a save modal — dim the save sheet too */
body.ai-builder.ai-alert-over-nested #ai-save-strategy-modal.show .ai-save-modal-content,
body.ai-builder.ai-alert-over-nested #ai-save-lineups-modal.show .ai-save-modal-content,
body.ai-builder.ai-alert-over-nested #ai-payout-help-modal.show .modal-content {
  filter: blur(2.5px) brightness(0.7);
  transition: filter 0.18s ease;
}

body.ai-builder .modal-backdrop.ai-nested-backdrop {
  background-color: rgba(2, 6, 23, 0.68) !important;
  opacity: 1 !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#ai-wizard-modal {
  z-index: 1060;
}

#ai-wizard-modal .ai-results-toolbar .btn {
  margin-right: 6px;
  margin-bottom: 6px;
}

#ai-wizard-modal .ai-results-primary-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0 0 0.75rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
  position: static;
}

#ai-wizard-modal .ai-results-primary-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

#ai-wizard-modal .ai-results-primary-tabs .nav-link {
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  margin-right: 0;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 13px;
  font-weight: 800;
}

#ai-wizard-modal .ai-results-primary-tabs .nav-link.active {
  color: #031018;
  background: linear-gradient(90deg, #ff6b42, #f97316);
  border-color: transparent;
}

#ai-wizard-modal .ai-results-tabs .nav-link {
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  margin-right: 6px;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 12px;
  font-weight: 700;
}

#ai-wizard-modal .ai-results-tabs .nav-link.active {
  color: #031018;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  border-color: transparent;
}

#ai-wizard-modal .ai-lineup-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(8, 14, 28, 0.65);
}

#ai-wizard-modal .ai-lineup-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-size: 13px;
}

#ai-wizard-modal .ai-lineup-card-note {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 6px;
}

#ai-wizard-modal #ai-results-op-table.op-table,
#ai-wizard-modal .ai-op-lineups-table {
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: #0a1020;
  width: 100%;
  color: #e2e8f0;
}

#ai-wizard-modal #ai-results-op-table .op-header th {
  background: linear-gradient(180deg, #0f2744 0%, #123a5c 100%) !important;
  color: #e0f2fe !important;
  border-bottom: 2px solid rgba(34, 211, 238, 0.55) !important;
  font-size: 11px;
  white-space: nowrap;
}

#ai-wizard-modal #ai-results-op-table .op-player td {
  background: #0b1224;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  vertical-align: middle;
  font-size: 12px;
}

#ai-wizard-modal #ai-results-op-table .op-player:hover td {
  background: #121a33;
}

#ai-wizard-modal #ai-results-op-table .player-name {
  color: #7dd3fc !important;
  cursor: pointer;
}

#ai-wizard-modal #ai-results-op-table .p-team {
  color: #f8fafc;
}

#ai-wizard-modal #ai-results-op-table .lus-total td {
  background: #12182b !important;
  color: #e2e8f0 !important;
  font-weight: 700;
  border-top: 1px solid rgba(34, 211, 238, 0.35);
  border-bottom: 2px solid rgba(167, 139, 250, 0.35);
}

#ai-wizard-modal #ai-results-op-table .op-player.locked-player td {
  background: #10281c !important;
  box-shadow: inset 3px 0 0 #34d399;
}

#ai-wizard-modal #ai-results-op-table .ai-lineup-note-row td {
  background: rgba(8, 14, 28, 0.9);
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  text-align: left;
  padding: 6px 12px 12px;
}

#ai-wizard-modal #ai-results-op-table .value-cell {
  font-weight: 700;
}

#ai-wizard-modal .ai-strategy-list .ai-strategy-chip,
#ai-wizard-modal .ai-strategy-chip {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #7dd3fc;
  margin: 0 6px 6px 0;
}

#ai-save-lineups-modal,
#ai-save-strategy-modal {
  z-index: 1070;
}

.ai-save-modal .modal-dialog {
  max-width: 460px;
}

.ai-save-modal .ai-save-modal-content {
  position: relative;
  background: #0b1224 !important;
  color: #e2e8f0;
  border: 1px solid rgba(34, 211, 238, 0.4) !important;
  border-radius: 14px !important;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.35);
  overflow: hidden;
}

.ai-save-modal .ai-save-modal-scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
}

.ai-save-modal .ai-save-modal-header,
.ai-save-modal .ai-save-modal-body,
.ai-save-modal .ai-save-modal-footer {
  position: relative;
  z-index: 1;
}

.ai-save-modal .ai-save-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, #0e1a33 0%, #1e1b4b 50%, #0e2a4a 100%);
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
  padding: 0.9rem 1.15rem;
}

.ai-save-modal .ai-save-modal-title {
  color: #f8fafc;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.ai-save-modal .ai-save-modal-title i {
  color: #22d3ee;
  margin-right: 8px;
}

.ai-save-modal .ai-save-modal-close {
  color: #f8fafc !important;
  opacity: 0.9;
  text-shadow: none;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  padding: 0 2px;
}

.ai-save-modal .ai-save-modal-close:hover,
.ai-save-modal .ai-save-modal-close:focus {
  color: #22d3ee !important;
  opacity: 1;
}

.ai-save-modal .ai-save-modal-body {
  padding: 1.15rem 1.2rem 0.9rem;
  background: #0b1224;
}

.ai-save-modal .ai-save-field {
  margin-bottom: 0.95rem;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(51, 65, 85, 0.75);
  border-radius: 10px;
}

.ai-save-modal .ai-save-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-save-modal .ai-save-input,
.ai-save-modal .ai-save-input.form-control {
  background: #020617 !important;
  border: 1px solid rgba(71, 85, 105, 0.95) !important;
  color: #e2e8f0 !important;
  border-radius: 8px;
  height: auto;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.ai-save-modal .ai-save-input:focus,
.ai-save-modal .ai-save-input.form-control:focus {
  border-color: rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
  outline: none;
  color: #f8fafc !important;
}

.ai-save-modal select.ai-save-input option {
  background: #020617;
  color: #e2e8f0;
}

.ai-save-modal .ai-save-hint {
  margin: 0.15rem 2px 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

.ai-save-modal .ai-save-modal-footer {
  background: rgba(8, 14, 28, 0.96);
  border-top: 1px solid rgba(34, 211, 238, 0.22);
  padding: 0.9rem 1.15rem;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* AI Builder-only alert modal restyle (shared alert-modal.php unchanged) */
body.ai-builder #alertModal {
  z-index: 1085;
}

body.ai-builder #alertModal .modal-dialog {
  max-width: 440px;
}

body.ai-builder #alertModal .modal-content {
  background: #0b1224 !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(34, 211, 238, 0.4) !important;
  border-radius: 14px !important;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.35);
  overflow: hidden;
}

body.ai-builder #alertModal .modal-header {
  background: linear-gradient(90deg, #0e1a33 0%, #1e1b4b 50%, #0e2a4a 100%);
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
  padding: 0.9rem 1.15rem;
}

body.ai-builder #alertModal .modal-title {
  color: #f8fafc;
  font-size: 1.1rem;
  font-weight: 800;
}

body.ai-builder #alertModal .modal-header .close,
body.ai-builder #alertModal .modal-header .close.text-white {
  color: #f8fafc !important;
  opacity: 0.9;
  text-shadow: none;
}

body.ai-builder #alertModal .modal-header .close:hover,
body.ai-builder #alertModal .modal-header .close:focus {
  color: #22d3ee !important;
  opacity: 1;
}

body.ai-builder #alertModal .modal-body {
  background: #0b1224;
  color: #e2e8f0;
  padding: 1.1rem 1.2rem;
  font-size: 14px;
  line-height: 1.5;
}

body.ai-builder #alertModal .modal-body p {
  margin-bottom: 0.5rem;
  color: #cbd5e1;
}

body.ai-builder #alertModal .modal-body strong {
  color: #f8fafc;
}

body.ai-builder #alertModal .modal-footer {
  background: rgba(8, 14, 28, 0.96);
  border-top: 1px solid rgba(34, 211, 238, 0.22);
  padding: 0.85rem 1.15rem;
  justify-content: flex-end;
}

body.ai-builder #alertModal.sim-modal .modal-footer button,
body.ai-builder #alertModal .modal-footer button {
  background: linear-gradient(90deg, #22d3ee 0%, #a78bfa 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 800;
  padding: 8px 18px !important;
  border-radius: 8px;
  min-width: 88px;
}

body.ai-builder #alertModal.sim-modal .modal-footer button:hover,
body.ai-builder #alertModal .modal-footer button:hover,
body.ai-builder #alertModal.sim-modal .modal-footer button:focus,
body.ai-builder #alertModal .modal-footer button:focus {
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

/* AI confirm modal */
#ai-confirm-modal {
  z-index: 1090;
}

.ai-confirm-modal .modal-dialog {
  max-width: 440px;
}

.ai-confirm-modal .ai-confirm-modal-content {
  position: relative;
  background: #0b1224 !important;
  color: #e2e8f0;
  border: 1px solid rgba(34, 211, 238, 0.4) !important;
  border-radius: 14px !important;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.35);
  overflow: hidden;
}

.ai-confirm-modal .ai-confirm-modal-scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.7;
}

.ai-confirm-modal .ai-confirm-modal-header,
.ai-confirm-modal .ai-confirm-modal-body,
.ai-confirm-modal .ai-confirm-modal-footer {
  position: relative;
  z-index: 1;
}

.ai-confirm-modal .ai-confirm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, #0e1a33 0%, #1e1b4b 50%, #0e2a4a 100%);
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
  padding: 0.9rem 1.15rem;
}

.ai-confirm-modal .ai-confirm-modal-title {
  color: #f8fafc;
  font-size: 1.1rem;
  font-weight: 800;
}

.ai-confirm-modal .ai-confirm-modal-title i {
  color: #22d3ee;
  margin-right: 8px;
}

.ai-confirm-modal.is-danger .ai-confirm-modal-title i {
  color: #f87171;
}

.ai-confirm-modal .ai-confirm-modal-close {
  color: #f8fafc !important;
  opacity: 0.9;
  text-shadow: none;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  padding: 0 2px;
}

.ai-confirm-modal .ai-confirm-modal-close:hover,
.ai-confirm-modal .ai-confirm-modal-close:focus {
  color: #22d3ee !important;
  opacity: 1;
}

.ai-confirm-modal .ai-confirm-modal-body {
  padding: 1.15rem 1.2rem;
  background: #0b1224;
}

.ai-confirm-modal .ai-confirm-message {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
}

.ai-confirm-modal .ai-confirm-message strong {
  color: #f8fafc;
}

.ai-confirm-modal .ai-confirm-modal-footer {
  background: rgba(8, 14, 28, 0.96);
  border-top: 1px solid rgba(34, 211, 238, 0.22);
  padding: 0.85rem 1.15rem;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ai-confirm-modal.is-danger #ai-confirm-ok-btn {
  background: linear-gradient(90deg, #f87171 0%, #fb7185 100%);
}

.ai-confirm-modal.is-danger #ai-confirm-ok-btn:hover,
.ai-confirm-modal.is-danger #ai-confirm-ok-btn:focus {
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.4);
}

/* —— Read-only Configuration tab —— */
#ai-wizard-modal .ai-config-readonly {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

#ai-wizard-modal .ai-config-readonly-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.75));
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.5;
}

#ai-wizard-modal .ai-config-readonly-note > i {
  margin-top: 2px;
  color: #93c5fd;
  font-size: 14px;
  flex: 0 0 auto;
}

#ai-wizard-modal .ai-config-readonly-note p {
  margin: 0;
}

#ai-wizard-modal .ai-config-readonly-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: #7dd3fc;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

#ai-wizard-modal .ai-config-readonly-link:hover,
#ai-wizard-modal .ai-config-readonly-link:focus {
  color: #bae6fd;
  outline: none;
}

#ai-wizard-modal .ai-config-readonly-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#ai-wizard-modal .ai-config-ro-empty,
#ai-wizard-modal .ai-config-ro-muted {
  color: #94a3b8;
  font-size: 13px;
}

#ai-wizard-modal .ai-config-ro-top-row,
#ai-wizard-modal .ai-config-ro-mid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
  align-items: stretch;
}

#ai-wizard-modal .ai-config-ro-top-row > .ai-config-ro-section,
#ai-wizard-modal .ai-config-ro-mid-row > .ai-config-ro-section {
  min-width: 0;
  height: 100%;
}

#ai-wizard-modal .ai-config-ro-section {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(11, 18, 32, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#ai-wizard-modal .ai-config-ro-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.65);
  flex: 0 0 auto;
}

#ai-wizard-modal .ai-config-ro-section-head i {
  color: #fb923c;
  font-size: 12px;
}

#ai-wizard-modal .ai-config-ro-section-head h5 {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e2e8f0;
}

#ai-wizard-modal .ai-config-ro-section-body {
  padding: 10px 12px 12px;
  flex: 1 1 auto;
}

#ai-wizard-modal .ai-config-ro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

#ai-wizard-modal .ai-config-ro-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

#ai-wizard-modal .ai-config-ro-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

#ai-wizard-modal .ai-config-ro-k {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

#ai-wizard-modal .ai-config-ro-v {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
  word-break: break-word;
}

#ai-wizard-modal .ai-config-ro-contest-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 200px);
  gap: 12px;
  align-items: start;
}

#ai-wizard-modal .ai-config-ro-contest-main {
  min-width: 0;
}

#ai-wizard-modal .ai-config-ro-quote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #fb923c;
  border-radius: 0 8px 8px 0;
  background: rgba(255, 107, 66, 0.08);
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
}

#ai-wizard-modal .ai-config-ro-constraint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

#ai-wizard-modal .ai-config-ro-constraint-block {
  min-width: 0;
}

#ai-wizard-modal .ai-config-ro-constraint-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 5px;
}

#ai-wizard-modal .ai-config-ro-expo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#ai-wizard-modal .ai-config-ro-expo-global {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

#ai-wizard-modal .ai-config-ro-expo-global-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

#ai-wizard-modal .ai-config-ro-expo-global-value {
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
}

#ai-wizard-modal .ai-config-ro-expo .ai-config-ro-constraint-block {
  margin: 0;
}

#ai-wizard-modal .ai-config-ro-chips {
  max-height: 96px;
}

#ai-wizard-modal .ai-config-ro-chips .ai-empty-chip {
  display: inline-block;
  margin-top: 0;
}

#ai-wizard-modal .ai-config-ro-ladder {
  min-width: 0;
}

#ai-wizard-modal .ai-config-ro-ladder-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 5px;
}

#ai-wizard-modal .ai-config-ro-ladder-scroll {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
}

#ai-wizard-modal .ai-config-ro-ladder-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#ai-wizard-modal .ai-config-ro-ladder-table thead th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.96);
  z-index: 1;
}

#ai-wizard-modal .ai-config-ro-ladder-table th,
#ai-wizard-modal .ai-config-ro-ladder-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
  color: #e2e8f0;
}

#ai-wizard-modal .ai-config-ro-ladder-table th {
  color: #94a3b8;
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#ai-wizard-modal .ai-config-ro-ladder-table td:last-child,
#ai-wizard-modal .ai-config-ro-ladder-table th:last-child {
  text-align: right;
}

@media (max-width: 900px) {
  #ai-wizard-modal .ai-config-ro-top-row,
  #ai-wizard-modal .ai-config-ro-mid-row {
    grid-template-columns: 1fr;
  }

  #ai-wizard-modal .ai-config-ro-contest-split {
    grid-template-columns: 1fr;
  }

  #ai-wizard-modal .ai-config-ro-ladder-scroll {
    max-height: 180px;
  }
}

@media (max-width: 575.98px) {
  #ai-wizard-modal .ai-config-ro-grid,
  #ai-wizard-modal .ai-config-ro-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #ai-wizard-modal .ai-config-ro-constraint-grid {
    grid-template-columns: 1fr;
  }

  #ai-wizard-modal .ai-config-readonly-note {
    padding: 9px 10px;
    font-size: 12px;
  }
}

/* Results shell: fill modal body; scroll only inside tab content (no outer wheel) */
#ai-wizard-modal .ai-wizard-body.is-results-view {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-wizard-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-wizard-results {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-primary-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-primary-content > .tab-pane.active {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#ai-wizard-modal .ai-wizard-body.is-results-view #ai-tab-summary .ai-assistant-log {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

#ai-wizard-modal .ai-wizard-body.is-results-view #ai-tab-config .ai-config-readonly {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

#ai-wizard-modal .ai-wizard-body.is-results-view #ai-tab-results-shell {
  gap: 0;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-shell-head {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-tabs {
  flex: 0 0 auto;
  margin-bottom: 0.75rem !important;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-tab-content > .tab-pane.active {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-lineups-toolbar,
#ai-wizard-modal .ai-wizard-body.is-results-view .ai-exposure-filters {
  flex: 0 0 auto;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-lineups-view {
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-table-wrap,
#ai-wizard-modal .ai-wizard-body.is-results-view .ai-results-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

/* AI Builder only: refresh projections next to select-all in player pool header */
body.ai-builder #main-op .op-header .check-lock {
  width: 110px;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1;
}

body.ai-builder #main-op .op-header .check-lock #all-players-checkbox,
body.ai-builder #main-op .op-header .check-lock .ai-pool-refresh-btn {
  vertical-align: middle;
}

body.ai-builder .ai-pool-refresh-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0 0 0 11px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  vertical-align: middle;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.ai-builder .ai-pool-refresh-btn:hover,
body.ai-builder .ai-pool-refresh-btn:focus {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 107, 66, 0.45);
  color: #ffb39a;
  outline: none;
}

body.ai-builder .ai-pool-refresh-btn i {
  pointer-events: none;
}

@media (max-width: 576px) {
  body.ai-builder #main-op .op-header .check-lock {
    width: 86px;
  }

  body.ai-builder .ai-pool-refresh-btn {
    width: 32px;
    height: 32px;
    margin-left: 8px;
    font-size: 13px;
    border-radius: 8px;
  }
}
