@keyframes show {
  0% { opacity: 0; transform: translateY(-12px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes hide {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}
@keyframes toast {
  0% { opacity: 0; transform: translateY(-8px) scale(0.95); }
  10% { opacity: 1; transform: translateY(0) scale(1); }
  85% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.95); }
}
.animatedHide { animation-name: hide !important; }

#activitySpinner {
  z-index: 1000; position: fixed; top: 0; left: 0;
  height: 100%; width: 100%;
  background: rgba(0,0,0,0.5);
  display: flex; justify-content: center; align-items: center;
}
#activitySpinner > i { font-size: 200px; color: white; }

.toastMsg {
  z-index: 2000;
  animation-name: toast; animation-duration: 2.5s;
  animation-timing-function: ease; animation-fill-mode: forwards;
  position: fixed; font-size: 0.95em; font-family: "Nunito", sans-serif;
  width: auto; max-width: 60%; left: 50%; transform: translateX(-50%);
  top: 3%; border-radius: 8px; padding: 0.6em 1.4em;
  text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  background: #333; color: #fff;
}

/* ── Dialog ── */
.dialogScreen {
  z-index: 1000; position: fixed; top: 0; left: 0;
  height: 100%; width: 100%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  font-size: 100%; display: flex; align-items: flex-start; justify-content: center;
}
.dialogScreen > .dialogWindow {
  animation-name: show; animation-duration: 0.18s;
  animation-timing-function: ease-out; animation-fill-mode: both;
  width: 40em; max-width: 92%; top: 8%; position: absolute;
  background: #ffffff; color: #222;
  border-radius: 12px; font-size: 100%; max-height: 82%; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  border: 1px solid rgba(0,0,0,0.08);
}
.dialogScreen > .dialogWindow > .dialogTitle {
  padding: 1rem 1.4rem 0.8rem;
  font-size: 1.1em; font-weight: 700;
  font-family: "Nunito", sans-serif; color: #1a1a2e;
  border-bottom: 1px solid #eee; flex-shrink: 0;
}
.dialogScreen > .dialogWindow > .dialogBody {
  padding: 1rem 1.4rem; overflow-y: auto; flex-grow: 1;
  color: #333; font-size: 0.97em; line-height: 1.6;
}
.dialogScreen > .dialogWindow > .dialogBody input[type="text"],
.dialogScreen > .dialogWindow > .dialogBody input[type="number"],
.dialogScreen > .dialogWindow > .dialogBody input[type="file"] {
  font-size: 100%; border: 1px solid #ccc; border-radius: 0.35em;
  padding: 0.25em 0.5em; outline: none; transition: border-color 0.15s;
}
.dialogScreen > .dialogWindow > .dialogBody input[type="text"]:focus,
.dialogScreen > .dialogWindow > .dialogBody input[type="number"]:focus {
  border-color: var(--color-primary);
}
.dialogScreen > .dialogWindow > .dialogButtonsRow {
  display: flex; justify-content: flex-end; align-items: center;
  width: 100%; padding: 0.75em 1.2em; box-sizing: border-box;
  border-top: 1px solid #eee; gap: 0.5em; flex-shrink: 0;
}
.dialogScreen > .dialogWindow > .dialogButtonsRow > button {
  font-size: 0.9em; font-family: "Nunito", sans-serif; font-weight: 600;
  border: none; border-radius: 0.4em; padding: 0.45em 1.2em;
  min-width: 5em; cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s; outline: none;
}
.dialogScreen > .dialogWindow > .dialogButtonsRow > button:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.dialogScreen > .dialogWindow > .dialogButtonsRow .push-left { margin-right: auto; }
.dialogScreen > .dialogWindow > .dialogButtonsRow .btn-success {
  color: #fff; background-color: var(--color-primary);
}
.dialogScreen > .dialogWindow > .dialogButtonsRow .btn-success:hover {
  background-color: #1e279a;
}
.dialogScreen > .dialogWindow > .dialogButtonsRow .btn-light {
  color: #444; background-color: #f0f0f0; border: 1px solid #ddd;
}
.dialogScreen > .dialogWindow > .dialogButtonsRow .btn-light:hover {
  background-color: #e4e4e4;
}
.dialogScreen > .dialogWindow select {
  font-size: 100%; width: 100%;
  background: #fff; color: #333;
  border: 1px solid #ccc; border-radius: 0.35em; padding: 0.3em 0.4em;
}

.animateClick { transform: scale(0.95); transition: all 0.1s; }

/* ── Spike Prime Port Mapping Modal ── */
.spike-port-body { min-width: 340px; padding: 4px 0; }

.spike-port-hint {
  font-size: 0.88em; color: #888; margin-bottom: 12px;
}

.spike-port-table {
  width: 100%; border-collapse: collapse; font-size: 0.95em;
}
.spike-port-table thead tr { border-bottom: 1px solid #eee; }
.spike-port-table th {
  padding: 6px 8px; text-align: left;
  color: #999; font-weight: 600; font-size: 0.82em;
}
.spike-port-table td { padding: 7px 8px; vertical-align: middle; }
.spike-port-table .spike-port-label { font-weight: 600; color: #1a1a2e; width: 80px; }
.spike-port-table tr + tr td { border-top: 1px solid #f0f0f0; }

.spike-port-select {
  background: #fff; border: 1px solid #ccc; color: #333;
  border-radius: 0.35em; padding: 0.25em 0.4em;
  font-size: 100%; cursor: pointer; width: 100%;
  transition: border-color 0.15s; outline: none;
}
.spike-port-select:focus { border-color: var(--color-primary); }

/* ── Spike Prime Upload Dialog ── */
.spike-upload-body { min-width: 320px; padding: 4px 0; }

.spike-upload-status {
  margin-bottom: 16px; min-height: 2.5em;
  white-space: pre-line; line-height: 1.5; color: #333;
}
.spike-upload-status.spike-upload-error { color: #e53935; }
.spike-upload-status.spike-upload-warning { color: #f57c00; }

.spike-upload-progress {
  width: 100%; height: 6px; background: #eee;
  border-radius: 4px; overflow: hidden;
}
.spike-upload-progress .spike-upload-progress-bar {
  height: 100%; width: 0%; background: var(--color-primary);
  border-radius: 4px; transition: width 0.2s ease;
}
