/* ==========================================================================
   MAÑANA, PLEASE — UGE-CE
   Pure Papers, Please flat pixel aesthetic (zero gradients, zero emojis)
   ========================================================================== */

:root {
  --bg-void: #12110f;
  --steel-dark: #282723;
  --steel-mid: #403f39;
  --steel-light: #59574f;
  --border-dark: #0c0b0a;

  --desk-bg: #665d4a;
  --tray-bg: #32302a;

  --paper: #eae1cc;
  --paper-alt: #ddd2b8;
  --ink: #1a1814;
  --ink-muted: #595245;

  --spain-red: #8e242c;
  --spain-gold: #c99a2e;
  --uge-olive: #385240;
  --stamp-green: #1e6b38;
  --stamp-red: #9e2020;
  --stamp-amber: #b36610;
  --inspect-cyan: #52e5e7;
  --inspect-red: #e04343;

  --font-display: 'Press Start 2P', 'PT Mono', 'Courier New', monospace;
  --font-ui: 'PT Mono', 'Courier New', monospace;
  --font-doc: 'PT Mono', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: #e6decb;
  font-family: var(--font-ui);
  font-size: 14px;
  image-rendering: pixelated;
}

.hidden {
  display: none !important;
}

#game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-void);
}

/* Crisp pixel inline SVG icons */
.px-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  image-rendering: pixelated;
}

.btn-with-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

/* ==================== FLAT STEPPED PIXEL BUTTONS ==================== */
.pixel-btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  background: #4b4942;
  color: #f0e8d5;
  border: 2px solid #0c0b0a;
  box-shadow: inset 2px 2px 0 #6e6b62, inset -2px -2px 0 #2b2a26;
  padding: 6px 11px;
  cursor: pointer;
  text-transform: uppercase;
}

.pixel-btn:hover:not(:disabled) {
  background: #5c5a52;
}

.pixel-btn:active:not(:disabled) {
  box-shadow: inset 2px 2px 0 #262521;
  transform: translate(1px, 1px);
}

.pixel-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.pixel-btn.primary {
  background: #36543f;
  box-shadow: inset 2px 2px 0 #557d61, inset -2px -2px 0 #1e3324;
}
.pixel-btn.primary:hover:not(:disabled) {
  background: #42664d;
}

.pixel-btn.secondary {
  background: #4f4638;
}

.pixel-btn.warn-btn {
  background: #874c14;
  box-shadow: inset 2px 2px 0 #b86f28, inset -2px -2px 0 #4f2b09;
}
.pixel-btn.warn-btn:hover:not(:disabled) {
  background: #9e5918;
}

.pixel-btn.inspect-btn.active {
  background: #186466;
  color: #d9ffff;
  box-shadow: inset 2px 2px 0 #52e5e7, inset -2px -2px 0 #0c383a;
}

.pixel-btn.big {
  font-family: var(--font-display);
  font-size: 11px;
  padding: 12px 20px;
}

.pixel-btn.tiny {
  font-size: 12px;
  padding: 3px 7px;
}

.pixel-btn.icon-btn {
  padding: 0;
}

/* ==================== OVERLAY SCREENS ==================== */
.overlay-screen {
  position: fixed;
  inset: 0;
  background: #12110f;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 16px;
}

.overlay-screen.active {
  display: flex;
}

/* ==================== AUTHENTIC PAPERS, PLEASE TITLE SCREEN ==================== */
#screen-title {
  background: #12110f;
}

.title-screen-inner {
  width: min(680px, 95vw);
  max-height: 96vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 16px 14px;
}

.title-art-frame {
  width: min(520px, 92%);
  height: 205px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #12110f;
  border-bottom: 2px solid #2b2823;
}

.title-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  image-rendering: pixelated;
  display: block;
}

.main-logo {
  margin: 4px 0 14px;
  font-family: var(--font-display);
  line-height: 1.25;
  text-transform: uppercase;
}

.logo-top {
  display: block;
  font-size: clamp(24px, 4.4vw, 40px);
  color: #ebe2cc;
  letter-spacing: 5px;
  padding-top: 12px;
  text-shadow: 4px 4px 0 #000;
}

/* Custom crisp pixel tilde above full-height N so MAÑANA never squishes */
.tilde-n {
  position: relative;
  display: inline-block;
}

.tilde-n::before,
.tilde-n::after {
  content: "";
  position: absolute;
  height: 5px;
  background: #ebe2cc;
  box-shadow: 3px 3px 0 #000;
}

.tilde-n::before {
  top: -11px;
  left: 2px;
  width: 48%;
}

.tilde-n::after {
  top: -8px;
  right: 5px;
  width: 48%;
}

.logo-bottom {
  display: block;
  font-size: clamp(22px, 3.8vw, 36px);
  color: #a3262f;
  letter-spacing: 7px;
  margin-top: 8px;
  text-shadow: 4px 4px 0 #000;
}

.logo-sub {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: #9e947e;
  letter-spacing: 1.8px;
  margin-bottom: 22px;
}

/* Symmetrically centered Papers, Please minimalist menu */
.title-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  width: min(370px, 92%);
  border-top: 2px solid #292621;
  border-bottom: 2px solid #292621;
  padding: 12px 0;
}

.menu-item {
  width: 100%;
  background: transparent;
  border: 2px solid transparent;
  color: #cfc6b0;
  font-family: var(--font-display);
  font-size: 11px;
  text-align: center;
  padding: 9px 12px;
  cursor: pointer;
  letter-spacing: 1px;
  display: grid;
  grid-template-columns: 18px 1fr 18px;
  align-items: center;
}

.menu-item .menu-arrow {
  color: #a3262f;
  opacity: 0;
  text-align: left;
}

.menu-item .menu-label {
  text-align: center;
}

.menu-item:hover,
.menu-item.primary {
  color: #f7f0dc;
}

.menu-item:hover {
  background: #1f1d19;
  border-color: #4f493e;
}

.menu-item:hover .menu-arrow,
.menu-item.primary .menu-arrow {
  opacity: 1;
}

.day-picker-panel {
  width: 100%;
  background: #1a1815;
  border: 2px solid #403b32;
  padding: 12px;
  margin-bottom: 16px;
}

.day-picker-title {
  font-family: var(--font-display);
  font-size: 9px;
  color: #b5aa94;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.day-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 6px;
}

.day-pick-btn {
  background: #26241f;
  border: 2px solid #0c0b0a;
  box-shadow: inset 1px 1px 0 #4a463d;
  color: #ece3ce;
  font-family: var(--font-ui);
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-pick-btn span {
  font-family: var(--font-display);
  font-size: 9px;
  color: #c99a2e;
}

.day-pick-btn small {
  font-size: 12px;
  color: #cfc6b2;
}

.day-pick-btn:hover {
  background: #36332c;
  border-color: #8e242c;
}

.title-footer {
  margin-top: 8px;
  border-top: 2px solid #292621;
  padding-top: 10px;
  width: 100%;
  font-size: 11px;
  color: #6b6456;
  letter-spacing: 1px;
}

/* ==================== MORNING BULLETIN ==================== */
.bulletin-paper {
  width: min(700px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid #0c0b0a;
  box-shadow: inset 0 0 0 4px #b8aa8c;
  padding: 22px 26px;
}

.bulletin-header {
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 4px double #2b2720;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.bulletin-seal {
  width: 68px;
  height: 68px;
  border: 3px solid var(--spain-red);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--spain-red);
  flex-shrink: 0;
}

.bulletin-ministry {
  font-size: 11px;
  font-weight: 700;
  color: #544d40;
  letter-spacing: 1px;
}

.bulletin-head-text h2 {
  margin: 5px 0;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.35;
  color: #171512;
}

.bulletin-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--spain-red);
}

.bulletin-alert {
  background: #8e2028;
  color: #fff6e5;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 14px;
  border: 2px solid #36090d;
  line-height: 1.4;
}

.bulletin-body {
  font-family: var(--font-doc);
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 15px;
  white-space: pre-line;
}

.bulletin-rules-box {
  background: #ddd3ba;
  border: 2px solid #6e6553;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.bulletin-rules-title {
  font-family: var(--font-display);
  font-size: 9.5px;
  color: var(--spain-red);
  margin-bottom: 10px;
}

.bulletin-rules-box ul {
  margin: 0;
  padding-left: 18px;
  font-family: var(--font-doc);
  font-size: 12px;
}

.bulletin-rules-box li {
  margin-bottom: 7px;
  line-height: 1.42;
}

.bulletin-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bulletin-stamp-note {
  font-size: 12px;
  color: #524b3f;
  font-weight: 700;
}

/* ==================== MAIN GAME LAYOUT ==================== */
#game-main {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* TOP BAR */
#top-bar {
  height: 132px;
  flex-shrink: 0;
  display: flex;
  background: #1c1b18;
  border-bottom: 5px solid #0c0b0a;
}

#queue-scene {
  flex: 1;
  position: relative;
  background-color: #36342e;
  background-image: url('../assets/queue_bg.jpg');
  background-size: cover;
  background-position: center 42%;
  border-right: 5px solid #0c0b0a;
  overflow: hidden;
}

.speaker-pulse {
  position: absolute;
  top: 16px;
  left: 36%;
  width: 16px;
  height: 16px;
  border: 3px solid #f0c954;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.speaker-pulse.active {
  animation: speakerRing 0.7s steps(5);
}

@keyframes speakerRing {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(3.8); opacity: 0; }
}

.queue-wall-sign {
  position: absolute;
  top: 6px;
  left: 10px;
  background: #181714;
  color: #ded0a6;
  border: 2px solid #5e5749;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 5;
}

#queue-line {
  position: absolute;
  bottom: 8px;
  left: 18px;
  right: 118px;
  height: 58px;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 18px;
  z-index: 4;
}

.queue-person {
  width: 24px;
  height: 46px;
  position: relative;
  transition: transform 0.35s steps(8), opacity 0.35s steps(6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.queue-person.active-at-booth {
  transform: translateX(34px);
}

.queue-person.leaving-good {
  transform: translateX(130px);
  opacity: 0;
}

.queue-person.leaving-bad {
  transform: translateX(-110px);
  opacity: 0;
}

.q-head {
  width: 12px;
  height: 12px;
  border: 2px solid #0c0b0a;
  margin-bottom: 1px;
}
.q-body {
  width: 20px;
  height: 20px;
  border: 2px solid #0c0b0a;
}
.q-legs {
  width: 14px;
  height: 9px;
  background: #1a1917;
  border-left: 2px solid #0a0908;
  border-right: 2px solid #0a0908;
}

#booth-divider {
  display: none;
}

/* FLAT METAL CONSOLE HUD */
#hud-panel {
  width: 400px;
  flex-shrink: 0;
  background: #3d3c36;
  box-shadow: inset 2px 2px 0 #5c5a52, inset -2px -2px 0 #242320;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.hud-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.hud-box {
  flex: 1;
  background: #141512;
  border: 2px solid #22211d;
  box-shadow: inset 2px 2px 0 #070807;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hud-label {
  font-size: 10px;
  color: #8c8978;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.hud-val {
  font-family: var(--font-display);
  font-size: 10px;
  margin-top: 3px;
  color: #e6dca8;
}

.hud-val.money {
  color: #7ee089;
}

.hud-btn {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== WORKSPACE ==================== */
#workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* LEFT COLUMN: BOOTH */
#booth-column {
  width: 360px;
  flex-shrink: 0;
  background: #383732;
  border-right: 5px solid #0c0b0a;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#booth-window {
  position: relative;
  height: 325px;
  flex-shrink: 0;
  background: #23221e;
  border-bottom: 5px solid #0c0b0a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#shutter {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: #3b3933;
  transition: transform 0.34s steps(8);
  display: flex;
  align-items: center;
  justify-content: center;
}

#shutter.open {
  transform: translateY(-100%);
  pointer-events: none;
}

.shutter-slats {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    #45433c 0px,
    #45433c 15px,
    #2e2d28 15px,
    #2e2d28 18px
  );
  box-shadow: inset 0 -10px 0 #1f1e1a;
}

.shutter-label {
  position: relative;
  z-index: 2;
  background: #1a1916;
  border: 3px solid #6b6659;
  padding: 12px 16px;
  text-align: center;
  font-family: var(--font-display);
  color: #e8dfc6;
  font-size: 10px;
  line-height: 1.6;
}

.shutter-label span {
  display: block;
  margin-top: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--spain-gold);
}

#applicant-stage {
  position: relative;
  height: 192px;
  background-color: #34322b;
  background-image: url('../assets/booth_bg.jpg');
  background-size: cover;
  background-position: center bottom;
  border-bottom: 4px solid #141310;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

#applicant-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#applicant-portrait {
  position: relative;
  z-index: 2;
  width: 172px;
  height: 172px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 8px;
}

.booth-portrait-img {
  width: 164px;
  height: 164px;
  object-fit: contain;
  image-rendering: pixelated;
}

#applicant-tag {
  position: absolute;
  top: 6px;
  left: 8px;
  background: #141310;
  border: 2px solid #5c5649;
  color: #e6ddc4;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  z-index: 5;
}

#silencio-timer {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #911e26;
  color: #fff3d6;
  border: 2px solid #2b0609;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  z-index: 6;
  animation: pulseAlert 0.75s steps(2) infinite;
}

@keyframes pulseAlert {
  0%, 100% { background: #911e26; }
  50% { background: #ba2b35; }
}

#dialogue-area {
  flex: 1;
  background: #1b1a17;
  padding: 7px 9px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-msg {
  padding: 6px 8px;
  font-family: var(--font-doc);
  font-size: 11.5px;
  line-height: 1.38;
  max-width: 96%;
}

.chat-msg.applicant {
  align-self: flex-start;
  background: #ebe4d0;
  color: #181612;
  border: 2px solid #0c0b0a;
  border-left: 4px solid var(--spain-red);
}

.chat-msg.inspector {
  align-self: flex-end;
  background: #d2e3d5;
  color: #132116;
  border: 2px solid #0c0b0a;
  border-right: 4px solid #296b3c;
}

.chat-msg.system {
  align-self: center;
  background: #381e1e;
  color: #ffd0d0;
  border: 2px solid #803030;
  font-size: 11px;
  text-align: center;
}

#booth-controls {
  padding: 8px 9px;
  background: #3e3d37;
  box-shadow: inset 0 2px 0 #5c5a52;
  border-bottom: 5px solid #0c0b0a;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-row {
  display: flex;
  gap: 6px;
}
.control-row .pixel-btn {
  flex: 1;
  font-size: 12px;
  padding: 7px 6px;
}

.inspect-status {
  background: #102a2b;
  border: 2px solid var(--inspect-cyan);
  color: #c2fcfc;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.inspect-status.discrepancy {
  background: #421414;
  border-color: var(--inspect-red);
  color: #ffd6d6;
}

.inspect-status.match {
  background: #12361f;
  border-color: #4ce07a;
  color: #ceffdc;
}

.bribe-bar {
  background: #382910;
  border: 2px solid var(--spain-gold);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bribe-text {
  font-family: var(--font-doc);
  font-size: 11px;
  color: #fae6b4;
}

.bribe-btns {
  display: flex;
  gap: 6px;
}
.bribe-btns button {
  flex: 1;
}

/* CITATION PRINTER */
#citation-printer {
  flex: 1;
  min-height: 105px;
  background: #1a1916;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.printer-header {
  background: #302e29;
  border-bottom: 2px solid #0c0b0a;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #cfc5b0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.7px;
}

.led {
  width: 10px;
  height: 10px;
  background: #2f6b3e;
  border: 2px solid #0b0a09;
}
.led.alert {
  background: #e63939;
}

#citation-feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.printer-idle {
  font-family: var(--font-doc);
  font-size: 11.5px;
  color: #787264;
  text-align: center;
  margin-top: 12px;
}

.citation-slip {
  background: #eed2d2;
  color: #241414;
  border-top: 3px dashed #8c6262;
  border-bottom: 3px dashed #8c6262;
  border-left: 5px dotted #6e4f4f;
  border-right: 5px dotted #6e4f4f;
  padding: 7px 9px;
  font-family: var(--font-doc);
  font-size: 11px;
  animation: printSlide 0.4s steps(6);
}

.citation-slip.ok-slip {
  background: #d8e8d7;
  border-color: #49734f;
  color: #142616;
}

@keyframes printSlide {
  from { transform: translateY(-24px); opacity: 0.2; }
  to { transform: translateY(0); opacity: 1; }
}

.citation-title {
  font-weight: 700;
  color: #8f1b1b;
  margin-bottom: 3px;
  border-bottom: 1px dotted #8a6060;
  padding-bottom: 2px;
}

.citation-slip.ok-slip .citation-title {
  color: #1c5e29;
}

.citation-penalty {
  margin-top: 4px;
  font-weight: 700;
  color: #8f1b1b;
  text-align: right;
}

/* ==================== RIGHT AREA: DESK ==================== */
#desk-area {
  flex: 1;
  display: flex;
  min-width: 0;
  position: relative;
}

#desk-tray {
  width: 146px;
  flex-shrink: 0;
  background: #33312b;
  border-right: 4px solid #12110e;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tray-title {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #bfb59e;
  letter-spacing: 0.8px;
  border-bottom: 2px solid #22201b;
  padding-bottom: 5px;
}

#tray-slots {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tray-doc-chip {
  background: #e3dac3;
  color: #1a1814;
  border: 2px solid #0e0d0b;
  box-shadow: inset 2px 2px 0 #f5efe0;
  padding: 6px 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.tray-doc-chip:hover {
  background: #f2ead6;
}

.tray-doc-chip.on-desk {
  background: #4d4940;
  color: #cfc7b4;
  border-style: dashed;
  box-shadow: none;
}

.tray-doc-chip.stamped {
  border-color: var(--stamp-green);
  background: #cfe8d3;
}

.tray-doc-chip .chip-dot {
  width: 8px;
  height: 12px;
  flex-shrink: 0;
  border: 1px solid #000;
}

.return-zone {
  background: #262420;
  border: 2px dashed #7a7261;
  padding: 8px 5px;
  text-align: center;
  color: #a69d8a;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.return-zone.ready {
  border-color: #69d186;
  background: #1e3b25;
  color: #d5f7de;
  cursor: pointer;
}

.return-zone.drag-over {
  background: #2c5737;
}

.return-ico {
  width: 18px;
  height: 18px;
}

.desk-manual-btn {
  position: relative;
  background: #6e1d24;
  color: #f7ebd4;
  border: 2px solid #0e0a0b;
  border-left: 6px solid #3b0c10;
  box-shadow: inset 2px 2px 0 #94353d;
  padding: 9px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  line-height: 1.1;
}

.desk-manual-btn:hover {
  background: #80232b;
}

.manual-badge {
  position: absolute;
  top: -7px;
  right: -4px;
  background: var(--spain-gold);
  color: #17140f;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border: 2px solid #000;
}

#desk-surface {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--desk-bg);
  background-image: url('../assets/desk_bg.jpg');
  background-size: cover;
  background-position: center;
}

#desk-surface.inspect-mode {
  box-shadow: inset 0 0 0 4px var(--inspect-cyan);
  transition: box-shadow 0.14s steps(3);
}

#desk-surface.flash-match {
  animation: deskFlashGreen 0.55s steps(4);
}

#desk-surface.flash-discrepancy {
  animation: deskFlashRed 0.55s steps(4);
}

@keyframes deskFlashGreen {
  0%, 100% { box-shadow: inset 0 0 0 4px var(--inspect-cyan); }
  25%, 60% { box-shadow: inset 0 0 0 6px #4ce07a; }
}

@keyframes deskFlashRed {
  0%, 100% { box-shadow: inset 0 0 0 4px var(--inspect-cyan); }
  25%, 65% { box-shadow: inset 0 0 0 6px #ff4242; }
}

.desk-watermark {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 245, 220, 0.2);
  pointer-events: none;
}

#documents-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
}

#inspect-lines-svg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 4500;
}

/* ==================== SLIDING RUBBER STAMP BAR ==================== */
#stamp-drawer {
  position: absolute;
  top: 12px;
  right: 0;
  max-width: 100%;
  z-index: 800;
  display: flex;
  align-items: flex-start;
  transition: transform 0.22s steps(6);
}

#stamp-drawer.closed {
  transform: translateX(calc(100% - 36px));
}

#stamp-drawer-toggle {
  width: 36px;
  flex-shrink: 0;
  height: 124px;
  background: #47453e;
  border: 3px solid #0c0b0a;
  border-right: none;
  color: #f0e6ce;
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 2px 2px 0 #6b685f;
}

#stamp-drawer-toggle:hover {
  background: #59564e;
}

.toggle-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
  font-size: 12px;
}

#stamp-drawer:not(.closed) .toggle-arrow {
  transform: rotate(180deg);
}

.stamp-drawer-body {
  width: min(372px, calc(100% - 36px));
  min-width: 272px;
  background: #3b3933;
  border: 3px solid #0c0b0a;
  border-right: none;
  box-shadow: inset 0 2px 0 #5e5b52;
  padding: 10px 12px 12px;
}

.stamp-drawer-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 2px solid #22201c;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.stamp-drawer-header span {
  font-family: var(--font-display);
  font-size: 9.5px;
  color: #f3ead3;
}

.stamp-drawer-header small {
  font-size: 11.5px;
  color: #c2b8a3;
}

.stamps-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.stamp-slot {
  flex: 1;
}

.stamp-btn {
  width: 100%;
  background: #211f1b;
  border: 2px solid #0c0b0a;
  box-shadow: inset 0 2px 0 #3d3a33;
  padding: 7px 4px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
}

.stamp-btn:hover {
  background: #2e2b25;
}

.stamp-btn:active,
.stamp-btn.stamping {
  transform: translateY(6px);
}

.stamp-handle {
  width: 38px;
  height: 14px;
  background: #6b533a;
  border: 2px solid #120d09;
  box-shadow: inset 0 2px 0 #947656;
}

.stamp-pad {
  width: 100%;
  padding: 7px 3px;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid #0d0c0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stamp-pad small {
  font-size: 10px;
  font-weight: 400;
}

.stamp-favorable .stamp-pad {
  background: #1b6334;
  color: #dcfae4;
  box-shadow: inset 0 2px 0 #318c51;
}

.stamp-denegado .stamp-pad {
  background: #961c1c;
  color: #ffe3e3;
  box-shadow: inset 0 2px 0 #c43737;
}

.stamp-requerimiento .stamp-pad {
  background: #a35e0d;
  color: #fff2d6;
  box-shadow: inset 0 2px 0 #cf8125;
}

/* ==================== PHYSICAL DOCUMENTS ON DESK ==================== */
.doc-card {
  position: absolute;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid #14120f;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.5);
  cursor: grab;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-width: 245px;
  max-width: calc(100% - 46px);
}

.doc-card:active {
  cursor: grabbing;
}

.doc-titlebar {
  background: #2b2924;
  color: #efe6d0;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.7px;
  border-bottom: 2px solid #12110e;
}

.doc-close-btn {
  background: #4f483e;
  color: #fff;
  border: 1px solid #000;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  padding: 0 6px;
  cursor: pointer;
}
.doc-close-btn:hover {
  background: #96222a;
}

.doc-body {
  padding: 10px 12px;
  font-family: var(--font-doc);
  font-size: 11.5px;
  line-height: 1.38;
  position: relative;
}

.country-code-badge {
  border: 2px solid #4d1921;
  color: #4d1921;
  padding: 1px 5px;
  font-family: var(--font-display);
  font-size: 8.5px;
}
.country-code-badge.green {
  border-color: #254736;
  color: #254736;
}
.country-code-badge.blue {
  border-color: #24445c;
  color: #24445c;
}

.doc-pasaporte {
  width: 302px;
  background: #e8e0cc;
  border: 4px solid #4d1921;
  box-shadow: inset 0 0 0 2px #c9bd9f, 4px 5px 0 rgba(0,0,0,0.52);
}
.doc-pasaporte .doc-titlebar {
  background: #5e1d27;
  color: #f5dfb0;
}

.doc-mit {
  width: 318px;
  background: #f2ebd8;
  border-top: 4px solid #264a37;
}
.doc-mit .doc-titlebar {
  background: #254736;
}

.doc-tasa {
  width: 290px;
  background: #dfe7eb;
}
.doc-tasa .doc-titlebar {
  background: #24445c;
}

.tasa-barcode {
  margin-top: 8px;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    #1b1a18 0px, #1b1a18 2px,
    transparent 2px, transparent 4px,
    #1b1a18 4px, #1b1a18 7px,
    transparent 7px, transparent 8px,
    #1b1a18 8px, #1b1a18 9px,
    transparent 9px, transparent 12px
  );
  opacity: 0.72;
}

.doc-contrato {
  width: 326px;
  background: #f0e9d6;
}
.doc-contrato .doc-titlebar {
  background: #3b3754;
}

.doc-banco {
  width: 312px;
  background: #e2ebe4;
}
.doc-banco .doc-titlebar {
  background: #1f4d3a;
}

.doc-penales {
  width: 316px;
  background: #f0e4de;
}
.doc-penales .doc-titlebar {
  background: #692e28;
}

.doc-experiencia {
  width: 312px;
  background: #ede5cd;
}
.doc-experiencia .doc-titlebar {
  background: #5c4323;
}

.doc-seguro {
  width: 316px;
  background: #deebf0;
}
.doc-seguro .doc-titlebar {
  background: #1a4d69;
}

.doc-paquete {
  width: 292px;
  background: #d9e3da;
}
.doc-paquete .doc-titlebar {
  background: #2a3b2c;
}

.doc-manual {
  width: 392px;
  background: #efe6cf;
  border: 4px solid #4a1217;
  border-left: 8px solid #360c10;
  box-shadow: 5px 6px 0 rgba(0,0,0,0.58);
}
.doc-manual .doc-titlebar {
  background: #6e1c23;
  color: #fae6bd;
}

.doc-official-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2e2922;
  padding-bottom: 5px;
  margin-bottom: 8px;
  gap: 8px;
}

.doc-official-title {
  font-weight: 700;
  font-size: 12px;
}

.doc-official-sub {
  font-size: 9.5px;
  color: #5c5447;
}

.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
}

.doc-field {
  margin-bottom: 5px;
  padding: 2px 4px;
}

.doc-field-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  color: #696052;
}

.doc-field-val {
  font-weight: 700;
  font-size: 11.5px;
  color: #161411;
  word-break: break-word;
}

.passport-bio {
  display: flex;
  gap: 10px;
}

.passport-bio .doc-field-val {
  white-space: nowrap;
  font-size: 10.5px;
}

.passport-photo {
  width: 82px;
  height: 98px;
  background: #b6c2c4;
  border: 2px solid #26231e;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.passport-photo-img {
  width: 82px;
  height: 88px;
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
  filter: saturate(0.55) contrast(1.12) sepia(0.22);
}

.passport-mrz {
  margin-top: 8px;
  padding-top: 5px;
  border-top: 1px solid #8a806e;
  font-size: 9.5px;
  letter-spacing: 0.8px;
  color: #3a352c;
  word-break: break-all;
}

.doc-tabs {
  display: flex;
  background: #cdc3ab;
  border-bottom: 2px solid #2a2620;
}

.doc-tab {
  flex: 1;
  background: #bab098;
  color: #2c2821;
  border: none;
  border-right: 1px solid #7a7260;
  padding: 5px 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.doc-tab:last-child {
  border-right: none;
}

.doc-tab.active {
  background: var(--paper);
  color: #8e2028;
}

.visa-sticker {
  border: 2px solid #264970;
  background: repeating-linear-gradient(
    -45deg,
    #d5e5f0 0px, #d5e5f0 6px,
    #e2ece4 6px, #e2ece4 12px
  );
  padding: 7px 8px;
  margin-bottom: 8px;
}

.visa-sticker.tie-card {
  border-color: #216144;
  background: repeating-linear-gradient(
    -45deg,
    #d3ede0 0px, #d3ede0 6px,
    #e2ecf0 6px, #e2ecf0 12px
  );
}

.entry-stamp-box {
  border: 2px solid #233b6e;
  color: #233b6e;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-block;
  transform: rotate(-3deg);
  margin-top: 4px;
  background: rgba(35, 59, 110, 0.06);
}

.entry-stamp-box.missing {
  border-style: dashed;
  border-color: #8a7e6e;
  color: #7c7163;
  transform: none;
}

.seal-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed #998f7c;
}

.official-seal {
  border: 2px solid #1e5937;
  color: #1b4f31;
  background: rgba(30, 89, 55, 0.08);
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
}

.official-seal.blue {
  border-color: #224675;
  color: #1b3a63;
  background: rgba(34, 70, 117, 0.08);
}

.official-seal.missing-seal {
  border: 2px dashed #962626;
  color: #8f1e1e;
  background: rgba(150, 38, 38, 0.08);
}

.bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  margin: 6px 0;
}

.bank-table th, .bank-table td {
  border: 1px solid #8a8270;
  padding: 3px 5px;
  text-align: left;
}

.bank-table th {
  background: #cbd9cd;
  font-size: 9.5px;
}

.signature-box {
  margin-top: 8px;
  border: 1px solid #7d7564;
  background: #faf5e8;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sig-script {
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 14px;
  color: #183466;
}

/* STAMP IMPRINT */
.stamped-imprint {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-9deg);
  border: 4px solid var(--stamp-green);
  color: var(--stamp-green);
  background: rgba(255, 252, 244, 0.84);
  padding: 7px 12px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1px;
  text-align: center;
  pointer-events: none;
  z-index: 30;
  box-shadow: inset 0 0 0 2px currentColor;
  animation: stampSlam 0.14s steps(4);
}

.stamped-imprint small {
  display: block;
  font-family: var(--font-doc);
  font-size: 9px;
  margin-top: 4px;
}

.stamped-imprint.DENEGADO {
  border-color: var(--stamp-red);
  color: var(--stamp-red);
}

.stamped-imprint.REQUERIMIENTO {
  border-color: var(--stamp-amber);
  color: var(--stamp-amber);
  font-size: 10.5px;
}

@keyframes stampSlam {
  0% { transform: translate(-50%, -50%) scale(1.6) rotate(-14deg); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(-9deg); opacity: 1; }
}

.quick-return-btn {
  margin-top: 8px;
  width: 100%;
  font-size: 12px;
}

.manual-hint {
  font-size: 10.5px;
  color: #5c5345;
  margin-bottom: 7px;
  border-bottom: 1px dashed #a89f8b;
  padding-bottom: 5px;
}

.manual-content {
  max-height: 305px;
  overflow-y: auto;
  padding-right: 4px;
}

.manual-rule-item {
  border: 1px solid #b5aa91;
  background: #f7f0df;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.38;
}

.manual-rule-item.new-today {
  border-left: 4px solid var(--spain-red);
  background: #faebe6;
}

.manual-rule-tag {
  display: inline-block;
  background: var(--spain-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  margin-right: 5px;
}

.bank-period-wrap {
  padding: 2px;
  margin: 2px 0;
}

/* ==================== INSPECT MODE ==================== */
.inspect-mode .inspectable,
.inspect-mode .inspectable-global {
  outline: 2px dashed rgba(82, 229, 231, 0.72);
  background: rgba(82, 229, 231, 0.11);
  cursor: crosshair !important;
  transition: background 0.1s, outline-color 0.1s;
}

.inspect-mode .inspectable:hover,
.inspect-mode .inspectable-global:hover {
  outline: 2px solid var(--inspect-cyan);
  background: rgba(82, 229, 231, 0.28);
}

.inspect-selected {
  outline: 3px solid #22ebe4 !important;
  background: rgba(34, 235, 228, 0.28) !important;
  animation: inspectPulseCyan 0.85s steps(4) infinite;
}

.inspect-match {
  outline: 3px solid #4ce07a !important;
  background: rgba(76, 224, 122, 0.34) !important;
  animation: inspectFlashGreen 0.55s steps(4);
}

.inspect-discrepancy {
  outline: 3px solid #ff4242 !important;
  background: rgba(255, 66, 66, 0.34) !important;
  animation: inspectAlertRed 0.42s steps(4) 2;
}

@keyframes inspectPulseCyan {
  0%, 100% { outline-color: #22ebe4; }
  50% { outline-color: #9ffafa; }
}

@keyframes inspectFlashGreen {
  0% { background: rgba(76, 224, 122, 0.65); outline-color: #a6ffc1; }
  100% { background: rgba(76, 224, 122, 0.34); outline-color: #4ce07a; }
}

@keyframes inspectAlertRed {
  0% { transform: translateX(0); background: rgba(255, 66, 66, 0.62); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); background: rgba(255, 66, 66, 0.34); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.inspect-beam.beam-draw {
  stroke-dasharray: var(--beam-len, 400);
  stroke-dashoffset: var(--beam-len, 400);
  animation: drawBeam 0.24s steps(8) forwards;
}

@keyframes drawBeam {
  to { stroke-dashoffset: 0; }
}

.inspect-reticle {
  animation: reticleLock 0.16s steps(3);
}

@keyframes reticleLock {
  from { opacity: 0.25; }
  to { opacity: 1; }
}

.inspect-midpoint-badge.badge-pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: badgePop 0.2s steps(4) 0.12s both;
}

@keyframes badgePop {
  from { opacity: 0; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1); }
}

.shake {
  animation: deskShake 0.16s steps(4);
}

@keyframes deskShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 1px); }
}

/* ==================== SUMMARY & ENDING SCREENS ==================== */
.summary-panel, .ending-panel {
  width: min(800px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  background: #1f1d19;
  border: 4px solid #0c0b09;
  box-shadow: inset 0 0 0 3px #4a4439;
  padding: 22px 26px;
}

.summary-header {
  border-bottom: 2px solid #494339;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.summary-header h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  color: #f0e7d0;
  font-size: 14px;
}

.summary-sub {
  font-size: 12px;
  color: #a89f8b;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.summary-ledger, .summary-expenses {
  background: #161411;
  border: 2px solid #3f3a31;
  padding: 14px;
}

.summary-ledger h3, .summary-expenses h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--spain-gold);
  border-bottom: 1px solid #3b362e;
  padding-bottom: 7px;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-family: var(--font-doc);
  font-size: 12px;
}

.ledger-row.neg span:last-child { color: #e87272; }
.ledger-row.pos span:last-child { color: #83d18d; }
.ledger-row.total {
  font-weight: 700;
  font-size: 14px;
  color: #fff6df;
}

.ledger-divider {
  border-top: 2px dashed #4a4439;
  margin: 8px 0;
}

.expenses-hint {
  font-family: var(--font-doc);
  font-size: 11px;
  color: #9e9583;
  margin: 0 0 10px;
}

.expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #24211c;
  border: 1px solid #3f3930;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: var(--font-doc);
  font-size: 12px;
}

.expense-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.family-status-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #3b362e;
}

.family-status-box h4 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 9px;
  color: #bfb59f;
}

.family-member-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-doc);
  font-size: 11.5px;
  padding: 2px 0;
}

.status-ok { color: #83d18d; }
.status-warn { color: #e6b44c; }
.status-bad { color: #e86b6b; }

.summary-verdict-box {
  background: #2c2822;
  border-left: 4px solid var(--spain-gold);
  padding: 10px 14px;
  font-family: var(--font-doc);
  font-size: 12px;
  margin-bottom: 16px;
  line-height: 1.45;
}

.summary-footer {
  display: flex;
  justify-content: flex-end;
}

.ending-panel {
  text-align: center;
}
.ending-badge {
  display: inline-block;
  border: 2px solid var(--spain-gold);
  color: var(--spain-gold);
  padding: 5px 12px;
  font-family: var(--font-display);
  font-size: 9.5px;
  margin-bottom: 12px;
}
.ending-panel h2 {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.4;
}
.ending-desc {
  text-align: left;
  background: #161411;
  border: 2px solid #403b32;
  padding: 14px 18px;
  font-family: var(--font-doc);
  font-size: 12.5px;
  line-height: 1.55;
  margin: 14px 0;
  white-space: pre-line;
}
.ending-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.ending-stat-card {
  background: #161411;
  border: 2px solid #453f35;
  padding: 10px;
}
.ending-stat-card span {
  display: block;
  font-size: 10.5px;
  color: #9e9583;
  margin-bottom: 4px;
}
.ending-stat-card strong {
  font-family: var(--font-display);
  font-size: 13px;
  color: #f3ead3;
}
.ending-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #191815;
}
::-webkit-scrollbar-thumb {
  background: #595347;
  border: 1px solid #0d0c0a;
}

@media (max-width: 1024px) {
  #booth-column { width: 310px; }
  #hud-panel { width: 330px; }
  #desk-tray { width: 128px; }
  .summary-grid { grid-template-columns: 1fr; }
}
