/* Presentation app theme */

:root {
  color-scheme: dark;

  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --bg: #1e1e2e;
  --bg-deep: #11111b;
  --surface: #181825;
  --surface-raised: #313244;
  --surface-soft: #45475a;
  --surface-hover: #585b70;
  --border: #45475a;
  --border-strong: #585b70;

  --text: #cdd6f4;
  --text-soft: #bac2de;
  --muted: #9399b2;
  --muted-strong: #a6adc8;

  --accent: #b4befe;
  --accent-bright: #cba6f7;
  --accent-deep: #89b4fa;
  --highlight: #f9e2af;

  --success: #a6e3a1;
  --success-soft: rgb(166 227 161 / 14%);
  --danger: #f38ba8;
  --danger-soft: rgb(243 139 168 / 14%);
  --info: #89b4fa;
  --info-soft: rgb(137 180 250 / 14%);

  --syntax-comment: #6c7086;
  --syntax-keyword: #cba6f7;
  --syntax-string: #a6e3a1;
  --syntax-number: #fab387;
  --syntax-function: #89b4fa;
  --syntax-type: #f9e2af;
  --syntax-variable: #cdd6f4;

  --radius-sm: 0.45rem;
  --radius-md: 0.65rem;
  --radius-lg: 0.85rem;
  --radius-xl: 1rem;

  --content-width: 78rem;
  --topbar-height: 4.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
}

::selection {
  background: var(--highlight);
  color: #11111b;
}

a {
  color: var(--accent-bright);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--highlight);
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.15rem, 4vw, 4rem);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.4rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

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

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell {
  width: min(100% - 2rem, var(--content-width));
  min-height: 100vh;
  margin-inline: auto;
  padding-block: calc(var(--topbar-height) + 2rem) 3rem;
}

.topbar,
.presenter-toolbar,
.audience-toolbar {
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-deep) 94%, transparent);
  backdrop-filter: blur(14px);
}

.topbar {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem max(1rem, calc((100vw - var(--content-width)) / 2));
}

.topbar > :last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand::before {
  width: 0.82rem;
  height: 0.82rem;
  border-radius: 0.24rem;
  background: var(--highlight);
  content: "";
}

.panel {
  padding: clamp(1rem, 2.5vw, 2rem);
}

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.landing-grid > * {
  min-width: 0;
}

.landing-hero {
  min-height: 70vh;
  align-items: center;
}

.landing-intro {
  max-width: 38rem;
  color: var(--text-soft);
  font-size: 1.15rem;
}

.waiting-state {
  text-align: center;
}

.admin-page {
  --content-width: 82rem;
  background: var(--bg);
}

.admin-shell {
  width: min(100% - 2rem, var(--content-width));
  min-height: 100vh;
  margin-inline: auto;
  padding-block: calc(var(--topbar-height) + clamp(3rem, 8vw, 7rem)) 5rem;
}

.admin-heading {
  max-width: 42rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.admin-heading h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.2rem, 5vw, 4.25rem);
}

.admin-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin-bottom: 0.65rem;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.presentation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.presentation-grid > li {
  min-width: 0;
}

.presentation-card,
.new-presentation-card {
  display: flex;
  width: 100%;
  min-height: 20rem;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.presentation-card:hover,
.presentation-card:focus-visible,
.new-presentation-card:hover:not(:disabled),
.new-presentation-card:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.presentation-preview {
  display: flex;
  min-height: 12rem;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.3rem, 3vw, 2.1rem);
  background: var(--bg);
}

.presentation-preview-kicker {
  margin-bottom: 0.8rem;
  color: var(--highlight);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.presentation-preview strong {
  max-width: 16ch;
  margin-bottom: 1.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  line-height: 1.08;
}


.presentation-card-body {
  display: grid;
  gap: 1.1rem;
  padding: 1.15rem 1.2rem;
}

.presentation-card-title,
.presentation-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.presentation-card-title > span:first-child {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.presentation-card-title strong {
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presentation-card-title small,
.presentation-card-meta > span:first-child {
  color: var(--muted);
  font-size: 0.76rem;
}

.presentation-card-arrow {
  color: var(--muted);
  font-size: 1.2rem;
}

.presentation-card:hover .presentation-card-arrow {
  color: var(--highlight);
}

.new-presentation-card {
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  text-align: center;
}

.new-presentation-card > span:last-child {
  display: grid;
  gap: 0.25rem;
}

.new-presentation-card strong {
  color: var(--text);
  font-size: 1rem;
}

.new-presentation-card small {
  color: var(--muted);
}

.new-presentation-icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  color: var(--highlight);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
}


.create-popover {
  width: min(100% - 2rem, 32rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.create-popover::backdrop {
  background: rgb(17 17 27 / 92%);
}

.create-popover > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem 1rem;
}

.create-popover h2,
.create-popover .eyebrow {
  margin-bottom: 0.25rem;
}

.create-popover form,
.create-popover #create-error:not(:empty) {
  margin: 1.25rem 1.5rem 1.5rem;
}

.create-popover #create-error:not(:empty) + form {
  margin-top: 0;
}

.popover-close {
  width: 2.4rem;
  min-height: 2.4rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.4rem;
}

.optional-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.create-popover label > small {
  color: var(--muted);
  font-weight: 400;
}

form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

input,
select {
  padding: 0.65rem 0.8rem;
}

textarea {
  min-height: 9rem;
  resize: vertical;
  padding: 0.8rem;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

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

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 1px;
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

button,
.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.64rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #11111b;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

button:hover:not(:disabled),
.button:hover:not([aria-disabled="true"]) {
  border-color: transparent;
  color: #11111b;
}

button:active:not(:disabled),
.button:active:not([aria-disabled="true"]) {
  background: var(--accent-deep);
}

.button.secondary,
.button-secondary,
button.secondary {
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--text);
}

.button.secondary:hover,
.button-secondary:hover,
button.secondary:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text);
}

.button.ghost,
.button-ghost,
button.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted-strong);
}

.button.ghost:hover,
.button-ghost:hover,
button.ghost:hover:not(:disabled) {
  background: rgb(255 255 255 / 6%);
  color: var(--text);
}

.button.danger,
.button-danger,
button.danger {
  border-color: transparent;
  background: var(--danger-soft);
  box-shadow: none;
  color: var(--danger);
}

.button.small,
.button-small,
button.small {
  min-height: 2.25rem;
  padding: 0.45rem 0.72rem;
  font-size: 0.86rem;
}

.button-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-only {
  width: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
}

.inline-form {
  display: contents;
}

.editor-page .topbar {
  padding-inline: 0.5rem;
}

.editor-shell {
  width: calc(100% - 1rem);
  max-width: none;
  padding-block: calc(var(--topbar-height) + 0.5rem) 0.5rem;
}

.editor-layout {
  display: grid;
  min-height: calc(100vh - var(--topbar-height) - 1rem);
  grid-template-columns: minmax(20rem, 32rem) minmax(0, 1fr);
  gap: 0.5rem;
}

.editor-pane,
.preview-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.editor-pane {
  padding: 1rem 1.25rem 1rem 0.75rem;
  border-right: 1px solid var(--border);
}

.editor-pane textarea {
  min-height: 26rem;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.65;
  tab-size: 2;
}

.theme-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.editor-publish {
  justify-self: start;
}

.editor-examples {
  margin-top: 1rem;
}

.preview-pane {
  display: grid;
  place-items: center;
  padding: 0.75rem;
  background: var(--surface);
}

.editor-preview {
  container-type: inline-size;
  display: grid;
  width: 100%;
  gap: 0.75rem;
}

.editor-preview .slide-stage {
  width: 100%;
  max-width: none;
}

.editor-preview .slide-content {
  padding: clamp(1rem, 4.5cqw, 3.5rem);
  font-size: clamp(0.7rem, 1.6cqw, 1.2rem);
}

.editor-preview .slide-content h1 {
  font-size: clamp(1.4rem, 5cqw, 4rem);
}

.editor-preview .slide-content h2 {
  font-size: clamp(1rem, 3.5cqw, 2.8rem);
}

.editor-preview .choices {
  gap: clamp(0.3rem, 0.8cqw, 0.75rem);
  margin-top: clamp(0.5rem, 1.2cqw, 1rem);
}

.editor-preview .choice {
  min-height: clamp(2rem, 5.5cqw, 4rem);
  gap: clamp(0.35rem, 0.8cqw, 0.75rem);
  padding: clamp(0.4rem, 1cqw, 0.8rem) clamp(0.5rem, 1.2cqw, 0.9rem);
}

.editor-preview .choice::before {
  width: clamp(1rem, 1.8cqw, 1.5rem);
  height: clamp(1rem, 1.8cqw, 1.5rem);
}

.preview-navigation {
  position: sticky;
  z-index: 20;
  bottom: 0.75rem;
  display: grid;
  width: min(100%, 32rem);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-self: center;
  gap: 0.5rem;
}

.preview-navigation > button {
  width: 100%;
  min-width: 0;
}

.preview-position {
  min-width: 6.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.slide-stage {
  position: relative;
  width: min(100%, 75rem);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: clamp(0.45rem, 1vw, 1rem);
  background: var(--bg);
}

.slide {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  background: transparent;
  color: var(--text);
}

.slide.active,
.slide[aria-current="true"] {
  display: flex;
}

.slide-content {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 5.5rem);
  font-size: clamp(0.75rem, 1.55vw, 1.35rem);
}

.slide-content > :last-child {
  margin-bottom: 0;
}

.slide-content:has(> p:first-child > img:only-child) {
  position: relative;
  justify-content: flex-end;
  padding: 0;
}

.slide-content:has(> p:first-child > img:only-child)::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgb(0 0 0 / 75%));
  content: "";
  pointer-events: none;
}

.slide-content:has(> p:first-child > img:only-child) > p:first-child {
  position: absolute;
  inset: 0;
  max-width: none;
  margin: 0;
}

.slide-content:has(> p:first-child > img:only-child) > p:first-child img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-content:has(> p:first-child > img:only-child) > :not(p:first-child) {
  position: relative;
  z-index: 2;
  margin-right: clamp(1.5rem, 5vw, 5.5rem);
  margin-left: clamp(1.5rem, 5vw, 5.5rem);
  color: #fff;
  text-shadow: 0 0.08em 0.3em rgb(0 0 0 / 65%);
}

.slide-content:has(> p:first-child > img:only-child) > :last-child {
  margin-bottom: clamp(1.5rem, 5vw, 5.5rem);
}

.slide-content h1 {
  max-width: 18ch;
  margin-bottom: 0.45em;
  font-size: clamp(2rem, 5.4vw, 5.2rem);
}

.slide-content h2 {
  max-width: 24ch;
  margin-bottom: 0.55em;
  font-size: clamp(1.6rem, 3.8vw, 3.8rem);
}

.slide-content p,
.slide-content li {
  max-width: 52ch;
  color: var(--text-soft);
}

.slide-content ul,
.slide-content ol {
  display: grid;
  gap: 0.45em;
  margin: 0;
  padding-left: 1.25em;
}

.slide-content :is(ul, ol) + p {
  margin-top: 1em;
}

.slide-content li::marker {
  color: var(--highlight);
}

.slide-content li:has(> input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 0.55em;
  list-style: none;
}

.slide-content li > input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  min-height: 0;
  flex: 0 0 1.1em;
  margin: 0.18em 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--highlight);
  opacity: 1;
}

.slide-content blockquote {
  max-width: 42ch;
  margin: 0;
  padding: 0.2em 0 0.2em 1em;
  border-left: 0.22em solid var(--highlight);
  color: var(--text);
  font-size: 1.16em;
}

code,
pre {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

code {
  padding: 0.12em 0.34em;
  border-radius: 0.3em;
  background: #11111b;
  color: var(--highlight);
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  overflow: auto;
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #181825 !important;
  color: var(--syntax-variable);
  font-size: 0.88em;
  line-height: 1.6;
  tab-size: 2;
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.comment,
.hljs-comment,
.token.comment,
.token.prolog,
.token.doctype {
  color: var(--syntax-comment);
  font-style: italic;
}

.keyword,
.hljs-keyword,
.hljs-selector-tag,
.token.keyword,
.token.operator {
  color: var(--syntax-keyword);
}

.string,
.hljs-string,
.hljs-attr,
.token.string,
.token.char,
.token.attr-value {
  color: var(--syntax-string);
}

.number,
.literal,
.hljs-number,
.hljs-literal,
.token.number,
.token.boolean {
  color: var(--syntax-number);
}

.function,
.title.function_,
.hljs-title,
.token.function {
  color: var(--syntax-function);
}

.type,
.class-name,
.hljs-type,
.hljs-title.class_,
.token.class-name,
.token.builtin {
  color: var(--syntax-type);
}

.variable,
.hljs-variable,
.token.variable,
.token.property {
  color: var(--syntax-variable);
}


.presenter-shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 32rem;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 5.25rem;
  background: var(--bg-deep);
}

.presenter-toolbar {
  position: relative;
  z-index: 10;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1rem;
}

.presenter-toolbar > *,
.audience-status,
.audience-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.6rem;
}

.presenter-status,
.audience-status {
  overflow: hidden;
}

.nav-title {
  overflow: hidden;
  min-width: 2rem;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-position {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.presenter-share {
  justify-content: center;
}

.share-code {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 0.45rem;
  white-space: nowrap;
}

.share-code > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-code strong {
  color: var(--highlight);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.presenter-actions {
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: none;
}

.presenter-actions::-webkit-scrollbar {
  display: none;
}

.share-status {
  overflow: hidden;
  max-width: 6.5rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presenter-shell .slide-stage {
  width: calc(100% - 1.5rem);
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  aspect-ratio: auto;
  margin: 0.75rem;
  border-radius: var(--radius-md);
}

.audience-shell {
  display: grid;
  width: min(100% - 2rem, 100rem);
  min-height: 100vh;
  align-content: center;
  gap: 1rem;
  margin-inline: auto;
  padding-block: calc(var(--topbar-height) + 2rem) 11rem;
}

.audience-toolbar {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem max(1rem, calc((100vw - 100rem) / 2));
}

.audience-status {
  justify-content: flex-start;
}

.audience-actions {
  position: fixed;
  z-index: 75;
  right: 50%;
  bottom: 5.4rem;
  width: max-content;
  max-width: calc(100% - 1rem);
  justify-content: flex-start;
  overflow-x: auto;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  flex-wrap: nowrap;
  scrollbar-width: none;
  transform: translateX(50%);
}

.audience-actions::-webkit-scrollbar {
  display: none;
}

.audience-actions .hand-button,
.audience-actions .reactions {
  width: auto;
  flex: 0 0 auto;
}

.audience-actions .reactions {
  flex-wrap: nowrap;
}

.audience-slide-content {
  padding: 0;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
}

.audience-slide-content:has(> p:first-child > img:only-child) {
  min-height: clamp(20rem, calc(100vh - var(--topbar-height) - 13rem), 50rem);
}

.hand-button.raised,
.hand-button.raised:hover:not(:disabled) {
  border-color: var(--highlight);
  background: var(--highlight);
  color: #11111b;
  animation: raised-hand-pulse 1.8s ease-in-out infinite;
}

@keyframes raised-hand-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

.interaction {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.audience-slide {
  overflow: visible;
  padding: 0;
  background: transparent;
}

.interaction > :last-child {
  margin-bottom: 0;
}

.interaction h1,
.interaction h2 {
  margin-bottom: 0.45em;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.choice {
  display: flex;
  width: 100%;
  min-height: 4.2rem;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
  text-align: left;
}

.choice::before {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  content: "";
}

.choice:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text);
}

.choice.static,
.reaction.static {
  cursor: default;
  pointer-events: none;
}

.choice.selected,
.choice[aria-pressed="true"],
.choice:has(input:checked) {
  border-color: transparent;
  background: var(--surface-soft);
}

.choice.selected::before,
.choice[aria-pressed="true"]::before,
.choice:has(input:checked)::before {
  border-color: var(--highlight);
  background: var(--highlight);
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.interaction-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.ordering-response + .group-ordering {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.ordering-form {
  display: block;
}

.ordering-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.ordering-cards {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding: 0;
  counter-reset: ordering-card;
  list-style: none;
}

.ordering-card {
  display: grid;
  min-height: 3.5rem;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  counter-increment: ordering-card;
  cursor: grab;
  font-weight: 650;
}

.ordering-card::before {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted-strong);
  content: counter(ordering-card);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.ordering-card.dragging {
  background: var(--surface-soft);
  cursor: grabbing;
  opacity: 0.7;
  pointer-events: none;
}

.ordering-card.static {
  grid-template-columns: auto minmax(0, 1fr);
  cursor: default;
}

.drag-handle {
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.ordering-card-controls {
  display: flex;
  gap: 0.2rem;
}

.group-order {
  margin-top: 0.75rem;
}

.results {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.25rem;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.7fr) minmax(10rem, 1.5fr) auto;
  align-items: center;
  gap: 0.8rem;
}

.result-row > :first-child {
  overflow: hidden;
  color: var(--text-soft);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row > :last-child {
  min-width: 3.4rem;
  color: var(--muted-strong);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bar-track {
  position: relative;
  height: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  min-width: 0;
  border-radius: inherit;
  background: var(--highlight);
  transform-origin: left center;
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}


.vertical-chart {
  display: flex;
  height: 15rem;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.55rem, 2vw, 1.25rem);
  padding: 1.25rem 1rem 0;
  border-bottom: 1px solid var(--border-strong);
}

.vertical-bar {
  position: relative;
  width: clamp(2.2rem, 8vw, 5rem);
  height: var(--value, 0%);
  min-height: 0.25rem;
  border-radius: 0.35rem 0.35rem 0 0;
  background: var(--highlight);
  transform-origin: center bottom;
  transition: height 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vertical-bar::after {
  position: absolute;
  right: 50%;
  bottom: -1.8rem;
  max-width: 7rem;
  color: var(--muted);
  content: attr(data-label);
  font-size: 0.75rem;
  text-align: center;
  text-overflow: ellipsis;
  transform: translateX(50%);
  white-space: nowrap;
}

.word-cloud {
  display: flex;
  min-height: 16rem;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  flex-wrap: wrap;
  padding: 1.25rem;
}

.word-cloud > * {
  color: var(--word-color, var(--text-soft));
  font-family: var(--font-display);
  font-size: calc(0.82rem + var(--weight, 1) * 0.32rem);
  font-weight: calc(520 + var(--weight, 1) * 45);
  line-height: 1;
  transition: filter 160ms ease, transform 160ms ease;
}

.word-cloud > *:hover {
  filter: brightness(1.15);
  transform: scale(1.04);
}

.reactions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.presenter-reactions {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: 1.15rem;
}

.presentation-navigation {
  position: fixed;
  z-index: 80;
  right: 50%;
  bottom: 1rem;
  display: grid;
  width: min(calc(100% - 2rem), 34rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  transform: translateX(50%);
}

.presentation-navigation > * {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.nav-placeholder {
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}

.attention-control {
  background: var(--highlight);
  color: #11111b;
}

.attention-control:hover:not(:disabled) {
  background: #fab387;
  color: #11111b;
}

.attention-control:active:not(:disabled) {
  background: #eba0ac;
}

.question-signal {
  position: fixed;
  z-index: 90;
  bottom: 1rem;
  left: 1rem;
}

.question-signal button {
  background: var(--danger-soft);
  color: var(--danger);
}

.reaction-feed {
  position: fixed;
  z-index: 120;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.flying-reaction {
  position: absolute;
  bottom: 4.5rem;
  left: calc(50% + var(--start, 0px));
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
  animation: reaction-flight 3s ease-out forwards;
}

@keyframes reaction-flight {
  0% {
    opacity: 0;
    transform: translate(0, 1rem) scale(0.8);
  }

  12% {
    opacity: 1;
  }

  78% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--drift, 0), -55vh) scale(1.15);
  }
}

.slide-stage.slide-changed::after,
.audience-slide.slide-changed::after {
  position: absolute;
  z-index: 20;
  inset: 0;
  border: 4px solid var(--highlight);
  border-radius: inherit;
  content: "";
  pointer-events: none;
  animation: slide-border-cue 1.1s ease-out forwards;
}

@keyframes slide-border-cue {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.reaction {
  position: relative;
  display: inline-flex;
  min-width: 3.25rem;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-size: 1.3rem;
}

.reaction:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text);
}

.reaction:active:not(:disabled),
.reaction.active {
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--highlight);
}

.reaction .count {
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.status-pill {
  display: inline-flex;
  min-height: 1.8rem;
  align-items: center;
  gap: 0.42rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-pill::before {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill.live {
  background: var(--danger-soft);
  color: var(--danger);
}

.presenter-toolbar .status-pill.live::before,
.audience-toolbar .status-pill.live::before {
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.status-pill.success,
.status-pill.connected {
  background: var(--success-soft);
  color: var(--success);
}


.status-pill.waiting,
.status-pill.pending {
  background: var(--surface-soft);
  color: var(--highlight);
}

.status-pill.error,
.status-pill.disconnected {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state {
  display: grid;
  min-height: 14rem;
  place-items: center;
  align-content: center;
  gap: 0.65rem;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.empty-state::before {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--highlight);
  content: "";
}

.empty-state > :last-child {
  margin-bottom: 0;
}

.notice,
.error {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.95rem;
  border-left: 2px solid currentColor;
  background: var(--info-soft);
  color: var(--info);
}

.notice::before,
.error::before {
  flex: 0 0 auto;
  content: "●";
  font-size: 0.72rem;
  line-height: 1.9;
}

.notice > :last-child,
.error > :last-child {
  margin-bottom: 0;
}

.error {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 75rem) {
  .presenter-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .presenter-actions {
    grid-column: 1 / -1;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 62rem) {
  .question-signal,
  .presenter-reactions {
    bottom: 6.25rem;
  }

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

  .landing-grid,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-layout {
    min-height: auto;
  }

  .editor-pane,
  .preview-pane {
    overflow: visible;
  }

  .editor-pane {
    padding: 1rem 0 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .preview-pane {
    min-height: 24rem;
  }

}

@media (max-width: 45rem) {
  :root {
    --topbar-height: 3.75rem;
  }

  body {
    font-size: 0.96rem;
  }

  .shell {
    width: min(100% - 1rem, var(--content-width));
    padding-top: calc(var(--topbar-height) + 1rem);
    padding-bottom: 1.5rem;
  }

  .admin-shell {
    width: min(100% - 1.25rem, var(--content-width));
    padding-top: calc(var(--topbar-height) + 2.5rem);
    padding-bottom: 2rem;
  }

  .presentation-grid {
    grid-template-columns: 1fr;
  }

  .presentation-card,
  .new-presentation-card {
    min-height: 16rem;
  }

  .topbar {
    gap: 0.5rem;
    padding-inline: 0.75rem;
  }

  .topbar .button,
  .topbar button {
    min-height: 2.3rem;
    padding-inline: 0.68rem;
    font-size: 0.82rem;
  }

  .brand {
    font-size: 0.96rem;
  }

  .panel,
  .interaction {
    border-radius: var(--radius-md);
    padding: 1rem;
  }

  .choices {
    grid-template-columns: 1fr;
  }

  .preview-pane {
    min-height: 15rem;
    padding: 0.5rem;
  }

  .slide-content {
    padding: clamp(1rem, 5vw, 2rem);
  }

  .result-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
  }

  .result-row .bar-track,
  .result-row > :nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .result-row > :first-child {
    white-space: normal;
  }

  .vertical-chart {
    height: 12rem;
    gap: 0.45rem;
    padding-inline: 0.5rem;
  }

  .audience-shell {
    width: calc(100% - 1rem);
    padding-block: calc(var(--topbar-height) + 1rem) 10.5rem;
  }

  .audience-slide {
    padding: 1rem;
  }

  .audience-slide-content {
    font-size: 1rem;
  }

  .presenter-toolbar {
    display: flex;
    min-height: var(--topbar-height);
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.55rem 0.75rem;
    scrollbar-width: none;
  }

  .presenter-toolbar::-webkit-scrollbar {
    display: none;
  }

  .presenter-toolbar > * {
    width: auto;
    flex: 0 0 auto;
  }

  .presenter-status .nav-title {
    max-width: 10rem;
  }

  .presenter-actions {
    justify-content: flex-start;
    padding-top: 0;
    border-top: 0;
  }

  .audience-toolbar {
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
  }

  .presentation-navigation {
    bottom: 0.5rem;
    width: calc(100% - 1rem);
  }

  .presentation-navigation > * {
    padding-inline: 0.45rem;
    font-size: 0.78rem;
  }

}

@media (max-width: 30rem) {
  .topbar .brand span {
    display: none;
  }

  .panel {
    padding: 0.8rem;
  }

  .button,
  button {
    width: 100%;
  }

  .topbar .button,
  .topbar button,
  .popover-close,
  .presenter-toolbar .button,
  .presenter-toolbar button,
  .reaction,
  .choice {
    width: auto;
  }

  .presenter-toolbar > * {
    width: auto;
  }

  .audience-toolbar .nav-title {
    max-width: 5rem;
  }

  .presenter-reactions {
    display: none;
  }

  .choice {
    width: 100%;
  }

  .reactions {
    gap: 0.45rem;
  }

  .reaction {
    min-width: 3rem;
    min-height: 3rem;
    padding: 0.45rem 0.62rem;
  }
}

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

@media print {
  :root {
    color-scheme: light;
    --bg: #fff;
    --bg-deep: #fff;
    --surface: #fff;
    --surface-raised: #fff;
    --text: #111;
    --text-soft: #222;
    --muted: #555;
    --border: #bbb;
  }

  @page {
    size: landscape;
    margin: 0;
  }

  html,
  body {
    width: 100%;
    min-width: 0;
    min-height: 0;
    background: #fff !important;
    color: #111;
  }

  .topbar,
  .presenter-toolbar,
  .audience-toolbar,
  .audience-actions,
  .presentation-navigation,
  .editor-pane,
  .reactions,
  button,
  .button {
    display: none !important;
  }

  .shell,
  .presenter-shell,
  .preview-pane {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff !important;
    box-shadow: none;
  }

  .editor-layout {
    display: block;
    min-height: 0;
  }

  .slide-stage {
    width: 100%;
    max-width: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .slide {
    position: relative;
    display: flex !important;
    width: 100%;
    aspect-ratio: 16 / 9;
    break-after: page;
    page-break-after: always;
    background: #fff !important;
    color: #111;
  }

  .slide:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .slide-content,
  .slide-content h1,
  .slide-content h2,
  .slide-content p,
  .slide-content li {
    color: #111;
  }

  .slide-content {
    font-size: 1.35rem;
  }

  .slide-content h1 {
    font-size: 4rem;
  }

  .slide-content h2 {
    font-size: 3rem;
  }

  pre,
  code {
    border-color: #bbb;
    background: #f2f2f2 !important;
    color: #111;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .bar-fill,
  .vertical-bar,
  .status-pill {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  a {
    color: #111;
    text-decoration: none;
  }
}
