:root {
  color-scheme: dark;
  --bg: #0d1113;
  --surface: #151a1d;
  --surface-2: #1d2428;
  --surface-3: #252d31;
  --text: #f4f4f1;
  --muted: #aeb7b5;
  --line: #354247;
  --accent: #7bd389;
  --accent-strong: #aee66f;
  --danger: #ff7a6e;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
.button-link {
  font: inherit;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  background: var(--accent);
  color: #08130b;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.secondary,
button.tab,
button.icon-button,
.button-link.secondary {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

button.danger {
  color: #230604;
  background: var(--danger);
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #0f1416;
  color: var(--text);
}

input[type="range"] {
  padding: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.app-shell {
  width: min(1440px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 28px;
}

.unsupported-shell {
  display: grid;
  place-items: center;
  width: min(860px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
}

.unsupported-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 60px var(--shadow);
  padding: clamp(22px, 5vw, 44px);
}

.unsupported-copy {
  max-width: 62ch;
  margin: 16px 0 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.unsupported-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar,
.status-strip,
.tabs,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 60px var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-actions,
.inline-actions,
.remote-pad {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-strip span {
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
}

.tab {
  flex: 1;
}

.tab.active {
  color: #08130b;
  background: var(--accent);
}

#blankPresentationButton.active {
  color: #08130b;
  background: var(--accent);
}

.view-panel {
  display: none;
  margin-top: 14px;
}

.view-panel.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 14px;
}

.tool-panel {
  min-height: 280px;
  padding: 16px;
}

.side-panel {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

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

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 1.7rem;
  line-height: 1;
}

.slide-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050708;
}

.slide-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide-preview figcaption {
  color: var(--muted);
}

.note-text {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.slide-list,
.playlist-list {
  display: grid;
  gap: 8px;
}

.slide-list-item,
.playlist-item {
  display: grid;
  width: 100%;
  min-height: 52px;
  justify-items: start;
  gap: 4px;
  padding: 10px;
  color: var(--text);
  text-align: left;
  background: var(--surface-2);
  border-color: var(--line);
}

.slide-list-item.active,
.playlist-item.active {
  border-color: var(--accent);
  background: #1f3026;
}

.slide-list-item span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.speed-control,
.config-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.speed-control span,
.config-grid label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.config-grid {
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  align-items: end;
}

.config-grid label {
  display: grid;
  gap: 6px;
}

.teleprompter-scroll {
  height: min(58vh, 680px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34vh 22px 46vh;
  background: #0a0d0e;
  scroll-behavior: auto;
}

.prompt-line {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid transparent;
  color: var(--text);
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  line-height: 1.45;
}

.prompt-line.active {
  border-left-color: var(--accent);
  background: #1e2a22;
}

.remote-pad {
  margin-top: 16px;
}

.remote-pad button {
  flex: 1 1 120px;
}

.advanced {
  margin-top: 18px;
  color: var(--muted);
}

.advanced summary {
  cursor: pointer;
  font-weight: 750;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.toggle-row input {
  width: auto;
  min-height: auto;
}

.target-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.target-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  opacity: 1;
  background: #000;
}

.target-page {
  overflow: hidden;
  background: #000;
}

.target-stage {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  color: #f2f2f2;
}

.target-blank {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #7a7a7a;
  font-size: clamp(1rem, 2vw, 1.6rem);
}

.target-slide {
  width: 100%;
  height: 100%;
  background: #000;
}

.target-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.target-prompt {
  width: 100%;
  height: 100%;
  background: #111;
  filter: grayscale(1);
}

.target-prompt-scroll {
  height: 100%;
  overflow: hidden;
  padding: 34vh 7vw 46vh;
}

.target-prompt-line {
  margin: 0;
  padding: 1.4vh 1.2vw;
  border-left: 0.35vw solid transparent;
  color: #f2f2f2;
  font-size: clamp(2rem, 4.6vw, 5.6rem);
  line-height: 1.28;
}

.target-prompt-line.active {
  border-left-color: #fff;
  background: #303030;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar,
  .workspace-grid,
  .status-strip,
  .config-grid,
  .speed-control {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .project-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-grid {
    display: grid;
  }

  .side-panel {
    max-height: none;
  }
}
