:root {
  --bg-app: #09090b;
  --bg-panel: #121216;
  --bg-card: #18181e;
  --bg-card-hover: #202028;
  --bg-input: #0e0e12;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --gold: #d4a853;
  --gold-bright: #e7c275;
  --gold-soft: rgba(212, 168, 83, 0.14);
  --gold-glow: rgba(212, 168, 83, 0.28);
  --text-main: #f3f0ea;
  --text-sub: #a5a199;
  --text-muted: #6f6c66;
  --success: #45b97c;
  --warn: #e6a23c;
  --danger: #e25c5c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="light"] {
  --bg-app: #f3efe8;
  --bg-panel: #fbf9f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f4efe6;
  --bg-input: #f6f3ed;
  --border: rgba(28, 25, 23, 0.1);
  --border-strong: rgba(28, 25, 23, 0.2);
  --gold: #a97b25;
  --gold-bright: #8c6315;
  --gold-soft: rgba(169, 123, 37, 0.12);
  --gold-glow: rgba(169, 123, 37, 0.22);
  --text-main: #1b1917;
  --text-sub: #57534e;
  --text-muted: #8a847c;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
}

/* Top Bar */
.topbar {
  min-height: 54px;
  padding: 6px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d4a853, #966c21);
  color: #0b0b0d;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px var(--gold-glow);
  flex-shrink: 0;
}

.brand-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2.2px;
  color: var(--gold-bright);
}

.brand-sub {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}

.market-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 999px;
}

.market-pill {
  border: none;
  background: transparent;
  color: var(--text-sub);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.market-pill:hover {
  color: var(--text-main);
}

.market-pill.active {
  background: var(--gold-soft);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 83, 0.45);
}

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

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn-ghost:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}
.status-dot.cloud {
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold);
}

/* Market Context Strip */
.market-banner {
  background: linear-gradient(90deg, rgba(212, 168, 83, 0.08), rgba(212, 168, 83, 0.02));
  border-bottom: 1px solid var(--border);
  padding: 6px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-sub);
  flex-wrap: wrap;
}

.market-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  border: 1px solid rgba(212, 168, 83, 0.35);
  font-size: 11px;
  font-weight: 600;
}

.badge-tag.warn {
  background: rgba(230, 162, 60, 0.15);
  color: #f3be6b;
  border-color: rgba(230, 162, 60, 0.45);
}

/* Main 3-Column Studio Grid */
.studio-grid {
  display: grid;
  grid-template-columns: 332px minmax(420px, 1fr) 425px;
  height: calc(100vh - 88px);
  overflow: hidden;
}

.col-pane {
  height: 100%;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.col-left {
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
}

.col-mid {
  border-right: 1px solid var(--border);
  background: var(--bg-app);
}

.col-right {
  background: var(--bg-panel);
}

/* Panel & Card Primitives */
.studio-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 7px;
}

.section-counter {
  font-size: 11px;
  color: var(--gold-bright);
  background: var(--gold-soft);
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 600;
}

.sub-label {
  font-size: 11.5px;
  color: var(--text-sub);
}

/* Reference Slots */
.ref-slot {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-slot-top {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.ref-thumb-box {
  width: 78px;
  height: 102px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ref-thumb-box:hover {
  border-color: var(--gold);
}

.ref-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-thumb-placeholder {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}

.ref-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
}

.ref-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ref-title {
  font-size: 12.5px;
  font-weight: 600;
}

.ref-presets-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mini-preset-btn {
  width: 34px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  flex-shrink: 0;
  opacity: 0.72;
  transition: all 0.15s;
}

.mini-preset-btn:hover,
.mini-preset-btn.active {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.mini-preset-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-clear-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}
.mini-clear-btn:hover {
  color: var(--danger);
}

/* Toggle & Range Slider */
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-sub);
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  transition: 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .switch-slider {
  background: var(--gold);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(16px);
  background: #0b0b0d;
}

.gold-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}
[data-theme="light"] .gold-range {
  background: rgba(0, 0, 0, 0.15);
}
.gold-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-bright);
  cursor: pointer;
  box-shadow: 0 0 8px var(--gold-glow);
}

.inline-select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11.5px;
  outline: none;
}
.inline-select:focus {
  border-color: var(--gold);
}

/* Chips */
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip-btn {
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-sub);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.chip-btn.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 500;
}

/* Pose Library */
.pose-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pose-tab {
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-sub);
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pose-tab.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 600;
}

.pose-search {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
  outline: none;
}
.pose-search:focus {
  border-color: var(--gold);
}

.pose-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  max-height: 330px;
  overflow-y: auto;
  padding-right: 2px;
}

.pose-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: all 0.15s;
}

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

.pose-card.selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 1px rgba(212, 168, 83, 0.35);
}

.pose-svg {
  width: 100%;
  height: 76px;
  display: block;
}

.pose-code {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pose-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-size: 9px;
  display: grid;
  place-items: center;
  color: #0b0b0d;
}

.pose-card.selected .pose-check {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

.pose-name {
  font-size: 10.5px;
  color: var(--text-sub);
  text-align: center;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pose-card.selected .pose-name {
  color: var(--text-main);
  font-weight: 500;
}

/* Middle Column: Prompt Workshop */
.idea-textarea {
  width: 100%;
  min-height: 82px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  resize: vertical;
  outline: none;
}
.idea-textarea:focus {
  border-color: var(--gold);
}

.btn-gold {
  background: linear-gradient(135deg, #e2ba6a, #c1913a);
  color: #0b0b0d;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(212, 168, 83, 0.25);
  transition: transform 0.12s, filter 0.15s;
}
.btn-gold:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-gold:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--gold-bright);
  border: 1px solid rgba(212, 168, 83, 0.45);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-secondary:hover {
  background: var(--gold-soft);
}

.cta-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.four-dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dim-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-bright);
}

.dim-textarea {
  width: 100%;
  min-height: 76px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.48;
  padding: 4px;
  resize: vertical;
  outline: none;
}
.dim-textarea:focus {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}

.master-prompt-box {
  width: 100%;
  min-height: 92px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  padding: 10px;
  resize: vertical;
  outline: none;
}
.master-prompt-box:focus {
  border-color: var(--gold);
}

.seg-toggle {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
}
.seg-btn.active {
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-weight: 600;
}

.collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

/* Right Column: Output Studio (Image + Video) */
.studio-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.mode-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.24), rgba(212, 168, 83, 0.1));
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 83, 0.45);
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ratio-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 4px;
  text-align: center;
  cursor: pointer;
  color: var(--text-sub);
  font-size: 11.5px;
}
.ratio-card strong {
  display: block;
  color: var(--text-main);
  font-size: 12.5px;
}
.ratio-card.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.ratio-card.active strong {
  color: var(--gold-bright);
}

.stage-viewport {
  background: #070709;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 290px;
  max-height: 360px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.stage-viewport img,
.stage-viewport video,
.stage-viewport canvas {
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
  display: block;
}

.stage-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.stage-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(11, 11, 13, 0.8);
  border: 1px solid rgba(212, 168, 83, 0.45);
  color: var(--gold-bright);
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.stage-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.filmstrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}

.film-thumb {
  width: 58px;
  height: 76px;
  border-radius: 7px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-input);
}

.film-thumb.active {
  border-color: var(--gold-bright);
}

.film-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-idx {
  position: absolute;
  bottom: 2px;
  right: 3px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 9px;
  padding: 0 4px;
  border-radius: 4px;
}

/* Video Studio Source Frame Picker */
.video-source-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}

.vsrc-card {
  width: 58px;
  height: 76px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  opacity: 0.72;
}
.vsrc-card.selected {
  opacity: 1;
  border: 2px solid var(--gold-bright);
}
.vsrc-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vsrc-order {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-bright);
  color: #0b0b0d;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c1913a, #f0cf85);
  transition: width 0.2s ease;
}

/* History Panel */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
}

.history-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.history-item:hover {
  border-color: var(--gold);
}

.history-thumb {
  width: 40px;
  height: 50px;
  border-radius: 5px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--gold-bright);
}

.history-info {
  flex: 1;
  min-width: 0;
}
.history-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  font-size: 10.5px;
  color: var(--text-muted);
}

.history-del {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px;
}
.history-del:hover {
  color: var(--danger);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.84);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: grid;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: min(760px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.lightbox-card {
  width: min(980px, 95vw);
}

.lightbox-stage {
  background: #050507;
  border-radius: 12px;
  height: 62vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.1s ease-out;
}

.size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.size-table th,
.size-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: left;
}
.size-table th {
  color: var(--text-sub);
  font-weight: 600;
}
.size-table td.highlight-cell {
  color: var(--gold-bright);
  font-weight: 700;
  background: var(--gold-soft);
}
.size-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 11.5px;
  color: var(--text-sub);
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  outline: none;
}
.form-input:focus {
  border-color: var(--gold);
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1c22;
  border: 1px solid var(--gold);
  color: var(--text-main);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.user-chip {
  font-size: 11.5px;
  color: var(--gold-bright);
  background: var(--gold-soft);
  border: 1px solid rgba(212, 168, 83, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.cred-banner {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.16), rgba(212, 168, 83, 0.06));
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.role-staff-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
  border: 1px solid var(--border);
  font-size: 11px;
}

.status-pill-on {
  color: var(--success);
  font-size: 11.5px;
  font-weight: 600;
}

.status-pill-off {
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 600;
}

.table-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mini-action-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}
.mini-action-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}
.mini-action-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

@media (max-width: 1560px) {
  .brand-sub {
    display: none;
  }
}

@media (max-width: 1240px) {
  .market-switcher {
    flex-wrap: wrap;
    border-radius: 10px;
  }
  .topbar-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 1180px) {
  .studio-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .col-pane {
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
