/* The real UMD "eyebrow" flag badge */
.umd-eyebrow {
  display: inline-block;
  font-weight: 700;
  color: #000000;
  font-size: 0.8rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: #ffd200;
  padding: 0.625em 1.875em;
  margin-bottom: 0.9375em;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

/* Tailwind Theme Fallbacks */
.bg-umd-red { background-color: #e21833; }
.bg-umd-darkRed { background-color: #b81227; }
.text-umd-red { color: #e21833; }
.border-umd-red { border-color: #e21833; }

[data-theme="dark"] .text-\[\#e21833\],
[data-theme="dark"] .text-umd-red { color: #ff3355; }

[data-theme="light"] .text-indigo-400,
[data-theme="white"] .text-indigo-400 { color: #4f46e5; }
[data-theme="light"] .text-amber-400,
[data-theme="white"] .text-amber-400 { color: #b45309; }
[data-theme="light"] .text-emerald-400,
[data-theme="white"] .text-emerald-400 { color: #047857; }

/* Theme CSS Custom Variables */
:root, [data-theme="dark"] {
  --ui-bg-main: #0a0a0a;
  --ui-bg-panel: #171717;
  --ui-bg-header: rgba(10, 10, 10, 0.85);
  --ui-bg-card: rgba(10, 10, 10, 0.6);
  --ui-bg-inner: #0a0a0a;
  --ui-bg-input: #171717;
  --ui-text-main: #f5f5f5;
  --ui-text-muted: #a3a3a3;
  --ui-text-sub: #737373;
  --ui-border: #262626;
  --ui-slider-track: rgba(255, 255, 255, 0.15);
  --ui-btn-active-bg: #262626;
  --ui-btn-active-text: #ffffff;
  --ui-btn-active-border: #404040;
  --ui-btn-inactive-text: #a3a3a3;
  --ui-btn-inactive-hover: #ffffff;
}

[data-theme="light"] {
  --ui-bg-main: #e5e5e5;
  --ui-bg-panel: #f5f5f5;
  --ui-bg-header: rgba(245, 245, 245, 0.9);
  --ui-bg-card: rgba(255, 255, 255, 0.7);
  --ui-bg-inner: #e5e5e5;
  --ui-bg-input: #ffffff;
  --ui-text-main: #0f172a;
  --ui-text-muted: #262626;
  --ui-text-sub: #404040;
  --ui-border: #d4d4d4;
  --ui-slider-track: rgba(0, 0, 0, 0.15);
  --ui-btn-active-bg: #ffffff;
  --ui-btn-active-text: #0f172a;
  --ui-btn-active-border: #a3a3a3;
  --ui-btn-inactive-text: #262626;
  --ui-btn-inactive-hover: #000000;
}

[data-theme="white"] {
  --ui-bg-main: #f8fafc;
  --ui-bg-panel: #ffffff;
  --ui-bg-header: rgba(255, 255, 255, 0.92);
  --ui-bg-card: #f8fafc;
  --ui-bg-inner: #f1f5f9;
  --ui-bg-input: #ffffff;
  --ui-text-main: #0f172a;
  --ui-text-muted: #1e293b;
  --ui-text-sub: #334155;
  --ui-border: #e2e8f0;
  --ui-slider-track: rgba(0, 0, 0, 0.15);
  --ui-btn-active-bg: #ffffff;
  --ui-btn-active-text: #0f172a;
  --ui-btn-active-border: #cbd5e1;
  --ui-btn-inactive-text: #1e293b;
  --ui-btn-inactive-hover: #000000;
}

/* ALL of this tool's own chrome */
html[data-theme="light"] #umd-bg-tool-mount.umd-brand {
  --ui-bg-main: #e5e5e5;
  --ui-bg-panel: #f5f5f5;
  --ui-bg-header: rgba(245, 245, 245, 0.9);
  --ui-bg-card: rgba(255, 255, 255, 0.7);
  --ui-bg-inner: #e5e5e5;
  --ui-bg-input: #ffffff;
  --ui-text-main: #0f172a;
  --ui-text-muted: #262626;
  --ui-text-sub: #404040;
  --ui-border: #d4d4d4;
  --ui-slider-track: rgba(0, 0, 0, 0.15);
  --ui-btn-active-bg: #ffffff;
  --ui-btn-active-text: #0f172a;
  --ui-btn-active-border: #a3a3a3;
  --ui-btn-inactive-text: #262626;
  --ui-btn-inactive-hover: #000000;
}
html[data-theme="dark"] #umd-bg-tool-mount.umd-brand {
  --ui-bg-main: #0a0a0a;
  --ui-bg-panel: #171717;
  --ui-bg-header: rgba(10, 10, 10, 0.85);
  --ui-bg-card: rgba(10, 10, 10, 0.6);
  --ui-bg-inner: #0a0a0a;
  --ui-bg-input: #171717;
  --ui-text-main: #f5f5f5;
  --ui-text-muted: #a3a3a3;
  --ui-text-sub: #737373;
  --ui-border: #262626;
  --ui-slider-track: rgba(255, 255, 255, 0.15);
  --ui-btn-active-bg: #262626;
  --ui-btn-active-text: #ffffff;
  --ui-btn-active-border: #404040;
  --ui-btn-inactive-text: #a3a3a3;
  --ui-btn-inactive-hover: #ffffff;
}

#umd-bg-tool-mount[data-theme="light"] #canvas-wrapper { --ui-bg-main: #ffffff; }
#umd-bg-tool-mount[data-theme="white"] #canvas-wrapper { --ui-bg-main: #f8fafc; }
#umd-bg-tool-mount[data-theme="dark"] #canvas-wrapper { --ui-bg-main: #0a0a0a; }

html[data-theme="dark"] #umd-bg-tool-mount .text-\[\#e21833\],
html[data-theme="dark"] #umd-bg-tool-mount .text-umd-red { color: #ff3355; }
html[data-theme="light"] #umd-bg-tool-mount .text-indigo-400 { color: #4f46e5; }
html[data-theme="light"] #umd-bg-tool-mount .text-amber-400 { color: #b45309; }
html[data-theme="light"] #umd-bg-tool-mount .text-emerald-400 { color: #047857; }

/* Helper Utility Classes */
.ui-bg-main { background-color: var(--ui-bg-main); }
.ui-bg-panel { background-color: var(--ui-bg-panel); }
.ui-bg-header { background-color: var(--ui-bg-header); }
.ui-bg-card { background-color: var(--ui-bg-card); }
.ui-bg-inner { background-color: var(--ui-bg-inner); }
.ui-bg-input { background-color: var(--ui-bg-input); }
.ui-text-main { color: var(--ui-text-main); }
.ui-text-muted { color: var(--ui-text-muted); }
.ui-border { border-color: var(--ui-border); }

/* Theme Buttons */
.theme-toggle-btn {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  color: var(--ui-text-main);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  opacity: 0.75;
}

.theme-toggle-btn.active,
.theme-toggle-btn:hover,
.theme-toggle-btn:focus,
.theme-btn-active {
  opacity: 1;
}

.theme-btn-active {
  background-color: var(--ui-btn-active-bg) !important;
  color: var(--ui-btn-active-text) !important;
  border-color: var(--ui-btn-active-border) !important;
  opacity: 1 !important;
}

.theme-btn-inactive {
  color: var(--ui-btn-inactive-text) !important;
  opacity: 0.75;
}

.theme-btn-inactive:hover,
.theme-btn-inactive:focus {
  color: var(--ui-btn-inactive-hover) !important;
  opacity: 1;
}

/* Custom Range Controls */
#umd-bg-tool-mount input[type=range] {
  -webkit-appearance: none;
  background: transparent;
}
#umd-bg-tool-mount input[type=range]:focus {
  outline: none;
}
#umd-bg-tool-mount input[type=range]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(226, 24, 51, 0.55);
  border-radius: 999px;
}
#umd-bg-tool-mount input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: var(--ui-slider-track);
  border-radius: 3px;
}
#umd-bg-tool-mount input[type=range]::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #e21833;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -5px;
  box-shadow: 0 0 6px rgba(226, 24, 51, 0.6);
  transition: transform 0.1s ease;
}

#umd-bg-tool-mount input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
#umd-bg-tool-mount input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Web components are layout-transparent */
background-controls { display: contents; }
background-engine { display: block; }

background-controls input[type=range] {
  -webkit-appearance: none;
  background: transparent;
}
background-controls input[type=range]:focus {
  outline: none;
}
background-controls input[type=range]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(226, 24, 51, 0.55);
  border-radius: 999px;
}
background-controls input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: var(--ui-slider-track);
  border-radius: 3px;
}
background-controls input[type=range]::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #e21833;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -5px;
  box-shadow: 0 0 6px rgba(226, 24, 51, 0.6);
  transition: transform 0.1s ease;
}
background-controls input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
background-controls input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Used by exporter.js while it rasterises a DOM overlay */
[data-exporting], [data-exporting] * {
  animation: none !important;
  transition: none !important;
}

/* Overlay design tokens */
:root, [data-theme="dark"] {
  --ov-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ov-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ov-card-bg: rgba(14, 14, 14, 0.93);
  --ov-card-border: rgba(255, 255, 255, 0.16);
  --ov-text: #f5f5f5;
  --ov-muted: #d0d0d0;
  --ov-accent: #e21833;
  --ov-accent-text: #ffd100;
  --ov-chip-bg: rgba(255, 255, 255, 0.10);
  --ov-head-bg: rgba(255, 255, 255, 0.09);
  --ov-row-alt: rgba(255, 255, 255, 0.05);
  --ov-row-line: rgba(255, 255, 255, 0.14);
  --ov-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] {
  --ov-card-bg: rgba(255, 255, 255, 0.94);
  --ov-card-border: rgba(0, 0, 0, 0.14);
  --ov-text: #111111;
  --ov-muted: #3f3f3f;
  --ov-accent: #e21833;
  --ov-accent-text: #b81227;
  --ov-chip-bg: rgba(0, 0, 0, 0.06);
  --ov-head-bg: rgba(0, 0, 0, 0.07);
  --ov-row-alt: rgba(0, 0, 0, 0.04);
  --ov-row-line: rgba(0, 0, 0, 0.14);
  --ov-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
[data-theme="white"] {
  --ov-card-bg: rgba(255, 255, 255, 0.97);
  --ov-card-border: #cbd5e1;
  --ov-text: #0f172a;
  --ov-muted: #334155;
  --ov-accent: #e21833;
  --ov-accent-text: #b81227;
  --ov-chip-bg: #f1f5f9;
  --ov-head-bg: #e2e8f0;
  --ov-row-alt: #f8fafc;
  --ov-row-line: #cbd5e1;
  --ov-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

/* Utility-page shell: sidebar + scaled stage */
.app-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--ui-bg-main);
  color: var(--ui-text-main);
  font-family: var(--ov-font);
}
.app-sidebar {
  background: var(--ui-bg-panel);
  border-right: 1px solid var(--ui-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}
.app-sidebar__head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-bg-header);
}
.app-sidebar__head h1 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ui-text-main);
}
.app-sidebar__head p {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 500;
  color: var(--ui-text-muted);
}
.app-sidebar__body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-sidebar__body--first { padding-top: 16px; }
.app-sidebar__body--first .app-section:first-child { padding-top: 0; border-top: 0; }
.app-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--ui-border);
}
.app-section__title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ui-text-muted);
}
.app-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-text-main);
}
.app-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--ui-bg-input);
  color: var(--ui-text-main);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
}
.app-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #e21833;
}
.app-input[type="file"] {
  padding: 5px 8px;
  cursor: pointer;
}
.app-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ui-text-muted);
}
.app-hint--warn { color: #d97706; }
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: #e21833;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px -8px rgba(226, 24, 51, 0.5);
}
.app-btn:hover { background: #b81227; }
.app-btn--dark {
  background: #262626;
  border-color: #404040;
  box-shadow: none;
}
.app-btn--dark:hover { background: #171717; }
.app-btn--ghost {
  background: transparent;
  color: var(--ui-text-main);
  border-color: var(--ui-border);
  box-shadow: none;
}
.app-btn--ghost:hover { background: var(--ui-bg-inner); }
.app-btn--small { padding: 6px 10px; font-size: 11px; width: auto; }
.app-btn:disabled { opacity: 0.55; cursor: progress; }
.app-btn:focus-visible,
.app-seg__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ui-bg-panel), 0 0 0 4px #e21833;
}
.app-btn-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.app-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--ui-bg-inner);
  border: 1px solid var(--ui-border);
  border-radius: 9999px;
}
.app-seg__btn {
  border: 0;
  border-radius: 9999px;
  padding: 7px 6px;
  background: transparent;
  color: var(--ui-btn-inactive-text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  text-align: center;
}
.app-seg__btn:hover { color: var(--ui-btn-inactive-hover); }
.app-seg__btn[aria-pressed="true"] {
  background: #e21833;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.app-seg__btn small { display: block; font-size: 9px; font-weight: 500; opacity: 0.85; }
.app-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.app-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; font-weight: 700; cursor: pointer; }
.app-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.app-switch__track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 11px; background: var(--ui-border, #888); transition: background .15s; }
.app-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.app-switch input:checked + .app-switch__track { background: #e21833; }
.app-switch input:checked + .app-switch__track::after { transform: translateX(18px); }
.app-switch input:focus-visible + .app-switch__track { outline: 2px solid #ffd200; outline-offset: 2px; }
.app-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.app-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 100vh;
  padding: 24px;
  background: var(--ui-bg-main);
}
.app-preview__meta {
  font-family: var(--ov-mono);
  font-size: 11px;
  color: var(--ui-text-muted);
}
.stage-frame {
  position: relative;
  flex: none;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--ui-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}
.stage {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  transform-origin: 0 0;
}
.stage-bg { position: absolute; inset: 0; }
.stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ov-font);
}
.stage [hidden] { display: none !important; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--ui-border);
  }
  .app-preview { min-height: 0; }
}

/* Zoom Waiting Room overlay */
.wr-card {
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 1440px;
  height: 810px;
  padding: 100px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 448px;
  column-gap: 88px;
  align-items: center;
  overflow: hidden;
  background: var(--ov-card-bg);
  border: 2px solid var(--ov-card-border);
  border-radius: 40px;
  box-shadow: var(--ov-shadow);
  color: var(--ov-text);
}
/* The real UMD "eyebrow" flag badge */
.wr-tag {
  display: inline-block;
  font-weight: 700;
  color: #000000;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  background-color: #FFD200;
  padding: 12px 32px;
  margin-bottom: 28px;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}
.wr-card__accent {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  background: var(--ov-accent);
}
.wr-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding-bottom: 40px;
  border-bottom: 3px solid var(--ov-accent);
}
.wr-title__pre {
  font-size: 44px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.2;
  margin-bottom: 6px;
}
.wr-title__main {
  font-size: 148px;
  line-height: 1.0;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.wr-title__sub {
  margin-top: 16px;
  font-size: 54px;
  line-height: 1.15;
  font-weight: 700;
  text-transform: uppercase;
}
.wr-subtitle {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 48px 0 0;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--ov-accent-text);
}
.wr-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ov-accent-text);
  animation: wr-dot 1.6s ease-in-out infinite;
}
.wr-pulse { animation: wr-pulse 2.4s ease-in-out infinite; }
@keyframes wr-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes wr-dot {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50% { transform: scale(1); opacity: 1; }
}
.wr-copy {
  margin: 32px 0 0;
  font-size: 30px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ov-muted);
}
.wr-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.wr-qr__frame {
  width: 400px;
  height: 400px;
  box-sizing: border-box;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 32px;
  /* Glassmorphic shell */
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.wr-qr__link {
  display: block;
  width: 100%;
  height: 100%;
}
.wr-qr__frame img { display: block; width: 100%; height: 100%; }
.wr-qr__url {
  margin: 0;
  max-width: 448px;
  text-align: center;
  font-family: var(--ov-mono);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 22px;
  border-radius: 999px;
}
.wr-qr__url a { color: inherit; text-decoration: none; }

/* Social graphic overlay */
.sg-panel {
  position: relative;
  flex: none;
  box-sizing: border-box;
  display: grid;
  overflow: hidden;
  background: var(--ov-card-bg);
  border: 2px solid var(--ov-card-border);
  border-radius: 40px;
  box-shadow: var(--ov-shadow);
  color: var(--ov-text);
}
.sg-accent {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  background: var(--ov-accent);
}
.sg-headline {
  grid-area: head;
  margin: 0;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.sg-subtitle {
  grid-area: sub;
  margin: 24px 0 0;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ov-accent-text);
  overflow-wrap: anywhere;
}
.sg-speaker { grid-area: speaker; }
.sg-avatar {
  display: block;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 8px solid var(--ov-accent);
  background: #6b7280;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
.sg-speaker__name { font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.sg-speaker__role { margin-top: 8px; font-weight: 500; line-height: 1.25; color: var(--ov-muted); overflow-wrap: anywhere; }
.sg-badge {
  grid-area: badge;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  padding: 24px 32px;
  border-radius: 24px;
  background: var(--ov-chip-bg);
  border: 2px solid var(--ov-card-border);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
}
.sg-badge__row { display: flex; align-items: center; gap: 18px; }
.sg-badge__row svg { flex: none; width: 36px; height: 36px; color: var(--ov-accent-text); }
.sg-badge__row span { min-width: 0; overflow-wrap: anywhere; }

/* 16:9 */
.stage[data-aspect="16x9"] .sg-panel {
  width: 1728px; height: 888px; padding: 84px 80px 72px;
  grid-template-columns: minmax(0, 1fr) 500px;
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "head speaker" "sub speaker" "badge speaker";
  column-gap: 72px;
}
.stage[data-aspect="16x9"] .sg-headline { font-size: 84px; }
.stage[data-aspect="16x9"] .sg-subtitle { font-size: 40px; }
.stage[data-aspect="16x9"] .sg-speaker { align-self: center; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage[data-aspect="16x9"] .sg-avatar { width: 380px; height: 380px; }
.stage[data-aspect="16x9"] .sg-speaker__name { margin-top: 32px; font-size: 48px; }
.stage[data-aspect="16x9"] .sg-speaker__role { font-size: 30px; }
.stage[data-aspect="16x9"] .sg-badge { justify-self: start; max-width: 100%; }

/* 1:1 */
.stage[data-aspect="1x1"] .sg-panel {
  width: 952px; height: 952px; padding: 76px 68px 60px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "head" "sub" "speaker" "badge";
}
.stage[data-aspect="1x1"] .sg-headline { font-size: 72px; }
.stage[data-aspect="1x1"] .sg-subtitle { font-size: 34px; }
.stage[data-aspect="1x1"] .sg-speaker { align-self: center; display: flex; flex-direction: row; align-items: center; gap: 36px; }
.stage[data-aspect="1x1"] .sg-avatar { width: 220px; height: 220px; }
.stage[data-aspect="1x1"] .sg-speaker__text { min-width: 0; }
.stage[data-aspect="1x1"] .sg-speaker__name { font-size: 44px; }
.stage[data-aspect="1x1"] .sg-speaker__role { font-size: 28px; }
.stage[data-aspect="1x1"] .sg-badge { font-size: 28px; }

/* 9:16 */
.stage[data-aspect="9x16"] .sg-panel {
  width: 936px; height: 1776px; padding: 96px 72px 72px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "head" "sub" "speaker" "badge";
}
.stage[data-aspect="9x16"] .sg-headline { font-size: 88px; }
.stage[data-aspect="9x16"] .sg-subtitle { font-size: 40px; }
.stage[data-aspect="9x16"] .sg-speaker { align-self: center; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage[data-aspect="9x16"] .sg-avatar { width: 460px; height: 460px; }
.stage[data-aspect="9x16"] .sg-speaker__name { margin-top: 36px; font-size: 56px; }
.stage[data-aspect="9x16"] .sg-speaker__role { font-size: 34px; }
.stage[data-aspect="9x16"] .sg-badge { font-size: 32px; }

.usd-app {
  --u-base: min(0.0520833vw, 0.0925926vh);
  --u: var(--u-base);
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--ui-bg-main);
  color: var(--ov-text);
  font-family: var(--ov-font);
}
.usd-bg { position: fixed; inset: 0; }
/* Presentation mode */
.usd-app.is-idle, .usd-app.is-idle * { cursor: none !important; }
.usd-main {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  height: 100%;
  padding: calc(var(--u) * 40) calc(var(--u) * 56) calc(var(--u) * 44);
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--u) * 640);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: calc(var(--u) * 64);
  row-gap: calc(var(--u) * 24);
}
/* Nothing coming up */
.usd-main[data-agenda="none"] { grid-template-columns: minmax(0, 1fr); }
.usd-main[data-agenda="none"] .usd-agenda { display: none; }
.usd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.usd-brand {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 18);
  font-size: calc(var(--u) * 24);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.usd-brand__mark {
  width: calc(var(--u) * 14);
  height: calc(var(--u) * 44);
  border-radius: calc(var(--u) * 4);
  background: var(--ov-accent);
}
.usd-hero, .usd-agenda { --u: calc(var(--u-base) * var(--fit, 1)); }
.usd-card {
  background: var(--ov-card-bg);
  border: 2px solid var(--ov-card-border);
  border-radius: calc(var(--u) * 32);
  box-shadow: var(--ov-shadow);
}
.usd-hero {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: calc(var(--u) * 26);
  min-height: 0;
  overflow: hidden;
}
/* The session title is the star */
.usd-hero__title {
  margin: 0;
  font-size: calc(var(--u) * 88 * var(--tfit, 1));
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.015em;
}
/* Only shown when the session is not today */
.usd-when { font-size: calc(var(--u) * 32); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ov-accent-text); }
.usd-presenter__name { font-size: calc(var(--u) * 34); font-weight: 700; line-height: 1.15; }
.usd-presenter__role { margin-top: calc(var(--u) * 4); font-size: calc(var(--u) * 24); color: var(--ov-muted); line-height: 1.2; }
.usd-desc { margin: 0; max-width: 60ch; font-size: calc(var(--u) * 26); line-height: 1.45; color: var(--ov-muted); }
.usd-note { margin: 0; font-size: calc(var(--u) * 24); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ov-muted); }

/* Coming up: a short list, not a table */
.usd-agenda {
  grid-column: 2;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  justify-content: center;
}
.usd-agenda__heading {
  margin: 0;
  font-size: calc(var(--u) * 40);
  line-height: 1.1;
  font-weight: 800;
  color: var(--ov-accent-text);
}
.usd-agenda__hint {
  margin: calc(var(--u) * 10) 0 0;
  font-size: calc(var(--u) * 20);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ov-muted);
}
.usd-agenda__empty { margin: calc(var(--u) * 24) 0 0; font-size: calc(var(--u) * 28); color: var(--ov-muted); }
.usd-list { list-style: none; margin: calc(var(--u) * 18) 0 0; padding: 0; display: flex; flex-direction: column; }
.usd-item {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 24);
  padding: calc(var(--u) * 16) 0;
  border-top: 1px solid var(--ov-row-line);
}
.usd-item__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.usd-item__time { font-size: calc(var(--u) * 36); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ov-accent-text); }
.usd-item__title { margin-top: calc(var(--u) * 6); font-size: calc(var(--u) * 30); font-weight: 700; line-height: 1.2; }
.usd-item__by { margin-top: calc(var(--u) * 6); font-size: calc(var(--u) * 22); line-height: 1.2; color: var(--ov-muted); }
.usd-item__qr { flex: none; display: block; width: calc(var(--u) * 104); height: calc(var(--u) * 104); }
.usd-empty-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(var(--u) * 20);
}

.usd-toggle {
  position: fixed;
  z-index: 20;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid var(--ui-border);
  background: var(--ui-bg-panel);
  color: var(--ui-text-main);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, left 0.25s ease;
}
.usd-toggle:hover,
.usd-toggle:focus-visible { opacity: 1; outline: none; box-shadow: 0 0 0 2px #e21833; }
.usd-app[data-sidebar="open"] .usd-toggle { opacity: 1; left: 354px; }
.usd-sidebar {
  position: fixed;
  z-index: 15;
  top: 0;
  left: 0;
  bottom: 0;
  width: 340px;
  max-width: 90vw;
  overflow-y: auto;
  background: var(--ui-bg-panel);
  color: var(--ui-text-main);
  border-right: 1px solid var(--ui-border);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  transform: translateX(-104%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
}
.usd-app[data-sidebar="open"] .usd-sidebar {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease, visibility 0s;
}
/* Portrait screens */
@media (orientation: portrait) and (min-width: 901px) {
  .usd-app { --u-base: 0.0694444vw; } /* a vertical screen has room for larger type */
  .usd-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 3fr) minmax(0, 2fr); }
  .usd-main[data-agenda="none"] { grid-template-rows: auto minmax(0, 1fr); }
  .usd-agenda { grid-column: 1; grid-row: 3; }
}
@media (max-width: 900px) {
  .usd-app { --u-base: 0.16vw; height: auto; min-height: 100vh; overflow: visible; }
  .usd-main { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .usd-agenda { grid-column: 1; grid-row: auto; }
  .usd-hero, .usd-agenda { overflow: visible; }
}
