:root {
  --bg-canvas: #f4f4f2;
  --bg-surface: #ffffff;
  --bg-surface-hover: #fafaf9;
  --bg-surface-active: #fff7ed;

  --border-hairline: rgba(20, 20, 22, 0.09);
  --border-strong: rgba(20, 20, 22, 0.18);
  --text-primary: #141416;
  --text-secondary: #52525b;
  --text-muted: #71717a;

  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-ring: rgba(234, 88, 12, 0.35);

  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --header-height: 60px;
  --sidebar-width: 224px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

:root.dark {
  --bg-canvas: #0e0e11;
  --bg-surface: #16161a;
  --bg-surface-hover: #1f1f24;
  --bg-surface-active: #271a14;

  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-ring: rgba(249, 115, 22, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
select,
a {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-shell.is-loading .slides-sidebar {
  display: none !important;
}

.app-shell.is-loading .workspace-grid {
  grid-template-columns: 1fr;
}

.app-shell.is-loading .slide-canvas-box {
  border: none;
  box-shadow: none;
  background-color: transparent;
}

#previewImage:not([src]),
#previewImage[src=""] {
  opacity: 0;
  visibility: hidden;
}

.app-shell.is-loading #previewImage {
  opacity: 0;
  visibility: hidden;
}

.app-shell.is-loading .header-counter {
  visibility: hidden;
}

/* Top Bar */
.top-bar {
  height: var(--header-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-pdf-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  background-color: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.28);
}

:root.dark .badge-pdf-active {
  background-color: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.badge-pdf-active .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-counter {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  padding-right: 4px;
  white-space: nowrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-primary);
}

.btn-icon .icon-sun {
  display: none;
}

.btn-icon.is-dark .icon-moon {
  display: none;
}

.btn-icon.is-dark .icon-sun {
  display: block;
}

.btn-slideshow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-slideshow:hover {
  background-color: var(--accent-hover);
}

.btn-slideshow:active {
  transform: scale(0.98);
}

/* Main Workspace */
.workspace-grid {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns var(--transition-fast);
}

.slides-sidebar {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-hairline);
  min-height: 0;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* .slides-list {
  list-style: none;
  margin: 0;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
} */

.slides-list {
  list-style: none;
  margin: 0;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / old Edge */
}

.slides-list::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.slide-item {
  flex-shrink: 0; /* prevents thumbnails from squishing in a flex column */
}

.slide-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  background-color: #18181b;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.slide-item:hover {
  border-color: var(--border-strong);
}

.slide-item.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-item-num {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 6px;
  background-color: rgba(12, 12, 14, 0.78);
  color: #f4f4f5;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.slide-item.is-selected .slide-item-num {
  background-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.preview-stage {
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-primary);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.canvas-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-frame {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-canvas-box {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(20, 20, 22, 0.1);
  background-color: #18181b;
}

.slide-canvas-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity var(--transition-fast);
}

.slide-assets-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.slide-asset-item {
  position: absolute;
  pointer-events: auto;
  overflow: hidden;
  background-color: transparent;
}

.slide-asset-item.has-video {
  background-color: #000000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.slide-asset-item.has-link {
  overflow: visible;
  z-index: 15;
}

.slide-link-hotspot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  white-space: pre-line;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #45b0e1;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 8px;
  line-height: 1.25;
  border: none;
  outline: none;
  background-color: transparent;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.slide-link-hotspot:hover {
  color: #7dd3fc;
}

.slide-link-hotspot:focus-visible {
  outline-offset: 2px;
}

.slide-asset-item video,
.slide-asset-item img {
  width: 100%;
  height: 100%;
  display: block;
}
.slide-asset-item img {
  width: 100%;
  height: 100%;
  object-fit: inherit; /* Inherits whatever is applied on the element or asset config */
}
.slide-asset-item video {
  object-fit: cover;
}

.slide-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  transition: opacity var(--transition-fast), background-color var(--transition-fast);
  cursor: pointer;
}

.slide-play-overlay:hover {
  background: rgba(0, 0, 0, 0.15);
}

.slide-play-overlay.is-playing {
  opacity: 0;
  pointer-events: none !important;
}

.slide-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #141416;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-fast);
}

.slide-play-overlay:hover .slide-play-btn {
  transform: scale(1.08);
}

/* Loading State */
.stage-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-canvas);
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1), visibility 300ms;
}

.stage-loading-overlay[hidden] {
  display: none !important;
}

.stage-loading-overlay:not(.is-active) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.stage-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.stage-loading-text-group,
.stage-loading-progress-wrap {
  display: none !important;
}

.spinner-circle-box {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.loading-circle-svg {
  width: 60px;
  height: 60px;
  animation: spinner-rotate 1.4s linear infinite;
  transform-origin: center center;
}

.loading-circle-bg {
  stroke: rgba(234, 88, 12, 0.16);
}

:root.dark .loading-circle-bg {
  stroke: rgba(249, 115, 22, 0.2);
}

.loading-circle-spinner {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  animation: spinner-dash 1.4s ease-in-out infinite;
}

@keyframes spinner-rotate {
  100% { transform: rotate(360deg); }
}

@keyframes spinner-dash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Slideshow Overlay */
.slideshow-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: #09090b;
  color: #f4f4f5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.slideshow-overlay[hidden] {
  display: none;
}

.slideshow-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: linear-gradient(to bottom, rgba(9, 9, 11, 0.9), rgba(9, 9, 11, 0));
}

.slideshow-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  min-width: 0;
}

.slideshow-counter {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  flex-shrink: 0;
}

.slideshow-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slideshow-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ss-btn {
  padding: 7px 14px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.ss-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.ss-btn.is-active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.ss-btn-close:hover {
  background-color: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
}

.slideshow-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  overflow: hidden;
}

/* .ss-image-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
} */

.ss-image-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2. Lock #slideshowCanvasBox to responsive 16:9 that expands to full viewport bounds */
#slideshowCanvasBox {
  position: relative;
  aspect-ratio: 16 / 9;
  /* Scales up to 100% width or 100% height without exceeding either */
  width: min(100%, calc((100vh - 160px) * (16 / 9)));
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #18181b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

/* 3. Delete or replace '.ss-image-wrap img' so it no longer forces 'width: auto' */
.ss-image-wrap #slideshowImage {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
  display: block;
}

/* 4. Allow Slide 17 GIF to respect its JSON objectFit property */
.slide-asset-item img {
  width: 100%;
  height: 100%;
  object-fit: inherit;
}

.ss-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(24, 24, 27, 0.72);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.ss-nav-arrow:hover:not(:disabled) {
  background-color: var(--accent);
  border-color: var(--accent);
}

.ss-nav-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.ss-prev { left: 16px; }
.ss-next { right: 16px; }

.slideshow-bottombar {
  padding: 12px 24px 18px;
  background: linear-gradient(to top, rgba(9, 9, 11, 0.92), rgba(9, 9, 11, 0));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ss-progress-track {
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  overflow: hidden;
}

.ss-progress-fill {
  height: 100%;
  width: 4.35%;
  background-color: var(--accent);
  transition: width 200ms ease-out;
}

.ss-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ss-playback-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ss-interval-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #a1a1aa;
}

.ss-select {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.8125rem;
  cursor: pointer;
}

.ss-select option {
  background-color: #18181b;
  color: #f4f4f5;
}

.ss-kbd-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: #a1a1aa;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background-color: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  pointer-events: none;
}

.drop-overlay[hidden] {
  display: none;
}

.drop-overlay-box {
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  padding: 48px 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  background-color: rgba(234, 88, 12, 0.08);
}

.drop-overlay-box svg {
  color: var(--accent);
}

.drop-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.drop-subtitle {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background-color: #18181b;
  color: #f4f4f5;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification[hidden] {
  display: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-missing-notice {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
  z-index: 25;
  padding: 32px;
}

.slide-missing-notice[hidden] {
  display: none;
}

.missing-notice-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 420px;
}

.missing-notice-card svg {
  color: var(--accent);
}

.missing-notice-card h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.missing-notice-card p {
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Floating Mobile Navigation Pill --- */
.mobile-nav-pill {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 999999 !important; /* Forces it above all presentation layers, canvas, and overlays */
  background-color: #ffffff !important;
  color: #111827 !important;
  padding: 4px 8px;
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
  align-items: center;
  gap: 6px;
  user-select: none;
  touch-action: manipulation;
  pointer-events: auto !important;
}

@keyframes pill-appear {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pill-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  border: none;
  background-color: transparent !important;
  color: #111827 !important;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.pill-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: #111827;
  color: #111827;
  pointer-events: none;
}

.pill-btn:hover {
  background-color: #f3f4f6 !important;
}

.pill-btn:active {
  background-color: #e5e7eb !important;
}

.pill-btn:disabled {
  opacity: 0.25 !important;
  cursor: not-allowed;
  pointer-events: none;
}

.pill-counter {
  font-family: var(--font-display, sans-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827 !important;
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pill-menu-anchor {
  position: relative;
  display: flex;
  align-items: center;
}

.mobile-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  min-width: 175px;
  background-color: #1c1c1f;
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}

.mobile-menu-dropdown[hidden] {
  display: none;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  color: #f4f4f5;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ==========================================================
   MOBILE RESPONSIVENESS (PORTRAIT & LANDSCAPE)
   ========================================================== */
@media (max-width: 860px), (max-height: 520px) {
  .top-bar,
  .slides-sidebar {
    display: none !important;
  }

  .mobile-nav-pill {
    display: flex !important;
  }


  body,
  .app-shell {
    background-color: #0b0b0e !important;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .workspace-grid {
    grid-template-columns: 1fr !important;
    height: 100%;
  }

  .preview-stage {
    padding: 0 !important;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .canvas-wrapper,
  .slide-frame {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    padding: 8px;
  }

  .slide-canvas-box {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  }
}

/* Mobile Portrait Specifics */
@media (max-width: 860px) and (orientation: portrait) {
  .mobile-nav-pill {
    bottom: 24px;
    left: 20px;
  }

  .slide-canvas-box {
    width: 100%;
    max-width: 100vw;
  }
}

/* Mobile Landscape Specifics */
@media (max-height: 520px) and (orientation: landscape) {
  .canvas-wrapper,
  .slide-frame {
    padding: 4px;
  }

  .slide-canvas-box {
    height: 96dvh;
    max-height: 96dvh;
    width: auto;
    aspect-ratio: 16 / 9;
  }

  .mobile-nav-pill {
    bottom: 12px;
    left: 16px;
    padding: 4px 8px;
  }

  .pill-btn {
    width: 32px;
    height: 32px;
  }

  .pill-counter {
    font-size: 0.9375rem;
  }
}


/* ==========================================================
   DEV MODE CONTROLS (?mode=dev) & PRINT-TO-PDF STYLES
   ========================================================== */
.dev-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--border-hairline);
}

.dev-actions[hidden] {
  display: none !important;
}

.dev-btn {
  color: var(--text-primary);
}

.dev-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dev-btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 350;
  background-color: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pdf-modal-backdrop[hidden] {
  display: none !important;
}

.pdf-modal-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.pdf-modal-content {
  flex: 1;
  min-width: 0;
}

.pdf-modal-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.pdf-modal-status {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.pdf-progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--border-hairline);
  border-radius: 999px;
  overflow: hidden;
}

.pdf-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  transition: width 160ms ease-out;
}

.print-deck-container {
  display: none;
}

@media print {
  @page {
    size: 16in 9in;
    margin: 0;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: #18181b !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-shell,
  .mobile-nav-pill,
  .slideshow-overlay,
  .pdf-modal-backdrop,
  .toast-notification {
    display: none !important;
  }

  .print-deck-container {
    display: block !important;
    width: 100%;
  }

  .print-slide-page {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #18181b;
    page-break-after: always;
    break-after: page;
    overflow: hidden;
  }

  .print-slide-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .print-slide-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
}