/* T.I.T.U.S. — arc-reactor HUD */

:root {
  --cyan: #40d8ff;
  --cyan-dim: rgba(64, 216, 255, 0.35);
  --cyan-faint: rgba(64, 216, 255, 0.12);
  --amber: #ffb340;
  --red: #ff5d5d;
  --bg: #030608;
  --hud-font: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --mono-font: "Share Tech Mono", "SFMono-Regular", Consolas, monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--cyan);
  font-family: var(--mono-font);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.8s ease; /* theme changes sweep in, not snap */
}

/* ---- device-shape tailoring (body carries device-phone/-tablet/-desktop) ---- */

.device-phone #gear { font-size: 28px; right: 20px; bottom: 20px; }
.device-phone #privacy-btn { right: 64px; bottom: 22px; }
.device-phone #privacy-btn svg { width: 26px; height: 26px; }
.device-phone .panel-close { font-size: 16px; padding: 4px 8px; }
.device-phone #hint { font-size: 12px; }
.device-tablet #panels { width: min(420px, 44vw); }

/* faint grid + vignette backdrop */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--cyan-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--cyan-faint) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

#stage { position: fixed; inset: 0; }

#reactor {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: pointer;
}

/* ---- overlays ---- */

.overlay {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  cursor: pointer;
}
.hidden { display: none !important; }

.ignition-inner { text-align: center; }
.ignition-ring {
  width: 140px; height: 140px;
  margin: 0 auto 28px;
  border-radius: 50%;
  border: 2px solid var(--cyan-dim);
  border-top-color: var(--cyan);
  animation: spin 2.4s linear infinite;
  box-shadow: 0 0 40px var(--cyan-faint), inset 0 0 30px var(--cyan-faint);
}
@keyframes spin { to { transform: rotate(360deg); } }
.ignition-label {
  font-family: var(--hud-font);
  font-size: 18px; letter-spacing: 0.45em; text-indent: 0.45em;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan-dim);
}
.ignition-sub {
  margin-top: 12px;
  font-size: 12px; letter-spacing: 0.25em;
  color: var(--cyan-dim);
}
.denied-mark { font-size: 48px; color: var(--red); margin-bottom: 20px; }
#denied .ignition-label { color: var(--red); }

/* ---- HUD corners ---- */

.hud.corner {
  position: absolute; width: 42px; height: 42px;
  border-color: var(--cyan-dim); border-style: solid; border-width: 0;
  pointer-events: none;
}
.hud.tl { top: 14px; left: 14px; border-top-width: 1px; border-left-width: 1px; }
.hud.tr { top: 14px; right: 14px; border-top-width: 1px; border-right-width: 1px; }
.hud.bl { bottom: 14px; left: 14px; border-bottom-width: 1px; border-left-width: 1px; }
.hud.br { bottom: 14px; right: 14px; border-bottom-width: 1px; border-right-width: 1px; }

/* ---- top bar ---- */

#hud-top {
  position: absolute; top: 26px; left: 34px; right: 34px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
}
#status-line {
  font-family: var(--hud-font);
  font-size: 15px; letter-spacing: 0.35em;
  text-shadow: 0 0 10px var(--cyan-dim);
}
#status-line.listening { color: var(--cyan); }
#status-line.processing { color: var(--amber); }
#status-line.confirm { color: var(--red); }
#status-line.privacy { color: var(--red); }
#status-sub { margin-top: 6px; font-size: 11px; color: var(--cyan-dim); letter-spacing: 0.15em; }
#clock-block { text-align: right; }
#clock { font-family: var(--hud-font); font-size: 20px; letter-spacing: 0.15em; }
#datestamp { margin-top: 4px; font-size: 11px; color: var(--cyan-dim); letter-spacing: 0.2em; }

/* ---- tool feed (left column) ---- */

#tool-feed {
  position: absolute; left: 34px; top: 110px; bottom: 190px;
  width: min(320px, 34vw);
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 8px;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, black 18%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 18%);
}
.tool-entry {
  border-left: 2px solid var(--cyan-dim);
  padding: 5px 10px;
  background: rgba(64, 216, 255, 0.05);
  font-size: 11.5px;
  animation: slide-in 0.25s ease-out;
}
@keyframes slide-in { from { transform: translateX(-12px); opacity: 0; } }
.tool-entry .tool-name { color: var(--cyan); letter-spacing: 0.1em; }
.tool-entry .tool-summary { color: var(--cyan-dim); word-break: break-all; }
.tool-entry pre {
  margin-top: 4px; color: var(--cyan-dim);
  font-size: 10.5px; white-space: pre-wrap; word-break: break-all;
  max-height: 90px; overflow: hidden;
}
.tool-entry.error { border-left-color: var(--red); }
.tool-entry.error pre { color: var(--red); }

/* ---- structured content panels ---- */

#panels {
  position: absolute; right: 34px; top: 110px; bottom: 190px;
  width: min(340px, 36vw);
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 15;
}
#panels::-webkit-scrollbar { display: none; }

.panel {
  border: 1px solid var(--cyan-dim);
  background: rgba(6, 12, 16, 0.82);
  box-shadow: 0 0 24px var(--cyan-faint), inset 0 0 18px rgba(64, 216, 255, 0.04);
  animation: panel-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  flex-shrink: 0;
  transition: border-color 0.6s ease, box-shadow 0.6s ease,
              opacity 0.45s ease, transform 0.45s ease;
}

/* ---- war-room immersion: the floor clears, only the board remains ---- */

.panel.war-hidden {
  opacity: 0;
  transform: translateX(30px) scale(0.94);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  border-width: 0;
  box-shadow: none;
  transition: opacity 0.45s ease, transform 0.45s ease,
              max-height 0.5s ease 0.15s, border-width 0s linear 0.5s;
}
#stage.war-room #panels { width: min(560px, 48vw); }
#stage.war-room .panel:not(.war-hidden) {
  box-shadow: 0 0 40px var(--cyan-faint), inset 0 0 22px rgba(255, 90, 60, 0.06);
}
#stage.war-room::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 90, 60, 0.10));
  z-index: 5;
}
@keyframes panel-in {
  from { transform: translateY(14px) scale(0.97); opacity: 0; filter: blur(3px); }
  to { transform: none; opacity: 1; filter: none; }
}

/* A panel that has finished its spotlight debut: suppress the entry
   animation so removing .spotlight doesn't replay it. (.dissolving is
   declared later so scene dissolves still win.) */
.panel.docked { animation: none; }

/* Spotlight debut: a freshly created panel renders large, centre-screen,
   then docks into the panel column. */
.panel.spotlight {
  position: fixed; left: 50%; top: 50%;
  width: min(560px, 82vw); max-height: 72vh; overflow: auto;
  z-index: 30;
  box-shadow: 0 0 70px var(--cyan-dim), inset 0 0 22px rgba(64, 216, 255, 0.07);
  animation: spotlight-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes spotlight-in {
  from { transform: translate(-50%, -50%) scale(0.82); opacity: 0; filter: blur(5px); }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: none; }
}
.panel.spotlight .panel-body { font-size: 14px; padding: 14px 16px; }
.panel.spotlight .panel-head { padding: 10px 14px; }
.panel.spotlight .panel-title { font-size: 13px; }
.panel.spotlight .panel-stat-value { font-size: 48px; }
.panel.spotlight .panel-chart { height: 170px; }

.panel.dissolving {
  animation: panel-out 0.4s ease forwards;
  pointer-events: none;
}
@keyframes panel-out {
  to { transform: translateX(24px) scale(0.96); opacity: 0; filter: blur(4px); }
}

/* Accent sweep across the stage on scene change */
.scene-sweep {
  position: absolute; inset: 0;
  z-index: 40;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, var(--cyan-faint) 48%, var(--cyan-dim) 50%, var(--cyan-faint) 52%, transparent 70%);
  transform: translateX(-100%);
  animation: sweep 0.9s ease-in-out forwards;
}
@keyframes sweep { to { transform: translateX(100%); } }

.panel-stat-num { transition: color 0.6s ease; }
.panel.expanded { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(720px, 90vw); max-height: 80vh; z-index: 25; overflow: auto;
  animation: none; /* panel-in's fill would override the centering transform */ }

.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--cyan-faint);
  cursor: pointer;
  user-select: none;
}
.panel-title {
  flex: 1;
  font-family: var(--hud-font);
  font-size: 11px; letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.6s ease;
}
.panel-live {
  font-size: 9px; letter-spacing: 0.2em;
  color: var(--amber);
  border: 1px solid rgba(255, 179, 64, 0.5);
  padding: 1px 5px;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.45; } }
.panel-close {
  background: none; border: none;
  color: var(--cyan-dim); font-size: 14px; line-height: 1;
  cursor: pointer; padding: 2px 4px;
}
.panel-close:hover { color: var(--red); }

.panel-body { padding: 10px 12px; font-size: 12px; }
.panel-caption { margin-top: 6px; font-size: 10.5px; color: var(--cyan-dim); letter-spacing: 0.08em; }

.panel-stat-value {
  font-family: var(--hud-font);
  font-size: 30px; color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan-dim);
}
.panel-stat-unit { font-size: 14px; color: var(--cyan-dim); margin-left: 4px; }

.panel-progress-track {
  height: 10px;
  border: 1px solid var(--cyan-dim);
  background: rgba(64, 216, 255, 0.05);
}
.panel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(64, 216, 255, 0.35), var(--cyan));
  box-shadow: 0 0 10px var(--cyan-dim);
  transition: width 0.5s ease;
}
.panel-progress-label { margin-top: 5px; font-size: 11px; color: var(--cyan); }

.panel-chart { display: block; width: 100%; height: 96px; }
.panel.expanded .panel-chart { height: 220px; }

.panel-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.panel-table th {
  text-align: left; padding: 3px 6px;
  color: var(--cyan); letter-spacing: 0.1em; font-weight: normal;
  border-bottom: 1px solid var(--cyan-dim);
}
.panel-table td { padding: 3px 6px; color: rgba(210, 235, 245, 0.8); border-bottom: 1px solid var(--cyan-faint); }
.panel-table tr:last-child td { border-bottom: none; }

/* Apple Music one-time authorization */
#apple-auth {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 22px;
  font-family: var(--hud-font);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--cyan);
  background: rgba(3, 6, 8, 0.85);
  border: 1px solid var(--cyan-dim);
  border-radius: 4px;
  cursor: pointer;
}
#apple-auth:hover { background: rgba(64, 216, 255, 0.12); }

/* Video panel */
.panel-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--cyan-faint);
  border-radius: 4px;
  background: #000;
}

/* Game boards */
.panel-grid {
  display: grid;
  gap: 2px;
  max-width: 280px;
  margin: 2px auto 0;
  font-family: var(--mono-font);
}
.grid-label {
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; color: var(--cyan-dim); letter-spacing: 0.05em;
}
.grid-cell {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; font-size: 12px; border-radius: 2px;
  background: rgba(64, 216, 255, 0.06);
  border: 1px solid var(--cyan-faint);
  color: rgba(210, 235, 245, 0.85);
}
.grid-s { background: rgba(64, 216, 255, 0.22); border-color: var(--cyan-dim); color: var(--cyan); }
.grid-m { color: var(--cyan-dim); }
.grid-h { background: rgba(255, 179, 64, 0.25); border-color: var(--amber); color: var(--amber); }
.grid-k { background: rgba(255, 93, 93, 0.25); border-color: var(--red); color: var(--red); }
.grid-x, .grid-xw { color: var(--cyan); font-size: 16px; }
.grid-o, .grid-ow { color: var(--amber); font-size: 16px; }
.grid-xw, .grid-ow { background: rgba(64, 216, 255, 0.18); border-color: var(--cyan); }

.panel-list { list-style: none; }
.panel-list li { padding: 3px 0; color: rgba(210, 235, 245, 0.85); border-bottom: 1px solid var(--cyan-faint); }
.panel-list li:last-child { border-bottom: none; }
.panel-list li::before { content: "\25B8 "; color: var(--cyan-dim); }

/* A panel wearing its own accent (set via --panel-accent, e.g. a coaching
   mode's colours): border, glow, title, stat, progress, and list markers
   all take the tint. Charts read the accent from their spec directly. */
.panel.tinted {
  border-color: color-mix(in srgb, var(--panel-accent) 45%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--panel-accent) 15%, transparent),
              inset 0 0 18px color-mix(in srgb, var(--panel-accent) 5%, transparent);
}
.panel.tinted .panel-title {
  color: var(--panel-accent);
  text-shadow: 0 0 8px color-mix(in srgb, var(--panel-accent) 45%, transparent);
}
.panel.tinted .panel-stat-value,
.panel.tinted .panel-stat-num { color: var(--panel-accent); }
.panel.tinted .panel-stat-unit,
.panel.tinted .panel-caption { color: color-mix(in srgb, var(--panel-accent) 62%, transparent); }
.panel.tinted .panel-progress-fill { background: var(--panel-accent); }
.panel.tinted .panel-progress-label { color: var(--panel-accent); }
.panel.tinted .panel-list li::before { color: color-mix(in srgb, var(--panel-accent) 70%, transparent); }
.panel.tinted .panel-list li { border-bottom-color: color-mix(in srgb, var(--panel-accent) 14%, transparent); }
.panel.tinted .panel-head { border-bottom-color: color-mix(in srgb, var(--panel-accent) 30%, transparent); }

.panel-map { display: block; width: 100%; height: auto; max-height: 250px; }
.panel.expanded .panel-map { max-height: 68vh; }
.map-shape {
  fill: rgba(20, 60, 75, 0.35);
  stroke: var(--cyan-dim);
  stroke-width: 1;
}
.map-node.map-root .map-shape,
.map-node.map-start .map-shape,
.map-node.map-end .map-shape {
  fill: rgba(64, 216, 255, 0.14);
  stroke: var(--cyan);
}
.map-node.map-decision .map-shape { fill: rgba(255, 157, 60, 0.1); stroke: var(--amber); }
.map-node.suggested { opacity: 0.62; }
.map-node.suggested .map-shape { stroke-dasharray: 4 3; }
.map-label { fill: rgba(210, 235, 245, 0.88); font-size: 10px; letter-spacing: 0.03em; }
.map-node.map-root .map-label { fill: var(--cyan); }
.map-note { fill: var(--cyan-dim); font-size: 8px; }
.map-edge { fill: none; stroke: var(--cyan-dim); stroke-width: 1; opacity: 0.75; }
.map-edge.suggested { stroke-dasharray: 4 3; opacity: 0.45; }
.map-edge-label { fill: var(--cyan); font-size: 8.5px; letter-spacing: 0.05em; }
.map-arrowhead { fill: var(--cyan-dim); }

.panel-weather-now { display: flex; align-items: center; gap: 12px; }
.panel-weather-glyph { font-size: 30px; filter: grayscale(0.35) drop-shadow(0 0 8px rgba(64,216,255,0.5)); }
.panel-weather-cond { margin-top: 2px; font-size: 12px; color: var(--cyan); letter-spacing: 0.05em; }
.panel-weather-meta { margin-top: 5px; font-size: 10.5px; color: var(--cyan-dim); letter-spacing: 0.06em; }
.panel-weather-days {
  display: flex; gap: 4px; margin-top: 10px;
  border-top: 1px solid var(--cyan-faint); padding-top: 8px;
}
.panel-weather-day { flex: 1; text-align: center; }
.panel-weather-day .d { font-size: 9.5px; color: var(--cyan-dim); letter-spacing: 0.15em; text-transform: uppercase; }
.panel-weather-day .g { font-size: 15px; margin: 3px 0; filter: grayscale(0.35); }
.panel-weather-day .t { font-size: 11px; color: var(--cyan); }
.panel-weather-day .t span { color: var(--cyan-dim); font-size: 10px; }
.panel-weather-day .rain { font-size: 9px; color: var(--amber); margin-top: 2px; }

.panel-memory { list-style: none; max-height: 230px; overflow-y: auto; scrollbar-width: thin; }
.panel-memory li {
  display: flex; align-items: baseline; gap: 7px;
  padding: 4px 0; border-bottom: 1px solid var(--cyan-faint);
}
.panel-memory li:last-child { border-bottom: none; }
.memory-cat {
  flex-shrink: 0;
  font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan-dim);
  border: 1px solid var(--cyan-faint);
  padding: 1px 4px;
}
.memory-fact { flex: 1; font-size: 11px; color: rgba(210, 235, 245, 0.85); line-height: 1.35; }
.memory-forget {
  background: none; border: none;
  color: var(--cyan-dim); font-size: 11px; cursor: pointer; padding: 0 2px;
}
.memory-forget:hover { color: var(--red); }
.panel.expanded .panel-memory { max-height: 62vh; }

.panel-feed { list-style: none; }
.panel-feed li { padding: 5px 0; border-bottom: 1px solid var(--cyan-faint); line-height: 1.4; }
.panel-feed li:last-child { border-bottom: none; }
.panel-feed a { color: rgba(210, 235, 245, 0.88); text-decoration: none; font-size: 11.5px; }
.panel-feed a:hover { color: var(--cyan); text-shadow: 0 0 8px var(--cyan-dim); }
.panel-feed .feed-meta { font-size: 9.5px; color: var(--cyan-dim); white-space: nowrap; }

.panel-text {
  white-space: pre-wrap; word-break: break-all;
  color: rgba(210, 235, 245, 0.8);
  font-size: 11px;
  max-height: 180px; overflow-y: auto;
  scrollbar-width: thin;
}
.panel.expanded .panel-text { max-height: 65vh; }

.panel-strategy-phases {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px;
}
.strategy-phase {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 2px 6px; border: 1px solid rgba(64, 216, 255, 0.18);
  color: rgba(210, 235, 245, 0.35);
}
.strategy-phase.done { color: var(--cyan-dim); border-color: var(--cyan-dim); }
.strategy-phase.current {
  color: var(--cyan); border-color: var(--cyan);
  text-shadow: 0 0 8px rgba(64, 216, 255, 0.5);
}
.panel-strategy-problem {
  font-size: 12px; line-height: 1.45; color: rgba(210, 235, 245, 0.9);
  margin-bottom: 4px;
}
.strategy-section-label {
  margin-top: 7px; font-size: 9.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--cyan-dim);
}
.panel-strategy-list {
  list-style: none; margin: 2px 0 0; padding: 0;
  font-size: 11px; line-height: 1.5; color: rgba(210, 235, 245, 0.8);
}
.strategy-glyph { display: inline-block; width: 16px; color: var(--cyan-dim); }
.panel-strategy-list .strategy-done { color: rgba(210, 235, 245, 0.45); }
.panel-strategy-list .strategy-done .strategy-glyph { color: var(--cyan); }
.panel-strategy-list .strategy-chosen { color: var(--cyan); }
.panel-strategy-list .strategy-chosen .strategy-glyph { color: var(--cyan); }
.panel-strategy-list .strategy-rejected {
  color: rgba(210, 235, 245, 0.35); text-decoration: line-through;
}
.panel-strategy-list .strategy-risk-high .strategy-glyph { color: #ff5a3c; }
.panel-strategy-list .strategy-risk-medium .strategy-glyph { color: #ffb040; }
.panel-strategy-list .strategy-risk-low .strategy-glyph { color: var(--cyan-dim); }
.panel-strategy-list .strategy-mitigated { color: rgba(210, 235, 245, 0.55); }
.strategy-more { color: rgba(210, 235, 245, 0.4); font-size: 10px; }

.panel-quote {
  font-size: 15px; line-height: 1.55; font-style: italic;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(64, 216, 255, 0.35);
  padding: 6px 2px 2px;
}
.panel-quote::before { content: "“ "; color: var(--cyan-dim); font-size: 18px; }
.panel-quote-author {
  margin-top: 8px; text-align: right;
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan-dim);
}

/* ---- captions ---- */

#captions {
  position: absolute; left: 50%; bottom: 96px;
  transform: translateX(-50%);
  width: min(760px, 86vw);
  max-height: 34vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent, black 15%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%);
}
#captions::-webkit-scrollbar { display: none; }

/* The transcript yields ground as the HUD fills, and tucks away entirely on
   demand (issue #7). */
#captions { transition: max-height 0.4s ease, opacity 0.4s ease; }
#captions.compact { max-height: 18vh; }
#captions.collapsed { max-height: 0; opacity: 0; pointer-events: none; }
#captions-collapse {
  position: absolute; left: 50%; bottom: 72px;
  transform: translateX(-50%);
  z-index: 20;
  background: none; border: none;
  color: var(--cyan-dim); font-size: 14px;
  cursor: pointer; padding: 2px 14px;
  transition: color 0.2s;
}
#captions-collapse:hover { color: var(--cyan); }

.caption {
  font-size: 15px; line-height: 1.55;
  white-space: pre-wrap;
  text-shadow: 0 0 14px rgba(64, 216, 255, 0.25);
}
.caption.user { color: rgba(210, 235, 245, 0.75); text-align: right; font-size: 13.5px; }
.caption.user::before { content: "you \25B8\00a0"; color: var(--cyan-dim); }
.caption.titus { color: var(--cyan); }
.caption.titus::before { content: "titus \25B8\00a0"; color: var(--cyan-dim); }
.caption.notice { color: var(--amber); font-size: 13px; text-align: center; }
.caption.error { color: var(--red); font-size: 13px; text-align: center; }
.caption.warn {
  color: var(--red); font-size: 14px;
  border-left: 2px solid var(--red); padding-left: 10px;
  text-shadow: 0 0 12px rgba(255, 93, 93, 0.4);
}
.caption.warn::before { content: "\26A0  "; }
.caption.suggest { color: var(--amber); }
.caption.suggest::before { content: "titus \25B8\00a0"; color: rgba(255, 179, 64, 0.55); }

.hud-flash {
  position: absolute; inset: 0;
  z-index: 39;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, var(--cyan-faint) 100%);
  animation: hud-flash 1.1s ease-out forwards;
}
.hud-flash.warn { background: radial-gradient(ellipse at center, transparent 40%, rgba(255,93,93,0.28) 100%); }
@keyframes hud-flash { from { opacity: 1; } to { opacity: 0; } }

#hint {
  position: absolute; left: 50%; bottom: 40px;
  transform: translateX(-50%);
  font-size: 12px; letter-spacing: 0.3em;
  color: var(--cyan-dim);
  pointer-events: none;
  transition: opacity 0.6s;
}

/* ---- live transcript (interim speech-to-text) ---- */

#live-transcript {
  position: absolute; left: 50%; bottom: 62px;
  transform: translateX(-50%);
  max-width: min(720px, 84vw);
  font-size: 17px; line-height: 1.4;
  color: #eaffff;
  text-align: center;
  text-shadow: 0 0 18px rgba(64, 216, 255, 0.55);
  pointer-events: none;
}
#live-caret {
  display: inline-block;
  width: 2px; height: 1em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--cyan);
  animation: live-caret-blink 0.9s steps(1) infinite;
}
@keyframes live-caret-blink { 50% { opacity: 0; } }

/* ---- authorization modal ---- */

#confirm-box {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(560px, 90vw);
  border: 1px solid var(--amber);
  background: rgba(6, 10, 14, 0.92);
  box-shadow: 0 0 50px rgba(255, 179, 64, 0.2);
  padding: 22px 26px;
  text-align: center;
}
#confirm-box.dangerous { border-color: var(--red); box-shadow: 0 0 50px rgba(255, 93, 93, 0.25); }
#confirm-title {
  font-family: var(--hud-font);
  font-size: 14px; letter-spacing: 0.35em;
  color: var(--amber);
}
#confirm-box.dangerous #confirm-title { color: var(--red); }
#confirm-command {
  margin: 16px 0; padding: 10px 14px;
  background: rgba(64, 216, 255, 0.06);
  border: 1px solid var(--cyan-faint);
  color: #e8f7ff;
  font-size: 13px; white-space: pre-wrap; word-break: break-all;
  text-align: left;
}
#confirm-voice-hint { font-size: 11px; letter-spacing: 0.25em; color: var(--cyan-dim); margin-bottom: 16px; }
#confirm-buttons { display: flex; gap: 14px; justify-content: center; }
#confirm-buttons button {
  font-family: var(--hud-font);
  font-size: 13px; letter-spacing: 0.25em;
  padding: 10px 22px;
  background: transparent;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  cursor: pointer;
}
#btn-authorize { border-color: var(--cyan); }
#btn-authorize:hover { background: rgba(64, 216, 255, 0.12); }
#btn-deny { border-color: var(--red); color: var(--red); }
#btn-deny:hover { background: rgba(255, 93, 93, 0.12); }

/* ---- settings ---- */

#gear {
  position: absolute; right: 26px; bottom: 22px;
  z-index: 20;
  background: none; border: none;
  color: var(--cyan-dim); font-size: 22px;
  cursor: pointer;
  transition: color 0.2s, transform 0.4s;
}
#gear:hover { color: var(--cyan); transform: rotate(45deg); }

/* ---- privacy mode (microphone kill switch) ---- */

#privacy-btn {
  position: absolute; right: 62px; bottom: 24px;
  z-index: 20;
  background: none; border: none;
  color: var(--cyan-dim);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
#privacy-btn svg { width: 21px; height: 21px; display: block; }
#privacy-btn:hover { color: var(--cyan); }
#privacy-btn .slash { stroke: var(--red); visibility: hidden; }
#privacy-btn.active { color: var(--red); }
#privacy-btn.active:hover { color: var(--red); }
#privacy-btn.active .slash { visibility: visible; }
#settings {
  position: absolute; right: 26px; bottom: 62px;
  z-index: 20;
  width: 280px;
  border: 1px solid var(--cyan-dim);
  background: rgba(6, 10, 14, 0.94);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.setting-row label { font-size: 11.5px; letter-spacing: 0.15em; color: var(--cyan-dim); }
.setting-row select {
  background: var(--bg); color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  font-family: var(--mono-font); font-size: 11.5px;
  padding: 4px 6px; max-width: 150px;
}
.setting-row input[type="checkbox"] { accent-color: var(--cyan); width: 16px; height: 16px; }
#engine-label { font-size: 11.5px; color: var(--cyan); letter-spacing: 0.1em; }
#audio-label { font-size: 11.5px; color: var(--cyan); letter-spacing: 0.1em; }
#audio-claim {
  background: none; color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  font-family: var(--mono-font); font-size: 10.5px;
  letter-spacing: 0.15em; text-transform: uppercase;
  padding: 3px 8px; cursor: pointer;
}
#audio-claim:hover { background: rgba(64, 216, 255, 0.12); }

#unsupported {
  position: absolute; left: 50%; top: 96px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 10px 18px;
  border: 1px solid var(--red);
  color: var(--red);
  background: rgba(6, 10, 14, 0.9);
  font-size: 12.5px; letter-spacing: 0.1em;
}

@media (max-width: 720px) {
  #tool-feed { display: none; }
  #panels { left: 12px; right: 12px; top: 88px; bottom: 42vh; width: auto; }
  #captions { bottom: 84px; max-height: 26vh; }
  #status-line { font-size: 12px; }
  #clock { font-size: 15px; }
}
