*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:root {
  --bg: #111821;
  --surface: rgba(18, 25, 34, 0.9);
  --surface-solid: #151d27;
  --text: #d7dfe7;
  --text-soft: #aab6c2;
  --green: #7cb694;
  --neon-green: #8bc8a3;
  --cyan: #7eb2c7;
  --amber: #d1a66d;
  --red: #d98585;
  --dim: #71808e;
  --prompt: #91c8a6;
  --panel-bg: rgba(18, 25, 34, 0.97);
  --edge-cyan: rgba(157, 183, 199, 0.26);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
}

#app { position: fixed; inset: 0; z-index: 0; }
#app canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#crt-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), rgba(0, 0, 0, 0.025));
  opacity: 0.12;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.45s ease;
}
body[data-room-mode='night'] #crt-overlay { opacity: 0.18; }

#vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 72%, rgba(4, 8, 12, 0.24) 100%);
  pointer-events: none;
  z-index: 2;
  opacity: 0.52;
  transition: opacity 0.45s ease;
}
body[data-room-mode='night'] #vignette { opacity: 0.76; }

#screen-dim {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 16, 24, 0.25) 20%, rgba(4, 7, 12, 0.82) 80%);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
body.terminal-open #screen-dim,
body.dolly-mode #screen-dim {
  opacity: 1;
}

#flash {
  position: fixed;
  inset: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease-out;
  z-index: 80;
}
#flash.on { opacity: 1; transition: opacity 0.05s ease-in; }

#loading {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(16, 23, 31, 0.86);
  border: 1px solid rgba(176, 196, 209, 0.16);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  transition: opacity 0.3s ease;
}
body.ready #loading { opacity: 0; pointer-events: none; }

.loader-inner { display: flex; align-items: center; gap: 9px; }
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(160, 184, 198, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-inner p {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.4px;
}

#profile-card {
  position: fixed;
  top: clamp(20px, 4vw, 54px);
  left: clamp(20px, 4vw, 58px);
  width: min(440px, calc(100vw - 40px));
  z-index: 12;
  padding: clamp(22px, 3vw, 30px);
  background:
    linear-gradient(145deg, rgba(22, 30, 40, 0.92), rgba(16, 23, 31, 0.84));
  border: 1px solid rgba(184, 203, 214, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(14px) saturate(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
body.overview-collapsed #profile-card {
  opacity: 0;
  transform: translateX(-24px);
  pointer-events: none;
}
body.panel-open #profile-card,
body.terminal-open #profile-card {
  opacity: 0.16;
  pointer-events: none;
}
#profile-collapse {
  position: absolute;
  top: 15px;
  right: 16px;
  min-height: 32px;
  padding: 6px 9px;
  color: var(--text-soft);
  background: rgba(228, 237, 242, 0.055);
  border: 1px solid rgba(184, 203, 214, 0.16);
  border-radius: 7px;
  font: 650 11px/1.4 var(--sans);
  cursor: pointer;
}
#profile-collapse:hover,
#profile-collapse:focus-visible {
  color: #eef3f5;
  background: rgba(228, 237, 242, 0.1);
  border-color: rgba(184, 203, 214, 0.3);
}
.profile-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.15px;
  padding-right: 92px;
}
.profile-context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(124, 182, 148, 0.14);
}
.profile-eyebrow {
  margin-top: 22px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.15px;
  text-transform: uppercase;
}
#profile-title {
  margin-top: 8px;
  color: #f2f5f7;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.02;
  letter-spacing: -1.8px;
}
.profile-role {
  margin-top: 11px;
  color: #d9e4ea;
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 600;
}
.profile-summary {
  margin-top: 13px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.62;
}
.profile-art {
  height: 78px;
  margin-top: 16px;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(11, 17, 24, 0.08), rgba(11, 17, 24, 0.2)),
    url('./workspace-triptych.jpg');
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(184, 203, 214, 0.16);
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}
.profile-proof {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.profile-proof > div {
  min-width: 0;
  padding: 12px;
  background: rgba(221, 233, 239, 0.035);
  border: 1px solid rgba(176, 196, 209, 0.12);
  border-radius: 9px;
}
.profile-proof strong {
  display: block;
  color: #edf3f5;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1;
}
.profile-proof span {
  display: block;
  margin-top: 7px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.45;
}
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
}
.profile-action {
  display: inline-flex;
  align-items: center;
  min-height: 39px;
  padding: 9px 13px;
  color: #dce7ec;
  background: rgba(228, 237, 242, 0.055);
  border: 1px solid rgba(184, 203, 214, 0.19);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.profile-action:hover,
.profile-action:focus-visible {
  background: rgba(228, 237, 242, 0.1);
  border-color: rgba(184, 203, 214, 0.34);
  transform: translateY(-1px);
}
.profile-action.primary {
  color: #13231a;
  background: #9dc9ad;
  border-color: #9dc9ad;
}
.profile-action.primary:hover,
.profile-action.primary:focus-visible { background: #aed7bc; border-color: #aed7bc; }
.profile-action.quiet { color: var(--text-soft); background: transparent; }
.profile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid rgba(184, 203, 214, 0.12);
}
.profile-nav a,
.profile-nav button {
  padding: 3px 0;
  color: var(--text-soft);
  background: none;
  border: 0;
  font: 600 11px/1.5 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.profile-nav a:hover,
.profile-nav a:focus-visible,
.profile-nav button:hover,
.profile-nav button:focus-visible { color: #f0f4f6; }
.profile-links {
  display: flex;
  gap: 14px;
  margin-top: 15px;
}
.profile-links a {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  text-underline-offset: 3px;
}
.profile-links a:hover,
.profile-links a:focus-visible { color: var(--text); }

#room-guide {
  position: fixed;
  left: clamp(20px, 4vw, 58px);
  bottom: 20px;
  z-index: 8;
  max-width: 430px;
  padding: 8px 11px;
  color: rgba(212, 223, 230, 0.72);
  background: rgba(18, 25, 34, 0.66);
  border: 1px solid rgba(184, 203, 214, 0.12);
  border-radius: 7px;
  backdrop-filter: blur(8px);
  font: 10px/1.45 var(--mono);
  transition: opacity 0.2s ease;
}
body.panel-open #room-guide,
body.terminal-open #room-guide { opacity: 0; }

#profile-restore {
  position: fixed;
  left: clamp(20px, 4vw, 58px);
  top: clamp(20px, 4vw, 54px);
  z-index: 13;
  min-height: 38px;
  padding: 8px 12px;
  color: #e2e9ed;
  background: rgba(18, 25, 34, 0.82);
  border: 1px solid rgba(184, 203, 214, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  font: 600 11px/1.4 var(--sans);
  cursor: pointer;
}
#profile-restore:hover,
#profile-restore:focus-visible { background: rgba(28, 37, 48, 0.92); }
body.panel-open #profile-restore,
body.terminal-open #profile-restore { opacity: 0; pointer-events: none; }

#zoom-controls {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9;
  display: grid;
  grid-template-columns: 44px 64px 44px 72px;
  gap: 4px;
  padding: 5px;
  background: rgba(18, 25, 34, 0.76);
  border: 1px solid rgba(184, 203, 214, 0.16);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
body.ready #zoom-controls {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
body.panel-open #zoom-controls,
body.terminal-open #zoom-controls {
  opacity: 0.18;
  pointer-events: none;
}
body.room-failed #zoom-controls,
body.no-webgl #zoom-controls { display: none; }
#zoom-controls button {
  min-width: 0;
  height: 44px;
  padding: 0 7px;
  color: #dce5ea;
  background: rgba(228, 237, 242, 0.055);
  border: 1px solid rgba(184, 203, 214, 0.14);
  border-radius: 6px;
  font: 650 15px/1 var(--sans);
  cursor: pointer;
}
#zoom-controls button:hover:not(:disabled),
#zoom-controls button:focus-visible {
  color: #f3f6f8;
  background: rgba(228, 237, 242, 0.12);
  border-color: rgba(184, 203, 214, 0.3);
}
#zoom-controls button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
#zoom-controls button:disabled {
  color: rgba(170, 182, 194, 0.36);
  cursor: default;
}
#zoom-reset {
  font-family: var(--mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.2px;
}
#room-mode {
  font-family: var(--mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.25px;
}
body[data-room-mode='day'] #room-mode { color: #dfbd88; }
body[data-room-mode='night'] #room-mode { color: #9fc5e2; }

#hotspots {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.panel-open #hotspots,
body.terminal-open #hotspots { opacity: 0.12; pointer-events: none; }

.hotspot {
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}
.hotspot:focus-visible { outline: 1px solid var(--cyan); outline-offset: 6px; border-radius: 50%; }

.hotspot-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(224, 238, 246, 0.95);
  border: 2px solid rgba(17, 24, 33, 0.85);
  box-shadow: 0 0 0 3px rgba(126, 178, 199, 0.22), 0 2px 8px rgba(0, 0, 0, 0.4);
  animation: hotspot-pulse 2.8s ease-in-out infinite;
}
@keyframes hotspot-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 3px rgba(126, 178, 199, 0.25), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 0 8px rgba(126, 178, 199, 0.08), 0 0 16px rgba(126, 178, 199, 0.45);
  }
}
.hotspot:hover .hotspot-dot {
  background: #ffffff;
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 0 0 8px rgba(126, 178, 199, 0.35), 0 0 20px rgba(126, 178, 199, 0.6);
}

.hotspot-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #edf3f7;
  background: rgba(14, 21, 30, 0.92);
  border: 1px solid rgba(184, 203, 214, 0.24);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  padding: 5px 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.hotspot:hover .hotspot-label,
.hotspot:focus-visible .hotspot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#tooltip {
  position: fixed;
  top: 0;
  left: 0;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.25px;
  color: #f0f4f7;
  background: rgba(14, 21, 30, 0.92);
  border: 1px solid rgba(184, 203, 214, 0.24);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  padding: 7px 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 40;
}
#tooltip.visible { opacity: 1; }

#backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
}
#backdrop.open { opacity: 1; pointer-events: auto; }

#panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(520px, 94vw);
  background: linear-gradient(165deg, rgba(20, 28, 38, 0.96), rgba(12, 17, 24, 0.98));
  border-left: 1px solid rgba(184, 203, 214, 0.2);
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(1.15);
  transform: translateX(103%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 31;
  display: flex;
  flex-direction: column;
}
#panel.open { transform: translateX(0); }

#panel-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(228, 237, 242, 0.06);
  border: 1px solid rgba(184, 203, 214, 0.2);
  color: #e5edf2;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
#panel-close:hover, #panel-close:focus-visible {
  border-color: rgba(184, 203, 214, 0.45);
  background: rgba(228, 237, 242, 0.14);
  transform: rotate(90deg);
}

#panel-tag {
  display: inline-block;
  margin: 22px 26px 0;
  padding: 4px 10px;
  width: fit-content;
  border-radius: 6px;
  background: rgba(126, 178, 199, 0.12);
  border: 1px solid rgba(126, 178, 199, 0.24);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
#panel-title {
  padding: 6px 56px 14px 26px;
  color: #edf2f5;
  font-size: 22px;
  letter-spacing: -0.35px;
  border-bottom: 1px solid rgba(184, 203, 214, 0.12);
}

#panel-body {
  padding: 18px 26px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.68;
}
.rich h3 {
  color: #d9e5ea;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 20px 0 8px;
}
.rich h3:first-child { margin-top: 0; }
.rich h4 {
  color: #e2e8eb;
  font-size: 14px;
  margin: 14px 0 4px;
}
.rich p { margin: 8px 0; }
.rich em { color: #e2e8eb; font-style: normal; font-weight: 650; }
.rich strong { color: #d8ecf5; }
.rich a {
  color: #9fc6d5;
  text-decoration: none;
  border-bottom: 1px dotted rgba(159, 198, 213, 0.45);
}
.rich a:hover, .rich a:focus-visible {
  color: #c4dde7;
  border-bottom-style: solid;
}
.rich code {
  background: rgba(184, 203, 214, 0.06);
  border: 1px solid rgba(184, 203, 214, 0.12);
  color: #c8d7de;
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
}
.rich ul { list-style: none; margin: 8px 0; }
.rich li { padding: 3px 0 3px 16px; position: relative; }
.rich li::before { content: '•'; position: absolute; left: 0; color: var(--dim); }
.rich .muted { color: var(--dim); }
.rich article {
  border-left: 2px solid rgba(159, 184, 198, 0.18);
  padding-left: 14px;
  margin: 14px 0;
}
.rich .btn {
  display: inline-block;
  background: rgba(157, 201, 173, 0.1);
  border: 1px solid rgba(157, 201, 173, 0.38);
  border-radius: 7px;
  color: #b8dbc4;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 18px;
  margin: 6px 8px 6px 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.rich .btn:hover, .rich .btn:focus-visible {
  background: rgba(157, 201, 173, 0.16);
  box-shadow: none;
}
.rich .btn.secondary {
  border-color: rgba(159, 184, 198, 0.3);
  color: #bfd0d8;
  background: rgba(159, 184, 198, 0.06);
}
.rich .btn.secondary:hover { background: rgba(159, 184, 198, 0.12); box-shadow: none; }

.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  background: var(--bg);
  color: var(--neon-green);
  border: 1px solid var(--edge-cyan);
  padding: 10px 16px;
  font-size: 12px;
  z-index: 200;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.crawl {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body.room-failed { overflow: auto; }
body.room-failed #profile-card,
body.no-webgl #profile-card {
  position: relative;
  inset: auto;
  width: min(860px, calc(100% - 40px));
  margin: 24px auto 0;
}
body.room-failed #room-guide,
body.no-webgl #room-guide { display: none; }
body.room-failed .crawl,
body.no-webgl .crawl {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  white-space: normal;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 22px;
}
body.room-failed #app,
body.room-failed #hotspots,
body.room-failed #crt-overlay,
body.no-webgl #app,
body.no-webgl #hotspots,
body.no-webgl #crt-overlay { display: none; }

#terminal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  font-family: var(--mono);
  z-index: 50;
}
#terminal-overlay.active { display: flex; }
#terminal-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.025) 0px,
    rgba(0, 0, 0, 0.025) 1px,
    transparent 1px,
    transparent 5px
  );
  pointer-events: none;
  z-index: 99;
}

.term-exit {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 110;
  background: transparent;
  border: 1px solid rgba(184, 203, 214, 0.22);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.term-exit:hover, .term-exit:focus-visible { border-color: rgba(184, 203, 214, 0.5); color: #fff; }

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 72px 7px 16px;
  background: #1d2732;
  border-bottom: 1px solid rgba(184, 203, 214, 0.14);
  font-size: 11px;
  color: #b9c6cf;
  flex-shrink: 0;
}
.status-bar .left, .status-bar .right { display: flex; gap: 20px; align-items: center; }
.signal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(124, 182, 148, 0.12);
}
.signal-dot.active { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 6px var(--green); }
  50% { box-shadow: 0 0 14px var(--green), 0 0 4px var(--green); }
}

.viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 16px 24px;
  position: relative;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.terminal { max-width: 900px; margin: 0 auto; font-family: var(--mono); }
.line { margin-bottom: 2px; white-space: pre-wrap; word-break: break-word; }
.line.dim { color: var(--dim); }
.line.green { color: var(--green); }
.line.cyan { color: var(--cyan); }
.line.amber { color: var(--amber); }
.line.red { color: var(--red); }
.line.prompt { color: var(--prompt); }

.input-area {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 8px 24px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.prompt-char { color: var(--prompt); font-weight: 700; font-size: 16px; flex-shrink: 0; }
#realInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  caret-color: var(--prompt);
  padding: 2px 0;
}
#realInput::placeholder { color: var(--dim); }

.hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.5px;
  animation: none;
}
@keyframes fadeHint {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

.splash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 700;
  color: var(--prompt);
  text-align: center;
  letter-spacing: 2px;
  text-shadow: none;
  animation: none;
  pointer-events: none;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  white-space: nowrap;
}
.splash small {
  display: inline-block;
  margin-top: 12px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.6px;
}
.splash.fading {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-20px);
}
@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 20px var(--prompt), 0 0 40px var(--prompt), 0 0 80px var(--green); }
  50% { text-shadow: 0 0 30px var(--prompt), 0 0 60px var(--prompt), 0 0 120px var(--green), 0 0 160px var(--cyan); }
}

@media (max-width: 768px) {
  #profile-card {
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 19px;
    border-radius: 13px;
    overflow-y: auto;
  }
  #profile-collapse { top: 12px; right: 13px; }
  #profile-restore {
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
  }
  #zoom-controls {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .profile-context { font-size: 9px; }
  .profile-eyebrow { margin-top: 15px; }
  #profile-title { font-size: clamp(29px, 10vw, 40px); }
  .profile-role { font-size: 14px; }
  .profile-summary { font-size: 13px; line-height: 1.5; }
  .profile-art { height: 62px; margin-top: 13px; }
  .profile-proof { margin-top: 15px; }
  .profile-proof > div { padding: 10px; }
  .profile-proof strong { font-size: 18px; }
  .profile-actions { margin-top: 16px; }
  .profile-action { min-height: 38px; }
  .profile-nav { margin-top: 16px; padding-top: 14px; }
  #room-guide { display: none; }
  #loading {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .status-bar { font-size: 9px; padding: 6px 46px 6px 10px; }
  .status-bar .left, .status-bar .right { gap: 10px; flex-wrap: wrap; }
  .viewport { padding: 12px; }
  .terminal { max-width: 100%; }
  .terminal .line { font-size: 13px; }
  .input-area { padding: 8px 12px 14px; }
  #realInput { font-size: 16px; padding: 8px 4px; min-height: 40px; -webkit-appearance: none; }
  .hint { bottom: 56px; font-size: 9px; letter-spacing: 1px; }

  #panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 84vh;
    max-height: 84dvh;
    border-left: none;
    border-top: 1px solid var(--edge-cyan);
    transform: translateY(103%);
  }
  #panel.open { transform: translateY(0); }
  #panel-title { padding-right: 26px; }
  #panel-body { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }

  #terminal-overlay {
    height: 100vh;
    height: 100dvh;
  }
  .term-exit {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
  }
  .status-bar { padding-top: calc(6px + env(safe-area-inset-top, 0px)); }
  .input-area { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }

  .hotspot { width: 44px; height: 44px; }
}

@media (max-height: 720px) and (min-width: 769px) {
  #profile-card { top: 16px; padding: 22px; }
  .profile-eyebrow { margin-top: 14px; }
  .profile-proof { margin-top: 14px; }
  .profile-actions { margin-top: 15px; }
  .profile-nav { margin-top: 14px; padding-top: 13px; }
  .profile-links { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .signal-dot.active { animation: none; }
  .hotspot-dot { animation: none; }
  .splash { animation: none; }
  .hint { animation: none; opacity: 0.5; }
  #panel, #backdrop, #profile-card, #room-guide, #zoom-controls, #crt-overlay, #vignette, .skip-link { transition: none; }
}
