:root {
  --canvas: #0e0f11;
  --canvas-raised: #121417;
  --surface: #191b1f;
  --surface-raised: #202329;
  --surface-muted: #272a30;
  --text: #f5f6f8;
  --text-muted: #b6bbc4;
  --text-soft: #9097a2;
  --border: #30343a;
  --border-strong: #4d535c;
  --accent: #ff7545;
  --accent-soft: #342017;
  --primary: #c74418;
  --primary-hover: #ad3612;
  --success: #58cf90;
  --success-soft: #14291e;
  --warning: #f0b55e;
  --warning-soft: #2e2516;
  --danger: #ff7d89;
  --danger-soft: #321a20;
  --focus: #ff9a73;
  --header-height: 68px;
  --radius: 8px;
  --radius-sm: 6px;
  --transition: 160ms cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
textarea,
select {
  min-width: 0;
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select,
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 20, 23, .97);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
  text-decoration: none;
}

.brand > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand img {
  width: 22px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand small {
  margin-left: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.header-actions,
.room-actions,
.question-controls,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.connection > span,
.room-context > span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--border-strong);
}

.connection.is-live > span,
.room-context > span {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(88, 207, 144, .1);
}

.connection.is-offline > span {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 125, 137, .1);
}

label,
.field-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

input:hover,
textarea:hover,
select:hover {
  border-color: #707782;
  background: var(--surface-raised);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--focus);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--focus);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-soft);
  opacity: 1;
}

input,
select {
  min-height: 44px;
  padding: 9px 12px;
}

textarea {
  min-height: 120px;
  padding: 13px 14px;
  resize: vertical;
}

input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: scale(.98);
}

.primary-button {
  padding: 10px 18px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

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

.secondary-button {
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: #707782;
  background: var(--surface-muted);
}

.icon-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: .46;
  transform: none;
}

.primary-button img {
  filter: brightness(0) invert(1);
}

.secondary-button img,
.icon-button img,
.moderator-search img,
.empty-symbol img,
.vote-button img {
  filter: brightness(0) invert(1);
  opacity: .86;
}

.compact-button {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 14px;
}

/* Participant application */
.participant-body main {
  width: 100%;
}

.room-finder,
.error-state {
  display: grid;
  width: min(100% - 32px, 680px);
  min-height: calc(100vh - var(--header-height));
  align-content: center;
  gap: 30px;
  margin: 0 auto;
  padding: 56px 0;
}

.finder-heading {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.room-finder h1,
.error-state h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.08;
  font-weight: 780;
}

.room-form,
.login-form,
.dialog-form {
  display: grid;
  gap: 12px;
}

.joined-input {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.joined-input:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(255, 154, 115, .18);
}

.joined-input > span {
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.joined-input input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#room-app {
  min-height: calc(100vh - var(--header-height));
}

.room-heading {
  display: flex;
  width: min(100%, 1180px);
  min-height: 162px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 auto;
  padding: 34px 28px 28px;
}

.room-heading-copy {
  min-width: 0;
}

.room-context {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-slug {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.room-heading h1,
.moderator-room-heading h1 {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 780;
}

.room-state {
  display: inline-flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid #285a40;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
  text-transform: capitalize;
}

.room-state[data-status="paused"] {
  border-color: #5e4b25;
  background: var(--warning-soft);
  color: var(--warning);
}

.room-state[data-status="closed"],
.room-state[data-status="archived"] {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.participant-grid {
  display: grid;
  width: min(100%, 1180px);
  grid-template-columns: minmax(0, 1fr) 370px;
  align-items: start;
  gap: 24px;
  margin: 0 auto;
  padding: 0 28px 64px;
}

.composer {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  grid-column: 2;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

.composer form {
  display: grid;
  gap: 11px;
}

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

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

.composer-heading h2,
.questions-toolbar h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.composer textarea {
  min-height: 144px;
  font-size: 16px;
}

.composer-meta {
  display: grid;
  gap: 12px;
}

.identity-fields {
  display: grid;
  gap: 10px;
}

.name-field {
  display: grid;
  width: 100%;
  gap: 6px;
}

.name-field small {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.check-control {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.check-control input {
  width: 20px;
  min-height: 20px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.submit-group {
  display: flex;
  width: 100%;
}

.submit-button {
  width: 100%;
}

.character-count {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.composer-status {
  min-height: 18px;
  margin: 9px 0 -2px;
  color: var(--success);
  font-size: 13px;
  font-weight: 650;
}

.questions-section {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.questions-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.questions-toolbar h2 span {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background-color var(--transition), color var(--transition);
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-pressed="true"] {
  background: var(--surface-muted);
  color: var(--text);
}

.search-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.question-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .12);
}

.question-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 132px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.question-item:last-child {
  border-bottom: 0;
}

.question-item.is-pinned {
  background: #1f1c1b;
}

.vote-button {
  display: flex;
  width: 76px;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--canvas-raised);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  transition: background-color var(--transition), color var(--transition);
}

.vote-button img {
  width: 19px;
  height: 19px;
}

.vote-button:hover,
.vote-button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.vote-button[aria-pressed="true"] img {
  filter: invert(62%) sepia(93%) saturate(1806%) hue-rotate(330deg) brightness(104%) contrast(101%);
  opacity: 1;
}

.question-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 21px 22px;
}

.question-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.question-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.question-flag img {
  filter: invert(62%) sepia(93%) saturate(1806%) hue-rotate(330deg) brightness(104%) contrast(101%);
}

.question-body {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 17px;
  line-height: 1.45;
}

.question-byline {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.question-answer {
  margin: 4px 0 0;
  padding: 12px 13px;
  border: 1px solid #244a35;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: #bdf3d5;
  white-space: pre-wrap;
}

.question-answer strong {
  display: block;
  margin-bottom: 4px;
  color: var(--success);
  font-size: 12px;
}

.empty-state,
.workspace-empty {
  display: grid;
  min-height: 300px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--canvas-raised);
}

.empty-symbol {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-state p,
.workspace-empty h1 {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.empty-state small {
  color: var(--text-soft);
  font-size: 13px;
}

.error-state {
  justify-items: start;
  align-content: center;
}

.error-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #5d3324;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.error-state p {
  max-width: 520px;
  margin: -16px 0 0;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid #d6d8dc;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--canvas);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .3);
  font-size: 14px;
  font-weight: 700;
}

/* Moderator authentication */
.admin-body {
  overflow: hidden;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.login-form {
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.login-form .brand {
  margin-bottom: 18px;
}

.login-form h1 {
  margin: 8px 0 2px;
  font-size: 29px;
  line-height: 1.15;
}

.login-context {
  margin: 0 0 4px;
  padding: 11px 12px;
  border: 1px solid #5d3324;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: #ffc2ab;
  font-size: 14px;
}

.login-form .primary-button {
  width: 100%;
  margin-top: 6px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

/* Moderator application */
.admin-app {
  height: 100vh;
  overflow: hidden;
}

.admin-header {
  position: relative;
  background: #111316;
}

.admin-layout {
  display: grid;
  width: 100%;
  max-width: none;
  height: calc(100vh - var(--header-height));
  grid-template-columns: 264px minmax(0, 1fr);
}

.room-sidebar {
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #141619;
}

.sidebar-heading {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-heading > div {
  display: grid;
  gap: 3px;
}

.sidebar-heading h2 {
  margin: 0;
  font-size: 15px;
}

.sidebar-heading > span {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.room-list {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.room-list-button {
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-content: center;
  gap: 5px 10px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background-color var(--transition);
}

.room-list-button:hover {
  background: var(--surface);
}

.room-list-button[aria-current="true"] {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.room-list-button[aria-current="true"] .room-list-title {
  color: var(--accent);
}

.room-list-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-list-slug {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-list-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--success);
  font-size: 11px;
  font-weight: 750;
  text-transform: capitalize;
}

.room-list-status[data-status="paused"] {
  color: var(--warning);
}

.room-list-status[data-status="closed"],
.room-list-status[data-status="archived"] {
  color: var(--text-muted);
}

.moderation-workspace {
  min-width: 0;
  overflow-y: auto;
  background: var(--canvas);
}

.moderator-room-heading {
  display: flex;
  min-height: 128px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-raised);
}

.moderator-room-heading h1 {
  font-size: 28px;
}

.room-actions {
  flex-wrap: wrap;
  justify-content: end;
}

.status-select {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 13px;
}

.status-select select {
  width: 118px;
  min-height: 38px;
}

.moderator-toolbar {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.moderator-toolbar-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.moderator-toolbar h2 {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
}

.moderator-search {
  display: grid;
  width: min(310px, 100%);
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--canvas-raised);
}

.moderator-search:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}

.moderator-search img {
  margin-left: 10px;
}

.moderator-search input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.moderator-summary {
  display: flex;
  gap: 28px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-raised);
  color: var(--text-muted);
  font-size: 13px;
}

.moderator-summary strong {
  margin-right: 3px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.moderator-question-list {
  margin: 20px 24px 40px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
}

.admin-list-empty {
  display: grid;
  min-height: 300px;
  place-items: center;
  padding: 24px;
  color: var(--text-muted);
  font-weight: 650;
  text-align: center;
}

.admin-question {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 174px;
  min-height: 142px;
  border-bottom: 1px solid var(--border);
}

.admin-question:last-child {
  border-bottom: 0;
}

.admin-question.is-dismissed {
  opacity: .62;
}

.admin-question-votes {
  display: grid;
  place-content: center;
  border-right: 1px solid var(--border);
  background: var(--canvas-raised);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  text-align: center;
}

.admin-question-votes small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 550;
}

.admin-question-content {
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 20px 22px;
}

.admin-question-content > p:first-child {
  font-size: 16px;
  line-height: 1.45;
}

.admin-question-content p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.admin-question-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.admin-question-answer {
  padding: 11px 12px;
  border: 1px solid #244a35;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: #bdf3d5;
  font-size: 13px;
}

.admin-question-actions {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  align-content: center;
  justify-content: center;
  gap: 8px;
  border-left: 1px solid var(--border);
  background: var(--canvas-raised);
}

.admin-question-actions .icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
}

.admin-question-actions .danger-button:hover {
  border-color: #78404a;
  background: var(--danger-soft);
}

.mobile-room-picker {
  display: none;
}

.workspace-empty {
  min-height: calc(100vh - var(--header-height));
}

/* Dialogs */
dialog {
  width: min(92vw, 520px);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .76);
}

.dialog-form {
  padding: 22px;
}

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

.dialog-heading h2 {
  margin: 0;
  font-size: 21px;
}

.dialog-slug {
  grid-template-columns: max-content minmax(0, 1fr);
}

.dialog-actions {
  justify-content: end;
  margin-top: 8px;
}

.answer-question {
  max-height: 120px;
  margin: 0 0 8px;
  overflow-y: auto;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas-raised);
}

@media (max-width: 980px) {
  .participant-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .moderator-toolbar {
    align-items: stretch;
  }

  .moderator-toolbar-title {
    display: grid;
    gap: 9px;
  }
}

@media (max-width: 860px) {
  .participant-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .composer {
    position: static;
    grid-column: 1;
    grid-row: 1;
  }

  .questions-section {
    grid-row: 2;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 60px;
  }

  .site-header {
    padding: 0 14px;
  }

  .connection {
    min-height: 30px;
    font-size: 12px;
  }

  .room-finder,
  .error-state {
    width: min(100% - 36px, 680px);
    padding: 36px 0;
  }

  .room-finder h1,
  .error-state h1 {
    font-size: 31px;
  }

  .joined-input {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .joined-input > span {
    grid-column: 1 / -1;
    padding: 10px 12px 0;
    font-size: 12px;
  }

  .room-heading {
    min-height: 120px;
    padding: 24px 16px 20px;
  }

  .room-heading h1 {
    font-size: 27px;
  }

  .participant-grid {
    gap: 24px;
    padding: 0 12px 44px;
  }

  .composer {
    padding: 18px;
  }

  .composer textarea {
    min-height: 126px;
  }

  .questions-toolbar {
    min-height: 52px;
  }

  .question-item {
    grid-template-columns: 60px minmax(0, 1fr);
    min-height: 118px;
  }

  .vote-button {
    width: 60px;
  }

  .question-content {
    padding: 17px 15px;
  }

  .question-body {
    font-size: 16px;
  }

  .search-row {
    grid-template-columns: 1fr max-content;
  }

  .search-row label {
    grid-column: 1 / -1;
  }

  .toast {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .login-view {
    padding: 16px;
  }

  .login-form {
    padding: 24px 20px;
  }

  .admin-header .brand > span {
    display: none;
  }

  .admin-layout {
    display: block;
  }

  .room-sidebar {
    display: none;
  }

  .moderation-workspace {
    height: 100%;
  }

  .mobile-room-picker {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .moderator-room-heading {
    display: grid;
    min-height: 0;
    align-items: start;
    gap: 18px;
    padding: 19px 14px;
  }

  .moderator-room-heading h1 {
    font-size: 24px;
  }

  .room-actions {
    display: grid;
    grid-template-columns: repeat(3, max-content) minmax(0, 1fr);
    width: 100%;
    justify-content: start;
  }

  .status-select {
    justify-self: end;
  }

  .moderator-toolbar {
    display: grid;
    min-height: 0;
    gap: 14px;
    padding: 14px;
  }

  .moderator-toolbar-title {
    display: grid;
    gap: 12px;
  }

  .moderator-toolbar .segmented {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .moderator-toolbar .segmented button {
    padding: 7px 4px;
  }

  .moderator-search {
    width: 100%;
  }

  .moderator-summary {
    gap: 16px;
    padding: 11px 14px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .moderator-question-list {
    margin: 12px 10px 28px;
  }

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

  .admin-question-votes {
    grid-row: 1 / span 2;
  }

  .admin-question-content {
    padding: 15px 13px;
  }

  .admin-question-actions {
    display: flex;
    grid-column: 2;
    justify-content: start;
    padding: 0 13px 14px;
    border-left: 0;
    background: transparent;
  }

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

@media (max-width: 390px) {
  .site-header {
    padding: 0 10px;
  }

  .brand {
    gap: 8px;
    font-size: 15px;
  }

  .connection {
    width: 18px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .connection > span {
    width: 9px;
    height: 9px;
  }

  .room-heading {
    padding-right: 12px;
    padding-left: 12px;
  }

  .participant-grid {
    padding-right: 8px;
    padding-left: 8px;
  }

  .composer {
    padding: 15px;
  }

  .questions-toolbar {
    display: grid;
    gap: 12px;
  }

  .question-controls {
    width: 100%;
    justify-content: space-between;
  }

  .segmented {
    flex: 1 1 auto;
  }

  .segmented button {
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .vote-button {
    width: 54px;
  }

  .room-actions {
    grid-template-columns: repeat(3, max-content);
  }

  .status-select {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .status-select select {
    flex: 1;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
