@import url("/fonts/montserrat.css?v=20260724-all1");

.sqn-editor-page {
  background: #071018;
  overscroll-behavior-y: contain;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.sqn-editor-shell {
  width: min(1040px, calc(100% - 24px));
  padding-top: 16px;
  padding-bottom: 24px;
}

.sqn-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.sqn-editor-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.sqn-editor-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(210px, 1.25fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--sqn-line);
  border-radius: 8px;
  background: #101a24;
}

.sqn-editor-select {
  display: grid;
  gap: 6px;
  color: var(--sqn-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sqn-editor-select select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--sqn-line);
  border-radius: 7px;
  background: #08111a;
  color: var(--sqn-ink);
  padding: 8px 10px;
  font: 700 14px/1.2 "Montserrat", sans-serif;
}

.sqn-editor-select select:disabled {
  color: var(--sqn-muted);
  opacity: .7;
}

.sqn-editor-config-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  color: var(--sqn-muted);
  font-size: 13px;
  font-weight: 700;
}

.sqn-editor-config-hint {
  grid-column: 1 / -1;
  margin: -3px 0 0;
  color: var(--sqn-muted);
  font-size: 12px;
  line-height: 1.4;
}

.sqn-editor-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 450px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.sqn-editor-prototype-panel,
.sqn-editor-data-panel {
  border-radius: 8px;
  box-shadow: none;
}

.sqn-editor-prototype-panel {
  position: sticky;
  top: 10px;
}

.sqn-editor-prototype-head {
  min-height: 54px;
}

.sqn-editor-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  overflow: hidden;
  border: 1px solid var(--sqn-line);
  border-radius: 7px;
}

.sqn-editor-segmented button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--sqn-line);
  background: #08111a;
  color: var(--sqn-muted);
  padding: 6px 10px;
  font: 800 12px/1 "Montserrat", sans-serif;
  cursor: pointer;
}

.sqn-editor-segmented button:last-child {
  border-right: 0;
}

.sqn-editor-segmented button[aria-pressed="true"] {
  background: linear-gradient(115deg, rgba(255,78,226,.86), rgba(42,95,227,.9));
  color: #fff;
}

.sqn-editor-cube-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 388px;
  background: #080f18;
}

.sqn-editor-cube-stage {
  width: min(100%, 440px);
  height: 388px;
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
}

.sqn-editor-cube-stage.is-moving {
  cursor: grabbing;
}

.sqn-editor-cube-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.sqn-editor-cube-blocker {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(7,16,24,.72);
  color: var(--sqn-orange);
  padding: 20px;
  text-align: center;
  font-weight: 800;
}

.sqn-editor-cube-blocker[hidden] {
  display: none;
}

.sqn-editor-prototype-status {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--sqn-line);
  color: var(--sqn-muted);
  font-size: 12px;
  font-weight: 700;
}

.sqn-editor-data-panel {
  display: grid;
}

.sqn-editor-field {
  padding: 14px;
  border-bottom: 1px solid var(--sqn-line);
  background: #101a24;
  transition: background-color .18s ease;
}

.sqn-editor-field:last-child {
  border-bottom: 0;
}

.sqn-editor-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sqn-editor-field-head label {
  color: var(--sqn-ink);
  font-size: 14px;
  font-weight: 800;
}

.sqn-editor-field-tools {
  display: flex;
  gap: 6px;
}

.sqn-editor-field-tools button {
  border: 1px solid var(--sqn-line);
  border-radius: 6px;
  background: rgba(255,255,255,.055);
  color: var(--sqn-muted);
  min-height: 30px;
  padding: 5px 8px;
  font: 800 11px/1 "Montserrat", sans-serif;
  cursor: pointer;
}

.sqn-editor-field-tools button:disabled {
  opacity: .38;
  cursor: default;
}

.sqn-editor-field textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 1px solid var(--sqn-line);
  border-radius: 7px;
  background: #08111a;
  color: var(--sqn-ink);
  padding: 10px;
  outline: none;
  font: 12px/1.45 "Montserrat", sans-serif;
}

.sqn-editor-field textarea:focus {
  box-shadow: 0 0 0 3px rgba(70,223,240,.10);
}

.sqn-editor-field .sqn-editor-alg-input {
  min-height: 106px;
}

.sqn-editor-field-hint {
  margin: 8px 1px 0;
  color: var(--sqn-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.sqn-editor-reachability-hint {
  padding: 9px 10px;
  border: 1px solid rgba(70,223,240,.2);
  border-radius: 7px;
  background: rgba(70,223,240,.055);
}

.sqn-editor-reachability-hint strong {
  color: var(--sqn-brand);
}

.sqn-editor-field[data-validity="pending"] {
  background: rgba(255,155,74,.055);
}

.sqn-editor-field[data-validity="pending"] textarea {
  border-color: rgba(255,155,74,.72);
}

.sqn-editor-field[data-validity="invalid"] {
  background: rgba(255,93,101,.055);
}

.sqn-editor-field[data-validity="invalid"] textarea {
  border-color: rgba(255,93,101,.78);
}

.sqn-editor-field[data-validity="valid"] textarea {
  border-color: rgba(105,232,131,.48);
}

.sqn-editor-validation {
  min-height: 23px;
  padding-top: 6px;
  color: var(--sqn-muted);
  font-size: 12px;
  font-weight: 700;
}

[data-validity="pending"] .sqn-editor-validation { color: var(--sqn-orange); }
[data-validity="invalid"] .sqn-editor-validation { color: var(--sqn-bad); }
[data-validity="valid"] .sqn-editor-validation { color: var(--sqn-good); }

.sqn-editor-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.sqn-editor-color {
  width: 34px;
  height: 34px;
  position: relative;
  border: 2px solid rgba(255,255,255,.22);
  border-radius: 6px;
  background: var(--editor-color);
  cursor: pointer;
}

.sqn-editor-color[aria-pressed="true"] {
  outline: 2px solid var(--sqn-cyan);
  outline-offset: 2px;
}

.sqn-editor-color span {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sqn-line);
  border-radius: 9px;
  background: #172330;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.sqn-editor-plane {
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--sqn-line);
  border-radius: 7px;
  background: #080f18;
  overflow: hidden;
}

.sqn-editor-plane svg {
  display: block;
  width: min(100%, 390px);
  height: auto;
  margin: 0 auto;
}

.sqn-editor-plane [data-sqn-face][data-sqn-index] {
  cursor: pointer;
  transition: filter .12s ease, stroke-width .12s ease;
}

.sqn-editor-plane [data-sqn-face][data-sqn-index]:hover {
  filter: brightness(1.18);
  stroke-width: 1.5;
}

.sqn-editor-action-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--sqn-line);
  border-radius: 8px;
  background: #101a24;
  box-shadow: none;
}

.sqn-editor-summary {
  color: var(--sqn-muted);
  font-size: 12px;
  font-weight: 700;
}

.sqn-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sqn-editor-action-panel .sqn-button {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  touch-action: manipulation;
}

#sqnEditorApply,
#sqnEditorReverseSequence {
  border-color: transparent;
  background: linear-gradient(115deg, var(--sqn-brand) 0%, #d900bd 45%, #2a5fe3 100%);
  color: #fff;
}

.sqn-editor-action-panel .sqn-button:disabled {
  opacity: .4;
  cursor: default;
  transform: none;
}

@media (max-width: 820px) {
  .sqn-editor-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sqn-editor-config-status {
    grid-column: 1 / -1;
    min-height: 24px;
  }

  .sqn-editor-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .sqn-editor-prototype-panel {
    position: static;
  }

  .sqn-editor-cube-wrap {
    min-height: 330px;
  }

  .sqn-editor-cube-stage {
    width: min(82vw, 360px);
    height: 330px;
  }
}

@media (max-width: 520px) {
  .sqn-editor-shell {
    width: calc(100% - 14px);
  }

  .sqn-editor-shell {
    padding-top: 8px;
  }

  .sqn-editor-topbar {
    margin-bottom: 9px;
  }

  .sqn-editor-title {
    font-size: 18px;
  }

  .sqn-editor-page .sqn-logo {
    width: 36px;
    height: 36px;
  }

  .sqn-editor-settings {
    gap: 8px;
    margin-bottom: 9px;
    padding: 8px;
  }

  .sqn-editor-select select {
    min-height: 40px;
    font-size: 13px;
  }

  .sqn-editor-workspace {
    gap: 9px;
  }

  .sqn-editor-prototype-head,
  .sqn-editor-field {
    padding-left: 10px;
    padding-right: 10px;
  }

  .sqn-editor-cube-wrap {
    min-height: 286px;
  }

  .sqn-editor-cube-stage {
    width: min(78vw, 330px);
    height: 286px;
  }

  .sqn-editor-field-head {
    align-items: flex-start;
  }

  .sqn-editor-field-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #sqnEditorReplayField .sqn-editor-field-head {
    flex-direction: column;
    align-items: stretch;
  }

  #sqnEditorReplayField .sqn-editor-field-tools {
    flex-wrap: nowrap;
    width: 100%;
  }

  .sqn-editor-action-panel {
    margin-top: 9px;
    gap: 7px;
    padding: 8px;
  }

  .sqn-editor-summary {
    min-height: 18px;
  }

  .sqn-editor-actions {
    gap: 7px;
  }

  .sqn-editor-action-panel .sqn-button {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
  }
}
