
:root {
  --bg: #0f1720;
  --panel: #16212c;
  --panel-2: #1b2835;
  --text: #ecf2f8;
  --muted: #9fb0c0;
  --accent: #4da3ff;
  --accent-2: #81c1ff;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 18px 55px rgba(0,0,0,0.38);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #0a1118 0%, var(--bg) 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
}
.sidebar {
  background: rgba(15, 23, 32, 0.92);
  border-right: 1px solid var(--border);
  padding: 24px 18px 18px;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(10px);
}
.brand-block h1 {
  margin: 8px 0 12px;
  font-size: 2rem;
  line-height: 1.08;
}
.deck-subtitle, .current-subtitle, .help-bar p {
  color: var(--muted);
  line-height: 1.5;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  font-size: 0.76rem;
  margin: 0;
}
.sidebar-actions {
  display: grid;
  gap: 10px;
  margin: 20px 0 24px;
}
.action-btn, .nav-btn, .icon-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: 0.2s ease;
}
.action-btn {
  padding: 12px 14px;
  font-weight: bold;
  text-align: center;
}
.action-btn:hover, .nav-btn:hover, .icon-btn:hover, .slide-link:hover {
  border-color: rgba(129, 193, 255, 0.5);
  transform: translateY(-1px);
}
.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.toc-header h2 {
  margin: 0;
  font-size: 1rem;
}
.slide-list {
  display: grid;
  gap: 10px;
}
.slide-link {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  color: var(--text); /* Buttons otherwise inherit the browser's dark text color. */
  text-align: left;
  cursor: pointer;
}
.slide-link.active {
  background: linear-gradient(180deg, rgba(77,163,255,0.18), rgba(77,163,255,0.08));
  border-color: rgba(129, 193, 255, 0.65);
}
.slide-link img {
  width: 100%;
  border-radius: 8px;
  display: block;
  background: #fff;
}
.slide-meta {
  min-width: 0;
}
.slide-num {
  display: block;
  color: var(--accent-2);
  font-size: 0.78rem;
  margin-bottom: 4px;
}
.slide-title {
  display: block;
  color: #f3f7fc;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 5px;
  overflow-wrap: break-word;
}
.slide-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.main-stage {
  padding: 24px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.topbar h2 {
  margin: 6px 0 4px;
  font-size: 1.6rem;
  line-height: 1.15;
}
.topbar-actions, .control-group {
  display: flex;
  gap: 10px;
  align-items: center;
}
.icon-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 1.25rem;
}
.mobile-only, .mobile-close { display: none; }
.viewer-wrap {
  min-height: 0;
  display: grid;
  align-items: start;
}
.slide-frame {
  margin: 0;
  width: 100%;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 235px);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 8px;
}
.slide-frame img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  background: transparent;
}
.control-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}
.nav-btn {
  padding: 12px 14px;
  font-weight: bold;
}
.status-block {
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.counter-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
.progress-range {
  width: 100%;
}
.help-bar {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(92vw, 400px);
    transform: translateX(-104%);
    transition: transform 0.25s ease;
    z-index: 15;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-only, .mobile-close { display: inline-flex; }
  .mobile-close {
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
  }
  .main-stage { padding: 18px; }
}
@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-actions { align-self: flex-end; }
  .control-bar {
    grid-template-columns: 1fr;
  }
  .control-group, .control-group.right {
    justify-content: space-between;
  }
  .slide-frame { max-height: calc(100vh - 315px); }
  .slide-frame img { max-height: 100%; }
  .brand-block h1 { font-size: 1.7rem; }
  .topbar h2 { font-size: 1.3rem; }
}
