.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.topbar-upgrades {
  width: 100%;
  margin: -8px 0 2px;
  font-size: 0.82rem;
}

.topbar h1 {
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.eyebrow,
.section-tag,
.label,
.muted {
  color: var(--text-soft);
}

.eyebrow,
.section-tag {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.topbar-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 12px;
  width: min(700px, 100%);
}

.stat-box,
.hero-card,
.panel,
.camera-card,
.room-card,
.guest-card,
.log-item {
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat-box {
  border-radius: var(--radius-md);
  padding: 14px;
}

.stat-box strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Summary / run-ending: allow full reward + archive block to scroll on short viewports */
#app.screen-summary-screen,
#app.screen-run-ending-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

#app.screen-summary-screen > main,
#app.screen-run-ending-screen > main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(12px, var(--safe-bottom, 0px));
}

#summary-screen .hero-card,
#run-ending-screen .run-ending-card {
  min-height: 0;
}

.room-card-locked {
  opacity: 0.78;
  border-style: dashed;
}

[hidden] {
  display: none !important;
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.hero-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 720px;
  margin: 10px 0 14px;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  transition: 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #081019;
  font-weight: 700;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text-main);
}

.button-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.3);
}

.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.button.is-processing {
  pointer-events: none;
}

.tab-button.active {
  background: rgba(110, 231, 255, 0.18);
  border-color: rgba(110, 231, 255, 0.35);
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.panel {
  display: none;
  border-radius: var(--radius-xl);
  padding: 22px;
  min-height: 520px;
}

.active-panel {
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.split-space {
  margin-top: 28px;
}

.card-list,
.log-list,
.room-grid,
.camera-grid,
.shared-space-grid {
  display: grid;
  gap: 14px;
}

.shared-space-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.shared-space-card {
  min-height: 0;
}

.room-grid,
.camera-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.guest-card,
.room-card,
.camera-card,
.log-item {
  border-radius: var(--radius-lg);
  padding: 16px;
}

.guest-meta,
.room-meta,
.camera-meta {
  margin: 8px 0 14px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.guest-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.camera-preview {
  height: 110px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.camera-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 4px,
    rgba(255,255,255,0.025) 5px,
    transparent 6px
  );
}

.meter-block {
  margin: 18px 0 22px;
}

.meter-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.meter-track {
  width: 100%;
  height: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.meter-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--success), var(--accent));
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
  }

  .topbar-stats {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}

.camera-card.camera-status-clear {
  border-color: var(--border);
}

.camera-card.camera-status-static,
.camera-card.camera-status-blocked {
  border-color: rgba(251, 191, 36, 0.38);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12), var(--shadow);
}

.camera-card.camera-status-movement-detected,
.camera-card.camera-status-door-ajar,
.camera-card.camera-status-shadow-figure {
  border-color: rgba(239, 68, 68, 0.42);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.14), var(--shadow);
}

.camera-card.camera-status-static .camera-preview,
.camera-card.camera-status-blocked .camera-preview {
  background: linear-gradient(
    180deg,
    rgba(251, 191, 36, 0.16),
    rgba(255, 255, 255, 0.03)
  );
}

.camera-card.camera-status-movement-detected .camera-preview,
.camera-card.camera-status-door-ajar .camera-preview,
.camera-card.camera-status-shadow-figure .camera-preview {
  background: linear-gradient(
    180deg,
    rgba(239, 68, 68, 0.16),
    rgba(255, 255, 255, 0.03)
  );
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.risk-badge-low {
  background: rgba(34, 197, 94, 0.12);
  color: rgb(134, 239, 172);
  border-color: rgba(34, 197, 94, 0.22);
}

.risk-badge-medium {
  background: rgba(251, 191, 36, 0.12);
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.22);
}

.risk-badge-high {
  background: rgba(239, 68, 68, 0.12);
  color: rgb(252, 165, 165);
  border-color: rgba(239, 68, 68, 0.24);
}

.guest-risk-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.3rem;
}

.guest-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.guest-case-read {
  margin: 0.6rem 0 0.72rem;
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.16);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.06), rgba(255, 255, 255, 0.02));
}

.guest-case-read.is-hot {
  border-color: rgba(244, 63, 94, 0.28);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.08);
}

.guest-case-read-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.28rem;
}

.guest-case-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(251, 191, 36, 0.24);
  color: rgb(253, 224, 71);
  background: rgba(251, 191, 36, 0.1);
}

.guest-case-headline {
  margin: 0 0 0.38rem;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.42;
}

.guest-contradiction-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.22rem;
}

.guest-contradiction-item {
  color: rgb(254, 240, 138);
  font-size: 0.8rem;
  line-height: 1.35;
}

.guest-followup-line,
.guest-support-line {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.guest-scan-line {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.guest-scan-line.guest-scan-friction {
  border-left: 2px solid rgba(192, 132, 252, 0.45);
  padding-left: 0.42rem;
}

.room-card.room-condition-watch {
  border-color: rgba(239, 68, 68, 0.42);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12), var(--shadow);
}

.room-card.room-condition-watch h4,
.room-card.room-condition-watch p {
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.08);
}

.room-meta-risk {
  color: var(--muted);
  font-size: 0.9rem;
}

.room-card.room-condition-critical {
  border-color: rgba(244, 63, 94, 0.72);
  box-shadow:
    0 0 0 1px rgba(244, 63, 94, 0.22),
    0 0 24px rgba(244, 63, 94, 0.16),
    var(--shadow);
}

.room-card.room-condition-critical h4,
.room-card.room-condition-critical p {
  text-shadow: 0 0 14px rgba(244, 63, 94, 0.16);
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.report-actions .btn {
  min-width: 160px;
}

.guest-action-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.button.button-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
}

.button.button-secondary:hover {
  border-color: rgba(125, 211, 252, 0.45);
}

.button.button-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: rgb(252, 165, 165);
}

.button.button-danger:hover {
  border-color: rgba(239, 68, 68, 0.4);
}

.desk-flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(125, 211, 252, 0.12);
  color: rgb(125, 211, 252);
  border: 1px solid rgba(125, 211, 252, 0.22);
}

.room-meta-flag {
  color: var(--muted);
  font-size: 0.9rem;
}

.policy-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.policy-badge-approve {
  background: rgba(34, 197, 94, 0.1);
  color: rgb(134, 239, 172);
  border-color: rgba(34, 197, 94, 0.18);
}

.policy-badge-watch {
  background: rgba(251, 191, 36, 0.12);
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.22);
}

.policy-badge-deny {
  background: rgba(244, 63, 94, 0.14);
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.26);
}

.guest-policy-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0.45rem 0 0.35rem;
}

.guest-policy-reason {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.room-meta-policy,
.room-meta-override {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-rating {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  font-weight: 700;
}

.summary-breakdown {
  margin: 0.9rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  display: grid;
  gap: 0.38rem;
}

.summary-breakdown li {
  line-height: 1.42;
}

.summary-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.summary-grade-a {
  background: rgba(34, 197, 94, 0.12);
  color: rgb(134, 239, 172);
  border-color: rgba(34, 197, 94, 0.22);
}

.summary-grade-b {
  background: rgba(96, 165, 250, 0.12);
  color: rgb(147, 197, 253);
  border-color: rgba(96, 165, 250, 0.22);
}

.summary-grade-c {
  background: rgba(251, 191, 36, 0.12);
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.22);
}

.summary-grade-d,
.summary-grade-f {
  background: rgba(244, 63, 94, 0.14);
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.26);
}

.report-panel-actions,
.report-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.report-panel-actions {
  margin-bottom: 1rem;
}

.button.button-utility {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
}

.button.button-utility:hover {
  border-color: rgba(125, 211, 252, 0.45);
}

.room-tactical-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.room-meta-control {
  color: var(--muted);
  font-size: 0.9rem;
}

.button.button-warning {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.24);
  color: rgb(253, 224, 71);
}

.button.button-warning:hover {
  border-color: rgba(251, 191, 36, 0.4);
}

.button.button-police {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.24);
  color: rgb(147, 197, 253);
}

.button.button-police:hover {
  border-color: rgba(96, 165, 250, 0.4);
}

.button.button-evict {
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.28);
  color: rgb(253, 164, 175);
}

.button.button-evict:hover {
  border-color: rgba(244, 63, 94, 0.45);
}

.failure-reason {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(244, 63, 94, 0.14);
  color: rgb(253, 164, 175);
  border: 1px solid rgba(244, 63, 94, 0.26);
  margin-top: 0.9rem;
}

.failure-text {
  margin-top: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.shift-status-card {
  margin-top: 1rem;
  padding: 1rem 1rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.shift-status-title {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.shift-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 0.9rem;
}

.shift-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(96, 165, 250, 0.95),
    rgba(139, 92, 246, 0.95)
  );
  transition: width 180ms ease;
}

.objective-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.objective-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 0.95rem;
}

.objective-item .objective-mark {
  width: 1.2rem;
  text-align: center;
  font-weight: 800;
}

.objective-item.is-complete .objective-mark {
  color: rgb(74, 222, 128);
}

.objective-item.is-failed .objective-mark {
  color: rgb(248, 113, 113);
}

.summary-objectives {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.scenario-card {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.scenario-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(96, 165, 250, 0.14);
  color: rgb(147, 197, 253);
  border: 1px solid rgba(96, 165, 250, 0.26);
  margin-bottom: 0.6rem;
}

.scenario-description {
  color: var(--muted);
  line-height: 1.5;
}

.active-night-event-card {
  margin-top: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.active-night-event-card.is-active {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.14);
}

.active-story-beat-card {
  margin-top: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.active-story-beat-card.is-active {
  border-color: rgba(125, 211, 252, 0.3);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.1);
}

.active-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.active-event-severity {
  border-radius: 999px;
  padding: 0.16rem 0.46rem;
  font-size: 0.67rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.guest-returning-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(196, 181, 253, 0.14);
  color: rgb(221, 214, 254);
  border: 1px solid rgba(196, 181, 253, 0.28);
}

.guest-history-line {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  margin: 0.22rem 0;
}

.active-event-severity.severity-low {
  color: rgb(147, 197, 253);
  border-color: rgba(96, 165, 250, 0.3);
}

.active-event-severity.severity-medium {
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.36);
}

.active-event-severity.severity-high {
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.36);
}

.guest-special-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.45rem 0 0.2rem;
  flex-wrap: wrap;
}

.special-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(251, 191, 36, 0.14);
  color: rgb(253, 224, 71);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.guest-special-title {
  font-size: 0.84rem;
  color: var(--text-main);
  font-weight: 700;
}

.guest-special-clue {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.summary-thread-flavor {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.summary-identity-flavor {
  margin-top: 0.55rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 0.6rem;
}

.summary-branch-flavor {
  margin-top: 0.45rem;
  border-left: 2px solid rgba(110, 231, 255, 0.22);
  padding-left: 0.7rem;
}

.run-identity-strip {
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(110, 231, 255, 0.06), rgba(255, 255, 255, 0.02));
  display: grid;
  gap: 0.18rem;
  font-size: 0.86rem;
}

.run-identity-strip p {
  margin: 0;
}

.shift-branch-hint {
  margin-top: 0.52rem;
  font-size: 0.86rem;
  border-left: 2px solid rgba(110, 231, 255, 0.22);
  padding-left: 0.65rem;
}

.campaign-shift-line {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.finale-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(244, 63, 94, 0.16);
  color: rgb(253, 164, 175);
  border: 1px solid rgba(244, 63, 94, 0.3);
  margin-bottom: 0.65rem;
}

.finale-state-card {
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.finale-state-card.band-contained {
  border-color: rgba(74, 222, 128, 0.35);
}

.finale-state-card.band-elevated {
  border-color: rgba(96, 165, 250, 0.35);
}

.finale-state-card.band-high {
  border-color: rgba(251, 191, 36, 0.38);
}

.finale-state-card.band-critical {
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.14);
}

.finale-pressure-label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.finale-chain-label {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.finale-command-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.finale-command-btn {
  border-radius: 12px;
  text-align: left;
  display: grid;
  gap: 0.2rem;
  padding: 0.58rem 0.72rem;
}

.finale-command-btn small {
  font-size: 0.7rem;
  color: var(--muted);
}

.finale-objectives-wrap {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
}

.finale-objective-list .objective-item {
  font-size: 0.9rem;
}

.microcopy-line {
  margin: -0.2rem 0 0.8rem;
  font-size: 0.84rem;
  line-height: 1.4;
}

.tutorial-hint-card {
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(110, 231, 255, 0.28);
  background: linear-gradient(180deg, rgba(110, 231, 255, 0.09), rgba(255, 255, 255, 0.03));
}

.tutorial-hint-card.is-guided {
  border-color: rgba(251, 191, 36, 0.38);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.tutorial-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(191, 219, 254);
  border: 1px solid rgba(125, 211, 252, 0.3);
  background: rgba(125, 211, 252, 0.08);
}

.tutorial-hint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.tutorial-hint-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.panel-intro-chip {
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  padding: 0.48rem 0.62rem;
  border-radius: 10px;
  border: 1px dashed rgba(125, 211, 252, 0.36);
  background: rgba(255, 255, 255, 0.02);
}

.tutorial-highlight {
  outline: 2px solid rgba(110, 231, 255, 0.35);
  outline-offset: 2px;
  animation: tutorialPulse 1.5s ease-in-out infinite;
}

@keyframes tutorialPulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 255, 0.2); }
  70% { box-shadow: 0 0 0 8px rgba(110, 231, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 255, 0); }
}

.main-menu-onboarding {
  margin: 0.95rem 0 0.85rem;
}

.main-menu-onboarding-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.8rem 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.main-menu-onboarding-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  display: grid;
  gap: 0.2rem;
}

.help-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 17, 0.72);
  z-index: 60;
}

.help-overlay.is-open {
  display: flex;
}

.help-overlay-panel {
  width: min(960px, calc(100vw - 2.2rem));
  max-height: min(84vh, 760px);
  overflow: auto;
}

.help-glossary-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.help-term-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.62rem 0.66rem;
}

.help-term-card h4 {
  margin: 0 0 0.25rem;
}

.night-prep-doctrine,
.night-prep-factions {
  margin-top: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.night-prep-campaign,
.summary-campaign-progress {
  font-size: 0.9rem;
}

.night-prep-campaign-forecast {
  margin-top: 0.8rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.07), rgba(255, 255, 255, 0.02));
}

.summary-campaign-flavor {
  margin-top: 0.55rem;
  border-left: 2px solid rgba(251, 191, 36, 0.24);
  padding-left: 0.7rem;
}

.run-ending-card {
  border-color: rgba(125, 211, 252, 0.28);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.08), rgba(255, 255, 255, 0.03));
}

.run-ending-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(110, 231, 255, 0.34);
  color: rgb(186, 230, 253);
  background: rgba(110, 231, 255, 0.12);
  margin-top: 0.4rem;
}

.run-ending-subtitle,
.run-ending-campaign-line,
.run-ending-summary,
.run-ending-pressure,
.run-ending-posture,
.run-ending-stats {
  margin-top: 0.6rem;
}

.run-ending-finale-context {
  margin-top: 0.62rem;
  border-left: 2px solid rgba(244, 63, 94, 0.35);
  padding-left: 0.55rem;
  color: rgb(253, 164, 175);
  display: none;
}

.run-ending-finale-context.is-active {
  display: block;
}

.run-ending-doctrine,
.run-ending-climate {
  margin-top: 0.55rem;
  font-size: 0.95rem;
}

.run-ending-notes {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  display: grid;
  gap: 0.32rem;
}

.run-ending-tags {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.run-ending-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(125, 211, 252, 0.26);
  color: rgb(186, 230, 253);
  background: rgba(125, 211, 252, 0.08);
}

.night-prep-director {
  margin-top: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 2px solid rgba(110, 231, 255, 0.26);
  background: rgba(255, 255, 255, 0.02);
}

.prep-faction-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.prep-faction-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(125, 211, 252, 0.28);
  color: rgb(186, 230, 253);
  background: rgba(125, 211, 252, 0.08);
}

.night-prep-carryover,
.night-prep-threads {
  margin-top: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.prep-notes-list {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.prep-notes-list li {
  display: grid;
  gap: 0.12rem;
}

.prep-notes-list li span {
  color: var(--muted);
  font-size: 0.86rem;
}

.button.button-special {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: rgb(253, 224, 71);
}

.button.button-special:hover {
  border-color: rgba(251, 191, 36, 0.48);
}

.special-overlay-panel {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.08), rgba(255, 255, 255, 0.03));
  border-color: rgba(96, 165, 250, 0.28);
}

.archetype-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.26rem 0.58rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(250, 204, 21, 0.14);
  color: rgb(250, 204, 21);
  border: 1px solid rgba(250, 204, 21, 0.22);
  margin-left: 0.4rem;
}

.guest-archetype-clue,
.room-archetype-line,
.room-chain-line,
.summary-outcome-note {
  color: var(--muted);
  line-height: 1.45;
}

.summary-scenario-label,
.summary-outcome-title {
  margin-top: 0.95rem;
}

/* Phase 6X presentation/audio polish additions */
.audio-toggle {
  align-self: center;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.88rem;
}

.audio-toggle.is-active {
  border-color: rgba(110, 231, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.16), var(--shadow);
}

.audio-toggle.is-muted {
  border-color: rgba(244, 63, 94, 0.3);
  color: rgb(253, 164, 175);
  background: rgba(244, 63, 94, 0.08);
}

.live-alert-strip {
  display: grid;
  gap: 0.42rem;
  margin: 0.35rem 0 0.85rem;
  min-height: 1.9rem;
}

.live-alert {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.45rem 0.6rem;
  font-size: 0.84rem;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.live-alert-label {
  display: inline-block;
  margin-right: 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-alert-actionable {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.live-alert.is-emphasis {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.live-alert-overflow {
  color: var(--muted);
  border-style: dashed;
}

.live-alert-info {
  border-color: rgba(96, 165, 250, 0.3);
  color: rgb(191, 219, 254);
}

.live-alert-warning {
  border-color: rgba(251, 191, 36, 0.35);
  color: rgb(253, 230, 138);
}

.live-alert-danger {
  border-color: rgba(244, 63, 94, 0.4);
  color: rgb(253, 164, 175);
  background: rgba(244, 63, 94, 0.08);
}

.live-alert-success {
  border-color: rgba(74, 222, 128, 0.35);
  color: rgb(134, 239, 172);
}

.shift-pressure-label {
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.shift-pressure-label.pressure-tense {
  color: rgb(253, 224, 71);
}

.shift-pressure-label.pressure-dire,
.shift-pressure-label.pressure-emergency {
  color: rgb(253, 164, 175);
}

.night-mood-line {
  margin: 0.18rem 0 0;
  color: rgb(226, 232, 240);
  font-size: 0.79rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shift-pressure-label.pressure-dire {
  color: rgb(252, 165, 165);
}

.pressure-calm {
  --pressure-accent: rgba(96, 165, 250, 0.06);
}

.pressure-tense {
  --pressure-accent: rgba(251, 191, 36, 0.09);
}

.pressure-dire {
  --pressure-accent: rgba(244, 63, 94, 0.12);
}

.pressure-calm .shift-status-card,
.pressure-tense .shift-status-card,
.pressure-dire .shift-status-card {
  box-shadow: inset 0 0 0 1px var(--pressure-accent);
}

.pressure-dire .panel,
.pressure-dire .hero-card {
  border-color: rgba(244, 63, 94, 0.24);
}

.stat-box.is-warning {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12), var(--shadow);
}

.stat-box.is-danger {
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.16), 0 0 16px rgba(244, 63, 94, 0.12), var(--shadow);
}

.stat-box.is-highlight {
  border-color: rgba(110, 231, 255, 0.38);
}

.room-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.room-condition-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.room-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.28rem;
  margin: 0.4rem 0 0.52rem;
}

.room-meta-line {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.room-meta-line strong {
  color: var(--text-main);
  font-size: 0.83rem;
  font-weight: 700;
}

.room-tone-warning .room-condition-pill {
  border-color: rgba(251, 191, 36, 0.36);
  color: rgb(253, 224, 71);
}

.room-tone-danger .room-condition-pill {
  border-color: rgba(244, 63, 94, 0.44);
  color: rgb(253, 164, 175);
}

.room-tactical-row {
  padding-top: 0.28rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.room-chain-line.is-high {
  color: rgb(252, 165, 165);
}

.room-card.is-critical-pulse {
  animation: criticalPulse 1.9s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(244, 63, 94, 0.18),
      0 0 18px rgba(244, 63, 94, 0.12),
      var(--shadow);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(244, 63, 94, 0.28),
      0 0 26px rgba(244, 63, 94, 0.2),
      var(--shadow);
  }
}

.room-card .room-meta-line strong {
  line-height: 1.3;
}

.room-card .room-meta-line strong,
.room-card .room-meta-line span {
  white-space: nowrap;
}

.room-card .room-meta-line span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-card .room-meta-line strong {
  text-align: right;
}

.room-card .room-meta-line strong,
.room-card .room-meta-line span {
  min-width: 0;
}

.room-card.room-condition-critical {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.07), rgba(255, 255, 255, 0.02));
}

.room-card .room-meta-grid + .room-archetype-line {
  margin-top: 0.2rem;
}

.room-card .room-meta-grid + .room-archetype-line,
.room-card .room-chain-line {
  font-size: 0.84rem;
}

.room-card .room-chain-line {
  margin-top: 0.2rem;
}

.room-card .room-meta-line strong {
  font-weight: 600;
}

.room-card .room-meta-line span {
  opacity: 0.92;
}

.camera-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.camera-status-badge.is-clear {
  background: rgba(34, 197, 94, 0.12);
  color: rgb(134, 239, 172);
  border-color: rgba(34, 197, 94, 0.2);
}

.camera-status-badge.is-alert {
  background: rgba(244, 63, 94, 0.14);
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.28);
}

.power-economy-meta {
  margin-top: 0.7rem;
  font-size: 0.86rem;
}

.camera-card.is-actionable {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), var(--shadow);
}

.camera-alert-line {
  color: rgb(253, 224, 71);
  font-size: 0.82rem;
  margin: 0.3rem 0 0.65rem;
}

.camera-investigate-btn {
  width: 100%;
}

.camera-scene-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 16, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1200;
}

.camera-scene-overlay.is-open {
  display: flex;
}

.camera-scene-panel {
  width: min(680px, 100%);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(251, 191, 36, 0.28);
  box-shadow: var(--shadow);
  padding: 1rem;
  max-height: min(92dvh, calc(100dvh - 2rem));
  overflow: auto;
  overscroll-behavior: contain;
}

.camera-scene-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.camera-scene-title {
  margin: 0.7rem 0 0.25rem;
  font-weight: 700;
}

.camera-scene-sublabel {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.camera-scene-flavor {
  margin: 0.45rem 0 0;
  color: var(--text-main);
  line-height: 1.4;
}

.camera-scene-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.camera-scene-severity {
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.camera-scene-severity-high {
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.4);
}

.camera-scene-severity-medium {
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.38);
}

.camera-scene-severity-low {
  color: rgb(147, 197, 253);
  border-color: rgba(96, 165, 250, 0.35);
}

.camera-scene-modifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.45rem 0;
}

.camera-scene-modifier {
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.74rem;
  color: rgb(134, 239, 172);
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}

.camera-scene-description,
.camera-scene-stage p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.camera-scene-stage {
  margin: 0.7rem 0;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.camera-scene-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
  align-items: stretch;
}

.camera-scene-action-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: 12px;
  text-align: left;
  gap: 0.34rem;
  white-space: normal;
  overflow: visible;
  min-height: 0;
  height: auto;
  padding: 0.72rem 0.78rem;
}

.camera-scene-action-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.36rem;
  width: 100%;
  min-width: 0;
}

.camera-scene-action-block {
  display: block;
  width: 100%;
  min-width: 0;
}

.camera-scene-action-title,
.camera-scene-action-cost,
.camera-scene-action-desc,
.camera-scene-action-note,
.camera-scene-action-btn small,
.camera-scene-action-btn span {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.44;
}

.camera-scene-action-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.camera-scene-action-cost {
  color: #bfdbfe;
}

.camera-scene-action-btn small {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.camera-scene-action-hint {
  opacity: 0.92;
}

.camera-scene-action-effect {
  color: rgb(191, 219, 254);
}

.summary-polish-card {
  background: linear-gradient(180deg, rgba(110, 231, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-color: rgba(110, 231, 255, 0.2);
}

.summary-polish-card .summary-rating {
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.failure-polish-card {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.07), rgba(255, 255, 255, 0.02));
  border-color: rgba(244, 63, 94, 0.24);
}

.night-prep-card {
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(125, 211, 252, 0.24);
}

.night-prep-money {
  margin-top: 0.8rem;
  font-weight: 700;
}

.night-prep-spent,
.night-prep-active-upgrades {
  margin-top: 0.35rem;
}

.night-prep-upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.prep-staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.prep-staff-card {
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.prep-staff-card.is-active {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}

.prep-staff-card.is-oncall {
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.08);
}

.prep-staff-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.prep-staff-role {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(125, 211, 252);
}

.prep-upgrade-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.prep-upgrade-card.is-owned {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.07);
}

.prep-upgrade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.prep-upgrade-header h4 {
  margin: 0;
  font-size: 0.95rem;
}

.prep-upgrade-category {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(125, 211, 252);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
}

.prep-upgrade-description,
.prep-upgrade-cost {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.prep-upgrade-buy-btn[disabled] {
  opacity: 0.65;
}

/* Phase 14X: hierarchy + density + interaction polish */
.panel-tabs .tab-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tab-attention-badge {
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  padding: 0 0.32rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: rgb(253, 224, 71);
  border: 1px solid rgba(251, 191, 36, 0.36);
  background: rgba(251, 191, 36, 0.14);
}

.tab-button.needs-attention {
  border-color: rgba(251, 191, 36, 0.34);
}

.shift-status-card {
  display: grid;
  gap: 0.78rem;
}

.shift-primary-block,
.shift-context-block,
.shift-secondary-block {
  padding: 0.78rem 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.shift-primary-block {
  border-color: rgba(125, 211, 252, 0.18);
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.07), rgba(255, 255, 255, 0.02));
}

.shift-secondary-block {
  border-style: dashed;
}

.shift-secondary-block .section-tag {
  margin-bottom: 0.45rem;
}

.scenario-card {
  margin-top: 0;
}

.shift-context-block .run-identity-strip,
.shift-context-block .active-story-beat-card {
  margin-top: 0.65rem;
}

.guest-card {
  display: grid;
  gap: 0.52rem;
}

.guest-card h4 {
  margin: 0;
}

.guest-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.guest-critical-badges,
.guest-chip-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.guest-meta-chip {
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  background: rgba(255, 255, 255, 0.03);
}

.guest-meta-chip-archetype {
  color: rgb(253, 230, 138);
  border-color: rgba(250, 204, 21, 0.22);
  background: rgba(251, 191, 36, 0.08);
}

.guest-meta-chip-contradiction {
  color: rgb(251, 191, 36);
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.guest-meta-chip-scanner {
  color: rgb(125, 211, 252);
  border-color: rgba(125, 211, 252, 0.26);
  background: rgba(125, 211, 252, 0.08);
}

.guest-meta-chip-verified {
  color: rgb(134, 239, 172);
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.08);
}

.guest-meta-chip-uv {
  color: rgb(216, 180, 254);
  border-color: rgba(192, 132, 252, 0.28);
  background: rgba(192, 132, 252, 0.08);
}

.guest-signal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.48rem;
  border-radius: 999px;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: rgb(203, 213, 225);
  background: rgba(148, 163, 184, 0.08);
}

.guest-signal-chip.is-moderate {
  border-color: rgba(251, 191, 36, 0.3);
  color: rgb(253, 230, 138);
  background: rgba(251, 191, 36, 0.08);
}

.guest-signal-chip.is-strong {
  border-color: rgba(244, 63, 94, 0.34);
  color: rgb(253, 164, 175);
  background: rgba(244, 63, 94, 0.1);
}

.guest-card.guest-card-elevated {
  border-color: rgba(244, 63, 94, 0.3);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.12), var(--shadow);
}

.guest-card.guest-card-urgent {
  border-color: rgba(251, 191, 36, 0.28);
}

.guest-detail-block {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
  padding: 0.52rem 0.62rem;
}

.guest-detail-block p {
  margin: 0.12rem 0;
}

.guest-inspection-drawer {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.4rem 0.6rem;
}

.guest-inspection-drawer summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: rgb(191, 219, 254);
}

.guest-inspection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.guest-id-line {
  font-size: 0.79rem;
  line-height: 1.4;
}

.guest-scan-line-warning {
  color: rgb(253, 224, 71);
}

.guest-room-choice-block {
  display: grid;
  gap: 0.35rem;
}

.guest-room-choice-label,
.guest-room-choice-hint {
  margin: 0;
}

.guest-room-choice-row {
  display: grid;
  gap: 0.38rem;
}

.guest-room-select {
  width: 100%;
  min-height: 2.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  padding: 0.42rem 0.55rem;
}

.guest-history-block {
  border-left: 2px solid rgba(125, 211, 252, 0.22);
  padding-left: 0.52rem;
}

.guest-special-preview {
  color: var(--muted);
  font-size: 0.78rem;
}

.guest-action-row {
  margin-top: 0.14rem;
  padding-top: 0.52rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.guest-action-row-secondary {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.desk-scanner-card {
  margin: 0.7rem 0 0.9rem;
  padding: 0.72rem 0.78rem;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.08), rgba(255, 255, 255, 0.02));
}

.scanner-feed-list {
  display: grid;
  gap: 0.42rem;
}

.scanner-feed-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.8rem;
  line-height: 1.42;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.38);
  color: var(--muted);
}

.scanner-feed-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.scanner-feed-copy {
  min-width: 0;
}

.scanner-feed-text {
  display: block;
  line-height: 1.42;
}

.scanner-tone-vehicle {
  border-color: rgba(251, 191, 36, 0.24);
  color: rgb(253, 230, 138);
}

.scanner-tone-vehicle .scanner-feed-label {
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.12);
}

.scanner-tone-desk {
  border-color: rgba(110, 231, 255, 0.2);
  color: rgb(191, 219, 254);
}

.scanner-tone-desk .scanner-feed-label {
  color: rgb(125, 211, 252);
  border-color: rgba(110, 231, 255, 0.24);
  background: rgba(110, 231, 255, 0.1);
}

.scanner-tone-warning {
  border-color: rgba(244, 63, 94, 0.28);
  color: rgb(253, 164, 175);
  background: rgba(127, 29, 29, 0.12);
}

.scanner-tone-warning .scanner-feed-label {
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.28);
  background: rgba(244, 63, 94, 0.1);
}

.scanner-tone-ambient .scanner-feed-label {
  color: rgb(191, 219, 254);
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.08);
}

.scanner-feed-item.scanner-feed-planted {
  border-color: rgba(192, 132, 252, 0.38);
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.2), rgba(15, 23, 42, 0.55));
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.12);
}

.scanner-feed-item.scanner-feed-planted .scanner-feed-label {
  color: rgb(233, 213, 255);
  border-color: rgba(192, 132, 252, 0.45);
  background: rgba(88, 28, 135, 0.32);
}

.desk-scanner-card.is-system-override {
  border-color: rgba(192, 132, 252, 0.32);
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.14), rgba(255, 255, 255, 0.02));
}

.desk-scanner-card.is-scanner-compromised {
  border-color: rgba(192, 132, 252, 0.42);
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.14);
}

.desk-scanner-card.is-feed-isolated {
  opacity: 0.96;
}

.guest-stay-chip {
  border-color: rgba(110, 231, 255, 0.28);
  background: rgba(110, 231, 255, 0.08);
}

.room-occupant-block {
  margin-bottom: 0.38rem;
}

.room-occupant-block .room-meta {
  margin: 0;
}

.room-stay-line {
  margin: 0.22rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.room-memory-line {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
}

.room-pressure-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
  margin: 0.36rem 0 0.48rem;
}

.room-state-chip {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.room-meta-grid-compact {
  margin-top: 0.2rem;
}

.room-service-alert {
  margin: 0.3rem 0 0.45rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(15, 23, 42, 0.34);
  position: relative;
  overflow: hidden;
}

.room-service-alert-medium {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(120, 53, 15, 0.12);
}

.room-service-alert-high {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(127, 29, 29, 0.16);
}

.room-service-alert::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.04));
  opacity: 0.45;
}

.room-service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.16rem;
}

.room-service-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.46rem;
  border-radius: 999px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.room-service-route,
.room-service-spill,
.shared-space-route-line,
.shared-space-connection-line {
  margin: 0.22rem 0 0;
  font-size: 0.77rem;
  line-height: 1.34;
}

.room-service-route,
.shared-space-route-line {
  color: rgb(191, 219, 254);
}

.room-service-spill,
.shared-space-connection-line {
  color: rgb(253, 224, 71);
}

.room-service-spill.is-hot,
.shared-space-card.is-emergency-priority .shared-space-connection-line {
  color: rgb(253, 164, 175);
}

.room-service-kind-dead-line-call,
.room-service-kind-rear-exit-rattle {
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.1);
}

.room-service-kind-dead-line-call .room-service-pill {
  border-color: rgba(96, 165, 250, 0.24);
  color: rgb(147, 197, 253);
}

.room-service-kind-rear-exit-rattle .room-service-pill {
  border-color: rgba(251, 191, 36, 0.24);
  color: rgb(253, 224, 71);
}

.room-service-title,
.room-service-detail,
.room-service-note {
  margin: 0;
}

.room-service-title {
  font-size: 0.8rem;
  font-weight: 700;
}

.room-service-detail,
.room-service-note {
  margin-top: 0.18rem;
  font-size: 0.76rem;
  line-height: 1.35;
}

.room-service-row,
.room-tactical-row {
  margin-top: 0.68rem;
}

.room-service-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

#hallway-threat-line {
  margin-top: 0.4rem;
}

#app.atmosphere-blackout-risk .shift-primary-block,
#app.atmosphere-blackout-partial .shift-primary-block,
#app.atmosphere-blackout-full .shift-primary-block {
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.08);
}

#app.atmosphere-blackout-partial .shift-primary-block {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(255, 255, 255, 0.02));
}

#app.atmosphere-blackout-full .shift-primary-block {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.75), rgba(59, 7, 18, 0.14));
}

#app.atmosphere-visibility-reduced .room-service-alert,
#app.atmosphere-visibility-reduced .guest-case-read {
  border-color: rgba(250, 204, 21, 0.22);
}

#app.atmosphere-blackout-partial.atmosphere-visibility-reduced .room-service-alert,
#app.atmosphere-blackout-full.atmosphere-visibility-reduced .room-service-alert {
  background: rgba(15, 23, 42, 0.82);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.12);
}

#app.atmosphere-flashlight .guest-card,
#app.atmosphere-flashlight .room-card:not(.room-card-locked),
#app.atmosphere-emergency-lanterns .guest-card,
#app.atmosphere-emergency-lanterns .room-card:not(.room-card-locked) {
  box-shadow: inset 0 0 0 1px rgba(253, 224, 71, 0.12), var(--shadow, 0 12px 40px rgba(0, 0, 0, 0.35));
}

#app.atmosphere-system-override .shift-primary-block {
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.12), 0 0 28px rgba(88, 28, 135, 0.08);
}

#app.atmosphere-hunt-night .shift-primary-block {
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.14), 0 0 26px rgba(127, 29, 29, 0.12);
}

#app.atmosphere-alerts-compromised #live-alert-strip .live-alert-warning {
  border-style: dashed;
}

.guest-case-read.has-scanner-friction {
  border-left: 3px solid rgba(192, 132, 252, 0.55);
}

.guest-case-read.is-hot .guest-contradiction-item {
  color: rgb(253, 224, 71);
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.18);
}

.room-card.room-card-system-noise .room-service-alert {
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.12);
}

.shared-space-card.shared-space-system-noise {
  border-color: rgba(168, 85, 247, 0.28);
}

.shared-space-card.has-linked-scanner .shared-space-connection-line {
  color: rgb(253, 224, 71);
  font-weight: 650;
}

#app.atmosphere-hostile-night .shift-context-block,
#app.atmosphere-hallway-threat .shift-context-block {
  border-color: rgba(244, 63, 94, 0.22);
}

.camera-grid {
  position: relative;
}

.camera-grid.camera-grid-scanline::before,
.camera-grid.camera-grid-glitch-light::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 14px;
}

.camera-grid.camera-grid-scanline::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0,
    rgba(255, 255, 255, 0.03) 1px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0) 6px
  );
  opacity: 0.5;
}

.camera-grid.camera-grid-glitch-light::after {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.06), rgba(96, 165, 250, 0.04));
  mix-blend-mode: screen;
  opacity: 0.65;
}

.camera-grid.camera-grid-glitch-heavy {
  filter: contrast(1.03) saturate(0.9);
}

#app.pressure-emergency .camera-grid,
#app.pressure-dire .camera-grid {
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.12);
}

.camera-card.camera-card-glitch {
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.08), var(--shadow);
}

#app.pressure-emergency .camera-card.camera-card-glitch,
#app.pressure-dire .camera-card.camera-card-glitch {
  border-color: rgba(244, 63, 94, 0.3);
}

.camera-card.camera-card-glitch .camera-preview {
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      rgba(0, 0, 0, 0) 4px,
      rgba(0, 0, 0, 0) 8px
    );
}

.camera-card.camera-card-flicker {
  border-color: rgba(244, 63, 94, 0.26);
}

.shared-space-card {
  position: relative;
  overflow: hidden;
}

.shared-space-card::after {
  content: '';
  position: absolute;
  inset: auto 14px 10px 14px;
  height: 2px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.45), rgba(244, 63, 94, 0.06));
  opacity: 0.55;
}

.shared-space-card.is-emergency-priority::after {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.7), rgba(251, 191, 36, 0.12));
}

.shared-space-card .room-service-row {
  margin-top: 0.75rem;
}

#app.pressure-emergency .camera-card.camera-card-flicker {
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.18), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.camera-scene-panel.camera-scene-glitch {
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.08), var(--shadow);
}

.camera-scene-panel.camera-scene-blackout {
  border-color: rgba(244, 63, 94, 0.26);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(69, 10, 10, 0.32));
}

.report-panel-actions {
  margin-bottom: 0.75rem;
  padding-bottom: 0.68rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.log-list {
  gap: 0.52rem;
}

.log-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.log-pill {
  margin-top: 0.08rem;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 0.16rem 0.44rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.log-pill-info {
  color: rgb(191, 219, 254);
  border-color: rgba(96, 165, 250, 0.3);
}

.log-pill-warning {
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.34);
}

.log-pill-danger {
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.35);
}

.log-pill-success {
  color: rgb(134, 239, 172);
  border-color: rgba(34, 197, 94, 0.35);
}

.log-item-warning {
  border-color: rgba(251, 191, 36, 0.22);
}

.log-item-danger {
  border-color: rgba(244, 63, 94, 0.26);
  background: rgba(244, 63, 94, 0.06);
}

.log-item-success {
  border-color: rgba(34, 197, 94, 0.22);
}

.log-repeat-count {
  color: var(--muted);
  font-size: 0.75rem;
}

.camera-scene-panel {
  padding: 1.08rem;
}

.overlay-close-btn {
  min-width: 84px;
}

.camera-scene-stage-note {
  margin: 0.32rem 0 0.58rem;
  font-size: 0.82rem;
}

.camera-scene-action-btn.is-safer {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}

.camera-scene-action-btn.is-risky {
  border-color: rgba(244, 63, 94, 0.34);
  background: rgba(244, 63, 94, 0.08);
}

.summary-primary-block,
.summary-performance-block,
.summary-flavor-block,
.prep-primary-block,
.prep-context-grid {
  margin-top: 0.72rem;
}

.summary-performance-block,
.summary-flavor-block,
.prep-primary-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.7rem 0.78rem;
  background: rgba(255, 255, 255, 0.02);
}

.summary-performance-block {
  background: rgba(110, 231, 255, 0.04);
}

.summary-flavor-block {
  border-style: dashed;
}

.prep-primary-block {
  background: rgba(125, 211, 252, 0.05);
}

.prep-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.night-prep-doctrine,
.night-prep-factions,
.night-prep-owner,
.night-prep-director,
.night-prep-carryover,
.night-prep-threads,
.night-prep-suspect-board {
  margin-top: 0;
}

.night-prep-owner,
.night-prep-suspect-board {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.7rem 0.78rem;
  background: rgba(255, 255, 255, 0.025);
}

.night-prep-plan-grid {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.prep-plan-btn.is-active {
  border-color: rgba(125, 211, 252, 0.4);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.2);
  background: rgba(125, 211, 252, 0.08);
}

.failure-polish-card .failure-reason {
  font-size: 0.76rem;
  padding: 0.3rem 0.7rem;
}

.overlay-open .tab-button.active {
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.22);
}

.main-menu-meta-surface {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.main-menu-meta-overview,
.main-menu-meta-perks,
.main-menu-meta-archive {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 0.85rem;
}

.main-menu-meta-line,
.main-menu-meta-selected {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.main-menu-perk-list {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.45rem;
}

.meta-perk-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
  padding: 0.58rem 0.62rem;
}

.meta-perk-card.is-owned {
  border-color: rgba(74, 222, 128, 0.33);
}

.meta-perk-card.is-selected {
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.26);
}

.meta-perk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.meta-perk-head h4 {
  margin: 0;
  font-size: 0.9rem;
}

.meta-perk-effect,
.meta-perk-requirement {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.meta-perk-actions {
  margin-top: 0.45rem;
}

#main-menu-reroll-btn {
  margin-top: 0.55rem;
  width: 100%;
}

.main-menu-archive-list {
  margin: 0.45rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.3rem;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.run-ending-card {
  position: relative;
  overflow: hidden;
}

.run-ending-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.12), transparent 48%);
  opacity: 0;
  transition: opacity 420ms ease;
}

.run-ending-card.ending-cinematic-reveal::before {
  opacity: 1;
}

.run-ending-tone-badge {
  margin-top: 0.38rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 0.22rem 0.58rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.run-ending-tagline {
  margin-top: 0.58rem;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--text-main);
  border-left: 2px solid rgba(125, 211, 252, 0.3);
  padding-left: 0.62rem;
}

.run-ending-dramatic-summary {
  margin-top: 0.6rem;
  line-height: 1.52;
}

.run-ending-reward-block {
  margin-top: 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(110, 231, 255, 0.24);
  background: rgba(110, 231, 255, 0.06);
  padding: 0.72rem 0.82rem;
}

.run-ending-reward-points {
  margin-top: 0.3rem;
  font-weight: 700;
}

.run-ending-reward-breakdown,
.run-ending-archive-progress {
  margin-top: 0.35rem;
  font-size: 0.84rem;
}

.run-ending-reward-discoveries,
.run-ending-reward-unlocks {
  margin: 0.45rem 0 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.28rem;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.run-ending-reward-unlocks {
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
  padding-top: 0.45rem;
}

.run-ending-card.ending-tone-stable {
  border-color: rgba(74, 222, 128, 0.3);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.09), rgba(255, 255, 255, 0.03));
}

.run-ending-card.ending-tone-fragile {
  border-color: rgba(251, 191, 36, 0.3);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.09), rgba(255, 255, 255, 0.03));
}

.run-ending-card.ending-tone-cold {
  border-color: rgba(96, 165, 250, 0.35);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.1), rgba(255, 255, 255, 0.03));
}

.run-ending-card.ending-tone-collapse {
  border-color: rgba(244, 63, 94, 0.34);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.1), rgba(255, 255, 255, 0.03));
}

.run-ending-card.ending-tone-hostile {
  border-color: rgba(248, 113, 113, 0.38);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.11), rgba(255, 255, 255, 0.03));
}

.run-ending-card.ending-tone-controlled {
  border-color: rgba(125, 211, 252, 0.36);
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.11), rgba(255, 255, 255, 0.03));
}

/* === Phase 23X: Atmosphere / Presentation Prestige Pass v1 === */

.app-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  overflow-x: clip;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

.hero-card,
.panel,
.room-card,
.camera-card,
.guest-card,
.log-item,
.main-menu-meta-surface,
.camera-scene-panel,
.help-overlay-panel {
  min-width: 0;
}

.app-shell::before,
.app-shell::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.app-shell::before {
  background:
    radial-gradient(circle at 12% 10%, rgba(110, 231, 255, 0.08), transparent 42%),
    radial-gradient(circle at 90% 14%, rgba(139, 92, 246, 0.06), transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(244, 63, 94, 0.07), transparent 44%);
}

.app-shell::after {
  background: linear-gradient(180deg, rgba(8, 11, 18, 0), rgba(8, 11, 18, 0.44));
}

.topbar-subtitle {
  margin-top: 0.28rem;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  color: var(--text-soft);
}

.hero-card,
.panel,
.camera-card,
.room-card,
.guest-card,
.log-item,
.help-overlay-panel,
.camera-scene-panel {
  position: relative;
  overflow: hidden;
}

.camera-scene-panel {
  overflow-y: auto;
  overflow-x: hidden;
}

.hero-card::before,
.panel::before,
.camera-card::before,
.room-card::before,
.guest-card::before,
.help-overlay-panel::before,
.camera-scene-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%);
  opacity: 0.46;
}

.hero-card > *,
.panel > *,
.camera-card > *,
.room-card > *,
.guest-card > *,
.help-overlay-panel > *,
.camera-scene-panel > * {
  position: relative;
}

.section-tag {
  color: rgba(214, 234, 255, 0.78);
}

#main-menu .hero-card {
  border-color: rgba(110, 231, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(110, 231, 255, 0.08), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 78% 16%, rgba(125, 211, 252, 0.12), transparent 40%);
}

#main-menu .hero-actions {
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-polish-card {
  border-color: rgba(110, 231, 255, 0.28);
}

.night-prep-card {
  border-color: rgba(125, 211, 252, 0.3);
}

.failure-polish-card {
  border-color: rgba(244, 63, 94, 0.32);
}

.run-ending-card {
  border-width: 1px;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.run-ending-card .section-tag {
  color: rgba(226, 241, 255, 0.86);
}

.run-ending-tone-badge {
  font-weight: 800;
}

.ending-family-good .run-ending-tone-badge {
  color: rgb(134, 239, 172);
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.14);
}

.ending-family-mixed .run-ending-tone-badge {
  color: rgb(147, 197, 253);
  border-color: rgba(96, 165, 250, 0.34);
  background: rgba(96, 165, 250, 0.14);
}

.ending-family-fragile .run-ending-tone-badge {
  color: rgb(253, 224, 71);
  border-color: rgba(251, 191, 36, 0.36);
  background: rgba(251, 191, 36, 0.14);
}

.ending-family-cold .run-ending-tone-badge {
  color: rgb(186, 230, 253);
  border-color: rgba(125, 211, 252, 0.36);
  background: rgba(125, 211, 252, 0.14);
}

.ending-family-hostile .run-ending-tone-badge,
.ending-family-chaotic .run-ending-tone-badge {
  color: rgb(253, 164, 175);
  border-color: rgba(244, 63, 94, 0.42);
  background: rgba(244, 63, 94, 0.14);
}

.run-ending-card.ending-family-good .run-ending-tagline {
  border-left-color: rgba(74, 222, 128, 0.45);
}

.run-ending-card.ending-family-fragile .run-ending-tagline {
  border-left-color: rgba(251, 191, 36, 0.45);
}

.run-ending-card.ending-family-cold .run-ending-tagline {
  border-left-color: rgba(125, 211, 252, 0.46);
}

.run-ending-card.ending-family-hostile .run-ending-tagline,
.run-ending-card.ending-family-chaotic .run-ending-tagline {
  border-left-color: rgba(244, 63, 94, 0.48);
}

.shared-space-card.is-emergency-priority {
  border-color: rgba(244, 63, 94, 0.3);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.12), var(--shadow);
}

.room-service-note-priority {
  color: rgb(253, 164, 175);
  font-weight: 700;
}

#app.pressure-emergency .shift-status-card,
#app.pressure-dire .shift-status-card {
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.08), 0 18px 34px rgba(0, 0, 0, 0.28);
}

.run-ending-reward-block {
  box-shadow: inset 0 0 0 1px rgba(110, 231, 255, 0.18);
}

.risk-badge,
.policy-badge,
.desk-flag-badge,
.special-badge,
.summary-grade,
.run-ending-tag,
.prep-upgrade-category,
.room-state-chip,
.camera-status-badge,
.active-event-severity,
.finale-banner,
.failure-reason {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.shift-status-card {
  border-color: rgba(110, 231, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.015)),
    radial-gradient(circle at 0% 0%, rgba(110, 231, 255, 0.08), transparent 45%);
}

.is-finale-night .shift-status-card {
  border-color: rgba(251, 191, 36, 0.28);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.1);
}

.is-last-stand .shift-status-card {
  border-color: rgba(244, 63, 94, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(244, 63, 94, 0.14),
    0 0 26px rgba(244, 63, 94, 0.14);
}

.is-last-stand .finale-state-card.band-critical {
  box-shadow:
    0 0 0 1px rgba(244, 63, 94, 0.2),
    0 0 24px rgba(244, 63, 94, 0.17);
}

.camera-scene-overlay,
.help-overlay {
  background: rgba(5, 8, 16, 0.78);
}

.camera-scene-panel {
  border-color: rgba(110, 231, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(110, 231, 255, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 55%);
}

.camera-scene-tone-low {
  border-color: rgba(96, 165, 250, 0.3);
}

.camera-scene-tone-medium {
  border-color: rgba(251, 191, 36, 0.34);
}

.camera-scene-tone-high {
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(244, 63, 94, 0.15);
}

.special-encounter-tone {
  border-color: rgba(196, 181, 253, 0.36);
  background: linear-gradient(180deg, rgba(196, 181, 253, 0.09), rgba(255, 255, 255, 0.03));
}

.event-severity-low {
  border-color: rgba(96, 165, 250, 0.34);
}

.event-severity-medium {
  border-color: rgba(251, 191, 36, 0.36);
}

.event-severity-high {
  border-color: rgba(244, 63, 94, 0.42);
}

.help-overlay-panel,
.settings-overlay-panel {
  border-color: rgba(110, 231, 255, 0.26);
}

body.high-contrast .app-shell::before,
body.high-contrast .app-shell::after,
body.high-contrast .hero-card::before,
body.high-contrast .panel::before,
body.high-contrast .camera-card::before,
body.high-contrast .room-card::before,
body.high-contrast .guest-card::before,
body.high-contrast .help-overlay-panel::before,
body.high-contrast .camera-scene-panel::before {
  display: none;
}

/* === Phase 20X: Settings, accessibility, QoL polish === */

.settings-overlay-panel {
  max-width: min(760px, calc(100vw - 1.6rem));
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.72rem;
  margin-top: 0.75rem;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.52rem 0.62rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.9rem;
}

.settings-item input[type='checkbox'] {
  inline-size: 1rem;
  block-size: 1rem;
  accent-color: #7dd3fc;
}

.settings-item select {
  background: rgba(12, 18, 28, 0.9);
  color: var(--text-main);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  padding: 0.32rem 0.45rem;
}

.settings-footnote {
  margin-top: 0.72rem;
}

.help-persistence-note {
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.button:focus-visible,
.tab-button:focus-visible,
.settings-item select:focus-visible,
.settings-item input:focus-visible {
  outline: 2px solid rgba(110, 231, 255, 0.95);
  outline-offset: 2px;
}

.button:disabled,
.button[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
}

.meta-perk-card .meta-perk-requirement {
  line-height: 1.35;
}

.helpers-advanced-off .microcopy-line,
.helpers-advanced-off .camera-scene-action-hint,
.helpers-advanced-off .camera-scene-action-effect,
.helpers-advanced-off .guest-policy-reason,
.helpers-advanced-off .room-meta-line span {
  display: none;
}

.helpers-advanced-off .help-persistence-note,
.helpers-advanced-off .settings-footnote {
  display: block;
}

html[data-ui-scale='compact'] {
  font-size: 13px;
}

html[data-ui-scale='normal'] {
  font-size: 14px;
}

html[data-ui-scale='large'] {
  font-size: 16px;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation: none !important;
  transition-duration: 0s !important;
  scroll-behavior: auto !important;
}

body.high-contrast {
  --border: rgba(255, 255, 255, 0.36);
}

body.high-contrast .hero-card,
body.high-contrast .panel,
body.high-contrast .room-card,
body.high-contrast .camera-card,
body.high-contrast .guest-card,
body.high-contrast .log-item,
body.high-contrast .settings-item {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), var(--shadow);
}

body.high-contrast .muted,
body.high-contrast .label,
body.high-contrast .section-tag {
  color: rgba(234, 244, 255, 0.95);
}

/* === Phase 25X: mobile-first responsive + touch + small-screen pass === */

.mobile-menu-section {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.2rem 0.2rem 0.25rem;
}

.mobile-menu-section + .mobile-menu-section {
  margin-top: 0.55rem;
}

.mobile-menu-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.56rem 0.64rem;
  border-radius: 10px;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.mobile-menu-section > summary::-webkit-details-marker {
  display: none;
}

.mobile-menu-section > summary::after {
  content: '▾';
  float: right;
  opacity: 0.85;
}

.mobile-menu-section[open] > summary {
  background: rgba(125, 211, 252, 0.1);
  color: var(--text-main);
}

.mobile-menu-section[open] > summary::after {
  content: '▴';
}

.mobile-menu-section-body {
  padding: 0.15rem 0.55rem 0.45rem;
}

.main-menu-run-setup .main-menu-setup-label {
  display: block;
  margin-top: 0.45rem;
  margin-bottom: 0.28rem;
  font-size: 0.82rem;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.main-menu-setup-select {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  background: rgba(12, 18, 28, 0.9);
  color: var(--text-main);
  padding: 0.45rem 0.6rem;
}

.main-menu-contract-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.main-menu-contract-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.45rem 0.55rem;
  min-width: 0;
}

.main-menu-contract-item input[type='checkbox'] {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  accent-color: #7dd3fc;
}

.main-menu-contract-item span,
.main-menu-contract-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 921px) {
  .mobile-menu-section > summary {
    display: none;
  }

  .mobile-menu-section {
    padding: 0.75rem 0.85rem;
  }

  .mobile-menu-section:not([open]) > *:not(summary) {
    display: block;
  }

  #main-menu .hero-actions {
    margin-top: 0.95rem;
    margin-bottom: 0.55rem;
  }
}

@media (max-width: 1120px) {
  .hero-card,
  .panel {
    padding: 20px;
  }

  .main-menu-meta-surface {
    grid-template-columns: 1fr;
  }

  .night-prep-upgrade-grid,
  .prep-context-grid,
  .help-glossary-grid,
  .run-ending-tags {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  #app.screen-main-menu .topbar {
    gap: 8px;
    margin-bottom: 10px;
  }

  #app.screen-main-menu .topbar-stats,
  #app.screen-main-menu .topbar-upgrades {
    display: none;
  }

  #app.screen-main-menu .topbar h1 {
    font-size: clamp(1.45rem, 5.9vw, 1.82rem);
  }

  #app.screen-main-menu .topbar-subtitle {
    margin-top: 0.18rem;
  }

  #app.screen-main-menu #audio-toggle-btn,
  #app.screen-main-menu #open-settings-btn,
  #app.screen-main-menu #open-help-btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  #app.screen-main-menu #main-menu .hero-actions {
    top: max(4px, var(--safe-top));
    margin-top: 0.45rem;
  }

  .app-shell {
    padding-left: max(14px, var(--safe-left));
    padding-right: max(14px, var(--safe-right));
    padding-bottom: max(16px, var(--safe-bottom));
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: clamp(1.55rem, 6.2vw, 1.95rem);
  }

  .topbar-subtitle {
    font-size: 0.8rem;
  }

  #main-menu .hero-card {
    padding: 18px 16px;
    min-height: 0;
  }

  #main-menu .hero-card h2 {
    font-size: clamp(1.28rem, 6.4vw, 1.75rem);
    margin: 0.45rem 0 0.6rem;
    line-height: 1.18;
  }

  #main-menu .hero-actions {
    position: sticky;
    top: max(8px, var(--safe-top));
    z-index: 4;
    margin: 0.65rem 0 0.45rem;
    padding: 0.45rem;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 14px;
    background: rgba(8, 12, 20, 0.9);
    backdrop-filter: blur(6px);
  }

  .mobile-menu-section {
    padding: 0.15rem;
  }

  .main-menu-onboarding-card {
    padding: 0.66rem 0.72rem;
    gap: 0.4rem;
  }

  .main-menu-meta-surface {
    gap: 0.6rem;
  }

  .main-menu-contract-item {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'check label'
      '. bonus';
    align-items: start;
    row-gap: 0.15rem;
  }

  .main-menu-contract-item input {
    grid-area: check;
    margin-top: 0.2rem;
  }

  .main-menu-contract-item span {
    grid-area: label;
    font-size: 0.92rem;
  }

  .main-menu-contract-item small {
    grid-area: bonus;
    font-size: 0.78rem;
  }

  .main-menu-meta-line,
  .main-menu-meta-selected {
    font-size: 0.85rem;
  }

  .panel-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    margin-bottom: 14px;
    scrollbar-width: thin;
  }

  .panel-tabs .tab-button {
    flex: 0 0 auto;
    min-width: 118px;
    justify-content: center;
  }

  #app.screen-game-screen .panel-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    overflow: visible;
    padding-bottom: 0;
  }

  #app.screen-game-screen .panel-tabs .tab-button {
    min-width: 0;
    width: 100%;
    justify-content: center;
  }

  .panel {
    min-height: 0;
    padding: 16px;
  }

  .panel-header {
    align-items: flex-start;
  }

  .panel-header .button {
    width: 100%;
  }

  .shift-status-card {
    margin-top: 0.7rem;
    padding: 0.75rem;
    gap: 0.58rem;
  }

  .shift-primary-block,
  .shift-context-block,
  .shift-secondary-block {
    padding: 0.62rem 0.68rem;
  }

  .finale-command-row {
    grid-template-columns: 1fr;
  }

  .room-grid,
  .camera-grid,
  .night-prep-upgrade-grid,
  .prep-context-grid {
    grid-template-columns: 1fr;
  }

  .guest-card,
  .room-card,
  .camera-card,
  .log-item {
    padding: 12px;
  }

  .room-card-vacant {
    padding: 9px 10px;
    border-radius: 12px;
  }

  .room-card-vacant .room-card-header {
    margin-bottom: 0.15rem;
  }

  .room-card-vacant .room-condition-pill {
    font-size: 0.62rem;
    padding: 0.14rem 0.4rem;
  }

  .room-card-vacant .room-meta {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.28;
  }

  .guest-card h4,
  .room-card h4,
  .camera-card h4 {
    overflow-wrap: anywhere;
  }

  .guest-action-row,
  .room-tactical-row,
  .report-panel-actions,
  .button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .guest-action-row .button,
  .room-tactical-row .button,
  .report-panel-actions .button,
  .button-row .button,
  .hero-actions .button {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  .camera-scene-overlay,
  .help-overlay {
    align-items: flex-end;
    padding: max(8px, var(--safe-top)) max(8px, var(--safe-right)) max(8px, var(--safe-bottom)) max(8px, var(--safe-left));
  }

  .help-overlay-panel,
  .settings-overlay-panel,
  .camera-scene-panel {
    width: min(100%, calc(100vw - 0.5rem));
    max-height: min(88dvh, calc(100dvh - max(10px, var(--safe-top)) - max(10px, var(--safe-bottom))));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 16px;
    padding: 0.8rem;
  }

  .camera-scene-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(10, 14, 22, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: -0.2rem -0.2rem 0.55rem;
    padding: 0.6rem;
  }

  .camera-scene-actions,
  .help-glossary-grid,
  .settings-grid {
    overflow: visible;
    padding-right: 0.1rem;
  }

  .camera-scene-actions {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .camera-scene-action-btn {
    gap: 0.42rem;
  }

  .camera-scene-action-stack {
    gap: 0.42rem;
  }

  .camera-scene-action-title {
    font-size: 0.98rem;
    line-height: 1.34;
  }

  .camera-scene-action-cost,
  .camera-scene-action-desc,
  .camera-scene-action-note {
    line-height: 1.46;
  }

  .summary-screen .hero-card,
  #night-prep-screen .hero-card,
  #failure-screen .hero-card,
  #run-ending-screen .hero-card {
    padding: 16px;
    gap: 12px;
  }

  #summary-screen .hero-actions,
  #night-prep-screen .hero-actions,
  #failure-screen .hero-actions,
  #run-ending-screen .hero-actions {
    position: sticky;
    bottom: max(6px, var(--safe-bottom));
    z-index: 3;
    margin-top: 0.4rem;
    padding: 0.5rem;
    border: 1px solid rgba(125, 211, 252, 0.2);
    border-radius: 12px;
    background: rgba(8, 12, 20, 0.92);
  }

  .summary-performance-block,
  .summary-flavor-block,
  .prep-primary-block,
  .run-ending-reward-block {
    padding: 0.62rem;
  }

  .run-ending-tags,
  .guest-critical-badges,
  .guest-chip-row,
  .room-pressure-row,
  .camera-scene-modifiers {
    gap: 0.34rem;
  }

  .run-ending-tag,
  .room-state-chip,
  .guest-meta-chip,
  .camera-scene-modifier {
    overflow-wrap: anywhere;
  }

  .log-item {
    grid-template-columns: 1fr;
  }

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

  .hero-actions .button,
  .report-panel-actions .button,
  .room-tactical-row .button,
  .guest-action-row .button {
    flex: 1 1 180px;
  }

  .help-overlay-panel,
  .settings-overlay-panel,
  .camera-scene-panel {
    width: min(100%, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-top: max(10px, var(--safe-top));
    padding-left: max(10px, var(--safe-left));
    padding-right: max(10px, var(--safe-right));
  }

  .topbar-stats {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .hero-card h2 {
    line-height: 1.2;
  }

  .eyebrow,
  .section-tag {
    letter-spacing: 0.11em;
    font-size: 0.66rem;
  }

  .muted,
  .guest-note,
  .guest-policy-reason,
  .camera-scene-description,
  .scenario-description {
    font-size: 0.9rem;
    line-height: 1.48;
  }

  .room-meta-line {
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
  }

  .room-card .room-meta-line strong,
  .room-card .room-meta-line span {
    white-space: normal;
    text-align: left;
  }

  .camera-preview {
    height: 95px;
  }

  .app-shell::before,
  .app-shell::after {
    opacity: 0.75;
  }

  .summary-breakdown,
  .summary-thread-flavor,
  .run-ending-notes,
  .run-ending-reward-discoveries,
  .run-ending-reward-unlocks {
    word-break: break-word;
  }
}

@media (max-width: 560px) {
  .topbar-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-box {
    padding: 10px;
  }

  .stat-box strong {
    margin-top: 4px;
    font-size: 1.05rem;
  }

  .camera-scene-header {
    gap: 0.5rem;
  }

  .overlay-close-btn {
    min-width: 68px;
    padding-inline: 0.7rem;
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .room-card.is-critical-pulse,
  .tutorial-highlight {
    animation-duration: 2.6s;
  }
}

/* Phase 2 — clarity, pressure, replayability visuals */
.panel,
.hero-card,
.guest-card,
.room-card,
.camera-card,
.shift-status-card,
.scenario-card,
.active-night-event-card,
.active-story-beat-card,
.log-item {
  background: color-mix(in srgb, var(--bg-panel) 92%, #ffffff 8%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(110, 231, 255, 0.06);
}

.panel,
.hero-card {
  padding: 24px;
}

.guest-card h4,
.room-card h4,
.camera-card h4,
.shift-status-title {
  color: #f8fbff;
}

.guest-card,
.room-card,
.camera-card,
.log-item {
  padding: 18px;
}

.button.button-primary,
.guest-action-row .button.button-primary {
  box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.2), 0 8px 20px rgba(110, 231, 255, 0.15);
}

.guest-action-row .button:nth-child(2) {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.guest-action-row .button.button-danger,
.button.button-danger {
  border-color: rgba(239, 68, 68, 0.45);
}

.phase2-tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.76);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 16px;
}

.phase2-tutorial-overlay.is-open {
  display: flex;
}

.phase2-tutorial-panel {
  width: min(560px, 96vw);
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(110, 231, 255, 0.3);
  border-radius: 16px;
  padding: 20px;
}

.phase2-tutorial-progress {
  font-size: 0.84rem;
  color: var(--text-soft);
  margin: 8px 0 14px;
}

.phase2-context-hint {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 320px;
  background: rgba(11, 18, 32, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  border-radius: 12px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 1100;
}

.phase2-context-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.phase2-guest-card .guest-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phase2-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(110, 231, 255, 0.35);
  background: linear-gradient(180deg, rgba(110, 231, 255, 0.24), rgba(255, 255, 255, 0.05));
  flex-shrink: 0;
}

.phase2-avatar.sil-b { border-radius: 42% 58% 55% 45%; }
.phase2-avatar.sil-c { border-radius: 35% 65% 40% 60%; }
.phase2-avatar.sil-d { border-radius: 60% 40% 48% 52%; }
.phase2-avatar.sil-e { border-radius: 50% 50% 40% 60%; }

.phase2-trait-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.phase2-trait-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
}

.phase2-recent-actions {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.phase2-recent-actions ul {
  margin: 6px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--text-main);
}

.phase2-float {
  position: fixed;
  left: 50%;
  bottom: 22%;
  transform: translate(-50%, 0);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: phase2Float 1100ms ease forwards;
  z-index: 1000;
}

.phase2-float-safe { background: rgba(34, 197, 94, 0.2); color: #bbf7d0; }
.phase2-float-warn { background: rgba(251, 191, 36, 0.2); color: #fde68a; }
.phase2-float-danger { background: rgba(239, 68, 68, 0.2); color: #fecaca; }

@keyframes phase2Float {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  20% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -14px); }
}

.phase2-pressure-elevated .shift-status-card { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2); }
.phase2-pressure-severe .shift-status-card { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.24); }
.phase2-pressure-critical .shift-status-card { box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.32), 0 0 22px rgba(248, 113, 113, 0.18); }

.phase2-pressure-critical .tab-button.active {
  border-color: rgba(248, 113, 113, 0.5);
}

/* ===== Phase 3: Presentation & Retention ===== */

.phase3-onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  pointer-events: none;
}

.phase3-onboarding-overlay.is-open {
  display: block;
}

.phase3-onboarding-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 18, 0.74);
}

.phase3-onboarding-spotlight,
.phase3-onboarding-highlight {
  position: fixed;
  border: 1px solid rgba(110, 231, 255, 0.5);
  box-shadow: 0 0 0 9999px rgba(3, 6, 14, 0.68), 0 0 22px rgba(110, 231, 255, 0.18);
  border-radius: 10px;
  pointer-events: none;
}

.phase3-onboarding-spotlight.is-hidden {
  opacity: 0;
  width: 0 !important;
  height: 0 !important;
  border-width: 0;
  box-shadow: none;
}

.phase3-onboarding-panel {
  position: fixed;
  z-index: 1402;
  width: min(360px, 92vw);
  background: rgba(12, 18, 32, 0.95);
  border: 1px solid rgba(110, 231, 255, 0.34);
  border-radius: 14px;
  padding: 12px;
  color: #dbeafe;
  pointer-events: auto;
}

.phase3-onboarding-panel h4 { margin: 0 0 6px; }
.phase3-onboarding-panel p { margin: 0 0 10px; color: var(--text-soft); }

.phase3-onboarding-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.phase3-help-tutorial-controls {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.phase3-help-tutorial-controls .button {
  margin-top: 6px;
}

.guest-clue-emphasis {
  color: rgba(125, 211, 252, 0.92);
  font-weight: 600;
}

.phase3-silhouette-body {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-block;
}

.phase3-silhouette-head {
  position: absolute;
  top: 0;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translateX(-50%);
  border: 1px solid rgba(226, 232, 240, 0.7);
  background: rgba(15, 23, 42, 0.75);
}

.phase3-silhouette-head.head-round { border-radius: 50%; }
.phase3-silhouette-head.head-oval { border-radius: 45% 45% 52% 52%; height: 10px; }
.phase3-silhouette-head.head-square { border-radius: 2px; }

.phase3-silhouette-torso {
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 13px;
  height: 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(148, 163, 184, 0.52);
  border-radius: 6px 6px 3px 3px;
  background: rgba(15, 23, 42, 0.7);
}

.phase3-silhouette-body.posture-forward { transform: skewX(-8deg); }
.phase3-silhouette-body.posture-slouch { transform: translateY(1px); opacity: 0.9; }
.phase3-silhouette-body.outfit-hood .phase3-silhouette-head { box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.5); }
.phase3-silhouette-body.outfit-collar .phase3-silhouette-torso { border-radius: 3px 3px 5px 5px; }
.phase3-silhouette-body.outfit-jacket .phase3-silhouette-torso { width: 15px; }
.phase3-silhouette-body.outfit-cap .phase3-silhouette-head { box-shadow: inset 0 2px 0 rgba(125, 211, 252, 0.3); }
.phase3-silhouette-body.accent-special .phase3-silhouette-torso { border-color: rgba(251, 191, 36, 0.65); }
.phase3-silhouette-body.accent-known .phase3-silhouette-torso { border-color: rgba(34, 197, 94, 0.58); }

.phase3-silhouette-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at 30% 25%, rgba(226, 232, 240, 0.22), rgba(15, 23, 42, 0.88));
  color: #f8fbff;
  text-shadow: 0 1px 1px rgba(2, 6, 23, 0.9);
  flex-shrink: 0;
}

.phase3-silhouette-avatar.variant-calm { border-color: rgba(56, 189, 248, 0.4); }
.phase3-silhouette-avatar.variant-nervous { border-color: rgba(251, 191, 36, 0.45); }
.phase3-silhouette-avatar.variant-aggressive { border-color: rgba(248, 113, 113, 0.5); }
.phase3-silhouette-avatar.variant-exhausted { border-color: rgba(148, 163, 184, 0.4); opacity: 0.88; }
.phase3-silhouette-avatar.variant-suspicious { border-color: rgba(167, 139, 250, 0.46); }
.phase3-silhouette-avatar.variant-known { border-color: rgba(34, 197, 94, 0.42); }
.phase3-silhouette-avatar.variant-special {
  border-color: rgba(251, 191, 36, 0.56);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25), inset 0 0 0 1px rgba(251, 191, 36, 0.18);
}

.phase3-special-guest {
  border-color: rgba(251, 191, 36, 0.34);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.14);
}

.phase3-guest-card-refined { border-color: rgba(148, 163, 184, 0.22); }
.phase3-guest-header { margin-bottom: 4px; }

.phase3-guest-header-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.45rem;
}

.phase3-header-main {
  min-width: 0;
}

.phase3-header-main h4 {
  margin: 0;
  line-height: 1.2;
}

.phase3-header-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.phase3-decision-summary {
  margin: 0.16rem 0 0.28rem;
  font-size: 0.79rem;
  color: #bfdbfe;
  line-height: 1.35;
}

.phase3-chip-row {
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.phase3-chip { opacity: 0.95; }
.phase3-chip-warning { border-color: rgba(248, 113, 113, 0.35); }
.phase3-chip-policy { border-color: rgba(59, 130, 246, 0.32); }
.phase3-chip-mood { border-color: rgba(167, 139, 250, 0.32); }
.phase3-chip-stay { border-color: rgba(250, 204, 21, 0.32); }
.phase3-chip-trait { border-color: rgba(94, 234, 212, 0.3); }

.phase3-detail-line.is-secondary {
  opacity: 0.82;
  font-size: 0.9em;
}


.phase3-detail-block {
  margin-top: 0.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 0.45rem;
}

#guest-queue.phase3-queue-compact .guest-card { margin-bottom: 8px; padding: 10px; }
.phase3-lower-priority { border-left: 2px solid rgba(148, 163, 184, 0.28); }

.phase3-card-details {
  margin: 8px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 6px;
}

.phase3-card-details > summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.phase3-decision-row { gap: 8px; }

.phase3-decision-btn {
  transition: transform 110ms ease, filter 110ms ease, box-shadow 120ms ease;
}

.phase3-decision-btn:hover { filter: brightness(1.04); }
.phase3-decision-btn.phase3-pressed { transform: translateY(1px) scale(0.99); }

.phase3-decision-checkin { box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35); }
.phase3-decision-flag { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35); }
.phase3-decision-reject { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35); }

.phase3-selected-flash { animation: phase3Pulse 280ms ease; }
@keyframes phase3Pulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.phase3-summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.phase3-summary-stat {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.5);
}

.phase3-summary-stat span {
  display: block;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.phase3-shift-grade-line {
  margin-top: 4px;
  color: #bfdbfe;
  letter-spacing: 0.03em;
}

.phase3-summary-flavor-lines p { margin: 8px 0 0; }
.phase3-summary-replay-row { margin-top: 10px; border-top: 1px solid rgba(148, 163, 184, 0.2); padding-top: 8px; }

.phase3-motel-identity .section-tag {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phase3-alert-signage { border-color: rgba(251, 191, 36, 0.35); }

@media (max-width: 720px) {
  .phase3-onboarding-panel,
  .phase3-mobile-panel {
    width: min(94vw, 360px);
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    bottom: 10px !important;
    top: auto !important;
  }

  .phase3-summary-stats-grid,
  .phase3-mobile-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phase3-tap-button {
    min-height: 42px;
    padding: 0.55rem 0.7rem;
  }
}

/* ─── Continue After Failure Overlay ─────────────────────────── */

.cfo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cfo-overlay.is-open {
  display: flex;
}

/* v0.55 — Shift Contract cards (main menu) */
.dem-contract-header {
  display: grid;
  gap: 4px;
  margin: 6px 0 10px;
}
.dem-contract-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 560px) {
  .dem-contract-grid {
    grid-template-columns: 1fr;
  }
}
.dem-contract-card {
  border-radius: 14px;
  padding: 10px 10px 9px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(241, 245, 249, 0.92);
}
.dem-contract-card.is-selected {
  border-color: rgba(110, 231, 255, 0.35);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}
.dem-contract-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dem-contract-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.dem-contract-badges {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.dem-contract-risk,
.dem-contract-bonus {
  font-size: 0.75rem;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.dem-contract-bonus {
  border-color: rgba(167, 243, 208, 0.22);
  background: rgba(167, 243, 208, 0.07);
}
.dem-contract-desc {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.35;
}
.dem-contract-note {
  margin: 10px 0 0;
  font-size: 0.86rem;
}

/* v0.56 — Tutorial overlay + toast */
#dem-overlay-root.dem-overlay-root {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: none;
}
#dem-overlay-root.dem-overlay-root.is-open {
  display: block;
}
.dem-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 16, 0.82);
  backdrop-filter: blur(3px);
}
.dem-overlay-card {
  position: absolute;
  inset: auto 14px 14px 14px;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(15, 18, 30, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 18px 16px 14px;
}
.dem-overlay-title {
  margin: 6px 0 6px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.dem-overlay-body {
  margin: 0;
  line-height: 1.5;
}
.dem-overlay-progress {
  margin-top: 10px;
  font-size: 0.86rem;
}
.dem-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.dem-overlay-actions .button {
  min-height: 44px;
}

#dem-toast.dem-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1700;
}
.dem-toast-card {
  max-width: 680px;
  margin: 0 auto;
  background: rgba(15, 18, 30, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 12px 12px 10px;
}
.dem-toast-msg {
  color: rgba(241, 245, 249, 0.95);
  line-height: 1.45;
}
.dem-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.dem-toast-actions .button {
  min-height: 44px;
}

/* v0.56 — Daily card (main menu) */
.dem-daily-card {
  margin-top: 10px;
  padding: 12px 12px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.dem-daily-title {
  margin: 0;
  line-height: 1.4;
}
.dem-daily-note {
  margin: 6px 0 0;
}
.dem-daily-streak {
  margin: 8px 0 0;
  font-size: 0.9rem;
}
.dem-daily-actions {
  margin-top: 10px;
}
.dem-daily-hint {
  margin: 8px 0 0;
  font-size: 0.86rem;
}

.cfo-panel {
  background: rgba(15, 18, 30, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 24px 22px 20px;
  max-width: min(480px, calc(100vw - 32px));
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cfo-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: rgba(251, 113, 133, 0.95);
  text-align: center;
}

.cfo-subtitle {
  margin: 0;
  font-size: 0.94rem;
  color: rgba(148, 163, 184, 0.92);
  line-height: 1.45;
  text-align: center;
}

.cfo-recap {
  text-align: center;
}

.cfo-recap-pct {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.95);
}

.cfo-recap-line {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: rgba(167, 243, 208, 0.88);
}

.cfo-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.cfo-stat {
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(203, 213, 225, 0.90);
}

.cfo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cfo-use-credit-btn {
  background: rgba(110, 231, 183, 0.14);
  border: 1px solid rgba(110, 231, 183, 0.35);
  color: rgba(209, 250, 229, 0.97);
  font-weight: 700;
}

.cfo-use-credit-btn:hover:not(:disabled) {
  background: rgba(110, 231, 183, 0.22);
}

.cfo-note {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(148, 163, 184, 0.80);
  text-align: center;
  line-height: 1.45;
}

.cfo-continue-used-msg {
  color: rgba(251, 113, 133, 0.75);
}

.cfo-ad-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.cfo-ad-title {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.70);
}

.cfo-ad-label {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.60);
}

.cfo-ad-countdown {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.90);
}

/* ─── end Continue After Failure Overlay ─────────────────────── */
