main.shell { --signal: #ffc18c; }

.head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.observatory-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid #ff7d56; border-radius: 3px; background: #ff5a2a1c;
  color: var(--paper); min-height: 36px; padding: 0 12px; font-size: 12px; font-weight: 560;
  box-shadow: 0 0 20px #ff5a2a26; transition: background .15s;
}
.observatory-pill:hover { background: #ff5a2a30; }

.intro {
  min-height: 112px; display: flex; justify-content: space-between; align-items: end;
  gap: 24px; padding: 20px 0 16px;
}
.location { display: flex; align-items: center; gap: 8px; color: var(--muted); }
h1 { font-size: clamp(48px, 6.8vw, 96px); line-height: .9; letter-spacing: -.072em; font-weight: 390; margin-top: 6px; }
.intro > p { max-width: 40ch; margin-bottom: 2px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* 1-2-3 Step Guide */
.step-guide {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.step {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 13px; background: #10141d; border: 1px solid var(--border); border-radius: 3px;
  opacity: .58; transition: opacity .25s, border-color .25s, background .25s, box-shadow .25s;
}
.step.active {
  opacity: 1; border-color: color-mix(in srgb, var(--signal) 75%, #fff 10%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--signal) 11%, #10141d), #10141d);
  box-shadow: 0 0 22px color-mix(in srgb, var(--signal) 14%, transparent);
}
.step.done { opacity: .92; border-color: #4f8c73; background: #101a1c; }
.step-num {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid #3c4557; color: var(--muted); font-size: 11px; font-weight: 600;
}
.step.active .step-num { border-color: var(--signal); color: var(--signal); background: color-mix(in srgb, var(--signal) 16%, transparent); }
.step.done .step-num { border-color: #9de4be; color: #0a1411; background: #9de4be; }
.step-text { min-width: 0; flex: 1; }
.step-text strong { display: block; font-size: 13px; font-weight: 580; color: var(--paper); line-height: 1.25; }
.step-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.hold-bar { height: 3px; background: #232b3a; margin-top: 6px; border-radius: 2px; overflow: hidden; }
.hold-fill { height: 100%; width: 0%; background: var(--signal); transition: width 40ms linear; }

/* 4/4 Deep-Space Choir Finale Banner */
.choir-banner {
  display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center;
  margin-bottom: 14px; padding: 16px 20px;
  background: radial-gradient(ellipse at 18% 50%, #24365266, transparent 65%), linear-gradient(135deg, #101624, #0d121c);
  border: 1px solid #48617d; border-left: 3px solid var(--ember); border-radius: 3px;
  box-shadow: 0 16px 48px #03060e99;
}
.choir-visual { position: relative; width: 100%; height: 136px; border: 1px solid #283548; background: #070a12; border-radius: 3px; overflow: hidden; }
#mini-constellation { display: block; width: 100%; height: 100%; }
.choir-tag { display: flex; align-items: center; gap: 7px; color: #ff9c7d; margin-bottom: 5px; }
.choir-body h2 { font-size: clamp(20px, 2.5vw, 27px); font-weight: 510; letter-spacing: -.03em; margin-bottom: 6px; }
.choir-body p { font-size: 13px; color: #c7d2e2; line-height: 1.5; max-width: 62ch; }
.choir-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }

/* Main Console */
.console { display: grid; grid-template-columns: 1.04fr 1fr; border: 1px solid var(--border); }
.observation { display: flex; flex-direction: column; min-width: 0; background: #10131b; }
.portrait {
  position: relative; isolation: isolate; min-height: 276px; flex: 1; overflow: hidden;
  background: #080b12; border-bottom: 1px solid var(--border);
}
.planet-halo {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 67% 48%, color-mix(in srgb, var(--signal) 26%, transparent), transparent 62%);
  transition: opacity .4s ease;
}
.planet-lens {
  position: absolute; top: 8%; left: 67%; height: 84%; aspect-ratio: 1; transform: translateX(-50%);
  isolation: isolate; overflow: hidden; border-radius: 50%;
  background: #080b12;
  box-shadow: 0 0 42px color-mix(in srgb, var(--signal) 22%, transparent);
}
.planet-lens img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.planet-lens::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle, transparent 58%, #080b12b8 93%, #080b12 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal) 34%, transparent);
}

/* Lock-on visual pulse */
.lock-ring {
  position: absolute; top: 50%; left: 67%; width: 220px; height: 220px;
  border-radius: 50%; border: 2px solid var(--signal);
  transform: translate(-50%, -50%) scale(.72); opacity: 0; pointer-events: none; z-index: 2;
}
.lock-ring.pulse { animation: lock-pulse 1.05s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes lock-pulse {
  0% { transform: translate(-50%, -50%) scale(.72); opacity: .95; box-shadow: 0 0 28px var(--signal); }
  100% { transform: translate(-50%, -50%) scale(1.65); opacity: 0; box-shadow: 0 0 0 transparent; }
}

.portrait::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, #080b12dd, transparent 34%), linear-gradient(90deg, #080b12b8 0%, #080b1255 22%, transparent 50%);
}
.orbit {
  position: absolute; top: 48%; left: 67%; width: 76%; height: 80%;
  border: 1px solid color-mix(in srgb, var(--signal) 30%, transparent); border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-17deg) scaleY(.47); pointer-events: none;
}
.orbit-two { transform: translate(-50%, -50%) rotate(-17deg) scale(1.08, .57); opacity: .32; }
.portrait-caption { position: absolute; left: 19px; bottom: 16px; z-index: 1; }
.portrait-caption .location { color: var(--signal); }
.portrait-caption h2 { font-size: clamp(34px, 5vw, 68px); line-height: .97; letter-spacing: -.064em; font-weight: 410; }
.plate-id { position: absolute; right: 15px; top: 15px; color: var(--muted); z-index: 1; }

.telemetry {
  margin: 0; padding: 13px 18px; display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px 10px;
}
.telemetry div { grid-column: span 2; }
.telemetry div:last-child { grid-column: span 4; }
.telemetry dt { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.telemetry dd { margin: 0; color: #e5e2da; font: 12px/1.35 var(--mono); }

/* Prominent Science Context Card */
.signal-note {
  border-top: 1px solid var(--border); border-left: 3px solid #2f384a;
  background: #0d111a; padding: 12px 16px 13px; min-width: 0;
  transition: border-color .3s, background .3s;
}
.signal-note.unlocked {
  border-left-color: var(--signal);
  background: linear-gradient(135deg, color-mix(in srgb, var(--signal) 10%, #101622), #0f141e);
}
.signal-note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.signal-note h3 {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 13px; margin: 0; font-weight: 600;
}
.signal-note.unlocked h3 { color: var(--signal); }
.signal-note.unlocked h3 .dot { background: var(--signal); }
.signal-note a { color: var(--signal); font-size: 11px; text-underline-offset: 3px; white-space: nowrap; }
.signal-locked-hint { font-size: 12px; color: #8c96a8; line-height: 1.45; }
.signal-unlocked-body p { font-size: 12.5px; color: #dbe2ee; line-height: 1.48; }
.signal-interp { margin-top: 4px; color: #a9b5c8 !important; font-size: 12px !important; }
.next-world-row { margin-top: 10px; }
.next-world-btn {
  border: 1px solid color-mix(in srgb, var(--signal) 70%, #fff 10%);
  background: color-mix(in srgb, var(--signal) 16%, #131823);
  color: var(--paper); border-radius: 3px; padding: 6px 12px; font-size: 12px; font-weight: 560;
}
.next-world-btn:hover { background: color-mix(in srgb, var(--signal) 26%, #131823); }

/* Receiver Panel */
.receiver {
  background: #10131a; border-left: 1px solid var(--border); min-width: 0;
  display: grid; grid-template-rows: auto auto minmax(120px, 1fr) auto; padding: 14px 19px 12px;
}
.band { margin-bottom: 13px; }
.band-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.band-head h2 { font-size: 14px; font-weight: 560; }
.band-head span { color: var(--signal); font-size: 9.5px; opacity: .9; }
.band-plot { position: relative; height: 86px; background: #090d14; border: 1px solid #283040; }
#spectrum { display: block; position: absolute; width: 100%; height: 100%; cursor: ew-resize; touch-action: none; }
#spectrum.fixed { cursor: default; }

.scope-head, .mix-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scope-head { padding: 0 0 8px; }
.scope-head h2, .mix-head h2 { font-size: 14px; font-weight: 560; }
.scope-state { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.scope-state.holding { color: var(--signal); }
.scope-state.holding .dot { background: var(--signal); }
.scope-state.acquired { color: #9de4be; }
.scope-state.acquired .dot { background: #9de4be; }
.scope { position: relative; background: #090d14; border: 1px solid #283040; transition: border-color .25s; }
.scope.flash { border-color: var(--signal); box-shadow: inset 0 0 24px color-mix(in srgb, var(--signal) 22%, transparent); }
#oscilloscope { display: block; position: absolute; width: 100%; height: 100%; }
.scope-tag { position: absolute; pointer-events: none; bottom: 8px; left: 9px; font-size: 9px; color: #a0adbd; }
.scope-tag-end { left: auto; right: 9px; }

.tuning { display: grid; grid-template-columns: minmax(128px, 184px) 1fr; align-items: center; gap: 14px; padding-top: 9px; }
.knob { aspect-ratio: 1; width: 100%; cursor: grab; touch-action: none; }
.knob.dragging { cursor: grabbing; }
.knob.fixed, #frequency[aria-disabled="true"] { cursor: default; }
.knob canvas { width: 100%; height: 100%; display: block; }
.tune-controls { min-width: 0; padding-right: 4px; }
.tune-controls label, .strength-head, #tune-help { color: var(--muted); }
.frequency { font: 34px/1.05 var(--mono); color: var(--paper); letter-spacing: -.07em; margin: 5px 0 4px; }
.frequency small { font-size: 14px; color: var(--muted); letter-spacing: 0; }
input[type="range"] { accent-color: var(--signal); width: 100%; height: 23px; margin: 0; cursor: pointer; }
input[type="range"]:disabled { cursor: default; opacity: .35; }
.strength-head { display: flex; justify-content: space-between; gap: 4px; margin: 8px 0 4px; }
#strength-value { color: var(--signal); }
meter { display: block; height: 4px; width: 100%; -webkit-appearance: none; appearance: none; background: #262c39; }
meter::-webkit-meter-bar { background: #262c39; border: 0; border-radius: 0; }
meter::-webkit-meter-optimum-value { background: var(--signal); }
meter::-moz-meter-bar { background: var(--signal); }
#tune-help { font-size: 11px; line-height: 1.4; margin-top: 8px; }

/* Channel Mix */
.mix { margin-top: 15px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.mix-head { margin-bottom: 8px; }
.mix-head p { color: var(--muted); }
.channels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); }
.channel { position: relative; min-width: 0; background: #10131a; }
.channel + .channel { border-left: 1px solid var(--border); }
.channel.selected { background: #181c26; }
.select-channel {
  position: relative; display: flex; align-items: flex-start; gap: 8px; width: 100%;
  border: 0; border-top: 2px solid transparent; min-height: 47px;
  text-align: left; padding: 9px 10px; background: transparent;
}
.select-channel:hover { background: #1f2431; }
.channel.selected .select-channel { border-top-color: var(--channel-color); }
.channel .dot { width: 6px; height: 6px; margin: 5px 0 0 1px; background: #5a6375; }
.channel.selected .dot, .channel.unlocked .dot { background: var(--channel-color); box-shadow: 0 0 8px var(--channel-color); }
.channel-name { font-size: clamp(12px, 1.45vw, 15px); display: block; line-height: 1.12; }
.channel-state { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.channel.unlocked .channel-state { color: var(--channel-color); }
.channel-mix { display: flex; align-items: center; gap: 6px; padding: 0 10px 8px; }
.channel-mix button {
  border: 1px solid #343a4a; border-radius: 2px; padding: 4px 5px;
  background: #151922; min-width: 35px; min-height: 28px; font: 10px/1 var(--mono); color: var(--muted);
}
.channel-mix button[aria-pressed="true"] { color: var(--channel-color); border-color: #69717f; }
.channel-mix button:disabled { opacity: .55; }
.channel-mix input { accent-color: var(--channel-color); }

/* Initialize Dialog */
.initialize {
  width: min(510px, calc(100% - 34px)); max-height: calc(100% - 30px); overflow: auto;
  padding: clamp(24px, 5vw, 36px);
  background: radial-gradient(ellipse at 92% 0%, #24344c 0%, transparent 62%), #0f131d;
  color: var(--paper); border: 1px solid #495a70; border-top: 2px solid var(--ember);
  box-shadow: 0 24px 100px #03050bc4;
}
.initialize::backdrop { background: #060911cf; backdrop-filter: blur(6px); }
.boot-heading { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; color: var(--ice); }
.boot-heading img { width: 32px; height: 32px; margin-left: -4px; }
.initialize h2 { font-size: clamp(30px, 6vw, 44px); line-height: .96; letter-spacing: -.055em; font-weight: 420; }
#initialize-copy { font-size: 14px; color: #c7d3e3; line-height: 1.58; margin: 14px 0 16px; max-width: 44ch; }
.boot-steps {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 20px; padding: 10px 12px;
  background: #0a0e17; border: 1px solid #263144; border-radius: 3px; font-size: 10.5px; color: #b8c4d6;
}
.boot-steps b { color: var(--ember); margin-right: 4px; }
.initialize-button {
  background: var(--ember); color: #180e0a; border: 1px solid #ff9475; min-height: 43px;
  padding: 0 16px; border-radius: 3px; font-weight: 660; font-size: 13px;
  transition: background .15s;
}
.initialize-button:hover { background: #ff7e56; }
.initialize-button:disabled { opacity: .75; }

/* Full-Screen Ambient Observatory Mode */
.observatory {
  position: fixed; inset: 0; z-index: 50; background: #050810; overflow: hidden;
}
#observatory-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.obs-top {
  position: absolute; top: 24px; left: 28px; right: 28px; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.obs-brand { display: flex; align-items: center; gap: 10px; }
.obs-brand img { width: 34px; height: 34px; }
.obs-brand strong { display: block; color: var(--paper); font-size: 12px; }
.obs-brand span { display: block; color: var(--ice); font-size: 10px; opacity: .85; }
.obs-controls { display: flex; gap: 8px; }
.obs-controls button { background: #0b101cc8; backdrop-filter: blur(6px); }
.obs-footer {
  position: absolute; bottom: 20px; left: 28px; right: 28px; z-index: 2;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px;
  color: #8f9db3; font-size: 10px; pointer-events: none;
}

@media (max-width: 900px) {
  .tuning { grid-template-columns: minmax(102px, 144px) 1fr; gap: 8px; }
  .portrait { min-height: 235px; }
  .planet-lens, .orbit, .lock-ring { left: 65%; }
  .choir-banner { grid-template-columns: 1fr; }
  .choir-visual { height: 110px; }
}
@media (max-width: 720px) {
  .step-guide { grid-template-columns: 1fr; gap: 6px; }
  .intro { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 0 12px; min-height: unset; }
  h1 { font-size: clamp(40px, 11vw, 62px); }
  .console { display: flex; flex-direction: column; }
  .portrait { min-height: 205px; }
  .portrait-caption { left: 12px; bottom: 11px; }
  .receiver { border-left: none; border-top: 1px solid var(--border); padding: 12px; grid-template-rows: auto auto 118px auto; }
  .channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel:nth-child(3) { border-left: 0; }
  .channel:nth-child(n+3) { border-top: 1px solid var(--border); }
  .obs-top { top: 14px; left: 14px; right: 14px; flex-wrap: wrap; }
}
