:root {
  --brand: #222942;
  --brand-dark: #141a2e;
  --brand-mid: #2f3a5f;
  --gold: #d6b46a;
  --ink: #182033;
  --muted: #667087;
  --line: #dfe5ef;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --green: #168a55;
  --blue: #2468d8;
  --yellow: #a66b00;
  --red: #b42318;
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(34, 41, 66, 0.08), rgba(255, 255, 255, 0) 340px),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  min-height: 96px;
  padding: 12px 40px 0;
  background: #222942;
  border-bottom: 1px solid #3E4A74;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  color: white;
}

.brand img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

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

.brand strong {
  font-size: 17px;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  margin-top: 2px;
}

.role-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 48px;
  flex-wrap: wrap;
}

.role-nav a,
.role-booth-menu > summary {
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 20px;
  border: 0;
  border-bottom: 4px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #94A3B8;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
}

.role-nav a:hover,
.role-booth-menu > summary:hover {
  color: white;
  background: transparent;
  border-bottom-color: transparent;
}

.role-booth-menu {
  position: relative;
}

.role-booth-menu > summary {
  cursor: pointer;
  list-style: none;
}

.role-booth-menu > summary::-webkit-details-marker {
  display: none;
}

.role-booth-list {
  position: absolute;
  top: calc(100% - 10px);
  left: 50%;
  z-index: 80;
  display: none;
  min-width: 150px;
  padding: 8px;
  transform: translateX(-50%);
  border: 1px solid #3E4A74;
  border-radius: 12px;
  background: #222942;
  box-shadow: var(--shadow);
}

.role-booth-menu[open] .role-booth-list {
  display: grid;
  gap: 4px;
}

.role-booth-list a {
  display: block;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94A3B8;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.role-booth-list a:hover,
.role-booth-list a.is-active {
  background: #3E4A74;
  color: white;
}

.role-booth-icon {
  margin-left: 8px;
  font-size: 20px;
  line-height: 1;
}

.booth-switcher a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 700;
}

.booth-switcher a.active {
  color: var(--brand);
  background: white;
  border-color: white;
}

.app-shell {
  width: min(1540px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero-panel,
.screen-heading,
.bigscreen-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 24px;
}

.hero-panel {
  min-height: 270px;
  padding: clamp(26px, 5vw, 58px);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(20, 26, 46, 0.94), rgba(34, 41, 66, 0.86)),
    url("/img/logo.svg") right 42px center / 320px auto no-repeat;
  color: white;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  max-width: 860px;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
}

.screen-heading h1,
.bigscreen-hero h1 {
  font-size: clamp(32px, 4vw, 56px);
}

.hero-text,
.screen-heading p {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(33, 24, 22, 0.66);
  font-size: 17px;
  line-height: 1.55;
}

.hero-panel .hero-text {
  color: rgba(255, 255, 255, 0.82);
}

.launcher-grid,
.booth-grid,
.bigscreen-booths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.launch-card,
.panel,
.booth-card,
.service-row,
.big-booth {
  border: 1px solid rgba(34, 41, 66, 0.12);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.launch-card {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.launch-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.launch-card span {
  color: var(--brand);
  font-weight: 900;
}

.launch-card strong {
  display: block;
  margin-top: 18px;
  font-size: 24px;
}

.launch-card small,
.muted,
.tester-block small,
.set-item small {
  color: var(--muted);
}

.launch-card.dark {
  color: white;
  background: linear-gradient(140deg, var(--brand-dark), var(--brand-mid));
}

.launch-card.dark span,
.launch-card.dark small {
  color: var(--gold);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.section-grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.62fr);
}

.section-grid.wide-left {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.55fr);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-title,
.booth-head,
.booth-focus-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-title small,
.current-set small {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-title strong {
  font-size: 22px;
}

.metrics-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.metric {
  min-width: 118px;
  padding: 14px 16px;
  border: 1px solid rgba(34, 41, 66, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.hero-panel .metric,
.metrics-row.bright .metric {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-panel .metric small,
.metrics-row.bright .metric small {
  color: rgba(255, 255, 255, 0.72);
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 32px;
}

.code-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.code-form label,
.survey-card label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.code-form input,
.survey-card textarea {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 18px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  outline: none;
}

.survey-card textarea {
  min-height: 100px;
  padding: 14px;
  resize: vertical;
  font-size: 16px;
  font-weight: 500;
}

.code-form input:focus,
.survey-card textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(34, 41, 66, 0.14);
}

.code-form.stacked {
  display: grid;
  grid-template-columns: 1fr;
}

.primary-btn,
.ghost-btn {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-btn {
  color: white;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(34, 41, 66, 0.22);
}

.ghost-btn {
  color: var(--brand);
  background: #eef2f8;
  border: 1px solid rgba(34, 41, 66, 0.2);
}

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

.notice {
  min-height: 42px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}

.notice.success {
  color: var(--green);
}

.notice.error {
  color: var(--red);
}

.tester-table,
.queue-list,
.server-list,
.set-list,
.completed-list {
  display: grid;
  gap: 10px;
}

.tester-table.compact {
  gap: 8px;
}

.table-row,
.queue-item,
.set-item,
.completed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.table-row span:first-child,
.queue-item span,
.set-item span {
  min-width: 0;
}

.table-row strong,
.table-row small,
.queue-item strong,
.queue-item small,
.set-item strong,
.set-item small,
.tester-block strong,
.tester-block small {
  display: block;
}

.queue-item b,
.set-item b,
.completed-item b {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: white;
  background: var(--brand);
}

.queue-list.large .queue-item {
  min-height: 74px;
}

.completed-item em {
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #65534d;
  background: #f3ece9;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status.waiting,
.status.ready,
.ready {
  color: var(--yellow);
  background: #fff3d7;
}

.status.assigned,
.status.waitingtester,
.waitingtester {
  color: var(--blue);
  background: #eaf1ff;
}

.status.waitingserver,
.waitingserver {
  color: var(--brand);
  background: #eef2f8;
}

.status.testing,
.testing {
  color: var(--green);
  background: #e9f8f0;
}

.status.completed,
.completed {
  color: #6f3fb3;
  background: #f2ecff;
}

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

.booth-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-top: 5px solid #cdd5e3;
}

.booth-card.waitingserver,
.service-row.waitingserver,
.big-booth.waitingserver {
  border-top-color: var(--brand);
}

.booth-card.testing,
.service-row.testing,
.big-booth.testing {
  border-top-color: var(--green);
}

.booth-card.waitingtester,
.service-row.waitingtester,
.big-booth.waitingtester {
  border-top-color: var(--blue);
}

.booth-card.completed,
.service-row.completed,
.big-booth.completed {
  border-top-color: #6f3fb3;
}

.booth-head {
  margin-bottom: 0;
}

.booth-head span {
  font-weight: 900;
}

.set-chip,
.waiting-banner,
.current-set {
  border-radius: 8px;
  background: #f0f4fa;
  padding: 12px 14px;
  color: var(--brand);
  font-weight: 800;
}

.tester-block {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7f9fc;
}

.tester-block span {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-top: 5px solid #cdd5e3;
}

.service-row h3 {
  margin: 10px 0;
  font-size: 28px;
}

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

.mini-booth {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  text-align: center;
}

.mini-booth b {
  font-size: 24px;
}

.mini-booth span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.booth-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 520px;
}

.booth-focus {
  min-height: 560px;
}

.booth-focus h2 {
  margin-bottom: 0;
  font-size: clamp(36px, 5vw, 64px);
}

.current-set {
  display: grid;
  gap: 6px;
  margin: 18px 0;
}

.current-set strong {
  font-size: 26px;
}

.survey-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

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

.sample-strip span {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f0f4fa;
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
}

.question-card {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.question-card legend {
  padding: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

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

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

.option-grid.count-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.option-tile {
  min-height: 58px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.option-tile input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.option-tile:has(input:checked) {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(34, 41, 66, 0.22);
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.rating-row button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 900;
}

.thank-you {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  border-radius: 8px;
  background: #f2ecff;
  padding: 22px;
}

.thank-you strong {
  color: #6f3fb3;
  font-size: 36px;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.connection-pill {
  min-width: 112px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff3d7;
  color: var(--yellow);
  font-weight: 900;
}

.connection-pill.live {
  background: #e9f8f0;
  color: var(--green);
}

.bigscreen-mode {
  background:
    radial-gradient(circle at top left, rgba(214, 180, 106, 0.18), transparent 360px),
    radial-gradient(circle at bottom right, rgba(47, 58, 95, 0.36), transparent 420px),
    #101626;
  color: white;
}

.bigscreen-mode .topbar {
  background: rgba(16, 22, 38, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.bigscreen-mode .brand small,
.bigscreen-mode .screen-heading p {
  color: rgba(255, 255, 255, 0.62);
}

.bigscreen-mode .role-nav a {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.bigscreen-hero {
  padding: 8px 0 10px;
}

.bigscreen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
}

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

.big-booth {
  min-height: 170px;
  padding: 22px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  border-top: 7px solid rgba(255, 255, 255, 0.24);
}

.big-booth div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.big-booth strong {
  font-size: 30px;
}

.big-booth span {
  color: var(--gold);
  font-weight: 900;
}

.big-booth p {
  margin: 28px 0 6px;
  font-size: 24px;
  font-weight: 900;
}

.big-booth small {
  color: rgba(255, 255, 255, 0.68);
}

.bigscreen-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.dark-panel {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.dark-panel .panel-title small,
.dark-panel .queue-item small,
.dark-panel .set-item small {
  color: rgba(255, 255, 255, 0.6);
}

.dark-panel .queue-item,
.dark-panel .set-item,
.dark-panel .completed-item {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.dark-panel .completed-item small {
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1120px) {
  .topbar,
  .hero-panel,
  .screen-heading,
  .bigscreen-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-grid.two,
  .section-grid.wide-left,
  .bigscreen-layout {
    grid-template-columns: 1fr;
  }

  .launcher-grid,
  .booth-grid,
  .bigscreen-booths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1540px);
    padding-top: 18px;
  }

  .topbar {
    position: static;
    padding: 14px 12px;
  }

  .brand {
    min-width: 0;
    gap: 12px;
  }

  .brand img {
    width: auto;
    height: 56px;
    max-width: 48vw;
  }

  .brand strong {
    font-size: 16px;
  }

  .role-nav {
    justify-content: flex-start;
  }

  h1,
  .screen-heading h1,
  .bigscreen-hero h1 {
    font-size: 34px;
    line-height: 1.06;
  }

  .launcher-grid,
  .booth-grid,
  .bigscreen-booths {
    grid-template-columns: 1fr;
  }

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

  .sample-strip,
  .option-grid,
  .option-grid.count-2,
  .option-grid.count-4 {
    grid-template-columns: 1fr;
  }

  .code-form,
  .service-row {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
    overflow: hidden;
    background:
      linear-gradient(110deg, rgba(20, 26, 46, 0.94), rgba(34, 41, 66, 0.86)),
      url("/img/logo.png") right 20px bottom 20px / 220px auto no-repeat;
  }

  .hero-panel h1 {
    max-width: 320px;
  }
}
