* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  color: #172026;
  background: #eef2f5;
  --surface: #eef2f5;
  --surface-raised: #ffffff;
  --surface-subtle: #f6f8fa;
  --ink: #172026;
  --muted: #64707a;
  --line: #d7dee5;
  --stage-ink: #0d1216;
  --stage-panel: rgba(15, 21, 26, 0.9);
  --panel-dark: rgba(15, 21, 26, 0.86);
  --panel-border: rgba(220, 228, 235, 0.18);
  --accent: #4f80b8;
  --accent-strong: #2f5f8f;
  --accent-soft: #d8e9f7;
  --success: #1f8a5b;
  --warning: #6f8394;
  --danger: #b4473f;
  --info: #3f6378;
  --control: #26323b;
  --control-strong: #192229;
  --control-muted: #47545e;
  --control-hover: #34424d;
  --control-border: rgba(230, 236, 242, 0.2);
  --focus-ring: rgba(78, 142, 190, 0.42);
  --button-yellow-50: #eef6ff;
  --button-yellow-100: #d8e9f7;
  --button-yellow-300: #9fbad1;
  --button-yellow-500: #4f80b8;
  --button-yellow-600: #3e6f9f;
  --button-yellow-700: #2f5f8f;
  --button-yellow-800: #102032;
  --button-yellow-shadow: rgba(47, 95, 143, 0.24);
  --compact-control-height: 32px;
  --left-rail-left: 20px;
  --left-rail-width: 246px;
}

.app {
  min-height: 100vh;
  display: block;
}

.stage {
  position: relative;
  min-height: 100vh;
  --stage-toolbar-top: 24px;
  --stage-toolbar-gap: 16px;
  --stage-camera-top: 104px;
  --stage-status-top: 104px;
  --stage-quality-top: 160px;
  --stage-dock-space: 24px;
  --stage-camera-left: 304px;
  --stage-dock-top: 496px;
  --stage-caption-bottom: 112px;
  background:
    radial-gradient(circle at 50% 0%, rgba(63, 99, 120, 0.2), rgba(13, 18, 22, 0.02) 34%),
    linear-gradient(180deg, #121a20 0%, #0b1014 100%);
  overflow: hidden;
}

.camera-viewport {
  position: absolute;
  left: var(--stage-camera-left, 304px);
  top: var(--stage-camera-top, 104px);
  transform: none;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0) 38%),
    #101417;
  box-shadow:
    0 22px 72px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
  background: #0f1110;
  opacity: 0;
  pointer-events: none;
}

.interviewer-preview {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 9;
  width: min(22%, 180px);
  min-width: 128px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  filter: none;
  mix-blend-mode: normal;
  isolation: isolate;
}

.interviewer-preview[hidden] {
  display: none;
}

.interviewer-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: none !important;
  mix-blend-mode: normal;
  transform: translateZ(0);
}

.interviewer-preview span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.camera-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0) 38%),
    #101417;
}

.guide-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: none;
}

.mesh-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: none;
}

.stage-generated-image {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  background: #07100d;
}

.stage-generated-image[hidden] {
  display: none;
}

.stage-visual-tabs {
  position: absolute;
  left: 24px;
  top: auto;
  bottom: calc(var(--stage-caption-bottom, 170px) + 62px);
  z-index: 8;
  display: grid;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(7, 10, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}

.stage-visual-tabs[hidden] {
  display: none;
}

.stage-visual-tab {
  min-height: var(--compact-control-height);
  min-width: 96px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
}

.stage-visual-tab.is-active {
  background: linear-gradient(180deg, var(--button-yellow-100), var(--button-yellow-300));
  color: var(--button-yellow-800);
}

.stage-visual-stats {
  position: absolute;
  left: 50%;
  bottom: calc(var(--stage-dock-space, 170px) + 34px);
  z-index: 8;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  max-width: calc(100% - 48px);
  padding: 8px;
  border-radius: 12px;
  background: rgba(7, 10, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  color: #fff;
}

.stage-visual-stats[hidden] {
  display: none;
}

.stage-visual-stats span {
  display: grid;
  gap: 3px;
  min-width: 96px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.stage-visual-stats strong {
  font-size: 14px;
  color: #fff;
  letter-spacing: 0;
  text-transform: none;
}

.realtime-hud {
  position: absolute;
  top: 24px;
  right: 24px;
  width: min(320px, calc(100% - 48px));
  padding: 12px;
  background: rgba(8, 10, 12, 0.42);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  z-index: 4;
}

.realtime-hud.hud-hidden {
  display: none;
}

.realtime-hud.hud-left {
  left: 24px;
  right: auto;
}

.realtime-hud.hud-compact {
  width: min(260px, calc(100% - 48px));
  padding: 10px;
}

.realtime-hud.hud-compact .hud-card {
  padding: 8px;
}

.realtime-hud.hud-compact .hud-value {
  font-size: 14px;
}

.realtime-hud.hud-compact .hud-card canvas {
  height: 56px;
}

.hud-header {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hud-grid {
  display: grid;
  gap: 10px;
}

.hud-card {
  padding: 10px;
  background: rgba(0, 0, 0, 0.38);
  border-radius: 8px;
  border-left: 4px solid rgba(255, 255, 255, 0.22);
}

.hud-label {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.84;
  margin-bottom: 4px;
}

.hud-value {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.hud-trend {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  opacity: 0.92;
}

.hud-card.hud-ok {
  border-left-color: #56d18f;
}

.hud-card.hud-warn {
  border-left-color: #f0c04f;
}

.hud-card.hud-bad {
  border-left-color: #e34d4d;
}

.hud-card canvas {
  width: 100%;
  height: 70px;
  display: block;
}

.session-indicators {
  position: absolute;
  left: var(--left-rail-left);
  top: calc(var(--stage-quality-top, 160px) + 292px);
  z-index: 5;
  width: min(var(--left-rail-width), calc(100% - 40px));
  display: grid;
  gap: 5px;
}

.caption-bar {
  min-height: 24px;
  padding: 4px 9px;
  background: rgba(18, 26, 32, 0.84);
  color: #f5f8fa;
  font-size: 10.5px;
  line-height: 1.2;
  border-radius: 10px;
  border: 1px solid rgba(230, 236, 242, 0.16);
  box-shadow: none;
}

.mic-monitor {
  position: absolute;
  left: var(--left-rail-left);
  top: var(--stage-status-top, 104px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 5px;
  width: min(var(--left-rail-width), calc(100% - 40px));
  min-height: var(--compact-control-height);
  padding: 5px 9px;
  background: rgba(15, 21, 26, 0.92);
  color: #fff;
  border: 1px solid rgba(230, 236, 242, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, border-color 120ms ease, filter 120ms ease;
}

.mic-monitor:hover {
  filter: brightness(1.08);
}

.mic-monitor:focus-visible {
  outline: 2px solid #f8fafc;
  outline-offset: 3px;
}

.mic-monitor.is-muted {
  background: rgba(126, 45, 45, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.mic-monitor span {
  width: 7px;
  height: 8px;
  border-radius: 8px;
  background: #2dbb7f;
  transform-origin: center bottom;
}

.mic-monitor.is-muted span {
  background: #d7a94a;
}

.mic-monitor strong {
  margin-left: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.quality-panel {
  position: absolute;
  left: var(--left-rail-left);
  top: var(--stage-quality-top, 160px);
  z-index: 8;
  display: grid;
  gap: 8px;
  width: min(var(--left-rail-width), calc(100% - 40px));
  max-width: min(var(--left-rail-width), calc(100% - 40px));
  min-width: 0;
  overflow: hidden;
}

.stage-toolbar {
  position: absolute;
  top: var(--stage-toolbar-top, 24px);
  left: 24px;
  z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: min(760px, calc(100% - 48px));
  max-width: calc(100% - 48px);
}

.stage-toolbar > * {
  min-width: 0;
}

.stage-toolbar.is-collapsed {
  grid-template-columns: auto;
  width: auto;
}

.toolbar-controls {
  display: grid;
  grid-template-columns: minmax(104px, 124px) 34px minmax(128px, 150px) repeat(3, 74px) minmax(96px, 118px);
  gap: 6px;
  min-width: 0;
  align-items: center;
}

.stage-toolbar.is-collapsed .toolbar-controls {
  display: none;
}

.toolbar-collapse-btn {
  min-width: 124px;
  min-height: var(--compact-control-height);
  padding: 0 12px;
  border-radius: 999px;
  background: #d8e9f7;
  color: var(--button-yellow-800);
  border: 1px solid rgba(222, 238, 250, 0.52);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 800;
}

.toolbar-config-btn {
  min-width: 0;
  min-height: var(--compact-control-height);
  padding: 0 12px;
  border-radius: 999px;
  background: #2f5f8f;
  color: #eef6ff;
  border: 1px solid rgba(178, 210, 235, 0.34);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.toolbar-icon-btn {
  min-width: 34px;
  min-height: var(--compact-control-height);
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(25, 34, 41, 0.96);
  color: #f8fafc;
  border: 1px solid var(--control-border);
  box-shadow: none;
}

.toolbar-toggle-group {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(11, 16, 20, 0.72);
  border: 1px solid var(--control-border);
  backdrop-filter: blur(10px);
  color: #fff;
}

.toolbar-toggle-label {
  display: none;
}

.prompt-intensity-group {
  gap: 4px;
}

.toolbar-select {
  width: 100%;
  min-height: var(--compact-control-height);
  padding: 0 26px 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(220, 228, 235, 0.4);
  background: #f8fafc;
  color: #172026;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.toolbar-select:focus-visible {
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.prompt-intensity-hint {
  display: none;
}

.segmented-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.segmented-switch-option {
  position: relative;
  display: grid;
  place-items: center;
  min-height: var(--compact-control-height);
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(246, 248, 250, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.switch-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.segmented-switch-option::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  transform: translateX(-50%);
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(5, 7, 7, 0.92);
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.segmented-switch-option:hover::after,
.segmented-switch-option:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, -2px);
}

.segmented-switch-option.is-active {
  background: #d8e9f7;
  color: var(--button-yellow-800);
  border-color: rgba(178, 210, 235, 0.46);
}

.segmented-switch-option:disabled,
.toolbar-collapse-btn:disabled,
.toolbar-config-btn:disabled {
  opacity: 0.55;
}

.quality-panel div {
  padding: 8px 10px;
  color: #fff;
  background: rgba(15, 21, 26, 0.82);
  border: 1px solid rgba(230, 236, 242, 0.13);
  border-left: 4px solid var(--info);
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.22;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.quality-panel .quality-ok {
  border-left-color: #2dbb7f;
  background: rgba(17, 105, 70, 0.88);
}

.quality-panel .quality-warn {
  border-left-color: #8ea6ba;
  background: rgba(49, 64, 78, 0.92);
}

.quality-panel .quality-bad {
  border-left-color: #e06a5f;
  background: rgba(135, 48, 45, 0.9);
}

.training-reader {
  position: absolute;
  inset: 24px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.93);
  color: #111;
  border-radius: 8px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.reader-label {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.reader-text {
  white-space: pre-wrap;
  font-size: 34px;
  line-height: 1.35;
  font-weight: 700;
}

.stage-session-dock {
  position: absolute;
  left: var(--left-rail-left);
  right: auto;
  top: var(--stage-dock-top, 496px);
  bottom: auto;
  z-index: 7;
  transform: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  justify-content: stretch;
  width: var(--left-rail-width);
  padding: 10px;
  border: 1px solid rgba(230, 236, 242, 0.14);
  border-radius: 16px;
  background: rgba(12, 18, 23, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.38);
}

.stage-session-copy {
  min-width: 0;
  flex: none;
  max-width: none;
  display: block;
}

.hero-eyebrow {
  display: none;
}

.engine-badge {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(18, 26, 32, 0.9);
  border: 1px solid var(--panel-border);
  color: #f5f8fa;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-session-dock h1 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.12;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.36);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-session-dock p {
  display: none;
}

.stage-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-top: 0;
}

.stage-status {
  min-height: 0;
  padding: 6px 10px;
  background: rgba(246, 248, 250, 0.08);
  border: 1px solid rgba(220, 228, 235, 0.16);
  color: #fff;
  border-radius: 999px;
}

.stage-status a {
  display: block;
  color: #fff;
}

.call-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.call-invite[hidden] {
  display: none;
}

.call-invite input {
  min-width: 0;
  min-height: var(--compact-control-height);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 0 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.24);
}

.call-invite button {
  min-height: var(--compact-control-height);
  white-space: nowrap;
}

.stage-session-dock .status {
  min-height: 38px;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  background: rgba(246, 248, 250, 0.08);
  border: 1px solid rgba(220, 228, 235, 0.16);
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stage-session-dock .status a {
  color: #dff7e8;
  font-weight: 700;
  text-decoration: underline;
}

.stage-actions {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  align-items: stretch;
  justify-content: stretch;
  flex-wrap: nowrap;
  gap: 7px;
  min-height: var(--compact-control-height);
}

.stage-actions button {
  flex: none;
  min-width: 0;
  min-height: 31px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stage-cost-shell {
  position: absolute;
  right: 24px;
  bottom: calc(var(--stage-dock-space, 92px) + 12px);
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  width: min(420px, calc(100% - 48px));
  pointer-events: none;
}

.panel {
  display: none;
}

.advanced-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

body.user-mode .advanced-only {
  display: none;
}

body.user-mode .realtime-hud {
  display: none !important;
}

body.user-mode .stage-visual-tabs {
  display: none !important;
}

body.user-mode .stage-visual-stats {
  display: none !important;
}

body.own-call-mode.user-mode .mic-monitor,
body.own-call-mode.user-mode .quality-panel,
body.own-call-mode.user-mode .stage-cost-shell,
body.own-call-mode.user-mode .session-indicators,
body.own-call-mode.user-mode .realtime-hud,
body.own-call-mode.user-mode .stage-visual-tabs,
body.own-call-mode.user-mode .stage-visual-stats {
  display: none !important;
}

body.own-call-mode.user-mode .stage-session-dock {
  left: var(--left-rail-left);
  right: auto;
  top: var(--stage-dock-top, 496px);
  bottom: auto;
  transform: none;
  width: var(--left-rail-width);
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
}

body.own-call-mode.user-mode .hero-eyebrow,
body.own-call-mode.user-mode .stage-session-dock p {
  display: none;
}

body.own-call-mode.user-mode .stage-session-copy {
  gap: 6px;
}

body.own-call-mode.user-mode .stage-status-row {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
}

body.own-call-mode.user-mode .stage-status {
  min-height: var(--compact-control-height);
  padding: 0 10px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.own-call-mode.user-mode .call-invite {
  grid-template-columns: minmax(180px, 300px) auto;
  gap: 6px;
  margin-top: 6px;
}

body.own-call-mode.user-mode .call-invite input,
body.own-call-mode.user-mode .call-invite button {
  min-height: var(--compact-control-height);
}

body.own-call-mode.user-mode .stage-actions {
  display: grid;
  grid-template-columns: 1fr;
  flex-wrap: nowrap;
  gap: 6px;
}

body.own-call-mode.user-mode .stage-actions button {
  min-width: 0;
  min-height: 32px;
  padding: 0 10px;
  font-size: 11.5px;
}

body.own-call-mode.user-mode #repeatBtn,
body.own-call-mode.user-mode #meetFocusBtn {
  display: none !important;
}

h1,
h2 {
  margin: 0 0 18px;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

label {
  display: block;
  margin: 0 0 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.4;
  resize: vertical;
}

input[type="number"] {
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
}

.actions {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}

button {
  flex: 1;
  min-height: 34px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--control);
  color: #f8fafc;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

a.btn-secondary {
  flex: 1;
  min-height: var(--compact-control-height);
  border-radius: 10px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-decoration: none;
}

button:not(:disabled):hover {
  background: var(--control-hover);
  border-color: rgba(255, 255, 255, 0.22);
}

button:not(:disabled):active {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
}

button:focus-visible,
a.btn-secondary:focus-visible,
.segmented-switch-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.actions-primary {
  margin-top: 18px;
}

.btn-primary {
  background: #3e6f9f;
  border-color: rgba(178, 210, 235, 0.36);
  color: #eef6ff;
}

.btn-primary:not(:disabled):hover {
  background: #4f80b8;
  border-color: rgba(206, 229, 245, 0.54);
}

.btn-secondary {
  background: #26323b;
  border-color: var(--control-border);
  color: #f8fafc;
}

.btn-secondary:not(:disabled):hover {
  background: #3b4a54;
}

.btn-danger {
  background: #c33f36;
  border-color: rgba(255, 215, 210, 0.22);
  color: #fff8f7;
}

.btn-danger:not(:disabled):hover {
  background: #d34b42;
  border-color: rgba(255, 215, 210, 0.42);
}

.btn-ghost {
  background: #4c5962;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

.btn-ghost:not(:disabled):hover {
  background: #596772;
}

button:disabled {
  background: rgba(172, 181, 188, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(42, 52, 60, 0.78);
  cursor: not-allowed;
  box-shadow: none;
}

.status {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  min-height: 44px;
}

body.voice-modal-open {
  overflow: hidden;
}

body.settings-modal-open {
  overflow: hidden;
}

body.final-review-open {
  overflow: hidden;
}

body.contact-modal-open {
  overflow: auto;
}

body.contact-center-active .caption-bar,
body.contact-center-active .stage-session-copy,
body.contact-center-active .quality-panel div,
body.contact-center-active .session-indicators > *,
body.contact-center-active .stage-visual-stats span,
body.contact-center-active .realtime-hud,
body.contact-center-active .stage-cost-shell {
  background: rgba(8, 14, 20, 0.46) !important;
  border-color: rgba(220, 235, 248, 0.22) !important;
  backdrop-filter: blur(8px);
}

body.contact-center-active .caption-bar {
  color: rgba(255, 255, 255, 0.92);
}

body.contact-center-active .toolbar-scope-interview {
  display: none;
}

body.contact-center-active .toolbar-controls {
  gap: 8px;
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: 24px;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 18, 0.68);
  backdrop-filter: blur(7px);
}

#contactCenterModal {
  pointer-events: none;
  align-items: flex-end;
  justify-items: center;
  padding: 18px 18px 18px var(--stage-camera-left, 304px);
}

#contactCenterModal .contact-modal-backdrop {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

#contactCenterModal .contact-modal-card {
  pointer-events: auto;
  width: min(960px, calc(100vw - var(--stage-camera-left, 304px) - 36px));
  max-height: calc(100vh - 96px);
  padding: 8px;
  border-radius: 12px;
  background: rgba(10, 17, 24, 0.2);
  border-color: rgba(208, 225, 240, 0.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(5px);
}

#contactCenterModal .contact-modal-header {
  align-items: center;
  margin-bottom: 6px;
}

#contactCenterModal .contact-title-block {
  display: none;
}

#contactCenterModal .contact-header-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 5px;
  width: 100%;
}

#contactCenterModal .contact-header-actions button {
  min-width: 0;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

#contactCenterModal .contact-modal-eyebrow {
  color: rgba(210, 229, 244, 0.78);
}

#contactCenterModal .contact-modal-header h2 {
  font-size: 16px;
}

#contactCenterModal .contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 6px;
}

#contactCenterModal.config-collapsed .contact-config {
  display: block;
  padding: 0;
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
}

#contactCenterModal.config-collapsed .contact-config > .grid,
#contactCenterModal.config-collapsed .contact-config > label,
#contactCenterModal.config-collapsed .contact-config > .status,
#contactCenterModal.config-collapsed .contact-config > .cost-panel {
  display: none;
}

#contactCenterModal.config-collapsed .contact-modal-card {
  width: min(960px, calc(100vw - var(--stage-camera-left, 304px) - 36px));
}

#contactCenterModal.config-collapsed .contact-log {
  min-height: 34px;
  max-height: 74px;
}

#contactCenterModal.config-collapsed .contact-modal-header {
  display: block;
  margin-bottom: 5px;
}

#contactCenterModal.config-collapsed .contact-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

#contactCenterModal.config-collapsed .contact-console {
  display: grid;
  grid-template-columns: 168px minmax(230px, 1fr) 316px;
  align-items: stretch;
  gap: 6px;
}

#contactCenterModal.config-collapsed .contact-customer,
#contactCenterModal.config-collapsed .contact-log,
#contactCenterModal.config-collapsed .contact-score {
  margin: 0;
}

#contactCenterModal.config-collapsed .contact-score {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#contactCenterModal .contact-config,
#contactCenterModal .contact-console,
#contactCenterModal .cost-panel {
  background: rgba(8, 14, 20, 0.18);
  border-color: rgba(208, 225, 240, 0.09);
  backdrop-filter: blur(4px);
}

#contactCenterModal:not(.config-collapsed) .contact-grid-2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#contactCenterModal:not(.config-collapsed) .contact-config {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#contactCenterModal:not(.config-collapsed) .contact-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#contactCenterModal .contact-config label,
#contactCenterModal .contact-cost-panel {
  font-size: 11px;
}

#contactCenterModal textarea {
  max-height: 74px;
}

#contactCenterModal .contact-log {
  min-height: 74px;
  max-height: 18vh;
  background: rgba(8, 14, 20, 0.12);
  border-color: rgba(220, 235, 248, 0.08);
}

#contactCenterModal .contact-turn {
  background: rgba(13, 22, 30, 0.24);
  border-color: rgba(220, 235, 248, 0.09);
  color: rgba(255,255,255,.92);
}

#contactCenterModal .contact-score {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

#contactCenterModal .contact-score div,
#contactCenterModal .cost-meta div,
#contactCenterModal .cost-grid div {
  background: rgba(8, 14, 20, 0.14);
  border-color: rgba(220, 235, 248, 0.08);
}

#contactCenterModal.config-collapsed .contact-customer {
  min-height: 72px;
  padding: 8px;
  gap: 8px;
}

#contactCenterModal.config-collapsed .contact-avatar {
  width: 34px;
  height: 34px;
}

#contactCenterModal.config-collapsed .contact-score div {
  padding: 8px;
}

#contactCenterModal.config-collapsed .contact-score strong {
  font-size: 15px;
}

#contactCenterModal .contact-actions {
  gap: 6px;
}

#contactCenterModal.config-collapsed .contact-actions {
  display: grid;
  grid-template-columns: max-content;
  align-content: start;
  justify-content: start;
  margin: 0;
  height: 100%;
}

#contactCenterModal.config-collapsed .contact-actions button {
  display: none;
}

#contactCenterModal.config-collapsed:not(.contact-running) #contactStartBtn,
#contactCenterModal.config-collapsed.contact-running #contactFinishBtn {
  display: none;
  width: 138px;
}

#contactCenterModal .contact-actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

#contactCenterModal .cost-header {
  gap: 8px;
}

#contactCenterModal .cost-toggle-btn {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

#contactCostPanel.cost-collapsed {
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

#contactCostPanel.cost-collapsed .cost-header > div,
#contactCostPanel.cost-collapsed .cost-total-value {
  display: none;
}

#contactCostPanel.cost-collapsed .cost-header {
  display: flex;
  justify-content: flex-end;
}

#contactCostPanel.cost-collapsed .cost-note,
#contactCostPanel.cost-collapsed .cost-meta,
#contactCostPanel.cost-collapsed .cost-grid {
  display: none;
}

.contact-modal-card {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.contact-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.contact-modal-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.contact-modal-header h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
}

.contact-config,
.contact-console {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.contact-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-config label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.contact-config select,
.contact-config textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.contact-config textarea {
  resize: vertical;
  line-height: 1.42;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.contact-actions button {
  flex: 1 1 140px;
  min-height: var(--compact-control-height);
}

.contact-customer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.contact-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--control), var(--control-strong));
  color: #f8fafc;
  font-weight: 900;
}

.contact-customer strong,
.contact-customer span {
  display: block;
}

.contact-customer span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.contact-log {
  min-height: 300px;
  max-height: 42vh;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
}

.contact-turn {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.4;
  font-size: 14px;
}

.contact-turn.customer {
  justify-self: start;
  background: #ffffff;
  border: 1px solid var(--line);
}

.contact-turn.candidate {
  justify-self: end;
  background: #eef7f3;
  border: 1px solid #cfe5da;
}

.contact-turn.system {
  justify-self: center;
  max-width: 100%;
  background: #edf2f6;
  color: #2f3d46;
  font-size: 13px;
  font-weight: 700;
}

.contact-score {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.contact-score div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.contact-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-score strong {
  color: var(--ink);
  font-size: 18px;
}

.final-review-modal[hidden] {
  display: none;
}

.final-review-modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 24px;
}

.final-review-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 18, 0.66);
  backdrop-filter: blur(7px);
}

.final-review-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(217, 212, 200, 0.88);
  border-radius: 14px;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.34);
}

.final-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.final-review-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.final-review-header h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.final-review-state {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e7f0f7;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.ai-thinking-overlay[hidden] {
  display: none;
}

.ai-thinking-overlay {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.ai-thinking-card {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(520px, calc(100vw - 48px));
  padding: 22px 24px;
  border: 1px solid rgba(139, 177, 214, 0.42);
  border-radius: 18px;
  background: rgba(12, 20, 27, 0.9);
  color: #f4f8fb;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
}

.ai-thinking-spinner {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 4px solid rgba(203, 219, 232, 0.24);
  border-top-color: #69a7df;
  animation: ai-thinking-spin 0.9s linear infinite;
}

.ai-thinking-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}

.ai-thinking-card p {
  margin: 6px 0 0;
  color: #cbdbe8;
  font-size: 14px;
  line-height: 1.35;
}

@keyframes ai-thinking-spin {
  to {
    transform: rotate(360deg);
  }
}

.final-progress-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.final-progress-list li {
  position: relative;
  min-height: 40px;
  padding: 11px 12px 11px 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--muted);
  font-weight: 700;
}

.final-progress-list li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #c6cbd0;
}

.final-progress-list li.is-active {
  border-color: rgba(79, 128, 184, 0.5);
  color: var(--ink);
  background: #eef6ff;
}

.final-progress-list li.is-active::before {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(79, 128, 184, 0.16);
}

.final-progress-list li.is-done {
  color: #26343a;
}

.final-progress-list li.is-done::before {
  background: #2f8d66;
}

.final-progress-list li.is-error {
  border-color: rgba(159, 63, 54, 0.52);
  color: #873930;
  background: #fff3f1;
}

.final-progress-list li.is-error::before {
  background: var(--danger);
}

.final-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.final-review-actions button {
  flex: 1 1 150px;
  min-width: 140px;
}

.final-review-actions #finalForceStopBtn {
  flex-basis: 210px;
}

.settings-modal[hidden] {
  display: none;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: grid;
  place-items: center;
  padding: 24px;
}

.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 20, 0.62);
  backdrop-filter: blur(6px);
}

.settings-modal-card {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(88, 122, 145, 0.16), rgba(246, 248, 250, 0) 34%),
    linear-gradient(180deg, #ffffff 0%, #f3f6f8 100%);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.28);
}

.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-modal-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-close-btn {
  flex: 0 0 auto;
  min-width: 96px;
  background: var(--control-muted);
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.settings-overview-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.settings-overview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-overview-card strong {
  font-size: 22px;
  line-height: 1.1;
  color: var(--ink);
}

.settings-overview-copy {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.settings-tab {
  min-height: var(--compact-control-height);
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: #2b3942;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.settings-tab.is-active {
  background: linear-gradient(180deg, var(--button-yellow-500), var(--button-yellow-700));
  border-color: var(--button-yellow-700);
  color: #eef6ff;
}

.settings-panel {
  display: grid;
  gap: 0;
}

.settings-tab-panel {
  display: none;
  gap: 14px;
}

.settings-tab-panel.is-active {
  display: grid;
}

.settings-section {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.settings-section summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 18px 52px 18px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.settings-section summary::-webkit-details-marker {
  display: none;
}

.settings-section summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e8eef3;
  color: #2f3d46;
  font-size: 18px;
  line-height: 1;
}

.settings-section[open] summary::after {
  content: "−";
}

.settings-section-body {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}

.upload-interview-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.upload-interview-box label {
  margin: 0;
}

.settings-grid-2,
.settings-grid-3 {
  gap: 12px;
}

.settings-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-panel .grid {
  gap: 12px;
}

.settings-copy-block {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.settings-copy-block p {
  margin: 0;
}

.voice-modal[hidden] {
  display: none;
}

.voice-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.voice-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 20, 0.62);
  backdrop-filter: blur(6px);
}

.voice-modal-card {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-raised);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.28);
}

.voice-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.voice-modal-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.voice-close-btn {
  flex: 0 0 auto;
  min-width: 96px;
  background: var(--control-muted);
}

.voice-modal-body {
  display: grid;
  gap: 16px;
}

.voice-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
}

.voice-card h3 {
  margin: 0 0 14px;
}

.voice-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.voice-recorder-actions {
  flex-wrap: wrap;
}

.voice-recorder-actions button {
  min-width: 180px;
}

.voice-audio-preview {
  width: 100%;
  margin: 8px 0 0;
}

.vibration-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
}

#vibrationImage {
  width: 100%;
  min-height: 260px;
  border-radius: 14px;
  background: #0d1216;
  border: 1px solid rgba(13, 18, 22, 0.18);
}

.vibration-metrics {
  display: grid;
  gap: 10px;
}

.vibration-metric {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
}

.vibration-metric span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.vibration-metric strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.calibration {
  margin-top: 22px;
}

.cost-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
  display: grid;
  gap: 12px;
}

.cost-panel.cost-hidden {
  display: none;
}

.cost-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.cost-total-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cost-total-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
}

.cost-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.cost-panel.cost-overlay {
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(15, 21, 26, 0.72);
  backdrop-filter: blur(14px);
  color: rgba(248, 250, 252, 0.92);
  box-shadow: none;
}

.cost-panel.cost-overlay .cost-header {
  align-items: baseline;
  gap: 12px;
}

.cost-panel.cost-overlay .cost-total-label,
.cost-panel.cost-overlay .cost-note {
  color: rgba(245, 248, 243, 0.72);
}

.cost-panel.cost-overlay .cost-total-value {
  font-size: 22px;
  color: #dff7e8;
}

.cost-panel.cost-overlay .cost-meta,
.cost-panel.cost-overlay .cost-grid {
  display: none;
}

.cost-meta,
.cost-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cost-meta div,
.cost-grid div {
  padding: 10px 12px;
  border: 1px solid #e0e6db;
  border-radius: 8px;
  background: #fff;
}

.cost-meta span,
.cost-grid span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.cost-meta strong,
.cost-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #181818;
}

.cost-grid-wide {
  grid-column: 1 / -1;
}

.transcript {
  min-height: 320px;
  max-height: 55vh;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

body.meet-focus-mode .stage {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  height: min(300px, calc(100vh - 32px));
  min-height: 0;
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(12, 14, 13, 0.38);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(8px);
}

body.meet-focus-mode .camera-viewport {
  left: 12px !important;
  right: 12px;
  top: 12px !important;
  bottom: 74px;
  width: auto !important;
  height: auto !important;
  transform: none;
  border-radius: 12px;
}

body.meet-focus-mode .stage-toolbar,
body.meet-focus-mode .stage-visual-tabs,
body.meet-focus-mode .stage-visual-stats,
body.meet-focus-mode .realtime-hud,
body.meet-focus-mode .mic-monitor,
body.meet-focus-mode .quality-panel,
body.meet-focus-mode .stage-cost-shell,
body.meet-focus-mode .session-indicators,
body.meet-focus-mode .training-reader,
body.meet-focus-mode .stage-session-copy {
  display: none !important;
}

body.meet-focus-mode .stage-session-dock {
  left: 12px;
  right: 12px;
  bottom: 12px;
  transform: none;
  width: auto;
  display: grid;
  grid-template-columns: 1fr;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.meet-focus-mode .stage-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

body.meet-focus-mode .stage-actions button {
  min-width: 0;
  min-height: var(--compact-control-height);
  padding: 0 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.26);
  color: #111;
  backdrop-filter: blur(8px);
}

@media (min-width: 901px) {
  .stage {
    --left-rail-left: 18px;
    --left-rail-width: 250px;
    --stage-camera-left: 326px;
  }

  .camera-viewport {
    left: var(--stage-camera-left, 326px);
  }

  .mic-monitor,
  .quality-panel,
  .session-indicators,
  .stage-session-dock {
    left: var(--left-rail-left);
    width: var(--left-rail-width);
    max-width: var(--left-rail-width);
  }

  .mic-monitor {
    min-height: 30px;
    padding: 4px 9px;
  }

  .quality-panel {
    gap: 8px;
  }

  .quality-panel div {
    font-size: 11px;
    line-height: 1.22;
    max-height: 92px;
  }

  .session-indicators {
    gap: 5px;
  }

  .stage-session-dock {
    top: calc(var(--stage-quality-top, 160px) + 178px);
    bottom: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 8px;
    border-radius: 14px;
    overflow: hidden;
  }

  .stage-session-dock .stage-session-copy,
  .stage-session-dock .stage-status-row,
  .stage-session-dock .stage-status {
    width: 100%;
    min-width: 0;
  }

  .stage-session-dock .stage-status {
    min-height: 38px;
    height: auto;
    padding: 8px 9px;
    align-items: flex-start;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .stage-session-dock .stage-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
    gap: 7px;
    margin: 0;
  }

  .stage-session-dock .stage-actions button {
    width: 100%;
    min-width: 0;
    min-height: 31px;
    padding: 0 8px;
    font-size: 11px;
  }

  .stage-session-dock .stage-actions #repeatBtn:disabled,
  .stage-session-dock .stage-actions #stopBtn:disabled {
    opacity: 0.48;
  }

  .stage-toolbar:not(.is-collapsed) ~ .session-indicators {
    display: none;
  }

  .stage-toolbar.is-collapsed ~ .session-indicators {
    top: calc(var(--stage-toolbar-top, 24px) + 4px);
    left: var(--stage-camera-center-x, 50%);
    transform: translateX(-50%);
    width: auto;
    max-width: min(380px, calc(100% - 320px));
    display: block;
  }

  .stage-toolbar.is-collapsed ~ .session-indicators .caption-bar {
    display: none;
  }

  .stage-toolbar.is-collapsed ~ .session-indicators .engine-badge {
    width: auto;
    max-width: 380px;
    min-height: 24px;
    padding: 0 11px;
    background: rgba(15, 21, 26, 0.9);
    border-color: rgba(230, 236, 242, 0.22);
    color: rgba(248, 250, 252, 0.92);
    font-size: 10.5px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  }
}

@media (max-width: 900px) {
  .stage {
    min-height: 46vh;
    --stage-toolbar-top: 12px;
    --stage-toolbar-gap: 12px;
    --stage-camera-top: 108px;
    --stage-status-top: 136px;
    --stage-quality-top: 192px;
    --stage-dock-space: 188px;
    --stage-camera-left: 12px;
    --stage-dock-top: auto;
    --left-rail-left: 12px;
    --left-rail-width: min(280px, calc(100vw - 24px));
    --stage-caption-bottom: 220px;
  }

  .camera-viewport {
    border-radius: 16px;
    left: var(--stage-camera-left, 12px);
  }

  .stage-visual-tabs {
    left: 12px;
    top: auto;
    bottom: calc(var(--stage-caption-bottom, 220px) + 54px);
    max-width: min(128px, calc(100% - 20px));
  }

  .stage-visual-tab {
    min-width: 0;
    padding: 0 10px;
  }

  .stage-visual-stats {
    left: 12px;
    right: 12px;
    bottom: calc(var(--stage-dock-space, 214px) + 18px);
    transform: none;
    overflow-x: auto;
  }

  .stage-visual-stats span {
    min-width: 84px;
  }

  .session-indicators {
    left: var(--left-rail-left);
    top: calc(var(--stage-quality-top, 160px) + 292px);
    width: var(--left-rail-width);
  }

  .caption-bar {
    min-height: var(--compact-control-height);
    padding: 6px 10px;
    font-size: 13px;
  }

  .mic-monitor {
    left: var(--left-rail-left);
    width: var(--left-rail-width);
  }

  .quality-panel {
    left: var(--left-rail-left);
    right: auto;
    width: var(--left-rail-width);
    max-width: none;
  }

  .stage-cost-shell {
    left: 12px;
    right: 12px;
    bottom: calc(var(--stage-dock-space, 214px) + 16px);
    width: auto;
    justify-content: flex-start;
  }

  .cost-panel.cost-overlay {
    width: auto;
  }

  .stage-toolbar {
    top: var(--stage-toolbar-top, 12px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stage-toolbar.is-collapsed {
    width: auto;
    right: auto;
  }

  .toolbar-controls {
    grid-template-columns: 1fr;
  }

  .toolbar-collapse-btn {
    width: 100%;
  }

  .toolbar-config-btn,
  .toolbar-toggle-group {
    width: 100%;
  }

  .stage-session-dock {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 10px;
    transform: none;
    width: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
  }

  .engine-badge {
    min-height: 20px;
    font-size: 11px;
  }

  .stage-actions {
    width: 100%;
    justify-content: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-actions button {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    min-height: 32px;
  }

  body.meet-focus-mode .stage {
    right: 10px;
    bottom: 10px;
    width: min(360px, calc(100vw - 20px));
    height: min(270px, calc(100vh - 20px));
  }

  .realtime-hud {
    right: 12px;
    left: 12px;
    top: auto;
    bottom: 92px;
    width: auto;
  }

  .realtime-hud.hud-left {
    left: 12px;
    right: 12px;
  }

  .quality-panel div {
    font-size: 16px;
    padding: 12px 14px;
  }

  .training-reader {
    inset: 12px;
    padding: 18px;
  }

  .reader-text {
    font-size: 24px;
  }

  .cost-meta,
  .cost-grid {
    grid-template-columns: 1fr;
  }

  .cost-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cost-total-value {
    white-space: normal;
  }

  .voice-modal {
    padding: 12px;
  }

  .settings-modal {
    padding: 12px;
  }

  .settings-modal-card {
    width: min(100vw - 24px, 1180px);
    max-height: calc(100vh - 24px);
    padding: 16px;
    border-radius: 18px;
  }

  .settings-modal-header {
    flex-direction: column;
  }

  .settings-overview {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    gap: 8px;
  }

  .settings-tab {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .settings-grid-2,
  .settings-grid-3 {
    grid-template-columns: 1fr;
  }

  .voice-modal-card {
    width: min(100vw - 24px, 920px);
    max-height: calc(100vh - 24px);
    padding: 16px;
    border-radius: 18px;
  }

  .voice-modal-header {
    flex-direction: column;
  }

  .voice-grid-2 {
    grid-template-columns: 1fr;
  }

  .voice-recorder-actions button {
    min-width: 0;
  }

  .contact-modal {
    padding: 12px;
  }

  .contact-modal-card {
    width: min(100vw - 24px, 1120px);
    max-height: calc(100vh - 24px);
    padding: 16px;
    border-radius: 18px;
  }

  .contact-modal-header {
    flex-direction: column;
  }

  .contact-layout,
  .contact-grid-2,
  .contact-score {
    grid-template-columns: 1fr;
  }

  .contact-log {
    min-height: 240px;
  }

  .vibration-board {
    grid-template-columns: 1fr;
  }

  .vibration-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
