/* headerlock · Minimalist Design System (Studio Workstation Edition) */
:root {
  --bg: #07080b;
  --header-bg: rgba(7, 8, 11, 0.75);
  --stage-bg: transparent;
  --glow-top: rgba(59, 130, 246, 0.08);
  --glow-center: rgba(99, 102, 241, 0.04);
  --glow-bottom: rgba(139, 92, 246, 0.04);
  --pattern-dot: rgba(255, 255, 255, 0.06);
  --noise-opacity: 0.032;

  --card-bg: linear-gradient(180deg, rgba(18, 19, 26, 0.92) 0%, rgba(11, 12, 16, 0.96) 100%);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-border-hover: rgba(255, 255, 255, 0.18);
  --card-bar-bg: linear-gradient(180deg, rgba(24, 26, 35, 0.95) 0%, rgba(16, 18, 24, 0.95) 100%);
  --card-bar-border: rgba(255, 255, 255, 0.07);
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6);
  --viewport-bg: #000000;

  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --control-bg: rgba(255, 255, 255, 0.04);
  --control-hover: rgba(255, 255, 255, 0.08);
  --control-active: linear-gradient(180deg, #2a2d3d 0%, #1e202c 100%);
  --control-text: #a1a1aa;
  --control-text-active: #ffffff;
  --control-border: rgba(255, 255, 255, 0.1);

  --dock-bg: linear-gradient(180deg, rgba(20, 22, 30, 0.88) 0%, rgba(11, 12, 17, 0.95) 100%);
  --dock-border: rgba(255, 255, 255, 0.12);
  --dock-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 48px -8px rgba(0, 0, 0, 0.85);
  --dock-pill-active: linear-gradient(180deg, #303446 0%, #202330 100%);

  --btn-ghost-bg: rgba(255, 255, 255, 0.04);
  --btn-ghost-hover: rgba(255, 255, 255, 0.09);
  --btn-ghost-border: rgba(255, 255, 255, 0.1);
  --btn-ghost-border-hover: rgba(255, 255, 255, 0.2);
  --btn-ghost-text: #cbd5e1;

  --btn-solid-bg: #ffffff;
  --btn-solid-text: #090a0f;
  --btn-solid-hover: #e2e8f0;

  --range-track: #272730;
  --range-thumb: #ffffff;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --header-bg: rgba(248, 250, 252, 0.85);
  --stage-bg: transparent;
  --glow-top: rgba(99, 102, 241, 0.045);
  --glow-center: rgba(59, 130, 246, 0.02);
  --glow-bottom: rgba(14, 165, 233, 0.025);
  --pattern-dot: rgba(15, 23, 42, 0.038);
  --noise-opacity: 0.016;

  --card-bg: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  --card-border: rgba(15, 23, 42, 0.09);
  --card-border-hover: rgba(15, 23, 42, 0.16);
  --card-bar-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --card-bar-border: rgba(15, 23, 42, 0.06);
  --card-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 16px 36px -6px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --viewport-bg: #ffffff;

  --border: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.04);
  --border-strong: rgba(15, 23, 42, 0.15);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --control-bg: rgba(15, 23, 42, 0.04);
  --control-hover: rgba(15, 23, 42, 0.08);
  --control-active: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  --control-text: #64748b;
  --control-text-active: #0f172a;
  --control-border: rgba(15, 23, 42, 0.1);

  --dock-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.98) 100%);
  --dock-border: rgba(15, 23, 42, 0.12);
  --dock-shadow: inset 0 1px 0 #ffffff, 0 16px 36px -6px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
  --dock-pill-active: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);

  --btn-ghost-bg: rgba(15, 23, 42, 0.04);
  --btn-ghost-hover: rgba(15, 23, 42, 0.08);
  --btn-ghost-border: rgba(15, 23, 42, 0.1);
  --btn-ghost-border-hover: rgba(15, 23, 42, 0.18);
  --btn-ghost-text: #334155;

  --btn-solid-bg: #0f172a;
  --btn-solid-text: #ffffff;
  --btn-solid-hover: #1e293b;

  --range-track: #e2e8f0;
  --range-thumb: #0f172a;
}

/* ── Reset & Typography ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

::selection {
  background: transparent;
  color: inherit;
}

::-moz-selection {
  background: transparent;
  color: inherit;
}

html, body {
  width: 100%;
  height: 100vh;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}


/* Subtle Anti-Glare Studio Noise Texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: var(--noise-opacity);
  mix-blend-mode: overlay;
  z-index: 1;
}

/* ── App Header ───────────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

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

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

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

.segmented-control {
  display: flex;
  align-items: center;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.segmented-control button {
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--control-text);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmented-control button:hover {
  color: var(--text-primary);
}

.segmented-control button.active {
  background: var(--control-active);
  color: var(--control-text-active);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .segmented-control button.active {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
}

.header-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--btn-ghost-bg);
  border: 1px solid var(--btn-ghost-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  outline: none;
}

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

.theme-icon {
  position: absolute;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

:root .sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.35);
}
:root .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-ghost {
  background: var(--btn-ghost-bg);
  border: 1px solid var(--btn-ghost-border);
  color: var(--btn-ghost-text);
}

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

.btn-solid {
  background: var(--btn-solid-bg);
  color: var(--btn-solid-text);
  border: 1px solid var(--btn-solid-bg);
  font-weight: 600;
}

.btn-solid:hover {
  background: var(--btn-solid-hover);
  border-color: var(--btn-solid-hover);
}

/* ── Studio Workstation Layout ────────────────────────────────── */
.studio-workspace {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100vh - 52px);
  max-height: calc(100vh - 52px);
  padding-top: 52px;
  background: transparent;
  overflow: hidden;
  z-index: 2;
}

/* ── Studio Sidebar (Left Deck) ───────────────────────────────── */
.studio-sidebar {
  width: 350px;
  min-width: 330px;
  max-width: 360px;
  height: 100%;
  position: relative;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--dock-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px -4px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  z-index: 50;
  padding: 16px 16px 20px;
  gap: 14px;
  transition: background 0.25s ease, border-color 0.25s ease;
}


.studio-sidebar::-webkit-scrollbar {
  width: 4px;
}
.studio-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

/* Sidebar Section */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section:last-of-type {
  border-bottom: none;
}

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

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.sidebar-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-weight: 500;
}

[data-theme="light"] .sidebar-badge {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
}

/* Pills (Target, Shape, Extend) */
.dock-pills {
  display: flex;
  align-items: center;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 7px;
  padding: 2px;
  gap: 1px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.dock-pills.w-full {
  width: 100%;
}

.dock-pill {
  flex: 1;
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--control-text);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
}

.dock-pill:hover {
  color: var(--text-primary);
}

.dock-pill.active {
  background: var(--dock-pill-active);
  color: var(--control-text-active);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .dock-pill.active {
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Sidebar Tool Tabs */
.sidebar-tabs {
  display: flex;
  align-items: center;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.sidebar-tab {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--control-text);
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.sidebar-tab:hover {
  color: var(--text-primary);
}

.sidebar-tab.active {
  background: var(--dock-pill-active);
  color: var(--control-text-active);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .sidebar-tab.active {
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Sidebar Panels */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.sidebar-panel[hidden] {
  display: none !important;
}

.sidebar-panel-footer {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* Adjust grid */
.adjust-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-label-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

.control-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

.control-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-primary);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* Range Inputs */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--range-track);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: none;
  transition: background-color 0.25s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--range-thumb);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Presets */
.presets-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.presets-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.presets-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.preset-pill {
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--control-bg);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}

.preset-pill:hover {
  background: var(--control-hover);
  color: var(--text-primary);
}

.preset-pill.active {
  background: var(--dock-pill-active);
  color: var(--control-text-active);
  border-color: var(--border-strong);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.flyout-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 0;
}

/* Switches */
.fx-switches-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-title {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 19px;
  flex-shrink: 0;
}

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

.slider-toggle {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--control-border);
  border-radius: 999px;
  transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 13px;
  width: 13px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .slider-toggle {
  background-color: #3b82f6;
}

.toggle-switch input:checked + .slider-toggle:before {
  transform: translateX(15px);
}

.sub-options {
  padding: 8px 10px;
  background: var(--control-bg);
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.fx-sliders-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Transform Grid */
.flyout-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.flyout-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flyout-btn-toggle,
.flyout-btn-action,
.flyout-btn-ghost {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  outline: none;
}

.flyout-btn-toggle {
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  color: var(--control-text);
}

.flyout-btn-toggle:hover {
  background: var(--control-hover);
  color: var(--text-primary);
}

.flyout-btn-toggle.active {
  background: var(--dock-pill-active);
  color: var(--control-text-active);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.flyout-btn-action {
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  color: var(--text-primary);
}

.flyout-btn-action:hover {
  background: var(--control-hover);
  border-color: var(--border-strong);
}

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

.flyout-btn-ghost:hover {
  background: var(--control-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.w-full {
  width: 100%;
}

.flyout-pill-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--control-hover);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Zoom Controls in Transform panel */
.dock-zoom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dock-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.dock-btn:hover {
  background: var(--control-hover);
  color: var(--text-primary);
}

/* Balance Panel */
.balance-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crop-balance-endpoints {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.balance-help {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 6px;
}

.balance-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  color: var(--text-muted);
  font-size: 11px;
}

/* Sidebar Settings Rows */
.sidebar-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setting-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Sidebar Reset All */
.sidebar-footer {
  margin-top: auto;
  padding-top: 6px;
}

.sidebar-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-reset-btn:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

/* ── Studio Stage (Right Canvas Area - Zero Scroll at 100% Zoom) ── */
.studio-stage {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 16px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
}

.views-container {
  display: flex;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Mode 1: BOTH (Side-by-side, Desktop has significantly more LENGTH, Mobile is compact, zero scroll) ── */
.views-container.view-both {
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
}

.views-container.view-both .card.desktop-view {
  flex: 1.55;
  max-width: 840px;
  min-width: 480px;
  display: flex;
}

.views-container.view-both .card.mobile-view {
  flex: 0.9;
  max-width: 450px;
  min-width: 300px;
  display: flex;
}

/* ── Mode 2: DESKTOP ONLY (Focus mode, MUCH LARGER and main view) ── */
.views-container.view-desktop {
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.views-container.view-desktop .card.mobile-view {
  display: none !important;
}

.views-container.view-desktop .card.desktop-view {
  display: flex;
  width: 100%;
  max-width: 1160px;
}

/* ── Mode 3: MOBILE ONLY (Focus mode, MUCH LARGER and main view) ── */
.views-container.view-mobile {
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.views-container.view-mobile .card.desktop-view {
  display: none !important;
}

.views-container.view-mobile .card.mobile-view {
  display: flex;
  width: 100%;
  max-width: 620px;
}


/* Preview Card */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--card-border-hover);
}

.card-bar {
  height: 38px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-bar-border);
  background: var(--card-bar-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.25s ease, border-color 0.25s ease;
}

[data-theme="light"] .card-bar {
  box-shadow: inset 0 1px 0 #ffffff;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.card-title .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

[data-theme="light"] .card-title .dot {
  background: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.35);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  background: var(--control-bg);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.viewport {
  position: relative;
  width: 100%;
  background: var(--viewport-bg);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  transition: background-color 0.25s ease;
}

.viewport:active {
  cursor: grabbing;
}

.preview-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.viewport-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-secondary);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.viewport:hover .viewport-hint {
  opacity: 1;
}

/* ── Drag & Drop Overlay ─────────────────────────────────────── */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

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

.drop-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 60px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
}

/* ── Minimal Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 22px;
  right: 24px;
  background: var(--dock-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 7px 12px;
  border-radius: 7px;
  box-shadow: var(--dock-shadow);
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.18s ease;
  pointer-events: none;
  z-index: 200;
}


.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive Adaptations ──────────────────────────────────── */
@media (max-width: 1140px) {
  .studio-workspace {
    flex-direction: column;
  }
  .studio-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }
  .studio-stage {
    padding: 20px 16px 60px;
  }
}
