:root {
  --bg:        #05060a;
  --bg-2:      #0a0c13;
  --panel:     #0d1018;
  --panel-2:   #11151f;
  --line:      rgba(255, 255, 255, 0.09);
  --line-2:    rgba(255, 255, 255, 0.16);
  --text:      #e9edf5;
  --text-dim:  #8791a5;
  --text-mute: #5b6478;

  --red:      #ff1b3d;
  --red-dim:  #b3122b;
  --orange:   #ff6a1f;
  --magenta:  #ff2fd0;
  --cyan:     #12f0ff;
  --cyan-dim: #0b9fb0;
  --green:    #2ef08a;
  --amber:    #ffc23d;

  --glow-red:  0 0 24px rgba(255, 27, 61, 0.45);
  --glow-cyan: 0 0 24px rgba(18, 240, 255, 0.4);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r:  10px;
  --r-s: 6px;
}

* { box-sizing: border-box; }

/* Author `display` on .drawer/.scrim/.toast outranks the UA [hidden] rule. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1200px 700px at 50% -10%, #16060e 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 110%, #05161c 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Film grain so the flat black doesn't band on big panels. */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* topbar */

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 27, 61, 0.06), transparent);
  position: relative;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 10px;
  height: 26px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--magenta) 45%, var(--red));
  box-shadow: var(--glow-red);
  animation: markPulse 2.4s ease-in-out infinite;
}
@keyframes markPulse {
  0%, 100% { transform: scaleY(1);    opacity: 1;    }
  50%      { transform: scaleY(0.62); opacity: 0.75; }
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.16em;
  font-weight: 800;
}
.brand h1 span { color: var(--red); text-shadow: var(--glow-red); }

.top-stats {
  margin-left: auto;
  display: flex;
  gap: 26px;
}
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-mute);
}
.stat-value {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  width: 34px;
  height: 34px;
  border-radius: var(--r-s);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.04); }

/* stage */

.stage {
  height: calc(100% - 58px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.65fr);
  gap: 0;
}

.viz-wrap {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
#viz { display: block; width: 100%; height: 100%; }

.viz-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 40px;
  pointer-events: none;
}

.speaker-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(6px);
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.speaker-tag .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.speaker-tag[data-who="bot"]  { color: var(--red);  border-color: rgba(255,27,61,0.5);  box-shadow: var(--glow-red); }
.speaker-tag[data-who="user"] { color: var(--cyan); border-color: rgba(18,240,255,0.5); box-shadow: var(--glow-cyan); }
.speaker-tag[data-who="bot"] .dot,
.speaker-tag[data-who="user"] .dot { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }


/* engage veil */
.idle-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(5,6,10,0.55), rgba(5,6,10,0.94));
  backdrop-filter: blur(2px);
  transition: opacity 0.4s, visibility 0.4s;
}
.idle-veil.gone { opacity: 0; visibility: hidden; }

.engage {
  position: relative;
  width: 190px; height: 190px;
  border-radius: 50%;
  border: 2px solid var(--red);
  background: radial-gradient(circle at 50% 40%, rgba(255,27,61,0.22), rgba(5,6,10,0.9));
  color: #fff;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  box-shadow: 0 0 60px rgba(255, 27, 61, 0.35), inset 0 0 40px rgba(255, 27, 61, 0.2);
  transition: transform 0.12s, box-shadow 0.2s;
}
.engage:hover { transform: scale(1.04); box-shadow: 0 0 90px rgba(255, 27, 61, 0.55), inset 0 0 60px rgba(255,27,61,0.3); }
.engage:active { transform: scale(0.97); }
.engage-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 27, 61, 0.5);
  animation: ring 2.2s ease-out infinite;
}
@keyframes ring {
  0%   { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.22); opacity: 0;   }
}
.engage-hint { color: var(--text-mute); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; margin: 0; }

/* console */

.console {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  gap: 12px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  overflow: hidden;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mode-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.2s;
}
.mode-btn strong { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; }
.mode-btn small { font-size: 10.5px; color: var(--text-mute); }
.mode-btn:hover { border-color: var(--line-2); color: var(--text); }
.mode-btn.active {
  color: #fff;
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(255,27,61,0.14), rgba(255,27,61,0.03));
  box-shadow: var(--glow-red);
}
.mode-btn.active small { color: rgba(255, 255, 255, 0.6); }

.control-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.primary-btn {
  flex: 1 1 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--red), #c4102a);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  box-shadow: var(--glow-red);
  transition: filter 0.15s, transform 0.1s, box-shadow 0.2s;
}
.primary-btn:hover:not(:disabled) { filter: brightness(1.12); }
.primary-btn:active:not(:disabled) { transform: translateY(1px); }
.primary-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; filter: grayscale(0.6); }
.primary-btn.running {
  background: linear-gradient(135deg, #2a2f3d, #1a1e28);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.pb-icon {
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff;
}
.primary-btn.running .pb-icon { border-radius: 1px; background: var(--red); box-shadow: 0 0 10px var(--red); }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.2s, background 0.15s;
}
.ghost-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); }
.ghost-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ghost-btn[aria-pressed="true"] {
  color: var(--cyan);
  border-color: rgba(18, 240, 255, 0.55);
  background: rgba(18, 240, 255, 0.08);
  box-shadow: var(--glow-cyan);
}
.ghost-btn.danger:hover:not(:disabled) { color: var(--red); border-color: rgba(255, 27, 61, 0.5); }

/* Live input level. Present so a silent mic is visibly distinguishable from a
   mic that is working but not being recognised. */
.mic-meter {
  display: none;
  width: 34px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.ghost-btn[aria-pressed="true"] .mic-meter { display: block; }
.mic-meter i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), #fff);
  box-shadow: 0 0 8px var(--cyan);
  transition: width 0.06s linear;
}
.ghost-btn.hearing { border-color: var(--cyan); }

.slider-wrap {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}
.slider-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
}
.slider-label b { color: var(--red); text-shadow: var(--glow-red); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta) 55%, var(--red));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--red);
  box-shadow: 0 0 12px rgba(255, 27, 61, 0.8);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--red);
}

/* mission */

.mission-bar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.grow { flex: 1 1 auto; }
.field label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--text-mute);
}

input[type="text"], input[type="time"], input[type="password"], select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  color: var(--text);
  padding: 9px 10px;
  font-family: var(--sans);
  font-size: 13px;
  width: 100%;
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 27, 61, 0.14);
}
input::placeholder { color: var(--text-mute); }
input[type="time"] { font-family: var(--mono); }
select { cursor: pointer; }

.commit-btn {
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-radius: var(--r-s);
  background: rgba(255, 27, 61, 0.12);
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.commit-btn:hover { background: var(--red); color: #fff; }

.mission-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(46, 240, 138, 0.35);
  border-radius: var(--r);
  background: rgba(46, 240, 138, 0.06);
}
.ms-flag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--green);
  border: 1px solid rgba(46, 240, 138, 0.4);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.ms-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-timer {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ms-timer.overdue { color: var(--red); animation: blink 0.9s steps(2) infinite; }
.ms-done {
  border: 1px solid rgba(46,240,138,0.5);
  background: transparent;
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 5px 9px;
  border-radius: var(--r-s);
  cursor: pointer;
}
.ms-done:hover { background: var(--green); color: #041b0e; }
.ms-clear {
  background: none; border: none; color: var(--text-mute);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.ms-clear:hover { color: var(--red); }

/* transcript */

.talk-row { display: flex; gap: 8px; }
.talk-row.hidden { display: none; }
.send-btn {
  padding: 0 18px;
  border: 1px solid var(--cyan);
  border-radius: var(--r-s);
  background: rgba(18, 240, 255, 0.1);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.send-btn:hover { background: var(--cyan); color: #02222a; }

.transcript-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-mute);
  padding-top: 2px;
}
.engine-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  letter-spacing: 0.14em;
}
.engine-pill.live { color: var(--green); border-color: rgba(46, 240, 138, 0.4); }

.transcript {
  flex: 1 1 auto;
  min-height: 90px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.transcript::-webkit-scrollbar { width: 8px; }
.transcript::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

.msg {
  padding: 9px 11px;
  border-radius: var(--r-s);
  font-size: 13px;
  max-width: 92%;
  animation: msgIn 0.22s ease-out;
  overflow-wrap: anywhere;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg .who {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  opacity: 0.65;
  margin-bottom: 3px;
}
.msg.bot {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(255, 27, 61, 0.12), rgba(255, 47, 208, 0.06));
  border-left: 2px solid var(--red);
  color: #fff;
  font-weight: 600;
}
.msg.user {
  align-self: flex-end;
  background: rgba(18, 240, 255, 0.08);
  border-right: 2px solid var(--cyan);
  color: #d6f7ff;
}
.msg.safe {
  align-self: stretch;
  max-width: 100%;
  background: rgba(120, 170, 255, 0.09);
  border-left: 2px solid #78aaff;
  color: #dbe8ff;
  font-weight: 400;
  line-height: 1.55;
}
.msg.sys {
  align-self: center;
  background: none;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* drawer */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 40;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: var(--panel-2);
  border-left: 1px solid var(--line-2);
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.6);
}
@keyframes slideIn { from { transform: translateX(100%); } }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.24em;
}
.drawer-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 22px; }

.group { display: flex; flex-direction: column; gap: 10px; }
.group h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: uppercase;
}
.group h3 small { color: var(--text-mute); letter-spacing: 0.1em; text-transform: none; }

.row { display: flex; flex-direction: column; gap: 5px; }
.row > span { font-size: 11px; color: var(--text-dim); }
.row.toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.row.toggle > span { font-size: 13px; color: var(--text); }
input[type="checkbox"] {
  appearance: none;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: #232838;
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex: none;
}
input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s, background 0.2s;
}
input[type="checkbox"]:checked { background: rgba(255, 27, 61, 0.3); border-color: var(--red); }
input[type="checkbox"]:checked::after { transform: translateX(18px); background: var(--red); }

.note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-mute);
  padding: 9px 11px;
  border-left: 2px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--r-s) var(--r-s) 0;
}
.note.ok   { border-left-color: var(--green); }
.note.warn { border-left-color: var(--amber); color: #c8ac74; }
.note b { color: var(--text-dim); }
.note code { font-family: var(--mono); font-size: 11px; color: var(--cyan); }

.source-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 5px; }
.source-list a { color: var(--text-dim); font-size: 11px; word-break: break-all; text-decoration: none; }
.source-list a:hover { color: var(--cyan); text-decoration: underline; }

/* toast */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 11px 18px;
  border-radius: var(--r);
  background: #1a1020;
  border: 1px solid var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), var(--glow-red);
  max-width: min(520px, 90vw);
  animation: toastIn 0.25s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* responsive */

@media (max-width: 1000px) {
  body { overflow: auto; }
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 46vh) auto;
    height: auto;
  }
  .viz-wrap { border-right: none; border-bottom: 1px solid var(--line); }
  .console { overflow: visible; }
  .transcript { max-height: 320px; }
  .top-stats { gap: 16px; }
}

@media (max-width: 600px) {
  .topbar { height: 52px; padding: 0 10px; gap: 10px; flex-wrap: nowrap; }
  .brand h1 { font-size: 15px; letter-spacing: 0.1em; }
  .brand-mark { height: 20px; width: 8px; }
  .top-stats { gap: 12px; }
  .stat-label { font-size: 8px; letter-spacing: 0.1em; }
  .stat-value { font-size: 13px; }
  .icon-btn { flex: none; width: 30px; height: 30px; }
  .mission-bar { flex-wrap: wrap; }
  .field { flex: 1 1 100%; }
  .commit-btn { width: 100%; }
  }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Armed but not started: draw the eye to the control that actually plays. */
.primary-btn.pulse { animation: armed 1.5s ease-in-out infinite; }
@keyframes armed {
  0%, 100% { box-shadow: var(--glow-red); }
  50%      { box-shadow: 0 0 34px rgba(255, 27, 61, 0.85); }
}

/* Settings: connection + diagnostics controls */
.test-btn {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  background: var(--panel);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.test-btn:hover:not(:disabled) { color: var(--cyan); border-color: var(--cyan); }
.test-btn:disabled { opacity: 0.5; cursor: progress; }

.diag { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }
.diag-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.03);
}
.diag-row b { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; }
.diag-row.pass b { color: var(--green); }
.diag-row.fail b { color: var(--red); }
.diag-row span { color: var(--text); }
.diag-row i { grid-column: 2; font-style: normal; color: var(--text-mute); font-size: 11px; }

/* Microphone is a status readout, not a control: it follows the session. */
.mic-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.mic-status[data-state="live"] {
  color: var(--cyan);
  border-color: rgba(18, 240, 255, 0.55);
  background: rgba(18, 240, 255, 0.08);
  box-shadow: var(--glow-cyan);
}
.mic-status[data-state="blocked"] { color: var(--amber); border-color: rgba(255, 194, 61, 0.45); }
.mic-status .mic-meter { display: none; }
.mic-status[data-state="live"] .mic-meter { display: block; }
