:root {
  --bg: #020817;
  --bg-2: #031126;
  --panel: #071f44;
  --panel-2: #082a5b;
  --panel-3: #06366e;
  --line: #0f52d9;
  --line-2: #1976ff;
  --accent: #00d9ff;
  --text: #eef8ff;
  --muted: #b8d7ff;
  --dim: #6f93c8;
  --shadow: rgba(0, 217, 255, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, rgba(0, 217, 255, 0.12), transparent 32rem), var(--bg);
  color: var(--text);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.page {
  width: min(1360px, calc(100% - 20px));
  margin: 0 auto;
  padding: 12px 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
  padding: 8px 0;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--panel-2), var(--bg-2));
  color: var(--accent);
  font-weight: 900;
  box-shadow: 0 0 22px var(--shadow);
}

.brand h1 {
  margin: 0;
  font-size: clamp(21px, 2.5vw, 30px);
  line-height: 1.12;
}

.brand p,
.subtle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel-3);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #041225;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 11px;
  text-decoration: none;
  text-transform: uppercase;
}

.topbar-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--shadow);
}

.notice-banner {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  margin: 0;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(6, 54, 110, 0.9);
  color: var(--text);
  box-shadow: 0 0 22px var(--shadow);
  padding: 11px 13px;
  font-weight: 900;
  pointer-events: none;
}

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

.surface-grid {
  grid-auto-rows: minmax(54px, auto);
  align-items: stretch;
}

.student-dense,
.host-dense {
  align-items: start;
}

.host-layout {
  grid-auto-flow: dense;
}

.student-mobile-stack {
  display: grid;
  gap: 8px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(7, 31, 68, 0.96), rgba(3, 17, 38, 0.98));
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.08);
  padding: 12px;
  min-width: 0;
}

.panel.accent {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(6, 54, 110, 0.96), rgba(7, 31, 68, 0.98));
  box-shadow: 0 0 26px var(--shadow);
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  line-height: 1.1;
}

.panel h2 {
  font-size: 19px;
}

.panel h3 {
  font-size: 15px;
  color: var(--text);
}

.label {
  display: block;
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.student-layout .comfort-panel {
  grid-column: span 5;
}

.student-layout .question-panel {
  grid-column: span 4;
}

.student-layout .status-panel {
  grid-column: span 3;
}

.student-layout .reaction-panel {
  grid-column: span 4;
}

.student-layout .command-panel,
.student-layout .resources-panel,
.student-layout .identity-panel {
  grid-column: span 4;
}

.student-layout .secondary-details {
  grid-column: span 4;
}

.static-student-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.away-card {
  min-height: 300px;
  display: grid;
  align-content: center;
}

.away-card h2 {
  font-size: clamp(34px, 7vw, 72px);
  line-height: 0.96;
}

.static-note {
  max-width: 760px;
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 800;
  line-height: 1.25;
}

.static-schedule {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.static-links {
  margin-top: 10px;
}

.host-layout .wide {
  grid-column: span 7;
}

.host-layout .side {
  grid-column: span 5;
}

.host-layout .half {
  grid-column: span 4;
}

.host-dense .side {
  max-height: calc(100vh - 118px);
  overflow: auto;
}

.host-page .topbar {
  margin-bottom: 8px;
}

.host-page .panel {
  padding: 10px;
}

.host-page .panel h2,
.host-page .panel h3 {
  margin-bottom: 8px;
}

.host-page .panel h2 {
  font-size: 17px;
}

.host-page .label {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.11em;
}

.host-publish-panel,
.host-resource-panel,
.host-command-panel,
.host-reaction-details {
  align-self: start;
}

.host-queue-panel .list {
  gap: 7px;
}

.admin-layout {
  align-items: start;
}

.admin-ops-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.admin-ops-strip > div,
.security-callout {
  min-width: 0;
  border: 1px solid rgba(0, 217, 255, 0.48);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.82);
  padding: 10px;
}

.admin-ops-strip strong,
.security-callout strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.security-callout span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

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

.tailscale-control-grid .admin-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.tailscale-control-grid .warning-item {
  border-color: rgba(0, 217, 255, 0.9);
  background: rgba(0, 217, 255, 0.1);
}

.admin-layout .admin-status {
  grid-column: span 3;
}

.admin-layout .admin-launch {
  grid-column: span 9;
}

.admin-layout .admin-access {
  grid-column: span 5;
}

.admin-layout .admin-session {
  grid-column: span 7;
}

.admin-layout .admin-activity {
  grid-column: span 5;
}

.admin-layout .admin-timeline {
  grid-column: span 12;
}

.admin-layout .admin-archive {
  grid-column: span 5;
}

.admin-layout .admin-questions {
  grid-column: span 7;
}

.admin-layout .admin-files {
  grid-column: span 7;
}

.admin-layout .admin-shortcuts {
  grid-column: span 12;
}

.slider-wrap {
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-2);
}

.comfort-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
}

.comfort-range {
  width: 100%;
  accent-color: var(--accent);
}

.comfort-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}

.big-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent);
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

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

.action-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  white-space: normal;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.action-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--shadow);
}

.action-button.primary {
  border-color: var(--accent);
  background: var(--panel-3);
}

.ghost-button {
  background: var(--bg-2);
}

.danger-button {
  border-color: var(--accent);
  background: #041225;
}

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

.reaction-button {
  min-height: 96px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 900;
  font-size: 12px;
  box-shadow: inset 0 0 18px rgba(0, 217, 255, 0.08);
}

.reaction-button span {
  line-height: 1.1;
}

.reaction-icon {
  width: 54px;
  height: 54px;
  display: block;
  margin: 0 auto 5px;
  border: 1px solid rgba(0, 217, 255, 0.32);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.18);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 9px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #041225;
  color: var(--text);
  padding: 10px 11px;
  resize: vertical;
}

.file-input {
  min-height: 46px;
}

.file-input::file-selector-button {
  min-height: 38px;
  margin-right: 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-3);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  padding: 7px 10px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row > * {
  min-width: 0;
}

.row > button,
.row > select {
  flex: 1 1 160px;
}

.list {
  display: grid;
  gap: 7px;
}

.list-item {
  border: 1px solid rgba(25, 118, 255, 0.75);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.75);
  padding: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.compact-status .list {
  gap: 6px;
}

.compact-more {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.secondary-details summary {
  display: grid;
  gap: 5px;
  cursor: pointer;
  list-style: none;
}

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

.secondary-details summary span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.secondary-details summary strong {
  font-size: 18px;
}

.secondary-details[open] summary {
  margin-bottom: 10px;
}

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

.question-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.question-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.question-actions .ghost-button {
  min-height: 36px;
  padding: 8px 10px;
}

.score-chip {
  min-width: 64px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(6, 54, 110, 0.92);
  color: var(--text);
  box-shadow: 0 0 18px var(--shadow);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-chip span {
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

.host-question-row {
  border-color: var(--accent);
  background: rgba(6, 54, 110, 0.76);
}

.host-question-row .score-chip {
  min-width: 76px;
  min-height: 50px;
}

.admin-question-row {
  box-shadow: 0 0 0 1px rgba(0, 217, 255, 0.18), 0 0 18px rgba(0, 217, 255, 0.12);
}

.queue-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.queue-heading h3 {
  margin: 0;
}

.queue-count {
  min-width: 36px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #041225;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 0 14px var(--shadow);
}

.question-answered {
  border-style: dashed;
  background: rgba(4, 18, 37, 0.54);
  opacity: 0.56;
  animation: question-ghost 900ms ease-out both;
}

.question-withdrawn {
  border-style: dashed;
  background: rgba(4, 18, 37, 0.66);
  opacity: 0.68;
  animation: question-ghost 900ms ease-out both;
}

.question-answered strong,
.question-withdrawn strong {
  color: var(--muted);
}

.answered-chip,
.edited-chip,
.withdrawn-chip {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 217, 255, 0.55);
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.82);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 7px 10px;
  text-transform: uppercase;
}

.edited-chip {
  border-color: rgba(125, 247, 255, 0.65);
  color: #7df7ff;
}

.withdrawn-chip {
  border-color: rgba(111, 147, 200, 0.75);
  color: var(--muted);
}

@keyframes question-ghost {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0.56;
    transform: translateY(1px);
  }
}

.points-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.spend-tile {
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  overflow: hidden;
}

.spend-tile span {
  position: relative;
  z-index: 1;
}

.spend-tile-preview {
  position: relative;
  width: 68px;
  height: 34px;
  display: block;
  border: 1px solid rgba(0, 217, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 217, 255, 0.18), transparent 1px) 0 0 / 12px 100%,
    rgba(2, 8, 23, 0.86);
  box-shadow: inset 0 0 18px rgba(0, 217, 255, 0.16), 0 0 14px rgba(0, 217, 255, 0.18);
  overflow: hidden;
}

.spend-tile-preview b {
  position: absolute;
  display: block;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.7);
}

.preview-packet-storm b {
  width: 16px;
  height: 3px;
}

.preview-packet-storm b:nth-child(1) { left: 6px; top: 8px; }
.preview-packet-storm b:nth-child(2) { left: 20px; top: 16px; }
.preview-packet-storm b:nth-child(3) { left: 36px; top: 11px; }
.preview-packet-storm b:nth-child(4) { left: 48px; top: 22px; }

.preview-shield-wall b {
  width: 16px;
  height: 22px;
  top: 6px;
  clip-path: polygon(50% 0, 90% 18%, 78% 82%, 50% 100%, 22% 82%, 10% 18%);
}

.preview-shield-wall b:nth-child(1) { left: 8px; }
.preview-shield-wall b:nth-child(2) { left: 26px; }
.preview-shield-wall b:nth-child(3) { left: 44px; }

.preview-electric-laurel b {
  width: 24px;
  height: 24px;
  top: 5px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: transparent;
}

.preview-electric-laurel b:nth-child(1) { left: 12px; border-right-color: transparent; }
.preview-electric-laurel b:nth-child(2) { right: 12px; border-left-color: transparent; }

.preview-brain-melt-ripple b {
  inset: 6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: transparent;
}

.preview-brain-melt-ripple b:nth-child(2) { inset: 11px; }
.preview-brain-melt-ripple b:nth-child(3) { inset: 15px; background: var(--accent); }

.preview-blue-screen-blink b {
  left: 8px;
  right: 8px;
  height: 2px;
}

.preview-blue-screen-blink b:nth-child(1) { top: 11px; }
.preview-blue-screen-blink b:nth-child(2) { top: 21px; opacity: 0.58; }

.preview-phish-alert b,
.preview-visual-effect b {
  width: 38px;
  height: 18px;
  left: 15px;
  top: 8px;
  border: 2px solid var(--accent);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: transparent;
}

.list-item strong {
  display: block;
}

.list-item a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.resource-link {
  display: grid;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
}

.resource-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.embed-frame {
  width: 100%;
  min-height: 220px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.route-row strong {
  grid-column: 1 / -1;
}

.route-row .copy-button {
  min-width: 86px;
}

.route-row.route-compact {
  padding: 7px;
}

.route-row.route-compact strong {
  grid-column: auto;
}

.route-row.route-compact a {
  grid-column: 1 / -1;
  font-size: 12px;
}

.copied-row {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 18px rgba(0, 217, 255, 0.12);
}

.copy-confirm {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.share-kit {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 10px;
  align-items: start;
}

.share-primary,
.share-qr-actions,
.local-links {
  min-width: 0;
  border: 1px solid rgba(25, 118, 255, 0.75);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.75);
  padding: 9px;
}

.share-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  align-self: start;
}

.share-url {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.share-qr-actions {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  align-self: start;
}

.share-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.share-action-grid .ghost-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
}

.local-links {
  grid-column: 1 / -1;
  padding: 8px;
  align-self: start;
}

.compact-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.admin-access-compact {
  display: grid;
  gap: 8px;
}

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

.admin-session-compact {
  display: grid;
  gap: 8px;
}

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

.compact-field {
  gap: 4px;
  margin-bottom: 0;
}

.compact-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-field input,
.compact-field textarea,
.compact-field select {
  min-height: 36px;
  padding: 7px 9px;
}

.compact-field textarea {
  min-height: 38px;
}

.admin-session-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.24fr);
  gap: 8px;
  align-items: end;
}

.admin-session-note-row > button {
  min-height: 38px;
}

.host-status-compact,
.host-resource-compact {
  display: grid;
  gap: 8px;
}

.host-status-grid,
.host-resource-grid,
.host-embed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.host-status-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.24fr);
  gap: 8px;
  align-items: end;
}

.host-status-note-row > button,
.host-resource-grid > button,
.host-embed-grid > button {
  min-height: 38px;
}

.host-embed-details {
  border: 1px solid rgba(25, 118, 255, 0.68);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.76);
  padding: 8px;
}

.host-embed-grid {
  margin-top: 8px;
}

.embed-content-field {
  grid-column: span 2;
}

.command-chip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.command-chip {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid rgba(25, 118, 255, 0.62);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.78);
  padding: 6px 7px;
}

.command-chip strong {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.command-chip b {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.command-chip.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.point-spend-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.point-spend-strip span,
.point-spend-strip.empty {
  border: 1px solid rgba(0, 217, 255, 0.28);
  border-radius: 999px;
  background: rgba(4, 18, 37, 0.64);
  padding: 5px 8px;
}

.point-spend-strip strong {
  margin-right: 6px;
  color: var(--text);
}

.room-switcher {
  border: 1px solid rgba(25, 118, 255, 0.75);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.75);
  padding: 8px;
}

.admin-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.22fr);
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

.admin-room-row > button {
  min-height: 38px;
}

.access-shortcuts {
  border: 1px solid rgba(25, 118, 255, 0.75);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.75);
  padding: 8px;
}

.access-diagnostics {
  border: 1px solid rgba(25, 118, 255, 0.75);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.75);
  padding: 8px;
}

.access-diagnostics .tailscale-control-grid {
  margin-top: 8px;
  gap: 7px;
}

.compact-db {
  font-size: 12px;
  line-height: 1.2;
}

.join-qr-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.join-qr-card img {
  width: 108px;
  max-width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #020817;
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.join-qr-card strong {
  display: block;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}

.join-qr-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.share-qr-card {
  display: block;
  text-align: center;
}

.share-qr-card img {
  width: 96px;
  margin: 0 auto;
}

.share-qr-card span {
  margin-top: 2px;
  overflow-wrap: normal;
  word-break: normal;
}

.meter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.admin-meter-grid {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
}

.meter-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
}

.meter {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  padding: 10px;
}

.meter-grid-compact .meter {
  min-height: 66px;
  padding: 7px;
}

.meter-grid-compact .big-value {
  font-size: 20px;
}

.meter-grid-compact .meter-bar {
  height: 7px;
  margin-top: 5px;
}

.meter-bar {
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: #041225;
  overflow: hidden;
  border: 1px solid rgba(0, 217, 255, 0.35);
}

.feedback-layer,
.rain-field {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.spend-fx-layer {
  position: fixed;
  inset: 0;
  z-index: 54;
  pointer-events: none;
  overflow: hidden;
}

.rain-drop {
  position: fixed;
  top: -44px;
  left: var(--x);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 72px;
  max-width: 176px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(7, 31, 68, 0.9);
  color: var(--text);
  box-shadow: 0 0 24px var(--shadow);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  animation: gentle-rain 3.1s ease-out var(--delay) forwards;
  will-change: transform, opacity;
}

.rain-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.42));
}

.rain-emoji,
.rain-vote,
.rain-question {
  background: rgba(6, 54, 110, 0.94);
  border-color: var(--line-2);
}

.rain-comfort {
  border-color: var(--accent);
}

.spend-fx {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  animation: spend-shell 10s ease-out var(--fx-age, 0s) both;
}

.spend-fx-core {
  position: relative;
  width: min(82vw, 980px);
  height: min(48vh, 470px);
  display: grid;
  place-items: center;
}

.spend-fx-core strong {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  border: 1px solid rgba(0, 217, 255, 0.6);
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.9);
  color: var(--accent);
  box-shadow: 0 0 34px rgba(0, 217, 255, 0.34), inset 0 0 18px rgba(0, 217, 255, 0.12);
  font-size: clamp(14px, 2.2vw, 27px);
  font-weight: 900;
  line-height: 1;
  padding: 12px 16px;
  text-shadow: 0 0 16px rgba(0, 217, 255, 0.68);
  text-transform: uppercase;
}

.packet-field,
.phish-field,
.blink-field,
.laurel-field,
.ripple-field,
.shield-field {
  position: absolute;
  inset: 0;
}

.packet-field i {
  position: absolute;
  left: -12vw;
  top: var(--y);
  width: var(--w);
  height: 7px;
  border: 1px solid rgba(125, 247, 255, 0.78);
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), #7df7ff);
  box-shadow: 0 0 24px rgba(0, 217, 255, 0.82);
  animation: packet-flight 1.8s linear calc(var(--d, 0ms) + var(--fx-age, 0s)) both;
}

.phish-field {
  display: grid;
  place-items: center;
}

.phish-field i {
  width: min(42vw, 380px);
  aspect-ratio: 1;
  border: 5px solid var(--accent);
  border-top: 0;
  border-radius: 0 0 50% 50%;
  transform: rotate(-18deg);
  box-shadow: 0 0 48px rgba(0, 217, 255, 0.52);
}

.phish-field b {
  position: absolute;
  width: 22vw;
  max-width: 260px;
  height: 3px;
  background: rgba(125, 247, 255, 0.84);
  box-shadow: 0 0 18px rgba(0, 217, 255, 0.54);
}

.phish-field b:nth-child(2) { transform: translate(-36%, -90px) rotate(14deg); }
.phish-field b:nth-child(3) { transform: translate(32%, -10px) rotate(-10deg); }
.phish-field b:nth-child(4) { transform: translate(-5%, 82px) rotate(5deg); }

.blink-field {
  background:
    linear-gradient(rgba(0, 217, 255, 0.13) 1px, transparent 1px) 0 0 / 100% 18px,
    radial-gradient(circle at 50% 50%, rgba(0, 217, 255, 0.34), transparent 34%);
  border: 1px solid rgba(0, 217, 255, 0.48);
  box-shadow: inset 0 0 70px rgba(0, 217, 255, 0.2), 0 0 38px rgba(0, 217, 255, 0.2);
  animation: blink-flash 620ms steps(2, end) var(--fx-age, 0s) 7 both;
}

.blink-field i {
  position: absolute;
  left: 8%;
  width: 84%;
  height: 2px;
  top: var(--y);
  background: rgba(125, 247, 255, 0.68);
  box-shadow: 0 0 13px rgba(0, 217, 255, 0.62);
}

.laurel-field i {
  position: absolute;
  top: 8%;
  bottom: 8%;
  width: 34%;
  border: 4px solid var(--accent);
  filter: drop-shadow(0 0 26px rgba(0, 217, 255, 0.78));
}

.laurel-field i:nth-child(1) {
  left: 18%;
  border-right: 0;
  border-radius: 100% 0 0 100%;
}

.laurel-field i:nth-child(2) {
  right: 18%;
  border-left: 0;
  border-radius: 0 100% 100% 0;
}

.laurel-field b {
  position: absolute;
  left: var(--leaf-left);
  top: var(--leaf-top);
  width: 34px;
  height: 14px;
  border-radius: 100% 0 100% 0;
  background: #7df7ff;
  box-shadow: 0 0 18px rgba(0, 217, 255, 0.54);
  transform: rotate(var(--leaf-rotate));
}

.ripple-field {
  display: grid;
  place-items: center;
}

.spend-reaction-icon {
  width: min(28vw, 220px);
  aspect-ratio: 1;
  border: 2px solid rgba(0, 217, 255, 0.45);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 42px rgba(0, 217, 255, 0.36);
  z-index: 2;
}

.ripple-field i {
  position: absolute;
  width: min(22vw, 220px);
  aspect-ratio: 1;
  border: 2px solid rgba(125, 247, 255, 0.78);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(0, 217, 255, 0.38);
  animation: ripple-ring 1.8s ease-out var(--fx-age, 0s) 4 both;
}

.ripple-field i:nth-of-type(2) { animation-delay: calc(var(--fx-age, 0s) + 280ms); }
.ripple-field i:nth-of-type(3) { animation-delay: calc(var(--fx-age, 0s) + 560ms); }

.shield-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: min(2vw, 20px);
}

.shield-field i {
  width: min(11vw, 110px);
  height: min(23vh, 220px);
  clip-path: polygon(50% 0, 90% 18%, 78% 82%, 50% 100%, 22% 82%, 10% 18%);
  background: linear-gradient(180deg, rgba(125, 247, 255, 0.98), rgba(0, 217, 255, 0.76), rgba(15, 82, 217, 0.76));
  border: 1px solid rgba(125, 247, 255, 0.8);
  box-shadow: 0 0 38px rgba(0, 217, 255, 0.62), inset 0 0 22px rgba(238, 248, 255, 0.18);
  animation: shield-rise 1.2s ease-out calc(var(--d, 0ms) + var(--fx-age, 0s)) both;
}

@keyframes spend-shell {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  7%,
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

@keyframes packet-flight {
  from {
    transform: translateX(0) skewX(-18deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  to {
    transform: translateX(120vw) skewX(-18deg);
    opacity: 0;
  }
}

@keyframes blink-flash {
  0%,
  100% {
    opacity: 0.18;
  }
  50% {
    opacity: 0.78;
  }
}

@keyframes ripple-ring {
  from {
    transform: scale(0.78);
    opacity: 0.86;
  }
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

@keyframes shield-rise {
  from {
    transform: translateY(26vh) scaleY(0.72);
    opacity: 0;
  }
  to {
    transform: translateY(0) scaleY(1);
    opacity: 1;
  }
}

@keyframes gentle-rain {
  0% {
    transform: translate(-50%, -24px) scale(0.96);
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  74% {
    opacity: 0.92;
  }
  100% {
    transform: translate(calc(-50% + 16px), 34vh) scale(1);
    opacity: 0;
  }
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--line), var(--accent));
}

.signal-timeline {
  display: grid;
  gap: 8px;
}

.signal-timeline-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.signal-panel {
  margin-bottom: 10px;
}

.signal-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(260px, 1.35fr);
  gap: 7px 12px;
  align-items: center;
  border: 1px solid rgba(25, 118, 255, 0.58);
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.68);
  padding: 8px;
}

.signal-timeline-compact .signal-row {
  grid-template-columns: minmax(96px, 0.62fr) minmax(0, 1.38fr);
  gap: 4px 8px;
  padding: 6px;
}

.signal-hot {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 18px rgba(0, 217, 255, 0.12);
}

.signal-head {
  min-width: 0;
}

.signal-head strong {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}

.signal-timeline-compact .signal-head strong {
  font-size: 12px;
}

.signal-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-timeline-compact .signal-head span {
  margin-top: 1px;
  font-size: 9px;
}

.signal-statline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.signal-timeline-compact .signal-statline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.signal-statline span {
  min-height: 34px;
  display: grid;
  align-content: center;
  border: 1px solid rgba(15, 82, 217, 0.72);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.84);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.08;
  padding: 4px 6px;
  text-transform: uppercase;
}

.signal-timeline-compact .signal-statline span {
  min-height: 24px;
  padding: 3px 4px;
  font-size: 9px;
}

.signal-statline b {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.signal-timeline-compact .signal-statline b {
  font-size: 14px;
}

.signal-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
}

.signal-timeline-compact .signal-gauges {
  display: none;
}

.signal-gauge {
  height: 8px;
  border: 1px solid rgba(0, 217, 255, 0.32);
  border-radius: 999px;
  background: #041225;
  overflow: hidden;
}

.signal-gauge i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--line), var(--accent));
}

.signal-gauge.diversity i {
  background: linear-gradient(90deg, #0f52d9, #7df7ff);
}

.signal-gauge.repeats i {
  background: linear-gradient(90deg, #375985, #b8d7ff);
}

.signal-strip {
  position: relative;
  height: 22px;
  border: 1px solid rgba(0, 217, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(25, 118, 255, 0.18), transparent 1px) 0 0 / 25% 100%,
    rgba(4, 18, 37, 0.64);
}

.signal-timeline-compact .signal-strip {
  grid-column: 1 / -1;
  height: 14px;
}

.signal-dot {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 1px solid var(--text);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--shadow);
  transform: translate(-50%, -50%);
}

.signal-timeline-compact .signal-dot {
  width: 8px;
  height: 8px;
}

.signal-dot.repeat {
  width: 9px;
  height: 9px;
  border-color: var(--muted);
  background: var(--line-2);
  opacity: 0.72;
}

.archive-log {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}

.archive-log.empty {
  max-height: none;
}

.archive-empty,
.archive-row {
  border: 1px solid rgba(25, 118, 255, 0.62);
  border-radius: 8px;
  background: rgba(4, 18, 37, 0.76);
  padding: 8px;
}

.archive-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

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

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

.archive-row strong {
  font-size: 13px;
  line-height: 1.16;
}

.archive-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.archive-row b {
  min-width: 70px;
  border: 1px solid rgba(0, 217, 255, 0.42);
  border-radius: 999px;
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
  padding: 6px 8px;
  text-align: center;
  text-transform: uppercase;
}

.archive-superseded {
  border-color: rgba(125, 247, 255, 0.66);
  box-shadow: inset 3px 0 0 rgba(125, 247, 255, 0.76);
}

.archive-expired {
  opacity: 0.82;
}

.overlay-body {
  background: transparent;
  overflow: hidden;
}

.overlay-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: transparent;
}

.overlay-frame {
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(0, 217, 255, 0.36);
  box-shadow: inset 0 0 52px rgba(0, 217, 255, 0.14);
  pointer-events: none;
}

.overlay-widget {
  position: absolute;
  min-width: 80px;
  min-height: 42px;
}

.overlay-widget .overlay-orb,
.overlay-widget .overlay-badges,
.overlay-widget .overlay-pulse {
  position: static;
}

.overlay-widget .overlay-badges {
  display: flex;
  flex-wrap: wrap;
}

.overlay-widget .overlay-pulse {
  width: 100%;
}

.overlay-orb {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: rgba(3, 17, 38, 0.74);
  color: var(--accent);
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 0 34px var(--shadow);
}

.overlay-badges {
  position: absolute;
  left: 32px;
  top: 28px;
  display: flex;
  gap: 10px;
}

.overlay-badge {
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(6, 54, 110, 0.82);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.point-spend-widget {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.overlay-pulse {
  position: absolute;
  left: 10vw;
  right: 10vw;
  bottom: 34px;
  height: 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(4, 18, 37, 0.82);
  overflow: hidden;
}

.overlay-pulse div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--line), var(--accent));
}

.overlay-join-qr {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 320px);
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.86);
  box-shadow: 0 0 34px rgba(0, 217, 255, 0.2);
  padding: 12px;
}

.overlay-join-qr img {
  width: min(100%, 230px);
  aspect-ratio: 1;
  border-radius: 8px;
  background: #020817;
}

.overlay-join-qr strong {
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.burst-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.burst {
  position: absolute;
  left: var(--x);
  bottom: 16vh;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: rgba(7, 31, 68, 0.88);
  color: var(--accent);
  font-weight: 900;
  animation: rise 2.4s ease-out var(--burst-age, 0s) forwards;
}

.burst-icon {
  width: 42px;
  height: 42px;
  display: block;
  margin: 0 auto 5px;
  border-radius: 8px;
  object-fit: cover;
}

@keyframes rise {
  from {
    transform: translateY(0) scale(0.94);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  to {
    transform: translateY(-36vh) scale(1.06);
    opacity: 0;
  }
}

.editor-shell {
  display: grid;
  grid-template-columns: 230px 1fr 240px;
  gap: 14px;
}

.palette,
.inspector {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.palette-item {
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #041225;
  color: var(--text);
  text-align: left;
  padding: 9px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.palette-item:active,
.layout-widget:active {
  cursor: grabbing;
}

.drag-handle {
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  font-weight: 900;
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 54px;
  gap: 8px;
  min-height: 560px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background-image:
    linear-gradient(rgba(0, 217, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 217, 255, 0.11) 1px, transparent 1px);
  background-size: calc(100% / 12) 62px;
  padding: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.layout-grid.drag-over {
  border-color: var(--accent);
  box-shadow: inset 0 0 28px rgba(0, 217, 255, 0.18), 0 0 24px var(--shadow);
}

.layout-widget {
  position: relative;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(6, 54, 110, 0.92);
  padding: 10px 10px 44px;
  font-weight: 800;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.layout-widget.is-moving {
  opacity: 0.42;
  outline: 2px solid var(--accent);
}

.layout-drag-preview {
  border: 2px dashed var(--accent);
  border-radius: 8px;
  background: rgba(0, 217, 255, 0.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  z-index: 3;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.widget-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-tools {
  position: absolute;
  right: 30px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  max-width: calc(100% - 38px);
}

.widget-tool {
  min-height: 28px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #041225;
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  padding: 4px 7px;
}

.danger-tool {
  border-color: var(--accent);
}

.widget-resize-handle {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(0, 217, 255, 0.72) 39% 47%, transparent 48% 61%, rgba(0, 217, 255, 0.72) 62% 70%, transparent 71%),
    #041225;
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.22);
  cursor: nwse-resize;
  touch-action: none;
}

.widget-resize-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reaction-pack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.reaction-card {
  min-height: 118px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #041225;
  padding: 8px;
  text-align: center;
}

.reaction-card-icon {
  width: 70px;
  height: 70px;
  border: 1px solid rgba(0, 217, 255, 0.38);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 16px rgba(0, 217, 255, 0.2);
}

.reaction-card strong {
  font-size: 11px;
  line-height: 1.2;
}

.host-reaction-details .reaction-pack {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.host-reaction-details .reaction-card {
  min-height: 74px;
  gap: 4px;
  padding: 5px;
}

.host-reaction-details .reaction-card-icon {
  width: 42px;
  height: 42px;
}

.host-reaction-details .reaction-card strong {
  font-size: 9px;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
  }

  .status-chip {
    max-width: 100%;
    white-space: normal;
  }

  .grid,
  .editor-shell {
    display: block;
  }

  .admin-ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel,
  .palette,
  .inspector {
    margin-bottom: 12px;
  }

  .student-layout .comfort-panel,
  .student-layout .question-panel,
  .student-layout .status-panel,
  .student-layout .reaction-panel,
  .student-layout .command-panel,
  .student-layout .resources-panel,
  .student-layout .identity-panel,
  .student-layout .secondary-details,
  .host-layout .wide,
  .host-layout .side,
  .host-layout .half,
  .admin-layout .admin-status,
  .admin-layout .admin-launch,
  .admin-layout .admin-access,
  .admin-layout .admin-session,
  .admin-layout .admin-activity,
  .admin-layout .admin-timeline,
  .admin-layout .admin-archive,
  .admin-layout .admin-questions,
  .admin-layout .admin-files,
  .admin-layout .admin-shortcuts {
    grid-column: auto;
  }

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

  .host-layout .half {
    margin-bottom: 12px;
  }

  .share-kit,
  .share-qr-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .compact-route-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 12px, 1480px);
    padding-top: 8px;
  }

  .panel {
    padding: 12px;
  }

  .brand {
    width: 100%;
  }

  .student-page {
    width: min(100% - 8px, 720px);
    padding-top: 4px;
  }

  .student-page .topbar {
    gap: 6px;
    margin-bottom: 6px;
    padding: 2px 0;
  }

  .student-page .brand {
    gap: 8px;
  }

  .student-page .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .student-page .brand h1 {
    font-size: 19px;
  }

  .student-page .brand p {
    margin-top: 1px;
    font-size: 11px;
  }

  .student-page .status-chip {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 10px;
  }

  .student-page .panel {
    padding: 9px;
    margin-bottom: 0;
  }

  .student-page .panel h2,
  .student-page .panel h3 {
    margin-bottom: 8px;
    font-size: 15px;
  }

  .student-page .label {
    margin-bottom: 5px;
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .student-page .subtle {
    font-size: 11px;
    line-height: 1.25;
  }

  .student-page .slider-wrap {
    padding: 8px;
  }

  .student-page .comfort-labels {
    gap: 3px;
    font-size: 8px;
  }

  .student-page .comfort-readout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    margin-top: 5px;
  }

  .student-page .big-value {
    font-size: 20px;
  }

  .student-page .button-grid,
  .student-page .compact-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .student-page .action-button,
  .student-page .ghost-button,
  .student-page .danger-button {
    min-height: 48px;
    padding: 6px 5px;
    font-size: 12px;
    line-height: 1.08;
  }

  .student-page .reaction-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .student-page .reaction-button {
    min-height: 64px;
    padding: 4px;
    font-size: 0;
  }

  .student-page .reaction-icon {
    width: 42px;
    height: 42px;
    margin: 0;
  }

  .student-page .command-panel .list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-page .field {
    gap: 5px;
    margin-bottom: 7px;
  }

  .student-page .field input,
  .student-page .field textarea,
  .student-page .field select {
    min-height: 46px;
    padding: 9px;
    font-size: 14px;
  }

  .student-page #questionText {
    min-height: 54px;
  }

  .student-page .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .student-page .row > button,
  .student-page .row > select {
    width: 100%;
  }

  .student-page .question-list {
    max-height: 146px;
    overflow: auto;
  }

  .student-page .points-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-page .spend-tile {
    min-height: 74px;
    gap: 5px;
  }

  .student-page .spend-tile-preview {
    width: 58px;
    height: 28px;
  }

  .comfort-readout {
    display: grid;
    justify-items: start;
  }

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

  .share-primary {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-session-grid,
  .admin-session-note-row,
  .admin-room-row,
  .host-status-grid,
  .host-resource-grid,
  .host-embed-grid,
  .host-status-note-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .embed-content-field {
    grid-column: auto;
  }

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

  .share-action-grid,
  .admin-generate-actions {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .question-meta {
    justify-content: flex-start;
  }

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

  .signal-timeline-compact {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .join-qr-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-row .copy-button,
  .admin-actions > button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .button-grid {
    grid-template-columns: 1fr;
  }

  .student-page .button-grid,
  .student-page .compact-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .student-page .reaction-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .student-page .command-panel .list,
  .student-page .points-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reaction-grid,
  .meter-grid {
    grid-template-columns: 1fr;
  }

  .signal-statline,
  .signal-gauges {
    grid-template-columns: 1fr;
  }

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

  .comfort-labels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    text-align: left;
  }

  .action-button,
  .ghost-button,
  .danger-button {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
