:root {
  --ink: #172033;
  --muted: #5b677a;
  --line: #d8e0eb;
  --shell: #eef2f7;
  --panel: #ffffff;
  --ribbon: #f7f8fb;
  --navy: #0c1222;
  --blue: #2f6df6;
  --orange: #f05f2c;
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

.powerpoint-preview {
  display: grid;
  min-height: 100vh;
  grid-template-rows: 52px 94px minmax(0, 1fr) 30px;
}

.preview-titlebar,
.ribbon,
.preview-status {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.preview-titlebar {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 0 18px;
}

.preview-brand,
.document-title,
.return-link {
  display: inline-flex;
  align-items: center;
}

.preview-brand {
  gap: 10px;
  font-weight: 850;
}

.preview-brand img {
  width: 34px;
  height: 34px;
}

.document-title {
  justify-self: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.document-title strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.return-link {
  min-height: 34px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--navy);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
}

.ribbon {
  padding: 0 18px 14px;
}

.ribbon-tabs {
  display: flex;
  gap: 24px;
  height: 38px;
  align-items: center;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}

.ribbon-tabs span {
  display: inline-flex;
  height: 100%;
  align-items: center;
  border-bottom: 2px solid transparent;
}

.ribbon-tabs .is-active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.ribbon-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 40px;
}

.ribbon-tools span {
  width: 72px;
  height: 28px;
  background: #e8edf5;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.ribbon-tools .wide {
  width: 136px;
}

.workspace-shell {
  display: grid;
  min-height: 0;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 0;
}

.slide-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 18px 12px;
  overflow: auto;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}

.slide-thumb {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.slide-thumb.is-active .thumb-canvas {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(240, 95, 44, 0.16);
}

.thumb-canvas {
  display: grid;
  gap: 6px;
  aspect-ratio: 16 / 9;
  padding: 9px;
  background: #ffffff;
  border: 2px solid #dce4ef;
  border-radius: 4px;
}

.thumb-canvas i {
  display: block;
  height: 7px;
  background: #cad5e5;
  border-radius: 999px;
}

.thumb-canvas i:first-child {
  width: 72%;
  background: var(--blue);
}

.thumb-canvas i:nth-child(2) {
  width: 52%;
  background: var(--orange);
}

.thumb-canvas-muted i:first-child {
  width: 64%;
  background: #94a3b8;
}

.slide-stage {
  min-width: 0;
  min-height: 0;
  padding: clamp(16px, 2vw, 30px);
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    #eef2f7;
  background-size: 24px 24px;
}

.slide-frame {
  width: min(100%, 1600px);
  min-width: 980px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #c8d3e3;
  border-radius: 4px;
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.18);
}

.deckforge-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.preview-status {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

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

@media (max-width: 980px) {
  .powerpoint-preview {
    grid-template-rows: auto auto minmax(0, 1fr) 30px;
  }

  .preview-titlebar {
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
  }

  .document-title {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .ribbon {
    padding: 0 14px 12px;
  }

  .ribbon-tabs {
    gap: 14px;
    overflow: hidden;
  }

  .ribbon-tabs span:nth-child(n + 5),
  .ribbon-tools span:nth-child(n + 4) {
    display: none;
  }

  .workspace-shell {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .slide-frame {
    min-width: 840px;
  }
}

@media (max-width: 640px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .slide-rail {
    grid-auto-flow: column;
    grid-auto-columns: 116px;
    grid-template-columns: none;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .slide-stage {
    padding: 12px;
  }

  .slide-frame {
    min-width: 760px;
  }
}
