/* Full-screen JXU voice console */
.agent-page.hud-page {
  color-scheme: dark;
  --bg: #040e12;
  --paper: #081a20;
  --ink: #dcf5f1;
  --muted: #94b8b7;
  --line: #214247;
  --green: #8ae3d8;
  --accent: #52d9d0;
  background:
    radial-gradient(ellipse at 43% 34%, #0d393d80, transparent 51%),
    linear-gradient(#040e12eb, #040e12f5),
    repeating-linear-gradient(0deg, #54979920 0 1px, transparent 1px 34px);
  color: var(--ink);
}

.hud-page .top {
  --header-logo-size: 52px;
  min-height: 82px;
  padding: 14px 28px;
  background: #040e1299;
  border-bottom: 1px solid #285054;
}

.hud-page .brand-emblem {
  width: var(--header-logo-size);
  height: var(--header-logo-size);
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.institution-emblems {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 20px;
  border-right: 1px solid #315357;
  flex: none;
}

.institution-emblems a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--header-logo-size);
  height: var(--header-logo-size);
  flex: none;
  border-radius: 3px;
}

.institution-emblems a:focus-visible {
  outline: 2px solid #76e3d9;
  outline-offset: 5px;
}

.institution-emblems img {
  display: block;
  width: var(--header-logo-size);
  height: var(--header-logo-size);
  object-fit: contain;
  flex: none;
}

.institution-emblems .tatu-emblem {
  /* Compensate for the transparent margin in the original logo. */
  transform: scale(1.2);
}

.hud-page .brand strong {
  letter-spacing: .11em;
  font-size: 16px;
}

.hud-page .brand small {
  color: #92b9b6;
  font-size: 9px;
}

.hud-page .quiet,
.hud-page .top .quiet {
  border: 1px solid #315357;
  border-radius: 4px;
  background: #0c2228;
  color: #c3eeeb;
}

.hud-page .quiet:hover,
.hud-page .top .quiet:hover {
  border-color: #66dacf;
  background: #15383d;
}

.hud-clock {
  margin-right: 9px;
  font: 20px var(--mono);
  font-variant-numeric: tabular-nums;
  color: #cbefea;
}

.agent-page.hud-page .agent-layout {
  width: calc(100% - 56px);
  max-width: 1700px;
  margin: 20px auto;
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(300px, 1fr) minmax(310px, 440px);
  grid-template-areas: "status voice chat";
  gap: 22px;
  align-items: start;
}

.station-sidebar {
  grid-area: status;
  padding-top: 13px;
  font-size: 12px;
}

.hud-section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #badbd4;
  letter-spacing: .12em;
  font: 10px var(--mono);
}

.hud-section-label > span {
  color: #5de5d3;
  padding: 3px 5px;
  border: 1px solid #31565a;
}

.station-metrics {
  margin: 17px 0;
}

.station-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #193439;
}

.station-metrics dt {
  color: #95b4b3;
  font: 9px var(--mono);
  letter-spacing: .12em;
}

.station-metrics dd {
  margin: 0;
  color: #94ece1;
  font-size: 11px;
}

.hud-divider {
  height: 1px;
  margin: 24px 0 19px;
  background: linear-gradient(90deg, #579e98, #173136 65%, transparent);
}

.station-knowledge {
  margin: 16px 0 10px;
}

.hud-page #knowledge-status {
  display: block;
  color: #b8f1e5;
  border: 0;
  border-left: 2px solid #5fd2c4;
  border-radius: 0;
  padding: 4px 8px;
  font: 11px var(--mono);
}

.station-knowledge small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.hud-page .station-sidebar .suggestions {
  margin-top: 0;
}

.hud-page .station-sidebar .section-heading {
  margin-bottom: 10px;
}

.hud-page .station-sidebar .section-heading h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
}

.hud-page .station-sidebar .section-heading > span {
  display: none;
}

.hud-page .cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-page .card {
  min-height: 0;
  padding: 10px 7px;
  background: #091c21;
  border: 1px solid #26464a;
  border-radius: 3px;
  align-items: center;
  gap: 8px;
}

.hud-page .card strong {
  font-size: 12px;
  font-weight: 600;
}

.hud-page .card small {
  font-size: 10px;
}

.hud-page .tile {
  background: #173238;
  color: #7fd8cf;
  width: 27px;
  height: 29px;
  border-radius: 2px;
}

.hud-page .tile svg {
  width: 14px;
}

.hud-page .card:hover {
  background: #153039;
  border-color: #72b9af;
}

.station-note {
  color: #819f9f;
  font: 9px/1.8 var(--mono);
  letter-spacing: .09em;
  margin-top: 27px;
}

.hud-page .chat-workspace {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 126px);
  min-height: 540px;
  padding: 15px;
  border: 1px solid #264a4e;
  background: #061317aa;
  border-radius: 4px;
}

.hud-page .desk-label {
  color: #a9d3cb;
  font-size: 9px;
  padding-bottom: 14px;
  border-bottom: 1px solid #23464a;
}

.hud-page .workspace {
  display: block;
  flex: 1;
  margin-top: 22px;
  background: transparent;
  border: 0;
  border-left: 0;
  box-shadow: none;
}

.hud-page .hero {
  background: transparent;
  padding: 10px 0;
  min-height: 0;
}

.hud-page .hero .eyebrow {
  font-size: 9px;
  color: #88c4bd;
  letter-spacing: .07em;
}

.hud-page .hero h1 {
  font-size: clamp(34px, 3.3vw, 47px);
  letter-spacing: -.05em;
  line-height: 1.1;
}

.hud-page .hero em {
  color: #62ddd0;
}

.hud-page .hero p {
  color: #acc9c5;
  font-size: 13px;
}

.hud-page .hero-tags {
  gap: 5px;
}

.hud-page .hero-tags span {
  background: #0b2328;
  color: #b2d5ce;
  border-color: #2b4c4f;
  font-size: 10px;
}

.hud-page #conversation {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3b7371 transparent;
  padding-top: 14px;
}

.hud-page .message {
  padding: 13px 10px;
  background: #0a1c22;
  border: 1px solid #27494d;
  border-radius: 3px;
  font-size: 13px;
}

.hud-page .message.user {
  margin-left: 24px;
  border-left: 2px solid #4f9d95;
  background: #102b30;
}

.hud-page .message header {
  font-size: 11px;
}

.hud-page .message header .quiet {
  font-size: 10px;
  padding: 6px 8px;
}

.hud-page .composer-wrap {
  position: static;
  background: transparent;
  padding-bottom: 0;
}

.hud-page form {
  background: #0a2026;
  border: 1px solid #40706d;
  border-radius: 4px;
  padding: 11px;
  box-shadow: none;
}

.hud-page textarea {
  min-height: 48px;
  font-size: 13px;
}

.hud-page .compose-label {
  font-size: 9px;
}

.hud-page .attach {
  font-size: 11px;
}

.hud-page .fine {
  font-size: 9px;
  line-height: 1.5;
  color: #95b2b0;
}

.hud-page .send,
.hud-page .voice-trigger {
  border-radius: 3px;
  background: #2ba79e;
  border-color: #5bdbcf;
  color: #031a20;
}

.hud-page .send:hover,
.hud-page .voice-trigger:hover {
  background: #69e1d6;
}

.hud-page .voice-panel {
  --signal: #4ad9df;
  grid-area: voice;
  position: sticky;
  top: 18px;
  padding: 15px 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  align-self: center;
  width: 100%;
}

.hud-page .voice-panel[data-phase="listening"] {
  --signal: #66f2cf;
}

.hud-page .voice-panel[data-phase="speaking"] {
  --signal: #78daff;
}

.hud-page .voice-meta {
  padding: 0 6px 12px;
  color: #8cd4cd;
  font-size: 9px;
}

.hud-page .voice-stage {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.hud-orbit {
  width: min(100%, 440px);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  background: radial-gradient(circle, #45c7d021, transparent 61%);
}

.hud-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: var(--signal);
  stroke-width: .8;
  filter: drop-shadow(0 0 calc(2px + 5px * var(--signal-strength, 0)) #41e5f0aa);
  opacity: calc(.55 + .4 * var(--signal-strength, 0));
}

.ring-outer {
  stroke-dasharray: 3 8 1 7;
}

.ring-ticks {
  stroke-width: 5;
  stroke-dasharray: 1 7;
  opacity: .65;
}

.ring-spin,
.ring-reverse,
.ring-outer,
.ring-ticks {
  transform-origin: 160px 160px;
}

.hud-page .ring-spin {
  animation: hud-rotate 28s linear infinite;
}

.hud-page .ring-reverse {
  animation: hud-rotate 37s linear infinite reverse;
}

.hud-page .ring-outer {
  animation: hud-rotate 65s linear infinite;
}

.hud-page .ring-ticks {
  animation: hud-rotate 52s linear infinite reverse;
}

@keyframes hud-rotate {
  to { transform: rotate(360deg); }
}

.hud-page .message.assistant .answer {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  letter-spacing: .015em;
}

.hud-page .terminal-stream::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 4px;
  vertical-align: -.12em;
  background: #88ffdf;
  box-shadow: 0 0 7px #52e6ce88;
  animation: terminal-caret .7s steps(1) infinite;
}

@keyframes terminal-caret {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-page .terminal-stream::after {
    animation: none;
  }
}

.hud-page .voice-reticle {
  position: relative;
  width: 42%;
  aspect-ratio: 1;
  background: #081c23;
  border-radius: 50%;
  border: 1px solid #3d99a7;
  padding: 5px;
  box-shadow: 0 0 calc(12px + 28px * var(--signal-strength, 0)) #249ec742;
}

.hud-page .voice-reticle img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  object-fit: contain;
}

.hud-page .voice-scope {
  height: 60px;
  width: 93%;
  margin-top: -20px;
}

.hud-page .scope-label {
  padding: 0 7px 10px;
  border-bottom: 1px solid #2e585b;
  font-size: 9px;
}

.hud-page .voice-copy {
  text-align: center;
  padding: 19px 5px;
  min-height: 94px;
}

.hud-page .voice-copy h2 {
  font-size: 19px;
  font-weight: 500;
}

.hud-page .voice-copy p {
  color: #a4c5c0;
  font-size: 12px;
}

.hud-page .voice-trigger {
  width: min(100%, 300px);
  margin: 0 auto;
}

.hud-page .voice-trigger[aria-pressed="true"],
.hud-page .voice-next {
  color: #c5efe8;
  border-color: #548d87;
  background: #123335;
}

.hud-page .voice-next {
  width: min(100%, 300px);
  margin: 8px auto 0;
}

.hud-page .voice-footer {
  font-size: 9px;
  color: #8ab7b3;
  border-color: #27474c;
  margin-top: 19px;
  padding: 14px 5px 0;
}

.hud-page .flow li,
.hud-page th {
  background: #142e33;
}

.hud-page :is(th, td, .flow li) {
  border-color: #3a6265;
}

@media (max-width: 1100px) and (min-width: 801px) {
  .agent-page.hud-page .agent-layout {
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
    grid-template-areas: "voice chat" "status chat";
  }
  .station-sidebar {
    padding-bottom: 20px;
  }
  .station-metrics {
    display: flex;
    gap: 15px;
  }
  .station-metrics > div {
    flex: 1;
    flex-direction: column;
  }
}

@media (max-width: 800px) {
  .hud-page .top {
    padding: 12px 14px;
  }
  .hud-page .brand strong {
    font-size: 14px;
    letter-spacing: .02em;
  }
  .hud-page .brand small {
    font-size: 8px;
  }
  .hud-clock {
    display: none;
  }
  .agent-page.hud-page .agent-layout {
    width: calc(100% - 28px);
    grid-template-columns: 1fr;
    grid-template-areas: "voice" "chat" "status";
    gap: 20px;
  }
  .hud-page .voice-panel {
    position: static;
    padding-top: 0;
  }
  .hud-orbit {
    width: min(70vw, 270px);
  }
  .hud-page .voice-scope {
    height: 40px;
    margin-top: -14px;
  }
  .hud-page .voice-copy {
    min-height: 0;
    padding: 12px 5px;
  }
  .hud-page .chat-workspace {
    min-height: 470px;
    height: auto;
  }
  .hud-page #conversation {
    max-height: 65dvh;
  }
  .station-sidebar {
    border-top: 1px solid #2b4e50;
  }
  .hud-page .voice-footer {
    margin-top: 12px;
  }
}

@media (max-width: 650px) {
  .hud-page .top {
    display: grid;
    --header-logo-size: 38px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .header-identity {
    display: contents;
  }
  .header-identity .brand {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .institution-emblems {
    grid-column: 1;
    grid-row: 2;
    border-right: 0;
    padding-right: 0;
    gap: 14px;
  }
  .hud-page .top-tools {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hud-page .ring-spin,
  .hud-page .ring-reverse,
  .hud-page .ring-outer,
  .hud-page .ring-ticks {
    animation: none !important;
  }
}

/* Keep the voice instrument on the page centerline. */
@media (min-width: 1101px) {
  .agent-page.hud-page .agent-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 500px) minmax(0, 1fr);
    align-items: center;
    min-height: calc(100dvh - 130px);
  }
  .hud-page .chat-workspace { min-width: 0; }
}
.hud-page .voice-stage { align-items: center; }
.hud-orbit { margin-inline: auto; }
.hud-rings { fill: none; }
.hud-page .scope-label { width: 100%; }
.hud-page .voice-scope { opacity: .45; height: 36px; margin-top: -8px; }
.hud-page .ring-wave {
  stroke-width: 1.5;
  stroke: var(--signal);
  opacity: .95;
  filter: drop-shadow(0 0 3px var(--signal));
  stroke-linejoin: round;
}
.hud-page .voice-reticle {
  box-shadow: 0 0 0 7px #09252a, 0 0 0 8px #31717b66,
    0 0 calc(18px + 36px * var(--signal-strength, 0)) #249ec756;
}
.hud-page .voice-panel[data-phase="listening"] .ring-wave { stroke: #82f7cf; }
.hud-page .voice-panel[data-phase="speaking"] .ring-wave { stroke: #9de7ff; }
@media (prefers-reduced-motion: reduce) {
  .hud-rings { filter: none; }
}

/* Angular controls share the voice console's cyan instrument lines. */
.agent-page.hud-page :is(button, a.top-icon) {
  --control-line: #3f7980;
  --control-fill: linear-gradient(120deg, #10343c, #091c24);
  --control-ink: #c9f6ef;
  position: relative;
  isolation: isolate;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--control-ink);
  box-shadow: none;
  font-family: var(--mono);
  letter-spacing: .025em;
  transition: color .16s ease, filter .16s ease, transform .12s ease;
}

.agent-page.hud-page :is(button, a.top-icon)::before,
.agent-page.hud-page :is(button, a.top-icon)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  clip-path: polygon(0 9px, 9px 0, calc(100% - 9px) 0, 100% 9px,
    100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px));
}

.agent-page.hud-page :is(button, a.top-icon)::before {
  inset: 0;
  z-index: -2;
  background: var(--control-line);
  transition: background .16s ease;
}

.agent-page.hud-page :is(button, a.top-icon)::after {
  inset: 1px;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 28%, #a2fff63b 49%, transparent 70%) top center / 65% 1px no-repeat,
    var(--control-fill);
}

.agent-page.hud-page :is(button, a.top-icon):hover {
  --control-line: #8ff9e9;
  --control-fill: linear-gradient(120deg, #1b5057, #102f3b);
  color: #ecfffc;
  filter: drop-shadow(0 0 7px #40d9d338);
}

.agent-page.hud-page :is(button, a.top-icon):active {
  transform: translateY(1px);
}

.agent-page.hud-page :is(button, a.top-icon):focus-visible {
  outline: 2px solid #b0fff3;
  outline-offset: 4px;
}

.agent-page.hud-page .top-icon,
.agent-page.hud-page :is(.mic, .send) {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  justify-content: center;
}

.agent-page.hud-page :is(.voice-trigger, .send) {
  --control-line: #94fff1;
  --control-fill: linear-gradient(120deg, #24636b, #12404d);
  --control-ink: #e4fffa;
}

.agent-page.hud-page .voice-trigger {
  min-height: 50px;
  font-size: 12px;
}

.agent-page.hud-page :is(.voice-trigger, .send):hover {
  --control-fill: linear-gradient(120deg, #36818a, #1b5867);
  filter: drop-shadow(0 0 10px #4fe8dd50);
}

.agent-page.hud-page button[aria-pressed="true"] {
  --control-line: #efc984;
  --control-fill: linear-gradient(120deg, #51452c, #2b2b22);
  --control-ink: #ffe7b8;
}

.agent-page.hud-page button:disabled {
  --control-line: #38545a;
  --control-fill: linear-gradient(120deg, #172b31, #101d23);
  color: #95aaab;
  opacity: .65;
  filter: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .agent-page.hud-page :is(button, a.top-icon),
  .agent-page.hud-page :is(button, a.top-icon)::before {
    transition: none;
  }
}

.hud-page .reply-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.hud-page .message header {
  gap: 12px;
  flex-wrap: wrap;
}

.hud-page .chat-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  max-height: 42dvh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3b7371 transparent;
  padding: 4px;
}

.hud-page .chat-list-item {
  width: 100%;
  min-width: 0;
  padding: 12px;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.55;
}

.hud-page .chat-list-item[aria-current="true"] {
  --control-line: #8de6d8;
  --control-fill: linear-gradient(120deg, #20515a, #112f37);
  color: #e3fff8;
}

.chat-list-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.hud-page .response-dialog {
  width: min(1100px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  padding: 0;
  color: var(--ink);
  background: #081a20;
  border: 1px solid #58968e;
  border-radius: 5px;
  box-shadow: 0 22px 90px #0009;
}

.hud-page .response-dialog::backdrop {
  background: #02090ddd;
  backdrop-filter: blur(4px);
}

.response-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px 22px;
  background: #0c2228;
  border-bottom: 1px solid #31595c;
}

.response-dialog-header h2 {
  margin: 0;
  color: #b5f7eb;
  font-size: 18px;
}

.hud-page #close-response {
  padding-inline: 17px;
}

.response-question {
  margin: 0;
  padding: 18px 22px 0;
  color: #bdd8d4;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.response-content {
  padding: 18px 22px 24px;
}

.hud-page .response-content .message {
  padding: 0;
  border: 0;
  background: transparent;
  margin: 0;
}

.hud-page .response-content .answer {
  font-size: 14px;
  line-height: 1.85;
}

.hud-page .response-content .table-wrap {
  max-width: 100%;
}

.source-date {
  display: block;
  font: 10px/1.6 var(--mono);
  color: var(--muted);
  margin: 2px 0 6px;
}

@media (max-width: 600px) {
  .response-dialog-header,
  .response-content {
    padding: 14px;
  }

  .response-question {
    padding: 14px 14px 0;
  }
}
