:root {
  --ink: #e8ddd0;
  --muted: #988f86;
  --faint: #5f5b57;
  --black: #090a0b;
  --panel: #141618;
  --panel-raised: #1a1c1e;
  --concrete: #343332;
  --concrete-dark: #1f2020;
  --red: #a62924;
  --red-bright: #e24b37;
  --red-deep: #4b1617;
  --brass: #ad8b63;
  --green: #7ea487;
  --yellow: #c9a85b;
  --danger: #dd5442;
  --line: rgba(217, 200, 180, 0.14);
  --scrollbar-track: #0d0f10;
  --scrollbar-track-hover: #17191a;
  --scrollbar-thumb: #8f6d47;
  --scrollbar-thumb-hover: #d2aa68;
  --scrollbar-thumb-border: #191b1c;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
  font-family: "Arial Narrow", "Roboto Condensed", "Inter", Arial, sans-serif;
  color: var(--ink);
  background: var(--black);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--black);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(135, 36, 30, 0.18), transparent 42rem),
    linear-gradient(135deg, #0b0c0d 0%, #171717 50%, #0b0c0d 100%);
  color: var(--ink);
  letter-spacing: 0.025em;
}

/* Keep every game surface, including modal and dossier scroll containers,
 * inside the same dark charcoal / red / brass visual language. The explicit
 * height also covers horizontal overflow without relying on system defaults. */
body,
.overlay,
.inspection-overlay,
.inspection-modal,
.inspection-visual,
.inspection-visual.dossier-visual,
.rs-dossier-view {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border: 1px solid rgba(166, 41, 36, 0.2);
}

*::-webkit-scrollbar-track:hover {
  background: var(--scrollbar-track-hover);
}

*::-webkit-scrollbar-thumb {
  min-height: 34px;
  border: 3px solid var(--scrollbar-thumb-border);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--scrollbar-thumb), #6f5136);
  box-shadow: inset 0 0 0 1px rgba(226, 195, 143, 0.28);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), #a62924);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 180, 0.5);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.58'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 76px;
  padding: 14px clamp(16px, 3vw, 48px);
  border-bottom: 1px solid rgba(221, 202, 177, 0.12);
  background: rgba(9, 10, 11, 0.96);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.3);
}

.brand-lockup,
.protocol-status,
.header-metrics,
.metric,
.desk-status,
.briefing-strip,
.footer-bar {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(198, 145, 94, 0.78);
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #ead4b7;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.12em;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.brand-name,
.brand-subtitle,
.metric-label,
.panel-kicker,
.scene-line,
.footer-bar,
.wall-slogan,
.service-rail,
.entry-frame-label,
.queue-screen-label,
.queue-caption,
.desk-topline,
.desk-instruction,
.visitor-nameplate small,
.arrival-badge,
.case-progress,
.decision-state,
.log-marker,
.tool-button small,
.decision-button small {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-name {
  margin: 0 0 3px;
  color: #f0e1cd;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.21em;
}

.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.protocol-status {
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

#runSeed {
  color: #806f5e;
  font-family: "Courier New", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.status-light {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(126, 164, 135, 0.75);
}

.status-divider {
  width: 1px;
  height: 13px;
  background: var(--line);
}

.audio-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.15em;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
}

.audio-toggle:hover {
  border-color: var(--red-bright);
  color: var(--red-bright);
}

.audio-toggle[aria-pressed="true"] {
  color: var(--red-bright);
  border-color: var(--red-bright);
}

.header-metrics {
  gap: 18px;
}

.metric {
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 122px;
}

.metric-label {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.metric strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.meter {
  width: 100%;
  height: 4px;
  overflow: hidden;
  background: #292a2a;
}

.meter span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--brass);
  transition: width 350ms ease, background 350ms ease;
}

.metric-career .meter span {
  background: var(--red-bright);
}

.embassy-wall {
  position: relative;
  display: grid;
  min-height: 282px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #161717;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(255, 255, 255, 0.025) 8.1% 8.3%, transparent 8.4% 91.6%, rgba(255, 255, 255, 0.025) 91.7% 91.9%, transparent 92%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 103px),
    linear-gradient(180deg, #454441, #282827 76%, #151616);
  box-shadow: inset 0 -35px 50px rgba(0, 0, 0, 0.48);
}

.embassy-wall::after {
  position: absolute;
  right: 8%;
  bottom: 0;
  left: 8%;
  height: 1px;
  background: rgba(190, 160, 123, 0.24);
  content: "";
}

.wall-column {
  position: absolute;
  top: -4%;
  bottom: -7%;
  width: 9.5%;
  border: 1px solid rgba(0, 0, 0, 0.23);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 20% 75%, rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 3px, transparent 3px 11px),
    #333331;
  box-shadow: inset 11px 0 17px rgba(0, 0, 0, 0.25), inset -11px 0 17px rgba(0, 0, 0, 0.24);
}

.wall-column-left {
  left: 4%;
}

.wall-column-right {
  right: 4%;
}

.monument-flag {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(390px, 45vw);
  min-height: 236px;
  place-items: center;
  align-content: center;
  padding: 24px;
  border-left: 1px solid rgba(235, 177, 136, 0.18);
  border-right: 1px solid rgba(235, 177, 136, 0.18);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 18% 82%, rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 12px),
    linear-gradient(150deg, #611a1b, #9b2c28 46%, #5c191a);
  box-shadow: 0 17px 30px rgba(0, 0, 0, 0.33);
  animation: flag-wave 8s ease-in-out infinite;
}

.monument-flag::before,
.monument-flag::after {
  position: absolute;
  width: 100%;
  height: 1px;
  background: rgba(237, 195, 145, 0.25);
  content: "";
}

.monument-flag::before {
  top: 18px;
}

.monument-flag::after {
  bottom: 18px;
}

.flag-star {
  margin-bottom: 5px;
  color: #e8c69a;
  font-size: 20px;
}

.veskar-seal,
.overlay-emblem {
  display: grid;
  place-items: center;
  border: 2px solid #dfba85;
  border-radius: 50%;
  color: #e2bd88;
}

.veskar-seal {
  position: relative;
  width: 81px;
  height: 81px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 7px rgba(92, 25, 26, 0.55), inset 0 0 0 9px #dfba85;
}

.veskar-seal::before,
.veskar-seal::after {
  position: absolute;
  background: #dfba85;
  content: "";
}

.veskar-seal::before {
  width: 62%;
  height: 2px;
}

.veskar-seal::after {
  width: 2px;
  height: 62%;
}

.veskar-seal span {
  z-index: 1;
  font-size: 31px;
  font-weight: 900;
}

.flag-country {
  color: #ead0a8;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}

.flag-caption {
  margin-top: 6px;
  color: #d9b989;
  font-size: 10px;
  letter-spacing: 0.26em;
}

.wall-slogan {
  position: absolute;
  z-index: 1;
  display: grid;
  gap: 6px;
  width: 126px;
  padding: 17px 12px;
  border-top: 1px solid rgba(211, 157, 111, 0.32);
  border-bottom: 1px solid rgba(211, 157, 111, 0.32);
  background: rgba(88, 22, 22, 0.78);
  color: #d1aa7a;
  text-align: center;
  line-height: 1.15;
}

.wall-slogan-left {
  left: 17%;
}

.wall-slogan-right {
  right: 17%;
}

.wall-light {
  position: absolute;
  top: 15px;
  width: 170px;
  height: 3px;
  background: var(--red-bright);
  box-shadow: 0 0 16px rgba(226, 75, 55, 0.9);
  transform: skewX(-28deg);
}

.wall-light-one {
  left: 0;
}

.wall-light-two {
  right: 0;
}

.service-rail {
  position: absolute;
  right: 11%;
  bottom: 22px;
  left: 11%;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(209, 167, 118, 0.32);
  background: rgba(12, 13, 13, 0.83);
  color: #c3a17b;
}

.service-rail span {
  flex: 1;
  padding: 9px 8px;
  border-right: 1px solid rgba(209, 167, 118, 0.22);
  text-align: center;
  white-space: nowrap;
}

.service-rail span:last-child {
  border-right: 0;
}

.checkpoint-scene {
  position: relative;
  padding: 0 clamp(16px, 4vw, 64px);
  background:
    linear-gradient(180deg, #101111, #181919 60%, #111212),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 82px);
  box-shadow: inset 0 32px 45px rgba(0, 0, 0, 0.48);
}

.scene-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1500px;
  margin: 0 auto;
  padding: 13px 0 11px;
  color: var(--muted);
}

.scene-line span:last-child {
  color: #c4a981;
}

.scene-floor {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(250px, 1fr) minmax(300px, 1.35fr);
  align-items: end;
  gap: clamp(12px, 2.5vw, 48px);
  max-width: 1500px;
  min-height: 265px;
  margin: 0 auto;
  padding: 23px 0 0;
  border-top: 1px solid rgba(196, 169, 129, 0.16);
  background:
    linear-gradient(165deg, transparent 0 70%, rgba(206, 198, 178, 0.06) 70.1% 70.4%, transparent 70.5%),
    linear-gradient(15deg, transparent 0 70%, rgba(206, 198, 178, 0.05) 70.1% 70.4%, transparent 70.5%);
}

.queue-glimpse {
  align-self: center;
  justify-self: start;
  width: min(145px, 100%);
  padding: 13px;
  border: 1px solid #363333;
  background: #0e1010;
  box-shadow: var(--shadow);
}

.queue-screen {
  display: grid;
  gap: 4px;
  padding: 12px 10px;
  border: 1px solid rgba(202, 64, 47, 0.55);
  background: #1a1010;
  color: #c94c3c;
  text-align: center;
}

.queue-screen-label {
  color: var(--muted);
  font-size: 8px;
}

.queue-screen strong {
  color: #ed5a44;
  font-family: "Courier New", monospace;
  font-size: 27px;
  letter-spacing: 0.08em;
}

.queue-screen span:last-child {
  color: #9b5a4f;
  font-family: "Courier New", monospace;
  font-size: 11px;
}

.queue-caption {
  margin-top: 11px;
  color: #706d67;
  font-size: 8px;
  text-align: center;
}

.visitor-stage {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  min-height: 230px;
}

.entry-frame {
  position: absolute;
  top: 0;
  width: min(160px, 70%);
  height: 207px;
  border: 3px solid #4c4d4b;
  border-bottom: 0;
  box-shadow: inset 10px 0 0 #252626, inset -10px 0 0 #252626;
}

.entry-frame::before,
.entry-frame::after {
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--red);
  box-shadow: 0 0 9px rgba(210, 56, 42, 0.55);
  content: "";
}

.entry-frame::before {
  left: -3px;
}

.entry-frame::after {
  right: -3px;
}

.entry-frame-label,
.entry-frame-mark {
  position: absolute;
  color: #6f6d68;
  font-size: 7px;
  letter-spacing: 0.11em;
  white-space: nowrap;
}

.entry-frame-label {
  top: 10px;
  left: 13px;
  writing-mode: vertical-rl;
}

.entry-frame-mark {
  right: 10px;
  bottom: 9px;
}

.visitor-portrait {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 206px;
  margin-top: 22px;
  filter: drop-shadow(0 10px 9px rgba(0, 0, 0, 0.55));
  animation: visitor-enter 550ms ease both;
}

.portrait-head {
  position: absolute;
  top: 23px;
  left: 30px;
  width: 43px;
  height: 50px;
  border-radius: 48% 48% 45% 45%;
  background: #b98d72;
  box-shadow: inset -8px -3px 0 rgba(62, 34, 31, 0.22);
}

.portrait-head::before,
.portrait-head::after {
  position: absolute;
  top: 24px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2b2321;
  content: "";
}

.portrait-head::before {
  left: 11px;
}

.portrait-head::after {
  right: 11px;
}

.portrait-head span {
  position: absolute;
  top: -5px;
  left: -4px;
  width: 51px;
  height: 25px;
  border-radius: 50% 50% 15% 15%;
  background: #2e2928;
}

.portrait-body {
  position: absolute;
  bottom: 0;
  left: 8px;
  width: 88px;
  height: 128px;
  border-radius: 45px 45px 8px 8px;
  background: #202529;
  box-shadow: inset 19px 0 0 rgba(255, 255, 255, 0.035), inset -13px 0 0 rgba(0, 0, 0, 0.24);
}

.portrait-body::before {
  position: absolute;
  top: 25px;
  left: 41px;
  width: 7px;
  height: 86px;
  background: #a58a62;
  box-shadow: 0 15px 0 #a58a62;
  content: "";
  opacity: 0.75;
}

.visitor-portrait[data-look="soldier"] .portrait-head span,
.visitor-portrait[data-look="official"] .portrait-head span {
  top: -11px;
  left: -8px;
  width: 59px;
  height: 27px;
  border-radius: 3px 3px 15px 15px;
  background: #181a1b;
}

.visitor-portrait[data-look="soldier"] .portrait-body {
  background: #242923;
  border-top: 6px solid #9e3028;
}

.visitor-portrait[data-look="soldier"] .portrait-body::after {
  position: absolute;
  top: 24px;
  right: 10px;
  width: 15px;
  height: 22px;
  border: 1px solid #b78a5b;
  content: "";
}

.visitor-portrait[data-look="official"] .portrait-body {
  background: #29282a;
  border-top: 6px solid #8e2927;
}

.visitor-portrait[data-look="worker"] .portrait-body {
  background: #45433c;
}

.visitor-portrait[data-look="anomaly"] {
  filter: drop-shadow(0 0 10px rgba(220, 61, 46, 0.38));
}

.visitor-portrait[data-look="anomaly"] .portrait-head {
  background: #99826e;
  box-shadow: 9px 0 0 rgba(180, 91, 73, 0.28), inset -8px -3px 0 rgba(62, 34, 31, 0.22);
}

.visitor-portrait[data-look="anomaly"] .portrait-body::after {
  position: absolute;
  top: 0;
  left: 18px;
  width: 51px;
  height: 120px;
  border-right: 1px solid rgba(232, 84, 62, 0.7);
  border-left: 1px solid rgba(232, 84, 62, 0.7);
  content: "";
  opacity: 0.75;
}

.visitor-nameplate {
  position: absolute;
  z-index: 4;
  bottom: -6px;
  display: grid;
  min-width: 195px;
  padding: 8px 12px;
  border: 1px solid rgba(199, 165, 121, 0.33);
  background: rgba(11, 12, 12, 0.91);
  text-align: center;
}

.visitor-nameplate span {
  color: #e3c59e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.visitor-nameplate small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.security-desk {
  position: relative;
  z-index: 3;
  min-height: 210px;
  align-self: end;
  border: 1px solid rgba(171, 134, 99, 0.4);
  background: linear-gradient(145deg, #16191a, #0a0b0c 82%);
  box-shadow: var(--shadow);
}

.desk-topline {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid #332b28;
  color: #b99976;
}

.desk-panel {
  display: grid;
  min-height: 154px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 18px;
}

.desk-emblem {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #b07d56;
  border-radius: 50%;
  color: #c38e62;
  font-size: 23px;
  font-weight: 900;
  box-shadow: inset 0 0 0 4px #171718;
}

.desk-instruction {
  color: #cfad84;
  font-size: 9px;
}

.desk-status {
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.desk-edge {
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 4px;
  background: var(--red);
  box-shadow: 0 0 11px rgba(220, 61, 46, 0.5);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(350px, 1.25fr) minmax(260px, 0.82fr);
  gap: 12px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 15px clamp(16px, 4vw, 64px) 22px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(31, 32, 32, 0.95), rgba(15, 16, 17, 0.98));
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.24);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 16px 17px 13px;
  border-bottom: 1px solid var(--line);
}

.compact-heading {
  min-height: 68px;
}

.panel-heading-status {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: max-content;
}

.case-progress {
  color: #9c8b79;
  font-size: 8px;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.panel-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--brass);
  font-size: 8px;
}

.panel h2 {
  margin: 0;
  color: #e9dbc8;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.arrival-badge,
.decision-state {
  padding: 6px 8px;
  border: 1px solid rgba(178, 140, 102, 0.35);
  color: #be9a72;
  font-size: 8px;
  white-space: nowrap;
}

.arrival-badge.clearance {
  border-color: rgba(133, 163, 137, 0.54);
  color: #9bc09e;
}

.arrival-badge.emergency {
  border-color: rgba(208, 165, 81, 0.64);
  color: #dec176;
}

.arrival-badge.alert {
  border-color: rgba(219, 77, 58, 0.6);
  color: #e76b57;
}

.case-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 14px 17px;
  color: #b7b0a6;
  font-family: "Courier New", monospace;
  font-size: 10px;
  line-height: 1.55;
}

.case-meta .meta-row {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.case-meta .meta-label {
  color: #77726c;
  font-family: var(--font, "Arial Narrow", Arial, sans-serif);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-meta .meta-value {
  overflow: hidden;
  color: #d5cabb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-purpose {
  margin: 0 17px 12px;
  padding: 10px 11px;
  border-left: 2px solid var(--red);
  background: rgba(86, 30, 28, 0.18);
  color: #d0c0ad;
  font-size: 12px;
  line-height: 1.45;
}

.case-rule {
  margin: 0 17px 12px;
  padding: 8px 10px;
  border: 1px solid rgba(196, 165, 116, 0.2);
  background: rgba(196, 165, 116, 0.055);
  color: #a99b8b;
  font-family: "Courier New", monospace;
  font-size: 9px;
  line-height: 1.45;
}

.case-rule::first-line {
  color: #d0ad73;
}

.evidence-list {
  display: grid;
  gap: 7px;
  padding: 0 17px 15px;
}

.evidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px;
  border: 1px solid rgba(211, 192, 166, 0.1);
  background: rgba(0, 0, 0, 0.16);
  color: #8f8982;
  font-size: 10px;
}

.evidence-row strong {
  color: #b7aa99;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.evidence-row strong.pending {
  color: #696662;
}

.evidence-row strong.match,
.evidence-row strong.clear {
  color: #9dc29e;
}

.evidence-row strong.alert,
.evidence-row strong.mismatch {
  color: #e27962;
}

.evidence-row strong.review {
  color: #d9b96d;
}

.question-card {
  margin: 0 17px 15px;
  padding: 11px 12px;
  border: 1px solid rgba(196, 165, 116, 0.25);
  background: rgba(141, 91, 39, 0.1);
}

.question-card p {
  margin: 5px 0 0;
  color: #c9bcae;
  font-size: 11px;
  line-height: 1.45;
}

.question-card .quoted {
  padding-left: 9px;
  border-left: 2px solid var(--brass);
  color: #e3cfb5;
  font-style: italic;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.tool-button,
.decision-button,
.primary-button,
.footer-help {
  cursor: pointer;
  border: 1px solid rgba(182, 145, 106, 0.28);
  color: #c8b092;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tool-button {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 60px;
  padding: 8px;
  background: #1b1c1c;
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.tool-button:not(:disabled):hover,
.tool-button.revealed {
  border-color: rgba(219, 75, 56, 0.8);
  background: #2a1918;
  color: #f0c6a0;
}

.tool-button:disabled,
.decision-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.tool-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--brass);
  font-size: 13px;
  line-height: 1;
}

.tool-sprite {
  padding: 0;
  object-fit: cover;
  filter: saturate(0.75) contrast(1.1);
}

#toolIdSprite,
#idShortcutSprite {
  object-position: center top;
}

.tool-button small {
  display: block;
  margin-top: 4px;
  color: #77736d;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.inspection-output {
  display: flex;
  min-height: 215px;
  flex-direction: column;
  justify-content: flex-start;
  padding: 15px;
}

.empty-state {
  display: grid;
  flex: 1;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 180px;
  border: 1px dashed rgba(185, 147, 104, 0.18);
  color: #77726c;
  text-align: center;
}

.empty-state p {
  max-width: 180px;
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}

.empty-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #785348;
  border-radius: 50%;
  color: #a46558;
  font-size: 16px;
}

.result-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 13px;
  border-left: 3px solid var(--brass);
  background: rgba(0, 0, 0, 0.22);
  animation: result-arrive 220ms ease both;
}

.result-card.alert {
  border-left-color: var(--danger);
  background: rgba(126, 34, 28, 0.15);
}

.result-card.clear {
  border-left-color: var(--green);
}

.result-card h3,
.result-card p {
  margin: 0;
}

.result-card h3 {
  color: #dfc7a5;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-card p {
  color: #bdb3a8;
  font-size: 11px;
  line-height: 1.52;
}

.result-card .result-code {
  color: #7d7770;
  font-family: "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.xray-box {
  position: relative;
  display: grid;
  min-height: 82px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(142, 182, 179, 0.35);
  background: radial-gradient(ellipse, #3f5956, #1d2b2b 68%, #101919);
  color: #b1d5c8;
  font-family: "Courier New", monospace;
  font-size: 10px;
  text-align: center;
}

.xray-box::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10%;
  width: 5px;
  background: rgba(219, 255, 220, 0.88);
  box-shadow: 0 0 17px rgba(209, 255, 225, 0.85);
  content: "";
  opacity: 0;
}

.xray-box.scanning::before {
  animation: xray-sweep 650ms ease-in-out;
}

.inspection-log {
  display: flex;
  gap: 9px;
  min-height: 36px;
  align-items: center;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: #827c75;
  font-family: "Courier New", monospace;
  font-size: 9px;
}

.log-marker {
  color: #b3785e;
  font-family: var(--font, Arial, sans-serif);
  font-size: 8px;
}

.decision-copy {
  min-height: 50px;
  margin: 0;
  padding: 14px 16px 8px;
  color: #aaa29a;
  font-size: 11px;
  line-height: 1.45;
}

.decision-progress {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 12px 10px;
  padding: 7px 9px;
  border: 1px solid rgba(192, 157, 112, 0.16);
  background: rgba(0, 0, 0, 0.16);
  color: #847a6f;
  font-family: "Courier New", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.decision-progress span:first-child {
  color: #c7a36e;
}

.decision-actions {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.decision-button {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  background: #1b1c1d;
  text-align: left;
}

.decision-button span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.decision-button small {
  color: #7b756e;
  font-size: 7px;
}

.decision-button.admit {
  border-color: rgba(133, 163, 137, 0.45);
  color: #9fc2a0;
}

.decision-button.admit:not(:disabled):hover {
  background: rgba(65, 103, 72, 0.24);
  transform: translateY(-1px);
}

.decision-button.hold,
.decision-button.call {
  border-color: rgba(190, 158, 101, 0.42);
  color: #d0ad72;
}

.decision-button.hold:not(:disabled):hover,
.decision-button.call:not(:disabled):hover {
  background: rgba(112, 82, 36, 0.23);
  transform: translateY(-1px);
}

.decision-button.deny {
  border-color: rgba(185, 78, 64, 0.48);
  color: #db8372;
}

.decision-button.deny:not(:disabled):hover {
  background: rgba(119, 36, 31, 0.25);
  transform: translateY(-1px);
}

.decision-note {
  min-height: 37px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  color: #7d7771;
  font-family: "Courier New", monospace;
  font-size: 9px;
  line-height: 1.4;
}

.footer-bar {
  justify-content: space-between;
  gap: 15px;
  padding: 0 clamp(16px, 4vw, 64px) 17px;
  color: #5e5b57;
  font-size: 8px;
}

.footer-help {
  padding: 5px 8px;
  border-color: rgba(160, 126, 93, 0.22);
  background: transparent;
  color: #8a7764;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.footer-help:hover {
  border-color: rgba(221, 176, 119, 0.6);
  color: #d4b084;
}

.overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 5, 5, 0.82);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.overlay-card {
  position: relative;
  width: min(520px, 100%);
  padding: 35px clamp(24px, 6vw, 54px) 32px;
  border: 1px solid rgba(207, 165, 118, 0.5);
  background:
    linear-gradient(90deg, rgba(144, 37, 32, 0.11), transparent 30% 70%, rgba(144, 37, 32, 0.11)),
    linear-gradient(145deg, #292827, #101111 72%);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.58);
  text-align: center;
  transform: translateY(12px) scale(0.98);
  transition: transform 260ms ease;
}

.overlay.is-open .overlay-card {
  transform: translateY(0) scale(1);
}

.overlay-card::before,
.overlay-card::after {
  position: absolute;
  top: 15px;
  bottom: 15px;
  width: 1px;
  background: rgba(205, 164, 113, 0.32);
  content: "";
}

.overlay-card::before {
  left: 15px;
}

.overlay-card::after {
  right: 15px;
}

.overlay-emblem {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  box-shadow: inset 0 0 0 5px rgba(86, 24, 24, 0.55), inset 0 0 0 7px #dfba85;
}

.overlay-emblem span {
  font-size: 23px;
  font-weight: 900;
}

.overlay-card h1 {
  margin: 0;
  color: #ebd1a9;
  font-size: clamp(32px, 8vw, 52px);
  font-weight: 900;
  letter-spacing: 0.19em;
  text-indent: 0.19em;
}

.overlay-card p {
  margin: 18px auto 24px;
  max-width: 370px;
  color: #b6ada3;
  font-size: 13px;
  line-height: 1.65;
}

.briefing-strip {
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid rgba(190, 149, 103, 0.22);
  background: rgba(0, 0, 0, 0.2);
}

.briefing-strip span {
  flex: 1;
  padding: 10px 7px;
  border-right: 1px solid rgba(190, 149, 103, 0.22);
  color: #8c8175;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.briefing-strip span:last-child {
  border-right: 0;
}

.briefing-strip b {
  display: block;
  margin-bottom: 4px;
  color: #d0a875;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-width: 180px;
  padding: 13px 18px;
  border-color: rgba(228, 75, 55, 0.72);
  background: linear-gradient(135deg, #982c27, #5c1819);
  color: #f4d6b1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.primary-button:hover {
  background: linear-gradient(135deg, #bd3b30, #731d1e);
  box-shadow: 0 0 18px rgba(190, 54, 42, 0.3);
  transform: translateY(-1px);
}

.primary-button span {
  font-size: 20px;
  line-height: 0.5;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 14px;
  border-left: 3px solid var(--red-bright);
  background: rgba(14, 15, 15, 0.95);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
  color: #d4c2af;
  font-family: "Courier New", monospace;
  font-size: 10px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.good {
  border-left-color: var(--green);
}

.toast.bad {
  border-left-color: var(--danger);
}

.stamp-hit {
  animation: stamp-hit 600ms ease both;
}

.alert-pulse {
  animation: alert-pulse 650ms ease;
}

@keyframes flag-wave {
  0%, 100% { transform: perspective(600px) rotateY(0deg); }
  50% { transform: perspective(600px) rotateY(1deg); }
}

@keyframes visitor-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes result-arrive {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes xray-sweep {
  0% { left: -10%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 105%; opacity: 0; }
}

@keyframes stamp-hit {
  0% { transform: scale(1); }
  18% { transform: scale(0.96) rotate(-1deg); }
  42% { transform: scale(1.04) rotate(0.5deg); }
  100% { transform: scale(1); }
}

@keyframes alert-pulse {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 3px rgba(215, 68, 53, 0.5), 0 0 28px rgba(215, 68, 53, 0.3); }
}

@media (max-width: 1060px) {
  .topbar {
    flex-wrap: wrap;
  }

  .protocol-status {
    order: 3;
    width: 100%;
    padding-top: 2px;
  }

  .wall-slogan-left {
    left: 7%;
  }

  .wall-slogan-right {
    right: 7%;
  }

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

  .decision-panel {
    grid-column: 1 / -1;
  }

  .decision-actions {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 12px;
    padding: 12px 15px;
  }

  .brand-lockup {
    min-width: 0;
  }

  .header-metrics {
    gap: 8px;
  }

  .metric {
    min-width: 92px;
  }

  .metric-label {
    font-size: 7px;
  }

  .wall-slogan {
    display: none;
  }

  .monument-flag {
    width: 260px;
    min-height: 230px;
  }

  .service-rail {
    right: 3%;
    left: 3%;
  }

  .service-rail span {
    overflow: hidden;
    font-size: 7px;
    text-overflow: ellipsis;
  }

  .scene-line {
    flex-direction: column;
    gap: 5px;
    font-size: 8px;
  }

  .scene-line span:last-child {
    align-self: flex-end;
  }

  .scene-floor {
    grid-template-columns: 75px 1fr;
    gap: 10px;
    min-height: 265px;
  }

  .queue-glimpse {
    width: 75px;
    padding: 7px;
  }

  .queue-screen {
    padding: 8px 4px;
  }

  .queue-screen strong {
    font-size: 18px;
  }

  .queue-caption {
    font-size: 7px;
  }

  .visitor-stage {
    min-height: 225px;
  }

  .security-desk {
    grid-column: 1 / -1;
    min-height: 130px;
  }

  .desk-panel {
    min-height: 85px;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 10px 15px;
  }

  .desk-emblem {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .workbench {
    grid-template-columns: 1fr;
    padding: 12px 15px 20px;
  }

  .decision-panel {
    grid-column: auto;
  }

  .decision-actions {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bar {
    flex-wrap: wrap;
    padding: 0 15px 15px;
  }
}

@media (max-width: 460px) {
  .brand-subtitle,
  .protocol-status span:nth-of-type(2),
  .status-divider,
  .metric-label {
    display: none;
  }

  .header-metrics {
    margin-left: auto;
  }

  .metric strong {
    font-size: 14px;
  }

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

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

  .decision-actions {
    grid-template-columns: 1fr;
  }

  .briefing-strip span {
    font-size: 7px;
  }
}

/* Single-screen checkpoint: the room stays visible while every inspection opens as a layer. */
body {
  overflow: hidden;
}

main {
  position: relative;
  height: clamp(520px, calc(100svh - 110px), 900px);
}

.embassy-wall {
  height: 100%;
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 8, 0.38), transparent 25% 75%, rgba(5, 7, 8, 0.42)),
    linear-gradient(180deg, rgba(5, 7, 8, 0.04), rgba(5, 7, 8, 0.24)),
    url("assets/generated/embassy-background.png") center / cover no-repeat;
  border-bottom: 0;
  box-shadow: inset 0 -110px 100px rgba(4, 5, 5, 0.72);
}

.embassy-wall::after,
.wall-column,
.wall-slogan,
.monument-flag,
.wall-light,
.service-rail {
  display: none;
}

.checkpoint-scene {
  position: absolute;
  z-index: 5;
  inset: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.scene-line {
  position: absolute;
  top: 0;
  right: clamp(16px, 4vw, 58px);
  left: clamp(16px, 4vw, 58px);
  z-index: 8;
  max-width: none;
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid rgba(226, 199, 160, 0.18);
  text-shadow: 0 2px 8px #000;
}

.scene-floor {
  position: absolute;
  inset: 0;
  display: block;
  max-width: none;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
}

.queue-glimpse {
  display: none;
}

.visitor-stage {
  position: absolute;
  bottom: 3%;
  left: 25%;
  display: grid;
  width: min(280px, 25vw);
  height: 66%;
  min-height: 0;
  align-items: end;
  justify-items: center;
  pointer-events: auto;
}

.entry-frame {
  display: none;
}

.visitor-portrait {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 18px 13px rgba(0, 0, 0, 0.7));
  animation: visitor-enter 550ms ease both;
}

.visitor-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transition: filter 240ms ease, transform 240ms ease;
}

.visitor-portrait:hover .visitor-image {
  filter: brightness(1.12) saturate(1.08);
  transform: translateY(-4px);
}

.portrait-head,
.portrait-body {
  display: none;
}

.visitor-nameplate {
  bottom: 0;
  min-width: min(250px, 92%);
  padding: 7px 10px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
}

.security-desk {
  position: absolute;
  right: 27%;
  bottom: 10%;
  width: min(300px, 24vw);
  min-height: 126px;
  pointer-events: auto;
  background: linear-gradient(145deg, rgba(18, 20, 20, 0.9), rgba(5, 6, 7, 0.76));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(2px);
}

.desk-panel {
  position: relative;
  min-height: 82px;
  padding: 12px;
}

.desk-stamp-art {
  position: absolute;
  right: 7px;
  bottom: 4px;
  width: 70px;
  height: 78px;
  object-fit: contain;
  opacity: 0.82;
  transform: rotate(7deg);
  filter: drop-shadow(0 7px 6px rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.desk-emblem {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.desk-instruction {
  font-size: 8px;
}

.scene-case-card {
  position: absolute;
  top: 17%;
  left: clamp(16px, 4vw, 58px);
  z-index: 11;
  display: grid;
  width: min(290px, 25vw);
  gap: 5px;
  padding: 13px 14px 14px;
  border: 1px solid rgba(207, 170, 122, 0.42);
  border-left: 3px solid var(--red-bright);
  background: linear-gradient(135deg, rgba(10, 12, 12, 0.9), rgba(24, 17, 17, 0.74));
  box-shadow: 0 15px 28px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  backdrop-filter: blur(4px);
}

.scene-case-card {
  grid-template-columns: 43px minmax(0, 1fr);
  column-gap: 9px;
}

.scene-case-portrait {
  grid-column: 1;
  grid-row: 1 / span 5;
  align-self: center;
  width: 43px;
  height: 78px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 7px 5px rgba(0, 0, 0, 0.6));
}

.scene-case-card > .panel-kicker,
.scene-case-card > strong,
.scene-case-card > small,
.scene-case-card > .scene-case-tags,
.scene-case-card > p {
  grid-column: 2;
}

.scene-case-card strong {
  overflow: hidden;
  color: #f0d8b8;
  font-size: clamp(14px, 1.3vw, 20px);
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-case-card small {
  overflow: hidden;
  color: #a79a8b;
  font-size: 8px;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-case-card p {
  margin: 7px 0 0;
  color: #c7b8a9;
  font-size: 10px;
  line-height: 1.4;
}

.scene-case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.scene-case-tags span {
  padding: 4px 5px;
  border: 1px solid rgba(201, 163, 113, 0.35);
  color: #d5b37f;
  font-size: 7px;
  letter-spacing: 0.11em;
  white-space: nowrap;
}

.scene-case-tags span:last-child {
  border-color: rgba(222, 75, 55, 0.38);
  color: #d77f68;
}

.scene-hotspots {
  position: absolute;
  z-index: 12;
  inset: 0;
  pointer-events: none;
}

.scene-hotspot {
  position: absolute;
  display: grid;
  min-width: 76px;
  min-height: 38px;
  place-items: center;
  padding: 6px 9px;
  border: 1px solid rgba(226, 187, 133, 0.44);
  background: rgba(7, 9, 9, 0.42);
  color: #e1bf8e;
  cursor: pointer;
  pointer-events: auto;
  text-shadow: 0 1px 4px #000;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  backdrop-filter: blur(2px);
}

.scene-hotspot {
  overflow: hidden;
}

.hotspot-sprite {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  filter: saturate(0.72) contrast(1.12);
  mix-blend-mode: screen;
  pointer-events: none;
}

.hotspot-sprite-portrait {
  object-fit: contain;
  filter: saturate(0.86) contrast(1.08) drop-shadow(0 7px 6px rgba(0, 0, 0, 0.65));
  mix-blend-mode: normal;
  opacity: 0.78;
}

.hotspot-visitor .hotspot-sprite {
  top: 5px;
  right: 5px;
  bottom: auto;
  left: auto;
  width: 82px;
  height: 100px;
}

.hotspot-label {
  position: relative;
  z-index: 2;
}

.scene-hotspot:hover:not(:disabled),
.scene-hotspot.selected,
.scene-hotspot.revealed {
  border-color: var(--red-bright);
  background: rgba(107, 24, 22, 0.7);
  box-shadow: 0 0 0 2px rgba(226, 75, 55, 0.18), 0 0 20px rgba(188, 49, 38, 0.23);
  transform: translateY(-2px);
}

.scene-hotspot:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.hotspot-label {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.hotspot-pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 7px;
  height: 7px;
  border: 1px solid #e6c597;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 10px rgba(231, 77, 54, 0.85);
  animation: hotspot-ping 2.4s ease-in-out infinite;
}

.hotspot-record {
  top: 32%;
  right: 39%;
}

.hotspot-visitor {
  bottom: 16%;
  left: 23%;
  width: min(285px, 25vw);
  height: 47%;
  border-color: rgba(226, 187, 133, 0.22);
  background: transparent;
  backdrop-filter: none;
}

.hotspot-visitor .hotspot-label {
  align-self: start;
  margin-top: -26px;
}

.hotspot-documents {
  right: 38%;
  bottom: 17%;
}

.hotspot-detector {
  right: 28%;
  bottom: 29%;
  height: 15%;
}

.hotspot-xray {
  right: 15%;
  bottom: 15%;
}

.hotspot-question {
  bottom: 58%;
  left: 31%;
}

.scene-actions {
  position: absolute;
  right: clamp(16px, 4vw, 58px);
  bottom: 3%;
  z-index: 13;
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 5px;
  width: min(430px, 34vw);
  padding: 8px;
  border: 1px solid rgba(208, 168, 119, 0.38);
  background: rgba(8, 9, 9, 0.82);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
  pointer-events: auto;
  backdrop-filter: blur(5px);
}

.scene-actions-label {
  grid-column: 1 / -1;
  color: #9e8d7a;
  font-size: 7px;
  letter-spacing: 0.16em;
}

.scene-decision {
  min-height: 37px;
  padding: 6px 7px;
  border: 1px solid rgba(182, 145, 106, 0.35);
  background: rgba(21, 22, 22, 0.88);
  color: #cbb395;
  cursor: pointer;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.09em;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.scene-decision {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.decision-sprite {
  display: block;
  width: 27px;
  height: 30px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.58));
  opacity: 0.9;
}

.scene-decision span {
  position: relative;
  z-index: 1;
}

.scene-decision:hover:not(:disabled) {
  transform: translateY(-2px);
}

.scene-decision.admit {
  border-color: rgba(126, 164, 135, 0.55);
  color: #a9d0ab;
}

.scene-decision.hold,
.scene-decision.call {
  border-color: rgba(201, 168, 91, 0.5);
  color: #dfc17d;
}

.scene-decision.deny {
  border-color: rgba(221, 84, 66, 0.6);
  color: #e4907f;
}

.scene-decision:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.workbench {
  display: none;
}

.footer-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 18;
  min-height: 26px;
  padding-bottom: 7px;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 6, 0.72));
}

.overlay-card {
  width: min(760px, 100%);
  min-height: 430px;
  padding: 32px 40px 30px 250px;
  text-align: left;
}

.overlay-inspector {
  position: absolute;
  bottom: 0;
  left: -25px;
  width: 300px;
  height: 410px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.7));
  pointer-events: none;
}

.overlay-card .overlay-emblem {
  margin-left: 0;
}

.overlay-card h1 {
  text-indent: 0;
}

.overlay-card p {
  margin-left: 0;
  margin-right: 0;
}

.inspection-overlay {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 4, 4, 0.78);
  backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.inspection-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.inspection-modal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(880px, 100%);
  max-height: calc(100svh - 44px);
  overflow: auto;
  border: 1px solid rgba(211, 170, 118, 0.52);
  background:
    linear-gradient(135deg, rgba(131, 30, 26, 0.16), transparent 24% 76%, rgba(131, 30, 26, 0.12)),
    linear-gradient(145deg, #252625, #0c0e0e 74%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  transform: translateY(14px) scale(0.98);
  transition: transform 220ms ease;
}

.inspection-overlay.is-open .inspection-modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(215, 174, 121, 0.35);
  background: rgba(9, 10, 10, 0.72);
  color: #d6b586;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.inspection-modal-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 58px 16px 24px;
  border-bottom: 1px solid var(--line);
}

.inspection-modal-heading h2 {
  margin: 0;
  color: #eed9bb;
  font-size: clamp(21px, 3vw, 30px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inspection-status {
  max-width: 230px;
  padding: 7px 9px;
  border: 1px solid rgba(205, 173, 113, 0.4);
  color: #d6b979;
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-align: right;
}

.inspection-status.match {
  border-color: rgba(126, 164, 135, 0.58);
  color: #a8d0ac;
}

.inspection-status.alert {
  border-color: rgba(221, 84, 66, 0.62);
  color: #ea8c7b;
}

.inspection-visual {
  display: grid;
  min-height: 190px;
  margin: 18px 24px 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(208, 171, 124, 0.25);
  background: radial-gradient(circle at 50% 30%, rgba(116, 52, 40, 0.18), transparent 60%), #090b0b;
}

.inspection-visual.dossier-visual {
  display: block;
  min-height: 0;
  max-height: min(68svh, 720px);
  padding: 18px;
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(176, 113, 69, 0.08), transparent 35%),
    #15100f;
}

.inspection-visual.dossier-visual .rs-dossier-view {
  width: min(100%, 620px);
}

.inspection-art {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  object-position: center;
}

.inspection-art.xray-art {
  max-height: 360px;
  object-fit: contain;
}

.inspection-art.portrait-art {
  width: auto;
  max-width: 330px;
  height: 330px;
  object-fit: contain;
}

.inspection-text {
  padding: 16px 24px 18px;
}

.inspection-result-copy {
  display: grid;
  gap: 8px;
  padding-left: 12px;
  border-left: 3px solid var(--brass);
}

.inspection-result-copy.match {
  border-left-color: var(--green);
}

.inspection-result-copy.alert {
  border-left-color: var(--danger);
}

.inspection-result-copy h3,
.inspection-result-copy p {
  margin: 0;
}

.inspection-result-copy h3 {
  color: #e4cba8;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspection-result-copy p {
  color: #c3b6a8;
  font-size: 12px;
  line-height: 1.52;
}

.inspection-question {
  color: #e3cfb5 !important;
}

.inspection-quote {
  padding-left: 10px;
  border-left: 2px solid var(--brass);
  color: #d9c5aa !important;
  font-style: italic;
}

.inspection-consistency {
  color: #c9ac72;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.inspection-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 5px;
}

.inspection-meta > div {
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(210, 186, 152, 0.13);
  background: rgba(0, 0, 0, 0.15);
}

.inspection-meta .meta-row {
  display: grid;
  gap: 3px;
}

.inspection-meta span,
.inspection-meta .meta-label {
  color: #857b70;
  font-size: 8px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.inspection-meta b,
.inspection-meta .meta-value {
  overflow: hidden;
  color: #d7c5ad;
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--line);
}

.inspection-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inspection-shortcuts button,
.modal-return {
  border: 1px solid rgba(191, 151, 106, 0.3);
  background: rgba(22, 23, 23, 0.9);
  color: #bd9e78;
  cursor: pointer;
  font-size: 8px;
  letter-spacing: 0.1em;
  padding: 7px 8px;
}

.inspection-shortcuts button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shortcut-sprite {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.12);
}

.inspection-shortcuts button:hover,
.inspection-shortcuts button.selected,
.modal-return:hover {
  border-color: var(--red-bright);
  background: rgba(110, 27, 25, 0.52);
  color: #e6bd9b;
}

.modal-return {
  flex: 0 0 auto;
  color: #d9b883;
}

@keyframes hotspot-ping {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50% { transform: scale(1.25); opacity: 1; }
}

@media (max-width: 1060px) {
  main {
    height: clamp(560px, calc(100svh - 145px), 900px);
  }

  .scene-case-card {
    width: 28vw;
  }

  .visitor-stage {
    left: 22%;
    width: min(255px, 27vw);
  }

  .security-desk {
    right: 24%;
    width: min(275px, 28vw);
  }

  .scene-actions {
    width: min(450px, 41vw);
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  main {
    height: 700px;
  }

  .embassy-wall {
    background-position: 50% center;
  }

  .scene-line {
    font-size: 8px;
  }

  .scene-case-card {
    top: 13%;
    left: 15px;
    width: min(250px, 58vw);
  }

  .scene-case-card p {
    display: none;
  }

  .visitor-stage {
    bottom: 18%;
    left: 5%;
    width: min(235px, 46vw);
    height: 54%;
  }

  .security-desk {
    right: 6%;
    bottom: 19%;
    width: min(230px, 45vw);
    min-height: 98px;
  }

  .desk-panel {
    grid-template-columns: auto 1fr;
  }

  .desk-instruction {
    display: none;
  }

  .hotspot-record {
    top: 31%;
    right: 9%;
  }

  .hotspot-visitor {
    bottom: 21%;
    left: 3%;
    width: 44vw;
    height: 37%;
  }

  .hotspot-documents {
    right: 32%;
    bottom: 22%;
  }

  .hotspot-detector {
    right: 8%;
    bottom: 36%;
    height: 14%;
  }

  .hotspot-xray {
    right: 7%;
    bottom: 22%;
  }

  .hotspot-question {
    bottom: 51%;
    left: 33%;
  }

  .scene-actions {
    right: 15px;
    bottom: 3%;
    left: 15px;
    width: auto;
  }

  .scene-actions-label {
    display: none;
  }

  .scene-decision {
    min-height: 32px;
    font-size: 7px;
  }

  .footer-bar {
    position: static;
  }

  .overlay-card {
    min-height: 520px;
    padding: 28px 24px 26px;
    text-align: center;
  }

  .overlay-inspector {
    right: 0;
    bottom: auto;
    left: 0;
    width: 190px;
    height: 235px;
    margin: 0 auto;
  }

  .overlay-card .overlay-emblem {
    margin: 205px auto 14px;
  }

  .inspection-overlay {
    padding: 10px;
  }

  .inspection-modal {
    max-height: calc(100svh - 20px);
  }

  .inspection-modal-heading {
    padding: 20px 50px 14px 16px;
  }

  .inspection-visual {
    margin: 12px 16px 0;
  }

  .inspection-text {
    padding: 13px 16px 15px;
  }

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

  .inspection-modal-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 16px 14px;
  }

  .modal-return {
    width: 100%;
  }
}

@media (max-width: 460px) {
  main {
    height: 680px;
  }

  .scene-case-card {
    top: 13%;
    width: 63vw;
  }

  .scene-case-card strong {
    font-size: 13px;
  }

  .scene-case-card small {
    font-size: 7px;
  }

  .visitor-stage {
    bottom: 20%;
    left: 0;
    width: 54vw;
    height: 48%;
  }

  .security-desk {
    right: 2%;
    bottom: 20%;
    width: 46vw;
  }

  .visitor-nameplate {
    min-width: 150px;
  }

  .visitor-nameplate span {
    font-size: 9px;
  }

  .scene-hotspot {
    min-width: 58px;
    min-height: 28px;
    padding: 4px 5px;
  }

  .hotspot-label {
    font-size: 6px;
  }

  .hotspot-record {
    top: 33%;
    right: 5%;
  }

  .hotspot-visitor {
    bottom: 23%;
    left: 2%;
    width: 50vw;
    height: 32%;
  }

  .hotspot-documents {
    right: 34%;
    bottom: 24%;
  }

  .hotspot-detector {
    right: 4%;
    bottom: 40%;
  }

  .hotspot-xray {
    right: 4%;
    bottom: 25%;
  }

  .hotspot-question {
    bottom: 51%;
    left: 32%;
  }

  .scene-actions {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .inspection-art.xray-art {
    max-height: 210px;
  }
}

/* Phone layout: preserve the room, move inspection controls into a reachable visual dock. */
@media (max-width: 760px) {
  :root {
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: manipulation;
  }

  .topbar {
    position: relative;
    min-height: 92px;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 15px 28px;
  }

  .brand-lockup {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-name {
    font-size: 14px;
  }

  .header-metrics {
    flex: 0 0 auto;
    gap: 7px;
  }

  .metric {
    min-width: 74px;
    gap: 4px;
  }

  .metric-label {
    display: block;
    overflow: hidden;
    max-width: 74px;
    font-size: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric strong {
    font-size: 13px;
  }

  .protocol-status {
    position: absolute;
    bottom: 7px;
    left: 15px;
    width: auto;
    padding: 0;
    font-size: 8px;
  }

  .protocol-status .status-divider {
    display: inline-block;
    height: 10px;
  }

  main {
    height: max(620px, calc(100svh - 92px));
    min-height: 620px;
  }

  .scene-line {
    top: 0;
    right: 15px;
    left: 15px;
    padding: 9px 0 8px;
    font-size: 7px;
  }

  .scene-line span:last-child {
    max-width: 54%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .scene-case-card {
    top: 11%;
    left: 15px;
    width: min(255px, 62vw);
    padding: 10px 11px;
  }

  .scene-case-portrait {
    width: 37px;
    height: 68px;
  }

  .scene-case-card strong {
    font-size: 12px;
  }

  .scene-case-card small {
    font-size: 6px;
  }

  .scene-case-tags span {
    padding: 3px 4px;
    font-size: 6px;
  }

  .visitor-stage {
    bottom: 28%;
    left: 4%;
    width: min(225px, 53vw);
    height: 45%;
  }

  .security-desk {
    right: 4%;
    bottom: 28%;
    width: min(190px, 43vw);
    min-height: 86px;
  }

  .desk-topline {
    padding: 7px 9px;
    font-size: 7px;
  }

  .desk-panel {
    min-height: 57px;
    grid-template-columns: auto 1fr;
    gap: 7px;
    padding: 7px 9px;
  }

  .desk-emblem {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .desk-status {
    font-size: 7px;
  }

  .desk-stamp-art {
    right: 3px;
    bottom: 1px;
    width: 44px;
    height: 49px;
  }

  .scene-hotspots {
    top: auto;
    right: 15px;
    bottom: calc(116px + var(--mobile-safe-bottom));
    left: 15px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    height: 59px;
  }

  .scene-hotspot,
  .hotspot-record,
  .hotspot-visitor,
  .hotspot-documents,
  .hotspot-detector,
  .hotspot-xray,
  .hotspot-question {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    height: 59px;
    min-width: 0;
    min-height: 52px;
    padding: 4px 2px;
    border-color: rgba(226, 187, 133, 0.38);
    background: rgba(7, 9, 9, 0.82);
    backdrop-filter: blur(4px);
  }

  .scene-hotspot .hotspot-sprite,
  .hotspot-visitor .hotspot-sprite {
    top: 3px;
    right: 2px;
    bottom: auto;
    left: 2px;
    width: auto;
    height: 36px;
    opacity: 0.72;
  }

  .scene-hotspot .hotspot-pulse {
    top: 2px;
    right: 2px;
    width: 5px;
    height: 5px;
  }

  .scene-hotspot .hotspot-label {
    align-self: end;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    font-size: 6px;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .scene-actions {
    right: 15px;
    bottom: calc(8px + var(--mobile-safe-bottom));
    left: 15px;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
  }

  .scene-actions-label {
    display: block;
    grid-column: 1 / -1;
    font-size: 6px;
  }

  .scene-decision {
    min-height: 38px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 4px;
    padding: 4px 5px;
    font-size: 7px;
  }

  .decision-sprite {
    width: 24px;
    height: 26px;
  }

  .toast {
    right: 15px;
    top: 100px;
    bottom: auto;
    left: 15px;
    max-width: none;
    font-size: 9px;
  }

  .footer-bar {
    display: none;
  }

  .inspection-overlay {
    align-items: start;
    padding: 8px;
  }

  .inspection-modal {
    width: 100%;
    max-height: calc(100svh - 16px);
    border-radius: 2px;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    width: 42px;
    height: 42px;
    font-size: 27px;
  }

  .inspection-modal-heading {
    min-height: 78px;
    padding: 17px 58px 12px 14px;
  }

  .inspection-modal-heading h2 {
    font-size: 20px;
  }

  .inspection-status {
    max-width: 112px;
    font-size: 7px;
  }

  .inspection-visual {
    min-height: 142px;
    margin: 10px 12px 0;
  }

  .inspection-visual.dossier-visual {
    max-height: 62svh;
    padding: 10px;
  }

  .inspection-art {
    max-height: 230px;
  }

  .inspection-art.portrait-art {
    height: 230px;
  }

  .inspection-text {
    padding: 11px 12px 12px;
  }

  .inspection-result-copy h3 {
    font-size: 13px;
  }

  .inspection-result-copy p {
    font-size: 11px;
  }

  .inspection-modal-footer {
    gap: 8px;
    padding: 9px 12px calc(11px + var(--mobile-safe-bottom));
  }

  .inspection-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .inspection-shortcuts button {
    justify-content: center;
    min-height: 38px;
    padding: 5px 3px;
    font-size: 7px;
  }

  .shortcut-sprite {
    width: 17px;
    height: 17px;
  }

  .modal-return {
    min-height: 42px;
    font-size: 8px;
  }

  .overlay-card {
    min-height: 500px;
  }

  .primary-button,
  .footer-help {
    min-height: 46px;
  }
}
