@font-face {
  font-family: "Noto Sans Lao";
  src: url("/static/fonts/NotoSansLao-Lao.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0E81-0EDF, U+200C-200D, U+25CC;
}

:root {
  color-scheme: light;
  --bg: #f4f5f0;
  --bg-deep: #e9ece5;
  --surface: #fffefb;
  --surface-soft: #f8f9f5;
  --ink: #17211d;
  --muted: #5c6962;
  --faint: #87928b;
  --line: #dce1d8;
  --line-strong: #c7cec4;
  --accent: #0a5f51;
  --accent-hover: #074a3f;
  --accent-soft: #e4f0eb;
  --accent-ink: #06463c;
  --danger: #a2352e;
  --danger-soft: #faece9;
  --warning: #8a5a00;
  --warning-soft: #fbf1dc;
  --success: #0a5f51;
  --success-soft: #e4f0eb;
  --r-card: 10px;
  --r-control: 10px;
  --r-small: 8px;
  --shadow-card: 0 1px 2px rgb(23 33 29 / 4%), 0 10px 30px rgb(23 33 29 / 5%);
  --shadow-float: 0 12px 36px rgb(23 33 29 / 14%), 0 2px 6px rgb(23 33 29 / 6%);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Leelawadee UI", "Noto Sans Thai", "Noto Sans Lao", "Noto Sans",
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Noto Sans CJK TC",
    Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-weight: 650;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

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

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

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

.hidden {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--r-small);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-float);
  transform: translateY(-180%);
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark-mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface);
  border: 1px solid var(--accent);
}

.overline {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.meta-label {
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.optional {
  color: var(--faint);
  font-weight: 400;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease,
    transform 80ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

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

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

.button-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--faint);
  color: var(--ink);
}

.button-quiet {
  border-color: transparent;
  color: var(--muted);
}

.button-quiet:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.button-small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 0.8rem;
}

.button-wide {
  width: 100%;
}

.danger {
  color: var(--danger);
}

.danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.danger-solid:hover {
  background: #842923;
  border-color: #842923;
}

/* Form controls */
.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-small);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgb(10 95 81 / 12%);
}

input::placeholder {
  color: var(--faint);
  opacity: 1;
}

input[type="file"] {
  width: 100%;
  min-height: 40px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-small);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
}

input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

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

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.form-actions .hint {
  max-width: 54ch;
}

.form-error {
  min-height: 1.2em;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 600;
}

.copy-field {
  display: flex;
  gap: 8px;
}

.copy-field input {
  min-width: 0;
  flex: 1;
  font-size: 0.8rem;
}

.copy-area {
  position: fixed;
  top: -1000px;
  left: -1000px;
  opacity: 0;
}

/* Alerts and labels */
.alert {
  padding: 13px 16px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--r-small);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}

.alert strong {
  font-weight: 700;
}

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

.alert-success {
  border-left-color: var(--success);
  background: var(--success-soft);
}

.alert-warning {
  border-left-color: var(--warning);
  background: var(--warning-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

.status-pill.live {
  border-color: #b9d9cf;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.status-pill.warning {
  border-color: #e9d4a9;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.off {
  color: var(--faint);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--faint);
}

.status-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(10 95 81 / 12%);
}

.status-dot.connecting {
  background: var(--warning);
}

.status-dot.reconnecting {
  background: var(--warning);
}

.status-dot.ended {
  background: var(--faint);
}

.provider-line {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Shared panels */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

/* Auth */
.auth-page {
  background: var(--bg);
}

.auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 100dvh;
  padding: 36px 20px;
}

.auth-wordmark {
  margin-bottom: 2px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.auth-card h1 {
  font-size: 1.55rem;
}

.auth-card .lede {
  margin-top: 8px;
  margin-bottom: 22px;
  font-size: 0.9rem;
}

.auth-card .alert {
  margin-bottom: 18px;
}

.auth-note {
  max-width: 420px;
  color: var(--faint);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

/* Dashboard header */
.app-header {
  border-bottom: 1px solid var(--line);
  background: rgb(255 254 251 / 86%);
  backdrop-filter: blur(8px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 16px 24px;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-nav form {
  margin: 0;
}

.nav-role {
  color: var(--faint);
  font-size: 0.78rem;
}

.dashboard-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 42px 24px 56px;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.page-intro h1 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 3.5vw, 2.55rem);
}

.page-intro-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 5px;
  flex-wrap: wrap;
}

.upload-panel {
  padding: 24px;
  margin-bottom: 38px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.panel-heading p {
  max-width: 66ch;
  color: var(--muted);
  font-size: 0.86rem;
}

.panel-limit {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
}

.upload-form {
  display: grid;
  gap: 17px;
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 16px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 38px 28px;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

.empty-mark {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) 8px 10px / 14px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 8px 15px / 10px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 8px 20px / 13px 1px no-repeat,
    var(--surface-soft);
}

.empty-state h2 {
  font-size: 1.2rem;
}

.empty-state p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state form {
  margin-top: 8px;
}

.presentations-section,
.recent-section {
  margin-top: 10px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.section-heading h2 {
  font-size: 1.05rem;
}

.count-label {
  color: var(--faint);
  font-size: 0.76rem;
}

.presentation-list {
  border-top: 1px solid var(--line);
}

.presentation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.presentation-main {
  min-width: 0;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.title-line h3 {
  min-width: 0;
  font-size: 1.06rem;
  font-weight: 680;
}

.adapter-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.adapter-reveal {
  border-color: #c6dbd4;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.adapter-generic,
.adapter-unknown {
  border-color: #e7d8ba;
  color: var(--warning);
  background: var(--warning-soft);
}

.meta-line {
  margin-top: 7px;
  color: var(--faint);
  font-size: 0.78rem;
}

.meta-separator {
  margin: 0 6px;
}

.language-status-group {
  margin-top: 14px;
}

.language-status-group > .meta-label {
  display: block;
  margin-bottom: 7px;
}

.language-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 0.72rem;
  line-height: 1.2;
}

.lang-chip .lang-name {
  color: var(--ink);
  font-weight: 600;
}

.lang-chip .lang-status {
  color: var(--faint);
  font-size: 0.68rem;
}

.lang-chip.ready {
  border-color: #bdd8cf;
  background: var(--accent-soft);
}

.lang-chip.ready .lang-status {
  color: var(--accent-ink);
}

.lang-chip.preparing,
.lang-chip.partial {
  border-color: #e7d8ba;
  background: var(--warning-soft);
}

.lang-chip.preparing .lang-status,
.lang-chip.partial .lang-status {
  color: var(--warning);
}

.lang-chip.error {
  border-color: #e9c8c3;
  background: var(--danger-soft);
}

.lang-chip.error .lang-status {
  color: var(--danger);
}

.lang-chip.off {
  opacity: 0.65;
}

.lang-chip.original {
  border-color: var(--line);
  background: transparent;
}

.inline-hint {
  margin-top: 7px;
  color: var(--faint);
  font-size: 0.74rem;
}

.presentation-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 420px;
}

.presentation-actions form {
  margin: 0;
}

.presentation-actions .button {
  min-height: 34px;
  font-size: 0.8rem;
}

.share-details {
  position: relative;
}

.share-details summary {
  list-style: none;
  cursor: pointer;
}

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

.share-details[open] summary {
  background: var(--surface-soft);
  border-color: var(--faint);
}

.share-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  width: min(520px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.share-popover-copy {
  min-width: 0;
}

.share-popover .meta-label {
  display: block;
  margin-bottom: 6px;
}

.share-url {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.share-url a {
  color: var(--muted);
}

.qr-image {
  display: block;
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.panel-limit,
.count-label,
.meta-label,
.hint {
  line-height: 1.4;
}

.recent-section {
  margin-top: 38px;
}

.recent-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.recent-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}

.recent-title {
  color: var(--ink);
  font-weight: 600;
}

.recent-meta {
  color: var(--faint);
  font-size: 0.76rem;
}

.dashboard-footnote {
  max-width: 78ch;
  margin-top: 40px;
  color: var(--faint);
  font-size: 0.76rem;
  line-height: 1.55;
}

/* Stage pages */
body.presenter-page,
body.attendee-page {
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-deep);
}

.stage-page {
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-deep);
}

.stage-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 56px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.stage-bar-main,
.stage-bar-actions,
.attendee-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stage-bar-main {
  flex: 1 1 auto;
}

.stage-bar-actions {
  flex: 0 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.back-link:hover {
  color: var(--ink);
}

.back-arrow {
  font-size: 1rem;
  line-height: 1;
}

.stage-title {
  min-width: 0;
  max-width: 42ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
  font-weight: 650;
}

.viewer-count {
  color: var(--faint);
  font-size: 0.76rem;
  white-space: nowrap;
}

.viewer-count strong {
  color: var(--ink);
  font-weight: 650;
}

.prep-indicator {
  color: var(--faint);
  font-size: 0.74rem;
  white-space: nowrap;
}

.prep-indicator::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.stage-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 16px 16px;
}

.deck-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: #fff;
}

.stage-overlay {
  position: absolute;
  inset: 12px 16px 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: rgb(255 254 251 / 94%);
  text-align: center;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.stage-overlay.hidden {
  display: none !important;
}

.stage-overlay.is-error {
  background: var(--surface);
}

.stage-overlay > p {
  max-width: 46ch;
}

.stage-overlay .hint {
  max-width: 52ch;
}

.stage-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: rgb(255 254 251 / 96%);
  box-shadow: var(--shadow-float);
  transform: translateX(-50%);
}

.stage-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.stage-control:hover {
  background: var(--surface-soft);
}

.stage-control:active {
  transform: translateY(1px);
}

.control-arrow {
  font-size: 1rem;
  line-height: 1;
}

.slide-label {
  min-width: 92px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
  white-space: nowrap;
}

.toast {
  position: absolute;
  top: 24px;
  left: 50%;
  z-index: 20;
  max-width: min(520px, calc(100% - 48px));
  padding: 9px 13px;
  border: 1px solid #e7d8ba;
  border-radius: var(--r-small);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  transform: translateX(-50%);
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-bottom: 6px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.noscript-note {
  padding: 12px 16px;
  border-top: 1px solid #e7d8ba;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.84rem;
}

/* Attendee */
.attendee-bar {
  gap: 20px;
}

.attendee-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.attendee-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 650;
}

.attendee-tools {
  flex: 0 0 auto;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.translation-status {
  color: var(--warning);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.translation-status:empty {
  display: none;
}

.language-control select {
  width: auto;
  min-width: 172px;
  max-width: 300px;
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  background: var(--surface);
  font-size: 0.82rem;
}

.attendee-notice {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-bottom: 1px solid #e7d8ba;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.8rem;
}

.attendee-stage {
  padding: 10px 14px 14px;
}

.ended-overlay {
  z-index: 15;
  gap: 8px;
  background: rgb(255 254 251 / 98%);
}

.ended-overlay h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

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

  .spinner {
    animation: none;
    border-top-color: var(--line-strong);
  }
}

/* Dialog */
.dialog {
  width: min(580px, calc(100vw - 32px));
  max-height: min(88dvh, 860px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}

.dialog::backdrop {
  background: rgb(15 23 19 / 42%);
  backdrop-filter: blur(2px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 0;
}

.dialog-header h2 {
  font-size: 1.2rem;
}

.dialog-subtitle {
  max-width: 52ch;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dialog-close {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.dialog-body {
  max-height: calc(88dvh - 80px);
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.share-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.qr-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.qr-column .qr-image {
  width: 100%;
  height: auto;
  max-width: 200px;
}

.share-column {
  min-width: 0;
}

.share-column > .meta-label {
  display: block;
  margin-bottom: 5px;
}

.share-column .share-url {
  margin-bottom: 9px;
  font-size: 0.8rem;
}

.share-prep {
  margin-top: 18px;
}

.share-prep > .meta-label {
  display: block;
  margin-bottom: 6px;
}

.language-chips-stacked {
  flex-direction: column;
  align-items: stretch;
}

.language-chips-stacked .lang-chip {
  justify-content: space-between;
}

.sync-note {
  margin-top: 10px;
}

.sync-warning {
  color: var(--warning);
}

.message-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 100dvh;
  padding: 36px 20px;
}

.message-card {
  width: min(560px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.message-card h1 {
  margin-bottom: 12px;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.message-card p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.message-card .button {
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 960px) {
  .presentation-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .presentation-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .share-popover {
    left: 0;
    right: auto;
  }
}

@media (max-width: 760px) {
  .app-header-inner {
    padding: 13px 16px;
  }

  .nav-role {
    display: none;
  }

  .dashboard-shell {
    padding: 28px 16px 44px;
  }

  .page-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
  }

  .page-intro-meta {
    padding-bottom: 0;
  }

  .upload-panel {
    padding: 18px;
  }

  .panel-heading {
    flex-direction: column;
    gap: 6px;
  }

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

  .form-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }

  .stage-bar {
    min-height: 50px;
    padding: 7px 12px;
  }

  .stage-title {
    max-width: 28ch;
  }

  .back-label {
    display: none;
  }

  .back-arrow {
    font-size: 1.15rem;
  }

  .viewer-count,
  .prep-indicator {
    display: none;
  }

  .stage-frame-wrap {
    padding: 8px 10px 12px;
  }

  .stage-overlay {
    inset: 8px 10px 12px;
  }

  .stage-controls {
    bottom: 20px;
  }

  .stage-bar .button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.76rem;
  }

  .attendee-bar {
    gap: 10px;
  }

  .attendee-title {
    font-size: 0.82rem;
    max-width: 38vw;
  }

  .connection-state #connection-state {
    display: none;
  }

  .translation-status {
    display: none;
  }

  .language-control select {
    min-width: 148px;
    max-width: 46vw;
    font-size: 0.78rem;
  }

  .attendee-stage {
    padding: 8px 10px 10px;
  }

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

  .qr-column {
    align-items: flex-start;
  }

  .qr-column .qr-image {
    max-width: 170px;
  }

  .dialog-header,
  .dialog-body {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 640px) {
  .attendee-bar {
    flex-wrap: wrap;
    gap: 5px 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .attendee-title-wrap {
    flex: 1 1 100%;
  }

  .attendee-title {
    max-width: 100%;
    font-size: 0.88rem;
  }

  .attendee-tools {
    width: 100%;
    justify-content: space-between;
  }

  .connection-state #connection-state {
    display: inline;
  }

  .language-control {
    margin-left: auto;
  }

  .language-control select {
    max-width: 62vw;
    min-width: 166px;
  }

  .attendee-stage {
    padding-top: 6px;
  }
}

@media (max-width: 540px) {
  .app-header-inner {
    padding: 12px 14px;
  }

  .wordmark {
    font-size: 0.92rem;
  }

  .nav-role {
    display: none;
  }

  .page-intro h1 {
    font-size: 1.85rem;
  }

  .presentation-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .presentation-actions .button,
  .presentation-actions form,
  .presentation-actions summary {
    width: 100%;
  }

  .presentation-actions form .button {
    width: 100%;
  }

  .share-details {
    width: 100%;
  }

  .share-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .share-popover .qr-image {
    max-width: 160px;
  }

  .presentation-actions .share-details summary {
    display: flex;
  }

  .control-text {
    display: none;
  }

  .stage-control {
    min-width: 40px;
    min-height: 36px;
    padding: 0 8px;
  }

  .control-arrow {
    font-size: 1.15rem;
  }

  .slide-label {
    min-width: 76px;
    font-size: 0.7rem;
  }

  .stage-title {
    max-width: 22ch;
  }

  .attendee-title {
    max-width: 30vw;
  }

  .stage-bar-actions {
    gap: 5px;
  }

  .auth-card {
    padding: 22px;
  }

  .dialog {
    width: calc(100vw - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}
