/* ============================================================
   SECTORS 01–03
   ============================================================ */

.desktop-shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 20px;
}

.desktop-shape-grid .shape-button {
  min-height: 150px;
  font-size: 3.2rem;
  border-radius: 20px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.065),
      rgba(255, 255, 255, 0.025)
    );
}

@media (hover: hover) and (pointer: fine) {
  .desktop-shape-grid .shape-button:hover:not(:disabled) {
    border-color: rgba(233, 183, 189, 0.3);
    background: rgba(233, 183, 189, 0.06);
    transform: translateY(-2px);
  }
}

.desktop-sequence-display {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 16px 20px;
}

.desktop-sequence-display strong {
  margin-top: 4px;
  font-size: 1.25rem;
}

.desktop-system-log {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 0;
}

.desktop-system-log .log-entry-button {
  display: flex;
  min-height: 140px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
}

.desktop-system-log .log-entry-button strong {
  grid-row: auto;
  font-size: 1.35rem;
}

.desktop-system-log .log-entry-button span {
  font-size: var(--font-label);
}

.desktop-system-log .log-entry-button small {
  font-size: var(--font-label);
}

.signal-console {
  padding: 24px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
}

.signal-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.signal-console-header .panel-label { margin: 0; }

.signal-status {
  color: #74b98a;
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.desktop-signal-play {
  margin: 0 0 20px;
  min-height: 58px;
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  letter-spacing: 0.08em;
}

.desktop-signal-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 0 0 20px;
}

.desktop-signal-grid .signal-button {
  min-height: 110px;
  font-size: 1.4rem;
  border-radius: 18px;
}

/* Sector 2: keep the signal controls and feedback inside the fixed terminal. */
.mission-screen--terminal[data-sector="2"] .signal-console { padding: 18px 20px; }
.mission-screen--terminal[data-sector="2"] .signal-console-header { margin-bottom: 12px; }
.mission-screen--terminal[data-sector="2"] .desktop-signal-play {
  min-height: 50px;
  margin-bottom: 14px;
}
.mission-screen--terminal[data-sector="2"] .desktop-signal-grid { margin-bottom: 14px; }
.mission-screen--terminal[data-sector="2"] .desktop-signal-grid .signal-button { min-height: 82px; }
.mission-screen--terminal[data-sector="2"] .desktop-sequence-display { min-height: 64px; }
.mission-screen--terminal[data-sector="2"] .result-actions { margin-top: 14px; }

.cipher-console { width: 100%; }

.desktop-cipher-panel {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.desktop-cipher-panel strong {
  margin: 22px 0 18px;
  font-size: clamp(2.5rem, 3.5vw, 3.2rem);
  letter-spacing: 0.18em;
}

.archive-workspace {
  display: grid;
  grid-template-columns:
    minmax(0, 0.9fr)
    minmax(0, 1.1fr);
  gap: 18px;
}

.archive-clue-panel { margin: 0; }

.archive-clue-panel .panel-label { margin-bottom: 18px; }

.archive-clues {
  display: grid;
  gap: 12px;
}

.archive-clues p {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
  line-height: 1.5;
}

.archive-clues p:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.archive-interaction {
  padding: 20px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
}

.archive-interaction .panel-label { margin-bottom: 18px; }

.desktop-archive-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.desktop-archive-grid .archive-fragment {
  min-height: 100px;
  font-size: 2rem;
  border-radius: 16px;
}

.binary-console { width: 100%; }

.desktop-binary-panel {
  margin: 0;
  padding: 24px 30px 30px;
  text-align: left;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-header > span:first-child {
  color: var(--muted);
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.16em;
}

.terminal-status {
  color: #74b98a !important;
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: var(--font-label) !important;
  letter-spacing: 0.12em;
}

.desktop-binary-panel code {
  margin: 0;
  color: rgba(247, 244, 239, 0.92);
  font-size: 1.35rem;
  line-height: 1.9;
  letter-spacing: 0.18em;
}

.puzzle-workspace > .feedback { margin-top: 18px; }

@media (max-width: 1050px) {
  .desktop-system-log {
    grid-template-columns: repeat(3, 1fr);
  }

  .archive-workspace {
    grid-template-columns: 1fr;
  }

  .desktop-shape-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.decode-challenge--long strong {
  white-space: nowrap;
  max-width: 100%;
  font-size:
    clamp(
      1.45rem,
      1.75vw,
      1.85rem
    );
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ============================================================
   SECTORS 04–06
   ============================================================ */

.connection-status {
  color: #74b98a;
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.remote-workspace { width: 100%; }

.remote-story-panel {
  padding: 18px 20px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
}

.remote-story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.remote-story-header .panel-label { margin: 0; }

.remote-story-panel .remote-story {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.remote-auth-console {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 16px 20px;
  text-align: center;
  background:
    radial-gradient(
      circle at center,
      rgba(233, 183, 189, 0.08),
      transparent 60%
    ),
    rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(233, 183, 189, 0.18);
  border-radius: 18px;
}

.remote-auth-console .panel-label { margin-bottom: 10px; }

.remote-auth-request {
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.remote-auth-warning {
  margin-top: 8px;
  color: #d68e8e;
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: var(--font-label);
  letter-spacing: 0.1em;
}

.crossref-workspace { width: 100%; }

.registry-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 12px;
}

.registry-heading .panel-label { margin: 0; }

.registry-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--muted);
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: var(--font-label);
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
}

.desktop-crossref-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.desktop-crossref-table {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #17171d;
}

.desktop-crossref-columns .crossref-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(56px, 0.7fr) minmax(48px, 0.55fr);
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
}

.desktop-crossref-table .crossref-row:last-child { border-bottom: 0; }

.desktop-crossref-table .crossref-row {
  min-height: 42px;
}

.crossref-workspace .answer-area { margin-top: 16px; }

.desktop-crossref-table .crossref-row:not(.crossref-header) {
  transition: background 130ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .desktop-crossref-table
  .crossref-row:not(.crossref-header):hover {
    background: rgba(233, 183, 189, 0.055);
  }
}

@media (max-width: 650px) {
  .desktop-crossref-columns { grid-template-columns: 1fr; }
}

.sync-console {
  width: 100%;
  padding: 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
}

.sync-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sync-console-header .panel-label { margin: 0; }

.sync-packet-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.sync-packet {
  display: flex;
  min-width: 0;
  min-height: 104px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
}

.sync-channel {
  color: var(--muted);
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.sync-packet strong {
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

.sync-packet small {
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.07em;
}

.sync-packet--ok small { color: #74b98a; }

.sync-packet--error {
  border-color: rgba(210, 104, 104, 0.38);
  background: rgba(210, 104, 104, 0.055);
}

.sync-packet--error small { color: #d68e8e; }

.sync-mapping-table {
  margin: 0;
  border-radius: 14px;
}

.sync-mapping-table .crossref-row {
  grid-template-columns: 1fr 1fr;
  padding: 8px 12px;
}

.sync-console + .answer-area { margin-top: 16px; }

.sync-mapping-table .crossref-row strong,
.sync-mapping-table .crossref-row span {
  text-align: center;
}

.sync-mapping-table .crossref-row strong {
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  letter-spacing: 0.08em;
}

/* Sector 6: keep the decoder and its feedback inside the shared workspace. */
.mission-screen--terminal[data-sector="6"] .sync-console {
  padding: 12px 16px;
}

.mission-screen--terminal[data-sector="6"] .sync-console-header {
  margin-bottom: 9px;
  padding-bottom: 8px;
}

.mission-screen--terminal[data-sector="6"] .sync-mapping-table .crossref-row {
  padding-top: 6px;
  padding-bottom: 6px;
}

.mission-screen--terminal[data-sector="6"] .sync-console + .answer-area {
  margin-top: 12px;
}

@media (max-width: 1050px) {
  .sync-packet-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
