:root {
  color-scheme: dark;
  --bg: #0d100c;
  --bg-strong: #080a08;
  --surface: rgba(18, 24, 17, 0.92);
  --surface-2: rgba(30, 37, 25, 0.9);
  --surface-3: rgba(45, 49, 33, 0.84);
  --line: rgba(150, 170, 112, 0.28);
  --line-strong: rgba(197, 224, 132, 0.48);
  --text: #d7e4bf;
  --muted: #91a17c;
  --faint: #667158;
  --green: #98c66e;
  --green-strong: #c0e889;
  --amber: #d7a94d;
  --red: #d65b45;
  --rust: #9d6141;
  --cyan: #7bb8ad;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", "Consolas", monospace;
  --font-ui: Inter, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-ui);
  overflow-x: hidden;
  background:
    linear-gradient(rgba(13, 16, 12, 0.86), rgba(13, 16, 12, 0.92)),
    url("../assets/pda-scratched-texture.png") center / cover fixed,
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(202, 238, 145, 0.045) 0,
      rgba(202, 238, 145, 0.045) 1px,
      transparent 1px,
      transparent 5px
    ),
    linear-gradient(90deg, rgba(0, 0, 0, 0.38), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.46));
  mix-blend-mode: screen;
}

body.emission-warning::after,
body.emission-active::after {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(transparent 0 42%, rgba(214, 91, 69, 0.18) 43%, transparent 46%),
    repeating-linear-gradient(
      to bottom,
      rgba(214, 91, 69, 0.08) 0,
      rgba(214, 91, 69, 0.08) 2px,
      transparent 2px,
      transparent 7px
    );
  mix-blend-mode: screen;
  animation: emission-glitch 820ms steps(2, end) infinite;
}

body.emission-warning::after {
  background:
    linear-gradient(transparent 0 58%, rgba(215, 169, 77, 0.12) 59%, transparent 62%),
    repeating-linear-gradient(
      to bottom,
      rgba(215, 169, 77, 0.045) 0,
      rgba(215, 169, 77, 0.045) 1px,
      transparent 1px,
      transparent 9px
    );
  animation: emission-warning-glitch 1600ms steps(3, end) infinite;
}

body.emission-warning .pda-shell {
  animation: emission-warning-drift 1800ms ease-in-out infinite;
}

body.emission-active .pda-shell {
  animation: emission-shake 360ms steps(4, end) infinite;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

.app-root {
  min-height: 100vh;
}

.boot-screen,
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.boot-screen {
  font-family: var(--font-mono);
  color: var(--green-strong);
}

.boot-mark {
  font-size: 1.4rem;
  font-weight: 800;
}

.boot-line {
  width: min(320px, 70vw);
  height: 2px;
  margin: 14px auto;
  background: var(--green);
}

.login-terminal,
.pda-shell {
  position: relative;
  width: 100%;
  max-width: 1180px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(116, 123, 70, 0.12), rgba(8, 10, 8, 0.18)),
    var(--surface);
  box-shadow: var(--shadow);
}

.login-terminal::after,
.pda-shell::after {
  position: absolute;
  inset: 6px;
  z-index: 0;
  pointer-events: none;
  content: "";
  border: 1px dashed rgba(191, 214, 129, 0.1);
  border-radius: 6px;
}

.login-terminal > *,
.pda-shell > * {
  position: relative;
  z-index: 1;
}

.login-terminal {
  max-width: 520px;
  padding: 14px;
}

.terminal-head,
.app-header,
.operator-strip,
.panel-title,
.profile-tags,
.button-row,
.view-tabs,
.sample-codes,
.money-strip,
.roll-strip {
  display: flex;
  align-items: center;
}

.terminal-head {
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.terminal-code {
  color: var(--amber);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 14px currentColor;
}

.status-dot.online {
  color: var(--green);
  background: currentColor;
}

.ops-banner,
.broadcast-stack {
  display: grid;
  gap: 8px;
}

.ops-banner {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
}

.ops-banner strong,
.ops-banner span,
.ops-banner small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.ops-banner.warn {
  border-color: rgba(215, 169, 77, 0.48);
}

.ops-banner.good {
  border-color: rgba(152, 198, 110, 0.44);
}

.ops-banner.danger {
  border-color: rgba(214, 91, 69, 0.56);
}

.ops-banner.good strong,
.ops-banner.good span {
  color: var(--green-strong);
}

.ops-banner.warn strong,
.ops-banner.warn span {
  color: var(--amber);
}

.ops-banner.danger strong,
.ops-banner.danger span {
  color: var(--red);
}

.field-status {
  margin-bottom: 10px;
}

.emission-banner,
.punishment-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(68, 52, 23, 0.46), rgba(9, 12, 9, 0.78)),
    rgba(5, 7, 5, 0.72);
  box-shadow: inset 0 0 24px rgba(215, 169, 77, 0.08);
}

.emission-banner {
  grid-template-columns: 26px 1fr;
  align-items: center;
  border-color: rgba(215, 169, 77, 0.56);
}

.emission-banner.warning {
  animation: emission-warning-panel 1800ms ease-in-out infinite;
}

.emission-banner.active,
.emission-banner.ended,
.punishment-card {
  border-color: rgba(214, 91, 69, 0.6);
  background:
    linear-gradient(135deg, rgba(82, 24, 14, 0.5), rgba(9, 12, 9, 0.82)),
    rgba(5, 7, 5, 0.72);
}

.emission-pulse {
  width: 18px;
  height: 18px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(215, 169, 77, 0.72);
  animation: warning-pulse 1200ms ease-in-out infinite;
}

.emission-banner.active .emission-pulse,
.emission-banner.ended .emission-pulse {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 20px rgba(214, 91, 69, 0.82);
  animation-duration: 520ms;
}

.emission-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.emission-copy span,
.emission-copy small,
.countdown-block span,
.punishment-card span,
.punishment-card p,
.emission-status-card span,
.emission-roster-row span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.emission-copy strong,
.punishment-card strong,
.emission-status-card strong,
.emission-roster-row strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.emission-banner.active .emission-copy strong,
.punishment-card strong {
  color: #ffd7cd;
}

.countdown-block {
  display: grid;
  gap: 3px;
  min-width: 104px;
  border: 1px solid rgba(150, 170, 112, 0.22);
  border-radius: 5px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.26);
}

.countdown-block strong,
.punishment-timers strong {
  color: var(--green-strong);
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.shelter-button {
  grid-column: 1 / -1;
}

.shelter-instruction {
  grid-column: 1 / -1;
  border: 1px dashed rgba(215, 169, 77, 0.46);
  border-radius: 5px;
  padding: 8px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.2);
}

.punishment-card {
  border-style: double;
}

.emergency-card .punishment-card {
  margin-bottom: 0;
}

.punishment-card p {
  margin-top: 6px;
  color: var(--amber);
  font-size: 0.78rem;
  line-height: 1.45;
}

.punishment-card.reminder-due {
  box-shadow:
    inset 0 0 24px rgba(214, 91, 69, 0.14),
    0 0 22px rgba(214, 91, 69, 0.16);
}

.punishment-card.reminder-due .punishment-timers strong:last-child {
  color: var(--red);
}

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

.punishment-timers div {
  min-width: 0;
  border: 1px solid rgba(150, 170, 112, 0.22);
  border-radius: 5px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.login-brand {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  padding: 22px 10px 18px;
}

.brand-glyph {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--green-strong);
  font-family: var(--font-mono);
  font-weight: 900;
  background: rgba(8, 10, 8, 0.7);
  box-shadow: inset 0 0 18px rgba(152, 198, 110, 0.12);
}

.login-brand h1 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}

.login-brand p {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-grid,
.form-grid {
  display: grid;
  gap: 12px;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.portrait-picker {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  padding: 8px;
  border: 1px solid rgba(150, 170, 112, 0.22);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.portrait-picker.compact {
  margin: 0;
}

.portrait-picker img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(150, 170, 112, 0.3);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

input,
select,
textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: rgba(5, 7, 5, 0.72);
  padding: 0 12px;
  outline: none;
}

textarea {
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(152, 198, 110, 0.15);
}

.auth-error {
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid rgba(214, 91, 69, 0.42);
  color: #ffd7cd;
  background: rgba(91, 20, 12, 0.28);
}

.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(3, 5, 3, 0.78);
  backdrop-filter: blur(6px);
}

.camera-panel {
  width: min(100%, 460px);
  overflow: hidden;
}

.portrait-camera-view {
  aspect-ratio: 3 / 4;
  margin: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(202, 238, 145, 0.04) 0,
      rgba(202, 238, 145, 0.04) 1px,
      transparent 1px,
      transparent 5px
    ),
    #050705;
}

.portrait-camera-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.08) saturate(0.8);
}

.camera-panel .button-row {
  margin: 12px;
}

.button-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.button-row.compact {
  margin-top: 10px;
  gap: 8px;
}

.primary-button,
.ghost-button,
.mini-button,
.view-tabs button,
.sample-codes button,
.zone,
.brand-button,
.admin-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  background: rgba(16, 21, 14, 0.84);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.primary-button {
  flex: 1;
  color: #0d100c;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--green-strong), var(--green));
  border-color: rgba(214, 228, 191, 0.42);
}

.primary-button.danger-button {
  color: #ffd7cd;
  background: linear-gradient(180deg, #9d2f20, #5b140c);
  border-color: rgba(214, 91, 69, 0.68);
}

.ghost-button {
  flex: 1;
  color: var(--green-strong);
  text-transform: uppercase;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.full {
  width: 100%;
}

button:hover {
  border-color: var(--green);
  background: rgba(40, 55, 30, 0.84);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.pda-shell {
  min-height: 100vh;
  margin: 0 auto;
  border-radius: 0;
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 12, 9, 0.94);
  backdrop-filter: blur(12px);
}

.brand-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
}

.brand-button strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.brand-button small {
  display: block;
  max-width: 42vw;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-strip {
  justify-content: flex-end;
  gap: 8px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.operator-strip span {
  display: none;
}

.view-tabs {
  position: sticky;
  top: 72px;
  z-index: 4;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 12, 0.94);
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tabs button {
  display: inline-grid;
  grid-template-columns: 24px auto;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
  min-width: 88px;
  padding: 0 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.view-tabs button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.64rem;
}

.view-tabs button.active {
  color: var(--green-strong);
  border-color: var(--green);
  background: rgba(43, 61, 31, 0.78);
}

.view-tabs button.active span {
  color: var(--bg);
  background: var(--green);
}

.app-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(42, 54, 31, 0.24), rgba(7, 10, 7, 0.1)),
    var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.panel-title {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-title > * {
  min-width: 0;
}

.panel-title h3 {
  margin: 0;
  color: var(--green-strong);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.panel-title span,
.system-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.panel-title span {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 479px) {
  .panel-title {
    align-items: flex-start;
  }

  .panel-title > span:not(.status-pill) {
    display: none;
  }

  .panel-title .status-pill {
    justify-content: flex-start;
    flex-basis: 100%;
    text-align: left;
  }
}

.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.profile-hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  overflow: hidden;
}

.portrait-frame {
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-strong);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.08) saturate(0.82);
}

.profile-core h2 {
  margin: 4px 0 8px;
  font-family: var(--font-mono);
  font-size: 1.18rem;
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.portrait-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.portrait-actions .button-row {
  margin-top: 0;
}

.portrait-camera-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.profile-tags {
  flex-wrap: wrap;
  gap: 6px;
}

.profile-tags span,
.status-pill,
.chip,
.quest-template-strip span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  background: rgba(5, 7, 5, 0.46);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.player-instruction {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px;
  border-color: rgba(152, 198, 110, 0.34);
  background:
    linear-gradient(135deg, rgba(38, 55, 28, 0.34), rgba(7, 10, 7, 0.2)),
    var(--surface);
}

.player-instruction.tone-warn {
  border-color: rgba(215, 169, 77, 0.48);
}

.player-instruction.tone-danger,
.player-instruction.tone-critical {
  border-color: rgba(214, 91, 69, 0.56);
}

.player-instruction span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.player-instruction strong {
  color: var(--green-strong);
  font-family: var(--font-mono);
  font-size: 1.08rem;
  text-transform: uppercase;
}

.player-instruction.tone-warn strong {
  color: var(--amber);
}

.player-instruction.tone-danger strong,
.player-instruction.tone-critical strong {
  color: #ffd7cd;
}

.dashboard-grid,
.scanner-layout,
.map-layout,
.station-layout,
.admin-layout {
  display: grid;
  gap: 12px;
}

.dashboard-grid > *,
.scanner-layout > *,
.map-layout > *,
.station-layout > *,
.admin-layout > * {
  min-width: 0;
}

.status-panel {
  padding-bottom: 12px;
}

.status-panel p,
.panel > p,
.editor-panel > label,
.editor-panel .form-grid,
.editor-panel .create-quest,
.station-layout .panel > label,
.station-layout .checkbox-grid,
.station-layout .button-row,
.station-layout .panel > .ghost-button,
.scan-panel .qr-input,
.artifact-panel .risk-output,
.zone-map + .panel > p {
  margin: 12px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.meter {
  margin: 12px;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

.quest-stack,
.equipment-grid,
.artifact-list,
.artifact-editor-list,
.item-editor-list,
.account-list,
.info-editor-list,
.chip-grid,
.ledger-list,
.scan-log,
.event-list,
.token-list,
.quest-editor-list,
.punishment-template-list,
.punishment-admin-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.tone-good {
  color: var(--green-strong) !important;
}

.tone-warn {
  color: var(--amber) !important;
}

.tone-danger,
.tone-critical {
  color: var(--red) !important;
}

.meter .tone-good {
  background: var(--green);
}

.quest-card,
.ledger-entry,
.log-entry,
.world-event,
.artifact-card,
.equipment-tile,
.token-card,
.qr-sheet-item,
.quest-edit-row,
.item-edit-row,
.account-row,
.info-edit-row,
.punishment-template-row,
.punishment-admin-row {
  border: 1px solid rgba(150, 170, 112, 0.2);
  border-radius: 6px;
  background: rgba(7, 10, 7, 0.38);
}

.quest-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.quest-card > div {
  min-width: 0;
}

.quest-card strong,
.equipment-tile strong,
.ledger-entry strong,
.log-entry strong,
.world-event strong,
.token-card strong,
.qr-sheet-item strong,
.quest-edit-row strong,
.item-edit-row strong,
.punishment-template-row strong,
.punishment-admin-row strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.emergency-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.emergency-head {
  display: grid;
  gap: 5px;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.emergency-head strong {
  color: var(--green-strong);
  font-size: 1.6rem;
}

.emergency-condition {
  min-height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 10vw, 4.6rem);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.28);
}

.condition-quick-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(150, 170, 112, 0.22);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.condition-quick-panel > span,
.condition-confirm span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.condition-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.condition-button-grid button {
  min-height: 38px;
  border: 1px solid rgba(150, 170, 112, 0.24);
  border-radius: 4px;
  padding: 0 8px;
  color: var(--muted);
  background: rgba(7, 10, 7, 0.48);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.condition-button-grid button.active {
  border-color: var(--green);
  color: var(--bg-strong);
  background: var(--green);
  opacity: 1;
}

.condition-button-grid button.tone-warn {
  border-color: rgba(215, 169, 77, 0.38);
}

.condition-button-grid button.tone-danger,
.condition-button-grid button.tone-critical {
  border-color: rgba(214, 91, 69, 0.42);
}

.condition-confirm {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(214, 91, 69, 0.5);
  border-radius: 5px;
  padding: 9px;
  background: rgba(91, 20, 12, 0.26);
}

.condition-confirm strong {
  color: #ffd7cd;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

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

.emergency-grid div,
.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.emergency-grid span,
.metric-grid span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.emergency-grid strong,
.metric-grid strong {
  color: var(--green-strong);
  font-family: var(--font-mono);
  font-size: 1.3rem;
}

.timer-card {
  display: grid;
  gap: 4px;
  margin: 12px;
  padding: 10px;
  border: 1px solid rgba(215, 169, 77, 0.42);
  border-radius: 5px;
  color: var(--amber);
  font-family: var(--font-mono);
  background: rgba(52, 34, 9, 0.22);
}

.emergency-card .timer-card {
  margin: 0;
}

.quest-card small,
.quest-edit-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.quest-card p {
  grid-column: 1 / -1;
  font-size: 0.82rem;
}

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

.chip {
  min-height: 34px;
  justify-content: center;
  text-align: center;
}

.chip.active {
  color: #11170e;
  border-color: var(--green);
  background: var(--green);
}

.equipment-tile {
  min-height: 86px;
  padding: 10px;
  opacity: 0.55;
}

.equipment-tile.active {
  opacity: 1;
  border-color: rgba(152, 198, 110, 0.58);
  background: rgba(44, 62, 30, 0.5);
}

.equipment-tile small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.artifact-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
}

.artifact-card img {
  width: 72px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg-strong);
}

.artifact-card strong {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}

.artifact-card small,
.artifact-card code {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.artifact-card code {
  width: fit-content;
  max-width: 100%;
  padding: 5px 6px;
  overflow-wrap: anywhere;
  color: var(--green-strong);
  background: rgba(0, 0, 0, 0.35);
}

.artifact-card p {
  margin-top: 7px;
  font-size: 0.8rem;
}

.artifact-trade {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 86px;
  gap: 8px;
  align-items: end;
}

.admin-artifact {
  grid-template-columns: 78px 1fr;
}

.admin-artifact > label {
  grid-column: 1 / -1;
}

.qr-print {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(150, 170, 112, 0.2);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.28);
}

.qr-print img {
  width: 96px;
  height: 96px;
  padding: 6px;
  background: #f2f5e8;
  image-rendering: pixelated;
}

.money-strip {
  justify-content: space-between;
  gap: 10px;
  margin: 12px 12px 0;
}

.money-strip span {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--line);
  padding: 9px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  text-transform: uppercase;
}

.ledger-entry {
  display: grid;
  grid-template-columns: 78px 54px 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px;
}

.ledger-entry span,
.ledger-entry small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.ledger-entry p {
  grid-column: 1 / -1;
  font-size: 0.8rem;
}

.empty-state {
  padding: 10px;
  color: var(--faint) !important;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.scanner-window {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #050705;
}

.scanner-window video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-reticle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--green-strong);
  font-family: var(--font-mono);
  background:
    linear-gradient(transparent 48%, rgba(152, 198, 110, 0.18) 49%, transparent 51%),
    linear-gradient(90deg, transparent 48%, rgba(152, 198, 110, 0.18) 49%, transparent 51%);
}

.scan-reticle span {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: var(--green);
}

.scan-reticle span:nth-child(1) {
  top: 18px;
  left: 18px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.scan-reticle span:nth-child(2) {
  top: 18px;
  right: 18px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.scan-reticle span:nth-child(3) {
  bottom: 18px;
  left: 18px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.scan-reticle span:nth-child(4) {
  right: 18px;
  bottom: 18px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.sample-codes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 0 12px 12px;
}

.sample-codes button {
  min-height: 32px;
  padding: 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
  white-space: normal;
}

.artifact-image {
  width: calc(100% - 24px);
  aspect-ratio: 1;
  max-height: 260px;
  margin: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  filter: contrast(1.12) saturate(0.86);
}

.risk-output {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.risk-output > span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.risk-output.good {
  border-color: rgba(152, 198, 110, 0.52);
}

.risk-output.warn {
  border-color: rgba(215, 169, 77, 0.56);
}

.risk-output.danger {
  border-color: rgba(214, 91, 69, 0.62);
}

.risk-output ul {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.artifact-scan-meta {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(150, 170, 112, 0.2);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.2);
}

.artifact-scan-meta strong {
  color: var(--text);
}

.artifact-scan-meta small {
  color: var(--muted);
  line-height: 1.35;
}

.roll-strip {
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
}

.roll-strip span {
  flex: 1;
  min-height: 30px;
  border: 1px solid var(--line);
  padding: 7px 6px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: center;
  text-transform: uppercase;
}

.log-entry {
  padding: 9px;
}

.log-entry span {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.log-entry p {
  margin-top: 4px;
  font-size: 0.8rem;
}

.live-map-panel {
  grid-column: 1 / -1;
  overflow: hidden;
}

.leaflet-map {
  width: calc(100% - 24px);
  height: 320px;
  height: clamp(240px, 38vh, 360px);
  height: clamp(240px, 38svh, 360px);
  min-height: 240px;
  max-height: 360px;
  margin: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: #0b0f0a;
  touch-action: pan-x pan-y;
}

.leaflet-container {
  position: relative;
  overflow: hidden;
  font-family: var(--font-ui);
  background: #0b0f0a;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  top: 0;
  left: 0;
}

.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  user-select: none;
}

.leaflet-map-pane {
  z-index: auto;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  clear: both;
  pointer-events: auto;
}

.leaflet-left .leaflet-control {
  float: left;
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  float: right;
  margin-right: 10px;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--text);
  background: rgba(12, 16, 11, 0.96);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 9px 10px;
  line-height: 1.35;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  color: var(--green-strong) !important;
  background: rgba(8, 10, 8, 0.92) !important;
  border-color: var(--line) !important;
}

.poi-marker {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--bg-strong);
  border-radius: 50%;
  color: #10140f;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 900;
  background: var(--green-strong);
  box-shadow: 0 0 0 2px rgba(192, 232, 137, 0.55), 0 4px 14px rgba(0, 0, 0, 0.45);
}

.poi-editable {
  cursor: grab;
  touch-action: none;
}

.poi-selected {
  border-color: var(--green-strong);
  box-shadow:
    0 0 0 3px rgba(192, 232, 137, 0.8),
    0 0 18px rgba(192, 232, 137, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.45);
}

.poi-duty {
  background: var(--amber);
}

.poi-shelter {
  background: var(--cyan);
}

.poi-anomaly,
.poi-artifact {
  background: var(--red);
}

.poi-quest {
  background: #d7e4bf;
}

.map-control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 12px;
}

.map-gm-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.map-gm-tools .wide {
  grid-column: 1 / -1;
}

.map-gm-tools .active {
  border-color: var(--green);
  color: var(--bg-strong);
  background: var(--green-strong);
}

.map-gm-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.map-layer-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.layer-toggle {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.22);
}

.layer-toggle input {
  min-height: auto;
  width: auto;
}

.map-status {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  margin: 0 12px 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.26);
}

.map-status strong,
.map-status span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.map-status strong {
  color: var(--green-strong);
  text-transform: uppercase;
}

.map-status span {
  color: var(--muted);
  line-height: 1.35;
}

.map-status.good span {
  color: var(--green-strong);
}

.map-status.danger span {
  color: var(--red);
}

.map-status.editor strong,
.map-status.editor span {
  color: var(--amber);
}

.map-fallback {
  display: grid;
  height: 100%;
  min-height: 100%;
  place-items: center;
  padding: 18px;
  color: var(--amber);
  font-family: var(--font-mono);
  text-align: center;
  text-transform: uppercase;
}

.map-item-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.map-list-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px;
  text-align: left;
}

.map-list-row span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--bg-strong);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 900;
  background: var(--zone-color, var(--green));
}

.map-list-row strong {
  color: var(--text);
}

.map-list-row small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.map-list-row.active {
  border-color: var(--green);
  background: rgba(43, 61, 31, 0.74);
}

.map-editor-panel {
  grid-column: 1 / -1;
}

.map-editor-grid {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.map-editor-section {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(150, 170, 112, 0.2);
  border-radius: 6px;
  padding: 10px;
  background: rgba(7, 10, 7, 0.3);
}

.map-editor-section h4 {
  margin: 0;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

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

.editor-hint,
.empty-map-list {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.35;
}

.empty-map-list {
  padding: 4px;
}

.zone-draft-label {
  border: 0;
  color: #0d100c;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 900;
  background: transparent;
  box-shadow: none;
}

.quick-action-panel {
  margin: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.quick-action-panel h4,
.compact-title {
  margin: 0 0 8px;
}

.token-card {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
  padding: 10px;
}

.token-card small,
.token-card code,
.item-edit-row small,
.item-edit-row code,
.punishment-admin-row span,
.punishment-admin-row small,
.qr-sheet-item span,
.qr-sheet-item code {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.token-card img {
  width: 92px;
  height: 92px;
  padding: 6px;
  border-radius: 4px;
  background: #f2f5e8;
}

.item-edit-row,
.account-row,
.info-edit-row,
.punishment-template-row,
.punishment-admin-row {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.item-edit-row {
  grid-template-columns: 1fr 92px;
  align-items: start;
}

.item-edit-row > label,
.item-edit-row > button {
  grid-column: 1 / -1;
}

.item-edit-row img {
  width: 92px;
  height: 92px;
  padding: 6px;
  border-radius: 4px;
  background: #f2f5e8;
}

.item-edit-row p,
.account-row p,
.punishment-admin-row p {
  margin-top: 6px;
  font-size: 0.8rem;
}

.account-row > div,
.account-row > label,
.account-row > button,
.account-row .checkbox-grid {
  min-width: 0;
}

.account-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.info-layout {
  display: grid;
  gap: 10px;
}

.info-hero {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.info-search {
  margin: 0;
}

.info-category-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 2px;
  scrollbar-width: thin;
}

.info-category-filter button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(150, 170, 112, 0.28);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(7, 10, 6, 0.58);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.info-category-filter button.active {
  border-color: var(--green-strong);
  color: var(--bg-strong);
  background: var(--green);
  box-shadow: 0 0 18px rgba(152, 198, 110, 0.18);
}

.info-post-list {
  display: grid;
  gap: 8px;
}

.info-post {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.info-post-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  width: 100%;
  min-height: 84px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.info-post-toggle:hover,
.info-post-toggle:focus-visible {
  background: rgba(152, 198, 110, 0.08);
}

.info-indicator {
  color: var(--green-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
}

.info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
  align-items: center;
}

.info-category,
.info-edit-row small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.info-meta small {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
}

.info-post-toggle strong {
  grid-column: 2;
  min-width: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.info-preview {
  grid-column: 2;
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.info-full {
  padding: 0 10px 12px 34px;
}

.info-full p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.info-post-image,
.info-image-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(150, 170, 112, 0.24);
}

.info-post-image {
  width: 64px;
  height: 48px;
  margin: 0 10px 10px 34px;
  border-radius: 4px;
  opacity: 0.82;
}

.info-post.expanded .info-post-image {
  width: calc(100% - 20px);
  height: auto;
  max-height: 280px;
  margin: 0 10px 10px;
  opacity: 1;
}

.info-post.tone-amber {
  border-color: rgba(215, 169, 77, 0.45);
}

.info-post.tone-red {
  border-color: rgba(214, 91, 69, 0.48);
}

.info-post.tone-blue {
  border-color: rgba(105, 160, 178, 0.42);
}

.info-empty {
  padding: 18px 12px;
}

.info-empty .empty-state {
  text-transform: none;
}

mark {
  padding: 0 2px;
  border-radius: 2px;
  color: var(--bg-strong);
  background: var(--green-strong);
}

.info-edit-row img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 5px;
}

.info-edit-row > label,
.info-edit-row > button {
  min-width: 0;
}

.punishment-template-row label {
  min-width: 0;
}

.print-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.qr-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.print-page {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 14px;
}

.print-page-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.print-page-controls > div:first-child {
  display: grid;
  gap: 4px;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.print-page-controls span {
  color: var(--muted);
  font-size: 0.75rem;
}

.print-page-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 6, 4, 0.72);
}

.print-sheet-title {
  display: grid;
  gap: 4px;
  padding: 14px 14px 0;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.print-sheet-title h1 {
  margin: 0;
  color: var(--green-strong);
  font-size: 1.1rem;
}

.print-sheet-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.qr-sheet-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-style: dashed;
  break-inside: avoid;
}

.qr-sheet-item img {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  justify-self: center;
  padding: 8px;
  background: #f2f5e8;
}

.qr-sheet-item p,
.qr-sheet-item small {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.32;
}

.qr-sheet-item small {
  color: var(--amber);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.audit-entry {
  border-color: rgba(215, 169, 77, 0.26);
}

.danger-button {
  color: var(--red);
}

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

.zone {
  display: grid;
  min-height: 92px;
  align-content: space-between;
  justify-items: start;
  padding: 10px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(111, 124, 71, 0.18), rgba(7, 9, 7, 0.5)),
    rgba(5, 7, 5, 0.5);
}

.zone span {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.zone strong {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 1.2rem;
}

.zone.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(152, 198, 110, 0.2);
}

.hazard-readout {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 12px;
  align-items: center;
  margin: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.hazard-readout span,
.data-row span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.hazard-readout strong {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 1.8rem;
  text-align: right;
}

.data-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.data-row strong {
  color: var(--text);
  text-align: right;
}

.world-event {
  padding: 10px;
}

.world-event span {
  display: block;
  margin: 4px 0 6px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.world-event.warning {
  border-color: rgba(215, 169, 77, 0.5);
}

.world-event.critical {
  border-color: rgba(214, 91, 69, 0.6);
}

.emission-control-panel {
  display: grid;
  gap: 12px;
}

.run-game-panel {
  display: grid;
  gap: 12px;
  border-color: rgba(215, 169, 77, 0.32);
  background: rgba(0, 0, 0, 0.12);
}

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

.run-control-grid button {
  min-height: 52px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.emission-status-card {
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 8px;
  align-items: stretch;
}

.emission-status-card div,
.emission-roster-row {
  border: 1px solid rgba(150, 170, 112, 0.22);
  border-radius: 5px;
  padding: 9px;
  background: rgba(0, 0, 0, 0.22);
}

.emission-status-card.warning div {
  border-color: rgba(215, 169, 77, 0.4);
}

.emission-status-card.active div,
.emission-status-card.ended div {
  border-color: rgba(214, 91, 69, 0.46);
}

.emission-status-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green-strong);
  font-family: var(--font-mono);
}

.emission-status-card.active strong,
.emission-status-card.ended strong {
  color: var(--red);
}

.emission-roster {
  display: grid;
  gap: 8px;
}

.emission-roster-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.emission-roster-row > div {
  min-width: 0;
}

.emission-roster-row strong,
.emission-roster-row span {
  display: block;
}

.emission-roster-row .mini-button {
  grid-column: 1 / -1;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
}

.admin-tabs button {
  min-height: 40px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.admin-tabs button.active {
  color: var(--green-strong);
  border-color: var(--green);
  background: rgba(43, 61, 31, 0.74);
}

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

.metric-grid div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--green-strong);
  font-family: var(--font-mono);
  font-size: 1.5rem;
}

.editor-panel {
  overflow: hidden;
}

.editor-section,
.create-quest {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.editor-section h4,
.create-quest h4 {
  margin: 0 0 10px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(150, 170, 112, 0.2);
  border-radius: 4px;
  padding: 8px;
  color: var(--text);
  background: rgba(7, 10, 7, 0.3);
  text-transform: none;
}

.check-row input {
  min-height: auto;
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.quest-template-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
}

.quest-edit-row {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.quest-edit-row code {
  display: block;
  margin-top: 5px;
  padding: 5px 6px;
  overflow-wrap: anywhere;
  color: var(--green-strong);
  background: rgba(0, 0, 0, 0.35);
}

.wide {
  padding-inline: 0;
}

@media (min-width: 560px) {
  .operator-strip span {
    display: inline;
  }

  .emission-banner {
    grid-template-columns: 26px minmax(0, 1fr) auto auto;
  }

  .shelter-button {
    grid-column: auto;
    min-width: 150px;
  }

  .punishment-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
    align-items: center;
  }

  .punishment-card .ghost-button {
    grid-column: 1 / -1;
  }

  .emission-roster-row {
    grid-template-columns: 1fr auto auto;
  }

  .emission-roster-row .mini-button {
    grid-column: auto;
  }

  .profile-core h2 {
    font-size: 1.35rem;
  }

  .quest-card {
    grid-template-columns: 1fr auto;
  }

  .item-edit-row {
    grid-template-columns: 1fr 92px;
  }

  .item-edit-row > label {
    grid-column: auto;
  }

  .item-edit-row > label:last-of-type,
  .item-edit-row > button {
    grid-column: 1 / -1;
  }

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

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

  .account-row > div,
  .account-row .checkbox-grid {
    grid-column: 1 / -1;
  }

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

  .info-edit-row > div,
  .info-edit-row > img,
  .info-edit-row > label:nth-of-type(5),
  .info-edit-row > button {
    grid-column: 1 / -1;
  }

  .punishment-template-row label:last-of-type,
  .punishment-template-row button {
    grid-column: 1 / -1;
  }

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

  .dashboard-grid,
  .scanner-layout,
  .map-layout,
  .station-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-hero,
  .status-panel,
  .scan-panel,
  .zone-map,
  .gm-summary {
    grid-column: 1 / -1;
  }
}

@media (min-width: 860px) {
  body {
    padding: 22px;
  }

  .pda-shell {
    min-height: calc(100vh - 44px);
    border-radius: var(--radius);
  }

  .app-header {
    border-radius: 7px 7px 0 0;
  }

  .app-main {
    padding: 16px;
  }

  .dashboard-grid {
    grid-template-columns: 0.85fr 1fr 1fr;
  }

  .scanner-layout,
  .map-layout {
    grid-template-columns: 1fr 0.9fr 1fr;
  }

  .leaflet-map {
    height: 430px;
    height: min(52vh, 520px);
    max-height: 520px;
  }

  .station-layout,
  .admin-layout {
    grid-template-columns: 0.8fr 1fr;
  }

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

  .admin-tabs,
  .editor-panel {
    grid-column: 1 / -1;
  }

  .quest-edit-row {
    grid-template-columns: 1.3fr 0.5fr 0.7fr 0.7fr;
    align-items: end;
  }

  .punishment-template-row {
    grid-template-columns: 1fr 0.45fr 0.45fr 0.45fr;
    align-items: end;
  }

  .punishment-template-row label:last-of-type {
    grid-column: 1 / 4;
  }

  .punishment-template-row button {
    grid-column: 4;
  }
}

@keyframes warning-pulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.68;
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

@keyframes emission-warning-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    filter: saturate(1);
  }

  50% {
    transform: translate3d(1px, -1px, 0);
    filter: saturate(0.72) contrast(1.12);
  }
}

@keyframes emission-warning-panel {
  0%,
  100% {
    box-shadow: inset 0 0 24px rgba(215, 169, 77, 0.08);
  }

  50% {
    box-shadow:
      inset 0 0 30px rgba(215, 169, 77, 0.18),
      0 0 18px rgba(215, 169, 77, 0.08);
  }
}

@keyframes emission-warning-glitch {
  0%,
  100% {
    transform: translateY(-8%);
    opacity: 0.16;
  }

  45% {
    transform: translateY(4%);
    opacity: 0.26;
  }
}

@keyframes emission-shake {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  25% {
    transform: translate3d(-5px, 3px, 0) rotate(-0.2deg);
  }

  50% {
    transform: translate3d(6px, -4px, 0) rotate(0.22deg);
  }

  75% {
    transform: translate3d(-4px, -5px, 0) rotate(-0.18deg);
  }
}

@keyframes emission-glitch {
  0%,
  100% {
    transform: translateY(-18%);
    opacity: 0.18;
  }

  35% {
    transform: translateY(6%);
    opacity: 0.32;
  }

  70% {
    transform: translateY(22%);
    opacity: 0.2;
  }
}

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

@media print {
  body {
    color: #111;
    background: #fff;
  }

  .app-header,
  .view-tabs,
  .gm-summary,
  .admin-tabs,
  .print-controls,
  .print-page-controls,
  .ops-banner,
  .broadcast-stack,
  .emission-banner,
  .punishment-card {
    display: none !important;
  }

  .pda-shell,
  .print-page,
  .print-page-sheet,
  .panel,
  .editor-panel {
    max-width: none;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  .print-sheet-title h1,
  .print-sheet-title p {
    color: #111;
  }

  .qr-sheet {
    grid-template-columns: repeat(3, 1fr);
  }

  .qr-sheet-item {
    break-inside: avoid;
    border: 1px solid #222;
    color: #111;
    background: #fff;
  }

  .qr-sheet-item * {
    color: #111 !important;
  }
}
