.norte-immersive {
  --immersive-line: #303852;
  --immersive-text: #f0f2ff;
  --immersive-muted: #aebbd6;
  --immersive-accent: #c5bbff;
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: max(550px, calc(100svh - 64px));
  max-width: 1440px;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto auto;
  border: 1px solid var(--immersive-line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--immersive-text);
  background: radial-gradient(ellipse at 50% 32%, #1d203b, transparent 68%), #0c0f19;
}
.norte-immersive::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #0a0c1640, transparent 35%, transparent 60%, #080a12b0);
}
.norte-immersive:fullscreen, .norte-immersive.is-viewport {
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  grid-template-rows: auto minmax(360px, 1fr) auto auto;
}
.norte-immersive.is-viewport {
  position: fixed;
  inset: 0;
  z-index: 90;
  height: 100dvh;
}
html:has(.norte-immersive.is-viewport) { overflow: hidden; }
.immersive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 2.4vw, 26px) clamp(16px, 3.3vw, 42px);
}
.immersive-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.immersive-identity h1 {
  font-size: clamp(1.03rem, 2.4vw, 1.46rem);
  margin: 0;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .24em;
  color: var(--immersive-text);
}
.immersive-mark {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #5a5780;
  border-radius: 9px;
  background: #1c1d31;
  color: var(--immersive-accent);
}
.immersive-mark:hover { background: #2c2849; color: #eee5ff; }
.immersive-header-actions, .immersive-footer-actions, .immersive-input-status {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.immersive-mode {
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #3a4d65;
  color: #b8cce0;
  background: #142237;
  font-size: .75rem;
  font-weight: 560;
  line-height: 1.3;
}
.immersive-mode[data-mode="real"] {
  border-color: #3b6c89;
  background: #102b42;
  color: #b2e2fc;
}
.immersive-secondary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #a9c1d7;
  padding: 6px 8px;
  font-size: .8rem;
  font-weight: 580;
  white-space: nowrap;
  cursor: pointer;
}
.immersive-header .immersive-secondary { border-color: #1b3446; background: #081521bc; }
.immersive-header .immersive-profile { width: auto; color-scheme: dark; font-family: inherit; }
.immersive-secondary[aria-pressed="true"] {
  border-color: #3b819b;
  color: #bcf2ff;
  background: #0d2a3b;
}
.immersive-secondary:disabled { cursor: default; }
.immersive-secondary:hover {
  color: #d6f4ff;
  background: #172a40;
  border-color: #2c4761;
}
.immersive-fullscreen { width: 36px; }
.immersive-icon {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 14px;
  height: 14px;
}
.immersive-icon-settings {
  background: linear-gradient(currentColor,currentColor) 1px 3px / 12px 1px no-repeat,
    linear-gradient(currentColor,currentColor) 1px 7px / 12px 1px no-repeat,
    linear-gradient(currentColor,currentColor) 1px 11px / 12px 1px no-repeat;
}
.immersive-icon-settings::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 3px;
  height: 3px;
  background: currentColor;
  box-shadow: 5px 4px currentColor, 1px 8px currentColor;
}
.immersive-icon-fullscreen {
  background:
    linear-gradient(currentColor,currentColor) 1px 1px / 4px 1px no-repeat, linear-gradient(currentColor,currentColor) 1px 1px / 1px 4px no-repeat,
    linear-gradient(currentColor,currentColor) 9px 1px / 4px 1px no-repeat, linear-gradient(currentColor,currentColor) 12px 1px / 1px 4px no-repeat,
    linear-gradient(currentColor,currentColor) 1px 12px / 4px 1px no-repeat, linear-gradient(currentColor,currentColor) 1px 9px / 1px 4px no-repeat,
    linear-gradient(currentColor,currentColor) 9px 12px / 4px 1px no-repeat, linear-gradient(currentColor,currentColor) 12px 9px / 1px 4px no-repeat;
}
.immersive-icon-history {
  width: 13px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: linear-gradient(currentColor,currentColor) 2px 3px / 6px 1px no-repeat,
    linear-gradient(currentColor,currentColor) 2px 6px / 4px 1px no-repeat;
}
.immersive-icon-voice::before {
  content: "";
  position: absolute;
  top: 0;
  left: 5px;
  width: 5px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
}
.immersive-icon-voice::after {
  content: "";
  position: absolute;
  inset: 6px 3px 2px;
  border: solid currentColor;
  border-width: 0 1px 1px;
  border-radius: 0 0 5px 5px;
}
.immersive-display {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0 clamp(10px, 2.9vw, 34px) clamp(8px, 2vh, 20px);
  border: 1px solid #173346;
  border-radius: 15px;
  background: radial-gradient(ellipse at 50% 46%, #35315938, transparent 64%),
    repeating-linear-gradient(90deg, #9ba2e00f 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, #9ba2e00f 0 1px, transparent 1px 48px), #0d1121a8;
}
.immersive-display::before, .immersive-display::after {
  position: absolute;
  z-index: 1;
  width: 20px;
  height: 20px;
  pointer-events: none;
  content: "";
}
.immersive-display::before {
  inset: 8px auto auto 8px;
  border-top: 1px solid #4783a1;
  border-left: 1px solid #4783a1;
}
.immersive-display::after {
  inset: auto 8px 8px auto;
  border-right: 1px solid #4783a1;
  border-bottom: 1px solid #4783a1;
}
.immersive-visual { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.immersive-visual canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.immersive-core-fallback {
  position: absolute;
  width: min(33%, 245px);
  aspect-ratio: 1;
  top: 47%;
  left: 50%;
  transform: translate(-50%,-50%);
  border: 1px solid #6daed2;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #eef4ff, #80bbff 6%, #234a90 24%, #10182e 72%);
  box-shadow: 0 0 28px #53d2fa68, 0 0 80px #215bd758, inset 0 0 20px #7bdcff64;
}
.immersive-core-fallback::before, .immersive-core-fallback::after {
  content: "";
  position: absolute;
  inset: 22% -23%;
  border: 1px solid #437c9d;
  border-radius: 50%;
  transform: rotate(-25deg);
}
.immersive-core-fallback::after {
  inset: 35% -27%;
  transform: rotate(37deg);
}
.has-canvas .immersive-core-fallback { display: none; }
.immersive-state {
  position: absolute;
  inset-inline: 12px;
  bottom: clamp(12px, 2.8vh, 27px);
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}
.immersive-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #355469;
  border-radius: 7px;
  color: #ddf4ff;
  background: #081723ed;
  font-size: .86rem;
  font-weight: 620;
  line-height: 1.2;
}
.immersive-indicator {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #80ccf2;
}
.norte-immersive[data-phase="idle"] .immersive-indicator { background: #87b5ca; }
.norte-immersive:is([data-phase="processing"], [data-phase="delegating"], [data-phase="tool"], [data-phase="listening"], [data-phase="speaking"]) .immersive-indicator {
  background: #c5ddff;
  box-shadow: 0 0 12px #64dbffbc;
}
.norte-immersive:is([data-phase="queued"], [data-severity="warning"]) .immersive-indicator { background: #f1bd73; box-shadow: 0 0 12px #ffb97380; }
.norte-immersive[data-severity="error"] .immersive-indicator { background: #ffa1ae; box-shadow: 0 0 12px #ff5f7c8c; }
.immersive-detail { margin: 0; max-width: 44ch; color: var(--immersive-muted); font-size: .79rem; line-height: 1.35; }
.immersive-nodes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
  margin: 4px 0 0;
  list-style: none;
}
.immersive-nodes li {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid #386578;
  color: #d1f1fe;
  background: #091a29ee;
  font-size: .71rem;
  white-space: nowrap;
}
.immersive-nodes li[data-status="running"] { border-color: #60b1c5; }
.immersive-nodes strong { font-weight: 650; letter-spacing: .055em; }
.immersive-nodes span { color: #afcbd8; }
.immersive-execution {
  width: 88px;
  height: 3px;
  accent-color: #83e8ff;
}
.norte-immersive[data-motion="static"] .immersive-execution { visibility: hidden; }
.immersive-amplitude {
  position: absolute;
  right: clamp(13px, 3vw, 26px);
  top: clamp(14px, 3vh, 27px);
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 9px 5px;
  border: 1px solid #315471;
  border-radius: 6px;
  background: #091a2cde;
}
.immersive-amplitude-wave { display: block; width: clamp(91px, 17vw, 146px); height: 25px; }
.immersive-amplitude meter { width: clamp(75px,14vw,115px); height: 5px; accent-color: #7bddff; }
.norte-immersive:is([data-motion="static"], [data-profile="economical"]) .immersive-amplitude-wave { display: none; }
.immersive-answer, .immersive-composer { width: min(720px, calc(100% - 34px)); margin-inline: auto; }
.immersive-answer {
  width: min(900px, calc(100% - 34px));
  min-width: 0;
  margin-bottom: 12px;
  padding: 13px clamp(13px,2vw,19px);
  border: 1px solid #264154;
  border-radius: 10px;
  background: #0a1825f2;
}
.immersive-answer header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.immersive-answer header h2 { font-size: .86rem; color: #cce8fb; }
.immersive-answer-agent { font-size: .71rem; font-weight: 630; letter-spacing: .045em; color: var(--immersive-muted); }
.immersive-answer-content {
  max-height: 12rem;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: 1px 4px 1px 0;
  font-size: .94rem;
}
.immersive-answer.is-expanded .immersive-answer-content { max-height: none; overflow: visible; }
.local-answer-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.immersive-answer-trace { margin: 0 0 9px; color: var(--immersive-muted); font-size: .78rem; }
.immersive-answer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.immersive-copied { color: var(--immersive-muted); font-size: .78rem; }
.immersive-composer { width: min(900px, calc(100% - 34px)); padding-block: 1px clamp(8px,1.6vw,17px); }
.immersive-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 7px;
  padding: 5px 5px 5px 12px;
  border: 1px solid #385b70;
  border-radius: 10px;
  background: #0b1a28;
  box-shadow: 0 10px 33px #01051080;
}
.immersive-field:focus-within {
  border-color: #739fbc;
  box-shadow: 0 0 0 2px #5694b828, 0 10px 33px #01051080;
}
.immersive-field textarea {
  width: 100%;
  min-height: 43px;
  max-height: 140px;
  border: 0;
  outline: none;
  border-radius: 0;
  padding: 11px 0 9px;
  resize: none;
  field-sizing: content;
  background: transparent;
  color: var(--immersive-text);
  line-height: 1.45;
  font-size: .99rem;
}
.immersive-field textarea:focus-visible { outline: none; }
.immersive-field textarea::placeholder { color: #9bb3c9; }
.immersive-send {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--immersive-accent);
  border-radius: 6px;
  padding: 7px 11px;
  color: #1c1437;
  background: var(--immersive-accent);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 690;
  line-height: 1.25;
}
.immersive-send:not(:disabled):hover { background: #e1dcff; }
.immersive-send:disabled {
  color: #9fb6cd;
  border-color: #46617b;
  background: #253e58;
  box-shadow: none;
  cursor: default;
  opacity: 1;
}
.immersive-arrow {
  display: inline-block;
  position: relative;
  width: 13px;
  height: 12px;
  background: linear-gradient(currentColor,currentColor) 1px center / 9px 1px no-repeat;
}
.immersive-arrow::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border: solid currentColor;
  border-width: 1px 1px 0 0;
}
.immersive-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 10px;
  min-height: 38px;
  padding-inline: 1px;
}
.immersive-input-status { gap: 2px 6px; justify-content: flex-start; }
#immersive-push-speech { touch-action: none; user-select: none; }
.immersive-footer-actions { margin-left: auto; }
.immersive-cancel { color: #ffc3bc; }
.immersive-cancel:hover { color: #ffd5cf; border-color: #6f494c; background: #38262a; }
.immersive-quote, .immersive-feedback {
  margin: 0 0 10px;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1px solid #3a5b7a;
  background: #102338;
  font-size: .84rem;
}
.immersive-quote-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.immersive-quote-heading h2 { font-size: .88rem; }
.immersive-quote-heading strong { font-weight: 600; color: #b0e6ff; }
.immersive-quote-note { color: #b8cee1; margin: 5px 0 0; }
.immersive-consent { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; color: #d4e9f7; font-size: .82rem; }
.immersive-consent input { accent-color: #8fdcff; margin: 2px 0 0; }
.immersive-feedback[data-tone="error"] { color: #ffbabd; background: #2a1d2b; border-color: #713d52; }

@media (max-width: 670px) {
  .norte-immersive { min-height: max(520px,calc(100svh - 124px)); border-radius: 16px; grid-template-rows: auto minmax(290px,1fr) auto auto; }
  .norte-immersive:fullscreen, .norte-immersive.is-viewport { grid-template-rows: auto minmax(290px,1fr) auto auto; }
  .immersive-header { padding: 10px 11px; gap: 8px; }
  .immersive-identity { gap: 7px; }
  .immersive-mark { width: 35px; height: 35px; border-radius: 8px; }
  .immersive-identity h1 { font-size: .95rem; letter-spacing: .16em; }
  .immersive-header-actions { gap: 4px; }
  .immersive-mode { padding: 4px 5px; font-size: .66rem; }
  .immersive-secondary { gap: 5px; padding: 5px; font-size: .72rem; min-height: 38px; }
  .immersive-fullscreen { width: 34px; }
  .immersive-icon-settings { display: none; }
  .immersive-display { border-radius: 9px; }
  .immersive-answer, .immersive-composer { width: calc(100% - 18px); }
  .immersive-answer { margin-bottom: 7px; padding: 9px 10px; }
  .immersive-field { padding-left: 8px; gap: 4px; }
  .immersive-field textarea { font-size: 1rem; }
  .immersive-send { font-size: .77rem; padding-inline: 8px; gap: 6px; }
}
@media (max-width: 430px) {
  .immersive-header { align-items: flex-start; }
  .immersive-identity { padding-top: 7px; }
  .immersive-mode { order: 1; }
  .immersive-header-actions { max-width: 235px; }
  .immersive-footer-actions { margin-left: 0; }
  .immersive-arrow { display: none; }
}
