/* ============================================================
   Recruitment Center (The Tavern) - Horizontal Roster
   ============================================================ */
.tavern-page {
  padding: 40px;
  background: transparent;
  color: #d4b96a;
  min-height: 100%;
  max-width: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.tavern-header {
  border-bottom: 1px solid rgba(212, 185, 106, 0.2);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.tavern-header h1 {
  font-family: 'Georgia', serif;
  font-size: 32px;
  color: #ebd69b;
  margin: 0;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

/* ── Roster view header ── */
.roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* ── Editor view header ── */
.editor-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.editor-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.editor-team-name {
  font-size: 18px;
  font-weight: bold;
  margin: 0 4px;
}

.editor-team-name-input {
  font-size: 18px;
  font-weight: bold;
  width: 220px;
  display: none;
}

.editor-summary {
  text-align: left;
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
}

.editor-confirm-row {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  padding-bottom: 24px;
}

.editor-confirm-btn {
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(220, 165, 40, 0.2);
  border: 1px solid var(--accent-gold, #d4b96a);
}

/* ── Fleet cards grid ── */
.fleet-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.fleet-card {
  background: var(--theme-card-bg, rgba(28, 43, 62, 0.7));
  backdrop-filter: blur(12px);
  border: 1px solid var(--theme-card-border, #37474f);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fleet-card-header {
  justify-content: flex-start;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--theme-card-border, #37474f);
  padding-bottom: 12px;
  height: auto;
}

.fleet-card-name {
  font-size: 20px;
  font-weight: bold;
  color: var(--theme-accent, #ebd69b);
}

.fleet-card-subtitle {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}

.fleet-card-stats {
  margin-bottom: 16px;
}

.fleet-card-actions {
  display: flex;
  gap: 10px;
}

.fleet-manage-btn {
  flex: 1;
  border-color: var(--theme-accent, #ebd69b);
  color: var(--theme-accent, #ebd69b);
}

/* ── Compact button variant ── */
.btn-compact {
  padding: 8px 16px;
  font-size: 13px;
}

.stat-val-white {
  color: #fff;
}

.team-summary-box {
  text-align: right;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid rgba(212, 185, 106, 0.1);
}

.ship-req-display {
  font-size: 13px;
  color: #ff8a65;
  margin-top: 0;
}

/* ── 3D Carousel Roster ── */
.roster-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  perspective: 1200px;
  overflow: hidden;
  padding: 20px 0;
  margin-top: 20px;
}

.roster-3d-container {
  position: relative;
  width: 320px;
  height: 500px;
  transform-style: preserve-3d;
}

/* ── Crew Card Large ── */
.crew-card-large {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 500px;
  background: var(--theme-card-bg, linear-gradient(180deg, rgba(28, 43, 62, 0.8) 0%, rgba(13, 21, 33, 0.8) 100%));
  backdrop-filter: blur(16px);
  border: 1px solid var(--theme-card-border, #37474f);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease, filter 0.6s ease;
  overflow: hidden;
}

/* Active card hover effect */
.crew-card-large.active-card:hover {
  transform: translateY(-5px) scale(1.02) !important;
  border-color: var(--theme-accent, #d4b96a);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), inset 0 0 20px var(--theme-glow-inner, rgba(212, 185, 106, 0.1));
}

/* Overlay to block clicks on side cards */
.crew-card-large::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
}

.crew-card-large:not(.active-card)::after {
  display: block;
}

/* Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 20, 30, 0.8);
  border: 2px solid var(--theme-accent, #d4b96a);
  color: var(--theme-accent, #d4b96a);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.carousel-btn:hover {
  background: var(--theme-accent, #d4b96a);
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 40px;
}

.carousel-btn.next {
  right: 40px;
}

.cc-header {
  text-align: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 2px solid #d4b96a;
  font-family: 'Georgia', serif;
  font-weight: bold;
  font-size: 18px;
  color: #ebd69b;
  letter-spacing: 1px;
}

.cc-header-relative {
  position: relative;
}

/* ── Crew name inline editing ── */
.cc-name-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.cc-name-input {
  display: none;
  width: 120px;
  text-align: center;
  font-family: inherit;
  font-size: inherit;
  background: var(--bg-card, #1c2b3e);
  color: var(--text-main, #ebd69b);
  border: 1px solid var(--border-color, #37474f);
  border-radius: 4px;
  padding: 2px 4px;
}

.cc-rename-btn {
  padding: 2px 6px;
  opacity: 0.6;
  background: none;
  border: none;
  cursor: pointer;
}

.cc-title {
  font-size: 11px;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}

.cc-avatar-box {
  width: 100%;
  height: 240px;
  overflow: visible;
  position: relative;
  background: transparent;
}

/* Bottom gradient fade — lets badges blend over the avatar naturally */
.cc-avatar-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
  z-index: 5;
}

.cc-avatar,
.add-avatar-anim {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
  filter: brightness(0.9) contrast(1.1);
}

.crew-card-large:hover .cc-avatar {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.1);
}

.cc-body {
  padding: 16px;
}

/* ── Speech Bubble ── */
.speech-bubble {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  color: #111;
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  font-family: 'Georgia', serif;
  font-size: 16px;
  font-weight: bold;
  max-width: 220px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  z-index: 100;
  opacity: 0;
  transform: scale(0.8);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  line-height: 1.4;
}

.speech-bubble.show {
  opacity: 1;
  transform: scale(1);
}

.speech-bubble.show.error {
  animation: bubble-shake 0.4s ease-in-out;
}

@keyframes bubble-shake {

  0%,
  100% {
    transform: scale(1) translateX(0);
  }

  25% {
    transform: scale(1.05) translateX(-5px) rotate(-2deg);
  }

  50% {
    transform: scale(1.05) translateX(5px) rotate(2deg);
  }

  75% {
    transform: scale(1.05) translateX(-5px) rotate(-1deg);
  }
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: -4px;
  border: 10px solid transparent;
  border-top-color: white;
  border-left-color: white;
  transform: rotate(-15deg);
}

.speech-bubble.error {
  background: #ff5252;
  color: white;
}

.speech-bubble.error::after {
  border-top-color: #ff5252;
  border-left-color: #ff5252;
}

/* Intelligence Toggle */
.cc-intel-toggle {
  display: flex;
  background: #0b111a;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #37474f;
  margin-bottom: 20px;
}

.intel-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #78909c;
  padding: 10px 0;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.intel-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.intel-btn.active.reef {
  background: #3e2723;
  color: #d7ccc8;
}

.intel-btn.active.voyager {
  background: #004d40;
  color: #80cbc4;
}

.intel-btn.active.oracle {
  background: #4a148c;
  color: #ce93d8;
}

.intel-btn.active.byok {
  background: #1a237e;
  color: #c5cae9;
}

/* BYOK pay-as-you-go cost label */
.stat-val.byok-cost {
  color: #c5cae9;
  font-weight: 600;
}

/* BYOK status row beneath the cost stats */
.cc-byok-status {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(26, 35, 126, 0.18);
  border: 1px solid rgba(63, 81, 181, 0.35);
  font-size: 12px;
}

.cc-byok-status .byok-status-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c5cae9;
  text-decoration: none;
}

.cc-byok-status .byok-status-link:hover {
  color: #fff;
}

.cc-byok-status.byok-ok {
  background: rgba(38, 166, 154, 0.15);
  border-color: rgba(38, 166, 154, 0.45);
}

.cc-byok-status.byok-ok .byok-status-link { color: #b2dfdb; }

.cc-byok-status.byok-warn {
  background: rgba(255, 152, 0, 0.12);
  border-color: rgba(255, 152, 0, 0.4);
}

.cc-byok-status.byok-warn .byok-status-link { color: #ffcc80; }

/* Stats Table */
.cc-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #b0bec5;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.stat-val {
  font-weight: bold;
  font-family: monospace;
  font-size: 15px;
}

.stat-val.gold {
  color: #ffd766;
}

.stat-val.low {
  color: #cfd8dc;
}

.stat-val.med {
  color: #29b6f6;
}

.stat-val.high {
  color: #ab47bc;
}

/* Add Sailor Card */
.add-sailor-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed #455a64;
  cursor: pointer;
}

.add-sailor-card:hover {
  background: rgba(212, 185, 106, 0.05);
  border-color: #d4b96a;
}

.add-sailor-btn-inner {
  text-align: center;
  color: #90a4ae;
  font-family: 'Georgia', serif;
  font-size: 20px;
}

.add-sailor-hint {
  font-size: 14px;
  opacity: 0.6;
  display: block;
  margin-top: 8px;
}

.add-sailor-card:hover .add-sailor-btn-inner {
  color: #d4b96a;
}

.delete-sailor-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #ff5252;
  color: #ff5252;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-sailor-btn:hover {
  background: #ff5252;
  color: #fff;
}

/* ── Prominent Skill Badges ── */
.cc-skill-badges {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: -36px;
  margin-bottom: 28px;
  position: relative;
  z-index: 10;
}

.cc-skill-badge {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 8px;
  border: 2px solid #d4b96a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.95), 0 0 12px rgba(212, 185, 106, 0.15), inset 0 0 10px rgba(0, 0, 0, 0.5);
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.cc-skill-badge:hover {
  transform: scale(1.1) translateY(-4px);
  z-index: 15;
}

.cc-skill-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* Optional tooltip label below the badge */
.cc-skill-badge-name {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 20, 0.95);
  border: 1px solid rgba(212, 185, 106, 0.6);
  color: #ffd54f;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.skill-icon {
  display: none;
  /* Hide the old tiny list icon */
}

.skill-icon-val {
  display: flex !important;
  align-items: center;
}

/* ── Ability slots (mobile-first Core / Gear surface) ── */
.cc-ability-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.cc-ability-slot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 9px;
  border: 1px solid rgba(212, 185, 106, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(212, 185, 106, 0.09), rgba(6, 12, 18, 0.72));
  color: #ebd69b;
  cursor: pointer;
  text-align: left;
}

.cc-ability-slot:hover {
  border-color: rgba(212, 185, 106, 0.72);
  background: linear-gradient(180deg, rgba(212, 185, 106, 0.16), rgba(6, 12, 18, 0.82));
}

.cc-ability-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffd976;
  border: 1px solid rgba(212, 185, 106, 0.38);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 12px;
}

.cc-ability-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-ability-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.cc-ability-hint {
  color: rgba(232, 213, 176, 0.62);
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-ability-count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 217, 118, 0.16);
  border: 1px solid rgba(255, 217, 118, 0.3);
  color: #ffe39a;
  font-size: 12px;
  font-weight: 700;
}

.cc-moves-chip {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(120, 176, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 18, 31, 0.66);
  color: #c9dbff;
  cursor: pointer;
  text-align: left;
}

.cc-moves-chip:hover {
  border-color: rgba(120, 176, 255, 0.54);
  background: rgba(12, 28, 48, 0.78);
}

.cc-moves-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #9bc0ff;
  border: 1px solid rgba(120, 176, 255, 0.3);
  background: rgba(0, 0, 0, 0.24);
  font-size: 14px;
}

.cc-moves-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-moves-label {
  font-size: 12px;
  font-weight: 700;
}

.cc-moves-hint {
  color: rgba(201, 219, 255, 0.58);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-moves-count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(120, 176, 255, 0.13);
  border: 1px solid rgba(120, 176, 255, 0.26);
  color: #d8e5ff;
  font-size: 12px;
  font-weight: 700;
}

.crew-member-dock {
  display: none;
}

@media (max-width: 768px) {
  .crew-member-dock {
    position: sticky;
    bottom: 0;
    z-index: 90;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    margin: 0;
    background: rgba(9, 14, 22, 0.94);
    border-top: 1px solid rgba(212, 185, 106, 0.22);
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
  }

  .crew-member-dock::-webkit-scrollbar {
    display: none;
  }

  .crew-member-dock-item {
    flex: 0 0 72px;
    border: 1px solid rgba(212, 185, 106, 0.18);
    border-radius: 8px;
    background: rgba(22, 31, 45, 0.78);
    color: rgba(232, 213, 176, 0.75);
    padding: 7px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
  }

  .crew-member-dock-item.active {
    border-color: rgba(255, 217, 118, 0.78);
    color: #ffe39a;
    background: linear-gradient(180deg, rgba(212, 185, 106, 0.22), rgba(22, 31, 45, 0.9));
  }

  .dock-avatar-wrap {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(212, 185, 106, 0.35);
    background: rgba(0, 0, 0, 0.34);
  }

  .dock-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .dock-role-icon {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(4, 8, 14, 0.92);
    color: #ffd976;
    font-size: 9px;
    border: 1px solid rgba(212, 185, 106, 0.45);
  }

  .dock-label {
    max-width: 62px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dock-ability-count {
    font-size: 10px;
    color: rgba(232, 213, 176, 0.68);
  }

  .cc-ability-panel {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 8px;
  }

  .cc-ability-slot {
    min-height: 38px;
    padding: 6px 8px;
  }

  .cc-moves-chip {
    min-height: 36px;
    margin-top: 6px;
    padding: 6px 8px;
  }

  .move-slot-card {
    grid-template-columns: 1fr auto;
  }

  .move-slot-command,
  .move-slot-name,
  .move-slot-route {
    grid-column: 1;
  }

  .move-slot-delete {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .skill-picker-filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Tier-based Dynamic Styling (Avatars and Cards) ── */
/* 1. Reef (Novice) - Rust Orange / Gritty Base */
.crew-card-large[data-tier="reef"] {
  border-color: #e65100; /* Industrial Orange */
}
.crew-card-large[data-tier="reef"].active-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), inset 0 0 25px rgba(230, 81, 0, 0.3);
}
.crew-card-large[data-tier="reef"] .cc-avatar {
  filter: drop-shadow(0 0 15px rgba(230, 81, 0, 0.4)) brightness(0.95);
}
.crew-card-large[data-tier="reef"]:hover .cc-avatar {
  filter: drop-shadow(0 0 30px rgba(255, 87, 34, 0.9)) brightness(1.1);
}

/* 2. Voyager (Adept) - Ice Cyan / Netrunner Blue */
.crew-card-large[data-tier="voyager"] {
  border-color: #00e5ff; /* Neon Cyan */
}
.crew-card-large[data-tier="voyager"].active-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), inset 0 0 25px rgba(0, 229, 255, 0.3);
}
.crew-card-large[data-tier="voyager"] .cc-avatar {
  filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.6)) brightness(1.05);
}
.crew-card-large[data-tier="voyager"]:hover .cc-avatar {
  filter: drop-shadow(0 0 35px rgba(0, 229, 255, 1)) brightness(1.15);
}

/* 3. Oracle (Master) - Singularity Violet / Void Magenta */
.crew-card-large[data-tier="oracle"] {
  border-color: #d500f9; /* Violet */
}
.crew-card-large[data-tier="oracle"].active-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), inset 0 0 30px rgba(213, 0, 249, 0.4);
}
.crew-card-large[data-tier="oracle"] .cc-avatar {
  filter: drop-shadow(0 0 20px rgba(213, 0, 249, 0.6)) brightness(1.1);
}
.crew-card-large[data-tier="oracle"]:hover .cc-avatar {
  filter: drop-shadow(0 0 45px rgba(213, 0, 249, 1)) brightness(1.2);
}
/* ── Skill Slot Drawer ── (M7 — recruitment skill slots) */
.skill-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}
.skill-drawer-overlay.hidden {
  display: none;
}
.skill-drawer {
  width: 420px;
  max-width: 100%;
  background: #14171f;
  border-left: 1px solid rgba(212, 185, 106, 0.25);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  color: #e8d5b0;
  overflow: hidden;
}
.skill-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(212, 185, 106, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.skill-drawer-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.skill-drawer-close {
  background: transparent;
  border: none;
  color: rgba(232, 213, 176, 0.6);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}
.skill-drawer-close:hover { color: #e8d5b0; }
.skill-drawer-quota {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(212, 185, 106, 0.04);
  border-bottom: 1px solid rgba(212, 185, 106, 0.1);
  font-size: 13px;
}
.skill-drawer-quota .quota-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.skill-drawer-quota .quota-pill.over {
  color: #ff6b6b;
  font-weight: 600;
}
.skill-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.skill-drawer-section {
  margin-bottom: 24px;
}
.skill-drawer-section h3 {
  font-size: 14px;
  margin: 0 0 8px 0;
  color: rgba(232, 213, 176, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.skill-drawer-section .section-add-btn {
  background: transparent;
  border: 1px dashed rgba(212, 185, 106, 0.4);
  color: rgba(232, 213, 176, 0.7);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.skill-drawer-section .section-add-btn:hover {
  border-color: rgba(212, 185, 106, 0.7);
  color: #e8d5b0;
}
.skill-drawer-section .section-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.skill-drawer-empty {
  font-size: 12px;
  color: rgba(232, 213, 176, 0.4);
  padding: 8px 0;
}

.skill-drawer-moves-note {
  margin-bottom: 8px;
  color: rgba(201, 219, 255, 0.58);
  font-size: 12px;
  line-height: 1.35;
}

.section-add-move-btn {
  background: transparent;
  border: 1px dashed rgba(120, 176, 255, 0.4);
  color: rgba(201, 219, 255, 0.78);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.section-add-move-btn:hover {
  border-color: rgba(120, 176, 255, 0.68);
  color: #d8e5ff;
}

.move-slot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.move-slot-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(120, 176, 255, 0.18);
  border-radius: 6px;
  background: rgba(120, 176, 255, 0.05);
}

.move-slot-command {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(120, 176, 255, 0.12);
  color: #d8e5ff;
  font-family: monospace;
  font-size: 12px;
}

.move-slot-name {
  min-width: 0;
  color: #e8d5b0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.move-slot-route {
  color: rgba(201, 219, 255, 0.52);
  font-size: 11px;
}

.move-slot-delete {
  background: transparent;
  border: 1px solid rgba(120, 176, 255, 0.2);
  border-radius: 4px;
  color: rgba(232, 213, 176, 0.7);
  cursor: pointer;
  padding: 3px 6px;
}

@media (max-width: 768px) {
  .skill-drawer {
    width: 100%;
    border-left: none;
  }
}

/* ── Skill Picker (stacks above drawer) ── */
.skill-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
}
.skill-picker-overlay.hidden { display: none; }
.skill-picker {
  background: #14171f;
  color: #e8d5b0;
  border: 1px solid rgba(212, 185, 106, 0.25);
  border-radius: 8px;
  width: 460px;
  max-width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.skill-picker-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(212, 185, 106, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.skill-picker-header h3 { margin: 0; font-size: 16px; }
.skill-picker-close {
  background: transparent;
  border: none;
  color: rgba(232, 213, 176, 0.6);
  font-size: 18px;
  cursor: pointer;
}
.skill-picker-close:hover { color: #e8d5b0; }
.skill-picker-actions {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(212, 185, 106, 0.1);
}
.skill-picker-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(212, 185, 106, 0.1);
}
.skill-picker-search-input {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(212, 185, 106, 0.24);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: #e8d5b0;
  padding: 0 10px;
  font-size: 13px;
}
.skill-picker-search-input:focus {
  outline: none;
  border-color: rgba(212, 185, 106, 0.68);
}
.skill-picker-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.skill-picker-filter {
  min-height: 30px;
  border: 1px solid rgba(212, 185, 106, 0.18);
  border-radius: 6px;
  background: rgba(212, 185, 106, 0.04);
  color: rgba(232, 213, 176, 0.72);
  cursor: pointer;
  font-size: 12px;
}
.skill-picker-filter.active {
  border-color: rgba(255, 217, 118, 0.6);
  background: rgba(212, 185, 106, 0.14);
  color: #ffe39a;
}
.skill-picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}
.skill-picker-loading,
.skill-picker-empty {
  padding: 16px 0;
  color: rgba(232, 213, 176, 0.5);
  text-align: center;
}
.skill-picker-banner {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.skill-picker-banner-warn {
  background: rgba(255, 200, 0, 0.08);
  border: 1px solid rgba(255, 200, 0, 0.25);
  color: #ffd166;
}
.skill-picker-action {
  margin-left: auto;
  color: #d4b96a;
  text-decoration: underline;
  cursor: pointer;
}
.skill-picker-item {
  display: block;
  width: 100%;
  background: rgba(212, 185, 106, 0.04);
  border: 1px solid rgba(212, 185, 106, 0.15);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-align: left;
  cursor: pointer;
  color: #e8d5b0;
}
.skill-picker-item:hover {
  border-color: rgba(212, 185, 106, 0.5);
  background: rgba(212, 185, 106, 0.08);
}
.skill-picker-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-picker-item-name { font-weight: 600; font-size: 14px; }
.skill-picker-score {
  margin-left: auto;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(120, 176, 255, 0.12);
  border: 1px solid rgba(120, 176, 255, 0.24);
  color: #c9dbff;
  font-size: 11px;
  text-align: center;
}
.skill-picker-item-summary { font-size: 12px; color: rgba(232, 213, 176, 0.65); margin-top: 2px; }
.skill-picker-item-path { font-size: 11px; color: rgba(232, 213, 176, 0.4); margin-top: 4px; font-family: monospace; }

@media (max-width: 768px) {
  .move-slot-card {
    grid-template-columns: 1fr auto;
  }

  .move-slot-command,
  .move-slot-name,
  .move-slot-route {
    grid-column: 1;
  }

  .move-slot-delete {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .skill-picker-filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Skill Import (stacks above picker) ── */
.skill-import-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.skill-import-overlay.hidden { display: none; }
.skill-import-modal {
  background: #14171f;
  color: #e8d5b0;
  border: 1px solid rgba(212, 185, 106, 0.25);
  border-radius: 8px;
  width: 480px;
  max-width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.skill-import-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(212, 185, 106, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.skill-import-header h3 { margin: 0; font-size: 16px; }
.skill-import-close {
  background: transparent;
  border: none;
  color: rgba(232, 213, 176, 0.6);
  font-size: 18px;
  cursor: pointer;
}
.skill-import-tabs {
  display: flex;
  border-bottom: 1px solid rgba(212, 185, 106, 0.1);
}
.skill-import-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(232, 213, 176, 0.6);
  padding: 10px 0;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
}
.skill-import-tab.active {
  color: #e8d5b0;
  border-bottom-color: #d4b96a;
}
.skill-import-panel {
  padding: 16px 18px;
  overflow-y: auto;
}
.skill-import-panel.hidden { display: none; }
.skill-import-error {
  padding: 0 18px;
  color: #ff6b6b;
  font-size: 12px;
  min-height: 18px;
}
.skill-import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(212, 185, 106, 0.1);
}

/* ── Skill slot cards (drawer body) ── */
.skill-slot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skill-slot-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(212, 185, 106, 0.04);
  border: 1px solid rgba(212, 185, 106, 0.15);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.skill-slot-card:hover {
  border-color: rgba(212, 185, 106, 0.4);
}
.skill-slot-card.dragging {
  opacity: 0.5;
  border-style: dashed;
}
.skill-slot-card.failed {
  border-color: rgba(255, 107, 107, 0.7);
}
.skill-slot-drag {
  cursor: grab;
  color: rgba(232, 213, 176, 0.4);
  padding: 0 4px;
  font-size: 14px;
}
.skill-slot-drag:active { cursor: grabbing; }
.skill-slot-name {
  flex: 1;
  font-size: 13px;
  color: #e8d5b0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skill-slot-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.skill-slot-actions button {
  background: transparent;
  border: 1px solid rgba(212, 185, 106, 0.2);
  color: rgba(232, 213, 176, 0.7);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.skill-slot-actions button:hover:not(:disabled) {
  border-color: rgba(212, 185, 106, 0.6);
  color: #e8d5b0;
}
.skill-slot-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.skill-slot-move { display: none; }
@media (max-width: 768px) {
  .skill-slot-drag { display: none; }
  .skill-slot-move { display: inline-flex !important; }
}

@keyframes skillSlotFlash {
  0%, 100% { background: transparent; border-color: rgba(212, 185, 106, 0.2); }
  50% { background: rgba(255, 107, 107, 0.2); border-color: #ff6b6b; }
}
.skill-slot-flash { animation: skillSlotFlash 0.4s ease; }
