/* ═══════════════════════════════════════════════════════════════════
   MY REPERTOIRES (Personal Opening Repertoire Builder & Trainer)
   ═══════════════════════════════════════════════════════════════════ */

.rep-container {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.rep-nav-breadcrumb {
  font-size: 13px;
  color: var(--accent);
  background: rgba(173, 98, 255, 0.12);
  border: 1px solid rgba(173, 98, 255, 0.25);
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 12px;
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   VIEW A: REPERTOIRE LIST
   ───────────────────────────────────────────────────────────── */
.rep-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.rep-page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 6px;
}

.rep-page-subtitle {
  font-size: 14px;
  color: var(--text2);
  max-width: 650px;
  line-height: 1.5;
}

.rep-list-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rep-filter-pills {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.rep-pill-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rep-pill-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.rep-pill-btn.active {
  background: var(--accent);
  color: #0e0c14;
  font-weight: 600;
}

/* Grid of Repertoire Cards */
.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.rep-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.rep-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  opacity: 0;
  transition: opacity 0.2s;
}

.rep-card:hover {
  transform: translateY(-3px);
  border-color: rgba(173, 98, 255, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 16px rgba(173, 98, 255, 0.1);
}

.rep-card:hover::before {
  opacity: 1;
}

.rep-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rep-color-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
}

.rep-color-badge.white {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.rep-color-badge.black {
  background: rgba(173, 98, 255, 0.15);
  color: #d4b3ff;
  border: 1px solid rgba(173, 98, 255, 0.3);
}

.rep-eco-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  background: rgba(173, 98, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.rep-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.3;
}

.rep-card-sub {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-card-moves-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 16px;
}

.rep-card-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text2);
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

.rep-stat-col strong {
  color: #fff;
  margin-right: 4px;
}

.rep-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.rep-card-actions .bento-btn {
  padding: 8px 12px;
  font-size: 12px;
}

.rep-card-btn-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: 6px;
  padding: 0 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.rep-card-btn-del:hover {
  background: rgba(229, 80, 80, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

/* Empty State */
.rep-empty-state {
  grid-column: 1 / -1;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rep-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.rep-empty-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.rep-empty-desc {
  font-size: 14px;
  color: var(--text2);
  max-width: 480px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────
   VIEW B: WIZARD
   ───────────────────────────────────────────────────────────── */
.rep-wizard-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.rep-wizard-header {
  margin-bottom: 28px;
}

.rep-wizard-step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(173, 98, 255, 0.12);
  border: 1px solid rgba(173, 98, 255, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.rep-wizard-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.rep-wizard-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.5;
}

.rep-wizard-group {
  margin-bottom: 24px;
}

.rep-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.rep-form-hint {
  display: block;
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

.rep-color-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.rep-color-choice {
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.rep-color-choice:hover {
  border-color: rgba(173, 98, 255, 0.5);
  background: rgba(28, 24, 40, 0.8);
}

.rep-color-choice.active {
  border-color: var(--accent);
  background: rgba(173, 98, 255, 0.08);
  box-shadow: 0 0 18px rgba(173, 98, 255, 0.15);
}

.rep-color-icon {
  font-size: 32px;
  line-height: 1;
}

.rep-color-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.rep-color-sub {
  font-size: 12px;
  color: var(--text2);
}

.rep-color-radio {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.2s;
}

.rep-color-choice.active .rep-color-radio {
  border-color: var(--accent);
  background: var(--accent);
  color: #0e0c14;
}

.rep-text-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  transition: border-color 0.2s;
}

.rep-text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(173, 98, 255, 0.15);
}

/* Wizard Board Row */
.rep-wizard-board-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.rep-wizard-board-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rep-mini-cg-board {
  width: 280px;
  height: 280px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.rep-board-turn-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg3);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.turn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.rep-feedback-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.rep-feedback-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 10px;
}

.rep-root-chips {
  display: flex;
  gap: 10px;
}

.rep-move-chip {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.rep-move-chip.placeholder {
  color: var(--text3);
  border-style: dashed;
}

.rep-eco-preview {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(173, 98, 255, 0.08);
  border: 1px solid rgba(173, 98, 255, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
}

.rep-eco-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

.rep-eco-name {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.rep-auto-badge {
  font-size: 11px;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.rep-wizard-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─────────────────────────────────────────────────────────────
   VIEW C & D: WORKSPACE (EDITOR & STUDY)
   ───────────────────────────────────────────────────────────── */
.rep-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.rep-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rep-color-pill, .rep-eco-pill, .rep-depth-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.rep-color-pill {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.rep-eco-pill {
  background: rgba(173, 98, 255, 0.15);
  color: var(--accent);
}

.rep-depth-pill {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text2);
}

.rep-header-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.rep-header-sub {
  font-size: 13px;
  color: var(--text2);
}

.rep-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 2-Column Workspace Grid */
.rep-workspace-grid {
  display: grid;
  grid-template-columns: minmax(540px, 600px) 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .rep-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Board Column */
#page-my-repertoires .rep-board-col {
  width: 100%;
  max-width: 600px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#page-my-repertoires .rep-board-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  width: 100%;
  max-width: 600px;
  min-width: 0;
  box-sizing: border-box;
}

/* Right Side Column (Header + Tools Tabs) */
.rep-side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

#page-my-repertoires .rep-board-card.flash-success {
  border-color: #4ade80 !important;
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.35) !important;
}

#page-my-repertoires .rep-board-card.flash-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.35) !important;
}

.rep-board-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-eval-hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text2);
}

.rep-cg-board-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
  aspect-ratio: 1 / 1;
}

.rep-main-cg-board {
  width: 100%;
  max-width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

/* Board Navigation Bar */
.rep-board-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}

.rep-nav-btn-group {
  display: flex;
  gap: 4px;
}

.rep-nav-icon-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.rep-nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.rep-btn-delete-node {
  background: transparent;
  border: 1px solid transparent;
  color: var(--danger);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.rep-btn-delete-node:hover {
  background: rgba(229, 80, 80, 0.12);
  border-color: var(--danger);
}

/* Line Breadcrumbs */
.rep-breadcrumb-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.rep-bc-title,
.rep-bc-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  white-space: nowrap;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.rep-bc-track,
.rep-breadcrumb-moves {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  flex: 1;
  padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.rep-breadcrumb-moves::-webkit-scrollbar,
.rep-bc-track::-webkit-scrollbar {
  height: 4px;
}

.rep-breadcrumb-moves::-webkit-scrollbar-track,
.rep-bc-track::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.rep-breadcrumb-moves::-webkit-scrollbar-thumb,
.rep-bc-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

.rep-breadcrumb-moves::-webkit-scrollbar-thumb:hover,
.rep-bc-track::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.65);
}

.rep-bc-move {
  color: var(--text2);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.rep-bc-move:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.rep-bc-move.active {
  color: #0e0c14;
  background: var(--accent);
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────
   RIGHT COLUMN: TABS & TOOLS
   ───────────────────────────────────────────────────────────── */
.rep-tabs-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

.rep-panel-tabs {
  display: flex;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.rep-tab-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.rep-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.rep-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(173, 98, 255, 0.05);
}

.rep-tab-content {
  display: none;
}

.rep-tab-content.active {
  display: block;
}

.rep-tab-inner {
  padding: 20px;
}

.rep-section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.rep-panel-heading {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.rep-panel-subheading {
  font-size: 12px;
  color: var(--text2);
}

.rep-badge-count {
  font-size: 11px;
  color: var(--accent);
  background: rgba(173, 98, 255, 0.12);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* Candidate Moves List */
.rep-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.rep-candidate-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rep-candidate-item:hover {
  border-color: var(--accent);
  background: rgba(173, 98, 255, 0.08);
  transform: translateX(3px);
}

.rep-cand-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rep-cand-san {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.rep-cand-freq {
  font-size: 11px;
  color: var(--text2);
  background: var(--bg2);
  padding: 2px 8px;
  border-radius: 4px;
}

.rep-cand-rate-bar {
  display: flex;
  width: 90px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: #333;
}

.rep-rate-w { background: #fff; }
.rep-rate-d { background: #888; }
.rep-rate-b { background: var(--accent); }

.rep-manual-move-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(173, 98, 255, 0.06);
  border: 1px solid rgba(173, 98, 255, 0.2);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}

/* Tree Explorer View */
.rep-tree-container {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.rep-tree-node-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s;
}

.rep-tree-node-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.rep-tree-node-item.active {
  background: rgba(173, 98, 255, 0.2);
  color: var(--accent);
  font-weight: 700;
}

/* PGN Dropzone */
.rep-dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg3);
  margin-top: 14px;
  margin-bottom: 16px;
}

.rep-dropzone:hover, .rep-dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(173, 98, 255, 0.08);
}

.rep-dropzone-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.rep-dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.rep-dropzone-sub {
  font-size: 12px;
  color: var(--text2);
}

.rep-accordion-trigger {
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.rep-accordion-trigger:hover {
  color: var(--text);
}

.rep-import-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
  margin-top: 16px;
}

.rep-import-result-card {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}

.rep-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #4ade80;
  margin-bottom: 12px;
}

.rep-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
  background: var(--bg3);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.rep-result-stat .stat-val {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.rep-result-stat .stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text3);
}

.rep-result-msg {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   STOCKFISH 18 EVALUATION BAR & ENGINE ADVISOR
   ═══════════════════════════════════════════════════════════════ */

.rep-board-eval-container {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.rep-eval-bar-track {
  width: 22px;
  min-width: 22px;
  background: #1e1e1e;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.2s ease;
}

/* Lila-style vertical flip when board orientation is Black */
.rep-eval-bar-track.reverse {
  transform: rotateX(180deg);
}

.rep-eval-bar-fill {
  background: #ffffff;
  width: 100%;
  height: 50%;
  margin-top: auto;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.rep-eval-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: #0f172a;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
  z-index: 2;
}

/* Counter-rotate text so score remains upright and vertically centered */
.rep-eval-bar-track.reverse .rep-eval-bar-text {
  transform: rotateX(180deg) translate(-50%, -50%) rotate(-90deg);
}

/* Engine Advisor Card */
.rep-engine-advisor-card {
  background: var(--bg2, #181a20);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.rep-engine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rep-engine-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rep-engine-icon {
  font-size: 16px;
}

.rep-engine-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1, #f8fafc);
  letter-spacing: 0.3px;
}

.rep-engine-status-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.rep-engine-status-tag.cached {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.rep-engine-status-tag.thinking {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.3);
  animation: repPulse 1.5s infinite;
}

@keyframes repPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Engine Toggle Switch */
.rep-engine-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rep-engine-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.rep-engine-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.rep-engine-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s;
  border-radius: 18px;
}

.rep-engine-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.rep-engine-switch input:checked + .rep-engine-slider {
  background-color: #3b82f6;
}

.rep-engine-switch input:checked + .rep-engine-slider:before {
  transform: translateX(14px);
}

.rep-engine-switch-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3, #94a3b8);
  user-select: none;
}

/* Stats Bento Grid */
.rep-engine-stats-bento {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.rep-engine-bento-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  transition: background 0.15s;
}

.rep-engine-bento-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.bento-metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3, #94a3b8);
  display: block;
}

.bento-metric-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text1, #f8fafc);
  margin-top: 3px;
  display: block;
}

.bento-metric-val.highlight {
  color: #4ade80;
}

.bento-metric-val.pos {
  color: #60a5fa;
}

.bento-metric-val.neg {
  color: #f87171;
}

.rep-engine-pv-bar {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.pv-tag {
  font-weight: 700;
  color: var(--text3, #94a3b8);
  font-family: 'IBM Plex Mono', monospace;
}

.pv-moves {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text2, #cbd5e1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   DESIGN 1: REPERTOIRE STUDY STUDIO (FULL-WIDTH WORKSPACE)
   ═══════════════════════════════════════════════════════════════ */

.rep-studio-view {
  width: 100%;
  max-width: 100% !important;
  padding: 0;
}

.rep-studio-header {
  margin-bottom: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

.rep-variation-pill {
  font-size: 11px;
  font-weight: 700;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Compact Engine Header Pill */
.rep-study-engine-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 8px;
}

.rep-engine-eval-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #4ade80;
  padding: 2px 6px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 4px;
  min-width: 48px;
  text-align: center;
}

.rep-engine-eval-badge.neg {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
}

.rep-engine-eval-badge.pos {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
}

.rep-engine-eval-badge.off {
  color: var(--text3);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

/* Studio 2-Column Full Width Grid */
.rep-studio-grid {
  display: grid;
  grid-template-columns: minmax(440px, 580px) 1fr;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

@media (max-width: 1080px) {
  .rep-studio-grid {
    grid-template-columns: 1fr;
  }
}

.rep-studio-reading-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* Studio Cards */
.rep-studio-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rep-studio-card:hover {
  border-color: rgba(173, 98, 255, 0.25);
}

.rep-studio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rep-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rep-card-icon {
  font-size: 24px;
}

.rep-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0;
}

.rep-card-subtitle {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
  margin-bottom: 0;
}

/* Interactive Opponent Branch Continuation Buttons */
.rep-branch-buttons-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.rep-branch-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.rep-branch-btn:hover {
  background: rgba(173, 98, 255, 0.12);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(173, 98, 255, 0.15);
}

.rep-branch-btn.active {
  background: rgba(173, 98, 255, 0.2);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(173, 98, 255, 0.3);
}

.rep-branch-btn-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-branch-btn-move {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.rep-branch-btn-freq {
  font-size: 11px;
  color: var(--text3);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.rep-branch-btn-var {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #c084fc;
  font-weight: 700;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.rep-branch-btn-var .var-eco {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 2px;
}

.rep-branch-btn-comment {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
  margin-top: 2px;
}

.rep-branch-empty-msg {
  color: var(--text3);
  font-size: 13px;
  padding: 14px;
  background: var(--bg3);
  border-radius: 8px;
  text-align: center;
}

/* Dual Synchronized Move Commentary Cards */
.rep-dual-notes-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rep-dual-note-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  transition: all 0.2s ease;
  position: relative;
}

.rep-dual-note-card.active-ply {
  border-color: rgba(173, 98, 255, 0.5);
  background: rgba(173, 98, 255, 0.05);
}

.rep-note-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rep-note-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rep-note-color-badge {
  font-size: 14px;
}

.rep-note-move-heading {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
}

.rep-note-quick-edit-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rep-note-quick-edit-btn:hover {
  color: #fff;
  border-color: var(--accent);
  background: rgba(173, 98, 255, 0.15);
}

.rep-note-content-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.rep-note-empty-text {
  color: var(--text3);
  font-style: italic;
  font-size: 13px;
}

/* Board Navigation Bar (Under Board) */
.rep-study-nav-bar {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.rep-study-nav-bar .rep-nav-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
}

.rep-nav-icon-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rep-nav-icon-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.rep-nav-flip-btn {
  background: rgba(173, 98, 255, 0.1);
  border-color: rgba(173, 98, 255, 0.25);
  color: var(--accent);
}

.rep-nav-flip-btn:hover {
  background: rgba(173, 98, 255, 0.2);
  border-color: var(--accent);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE STUDY MODE RESPONSIVENESS (<= 768px)
   Strictly mobile-only: Desktop PC browser layout is 100% untouched
   ══════════════════════════════════════════════════════════════════════ */
.rep-mobile-return-btn {
  display: none;
}

@media (max-width: 768px) {
  .rep-mobile-return-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--text1, #fff) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
  }

  .rep-mobile-return-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
  }

  /* When rep-view-study is visible, turn it into a flex column on mobile */
  #rep-view-study:not([style*="display: none"]) {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 4px 32px !important;
  }

  /* Make .rep-studio-grid transparent so its sub-items participate directly in #rep-view-study flex ordering */
  #rep-view-study .rep-studio-grid,
  #rep-view-study .rep-board-col,
  #rep-view-study .rep-board-card,
  #rep-view-study .rep-side-col,
  #rep-view-study .rep-studio-reading-col {
    display: contents !important;
  }

  /* 1. TOP FIRST AND UNMOVABLE: The Board */
  #rep-view-study .rep-study-board-pinned-wrap {
    order: 1 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: var(--bg2, #131b2e) !important;
    padding: 6px 8px 8px !important;
    margin: 0 -4px !important;
    border-radius: 0 0 12px 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: calc(100% + 8px) !important;
    box-sizing: border-box !important;
  }

  #rep-view-study .rep-board-meta-bar {
    width: 100% !important;
    max-width: min(calc(100vw - 20px), 360px, 40vh) !important;
    margin-bottom: 4px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  #rep-view-study .rep-meta-bar-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  /* Hide evaluation bar track on mobile — keep only numeric meter badge */
  #rep-view-study .rep-eval-bar-track {
    display: none !important;
  }

  #rep-view-study .rep-board-eval-container {
    width: 100% !important;
    max-width: min(calc(100vw - 20px), 360px, 40vh) !important;
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    justify-content: center !important;
  }

  #rep-view-study .rep-cg-board-wrapper {
    flex: 1 !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    position: relative !important;
  }

  /* 2. UNDER THAT: The Controls */
  #rep-view-study .rep-board-nav-bar.rep-study-nav-bar {
    order: 2 !important;
    width: 100% !important;
    margin: 2px 0 0 !important;
    padding: 6px 6px !important;
    background: var(--bg2, #131b2e) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  #rep-view-study .rep-nav-btn-group {
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }

  #rep-view-study .rep-nav-icon-btn {
    flex: 1 !important;
    padding: 7px 3px !important;
    font-size: 11px !important;
    text-align: center !important;
    justify-content: center !important;
    min-height: 36px !important;
    white-space: nowrap !important;
  }

  /* 3. UNDER THAT: Possible Moves (Opponent Continuations - 2 per line, smaller square format) */
  #rep-view-study #rep-study-continuations-card {
    order: 3 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
  }

  #rep-view-study .rep-branch-buttons-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  #rep-view-study .rep-branch-btn {
    padding: 8px 10px !important;
    min-height: 52px !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }

  #rep-view-study .rep-branch-btn-move {
    font-size: 14px !important;
  }

  #rep-view-study .rep-branch-btn-var {
    font-size: 10px !important;
    padding: 1px 4px !important;
    margin-top: 2px !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Hide frequency and comments on mobile for square compactness */
  #rep-view-study .rep-branch-btn-freq,
  #rep-view-study .rep-branch-btn-comment {
    display: none !important;
  }

  #rep-view-study .rep-studio-card-header {
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
  }

  #rep-view-study .rep-card-icon {
    font-size: 18px !important;
  }

  #rep-view-study .rep-card-title {
    font-size: 13px !important;
  }

  #rep-view-study .rep-card-subtitle {
    font-size: 11px !important;
  }

  /* Mobile Repertoires: Study-only mode (hide editor buttons & new study button) */
  .rep-editor-btn,
  .rep-list-actions .bento-btn-primary,
  #rep-btn-return-editor,
  .rep-note-quick-edit-btn {
    display: none !important;
  }

  .rep-card-actions {
    display: flex !important;
  }

  .rep-card-actions .bento-btn-secondary {
    flex: 1 !important;
    justify-content: center !important;
  }

  #rep-study-mobile-eval {
    font-size: 11px !important;
    padding: 2px 7px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-family: 'IBM Plex Mono', monospace !important;
  }

  /* 4. UNDER THOSE THE REST: Header card with return to editor & engine */
  #rep-view-study .rep-editor-header.rep-studio-header {
    order: 4 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  #rep-view-study .rep-header-actions {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  /* 5. UNDER THOSE THE REST: Current line breadcrumbs */
  #rep-view-study .rep-breadcrumb-box {
    order: 5 !important;
    width: 100% !important;
    margin: 0 !important;
    background: var(--bg2, #131b2e) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
  }

  #rep-view-study .rep-breadcrumb-moves {
    font-size: 12px !important;
  }

  /* 6. UNDER THOSE THE REST: Dual move commentary notes */
  #rep-view-study .rep-dual-notes-card {
    order: 6 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px 20px !important;
    box-sizing: border-box !important;
  }

  #rep-view-study .rep-dual-notes-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* M1: Hide study top header subtitle */
  #rep-view-study #rep-study-sub {
    display: none !important;
  }

  /* M2: Hide continuations card subtitle */
  #rep-view-study #rep-continuations-subtitle {
    display: none !important;
  }

  /* M3: Hide dual commentary card subtitle */
  #rep-view-study .rep-dual-notes-card .rep-card-subtitle {
    display: none !important;
  }

  /* M4: Compact empty annotation placeholder */
  #rep-view-study .rep-note-empty-text {
    font-size: 11px !important;
    opacity: 0.8 !important;
  }

  /* M6: Compact study header & badges */
  #rep-view-study .rep-editor-header.rep-studio-header {
    padding: 8px 10px !important;
  }

  #rep-view-study .rep-header-badges {
    gap: 4px !important;
    flex-wrap: wrap !important;
  }

  #rep-view-study #rep-study-color-pill,
  #rep-view-study #rep-study-eco-pill,
  #rep-view-study #rep-study-variation-pill {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  #rep-view-study #rep-study-title {
    font-size: 15px !important;
    margin-top: 2px !important;
  }

  /* M7: Hide 'LINE:' label prefix to give more horizontal room to breadcrumb moves */
  #rep-view-study .rep-bc-label {
    display: none !important;
  }
}

/* M5: Icon-only nav buttons on small screens */
@media (max-width: 600px) {
  #rep-view-study .rep-nav-label {
    display: none !important;
  }

  #rep-view-study .rep-nav-icon-btn {
    font-size: 14px !important;
    padding: 8px 4px !important;
  }
}

/* M8: Side-by-side note cards for landscape phones and small tablets */
@media (min-width: 480px) and (max-width: 768px) {
  #rep-view-study .rep-dual-notes-container {
    flex-direction: row !important;
    gap: 8px !important;
  }

  #rep-view-study .rep-dual-note-card {
    flex: 1 !important;
    min-width: 0 !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   MOVE-BY-MOVE STAGE DRILL STYLES
   ═══════════════════════════════════════════════════════════════════ */

.rep-drill-container {
  width: 100%;
}

.rep-drill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rep-drill-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rep-drill-pill {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.rep-drill-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  margin: 0 0 4px 0;
  color: var(--text1);
}

.rep-drill-sub {
  font-size: 13px;
  color: var(--text2);
  margin: 0;
}

.rep-drill-tab-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rep-drill-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.rep-drill-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.rep-drill-tab.active {
  background: rgba(234, 179, 8, 0.15);
  border-color: #facc15;
  color: #fef08a;
}

.rep-drill-tab-count {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ── Stage Cards Grid ── */
.rep-drill-stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.rep-stage-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rep-stage-card:hover:not(.locked) {
  transform: translateY(-2px);
  border-color: rgba(234, 179, 8, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.rep-stage-card.completed {
  border-color: rgba(234, 179, 8, 0.4);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.04), rgba(255, 255, 255, 0.01));
}

.rep-stage-card.in_progress {
  border-color: rgba(56, 189, 248, 0.4);
}

.rep-stage-card.locked {
  opacity: 0.6;
  filter: grayscale(0.4);
}

.rep-stage-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-stage-num-chip {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text2);
}

.rep-stage-vars-chip {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text3);
}

.rep-stage-title-wrap h4 {
  margin: 0 0 2px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text1);
}

.rep-stage-desc {
  font-size: 12px;
  color: var(--text3);
}

.rep-stage-status-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.rep-stage-status-badge.completed {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.rep-stage-status-badge.in-progress {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.rep-stage-status-badge.locked {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text3);
}

.rep-stage-status-badge.ready {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.rep-stage-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.rep-stage-card-actions .bento-btn {
  flex: 1;
  justify-content: center;
}

/* ── Full-Page Drill Studio Workspace ── */
.rep-drill-board-modal.rep-drill-studio {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #090d16;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.rep-drill-board-card.rep-drill-studio-card {
  background: #0d121f;
  border: none;
  border-radius: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rep-drill-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.rep-drill-stage-badge {
  font-weight: 700;
  font-size: 13.5px;
  color: #facc15;
  margin-right: 10px;
}

.rep-drill-pos-counter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: var(--text3);
}

.rep-drill-source-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 500;
  margin-left: 12px;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-drill-attempts-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rep-drill-attempts-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
}

.rep-drill-attempt-dots {
  display: flex;
  gap: 5px;
}

.rep-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.2s ease;
}

.rep-dot.active {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.rep-dot.used {
  background: rgba(255, 255, 255, 0.15);
}

.rep-drill-split {
  flex: 1;
  display: flex;
  gap: 28px;
  padding: 20px 28px;
  overflow: hidden;
  box-sizing: border-box;
}

.rep-drill-board-col {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
}

.rep-drill-board-wrapper {
  width: min(calc(100vh - 120px), calc(100vw - 520px), 700px);
  height: min(calc(100vh - 120px), calc(100vw - 520px), 700px);
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rep-drill-board-wrapper .cg-board-wrap {
  width: 100% !important;
  height: 100% !important;
}

.rep-drill-info-col {
  width: 440px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  height: 100%;
  overflow-y: auto;
  padding-right: 6px;
}

/* Theory Candidate Moves Panel */
.rep-drill-candidates-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rep-drill-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-drill-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rep-drill-box-sub {
  font-size: 11px;
  color: var(--text3);
}

.rep-drill-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rep-drill-cand-item {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 9px 12px;
  gap: 4px;
  transition: all 0.2s ease;
}

.rep-drill-cand-item.target {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
}

.rep-drill-cand-item.tested {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.rep-drill-cand-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-drill-cand-san {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
}

.rep-drill-cand-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.rep-drill-cand-badge.target {
  background: #38bdf8;
  color: #0b0f19;
}

.rep-drill-cand-badge.tested {
  background: #10b981;
  color: #0b0f19;
}

.rep-drill-cand-badge.upcoming {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text3);
}

.rep-drill-cand-note {
  font-size: 11.5px;
  color: var(--text2);
  line-height: 1.4;
  font-style: italic;
}

/* Author Commentary Card */
.rep-drill-author-box {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rep-drill-author-comment {
  font-size: 12.5px;
  line-height: 1.5;
  color: #e2e8f0;
  max-height: 120px;
  overflow-y: auto;
}

.rep-drill-breadcrumbs {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  font-family: 'IBM Plex Mono', monospace;
}

.rep-bc-root {
  color: var(--text3);
}

.rep-bc-move {
  color: var(--text1);
  font-weight: 600;
}

.rep-bc-target {
  color: #38bdf8;
  font-weight: 700;
}

.rep-drill-prompt-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.rep-drill-prompt-box.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.rep-drill-prompt-box.mistake {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  animation: drillShake 0.35s ease;
}

.rep-drill-prompt-box.requeued {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

@keyframes drillShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.rep-drill-turn-label {
  font-size: 13px;
  font-weight: 700;
  color: #facc15;
  margin-bottom: 6px;
}

.rep-drill-feedback-msg {
  font-size: 13.5px;
  color: var(--text1);
  line-height: 1.4;
}

.rep-drill-board-controls {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

/* ── Mistakes Bank Cards ── */
.rep-drill-mistakes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.rep-mistake-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rep-mistake-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-mistake-stage-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.rep-mistake-date {
  font-size: 11px;
  color: var(--text3);
}

.rep-mistake-line {
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
}

.rep-mistake-comparison {
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
}

.rep-cmp-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rep-cmp-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text3);
}

.rep-cmp-val {
  font-size: 14px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
}

.rep-cmp-item.wrong .rep-cmp-val {
  color: #f87171;
}

.rep-cmp-item.right .rep-cmp-val {
  color: #34d399;
}

/* ── History Table ── */
.rep-drill-history-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.rep-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.rep-history-table th,
.rep-history-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rep-history-table th {
  color: var(--text3);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
}

.rep-acc-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.rep-acc-badge.high {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.rep-acc-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Celebration card */
.rep-drill-celebration-card {
  padding: 32px 24px;
  text-align: center;
  max-width: 440px;
  margin: auto;
}

/* ── Mobile Responsiveness ── */
@media (max-width: 768px) {
  .rep-drill-split {
    flex-direction: column;
    padding: 12px;
  }
  .rep-drill-board-col {
    width: 100%;
  }
  .rep-drill-board-wrapper {
    width: min(calc(100vw - 48px), 420px);
    height: min(calc(100vw - 48px), 420px);
    margin: 0 auto;
  }
  .rep-drill-stages-grid {
    grid-template-columns: 1fr;
  }
  .rep-drill-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .rep-drill-tab-group {
    width: 100%;
  }
  .rep-drill-tab {
    flex: 1;
    justify-content: center;
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* ── Stages Completion Progress Meter ── */
.rep-drill-meter-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rep-drill-meter-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rep-drill-meter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
}

.rep-drill-meter-status {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 3px 0 0 0;
}

.rep-drill-meter-chips {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rep-meter-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.rep-meter-chip.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.rep-meter-chip.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.rep-meter-chip.locked {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rep-drill-meter-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.rep-drill-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* ── Interactive Mistakes Hover Boards ── */
.rep-mistake-line.rep-hover-board,
.rep-cmp-item.rep-hover-board {
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.rep-mistake-line.rep-hover-board:hover {
  background: rgba(56, 189, 248, 0.08);
  border-radius: 6px;
}

.rep-cmp-item.wrong.rep-hover-board:hover {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.rep-cmp-item.right.rep-hover-board:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.rep-hover-hint {
  font-size: 10.5px;
  color: var(--text3);
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.rep-hover-board:hover .rep-hover-hint {
  opacity: 1;
  color: #38bdf8;
}

/* ── Floating Mini-Chessboard Tooltip for Mistakes Bank ── */
.rep-drill-mini-tooltip {
  position: absolute;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.25);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(12px);
  animation: drillMiniFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  width: 210px;
  box-sizing: border-box;
}

@keyframes drillMiniFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.rep-drill-mini-tooltip-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.rep-drill-mini-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #facc15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-drill-mini-turn {
  font-size: 10.5px;
  color: var(--text3);
}

.rep-drill-mini-board-wrap {
  width: 190px;
  height: 190px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  background: #000;
}

#rep-drill-mini-board {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.rep-stages-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

#rep-btn-clear-mistakes {
  font-size: 13px;
  padding: 6px 14px;
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  transition: all 0.2s ease;
}

#rep-btn-clear-mistakes:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* ───────────────────────────────────────────────────────────── */
/* WIZARD: STUDY FROM GAMES MODE PILLS & OPENINGS LIST           */
/* ───────────────────────────────────────────────────────────── */

.rep-wizard-mode-pill-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.rep-mode-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rep-mode-pill:hover {
  background: rgba(173, 98, 255, 0.08);
  border-color: rgba(173, 98, 255, 0.4);
  color: #fff;
}

.rep-mode-pill.active {
  background: rgba(173, 98, 255, 0.15);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(173, 98, 255, 0.2);
}

.rep-mode-pill-icon {
  font-size: 15px;
}

.rep-openings-scrollbox {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.rep-openings-scrollbox::-webkit-scrollbar {
  width: 6px;
}
.rep-openings-scrollbox::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.rep-opening-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.rep-opening-card:hover {
  border-color: rgba(173, 98, 255, 0.5);
  background: rgba(173, 98, 255, 0.06);
  transform: translateY(-1px);
}

.rep-opening-card.active {
  border-color: var(--accent);
  background: rgba(173, 98, 255, 0.15);
  box-shadow: 0 0 14px rgba(173, 98, 255, 0.2);
}

.rep-opening-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rep-opening-wins-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #4ade80;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.rep-opening-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rep-opening-moves {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.rep-opening-name {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-opening-eco {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #d4b3ff;
  font-weight: 600;
}



