.spc-modal {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(11, 18, 33, 0.98), rgba(6, 11, 22, 0.99));
  color: #eef5ff;
  box-shadow: none;
}

.spc-modal[hidden] {
  display: none;
}

.spc-modal::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(6px);
}

.spc-modal__dialog {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100vh;
  padding: 12px 16px;
  gap: 10px;
}

.spc-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.spc-modal__eyebrow {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(181, 205, 235, 0.62);
}

.spc-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.spc-modal__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.spc-modal__view-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spc-modal__view-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(181, 205, 235, 0.6);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.spc-modal__view-btn:hover {
  color: rgba(232, 240, 255, 0.9);
}

.spc-modal__view-btn.is-active {
  background: rgba(91, 155, 245, 0.18);
  color: #5b9bf5;
}

.spc-modal__close,
.spc-modal__text-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.spc-modal__close:hover,
.spc-modal__text-btn:hover {
  border-color: rgba(91, 155, 245, 0.35);
  background: rgba(91, 155, 245, 0.1);
}

.spc-modal__text-btn--danger {
  color: #ff8a96;
}

.spc-modal__text-btn--danger:hover {
  border-color: rgba(255, 92, 108, 0.35);
  background: rgba(255, 92, 108, 0.12);
}

.spc-modal__pane-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spc-modal__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.spc-modal__stage[data-compare-count="3"] {
  grid-template-columns: 1fr 1fr 1fr;
}

.spc-modal__pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(0, 0, 0, 0.18);
}

.spc-modal__pane[hidden] {
  display: none;
}

.spc-modal__pane + .spc-modal__pane {
  border-left: 2px solid rgba(170, 200, 235, 0.42);
}

.spc-modal__pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(6, 11, 22, 0.72);
}

.spc-modal__viewport {
  position: relative;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.spc-modal__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.spc-modal__loading,
.spc-modal__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(6, 11, 22, 0.55);
  color: rgba(214, 228, 255, 0.82);
  font-size: 0.88rem;
  z-index: 2;
  text-align: center;
  padding: 24px;
}

.spc-modal__loading[hidden],
.spc-modal__empty[hidden] {
  display: none;
}

.spc-modal__spinner {
  width: 22px;
  height: 22px;
  animation: spc-spin 0.8s linear infinite;
}

@keyframes spc-spin {
  to { transform: rotate(360deg); }
}

.spc-modal__controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(6, 11, 22, 0.72);
}

.spc-modal__controls[hidden] {
  display: none;
}

.spc-modal__control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: rgba(181, 205, 235, 0.78);
}

.spc-modal__control input[type="range"] {
  width: 100%;
  accent-color: #5b9bf5;
}

.spc-modal__control em {
  font-style: normal;
  min-width: 2.6em;
  text-align: right;
  color: #eef5ff;
  font-variant-numeric: tabular-nums;
}

.spc-modal__picker {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #070d18;
  border-left: 1px solid #1a2a44;
}

.spc-modal__picker[hidden] {
  display: none;
}

.spc-modal__picker[data-picker-slot="0"] {
  left: 0;
  right: auto;
  border-left: 0;
  border-right: 1px solid #1a2a44;
}

.spc-modal__stage[data-compare-count="3"] .spc-modal__picker {
  width: 33.333%;
}

.spc-modal__stage[data-compare-count="3"] .spc-modal__picker[data-picker-slot="0"] {
  left: 0;
}

.spc-modal__stage[data-compare-count="3"] .spc-modal__picker[data-picker-slot="1"] {
  left: 33.333%;
  right: auto;
  border-left: 1px solid #1a2a44;
  border-right: 1px solid #1a2a44;
}

.spc-modal__stage[data-compare-count="3"] .spc-modal__picker[data-picker-slot="2"] {
  left: 66.666%;
  right: 0;
}

.spc-modal__picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.spc-modal__picker-head strong {
  display: block;
}

.spc-modal__picker-head span {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: rgba(181, 205, 235, 0.62);
}

.spc-modal__picker-jump {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.spc-modal__picker-search {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
}

.spc-modal__picker-list {
  overflow: auto;
  display: grid;
  gap: 6px;
  min-height: 0;
  flex: 1 1 auto;
}

.spc-modal__picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.spc-modal__picker-item:hover,
.spc-modal__picker-item.is-active {
  border-color: rgba(91, 155, 245, 0.35);
  background: rgba(91, 155, 245, 0.1);
}

.spc-modal__picker-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.spc-modal__picker-item img {
  width: 72px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.spc-modal__picker-item-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.spc-modal__picker-item-copy strong {
  font-size: 0.82rem;
}

.spc-modal__picker-item-copy span {
  font-size: 0.72rem;
  color: rgba(181, 205, 235, 0.66);
}

.spc-modal__picker-empty {
  padding: 18px 8px;
  color: rgba(181, 205, 235, 0.66);
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .spc-modal__stage[data-compare-count="3"] .spc-modal__control {
    font-size: 0.68rem;
  }
}

@media (max-width: 900px) {
  .spc-modal__stage,
  .spc-modal__stage[data-compare-count="3"] {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 1fr) minmax(220px, 1fr);
  }

  .spc-modal__stage[data-compare-count="3"] {
    grid-template-rows: repeat(3, minmax(200px, 1fr));
  }

  .spc-modal__pane + .spc-modal__pane {
    border-left: 0;
    border-top: 2px solid rgba(170, 200, 235, 0.42);
  }

  .spc-modal__picker,
  .spc-modal__picker[data-picker-slot="0"],
  .spc-modal__stage[data-compare-count="3"] .spc-modal__picker,
  .spc-modal__stage[data-compare-count="3"] .spc-modal__picker[data-picker-slot="0"],
  .spc-modal__stage[data-compare-count="3"] .spc-modal__picker[data-picker-slot="1"],
  .spc-modal__stage[data-compare-count="3"] .spc-modal__picker[data-picker-slot="2"] {
    width: 100%;
    left: 0;
    right: 0;
    border: 0;
  }

  .spc-modal__header {
    flex-direction: column;
  }

  .spc-modal__controls {
    grid-template-columns: 1fr;
  }
}
