/* ═══════════════════════════════════════════════════════════════
   THE CHAMBER — Dark Soundstage Edition
   Pure black backdrop, rim lighting, cinematic monochrome
   ═══════════════════════════════════════════════════════════════ */

:root {
  --c-bg:       #000000;
  --c-bg-soft:  #050608;
  --c-stage:    #0a0c10;

  --c-rim:      #fbbf24;        /* warm amber rim — Maestro identity */
  --c-rim-soft: #fde68a;
  --c-cool:     #c8d4e6;        /* cool white key light tone */
  --c-cool-dim: #8492a8;

  --c-text:        #e3e7ec;
  --c-text-mute:   rgba(227, 231, 236, 0.55);
  --c-text-dim:    rgba(227, 231, 236, 0.32);
  --c-ink:         rgba(227, 231, 236, 0.92);
  --c-rule:        rgba(227, 231, 236, 0.12);
  --c-rule-rim:    rgba(251, 191, 36, 0.18);

  --c-master:      #c4b8ff;
  --c-master-soft: #e5dbff;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease-theatre: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-soft: cubic-bezier(0.7, 0, 0.84, 0);
}

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

/* Chamber-wide yellow scrollbars — applies to every scrollable region unless
   a more specific rule overrides. */
html, body, .sigil-card, .im-card, #address-input, .im-form, [class*="im-"] {
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 191, 36, 0.7) rgba(0, 0, 0, 0.25);
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); border-radius: 5px; }
*::-webkit-scrollbar-thumb { background: rgba(251, 191, 36, 0.7); border-radius: 5px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(251, 191, 36, 0.95); }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--c-text);
  background: #000;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Force the modern font stack everywhere — defeats any stale browser cache */
.stanza-body, .stanza-head, .im-title, .im-eyebrow, .mn-text,
.address-hint, .ct-brand-text, .ct-brand-mark, .ct-beta {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif !important;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas: "top" "stage" "dialogue" "address";
  position: relative;
}

/* ═══════════════════════════════════════════════════════════
   SOUNDSTAGE ATMOSPHERE — vignette, dust, ambient backdrop
   ═══════════════════════════════════════════════════════════ */

/* Faint stars (kept for ambience, very subtle) */
#constellation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* Heavy vignette — soundstage edge fade */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.65) 85%, #000 100%),
    radial-gradient(ellipse 60% 40% at center 60%, rgba(251,191,36,0.04), transparent 70%);
  mix-blend-mode: multiply;
}

/* Film grain */
.film-grain {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.85'/></svg>");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, -4%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, 4%); }
  80%  { transform: translate(3%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ═══════════════════════════════════════════════════════════
   TOP BAR — minimal monochrome
   ═══════════════════════════════════════════════════════════ */
.chamber-top {
  grid-area: top;
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px 10px;
}
.ct-brand { display: flex; align-items: center; gap: 12px; }
.ct-brand-mark {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--c-rim);
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.55);
  font-weight: 500;
}
.ct-brand-text {
  font-size: 12px;
  color: var(--c-cool-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-ui);
  font-weight: 500;
}
.ct-beta {
    color: var(--c-rim);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  margin-left: 6px;
  letter-spacing: 0.06em;
  text-transform: none;
}
.ct-right { display: flex; gap: 10px; align-items: center; }
.ct-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid #fbbf24;
  color: var(--c-cool-dim);
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.35s var(--ease-theatre);
  text-decoration: none;
  backdrop-filter: blur(8px);
}
.ct-btn:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: var(--c-rim);
  color: var(--c-rim);
  box-shadow: 0 6px 18px -6px rgba(251, 191, 36, 0.4);
}
.ct-btn[aria-pressed="true"] {
  background: rgba(251, 191, 36, 0.16);
  border-color: var(--c-rim);
  color: var(--c-rim);
}
.ct-btn[aria-pressed="true"] .mute-on-only  { display: none; }
.ct-btn[aria-pressed="true"] .mute-off-only { display: block !important; }
.ct-btn-label {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  color: inherit;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════
   THE STAGE — soundstage with spotlight + 3D canvas
   ═══════════════════════════════════════════════════════════ */
.stage {
  grid-area: stage;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56vh;
  padding: 4px 24px 24px;       /* extra bottom padding to keep canvas off the dialogue */
  overflow: hidden;
}

/* Spotlight cone — very subtle backdrop glow (canvas bloom does the real work) */
.spotlight-cone {
  position: absolute;
  top: -8%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 700px;
  height: 110%;
  pointer-events: none;
  background: radial-gradient(ellipse 40% 55% at 50% 5%, rgba(251, 191, 36, 0.045), transparent 75%);
  filter: blur(30px);
  z-index: 1;
}
.stage-floor {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 45%;
  height: 12%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.05), transparent 80%);
  filter: blur(20px);
  z-index: 1;
}

/* The 3D canvas — absolutely centered on the stage, same size as the
   orbit aura ring so the robot lives INSIDE the visible circle. */
.maestro-wrap {
  position: absolute;
  top: 46%;                     /* lift slightly above center so feet sit higher in stage */
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(320px, 48vh, 560px);
  height: clamp(320px, 48vh, 560px);
  z-index: 3;
}
.maestro3d {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Floor reflection (subtle CSS layer beneath canvas, in case of letterboxing) */
.floor-reflection {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 30px;
  background: radial-gradient(ellipse at center top, rgba(251, 191, 36, 0.1) 0%, transparent 75%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 2;
}

/* Aura rings — kept very subtle in soundstage */
.aura {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -45%);
  z-index: 1;
}
.aura-1 {
  width: clamp(420px, 62vh, 760px);
  height: clamp(420px, 62vh, 760px);
  border: 1px solid rgba(251, 191, 36, 0.08);
  animation: aura-breathe 6s ease-in-out infinite;
}
.aura-2 {
  width: clamp(580px, 78vh, 920px);
  height: clamp(580px, 78vh, 920px);
  border: 1px dashed rgba(227, 231, 236, 0.04);
  animation: aura-rotate 80s linear infinite;
}
@keyframes aura-breathe {
  0%, 100% { transform: translate(-50%, -45%) scale(1); opacity: 0.55; }
  50%      { transform: translate(-50%, -45%) scale(1.04); opacity: 0.85; }
}
@keyframes aura-rotate {
  from { transform: translate(-50%, -45%) rotate(0deg); }
  to   { transform: translate(-50%, -45%) rotate(360deg); }
}

/* Orbit glyphs — only visible thinking/composing */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(380px, 54vh, 620px);
  height: clamp(380px, 54vh, 620px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease-theatre);
  z-index: 4;
}
body[data-state="thinking"] .orbit,
body[data-state="composing"] .orbit { opacity: 0.7; }
.o-glyph {
  position: absolute;
  top: 50%; left: 50%;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--c-rim);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
  transform-origin: 0 0;
}
.o-g1 { animation: orbit-1 14s linear infinite; }
.o-g2 { animation: orbit-2 18s linear infinite; }
.o-g3 { animation: orbit-3 22s linear infinite reverse; }
.o-g4 { animation: orbit-4 16s linear infinite; }
.o-g5 { animation: orbit-5 24s linear infinite reverse; }
@keyframes orbit-1 { from { transform: rotate(0deg) translateX(220px) rotate(0deg); } to { transform: rotate(360deg) translateX(220px) rotate(-360deg); } }
@keyframes orbit-2 { from { transform: rotate(72deg) translateX(260px) rotate(-72deg); } to { transform: rotate(432deg) translateX(260px) rotate(-432deg); } }
@keyframes orbit-3 { from { transform: rotate(144deg) translateX(200px) rotate(-144deg); } to { transform: rotate(504deg) translateX(200px) rotate(-504deg); } }
@keyframes orbit-4 { from { transform: rotate(216deg) translateX(280px) rotate(-216deg); } to { transform: rotate(576deg) translateX(280px) rotate(-576deg); } }
@keyframes orbit-5 { from { transform: rotate(288deg) translateX(240px) rotate(-288deg); } to { transform: rotate(648deg) translateX(240px) rotate(-648deg); } }

/* Voice visualizer ring */
.voice-viz {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(400px, 60vh, 720px);
  height: clamp(400px, 60vh, 720px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease-theatre);
  z-index: 4;
}
body[data-state="speaking"] .voice-viz { opacity: 0.95; }

/* Master sigil (lower-left counterpoint) */
.master-sigil {
  position: absolute;
  left: 5%;
  bottom: 8%;
  width: clamp(72px, 8vw, 110px);
  height: clamp(72px, 8vw, 110px);
  pointer-events: none;
  filter: drop-shadow(0 0 24px rgba(196, 184, 255, 0.4));
  z-index: 5;
}
.master-sigil::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed rgba(196, 184, 255, 0.35);
  animation: aura-rotate 60s linear infinite reverse;
}
.ms-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
    font-size: 12px;
  color: var(--c-master);
  letter-spacing: 0.14em;
  white-space: nowrap;
  opacity: 0.65;
  text-transform: uppercase;
}
body[data-master-active="true"] .master-sigil {
  filter: drop-shadow(0 0 36px rgba(196, 184, 255, 0.7));
  transform: scale(1.06);
  transition: all 0.4s var(--ease-out-soft);
}
#master-mark-inner path,
#master-mark-inner line,
#master-mark-inner circle,
#master-mark-inner polygon,
#master-mark-inner text {
  fill: none;
  stroke: var(--c-master-soft);
  stroke-width: 1.4;
}
#master-mark-inner text {
  fill: var(--c-master-soft);
  stroke: none;
  font-family: var(--font-display);
  }

/* ═══════════════════════════════════════════════════════════
   THE DIALOGUE — minimal monochrome stanzas
   ═══════════════════════════════════════════════════════════ */
.dialogue {
  grid-area: dialogue;
  position: relative;
  z-index: 5;
  max-height: 28vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 191, 36, 0.7) rgba(0, 0, 0, 0.25);
  /* Match the input box: same max-width + same horizontal positioning as .address-inner */
  width: calc(100% - max(12vw, 32px));
  max-width: 920px;
  margin: 4px auto 0;
  padding: 14px 22px;
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  border-radius: 14px;
  background: rgba(8, 10, 14, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, 0.8),
              inset 0 1px 0 rgba(251, 191, 36, 0.06);
}
.dialogue::-webkit-scrollbar { width: 10px; }
.dialogue::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); border-radius: 5px; }
.dialogue::-webkit-scrollbar-thumb { background: rgba(251, 191, 36, 0.7); border-radius: 5px; }
.dialogue::-webkit-scrollbar-thumb:hover { background: rgba(251, 191, 36, 0.95); }
.dialogue-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stanza {
  position: relative;
  padding: 4px 0 4px 22px;
  animation: stanza-in 0.9s var(--ease-out-soft) both;
}
@keyframes stanza-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stanza::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--rule-color, var(--c-rule)) 30%, var(--rule-color, var(--c-rule)) 70%, transparent);
}
.stanza-maestro { --rule-color: rgba(251, 191, 36, 0.45); }
.stanza-master  { --rule-color: rgba(196, 184, 255, 0.45); }
.stanza-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--c-text-mute);
  text-transform: uppercase;
}
.stanza-maestro .stanza-head { color: var(--c-rim); }
.stanza-master  .stanza-head { color: var(--c-master); }
.stanza-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, currentColor, transparent);
  opacity: 0.3;
}
.stanza-body {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--c-ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.stanza-master .stanza-body { color: rgba(229, 219, 255, 0.92); }
.stanza-body strong { font-weight: 600; color: var(--c-rim); }
.stanza-body em     { color: var(--c-rim-soft); }
.stanza-body code   { font-family: var(--font-mono); font-size: 0.85em; background: rgba(251, 191, 36, 0.06); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--c-rule-rim); }
.stanza-typing::after {
  content: "▎";
  color: var(--c-rim);
  margin-left: 4px;
  animation: cursor-blink 1.05s steps(2, end) infinite;
}
@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.stanza-system .stanza-body {
    font-size: 16px;
  color: var(--c-text-mute);
}
.stanza-link {
  margin-top: 6px;
  display: inline-block;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 12px;
  color: var(--c-rim);
  border: 1px solid var(--c-rule-rim);
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease-theatre);
}
.stanza-link:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: var(--c-rim);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   THE ADDRESS — minimal cinematic input
   ═══════════════════════════════════════════════════════════ */
.address {
  grid-area: address;
  position: relative;
  z-index: 6;
  padding: 12px max(6vw, 16px) 22px;
}
.address-inner {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.adr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.adr-quill {
  position: relative;
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  border-radius: 14px;
  background: rgba(10, 12, 16, 0.7);
  backdrop-filter: blur(14px);
  transition: all 0.5s var(--ease-theatre);
  overflow: hidden;
}
.adr-quill:focus-within {
  border-color: var(--c-rim);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.06),
              0 10px 40px -10px rgba(251, 191, 36, 0.35);
  background: rgba(15, 18, 24, 0.88);
}
#address-input {
  width: 100%;
  resize: none;
  background: transparent;
  border: none;
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.5;
  padding: 14px 18px;
  max-height: 173px;     /* desktop: ~6 lines */
  overflow-y: auto;
}
#address-input:focus { outline: none; }
#address-input::placeholder {
  color: var(--c-text-dim);
  }
.adr-flourish {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1.5px;
  background: linear-gradient(to right, transparent, var(--c-rim), transparent);
  transform: translateX(-50%);
  transition: width 0.6s var(--ease-out-soft);
}
.adr-quill:focus-within .adr-flourish { width: 92%; }
.adr-mic, .adr-send, .adr-stop {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid var(--c-rule);
  background: rgba(255, 255, 255, 0.03);
  color: var(--c-cool-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s var(--ease-theatre);
  backdrop-filter: blur(8px);
}
.adr-mic {
  border: 1.5px solid #fbbf24;
}
.adr-mic:hover, .adr-send:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: var(--c-rim);
  color: var(--c-rim);
  box-shadow: 0 8px 22px -8px rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}
.adr-send {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.04));
  border-color: rgba(251, 191, 36, 0.45);
  color: var(--c-rim);
}
.adr-send:hover {
  background: linear-gradient(135deg, var(--c-rim), #d97706);
  color: #0a0e1a;
}
.adr-stop {
  background: rgba(124, 29, 29, 0.4);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fca5a5;
}
.mic-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--c-rim);
  opacity: 0;
  pointer-events: none;
}
body[data-listening="true"] .adr-mic {
  background: rgba(251, 191, 36, 0.18);
  border-color: var(--c-rim);
  color: var(--c-rim);
}
body[data-listening="true"] .mic-pulse {
  animation: mic-ping 1.4s ease-out infinite;
}
@keyframes mic-ping {
  0%   { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.55); }
}
.address-hint {
  text-align: center;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--c-text-dim);
  letter-spacing: 0.1em;
  font-family: var(--font-ui);
  text-transform: uppercase;
}
.address-hint kbd {
  font-family: var(--font-mono);
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid var(--c-rule-rim);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--c-rim-soft);
  text-transform: none;
  letter-spacing: 0;
}
.address-hint .hint-sep {
  margin: 0 8px;
  opacity: 0.5;
}
.address-hint .hint-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--c-rim-soft);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(251, 191, 36, 0.35);
  text-underline-offset: 3px;
  transition: color 0.25s var(--ease-theatre);
}
.address-hint .hint-toggle:hover {
  color: var(--c-rim);
  text-decoration-color: var(--c-rim);
}

/* ═══════════════════════════════════════════════════════════
   SIGIL OVERLAY (first visit)
   ═══════════════════════════════════════════════════════════ */
.sigil-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(8, 10, 14, 0.92), #000);
  backdrop-filter: blur(20px);
  animation: fade-in 1s var(--ease-out-soft);
}
.sigil-overlay[aria-hidden="false"] { display: flex; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sigil-card {
  width: min(640px, 92vw);
  max-height: 90vh;
  padding: 38px 42px;
  border: 1px solid var(--c-rule);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 18, 24, 0.95), rgba(5, 6, 8, 0.96));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9),
              0 0 0 1px rgba(251, 191, 36, 0.04) inset;
  overflow-y: auto;
  animation: sigil-rise 1s var(--ease-out-soft);
}
@keyframes sigil-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sigil-eyebrow {
  font-family: var(--font-display);
    color: var(--c-master);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.85;
}
.sigil-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  color: var(--c-rim-soft);
  margin-bottom: 12px;
  line-height: 1.1;
}
.sigil-title em { color: var(--c-rim); font-weight: 500; }
.sigil-lede {
  font-family: var(--font-display);
  font-size: 16px;
    color: var(--c-text-mute);
  margin-bottom: 28px;
  line-height: 1.55;
}
.sigil-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.sigil-tile {
  aspect-ratio: 1;
  border: 1px solid var(--c-rule);
  border-radius: 12px;
  background: rgba(20, 22, 28, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--ease-theatre);
  padding: 10px;
}
.sigil-tile svg { width: 100%; height: 100%; }
.sigil-tile:hover {
  border-color: var(--c-master);
  background: rgba(124, 106, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(196, 184, 255, 0.4);
}
.sigil-tile.selected {
  border-color: var(--c-master-soft);
  background: rgba(196, 184, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(196, 184, 255, 0.3),
              0 0 30px rgba(196, 184, 255, 0.25);
}
.sigil-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.sigil-custom label {
  font-family: var(--font-display);
    color: var(--c-text-mute);
  font-size: 15px;
}
#sigil-initial {
  background: rgba(10, 12, 16, 0.55);
  border: 1px solid var(--c-rule);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--c-master-soft);
  width: 80px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s;
}
#sigil-initial:focus { border-color: var(--c-master); }
.sigil-confirm {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, rgba(196, 184, 255, 0.2), rgba(124, 106, 255, 0.15));
  border: 1px solid var(--c-master);
  color: var(--c-master-soft);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.08em;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.5s var(--ease-theatre);
  text-transform: uppercase;
}
.sigil-confirm:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--c-master), #7c6aff);
  color: #0a0e1a;
  box-shadow: 0 14px 38px -10px rgba(196, 184, 255, 0.6);
  transform: translateY(-1px);
}
.sigil-confirm:disabled { opacity: 0.35; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════
   INPUTS MODAL
   ═══════════════════════════════════════════════════════════ */
.inputs-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}
.inputs-modal[aria-hidden="false"] { display: flex; animation: fade-in 0.5s; }
.im-card {
  width: min(560px, 92vw);
  max-height: 86vh;
  padding: 32px 36px;
  border: 1px solid var(--c-rule);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 18, 24, 0.95), rgba(5, 6, 8, 0.96));
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9);
  overflow-y: auto;
  animation: sigil-rise 0.6s var(--ease-out-soft);
}
.im-eyebrow {
  font-family: var(--font-display);
    color: var(--c-rim-soft);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.85;
}
.im-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--c-ink);
  margin-bottom: 24px;
}
.im-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.im-field { display: flex; flex-direction: column; gap: 6px; }
.im-field label {
  font-family: var(--font-display);
    color: var(--c-text-mute);
  font-size: 15px;
}
.im-field input, .im-field textarea {
  background: rgba(10, 12, 16, 0.55);
  border: 1px solid var(--c-rule);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--c-ink);
  outline: none;
  transition: border-color 0.3s;
  resize: vertical;
}
.im-field input:focus, .im-field textarea:focus { border-color: var(--c-rim); }
.im-actions { display: flex; gap: 12px; justify-content: flex-end; }
.im-cancel, .im-submit {
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.4s var(--ease-theatre);
}
.im-cancel {
  background: transparent;
  border: 1px solid var(--c-rule);
  color: var(--c-text-mute);
}
.im-cancel:hover { color: var(--c-text); border-color: var(--c-text-mute); }
.im-submit {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(251, 191, 36, 0.08));
  border: 1px solid var(--c-rim);
  color: var(--c-rim);
}
.im-submit:hover {
  background: linear-gradient(135deg, var(--c-rim), #d97706);
  color: #0a0e1a;
}

/* ═══════════════════════════════════════════════════════════
   DCP CONNECTOR WIZARD (Chamber-native)
   Built on top of .inputs-modal / .im-card for shape + animation.
   Adds the stepper, saved-connection picker, credential form, and
   database/table pickers needed for a full DCP bind flow.
   ═══════════════════════════════════════════════════════════ */
.cm-card { width: min(640px, 94vw); }
.cm-stepper {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -12px 0 18px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  opacity: 0.65;
}
.cm-step { padding: 4px 0; }
.cm-step.is-active { color: var(--c-rim); opacity: 1; }
.cm-step + .cm-step::before { content: " › "; color: var(--c-rule); margin: 0 6px; }

.cm-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #fca5a5;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.cm-loading {
  font-family: var(--font-display);
  color: var(--c-rim);
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  opacity: 0.85;
}

.cm-step-body { margin-bottom: 18px; }
.cm-section { margin-bottom: 16px; }
.cm-label {
  font-family: var(--font-display);
  color: var(--c-text-mute);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: 0.85;
}
.cm-link {
  background: none;
  border: none;
  color: var(--c-rim);
  font-family: var(--font-display);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0 4px;
  transition: opacity 0.3s;
}
.cm-link:hover { opacity: 0.7; }

/* Saved-connection list */
.cm-saved-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.cm-saved-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--c-rule);
  background: rgba(10, 12, 16, 0.4);
  color: var(--c-ink);
  font-family: var(--font-ui);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s, background 0.25s;
}
.cm-saved-row:hover { border-color: var(--c-rim-soft); background: rgba(15, 18, 24, 0.55); }
.cm-saved-row.is-selected { border-color: var(--c-rim); background: rgba(251, 191, 36, 0.08); }
.cm-saved-nick { font-size: 14px; color: var(--c-ink); }
.cm-saved-meta { font-size: 11px; color: var(--c-text-mute); opacity: 0.75; }
.cm-empty {
  font-family: var(--font-display);
  color: var(--c-text-mute);
  font-size: 13px;
  font-style: italic;
  padding: 16px;
  text-align: center;
  border: 1px dashed var(--c-rule);
  border-radius: 8px;
  opacity: 0.65;
}

/* New-credentials form */
.cm-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.cm-field { display: flex; flex-direction: column; gap: 5px; }
.cm-field-row { flex-direction: row; align-items: center; gap: 8px; }
.cm-field label {
  font-family: var(--font-display);
  color: var(--c-text-mute);
  font-size: 13px;
}
.cm-field input[type="text"],
.cm-field input[type="password"],
.cm-field input[type="number"],
.cm-field select {
  background: rgba(10, 12, 16, 0.55);
  border: 1px solid var(--c-rule);
  border-radius: 7px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--c-ink);
  outline: none;
  transition: border-color 0.3s;
}
.cm-field input:focus, .cm-field select:focus { border-color: var(--c-rim); }
.cm-help {
  font-family: var(--font-display);
  color: var(--c-text-mute);
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
}

/* Database / table picker rows */
.cm-pick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--c-rule);
  border-radius: 8px;
  background: rgba(10, 12, 16, 0.4);
}
.cm-pick-row {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--c-ink);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s, border-color 0.18s;
}
.cm-pick-row:hover { background: rgba(251, 191, 36, 0.06); border-color: var(--c-rim-soft); }
.cm-pick-row.is-selected { background: rgba(251, 191, 36, 0.14); border-color: var(--c-rim); color: var(--c-rim); }

.cm-actions { justify-content: space-between; }
.cm-actions .im-cancel { margin-right: auto; }

/* ═══════════════════════════════════════════════════════════
   MOBILE NOTICE BANNER
   ═══════════════════════════════════════════════════════════ */
.mobile-notice {
  display: none;
  position: relative;
  z-index: 15;     /* above vignette + film grain so the dismiss is clickable */
}
.mn-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(15, 18, 24, 0.96), rgba(5, 6, 8, 0.9));
  border-bottom: 1px solid var(--c-rule-rim);
}
.mn-glyph { font-size: 24px; filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.5)); }
.mn-text {
  flex: 1;
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif !important;
  font-size: 17px !important;
  line-height: 1.4 !important;
  color: #fde68a !important;    /* same warm yellow as the Continue button */
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
}
.mn-text strong {
  display: block;
  color: var(--c-rim-soft);
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.mn-text em { color: var(--c-rim); }
.mn-dismiss {
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--ease-theatre);
}
.mn-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  body { grid-template-rows: auto auto 1fr auto auto; grid-template-areas: "top" "mobile" "stage" "dialogue" "address"; }
  .mobile-notice { display: block; grid-area: mobile; position: relative; z-index: 9; }
  .chamber-top { padding: 10px 14px; }
  .ct-brand-text { font-size: 10px; }
  .ct-beta { font-size: 10px; }
  .stage { min-height: 36vh; padding: 4px 8px 0; }
  .maestro-wrap { height: clamp(280px, 44vh, 440px); }
  .aura-1, .aura-2, .voice-viz { width: clamp(280px, 50vh, 420px); height: clamp(280px, 50vh, 420px); }
  .orbit { width: 280px; height: 280px; }
  .master-sigil { left: 4%; bottom: 3%; width: 58px; height: 58px; }
  .ms-label { font-size: 10px; }
  .dialogue { max-height: 34vh; padding: 0 16px; }
  .stanza-body { font-size: 17px; }
  .address { padding: 8px 12px 14px; }
  .address-inner { grid-template-columns: 1fr auto; gap: 8px; }
  .adr-actions { gap: 6px; }
  .adr-mic, .adr-send, .adr-stop { width: 44px; height: 44px; }
  #address-input {
    font-size: 16px;
    padding: 11px 14px;
    max-height: 70px;             /* mobile: 2 lines max, then scroll inside */
  }
  .address-hint { font-size: 10px; }
  .sigil-card { padding: 28px 22px; }
  .sigil-title { font-size: 28px; }
  .sigil-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .aura-1, .aura-2, .film-grain, .o-glyph { animation: none !important; }
  * { transition-duration: 0.01s !important; animation-duration: 0.01s !important; }
}
