/* ─── Flying Comet Medallion, Slide-Over Key Drawer, Physical Key Plaque & Vault ─── */
.claim-comet {
  position: fixed;
  z-index: 9999;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 106, 0.35), rgba(12, 11, 10, 0.92));
  border: 1.5px solid #E6C88A;
  box-shadow: 0 0 18px rgba(212, 175, 106, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform, opacity;
}

.claim-spark {
  position: fixed;
  z-index: 9998;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: #F4D898;
  box-shadow: 0 0 8px #D4AF6A;
  pointer-events: none;
}

.claim-ring-burst {
  position: fixed;
  z-index: 9997;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border-radius: 50%;
  border: 2px solid #E6C88A;
  pointer-events: none;
  animation: ringBurst 0.42s ease-out forwards;
}

.vessel-claim-toast {
  position: fixed;
  z-index: 9999;
  padding: 0.34rem 0.72rem;
  border-radius: 4px;
  border: 1px solid rgba(230, 200, 138, 0.65);
  background: linear-gradient(180deg, #272018 0%, #15120E 100%);
  color: #F4D898;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.56);
  pointer-events: none;
  transform: translateX(-50%);
  animation: vesselToastPop 1.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ringBurst {
  from { transform: scale(0.5); opacity: 0.95; }
  to { transform: scale(2.8); opacity: 0; }
}

@keyframes vesselToastPop {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(0.92); }
  16% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -6px) scale(0.96); }
}

/* Acquisition Seal Action Bar inside Specimen Dossier */
.claim-action-bar {
  margin-top: 0.52rem;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  flex-wrap: wrap;
}

.brass-seal-btn.has-sheen {
  position: relative;
  overflow: hidden;
}

.brass-seal-btn.has-sheen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 250, 232, 0.42) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.55s ease;
}

.brass-seal-btn.has-sheen:hover::after {
  transform: translateX(110%);
}

/* Slide-Over Key Vessel Drawer */
.key-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
  z-index: 55;
}

.key-drawer-backdrop.hidden { display: none; }

.key-drawer-panel {
  width: min(92vw, 29.5rem);
  height: 100%;
  background: var(--background);
  border-left: 1px solid rgba(212, 175, 106, 0.32);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.68);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem;
  overflow-y: auto;
  animation: drawerSlideIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.physical-key-card {
  position: relative;
  padding: 1.05rem 1.15rem;
  border-radius: 7px;
  border: 1px solid rgba(212, 175, 106, 0.45);
  background:
    radial-gradient(circle at 88% 18%, rgba(212, 175, 106, 0.14), transparent 55%),
    linear-gradient(155deg, rgba(42, 34, 24, 0.88) 0%, rgba(16, 14, 11, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.22), 0 14px 32px rgba(0, 0, 0, 0.38);
}

[data-theme="light"] .physical-key-card {
  background:
    radial-gradient(circle at 88% 18%, rgba(212, 175, 106, 0.22), transparent 55%),
    linear-gradient(155deg, #FBF6EA 0%, #E7DCC6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 26px rgba(48, 34, 16, 0.14);
}

.keys-workbench {
  padding: 1.85rem 2.4rem;
  overflow-y: auto;
  height: 100%;
  display: grid;
  grid-template-columns: 18.5rem minmax(0, 1fr);
  gap: 1.8rem;
  align-items: start;
}

.keys-empty-stage {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.2rem 1.8rem;
}

.key-roster-col,
.key-detail-col { min-width: 0; }

.key-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.key-list-card {
  width: 100%;
  text-align: left;
  padding: 0.78rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  margin-bottom: 0.55rem;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.key-list-card.active {
  border-color: var(--gold-rank);
  background: rgba(212, 175, 106, 0.1);
}

.forge-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.88rem;
  outline: none;
}

.forge-input:focus { border-color: var(--accent-gold); }

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.tpl-card {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  transition: border-color 0.14s ease, background 0.14s ease;
}

.tpl-card.selected,
.tpl-card:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 106, 0.1);
}

.claimed-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.68rem 0.88rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  margin-bottom: 0.48rem;
}

.channel-select-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chan-pill {
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--card-border);
  font-size: 0.7rem;
  color: var(--muted-foreground);
  background: transparent;
}

.chan-pill.active {
  border-color: var(--gold-rank);
  background: rgba(212, 175, 106, 0.14);
  color: var(--foreground);
  font-weight: 700;
}

.key-eject-btn {
  font-size: 0.71rem;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--card-border);
  color: var(--subtle-foreground);
}

.key-eject-btn:hover {
  color: var(--accent-vermilion);
  border-color: var(--accent-vermilion);
}

.station-lead {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--muted-foreground);
  margin: 0.35rem 0 1rem;
}

.station-stat {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  font-size: 0.7rem;
  color: var(--subtle-foreground);
}

.station-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--foreground);
}

.placard-ai-pip {
  display: inline-block;
  width: 0.42rem; height: 0.42rem;
  border-radius: 50%;
  background: var(--gold-rank);
}

.vault-banner--warn,
.vault-banner--error {
  border: 1px solid var(--gold-rank);
  background: rgba(212, 175, 106, 0.12);
  color: var(--foreground);
}

.vault-banner--error { border-color: var(--accent-vermilion); background: rgba(196, 72, 52, 0.12); }

[data-theme="light"] .vault-drawer {
  background: linear-gradient(180deg, #f7f3ea, #ece5d6);
  border-color: rgba(120, 98, 62, 0.3);
  box-shadow: -10px 0 30px rgba(84, 66, 38, 0.14);
}

[data-theme="light"] .chan-pill,
[data-theme="light"] .key-eject-btn { border-color: rgba(120, 98, 62, 0.42); color: #4f4433; }

[data-theme="light"] .chan-pill.active,
[data-theme="light"] .key-list-card.active,
[data-theme="light"] .tpl-card.selected { border-color: #8a6420; background: rgba(168, 124, 44, 0.16); color: #2e2618; }

[data-theme="light"] .key-eject-btn:hover { color: #a3321f; border-color: #a3321f; }

@media (max-width: 960px) {
  .keys-workbench { grid-template-columns: 1fr; height: auto; padding: 1.2rem 1rem; }
  .tpl-grid { grid-template-columns: 1fr; }
  .claimed-model-row { flex-wrap: wrap; }
  .station-lead, .station-stat, .vault-banner--warn, .vault-banner--error, .vault-drawer { max-width: 100%; overflow-wrap: anywhere; }
}
