:root {
  color-scheme: dark;
  --field: oklch(0.1 0 0);
  --field-deep: oklch(0.075 0 0);
  --surface: oklch(0.145 0.006 80);
  --surface-raised: oklch(0.185 0.008 80);
  --surface-hover: oklch(0.225 0.01 80);
  --line: oklch(0.29 0.01 80);
  --line-strong: oklch(0.4 0.012 80);
  --ink: oklch(0.96 0.01 80);
  --ink-soft: oklch(0.82 0.012 80);
  --muted: oklch(0.7 0.012 80);
  --amber: oklch(0.75 0.148 80);
  --amber-bright: oklch(0.82 0.16 83);
  --amber-wash: oklch(0.24 0.055 80);
  --thermal-red: oklch(0.55 0.21 25);
  --thermal-magenta: oklch(0.6 0.23 350);
  --thermal-orange: oklch(0.68 0.2 50);
  --thermal-yellow: oklch(0.86 0.18 95);
  --cyan: oklch(0.76 0.15 200);
  --cyan-wash: oklch(0.23 0.055 200);
  --telegram: oklch(0.69 0.15 235);
  --telegram-hover: oklch(0.75 0.14 235);
  --success: oklch(0.72 0.17 145);
  --success-wash: oklch(0.22 0.045 145);
  --error: oklch(0.66 0.21 28);
  --error-wash: oklch(0.22 0.055 28);
  --spectral-field: #16082b;
  --spectral-ink: #fcfaff;
  --spectral-peach: #efa777;
  --spectral-yellow: #ebe381;
  --spectral-cyan: #89bfcb;
  --spectral-blue: #2e3b5e;
  --font-ui: "Onest", Arial, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --text-micro: 0.75rem;
  --text-small: 0.875rem;
  --text-body: 1rem;
  --text-lead: 1.125rem;
  --text-title: 1.25rem;
  --text-wordmark: 1.5rem;
  --text-heading: 1.75rem;
  --text-screen: 2rem;
  --text-display: 2.5rem;
  --text-hero: 3.5rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 3rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --z-map: 1;
  --z-sticky: 20;
  --z-backdrop: 40;
  --z-modal: 50;
  --z-toast: 60;
}

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

html {
  min-width: 20rem;
  background: var(--field-deep);
  font-family: var(--font-ui);
  font-size: 16px;
  font-kerning: normal;
  font-optical-sizing: auto;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: var(--field-deep);
  color: var(--ink);
  line-height: 1.5;
}

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

button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

code,
.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

::selection {
  background: var(--amber);
  color: var(--field);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.7rem 0.75rem;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--amber);
  outline: none;
  background: var(--surface-raised);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 2px var(--field), 0 0 0 4px var(--amber);
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.wordmark {
  color: var(--amber);
  font-size: var(--text-wordmark);
  font-weight: 780;
  line-height: 1;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  font-size: var(--text-small);
  font-weight: 650;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 100ms var(--ease-out);
}

.button svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button--primary {
  background: var(--amber);
  color: var(--field);
}

.button--primary:hover:not(:disabled) {
  background: var(--amber-bright);
}

.button--ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.button--ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink);
}

.button--success {
  background: var(--success-wash);
  color: var(--success);
}

.button--wide {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 100ms var(--ease-out);
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--surface-hover);
  color: var(--ink);
}

.icon-button:active:not(:disabled) {
  transform: scale(0.94);
}

.icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-button--small {
  width: 2rem;
  height: 2rem;
  flex-basis: 2rem;
}

.icon-button--primary {
  background: var(--amber);
  color: var(--field);
}

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

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--amber);
  font-size: var(--text-small);
  font-weight: 650;
}

.section-label svg {
  width: 1.125rem;
  height: 1.125rem;
}

.status-chip,
.type-chip {
  display: inline-flex;
  min-height: 1.75rem;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  color: var(--ink-soft);
  font-size: var(--text-micro);
  font-weight: 600;
}

.status-chip svg {
  width: 0.875rem;
  height: 0.875rem;
}

.status-chip--active {
  border-color: var(--success);
  background: var(--success-wash);
  color: var(--success);
}

.status-chip i,
.status-dot i {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--muted);
  font-size: var(--text-micro);
}

.status-dot i {
  color: var(--success);
  box-shadow: 0 0 0 0.25rem var(--success-wash);
}

.inline-alert,
.form-error {
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  background: var(--error-wash);
  color: var(--error);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-small);
}

.input-action-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-sm);
}

.input-action-row > input {
  min-width: 0;
}

.empty-state {
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-md);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--space-2xl);
}

.empty-state > svg {
  color: var(--amber);
}

.empty-state h2 {
  font-size: var(--text-title);
}

.empty-state p {
  max-width: 40ch;
  color: var(--muted);
}

.empty-state--transparent {
  border: 0;
  background: transparent;
}

.thermal-loader {
  width: 10rem;
  height: 0.25rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.thermal-loader::after {
  display: block;
  width: 48%;
  height: 100%;
  background: linear-gradient(90deg, var(--thermal-magenta), var(--thermal-orange), var(--thermal-yellow));
  content: "";
  animation: loading-scan 1.1s var(--ease-out) infinite alternate;
}

@keyframes loading-scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(220%); }
}

/* Case catalog */
.catalog-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--spectral-field);
  color: var(--spectral-ink);
  --field: #16082b;
  --field-deep: #0d0618;
  --surface: #1d1036;
  --surface-raised: #281746;
  --surface-hover: #2f1c4e;
  --line: rgb(137 191 203 / 20%);
  --line-strong: rgb(137 191 203 / 38%);
  --ink: var(--spectral-ink);
  --ink-soft: #ddd6eb;
  --muted: #b9aecb;
  --amber: #ebe381;
  --amber-bright: #f4efa6;
  --amber-wash: rgb(235 227 129 / 12%);
  --cyan: #89bfcb;
  --cyan-wash: rgb(137 191 203 / 12%);
}

.catalog-header,
.catalog-footer,
.catalog-main {
  width: min(100% - 2rem, 78rem);
  margin-inline: auto;
}

.catalog-header {
  display: flex;
  min-height: 4.75rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.catalog-header .wordmark {
  color: var(--spectral-yellow);
}

.catalog-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.catalog-account {
  display: inline-flex;
  min-height: 2.75rem;
  max-width: 16rem;
  align-items: center;
  gap: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: transparent;
  padding: 0.55rem 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: var(--text-micro);
}

.catalog-account:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink);
}

.catalog-account svg {
  width: 1rem;
  flex: 0 0 auto;
  color: var(--cyan);
}

.catalog-account span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-main {
  padding-block: 0 5rem;
}

.catalog-hero {
  display: grid;
  min-height: 38rem;
  grid-template-columns: minmax(20rem, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: var(--space-lg);
  padding-block: var(--space-2xl) var(--space-3xl);
}

.catalog-hero__copy {
  position: relative;
  z-index: 2;
  max-width: 37rem;
  padding-right: var(--space-2xl);
}

.catalog-hero__copy .section-label {
  color: var(--spectral-cyan);
}

.catalog-hero__copy h1 {
  max-width: 16ch;
  margin-top: var(--space-lg);
  font-size: var(--text-hero);
  font-weight: 760;
  line-height: 1.04;
}

.catalog-hero__copy h1 span {
  display: block;
  white-space: nowrap;
}

.catalog-hero__copy > p:last-child {
  max-width: 40rem;
  margin-top: var(--space-xl);
  color: var(--muted);
  font-size: var(--text-lead);
  line-height: 1.6;
}

.ascii-logo {
  position: relative;
  min-width: 0;
  min-height: 32rem;
  overflow: hidden;
  border: 1px solid rgb(137 191 203 / 18%);
  border-radius: var(--radius-lg);
  background: var(--field-deep);
  cursor: grab;
  isolation: isolate;
  touch-action: pan-y;
}

.ascii-logo:active {
  cursor: grabbing;
}

.ascii-logo__output {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: none;
  margin: 0;
  background: linear-gradient(112deg,
    var(--spectral-peach) 0%,
    var(--spectral-yellow) 48%,
    var(--spectral-cyan) 100%);
  background-size: 100% 100%;
  background-clip: text;
  color: transparent;
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-weight: 600;
  filter: drop-shadow(0 1px 1px rgb(13 6 24 / 90%)) drop-shadow(0 0 3px rgb(13 6 24 / 58%));
  letter-spacing: 0;
  line-height: 0.9;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, -50%);
  user-select: none;
  white-space: pre;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .ascii-logo__output {
    background: none;
    color: var(--spectral-yellow);
    -webkit-text-fill-color: currentColor;
  }
}

.ascii-logo__meta {
  position: absolute;
  z-index: 2;
  right: var(--space-lg);
  bottom: var(--space-lg);
  left: var(--space-lg);
  display: flex;
  justify-content: space-between;
  color: rgb(252 250 255 / 68%);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  pointer-events: none;
}

.catalog-spectrum-accent {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.catalog-spectrum-accent span {
  width: clamp(8rem, 22vw, 16rem);
  height: 0.1875rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg,
    var(--spectral-peach),
    var(--spectral-yellow) 50%,
    var(--spectral-cyan));
}

.case-list {
  border-top: 1px solid var(--line);
}

.case-row {
  display: grid;
  min-height: 13.5rem;
  grid-template-columns: 5rem minmax(0, 1fr) 13rem;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  transition: background-color 180ms var(--ease-out);
}

.case-row:hover {
  background: rgb(46 59 94 / 28%);
}

.case-row--featured {
  min-height: 16rem;
}

.case-index {
  display: grid;
  place-items: start center;
  border-right: 1px solid var(--line);
  padding-top: var(--space-xl);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: var(--text-small);
}

.case-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl) var(--space-2xl);
}

.case-copy__top {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--muted);
  font-size: var(--text-micro);
}

.case-copy h2 {
  margin-top: var(--space-md);
  font-size: var(--text-heading);
  font-weight: 700;
}

.case-copy > p {
  max-width: 55ch;
  margin-top: var(--space-sm);
  color: var(--muted);
}

.case-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  color: var(--ink-soft);
  font-size: var(--text-micro);
}

.case-facts span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.case-facts svg {
  width: 1rem;
  height: 1rem;
  color: var(--amber);
}

.case-start {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: var(--space-xl);
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  text-align: left;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}

.case-start:hover:not(:disabled) {
  background: var(--amber);
  color: var(--field);
}

.case-start svg {
  flex: 0 0 auto;
  transition: transform 180ms var(--ease-out);
}

.case-start:hover svg {
  transform: translateX(0.25rem);
}

.case-start--purchase {
  color: var(--amber);
}

.case-start--purchase:hover:not(:disabled) {
  background: linear-gradient(112deg, var(--spectral-peach), var(--spectral-yellow) 56%, var(--spectral-cyan));
  color: var(--field-deep);
}

/* Email account */
.auth-dialog,
.evidence-dialog {
  width: min(calc(100% - 2rem), 31rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--field);
  color: var(--ink);
  padding: 0;
  box-shadow: 0 1rem 4rem rgb(4 2 11 / 58%);
}

.auth-dialog {
  --field: #16082b;
  --surface: #1d1036;
  --surface-raised: #281746;
  --surface-hover: #2f1c4e;
  --line: rgb(137 191 203 / 20%);
  --line-strong: rgb(137 191 203 / 38%);
  --ink: var(--spectral-ink);
  --ink-soft: #ddd6eb;
  --muted: #b9aecb;
  --amber: var(--spectral-yellow);
  --amber-bright: #f4efa6;
  --cyan: var(--spectral-cyan);
}

.auth-dialog::backdrop,
.evidence-dialog::backdrop {
  background: rgb(6 3 15 / 82%);
  backdrop-filter: blur(0.35rem);
}

.auth-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(112deg, rgb(242 168 132 / 10%), rgb(235 227 129 / 7%) 55%, rgb(137 191 203 / 10%));
  padding: var(--space-xl);
}

.auth-dialog__head h2 {
  max-width: 22rem;
  margin-top: var(--space-sm);
  overflow-wrap: anywhere;
  font-size: var(--text-title);
}

.auth-dialog__body {
  display: grid;
  gap: var(--space-xl);
  padding: var(--space-xl);
}

.auth-dialog__body > p {
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: var(--space-md);
}

.auth-code {
  font-family: var(--font-mono);
  font-size: var(--text-title);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.28em;
  text-align: center;
}

.auth-text-action {
  min-height: 2.75rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-micro);
}

.auth-text-action:hover {
  color: var(--ink);
}

.case-skeleton {
  height: 16rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, var(--field) 30%, var(--surface) 50%, var(--field) 70%);
  background-size: 220% 100%;
  animation: skeleton 1.6s linear infinite;
}

.case-skeleton--short {
  height: 12rem;
}

@keyframes skeleton {
  to { background-position-x: -220%; }
}

.catalog-footer {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
}

/* Login */
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--field);
  padding: var(--space-xl);
}

.login-back {
  position: fixed;
  top: var(--space-xl);
  left: var(--space-xl);
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: var(--space-sm);
  color: var(--muted);
  font-size: var(--text-small);
}

.login-back:hover {
  color: var(--ink);
}

.login-back svg {
  width: 1.125rem;
}

.login-panel {
  width: min(100%, 27rem);
  border-top: 2px solid var(--amber);
  background: var(--surface);
  padding: var(--space-2xl);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.login-copy {
  margin-top: var(--space-3xl);
}

.login-copy h1 {
  font-size: var(--text-screen);
  line-height: 1.15;
}

.login-copy p {
  margin-top: var(--space-md);
  color: var(--muted);
}

.login-copy code {
  color: var(--amber);
  font-size: var(--text-micro);
}

.login-form {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.login-form > label,
.manual-code > label,
.answer-form > label {
  font-size: var(--text-small);
  font-weight: 620;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 3.5rem;
}

.password-field .icon-button {
  position: absolute;
  top: 0;
  right: 0;
}

/* Map */
.map-canvas {
  position: relative;
  min-height: 18rem;
  overflow: hidden;
  background: var(--surface);
}

.map-canvas .leaflet-container,
.map-canvas.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: inherit;
  z-index: var(--z-map);
  background: var(--surface);
  font-family: var(--font-ui);
}

.map-canvas .leaflet-tile-pane {
  filter: grayscale(1) invert(0.91) sepia(0.08) saturate(0.65) brightness(0.58) contrast(1.15);
}

.map-canvas .leaflet-control-attribution {
  background: var(--field);
  color: var(--muted);
  font-size: var(--text-micro);
}

.map-canvas .leaflet-control-attribution a {
  color: var(--ink-soft);
}

.map-edit-hint {
  position: absolute;
  z-index: 10;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  padding: 0.45rem 0.65rem;
  color: var(--ink-soft);
  font-size: var(--text-micro);
  white-space: nowrap;
}

.map-canvas--editable {
  cursor: crosshair;
}

/* Player */
body.player-theme {
  --field: #16082b;
  --field-deep: #0d0618;
  --player-gutter: #081626;
  --surface: #1d1036;
  --surface-raised: #281746;
  --surface-hover: #2f1c4e;
  --line: rgb(137 191 203 / 20%);
  --line-strong: rgb(137 191 203 / 38%);
  --ink: var(--spectral-ink);
  --ink-soft: #ddd6eb;
  --muted: #b9aecb;
  --amber: var(--spectral-yellow);
  --amber-bright: #f4efa6;
  --amber-wash: #39343d;
  --cyan: var(--spectral-cyan);
  --cyan-wash: #22384a;
  --player-spectral-surface:
    linear-gradient(rgb(22 8 43 / 76%), rgb(22 8 43 / 88%)),
    radial-gradient(ellipse 88% 48% at 92% 8%,
      var(--spectral-peach) 0%,
      var(--spectral-yellow) 22%,
      var(--spectral-cyan) 44%,
      var(--spectral-blue) 65%,
      var(--spectral-field) 84%);
  position: relative;
  isolation: isolate;
  background: var(--player-gutter);
}

body.player-theme > #root {
  position: relative;
  z-index: 1;
}

@media (min-width: 48.0625rem) {
  body.player-theme::before,
  body.player-theme::after {
    position: fixed;
    z-index: 0;
    border-radius: var(--radius-pill);
    content: "";
    pointer-events: none;
  }

  body.player-theme::before {
    top: 18vh;
    left: max(1.25rem, calc(50% - 20.5rem));
    width: 0.1875rem;
    height: 6rem;
    background: linear-gradient(180deg,
      var(--spectral-peach),
      var(--spectral-yellow) 50%,
      var(--spectral-cyan));
  }

  body.player-theme::after {
    right: max(1.25rem, calc(50% - 20.5rem));
    bottom: 17vh;
    width: 3rem;
    height: 0.1875rem;
    background: linear-gradient(90deg,
      var(--spectral-peach),
      var(--spectral-yellow) 50%,
      var(--spectral-cyan));
  }
}

.player-app {
  position: relative;
  width: min(100%, 34rem);
  min-height: 100dvh;
  margin-inline: auto;
  overflow: clip;
  background: var(--player-spectral-surface), var(--field);
  box-shadow: 0 0 0 1px var(--line);
  isolation: isolate;
}

.player-app--heat::after {
  position: fixed;
  z-index: var(--z-toast);
  inset: 0;
  background: linear-gradient(115deg, transparent 15%, var(--thermal-magenta) 42%, var(--thermal-orange) 58%, var(--thermal-yellow) 78%, transparent 96%);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: heat-flash 800ms var(--ease-out);
  mix-blend-mode: screen;
}

@keyframes heat-flash {
  0% { opacity: 0; transform: translateX(-50%); }
  35% { opacity: 0.24; }
  100% { opacity: 0; transform: translateX(50%); }
}

.player-header {
  position: sticky;
  z-index: var(--z-sticky);
  top: 0;
  display: grid;
  min-height: calc(4.25rem + env(safe-area-inset-top));
  grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid var(--line);
  background: #16082b;
  padding: env(safe-area-inset-top) var(--space-md) 0;
}

.player-title {
  min-width: 0;
  text-align: center;
}

.player-title strong,
.player-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-title strong {
  font-size: var(--text-small);
}

.player-title span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
}

.evidence-counter {
  position: relative;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}

.evidence-counter:hover,
.evidence-counter:focus-visible {
  background: var(--surface-hover);
  color: var(--ink);
}

.evidence-counter svg {
  width: 1.25rem;
}

.evidence-counter span {
  position: absolute;
  top: 0.15rem;
  right: 0.05rem;
  display: grid;
  min-width: 1.05rem;
  height: 1.05rem;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--amber);
  color: var(--field);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 700;
}

.player-main {
  min-height: calc(100dvh - 8.75rem);
}

.player-map-view {
  display: grid;
  min-height: calc(100dvh - 8.75rem);
  grid-template-rows: minmax(17rem, 48dvh) auto;
}

.player-map {
  min-height: 17rem;
}

.map-status-bar {
  position: absolute;
  z-index: 10;
  top: calc(4.25rem + env(safe-area-inset-top) + var(--space-md));
  left: var(--space-md);
  right: var(--space-md);
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--field);
  padding: 0.45rem 0.65rem;
  font-size: var(--text-micro);
}

.map-status-bar span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-status-bar svg {
  width: 1rem;
  flex: 0 0 auto;
  color: var(--cyan);
}

.map-status-bar strong {
  color: var(--cyan);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.objective-sheet {
  position: relative;
  z-index: 5;
  margin-top: -0.75rem;
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--player-spectral-surface), var(--surface);
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.objective-progress {
  height: 0.2rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
}

.objective-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: var(--amber);
  transition: transform 300ms var(--ease-out);
}

.objective-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
}

.type-chip {
  border-color: var(--amber);
  background: var(--amber-wash);
  color: var(--amber);
  font-family: var(--font-ui);
}

.objective-sheet h1 {
  margin-top: var(--space-md);
  font-size: var(--text-heading);
  line-height: 1.15;
}

.objective-sheet > p {
  max-width: 48ch;
  margin-top: var(--space-sm);
  color: var(--ink-soft);
}

.objective-action {
  margin-top: var(--space-lg);
}

.hint-disclosure {
  margin-top: var(--space-md);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.hint-disclosure summary {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--text-small);
  list-style: none;
}

.hint-disclosure summary::-webkit-details-marker {
  display: none;
}

.hint-disclosure svg {
  width: 1rem;
  color: var(--amber);
}

.hint-disclosure p {
  padding: 0 0 var(--space-md) 1.5rem;
  color: var(--ink-soft);
  font-size: var(--text-small);
}

.answer-form {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.interview-action {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.interview-contact {
  display: grid;
  min-height: 4rem;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-md);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: var(--space-md);
}

.interview-contact > span {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--amber);
}

.interview-contact svg {
  width: 1.2rem;
}

.interview-contact div {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.interview-contact strong,
.interview-contact small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interview-contact small,
.interview-intro {
  color: var(--muted);
  font-size: var(--text-small);
}

.interview-intro {
  margin: 0;
}

.interview-action .answer-form {
  margin-top: 0;
  padding-top: var(--space-sm);
}

.button--telegram {
  background: var(--telegram);
  color: var(--field);
}

.button--telegram:hover {
  background: var(--telegram-hover);
}

.player-nav {
  position: sticky;
  z-index: var(--z-sticky);
  bottom: 0;
  display: grid;
  min-height: calc(4.5rem + env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: #16082b;
  padding-bottom: env(safe-area-inset-bottom);
}

.player-nav button {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 4.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-micro);
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}

.player-nav button:hover,
.player-nav button:focus-visible {
  background: var(--surface-hover);
  color: var(--ink-soft);
}

.player-nav button.active {
  color: var(--amber);
}

.player-nav button.active::before {
  position: absolute;
  top: -1px;
  width: 2rem;
  height: 2px;
  background: var(--amber);
  content: "";
}

.player-nav svg {
  width: 1.25rem;
  height: 1.25rem;
}

.player-nav i {
  position: absolute;
  top: 0.55rem;
  left: calc(50% + 0.55rem);
  display: grid;
  min-width: 1rem;
  height: 1rem;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--amber);
  color: var(--field);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-style: normal;
  font-weight: 700;
}

.player-document-view {
  min-height: calc(100dvh - 8.75rem);
  background: var(--player-spectral-surface), var(--field);
  padding: var(--space-xl) var(--space-lg) var(--space-3xl);
}

.document-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-xl);
}

.document-head h1 {
  margin-top: var(--space-sm);
  font-size: var(--text-screen);
  line-height: 1.15;
}

.document-head > strong {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: var(--text-title);
}

.evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-list li {
  border-bottom: 1px solid var(--line);
}

.evidence-list li > button {
  display: grid;
  width: 100%;
  min-height: 8rem;
  grid-template-columns: 3.25rem minmax(0, 1fr) 1.25rem;
  align-items: start;
  gap: var(--space-sm);
  background: transparent;
  padding-block: var(--space-xl);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.evidence-list li > button:hover {
  background: rgb(137 191 203 / 6%);
}

.evidence-number {
  display: grid;
  gap: var(--space-sm);
  color: var(--amber);
  font-family: var(--font-mono);
}

.evidence-number svg {
  width: 1.35rem;
  height: 1.35rem;
}

.evidence-number i {
  color: var(--muted);
  font-size: var(--text-micro);
  font-style: normal;
}

.evidence-copy {
  display: grid;
  min-width: 0;
}

.evidence-copy__meta {
  margin-bottom: var(--space-xs);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
}

.evidence-list strong {
  font-size: var(--text-lead);
}

.evidence-copy > span:not(.evidence-copy__meta) {
  margin-top: var(--space-sm);
  color: var(--ink-soft);
}

.evidence-list time {
  display: block;
  margin-top: var(--space-md);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
}

.evidence-chevron {
  width: 1rem;
  margin-top: 1.5rem;
  transform: rotate(-90deg);
  color: var(--muted);
}

.evidence-dialog {
  --field: #16082b;
  --surface: #1d1036;
  --surface-hover: #2f1c4e;
  --line: rgb(137 191 203 / 20%);
  --line-strong: rgb(137 191 203 / 38%);
  --ink: var(--spectral-ink);
  --ink-soft: #ddd6eb;
  --muted: #b9aecb;
  --amber: var(--spectral-yellow);
  --cyan: var(--spectral-cyan);
}

.evidence-dialog__head {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 2.75rem;
  align-items: start;
  gap: var(--space-md);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(112deg, rgb(239 167 119 / 10%), rgb(235 227 129 / 7%) 55%, rgb(137 191 203 / 10%));
  padding: var(--space-xl);
}

.evidence-dialog__icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--amber);
}

.evidence-dialog__icon svg {
  width: 1.35rem;
}

.evidence-dialog__head > div > span {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
}

.evidence-dialog__head h2 {
  margin-top: var(--space-xs);
  font-size: var(--text-title);
}

.evidence-dialog__body {
  display: grid;
  gap: var(--space-xl);
  padding: var(--space-xl);
}

.evidence-dialog__body > p {
  color: var(--ink-soft);
  font-size: var(--text-lead);
  line-height: 1.65;
}

.evidence-dialog__body > time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
}

.evidence-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.evidence-media--image {
  position: relative;
  display: block;
}

.evidence-media--image img {
  display: block;
  width: 100%;
  max-height: 24rem;
  object-fit: cover;
}

.evidence-media--image span {
  position: absolute;
  right: var(--space-sm);
  bottom: var(--space-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border-radius: var(--radius-sm);
  background: rgb(13 6 24 / 86%);
  padding: 0.4rem 0.55rem;
  font-size: var(--text-micro);
}

.evidence-media--image span svg,
.evidence-media--document > svg {
  width: 1rem;
}

.evidence-media--audio {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  color: var(--cyan);
}

.evidence-media--audio audio {
  width: 100%;
}

.evidence-media--document {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 1rem;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  color: var(--ink-soft);
}

.evidence-media--document:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.evidence-media--document span {
  display: grid;
}

.evidence-media--document small {
  color: var(--muted);
}

.evidence-related {
  display: grid;
  gap: var(--space-sm);
  border-top: 1px solid var(--line);
  padding-top: var(--space-lg);
}

.evidence-related > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
}

.evidence-related strong {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--ink-soft);
  font-size: var(--text-small);
}

.evidence-related svg {
  width: 1rem;
  color: var(--amber);
}

.case-briefing {
  padding-top: var(--space-xl);
}

.case-briefing > p {
  max-width: 65ch;
  color: var(--ink-soft);
  font-size: var(--text-lead);
  line-height: 1.65;
}

.case-briefing dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: var(--space-2xl) 0;
  border-top: 1px solid var(--line);
}

.case-briefing dl > div {
  border-bottom: 1px solid var(--line);
  padding: var(--space-lg) 0;
}

.case-briefing dt {
  color: var(--muted);
  font-size: var(--text-micro);
}

.case-briefing dd {
  margin: 0.25rem 0 0;
  font-weight: 620;
}

.case-briefing .safety-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--space-lg);
  color: var(--muted);
  font-size: var(--text-small);
}

.safety-note svg {
  width: 1.125rem;
  flex: 0 0 auto;
  color: var(--amber);
}

.completion-view {
  display: flex;
  min-height: calc(100dvh - 8.75rem);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background:
    linear-gradient(rgb(22 8 43 / 76%), rgb(22 8 43 / 88%)),
    radial-gradient(ellipse 95% 54% at 92% 52%,
      var(--spectral-peach) 0%,
      var(--spectral-yellow) 22%,
      var(--spectral-cyan) 44%,
      var(--spectral-blue) 65%,
      var(--spectral-field) 84%),
    var(--field);
  padding: var(--space-2xl);
}

.completion-signal {
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  border: 1px solid var(--thermal-orange);
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--thermal-yellow), var(--thermal-orange) 34%, var(--thermal-magenta) 68%, var(--field) 70%);
  color: var(--field);
}

.completion-signal svg {
  width: 2rem;
}

.completion-view .section-label {
  margin-top: var(--space-2xl);
}

.completion-view h1 {
  max-width: 14ch;
  margin-top: var(--space-md);
  font-size: var(--text-display);
  line-height: 1.05;
}

.completion-view > p {
  max-width: 42ch;
  margin-top: var(--space-lg);
  color: var(--muted);
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
}

.player-loading,
.admin-loading,
.fatal-state {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  background: var(--field);
  color: var(--muted);
  text-align: center;
}

.fatal-state {
  padding: var(--space-xl);
}

.fatal-state > svg {
  color: var(--error);
}

.fatal-state h1 {
  color: var(--ink);
}

body.player-theme .player-loading,
body.player-theme .fatal-state {
  background:
    linear-gradient(rgb(22 8 43 / 76%), rgb(22 8 43 / 88%)),
    radial-gradient(ellipse 82% 52% at 50% 50%,
      var(--spectral-peach) 0%,
      var(--spectral-yellow) 22%,
      var(--spectral-cyan) 44%,
      var(--spectral-blue) 65%,
      var(--spectral-field) 84%),
    var(--field);
}

/* Scanner */
.scanner-dialog {
  width: min(100% - 2rem, 31rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--field);
  color: var(--ink);
  padding: 0;
  box-shadow: 0 0.5rem 0.75rem oklch(0 0 0 / 0.45);
}

body.player-theme .scanner-dialog {
  background: var(--player-spectral-surface), var(--field);
}

.scanner-dialog::backdrop {
  background: oklch(0.03 0 0 / 0.88);
}

body.player-theme .scanner-dialog::backdrop {
  background: rgb(13 6 24 / 92%);
}

.scanner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.scanner-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--amber);
  font-size: var(--text-micro);
  font-weight: 650;
}

.scanner-head h2 {
  margin-top: var(--space-sm);
  font-size: var(--text-title);
}

.scanner-viewport {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.scanner-reader,
.scanner-reader > div,
.scanner-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.scanner-reader img,
.scanner-reader button,
.scanner-reader select {
  display: none !important;
}

.scan-reticle {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-reticle i {
  position: absolute;
  width: 3.5rem;
  height: 3.5rem;
  border-color: var(--amber);
  border-style: solid;
}

.scan-reticle i:nth-child(1) { top: 18%; left: 18%; border-width: 3px 0 0 3px; }
.scan-reticle i:nth-child(2) { top: 18%; right: 18%; border-width: 3px 3px 0 0; }
.scan-reticle i:nth-child(3) { bottom: 18%; left: 18%; border-width: 0 0 3px 3px; }
.scan-reticle i:nth-child(4) { right: 18%; bottom: 18%; border-width: 0 3px 3px 0; }

.scan-reticle span {
  position: absolute;
  top: 20%;
  left: 18%;
  width: 64%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--thermal-magenta), var(--thermal-yellow), transparent);
  box-shadow: 0 0 0.5rem var(--thermal-orange);
  animation: scan-line 2.1s ease-in-out infinite alternate;
}

@keyframes scan-line {
  to { transform: translateY(13rem); }
}

.scanner-dialog .form-error {
  margin: var(--space-lg) var(--space-lg) 0;
}

.manual-code {
  display: grid;
  gap: var(--space-sm);
  background: var(--surface);
  padding: var(--space-lg) var(--space-lg) max(var(--space-lg), env(safe-area-inset-bottom));
}

.manual-code > label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Toast */
.toast {
  position: fixed;
  z-index: var(--z-toast);
  top: max(var(--space-lg), env(safe-area-inset-top));
  left: 50%;
  display: grid;
  width: min(calc(100% - 2rem), 30rem);
  min-height: 3.5rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  transform: translateX(-50%);
  border: 1px solid currentColor;
  border-radius: var(--radius-md);
  background: var(--field);
  padding: var(--space-sm) var(--space-md);
  box-shadow: 0 0.4rem 0.5rem oklch(0 0 0 / 0.35);
  font-size: var(--text-small);
  animation: toast-in 220ms var(--ease-out);
}

.toast > svg {
  width: 1.25rem;
}

.toast--success { color: var(--success); }
.toast--error { color: var(--error); }
.toast .icon-button { color: currentColor; }

.toast .icon-button--small {
  width: 2.75rem;
  height: 2.75rem;
  flex-basis: 2.75rem;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -0.75rem); }
}

/* Admin */
.admin-app {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 15rem minmax(0, 1fr);
  grid-template-rows: 4.25rem minmax(0, 1fr);
  overflow: hidden;
  background: var(--field);
}

.admin-topbar {
  z-index: var(--z-sticky);
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: 15rem minmax(0, 1fr) auto auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--field);
  padding-right: var(--space-md);
}

.admin-topbar > .wordmark {
  display: flex;
  height: 100%;
  align-items: center;
  border-right: 1px solid var(--line);
  padding-inline: var(--space-xl);
}

.admin-menu {
  display: none;
}

.admin-case-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-md);
  padding-inline: var(--space-xl);
}

.admin-case-title span {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-case-title i {
  flex: 0 0 auto;
  color: var(--success);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-style: normal;
}

.admin-case-title i.is-dirty {
  color: var(--amber);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.admin-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, auto);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.15rem;
}

.admin-mode-switch button {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--radius-sm);
  background: transparent;
  padding-inline: var(--space-md);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-micro);
  font-weight: 620;
}

.admin-mode-switch button.active {
  background: var(--amber-wash);
  color: var(--amber);
}

.admin-mode-switch svg {
  width: 1rem;
}

.admin-mode-switch i {
  min-width: 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-style: normal;
  text-align: center;
}

.admin-sidebar {
  display: flex;
  min-width: 0;
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-mobile-head {
  display: none;
}

.sidebar-section-head {
  display: flex;
  min-height: 3.75rem;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--space-lg) var(--space-sm);
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 650;
}

.scenario-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-sm) var(--space-lg);
}

.scenario-nav button {
  display: flex;
  width: 100%;
  min-height: 4rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  padding: var(--space-sm) var(--space-md);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
}

.scenario-nav button:hover {
  background: var(--surface-hover);
}

.scenario-nav button.active {
  border-color: var(--amber);
  background: var(--amber-wash);
  color: var(--ink);
}

.scenario-nav button span {
  width: 100%;
  overflow: hidden;
  font-size: var(--text-small);
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-nav button small {
  color: var(--muted);
  font-size: var(--text-micro);
}

.sidebar-footer {
  display: grid;
  border-top: 1px solid var(--line);
  padding: var(--space-sm);
}

.sidebar-footer button,
.sidebar-footer a {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: var(--space-md);
  border-radius: var(--radius-md);
  background: transparent;
  padding: 0 var(--space-md);
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-micro);
}

.sidebar-footer button:hover,
.sidebar-footer a:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.sidebar-footer svg {
  width: 1rem;
}

.admin-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: 17rem minmax(23rem, 1fr) 23rem;
  overflow: hidden;
}

.step-rail,
.step-inspector {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
}

.step-rail {
  border-right: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-lg);
}

.panel-heading > div {
  display: grid;
  gap: 0.2rem;
}

.panel-heading .section-label {
  color: var(--muted);
  font-size: var(--text-micro);
}

.panel-heading strong {
  font-size: var(--text-small);
}

.step-list {
  margin: 0;
  padding: var(--space-md);
  list-style: none;
}

.step-list li:not(:last-child) {
  position: relative;
  padding-bottom: var(--space-sm);
}

.step-list li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 2.9rem;
  bottom: -0.15rem;
  left: 1.45rem;
  width: 1px;
  background: var(--line);
  content: "";
}

.step-list button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 4rem;
  grid-template-columns: 2rem minmax(0, 1fr) 1.25rem;
  align-items: center;
  gap: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--space-sm);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
}

.step-list button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.step-list button.active {
  border-color: var(--amber);
  background: var(--amber-wash);
  color: var(--ink);
}

.step-order {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--field);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
}

.step-list button.active .step-order {
  border-color: var(--amber);
  color: var(--amber);
}

.step-main {
  min-width: 0;
}

.step-main strong,
.step-main small {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
}

.step-main strong {
  overflow: hidden;
  font-size: var(--text-micro);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-main small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: var(--text-micro);
}

.step-main small svg {
  width: 0.75rem;
  height: 0.75rem;
}

.step-grip {
  width: 1rem;
  color: var(--muted);
}

.add-step-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-xl);
}

.add-step-row select {
  min-width: 0;
}

.admin-map-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--field);
}

.admin-map {
  position: absolute;
  inset: 0;
}

.map-toolbar {
  position: absolute;
  z-index: 12;
  top: var(--space-md);
  left: var(--space-md);
  right: var(--space-md);
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--field);
  padding: 0.45rem 0.75rem;
}

.map-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--ink-soft);
  font-size: var(--text-micro);
}

.map-toolbar svg {
  width: 1rem;
  color: var(--amber);
}

.map-toolbar code {
  color: var(--cyan);
  font-size: var(--text-micro);
}

.step-inspector {
  border-left: 1px solid var(--line);
}

.scenario-settings {
  border-bottom: 1px solid var(--line);
}

.scenario-settings > summary {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-lg);
  cursor: pointer;
  color: var(--ink-soft);
  font-size: var(--text-micro);
  font-weight: 620;
  list-style: none;
}

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

.scenario-settings > summary svg {
  width: 1rem;
}

.scenario-settings > summary svg:last-child {
  margin-left: auto;
  transition: transform 180ms var(--ease-out);
}

.scenario-settings[open] > summary svg:last-child {
  transform: rotate(180deg);
}

.settings-fields {
  display: grid;
  gap: var(--space-lg);
  border-top: 1px solid var(--line);
  padding: var(--space-lg);
}

.inspector-content {
  display: grid;
  gap: var(--space-lg);
  padding: var(--space-lg);
}

.inspector-head {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.inspector-head > div:first-child {
  display: grid;
  gap: 0.15rem;
}

.inspector-head span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
}

.inspector-head strong {
  font-size: var(--text-small);
}

.inspector-head > div:last-child {
  display: flex;
  gap: var(--space-xs);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field > span {
  color: var(--ink-soft);
  font-size: var(--text-micro);
  font-weight: 600;
}

.price-field {
  position: relative;
}

.price-field input {
  padding-right: 3.75rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.price-field > span {
  position: absolute;
  top: 50%;
  right: var(--space-md);
  transform: translateY(-50%);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  pointer-events: none;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(5rem, 0.65fr) minmax(0, 1.35fr);
  align-items: end;
  gap: var(--space-md);
}

.field-grid--three {
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
}

.inspector-block {
  display: grid;
  gap: var(--space-md);
  border-top: 1px solid var(--line);
  padding-top: var(--space-lg);
}

.relation-field {
  display: grid;
  gap: var(--space-sm);
}

.relation-field > span {
  color: var(--ink-soft);
  font-size: var(--text-micro);
  font-weight: 600;
}

.relation-field > div {
  display: grid;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.relation-option {
  cursor: pointer;
}

.relation-option + .relation-option {
  border-top: 1px solid var(--line);
}

.relation-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.relation-option > span {
  display: grid;
  min-height: 2.75rem;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--muted);
}

.relation-option input:checked + span {
  background: var(--amber-wash);
  color: var(--ink);
}

.relation-option input:focus-visible + span {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.relation-option svg {
  width: 1rem;
  color: var(--amber);
}

.relation-option b {
  overflow: hidden;
  font-size: var(--text-micro);
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--amber);
  font-size: var(--text-micro);
  font-weight: 650;
}

.block-title svg {
  width: 1rem;
}

.toggle-field {
  display: grid;
  min-height: 2.75rem;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.toggle-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-field > span {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.toggle-field > span::after {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.toggle-field input:checked + span {
  border-color: var(--amber);
  background: var(--amber-wash);
}

.toggle-field input:checked + span::after {
  transform: translateX(0.95rem);
  background: var(--amber);
}

.toggle-field input:focus-visible + span {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.toggle-field strong {
  font-size: var(--text-micro);
  font-weight: 550;
}

.field-help {
  color: var(--muted);
  font-size: var(--text-micro);
}

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

.qr-preview {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: start;
  gap: var(--space-md);
}

.qr-preview img {
  display: block;
  width: 7.5rem;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--ink);
}

.qr-preview > div {
  display: grid;
  gap: var(--space-md);
}

.qr-preview code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: var(--text-micro);
}

.admin-empty {
  width: min(100% - 3rem, 34rem);
  align-self: center;
  justify-self: center;
}

.admin-workspace--characters {
  grid-template-columns: 18rem minmax(0, 1fr);
}

.character-rail,
.character-editor {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.character-rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.character-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.character-list > button {
  display: grid;
  width: 100%;
  min-height: 5.5rem;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  padding: var(--space-sm);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
}

.character-list > button + button {
  margin-top: var(--space-xs);
}

.character-list > button:hover {
  background: var(--surface-hover);
}

.character-list > button.active {
  border-color: var(--amber);
  background: var(--amber-wash);
  color: var(--ink);
}

.character-list > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.character-list strong,
.character-list small,
.character-list code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-list strong {
  font-size: var(--text-small);
}

.character-list small,
.character-list code,
.character-list > button > i {
  color: var(--muted);
  font-size: var(--text-micro);
}

.character-list code {
  margin-top: 0.15rem;
}

.character-list > button > i {
  grid-column: 2;
  font-style: normal;
}

.character-list > button > i.is-active {
  color: var(--success);
}

.character-avatar {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--amber);
}

.character-avatar svg {
  width: 1.1rem;
}

.character-list-empty {
  padding: var(--space-lg);
  color: var(--muted);
  font-size: var(--text-small);
}

.integration-summary {
  display: grid;
  gap: var(--space-sm);
  border-top: 1px solid var(--line);
  padding: var(--space-md);
}

.integration-summary > div {
  display: grid;
  min-height: 1.5rem;
  grid-template-columns: 0.65rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  color: var(--muted);
  font-size: var(--text-micro);
}

.integration-summary strong {
  max-width: 8rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--error);
}

.integration-dot.is-ready {
  background: var(--success);
}

.character-editor {
  background: var(--field);
}

.character-editor-head,
.character-form-section {
  width: min(100%, 70rem);
  margin-inline: auto;
}

.character-editor-head {
  display: flex;
  min-height: 8rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-2xl);
}

.character-editor-head > div:first-child {
  min-width: 0;
}

.character-editor-head h1 {
  margin-top: var(--space-sm);
  font-size: var(--text-heading);
}

.character-editor-head p {
  margin-top: var(--space-xs);
  color: var(--muted);
}

.character-editor-head > div:last-child {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-md);
}

.toggle-field--compact {
  grid-template-columns: 2.25rem auto;
}

.character-form-section {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: var(--space-2xl);
  border-top: 1px solid var(--line);
  padding: var(--space-2xl);
}

.character-section-title {
  display: grid;
  align-content: start;
  gap: var(--space-xs);
}

.character-section-title span {
  font-size: var(--text-small);
  font-weight: 650;
}

.character-section-title small {
  color: var(--muted);
  font-size: var(--text-micro);
}

.character-fields {
  display: grid;
  gap: var(--space-lg);
}

.character-empty {
  min-height: 100%;
  align-content: center;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 78rem) {
  .admin-workspace {
    grid-template-columns: 15rem minmax(20rem, 1fr) 21rem;
  }

  .admin-workspace--characters {
    grid-template-columns: 16rem minmax(0, 1fr);
  }

  .admin-actions .button--ghost:first-child {
    display: none;
  }
}

@media (max-width: 64rem) {
  .admin-app {
    display: block;
    overflow: visible;
  }

  .admin-topbar {
    position: sticky;
    top: 0;
    display: grid;
    min-height: 4.25rem;
    grid-template-columns: 2.75rem auto minmax(0, 1fr) auto auto;
  }

  .admin-menu {
    display: inline-grid;
    margin-left: var(--space-sm);
  }

  .admin-topbar > .wordmark {
    border: 0;
    padding-inline: var(--space-sm);
  }

  .admin-case-title {
    padding-inline: var(--space-md);
  }

  .admin-case-title i {
    display: none;
  }

  .admin-sidebar {
    position: fixed;
    z-index: var(--z-modal);
    top: 0;
    bottom: 0;
    left: 0;
    width: min(20rem, 88vw);
    transform: translateX(-100%);
    transition: transform 220ms var(--ease-out);
  }

  .admin-sidebar--open {
    transform: translateX(0);
  }

  .sidebar-mobile-head {
    display: flex;
    min-height: 4.25rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 0 var(--space-sm) 0 var(--space-lg);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: var(--z-backdrop);
    inset: 0;
    display: block;
    background: oklch(0.03 0 0 / 0.75);
  }

  .admin-workspace {
    min-height: calc(100dvh - 4.25rem);
    grid-template-columns: 16rem minmax(0, 1fr);
    grid-template-rows: minmax(34rem, calc(100dvh - 4.25rem)) auto;
    overflow: visible;
  }

  .step-rail,
  .admin-map-panel {
    min-height: calc(100dvh - 4.25rem);
  }

  .step-inspector {
    grid-column: 1 / -1;
    min-height: 30rem;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .admin-workspace--characters {
    grid-template-columns: 17rem minmax(0, 1fr);
    grid-template-rows: minmax(34rem, calc(100dvh - 4.25rem));
  }

  .character-rail,
  .character-editor {
    min-height: calc(100dvh - 4.25rem);
  }

  .inspector-content,
  .settings-fields {
    width: min(100%, 44rem);
    margin-inline: auto;
  }
}

@media (max-width: 48rem) {
  .catalog-header,
  .catalog-footer,
  .catalog-main {
    width: min(100% - 1.5rem, 78rem);
  }

  .catalog-header__meta .status-dot {
    display: none;
  }

  .catalog-account {
    width: 2.75rem;
    padding: 0;
    justify-content: center;
  }

  .catalog-account span {
    display: none;
  }

  .catalog-header__meta .button {
    width: 2.75rem;
    padding: 0;
    font-size: 0;
  }

  .catalog-header__meta .button svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .catalog-main {
    padding-top: 0;
  }

  .catalog-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding-block: var(--space-2xl);
  }

  .catalog-hero__copy {
    max-width: 42rem;
    padding-right: 0;
  }

  .catalog-hero__copy h1 {
    font-size: var(--text-display);
  }

  .ascii-logo {
    min-height: 22rem;
  }

  .ascii-logo__meta span:last-child {
    display: none;
  }

  .case-row,
  .case-row--featured {
    min-height: 0;
    grid-template-columns: 3.25rem minmax(0, 1fr);
  }

  .case-index {
    grid-row: 1 / span 2;
  }

  .case-copy {
    padding: var(--space-xl) var(--space-lg);
  }

  .case-copy h2 {
    font-size: var(--text-title);
  }

  .case-start {
    min-height: 3.75rem;
    grid-column: 2;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: var(--space-md) var(--space-lg);
  }

  .catalog-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xs);
    padding-block: var(--space-lg);
  }

  .login-page {
    align-items: start;
    padding: 5.5rem var(--space-md) var(--space-md);
  }

  .login-back {
    top: var(--space-md);
    left: var(--space-md);
  }

  .login-panel {
    padding: var(--space-xl);
  }

  .player-app {
    box-shadow: none;
  }

  .admin-topbar {
    grid-template-columns: 2.75rem auto minmax(0, 1fr) auto auto;
  }

  .admin-case-title {
    display: none;
  }

  .admin-actions {
    grid-column: 5;
  }

  .admin-mode-switch {
    grid-column: 4;
  }

  .admin-mode-switch button {
    width: 2.5rem;
    padding: 0;
    justify-content: center;
  }

  .admin-mode-switch span,
  .admin-mode-switch i {
    display: none;
  }

  .admin-actions .button {
    width: 2.75rem;
    padding: 0;
    font-size: 0;
  }

  .admin-actions .button svg {
    width: 1.15rem;
  }

  .admin-workspace {
    display: block;
  }

  .admin-workspace--characters {
    display: block;
  }

  .step-rail,
  .admin-map-panel,
  .step-inspector {
    min-height: 0;
    overflow: visible;
  }

  .character-rail,
  .character-editor {
    min-height: 0;
    overflow: visible;
  }

  .character-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .character-list {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
  }

  .character-list > button {
    flex: 0 0 16rem;
  }

  .character-list > button + button {
    margin-top: 0;
  }

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

  .integration-summary > div {
    grid-template-columns: 0.65rem minmax(0, 1fr);
  }

  .integration-summary strong {
    grid-column: 2;
    max-width: none;
  }

  .integration-summary .button {
    grid-column: 1 / -1;
  }

  .character-editor-head {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    padding: var(--space-xl) var(--space-lg);
  }

  .character-editor-head > div:last-child {
    width: 100%;
    justify-content: space-between;
  }

  .character-form-section {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: var(--space-xl) var(--space-lg);
  }

  .step-rail {
    border-right: 0;
  }

  .step-list {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .step-list li {
    flex: 0 0 14rem;
    padding: 0 !important;
    scroll-snap-align: start;
  }

  .step-list li::after {
    display: none;
  }

  .add-step-row {
    max-width: 24rem;
  }

  .admin-map-panel {
    height: 27rem;
    border-top: 1px solid var(--line);
  }

  .map-toolbar {
    flex-wrap: wrap;
  }

  .map-toolbar code {
    display: none;
  }

  .step-inspector {
    border-top: 1px solid var(--line);
  }

  .field-grid,
  .field-grid--three {
    grid-template-columns: 1fr;
  }

  .qr-preview {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }

  .qr-preview img {
    width: 6.5rem;
  }

  .scanner-dialog {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .auth-dialog,
  .evidence-dialog {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

@media (max-width: 23rem) {
  .catalog-hero__copy h1 {
    font-size: var(--text-display);
  }

  .ascii-logo {
    min-height: 18rem;
  }

  .case-facts {
    gap: var(--space-sm);
  }

  .objective-sheet h1 {
    font-size: var(--text-wordmark);
  }

  .input-action-row .button {
    padding-inline: var(--space-md);
  }
}

@media (hover: hover) and (pointer: fine) {
  .case-row:hover .case-index {
    color: var(--thermal-yellow);
  }
}

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

  .ascii-logo {
    cursor: default;
  }
}
