:root {
  color-scheme: dark;
  --bg: #0d1014;
  --sidebar: #141821;
  --surface: #191f2a;
  --surface-2: #202735;
  --line: #334052;
  --ink: #f4f7fb;
  --muted: #b9c3d0;
  --soft: #8f9dad;
  --green: #32d583;
  --blue: #5ba7ff;
  --purple: #b692f6;
  --amber: #fdbb40;
  --red: #ff6b6b;
  --cyan: #46d9d3;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.game-stage {
  min-height: 100vh;
  background: #070b13;
  position: relative;
  overflow: hidden;
}

.stage-toolbar {
  position: absolute;
  z-index: 12;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  pointer-events: none;
}

.stage-brand,
.stage-actions {
  pointer-events: auto;
}

.stage-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 20, 32, 0.78);
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}

.stage-brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.stage-brand strong,
.stage-brand span {
  display: block;
}

.stage-brand span,
.stage-info p {
  color: var(--muted);
}

.stage-actions {
  display: flex;
  gap: 8px;
}

.stage-actions button {
  min-height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 999px;
  background: rgba(14, 20, 32, 0.78);
  color: var(--ink);
  padding: 9px 14px;
  backdrop-filter: blur(10px);
}

.stage-canvas {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: #070b13;
}

.stage-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease-out, filter 420ms ease-out;
}

.stage-canvas.warping .stage-image {
  transform: scale(1.08);
  opacity: 0.34;
  filter: blur(10px) saturate(1.35);
}

.stage-canvas.building-mode .stage-image {
  transform: scale(1.02);
  object-fit: cover;
}

.stage-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 11, 19, 0.74), transparent 18%, transparent 72%, rgba(7, 11, 19, 0.72)),
    linear-gradient(0deg, rgba(7, 11, 19, 0.64), transparent 40%, rgba(7, 11, 19, 0.24));
  pointer-events: none;
}

.stage-hotspots {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.stage-hotspot {
  position: absolute;
  min-width: 52px;
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(14, 20, 32, 0.68);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 7px rgba(70, 217, 211, 0.16), 0 0 26px rgba(70, 217, 211, 0.35);
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%);
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}

.stage-hotspot:hover,
.stage-hotspot:focus-visible {
  transform: translate(-50%, -56%) scale(1.08);
  box-shadow: 0 0 0 10px rgba(91, 167, 255, 0.2), 0 0 34px rgba(91, 167, 255, 0.55);
}

.stage-info {
  position: absolute;
  z-index: 8;
  left: 24px;
  bottom: 24px;
  max-width: 420px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(14, 20, 32, 0.82);
  border-radius: 10px;
  padding: 16px;
  backdrop-filter: blur(12px);
}

.stage-info h1 {
  font-size: 1.6rem;
}

.stage-info-link {
  display: grid;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.stage-info-link p,
.stage-info-link h1 {
  margin: 0;
}

.stage-info-link span {
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  padding: 9px 13px;
  color: white;
  background: linear-gradient(135deg, #ff2b5c, #b80d3a);
  font-size: 0.82rem;
  font-weight: 900;
}

.stage-info:has(.take-my-time-stage-link) {
  background:
    linear-gradient(135deg, rgba(255, 43, 92, 0.26), rgba(14, 20, 32, 0.86)),
    rgba(14, 20, 32, 0.82);
  border-color: rgba(255, 88, 126, 0.72);
  box-shadow: 0 22px 58px rgba(255, 43, 92, 0.22);
}

.stage-info:has(.take-my-time-stage-link):hover,
.stage-info:has(.take-my-time-stage-link):focus-within {
  transform: translateY(-2px);
  border-color: rgba(255, 148, 171, 0.92);
  box-shadow: 0 28px 70px rgba(255, 43, 92, 0.28);
}

.stage-data-layer {
  position: absolute;
  z-index: 9;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 48px));
  max-height: min(62vh, 620px);
  overflow: auto;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(14, 20, 32, 0.82);
  border-radius: 10px;
  padding: 12px;
  backdrop-filter: blur(12px);
  transition: width 180ms ease, max-height 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.stage-data-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.stage-data-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stage-data-toggle {
  min-height: 32px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--ink);
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.stage-data-toggle:hover,
.stage-data-toggle:focus-visible {
  border-color: rgba(125, 211, 252, 0.74);
  background: rgba(29, 78, 216, 0.34);
}

.stage-data-header h2,
.stage-data-card h3 {
  margin: 0;
  font-size: 1rem;
}

.stage-data-header p,
.stage-data-card p,
.stage-data-row small {
  color: var(--muted);
}

.stage-data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stage-metric,
.stage-data-card,
.stage-data-row {
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: rgba(25, 34, 49, 0.84);
  border-radius: 8px;
  padding: 9px;
}

.stage-metric strong,
.stage-metric span {
  display: block;
}

.stage-metric strong {
  font-size: 1rem;
}

.stage-metric span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.stage-data-card + .stage-data-card {
  margin-top: 8px;
}

.stage-data-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.stage-data-row strong,
.stage-data-row small {
  display: block;
}

.stage-data-badge {
  display: inline-flex;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--ink);
  background: rgba(38, 60, 95, 0.72);
  font-size: 0.78rem;
  white-space: nowrap;
}

.stage-data-badge.warning {
  border-color: rgba(253, 187, 64, 0.45);
  color: #ffe2aa;
  background: rgba(73, 57, 31, 0.72);
}

.stage-data-badge.safe {
  border-color: rgba(50, 213, 131, 0.4);
  color: #bdffd8;
  background: rgba(31, 64, 50, 0.72);
}

.stage-data-layer.is-collapsed {
  width: auto;
  max-width: min(260px, calc(100vw - 48px));
  max-height: 64px;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.42);
}

.stage-data-layer.is-collapsed .stage-data-header {
  align-items: center;
  margin-bottom: 0;
}

.stage-data-layer.is-collapsed .stage-data-header p,
.stage-data-layer.is-collapsed .stage-data-body,
.stage-data-layer.is-collapsed .stage-data-badge {
  display: none;
}

.stage-data-layer.is-collapsed .stage-data-header h2 {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-mode-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.staff-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.staff-avatar {
  position: absolute;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: rgba(31, 38, 51, 0.82);
  box-shadow: 0 0 18px rgba(70, 217, 211, 0.32);
  animation: staff-walk var(--walk-duration, 7s) ease-in-out infinite alternate;
}

.staff-avatar::after {
  content: attr(data-name);
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  color: var(--ink);
  background: rgba(14, 20, 32, 0.76);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 999px;
  padding: 2px 7px;
}

@keyframes staff-walk {
  from {
    transform: translate3d(-10px, 0, 0);
  }
  50% {
    transform: translate3d(8px, -12px, 0);
  }
  to {
    transform: translate3d(16px, 8px, 0);
  }
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand span,
.section-label,
small {
  color: var(--muted);
}

.nav-list,
.quick-actions,
.agent-list,
.approval-list,
.action-outbox-list,
.activity-feed {
  display: grid;
  gap: 8px;
}

.nav-item,
.quick-actions button,
.small-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.nav-item:hover,
.quick-actions button:hover,
.small-button:hover {
  background: var(--surface-2);
}

.nav-item.active {
  background: #263c5f;
  border-color: var(--blue);
}

.quick-actions {
  margin-top: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.quick-actions h2,
.panel h2,
.office-map h2 {
  margin: 0;
  font-size: 1rem;
}

.workspace {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.command {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.command input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.command:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(70, 217, 211, 0.16);
}

.command input::placeholder {
  color: var(--muted);
}

kbd,
.live-chip,
.warning {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface);
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.pulse-demo {
  background: var(--amber);
}

.pulse-connecting {
  background: var(--cyan);
}

.pulse-live {
  background: var(--green);
}

.pulse-error {
  background: var(--red);
}

.realtime-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(140px, 0.45fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--surface);
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.realtime-panel[hidden] {
  display: none;
}

.realtime-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.realtime-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.realtime-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.realtime-panel input {
  min-height: 42px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111925;
  color: var(--ink);
  padding: 9px 10px;
}

.realtime-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.realtime-note {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.make-kit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(50, 213, 131, 0.28);
  border-radius: 8px;
  background: rgba(25, 34, 49, 0.72);
  padding: 10px;
}

.make-audit-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 8px;
  background: rgba(28, 31, 40, 0.74);
  padding: 10px;
}

.make-audit-card strong,
.make-audit-card small {
  display: block;
}

.make-audit-card small {
  margin-top: 4px;
  color: var(--muted);
}

.make-audit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.make-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.make-audit-header .small-button {
  width: auto;
  white-space: nowrap;
}

.make-audit-updated {
  color: var(--soft);
  font-size: 0.74rem;
  margin-top: 4px;
}

.make-audit-header small {
  margin-top: 0;
}

.make-audit-pill {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(13, 20, 32, 0.7);
  padding: 9px;
}

.make-audit-pill span,
.make-audit-pill strong {
  display: block;
}

.make-audit-pill span {
  color: var(--muted);
  font-size: 0.75rem;
}

.make-audit-pill strong {
  margin-top: 2px;
  font-size: 1.1rem;
}

.make-audit-pill.production {
  border-color: rgba(50, 213, 131, 0.35);
}

.make-audit-pill.recent {
  border-color: rgba(125, 211, 252, 0.35);
}

.make-audit-pill.training {
  border-color: rgba(250, 204, 21, 0.35);
}

.make-audit-details {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.make-audit-detail-item {
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 8px;
  background: rgba(14, 20, 32, 0.72);
  padding: 8px 10px;
}

.make-audit-detail-item h3 {
  margin: 0 0 6px;
  font-size: 0.82rem;
}

.make-audit-detail-item ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.make-audit-detail-item li {
  color: var(--ink);
  font-size: 0.8rem;
}

.make-audit-detail-item small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 4px;
}

.make-kit[hidden] {
  display: none;
}

.make-kit strong,
.make-kit small {
  display: block;
}

.make-kit small {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.make-kit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.make-contract-output {
  grid-column: 1 / -1;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 8px;
  background: #0d1420;
  color: var(--muted);
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.make-contract-output:empty {
  display: none;
}

.hero-band,
.office-map,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 20px;
}

.section-label {
  margin: 0 0 6px;
  font-size: 0.85rem;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 8px;
}

.summary-strip div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.summary-strip span {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.panel,
.office-map {
  padding: 14px;
}

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

.visual-map {
  overflow: hidden;
}

.city-visual {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #070b13;
}

.city-visual img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
  display: block;
}

.city-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 13, 22, 0.74), transparent 22%, transparent 72%, rgba(9, 13, 22, 0.72)),
    linear-gradient(0deg, rgba(9, 13, 22, 0.58), transparent 34%, rgba(9, 13, 22, 0.36));
  pointer-events: none;
}

.city-visual.data-layer-on::after {
  background:
    linear-gradient(90deg, rgba(9, 13, 22, 0.42), transparent 18%, transparent 78%, rgba(9, 13, 22, 0.44)),
    linear-gradient(0deg, rgba(9, 13, 22, 0.34), transparent 42%, rgba(9, 13, 22, 0.22));
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(70, 217, 211, 0.24);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 5px rgba(70, 217, 211, 0.13);
  z-index: 4;
  transition: transform 180ms ease-out, background 180ms ease-out, box-shadow 180ms ease-out;
}

.hotspot:hover,
.hotspot.active {
  transform: translateY(-2px) scale(1.08);
  background: rgba(91, 167, 255, 0.42);
  box-shadow: 0 0 0 8px rgba(91, 167, 255, 0.18);
}

.room-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.room-selector button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #192231;
  color: var(--ink);
  padding: 7px 10px;
  min-height: 44px;
}

.room-selector button[aria-pressed="true"] {
  background: #263c5f;
  border-color: var(--blue);
}

.map-overlay {
  position: absolute;
  z-index: 2;
  max-width: 240px;
  border: 1px solid rgba(125, 211, 252, 0.55);
  background: rgba(14, 20, 32, 0.78);
  border-radius: 8px;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}

.map-overlay.take-my-time-link {
  max-width: 270px;
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(255, 43, 92, 0.26), rgba(14, 20, 32, 0.84)),
    rgba(14, 20, 32, 0.78);
  border-color: rgba(255, 88, 126, 0.72);
  box-shadow: 0 16px 42px rgba(255, 43, 92, 0.18);
  cursor: pointer;
}

.map-overlay.take-my-time-link:hover,
.map-overlay.take-my-time-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 148, 171, 0.92);
  box-shadow: 0 22px 58px rgba(255, 43, 92, 0.24);
}

.map-overlay strong,
.map-overlay span {
  display: block;
}

.map-overlay span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.top-left {
  top: 18px;
  left: 18px;
}

.top-right {
  top: 18px;
  right: 18px;
}

.bottom-left {
  bottom: 18px;
  left: 18px;
}

.bottom-right {
  bottom: 18px;
  right: 18px;
}

.room-link-card {
  display: grid;
  gap: 7px;
  text-decoration: none;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 43, 92, 0.24), rgba(25, 34, 49, 0.92)),
    var(--surface);
  border-color: rgba(255, 88, 126, 0.58);
}

.room-link-card:hover,
.room-link-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 148, 171, 0.82);
}

.room-link-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 11px;
  color: white;
  background: linear-gradient(135deg, #ff2b5c, #b80d3a);
  font-size: 0.78rem;
  font-weight: 900;
}

.office-room-panel {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.room-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.room-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #2b3447;
  border: 1px solid var(--line);
  font-size: 1.25rem;
}

.room-title h3,
.room-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.room-title p,
.room-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.room-widget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.room-widget {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #192231;
}

.room-widget strong,
.room-widget span {
  display: block;
}

.room-widget span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.room-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #192231;
}

.room-card + .room-card {
  margin-top: 8px;
}

.right-rail {
  display: grid;
  gap: 16px;
}

.agent-row,
.approval-row,
.activity-row,
.outbox-row,
.task-row {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.agent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a3447;
}

.status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status.working,
.status.online {
  background: var(--green);
}

.status.waiting {
  background: var(--amber);
}

.status.blocked {
  background: var(--red);
}

.agent-row strong,
.approval-row strong,
.outbox-row strong,
.task-row strong {
  display: block;
}

.agent-row small,
.approval-row small,
.outbox-row small,
.activity-row small,
.task-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.approval-row {
  display: grid;
  gap: 10px;
}

.outbox-row {
  display: grid;
  gap: 10px;
  border-color: rgba(50, 213, 131, 0.26);
}

.approval-meta,
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.approval-actions button {
  min-height: 36px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-radius: 999px;
  background: #172337;
  color: var(--ink);
  padding: 6px 10px;
}

.approval-actions button:hover {
  background: #263c5f;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.task-table {
  display: grid;
  gap: 8px;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px 120px;
  gap: 12px;
  align-items: center;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #273141;
  font-size: 0.82rem;
}

.badge.high {
  background: #4b2630;
  color: #ffd4d4;
}

.badge.medium {
  background: #49391f;
  color: #ffe2aa;
}

.badge.low {
  background: #1f4032;
  color: #bdffd8;
}

.activity-row {
  display: grid;
  gap: 4px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

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

@media (max-width: 760px) {
  .stage-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stage-actions {
    width: 100%;
  }

  .stage-actions button {
    flex: 1;
  }

  .stage-info {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .stage-canvas.building-mode .stage-info {
    display: none;
  }

  .stage-data-layer {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 40vh;
  }

  .stage-canvas.city-mode .stage-data-layer {
    display: none;
  }

  .stage-data-grid {
    grid-template-columns: 1fr;
  }

  .stage-info h1 {
    font-size: 1.25rem;
  }

  .stage-hotspot {
    min-width: 48px;
    min-height: 48px;
  }

  .workspace {
    padding: 12px;
  }

  .topbar,
  .hero-band {
    grid-template-columns: 1fr;
  }

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

  .make-kit {
    grid-template-columns: 1fr;
  }

  .make-kit-actions {
    justify-content: stretch;
  }

  .make-kit-actions button {
    flex: 1;
  }

  .make-audit-details {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .city-visual,
  .city-visual img {
    min-height: 420px;
  }

  .hotspot {
    width: 46px;
    height: 46px;
  }

  .map-overlay {
    position: static;
    margin: 8px;
  }

  .office-room-panel,
  .room-widget-grid {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: no-preference) {
  .pulse {
    animation: pulse 1.4s ease-out infinite;
  }

  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(50, 213, 131, 0.5);
    }
    100% {
      box-shadow: 0 0 0 12px rgba(50, 213, 131, 0);
    }
  }
}

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