/* Animos Web Studio Stylesheet
   Designed with Apple Human Interface Guidelines & Fluid Motion Principles
*/

:root {
  --bg-app: #09090b;
  --bg-sidebar: #0f0f13;
  --bg-panel-sub: #14141a;
  --bg-card: #181822;
  --bg-card-hover: #1f1f2c;
  --bg-card-active: #222232;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(59, 130, 246, 0.6);
  --border-strong: rgba(255, 255, 255, 0.15);

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-light: rgba(59, 130, 246, 0.15);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --shadow-float: 0 16px 36px -8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* RTL Layout Enhancements */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .sidebar-left {
  border-left: 1px solid var(--border-subtle);
  border-right: none;
}

html[dir="rtl"] .sidebar-right {
  border-right: 1px solid var(--border-subtle);
  border-left: none;
}

html[dir="rtl"] .project-title-input {
  padding: 4px 8px 4px 22px;
}

html[dir="rtl"] .edit-badge {
  right: auto;
  left: 6px;
}

html[dir="rtl"] .timeline-time {
  direction: ltr;
  justify-content: flex-start;
}

html[dir="rtl"] .stage-info {
  direction: ltr;
}

html[dir="rtl"] .radio-label input {
  margin-left: 8px;
  margin-right: 0;
}

/* Language Toggle Button */
.lang-toggle-btn {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lang-toggle-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-focus);
  transform: scale(1.02);
}

.lang-toggle-btn:active {
  transform: scale(0.96);
}

.lang-flag {
  font-size: 14px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Layout Container */
.studio-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* TOP HEADER */
.studio-header {
  height: 52px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-icon {
  width: 22px;
  height: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.brand-icon .dot {
  background: var(--accent-blue);
  border-radius: 3px;
  transition: transform 0.2s ease;
}

.brand:hover .brand-icon .dot:nth-child(2) {
  transform: scale(1.2);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.project-title-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.project-title-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 22px 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  width: 150px;
}

.project-title-input:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.project-title-input:focus {
  background: var(--bg-card);
  border-color: var(--border-focus);
  color: var(--text-primary);
  outline: none;
  width: 200px;
}

.edit-badge {
  position: absolute;
  right: 6px;
  pointer-events: none;
  color: var(--text-muted);
}

/* Header Center Segmented Control */
.header-center {
  display: flex;
  align-items: center;
}

.segmented-control {
  display: flex;
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.segment-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.segment-btn.active {
  background: var(--bg-card-hover);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.ratio-icon {
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}
.ratio-icon.square { width: 10px; height: 10px; }
.ratio-icon.wide { width: 14px; height: 8px; }
.ratio-icon.tall { width: 8px; height: 14px; }
.ratio-icon.port45 { width: 9px; height: 12px; }

/* Header Right Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-dot.green {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.pill-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pill-btn:active {
  transform: scale(0.96);
}

.pill-btn.secondary {
  background: var(--bg-panel-sub);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.pill-btn.secondary:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
}

.pill-btn.primary {
  background: var(--accent-blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

.pill-btn.primary:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.5);
}

/* STUDIO MAIN BODY */
.studio-body {
  display: grid;
  grid-template-columns: 260px 1fr 310px;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* LEFT SIDEBAR - TEMPLATES */
.sidebar-left {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.sidebar-count {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.templates-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.template-category {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 4px 6px;
}

.category-header .badge {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
}

.template-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.template-item:hover {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.template-item.active {
  background: var(--bg-card);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue), 0 4px 16px rgba(59, 130, 246, 0.2);
}

.template-thumb {
  height: 72px;
  background: #09090c;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.thumb-canvas-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 200px;
}

/* CSS Mock Shapes for Thumbnails */
.mock-ring-3d {
  width: 48px;
  height: 24px;
  border: 3px solid #4f46e5;
  border-radius: 50%;
  transform: rotateX(60deg) rotateZ(-20deg);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.mock-totem-3d {
  width: 22px;
  height: 52px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mock-totem-3d::before, .mock-totem-3d::after {
  content: '';
  flex: 1;
  background: #6366f1;
  border-radius: 3px;
  opacity: 0.6;
}
.mock-totem-3d::before { opacity: 0.9; }

.mock-film-3d {
  width: 60px;
  height: 24px;
  display: flex;
  gap: 3px;
  transform: rotateY(25deg);
}
.mock-film-3d::before, .mock-film-3d::after {
  content: '';
  flex: 1;
  background: #38bdf8;
  border-radius: 3px;
  opacity: 0.7;
}

.mock-orbit-3d {
  width: 32px;
  height: 32px;
  border: 2px dashed #a855f7;
  border-radius: 50%;
  transform: rotateX(45deg);
}

.mock-circle-3d {
  width: 36px;
  height: 36px;
  border: 2px solid #2dd4bf;
  border-radius: 50%;
}

.mock-device-3d {
  width: 26px;
  height: 46px;
  border: 2px solid #94a3b8;
  border-radius: 5px;
  transform: rotateY(-20deg) rotateX(15deg);
  background: rgba(255, 255, 255, 0.05);
}

.mock-cascade-3d {
  width: 40px;
  height: 40px;
  position: relative;
}
.mock-cascade-3d::before, .mock-cascade-3d::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 30px;
  background: #f43f5e;
  border-radius: 4px;
}
.mock-cascade-3d::before { top: 0; left: 0; opacity: 0.5; }
.mock-cascade-3d::after { bottom: 0; right: 0; opacity: 0.9; }

.mock-grid-3d {
  width: 44px;
  height: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  transform: rotateX(40deg) rotateZ(-20deg);
}
.mock-grid-3d span, .mock-grid-3d::before, .mock-grid-3d::after {
  content: '';
  background: #fbbf24;
  border-radius: 2px;
  opacity: 0.7;
}

/* New 3D Thumbnail Mock Shapes */
.mock-helix-3d {
  width: 32px;
  height: 48px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.mock-helix-3d::before, .mock-helix-3d::after {
  content: '';
  height: 6px;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  border-radius: 3px;
  transform: rotate(25deg);
}
.mock-helix-3d::after {
  transform: rotate(-25deg);
}

.mock-horizon-3d {
  width: 56px;
  height: 28px;
  border-top: 3px solid #06b6d4;
  border-bottom: 3px solid transparent;
  border-radius: 50%;
  transform: rotateX(55deg);
  box-shadow: 0 -4px 10px rgba(6, 182, 212, 0.4);
}

.mock-fan-3d {
  width: 44px;
  height: 36px;
  position: relative;
}
.mock-fan-3d::before, .mock-fan-3d::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 30px;
  background: #10b981;
  border-radius: 3px;
  opacity: 0.7;
}
.mock-fan-3d::before {
  transform: rotate(-20deg);
  left: 4px;
}
.mock-fan-3d::after {
  transform: rotate(20deg);
  right: 4px;
  opacity: 0.95;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.mock-stack-3d {
  width: 38px;
  height: 38px;
  position: relative;
}
.mock-stack-3d::before, .mock-stack-3d::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 18px;
  background: #f59e0b;
  border-radius: 3px;
  transform: rotate(-30deg) skewX(20deg);
}
.mock-stack-3d::before {
  top: 14px;
  left: 6px;
  opacity: 0.5;
}
.mock-stack-3d::after {
  top: 4px;
  left: 6px;
  opacity: 0.95;
}

/* Background Atmosphere & Gradient Presets */
.bg-upload-box {
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(255, 255, 255, 0.02);
}

.bg-upload-box:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-light);
}

.bg-upload-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.preset-gradients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gradient-preset-btn {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.gradient-preset-btn:hover {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.gradient-preset-btn.active {
  border-color: var(--accent-blue);
  background: var(--bg-card);
  color: #fff;
}

.grad-preview {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
}

.grad-spotlight { background: radial-gradient(circle, #334155, #09090c); }
.grad-aurora { background: radial-gradient(circle, #6366f1, #0f172a); }
.grad-sunset { background: radial-gradient(circle, #f43f5e, #1c1917); }
.grad-apple { background: radial-gradient(circle, #ffffff, #cbd5e1); border: 1px solid rgba(0,0,0,0.1); }

.grad-name {
  font-size: 11px;
  font-weight: 500;
}

/* Video Preview Modal */
.preview-card {
  width: 620px;
  max-width: 95vw;
}

.preview-body {
  padding: 16px 24px;
  gap: 14px;
}

.video-preview-wrapper {
  width: 100%;
  max-height: 420px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-video {
  width: 100%;
  max-height: 420px;
  display: block;
  outline: none;
}

.preview-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-badge {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-panel-sub);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.template-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.template-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.template-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* CENTER STAGE SECTION */
.stage-section {
  background: #070709;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stage-toolbar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(15, 15, 19, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.stage-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canvas-res-tag {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.fps-badge {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.stage-view-actions {
  display: flex;
  gap: 6px;
}

.stage-action-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.stage-action-btn:hover {
  background: var(--bg-card);
  color: #fff;
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
}

.canvas-frame-wrapper {
  position: relative;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101014;
}

#motionCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.canvas-interactive-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.canvas-interactive-overlay:active {
  cursor: grabbing;
}

/* BOTTOM FLOATING TIMELINE BAR */
.timeline-bar {
  height: 54px;
  background: rgba(20, 20, 26, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 20;
}

.timeline-controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timeline-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.timeline-btn:active {
  transform: scale(0.95);
}

.timeline-track-wrapper {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.timeline-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  position: relative;
  transition: height 0.15s ease;
}

.timeline-track-wrapper:hover .timeline-track {
  height: 6px;
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--accent-blue);
  border-radius: 2px;
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s ease;
  pointer-events: none;
}

.timeline-track-wrapper:hover .timeline-thumb {
  transform: translate(-50%, -50%) scale(1.2);
}

.timeline-time {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 90px;
  justify-content: flex-end;
}

.curr-time {
  color: #fff;
  font-weight: 600;
}

/* RIGHT INSPECTOR PANEL */
.sidebar-right {
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 14px;
  gap: 22px;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.text-link-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.text-link-btn:hover {
  text-decoration: underline;
}

/* Slots List */
.slots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.slot-row {
  display: flex;
  align-items: center;
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.slot-row:hover {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.15);
}

.slot-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.slot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.slot-title {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

.slot-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.slot-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.slot-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.add-slot-dropzone {
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(255, 255, 255, 0.02);
}

.add-slot-dropzone:hover, .add-slot-dropzone.dragover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-light);
}

.dropzone-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Control Groups & Sliders */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-row label, .control-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.val-pill {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #fff;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* Apple Style Custom Slider */
.apple-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.apple-slider:hover {
  background: rgba(255, 255, 255, 0.18);
}

.apple-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.apple-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Color Picker & Swatches */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hex-label {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted);
}

.color-input {
  -webkit-appearance: none;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  padding: 0;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.color-swatches {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.swatch-btn:hover {
  transform: scale(1.15);
}

.swatch-btn.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px #fff;
}

/* Pill Option Buttons */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pill-option {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-option:hover {
  background: var(--bg-card);
  color: #fff;
}

.pill-option.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.segmented-control.mini .segment-btn {
  padding: 3px 8px;
  font-size: 11px;
}

/* Switch Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider.round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  transition: 0.2s;
}

.slider.round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

input:checked + .slider.round {
  background-color: var(--accent-blue);
}

input:checked + .slider.round:before {
  transform: translateX(18px);
}

/* EXPORT MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 540px;
  max-width: 92vw;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-title-box h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.export-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Format Cards */
.format-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.format-card {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.format-card:hover {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.2);
}

.format-card.active {
  background: var(--bg-card);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.format-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.format-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.badge-recommended {
  font-size: 9px;
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.format-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Engine Options */
.engine-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.radio-label:hover {
  background: var(--bg-card);
}

.radio-label input {
  margin-top: 3px;
  accent-color: var(--accent-blue);
}

.radio-content {
  display: flex;
  flex-direction: column;
}

.radio-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.radio-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Progress Box */
.export-progress-box {
  background: #08080a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.1s ease;
}

.progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.progress-status {
  color: var(--text-secondary);
}

.progress-percent {
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* TOASTS */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: rgba(24, 24, 34, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

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

.hidden {
  display: none !important;
}
.hidden-input {
  display: none;
}

/* Light Mode Overrides when toggled */
body.light-theme {
  --bg-app: #f5f5f7;
  --bg-sidebar: #ffffff;
  --bg-panel-sub: #f0f0f4;
  --bg-card: #e5e5ea;
  --bg-card-hover: #dcdce2;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text-primary: #1c1c1e;
  --text-secondary: #48484a;
  --text-muted: #8e8e93;
}
body.light-theme .brand-name,
body.light-theme .template-name,
body.light-theme .modal-title-box h3,
body.light-theme .format-name,
body.light-theme .radio-title,
body.light-theme .curr-time,
body.light-theme .val-pill {
  color: #111;
}
body.light-theme .stage-section {
  background: #eef0f3;
}

/* =============================================
   MOBILE RESPONSIVE LAYOUT
   Apple HIG-inspired bottom tab bar + sheet pattern
   ============================================= */

/* Mobile Tab Bar & Sheets (hidden on desktop) */
.mobile-tab-bar {
  display: none;
}

.mobile-sheet-backdrop {
  display: none;
}

.sheet-mobile-header {
  display: none;
}

.sheet-close-btn {
  display: none;
}

.mobile-only-section {
  display: none;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Breakpoint: Tablets & small desktops ---- */
@media (max-width: 1100px) {
  .studio-body {
    grid-template-columns: 220px 1fr 280px;
  }
}

/* ---- Breakpoint: Small tablets ---- */
@media (max-width: 900px) {
  .studio-body {
    grid-template-columns: 200px 1fr 260px;
  }

  .studio-header {
    padding: 0 12px;
  }

  .header-center {
    display: none;
  }

  .status-indicator {
    display: none;
  }

  .pill-btn span,
  .pill-btn.secondary span {
    display: none;
  }
}

/* ---- Breakpoint: MOBILE (< 768px) ---- */
@media (max-width: 768px) {

  /* --- Body & Container --- */
  body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
  }

  .studio-container {
    height: 100vh;
    height: 100dvh;
  }

  /* --- HEADER: compact mobile version --- */
  .studio-header {
    height: 48px;
    padding: 0 12px;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
  }

  .brand-name {
    font-size: 15px;
  }

  .project-title-wrapper {
    display: none;
  }

  /* Compact Aspect Ratio in Header */
  .header-center {
    display: flex;
    justify-content: center;
    flex: 1;
    min-width: 0;
  }

  .header-center .segmented-control {
    padding: 1px;
    gap: 1px;
  }

  .header-center .segment-btn {
    padding: 3px 6px;
    font-size: 10px;
    font-weight: 600;
  }

  .header-center .ratio-icon {
    display: none;
  }

  .header-right {
    gap: 6px;
  }

  .header-right .status-indicator,
  .header-right .lang-toggle-btn .lang-text {
    display: none;
  }

  .lang-toggle-btn {
    padding: 5px 8px;
    min-width: 0;
  }

  .pill-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .pill-btn span {
    display: none;
  }

  .pill-btn.secondary {
    display: none;
  }

  .pill-btn.primary svg {
    width: 18px;
    height: 18px;
  }

  /* Hide the desktop export button (we have a tab for it) */
  #openExportModalBtn {
    display: none;
  }

  /* --- MAIN BODY: single-column, canvas takes all space --- */
  .studio-body {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 48px - 60px); /* header + tab bar */
    position: relative;
  }

  /* --- SIDEBARS: hidden by default, shown as sheets --- */
  .sidebar-left,
  .sidebar-right {
    position: fixed;
    bottom: 60px; /* above tab bar */
    left: 0;
    right: 0;
    z-index: 500;
    max-height: 65vh;
    border-radius: 16px 16px 0 0;
    border: none;
    border-top: 1px solid var(--border-strong);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    will-change: transform;
  }

  .sidebar-left {
    border-right: none;
    background: var(--bg-sidebar);
  }

  .sidebar-right {
    border-left: none;
    background: var(--bg-sidebar);
    padding: 16px 16px 24px;
  }

  html[dir="rtl"] .sidebar-left {
    border-left: none;
  }
  html[dir="rtl"] .sidebar-right {
    border-right: none;
  }

  .sidebar-left.mobile-sheet-open,
  .sidebar-right.mobile-sheet-open {
    transform: translateY(0);
  }

  /* Sheet Header & Close Button */
  .mobile-only-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sheet-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sheet-mobile-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
  }

  .sheet-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
  }

  .sheet-close-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
  }

  .sheet-close-btn:active {
    transform: scale(0.9);
  }

  /* Sheet drag handle indicator */
  .sidebar-left::before,
  .sidebar-right::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 8px auto 4px;
    flex-shrink: 0;
  }

  /* --- STAGE: full width & height --- */
  .stage-section {
    flex: 1;
    min-height: 0;
    width: 100%;
  }

  .stage-toolbar {
    height: 32px;
    padding: 0 10px;
  }

  .canvas-viewport {
    flex: 1;
  }

  /* --- TIMELINE: compact --- */
  .timeline-bar {
    height: 48px;
    padding: 0 12px;
    gap: 10px;
  }

  .timeline-time {
    min-width: 70px;
    font-size: 11px;
  }

  .timeline-btn {
    width: 28px;
    height: 28px;
  }

  /* --- MOBILE BOTTOM TAB BAR --- */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 15, 19, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid var(--border-subtle);
    z-index: 600;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-tab:active {
    transform: scale(0.92);
  }

  .mobile-tab.active {
    color: var(--accent-blue);
  }

  .mobile-tab svg {
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .mobile-tab.active svg {
    transform: scale(1.1);
  }

  /* Sheet Backdrop */
  .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 450;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-sheet-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-sheet-backdrop.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* --- Templates: more compact in mobile sheet --- */
  .sidebar-header {
    padding: 10px 16px;
    position: sticky;
    top: 0;
    background: var(--bg-sidebar);
    z-index: 10;
  }

  .templates-scroll-container {
    padding: 10px 12px 20px;
    gap: 14px;
  }

  .template-item {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
  }

  .template-thumb {
    width: 56px;
    height: 56px;
    min-width: 56px;
    margin-bottom: 0;
    border-radius: 8px;
  }

  .template-info {
    flex: 1;
    min-width: 0;
  }

  .template-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .template-desc {
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* --- Inspector controls: touch-friendly sizes --- */
  .apple-slider {
    height: 6px;
  }

  .apple-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .control-row label,
  .control-label {
    font-size: 13px;
  }

  .segmented-control.mini .segment-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .pill-group {
    gap: 6px;
  }

  .pill-option {
    padding: 6px 12px;
    font-size: 12px;
  }

  .toggle-row label {
    font-size: 13px;
  }

  .switch {
    width: 44px;
    height: 24px;
  }

  .slider.round:before {
    width: 20px;
    height: 20px;
  }

  input:checked + .slider.round:before {
    transform: translateX(20px);
  }

  /* --- Slots in mobile: horizontal scroll or compact list --- */
  .slots-list {
    max-height: 200px;
  }

  .slot-thumb {
    width: 36px;
    height: 36px;
  }

  /* --- Dropzone: bigger touch target --- */
  .add-slot-dropzone {
    padding: 14px;
  }

  .bg-upload-box {
    padding: 14px;
  }

  /* --- Gradient presets: 4 columns, touch-friendly --- */
  .preset-gradients-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .gradient-preset-btn {
    padding: 8px 10px;
  }

  /* --- Color swatches: bigger --- */
  .swatch-btn {
    width: 28px;
    height: 28px;
  }

  /* --- Modals: full-width on mobile --- */
  .modal-card {
    width: 100%;
    max-width: 100vw;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    animation: modalSlideUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .preview-card {
    width: 100%;
    max-width: 100vw;
  }

  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-backdrop {
    align-items: flex-end;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 14px 16px;
    gap: 14px;
  }

  .modal-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .modal-title-box h3 {
    font-size: 15px;
  }

  /* Format cards: single column on small screens */
  .format-cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .format-card {
    padding: 8px 10px;
  }

  .format-name {
    font-size: 12px;
  }

  .format-desc {
    font-size: 10px;
  }

  /* Export resolution/fps segments: scrollable */
  .export-field .segmented-control {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .export-field .segmented-control::-webkit-scrollbar {
    display: none;
  }

  /* --- Toast: above tab bar --- */
  .toast-container {
    bottom: 70px;
    right: 12px;
    left: 12px;
  }

  .toast {
    font-size: 12px;
  }

  /* --- Aspect ratio selector on mobile: put it in stage toolbar --- */
  .stage-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
  }

  /* Light theme mobile overrides */
  body.light-theme .mobile-tab-bar {
    background: rgba(255, 255, 255, 0.92);
    border-top-color: rgba(0, 0, 0, 0.1);
  }

  body.light-theme .sidebar-left::before,
  body.light-theme .sidebar-right::before {
    background: rgba(0, 0, 0, 0.2);
  }
}

/* ---- Breakpoint: Very small phones ---- */
@media (max-width: 380px) {
  .mobile-tab span {
    font-size: 9px;
  }

  .mobile-tab svg {
    width: 20px;
    height: 20px;
  }

  .brand-icon {
    display: none;
  }

  .format-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Safe area padding for notched phones ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .mobile-tab-bar {
      height: calc(60px + env(safe-area-inset-bottom));
      padding-bottom: env(safe-area-inset-bottom);
    }

    .studio-body {
      height: calc(100dvh - 48px - 60px - env(safe-area-inset-bottom));
    }

    .sidebar-left,
    .sidebar-right {
      bottom: calc(60px + env(safe-area-inset-bottom));
    }
  }
}
