:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f7f7;
  --text: #181818;
  --muted: #6f6f6f;
  --line: #e8e8e8;
  --accent: #1f6feb;
  --accent-dark: #1557b0;
  --success-bg: #ecf8f0;
  --success-text: #21653f;
  --error-bg: #fff1f1;
  --error-text: #9a2f2f;
  --shadow: 0 12px 28px rgba(12, 16, 24, 0.05);
}

html,
body {
  background: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: #ffffff;
}

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

button,
input,
select {
  font: inherit;
}

.app-shell,
.admin-shell {
  width: min(1280px, calc(100vw - 160px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar,
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.topbar-card {
  padding: 0;
  border-bottom: 0;
}

.admin-topbar-card {
  padding: 0;
  border-bottom: 0;
}

.topbar-title h1,
.admin-topbar h1,
.public-card h2,
.admin-card h2,
.survey-admin-item h3,
.section-head h3 {
  margin: 0;
}

.topbar-title h1,
.admin-topbar h1 {
  margin-top: 4px;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 600;
}

.admin-topbar h1 {
  margin-top: 0;
  font-size: clamp(1rem, 1.65vw, 1.25rem);
  line-height: 1.2;
}

.topbar-subtitle,
.panel-copy,
.status {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.event-brand-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 132px;
  height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
}

.event-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.topbar-actions,
.admin-nav,
.inline-actions,
.actions,
.split-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.ghost-button,
.primary-button {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ghost-button-compact,
.primary-button-compact {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

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

.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.flash {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.flash.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

.public-stage {
  padding: 0;
}

.public-flash {
  margin-top: 0;
  margin-bottom: 14px;
}

.admin-header-card {
  margin-top: 0;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.admin-nav-box {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.room-switcher {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.room-switcher .ghost-button,
.room-switcher .primary-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.public-card,
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: none;
}

.public-header-shell {
  margin-bottom: 14px;
}

.public-stage-shell {
  width: 100%;
  margin: 0;
}

.public-waiting-card {
  background: #fff;
}

.public-waiting-layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
}

.public-waiting-copy {
  min-width: 0;
}

.public-waiting-lead {
  margin: 0;
  color: #475467;
  font-size: 0.92rem;
  line-height: 1.5;
}

.public-waiting-tips {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #667085;
  font-size: 0.86rem;
  line-height: 1.5;
}

.public-waiting-tips li + li {
  margin-top: 6px;
}

.public-waiting-media {
  display: flex;
  justify-content: flex-start;
}

.public-waiting-image {
  display: block;
  width: min(100%, 148px);
  height: auto;
}

.survey-stage-card {
  --public-card-border: #dbe3ef;
  --public-card-bg:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  --public-track-bg: #eef2f7;
  --public-fill-start: #4da3ff;
  --public-fill-end: #2f6fed;
  --public-badge-border: #cfe0ff;
  --public-badge-text: #2f6fed;
}

.survey-stage-card-live {
  --public-card-border: #cfe0ff;
  --public-card-bg:
    radial-gradient(circle at top right, rgba(47, 111, 237, 0.08), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  --public-track-bg: #e8f0fc;
  --public-fill-start: #5aa9ff;
  --public-fill-end: #2f6fed;
  --public-badge-border: #cfe0ff;
  --public-badge-text: #2f6fed;
}

.survey-stage-card-results {
  --public-card-border: #bfe5d0;
  --public-card-bg:
    radial-gradient(circle at top right, rgba(24, 144, 98, 0.09), transparent 42%),
    linear-gradient(180deg, #fcfffd 0%, #f4fbf7 100%);
  --public-track-bg: #e2efe8;
  --public-fill-start: #4dc58b;
  --public-fill-end: #189062;
  --public-badge-border: #bfe5d0;
  --public-badge-text: #147a53;
  border-color: var(--public-card-border);
  background: var(--public-card-bg);
}

.survey-stage-card-live,
.survey-stage-card-results {
  border-color: var(--public-card-border);
  background: var(--public-card-bg);
}

.survey-stage-card-results .eyebrow {
  color: #189062;
}

.survey-stage-card-results .results-section {
  border-top-color: #d7eadf;
}

.survey-stage-card h2 {
  margin-top: 6px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.public-survey-timer {
  width: min(100%, 360px);
  margin: 0 0 18px;
  padding: 12px 14px 14px;
  border-radius: 18px;
  border: 1px solid #d7e6ff;
  background:
    radial-gradient(circle at top right, rgba(47, 111, 237, 0.1), transparent 42%),
    linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
  box-shadow: 0 12px 28px rgba(47, 111, 237, 0.08);
  color: var(--accent-dark);
}

.public-survey-timer-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.public-survey-timer-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a7299;
}

.public-survey-timer-value {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #2f6fed;
}

.public-survey-timer-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(47, 111, 237, 0.12);
}

.public-survey-timer-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6fed 0%, #5ba3ff 100%);
  transition: width 0.9s linear, background 0.2s ease;
}

.public-survey-timer.is-warning .public-survey-timer-value {
  color: #c97700;
}

.public-survey-timer.is-warning .public-survey-timer-fill {
  background: linear-gradient(90deg, #ffb020 0%, #ffd166 100%);
}

.public-survey-timer.is-danger {
  border-color: #ffd5d2;
  background:
    radial-gradient(circle at top right, rgba(229, 72, 77, 0.12), transparent 42%),
    linear-gradient(180deg, #fffafa 0%, #fff4f4 100%);
  box-shadow: 0 18px 40px rgba(229, 72, 77, 0.1);
}

.public-survey-timer.is-danger .public-survey-timer-value {
  color: #d92d20;
}

.public-survey-timer.is-danger .public-survey-timer-fill {
  background: linear-gradient(90deg, #d92d20 0%, #ff8a80 100%);
}

.answer-list {
  display: grid;
  gap: 10px;
}

.vote-status-card {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #d7e6ff;
  border-radius: 16px;
  background: #f6faff;
}

.vote-status-card strong {
  display: block;
  margin-bottom: 4px;
  color: #1849a9;
  font-size: 0.95rem;
}

.vote-status-card p {
  margin: 0;
  color: #486284;
  font-size: 0.9rem;
  line-height: 1.35;
}

.vote-form-fields {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.vote-form-locked .answer-list {
  opacity: 0.82;
}

.vote-form-locked .answer-option.selected {
  border-color: #8fb7ff;
  background: #eef5ff;
}

.vote-submit-hidden {
  display: none;
}

.answer-option {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 0.98rem;
}

.answer-option input {
  margin-top: 0;
}

.answer-option-label {
  flex: 1 1 auto;
  min-width: 0;
}

.answer-option.selected {
  border-color: var(--accent);
  background: #f2f7ff;
}

.answer-option-result {
  display: none;
  width: 100%;
}

.answer-option-result-track {
  display: block;
  position: relative;
  width: 100%;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(47, 111, 237, 0.12);
  overflow: hidden;
}

.answer-option-result-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6fed 0%, #5ba3ff 100%);
}

.answer-option-result-value {
  display: block;
  margin-top: 6px;
  color: #2f6fed;
  font-size: 0.86rem;
  font-weight: 700;
}

.results-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.results-bars {
  display: grid;
  gap: 14px;
}

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

.results-bars-one-by-one .bar-row {
  opacity: 0;
  transform: translateY(8px);
  animation: results-row-reveal 0.35s ease forwards;
  animation-delay: var(--result-delay, 0ms);
}

.bar-meta {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  font-size: 0.9rem;
}

.bar-track {
  position: relative;
  overflow: visible;
  height: 10px;
  margin-right: 120px;
  border-radius: 999px;
  background: var(--public-track-bg);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--public-fill-start) 0%, var(--public-fill-end) 100%);
  transition: width 0.45s ease;
}

.bar-percent-badge {
  position: absolute;
  top: 50%;
  left: clamp(34px, var(--public-option-percent), calc(100% - 34px));
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--public-badge-border);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  color: var(--public-badge-text);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bar-votes-badge {
  position: absolute;
  top: 50%;
  left: calc(100% + 18px);
  transform: translateY(-50%);
  min-width: 84px;
  color: #101828;
  font-size: 0.96rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-card {
  padding: 16px;
  margin-top: 14px;
}

.admin-card-narrow {
  max-width: 480px;
}

.admin-card-form {
  width: 100%;
  max-width: none;
}

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

.survey-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 14px 16px;
}

.survey-list-head h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.survey-list-head-main {
  min-width: 0;
}

.survey-list-head-empty {
  color: #667085;
  font-weight: 600;
}

.survey-list-head-copy {
  margin: 6px 0 0;
  color: #667085;
  font-size: 0.78rem;
  line-height: 1.45;
}

.survey-list-head-tools {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.survey-list-divider {
  height: 1px;
  margin: 0 14px 12px;
  background: var(--line);
}

.section-head-compact {
  margin-bottom: 10px;
}

.survey-admin-list,
.stack {
  display: grid;
  gap: 8px;
}

.active-panel-head,
.prepared-head {
  margin-bottom: 0;
}

.survey-admin-item-active {
  align-items: flex-start;
  margin-bottom: 14px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.survey-admin-item.survey-admin-item-active {
  background: #f8fbff;
  padding: 30px 30px 28px;
  border-radius: 24px;
}

.survey-admin-item.survey-admin-item-live {
  border-color: #bfe8ce;
  background: linear-gradient(180deg, #f7fff9 0%, #f3fbf6 100%);
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.12);
}

.survey-admin-item.survey-admin-item-active.survey-admin-item-live {
  border-color: #bfe8ce;
  background: linear-gradient(180deg, #f7fff9 0%, #f3fbf6 100%);
}

.survey-admin-item.survey-admin-item-standby {
  border-color: #e4e7ec;
  background: linear-gradient(180deg, #fbfbfc 0%, #f5f6f8 100%);
  box-shadow: inset 0 0 0 1px rgba(152, 162, 179, 0.08);
}

.survey-admin-item.survey-admin-item-active.survey-admin-item-standby {
  border-color: #e4e7ec;
  background: linear-gradient(180deg, #fbfbfc 0%, #f5f6f8 100%);
}

.active-options-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.active-survey-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.active-results-note {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fbff;
  color: #4a6486;
  font-size: 0.84rem;
  line-height: 1.4;
}

.active-results-hidden-card {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px dashed #d7e1ee;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
  color: #607089;
}

.active-results-hidden-card strong {
  color: #324a67;
  font-size: 0.98rem;
}

.active-options-preview {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.active-options-preview-item {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #fff;
  color: #23344d;
  font-size: 1rem;
  font-weight: 500;
}

.active-preference-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  background: #f8fbff;
  color: #345074;
  font-size: 0.76rem;
  font-weight: 600;
}

.active-option-row {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.active-option-meta {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  font-size: 0.96rem;
  line-height: 1.3;
}

.active-survey-main {
  gap: 20px;
}

.active-survey-status-row {
  display: block;
}

.survey-admin-item.survey-admin-item-active .active-survey-title {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.survey-admin-item-active .survey-admin-meta {
  font-size: 0.9rem;
  gap: 10px;
  color: #667085;
}

.active-command-panel {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #fff;
}

.active-command-panel-live {
  border-color: #bfe8ce;
  background: linear-gradient(180deg, #f7fff9 0%, #f4fbf6 100%);
}

.active-command-panel-standby {
  border-color: #e4e7ec;
  background: linear-gradient(180deg, #fbfbfc 0%, #f5f6f8 100%);
}

.active-command-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.active-command-status {
  margin-top: 10px;
}

.active-survey-tools {
  display: block;
}

.active-toggle-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.command-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.command-toggle-label {
  font-size: 0.84rem;
  font-weight: 600;
  transition: color 0.18s ease;
}

.command-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e7edf5;
  flex: 0 0 auto;
}

.command-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(12, 16, 24, 0.18);
}

.command-toggle-on {
  border-color: #bfe8ce;
  background: #eefaf2;
  color: #1f8f52;
}

.command-toggle-on .command-toggle-label-left {
  color: #9ab6a4;
}

.command-toggle-on .command-toggle-label-right {
  color: #1f8f52;
}

.command-toggle-on .command-toggle-track {
  background: #33b469;
}

.command-toggle-on .command-toggle-knob {
  left: 20px;
}

.command-toggle-off {
  border-color: #d0d5dd;
  background: #f8f9fb;
  color: #667085;
}

.command-toggle-off .command-toggle-label-left {
  color: #344054;
}

.command-toggle-off .command-toggle-label-right {
  color: #98a2b3;
}

.command-toggle-off .command-toggle-track {
  background: #d0d5dd;
}

.active-toggle-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 10px;
  border: 1px solid #edf2f7;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.active-toggle-button {
  min-width: 0;
  min-height: 32px;
  font-size: 0.84rem;
}

.active-toggle-step.is-done {
  background: #eef6ff;
  color: var(--accent);
  border-color: #d7e6ff;
}

.active-stop-selected {
  background: #d92d20;
  color: #fff;
  border-color: #d92d20;
}

.active-results-selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.active-results-callout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.active-results-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  animation: results-arrow-pulse 0.9s ease-in-out infinite;
}

.active-bar-track {
  position: relative;
  overflow: visible;
  height: 16px;
  background: #edf2f8;
  border-radius: 999px;
  margin-right: 132px;
}

.active-option-percent-badge {
  position: absolute;
  top: 50%;
  left: clamp(34px, var(--option-percent), calc(100% - 34px));
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d7e6ff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  color: #2f6fed;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.active-option-votes-badge {
  position: absolute;
  top: 50%;
  left: calc(100% + 18px);
  transform: translateY(-50%);
  min-width: 92px;
  color: #101828;
  font-size: 0.96rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.active-survey-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.survey-list-accordion {
  margin-top: 34px;
  padding: 4px 8px 10px;
  border-radius: 20px;
  background: #fff9ea;
}

.survey-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 24px 14px;
  cursor: pointer;
  list-style: none;
  color: #101828;
}

.survey-list-summary h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

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

.survey-list-summary::after {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 1.1rem;
  line-height: 1;
}

.survey-list-accordion[open] .survey-list-summary::after {
  content: '-';
}

.survey-list-summary-count {
  color: #667085;
  font-size: 1em;
  font-weight: 600;
}

.survey-admin-item-live .active-survey-label {
  color: #1f8f52;
}

.survey-admin-item-standby .active-survey-label {
  color: #667085;
}

.active-survey-label::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border-radius: 999px;
  vertical-align: middle;
}

.active-survey-label-online::before {
  background: #1f8f52;
  animation: live-pulse 1.2s ease-in-out infinite;
}

.active-survey-label-offline::before {
  background: #d92d20;
}

.active-survey-label-stopped {
  color: #b42318;
}

.active-survey-label-stopped::before {
  background: #d92d20;
}

.active-survey-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 143, 82, 0.12);
  color: #1f8f52;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.active-survey-status-copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.active-survey-status-title {
  color: #2f6fed;
}

.active-survey-status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(31, 143, 82, 0.12);
  color: #146c43;
  letter-spacing: 0.02em;
  text-transform: none;
}

.active-survey-status-text strong {
  font-size: 0.95rem;
  line-height: 1;
}

.active-survey-status-text-muted {
  background: rgba(47, 111, 237, 0.1);
  color: #2f6fed;
}

.active-survey-status-text-hidden {
  display: none;
}

.active-survey-label-stopped .active-survey-timer {
  background: #fff1f1;
  color: #b42318;
}

.active-survey-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.active-survey-pill-live {
  background: rgba(39, 174, 96, 0.12);
  color: #1f8f52;
}

.active-survey-pill-standby {
  background: rgba(31, 111, 235, 0.1);
  color: var(--accent);
}

.active-survey-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.active-survey-pill-live .active-survey-pill-dot {
  animation: live-pulse 1.2s ease-in-out infinite;
}

.active-survey-pill-standby .active-survey-pill-dot {
  animation: none;
}

.active-stop-button {
  border-color: #ffd6d6;
  background: #fff4f4;
  color: #b42318;
}

.active-stop-button:hover {
  background: #ffe9e9;
  border-color: #ffc1c1;
}

.active-close-button {
  white-space: nowrap;
}

.survey-admin-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #fff;
}

.survey-admin-item h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.survey-admin-main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.survey-admin-meta {
  margin: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.survey-admin-meta span::after {
  content: "·";
  margin-left: 8px;
}

.survey-admin-meta span:last-child::after {
  content: "";
  margin-left: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--accent-dark);
  font-weight: 600;
}

.live-pill-compact {
  min-width: 40px;
  min-height: 34px;
  justify-content: center;
  padding: 0 10px;
  font-size: 0.78rem;
}

.survey-admin-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.92rem;
}

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

.active-survey-tools .icon-action {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 1rem;
}

.icon-action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  font-weight: 500;
  font-size: 0.92rem;
}

.field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.field textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  resize: vertical;
}

.field select {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-banner {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #d7e6ff;
  background: #f6faff;
}

.admin-banner-label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-card h2 {
  font-size: 1rem;
}

.public-stage-shell h2 {
  font-size: 1.05rem;
}

.panel-copy,
.status {
  font-size: 0.9rem;
}

.compact-copy {
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.survey-create-settings {
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
}

.survey-create-settings-head h3,
.survey-settings-section h4,
.survey-settings-header h3 {
  margin: 0;
}

.survey-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.field-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.survey-settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.survey-settings-drawer.is-open {
  pointer-events: auto;
}

.survey-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.survey-settings-drawer.is-open .survey-settings-backdrop {
  opacity: 1;
}

.survey-settings-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100%;
  padding: 22px;
  background: #fff;
  border-left: 1px solid #dbe3ef;
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.26s ease;
  overflow-y: auto;
}

.survey-settings-drawer.is-open .survey-settings-panel {
  transform: translateX(0);
}

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

.survey-settings-form {
  display: grid;
  gap: 16px;
}

.survey-settings-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e7edf5;
  border-radius: 16px;
  background: #fbfdff;
}

.survey-settings-section-voting {
  background: linear-gradient(180deg, #fcfffe 0%, #f4fbf8 100%);
  border-color: #dfeee8;
}

.survey-settings-section-results {
  background: linear-gradient(180deg, #fffefd 0%, #fdf8f2 100%);
  border-color: #efe6d8;
}

.survey-settings-section-timer {
  background: linear-gradient(180deg, #fdfcff 0%, #f6f4fc 100%);
  border-color: #e5e1f0;
}

.field-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.field-inline-toggle-label {
  color: #667085;
  font-size: 0.85rem;
  font-weight: 500;
}

.survey-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.drawer-open {
  overflow: hidden;
}

.admin-card-compact {
  padding: 14px;
}

.stack-compact {
  gap: 10px;
}

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

.compact-actions {
  gap: 8px;
  margin-top: 4px;
}

.subhead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(31, 143, 82, 0.35);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.12);
    box-shadow: 0 0 0 6px rgba(31, 143, 82, 0);
  }
}

@keyframes results-arrow-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(4px);
  }
}

@keyframes results-row-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .app-shell,
  .admin-shell {
    width: min(100vw - 24px, 1120px);
    padding: 12px 0 20px;
  }

  .topbar,
  .admin-topbar,
  .section-head,
  .survey-admin-item,
  .vote-status-card,
  .bar-meta,
  .subhead,
  .actions,
  .split-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .public-card,
  .admin-card {
    padding: 16px;
    border-radius: 18px;
  }

  .admin-header-card {
    padding: 12px;
  }

  .admin-topbar-card,
  .topbar-card {
    gap: 14px;
    padding: 0;
    align-items: flex-start;
  }

  .public-header-shell .admin-topbar,
  .public-header-shell .admin-topbar-card {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    min-height: 48px;
  }

  .admin-topbar h1,
  .topbar-title h1,
  .survey-stage-card h2 {
    max-width: 100%;
    word-break: break-word;
  }

  .event-brand {
    align-items: center;
  }

  .public-header-shell .event-brand {
    display: grid;
    grid-template-columns: auto 1fr;
    width: 100%;
    align-items: center;
  }

  .public-header-shell .event-brand > div {
    display: flex;
    align-items: center;
    height: 34px;
  }

  .public-header-shell .admin-topbar h1 {
    display: block;
    margin: 0;
    line-height: 34px;
    transform: translateY(1px);
  }

  .event-brand-logo-frame {
    width: 108px;
    height: 34px;
  }

  .admin-nav-box {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .admin-nav {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
  }

  .admin-nav .ghost-button,
  .admin-nav .primary-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .room-switcher {
    gap: 10px;
    margin-top: 10px;
    margin-left: -2px;
    margin-right: -2px;
    padding: 0 2px 6px;
  }

  .public-header-shell,
  .public-stage-shell,
  .survey-admin-item.survey-admin-item-active {
    margin-left: 0;
    margin-right: 0;
  }

  .survey-stage-card h2 {
    margin-bottom: 14px !important;
    font-size: clamp(1.05rem, 4.8vw, 1.4rem) !important;
    line-height: 1.22 !important;
    letter-spacing: -0.01em;
  }

  .public-survey-timer {
    width: 100%;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 16px;
  }

  .public-survey-timer-head {
    gap: 10px;
    align-items: center;
  }

  .public-survey-timer-label {
    max-width: 60%;
    line-height: 1.3;
  }

  .vote-status-card {
    padding: 12px 14px;
  }

  .vote-status-card .ghost-button,
  .vote-status-card .primary-button {
    width: 100%;
  }

  .answer-list,
  .active-options-preview,
  .results-bars,
  .active-options-list {
    gap: 22px;
  }

  .public-waiting-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .public-waiting-media {
    justify-content: flex-start;
  }

  .public-waiting-image {
    width: min(100%, 180px);
  }

  .answer-option,
  .active-options-preview-item {
    min-height: 56px;
    padding: 12px 14px;
    align-items: flex-start;
  }

  .answer-option {
    font-size: 1rem;
  }

  .survey-stage-card-live .answer-option {
    gap: 10px;
  }

  .survey-stage-card-live .answer-option-result {
    display: block;
  }

  .survey-stage-card-live .results-section {
    display: none;
  }

  .answers-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .survey-list-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 10px;
    padding-left: 0;
    padding-right: 0;
  }

  .survey-list-head-main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .survey-list-head-tools {
    flex: 0 0 auto;
    justify-content: flex-end;
    width: auto;
  }

  .survey-list-head-tools form {
    width: auto;
  }

  .survey-list-divider {
    margin-left: 0;
    margin-right: 0;
  }

  .active-close-button {
    min-height: 32px;
    padding: 6px 12px;
  }

  .active-toggle-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .active-toggle-bar form {
    width: 100%;
  }

  .active-survey-tools {
    width: 100%;
  }

  .active-survey-tools form {
    width: 100%;
  }

  .active-toggle-button,
  .active-toggle-step,
  .active-toggle-title {
    width: 100%;
  }

  .active-command-panel,
  .survey-create-settings,
  .survey-settings-section {
    padding: 12px;
    border-radius: 14px;
  }

  .survey-admin-item {
    padding: 12px;
  }

  .survey-admin-item h3 {
    font-size: 1rem;
  }

  .survey-admin-tools {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    flex-wrap: wrap;
  }

  .survey-admin-tools form {
    width: 100%;
  }

  .survey-admin-tools .ghost-button,
  .survey-admin-tools .primary-button {
    width: 100%;
    min-width: 0;
  }

  .survey-admin-item.survey-admin-item-active {
    padding: 18px 16px 16px;
    border-radius: 20px;
  }

  .survey-admin-item.survey-admin-item-active .active-survey-title {
    font-size: 1.5rem;
  }

  .active-survey-preferences {
    margin-top: 10px;
  }

  .active-option-row,
  .bar-row {
    gap: 20px;
  }

  .active-option-meta,
  .bar-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    line-height: 1.35;
  }

  .bar-meta span {
    display: block;
    overflow-wrap: anywhere;
    font-size: 1.02rem;
  }

  .bar-meta {
    margin-bottom: 6px;
  }

  .active-bar-track,
  .bar-track {
    margin-right: 0;
    height: 12px;
    margin-top: 6px;
  }

  .active-option-percent-badge,
  .bar-percent-badge {
    min-width: 48px;
    height: 26px;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .active-option-votes-badge,
  .bar-votes-badge {
    display: none;
  }

  .compact-actions,
  .actions,
  .split-actions {
    gap: 10px;
  }

  .compact-actions .ghost-button,
  .compact-actions .primary-button,
  .actions .ghost-button,
  .actions .primary-button,
  .split-actions .ghost-button,
  .split-actions .primary-button {
    width: 100%;
  }

  .survey-settings-panel {
    width: 100vw;
    padding: 18px 16px;
  }
}
