/* Bridge control panel (inline section + confirm modal) layered on the
   migrated dashboard page without touching its layout or scripts. */

/* Bridge control buttons live in the hero, right of the headline. */

html[data-view="aurora"] .hero-text {
  display: grid;
  grid-template-columns: fit-content(40rem) minmax(0, 1fr);
  column-gap: clamp(24px, 3vw, 56px);
  align-items: center;
}
html[data-view="aurora"] .hero-text > :not(.cp-hero) { grid-column: 1; }
.cp-hero {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  max-width: 580px;
  width: 100%;
  position: relative;
  z-index: 2;
}
.cp-hero .cp-buttons-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.cp-hero .cp-buttons-row button {
  width: 100%;
  min-height: 64px;
  font-size: 15px;
  letter-spacing: 0.8px;
}
/* the button for the state the signs are showing right now */
.cp-buttons-row button[data-active="1"] {
  border-color: #33ff9c;
  background: rgba(51, 255, 156, 0.16);
  color: #33ff9c;
  box-shadow: 0 0 18px rgba(51, 255, 156, 0.35);
}
.cp-buttons-row button[data-active="1"]:hover:not(:disabled) {
  background: rgba(51, 255, 156, 0.24);
  box-shadow: 0 0 24px rgba(51, 255, 156, 0.5);
}
@media (max-width: 1100px) {
  html[data-view="aurora"] .hero-text { grid-template-columns: minmax(0, 1fr); }
  .cp-hero { grid-column: 1; grid-row: auto; margin-top: 18px; }
}
.cp-disabled-note {
  margin-top: 12px;
  font-size: 12px;
  color: #ff5f6e;
  letter-spacing: 0.4px;
}
.cp-guard-chip {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(95, 127, 153, 0.5);
  font-size: 11px;
  letter-spacing: 0.6px;
  color: rgba(175, 199, 217, 0.85);
  background: rgba(95, 127, 153, 0.12);
}
.cp-guard-chip[data-locked="0"] {
  border-color: rgba(51, 255, 156, 0.45);
  color: #33ff9c;
  background: rgba(51, 255, 156, 0.1);
}
.cp-guard-chip[data-locked="1"] {
  border-color: rgba(255, 184, 77, 0.5);
  color: #ffb84d;
  background: rgba(255, 184, 77, 0.1);
}
.cp-enroll-btn {
  display: block;
  margin-bottom: 10px;
  border-color: rgba(45, 226, 196, 0.55);
  color: var(--teal, #2dd2c4);
  background: rgba(45, 226, 196, 0.08);
  font-weight: 600;
}
.cp-enroll-btn:hover {
  background: rgba(45, 226, 196, 0.16);
  box-shadow: 0 0 14px rgba(45, 226, 196, 0.25);
}
#cp-buttons button[data-locked="1"] {
  opacity: 0.4;
  cursor: not-allowed;
  border-style: dashed;
}

.cp-status {
  margin-top: 12px;
  min-height: 18px;
  font-size: 12px;
  color: rgba(175, 199, 217, 0.85);
}
.cp-status.ok { color: #33ff9c; }
.cp-status.error { color: #ff5f6e; }
.cp-status.busy { color: #39f5ff; }

.cp-buttons-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.cp-buttons-row button {
  position: relative;
  overflow: hidden;
  min-width: 170px;
  padding: 13px 18px;
  border-radius: 8px;
  border: 1px solid rgba(57, 245, 255, 0.4);
  background: rgba(57, 245, 255, 0.07);
  color: #9fdbe2;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  cursor: pointer;
}
.cp-buttons-row button:hover:not(:disabled) {
  background: rgba(57, 245, 255, 0.14);
  box-shadow: 0 0 16px rgba(57, 245, 255, 0.3);
}
.cp-buttons-row button:disabled { opacity: 0.45; cursor: not-allowed; }
.cp-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(57, 245, 255, 0.25), rgba(57, 245, 255, 0.6));
  pointer-events: none;
}
.cp-label { position: relative; z-index: 1; }

.cp-cooldown {
  margin-top: 12px;
  font-size: 11px;
  color: #ffb84d;
  letter-spacing: 0.4px;
}

/* floating confirm modal */
#cp-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 4, 9, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#cp-modal[hidden] { display: none; }
.cp-modal-card {
  width: min(520px, 100%);
  border: 1px solid rgba(57, 245, 255, 0.3);
  border-radius: 10px;
  background: rgba(4, 10, 18, 0.98);
  padding: 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.cp-modal-text {
  font-size: 15px;
  line-height: 1.6;
  color: #dfeaf2;
}
.cp-modal-text b { color: #39f5ff; }
.cp-warn {
  display: inline-block;
  margin-top: 10px;
  color: #ffb84d;
  font-size: 12px;
  letter-spacing: 0.4px;
}
.cp-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
.cp-btn-ghost {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(95, 127, 153, 0.5);
  background: transparent;
  color: rgba(175, 199, 217, 0.8);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
#cp-confirm {
  position: relative;
  overflow: hidden;
  min-width: 200px;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid rgba(51, 255, 156, 0.45);
  background: rgba(51, 255, 156, 0.08);
  color: #33ff9c;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#cp-confirm:hover { background: rgba(51, 255, 156, 0.15); box-shadow: 0 0 16px rgba(51, 255, 156, 0.3); }
#cp-confirm.holding { border-color: #33ff9c; box-shadow: 0 0 18px rgba(51, 255, 156, 0.45); }
.cp-hold-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(51, 255, 156, 0.35), rgba(51, 255, 156, 0.75));
  pointer-events: none;
}
.cp-hold-label { position: relative; z-index: 1; }
.cp-modal-hint {
  margin-top: 14px;
  font-size: 11px;
  color: rgba(175, 199, 217, 0.55);
  letter-spacing: 0.4px;
}
body.cp-modal-open { overflow: hidden; }
