* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #050507;
  --bg-card: #0c0c10;
  --bg-card-alt: #111116;
  --bg-hover: #1a1a22;
  --accent-purple: #b07cff;
  --accent-cyan: #00e5ff;
  --accent-pink: #ff4d8a;
  --accent-gold: #ffc800;
  --accent-gradient: linear-gradient(135deg, #b07cff 0%, #ff4d8a 50%, #00e5ff 100%);
  --accent-gradient-text: linear-gradient(90deg, #b07cff 0%, #00e5ff 100%);
  --text-primary: #e8e8f0;
  --text-secondary: #6e6e82;
  --text-dim: #44445a;
  --border-color: #1e1e2a;
  --border-glow: #2a2a3e;
}

body {
  font-family: 'IBM Plex Mono', monospace;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.film-grain {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  animation: grainDrift 0.4s steps(1) infinite;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
}

@keyframes grainDrift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(1px, -2px); }
  75% { transform: translate(-1px, -1px); }
  100% { transform: translate(2px, 0); }
}

.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
}

/* ── HEADER ── */
.header {
  text-align: center;
  padding: 48px 24px 40px;
  margin-bottom: 32px;
  background: 
    radial-gradient(ellipse at 30% 0%, rgba(176, 124, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 0%, rgba(0, 229, 255, 0.06) 0%, transparent 60%),
    linear-gradient(180deg, rgba(15, 15, 22, 0.9) 0%, var(--bg-dark) 100%);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 300%;
  height: 2px;
  background: var(--accent-gradient);
  animation: shimmerLine 4s linear infinite;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176, 124, 255, 0.3), transparent);
}

@keyframes shimmerLine {
  0% { transform: translateX(0); }
  100% { transform: translateX(33.33%); }
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.logo-icon-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.logo-icon-wrap svg {
  width: 100%;
  height: 100%;
  color: var(--accent-purple);
  filter: drop-shadow(0 0 8px rgba(176, 124, 255, 0.3));
}

.ai-sparkle {
  position: absolute;
  top: -6px;
  right: -8px;
  font-size: 16px;
  animation: sparkleFloat 2.5s ease-in-out infinite;
}

@keyframes sparkleFloat {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg) translateY(0); }
  50% { opacity: 0.7; transform: scale(1.15) rotate(12deg) translateY(-2px); }
}

.app-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  letter-spacing: 0.18em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.hero-tagline {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.5rem, 4.5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(90deg, #b07cff 0%, #7c5aff 30%, #00c8ff 70%, #00e5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.hero-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.12em;
  font-weight: 300;
}

/* ── SECTION TITLES ── */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.22em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

/* ── UPLOAD ── */
.upload-section {
  margin-bottom: 32px;
}

.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s ease;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-purple);
  background: rgba(176, 124, 255, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(176, 124, 255, 0.08);
}

.upload-icon-wrapper {
  position: relative;
}

.upload-icon {
  width: 72px;
  height: 72px;
  color: var(--text-dim);
  opacity: 0.7;
}

.sparkle-overlay {
  position: absolute;
  top: -8px;
  right: -10px;
  font-size: 22px;
  animation: sparkleFloat 2s ease-in-out infinite;
}

.upload-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-subtext {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.upload-formats {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* 1 → 9 badge */
.transform-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(176, 124, 255, 0.08);
  border: 1px solid rgba(176, 124, 255, 0.2);
  border-radius: 24px;
  margin-top: 8px;
}

.tb-one {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.tb-arrow {
  font-size: 1.2rem;
  color: var(--accent-cyan);
}

.tb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.tb-cell {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--accent-cyan);
  opacity: 0.7;
}

.api-badge {
  margin-top: 6px;
  padding: 5px 14px;
  background: rgba(255, 200, 0, 0.08);
  border: 1px solid rgba(255, 200, 0, 0.2);
  border-radius: 16px;
  font-size: 0.7rem;
  color: var(--accent-gold);
}

/* Preview */
.preview-container {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.preview-image {
  width: 100%;
  display: block;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.remove-btn:hover {
  background: var(--accent-pink);
  border-color: var(--accent-pink);
}

/* ── STYLE SELECTOR ── */
.style-section {
  margin-bottom: 28px;
}

.style-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  -webkit-overflow-scrolling: touch;
}

.style-scroll::-webkit-scrollbar {
  height: 4px;
}
.style-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.style-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.style-card {
  flex: 0 0 148px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.style-card:hover {
  border-color: rgba(176, 124, 255, 0.4);
  transform: translateY(-2px);
}

.style-card.active {
  border-color: var(--accent-purple);
  background: rgba(176, 124, 255, 0.08);
  box-shadow: 0 0 24px rgba(176, 124, 255, 0.15), inset 0 0 20px rgba(176, 124, 255, 0.05);
}

.style-swatch {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  position: relative;
}

.warm-swatch { background: linear-gradient(135deg, #e8a959 0%, #c96b3b 50%, #6b3a1a 100%); }
.cool-swatch { background: linear-gradient(135deg, #3a8fb7 0%, #1a5c70 50%, #0d2e3a 100%); }
.noir-swatch { background: linear-gradient(135deg, #555 0%, #222 50%, #000 100%); }
.vintage-swatch { background: linear-gradient(135deg, #c9b58a 0%, #9e7e5a 50%, #5e4d35 100%); }
.scifi-swatch { background: linear-gradient(135deg, #00e5ff 0%, #8b5cf6 50%, #ff006e 100%); }
.epic-swatch { background: linear-gradient(135deg, #1a1a3e 0%, #3d3d6b 50%, #8a7f9a 100%); }

.style-name {
  font-size: 0.72rem;
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.style-desc {
  font-size: 0.6rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ── CONTEXT INPUT ── */
.context-section {
  margin-bottom: 28px;
  text-align: center;
}

.context-input {
  width: 100%;
  max-width: 520px;
  padding: 13px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  transition: all 0.25s;
}

.context-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(176, 124, 255, 0.1);
}

.context-input::placeholder {
  color: var(--text-dim);
}

.context-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ── GENERATE BUTTON ── */
.generate-btn {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 36px;
  padding: 18px 36px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  color: var(--text-dim);
  cursor: not-allowed;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.generate-btn.active {
  background: var(--accent-gradient);
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  border-color: transparent;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(176, 124, 255, 0.25);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.generate-btn.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 48px rgba(176, 124, 255, 0.35);
}

.generate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.loader-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── PROGRESS ── */
.progress-section {
  margin-bottom: 28px;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  max-width: 400px;
  margin: 0 auto 12px;
}

.progress-cell {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.progress-cell.done {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
}

.progress-cell.active {
  border-color: var(--accent-cyan);
  animation: cellPulse 1.2s ease-in-out infinite;
  color: var(--accent-cyan);
}

@keyframes cellPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(0, 229, 255, 0); }
}

.progress-status {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

/* ── GRID HEADER ── */
.grid-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.grid-header-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.grid-header-arrow {
  color: var(--accent-cyan);
  font-size: 1.3rem;
  animation: arrowPulse 1.5s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(4px); }
}

/* ── FRAMES GRID ── */
.grid-section {
  margin-bottom: 36px;
}

.frames-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 28px;
  position: relative;
}

.frame-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  opacity: 0;
  transform: scale(0.92);
  animation: frameReveal 0.5s ease forwards;
}

@keyframes frameReveal {
  to { opacity: 1; transform: scale(1); }
}

.frame-wrap.gen-active {
  border-color: var(--accent-cyan);
  animation: frameReveal 0.5s ease forwards, cellPulse 1.2s ease-in-out infinite;
}

.frame-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.frame-wrap:hover .frame-img {
  transform: scale(1.06);
}

.frame-loading-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-spin {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.frame-error-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
}

.frame-error-inner button {
  padding: 5px 14px;
  background: var(--accent-pink);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s;
}

.frame-error-inner button:hover {
  transform: scale(1.05);
}

.frame-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 6px;
}

.frame-label-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.frame-type-label {
  font-size: 0.55rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.frame-click-hint {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.frame-wrap:hover .frame-click-hint {
  opacity: 1;
}

/* ── ACTION BAR ── */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.02em;
}

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

.action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.action-btn.primary {
  background: var(--accent-gradient);
  background-size: 200% 200%;
  border: none;
  color: #fff;
}

.action-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(176, 124, 255, 0.25);
}

.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.action-btn.secondary:hover:not(:disabled) {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* ── LIGHTBOX ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 6, 0.96);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lbFade 0.2s ease;
}

@keyframes lbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5001;
}

.lb-close:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5001;
}

.lb-nav:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

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

.lb-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 90vw;
  max-height: 88vh;
}

.lb-image {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.lb-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lb-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lb-frame-num {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.lb-frame-type {
  color: var(--accent-cyan);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.lb-btn {
  padding: 9px 18px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lb-btn-regen {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.lb-btn-regen:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.lb-btn-dl {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
}

.lb-btn-dl:hover {
  transform: translateY(-2px);
}

/* ── FOOTER ── */
.app-footer {
  padding: 28px 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: 36px;
}

.film-strip-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 10px 0;
}

.film-hole {
  width: 10px;
  height: 6px;
  background: var(--border-color);
  border-radius: 2px;
  animation: holeFlicker 3s ease-in-out infinite alternate;
}

@keyframes holeFlicker {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

.footer-line {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 4px 0;
}

.footer-line a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-line a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.footer-powered {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .app-container {
    padding: 10px;
  }

  .header {
    padding: 30px 16px 28px;
  }

  .logo-row {
    flex-direction: column;
    gap: 8px;
  }

  .logo-icon-wrap {
    width: 38px;
    height: 38px;
  }

  .upload-zone {
    padding: 36px 20px;
  }

  .upload-icon {
    width: 56px;
    height: 56px;
  }

  .style-card {
    flex: 0 0 120px;
  }

  .style-desc {
    display: none;
  }

  .frames-grid {
    gap: 4px;
  }

  .frame-badge {
    min-width: 18px;
    height: 18px;
    font-size: 0.55rem;
    top: 4px;
    left: 4px;
  }

  .frame-type-label {
    font-size: 0.48rem;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .lb-nav {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }

  .lb-actions {
    flex-direction: column;
    width: 100%;
  }

  .lb-btn {
    width: 100%;
    text-align: center;
  }

  .progress-grid {
    gap: 4px;
  }
}