.qm-app {
  --qm-bg: #070b0f;
  --qm-bg-deep: #030609;
  --qm-surface: #0d141a;
  --qm-surface-raised: #131e26;
  --qm-panel: rgba(10, 17, 22, 0.9);
  --qm-panel-solid: #0a1116;
  --qm-text: #f3f0e8;
  --qm-muted: #a7b2b6;
  --qm-dim: #68777c;
  --qm-line: rgba(190, 210, 211, 0.13);
  --qm-line-strong: rgba(190, 210, 211, 0.24);
  --qm-signal: #65d7ba;
  --qm-signal-deep: #174f44;
  --qm-amber: #e4a246;
  --qm-amber-bright: #f2bc61;
  --qm-danger: #db6d6d;
  --qm-shadow: rgba(0, 8, 12, 0.66);
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow-x: clip;
  color: var(--qm-text);
  background:
    radial-gradient(
      circle at 72% 14%,
      rgba(25, 86, 77, 0.22),
      transparent 31rem
    ),
    radial-gradient(
      circle at 4% 94%,
      rgba(137, 78, 25, 0.13),
      transparent 29rem
    ),
    linear-gradient(135deg, #070d12 0%, var(--qm-bg) 48%, #05090c 100%);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.qm-app *,
.qm-app *::before,
.qm-app *::after {
  box-sizing: border-box;
}

.qm-app button,
.qm-app a,
.qm-app textarea {
  font: inherit;
}

.qm-app button,
.qm-app a {
  touch-action: manipulation;
}

.qm-app button {
  cursor: pointer;
}

.qm-app svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.qm-atmosphere {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.qm-atmosphere::before {
  content: "";
  position: absolute;
  inset: -22% -12%;
  opacity: 0.16;
  background-image: repeating-linear-gradient(
    108deg,
    transparent 0 17px,
    rgba(164, 214, 211, 0.46) 18px,
    transparent 19px 37px
  );
  background-size: 110px 140px;
  transform: skewX(-12deg);
  animation: qm-rain-drift 9s linear infinite;
}

.qm-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(121, 175, 173, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 175, 173, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(
    to bottom,
    transparent,
    #000 24%,
    #000 82%,
    transparent
  );
}

.qm-atmosphere > i {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  animation: qm-ambient-drift 13s ease-in-out infinite alternate;
}

.qm-atmosphere > i:nth-child(1) {
  top: 17%;
  right: -8rem;
  width: 34rem;
  height: 34rem;
  background: radial-gradient(
    circle,
    rgba(36, 111, 100, 0.13),
    transparent 66%
  );
}

.qm-atmosphere > i:nth-child(2) {
  bottom: -12rem;
  left: -8rem;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(
    circle,
    rgba(174, 103, 38, 0.09),
    transparent 66%
  );
  animation-delay: -5s;
}

.qm-atmosphere > i:nth-child(3) {
  top: 42%;
  left: 46%;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(101, 215, 186, 0.05);
  animation-delay: -9s;
}

@keyframes qm-rain-drift {
  from {
    background-position: 0 -140px;
  }
  to {
    background-position: -110px 140px;
  }
}

@keyframes qm-ambient-drift {
  from {
    transform: translate3d(-2%, -3%, 0) scale(0.96);
  }
  to {
    transform: translate3d(4%, 5%, 0) scale(1.06);
  }
}

.qm-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: 72px;
  padding: max(10px, env(safe-area-inset-top)) clamp(14px, 2.2vw, 34px) 10px;
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr) auto auto;
  align-items: center;
  gap: clamp(12px, 2vw, 30px);
  border-bottom: 1px solid var(--qm-line);
  background: rgba(5, 10, 14, 0.84);
  box-shadow:
    0 12px 40px rgba(0, 5, 8, 0.28),
    inset 0 -1px rgba(101, 215, 186, 0.025);
  backdrop-filter: blur(22px) saturate(125%);
}

.qm-topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 28%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(101, 215, 186, 0.62));
}

.qm-icon-button {
  min-width: 118px;
  min-height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--qm-muted);
  border: 1px solid var(--qm-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.qm-icon-button svg {
  width: 19px;
  height: 19px;
}

.qm-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.qm-brand img {
  width: 94px;
  height: auto;
  object-fit: contain;
}
.qm-brand span {
  min-width: 0;
  display: block;
}
.qm-brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.08em;
}
.qm-brand small,
.qm-topbar-case span {
  display: block;
  margin-top: 3px;
  color: var(--qm-dim);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.qm-topbar-case {
  min-width: 170px;
  padding-left: 20px;
  border-left: 1px solid var(--qm-line);
}

.qm-topbar-case strong {
  display: block;
  margin-top: 4px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color: var(--qm-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.qm-case-state {
  min-height: 38px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--qm-line);
  border-radius: 3px;
  color: var(--qm-muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.qm-case-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--qm-dim);
}

.qm-case-state[data-state="active"] i {
  background: var(--qm-signal);
  box-shadow: 0 0 13px rgba(101, 215, 186, 0.85);
  animation: qm-status-pulse 1.8s ease-in-out infinite;
}

.qm-case-state[data-state="completed"] i {
  background: var(--qm-amber-bright);
  box-shadow: 0 0 13px rgba(228, 162, 70, 0.78);
}

@keyframes qm-status-pulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.qm-shell {
  min-height: calc(100dvh - 72px);
}

.qm-welcome,
.qm-game {
  position: relative;
  z-index: 1;
}

.qm-welcome[hidden],
.qm-game[hidden],
.qm-loading[hidden],
.qm-complete[hidden],
.qm-toast[hidden],
.qm-dialog-backdrop[hidden] {
  display: none;
}

.qm-welcome {
  width: min(1520px, 100%);
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: clamp(40px, 6vh, 82px) clamp(22px, 4vw, 68px)
    max(54px, calc(32px + env(safe-area-inset-bottom)));
  display: grid;
  grid-template-columns: minmax(410px, 0.88fr) minmax(510px, 1.12fr);
  align-items: center;
  gap: clamp(46px, 6vw, 96px);
}

.qm-welcome::before {
  content: "CASE / INTERROGATION PROTOCOL";
  position: absolute;
  right: clamp(22px, 4vw, 68px);
  bottom: 21px;
  color: rgba(167, 178, 182, 0.24);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
}

.qm-welcome-copy {
  min-width: 0;
  max-width: 650px;
}

.qm-case-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.qm-eyebrow,
.qm-panel-code > i,
.qm-case-file > span:last-child {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.qm-eyebrow {
  color: var(--qm-signal);
}

.qm-case-file > span:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--qm-muted);
  letter-spacing: 0.1em;
}

.qm-case-file > span:last-child i,
.qm-art-status span i,
.qm-fallback-note i {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--qm-signal);
  box-shadow: 0 0 10px rgba(101, 215, 186, 0.72);
}

.qm-welcome h1 {
  margin: clamp(18px, 3vh, 30px) 0 21px;
  color: var(--qm-text);
  font-family: "Arial Narrow", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(58px, 5.6vw, 94px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.qm-welcome h1 span,
.qm-welcome h1 em {
  display: inline-block;
}

.qm-welcome h1 em {
  color: var(--qm-amber-bright);
  font-style: normal;
  text-shadow: 0 9px 30px rgba(156, 91, 27, 0.2);
}

.qm-welcome-lede {
  max-width: 610px;
  margin: 0;
  color: var(--qm-muted);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.8;
  text-wrap: pretty;
}

.qm-case-metrics {
  margin: 27px 0 0;
  padding: 13px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--qm-line);
  border-bottom: 1px solid var(--qm-line);
}

.qm-case-metrics > div {
  min-width: 0;
  padding: 0 15px;
  border-left: 1px solid var(--qm-line);
}

.qm-case-metrics > div:first-child {
  padding-left: 0;
  border-left: 0;
}
.qm-case-metrics > div:last-child {
  padding-right: 0;
}
.qm-case-metrics span {
  display: block;
  color: var(--qm-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.qm-case-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qm-gameplay-loop {
  margin: 23px 0 29px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.qm-gameplay-loop li {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.qm-gameplay-loop li > span {
  color: var(--qm-signal);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}
.qm-gameplay-loop p {
  min-width: 0;
  margin: 0;
}
.qm-gameplay-loop strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.qm-gameplay-loop small {
  display: block;
  margin-top: 3px;
  color: var(--qm-dim);
  font-size: 10px;
  line-height: 1.45;
}

.qm-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.qm-welcome-actions > button {
  flex: 1 1 190px;
}
.qm-welcome-actions > [hidden] {
  display: none;
}

.qm-primary-button,
.qm-secondary-button,
.qm-voice-button,
.qm-stop-button,
.qm-send-button {
  position: relative;
  min-height: 50px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.qm-primary-button {
  padding: 0 22px;
  border: 1px solid var(--qm-amber-bright);
  color: #191108;
  background: var(--qm-amber);
  box-shadow:
    0 10px 30px rgba(154, 91, 28, 0.16),
    inset 0 1px rgba(255, 255, 255, 0.24);
  font-weight: 800;
}

.qm-primary-button::after,
.qm-voice-button::after {
  content: "";
  position: absolute;
  inset: -100% auto -100% -45%;
  width: 32%;
  opacity: 0.42;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.52),
    transparent
  );
  transform: skewX(-18deg);
  animation: qm-cta-sweep 4.8s ease-in-out infinite;
}

@keyframes qm-cta-sweep {
  0%,
  68% {
    left: -45%;
  }
  100% {
    left: 125%;
  }
}

.qm-primary-button svg {
  width: 21px;
  height: 21px;
}

.qm-secondary-button {
  padding: 0 18px;
  border: 1px solid var(--qm-line-strong);
  color: var(--qm-text);
  background: rgba(255, 255, 255, 0.035);
}

.qm-music-toggle svg {
  width: 18px;
  height: 18px;
}

.qm-music-toggle .qm-music-off-mark {
  opacity: 0;
  color: var(--qm-danger);
  stroke-width: 2.2;
  transition: opacity 0.2s ease;
}

.qm-music-toggle[aria-pressed="false"] .qm-music-off-mark {
  opacity: 1;
}

.qm-welcome-resume {
  margin: 12px 0 0;
  color: var(--qm-amber-bright);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.qm-fallback-note {
  margin-top: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--qm-dim);
  font-size: 11px;
}

.qm-fallback-note i {
  background: var(--qm-dim);
  box-shadow: none;
}

.qm-welcome-art {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 13px 13px 86px;
  border: 1px solid var(--qm-line-strong);
  border-radius: 5px 24px 5px 5px;
  background: linear-gradient(
    145deg,
    rgba(18, 29, 36, 0.9),
    rgba(6, 11, 15, 0.96)
  );
  box-shadow:
    0 36px 100px var(--qm-shadow),
    inset 0 1px rgba(255, 255, 255, 0.04);
}

.qm-welcome-art::before,
.qm-welcome-art::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.qm-welcome-art::before {
  top: -1px;
  left: 36px;
  width: 92px;
  height: 3px;
  background: var(--qm-signal);
  box-shadow: 0 0 18px rgba(101, 215, 186, 0.5);
}

.qm-welcome-art::after {
  right: 22px;
  bottom: 23px;
  width: 48%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--qm-line-strong));
}

.qm-art-frame {
  position: relative;
  min-height: clamp(390px, 38vw, 600px);
  overflow: hidden;
  border: 1px solid rgba(208, 223, 221, 0.15);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
  background: #071016;
}

.qm-art-frame::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 8, 11, 0.06) 42%, rgba(3, 7, 9, 0.9) 100%),
    repeating-linear-gradient(
      180deg,
      transparent 0 3px,
      rgba(142, 213, 205, 0.025) 4px
    );
  pointer-events: none;
}

.qm-art-frame img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.74) contrast(1.1) brightness(0.86);
  transform: scale(1.035);
  animation: qm-art-breathe 14s ease-in-out infinite alternate;
}

@keyframes qm-art-breathe {
  from {
    transform: scale(1.035) translate3d(-0.35%, 0, 0);
  }
  to {
    transform: scale(1.085) translate3d(0.4%, -0.5%, 0);
  }
}

.qm-art-scanner {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.qm-art-scanner::before {
  content: "";
  position: absolute;
  top: -12%;
  left: 0;
  right: 0;
  height: 12%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(101, 215, 186, 0.1),
    rgba(101, 215, 186, 0.55),
    transparent
  );
  filter: blur(0.2px);
  animation: qm-scan 5.5s cubic-bezier(0.48, 0.01, 0.52, 0.99) infinite;
}

.qm-art-scanner i {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: repeating-linear-gradient(
    108deg,
    transparent 0 28px,
    rgba(181, 224, 219, 0.44) 29px,
    transparent 30px 58px
  );
  background-size: 180px 220px;
  animation: qm-rain-drift 7s linear infinite;
}

@keyframes qm-scan {
  0%,
  12% {
    transform: translateY(-5%);
    opacity: 0;
  }
  23% {
    opacity: 0.72;
  }
  72% {
    opacity: 0.46;
  }
  88%,
  100% {
    transform: translateY(930%);
    opacity: 0;
  }
}

.qm-art-reticle {
  position: absolute;
  z-index: 5;
  inset: 20px;
  pointer-events: none;
}
.qm-art-reticle i {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(101, 215, 186, 0.72);
}
.qm-art-reticle i:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 1px solid;
  border-left: 1px solid;
}
.qm-art-reticle i:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 1px solid;
  border-right: 1px solid;
}
.qm-art-reticle i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid;
  border-left: 1px solid;
}
.qm-art-reticle i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.qm-art-status {
  position: absolute;
  z-index: 6;
  top: 27px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: rgba(227, 239, 235, 0.78);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.qm-art-status span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qm-art-status strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.qm-welcome-art figcaption {
  position: absolute;
  z-index: 7;
  left: 32px;
  right: 100px;
  bottom: 23px;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.qm-welcome-art figcaption span {
  color: var(--qm-signal);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.qm-welcome-art figcaption strong {
  font-size: clamp(22px, 2.2vw, 31px);
  letter-spacing: -0.03em;
}
.qm-welcome-art figcaption small {
  overflow: hidden;
  color: var(--qm-muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qm-case-seal {
  position: absolute;
  z-index: 8;
  right: 25px;
  bottom: 20px;
  width: 54px;
  height: 54px;
  display: grid;
  place-content: center;
  justify-items: center;
  border: 1px solid rgba(228, 162, 70, 0.38);
  color: var(--qm-amber-bright);
  transform: rotate(-5deg);
}

.qm-case-seal span {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.qm-case-seal small {
  margin-top: 2px;
  font-family: ui-monospace, monospace;
  font-size: 5px;
  letter-spacing: 0.05em;
}

.qm-welcome:not([hidden]) .qm-case-file,
.qm-welcome:not([hidden]) h1,
.qm-welcome:not([hidden]) .qm-welcome-lede,
.qm-welcome:not([hidden]) .qm-case-metrics,
.qm-welcome:not([hidden]) .qm-gameplay-loop,
.qm-welcome:not([hidden]) .qm-welcome-actions,
.qm-welcome:not([hidden]) .qm-fallback-note,
.qm-welcome:not([hidden]) .qm-welcome-art {
  opacity: 0;
  animation: qm-stage-in 0.7s cubic-bezier(0.2, 0.78, 0.22, 1) forwards;
}

.qm-welcome:not([hidden]) h1 {
  animation-delay: 0.07s;
}
.qm-welcome:not([hidden]) .qm-welcome-lede {
  animation-delay: 0.13s;
}
.qm-welcome:not([hidden]) .qm-case-metrics {
  animation-delay: 0.19s;
}
.qm-welcome:not([hidden]) .qm-gameplay-loop {
  animation-delay: 0.25s;
}
.qm-welcome:not([hidden]) .qm-welcome-actions {
  animation-delay: 0.31s;
}
.qm-welcome:not([hidden]) .qm-fallback-note {
  animation-delay: 0.36s;
}
.qm-welcome:not([hidden]) .qm-welcome-art {
  animation-delay: 0.12s;
}

@keyframes qm-stage-in {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.qm-game {
  width: 100%;
  height: calc(100dvh - 72px);
  min-height: calc(100dvh - 72px);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "evidence interrogation"
    "voice interrogation";
  gap: 12px;
  align-items: stretch;
}

.qm-evidence-panel {
  grid-area: evidence;
}
.qm-interrogation {
  grid-area: interrogation;
}
.qm-voice-panel {
  grid-area: voice;
}

.qm-game:not([hidden]) > * {
  opacity: 0;
  animation: qm-stage-in 0.56s cubic-bezier(0.2, 0.78, 0.22, 1) forwards;
}

.qm-game:not([hidden]) > :nth-child(2) {
  animation-delay: 0.08s;
}
.qm-game:not([hidden]) > :nth-child(3) {
  animation-delay: 0.16s;
}

.qm-evidence-panel,
.qm-interrogation,
.qm-voice-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
  border: 1px solid var(--qm-line);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 24%),
    var(--qm-panel);
  box-shadow:
    0 18px 50px rgba(0, 5, 8, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px);
}

.qm-evidence-panel::before,
.qm-interrogation::before,
.qm-voice-panel::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -1px;
  left: 18px;
  width: 62px;
  height: 2px;
  background: var(--qm-signal);
  box-shadow: 0 0 14px rgba(101, 215, 186, 0.35);
}

.qm-evidence-panel,
.qm-voice-panel {
  padding: 20px;
}
.qm-evidence-panel {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--qm-line-strong) transparent;
}
.qm-evidence-panel header,
.qm-voice-panel header {
  display: grid;
  gap: 6px;
}

.qm-panel-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.qm-panel-code > i {
  color: var(--qm-dim);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.qm-evidence-panel h2,
.qm-voice-panel h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}
.qm-evidence-panel header p {
  margin: 0;
  color: var(--qm-muted);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.qm-focus-objective {
  position: relative;
  margin: 0;
  padding: 11px 60px 11px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 0;
  border-top: 1px solid rgba(228, 162, 70, 0.24);
  border-bottom: 1px solid rgba(228, 162, 70, 0.18);
  border-radius: 0;
  background: rgba(126, 76, 28, 0.1);
}

.qm-focus-objective::after {
  content: "TARGET";
  position: absolute;
  top: 50%;
  right: 15px;
  color: rgba(228, 162, 70, 0.28);
  font-family: ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  transform: translateY(-50%);
}
.qm-focus-objective span {
  color: var(--qm-amber-bright);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.qm-focus-objective p {
  margin: 0;
  color: #f1e3cd;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.qm-evidence-panel .qm-clue-list {
  margin-top: 18px;
}

.qm-clue-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.qm-clue-button {
  width: 100%;
  min-height: 66px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--qm-line);
  border-radius: 3px;
  color: var(--qm-text);
  background: rgba(255, 255, 255, 0.022);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.qm-clue-button:disabled {
  cursor: default;
  opacity: 1;
}
.qm-clue-button > span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--qm-line);
  border-radius: 2px;
  color: var(--qm-dim);
  background: rgba(255, 255, 255, 0.025);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.qm-clue-button div {
  min-width: 0;
}
.qm-clue-button strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.qm-clue-button small {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--qm-dim);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.qm-clue-button svg {
  width: 16px;
  height: 16px;
  color: var(--qm-dim);
}

.qm-clue-button.is-discovered {
  cursor: pointer;
  border-color: rgba(101, 215, 186, 0.26);
  background: linear-gradient(
    90deg,
    rgba(29, 87, 75, 0.16),
    rgba(29, 87, 75, 0.035)
  );
  animation: qm-evidence-lock 0.55s ease both;
}

.qm-clue-button.is-discovered > span:first-child {
  color: var(--qm-signal);
  border-color: rgba(101, 215, 186, 0.24);
  background: rgba(101, 215, 186, 0.07);
}
.qm-clue-button.is-discovered svg {
  color: var(--qm-signal);
}

@keyframes qm-evidence-lock {
  0% {
    box-shadow: inset 0 0 0 rgba(101, 215, 186, 0);
  }
  45% {
    box-shadow: inset 0 0 30px rgba(101, 215, 186, 0.14);
  }
  100% {
    box-shadow: inset 0 0 0 rgba(101, 215, 186, 0);
  }
}

.qm-interrogation {
  display: flex;
  flex-direction: column;
}

.qm-suspect-header {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(150px, 205px) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--qm-line);
  background: rgba(7, 12, 16, 0.62);
}

.qm-suspect-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(228, 162, 70, 0.46);
  border-radius: 3px;
  color: var(--qm-amber-bright);
  background:
    linear-gradient(rgba(228, 162, 70, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(228, 162, 70, 0.07) 1px, transparent 1px),
    #11181d;
  background-size: 8px 8px;
  font-family: ui-monospace, monospace;
  font-size: 20px;
  font-weight: 800;
}

.qm-suspect-avatar i {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--qm-panel-solid);
  border-radius: 50%;
  background: var(--qm-signal);
  box-shadow: 0 0 10px rgba(101, 215, 186, 0.5);
}
.qm-suspect-role {
  color: var(--qm-muted);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
}
.qm-suspect-header h1 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}
.qm-pressure {
  min-width: 0;
}
.qm-pressure > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--qm-muted);
  font-size: 10px;
}
.qm-pressure strong {
  color: var(--qm-amber-bright);
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
.qm-pressure-track {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.075);
}
.qm-pressure-track i {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(
    90deg,
    var(--qm-signal),
    var(--qm-amber),
    var(--qm-danger)
  );
  box-shadow: 0 0 10px rgba(228, 162, 70, 0.28);
  transition: width 0.42s cubic-bezier(0.2, 0.78, 0.22, 1);
}

.qm-session-actions {
  display: flex;
  gap: 7px;
}
.qm-session-actions button {
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--qm-line);
  border-radius: 2px;
  color: var(--qm-muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.qm-session-actions .qm-music-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.qm-session-actions .qm-music-toggle svg {
  width: 15px;
  height: 15px;
}

.qm-monitor-head {
  min-height: 28px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--qm-dim);
  border-bottom: 1px solid rgba(190, 210, 211, 0.07);
  background: rgba(3, 7, 9, 0.32);
  font-family: ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.qm-monitor-head i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--qm-line), transparent);
}
.qm-monitor-head small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--qm-danger);
  font-size: inherit;
}
.qm-monitor-head small::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: qm-status-pulse 1.3s ease-in-out infinite;
}

.qm-live-captions {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
  gap: 10px;
  border-bottom: 1px solid var(--qm-line);
  background: rgba(0, 0, 0, 0.13);
}

.qm-caption {
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid var(--qm-line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
}

.qm-caption span {
  color: var(--qm-dim);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.qm-caption p {
  margin: 6px 0 0;
  color: #e1e5e2;
  font-size: 14px;
  line-height: 1.5;
}
.qm-caption-player {
  border-left: 2px solid var(--qm-signal);
  background: rgba(101, 215, 186, 0.025);
}
.qm-caption-suspect {
  border-color: rgba(228, 162, 70, 0.42);
  border-left: 2px solid var(--qm-amber);
  background: rgba(126, 76, 28, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(228, 162, 70, 0.05),
    0 10px 26px rgba(0, 0, 0, 0.14);
}
.qm-caption-suspect span {
  color: var(--qm-amber-bright);
}
.qm-caption-suspect p {
  color: #fff2df;
  font-size: 15px;
  font-weight: 600;
}

.qm-history-head {
  min-height: 30px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--qm-muted);
  border-bottom: 1px solid rgba(190, 210, 211, 0.07);
  background: rgba(3, 7, 9, 0.42);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.qm-history-head small {
  color: var(--qm-dim);
  font-size: 9px;
}

.qm-transcript {
  flex: 1;
  min-height: 180px;
  padding: 14px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background:
    linear-gradient(rgba(101, 215, 186, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 215, 186, 0.014) 1px, transparent 1px);
  background-size: 36px 36px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--qm-line-strong) transparent;
}

.qm-turn {
  max-width: 86%;
  display: grid;
  gap: 5px;
  animation: qm-turn-in 0.34s cubic-bezier(0.2, 0.78, 0.22, 1) both;
}
.qm-turn span {
  color: var(--qm-dim);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
}
.qm-turn p {
  position: relative;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--qm-line);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.65;
}
.qm-turn:nth-last-child(n + 3) > * {
  opacity: 0.56;
}
.qm-turn-player {
  align-self: flex-end;
  text-align: right;
}
.qm-turn-player p {
  color: #e1f7f1;
  border-color: rgba(101, 215, 186, 0.2);
  background: linear-gradient(
    135deg,
    rgba(23, 79, 68, 0.28),
    rgba(23, 79, 68, 0.11)
  );
}
.qm-turn-suspect {
  align-self: flex-start;
}
.qm-turn-suspect p {
  color: #f1e3cd;
  border-color: rgba(228, 162, 70, 0.2);
  background: linear-gradient(
    135deg,
    rgba(125, 76, 29, 0.21),
    rgba(125, 76, 29, 0.08)
  );
}
.qm-turn-player:nth-last-child(2) p {
  border-color: rgba(101, 215, 186, 0.34);
  background: rgba(23, 79, 68, 0.26);
}
.qm-turn-suspect:last-child span::after {
  content: "LATEST";
  margin-left: 7px;
  color: var(--qm-amber-bright);
  font-size: 8px;
  letter-spacing: 0.1em;
}
.qm-turn-suspect:last-child p {
  border-color: rgba(228, 162, 70, 0.38);
  background: rgba(125, 76, 29, 0.22);
  box-shadow: inset 0 0 0 1px rgba(228, 162, 70, 0.04);
}

@keyframes qm-turn-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.qm-composer {
  position: relative;
  z-index: 4;
  padding: 13px 14px;
  border-top: 1px solid rgba(101, 215, 186, 0.32);
  background: rgba(3, 8, 11, 0.96);
  box-shadow: 0 -18px 38px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}
.qm-composer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  width: 96px;
  height: 2px;
  background: var(--qm-signal);
  box-shadow: 0 0 14px rgba(101, 215, 186, 0.32);
}

.qm-composer-heading {
  min-height: 23px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qm-composer-heading > label {
  display: block;
  margin-right: auto;
  color: var(--qm-signal);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.qm-selected-clue {
  min-height: 28px;
  max-width: min(280px, 55%);
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(228, 162, 70, 0.34);
  border-radius: 999px;
  color: var(--qm-amber-bright);
  background: rgba(126, 76, 28, 0.13);
  font-size: 9px;
}

.qm-selected-clue[hidden],
.qm-response-pulse[hidden] {
  display: none;
}

.qm-selected-clue span {
  color: var(--qm-dim);
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.qm-selected-clue strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qm-selected-clue svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.qm-response-pulse {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--qm-amber-bright);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.qm-response-pulse i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: qm-status-pulse 0.9s ease-in-out infinite;
}

.qm-composer-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.qm-composer textarea {
  width: 100%;
  min-height: 52px;
  max-height: 140px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid var(--qm-line);
  border-radius: 3px;
  outline: 0;
  color: var(--qm-text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 16px;
  line-height: 1.5;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}
.qm-composer textarea::placeholder {
  color: #667479;
}
.qm-composer textarea:focus {
  border-color: var(--qm-signal);
  background: rgba(20, 47, 44, 0.2);
  box-shadow: 0 0 0 3px rgba(101, 215, 186, 0.09);
}
.qm-composer > p {
  margin: 7px 0 0;
  color: var(--qm-muted);
  font-size: 12px;
}
.qm-send-button {
  min-width: 92px;
  padding: 0 14px;
  border: 1px solid rgba(101, 215, 186, 0.52);
  color: #e9fffa;
  background: var(--qm-signal-deep);
  font-weight: 700;
}
.qm-send-button svg {
  width: 17px;
  height: 17px;
}

.qm-complete {
  margin: 14px;
  padding: 25px;
  border: 1px solid rgba(228, 162, 70, 0.34);
  border-radius: 3px;
  text-align: center;
  background: linear-gradient(
    145deg,
    rgba(140, 84, 30, 0.14),
    rgba(26, 78, 68, 0.1)
  );
}
.qm-complete h2 {
  margin: 8px 0;
  font-size: 25px;
}
.qm-complete p {
  margin: 0 auto 18px;
  max-width: 480px;
  color: var(--qm-muted);
  line-height: 1.65;
}
.qm-complete > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.qm-voice-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "voice-head voice-head"
    "voice-orbit voice-status"
    "voice-start voice-stop"
    "voice-note voice-note";
  align-items: center;
  gap: 12px;
  text-align: center;
}
.qm-voice-panel header {
  grid-area: voice-head;
  text-align: left;
}

.qm-voice-orbit {
  grid-area: voice-orbit;
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.qm-voice-orbit::before,
.qm-voice-orbit::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(101, 215, 186, 0.16);
  border-radius: 50%;
  animation: qm-orbit 15s linear infinite;
}
.qm-voice-orbit::after {
  inset: 34px;
  border-style: solid;
  border-color: rgba(228, 162, 70, 0.11);
  animation-direction: reverse;
  animation-duration: 9s;
}
.qm-voice-orbit > i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(101, 215, 186, 0.14);
  border-radius: 50%;
}
.qm-voice-orbit > i:nth-child(2) {
  inset: 17px;
}
.qm-voice-orbit > i:nth-child(3) {
  inset: 34px;
}
.qm-voice-orbit > span {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--qm-line-strong);
  border-radius: 50%;
  color: var(--qm-dim);
  background: radial-gradient(circle, #18262d, #0e171d);
  box-shadow: 0 0 40px rgba(23, 79, 68, 0.16);
}
.qm-voice-orbit svg {
  width: 20px;
  height: 20px;
}
.qm-voice-orbit[data-state="listening"] > span {
  color: var(--qm-signal);
  border-color: rgba(101, 215, 186, 0.5);
  box-shadow: 0 0 42px rgba(101, 215, 186, 0.14);
}
.qm-voice-orbit[data-state="speaking"] > span {
  color: var(--qm-amber-bright);
  border-color: rgba(228, 162, 70, 0.52);
  box-shadow: 0 0 42px rgba(228, 162, 70, 0.13);
}
.qm-voice-orbit[data-state="connecting"] > i,
.qm-voice-orbit[data-state="listening"] > i,
.qm-voice-orbit[data-state="speaking"] > i {
  animation: qm-pulse 1.8s ease-out infinite;
}
.qm-voice-orbit[data-state="listening"] > i:nth-child(2),
.qm-voice-orbit[data-state="speaking"] > i:nth-child(2) {
  animation-delay: 0.25s;
}
.qm-voice-orbit[data-state="listening"] > i:nth-child(3),
.qm-voice-orbit[data-state="speaking"] > i:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes qm-orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes qm-pulse {
  0% {
    opacity: 0.75;
    transform: scale(0.86);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.qm-voice-status {
  grid-area: voice-status;
  min-height: 55px;
  display: grid;
  gap: 4px;
}
.qm-voice-status strong {
  font-size: 15px;
}
.qm-voice-status span {
  color: var(--qm-muted);
  font-size: 11px;
  line-height: 1.5;
}
.qm-voice-button,
.qm-stop-button {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  border: 1px solid rgba(101, 215, 186, 0.48);
  color: #eafff9;
  background: var(--qm-signal-deep);
  font-weight: 700;
}
.qm-voice-button {
  grid-area: voice-start;
  padding-inline: 6px;
  gap: 5px;
  font-size: 11px;
}
.qm-stop-button {
  grid-area: voice-stop;
  border-color: var(--qm-line);
  color: var(--qm-muted);
  background: rgba(255, 255, 255, 0.025);
}
.qm-voice-button svg,
.qm-stop-button svg {
  width: 19px;
  height: 19px;
}
.qm-voice-button:disabled,
.qm-stop-button:disabled,
.qm-send-button:disabled,
.qm-primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.qm-voice-note {
  grid-area: voice-note;
  min-height: 0;
  margin-top: 0;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  border: 1px solid var(--qm-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
}

.qm-mobile-dock {
  display: none;
}

.qm-app[data-interaction-state="thinking"] .qm-interrogation {
  border-color: rgba(228, 162, 70, 0.24);
  box-shadow:
    0 18px 50px rgba(0, 5, 8, 0.3),
    inset 0 0 70px rgba(133, 79, 28, 0.035);
}

.qm-app[data-interaction-state="thinking"] .qm-caption-suspect {
  background: linear-gradient(
    100deg,
    rgba(228, 162, 70, 0.04) 20%,
    rgba(228, 162, 70, 0.12) 45%,
    rgba(228, 162, 70, 0.04) 70%
  );
  background-size: 220% 100%;
  animation: qm-thinking-scan 1.4s linear infinite;
}

.qm-app[data-voice-state="listening"] .qm-interrogation::before {
  background: var(--qm-signal);
  box-shadow: 0 0 22px rgba(101, 215, 186, 0.72);
}

.qm-app[data-voice-state="speaking"] .qm-interrogation::before {
  background: var(--qm-amber);
  box-shadow: 0 0 22px rgba(228, 162, 70, 0.72);
}

@keyframes qm-thinking-scan {
  to {
    background-position: -220% 0;
  }
}
.qm-voice-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--qm-signal);
}
.qm-voice-note p {
  margin: 0;
  color: var(--qm-muted);
  font-size: 10px;
  line-height: 1.65;
}

.qm-loading {
  position: fixed;
  z-index: 60;
  inset: 72px 0 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 17px;
  color: var(--qm-muted);
  background:
    linear-gradient(rgba(101, 215, 186, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 215, 186, 0.02) 1px, transparent 1px),
    var(--qm-bg);
  background-size: 56px 56px;
}

.qm-loading > span {
  display: flex;
  gap: 8px;
}
.qm-loading i {
  width: 30px;
  height: 3px;
  background: var(--qm-signal);
  animation: qm-loader 1s ease-in-out infinite;
}
.qm-loading i:nth-child(2) {
  animation-delay: 0.15s;
}
.qm-loading i:nth-child(3) {
  animation-delay: 0.3s;
}
.qm-loading p {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
}

@keyframes qm-loader {
  0%,
  100% {
    opacity: 0.18;
    transform: scaleX(0.5);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

.qm-toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 48px));
  min-height: 50px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(228, 162, 70, 0.38);
  border-radius: 3px;
  color: var(--qm-text);
  background: #151b1f;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  animation: qm-toast-in 0.28s ease both;
}

@keyframes qm-toast-in {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
}
.qm-toast[data-type="error"] {
  border-color: rgba(219, 109, 109, 0.5);
}
.qm-toast svg {
  width: 19px;
  height: 19px;
  color: var(--qm-amber-bright);
}
.qm-toast[data-type="error"] svg {
  color: var(--qm-danger);
}
.qm-toast span {
  font-size: 12px;
  line-height: 1.5;
}

.qm-dialog-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(1, 4, 6, 0.82);
  backdrop-filter: blur(14px);
}
.qm-dialog {
  position: relative;
  width: min(450px, 100%);
  padding: 29px;
  border: 1px solid rgba(228, 162, 70, 0.34);
  border-radius: 4px;
  outline: 0;
  background: linear-gradient(150deg, #131b20, #090f13);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.64);
  animation: qm-dialog-in 0.28s cubic-bezier(0.2, 0.78, 0.22, 1) both;
}
.qm-dialog::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  width: 78px;
  height: 2px;
  background: var(--qm-amber);
}
.qm-dialog h2 {
  margin: 10px 0 11px;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.qm-dialog p {
  margin: 0;
  color: var(--qm-muted);
  line-height: 1.7;
}
.qm-dialog > div {
  margin-top: 23px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.qm-dialog > div > button {
  flex: 1 1 170px;
}

@keyframes qm-dialog-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
}

.qm-app :focus-visible {
  outline: 2px solid var(--qm-signal);
  outline-offset: 3px;
}

@media (hover: hover) {
  .qm-icon-button:hover {
    color: var(--qm-text);
    border-color: rgba(101, 215, 186, 0.4);
    background: rgba(101, 215, 186, 0.06);
    transform: translateX(-2px);
  }
  .qm-primary-button:hover {
    background: var(--qm-amber-bright);
    box-shadow:
      0 13px 36px rgba(154, 91, 28, 0.26),
      inset 0 1px rgba(255, 255, 255, 0.34);
    transform: translateY(-2px);
  }
  .qm-secondary-button:hover {
    color: #fff;
    border-color: rgba(101, 215, 186, 0.4);
    background: rgba(101, 215, 186, 0.065);
    transform: translateY(-2px);
  }
  .qm-clue-button:not(:disabled):hover {
    border-color: rgba(101, 215, 186, 0.42);
    background: rgba(101, 215, 186, 0.055);
    transform: translateX(3px);
  }
  .qm-session-actions button:hover {
    color: var(--qm-text);
    border-color: rgba(101, 215, 186, 0.34);
    background: rgba(101, 215, 186, 0.05);
  }
  .qm-turn:nth-last-child(n + 3):hover > * {
    opacity: 0.9;
  }
  .qm-voice-button:not(:disabled):hover,
  .qm-send-button:not(:disabled):hover {
    border-color: var(--qm-signal);
    background: #1c6153;
    box-shadow: 0 9px 28px rgba(22, 79, 68, 0.26);
    transform: translateY(-1px);
  }
  .qm-stop-button:not(:disabled):hover {
    color: var(--qm-text);
    border-color: var(--qm-line-strong);
    background: rgba(255, 255, 255, 0.055);
  }
}

.qm-primary-button:active,
.qm-secondary-button:active,
.qm-icon-button:active,
.qm-voice-button:active,
.qm-stop-button:active,
.qm-send-button:active,
.qm-clue-button:not(:disabled):active {
  transform: scale(0.98);
}

@media (max-width: 1279px) {
  .qm-game {
    grid-template-columns: minmax(235px, 270px) minmax(0, 1fr);
    grid-template-areas:
      "evidence interrogation"
      "voice interrogation";
  }
}

@media (max-width: 1040px) {
  .qm-topbar-case {
    display: none;
  }
  .qm-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .qm-welcome {
    grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
    gap: 34px;
  }
  .qm-welcome h1 {
    font-size: clamp(50px, 6.4vw, 70px);
  }
  .qm-art-frame {
    min-height: clamp(350px, 48vw, 500px);
  }
  .qm-suspect-header {
    grid-template-columns: 52px minmax(0, 1fr) minmax(145px, 190px);
  }
  .qm-session-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .qm-session-actions button {
    min-height: 44px;
  }
}

@media (max-width: 899px) {
  .qm-welcome {
    width: min(720px, 100%);
    grid-template-columns: 1fr;
    padding-top: 30px;
    gap: 38px;
  }
  .qm-welcome-copy {
    max-width: none;
  }
  .qm-welcome h1 {
    font-size: clamp(52px, 10vw, 76px);
  }
  .qm-art-frame {
    min-height: clamp(330px, 66vw, 490px);
  }
  .qm-game {
    height: calc(100dvh - 72px);
    min-height: 0;
    display: block;
    padding: 10px;
    overflow: hidden;
  }
  .qm-evidence-panel,
  .qm-interrogation,
  .qm-voice-panel {
    width: 100%;
    height: calc(100dvh - 152px);
    min-height: 0;
  }
  .qm-game > .qm-evidence-panel,
  .qm-game > .qm-interrogation,
  .qm-game > .qm-voice-panel {
    display: none;
  }
  .qm-game[data-mobile-view="interrogation"] > .qm-interrogation {
    display: flex;
  }
  .qm-game[data-mobile-view="evidence"] > .qm-evidence-panel {
    display: block;
  }
  .qm-game[data-mobile-view="voice"] > .qm-voice-panel {
    display: grid;
  }
  .qm-transcript {
    min-height: 0;
    max-height: none;
  }
  .qm-mobile-dock {
    position: fixed;
    z-index: 38;
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(520px, calc(100% - 20px));
    min-height: 64px;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid var(--qm-line-strong);
    border-radius: 7px;
    background: rgba(5, 10, 14, 0.94);
    box-shadow:
      0 14px 38px rgba(0, 3, 6, 0.54),
      inset 0 1px rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(22px) saturate(130%);
    transform: translateX(-50%);
  }
  .qm-game:not([hidden]) > .qm-mobile-dock {
    opacity: 1;
    animation: none;
  }
  .qm-mobile-dock button {
    position: relative;
    min-width: 0;
    min-height: 52px;
    padding: 5px 8px;
    display: grid;
    grid-template-columns: 22px auto;
    grid-template-rows: auto auto;
    place-content: center;
    column-gap: 7px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--qm-dim);
    background: transparent;
  }
  .qm-mobile-dock button[aria-pressed="true"] {
    color: var(--qm-text);
    border-color: rgba(101, 215, 186, 0.24);
    background: rgba(101, 215, 186, 0.08);
    box-shadow: inset 0 -2px var(--qm-signal);
  }
  .qm-mobile-dock svg {
    grid-row: 1 / 3;
    width: 20px;
    height: 20px;
    align-self: center;
  }
  .qm-mobile-dock span {
    font-size: 11px;
    font-weight: 700;
  }
  .qm-mobile-dock small {
    color: var(--qm-dim);
    font-family: ui-monospace, monospace;
    font-size: 8px;
  }
  .qm-mobile-dock button[aria-pressed="true"] small {
    color: var(--qm-signal);
  }
  .qm-toast {
    bottom: max(80px, calc(72px + env(safe-area-inset-bottom)));
  }
  .qm-app[data-voice-state="connecting"]
    .qm-mobile-dock
    [data-qm-view="voice"]
    small,
  .qm-app[data-voice-state="listening"]
    .qm-mobile-dock
    [data-qm-view="voice"]
    small {
    color: var(--qm-signal);
  }
  .qm-app[data-voice-state="speaking"]
    .qm-mobile-dock
    [data-qm-view="voice"]
    small {
    color: var(--qm-amber-bright);
  }
}

@media (max-width: 640px) {
  .qm-topbar {
    min-height: 64px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .qm-shell {
    min-height: calc(100dvh - 64px);
  }
  .qm-icon-button {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }
  .qm-icon-button span {
    display: none;
  }
  .qm-brand {
    justify-content: flex-start;
  }
  .qm-brand img {
    width: 78px;
  }
  .qm-brand span {
    display: none;
  }
  .qm-case-state {
    min-height: 36px;
    padding: 0 9px;
    font-size: 10px;
  }
  .qm-welcome {
    min-height: calc(100dvh - 64px);
    padding: 18px 14px max(50px, calc(26px + env(safe-area-inset-bottom)));
    gap: 30px;
  }
  .qm-welcome::before {
    display: none;
  }
  .qm-welcome-art {
    padding: 8px 8px 76px;
    border-radius: 3px 16px 3px 3px;
  }
  .qm-art-frame {
    min-height: clamp(235px, 72vw, 330px);
  }
  .qm-art-reticle {
    inset: 13px;
  }
  .qm-art-status {
    top: 18px;
    left: 18px;
    right: 18px;
    font-size: 8px;
  }
  .qm-welcome-art figcaption {
    left: 19px;
    right: 79px;
    bottom: 17px;
  }
  .qm-case-seal {
    right: 17px;
    bottom: 15px;
    width: 48px;
    height: 48px;
  }
  .qm-welcome h1 {
    margin: 18px 0 17px;
    font-size: clamp(43px, 13vw, 58px);
    line-height: 0.98;
  }
  .qm-welcome-lede {
    font-size: 14px;
    line-height: 1.72;
  }
  .qm-case-metrics {
    margin-top: 22px;
  }
  .qm-case-metrics > div {
    padding: 0 9px;
  }
  .qm-case-metrics span {
    font-size: 9px;
  }
  .qm-case-metrics strong {
    font-size: 11px;
  }
  .qm-gameplay-loop {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 19px 0 23px;
  }
  .qm-gameplay-loop li {
    align-items: center;
  }
  .qm-gameplay-loop p {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .qm-gameplay-loop small {
    margin-top: 0;
  }
  .qm-welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .qm-welcome-actions > button {
    min-height: 50px;
    width: 100%;
  }
  .qm-fallback-note {
    line-height: 1.5;
  }
  .qm-game {
    height: calc(100dvh - 64px);
    min-height: calc(100dvh - 64px);
    padding: 8px;
    gap: 8px;
  }
  .qm-evidence-panel,
  .qm-voice-panel {
    padding: 17px;
  }
  .qm-evidence-panel h2,
  .qm-voice-panel h2 {
    font-size: 21px;
  }
  .qm-interrogation {
    height: calc(100dvh - 144px);
    min-height: 0;
    max-height: none;
  }
  .qm-evidence-panel,
  .qm-voice-panel {
    height: calc(100dvh - 144px);
  }
  .qm-suspect-header {
    grid-template-columns: 48px minmax(0, 1fr) minmax(88px, 104px);
    padding: 13px;
  }
  .qm-suspect-avatar {
    width: 48px;
    height: 48px;
  }
  .qm-session-actions {
    grid-column: 1 / -1;
  }
  .qm-pressure {
    grid-column: auto;
  }
  .qm-session-actions button {
    min-height: 44px;
  }
  .qm-live-captions {
    grid-template-columns: 1fr;
  }
  .qm-caption {
    min-height: 57px;
  }
  .qm-caption-player {
    min-height: 0;
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .qm-focus-objective {
    padding: 9px 12px;
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .qm-focus-objective::after {
    display: none;
  }
  .qm-focus-objective span {
    font-size: 8px;
  }
  .qm-focus-objective p {
    font-size: 13px;
    line-height: 1.45;
  }
  .qm-history-head {
    display: none;
  }
  .qm-transcript {
    min-height: 96px;
    max-height: none;
    padding: 14px 12px;
  }
  .qm-turn {
    max-width: 92%;
  }
  .qm-composer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .qm-composer-heading {
    min-height: 22px;
    flex-wrap: wrap;
  }
  .qm-composer > p {
    display: none;
  }
  .qm-selected-clue {
    order: 3;
    max-width: 100%;
  }
  .qm-composer-input {
    grid-template-columns: minmax(0, 1fr) 92px;
  }
  .qm-composer textarea {
    min-height: 66px;
  }
  .qm-send-button {
    min-width: 92px;
    min-height: 66px;
    padding: 0 9px;
    width: 100%;
  }
  .qm-voice-panel {
    display: block;
    overflow-y: auto;
    text-align: center;
  }
  .qm-game[data-mobile-view="voice"] > .qm-voice-panel {
    display: block;
  }
  .qm-voice-panel header {
    text-align: left;
  }
  .qm-voice-orbit {
    width: 142px;
    height: 142px;
    margin: 28px auto 18px;
  }
  .qm-voice-button,
  .qm-stop-button {
    min-height: 48px;
    margin-top: 12px;
  }
  .qm-voice-note {
    min-height: 0;
    margin-top: 15px;
  }
  .qm-mobile-dock {
    width: calc(100% - 16px);
    bottom: max(6px, env(safe-area-inset-bottom));
  }
  .qm-primary-button,
  .qm-secondary-button,
  .qm-clue-button,
  .qm-dialog button {
    min-height: 44px;
  }
  .qm-toast {
    left: 12px;
    right: 12px;
    bottom: max(80px, calc(72px + env(safe-area-inset-bottom)));
    width: auto;
  }
  .qm-dialog-backdrop {
    padding: 14px;
  }
  .qm-dialog {
    padding: 23px 19px;
  }
  .qm-dialog > div {
    display: grid;
    grid-template-columns: 1fr;
  }
  .qm-loading {
    inset: 64px 0 0;
  }
}

@media (max-width: 380px) {
  .qm-case-state span {
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .qm-case-metrics {
    grid-template-columns: 1fr 1fr;
    row-gap: 12px;
  }
  .qm-case-metrics > div:nth-child(3) {
    grid-column: 1 / -1;
    padding: 11px 0 0;
    border-top: 1px solid var(--qm-line);
    border-left: 0;
  }
  .qm-gameplay-loop p {
    display: block;
  }
  .qm-transcript {
    min-height: 80px;
  }
  .qm-composer-input {
    grid-template-columns: minmax(0, 1fr) 84px;
  }
  .qm-send-button {
    min-width: 84px;
    min-height: 66px;
    padding: 0 8px;
  }
  .qm-welcome-art figcaption small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qm-app *,
  .qm-app *::before,
  .qm-app *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
