/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-base: #FFFFFF;
  --c-main: #000000;
  --c-accent: #FF0000;
  --c-gray: #666666;
  --c-light: #F5F5F5;
  --c-border: #E0E0E0;
  --c-base-dim: #F0F2F5;
  --c-main-light: rgba(0, 0, 0, 0.06);
  --c-accent-light: rgba(255, 0, 0, 0.08);
  --c-accent-dark: #CC0000;
  --c-card-shadow: rgba(0, 0, 0, 0.06);
  --font-main: "Noto Sans JP", sans-serif;
  --safe-x: 7%;
  --safe-y: 5%;
  --radius: 0.6cqw;
  --shadow: 0 0.2cqw 1.2cqw var(--c-card-shadow);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--c-base);
  font-family: var(--font-main);
  color: var(--c-main);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== Slide Stage ===== */
.slide-stage {
  width: 100vw; height: 100vh;
  display: grid; place-items: center;
  background: var(--c-base);
  position: relative;
}

.slide {
  width: 100vw; height: 100vh;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  margin: auto;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: var(--c-base);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  container-type: inline-size;
}
.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-content {
  width: 100%; height: 100%;
  padding: var(--safe-y) var(--safe-x);
  display: flex; flex-direction: column;
  justify-content: center;
  position: relative;
}

/* ===== Typography (cqw units) ===== */
.slide-hero   { font-size: max(7cqw, 28px); font-weight: 900; line-height: 1.2; letter-spacing: -0.02em; }
.slide-h1     { font-size: max(5.2cqw, 22px); font-weight: 700; line-height: 1.25; }
.slide-h2     { font-size: max(4.2cqw, 20px); font-weight: 700; line-height: 1.3; }
.slide-h3     { font-size: max(3cqw, 16px); font-weight: 500; line-height: 1.4; }
.slide-body   { font-size: max(2.4cqw, 14px); font-weight: 400; line-height: 1.7; letter-spacing: 0.02em; }
.slide-caption { font-size: max(1.6cqw, 12px); font-weight: 400; color: var(--c-gray); }
.slide-micro  { font-size: max(1.2cqw, 11px); font-weight: 400; color: var(--c-gray); }
.slide-hero, .slide-h1, .slide-h2 { text-wrap: balance; }
.slide-h3, .slide-body, .slide-caption { text-wrap: pretty; }

/* ===== Layout: Title ===== */
.layout-title .slide-content {
  align-items: center; text-align: center; gap: 2.5cqw;
}
.layout-title .title-accent-line {
  width: 6cqw; height: 0.4cqw;
  background: var(--c-accent);
  border-radius: 2px;
}
.layout-title .slide-body { color: var(--c-gray); }

/* ===== Layout: Section (Bridge) ===== */
.layout-section {
  background: var(--c-main) !important;
}
.layout-section .slide-content {
  align-items: center; text-align: center; gap: 2cqw;
}
.layout-section .slide-h1 { color: var(--c-base); }
.layout-section .section-line {
  width: 5cqw; height: 0.3cqw;
  background: var(--c-accent);
  border-radius: 2px;
}

/* ===== Layout: Statement ===== */
.layout-statement .slide-content {
  align-items: flex-start; gap: 2.5cqw;
  padding-left: 10%;
}
.layout-statement .accent-bar {
  width: 0.5cqw; height: 100%;
  background: var(--c-accent);
  position: absolute; left: 0; top: 0;
}
.layout-statement .slide-body { color: var(--c-gray); max-width: 75%; }

/* ===== Layout: Center ===== */
.layout-center .slide-content {
  align-items: center; text-align: center; gap: 2cqw;
}
.layout-center .headline-underline {
  width: 4cqw; height: 0.25cqw;
  background: var(--c-accent);
  margin-top: -0.5cqw;
  border-radius: 2px;
}
.layout-center .items-list {
  display: flex; flex-direction: column; gap: 1.2cqw;
  align-items: center;
}
.layout-center .item-row {
  display: flex; align-items: center; gap: 1cqw;
}
.layout-center .item-icon {
  width: 3.5cqw; height: 3.5cqw;
  display: flex; align-items: center; justify-content: center;
  font-size: 2cqw; font-weight: 700;
  color: var(--c-accent);
}
.layout-center .slide-body {
  max-width: 70%;
}

/* ===== Layout: Left-Right ===== */
.layout-left-right .slide-content {
  flex-direction: row; align-items: center; gap: 4cqw;
}
.layout-left-right .lr-left {
  flex: 1; display: flex; flex-direction: column; gap: 1.5cqw;
}
.layout-left-right .lr-right {
  flex: 0 0 38%;
  background: var(--c-light);
  border-radius: var(--radius);
  padding: 3cqw;
  border-left: 0.3cqw solid var(--c-accent);
  box-shadow: var(--shadow);
}
.layout-left-right .lr-right .accent-text {
  font-size: max(2.6cqw, 14px); font-weight: 700;
  line-height: 1.5;
  color: var(--c-main);
}
.layout-left-right .lr-items {
  display: flex; flex-wrap: wrap; gap: 0.8cqw;
}
.layout-left-right .lr-item-tag {
  background: var(--c-light);
  padding: 0.6cqw 1.2cqw;
  border-radius: 4px;
  font-size: max(2cqw, 13px); font-weight: 500;
}

/* ===== Layout: Profile ===== */
.layout-profile .slide-content {
  flex-direction: row; align-items: center; gap: 4cqw;
}
.layout-profile .profile-photo {
  flex: 0 0 30%;
  aspect-ratio: 1;
  background: var(--c-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 6cqw; font-weight: 900;
  color: var(--c-accent);
  border: 0.3cqw solid var(--c-border);
}
.layout-profile .profile-photo-img {
  flex: 0 0 30%;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 0.3cqw solid var(--c-border);
}
.layout-profile .profile-info {
  flex: 1; display: flex; flex-direction: column; gap: 1.5cqw;
}
.layout-profile .profile-accent {
  display: inline-block;
  background: var(--c-accent);
  color: var(--c-base);
  padding: 0.8cqw 1.8cqw;
  border-radius: var(--radius);
  font-size: max(3cqw, 16px); font-weight: 700;
}

/* ===== Layout: Grid-3 ===== */
.layout-grid-3 .slide-content {
  align-items: center; gap: 2.1cqw;
}
.layout-grid-3 .slide-h2 {
  font-size: max(3.7cqw, 19px);
}
.layout-grid-3 .grid-container {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1.6cqw; width: 92%;
}
.layout-grid-3 .grid-card {
  background: var(--c-light);
  border-radius: var(--radius);
  min-height: 18.5cqw;
  padding: 1.8cqw 1.4cqw 2cqw;
  text-align: center;
  display: flex; flex-direction: column;
  justify-content: center;
  align-items: center; gap: 1cqw;
  box-shadow: var(--shadow);
  border-top: 0.3cqw solid var(--c-accent);
}
.layout-grid-3 .grid-icon {
  width: 4.4cqw; height: 4.4cqw;
  border-radius: 50%;
  background: var(--c-main);
  color: var(--c-base);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2cqw;
}
.layout-grid-3 .grid-label {
  display: block;
  width: 100%;
  max-width: 14cqw;
  font-size: max(2cqw, 14px); font-weight: 700; line-height: 1.35;
  text-wrap: balance;
  line-break: strict;
}
.layout-grid-3 .slide-body {
  max-width: 84%;
  text-align: center;
  font-size: max(2.35cqw, 14px); font-weight: 700;
  color: var(--c-accent);
}

/* ===== Layout: Grid-4 ===== */
.layout-grid-4 .slide-content {
  align-items: center; gap: 2cqw;
}
.layout-grid-4 .slide-h2 {
  font-size: max(3.7cqw, 19px);
}
.layout-grid-4 .grid-container {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.6cqw; width: 90%;
}
.layout-grid-4 .grid-card {
  background: var(--c-light);
  border-radius: var(--radius);
  padding: 1.5cqw 1.7cqw;
  display: flex; align-items: center; gap: 1.5cqw;
  box-shadow: var(--shadow);
  border-left: 0.3cqw solid var(--c-accent);
}
.layout-grid-4 .grid-number {
  font-size: max(4.5cqw, 20px); font-weight: 900;
  color: var(--c-accent);
  flex: 0 0 auto;
  min-width: 5cqw; text-align: center;
}
.layout-grid-4 .grid-label {
  font-size: max(1.95cqw, 13px); font-weight: 700; line-height: 1.4;
  text-wrap: pretty;
}

/* ===== Layout: Flow ===== */
.layout-flow .slide-content {
  align-items: center; gap: 2cqw;
}
.layout-flow .slide-h2 {
  font-size: max(3.7cqw, 19px);
}
.layout-flow .flow-container {
  display: flex; align-items: center; gap: 0.8cqw;
  width: 96%;
}
.layout-flow .flow-step {
  flex: 1;
  background: var(--c-light);
  border-radius: var(--radius);
  min-height: 10.5cqw;
  padding: 1.2cqw 0.9cqw;
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.8cqw;
  box-shadow: var(--shadow);
  border-top: 0.3cqw solid var(--c-accent);
}
.layout-flow .flow-number {
  width: 3.6cqw; height: 3.6cqw;
  border-radius: 50%;
  background: var(--c-accent);
  color: var(--c-base);
  display: flex; align-items: center; justify-content: center;
  font-size: max(1.8cqw, 13px); font-weight: 900;
}
.layout-flow .flow-label {
  font-size: max(1.75cqw, 12px); font-weight: 700; line-height: 1.35;
  text-wrap: balance;
}
.layout-flow .flow-arrow {
  font-size: max(2.4cqw, 14px); color: var(--c-gray); flex: 0 0 auto;
}

/* ===== Layout: Prompt ===== */
.layout-prompt .slide-content {
  align-items: center; gap: 2cqw;
}
.layout-prompt .slide-h2 {
  font-size: max(3.6cqw, 18px);
  text-align: center;
}
.layout-prompt .prompt-box {
  width: 84%;
  background: #1A1A2E;
  color: #E0E0E0;
  border-radius: var(--radius);
  padding: 2cqw 8cqw 2.2cqw 2.6cqw;
  font-family: "Noto Sans JP", monospace;
  font-size: max(1.65cqw, 13px);
  line-height: 1.75;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
}
.layout-prompt .prompt-text {
  white-space: pre-wrap;
}
.layout-prompt .prompt-box::before {
  content: "PROMPT";
  position: absolute;
  top: -1.2cqw; left: 2cqw;
  background: var(--c-accent);
  color: var(--c-base);
  font-size: max(1.2cqw, 11px); font-weight: 700;
  padding: 0.2cqw 0.8cqw;
  border-radius: 3px;
  letter-spacing: 0.1em;
}
.layout-prompt .copy-btn {
  position: absolute;
  top: 1cqw; right: 1.5cqw;
  background: rgba(255,255,255,0.15);
  color: #E0E0E0;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 0.3cqw;
  padding: 0.4cqw 1.2cqw;
  font-size: max(1.2cqw, 11px);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-main);
}
.layout-prompt .copy-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* ===== Layout: Comparison ===== */
.layout-comparison .slide-content {
  align-items: center; gap: 2cqw;
}
.layout-comparison .comparison-container {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2.5cqw; width: 85%;
}
.layout-comparison .comp-card {
  border-radius: var(--radius);
  padding: 2.5cqw;
  box-shadow: var(--shadow);
}
.layout-comparison .comp-before {
  background: var(--c-light);
  border-top: 0.3cqw solid var(--c-gray);
}
.layout-comparison .comp-after {
  background: #FFF5F5;
  border-top: 0.3cqw solid var(--c-accent);
}
.layout-comparison .comp-label {
  font-size: max(1.6cqw, 12px); font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.2cqw;
  color: var(--c-gray);
}
.layout-comparison .comp-after .comp-label { color: var(--c-accent); }
.layout-comparison .comp-text {
  font-size: max(2cqw, 13px); line-height: 1.8;
}
.layout-comparison .comp-bottom {
  text-align: center;
  font-size: max(2.8cqw, 15px); font-weight: 700;
  color: var(--c-accent);
}

/* ===== Layout: Table ===== */
.layout-table .slide-content {
  align-items: center; gap: 2cqw;
}
.layout-table table {
  width: 80%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.layout-table th {
  background: var(--c-main);
  color: var(--c-base);
  padding: 1.2cqw 1.5cqw;
  font-size: max(1.8cqw, 13px); font-weight: 700;
  text-align: center;
}
.layout-table td {
  padding: 1cqw 1.5cqw;
  font-size: max(1.8cqw, 13px);
  text-align: center;
  border-bottom: 1px solid var(--c-border);
}
.layout-table tr:nth-child(even) td { background: var(--c-light); }
.layout-table td:first-child {
  font-weight: 700; text-align: left;
}
.layout-table .cell-strong { color: var(--c-accent); font-weight: 900; font-size: max(2.2cqw, 15px); }
.layout-table .cell-normal { font-weight: 500; }
.layout-table .cell-weak   { color: var(--c-gray); }

/* ===== Layout: Timeline ===== */
.layout-timeline .slide-content {
  align-items: center; gap: 2.5cqw;
}
.layout-timeline .timeline-container {
  width: 80%;
  display: flex; flex-direction: column; gap: 1.5cqw;
  position: relative;
  padding-left: 3cqw;
}
.layout-timeline .timeline-container::before {
  content: "";
  position: absolute; left: 1cqw; top: 0; bottom: 0;
  width: 0.2cqw;
  background: var(--c-accent);
}
.layout-timeline .timeline-item {
  display: flex; align-items: center; gap: 2cqw;
  background: var(--c-light);
  padding: 1.5cqw 2cqw;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.layout-timeline .timeline-item::before {
  content: "";
  position: absolute; left: -2.3cqw;
  width: 1cqw; height: 1cqw;
  background: var(--c-accent);
  border-radius: 50%;
}
.layout-timeline .timeline-period {
  font-size: max(2.2cqw, 14px); font-weight: 900;
  color: var(--c-accent);
  flex: 0 0 auto; min-width: 10cqw;
}
.layout-timeline .timeline-label {
  font-size: max(2.2cqw, 14px); font-weight: 500;
}

/* ===== Layout: Numbered ===== */
.layout-numbered .slide-content {
  align-items: center; gap: 1.5cqw;
  justify-content: center;
}
.layout-numbered .numbered-list {
  width: 80%;
  display: flex; flex-direction: column; gap: 1.2cqw;
}
.layout-numbered .numbered-item {
  display: flex; align-items: center; gap: 1.5cqw;
  background: var(--c-light);
  padding: 1.5cqw 2cqw;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 0.3cqw solid var(--c-accent);
}
.layout-numbered .numbered-number {
  font-size: max(4.5cqw, 20px); font-weight: 900;
  color: var(--c-accent);
  flex: 0 0 auto; min-width: 5cqw; text-align: center;
}
.layout-numbered .numbered-label {
  font-size: max(2.4cqw, 14px); font-weight: 700; line-height: 1.5;
}

/* ===== Layout: Quote ===== */
.layout-quote {
  background: var(--c-light) !important;
}
.layout-quote .slide-content {
  align-items: center; text-align: center; gap: 2cqw;
}
.layout-quote .quote-mark {
  font-size: 18cqw; font-weight: 900;
  color: var(--c-accent);
  line-height: 0.6;
  opacity: 0.2;
  margin-bottom: -2cqw;
}
.layout-quote .slide-h1 {
  max-width: 80%;
  font-style: italic;
}
.layout-quote .quote-author {
  font-size: max(2.4cqw, 14px);
  font-weight: 500;
  color: var(--c-gray);
  letter-spacing: 0.1em;
}

/* ===== Layout: Big Number ===== */
.layout-big-number .slide-content {
  align-items: center; gap: 3cqw;
}
.layout-big-number .bignumber-container {
  display: flex; gap: 5cqw;
  align-items: baseline;
  justify-content: center;
  width: 90%;
}
.layout-big-number .bignumber-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 0.8cqw;
}
.layout-big-number .bignumber-value {
  font-size: clamp(28px, 5.5cqw, 6.5cqw);
  font-weight: 900;
  color: var(--c-accent);
  line-height: 1;
  white-space: nowrap;
}
.layout-big-number .bignumber-label {
  font-size: max(2.2cqw, 14px);
  font-weight: 500;
  color: var(--c-gray);
}

/* ===== Layout: Photo Statement ===== */
.layout-photo-statement .slide-content {
  flex-direction: row; align-items: center; gap: 4cqw;
}
.layout-photo-statement .ps-text {
  flex: 1; display: flex; flex-direction: column; gap: 2cqw;
}
.layout-photo-statement .ps-photo {
  flex: 0 0 35%;
  display: flex; align-items: center; justify-content: center;
}
.layout-photo-statement .ps-photo img {
  width: 100%;
  border-radius: 1.5cqw;
  box-shadow: 0 0.4cqw 2cqw rgba(0,0,0,0.12);
}

/* ===== Layout: Photo Full (全面写真+オーバーレイ) ===== */
.layout-photo-full {
  background: var(--c-main) !important;
}
.layout-photo-full .slide-content {
  padding: 0; position: relative;
  justify-content: flex-end;
}
.layout-photo-full .pf-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.35;
}
.layout-photo-full .pf-text {
  position: relative; z-index: 1;
  padding: 5% 7% 8%;
  display: flex; flex-direction: column; gap: 1.5cqw;
}
.layout-photo-full .slide-h1 { color: var(--c-base); }
.layout-photo-full .slide-body { color: rgba(255,255,255,0.8); }

/* ===== Layout: Photo Half (半面写真+テキスト) ===== */
.layout-photo-half .slide-content {
  flex-direction: row; padding: 0;
}
.layout-photo-half .ph-image {
  flex: 0 0 45%; height: 100%;
  background-size: cover; background-position: center;
}
.layout-photo-half .ph-text {
  flex: 1; padding: 5% 7%;
  display: flex; flex-direction: column;
  justify-content: center; gap: 2cqw;
}

/* ===== Layout: Photo Partial (部分写真カード) ===== */
.layout-photo-partial .slide-content {
  align-items: center; gap: 2cqw;
}
.layout-photo-partial .pp-image {
  width: 40%; aspect-ratio: 16/9;
  background-size: cover; background-position: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== Layout: Accent Section ===== */
.layout-accent-section {
  background: var(--c-accent) !important;
}
.layout-accent-section .slide-content {
  align-items: center; text-align: center; gap: 2cqw;
}
.layout-accent-section .slide-h1 {
  color: var(--c-base);
}
.layout-accent-section .slide-body {
  color: rgba(255,255,255,0.8);
}

/* ===== Layout: Screenshot ===== */
.layout-screenshot .slide-content {
  align-items: center; gap: 1cqw;
}
.layout-screenshot .slide-h2 {
  font-size: max(3.6cqw, 18px);
}
.layout-screenshot .screenshot-container {
  width: min(54%, 42cqw);
  height: 56%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.layout-screenshot .screenshot-img {
  width: auto;
  height: 100%;
  max-width: 100%;
  display: block;
  object-fit: contain;
  object-position: top;
}
.layout-screenshot .screenshot-link {
  display: contents;
  cursor: pointer;
}
.layout-screenshot .screenshot-link:hover .screenshot-container {
  transform: scale(1.02);
  box-shadow: 0 0.8cqw 2.4cqw rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.layout-screenshot .slide-caption {
  margin-top: 0.4cqw !important;
  font-size: max(2cqw, 13px);
}

/* ===== Screenshot Placeholder ===== */
.screenshot-placeholder {
  width: 55%;
  margin: 1.5cqw auto;
  background: linear-gradient(135deg, var(--c-base-dim) 0%, var(--c-main-light) 100%);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  padding: 4cqw 2cqw;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.2cqw;
  color: var(--c-gray);
}
.screenshot-placeholder svg {
  width: 5cqw; height: 5cqw;
  opacity: 0.4;
}
.placeholder-label {
  font-size: max(1.6cqw, 12px);
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* ===== Layout: End ===== */
.layout-end .slide-content {
  align-items: center; text-align: center; gap: 2cqw;
}
.layout-end .end-line {
  width: 6cqw; height: 0.4cqw;
  background: var(--c-accent); border-radius: 2px;
}

/* ===== Status Bar ===== */
.status-bar {
  position: fixed; top: 1.2rem; right: 4.5rem;
  display: flex; align-items: center; gap: 0.8rem;
  font-size: 0.75rem; color: var(--c-gray);
  z-index: 100;
  pointer-events: none;
}
.status-agenda { font-weight: 500; }
.status-time   { opacity: 0.7; }
.status-count  { opacity: 0.7; }

/* ===== Menu Button ===== */
.menu-btn {
  position: fixed; top: 1rem; right: 1rem;
  width: 2.2rem; height: 2.2rem;
  background: transparent; border: none;
  cursor: pointer; z-index: 200;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.menu-btn span {
  display: block; width: 1.4rem; height: 2px;
  background: var(--c-main);
  transition: transform 0.2s, opacity 0.2s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.layout-section .menu-btn span,
.layout-section ~ .menu-btn span { background: var(--c-base); }

/* ===== Sidebar ===== */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed; top: 0; right: -360px;
  width: 360px; height: 100vh;
  background: var(--c-base);
  z-index: 160;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  padding: 1.5rem 0;
}
.sidebar-overlay.open .sidebar { right: 0; }

.sidebar-title {
  font-size: 0.85rem; font-weight: 700;
  padding: 0 1.5rem 1rem;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 0.5rem;
}
.sidebar-section {
  padding: 0.6rem 1.5rem 0.3rem;
  font-size: 0.7rem; font-weight: 700;
  color: var(--c-accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sidebar-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 1.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-item:hover { background: var(--c-light); }
.sidebar-item.current {
  background: var(--c-light);
  font-weight: 700;
  border-left: 3px solid var(--c-accent);
}
.sidebar-item-num {
  color: var(--c-gray); min-width: 1.5rem;
  font-size: 0.65rem;
}

/* ===== Talk Script ===== */
.script-trigger {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 48px; z-index: 90;
}
.script-panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 30vh;
  background: rgba(0,0,0,0.9);
  color: #E0E0E0;
  padding: 1.5rem 2rem;
  font-size: 0.9rem; line-height: 1.7;
  z-index: 95;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
}
.script-panel.show { transform: translateY(0); }
.script-label {
  font-size: 0.65rem; font-weight: 700;
  color: var(--c-accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

/* ===== Progress Bar ===== */
.progress-bar {
  position: fixed; bottom: 0; left: 0;
  height: 3px;
  background: var(--c-accent);
  z-index: 80;
  transition: width 0.2s ease;
}

/* ===== Mobile / Narrow Viewport ===== */
@media (max-width: 768px) {
  .slide {
    max-width: 100vw;
    max-height: 100vh;
  }
  .slide-content { padding: 6% 5%; }

  /* Left-Right → 縦積み */
  .layout-left-right .slide-content {
    flex-direction: column; gap: 2.5cqw;
  }
  .layout-left-right .lr-right { flex: none; width: 100%; }
  .layout-profile .slide-content {
    flex-direction: column; gap: 2cqw;
  }
  .layout-profile .profile-photo { flex: none; width: 25vw; height: 25vw; }

  /* Grid → 縦積み */
  .layout-grid-3 .grid-container {
    grid-template-columns: 1fr; width: 90%;
  }
  .layout-grid-4 .grid-container {
    grid-template-columns: 1fr; width: 90%;
  }

  /* Flow → 縦積み */
  .layout-flow .flow-container {
    flex-direction: column; width: 85%;
  }
  .layout-flow .flow-arrow {
    transform: rotate(90deg);
  }

  /* Comparison → 縦積み */
  .layout-comparison .comparison-container {
    grid-template-columns: 1fr; width: 90%;
  }

  /* Table → 横スクロール */
  .layout-table table { width: 95%; font-size: max(1.6cqw, 12px); }

  /* Timeline */
  .layout-timeline .timeline-container { width: 90%; }

  /* Numbered */
  .layout-numbered .numbered-list { width: 90%; }

  /* Sidebar */
  .sidebar { width: 85vw; right: -85vw; }

  /* Status bar 非表示 */
  .status-bar { display: none; }
}
