@import url('./design-system/tokens.css?v=1.36.0');

:root {
  color-scheme: light;
  /* Kompatibilitätsbrücke: bestehende Oberfläche bleibt unverändert, neue Module verwenden --vd-* direkt. */
  --bg: var(--vd-canvas);
  --bg-card: var(--vd-surface-raised);
  --bg-input: var(--vd-surface-raised);
  --bg-hover: var(--vd-surface-muted);
  --bg-page: var(--vd-surface-quiet);
  --border: var(--vd-line);
  --border-focus: var(--vd-brand);
  --text: var(--vd-ink);
  --text-muted: var(--vd-ink-muted);
  --text-secondary: var(--vd-ink-secondary);
  --accent: var(--vd-brand);
  --accent-hover: var(--vd-brand-strong);
  --accent-light: var(--vd-brand-soft);
  --orange: var(--vd-warning);
  --orange-hover: var(--vd-warning);
  --orange-light: var(--vd-warning-soft);
  --success: var(--vd-success);
  --danger: var(--vd-danger);
  --warning: var(--vd-warning);
  --radius: var(--vd-radius-md);
  --radius-sm: var(--vd-radius-sm);
  --shadow-sm: none;
  --shadow: var(--vd-shadow-soft);
}

[data-theme="dark"] { color-scheme: dark; }
[data-theme="contrast"] { color-scheme: dark; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* --- Sidebar --- */
.sidebar {
  width: 230px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 120;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-group {
  padding: 10px 10px 2px;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item span { flex: 1; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: var(--accent); }

.nav-badge {
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 5px;
  background: var(--danger);
  color: white;
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.sidebar-logout:hover { color: var(--danger); background: rgba(192,57,43,0.08); }

.sidebar-footer .theme-toggle {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-sm);
  height: 32px;
}

/* --- Main Wrapper --- */
.main-wrapper {
  flex: 1;
  margin-left: 230px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

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

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--accent); }
.topbar-btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.topbar-btn.primary:hover { background: var(--accent-hover); }

main { max-width: 960px; margin: 0 auto; padding: 24px 28px; width: 100%; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Generator Grid */
.generator-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 600px) { .generator-grid { grid-template-columns: 1fr 240px; } }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.dropzone p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.photo-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-preview .thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.photo-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .thumb .remove-photo {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(0,0,0,0.6); color: white; border: none;
  cursor: pointer; font-size: 12px; display: flex; align-items: center;
  justify-content: center; opacity: 0; transition: opacity 0.15s;
}
.photo-preview .thumb .edit-photo {
  position: absolute; top: 4px; left: 4px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: white; border: 2px solid white;
  cursor: pointer; font-size: 12px; display: flex; align-items: center;
  justify-content: center; transition: transform 0.15s, background 0.15s;
  z-index: 2; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.photo-preview .thumb .edit-photo:hover { background: var(--accent-hover); transform: scale(1.15); }
.photo-preview .thumb:hover .remove-photo { opacity: 1; }

.image-tools { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.config-section { display: flex; flex-direction: column; gap: 14px; }
.config-group label {
  display: block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 6px;
}
.button-group { display: flex; gap: 5px; flex-wrap: wrap; }

.toggle-btn {
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--text-secondary); padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.15s;
}
.toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.toggle-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

.model-select, select {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border);
  color: var(--text); padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer;
}
.model-select:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.primary-btn {
  background: var(--accent); color: white; border: none;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s;
  box-shadow: var(--shadow-sm);
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.secondary-btn {
  background: var(--bg-card); color: var(--text); border: 1.5px solid var(--border);
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px;
  cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.secondary-btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }

.small-btn {
  background: var(--bg-card); color: var(--text-secondary); border: 1.5px solid var(--border);
  padding: 5px 10px; border-radius: var(--radius-sm); font-size: 12px;
  cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.small-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Meta Section */
.meta-section {
  margin-top: 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.meta-section h2 { font-size: 14px; margin-bottom: 12px; color: var(--text-muted); }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.meta-grid-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.meta-edit-item { display: flex; flex-direction: column; gap: 3px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.6px; font-weight: 600; }
.meta-value { font-size: 14px; font-weight: 500; }
.meta-input {
  background: var(--bg-input); border: 1.5px solid var(--border); color: var(--text);
  padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px; width: 100%;
}
.meta-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.fee-info {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
}
.fee-info .fee-net { font-size: 16px; font-weight: 600; color: var(--success); }

/* Variant tabs */
.variant-tabs { display: flex; gap: 6px; margin: 16px 0 0; }
.variant-tab {
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--text-muted); padding: 6px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s;
}
.variant-tab.active { background: var(--orange); border-color: var(--orange); color: white; }

/* Results */
.result-section {
  margin-top: 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.result-section h2 { font-size: 15px; margin-bottom: 14px; }
.result-field { margin-bottom: 14px; }
.field-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.field-header label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.copy-btn {
  background: none; border: 1.5px solid var(--border); color: var(--text-muted);
  padding: 3px 8px; border-radius: 6px; font-size: 11px;
  cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.copy-btn:hover { border-color: var(--orange); color: var(--orange); }

.result-input, .result-textarea {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border);
  color: var(--text); padding: 9px 11px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; resize: vertical;
}
.result-input:focus, .result-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.result-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Loading */
.loading { text-align: center; padding: 48px; }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--orange); border-radius: 50%;
  margin: 0 auto 16px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--text-muted); font-size: 14px; }

/* History */
.history-toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.history-toolbar input, .history-toolbar select {
  background: var(--bg-input); border: 1.5px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px;
}
.history-toolbar input { flex: 1; min-width: 150px; }
.history-toolbar input:focus, .history-toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

/* History batch bar */
.history-batch-bar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.history-select-all-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; font-weight: 500; }
.history-select-all-wrap input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.history-batch-bar span { font-size: 13px; color: var(--text-muted); }
.danger-btn { color: var(--danger) !important; border-color: var(--danger) !important; }
.danger-btn:hover { background: rgba(192,57,43,0.08) !important; }
.danger-btn:disabled { opacity: 0.4; }
.history-toolbar input[type="date"] {
  background: var(--bg-input); border: 1.5px solid var(--border); color: var(--text);
  padding: 7px 8px; border-radius: var(--radius-sm); font-size: 12px;
}

.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex; align-items: center; gap: 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; cursor: pointer; transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.history-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.history-item .thumb-small { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--bg-page); }
.history-item .item-info { flex: 1; min-width: 0; }
.history-item .item-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item .item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.history-item .item-actions { display: flex; gap: 4px; align-items: center; }

.status-badge {
  font-size: 10px; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; font-weight: 600;
}
.status-active { background: rgba(44,110,73,0.1); color: var(--success); }
.status-sold { background: rgba(192,57,43,0.1); color: var(--danger); }
.status-reserved { background: var(--orange-light); color: var(--warning); }

.status-select {
  background: var(--bg-input); border: 1.5px solid var(--border); color: var(--text);
  padding: 3px 6px; border-radius: 4px; font-size: 11px; cursor: pointer;
}

.history-item .delete-btn {
  background: none; border: 1px solid transparent; color: var(--text-muted);
  padding: 3px 6px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 11px; transition: all 0.15s;
}
.history-item .delete-btn:hover { color: var(--danger); border-color: var(--danger); }

.history-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }

.history-detail { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.history-detail h3 { margin: 14px 0 6px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.history-detail p, .history-detail .detail-value { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.history-detail .detail-photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.history-detail .detail-photos img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }

/* Detail edit fields */
.detail-edit-group { margin-bottom: 14px; }
.detail-edit-group label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px; }
.detail-edit-group input, .detail-edit-group textarea, .detail-edit-group select {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border);
  color: var(--text); padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; resize: vertical;
}
.detail-edit-group input:focus, .detail-edit-group textarea:focus, .detail-edit-group select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.detail-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .detail-edit-row { grid-template-columns: 1fr; } }
.detail-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Templates */
.templates-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.templates-header h2 { font-size: 16px; }
.template-list { display: flex; flex-direction: column; gap: 6px; }
.template-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.template-item .tpl-info { flex: 1; }
.template-item .tpl-name { font-size: 14px; font-weight: 500; }
.template-item .tpl-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.template-item .tpl-actions { display: flex; gap: 6px; }
.template-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.template-form h3 { font-size: 15px; margin-bottom: 16px; }

/* Fee calculator */
.fee-results { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.fee-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm);
}
.fee-card .fee-platform { font-weight: 600; font-size: 14px; }
.fee-card .fee-breakdown { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.fee-card .fee-amounts { text-align: right; }
.fee-card .fee-net-amount { font-size: 18px; font-weight: 700; color: var(--success); }
.fee-card .fee-deducted { font-size: 12px; color: var(--text-muted); }

/* Inventory */
.inventory-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.inventory-header h2 { margin: 0; }
.inventory-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.inv-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.inv-stat-value { font-size: 24px; font-weight: 700; color: var(--accent); }
.inv-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.inventory-locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.inv-location-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.inv-location-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.inv-loc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.inv-loc-icon { color: var(--accent); flex-shrink: 0; }
.inv-loc-name { font-weight: 600; font-size: 15px; }
.inv-loc-stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-muted); }
.inv-loc-count { font-weight: 500; color: var(--text); }
.inv-loc-sold { color: var(--orange); }
.inv-loc-reserved { color: var(--accent); }
.inv-loc-value { margin-top: 8px; font-size: 16px; font-weight: 600; color: var(--accent); }
.inv-unassigned { border-style: dashed; opacity: 0.8; }
.inv-unassigned .inv-loc-icon { color: var(--text-muted); }
.inventory-detail-actions { display: flex; gap: 8px; margin: 12px 0; }
.inv-item-check { margin-right: 10px; }

/* Settings */
.settings-form { max-width: 500px; }
.setting-group { margin-bottom: 18px; }
.setting-group > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.setting-group small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.setting-group input, .setting-group select, .setting-group textarea {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border);
  color: var(--text); padding: 9px 11px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; resize: vertical;
}
.setting-group input:focus, .setting-group select:focus, .setting-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.key-input-wrap { display: flex; gap: 6px; }
.key-input-wrap input { flex: 1; }
.toggle-visibility {
  background: var(--bg-card); border: 1.5px solid var(--border); color: var(--text-muted);
  padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; white-space: nowrap;
  font-weight: 500;
}
.toggle-visibility:hover { border-color: var(--accent); color: var(--accent); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card); border: 1.5px solid var(--success);
  color: var(--text); padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; transform: translateY(100px); opacity: 0;
  transition: all 0.3s; z-index: 1000; box-shadow: var(--shadow);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Publish tab */
.publish-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.publish-header h2 { font-size: 16px; }
.publish-actions-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.publish-actions-bar span { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.publish-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.publish-filters input, .publish-filters select {
  background: var(--bg-input); border: 1.5px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px;
}
.publish-filters input { flex: 1; min-width: 150px; }
.publish-filters input:focus, .publish-filters select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.publish-list { display: flex; flex-direction: column; gap: 6px; }
.publish-item {
  display: flex; align-items: center; gap: 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; transition: all 0.15s; box-shadow: var(--shadow-sm);
}
.publish-item:hover { border-color: var(--accent); }
.publish-item input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }
.publish-item .thumb-small { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--bg-page); }
.publish-item .item-info { flex: 1; min-width: 0; }
.publish-item .item-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.publish-item .item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.publish-item .item-publish-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.publish-badges { display: flex; gap: 4px; margin-right: 8px; }
.publish-badge {
  font-size: 9px; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; font-weight: 600;
}
.publish-badge.copied { background: var(--orange-light); color: var(--orange); }
.publish-badge.published { background: rgba(44,110,73,0.1); color: var(--success); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--bg-card); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-header h3 { font-size: 15px; }
.modal-close {
  background: none; border: none; font-size: 22px; color: var(--text-muted);
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }

.smart-copy-field { margin-bottom: 14px; }
.smart-copy-field .field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.smart-copy-field label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.smart-copy-field input, .smart-copy-field textarea {
  width: 100%; background: var(--bg-page); border: 1.5px solid var(--border);
  color: var(--text); padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; resize: vertical;
}
.smart-copy-field textarea { min-height: 80px; }

.smart-copy-steps {
  background: var(--accent-light); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 16px;
}
.smart-copy-steps h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.smart-copy-steps ol { padding-left: 18px; font-size: 13px; line-height: 1.8; color: var(--text-secondary); }

.smart-copy-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.smart-copy-photos img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-sm); }

.smart-copy-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Etsy connect */
.etsy-connect-wrap { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.etsy-status { font-size: 12px; font-weight: 600; }
.etsy-status.connected { color: var(--success); }
.etsy-status.disconnected { color: var(--text-muted); }

/* HTML Preview */
.html-preview {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px; min-height: 80px; line-height: 1.6; font-size: 14px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
.html-source {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; tab-size: 2;
  background: #2c2c2a; color: #e8e8e0; border-radius: var(--radius-sm);
  padding: 14px;
}

/* Quill editor overrides */
.ql-toolbar.ql-snow {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  background: var(--bg-page) !important;
  font-family: inherit !important;
}
.ql-container.ql-snow {
  border: 1.5px solid var(--border) !important;
  border-top: none !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  min-height: 120px;
  background: var(--bg-input);
}
.ql-editor { min-height: 100px; line-height: 1.7; color: var(--text); }
.ql-editor.ql-blank::before { color: var(--text-muted) !important; font-style: normal !important; }
.ql-snow .ql-stroke { stroke: var(--text-secondary) !important; }
.ql-snow .ql-fill { fill: var(--text-secondary) !important; }
.ql-snow .ql-picker-label { color: var(--text-secondary) !important; }
.ql-snow .ql-active .ql-stroke { stroke: var(--accent) !important; }
.ql-snow .ql-active .ql-fill { fill: var(--accent) !important; }
.ql-snow .ql-active { color: var(--accent) !important; }
.ql-snow .ql-picker-options { background: var(--bg-card) !important; border-color: var(--border) !important; border-radius: var(--radius-sm) !important; }
.ql-editor:focus { box-shadow: inset 0 0 0 1px var(--accent); }

.hidden { display: none !important; }
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }

/* Category Picker */
.cat-picker-wrap { position: relative; }
.cat-picker-wrap .cat-search { width: 100%; }
.cat-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-height: 260px; overflow-y: auto; z-index: 20;
  scrollbar-width: thin;
}
.cat-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.cat-result-item {
  padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--bg-hover);
}
.cat-result-item:hover { background: var(--accent-light); }
.cat-result-name { font-weight: 600; font-size: 13px; color: var(--text); }
.cat-result-path { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cat-group-hd {
  padding: 7px 10px; font-size: 13px; font-weight: 700; color: var(--accent);
  cursor: pointer; background: var(--bg-hover); border-bottom: 1px solid var(--border);
}
.cat-group-hd:hover { background: var(--bg-page); }
.cat-group-hd::before { content: '▸ '; font-size: 10px; color: var(--text-muted); }
.cat-group-hd.expanded::before { content: '▾ '; }
.cat-sub-hd {
  padding: 5px 10px 5px 18px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); background: var(--bg);
}
.cat-leaf {
  padding: 5px 10px 5px 28px; font-size: 12px; cursor: pointer; color: var(--text);
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.cat-leaf:hover { background: var(--accent-light); color: var(--accent); }
.cat-selected-display {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--accent-light);
  border: 1px solid var(--accent); font-size: 13px;
  color: var(--accent); font-weight: 500;
}
.cat-sel-clear {
  margin-left: auto; cursor: pointer; font-size: 16px; line-height: 1;
  color: var(--text-muted); background: none; border: none; padding: 0 2px;
}
.cat-sel-clear:hover { color: var(--danger); }

/* SKU Badge */
.sku-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--accent-light); color: var(--accent);
  padding: 1px 5px; margin-right: 6px; letter-spacing: 0.3px;
}

/* Publish badges in history */
.item-pub-badges { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.publish-badge {
  font-size: 9px; font-weight: 600; padding: 1px 6px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.pub-published { background: #e8f5e9; color: var(--accent); }
.pub-copied { background: var(--orange-light); color: var(--orange); }
.pub-pending { background: #f0f0f0; color: #999; }
.pub-failed { background: #fce4e4; color: #c62828; }

/* Detail header with QR */
.detail-header-row { display: flex; gap: 16px; align-items: flex-start; }
.detail-header-row .detail-photos { flex: 1; }
.detail-qr-wrap {
  flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; gap: 4px; padding: 8px;
  background: var(--bg); border: 1px solid var(--border);
}
.detail-sku-big { font-size: 14px; font-weight: 800; color: var(--accent); letter-spacing: 0.5px; }

/* Dark Mode */
[data-theme="dark"] {
  --bg: #1a1a1e;
  --bg-card: #242428;
  --bg-input: #2c2c30;
  --bg-hover: #32323a;
  --bg-page: #18181c;
  --border: #3a3a42;
  --border-focus: #3d9e6a;
  --text: #e4e4e0;
  --text-muted: #8a8a90;
  --text-secondary: #b0b0b4;
  --accent: #3d9e6a;
  --accent-hover: #4db87a;
  --accent-light: rgba(61,158,106,0.12);
  --orange: #e09040;
  --orange-hover: #d08030;
  --orange-light: rgba(224,144,64,0.12);
  --success: #3d9e6a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}
[data-theme="dark"] .sidebar { background: #1e1e22; border-color: var(--border); }
[data-theme="dark"] .html-preview { background: var(--bg-input); }
[data-theme="dark"] .ql-editor { color: var(--text); }
[data-theme="dark"] .ql-container.ql-snow { background: var(--bg-input) !important; }
[data-theme="dark"] .ql-toolbar.ql-snow { background: var(--bg-hover) !important; }

.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  height: 32px; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all 0.15s; flex-shrink: 0;
  padding: 0 8px; gap: 6px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--text); margin-top: 4px; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.orange .stat-value { color: var(--orange); }

.chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.chart-card h3 { font-size: 14px; margin-bottom: 12px; color: var(--text-muted); }
.chart-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chart-bar-label { font-size: 12px; min-width: 100px; color: var(--text-secondary); }
.chart-bar-track { flex: 1; height: 22px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; display: flex; align-items: center; padding-left: 8px; font-size: 11px; font-weight: 600; color: #fff; }
.chart-bar-fill.green { background: var(--accent); }
.chart-bar-fill.orange { background: var(--orange); }
.chart-bar-fill.blue { background: #4a90d9; }

/* Advanced Image Editor */
.photo-editor-overlay {
  position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(8, 10, 12, .78); backdrop-filter: blur(8px);
}
.photo-editor {
  width: min(1420px, 98vw); max-height: 94vh; overflow: hidden; display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--vd-surface, var(--bg-card));
  border: 1px solid var(--vd-line, var(--border)); border-radius: 16px; box-shadow: 0 28px 90px rgba(0,0,0,.42);
}
.photo-editor-header {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 15px 18px; border-bottom: 1px solid var(--vd-line, var(--border));
}
.photo-editor-header > div { min-width: 0; }
.photo-editor-header h3 { margin: 2px 0 0; color: var(--vd-ink, var(--text)); font-size: 18px; }
.photo-editor-header small { display: block; margin-top: 4px; color: var(--vd-ink-muted, var(--text-muted)); font-size: 11px; }
.photo-editor-kicker { color: var(--vd-brand, var(--accent)); font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.photo-editor-toolbar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 9px 18px;
  border-bottom: 1px solid var(--vd-line, var(--border)); background: var(--vd-surface-muted, var(--bg-page));
}
.photo-editor-toolbar .small-btn.active, .pe-button-grid .small-btn.active { background: var(--vd-brand, var(--accent)); color: #fff; border-color: transparent; }
.pe-history-status { margin-left: auto; color: var(--vd-ink-muted, var(--text-muted)); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.photo-editor-workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; overflow: hidden; }
.photo-editor-stage {
  min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: stretch;
  gap: 10px; padding: 14px; overflow: auto; background:
    linear-gradient(45deg, rgba(120,120,120,.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(120,120,120,.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(120,120,120,.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(120,120,120,.06) 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.photo-editor-stage:has(.pe-before-pane:not(.hidden)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pe-preview-pane { min-width: 0; min-height: 420px; position: relative; display: flex; align-items: center; justify-content: center; padding: 28px 12px 12px; border: 1px solid var(--vd-line, var(--border)); border-radius: 12px; background: rgba(15,18,20,.78); }
.pe-preview-pane > span { position: absolute; top: 8px; left: 10px; z-index: 2; padding: 4px 7px; border-radius: 999px; color: #fff; background: rgba(0,0,0,.58); font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .08em; }
.pe-preview-pane canvas { display: block; max-width: 100%; max-height: calc(94vh - 250px); object-fit: contain; border-radius: 5px; box-shadow: 0 12px 36px rgba(0,0,0,.34); }
.photo-editor-canvas-wrap { min-width: 0; min-height: 0; width: 100%; height: 100%; position: relative; display: flex; align-items: center; justify-content: center; }
.photo-editor-canvas-wrap .crop-overlay { position: absolute; z-index: 4; cursor: crosshair; touch-action: none; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.pe-stage-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--vd-ink-muted, var(--text-muted)); font-size: 10px; }
.photo-editor-sidebar { min-height: 0; overflow-y: auto; padding: 12px; border-left: 1px solid var(--vd-line, var(--border)); background: var(--vd-surface-muted, var(--bg-page)); }
.pe-control-group { margin-bottom: 9px; border: 1px solid var(--vd-line, var(--border)); border-radius: 10px; background: var(--vd-surface, var(--bg-card)); overflow: hidden; }
.pe-control-group > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 10px 11px; color: var(--vd-ink, var(--text)); font-size: 11px; font-weight: 800; }
.pe-control-group > summary::-webkit-details-marker { display: none; }
.pe-control-group > summary::after { content: '⌄'; color: var(--vd-ink-muted, var(--text-muted)); }
.pe-control-group:not([open]) > summary::after { content: '›'; }
.pe-control-body { display: grid; gap: 9px; padding: 10px 11px 12px; border-top: 1px solid var(--vd-line, var(--border)); }
.pe-control-body .editor-row { display: grid; grid-template-columns: 88px minmax(0,1fr) 44px; gap: 8px; align-items: center; }
.pe-control-body .editor-row label, .pe-export-grid > label, .pe-crop-controls > label { color: var(--vd-ink-muted, var(--text-muted)); font-size: 10px; font-weight: 700; }
.pe-control-body input[type="range"] { width: 100%; accent-color: var(--vd-brand, var(--accent)); }
.pe-control-body .range-val { min-width: 40px; color: var(--vd-ink-secondary, var(--text-secondary)); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.pe-button-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.pe-button-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.pe-button-grid .small-btn { justify-content: center; }
.pe-crop-controls { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 8px; align-items: center; }
.pe-crop-controls .pe-button-grid { grid-column: 1 / -1; }
.pe-control-body select, .pe-control-body input[type="number"] { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid var(--vd-line, var(--border)); border-radius: 7px; color: var(--vd-ink, var(--text)); background: var(--vd-surface, var(--bg-input)); }
.pe-export-grid { grid-template-columns: 88px minmax(0,1fr); align-items: center; }
.pe-inline-control { display: grid; grid-template-columns: minmax(0,1fr) 40px; gap: 8px; align-items: center; }
.pe-custom-size { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: center; }
.pe-version-list { display: grid; gap: 6px; max-height: 210px; overflow-y: auto; }
.pe-version-item { width: 100%; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--vd-line, var(--border)); border-radius: 8px; color: var(--vd-ink, var(--text)); background: var(--vd-surface-muted, var(--bg-page)); text-align: left; cursor: pointer; }
.pe-version-item:hover, .pe-version-item.active { border-color: var(--vd-brand, var(--accent)); background: color-mix(in srgb, var(--vd-brand, var(--accent)) 9%, var(--vd-surface, var(--bg-card))); }
.pe-version-item > span { display: grid; place-items: center; min-height: 30px; border-radius: 6px; color: var(--vd-brand, var(--accent)); background: color-mix(in srgb, var(--vd-brand, var(--accent)) 12%, transparent); font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.pe-version-item strong { display: block; font-size: 10px; }
.pe-version-item small { display: block; margin-top: 3px; color: var(--vd-ink-muted, var(--text-muted)); font-size: 8px; line-height: 1.35; }
.photo-editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--vd-line, var(--border)); background: var(--vd-surface, var(--bg-card)); }
.photo-editor-actions > div { margin-right: auto; }
.photo-editor-actions strong { display: block; color: var(--vd-ink, var(--text)); font-size: 10px; }
.photo-editor-actions small { display: block; margin-top: 2px; color: var(--vd-ink-muted, var(--text-muted)); font-size: 9px; }
@media (max-width: 980px) {
  .photo-editor { max-height: 96vh; }
  .photo-editor-workspace { grid-template-columns: 1fr; overflow-y: auto; }
  .photo-editor-sidebar { overflow: visible; border-left: 0; border-top: 1px solid var(--vd-line, var(--border)); }
  .pe-preview-pane { min-height: 320px; }
  .pe-preview-pane canvas { max-height: 52vh; }
}
@media (max-width: 680px) {
  .photo-editor-overlay { padding: 0; }
  .photo-editor { width: 100vw; max-height: 100vh; min-height: 100vh; border-radius: 0; }
  .photo-editor-toolbar { padding-inline: 10px; }
  .photo-editor-stage:has(.pe-before-pane:not(.hidden)) { grid-template-columns: 1fr; }
  .photo-editor-stage { padding: 9px; }
  .pe-preview-pane { min-height: 280px; }
  .pe-history-status { width: 100%; margin-left: 0; }
  .photo-editor-actions { flex-wrap: wrap; }
  .photo-editor-actions > div { width: 100%; margin-right: 0; }
  .photo-editor-actions button { flex: 1; }
}


/* Drag handle for sortable items */
.drag-handle {
  cursor: grab; color: var(--text-muted); font-size: 16px; padding: 0 4px;
  user-select: none; touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.photo-preview .thumb.dragging { opacity: 0.4; }
.photo-preview .thumb.drag-over { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Scheduling */
.schedule-wrap { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.schedule-wrap input[type="datetime-local"] {
  background: var(--bg-input); border: 1.5px solid var(--border); color: var(--text);
  padding: 6px 10px; border-radius: var(--radius-sm); font-size: 13px;
}

/* Backup section */
.backup-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.backup-section h3 { font-size: 14px; margin-bottom: 12px; }
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Role Badge (used in admin) --- */
.role-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 6px;
}
.role-badge.admin { background: #ffeaa7; color: #856404; }
.role-badge.editor { background: #dfe6e9; color: #636e72; }

/* --- Admin Panel --- */
.admin-wrap { max-width: 900px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-header h2 { font-size: 18px; }
.admin-tabs { display: flex; gap: 2px; margin-bottom: 16px; }
.admin-tab {
  padding: 8px 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px 6px 0 0; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-muted); transition: all 0.15s; border-bottom: none;
}
.admin-tab.active { background: var(--bg-card); color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* User list */
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  transition: box-shadow 0.15s;
}
.user-card:hover { box-shadow: var(--shadow); }
.user-card-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 14px; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-info .name { font-weight: 600; font-size: 14px; color: var(--text); }
.user-card-info .email { font-size: 12px; color: var(--text-muted); }
.user-card-info .meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.user-card-actions { display: flex; gap: 6px; align-items: center; }
.user-card .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.user-card .status-dot.online { background: #27ae60; }
.user-card .status-dot.offline { background: #bbb; }
.user-card .status-dot.inactive { background: var(--danger); }

/* Sessions list */
.sessions-list .session-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 6px; font-size: 13px;
}
.session-row .session-info { flex: 1; }
.session-row .session-info .session-ua { font-size: 11px; color: var(--text-muted); }
.session-row .session-info .session-ip { font-size: 11px; color: var(--text-muted); }
.session-row .session-meta { font-size: 11px; color: var(--text-muted); text-align: right; min-width: 100px; }

/* Audit log */
.audit-list { max-height: 600px; overflow-y: auto; }
.audit-row {
  display: flex; gap: 10px; padding: 8px 12px; font-size: 12px;
  border-bottom: 1px solid var(--border); align-items: center;
}
.audit-row:hover { background: var(--bg-hover); }
.audit-row .audit-time { min-width: 130px; color: var(--text-muted); font-size: 11px; }
.audit-row .audit-user { min-width: 120px; font-weight: 500; }
.audit-row .audit-action { flex: 1; }
.audit-action-badge {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
}
.audit-action-badge.login { background: #e3f2fd; color: #1565c0; }
.audit-action-badge.user { background: #fce4ec; color: #c62828; }
.audit-action-badge.listing { background: #e8f5e9; color: #2e7d32; }
.audit-action-badge.session { background: #fff3e0; color: #e65100; }

/* Modals (reusable) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card); border-radius: 12px; width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2); overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 5px; }
.form-group input, .form-group select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg-input); }
.form-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,110,73,0.1); }

/* SMTP Config */
.smtp-config-form { max-width: 500px; }
.smtp-status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 18px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
}
.smtp-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; display: inline-block;
}
.smtp-status-dot.configured { background: var(--success); }
.smtp-status-dot.not-configured { background: var(--text-muted); }
.smtp-actions { display: flex; gap: 8px; margin-top: 16px; }

/* System Info Grid */
.system-info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.system-info-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
}
.system-info-card .sys-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); font-weight: 600;
}
.system-info-card .sys-value {
  font-size: 22px; font-weight: 700; color: var(--text); margin-top: 4px;
}
.system-info-card .sys-value.accent { color: var(--accent); }

/* Password Status Badge */
.pw-status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.pw-status-badge.has-pw { background: rgba(44,110,73,0.1); color: var(--success); }
.pw-status-badge.no-pw { background: rgba(199,123,42,0.1); color: var(--warning); }

/* Login History in Edit Modal */
.login-history-list {
  max-height: 200px; overflow-y: auto; margin-top: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.login-history-item {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 10px; font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.login-history-item:last-child { border-bottom: none; }
.login-history-item .lh-time { min-width: 110px; color: var(--text-muted); }
.login-history-item .lh-ip { color: var(--text-secondary); min-width: 90px; }
.login-history-item .lh-status { font-weight: 600; }
.login-history-item .lh-status.success { color: var(--success); }
.login-history-item .lh-status.failed { color: var(--danger); }

/* User card has_password indicator */
.user-card .pw-indicator {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  font-weight: 600; display: inline-block; margin-left: 6px;
}
.pw-indicator.has-pw { background: rgba(44,110,73,0.1); color: var(--success); }
.pw-indicator.no-pw { background: rgba(199,123,42,0.1); color: var(--warning); }

/* Pagination */
.pagination-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; box-shadow: var(--shadow-sm);
  flex-wrap: wrap; gap: 8px;
}
#history-pagination-bottom, #publish-pagination-bottom {
  margin-top: 8px; margin-bottom: 0;
}
.pagination-sizes { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.page-size-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 3px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.15s;
}
.page-size-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-size-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.pagination-nav { display: flex; align-items: center; gap: 8px; }
.page-nav-btn {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.15s;
}
.page-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--text-muted); font-weight: 500; min-width: 100px; text-align: center; }

/* Trash / Papierkorb */
.trash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.trash-header h2 { font-size: 16px; }
.trash-actions-bar { display: flex; align-items: center; gap: 12px; }
.trash-info-text { font-size: 12px; color: var(--text-muted); }
.trash-list { display: flex; flex-direction: column; gap: 6px; }
.trash-item {
  display: flex; align-items: center; gap: 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; transition: all 0.15s; box-shadow: var(--shadow-sm);
  opacity: 0.7;
}
.trash-item:hover { opacity: 1; border-color: var(--border); }
.trash-item .thumb-small { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--bg-page); filter: grayscale(40%); }
.trash-item .item-info { flex: 1; min-width: 0; }
.trash-item .item-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-item .item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.trash-item .trash-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.trash-item .restore-btn {
  background: none; border: 1px solid var(--accent); color: var(--accent);
  padding: 3px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 11px; font-weight: 500; transition: all 0.15s;
}
.trash-item .restore-btn:hover { background: var(--accent); color: white; }
.trash-item .perm-delete-btn {
  background: none; border: 1px solid var(--danger); color: var(--danger);
  padding: 3px 8px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 11px; font-weight: 500; transition: all 0.15s;
}
.trash-item .perm-delete-btn:hover { background: var(--danger); color: white; }

/* Trash badge on tab */
.trash-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px; margin-left: 4px;
  line-height: 1;
}

/* Invite method radios */
.invite-method-radios { display: flex; flex-direction: column; gap: 8px; }
.radio-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--text);
}
.radio-label input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.radio-label small { color: var(--text-muted); }

/* Duplicate & bulk status button */
.duplicate-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 3px 6px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 11px; transition: all 0.15s;
}
.duplicate-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Bulk status modal */
.bulk-status-options { display: flex; gap: 8px; margin-top: 12px; }

/* Sidebar mobile toggle */
.sidebar-toggle {
  display: none;
  background: none; border: none; color: var(--text);
  cursor: pointer; padding: 4px;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3);
    z-index: 110; display: none;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 480px) {
  main { padding: 14px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .admin-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .user-card { flex-direction: column; text-align: center; }
  .system-info-grid { grid-template-columns: 1fr 1fr; }
  .admin-tabs { flex-wrap: wrap; }
  .pagination-bar { flex-direction: column; }
  .topbar-actions { gap: 4px; }
  .topbar-btn span { display: none; }
}

/* ==========================================================================
   Vendoo Design System Contract 1.0
   Tokenquelle: public/design-system/tokens/source.json
   Generiert: public/design-system/tokens.css
   ========================================================================== */

html { background: var(--vd-canvas); }
body {
  background: var(--vd-canvas);
  color: var(--vd-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.008em;
}
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--vd-focus);
  outline-offset: 2px;
}

/* App shell */
.sidebar {
  width: var(--vd-sidebar-width);
  background: var(--vd-surface);
  border-right: 1px solid var(--vd-line);
  padding: 0;
  overflow: hidden;
}
.sidebar-header {
  height: var(--vd-topbar-height);
  padding: 0 22px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--vd-line);
}
.sidebar-logo { gap: 9px; color: var(--vd-brand); }
.logo-mark { flex: 0 0 auto; }
.logo-text {
  color: var(--vd-ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.045em;
}
.sidebar-nav { padding: 14px 10px 8px; }
.nav-group { padding: 0; }
.nav-group-primary { display: flex; flex-direction: column; gap: 5px; }
.nav-group-tools { margin-top: 14px; display: flex; flex-direction: column; gap: 3px; }
.nav-divider { height: 1px; background: var(--vd-line); margin: 2px 10px 12px; }
.nav-item {
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--vd-radius-sm);
  color: var(--vd-ink-secondary);
  font-size: 13px;
  font-weight: 540;
  position: relative;
}
.nav-item::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: transparent;
}
.nav-item svg { opacity: .78; }
.nav-item:hover { background: var(--vd-surface-muted); color: var(--vd-ink); }
.nav-item.active {
  color: var(--vd-brand);
  background: var(--vd-brand-soft);
  font-weight: 650;
}
.nav-item.active::before { background: var(--vd-brand); }
.nav-item.active svg { color: var(--vd-brand); }
.nav-item-quiet { min-height: 36px; font-size: 12px; }
.nav-badge { margin-left: auto; background: var(--vd-danger); }
.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--vd-line);
  background: var(--vd-surface);
  gap: 6px;
}
.sidebar-user { padding: 6px; gap: 8px; }
.sidebar-user-avatar, .topbar-avatar {
  background: var(--vd-ink);
  color: var(--vd-surface-raised);
}
.sidebar-user-info { display: none; }
.sidebar-logout { margin-left: auto; }
.sidebar-footer .theme-toggle {
  height: 34px;
  justify-content: flex-start;
  padding: 0 9px;
  gap: 9px;
  border: 0;
  background: transparent;
  color: var(--vd-ink-muted);
  font-size: 12px;
}
.sidebar-footer .theme-toggle:hover { background: var(--vd-surface-muted); color: var(--vd-ink); }

.main-wrapper { margin-left: var(--vd-sidebar-width); }
.topbar {
  min-height: var(--vd-topbar-height);
  height: var(--vd-topbar-height);
  padding: 0 22px 0 26px;
  background: color-mix(in srgb, var(--vd-surface) 94%, transparent);
  border-bottom: 1px solid var(--vd-line);
  backdrop-filter: blur(14px);
  gap: 22px;
}
.topbar-context { display: flex; align-items: center; gap: 10px; min-width: 185px; }
.topbar-context-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--vd-ink-secondary);
}
.topbar-heading { display: flex; align-items: baseline; gap: 9px; }
.topbar-title { font-size: 14px; font-weight: 700; letter-spacing: -0.025em; white-space: nowrap; }
.topbar-kicker { font-size: 11px; color: var(--vd-ink-muted); white-space: nowrap; }
.command-search {
  width: min(470px, 42vw);
  height: 36px;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-muted);
  color: var(--vd-ink-muted);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px 0 12px;
  cursor: pointer;
  text-align: left;
}
.command-search:hover { border-color: var(--vd-line-strong); color: var(--vd-ink-secondary); }
.command-search span { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-search kbd {
  min-width: 34px;
  padding: 2px 5px;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-xs);
  background: var(--vd-surface-raised);
  color: var(--vd-ink-muted);
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}
.topbar-actions { margin-left: auto; gap: 7px; }
.topbar-btn {
  height: 36px;
  border-radius: var(--vd-radius-sm);
  padding: 0 14px;
  border-color: var(--vd-line);
  background: var(--vd-surface-raised);
  color: var(--vd-ink-secondary);
}
.topbar-btn.primary {
  background: var(--vd-brand);
  border-color: var(--vd-brand);
  box-shadow: 0 5px 14px var(--vd-brand-soft);
}
.topbar-btn.primary:hover { background: var(--vd-brand-strong); border-color: var(--vd-brand-strong); }
.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--vd-ink-secondary);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}
.topbar-icon-btn:hover { background: var(--vd-surface-muted); color: var(--vd-ink); }
.topbar-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vd-brand);
  box-shadow: 0 0 0 2px var(--vd-surface);
}
.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 750;
}

main {
  max-width: none;
  margin: 0;
  padding: 20px 24px 28px;
}
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.page-heading h2 { font-size: 22px; line-height: 1.15; letter-spacing: -0.045em; }
.page-heading p { margin-top: 5px; color: var(--vd-ink-secondary); font-size: 12px; }
.eyebrow {
  margin: 0 0 7px !important;
  color: var(--vd-brand) !important;
  font-size: 10px !important;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* Studio Flow */
.studio-flow-page { min-width: 0; }
.studio-summary { display: flex; align-items: center; gap: 14px; color: var(--vd-ink-muted); font-size: 11px; }
.studio-summary strong { color: var(--vd-ink); font-size: 13px; }
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.studio-workspace { min-width: 0; }
.flow-board-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--vd-line-strong) transparent;
}
.flow-board {
  min-width: 1010px;
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
}
.flow-column { min-width: 0; }
.flow-column-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px 7px;
  border-bottom: 1px solid var(--vd-line);
  position: relative;
}
.flow-column:not(:last-child) .flow-column-header::after {
  content: "→";
  position: absolute;
  right: -10px;
  top: 7px;
  color: var(--vd-ink-muted);
  font-size: 10px;
  z-index: 2;
}
.flow-column-title { font-size: 11px; font-weight: 720; color: var(--vd-ink); }
.flow-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-muted);
  font-size: 10px;
  font-weight: 700;
}
.flow-column-list { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.flow-card {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
  color: var(--vd-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.flow-card:hover {
  border-color: var(--vd-line-strong);
  transform: translateY(-1px);
  box-shadow: var(--vd-shadow-soft);
}
.flow-card.selected { border-color: var(--vd-brand); box-shadow: 0 0 0 2px var(--vd-brand-soft); }
.flow-card-media {
  aspect-ratio: 1.45;
  overflow: hidden;
  border-radius: 6px;
  background: var(--vd-surface-muted);
  margin-bottom: 7px;
  position: relative;
}
.flow-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flow-card-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--vd-ink-muted); }
.flow-card-title {
  min-height: 30px;
  font-size: 11px;
  line-height: 1.32;
  font-weight: 680;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.flow-card-sku { margin-top: 4px; color: var(--vd-ink-muted); font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; }
.flow-card-footer { margin-top: 7px; display: flex; align-items: center; gap: 5px; min-height: 20px; }
.flow-platform { font-size: 9px; font-weight: 780; text-transform: uppercase; letter-spacing: .025em; }
.flow-price { margin-left: auto; font-size: 10px; font-weight: 730; white-space: nowrap; }
.flow-state {
  margin-left: auto;
  min-height: 19px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-secondary);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.flow-state.success { background: var(--vd-success-soft); color: var(--vd-success); }
.flow-state.warning { background: var(--vd-warning-soft); color: var(--vd-warning); }
.flow-state.brand { background: var(--vd-brand-soft); color: var(--vd-brand); }
.flow-progress { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--vd-brand) var(--progress), var(--vd-surface-muted) 0); position: relative; }
.flow-progress::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--vd-surface-raised); }
.flow-progress span { position: relative; z-index: 1; font-size: 8px; font-weight: 760; }
.flow-empty {
  min-height: 116px;
  border: 1px dashed var(--vd-line);
  border-radius: var(--vd-radius-sm);
  display: grid;
  place-items: center;
  color: var(--vd-ink-muted);
  font-size: 10px;
  text-align: center;
  padding: 12px;
}

.studio-bottom-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; margin-top: 14px; }
.work-panel {
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
  min-width: 0;
}
.work-panel-header {
  min-height: 44px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--vd-line);
}
.work-panel-header > div { display: flex; align-items: center; gap: 8px; }
.work-panel-header h3 { font-size: 12px; letter-spacing: -0.02em; }
.panel-icon { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.panel-icon-warning { color: var(--vd-danger); border: 1px solid var(--vd-danger); }
.panel-count { min-width: 22px; height: 20px; border-radius: 10px; background: var(--vd-surface-muted); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--vd-ink-muted); }
.text-action { border: 0; background: transparent; color: var(--vd-brand); font-size: 10px; cursor: pointer; }
.attention-list, .activity-list { padding: 5px 12px; }
.attention-item {
  min-height: 47px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--vd-line);
}
.attention-item:last-child, .activity-item:last-child { border-bottom: 0; }
.attention-thumb { width: 34px; height: 34px; border-radius: 5px; background: var(--vd-surface-muted); object-fit: cover; }
.attention-copy { min-width: 0; }
.attention-title { font-size: 10px; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-meta { margin-top: 2px; font-size: 9px; color: var(--vd-ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-action { height: 26px; padding: 0 9px; border: 1px solid var(--vd-line); border-radius: 6px; background: var(--vd-surface-raised); color: var(--vd-ink-secondary); font-size: 9px; font-weight: 650; cursor: pointer; }
.attention-action:hover { border-color: var(--vd-brand); color: var(--vd-brand); }
.activity-item { min-height: 39px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--vd-line); }
.activity-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--vd-surface-muted); color: var(--vd-ink-secondary); font-size: 9px; }
.activity-copy { font-size: 10px; color: var(--vd-ink-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 9px; color: var(--vd-ink-muted); white-space: nowrap; }

.studio-inspector {
  position: sticky;
  top: calc(var(--vd-topbar-height) + 20px);
  max-height: calc(100vh - var(--vd-topbar-height) - 40px);
  overflow-y: auto;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
  scrollbar-width: thin;
}
.inspector-empty { min-height: 520px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 28px; color: var(--vd-ink-muted); }
.inspector-empty-mark { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--vd-surface-muted); margin-bottom: 14px; }
.inspector-empty h3 { color: var(--vd-ink); font-size: 14px; }
.inspector-empty p { margin-top: 7px; max-width: 210px; font-size: 11px; line-height: 1.5; }
.inspector-content { padding: 10px; }
.inspector-hero { aspect-ratio: 1.42; border-radius: 7px; overflow: hidden; background: var(--vd-surface-muted); }
.inspector-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inspector-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 6px; }
.inspector-thumbs img { width: 100%; aspect-ratio: 1; border-radius: 5px; object-fit: cover; background: var(--vd-surface-muted); }
.inspector-title-row { padding: 14px 2px 10px; }
.inspector-title-row h3 { font-size: 15px; line-height: 1.35; letter-spacing: -0.025em; }
.inspector-sku { margin-top: 5px; color: var(--vd-ink-muted); font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.inspector-price-row { display: flex; align-items: center; gap: 8px; padding: 0 2px 12px; }
.inspector-platform { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.inspector-price { margin-left: auto; font-size: 18px; font-weight: 760; letter-spacing: -0.04em; }
.inspector-card { margin-top: 8px; padding: 12px; border: 1px solid var(--vd-line); border-radius: 7px; }
.inspector-card h4 { margin-bottom: 9px; font-size: 10px; color: var(--vd-ink-secondary); }
.confidence-row { display: flex; align-items: center; gap: 10px; }
.confidence-ring { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--vd-success) var(--confidence), var(--vd-surface-muted) 0); position: relative; }
.confidence-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--vd-surface-raised); }
.confidence-ring span { position: relative; z-index: 1; font-size: 10px; font-weight: 780; }
.confidence-copy strong { display: block; color: var(--vd-success); font-size: 10px; }
.confidence-copy span { display: block; margin-top: 2px; color: var(--vd-ink-muted); font-size: 9px; line-height: 1.4; }
.attribute-list { display: grid; grid-template-columns: 72px 1fr; gap: 6px 9px; font-size: 9px; }
.attribute-list dt { color: var(--vd-ink-muted); }
.attribute-list dd { color: var(--vd-ink-secondary); overflow-wrap: anywhere; }
.price-range { font-size: 15px; font-weight: 730; letter-spacing: -0.03em; }
.recommended-price { display: flex; justify-content: space-between; margin-top: 7px; color: var(--vd-ink-muted); font-size: 9px; }
.recommended-price strong { color: var(--vd-ink); font-size: 12px; }
.inspector-actions { display: grid; gap: 6px; margin-top: 9px; }
.inspector-action { min-height: 36px; border: 1px solid var(--vd-line); border-radius: 7px; background: var(--vd-surface-raised); color: var(--vd-ink-secondary); font-size: 11px; font-weight: 650; cursor: pointer; }
.inspector-action:hover { border-color: var(--vd-brand); color: var(--vd-brand); }
.inspector-action.primary { background: var(--vd-brand); border-color: var(--vd-brand); color: white; }
.inspector-action.primary:hover { background: var(--vd-brand-strong); color: white; }

/* Legacy component refinement */
.dropzone, .meta-section, .result-section, .chart-card, .stat-card, .admin-card, .settings-card {
  box-shadow: none;
}
input, select, textarea, .model-select, .result-input, .result-textarea, .meta-input {
  border-color: var(--vd-line);
  background: var(--vd-surface-raised);
}
input:focus, select:focus, textarea:focus, .model-select:focus, .result-input:focus, .result-textarea:focus, .meta-input:focus {
  border-color: var(--vd-brand);
  box-shadow: 0 0 0 3px var(--vd-focus);
}
.primary-btn { background: var(--vd-brand); box-shadow: none; }
.primary-btn:hover { background: var(--vd-brand-strong); }
.secondary-btn, .small-btn { background: var(--vd-surface-raised); border-color: var(--vd-line); }

@media (max-width: 1180px) {
  .studio-layout { grid-template-columns: minmax(0, 1fr); }
  .studio-inspector { position: static; max-height: none; }
  .inspector-empty { min-height: 180px; }
  .inspector-content { display: grid; grid-template-columns: minmax(240px, .85fr) 1.15fr; gap: 12px; }
  .inspector-content > * { min-width: 0; }
}

@media (max-width: 860px) {
  :root { --vd-sidebar-width: 148px; }
  .command-search { width: min(320px, 38vw); }
  .topbar-kicker { display: none; }
  .studio-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-wrapper { margin-left: 0; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-context { min-width: 0; }
  .topbar-context-icon { display: none; }
  .command-search { flex: 1; width: auto; }
  .command-search span { display: none; }
  .command-search kbd { display: none; }
  .topbar-icon-btn, .topbar-avatar { display: none; }
  main { padding: 16px 14px 24px; }
  .studio-heading { align-items: flex-start; flex-direction: column; }
  .flow-board { min-width: 940px; }
  .inspector-content { display: block; }
}

@media (max-width: 520px) {
  .topbar-btn.primary { width: 36px; padding: 0; justify-content: center; }
  .topbar-btn.primary span { display: none; }
  .topbar-title { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
  .page-heading h2 { font-size: 20px; }
  .studio-summary { flex-wrap: wrap; }
}

/* ========================================================================== 
   Listings / Historie 2026
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.listings-page { min-width: 0; }
.listings-heading { align-items: flex-start; }
.listings-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.vd-button {
  min-height: 36px;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
  color: var(--vd-ink-secondary);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
  white-space: nowrap;
}
.vd-button:hover:not(:disabled) { border-color: var(--vd-line-strong); color: var(--vd-ink); }
.vd-button.primary { background: var(--vd-brand); border-color: var(--vd-brand); color: #fff; }
.vd-button.primary:hover:not(:disabled) { background: var(--vd-brand-strong); border-color: var(--vd-brand-strong); color: #fff; }
.vd-button.ghost { background: transparent; }
.vd-button.compact { min-height: 31px; padding: 0 10px; font-size: 10px; }
.vd-button.danger { color: var(--vd-danger); }
.vd-button:disabled { opacity: .38; cursor: not-allowed; }

.history-export-wrap,
.history-columns-wrap { position: relative; }
.history-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 7px);
  right: 0;
  min-width: 190px;
  padding: 7px;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
  box-shadow: var(--vd-shadow-float);
}
.history-export-menu button,
.history-row-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--vd-ink-secondary);
  padding: 0 10px;
  text-align: left;
  font-size: 11px;
  cursor: pointer;
}
.history-export-menu button:hover,
.history-row-menu button:hover { background: var(--vd-surface-muted); color: var(--vd-ink); }
.history-row-menu button.danger { color: var(--vd-danger); }
.history-columns-panel { min-width: 208px; padding: 11px; }
.history-columns-panel strong { display: block; margin-bottom: 8px; font-size: 11px; }
.history-columns-panel label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--vd-ink-secondary);
  font-size: 11px;
  cursor: pointer;
}
.history-columns-panel input { accent-color: var(--vd-brand); }

.history-filterbar {
  display: grid;
  grid-template-columns: minmax(250px, 1.45fr) repeat(3, minmax(135px, .65fr)) auto auto;
  gap: 9px;
  align-items: end;
  margin-bottom: 14px;
}
.history-search-field,
.history-filter-field,
.history-custom-dates label {
  min-height: 52px;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
}
.history-search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  color: var(--vd-ink-muted);
}
.history-search-field:focus-within,
.history-filter-field:focus-within,
.history-custom-dates label:focus-within { border-color: var(--vd-brand); box-shadow: 0 0 0 3px var(--vd-focus); }
.history-search-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--vd-ink);
  font-size: 12px;
}
.history-search-field input::placeholder { color: var(--vd-ink-muted); }
.history-filter-field,
.history-custom-dates label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 11px;
}
.history-filter-field > span,
.history-custom-dates label > span {
  color: var(--vd-ink-muted);
  font-size: 9px;
  font-weight: 650;
}
.history-filter-field select,
.history-custom-dates input {
  width: 100%;
  min-height: 23px;
  padding: 0 20px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--vd-ink);
  font-size: 11px;
  font-weight: 600;
}
.history-custom-dates { display: grid; grid-template-columns: repeat(2, 125px); gap: 7px; }
.history-filterbar > .vd-button { min-height: 52px; }

.history-table-shell {
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-md);
  background: var(--vd-surface-raised);
  overflow: visible;
}
.history-batch-bar {
  min-height: 49px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-md) var(--vd-radius-md) 0 0;
  box-shadow: none;
  background: var(--vd-surface-raised);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.history-batch-bar.has-selection { background: color-mix(in srgb, var(--vd-brand-soft) 65%, var(--vd-surface-raised)); }
.history-select-all-wrap {
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 31px;
  padding: 0 9px;
  border-right: 1px solid var(--vd-line);
  color: var(--vd-ink-secondary);
}
.history-select-all-wrap input,
.history-row-select { width: 15px; height: 15px; accent-color: var(--vd-brand); cursor: pointer; }
.history-batch-actions { display: flex; align-items: center; gap: 6px; }
.history-clear-selection {
  flex: 0 0 auto;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--vd-ink-muted);
  font-size: 10px;
  cursor: pointer;
}
.history-clear-selection:hover { color: var(--vd-brand); }

.history-table {
  --history-platform: 104px;
  --history-provider: 118px;
  --history-price: 105px;
  --history-status: 125px;
  --history-location: 135px;
  --history-published: 150px;
  min-width: 1080px;
  overflow: visible;
}
.history-table-shell { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--vd-line-strong) transparent; }
.history-table-head,
.history-row {
  display: grid;
  grid-template-columns:
    34px
    minmax(270px, 1.8fr)
    var(--history-platform)
    var(--history-provider)
    var(--history-price)
    var(--history-status)
    var(--history-location)
    var(--history-published)
    40px;
  align-items: center;
}
.history-table-head {
  min-height: 38px;
  border-bottom: 1px solid var(--vd-line);
  color: var(--vd-ink-muted);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .018em;
}
.history-list { display: block; }
.history-row {
  min-height: 70px;
  border-bottom: 1px solid var(--vd-line);
  background: var(--vd-surface-raised);
  transition: background .15s ease;
  position: relative;
}
.history-row:last-child { border-bottom: 0; }
.history-row:hover { background: color-mix(in srgb, var(--vd-surface-muted) 68%, transparent); }
.history-row.selected { background: color-mix(in srgb, var(--vd-brand-soft) 72%, var(--vd-surface-raised)); }
.history-cell {
  min-width: 0;
  padding: 8px 10px;
  color: var(--vd-ink-secondary);
  font-size: 10px;
}
.history-cell-select { padding-left: 14px; padding-right: 4px; }
.history-cell-article { display: flex; align-items: center; gap: 11px; }
.history-thumb {
  width: 56px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: var(--vd-surface-muted);
}
.history-thumb-placeholder { display: grid; place-items: center; color: var(--vd-ink-muted); }
.history-article-copy { min-width: 0; }
.history-article-title {
  display: block;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--vd-ink);
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.history-article-title:hover { color: var(--vd-brand); }
.history-article-sku {
  margin-top: 4px;
  color: var(--vd-ink-muted);
  font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-cell strong { display: block; color: var(--vd-ink); font-size: 10px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-cell-sub,
.history-cell small {
  display: block;
  margin-top: 3px;
  color: var(--vd-ink-muted);
  font-size: 8.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-platform-name { display: block; color: var(--vd-ink); font-size: 10px; font-weight: 760; }
.history-provider-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--vd-success-soft);
  color: var(--vd-success);
  font-size: 9px;
  font-weight: 800;
}
.history-cell-provider { display: flex; align-items: center; gap: 7px; }
.history-cell-provider span:last-child { min-width: 0; }
.history-status-select {
  max-width: 96px;
  min-height: 23px;
  border: 0;
  border-radius: 5px;
  padding: 0 20px 0 7px;
  font-size: 9px;
  font-weight: 720;
  cursor: pointer;
}
.history-status-select.status-active { background: var(--vd-success-soft); color: var(--vd-success); }
.history-status-select.status-sold { background: var(--vd-success-soft); color: var(--vd-success); }
.history-status-select.status-reserved { background: var(--vd-warning-soft); color: var(--vd-warning); }
.history-publish-date { display: block; color: var(--vd-ink-secondary); font-size: 9px; white-space: nowrap; }
.history-publish-badges { display: flex; gap: 4px; margin-top: 4px; min-width: 0; }
.history-publish-badge {
  max-width: 100%;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--vd-ink-secondary);
  background: var(--vd-surface-muted);
  font-size: 8px;
  font-weight: 680;
  white-space: nowrap;
}
.history-publish-badge span { color: var(--vd-ink); font-weight: 780; }
.history-publish-badge.published { background: var(--vd-success-soft); color: var(--vd-success); }
.history-publish-badge.copied { background: var(--vd-info-soft); color: var(--vd-info); }
.history-publish-badge.pending { background: var(--vd-warning-soft); color: var(--vd-warning); }
.history-publish-badge.failed { background: var(--vd-danger-soft); color: var(--vd-danger); }
.history-publish-empty { color: var(--vd-ink-muted); font-size: 8.5px; white-space: nowrap; }
.history-cell-menu { position: relative; padding-left: 4px; padding-right: 8px; }
.history-row-menu-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink-muted);
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
}
.history-row-menu-button:hover { border-color: var(--vd-line-strong); color: var(--vd-ink); }
.history-row-menu {
  position: absolute;
  z-index: 35;
  top: 31px;
  right: 8px;
  width: 145px;
  padding: 6px;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
  box-shadow: var(--vd-shadow-float);
}

.history-hide-platform { --history-platform: 0px; }
.history-hide-provider { --history-provider: 0px; }
.history-hide-price { --history-price: 0px; }
.history-hide-status { --history-status: 0px; }
.history-hide-location { --history-location: 0px; }
.history-hide-published { --history-published: 0px; }
.history-hide-platform [data-column="platform"],
.history-hide-provider [data-column="provider"],
.history-hide-price [data-column="price"],
.history-hide-status [data-column="status"],
.history-hide-location [data-column="location"],
.history-hide-published [data-column="published"] { display: none; padding: 0; }

.history-table-footer {
  min-height: 55px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--vd-line);
}
.history-page-size { display: flex; align-items: center; gap: 7px; color: var(--vd-ink-muted); font-size: 10px; }
.history-page-size select {
  min-height: 30px;
  padding: 0 25px 0 9px;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink);
  font-size: 10px;
}
.history-pagination-nav { display: flex; align-items: center; gap: 5px; }
.history-page-buttons { display: flex; align-items: center; gap: 4px; }
.history-page-button,
.history-pagination-nav .page-nav-btn {
  min-width: 31px;
  height: 31px;
  padding: 0 8px;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink-secondary);
  font-size: 10px;
  cursor: pointer;
}
.history-page-button:hover:not(.active),
.history-pagination-nav .page-nav-btn:hover:not(:disabled) { border-color: var(--vd-line-strong); color: var(--vd-ink); }
.history-page-button.active { background: var(--vd-brand); border-color: var(--vd-brand); color: #fff; }
.history-pagination-nav .page-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.history-page-gap { width: 20px; text-align: center; color: var(--vd-ink-muted); font-size: 10px; }
.history-empty-state {
  min-height: 360px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 36px;
}
.history-empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--vd-surface-muted); color: var(--vd-ink-muted); }
.history-empty-state h3 { margin-top: 13px; font-size: 14px; }
.history-empty-state p { margin: 5px 0 14px; color: var(--vd-ink-muted); font-size: 11px; }

/* Detail stays functional while receiving the new surface language. */
.listings-page .history-detail {
  max-width: 1180px;
  margin: 0 auto;
  border-color: var(--vd-line);
  border-radius: var(--vd-radius-md);
  background: var(--vd-surface-raised);
  box-shadow: none;
}

@media (max-width: 1180px) {
  .history-filterbar { grid-template-columns: minmax(230px, 1.3fr) repeat(3, minmax(125px, .7fr)); }
  .history-filterbar > .vd-button { grid-column: auto; }
  .history-custom-dates { grid-column: 1 / -1; justify-content: start; }
  .history-table { min-width: 980px; --history-provider: 0px; --history-location: 0px; }
  .history-table [data-column="provider"],
  .history-table [data-column="location"] { display: none; }
}

@media (max-width: 860px) {
  .listings-heading { flex-direction: column; }
  .listings-heading-actions { width: 100%; }
  .history-filterbar { grid-template-columns: 1fr 1fr; }
  .history-search-field { grid-column: 1 / -1; }
  .history-filterbar > .vd-button { min-height: 42px; }
  .history-batch-bar { align-items: flex-start; }
  .history-batch-actions { min-width: max-content; }
}

@media (max-width: 520px) {
  .listings-heading-actions { overflow-x: auto; padding-bottom: 2px; }
  .history-filterbar { grid-template-columns: 1fr; }
  .history-search-field,
  .history-filter-field { min-height: 48px; }
  .history-search-field { grid-column: auto; }
  .history-custom-dates { grid-template-columns: 1fr 1fr; }
  .history-table-footer { align-items: flex-start; flex-direction: column; }
  .history-pagination-nav { width: 100%; justify-content: space-between; }
  .history-page-buttons { overflow-x: auto; }
}

/* --- Slice 03: Studio media fit + in-app Print Studio --- */
.flow-card-media,
.inspector-hero,
.attention-thumb {
  background: linear-gradient(145deg, var(--vd-surface-raised), var(--vd-surface-muted));
}
.flow-card-media {
  display: grid;
  place-items: center;
  padding: 7px;
}
.flow-card-media img,
.inspector-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.inspector-hero {
  display: grid;
  place-items: center;
  padding: 12px;
}
.attention-thumb {
  object-fit: contain;
  object-position: center;
  padding: 3px;
}

body.print-studio-open { overflow: hidden; }
.print-studio {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 22px;
}
.print-studio-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 19, 0.56);
  backdrop-filter: blur(9px);
}
.print-studio-shell {
  position: relative;
  width: min(1380px, 96vw);
  height: min(900px, 94vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--vd-line);
  border-radius: 18px;
  background: var(--vd-surface-raised);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}
.print-studio-header,
.print-studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border-color: var(--vd-line);
  background: var(--vd-surface-raised);
}
.print-studio-header { border-bottom: 1px solid var(--vd-line); }
.print-studio-footer { border-top: 1px solid var(--vd-line); justify-content: flex-end; }
.print-studio-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--vd-brand);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.print-studio-header h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.print-studio-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--vd-line);
  border-radius: 50%;
  background: var(--vd-surface);
  color: var(--vd-ink-secondary);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.print-studio-close:hover { border-color: var(--vd-line-strong); color: var(--vd-ink); }
.print-studio-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.print-studio-controls {
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid var(--vd-line);
  background: var(--vd-surface);
}
.print-control-group {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  margin-bottom: 20px;
  border: 1px solid var(--vd-line);
  border-radius: 11px;
  background: var(--vd-surface-raised);
}
.print-control-group > div { min-width: 0; display: grid; gap: 2px; }
.print-control-group strong { font-size: 13px; }
.print-control-group span:not(.print-summary-icon) { color: var(--vd-ink-muted); font-size: 10px; }
.print-summary-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--vd-brand-soft);
  color: var(--vd-brand);
  font-size: 18px;
  font-weight: 800;
}
.print-control-field { display: grid; gap: 7px; margin-bottom: 16px; }
.print-control-field > span,
.print-control-check > span { color: var(--vd-ink-secondary); font-size: 10px; font-weight: 700; }
.print-control-field select,
.print-control-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink);
  padding: 0 11px;
  font: inherit;
  font-size: 11px;
}
.print-control-field select:focus,
.print-control-field input:focus { outline: 2px solid var(--vd-brand-soft); border-color: var(--vd-brand); }
.print-control-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 0;
  cursor: pointer;
}
.print-control-check input { width: 16px; height: 16px; accent-color: var(--vd-brand); }
.print-hint {
  display: grid;
  gap: 5px;
  margin-top: 24px;
  padding: 13px;
  border-left: 3px solid var(--vd-brand);
  background: var(--vd-brand-soft);
}
.print-hint strong { font-size: 11px; }
.print-hint span { color: var(--vd-ink-secondary); font-size: 10px; line-height: 1.5; }
.print-preview-pane {
  min-width: 0;
  overflow: auto;
  padding: 0 24px 36px;
  background:
    linear-gradient(90deg, transparent 23px, rgba(127, 122, 112, .08) 24px, transparent 25px),
    linear-gradient(0deg, transparent 23px, rgba(127, 122, 112, .08) 24px, transparent 25px),
    var(--vd-surface-muted);
  background-size: 24px 24px;
}
.print-preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -24px 24px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--vd-line);
  background: color-mix(in srgb, var(--vd-surface-muted) 90%, transparent);
  backdrop-filter: blur(10px);
  color: var(--vd-ink-muted);
  font-size: 10px;
}
.print-preview-toolbar span:first-child { color: var(--vd-ink); font-weight: 700; }
.print-preview-pages { display: grid; justify-items: center; gap: 28px; }
.print-page {
  width: 794px;
  min-height: 1123px;
  padding: 38px;
  overflow: hidden;
  background: #fff;
  color: #1f1f1c;
  box-shadow: 0 14px 40px rgba(31, 31, 28, .18);
}
.print-label-grid { display: grid; width: 100%; height: 100%; align-content: start; }
.standard-labels .print-label-grid { grid-template-columns: repeat(2, 340px); grid-auto-rows: 177px; gap: 23px 34px; }
.compact-labels .print-label-grid { grid-template-columns: repeat(3, 217px); grid-auto-rows: 101px; gap: 8px 18px; }
.print-label-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  overflow: hidden;
  border: 1px solid #d8d5ce;
  background: #fff;
  padding: 15px 16px 15px 21px;
}
.print-label-accent { position: absolute; inset: 0 auto 0 0; width: 5px; background: #e33a16; }
.print-label-qr img { display: block; width: 106px; height: 106px; }
.print-label-copy { min-width: 0; display: grid; align-content: center; gap: 4px; }
.print-label-brand { color: #e33a16; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.print-label-sku { font-size: 21px; font-weight: 850; letter-spacing: -.035em; }
.print-label-title { min-height: 31px; overflow: hidden; font-size: 11px; font-weight: 650; line-height: 1.35; }
.print-label-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #6d6961; font-size: 9px; }
.print-label-meta strong { color: #1f1f1c; font-size: 12px; }
.compact-labels .print-label-card { gap: 7px; padding: 7px 8px 7px 11px; }
.compact-labels .print-label-accent { width: 3px; }
.compact-labels .print-label-qr img { width: 62px; height: 62px; }
.compact-labels .print-label-brand { font-size: 6px; }
.compact-labels .print-label-sku { font-size: 12px; }
.compact-labels .print-label-title { min-height: 20px; font-size: 7px; }
.compact-labels .print-label-meta { font-size: 6px; }
.compact-labels .print-label-meta strong { font-size: 8px; }
.print-datasheet { min-height: 100%; display: grid; align-content: start; gap: 24px; }
.print-datasheet-header { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 22px; border-bottom: 4px solid #e33a16; }
.print-datasheet-brand { display: block; margin-bottom: 7px; color: #e33a16; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.print-datasheet h1 { max-width: 570px; margin: 0; font-size: 29px; line-height: 1.15; letter-spacing: -.04em; }
.print-datasheet-sku { margin-top: 9px; color: #5f5b54; font-size: 16px; font-weight: 750; }
.print-datasheet-qr { width: 118px; height: 118px; }
.print-datasheet-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.print-datasheet-photos > div { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #dfdcd5; background: #f5f3ee; padding: 8px; }
.print-datasheet-photos img { width: 100%; height: 100%; object-fit: contain; }
.print-datasheet-description { padding: 17px 19px; border-left: 4px solid #e33a16; background: #f5f3ee; }
.print-datasheet-description h2 { margin: 0 0 7px; font-size: 13px; }
.print-datasheet-description p { margin: 0; color: #45423d; font-size: 11px; line-height: 1.65; }
.print-datasheet-meta { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid #dfdcd5; }
.print-datasheet-meta > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid #dfdcd5; }
.print-datasheet-meta > div:nth-child(odd) { padding-right: 20px; }
.print-datasheet-meta > div:nth-child(even) { padding-left: 20px; border-left: 1px solid #dfdcd5; }
.print-datasheet-meta span { color: #77726a; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.print-datasheet-meta strong { font-size: 11px; }

@media (max-width: 1050px) {
  .print-studio { padding: 10px; }
  .print-studio-shell { width: 100%; height: 100%; border-radius: 12px; }
  .print-studio-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .print-page { transform: scale(.78); transform-origin: top center; margin-bottom: -247px; }
}

@media (max-width: 720px) {
  .print-studio-layout { grid-template-columns: 1fr; }
  .print-studio-controls { border-right: 0; border-bottom: 1px solid var(--vd-line); max-height: 220px; }
  .print-preview-pane { min-height: 0; }
  .print-page { transform: scale(.55); margin-bottom: -505px; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  body.print-studio-active { display: block !important; background: #fff !important; }
  body.print-studio-active > *:not(#print-studio) { display: none !important; }
  body.print-studio-active #print-studio {
    position: static !important;
    display: block !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body.print-studio-active .print-studio-backdrop,
  body.print-studio-active .print-studio-header,
  body.print-studio-active .print-studio-controls,
  body.print-studio-active .print-preview-toolbar,
  body.print-studio-active .print-studio-footer { display: none !important; }
  body.print-studio-active .print-studio-shell,
  body.print-studio-active .print-studio-layout,
  body.print-studio-active .print-preview-pane,
  body.print-studio-active .print-preview-pages {
    display: block !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  body.print-studio-active .print-page {
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 10mm !important;
    margin: 0 !important;
    transform: none !important;
    box-shadow: none !important;
    break-after: page;
    page-break-after: always;
  }
  body.print-studio-active .print-page:last-child { break-after: auto; page-break-after: auto; }
  body.print-studio-active .standard-labels .print-label-grid {
    grid-template-columns: repeat(2, 90mm) !important;
    grid-auto-rows: 50mm !important;
    gap: 5mm 5mm !important;
  }
  body.print-studio-active .compact-labels .print-label-grid {
    grid-template-columns: repeat(3, 62mm) !important;
    grid-auto-rows: 29mm !important;
    gap: 1.6mm 2mm !important;
  }
}

/* ========================================================================== 
   Listing Studio 2026
   ========================================================================== */
.generator-studio-page { min-width: 0; }
.generator-heading { align-items: center; }
.generator-heading-actions { display: flex; align-items: center; gap: 12px; }
.generator-stepper { display: flex; align-items: center; gap: 6px; }
.generator-step {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--vd-line);
  border-radius: 999px;
  color: var(--vd-ink-muted);
  background: var(--vd-surface-raised);
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
}
.generator-step b {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-secondary);
  font-size: 9px;
}
.generator-step.is-active { border-color: var(--vd-brand); color: var(--vd-brand); }
.generator-step.is-active b { background: var(--vd-brand); color: white; }
.generator-step.is-complete { border-color: var(--vd-success); color: var(--vd-success); }
.generator-step.is-complete b { background: var(--vd-success); color: white; }

.generator-studio-layout {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(310px, 1fr) minmax(350px, 1.18fr);
  gap: 12px;
  align-items: start;
}
.generator-panel {
  min-width: 0;
  border: 1px solid var(--vd-line);
  border-radius: var(--vd-radius-sm);
  background: var(--vd-surface-raised);
  overflow: hidden;
}
.generator-panel-header {
  min-height: 58px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--vd-line);
}
.generator-panel-header > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.generator-panel-header h3 { font-size: 12px; letter-spacing: -0.025em; }
.generator-panel-header p { margin-top: 2px; color: var(--vd-ink-muted); font-size: 9px; line-height: 1.35; }
.generator-panel-index {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--vd-surface-muted);
  color: var(--vd-brand);
  font: 720 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.generator-count, .generator-beta, .generator-preview-status {
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-muted);
  font-size: 9px;
  font-weight: 720;
  white-space: nowrap;
}
.generator-beta { background: var(--vd-brand-soft); color: var(--vd-brand); }
.generator-preview-status.is-ready { background: var(--vd-success-soft); color: var(--vd-success); }
.generator-preview-status.is-working { background: var(--vd-warning-soft); color: var(--vd-warning); }

.media-workbench { padding-bottom: 12px; }
.generator-photo-stage {
  position: relative;
  aspect-ratio: 1.2;
  margin: 12px 12px 9px;
  overflow: hidden;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, var(--vd-surface-muted) 25%, transparent 25%) 0 0/18px 18px,
    linear-gradient(45deg, transparent 75%, var(--vd-surface-muted) 75%) 0 0/18px 18px,
    linear-gradient(45deg, transparent 75%, var(--vd-surface-muted) 75%) 9px -9px/18px 18px,
    linear-gradient(45deg, var(--vd-surface-muted) 25%, var(--vd-surface) 25%) 9px -9px/18px 18px;
}
.generator-cover { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; padding: 8px; }
.generator-photo-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 26px;
  color: var(--vd-ink-muted);
}
.generator-photo-empty-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--vd-surface-raised);
  border: 1px solid var(--vd-line);
  color: var(--vd-brand);
}
.generator-photo-empty strong { color: var(--vd-ink); font-size: 12px; }
.generator-photo-empty span { max-width: 220px; margin-top: 6px; font-size: 10px; line-height: 1.5; }
.generator-cover-badge {
  position: absolute;
  left: 9px;
  bottom: 9px;
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--vd-ink) 82%, transparent);
  color: var(--vd-surface);
  font-size: 9px;
  font-weight: 720;
  backdrop-filter: blur(8px);
}
.generator-dropzone {
  margin: 0 12px;
  min-height: 92px;
  padding: 13px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  text-align: left;
  border-width: 1px;
  border-radius: 8px;
  background: var(--vd-surface);
}
.generator-dropzone-icon {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--vd-brand-soft);
  color: var(--vd-brand);
}
.generator-dropzone p { font-size: 10px; line-height: 1.45; color: var(--vd-ink-secondary); }
.generator-dropzone p strong { color: var(--vd-ink); font-size: 11px; }
.generator-dropzone small { color: var(--vd-ink-muted); font-size: 8px; }
.generator-photo-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 9px 12px 0;
}
.generator-photo-strip .thumb {
  border: 1px solid var(--vd-line);
  border-radius: 6px;
  box-shadow: none;
  background: var(--vd-surface-muted);
}
.generator-photo-strip .thumb:first-child { border-color: var(--vd-brand); box-shadow: 0 0 0 2px var(--vd-brand-soft); }
.generator-photo-strip .thumb img { object-fit: contain; object-position: center; padding: 2px; }
.generator-photo-strip .thumb::after {
  content: attr(data-index);
  position: absolute;
  left: 4px;
  bottom: 4px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--vd-ink) 76%, transparent);
  color: var(--vd-surface);
  font-size: 7px;
  font-weight: 760;
}
.generator-image-tools { margin: 8px 12px 0; }
.generator-image-tools .small-btn { display: inline-flex; align-items: center; gap: 6px; }
.generator-image-tools .advanced-editor-entry {
  background: var(--vd-brand);
  color: #fff;
  border-color: var(--vd-brand);
  font-weight: 760;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--vd-brand) 22%, transparent);
}
.generator-image-tools .advanced-editor-entry:hover {
  background: var(--vd-brand-strong, var(--vd-brand));
  color: #fff;
  transform: translateY(-1px);
}

.generator-photo-quality {
  margin: 11px 12px 0;
  padding: 11px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface);
}
.generator-photo-quality-head { display: flex; align-items: center; justify-content: space-between; }
.generator-photo-quality-head > div { display: flex; align-items: center; gap: 6px; }
.generator-photo-quality-head strong { font-size: 10px; }
.generator-photo-quality-head > span { color: var(--vd-ink-muted); font-size: 9px; font-weight: 700; }
.quality-spark { color: var(--vd-brand); }
.generator-photo-quality ul { list-style: none; margin-top: 8px; display: grid; gap: 6px; }
.generator-photo-quality li { display: flex; align-items: center; gap: 7px; color: var(--vd-ink-muted); font-size: 9px; }
.generator-photo-quality li > span {
  width: 13px;
  height: 13px;
  border: 1px solid var(--vd-line-strong);
  border-radius: 50%;
  flex: 0 0 auto;
}
.generator-photo-quality li.is-complete { color: var(--vd-ink-secondary); }
.generator-photo-quality li.is-complete > span { border-color: var(--vd-success); background: var(--vd-success); position: relative; }
.generator-photo-quality li.is-complete > span::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 8px; }

.generator-config-panel { position: relative; }
.generator-config-stack { padding: 10px; display: grid; gap: 7px; }
.generator-config-card, .generator-notes-card {
  padding: 10px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface);
}
.generator-config-card { display: grid; gap: 8px; }
.generator-config-card.compact { align-content: start; }
.generator-config-copy label, .generator-notes-head label { display: block; color: var(--vd-ink); font-size: 10px; font-weight: 720; text-transform: none; letter-spacing: 0; margin: 0; }
.generator-config-copy span, .generator-notes-head span { display: block; margin-top: 2px; color: var(--vd-ink-muted); font-size: 8px; line-height: 1.4; }
.generator-choice-group { gap: 5px; }
.generator-choice-group .toggle-btn {
  min-height: 28px;
  padding: 0 9px;
  border-width: 1px;
  border-radius: 7px;
  font-size: 9px;
}
.generator-choice-group .toggle-btn.active { background: var(--vd-brand); border-color: var(--vd-brand); }
.generator-config-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.generator-config-card select { min-height: 34px; padding: 6px 9px; font-size: 10px; }
.generator-template-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.generator-template-tags span {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--vd-brand-soft);
  color: var(--vd-brand);
  font-size: 8px;
  font-weight: 680;
}
.generator-notes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.generator-notes-head > span { white-space: nowrap; }
.generator-notes-card textarea {
  width: 100%;
  margin-top: 8px;
  min-height: 88px;
  resize: vertical;
  padding: 9px;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  color: var(--vd-ink);
  background: var(--vd-surface-raised);
  font: 10px/1.55 inherit;
}
.generator-tone-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.generator-tone-row span { padding: 3px 6px; border-radius: 999px; background: var(--vd-surface-muted); color: var(--vd-ink-muted); font-size: 7px; }
.generator-loading { margin: 0 10px 10px; padding: 18px; border: 1px solid var(--vd-line); border-radius: 8px; background: var(--vd-surface); }
.generator-loading p { line-height: 1.5; }
.generator-loading p strong { color: var(--vd-ink); }
.generator-loading p span { font-size: 9px; }
.generator-action-zone {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--vd-line);
  background: color-mix(in srgb, var(--vd-surface-raised) 94%, transparent);
  backdrop-filter: blur(10px);
}
.generator-readiness { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 8px; align-items: center; }
.generator-readiness > span { width: 7px; height: 7px; border-radius: 50%; background: var(--vd-warning); }
.generator-readiness.is-ready > span { background: var(--vd-success); }
.generator-readiness strong { display: block; font-size: 9px; }
.generator-readiness small { display: block; margin-top: 2px; color: var(--vd-ink-muted); font-size: 8px; }
.generator-primary-action { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; }

.generator-preview-panel {
  position: sticky;
  top: calc(var(--vd-topbar-height) + 20px);
  max-height: calc(100vh - var(--vd-topbar-height) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.generator-preview-empty { min-height: 520px; display: grid; align-content: center; justify-items: center; text-align: center; padding: 34px; color: var(--vd-ink-muted); }
.generator-preview-empty-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px 18px 18px 5px;
  background: var(--vd-brand);
  color: white;
  font-size: 17px;
  font-weight: 820;
  letter-spacing: -.08em;
  box-shadow: 0 12px 24px var(--vd-brand-soft);
}
.generator-preview-empty h3 { margin-top: 15px; color: var(--vd-ink); font-size: 14px; }
.generator-preview-empty p { max-width: 275px; margin-top: 7px; font-size: 10px; line-height: 1.55; }
.generator-preview-skeleton { width: min(280px, 100%); margin-top: 20px; display: grid; gap: 7px; }
.generator-preview-skeleton span { height: 9px; border-radius: 999px; background: var(--vd-surface-muted); }
.generator-preview-skeleton span:nth-child(2) { width: 82%; }
.generator-preview-skeleton span:nth-child(3) { width: 94%; }
.generator-preview-skeleton span:nth-child(4) { width: 58%; }
.generator-variant-wrap { padding: 10px 12px 0; }
.generator-section-label { color: var(--vd-ink-muted); font-size: 8px; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.generator-result { margin: 0; padding: 12px; border: 0; border-radius: 0; background: transparent; }
.generator-result-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface);
}
.generator-result-score > div:first-child span { display: block; color: var(--vd-ink-muted); font-size: 8px; }
.generator-result-score > div:first-child strong { display: block; margin-top: 2px; color: var(--vd-success); font-size: 11px; }
.generator-quality-ring {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--vd-success) var(--quality), var(--vd-surface-muted) 0);
  position: relative;
}
.generator-quality-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--vd-surface); }
.generator-quality-ring span { position: relative; z-index: 1; font-size: 9px; font-weight: 780; }
.generator-result .result-field { margin-bottom: 11px; }
.generator-result .field-header > div { display: flex; align-items: center; gap: 6px; }
.generator-result .field-header label { color: var(--vd-ink-secondary); font-size: 9px; }
.field-count { color: var(--vd-ink-muted); font-size: 8px; }
.generator-result .result-input { padding: 8px 9px; font-size: 11px; }
.generator-result .ql-toolbar.ql-snow { border-color: var(--vd-line); border-radius: 7px 7px 0 0; background: var(--vd-surface); }
.generator-result .ql-container.ql-snow { min-height: 190px; border-color: var(--vd-line); border-radius: 0 0 7px 7px; font-size: 11px; }
.generator-meta-section { margin: 12px 0 0; padding: 10px; border-radius: 8px; background: var(--vd-surface); }
.generator-meta-section .meta-grid-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.generator-meta-section .meta-category-item { grid-column: 1 / -1; }
.generator-meta-section .meta-label { font-size: 8px; }
.generator-meta-section .meta-input { padding: 7px 8px; font-size: 10px; }
.generator-meta-section .fee-info { padding-top: 8px; font-size: 9px; }
.generator-meta-section .fee-info .fee-net { font-size: 11px; }
.generator-html-details { margin-top: 11px; border: 1px solid var(--vd-line); border-radius: 8px; overflow: hidden; }
.generator-html-details summary { padding: 10px; cursor: pointer; color: var(--vd-ink-secondary); font-size: 9px; font-weight: 680; }
.generator-html-details summary span { color: var(--vd-ink-muted); font-weight: 500; }
.generator-html-actions { display: flex; justify-content: flex-end; gap: 5px; padding: 0 10px 8px; }
.generator-html-details .html-preview, .generator-html-details .html-source { margin: 0 10px 10px; width: calc(100% - 20px); }
.generator-result-actions { position: sticky; bottom: -12px; display: grid; grid-template-columns: auto 1fr; padding: 10px 0 0; background: var(--vd-surface-raised); }
.generator-result-actions button { min-height: 38px; }

@media (max-width: 1280px) {
  .generator-studio-layout { grid-template-columns: minmax(250px, .8fr) minmax(310px, 1fr); }
  .generator-preview-panel { grid-column: 1 / -1; position: static; max-height: none; }
  .generator-preview-empty { min-height: 260px; }
}

@media (max-width: 900px) {
  .generator-heading { align-items: flex-start; flex-direction: column; }
  .generator-heading-actions { width: 100%; justify-content: space-between; }
  .generator-studio-layout { grid-template-columns: 1fr; }
  .generator-preview-panel { grid-column: auto; }
}

@media (max-width: 560px) {
  .generator-stepper { width: 100%; }
  .generator-step { flex: 1; justify-content: center; padding: 0 5px; }
  .generator-heading-actions { align-items: stretch; flex-direction: column; }
  .generator-config-pair { grid-template-columns: 1fr; }
  .generator-photo-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .generator-meta-section .meta-grid-edit { grid-template-columns: 1fr; }
  .generator-meta-section .meta-category-item { grid-column: auto; }
}

/* --- Slice 05: Publish Center 2026 --- */
.publish-center-page { padding-bottom: 22px; }
.publish-center-heading { align-items: flex-end; }
.publish-heading-actions { display: flex; align-items: center; gap: 7px; }
.publish-view-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin: 10px 0 0;
  padding: 0 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--vd-line);
  scrollbar-width: none;
}
.publish-view-tabs::-webkit-scrollbar { display: none; }
.publish-view-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--vd-ink-muted);
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
  cursor: pointer;
}
.publish-view-tab:hover { color: var(--vd-ink); background: var(--vd-surface-muted); }
.publish-view-tab.active { color: var(--vd-ink); border-bottom-color: var(--vd-brand); background: var(--vd-surface-raised); }
.publish-tab-count,
.publish-tab-badge {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-secondary);
  font-size: 8px;
  font-weight: 760;
}
.publish-tab-badge { background: var(--vd-brand-soft); color: var(--vd-brand); }
.publish-view-tab.active .publish-tab-count { background: var(--vd-brand-soft); color: var(--vd-brand); }

.publish-center-grid {
  min-height: 680px;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 282px;
  border: 1px solid var(--vd-line);
  border-top: 0;
  border-radius: 0 0 var(--vd-radius-md) var(--vd-radius-md);
  overflow: hidden;
  background: var(--vd-surface-raised);
}
.publish-list-panel,
.publish-status-rail,
.publish-workspace-panel { min-width: 0; min-height: 0; }
.publish-list-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--vd-line);
  background: var(--vd-surface);
}
.publish-list-panel-head,
.publish-rail-heading,
.publish-operation-header,
.publish-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.publish-list-panel-head { padding: 14px 14px 11px; }
.publish-panel-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--vd-ink-muted);
  font-size: 7.5px;
  font-weight: 780;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.publish-list-panel-head h3,
.publish-rail-heading h3,
.publish-operation-header h3,
.publish-workspace-header h3 { margin: 0; color: var(--vd-ink); font-size: 13px; letter-spacing: -.015em; }
.publish-list-panel-head h3 span { color: var(--vd-ink-muted); font-weight: 560; }
.publish-list-panel-head select {
  max-width: 112px;
  min-height: 30px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink-secondary);
  font-size: 8px;
}
.publish-list-filters { padding: 0 12px 11px; display: grid; gap: 7px; border-bottom: 1px solid var(--vd-line); }
.publish-search-field {
  min-height: 36px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink-muted);
}
.publish-search-field:focus-within { border-color: var(--vd-brand); box-shadow: 0 0 0 3px var(--vd-focus); }
.publish-search-field input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--vd-ink); font: 9px/1 inherit; }
.publish-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.publish-filter-row select {
  min-width: 0;
  min-height: 32px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink-secondary);
  font-size: 8px;
}
.publish-selection-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--vd-line);
  color: var(--vd-ink-muted);
  font-size: 8px;
}
.publish-selection-bar label { display: inline-flex; align-items: center; gap: 6px; color: var(--vd-ink-secondary); cursor: pointer; }
.publish-selection-bar input,
.publish-card-check input { accent-color: var(--vd-brand); }
.publish-center-page .publish-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.publish-list-card {
  position: relative;
  display: grid;
  grid-template-columns: 16px 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 76px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--vd-surface-raised);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.publish-list-card:hover { border-color: var(--vd-line-strong); transform: translateY(-1px); }
.publish-list-card.is-active { border-color: var(--vd-brand); background: var(--vd-brand-soft); }
.publish-card-check { align-self: start; padding-top: 4px; cursor: pointer; }
.publish-card-media {
  width: 54px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-muted);
  font-size: 7px;
}
.publish-card-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 3px; }
.publish-card-copy { min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding-right: 4px; }
.publish-card-copy > strong { color: var(--vd-ink); font-size: 9px; line-height: 1.25; font-weight: 720; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.publish-card-sku { margin-top: 3px; color: var(--vd-ink-muted); font: 7.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.publish-card-meta { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--vd-ink-muted); font-size: 7.5px; }
.publish-card-meta b { color: var(--vd-ink); font-size: 8.5px; font-weight: 720; }
.publish-card-status {
  position: absolute;
  right: 7px;
  bottom: 7px;
  min-height: 17px;
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-secondary);
  font-size: 7px;
  font-weight: 720;
}
.publish-card-status.status-published { background: var(--vd-success-soft); color: var(--vd-success); }
.publish-card-status.status-failed { background: var(--vd-danger-soft); color: var(--vd-danger); }
.publish-card-status.status-pending,
.publish-card-status.status-uploading { background: var(--vd-warning-soft); color: var(--vd-warning); }
.publish-card-status.status-copied { background: var(--vd-info-soft); color: var(--vd-info); }
.publish-card-status.status-prepared { background: var(--vd-brand-soft); color: var(--vd-brand); }
.publish-batch-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 9px;
  border-top: 1px solid var(--vd-line);
  background: var(--vd-surface-raised);
}
.publish-batch-bar .vd-button { flex: 1 1 auto; min-width: 68px; }

.publish-workspace-panel { background: var(--vd-surface-raised); }
.publish-workspace { min-height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.publish-workspace-header {
  min-height: 68px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--vd-line);
}
.publish-workspace-product { min-width: 0; display: flex; align-items: center; gap: 10px; }
.publish-workspace-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-muted);
  font-size: 7px;
}
.publish-workspace-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.publish-workspace-product > div:last-child { min-width: 0; }
.publish-workspace-product h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.publish-workspace-product p { margin-top: 3px; color: var(--vd-ink-muted); font: 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.publish-workspace-header-actions { display: flex; align-items: center; gap: 5px; }
.publish-workspace-state { min-height: 22px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; background: var(--vd-success-soft); color: var(--vd-success); font-size: 8px; font-weight: 720; }
.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink-secondary);
  cursor: pointer;
}
.icon-button:hover { border-color: var(--vd-line-strong); color: var(--vd-ink); }
.icon-button.danger { color: var(--vd-danger); }
.icon-button.is-loading,
.vd-button.is-loading { opacity: .72; cursor: wait; pointer-events: none; }
@keyframes vd-publish-spin { to { transform: rotate(360deg); } }
.publish-workspace-loading,
.publish-workspace-empty,
.publish-workspace-error {
  min-height: 440px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  color: var(--vd-ink-muted);
}
.publish-workspace-loading span { width: 22px; height: 22px; border: 2px solid var(--vd-line); border-top-color: var(--vd-brand); border-radius: 50%; animation: vd-publish-spin .8s linear infinite; }
.publish-workspace-empty > span,
.publish-workspace-error > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--vd-brand-soft); color: var(--vd-brand); font-size: 18px; }
.publish-workspace-empty h3,
.publish-workspace-error strong { color: var(--vd-ink); font-size: 13px; }
.publish-workspace-empty p,
.publish-workspace-error p { max-width: 340px; font-size: 9px; line-height: 1.55; }
.publish-workspace-empty.compact { min-height: 320px; }
.publish-smart-grid,
.publish-direct-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 226px;
  overflow-y: auto;
}
.publish-editor-column { min-width: 0; padding: 13px; display: grid; align-content: start; gap: 10px; }
.publish-editor-section { padding-bottom: 10px; border-bottom: 1px solid var(--vd-line); }
.publish-editor-section:last-child { border-bottom: 0; }
.publish-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.publish-field-head label { color: var(--vd-ink-secondary); font-size: 8.5px; font-weight: 720; }
.publish-field-head span { color: var(--vd-ink-muted); font-size: 7.5px; }
.publish-field-head > div { display: flex; gap: 4px; }
.publish-field-head button,
.publish-copy-field button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--vd-line);
  border-radius: 6px;
  background: var(--vd-surface);
  color: var(--vd-ink-secondary);
  font-size: 7.5px;
  font-weight: 680;
  cursor: pointer;
}
.publish-copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.publish-copy-field input,
.publish-editor-section > input,
.publish-editor-section textarea,
.publish-meta-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface);
  color: var(--vd-ink);
  font: 9px/1.45 inherit;
}
.publish-copy-field input,
.publish-editor-section > input,
.publish-meta-form input { min-height: 34px; padding: 0 9px; }
.publish-editor-section textarea { min-height: 190px; padding: 9px; resize: vertical; }
.publish-copy-field input[readonly],
.publish-editor-section textarea[readonly] { color: var(--vd-ink-secondary); background: var(--vd-surface-muted); }
.publish-meta-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.publish-meta-form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.publish-meta-form label { min-width: 0; display: grid; gap: 4px; }
.publish-meta-form label > span { color: var(--vd-ink-muted); font-size: 7.5px; font-weight: 680; }
.publish-meta-form.compact .publish-copy-field { grid-template-columns: minmax(0, 1fr); }
.publish-meta-form.compact .publish-copy-field button { display: none; }
.publish-readiness-column {
  min-width: 0;
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 10px;
  border-left: 1px solid var(--vd-line);
  background: var(--vd-surface);
}
.publish-readiness-card,
.publish-photo-section {
  padding: 10px;
  border: 1px solid var(--vd-line);
  border-radius: 9px;
  background: var(--vd-surface-raised);
}
.publish-readiness-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.publish-readiness-head h4 { margin: 0; font-size: 12px; }
.publish-platform-wordmark { color: var(--vd-brand); font-size: 9px; font-weight: 800; }
.integration-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--vd-danger); box-shadow: 0 0 0 4px var(--vd-danger-soft); }
.integration-dot.is-connected { background: var(--vd-success); box-shadow: 0 0 0 4px var(--vd-success-soft); }
.publish-integration-message { margin: 8px 0 4px; color: var(--vd-ink-muted); font-size: 8px; line-height: 1.5; }
.publish-readiness-card ul { list-style: none; margin: 10px 0; display: grid; gap: 6px; }
.publish-readiness-card li { display: flex; align-items: center; gap: 7px; color: var(--vd-ink-secondary); font-size: 8.5px; }
.publish-readiness-card li > span { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; font-size: 8px; font-weight: 800; }
.publish-readiness-card li.is-ready > span { background: var(--vd-success-soft); color: var(--vd-success); }
.publish-readiness-card li.is-missing > span { background: var(--vd-warning-soft); color: var(--vd-warning); }
.publish-ready-message { padding: 9px; border-radius: 7px; background: var(--vd-warning-soft); color: var(--vd-warning); }
.publish-ready-message.is-ready { background: var(--vd-success-soft); color: var(--vd-success); }
.publish-ready-message strong,
.publish-ready-message small { display: block; }
.publish-ready-message strong { font-size: 9px; }
.publish-ready-message small { margin-top: 2px; color: inherit; opacity: .8; font-size: 7.5px; line-height: 1.4; }
.publish-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.publish-photo-grid img,
.publish-photo-grid > span {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--vd-line);
  border-radius: 6px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink-muted);
  font-size: 7px;
  object-fit: contain;
  padding: 2px;
}
.publish-no-photos { min-height: 70px; display: grid; place-items: center; border: 1px dashed var(--vd-line-strong); border-radius: 7px; color: var(--vd-ink-muted); font-size: 8px; }
.vd-button.full { width: 100%; margin-top: 7px; justify-content: center; }
.publish-workspace-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-top: 1px solid var(--vd-line);
  background: var(--vd-surface-raised);
}
.publish-workspace-footer > div { display: flex; gap: 6px; }

.publish-status-rail {
  overflow-y: auto;
  border-left: 1px solid var(--vd-line);
  background: var(--vd-surface);
  scrollbar-width: thin;
}
.publish-rail-section { padding: 14px; border-bottom: 1px solid var(--vd-line); }
.publish-rail-heading { margin-bottom: 10px; }
.publish-status-list { display: grid; }
.publish-status-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--vd-line);
  background: transparent;
  color: var(--vd-ink);
  text-align: left;
  cursor: pointer;
}
.publish-status-row:last-child { border-bottom: 0; }
.publish-status-row:hover strong { color: var(--vd-brand); }
.publish-status-icon { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--vd-line); border-radius: 50%; font-size: 9px; font-weight: 800; }
.publish-status-icon.pending { color: var(--vd-ink-muted); }
.publish-status-icon.processing { color: var(--vd-info); border-color: var(--vd-info); }
.publish-status-icon.success { color: var(--vd-success); border-color: var(--vd-success); }
.publish-status-icon.danger { color: var(--vd-danger); border-color: var(--vd-danger); }
.publish-status-icon.scheduled { color: var(--vd-warning); border-color: var(--vd-warning); }
.publish-status-row strong,
.publish-status-row small { display: block; }
.publish-status-row strong { font-size: 8.5px; }
.publish-status-row small { margin-top: 2px; color: var(--vd-ink-muted); font-size: 7px; }
.publish-status-row b { color: var(--vd-ink); font-size: 10px; }
.publish-quick-actions { display: grid; gap: 7px; }
.publish-quick-action {
  width: 100%;
  min-height: 45px;
  display: grid;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface-raised);
  color: var(--vd-ink);
  text-align: left;
  cursor: pointer;
}
.publish-quick-action:hover { border-color: var(--vd-line-strong); }
.publish-quick-action.primary { border-color: var(--vd-brand); background: var(--vd-brand); color: white; }
.publish-quick-action strong,
.publish-quick-action small { display: block; }
.publish-quick-action strong { font-size: 8.5px; }
.publish-quick-action small { margin-top: 2px; color: inherit; opacity: .72; font-size: 7px; }
.publish-activity-list { display: grid; gap: 8px; }
.publish-activity-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; }
.publish-activity-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--vd-surface-muted); color: var(--vd-ink-muted); font-size: 8px; }
.publish-activity-icon.type-published,
.publish-activity-icon.type-sold { background: var(--vd-success-soft); color: var(--vd-success); }
.publish-activity-icon.type-failed { background: var(--vd-danger-soft); color: var(--vd-danger); }
.publish-activity-icon.type-scheduled { background: var(--vd-warning-soft); color: var(--vd-warning); }
.publish-activity-row strong,
.publish-activity-row small { display: block; }
.publish-activity-row strong { color: var(--vd-ink-secondary); font-size: 7.8px; line-height: 1.35; font-weight: 620; }
.publish-activity-row small { margin-top: 2px; color: var(--vd-ink-muted); font-size: 7px; }
.publish-rail-empty { color: var(--vd-ink-muted); font-size: 8px; }
.publish-empty-state { min-height: 180px; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 20px; text-align: center; }
.publish-empty-state strong { color: var(--vd-ink); font-size: 10px; }
.publish-empty-state span { color: var(--vd-ink-muted); font-size: 8px; }

.publish-operation-header {
  min-height: 74px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--vd-line);
}
.publish-operation-header p { margin-top: 3px; color: var(--vd-ink-muted); font-size: 8px; }
.publish-operation-header > div:last-child { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.publish-operation-list,
.publish-schedule-list { min-height: 0; padding: 10px 13px; overflow-y: auto; }
.publish-operation-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 100px 64px minmax(100px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--vd-line);
}
.publish-operation-row:hover { background: var(--vd-surface); }
.publish-operation-product { min-width: 0; display: flex; align-items: center; gap: 8px; }
.publish-operation-mark { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--vd-surface-muted); color: var(--vd-ink-muted); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.publish-operation-product strong,
.publish-operation-product small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.publish-operation-product strong { color: var(--vd-ink); font-size: 8.5px; }
.publish-operation-product small { margin-top: 3px; color: var(--vd-ink-muted); font: 7px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.publish-operation-meta span,
.publish-operation-meta b { display: block; }
.publish-operation-meta span { color: var(--vd-ink-muted); font-size: 7px; }
.publish-operation-meta b { margin-top: 3px; color: var(--vd-ink); font-size: 8px; }
.operation-status { display: inline-flex !important; width: fit-content; min-height: 19px; align-items: center; padding: 0 6px; border-radius: 5px; background: var(--vd-surface-muted); color: var(--vd-ink-secondary) !important; }
.operation-status.status-published { background: var(--vd-success-soft); color: var(--vd-success) !important; }
.operation-status.status-failed { background: var(--vd-danger-soft); color: var(--vd-danger) !important; }
.operation-status.status-uploading,
.operation-status.status-pending,
.operation-status.status-scheduled { background: var(--vd-warning-soft); color: var(--vd-warning) !important; }
.publish-operation-error { min-width: 0; color: var(--vd-ink-muted); font-size: 7.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.publish-operation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.publish-operation-footer { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border-top: 1px solid var(--vd-line); color: var(--vd-ink-muted); font-size: 8px; }
.publish-operation-footer strong { color: var(--vd-ink); }
.publish-schedule-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 135px minmax(190px, 1fr) 90px minmax(80px, .7fr) 30px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--vd-line);
}
.publish-schedule-date strong,
.publish-schedule-date span { display: block; }
.publish-schedule-date strong { color: var(--vd-ink); font-size: 8.5px; }
.publish-schedule-date span { margin-top: 3px; color: var(--vd-ink-muted); font-size: 7px; }
.publish-schedule-error { min-width: 0; color: var(--vd-danger); font-size: 7.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.publish-schedule-dialog { width: min(620px, 94vw); max-width: 620px; }
.publish-schedule-summary { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 13px; }
.publish-schedule-summary span,
.publish-schedule-summary b { padding: 4px 7px; border-radius: 999px; background: var(--vd-surface-muted); color: var(--vd-ink-secondary); font-size: 7.5px; font-weight: 620; }
.publish-schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.publish-schedule-grid label { display: grid; gap: 5px; color: var(--vd-ink-secondary); font-size: 8px; font-weight: 680; }
.publish-schedule-grid select,
.publish-schedule-grid input { min-height: 40px; padding: 0 10px; border: 1px solid var(--vd-line); border-radius: 8px; background: var(--vd-surface-raised); color: var(--vd-ink); font-size: 9px; }
.publish-schedule-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 16px; }

@media (max-width: 1320px) {
  .publish-center-grid { grid-template-columns: 245px minmax(0, 1fr); }
  .publish-status-rail { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; border-left: 0; border-top: 1px solid var(--vd-line); }
  .publish-rail-section { border-bottom: 0; border-right: 1px solid var(--vd-line); }
  .publish-rail-section:last-child { border-right: 0; }
}
@media (max-width: 960px) {
  .publish-center-heading { align-items: flex-start; flex-direction: column; }
  .publish-center-grid { grid-template-columns: 1fr; }
  .publish-list-panel { max-height: 470px; border-right: 0; border-bottom: 1px solid var(--vd-line); }
  .publish-smart-grid,
  .publish-direct-grid { grid-template-columns: 1fr; }
  .publish-readiness-column { border-left: 0; border-top: 1px solid var(--vd-line); }
  .publish-status-rail { grid-template-columns: 1fr; }
  .publish-rail-section { border-right: 0; border-bottom: 1px solid var(--vd-line); }
  .publish-operation-row { grid-template-columns: minmax(170px, 1fr) 90px 60px auto; }
  .publish-operation-error { display: none; }
}
@media (max-width: 620px) {
  .publish-heading-actions { width: 100%; }
  .publish-heading-actions .vd-button { flex: 1; }
  .publish-view-tab { padding: 0 10px; }
  .publish-list-panel-head { align-items: flex-start; }
  .publish-filter-row,
  .publish-schedule-grid,
  .publish-meta-form,
  .publish-meta-form.compact { grid-template-columns: 1fr; }
  .publish-workspace-header { align-items: flex-start; }
  .publish-workspace-header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .publish-workspace-footer,
  .publish-operation-footer { align-items: stretch; flex-direction: column; }
  .publish-workspace-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .publish-workspace-footer .vd-button { justify-content: center; }
  .publish-operation-header { align-items: flex-start; flex-direction: column; }
  .publish-operation-header > div:last-child { width: 100%; justify-content: stretch; }
  .publish-operation-header .vd-button { flex: 1; }
  .publish-operation-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .publish-operation-meta,
  .publish-operation-error { display: none; }
  .publish-schedule-row { grid-template-columns: 1fr auto; }
  .publish-schedule-row > :nth-child(3),
  .publish-schedule-row > :nth-child(4) { display: none; }
}

/* ========================================================================== 
   Slice 06 — Full Listing Editor + Live WYSIWYG/HTML synchronization
   ========================================================================== */
.generator-html-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 0 10px 10px;
}
.generator-html-pane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface-raised);
}
.generator-html-pane-head,
.detail-pane-head,
.detail-html-preview-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--vd-line);
  background: var(--vd-surface);
}
.generator-html-pane-head strong,
.detail-pane-head strong,
.detail-html-preview-head strong { color: var(--vd-ink); font-size: 8px; }
.generator-html-pane-head span,
.detail-pane-head span,
.detail-html-preview-head span { color: var(--vd-ink-muted); font-size: 7px; }
.generator-html-pane-head span[data-tone="working"],
.detail-html-preview-head span[data-tone="working"] { color: var(--vd-warning); }
.generator-html-pane-head span[data-tone="ok"],
.detail-html-preview-head span[data-tone="ok"] { color: var(--vd-success); }
.generator-html-pane-head span[data-tone="warning"],
.detail-html-preview-head span[data-tone="warning"] { color: var(--vd-warning); }
.generator-html-pane .html-source {
  min-height: 240px;
  margin: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 11px;
  resize: vertical;
  background: var(--vd-code-bg, #171714);
  color: #f3f0e7;
  font: 7.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}
.html-preview-frame {
  display: block;
  width: 100%;
  min-height: 240px;
  margin: 0 !important;
  border: 0;
  background: #fff;
}

.listings-page .history-detail {
  padding: 0;
  overflow: hidden;
  border-color: var(--vd-line);
  border-radius: 12px;
  background: var(--vd-surface-raised);
}
.listings-page #back-to-list { margin: 12px 14px 0; }
.listing-editor-shell { padding: 0 14px 16px; }
.listing-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 0 14px;
  border-bottom: 1px solid var(--vd-line);
}
.listing-editor-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--vd-brand);
  font-size: 7px;
  font-weight: 720;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.listing-editor-header h2 { margin: 0; color: var(--vd-ink); font-size: 18px; line-height: 1.2; text-transform: none; letter-spacing: -.02em; }
.listing-editor-header p { margin: 5px 0 0; color: var(--vd-ink-muted); font: 7px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: normal; }
.listing-editor-header-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.listing-editor-grid {
  display: grid;
  grid-template-columns: minmax(220px, .78fr) minmax(420px, 1.65fr) minmax(190px, .62fr);
  gap: 12px;
  align-items: start;
  padding-top: 13px;
}
.listing-media-editor,
.listing-content-editor,
.listing-context-panel { min-width: 0; }
.listing-media-editor,
.listing-editor-section,
.listing-context-card {
  border: 1px solid var(--vd-line);
  border-radius: 10px;
  background: var(--vd-surface-raised);
}
.listing-media-editor { padding: 10px; position: sticky; top: 74px; }
.listing-content-editor { display: grid; gap: 10px; }
.listing-editor-section { padding: 11px; }
.listing-context-panel { display: grid; gap: 9px; position: sticky; top: 74px; }
.listing-context-card { padding: 11px; }
.listing-context-card h3,
.listing-section-heading h3 { margin: 0; color: var(--vd-ink); font-size: 9px; text-transform: none; letter-spacing: 0; }
.listing-section-heading {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.listing-section-heading > div { display: flex; align-items: center; gap: 7px; }
.listing-section-heading > div > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--vd-brand-soft);
  color: var(--vd-brand);
  font-size: 7px;
  font-weight: 760;
}
.listing-section-heading > b { color: var(--vd-ink-muted); font-size: 7px; font-weight: 600; }
.detail-photo-stage {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--vd-line);
  border-radius: 9px;
  background: var(--vd-surface-muted);
}
.detail-photo-stage img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.detail-photo-empty { color: var(--vd-ink-muted); font-size: 8px; }
.detail-photo-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}
.detail-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface-muted);
  cursor: pointer;
}
.detail-photo-thumb:hover,
.detail-photo-thumb.is-active { border-color: var(--vd-brand); box-shadow: 0 0 0 2px var(--vd-brand-soft); }
.detail-photo-thumb.is-dragging { opacity: .45; }
.detail-photo-thumb img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.detail-photo-thumb span {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(21, 20, 17, .82);
  color: #fff;
  font-size: 5.5px;
  font-weight: 720;
}
.detail-photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.detail-photo-actions .vd-button { justify-content: center; min-width: 0; padding-inline: 6px; }
.detail-photo-help { margin: 8px 0 0 !important; color: var(--vd-ink-muted); font-size: 6.5px !important; line-height: 1.5 !important; white-space: normal !important; }
.listing-form-grid { display: grid; gap: 8px; }
.listing-form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.listing-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.listing-form-grid label,
.listing-full-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--vd-ink-secondary);
  font-size: 7px;
  font-weight: 680;
  text-transform: none;
  letter-spacing: 0;
}
.listing-full-field { position: relative; margin-top: 9px; }
.listing-full-field > span { position: absolute; right: 1px; top: 0; color: var(--vd-ink-muted); font-size: 6.5px; font-weight: 500; }
.listing-form-grid input,
.listing-form-grid select,
.listing-full-field input,
.listing-full-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid var(--vd-line);
  border-radius: 7px;
  background: var(--vd-surface);
  color: var(--vd-ink);
  font: inherit;
  font-size: 8px;
  text-transform: none;
  letter-spacing: 0;
}
.listing-full-field textarea { min-height: 76px; padding-block: 9px; resize: vertical; }
.listing-form-grid input:focus,
.listing-form-grid select:focus,
.listing-full-field input:focus,
.listing-full-field textarea:focus,
.detail-description-pane textarea:focus { outline: none; border-color: var(--vd-brand); box-shadow: 0 0 0 3px var(--vd-brand-soft); }
.detail-description-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.detail-description-pane { min-width: 0; overflow: hidden; border: 1px solid var(--vd-line); border-radius: 8px; background: var(--vd-surface); }
.detail-description-pane #detail-description-editor { min-height: 245px; }
.detail-description-pane .ql-toolbar { border: 0; border-bottom: 1px solid var(--vd-line); }
.detail-description-pane .ql-container { border: 0; min-height: 201px; font-size: 9px; }
.detail-description-pane textarea {
  display: block;
  width: 100%;
  min-height: 245px;
  padding: 10px;
  border: 0;
  resize: vertical;
  background: var(--vd-code-bg, #171714);
  color: #f3f0e7;
  font: 7.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}
.detail-html-preview-head { margin-top: 8px; border: 1px solid var(--vd-line); border-bottom: 0; border-radius: 8px 8px 0 0; }
.detail-html-preview { display: block; width: 100%; min-height: 280px; border: 1px solid var(--vd-line); border-radius: 0 0 8px 8px; background: #fff; }
.listing-context-card canvas { display: block; width: 118px; height: 118px; margin: 2px auto 8px; padding: 7px; border: 1px solid var(--vd-line); border-radius: 8px; background: #fff; }
.listing-context-card > strong { display: block; overflow-wrap: anywhere; color: var(--vd-ink); text-align: center; font: 8px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.listing-context-card .vd-button.full { width: 100%; justify-content: center; margin-top: 6px; }
.listing-context-card.danger-zone { border-color: color-mix(in srgb, var(--vd-danger) 35%, var(--vd-line)); }

@media (max-width: 1280px) {
  .listing-editor-grid { grid-template-columns: 230px minmax(0, 1fr); }
  .listing-context-panel { grid-column: 1 / -1; position: static; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .listing-context-card { min-height: 120px; }
}
@media (max-width: 920px) {
  .generator-html-workbench,
  .detail-description-split { grid-template-columns: 1fr; }
  .listing-editor-grid { grid-template-columns: 1fr; }
  .listing-media-editor,
  .listing-context-panel { position: static; }
  .listing-context-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-photo-stage { max-height: 470px; aspect-ratio: 4 / 3; }
}
@media (max-width: 620px) {
  .listing-editor-header { flex-direction: column; }
  .listing-editor-header-actions { width: 100%; }
  .listing-editor-header-actions .vd-button { flex: 1; justify-content: center; }
  .listing-form-grid.three,
  .listing-form-grid.two,
  .listing-context-panel { grid-template-columns: 1fr; }
  .detail-photo-actions { grid-template-columns: 1fr; }
  .generator-html-workbench { padding-inline: 7px; }
}

.history-detail .detail-photo-stage img, .history-detail .detail-photo-thumb img { object-fit: contain; object-position: center; }

/* ========================================================================== 
   Slice 07: Cross-browser extensions, responsive shell & mobile photo upload
   ========================================================================== */
html, body, .main-wrapper, main, .tab-content { min-width: 0; }
img, video, canvas, iframe { max-width: 100%; }

.mobile-upload-trigger {
  width: calc(100% - 24px);
  min-height: 52px;
  margin: 8px 12px 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--vd-line);
  border-radius: 8px;
  background: var(--vd-surface);
  color: var(--vd-ink-secondary);
  text-align: left;
  cursor: pointer;
}
.mobile-upload-trigger:hover { border-color: var(--vd-brand); background: var(--vd-brand-soft); }
.mobile-upload-trigger-icon {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 8px; background: var(--vd-brand-soft); color: var(--vd-brand); font-size: 18px; font-weight: 800;
}
.mobile-upload-trigger span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.mobile-upload-trigger strong { color: var(--vd-ink); font-size: 9px; }
.mobile-upload-trigger small { color: var(--vd-ink-muted); font-size: 7px; line-height: 1.35; }
.mobile-upload-trigger b { padding: 4px 6px; border-radius: 5px; background: var(--vd-ink); color: var(--vd-surface); font-size: 7px; }

.html-view-toolbar {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-top: 1px solid var(--vd-line);
  border-bottom: 1px solid var(--vd-line);
  background: var(--vd-surface);
}
.html-view-tabs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 7px; background: var(--vd-surface-muted); }
.html-view-tab {
  min-height: 28px; padding: 0 9px; border: 0; border-radius: 5px;
  background: transparent; color: var(--vd-ink-muted); font-size: 8px; font-weight: 720; cursor: pointer;
}
.html-view-tab.is-active { background: var(--vd-surface-raised); color: var(--vd-ink); box-shadow: 0 1px 5px rgba(20,18,15,.08); }
.html-switch-stage { min-width: 0; }
.html-switch-view { display: none; min-width: 0; }
.html-switch-view.is-active { display: block; }
.html-switch-view .html-source,
.detail-html-switch-stage textarea {
  display: block; width: 100%; min-height: 290px; margin: 0; padding: 12px;
  border: 0; border-radius: 0; resize: vertical; background: var(--vd-code-bg, #171714); color: #f3f0e7;
  font: 8px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2;
}
.html-switch-view .html-preview-frame { min-height: 320px; }
.detail-platform-workbench { margin-top: 9px; overflow: hidden; border: 1px solid var(--vd-line); border-radius: 8px; }
.detail-html-toolbar { border: 0; border-bottom: 1px solid var(--vd-line); }
.detail-html-toolbar > span { color: var(--vd-ink-muted); font-size: 7px; }
.detail-html-switch-stage .detail-html-preview { min-height: 340px; border: 0; border-radius: 0; }
.detail-wysiwyg-pane { width: 100%; }
.detail-wysiwyg-pane #detail-description-editor { min-height: 270px; }
.detail-photo-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mobile-upload-overlay { z-index: 2500; padding: 18px; }
.mobile-upload-dialog {
  width: min(760px, 100%); max-height: min(760px, calc(100dvh - 36px)); overflow: auto;
  border: 1px solid var(--vd-line); border-radius: 16px; background: var(--vd-surface-raised); box-shadow: var(--vd-shadow-float);
}
.mobile-upload-dialog > header,
.mobile-upload-dialog > footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.mobile-upload-dialog > header { border-bottom: 1px solid var(--vd-line); }
.mobile-upload-dialog > footer { justify-content: flex-end; border-top: 1px solid var(--vd-line); }
.mobile-upload-dialog-brand { display: flex; align-items: center; gap: 10px; }
.mobile-upload-dialog-brand > div { display: grid; gap: 2px; }
.mobile-upload-dialog-brand span { color: var(--vd-brand); font-size: 7px; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.mobile-upload-dialog-brand h3 { margin: 0; color: var(--vd-ink); font-size: 15px; }
.mobile-upload-dialog-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--vd-brand); color: #fff !important; font-size: 9px !important; }
.mobile-upload-dialog-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 22px; padding: 22px; }
.mobile-upload-qr-card { display: grid; justify-items: center; align-content: center; padding: 18px; border: 1px solid var(--vd-line); border-radius: 13px; background: #fff; }
.mobile-upload-qr-card canvas { width: 240px; height: 240px; padding: 8px; background: #fff; }
.mobile-upload-session-state { min-height: 28px; display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 0 9px; border-radius: 999px; background: var(--vd-surface-muted); color: var(--vd-ink-muted); font-size: 8px; font-weight: 720; }
.mobile-upload-session-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mobile-upload-session-state[data-tone="ready"] { background: var(--vd-success-soft); color: var(--vd-success); }
.mobile-upload-session-state[data-tone="warning"] { background: var(--vd-warning-soft); color: var(--vd-warning); }
.mobile-upload-session-state[data-tone="error"] { background: var(--vd-danger-soft); color: var(--vd-danger); }
.mobile-upload-dialog-copy { min-width: 0; align-self: center; }
.mobile-upload-dialog-copy h4 { margin: 4px 0 12px; color: var(--vd-ink); font-size: 21px; line-height: 1.15; letter-spacing: -.04em; }
.mobile-upload-dialog-copy ol { display: grid; gap: 9px; margin: 0 0 16px; padding-left: 22px; color: var(--vd-ink-secondary); font-size: 10px; line-height: 1.45; }
.mobile-upload-link-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--vd-line); border-radius: 8px; }
.mobile-upload-link-wrap input { min-width: 0; height: 38px; border: 0; border-radius: 0; padding: 0 9px; background: var(--vd-surface); color: var(--vd-ink-secondary); font: 7px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.mobile-upload-link-wrap button { border: 0; border-left: 1px solid var(--vd-line); padding: 0 10px; background: var(--vd-surface-muted); color: var(--vd-brand); font-size: 8px; font-weight: 720; cursor: pointer; }
.mobile-upload-dialog-copy > p { margin: 9px 0 0; color: var(--vd-ink-muted); font-size: 8px; line-height: 1.5; }
.mobile-upload-live { display: flex; justify-content: space-between; gap: 10px; margin-top: 15px; padding: 10px; border-radius: 8px; background: var(--vd-surface-muted); }
.mobile-upload-live strong { color: var(--vd-ink); font-size: 9px; }
.mobile-upload-live span { color: var(--vd-ink-muted); font-size: 8px; }

/* Fluid page widths and device adaptations */
.main-wrapper { width: calc(100% - var(--vd-sidebar-width)); max-width: 100%; }
main { width: 100%; overflow-x: clip; }
.history-table-wrap, .publish-workspace, .storage-main, .admin-grid, .settings-form { min-width: 0; }
.history-table-wrap { overflow-x: auto; }
.history-table { min-width: 980px; }
.generator-panel, .work-panel, .listing-editor-section, .listing-media-editor, .listing-context-card { max-width: 100%; }

@media (max-width: 1440px) {
  .generator-studio-layout { grid-template-columns: minmax(240px,.72fr) minmax(300px,.95fr) minmax(330px,1.1fr); }
  main { padding-inline: 18px; }
}
@media (max-width: 1180px) {
  .topbar-context { min-width: 150px; }
  .command-search { width: min(390px, 34vw); }
  .listing-editor-grid { grid-template-columns: 230px minmax(0,1fr); }
  .listing-context-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1024px) {
  :root { --vd-sidebar-width: 74px; }
  .sidebar-header { justify-content: center; padding-inline: 10px; }
  .logo-text, .nav-item span, .nav-group-label, .sidebar-footer .theme-toggle span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item::before { left: -10px; }
  .sidebar-footer .theme-toggle { justify-content: center; padding: 0; }
  .main-wrapper { width: calc(100% - var(--vd-sidebar-width)); }
  .topbar { padding-inline: 14px; }
  .generator-studio-layout { grid-template-columns: 1fr 1fr; }
  .generator-preview-panel { grid-column: 1 / -1; }
  .studio-layout { grid-template-columns: 1fr; }
  .studio-inspector { position: static; }
  .publish-center-layout { grid-template-columns: minmax(0,1fr); }
  .mobile-upload-dialog-grid { grid-template-columns: 250px minmax(0,1fr); gap: 16px; }
}
@media (max-width: 768px) {
  :root { --vd-sidebar-width: 0px; }
  body { display: block; }
  .main-wrapper { width: 100%; margin-left: 0; }
  .topbar { position: sticky; top: 0; z-index: 100; }
  .topbar-context { flex: 0 1 auto; }
  .topbar-actions { gap: 3px; }
  main { padding: 13px 10px 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .generator-studio-layout, .listing-editor-grid { grid-template-columns: 1fr; }
  .generator-preview-panel, .listing-media-editor, .listing-context-panel { position: static; max-height: none; }
  .listing-context-panel { grid-template-columns: 1fr 1fr; }
  .studio-bottom-grid { grid-template-columns: 1fr; }
  .flow-board { min-width: 860px; }
  .mobile-upload-dialog-grid { grid-template-columns: 1fr; padding: 15px; }
  .mobile-upload-qr-card canvas { width: 210px; height: 210px; }
  .mobile-upload-dialog-copy { text-align: left; }
  .html-view-toolbar { align-items: flex-start; flex-direction: column; }
  .generator-html-actions { width: 100%; justify-content: flex-start; overflow-x: auto; padding: 0; }
}
@media (max-width: 560px) {
  .topbar { min-height: 54px; height: 54px; }
  .topbar-title { max-width: 105px; }
  .command-search { max-width: 42px; padding: 0; justify-content: center; }
  .command-search svg { margin: 0; }
  .generator-stepper { overflow-x: auto; justify-content: flex-start; }
  .generator-step { min-width: max-content; flex: 0 0 auto; }
  .listing-context-panel, .listing-form-grid.two, .listing-form-grid.three { grid-template-columns: 1fr; }
  .detail-photo-actions { grid-template-columns: 1fr; }
  .mobile-upload-overlay { padding: 7px; align-items: flex-end; }
  .mobile-upload-dialog { max-height: calc(100dvh - 14px); border-radius: 16px 16px 8px 8px; }
  .mobile-upload-dialog > header, .mobile-upload-dialog > footer { padding-inline: 12px; }
  .mobile-upload-dialog > footer { display: grid; grid-template-columns: 1fr 1fr; }
  .mobile-upload-dialog > footer button { min-width: 0; }
  .mobile-upload-live { align-items: flex-start; flex-direction: column; }
  .html-view-tabs { width: 100%; }
  .html-view-tab { flex: 1; }
  .history-table { min-width: 850px; }
}

/* ========================================================================== 
   Slice 10 — Dashboard, Studio Flow V2 & responsive hardening
   ========================================================================== */
.dashboard-page,.studio-flow-v2{min-width:0}
.dashboard-heading{align-items:center}.dashboard-controls{display:flex;align-items:center;gap:8px}.dashboard-controls select{height:34px;padding:0 34px 0 10px;border:1px solid var(--vd-line);border-radius:var(--vd-radius-xs);background:var(--vd-surface-raised);color:var(--vd-ink);font:inherit;font-size:11px}
.dashboard-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:14px;align-items:start}.dashboard-main{min-width:0}.dashboard-rail{display:grid;gap:12px;min-width:0}.dashboard-card{min-width:0;border:1px solid var(--vd-line);border-radius:var(--vd-radius-sm);background:var(--vd-surface-raised);box-shadow:none;overflow:hidden}.dashboard-card>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 13px 9px}.dashboard-card>header>div{display:grid;gap:3px}.dashboard-card>header span{font-size:12px;font-weight:750;color:var(--vd-ink)}.dashboard-card>header strong{font-size:10px;font-weight:500;color:var(--vd-ink-muted)}
.dashboard-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-bottom:12px}.dashboard-kpi{position:relative;min-width:0;min-height:116px;padding:12px;border:1px solid var(--vd-line);border-radius:var(--vd-radius-sm);background:var(--vd-surface-raised);overflow:hidden}.dashboard-kpi-icon{width:24px;height:24px;display:grid;place-items:center;border-radius:var(--vd-radius-xs);background:var(--vd-success-soft);color:var(--vd-success);font-size:11px;font-weight:800}.dashboard-kpi>div{display:grid;gap:3px;margin-top:7px}.dashboard-kpi small{font-size:9px;color:var(--vd-ink-secondary)}.dashboard-kpi strong{font-size:17px;letter-spacing:-.035em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dashboard-kpi em{font-size:8px;font-style:normal;color:var(--vd-ink-muted)}.dashboard-kpi svg{position:absolute;left:12px;right:12px;bottom:8px;width:calc(100% - 24px);height:25px;color:var(--vd-success)}.dashboard-kpi svg[data-tone="blue"]{color:var(--vd-info)}.dashboard-kpi svg[data-tone="purple"]{color:#8054b3}.dashboard-kpi svg[data-tone="orange"]{color:var(--vd-brand)}
.dashboard-chart-grid{display:grid;grid-template-columns:1.35fr 1fr 1fr;gap:12px;margin-bottom:12px}.dashboard-chart{height:250px;padding:0 8px 8px}.dashboard-chart svg{width:100%;height:100%;overflow:visible}.chart-grid line{stroke:var(--vd-line);stroke-width:1}.chart-grid text{fill:var(--vd-ink-muted);font-size:10px}.chart-area{fill:var(--vd-brand-soft)}.chart-line{fill:none;stroke:var(--vd-brand);stroke-width:2.5;vector-effect:non-scaling-stroke}.chart-point{fill:var(--vd-surface-raised);stroke:var(--vd-brand);stroke-width:2;cursor:pointer}.dashboard-bar-chart{height:250px;display:flex;align-items:end;justify-content:space-around;gap:12px;padding:16px 14px 12px}.dashboard-bar-item{height:100%;min-width:0;flex:1;display:grid;grid-template-rows:18px 1fr 18px;gap:5px;text-align:center}.dashboard-bar-item>strong{font-size:9px;color:var(--vd-ink-secondary);white-space:nowrap}.dashboard-bar-item>div{display:flex;align-items:end;justify-content:center;border-bottom:1px solid var(--vd-line)}.dashboard-bar-item i{display:block;width:min(44px,72%);min-height:5px;background:var(--vd-info);border-radius:var(--vd-radius-xs) var(--vd-radius-xs) 0 0}.dashboard-bar-item:nth-child(2) i{background:var(--vd-success)}.dashboard-bar-item:nth-child(3) i{background:var(--vd-ink)}.dashboard-bar-item:nth-child(4) i{background:var(--vd-brand)}.dashboard-bar-item span{font-size:9px;color:var(--vd-ink-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dashboard-category-chart{min-height:250px;display:grid;grid-template-columns:145px minmax(0,1fr);gap:14px;align-items:center;padding:12px 14px}.dashboard-donut{width:138px;aspect-ratio:1;border-radius:50%;display:grid;place-items:center}.dashboard-donut>div{width:72%;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;align-content:center;background:var(--vd-surface-raised);text-align:center}.dashboard-donut strong{font-size:13px}.dashboard-donut span{font-size:9px;color:var(--vd-ink-muted)}.dashboard-category-legend{display:grid;gap:8px}.dashboard-category-legend>div{display:grid;grid-template-columns:8px minmax(0,1fr) auto;gap:7px;align-items:center;font-size:9px}.dashboard-category-legend i{width:7px;height:7px;border-radius:50%}.dashboard-category-legend span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dashboard-category-legend strong{font-size:9px}
.dashboard-focus-card{margin-bottom:12px}.dashboard-focus-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:0 12px 12px}.dashboard-focus-item{min-height:108px;padding:11px;border:1px solid var(--vd-line);border-radius:var(--vd-radius-sm);background:var(--vd-surface);color:var(--vd-ink);display:grid;grid-template-rows:auto 1fr auto;gap:6px;text-align:left;cursor:pointer}.dashboard-focus-item:hover{border-color:var(--vd-brand);transform:translateY(-1px)}.dashboard-focus-item strong{font-size:18px}.dashboard-focus-item span{font-size:10px;line-height:1.35}.dashboard-focus-item em{font-size:9px;font-style:normal;color:var(--vd-brand)}.dashboard-focus-item.tone-ready{background:color-mix(in srgb,var(--vd-success-soft) 72%,var(--vd-surface))}.dashboard-focus-item.tone-failed{background:color-mix(in srgb,var(--vd-danger-soft) 72%,var(--vd-surface))}.dashboard-focus-item.tone-uploads{background:color-mix(in srgb,var(--vd-info-soft) 72%,var(--vd-surface))}
.dashboard-lower-grid{display:grid;grid-template-columns:minmax(0,1fr) 255px;gap:12px}.dashboard-table-wrap{overflow:auto}.dashboard-table{width:100%;border-collapse:collapse;font-size:9px}.dashboard-table th,.dashboard-table td{padding:8px 10px;border-top:1px solid var(--vd-line);text-align:left;white-space:nowrap}.dashboard-table th{color:var(--vd-ink-muted);font-weight:600}.dashboard-table tbody tr{cursor:pointer}.dashboard-table tbody tr:hover{background:var(--vd-surface-muted)}.dashboard-product{display:flex;align-items:center;gap:8px;min-width:210px}.dashboard-product img,.dashboard-product>span{width:34px;height:34px;object-fit:contain;border:1px solid var(--vd-line);border-radius:var(--vd-radius-xs);background:var(--vd-surface-muted)}.dashboard-product>div{display:grid;gap:2px}.dashboard-product strong{font-size:9px}.dashboard-product small{font-size:8px;color:var(--vd-ink-muted)}.dashboard-status{padding:3px 6px;background:var(--vd-success-soft);color:var(--vd-success);font-size:8px}.dashboard-actions{display:grid;gap:7px;padding:0 12px 12px}.dashboard-actions button{min-height:34px;padding:0 10px;border:1px solid var(--vd-line);border-radius:var(--vd-radius-xs);background:var(--vd-surface-raised);color:var(--vd-ink);font:inherit;font-size:10px;font-weight:700;text-align:left;cursor:pointer}.dashboard-actions button:hover{border-color:var(--vd-brand);color:var(--vd-brand)}.dashboard-actions button.primary{border-color:var(--vd-brand);background:var(--vd-brand);color:#fff;text-align:center}.dashboard-quality{display:grid;grid-template-columns:58px minmax(0,1fr);gap:11px;align-items:center;padding:0 13px 12px}.dashboard-quality .confidence-ring{width:56px;height:56px}.dashboard-quality>div:last-child{display:grid;gap:3px}.dashboard-quality strong{font-size:11px;color:var(--vd-success)}.dashboard-quality p{font-size:9px;line-height:1.4;color:var(--vd-ink-muted)}.dashboard-card>.vd-button.full{width:calc(100% - 26px);margin:0 13px 13px}.dashboard-feed{display:grid;padding:0 12px 12px}.dashboard-feed button{display:grid;grid-template-columns:20px minmax(0,1fr);gap:8px;align-items:start;padding:8px 0;border:0;border-top:1px solid var(--vd-line);background:transparent;color:var(--vd-ink);text-align:left;cursor:pointer}.dashboard-feed button:first-child{border-top:0}.dashboard-feed-icon{width:18px;height:18px;display:grid;place-items:center;border-radius:50%;background:var(--vd-success-soft);color:var(--vd-success);font-size:9px;font-weight:800}.dashboard-feed-icon.tone-danger,.dashboard-feed-icon.tone-failed{background:var(--vd-danger-soft);color:var(--vd-danger)}.dashboard-feed button>span:last-child{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 6px}.dashboard-feed strong{font-size:9px;line-height:1.35}.dashboard-feed small{font-size:8px;color:var(--vd-ink-muted);white-space:nowrap}.dashboard-system p{padding:0 13px 12px;font-size:9px;line-height:1.45;color:var(--vd-ink-muted)}.dashboard-empty{padding:18px!important;text-align:center;color:var(--vd-ink-muted)!important;font-size:10px!important}

/* Studio Flow V2 */
.today-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:12px}.today-summary-grid>button{min-height:78px;padding:12px;border:1px solid var(--vd-line);border-radius:var(--vd-radius-sm);background:var(--vd-surface-raised);color:var(--vd-ink);display:grid;grid-template-columns:28px 42px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;gap:2px 9px;text-align:left;cursor:pointer}.today-summary-grid>button:hover{border-color:var(--vd-brand)}.today-summary-grid>button>span{grid-row:1/3;width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:var(--vd-success-soft);color:var(--vd-success);font-size:15px}.today-summary-grid>button:last-child>span{background:var(--vd-danger-soft);color:var(--vd-danger)}.today-summary-grid strong{grid-row:1/3;font-size:20px}.today-summary-grid small{font-size:10px;font-weight:700}.today-summary-grid em{font-size:8px;font-style:normal;color:var(--vd-ink-muted)}.today-filterbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.today-filter-tabs{display:flex;align-items:center;gap:5px}.today-filter-tabs button,.today-filterbar select{height:32px;padding:0 12px;border:1px solid transparent;border-radius:var(--vd-radius-xs);background:var(--vd-surface-muted);color:var(--vd-ink-secondary);font:inherit;font-size:10px;cursor:pointer}.today-filter-tabs button.active{border-color:var(--vd-brand);background:var(--vd-surface-raised);color:var(--vd-brand)}.today-filterbar select{border-color:var(--vd-line);background:var(--vd-surface-raised)}.studio-layout-v2{grid-template-columns:minmax(0,1fr) 300px}.today-ready-panel{margin-bottom:12px}.today-ready-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:0 12px 12px}.today-product-card{min-width:0;padding:0;border:1px solid var(--vd-line);border-radius:var(--vd-radius-sm);overflow:hidden;background:var(--vd-surface-raised);color:var(--vd-ink);text-align:left;cursor:pointer}.today-product-card:hover,.today-product-card.selected{border-color:var(--vd-brand);box-shadow:0 0 0 1px var(--vd-brand)}.today-product-media{height:135px;position:relative;display:grid;place-items:center;background:linear-gradient(145deg,var(--vd-surface),var(--vd-surface-muted));overflow:hidden}.today-product-media img{width:100%;height:100%;object-fit:contain;padding:8px}.today-product-media>b{position:absolute;right:6px;top:6px;padding:3px 5px;background:color-mix(in srgb,var(--vd-surface-raised) 92%,transparent);font-size:8px}.today-product-copy{display:grid;gap:4px;padding:9px}.today-product-copy>strong{font-size:10px;line-height:1.35;min-height:27px}.today-product-copy>span{font-size:8px;color:var(--vd-ink-muted)}.today-product-copy>div{display:flex;align-items:center;justify-content:space-between;gap:8px}.today-product-copy em{font-size:11px;font-style:normal;font-weight:750}.today-product-copy small{font-size:8px;color:var(--vd-success)}.today-middle-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(235px,.65fr);gap:12px;margin-bottom:12px}.today-table-wrap{overflow:auto}.today-table{width:100%;border-collapse:collapse;font-size:9px}.today-table th,.today-table td{padding:7px 10px;border-top:1px solid var(--vd-line);text-align:left;white-space:nowrap}.today-table th{color:var(--vd-ink-muted);font-weight:600}.today-table td:first-child button{display:flex;align-items:center;gap:8px;border:0;background:transparent;color:var(--vd-ink);text-align:left;cursor:pointer}.today-table td:first-child button>span{width:34px;height:28px;display:grid;place-items:center}.today-table td:first-child img{width:34px;height:28px;object-fit:contain}.today-table td:first-child div{display:grid;gap:2px}.today-table td:first-child strong{font-size:9px}.today-table td:first-child small{font-size:8px;color:var(--vd-ink-muted)}.today-status{padding:3px 6px;background:var(--vd-warning-soft);color:var(--vd-warning);font-size:8px}.attention-list.compact{padding:0 10px}.attention-list.compact .attention-item{width:100%;display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 0;border:0;border-top:1px solid var(--vd-line);background:transparent;color:var(--vd-ink);text-align:left;cursor:pointer}.attention-list.compact .attention-item:first-child{border-top:0}.attention-symbol{width:18px;height:18px;display:grid;place-items:center;color:var(--vd-brand);font-size:10px}.attention-copy{display:grid;gap:2px}.attention-copy strong{font-size:9px}.attention-copy small{font-size:8px;color:var(--vd-ink-muted)}.attention-list.compact .attention-item>b{font-size:9px}.today-panel-footer{display:block;margin:8px auto 10px}.today-activity-panel{margin-bottom:0}.today-activity-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:0 12px 12px}.today-activity-grid>div{min-width:0}.today-activity-grid h4{margin-bottom:6px;font-size:9px}.today-activity-grid .activity-item{width:100%;display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:7px;align-items:center;padding:7px 0;border:0;border-top:1px solid var(--vd-line);background:transparent;color:var(--vd-ink);text-align:left;cursor:pointer}.today-activity-grid .activity-item:first-child{border-top:0}.today-activity-grid .activity-copy{font-size:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.today-activity-grid .activity-time{font-size:8px;color:var(--vd-ink-muted);white-space:nowrap}.inspector-photo-count{position:absolute;left:8px;bottom:8px;padding:4px 6px;background:rgba(0,0,0,.66);color:#fff;font-size:8px}.inspector-title-row{display:flex;align-items:start;justify-content:space-between;gap:8px}.inspector-title-row>div{min-width:0}.inspector-thumbs>span{display:grid;place-items:center;border:1px solid var(--vd-line);font-size:9px;color:var(--vd-ink-muted)}
.publish-loading-state{min-height:250px;display:grid;place-items:center;align-content:center;gap:10px;color:var(--vd-ink-muted)}.publish-loading-state>span{width:28px;height:28px;border:2px solid var(--vd-line);border-top-color:var(--vd-brand);border-radius:50%;animation:spin .8s linear infinite}.publish-loading-state strong{font-size:11px}@keyframes spin{to{transform:rotate(360deg)}}

/* Width and device hardening */
@media(max-width:1450px){.dashboard-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.dashboard-chart-grid{grid-template-columns:1.35fr 1fr}.dashboard-chart-grid>.dashboard-card:last-child{grid-column:1/-1}.dashboard-category-chart{grid-template-columns:180px minmax(0,1fr)}.today-ready-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.today-ready-grid>.today-product-card:nth-child(n+4){display:none}}
@media(max-width:1180px){.dashboard-layout{grid-template-columns:1fr}.dashboard-rail{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-chart-grid{grid-template-columns:1fr 1fr}.dashboard-line-card{grid-column:1/-1}.dashboard-lower-grid{grid-template-columns:1fr}.studio-layout-v2{grid-template-columns:1fr}.studio-layout-v2 .studio-inspector{position:relative;top:auto;max-height:none;display:none}.studio-layout-v2 .studio-inspector:has(.inspector-content:not(.hidden)){display:block}.today-middle-grid{grid-template-columns:1fr}.today-ready-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.today-ready-grid>.today-product-card:nth-child(n){display:block}}
@media(max-width:900px){.dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-chart-grid{grid-template-columns:1fr}.dashboard-chart-grid>.dashboard-card{grid-column:auto!important}.dashboard-focus-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-rail{grid-template-columns:1fr}.today-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.today-summary-grid>button:last-child{grid-column:1/-1}.today-ready-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.today-filterbar{align-items:stretch;flex-direction:column}.today-filter-tabs{overflow:auto;padding-bottom:2px}.today-filter-tabs button{flex:0 0 auto}.today-activity-grid{grid-template-columns:1fr}.dashboard-heading{align-items:flex-start}.dashboard-controls{width:100%}.dashboard-controls select{flex:1}}
@media(max-width:620px){.dashboard-kpis{grid-template-columns:1fr}.dashboard-kpi{min-height:105px}.dashboard-focus-grid{grid-template-columns:1fr}.dashboard-category-chart{grid-template-columns:1fr;justify-items:center}.dashboard-category-legend{width:100%}.dashboard-line-card .dashboard-chart{height:220px;overflow-x:auto}.dashboard-line-card svg{min-width:620px}.dashboard-lower-grid{display:block}.dashboard-actions-card{margin-top:12px}.today-summary-grid{grid-template-columns:1fr}.today-summary-grid>button:last-child{grid-column:auto}.today-ready-grid{grid-template-columns:1fr}.today-product-card{display:grid;grid-template-columns:115px minmax(0,1fr)}.today-product-media{height:108px}.today-table{min-width:650px}.today-activity-grid{padding-inline:10px}.dashboard-controls{flex-direction:column;align-items:stretch}.dashboard-controls .vd-button{width:100%}}

/* ========================================================================== 
   Slice 11 — dashboard-first, fluid analytics & Studio Flow image hardening
   ========================================================================== */
.dashboard-page,
.dashboard-layout,
.dashboard-main,
.dashboard-chart-grid,
.dashboard-kpis,
.today-ready-grid,
.today-product-card { min-width: 0; }

/* KPI cards determine their own column count from the actually available width. */
.dashboard-kpis {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  align-items: stretch;
}
.dashboard-kpi {
  min-height: 132px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: minmax(62px, auto) 32px;
  column-gap: 10px;
  row-gap: 8px;
  align-content: start;
  padding: 12px;
}
.dashboard-kpi-icon {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  flex: none;
}
.dashboard-kpi > div {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  align-content: start;
}
.dashboard-kpi small,
.dashboard-kpi em {
  overflow-wrap: anywhere;
}
.dashboard-kpi strong {
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-kpi svg {
  position: static;
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  width: 100%;
  height: 30px;
  max-width: none;
  overflow: visible;
}

.dashboard-chart-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.dashboard-line-card { grid-column: span 5; }
.dashboard-chart-grid > .dashboard-card:nth-child(2) { grid-column: span 4; }
.dashboard-chart-grid > .dashboard-card:nth-child(3) { grid-column: span 3; }
.dashboard-chart,
.dashboard-bar-chart,
.dashboard-category-chart { min-width: 0; width: 100%; }
.dashboard-chart { overflow: hidden; }
.dashboard-chart svg { display: block; width: 100%; max-width: 100%; }
.dashboard-bar-chart { gap: clamp(5px, 1vw, 12px); }
.dashboard-bar-item { min-width: 42px; }
.dashboard-category-chart { grid-template-columns: minmax(112px, 42%) minmax(0, 1fr); }
.dashboard-donut { width: min(100%, 150px); }

/* Ready products always retain the complete product photo. */
.today-ready-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  align-items: stretch;
}
.today-ready-grid > .today-product-card:nth-child(n) { display: grid; }
.today-product-card {
  grid-template-rows: auto 1fr;
  height: 100%;
}
.today-product-media {
  width: 100%;
  height: auto;
  min-height: 150px;
  aspect-ratio: 4 / 3;
  padding: 9px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--vd-surface-raised), var(--vd-surface-muted));
}
.today-product-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  margin: auto;
  object-fit: contain;
  object-position: center;
}
.today-product-copy { align-content: start; }
.today-product-copy > strong {
  min-height: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

@media (max-width: 1550px) {
  .dashboard-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-line-card { grid-column: 1 / -1; }
  .dashboard-chart-grid > .dashboard-card:nth-child(2),
  .dashboard-chart-grid > .dashboard-card:nth-child(3) { grid-column: auto; }
  .today-ready-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 1180px) {
  .dashboard-chart-grid { grid-template-columns: 1fr; }
  .dashboard-chart-grid > .dashboard-card { grid-column: auto !important; }
  .dashboard-category-chart { grid-template-columns: minmax(130px, 32%) minmax(0, 1fr); }
  .today-ready-grid { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); }
  .dashboard-kpi { min-height: 126px; }
  .dashboard-category-chart { grid-template-columns: 1fr; justify-items: center; }
  .dashboard-category-legend { width: 100%; }
  .dashboard-line-card .dashboard-chart { height: 220px; overflow: hidden; }
  .dashboard-line-card svg { min-width: 0 !important; width: 100% !important; }
  .today-ready-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding-inline: 9px; }
  .today-product-media { min-height: 125px; padding: 7px; }
}

@media (max-width: 520px) {
  .dashboard-kpis { grid-template-columns: 1fr; }
  .dashboard-kpi {
    min-height: 112px;
    grid-template-columns: 26px minmax(0, 1fr) minmax(90px, 34%);
    grid-template-rows: auto;
    align-items: center;
  }
  .dashboard-kpi-icon { grid-column: 1; grid-row: 1; }
  .dashboard-kpi > div { grid-column: 2; grid-row: 1; }
  .dashboard-kpi svg { grid-column: 3; grid-row: 1; height: 44px; }
  .today-ready-grid { grid-template-columns: 1fr; }
  .today-product-card {
    display: grid;
    grid-template-columns: minmax(112px, 36%) minmax(0, 1fr);
    grid-template-rows: 1fr;
  }
  .today-product-media {
    height: 100%;
    min-height: 125px;
    aspect-ratio: auto;
  }
}
.today-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--vd-ink-muted);
  font-size: 9px;
  text-align: center;
}
@media (max-width: 760px) and (min-width: 521px) {
  .today-product-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* Vendoo Brand Asset Integration */
.sidebar-logo{width:100%;display:flex;align-items:center;justify-content:flex-start;min-width:0}
.brand-logo-full{display:block;width:124px;max-width:100%;height:auto;object-fit:contain;object-position:left center}
.brand-logo-icon{display:none;width:34px;height:34px;object-fit:contain}
@media(max-width:1024px){
  .sidebar-logo{justify-content:center}
  .brand-logo-full{display:none}
  .brand-logo-icon{display:block}
}

/* --- AI Model Photos --- */
.ai-model-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  display: grid;
  gap: 12px;
}

.ai-model-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-model-card-head > div:first-child {
  display: flex;
  gap: 12px;
}

.ai-model-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.ai-model-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ai-model-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.ai-model-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ai-model-controls .small-btn {
  height: 40px;
  justify-content: center;
}

.ai-model-status {
  font-size: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
}

.ai-model-status.is-working { border-color: color-mix(in srgb, var(--vd-warning) 38%, var(--line)); }
.ai-model-status.is-success { border-color: color-mix(in srgb, var(--vd-success) 42%, var(--line)); }
.ai-model-status.is-danger { border-color: color-mix(in srgb, var(--vd-danger) 42%, var(--line)); }

.ai-model-grid {
  display: grid;
  gap: 12px;
}

.ai-model-grid-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ai-model-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.ai-model-shot-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.ai-model-shot-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
}

.ai-model-shot-copy {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.ai-model-shot-copy strong,
.ai-model-shot-copy span {
  font-size: 12px;
}

.detail-ai-model-card {
  margin-top: 14px;
}

@media (max-width: 980px) {
  .ai-model-controls {
    grid-template-columns: 1fr;
  }

  .ai-model-grid-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Slice 15: AI provider settings */
.settings-form { max-width: 920px; }
.ai-settings-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 16px;
  background: var(--panel);
}
.ai-settings-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.ai-settings-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.ai-settings-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.ai-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.ai-settings-grid > div { min-width: 0; }
.setting-inline-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-bottom: 14px;
}
.setting-inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.setting-inline-checks input { margin: 0; }
.inline-input-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.compact-inline {
  white-space: nowrap;
  height: 40px;
}
.ai-models-status {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 10px 12px;
  color: var(--text);
}
.openrouter-models-preview {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.openrouter-model-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.openrouter-model-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.openrouter-model-top strong {
  display: block;
  font-size: 13px;
}
.openrouter-model-top span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.openrouter-model-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.openrouter-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.openrouter-badge.is-free {
  border-color: color-mix(in srgb, var(--success) 45%, var(--line));
}
.openrouter-model-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
@media (max-width: 960px) {
  .ai-settings-grid,
  .setting-inline-checks {
    grid-template-columns: 1fr;
  }
  .inline-input-actions {
    grid-template-columns: 1fr;
  }
}


.ai-generation-history-wrap {
  display: grid;
  gap: 10px;
}
.ai-generation-history-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.ai-generation-history-head strong,
.ai-generation-history-head span,
.ai-generation-empty {
  font-size: 12px;
}
.ai-generation-history-head span,
.ai-generation-empty { color: var(--muted); }
.ai-generation-history {
  display: grid;
  gap: 10px;
}
.ai-generation-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  background: var(--surface);
  display: grid;
  gap: 10px;
}
.ai-generation-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.ai-generation-card header strong,
.ai-generation-card header span {
  font-size: 12px;
}
.ai-generation-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ai-generation-thumb {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}
.ai-generation-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

/* Slice 17: robust mobile navigation */
.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--vd-line);
  border-radius: 5px;
  background: var(--vd-surface-muted);
  color: var(--vd-ink);
  cursor: pointer;
}

@media (max-width: 768px) {
  body.mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .sidebar {
    display: flex;
    width: min(86vw, 310px) !important;
    max-width: 310px;
    transform: translate3d(-105%, 0, 0);
    transition: transform .22s ease;
    z-index: 320;
    box-shadow: none;
    overflow-y: auto;
    visibility: visible;
    pointer-events: none;
  }

  .sidebar.open {
    transform: translate3d(0, 0, 0);
    box-shadow: 10px 0 34px rgba(23, 23, 20, .24);
    pointer-events: auto;
  }

  .sidebar-header {
    min-height: var(--vd-topbar-height);
    height: auto;
    padding: 10px 12px 10px 16px;
    justify-content: space-between !important;
    gap: 12px;
  }

  .sidebar-logo {
    justify-content: flex-start !important;
    min-width: 0;
  }

  .brand-logo-full {
    display: block !important;
    max-width: 150px;
    height: 34px;
    object-fit: contain;
    object-position: left center;
  }

  .brand-logo-icon {
    display: none !important;
  }

  .sidebar-close {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .sidebar-nav {
    padding: 12px 10px 8px;
  }

  .nav-item,
  .nav-item-quiet {
    justify-content: flex-start !important;
    min-height: 44px;
    padding: 0 12px !important;
    gap: 12px;
    font-size: 14px;
  }

  .nav-item span,
  .nav-group-label,
  .sidebar-footer .theme-toggle span,
  .sidebar-user-info {
    display: block !important;
  }

  .nav-item .nav-badge {
    display: inline-flex !important;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .sidebar-footer .theme-toggle {
    justify-content: flex-start !important;
    padding: 0 10px !important;
  }

  .sidebar-user {
    text-align: left;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 310;
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(20, 20, 18, .46);
    backdrop-filter: blur(2px);
    transition: opacity .18s ease, visibility .18s ease;
  }

  .sidebar-overlay.show {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-toggle {
    display: inline-flex !important;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--vd-line);
    border-radius: 5px;
    background: var(--vd-surface);
    position: relative;
    z-index: 2;
  }
}

/* Slice 20: Local FLUX full installer */
.local-flux-install-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.local-flux-install-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
.local-flux-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.local-flux-progress {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.local-flux-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.local-flux-progress-track {
  height: 10px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.local-flux-progress-track > div {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .25s ease;
}
@media (max-width: 980px) {
  .local-flux-install-options { grid-template-columns: 1fr; }
  .local-flux-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .local-flux-actions { grid-template-columns: 1fr; }
}

/* Slice 21: detailed FLUX installation status */
.local-flux-status-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 12px;
}
.local-flux-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.local-flux-status-head > div {
  display: grid;
  gap: 3px;
}
.local-flux-status-head strong { font-size: 13px; }
.local-flux-status-head span {
  font-size: 11px;
  color: var(--muted);
}
.local-flux-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.local-flux-check {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  padding: 9px;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.local-flux-check strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.local-flux-check span {
  font-size: 11px;
  color: var(--muted);
}
.local-flux-check.is-ok {
  border-color: color-mix(in srgb, var(--vd-success) 42%, var(--line));
}
.local-flux-check.is-missing {
  border-color: color-mix(in srgb, var(--vd-warning) 40%, var(--line));
}
.local-flux-error {
  border: 1px solid color-mix(in srgb, var(--vd-danger) 45%, var(--line));
  background: color-mix(in srgb, var(--vd-danger) 7%, var(--panel));
  border-radius: 5px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.local-flux-log-details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.local-flux-log-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.local-flux-log-details pre {
  margin: 10px 0 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  background: var(--panel);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 1100px) {
  .local-flux-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .local-flux-checks { grid-template-columns: 1fr; }
  .local-flux-status-head { flex-direction: column; }
}

/* Slice 22: live FLUX installer telemetry */
.local-flux-live-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.local-flux-live-metrics > div {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 10px;
  background: var(--panel);
  display: grid;
  gap: 3px;
  min-width: 0;
}
.local-flux-live-metrics span {
  color: var(--text-muted);
  font-size: 11px;
}
.local-flux-live-metrics strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.local-flux-state-value.is-running { color: var(--accent); }
.local-flux-state-value.is-completed { color: var(--success); }
.local-flux-state-value.is-failed,
.local-flux-state-value.is-stalled { color: var(--danger); }
.local-flux-progress-track > div.is-stalled {
  animation: local-flux-pulse 1s ease-in-out infinite alternate;
}
.local-flux-progress-track > div.is-failed {
  background: var(--danger);
}
@keyframes local-flux-pulse {
  from { opacity: .45; }
  to { opacity: 1; }
}
@media (max-width: 980px) {
  .local-flux-live-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .local-flux-live-metrics { grid-template-columns: 1fr; }
}

/* Slice 23: Settings Command Center + real AI image progress */
.settings-workspace {
  padding-bottom: 96px;
}
.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(circle at 92% 16%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 38%),
    linear-gradient(135deg, var(--panel), var(--surface));
  overflow: hidden;
}
.settings-hero-copy { max-width: 720px; }
.settings-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.settings-hero h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.04em; }
.settings-hero p { margin: 0; color: var(--text-muted); line-height: 1.55; }
.settings-hero-status { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 10px; min-width: min(390px, 100%); }
.settings-status-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
}
.settings-status-chip > div { display: grid; gap: 2px; }
.settings-status-chip small { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.settings-status-chip strong { font-size: 12px; }
.settings-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 5px color-mix(in srgb, var(--text-muted) 12%, transparent); }
.settings-status-chip.is-running .settings-status-dot { background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 14%, transparent); }
.settings-status-chip.is-stopped .settings-status-dot { background: var(--warning); box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 14%, transparent); }
.settings-status-chip.is-disabled .settings-status-dot,
.settings-status-chip.is-not-installed .settings-status-dot { background: var(--text-muted); }

.settings-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.settings-nav {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.settings-nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.settings-nav-item:hover { background: var(--surface); border-color: var(--line); }
.settings-nav-item.active { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); }
.settings-nav-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: var(--surface); color: var(--accent); font-size: 16px; }
.settings-nav-item.active .settings-nav-icon { background: var(--accent); color: white; }
.settings-nav-item > span:last-child { display: grid; gap: 2px; min-width: 0; }
.settings-nav-item strong { font-size: 13px; }
.settings-nav-item small { color: var(--text-muted); font-size: 10px; }

.settings-panels { min-width: 0; }
.settings-panel { display: none; gap: 14px; }
.settings-panel.active { display: grid; }
.settings-panel-head { padding: 4px 2px 2px; }
.settings-panel-head > div { display: grid; grid-template-columns: 36px minmax(0,1fr); column-gap: 10px; align-items: center; }
.settings-panel-head span { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-size: 11px; font-weight: 800; }
.settings-panel-head h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.settings-panel-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 12px; }

.settings-card,
.flux-command-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.035);
}
.settings-card-grid { display: grid; gap: 14px; }
.settings-card-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-card-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-field-grid { display: grid; gap: 12px; }
.settings-field-grid.four-cols { grid-template-columns: repeat(4, minmax(0,1fr)); }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.settings-card-head > div { display: grid; gap: 3px; }
.settings-card-head strong { font-size: 14px; }
.settings-card-head small { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.settings-card-head.split { align-items: center; }
.settings-card .setting-group { margin: 0; }
.settings-card .setting-group + .setting-group { margin-top: 12px; }
.compact-top { max-width: 520px; margin-top: 14px !important; }
.full-span { grid-column: 1 / -1; }
.checkbox-line { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12px; }
.checkbox-line input { width: 16px; height: 16px; accent-color: var(--accent); }

.premium-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.premium-switch input { position: absolute; opacity: 0; pointer-events: none; }
.premium-switch span { position: relative; width: 42px; height: 23px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); transition: .2s ease; }
.premium-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--text-muted); transition: .2s ease; }
.premium-switch input:checked + span { background: color-mix(in srgb, var(--success) 18%, var(--surface)); border-color: color-mix(in srgb, var(--success) 55%, var(--line)); }
.premium-switch input:checked + span::after { left: 22px; background: var(--success); }
.premium-switch b { font-size: 12px; }
.premium-switch.large span { width: 54px; height: 29px; }
.premium-switch.large span::after { width: 21px; height: 21px; }
.premium-switch.large input:checked + span::after { left: 28px; }

.reference-control-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 16px 0;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.reference-control-copy { display: flex; align-items: flex-start; gap: 12px; }
.reference-control-copy > div { display: grid; gap: 4px; }
.reference-control-copy strong { font-size: 13px; }
.reference-control-copy small { color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.reference-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 7px; background: var(--accent); color: white; }
.reference-strength-row { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(140px, 1fr) 46px; align-items: center; gap: 10px; }
.reference-strength-row label, .reference-strength-row output { font-size: 11px; font-weight: 700; }
.reference-strength-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.reference-strength-row output { text-align: right; color: var(--accent); }
.modern-checks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.modern-checks label { min-height: 44px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 11px; }
.modern-checks input { accent-color: var(--accent); }

.settings-disclosure { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; }
.settings-disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.settings-disclosure summary::-webkit-details-marker { display: none; }
.settings-disclosure summary span { font-size: 12px; font-weight: 700; }
.settings-disclosure summary small { color: var(--text-muted); font-size: 10px; }
.settings-disclosure[open] summary { border-bottom: 1px solid var(--line); }
.disclosure-body { padding: 16px; }

.flux-command-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 16px;
  align-items: center;
  background:
    radial-gradient(circle at 8% 20%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 34%),
    var(--panel);
}
.flux-command-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.flux-orb { display: grid; place-items: center; width: 72px; height: 72px; flex: 0 0 auto; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); color: var(--text-muted); font-size: 11px; font-weight: 900; letter-spacing: .08em; box-shadow: inset 0 0 24px rgba(0,0,0,.06); }
.flux-orb.is-running { color: white; background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #6c5ce7)); border-color: transparent; box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 10%, transparent), 0 12px 30px color-mix(in srgb, var(--accent) 24%, transparent); }
.flux-orb.is-stopped { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); }
.flux-command-copy { min-width: 0; }
.flux-command-copy > span { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.flux-command-copy h3 { margin: 4px 0 5px; font-size: 22px; }
.flux-command-copy p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.flux-command-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.flux-health-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.flux-health-grid > div { display: grid; gap: 5px; min-height: 72px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.flux-health-grid span { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.flux-health-grid strong { font-size: 13px; }
.flux-state-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 10px; font-weight: 800; }
.flux-state-badge.is-running { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, var(--line)); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.flux-state-badge.is-stopped { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); }
.flux-state-badge.is-disabled,
.flux-state-badge.is-not-installed { color: var(--text-muted); }
.command-actions { margin-top: 14px; }

.settings-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.settings-savebar > div { display: grid; gap: 2px; }
.settings-savebar strong { font-size: 12px; }
.settings-savebar small { color: var(--text-muted); font-size: 10px; }

.ai-job-progress-card { display: grid !important; gap: 8px; padding: 12px !important; }
.ai-job-progress-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ai-job-progress-head strong { font-size: 12px; line-height: 1.35; }
.ai-job-progress-head span { color: var(--accent); font-size: 12px; font-weight: 800; }
.ai-job-progress-track { height: 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.ai-job-progress-track > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #8e77ff)); transition: width .35s ease; }
.ai-job-progress-card small { color: var(--text-muted); font-size: 10px; }

@media (max-width: 1180px) {
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { position: static; grid-template-columns: repeat(4, minmax(0,1fr)); }
  .settings-nav-item { grid-template-columns: 30px minmax(0,1fr); }
  .settings-field-grid.four-cols { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings-card-grid.three-cols { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .settings-hero { align-items: flex-start; flex-direction: column; }
  .settings-hero-status { width: 100%; min-width: 0; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav-item { flex: 0 0 190px; }
  .settings-card-grid.two-cols,
  .settings-field-grid.four-cols,
  .modern-checks,
  .flux-health-grid { grid-template-columns: 1fr; }
  .flux-command-card { grid-template-columns: 1fr; }
  .flux-command-card > .premium-switch { justify-self: start; }
}
@media (max-width: 560px) {
  .settings-hero { padding: 18px; }
  .settings-hero-status { grid-template-columns: 1fr; }
  .settings-card, .flux-command-card { padding: 14px; }
  .reference-control-card { grid-template-columns: 1fr; }
  .reference-strength-row { grid-template-columns: 1fr auto; }
  .reference-strength-row input { grid-column: 1 / -1; grid-row: 2; }
  .settings-savebar { align-items: stretch; flex-direction: column; }
  .settings-savebar button { width: 100%; }
  .flux-command-main { align-items: flex-start; }
  .flux-orb { width: 58px; height: 58px; border-radius: 18px; }
}


body.ai-prompt-open { overflow: hidden; }
.ai-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 20px;
}
.ai-prompt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 19, 0.56);
  backdrop-filter: blur(8px);
}
.ai-prompt-shell {
  position: relative;
  width: min(760px, 96vw);
  max-height: min(86vh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--vd-line);
  border-radius: 18px;
  background: var(--vd-surface-raised);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}
.ai-prompt-header,
.ai-prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
}
.ai-prompt-header { border-bottom: 1px solid var(--vd-line); }
.ai-prompt-header h2 { margin: 0; font-size: 20px; }
.ai-prompt-header p { margin: 4px 0 0; color: var(--vd-ink-muted); font-size: 12px; }
.ai-prompt-body { padding: 20px; overflow: auto; display: grid; gap: 16px; }
.ai-prompt-summary { display: flex; flex-wrap: wrap; gap: 10px; }
.ai-prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--vd-line);
  border-radius: 999px;
  background: var(--vd-surface);
  font-size: 12px;
  font-weight: 700;
}
.ai-prompt-field { display: grid; gap: 8px; }
.ai-prompt-field > span { font-weight: 700; }
.ai-prompt-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--vd-line);
  border-radius: 12px;
  background: var(--vd-surface);
  color: var(--vd-ink);
  font: inherit;
}
.ai-prompt-field small { color: var(--vd-ink-muted); }
.ai-prompt-check {
  padding: 12px 14px;
  border: 1px solid var(--vd-line);
  border-radius: 12px;
  background: var(--vd-surface);
}
.ai-prompt-footer-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  .ai-prompt-shell { width: 100%; }
  .ai-prompt-header, .ai-prompt-footer { padding: 14px; }
  .ai-prompt-body { padding: 14px; }
  .ai-prompt-footer { flex-direction: column; align-items: stretch; }
  .ai-prompt-footer-actions { width: 100%; justify-content: stretch; }
  .ai-prompt-footer-actions > .vd-button,
  .ai-prompt-footer > .vd-button { flex: 1 1 auto; }
}

/* Slice 28: Eigenständiges FLUX Studio */
.flux-studio-page { padding-bottom: 36px; }
.flux-studio-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.flux-studio-engine-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.flux-studio-layout { display:grid; grid-template-columns:minmax(340px,.88fr) minmax(420px,1.12fr); gap:18px; align-items:start; }
.flux-studio-card { min-width:0; padding:20px; border:1px solid var(--vd-line); border-radius:16px; background:var(--vd-surface-raised); box-shadow:var(--vd-shadow-sm); }
.flux-studio-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:16px; }
.flux-studio-card-head>div { display:flex; align-items:center; gap:9px; min-width:0; }
.flux-studio-card-head>div>span { display:grid; place-items:center; width:26px; height:26px; flex:0 0 auto; border-radius:8px; background:var(--vd-brand-soft); color:var(--vd-brand); font-size:10px; font-weight:850; }
.flux-studio-card-head h3 { margin:0; font-size:15px; }
.flux-studio-card-head small { color:var(--vd-ink-muted); font-size:10px; text-align:right; }
.flux-studio-prompt-field { display:grid; gap:8px; }
.flux-studio-prompt-field>span { font-size:11px; font-weight:800; }
.flux-studio-prompt-field textarea { width:100%; min-height:210px; resize:vertical; padding:14px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface); color:var(--vd-ink); font:inherit; line-height:1.55; }
.flux-studio-prompt-field textarea:focus { outline:2px solid color-mix(in srgb,var(--vd-brand) 28%,transparent); border-color:var(--vd-brand); }
.flux-studio-prompt-field small { justify-self:end; color:var(--vd-ink-muted); font-size:9px; }
.flux-studio-template-row { display:flex; gap:7px; flex-wrap:wrap; margin:12px 0 16px; }
.flux-studio-template-row button { min-height:30px; padding:6px 10px; border:1px solid var(--vd-line); border-radius:999px; background:var(--vd-surface); color:var(--vd-ink); font-size:9px; font-weight:750; cursor:pointer; }
.flux-studio-template-row button:hover { border-color:var(--vd-brand); color:var(--vd-brand); }
.flux-studio-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.flux-studio-fields label { display:grid; gap:6px; font-size:10px; font-weight:750; }
.flux-studio-fields select,.flux-studio-fields input { width:100%; min-height:38px; }
.flux-seed-input { display:grid; grid-template-columns:minmax(0,1fr) 38px; gap:6px; }
.flux-seed-input button { border:1px solid var(--vd-line); border-radius:9px; background:var(--vd-surface); color:var(--vd-ink); cursor:pointer; font-size:17px; }
.flux-studio-run-row { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:18px; }
#flux-studio-status { min-width:0; color:var(--vd-ink-muted); font-size:10px; text-align:right; }
#flux-studio-status[data-tone="success"] { color:var(--vd-success); }
#flux-studio-status[data-tone="error"] { color:var(--vd-danger); }
.flux-studio-progress { display:grid; gap:7px; margin-top:14px; }
.flux-studio-progress>div:first-child { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--vd-ink-muted); font-size:10px; }
#flux-studio-progress-bar { width:0; height:100%; background:var(--vd-brand); transition:width .25s ease; }
.flux-studio-preview-card { position:sticky; top:18px; }
.flux-studio-preview { min-height:520px; display:grid; place-items:center; overflow:hidden; border:1px solid var(--vd-line); border-radius:14px; background:linear-gradient(135deg,var(--vd-surface-muted),var(--vd-surface)); }
.flux-studio-preview img { display:block; width:100%; max-height:680px; object-fit:contain; }
.flux-studio-preview-empty { display:grid; justify-items:center; gap:7px; padding:34px; text-align:center; color:var(--vd-ink-muted); }
.flux-studio-preview-empty b { font-size:34px; color:var(--vd-brand); }
.flux-studio-preview-empty strong { color:var(--vd-ink); font-size:14px; }
.flux-studio-preview-empty span { font-size:10px; }
.flux-studio-preview-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.flux-studio-preview-actions .danger { margin-left:auto; }
.flux-studio-history-section { margin-top:22px; }
.flux-studio-history-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:13px; }
.flux-studio-history-head h3 { margin:2px 0 0; }
.flux-studio-history { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.flux-history-card { min-width:0; overflow:hidden; border:1px solid var(--vd-line); border-radius:14px; background:var(--vd-surface-raised); transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.flux-history-card:hover { transform:translateY(-2px); box-shadow:var(--vd-shadow-sm); }
.flux-history-card.is-selected { border-color:var(--vd-brand); box-shadow:0 0 0 2px color-mix(in srgb,var(--vd-brand) 12%,transparent); }
.flux-history-image { width:100%; height:190px; padding:0; border:0; background:var(--vd-surface-muted); cursor:pointer; }
.flux-history-image img { display:block; width:100%; height:100%; object-fit:cover; }
.flux-history-copy { display:grid; gap:5px; padding:11px 12px 7px; }
.flux-history-copy strong { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; font-size:10px; line-height:1.4; }
.flux-history-copy small { color:var(--vd-ink-muted); font-size:8px; }
.flux-history-actions { display:flex; gap:6px; padding:7px 12px 12px; }
.flux-history-actions .small-btn { min-height:28px; padding:5px 8px; font-size:8px; }
.flux-history-actions .danger { color:var(--vd-danger); }
@media(max-width:1180px){.flux-studio-layout{grid-template-columns:1fr}.flux-studio-preview-card{position:static}.flux-studio-history{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){.flux-studio-heading{flex-direction:column}.flux-studio-engine-actions{justify-content:flex-start}.flux-studio-history{grid-template-columns:repeat(2,minmax(0,1fr))}.flux-studio-preview{min-height:380px}}
@media(max-width:560px){.flux-studio-card{padding:14px}.flux-studio-fields{grid-template-columns:1fr}.flux-studio-run-row{align-items:stretch;flex-direction:column}.flux-studio-run-row .vd-button{width:100%}#flux-studio-status{text-align:left}.flux-studio-preview-actions{display:grid;grid-template-columns:1fr}.flux-studio-preview-actions .danger{margin-left:0}.flux-studio-history{grid-template-columns:1fr}.flux-history-image{height:240px}.flux-studio-engine-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.flux-studio-engine-actions .settings-status-chip{grid-column:1/-1}}


/* Slice 29: Top-Tabs, Theme Polish und optimiertes FLUX Studio */
.settings-workspace { --settings-radius: 16px; }
.settings-hero { border-radius: var(--settings-radius); padding: 22px 24px; box-shadow: var(--vd-shadow-sm); }
.settings-shell { display: block; }
.settings-nav {
  position: sticky; top: 10px; z-index: 15;
  display: flex; gap: 6px; width: 100%; margin-bottom: 18px; padding: 6px;
  overflow-x: auto; scrollbar-width: thin;
  border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 10px 30px rgba(0,0,0,.08); backdrop-filter: blur(18px);
}
.settings-nav-item {
  flex: 1 1 0; min-width: 150px; min-height: 54px;
  grid-template-columns: 32px minmax(0,1fr); padding: 8px 12px;
  border: 1px solid transparent; border-radius: 10px;
}
.settings-nav-item:hover { transform: translateY(-1px); }
.settings-nav-item.active { background: var(--panel); box-shadow: 0 7px 20px rgba(0,0,0,.09); }
.settings-nav-item small { display: none; }
.settings-nav-icon { width: 30px; height: 30px; border-radius: 9px; }
.settings-panel { animation: settings-panel-in .22s ease both; }
@keyframes settings-panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.settings-panel-head { padding: 6px 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.settings-card, .flux-command-card, .local-flux-status-panel, .settings-disclosure {
  border-radius: 14px; border-color: color-mix(in srgb, var(--line) 88%, var(--accent));
  box-shadow: 0 8px 24px rgba(0,0,0,.045);
}
.settings-card:hover { border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); }
.settings-savebar { position: sticky; bottom: 12px; z-index: 20; border-radius: 14px; }
.settings-inline-note { display:flex; align-items:flex-start; gap:10px; margin-top:14px; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text-muted); font-size:10px; line-height:1.45; }
.settings-inline-note strong { color:var(--accent); }

.flux-studio-heading { padding: 22px 24px; margin-bottom: 18px; border: 1px solid var(--vd-line); border-radius: 18px; background: radial-gradient(circle at 88% 12%, color-mix(in srgb,var(--vd-brand) 18%,transparent), transparent 34%), linear-gradient(135deg,var(--vd-surface-raised),var(--vd-surface)); box-shadow:var(--vd-shadow-sm); }
.flux-studio-card { border-radius:18px; }
.flux-studio-controls { background: linear-gradient(180deg, color-mix(in srgb,var(--vd-brand) 3%,var(--vd-surface-raised)), var(--vd-surface-raised)); }
.flux-prompt-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:12px 0 10px; }
.flux-prompt-toolbar .flux-studio-template-row { margin:0; }
.flux-optimize-button { flex:0 0 auto; min-height:32px; color:var(--vd-brand); border-color:color-mix(in srgb,var(--vd-brand) 38%,var(--vd-line)); }
.flux-prompt-quality { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:15px; padding:10px 12px; border:1px solid var(--vd-line); border-radius:11px; background:var(--vd-surface); }
.flux-prompt-quality > span { display:flex; align-items:center; gap:7px; flex:0 0 auto; font-size:9px; }
.flux-prompt-quality i { width:8px; height:8px; border-radius:50%; background:var(--vd-ink-muted); box-shadow:0 0 0 4px color-mix(in srgb,var(--vd-ink-muted) 12%,transparent); }
.flux-prompt-quality p { margin:0; color:var(--vd-ink-muted); font-size:9px; text-align:right; }
.flux-prompt-quality[data-level="weak"] i { background:var(--vd-danger); }
.flux-prompt-quality[data-level="good"] i { background:#d99a24; }
.flux-prompt-quality[data-level="strong"] i { background:var(--vd-success); }
.flux-profile-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:14px; }
.flux-profile-strip button { display:grid; gap:3px; min-width:0; padding:10px; text-align:left; border:1px solid var(--vd-line); border-radius:11px; background:var(--vd-surface); color:var(--vd-ink); cursor:pointer; transition:.18s ease; }
.flux-profile-strip button:hover { transform:translateY(-1px); border-color:var(--vd-brand); }
.flux-profile-strip button.active { border-color:var(--vd-brand); background:var(--vd-brand-soft); box-shadow:0 0 0 2px color-mix(in srgb,var(--vd-brand) 10%,transparent); }
.flux-profile-strip strong { font-size:10px; }
.flux-profile-strip small { color:var(--vd-ink-muted); font-size:8px; line-height:1.35; }
.flux-studio-preview { position:relative; background-image: linear-gradient(45deg,color-mix(in srgb,var(--vd-line) 35%,transparent) 25%,transparent 25%),linear-gradient(-45deg,color-mix(in srgb,var(--vd-line) 35%,transparent) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,color-mix(in srgb,var(--vd-line) 35%,transparent) 75%),linear-gradient(-45deg,transparent 75%,color-mix(in srgb,var(--vd-line) 35%,transparent) 75%); background-size:20px 20px; background-position:0 0,0 10px,10px -10px,-10px 0; }
.flux-studio-preview img { position:relative; z-index:1; background:var(--vd-surface); }
.flux-studio-preview-actions { padding-top:12px; border-top:1px solid var(--vd-line); }
.flux-studio-preview-actions .primary { box-shadow:0 7px 20px color-mix(in srgb,var(--vd-brand) 22%,transparent); }
.flux-history-card { border-radius:16px; }

@media(max-width:900px){
  .settings-nav-item { flex:0 0 165px; }
  .flux-profile-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .flux-prompt-toolbar { align-items:stretch; flex-direction:column; }
  .flux-optimize-button { width:100%; }
}
@media(max-width:560px){
  .settings-nav { top:6px; padding:5px; }
  .settings-nav-item { flex-basis:138px; min-width:138px; min-height:48px; padding:7px 9px; }
  .settings-nav-icon { display:none; }
  .settings-nav-item { grid-template-columns:1fr; }
  .flux-studio-heading { padding:17px; border-radius:14px; }
  .flux-profile-strip { grid-template-columns:1fr 1fr; }
  .flux-prompt-quality { align-items:flex-start; flex-direction:column; }
  .flux-prompt-quality p { text-align:left; }
}

/* Slice 30 · FLUX Studio Pro */
.flux-studio-pro-layout { grid-template-columns:minmax(390px,.9fr) minmax(440px,1.1fr); }
.flux-studio-side-stack { display:grid; gap:18px; min-width:0; }
.flux-order-options { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; margin:14px 0; }
.flux-option-block { display:grid; gap:7px; }
.flux-option-label { font-size:10px; font-weight:800; color:var(--vd-ink); }
.flux-segmented { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; padding:4px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface-muted); }
.flux-segmented button { min-height:34px; border:0; border-radius:8px; background:transparent; color:var(--vd-ink-muted); font-size:10px; font-weight:800; cursor:pointer; }
.flux-segmented button:hover { color:var(--vd-ink); }
.flux-segmented button.active { background:var(--vd-surface-raised); color:var(--vd-brand); box-shadow:var(--vd-shadow-sm); }
.flux-lock-toggle { display:flex; align-items:center; gap:10px; min-height:58px; padding:10px 12px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface); cursor:pointer; }
.flux-lock-toggle input { width:18px; height:18px; accent-color:var(--vd-brand); }
.flux-lock-toggle span { display:grid; gap:2px; }
.flux-lock-toggle strong { font-size:10px; }
.flux-lock-toggle small { color:var(--vd-ink-muted); font-size:9px; line-height:1.35; }
.flux-indeterminate-track { position:relative; height:6px; overflow:hidden; border-radius:999px; background:var(--vd-surface-muted); }
.flux-indeterminate-track i { position:absolute; inset:0 auto 0 -35%; width:35%; border-radius:999px; background:var(--vd-brand); animation:flux-indeterminate 1.25s ease-in-out infinite; }
.flux-studio-progress[data-state="done"] .flux-indeterminate-track i { left:0; width:100%; animation:none; background:var(--vd-success); }
.flux-studio-progress[data-state="error"] .flux-indeterminate-track i,.flux-studio-progress[data-state="cancelled"] .flux-indeterminate-track i { left:0; width:100%; animation:none; background:var(--vd-danger); }
@keyframes flux-indeterminate { 0%{transform:translateX(0)} 50%{transform:translateX(285%)} 100%{transform:translateX(0)} }
.flux-variant-results { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.flux-variant-tile { min-width:0; padding:4px; border:1px solid var(--vd-line); border-radius:11px; background:var(--vd-surface); color:var(--vd-ink); cursor:pointer; text-align:left; }
.flux-variant-tile.active { border-color:var(--vd-brand); box-shadow:0 0 0 2px color-mix(in srgb,var(--vd-brand) 18%,transparent); }
.flux-variant-tile img { width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:8px; display:block; }
.flux-variant-tile span,.flux-variant-tile small { display:block; padding:4px 4px 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.flux-variant-tile span { font-size:9px; font-weight:800; }
.flux-variant-tile small { padding-top:1px; color:var(--vd-ink-muted); font-size:8px; }
.flux-runtime-card { position:relative; }
.flux-runtime-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.flux-runtime-grid>div { display:grid; gap:3px; min-width:0; padding:11px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface); }
.flux-runtime-grid span { color:var(--vd-ink-muted); font-size:9px; font-weight:750; }
.flux-runtime-grid strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.flux-runtime-grid small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--vd-ink-muted); font-size:8px; }
.flux-job-center { margin-top:22px; padding:20px; border:1px solid var(--vd-line); border-radius:18px; background:var(--vd-surface-raised); box-shadow:var(--vd-shadow-sm); }
.flux-job-center-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:14px; }
.flux-job-center-head h3 { margin:2px 0 3px; }
.flux-job-center-head p:last-child { margin:0; color:var(--vd-ink-muted); font-size:10px; }
.flux-job-center-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.flux-job-center-actions select { min-height:38px; border:1px solid var(--vd-line); border-radius:10px; background:var(--vd-surface); color:var(--vd-ink); padding:0 10px; }
.flux-job-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.flux-job-summary>div { display:grid; gap:3px; padding:11px 12px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface); }
.flux-job-summary span { color:var(--vd-ink-muted); font-size:9px; }
.flux-job-summary strong { font-size:16px; }
.flux-job-list { display:grid; gap:10px; }
.flux-job-card { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:14px; align-items:center; padding:14px; border:1px solid var(--vd-line); border-radius:14px; background:var(--vd-surface); }
.flux-job-card-main { min-width:0; }
.flux-job-status-line { display:flex; align-items:center; gap:8px; margin-bottom:7px; }
.flux-job-status-line small { color:var(--vd-ink-muted); font-size:8px; }
.flux-job-status { display:inline-flex; align-items:center; min-height:22px; padding:3px 8px; border-radius:999px; background:var(--vd-surface-muted); color:var(--vd-ink-muted); font-size:8px; font-weight:850; }
.flux-job-status.is-running,.flux-job-status.is-queued { background:color-mix(in srgb,var(--vd-brand) 12%,var(--vd-surface)); color:var(--vd-brand); }
.flux-job-status.is-completed { background:color-mix(in srgb,var(--vd-success) 13%,var(--vd-surface)); color:var(--vd-success); }
.flux-job-status.is-failed,.flux-job-status.is-cancelled { background:color-mix(in srgb,var(--vd-danger) 12%,var(--vd-surface)); color:var(--vd-danger); }
.flux-job-status.is-completed_with_errors,.flux-job-status.is-cancelling { background:color-mix(in srgb,#c88600 13%,var(--vd-surface)); color:#a66f00; }
.flux-job-prompt { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.flux-job-params { display:flex; gap:5px; flex-wrap:wrap; margin-top:7px; }
.flux-job-params span { padding:3px 7px; border-radius:999px; background:var(--vd-surface-muted); color:var(--vd-ink-muted); font-size:8px; }
.flux-job-card-main p { margin:7px 0 0; color:var(--vd-ink-muted); font-size:9px; line-height:1.45; }
.flux-job-card-main p b { color:var(--vd-danger); font-weight:700; }
.flux-job-variants { display:flex; gap:6px; flex-wrap:wrap; max-width:220px; justify-content:flex-end; }
.flux-job-thumb { position:relative; display:grid; place-items:center; width:48px; height:48px; padding:0; overflow:hidden; border:1px solid var(--vd-line); border-radius:9px; background:var(--vd-surface-muted); color:var(--vd-ink-muted); cursor:pointer; }
.flux-job-thumb img { width:100%; height:100%; object-fit:cover; }
.flux-job-thumb>span { position:absolute; right:3px; bottom:3px; display:grid; place-items:center; min-width:16px; height:16px; border-radius:999px; background:rgba(0,0,0,.72); color:#fff; font-size:8px; }
.flux-job-thumb.is-placeholder { cursor:default; }
.flux-job-thumb.is-placeholder span { position:static; background:transparent; color:var(--vd-ink); font-weight:800; }
.flux-job-thumb.is-placeholder small { font-size:7px; }
.flux-job-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; max-width:190px; }
.flux-library-actions { display:flex; align-items:center; gap:10px; }
.flux-library-actions label { display:flex; align-items:center; gap:6px; color:var(--vd-ink-muted); font-size:9px; }
.flux-history-image { position:relative; }
.flux-history-image>span { position:absolute; top:7px; right:7px; color:#ffd15c; font-size:18px; text-shadow:0 1px 4px rgba(0,0,0,.45); }

@media(max-width:1180px){
  .flux-studio-pro-layout{grid-template-columns:1fr}
  .flux-job-card{grid-template-columns:minmax(0,1fr) auto}
  .flux-job-actions{grid-column:1/-1;justify-content:flex-start;max-width:none}
}
@media(max-width:820px){
  .flux-order-options,.flux-runtime-grid{grid-template-columns:1fr}
  .flux-job-center-head{align-items:stretch;flex-direction:column}
  .flux-job-center-actions{justify-content:flex-start}
  .flux-job-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .flux-job-card{grid-template-columns:1fr}
  .flux-job-variants{justify-content:flex-start;max-width:none}
  .flux-job-actions{grid-column:auto}
}
@media(max-width:560px){
  .flux-variant-results{grid-template-columns:repeat(2,minmax(0,1fr))}
  .flux-job-center{padding:14px}
  .flux-job-center-actions{display:grid;grid-template-columns:1fr}
  .flux-job-center-actions>*{width:100%}
  .flux-job-summary{grid-template-columns:1fr}
  .flux-library-actions{align-items:flex-start;flex-direction:column}
}

/* Slice 30 – sichtbares Variantenprotokoll im Job-Center */
.flux-job-variant-ledger { display: grid; gap: .38rem; min-width: 0; }
.flux-job-variant-ledger > div { display: grid; grid-template-columns: 2.2rem minmax(6.5rem,auto) minmax(6rem,1fr) minmax(7rem,auto); align-items: center; gap: .5rem; padding: .42rem .55rem; border: 1px solid var(--border); border-radius: .65rem; background: color-mix(in srgb, var(--surface) 82%, transparent); font-size: .75rem; }
.flux-job-variant-ledger b { color: var(--text); }
.flux-job-variant-ledger span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flux-job-variant-ledger code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.flux-job-thumb small { display: block; max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .flux-job-variant-ledger > div { grid-template-columns: 2rem 1fr; }
  .flux-job-variant-ledger code { grid-column: 1 / -1; }
}


/* Vendoo 1.23.2 · FLUX layout, collapsible jobs and editor tools */
.flux-studio-left-stack { display:grid; gap:18px; min-width:0; align-content:start; }
.flux-studio-left-stack .flux-runtime-card { position:static; }
.flux-job-center-body.hidden { display:none !important; }
.flux-job-center-toggle { white-space:nowrap; }

.flux-job-card { display:block; padding:0; overflow:hidden; }
.flux-job-card-toggle {
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:12px 14px; border:0; color:var(--vd-ink); background:transparent; cursor:pointer; text-align:left;
}
.flux-job-card-toggle:hover { background:var(--vd-surface-muted); }
.flux-job-card-toggle-main { min-width:0; display:flex; align-items:center; gap:9px; flex:1; }
.flux-job-card-toggle-main .flux-job-prompt { min-width:0; }
.flux-job-card-toggle-meta { display:flex; align-items:center; gap:9px; flex:0 0 auto; color:var(--vd-ink-muted); font-size:8px; }
.flux-job-card-toggle-meta i { display:inline-grid; place-items:center; width:24px; height:24px; border-radius:999px; background:var(--vd-surface-muted); color:var(--vd-ink); font-style:normal; font-size:15px; transition:transform .18s ease; }
.flux-job-card.is-expanded .flux-job-card-toggle-meta i { transform:rotate(180deg); }
.flux-job-card-body {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px 14px; align-items:start;
  padding:0 14px 14px; border-top:1px solid var(--vd-line);
}
.flux-job-card.is-collapsed .flux-job-card-body { display:none; }
.flux-job-card-body .flux-job-card-main { padding-top:11px; }
.flux-job-card-body .flux-job-variants { padding-top:11px; }
.flux-job-card-body .flux-job-variant-ledger { grid-column:1/-1; }
.flux-job-card-body .flux-job-actions { grid-column:1/-1; max-width:none; justify-content:flex-start; }

.pe-special-tools { gap:11px; }
.pe-tool-toggle { display:flex; align-items:flex-start; gap:9px; padding:9px; border:1px solid var(--vd-line, var(--border)); border-radius:8px; background:var(--vd-surface-muted, var(--bg-page)); cursor:pointer; }
.pe-tool-toggle input { width:17px; height:17px; margin-top:1px; accent-color:var(--vd-brand, var(--accent)); }
.pe-tool-toggle span { display:grid; gap:3px; min-width:0; }
.pe-tool-toggle strong { font-size:10px; color:var(--vd-ink, var(--text)); }
.pe-tool-toggle small { color:var(--vd-ink-muted, var(--text-muted)); font-size:8px; line-height:1.4; }
.pe-watermark-tools { display:grid; grid-template-columns:88px minmax(0,1fr); gap:8px; align-items:center; }
.pe-watermark-tools .pe-tool-toggle { grid-column:1/-1; }
.pe-watermark-tools > label:not(.pe-tool-toggle) { color:var(--vd-ink-muted, var(--text-muted)); font-size:10px; font-weight:700; }
.pe-control-body input[type="text"] { width:100%; min-height:34px; padding:7px 9px; border:1px solid var(--vd-line, var(--border)); border-radius:7px; color:var(--vd-ink, var(--text)); background:var(--vd-surface, var(--bg-input)); }

@media(max-width:820px){
  .flux-job-card-toggle { align-items:flex-start; }
  .flux-job-card-toggle-main { align-items:flex-start; flex-direction:column; }
  .flux-job-card-toggle-meta { padding-top:1px; }
  .flux-job-card-body { grid-template-columns:1fr; }
  .flux-job-card-body .flux-job-variants,.flux-job-card-body .flux-job-variant-ledger,.flux-job-card-body .flux-job-actions { grid-column:auto; }
}

/* ========================================================================== 
   Vendoo 1.24.0 · Responsive hardening, FLUX archive and media library
   ========================================================================== */

/* Prevent any workspace child from forcing the application wider than viewport. */
.main-wrapper,
main,
.tab-content,
.page-heading,
.history-workspace,
.history-table-shell,
.history-table,
.flux-studio-pro-layout,
.flux-studio-left-stack,
.flux-job-center,
.flux-job-center-body,
.media-library-page,
.media-toolbar,
.media-grid,
.settings-shell,
.publish-workspace,
.storage-main,
.admin-grid { min-width: 0; max-width: 100%; }

.page-heading > *,
.flux-job-center-head > *,
.media-library-heading > * { min-width: 0; }

/* FLUX archive, selection and paging */
.flux-job-view-switch,
.media-view-switch {
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:3px;
  border:1px solid var(--vd-line);
  border-radius:10px;
  background:var(--vd-surface-muted);
}
.flux-job-view-switch button,
.media-view-switch button {
  min-height:30px;
  padding:0 10px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:var(--vd-ink-muted);
  font-size:9px;
  font-weight:760;
  cursor:pointer;
}
.flux-job-view-switch button.active,
.media-view-switch button.active {
  background:var(--vd-surface-raised);
  color:var(--vd-ink);
  box-shadow:0 1px 5px rgba(20,18,15,.08);
}
.flux-job-view-switch span {
  display:inline-grid;
  min-width:18px;
  height:18px;
  place-items:center;
  margin-left:3px;
  padding:0 5px;
  border-radius:999px;
  background:var(--vd-surface-muted);
  font-size:8px;
}
.flux-job-bulkbar,
.media-batchbar {
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
  padding:8px 10px;
  border:1px solid var(--vd-line);
  border-radius:11px;
  background:var(--vd-surface);
}
.flux-job-bulkbar > label,
.media-batchbar > label,
.media-check {
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--vd-ink-secondary);
  font-size:9px;
  font-weight:680;
}
.flux-job-bulkbar input,
.media-batchbar input,
.media-check input,
.media-card-select input { accent-color:var(--vd-brand); }
.flux-job-bulkbar > div,
.media-batchbar > div { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.flux-job-pagination,
.media-pagination {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:48px;
  margin-top:12px;
  color:var(--vd-ink-muted);
  font-size:9px;
}
.flux-job-pagination .page-nav-btn,
.media-pagination .page-nav-btn {
  width:34px;
  height:34px;
  border:1px solid var(--vd-line);
  border-radius:8px;
  background:var(--vd-surface-raised);
  color:var(--vd-ink);
  cursor:pointer;
}
.flux-job-pagination .page-nav-btn:disabled,
.media-pagination .page-nav-btn:disabled { opacity:.42; cursor:not-allowed; }
.flux-job-card-select {
  display:inline-grid;
  place-items:center;
  flex:0 0 auto;
  width:26px;
  height:26px;
  border-radius:7px;
  background:var(--vd-surface-muted);
}
.flux-job-card-select input { width:15px; height:15px; accent-color:var(--vd-brand); }
.flux-job-card.is-selected { border-color:var(--vd-brand); box-shadow:0 0 0 2px color-mix(in srgb,var(--vd-brand) 15%,transparent); }

/* Central media library */
.media-library-page { padding-bottom:24px; }
.media-library-heading { align-items:center; }
.media-heading-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.media-summary {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
  margin-bottom:12px;
}
.media-summary button {
  min-width:0;
  min-height:72px;
  display:grid;
  align-content:center;
  gap:4px;
  padding:11px 13px;
  border:1px solid var(--vd-line);
  border-radius:13px;
  background:var(--vd-surface-raised);
  color:var(--vd-ink);
  text-align:left;
  cursor:pointer;
}
.media-summary button:hover,
.media-summary button.active { border-color:var(--vd-brand); background:var(--vd-brand-soft); }
.media-summary span { color:var(--vd-ink-muted); font-size:9px; font-weight:680; }
.media-summary strong { font-size:19px; line-height:1; }
.media-toolbar {
  display:grid;
  grid-template-columns:minmax(220px,1fr) repeat(2,minmax(130px,auto)) auto auto auto;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
  padding:10px;
  border:1px solid var(--vd-line);
  border-radius:13px;
  background:var(--vd-surface-raised);
}
.media-toolbar select,
.media-search {
  min-width:0;
  min-height:38px;
  border:1px solid var(--vd-line);
  border-radius:9px;
  background:var(--vd-surface);
  color:var(--vd-ink);
}
.media-toolbar select { padding:0 30px 0 10px; font-size:9px; }
.media-search { display:grid; grid-template-columns:28px minmax(0,1fr); align-items:center; }
.media-search > span { display:grid; place-items:center; color:var(--vd-ink-muted); }
.media-search input { min-width:0; width:100%; height:36px; padding:0 9px 0 0; border:0; outline:0; background:transparent; color:var(--vd-ink); font-size:10px; }
.media-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr));
  gap:12px;
}
.media-card {
  min-width:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  border:1px solid var(--vd-line);
  border-radius:14px;
  background:var(--vd-surface-raised);
  transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease;
}
.media-card:hover { transform:translateY(-1px); border-color:var(--vd-line-strong); box-shadow:var(--vd-shadow-sm); }
.media-card.is-selected { border-color:var(--vd-brand); box-shadow:0 0 0 2px color-mix(in srgb,var(--vd-brand) 15%,transparent); }
.media-card-image { position:relative; min-height:180px; aspect-ratio:4/3; overflow:hidden; background:var(--vd-surface-muted); }
.media-card-image img { width:100%; height:100%; display:block; object-fit:contain; }
.media-card-select { position:absolute; top:8px; left:8px; display:grid; place-items:center; width:28px; height:28px; border-radius:8px; background:rgba(18,18,16,.72); }
.media-card-select input { width:16px; height:16px; }
.media-card-favorite-mark { position:absolute; top:9px; right:10px; color:#ffd15c; font-size:18px; text-shadow:0 1px 5px rgba(0,0,0,.5); }
.media-card-preview { position:absolute; inset:auto 8px 8px auto; min-height:28px; padding:0 9px; border:1px solid rgba(255,255,255,.35); border-radius:7px; background:rgba(15,15,13,.72); color:#fff; font-size:8px; font-weight:760; cursor:pointer; }
.media-card-content { min-width:0; display:grid; align-content:start; gap:6px; padding:11px 12px; }
.media-card-content > strong { overflow:hidden; color:var(--vd-ink); font-size:10px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.media-card-content > span,
.media-card-content > small { overflow:hidden; color:var(--vd-ink-muted); font-size:8px; line-height:1.4; text-overflow:ellipsis; white-space:nowrap; }
.media-card-sources { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.media-source-chip { display:inline-flex; min-height:19px; align-items:center; padding:2px 6px; border-radius:999px; background:var(--vd-surface-muted); color:var(--vd-ink-secondary); font-size:7px; font-weight:780; }
.media-source-chip.is-flux { background:color-mix(in srgb,var(--vd-brand) 13%,var(--vd-surface)); color:var(--vd-brand); }
.media-source-chip.is-edited { background:color-mix(in srgb,var(--vd-info) 13%,var(--vd-surface)); color:var(--vd-info); }
.media-source-chip.is-ai { background:color-mix(in srgb,var(--vd-warning) 14%,var(--vd-surface)); color:var(--vd-warning); }
.media-source-chip.is-listing { background:color-mix(in srgb,var(--vd-success) 13%,var(--vd-surface)); color:var(--vd-success); }
.media-card-actions { display:flex; gap:5px; flex-wrap:wrap; padding:0 12px 12px; }
.media-card-actions .small-btn { flex:1 1 auto; min-width:0; }
.media-grid.is-list { grid-template-columns:1fr; }
.media-grid.is-list .media-card { grid-template-columns:128px minmax(0,1fr) auto; grid-template-rows:1fr; align-items:center; }
.media-grid.is-list .media-card-image { min-height:96px; height:100%; aspect-ratio:auto; }
.media-grid.is-list .media-card-actions { max-width:350px; justify-content:flex-end; padding:10px 12px 10px 0; }
.media-empty { grid-column:1/-1; min-height:260px; display:grid; place-items:center; align-content:center; gap:8px; padding:30px; border:1px dashed var(--vd-line); border-radius:14px; color:var(--vd-ink-muted); text-align:center; }
.media-empty strong { color:var(--vd-ink); font-size:14px; }
.media-empty span { font-size:9px; }

.media-lightbox { position:fixed; inset:0; z-index:3000; display:grid; place-items:center; padding:22px; }
.media-lightbox.hidden { display:none; }
.media-lightbox-backdrop { position:absolute; inset:0; width:100%; height:100%; border:0; background:rgba(10,10,9,.78); cursor:pointer; }
.media-lightbox-dialog { position:relative; width:min(1180px,100%); max-height:calc(100dvh - 44px); overflow:auto; border:1px solid var(--vd-line); border-radius:18px; background:var(--vd-surface-raised); box-shadow:var(--vd-shadow-float); }
.media-lightbox-dialog > header,
.media-lightbox-dialog > footer { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 16px; }
.media-lightbox-dialog > header { border-bottom:1px solid var(--vd-line); }
.media-lightbox-dialog > footer { justify-content:flex-end; flex-wrap:wrap; border-top:1px solid var(--vd-line); }
.media-lightbox-dialog h3 { margin:2px 0 0; overflow:hidden; max-width:min(700px,70vw); text-overflow:ellipsis; white-space:nowrap; }
.media-lightbox-body { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(250px,.55fr); min-height:480px; }
.media-lightbox-stage { min-width:0; display:grid; place-items:center; padding:18px; background:repeating-conic-gradient(#ddd 0 25%,#fff 0 50%) 50%/20px 20px; }
.media-lightbox-stage img { max-width:100%; max-height:70dvh; object-fit:contain; }
#media-lightbox-meta { min-width:0; overflow:auto; padding:18px; border-left:1px solid var(--vd-line); }
#media-lightbox-meta dl { display:grid; grid-template-columns:90px minmax(0,1fr); gap:8px 10px; margin:14px 0; font-size:9px; }
#media-lightbox-meta dt { color:var(--vd-ink-muted); }
#media-lightbox-meta dd { min-width:0; margin:0; overflow-wrap:anywhere; color:var(--vd-ink); }
.media-lightbox-prompt { display:grid; gap:6px; padding:10px; border-radius:10px; background:var(--vd-surface-muted); }
.media-lightbox-prompt strong { font-size:9px; }
.media-lightbox-prompt p { margin:0; color:var(--vd-ink-secondary); font-size:9px; line-height:1.5; }

/* Background-removal sensitivity control */
.pe-sensitivity-help { display:block; margin-top:4px; color:var(--vd-ink-muted); font-size:8px; line-height:1.4; }

/* Real responsive listing cards instead of a viewport-breaking table. */
@media (max-width: 1180px) {
  .history-table { min-width:0; width:100%; --history-provider:0px; --history-location:0px; }
  .history-table [data-column="provider"],
  .history-table [data-column="location"] { display:none; }
  .history-table-head,
  .history-row {
    grid-template-columns:34px minmax(230px,1.7fr) 96px 92px 112px minmax(128px,1fr) 40px;
  }
}

@media (max-width: 860px) {
  .page-heading,
  .media-library-heading { align-items:flex-start; flex-direction:column; }
  .page-heading > :last-child,
  .media-heading-actions { width:100%; }
  .media-heading-actions .vd-button { flex:1; justify-content:center; }

  .history-filterbar { display:grid; grid-template-columns:1fr 1fr; align-items:stretch; }
  .history-search-field { grid-column:1/-1; }
  .history-custom-dates { grid-column:1/-1; grid-template-columns:1fr 1fr; }
  .history-filterbar > .vd-button { min-height:42px; }
  .history-batch-bar { flex-wrap:wrap; overflow:visible; }
  .history-batch-actions { flex-wrap:wrap; }
  .history-clear-selection { margin-left:0; }
  .history-table-shell { overflow:visible; border:0; background:transparent; }
  .history-table { min-width:0 !important; width:100%; overflow:visible; }
  .history-table-head { display:none; }
  .history-list { display:grid; gap:10px; }
  .history-row {
    min-height:0;
    display:grid;
    grid-template-columns:30px minmax(0,1fr) 38px;
    gap:0;
    align-items:start;
    overflow:visible;
    border:1px solid var(--vd-line);
    border-radius:13px;
    background:var(--vd-surface-raised);
  }
  .history-row:last-child { border-bottom:1px solid var(--vd-line); }
  .history-cell { padding:8px 10px; }
  .history-cell-select { grid-column:1; grid-row:1; padding:12px 0 0 12px; }
  .history-cell-article { grid-column:2; grid-row:1; padding:10px 6px; }
  .history-cell-menu { grid-column:3; grid-row:1; padding:9px 8px 0 0; }
  .history-cell-platform,
  .history-cell-provider,
  .history-cell-price,
  .history-cell-status,
  .history-cell-location,
  .history-cell-published {
    display:grid !important;
    grid-template-columns:92px minmax(0,1fr);
    grid-column:1/-1;
    align-items:center;
    gap:8px;
    min-height:38px;
    margin:0 10px;
    padding:7px 0;
    border-top:1px solid var(--vd-line);
  }
  .history-cell-platform::before { content:"Plattform"; }
  .history-cell-provider::before { content:"AI-Provider"; }
  .history-cell-price::before { content:"Preis"; }
  .history-cell-status::before { content:"Status"; }
  .history-cell-location::before { content:"Lagerort"; }
  .history-cell-published::before { content:"Aktualisiert"; }
  .history-cell-platform::before,
  .history-cell-provider::before,
  .history-cell-price::before,
  .history-cell-status::before,
  .history-cell-location::before,
  .history-cell-published::before {
    color:var(--vd-ink-muted);
    font-size:8px;
    font-weight:720;
  }
  .history-cell-provider { align-items:center; }
  .history-cell-provider > .history-provider-mark { display:none; }
  .history-cell-provider > span:last-child,
  .history-cell-price > *,
  .history-cell-status > *,
  .history-cell-location > *,
  .history-cell-published > * { grid-column:2; }
  .history-cell-provider::before,
  .history-cell-price::before,
  .history-cell-status::before,
  .history-cell-location::before,
  .history-cell-published::before { grid-column:1; grid-row:1 / span 2; }
  .history-status-select { max-width:170px; }
  .history-publish-badges { flex-wrap:wrap; }
  .history-table-footer { align-items:stretch; flex-direction:column; padding:10px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface-raised); }
  .history-pagination-nav { justify-content:space-between; }

  .media-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .media-toolbar { grid-template-columns:1fr 1fr; }
  .media-search { grid-column:1/-1; }
  .media-view-switch { justify-self:end; }
  .media-lightbox-body { grid-template-columns:1fr; }
  #media-lightbox-meta { border-top:1px solid var(--vd-line); border-left:0; }
  .media-grid.is-list .media-card { grid-template-columns:110px minmax(0,1fr); }
  .media-grid.is-list .media-card-actions { grid-column:1/-1; max-width:none; padding:0 10px 10px; }

  .flux-job-center-head { align-items:stretch; }
  .flux-job-center-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
  .flux-job-center-actions > * { width:100%; }
  .flux-job-view-switch { grid-column:1/-1; }
  .flux-job-bulkbar,
  .media-batchbar { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 620px) {
  main { padding-inline:10px !important; }
  .history-filterbar { grid-template-columns:1fr; }
  .history-search-field,
  .history-custom-dates { grid-column:auto; }
  .history-custom-dates { grid-template-columns:1fr; }
  .history-thumb { width:48px; height:44px; }
  .history-cell-platform,
  .history-cell-provider,
  .history-cell-price,
  .history-cell-status,
  .history-cell-location,
  .history-cell-published { grid-template-columns:78px minmax(0,1fr); }
  .history-page-buttons { max-width:100%; overflow:auto; }

  .media-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .media-summary button:first-child { grid-column:1/-1; }
  .media-toolbar { grid-template-columns:1fr; }
  .media-search { grid-column:auto; }
  .media-view-switch { justify-self:start; }
  .media-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .media-card-image { min-height:130px; }
  .media-card-content { padding:9px; }
  .media-card-actions { padding:0 9px 9px; }
  .media-card-actions .small-btn { flex:1 1 calc(50% - 4px); }
  .media-grid.is-list { grid-template-columns:1fr; }
  .media-grid.is-list .media-card { grid-template-columns:92px minmax(0,1fr); }
  .media-lightbox { padding:8px; }
  .media-lightbox-dialog { max-height:calc(100dvh - 16px); border-radius:12px; }
  .media-lightbox-dialog > header { align-items:flex-start; }
  .media-lightbox-dialog > footer .vd-button { flex:1 1 calc(50% - 6px); justify-content:center; }
  .media-lightbox-stage { padding:8px; }
  #media-lightbox-meta { padding:12px; }

  .flux-job-center { padding:12px; }
  .flux-job-center-actions { grid-template-columns:1fr; }
  .flux-job-view-switch { grid-column:auto; }
  .flux-job-summary { grid-template-columns:1fr 1fr; }
  .flux-job-card-toggle { gap:8px; padding:10px; }
  .flux-job-card-toggle-meta { flex-direction:column; align-items:flex-end; }
  .flux-job-card-body { padding:0 10px 10px; }
  .flux-job-bulkbar > div,
  .media-batchbar > div { width:100%; }
  .flux-job-bulkbar .vd-button,
  .media-batchbar .vd-button { flex:1 1 calc(50% - 4px); }
}

@media (max-width: 430px) {
  .media-grid { grid-template-columns:1fr; }
  .media-summary { grid-template-columns:1fr 1fr; }
  .flux-job-summary { grid-template-columns:1fr; }
}

@media (max-width: 860px) {
  .history-hide-platform .history-cell-platform,
  .history-hide-provider .history-cell-provider,
  .history-hide-price .history-cell-price,
  .history-hide-status .history-cell-status,
  .history-hide-location .history-cell-location,
  .history-hide-published .history-cell-published { display:none !important; }
}

/* ========================================================================== 
   Vendoo 1.25.0 — responsive editor, polished gallery, prompt lab & modals
   ========================================================================== */
body.modal-open { overflow:hidden; }

/* Listing editor: react to the available content width, not only viewport. */
.listings-page .history-detail {
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:clip;
  container-type:inline-size;
  container-name:listing-editor;
}
.listing-editor-shell,
.listing-editor-grid,
.listing-content-editor,
.listing-media-editor,
.listing-context-panel,
.listing-editor-section,
.listing-description-workbench,
.detail-platform-workbench,
.detail-description-pane,
.detail-html-switch-stage,
.detail-html-switch-stage > *,
.detail-html-preview,
#detail-description-editor,
#detail-html-source { min-width:0; max-width:100%; box-sizing:border-box; }
.listing-editor-grid {
  width:100%;
  grid-template-columns:minmax(190px,.78fr) minmax(0,1.65fr) minmax(170px,.62fr);
}
.listing-editor-header > div:first-child { min-width:0; }
.listing-editor-header h2,
.listing-editor-header p,
.listing-section-heading h3,
.listing-context-card strong { overflow-wrap:anywhere; word-break:break-word; }
.listing-form-grid > label,
.detail-photo-actions > *,
.listing-editor-header-actions > * { min-width:0; }
.detail-description-pane .ql-toolbar.ql-snow { display:flex; flex-wrap:wrap; gap:2px; overflow:visible; }
.detail-description-pane .ql-toolbar .ql-formats { margin-right:5px; }
.detail-platform-workbench iframe,
.detail-html-preview { width:100%; }

@container listing-editor (max-width: 1080px) {
  .listing-editor-grid { grid-template-columns:minmax(210px,260px) minmax(0,1fr); }
  .listing-context-panel { grid-column:1/-1; position:static; grid-template-columns:repeat(4,minmax(0,1fr)); }
  .listing-media-editor { top:64px; }
}
@container listing-editor (max-width: 760px) {
  .listing-editor-shell { padding-inline:10px; }
  .listing-editor-grid { grid-template-columns:minmax(0,1fr); }
  .listing-media-editor,.listing-context-panel { position:static; }
  .listing-context-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .listing-form-grid.three { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-photo-stage { aspect-ratio:4/3; max-height:460px; }
}
@container listing-editor (max-width: 500px) {
  .listing-editor-header { flex-direction:column; }
  .listing-editor-header-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; }
  .listing-form-grid.three,.listing-form-grid.two,.listing-context-panel { grid-template-columns:1fr; }
  .detail-photo-actions { grid-template-columns:1fr 1fr; }
  .listing-section-heading { align-items:flex-start; }
}
@media(max-width:620px) {
  .listings-page .history-detail { border-radius:10px; }
  .listing-editor-shell { padding-inline:8px; }
  .listing-editor-header-actions { display:grid; grid-template-columns:1fr 1fr; }
  .detail-photo-actions { grid-template-columns:1fr 1fr; }
}
@media(max-width:390px) {
  .listing-editor-header-actions,.detail-photo-actions { grid-template-columns:1fr; }
}

/* Gallery cards: clean overlays, aligned controls and stable action grid. */
.media-grid { align-items:stretch; }
.media-card { isolation:isolate; }
.media-card-image { min-height:190px; }
.media-card-image::after {
  content:""; position:absolute; inset:auto 0 0; height:64px; pointer-events:none;
  background:linear-gradient(transparent,rgba(16,16,14,.28));
}
.media-card-select {
  top:10px; left:10px; width:32px; height:32px; padding:0; z-index:4;
  border:1px solid rgba(255,255,255,.55); border-radius:10px;
  background:rgba(20,20,18,.68); box-shadow:0 5px 18px rgba(0,0,0,.18); backdrop-filter:blur(8px);
  cursor:pointer;
}
.media-card-select { display:grid; place-items:center; }
.media-card-select input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.media-card-select span {
  width:18px; height:18px; display:grid; place-items:center; pointer-events:none;
  border:2px solid rgba(255,255,255,.94); border-radius:5px; background:rgba(255,255,255,.08);
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.media-card-select input:focus-visible + span { outline:2px solid #fff; outline-offset:2px; }
.media-card-select input:checked + span { border-color:#fff; background:var(--vd-brand); transform:scale(1.03); }
.media-card-select input:checked + span::after {
  content:""; width:8px; height:4px; margin-top:-2px;
  border-left:2px solid #fff; border-bottom:2px solid #fff; transform:rotate(-45deg);
}
.media-card-favorite-toggle {
  position:absolute; top:10px; right:10px; z-index:4; width:32px; height:32px; display:grid; place-items:center;
  padding:0; border:1px solid rgba(255,255,255,.55); border-radius:10px;
  background:rgba(20,20,18,.68); color:#fff; font-size:17px; cursor:pointer; backdrop-filter:blur(8px);
}
.media-card-favorite-toggle.is-active { color:#ffd15c; background:rgba(20,20,18,.82); }
.media-card-preview {
  inset:auto 10px 10px 10px; z-index:3; min-height:34px; display:flex; align-items:center; justify-content:center; gap:6px;
  border:1px solid rgba(255,255,255,.5); border-radius:10px; background:rgba(18,18,16,.78);
  box-shadow:0 8px 24px rgba(0,0,0,.16); backdrop-filter:blur(9px); font-size:9px;
}
.media-card-preview span { font-size:13px; line-height:1; }
.media-card-content { min-height:116px; padding:12px 14px 10px; }
.media-card-content > strong {
  display:-webkit-box; min-height:2.7em; overflow:hidden; white-space:normal; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  font-size:10px; line-height:1.35;
}
.media-card-content > span,.media-card-content > small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.media-card-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:0 14px 14px; }
.media-card-actions .small-btn {
  width:100%; min-height:34px; display:flex; align-items:center; justify-content:center; margin:0;
  border-radius:9px; text-align:center; text-decoration:none;
}
.media-grid.is-list .media-card-actions { display:grid; grid-template-columns:repeat(2,minmax(120px,1fr)); width:min(360px,100%); }
@media(max-width:620px) {
  .media-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .media-card-image { min-height:150px; }
  .media-card-content { min-height:112px; }
  .media-card-actions { padding-inline:10px; }
}
@media(max-width:470px) {
  .media-grid { grid-template-columns:1fr; }
  .media-card-image { min-height:220px; }
}

/* Publish: calm refresh state and restored Smart Copy popup. */
#publish-refresh[aria-busy="true"],#publish-status-refresh[aria-busy="true"] { opacity:.72; cursor:wait; transform:none !important; animation:none !important; }
.smart-copy-launcher {
  min-height:360px; display:grid; grid-template-columns:56px minmax(0,1fr) auto; align-items:center; gap:18px;
  padding:28px; border:1px dashed var(--vd-line-strong); border-radius:14px; background:var(--vd-surface-muted);
}
.smart-copy-launcher-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:14px; background:var(--vd-brand); color:#fff; font-size:25px; }
.smart-copy-launcher h3 { margin:4px 0 7px; }
.smart-copy-launcher p { max-width:650px; color:var(--vd-ink-muted); line-height:1.55; }
.smart-copy-launcher-score { display:grid; min-width:105px; gap:2px; padding:12px; border:1px solid var(--vd-line); border-radius:11px; background:var(--vd-surface-raised); text-align:center; }
.smart-copy-launcher-score strong { font-size:20px; color:var(--vd-brand); }
.smart-copy-launcher-score span { font-size:8px; color:var(--vd-ink-muted); }
.smart-copy-launcher > .vd-button { grid-column:2/-1; justify-self:start; }
.smart-copy-modal,.flux-prompt-lab { position:fixed; inset:0; z-index:4200; display:grid; place-items:center; padding:20px; }
.smart-copy-modal.hidden,.flux-prompt-lab.hidden { display:none; }
.smart-copy-modal-backdrop,.flux-prompt-lab-backdrop { position:absolute; inset:0; width:100%; height:100%; border:0; background:rgba(9,9,8,.76); backdrop-filter:blur(4px); }
.smart-copy-modal-dialog,.flux-prompt-lab-dialog {
  position:relative; width:min(1180px,100%); max-height:calc(100dvh - 40px); overflow:auto;
  border:1px solid var(--vd-line); border-radius:18px; background:var(--vd-surface-raised); box-shadow:var(--vd-shadow-float);
}
.smart-copy-modal-dialog > header,.flux-prompt-lab-dialog > header {
  position:sticky; top:0; z-index:5; display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  padding:16px 18px; border-bottom:1px solid var(--vd-line); background:color-mix(in srgb,var(--vd-surface-raised) 94%,transparent); backdrop-filter:blur(12px);
}
.smart-copy-modal-dialog > header h2,.flux-prompt-lab-dialog > header h2 { margin:2px 0 4px; }
.smart-copy-modal-dialog > header p:last-child,.flux-prompt-lab-dialog > header p:last-child { margin:0; color:var(--vd-ink-muted); font-size:9px; }
.smart-copy-modal-content { padding:14px 18px 18px; }
.smart-copy-modal-content .publish-workspace-header { border:1px solid var(--vd-line); border-radius:12px; padding:11px; margin-bottom:12px; }
.smart-copy-modal-content .publish-smart-grid { grid-template-columns:minmax(0,1.5fr) minmax(250px,.62fr); }
@media(max-width:850px) {
  .smart-copy-launcher { grid-template-columns:48px minmax(0,1fr); }
  .smart-copy-launcher-score { grid-column:1/-1; width:100%; }
  .smart-copy-launcher > .vd-button { grid-column:1/-1; width:100%; justify-content:center; }
  .smart-copy-modal-content .publish-smart-grid { grid-template-columns:1fr; }
}
@media(max-width:560px) {
  .smart-copy-modal,.flux-prompt-lab { padding:7px; }
  .smart-copy-modal-dialog,.flux-prompt-lab-dialog { max-height:calc(100dvh - 14px); border-radius:12px; }
  .smart-copy-modal-content { padding:9px; }
  .smart-copy-launcher { min-height:0; padding:18px; grid-template-columns:1fr; text-align:center; }
  .smart-copy-launcher-icon { margin:auto; }
}

/* FLUX Prompt Lab */
.flux-prompt-lab-dialog { width:min(920px,100%); }
.flux-prompt-lab-body { display:grid; gap:13px; padding:16px 18px; }
.flux-prompt-lab-provider { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--vd-line); border-radius:10px; background:var(--vd-surface-muted); }
.flux-prompt-lab-provider span { color:var(--vd-ink-muted); font-size:8px; }
.flux-prompt-lab-provider strong { color:var(--vd-brand); font-size:9px; overflow-wrap:anywhere; text-align:right; }
.flux-prompt-lab-field { display:grid; gap:6px; color:var(--vd-ink-secondary); font-size:8px; font-weight:720; }
.flux-prompt-lab-field textarea { width:100%; min-height:120px; resize:vertical; padding:11px; border:1px solid var(--vd-line); border-radius:10px; background:var(--vd-surface); color:var(--vd-ink); font:inherit; font-size:10px; line-height:1.55; }
.flux-prompt-lab-options { display:grid; grid-template-columns:minmax(220px,1fr) 1fr 1fr; gap:10px; }
.flux-prompt-lab-options > label { min-width:0; }
.flux-prompt-lab-options select { width:100%; min-height:40px; margin-top:5px; }
.flux-prompt-lab-check { display:flex; align-items:flex-start; gap:8px; padding:10px; border:1px solid var(--vd-line); border-radius:10px; background:var(--vd-surface-muted); color:var(--vd-ink-secondary); font-size:8px; line-height:1.45; }
.flux-prompt-lab-check input { width:17px; height:17px; flex:0 0 auto; accent-color:var(--vd-brand); }
.flux-prompt-lab-actions { display:flex; gap:9px; flex-wrap:wrap; }
.flux-prompt-lab-status { min-height:34px; display:flex; align-items:center; padding:8px 10px; border-radius:9px; background:var(--vd-brand-soft); color:var(--vd-brand); font-size:8px; }
.flux-prompt-lab-notes { min-height:18px; margin:0; color:var(--vd-ink-muted); font-size:8px; line-height:1.45; }
.flux-prompt-lab-dialog > footer { position:sticky; bottom:0; display:flex; justify-content:flex-end; gap:9px; padding:13px 18px; border-top:1px solid var(--vd-line); background:var(--vd-surface-raised); }
.flux-optimize-button { display:inline-flex; align-items:center; gap:6px; }
.flux-optimize-button > span { color:var(--vd-brand); font-size:14px; }
@media(max-width:760px) { .flux-prompt-lab-options { grid-template-columns:1fr; } }

/* FLUX library and job pagination: compact, bounded page sizes. */
.flux-library-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.flux-library-actions select { min-height:34px; }
.flux-history-pagination { display:flex; align-items:center; justify-content:center; gap:10px; margin-top:13px; }
.flux-history-pagination span { color:var(--vd-ink-muted); font-size:8px; }
.flux-studio-history-section { min-width:0; }
@media(max-width:620px) {
  .flux-studio-history-head { align-items:flex-start; flex-direction:column; gap:10px; }
  .flux-library-actions { width:100%; justify-content:flex-start; }
  .flux-library-actions > * { flex:1 1 auto; }
}

/* Broad width hardening for all primary workspaces. */
.publish-center-page,.media-library-page,.flux-studio-page,.settings-workspace,.generator-page,.listings-page,
.publish-center-grid,.publish-workspace-panel,.publish-workspace,.media-toolbar,.media-batchbar,.flux-job-center,
.flux-job-center-head,.flux-job-center-body,.flux-studio-layout { min-width:0; max-width:100%; box-sizing:border-box; }
img,video,canvas,iframe { max-width:100%; }
button,input,select,textarea { max-width:100%; }

/* =====================================================================
   Vendoo 1.25.1 — fully adaptive media gallery
   ===================================================================== */
.media-library-page {
  min-width:0;
  container-type:inline-size;
  container-name:media-library;
}

.media-grid {
  width:100%;
  min-width:0;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,clamp(214px,19vw,286px)),1fr));
  gap:clamp(12px,1.35vw,20px);
  align-items:start;
}

.media-card {
  container-type:inline-size;
  container-name:media-card;
  min-width:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:auto auto auto;
  border:1px solid var(--vd-line);
  border-radius:clamp(12px,5cqi,18px);
  background:var(--vd-surface-raised);
  box-shadow:0 2px 10px rgba(25,22,18,.055);
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.media-card:hover {
  transform:translateY(-2px);
  border-color:var(--vd-line-strong);
  box-shadow:0 10px 28px rgba(25,22,18,.11);
}
.media-card.is-selected {
  border-color:var(--vd-brand);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--vd-brand) 17%,transparent),0 10px 28px rgba(25,22,18,.1);
}

.media-card-image {
  position:relative;
  min-width:0;
  min-height:0;
  aspect-ratio:4/3;
  overflow:hidden;
  background:var(--vd-surface-muted);
}
.media-card-image::after {
  content:none;
}
.media-card-open {
  position:absolute;
  inset:0;
  z-index:1;
  width:100%;
  height:100%;
  display:block;
  margin:0;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:0;
  background:transparent;
  cursor:zoom-in;
}
.media-card-open img {
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  transition:transform .22s ease,filter .22s ease;
}
.media-card-open::before {
  content:"⌕";
  position:absolute;
  inset:50% auto auto 50%;
  z-index:2;
  width:clamp(34px,15cqi,48px);
  height:clamp(34px,15cqi,48px);
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.68);
  border-radius:999px;
  background:rgba(20,20,18,.7);
  color:#fff;
  font-size:clamp(17px,7cqi,23px);
  opacity:0;
  transform:translate(-50%,-44%) scale(.92);
  box-shadow:0 8px 24px rgba(0,0,0,.2);
  backdrop-filter:blur(8px);
  pointer-events:none;
  transition:opacity .16s ease,transform .16s ease;
}
.media-card-open:hover img,
.media-card-open:focus-visible img { transform:scale(1.018); filter:brightness(.94); }
.media-card-open:hover::before,
.media-card-open:focus-visible::before { opacity:1; transform:translate(-50%,-50%) scale(1); }
.media-card-open:focus-visible { outline:3px solid var(--vd-brand); outline-offset:-3px; }
.media-card.is-selected .media-card-image { box-shadow:inset 0 0 0 3px var(--vd-brand); }

.media-card-select,
.media-card-favorite-toggle {
  position:absolute;
  top:clamp(8px,4cqi,12px);
  z-index:5;
  width:clamp(30px,12cqi,38px);
  height:clamp(30px,12cqi,38px);
  display:grid;
  place-items:center;
  margin:0;
  padding:0;
  border:1px solid rgba(255,255,255,.66);
  border-radius:clamp(9px,4cqi,12px);
  background:rgba(22,22,20,.7);
  box-shadow:0 6px 18px rgba(0,0,0,.18);
  backdrop-filter:blur(9px);
}
.media-card-select { left:clamp(8px,4cqi,12px); cursor:pointer; }
.media-card-favorite-toggle {
  right:clamp(8px,4cqi,12px);
  color:#fff;
  font-size:clamp(16px,7cqi,21px);
  line-height:1;
  cursor:pointer;
  transition:transform .15s ease,background .15s ease,color .15s ease;
}
.media-card-favorite-toggle:hover { transform:scale(1.06); background:rgba(22,22,20,.86); }
.media-card-favorite-toggle:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.media-card-favorite-toggle.is-active { color:#ffd15c; background:rgba(22,22,20,.86); }
.media-card-select input {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  opacity:0;
  cursor:pointer;
}
.media-card-select span {
  width:clamp(16px,6.5cqi,21px);
  height:clamp(16px,6.5cqi,21px);
  display:grid;
  place-items:center;
  border:2px solid rgba(255,255,255,.96);
  border-radius:clamp(4px,2cqi,6px);
  background:rgba(255,255,255,.08);
  pointer-events:none;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.media-card-select input:focus-visible + span { outline:2px solid #fff; outline-offset:3px; }
.media-card-select input:checked + span { border-color:#fff; background:var(--vd-brand); transform:scale(1.04); }
.media-card-select input:checked + span::after {
  content:"";
  width:45%;
  height:24%;
  margin-top:-9%;
  border-left:2px solid #fff;
  border-bottom:2px solid #fff;
  transform:rotate(-45deg);
}

.media-card-content {
  min-width:0;
  min-height:0;
  display:grid;
  align-content:start;
  gap:clamp(5px,2.4cqi,8px);
  padding:clamp(11px,5cqi,16px) clamp(12px,5.5cqi,17px) clamp(9px,4cqi,13px);
}
.media-card-content > strong {
  min-width:0;
  min-height:2.7em;
  display:-webkit-box;
  overflow:hidden;
  color:var(--vd-ink);
  font-size:clamp(12px,5.2cqi,15px);
  font-weight:760;
  line-height:1.35;
  white-space:normal;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.media-card-content > span,
.media-card-content > small {
  min-width:0;
  overflow:hidden;
  color:var(--vd-ink-muted);
  font-size:clamp(10px,4cqi,12px);
  line-height:1.4;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.media-card-sources { gap:clamp(4px,2cqi,7px); }
.media-source-chip {
  min-height:clamp(20px,8cqi,25px);
  padding:2px clamp(7px,3cqi,10px);
  font-size:clamp(9px,3.7cqi,11px);
}

.media-card-actions {
  min-width:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:clamp(5px,2.2cqi,8px);
  padding:0 clamp(10px,5cqi,16px) clamp(11px,5cqi,16px);
}
.media-action {
  min-width:0;
  min-height:clamp(40px,16cqi,48px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  margin:0;
  padding:5px 4px;
  overflow:hidden;
  border:1px solid var(--vd-line);
  border-radius:clamp(8px,3.7cqi,11px);
  background:var(--vd-surface);
  color:var(--vd-ink-secondary);
  font:inherit;
  text-align:center;
  text-decoration:none;
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,color .15s ease,transform .15s ease;
}
.media-action:hover {
  border-color:var(--vd-line-strong);
  background:var(--vd-surface-muted);
  color:var(--vd-ink);
  transform:translateY(-1px);
}
.media-action:focus-visible { outline:2px solid var(--vd-brand); outline-offset:2px; }
.media-action.danger:hover { border-color:color-mix(in srgb,var(--vd-danger) 50%,var(--vd-line)); color:var(--vd-danger); }
.media-action-icon { font-size:clamp(16px,6cqi,20px); line-height:1; }
.media-action-label {
  max-width:100%;
  overflow:hidden;
  font-size:clamp(8px,3.5cqi,10px);
  font-weight:700;
  line-height:1.1;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.media-pagination {
  width:100%;
  min-width:0;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0;
  padding:8px 2px;
  color:var(--vd-ink-muted);
  font-size:11px;
}
.media-pagination-top { margin:4px 0 12px; border-bottom:1px solid var(--vd-line); }
.media-pagination-bottom { margin:12px 0 0; border-top:1px solid var(--vd-line); }
.media-pagination-summary { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.media-pagination-controls { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.media-page-jump { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.media-page-jump select {
  min-width:64px;
  height:34px;
  padding:0 26px 0 10px;
  border:1px solid var(--vd-line);
  border-radius:8px;
  background:var(--vd-surface-raised);
  color:var(--vd-ink);
}
.media-pagination .page-nav-btn { flex:0 0 34px; }

.media-grid.is-list { grid-template-columns:1fr; gap:10px; }
.media-grid.is-list .media-card {
  grid-template-columns:clamp(150px,22vw,230px) minmax(0,1fr) minmax(220px,auto);
  grid-template-rows:auto;
  align-items:center;
  border-radius:14px;
}
.media-grid.is-list .media-card-image { width:100%; height:100%; min-height:118px; aspect-ratio:4/3; }
.media-grid.is-list .media-card-content { padding:14px 16px; }
.media-grid.is-list .media-card-actions { width:min(330px,100%); padding:12px 14px 12px 0; }

@container media-card (max-width: 235px) {
  .media-card-content > small { display:none; }
  .media-card-actions { gap:5px; padding-inline:9px; }
  .media-action { min-height:40px; padding:4px; }
  .media-action-label { display:none; }
  .media-action-icon { font-size:18px; }
}

@container media-card (min-width: 340px) {
  .media-action { flex-direction:row; gap:6px; }
  .media-action-label { font-size:10px; }
}

@container media-library (max-width: 760px) {
  .media-toolbar { grid-template-columns:1fr 1fr; }
  .media-search { grid-column:1/-1; }
  .media-view-switch { justify-self:end; }
  .media-batchbar { align-items:flex-start; }
  .media-grid.is-list .media-card {
    grid-template-columns:clamp(120px,32vw,180px) minmax(0,1fr);
  }
  .media-grid.is-list .media-card-actions {
    grid-column:1/-1;
    width:100%;
    padding:0 12px 12px;
  }
}

@container media-library (max-width: 520px) {
  .media-toolbar { grid-template-columns:1fr; }
  .media-search { grid-column:auto; }
  .media-view-switch { justify-self:stretch; }
  .media-view-switch button { flex:1; }
  .media-batchbar { flex-direction:column; }
  .media-batchbar > div { width:100%; }
  .media-batchbar .vd-button { flex:1; }
  .media-pagination { align-items:flex-start; flex-direction:column; gap:7px; }
  .media-pagination-controls { width:100%; justify-content:space-between; }
  .media-grid.is-list .media-card { grid-template-columns:110px minmax(0,1fr); }
  .media-grid.is-list .media-card-content { padding:10px 11px; }
}

@media (hover:none) {
  .media-card-open::before { display:none; }
  .media-card:hover { transform:none; }
}

/* 1.25.1 icon refinement */
.media-card-open::before { content:none; }
.media-open-indicator {
  position:absolute;
  inset:50% auto auto 50%;
  z-index:2;
  width:clamp(36px,15cqi,48px);
  height:clamp(36px,15cqi,48px);
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.7);
  border-radius:999px;
  background:rgba(20,20,18,.72);
  color:#fff;
  opacity:0;
  transform:translate(-50%,-44%) scale(.92);
  box-shadow:0 8px 24px rgba(0,0,0,.2);
  backdrop-filter:blur(8px);
  pointer-events:none;
  transition:opacity .16s ease,transform .16s ease;
}
.media-open-indicator .media-action-icon { width:20px; height:20px; }
.media-card-open:hover .media-open-indicator,
.media-card-open:focus-visible .media-open-indicator { opacity:1; transform:translate(-50%,-50%) scale(1); }
.media-action-icon {
  width:clamp(17px,6cqi,20px);
  height:clamp(17px,6cqi,20px);
  flex:0 0 auto;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
@media (hover:none) { .media-open-indicator { display:none; } }

/* Vendoo 1.26.0 — Artikel, Extensions, adaptive gallery controls and zoom preview */
.vd-icon { display:block; flex:0 0 auto; }
.vd-icon-host { display:inline-grid; place-items:center; }
.vd-button .vd-icon { margin-right:6px; }
.icon-button .vd-icon { margin:auto; }

/* Compact media overlays and action dock */
.media-card-select,
.media-card-favorite-toggle {
  top:clamp(6px,3cqi,9px);
  width:clamp(25px,10cqi,30px);
  height:clamp(25px,10cqi,30px);
  min-width:0;
  padding:0;
  border-radius:9px;
  background:rgba(20,20,18,.72);
  border:1px solid rgba(255,255,255,.68);
  box-shadow:0 4px 14px rgba(0,0,0,.18);
  backdrop-filter:blur(7px);
}
.media-card-select { left:clamp(6px,3cqi,9px); }
.media-card-favorite-toggle { right:clamp(6px,3cqi,9px); font-size:0; }
.media-card-favorite-toggle .vd-icon { width:clamp(14px,5.5cqi,17px); height:clamp(14px,5.5cqi,17px); }
.media-card-select input + span {
  width:clamp(15px,6cqi,18px);
  height:clamp(15px,6cqi,18px);
  border-radius:5px;
  display:grid;
  place-items:center;
  color:transparent;
}
.media-card-select input:checked + span { color:#fff; }
.media-card-select input:checked + span::after { content:none; }
.media-card-actions { gap:5px; padding:8px; }
.media-action {
  min-width:0;
  min-height:34px;
  padding:7px;
  border-radius:9px;
  justify-content:center;
}
.media-action .media-action-label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.media-action-icon { width:17px; height:17px; }
.media-open-indicator { width:38px; height:38px; }
.media-open-indicator .media-action-icon { width:18px; height:18px; }
@container media-card (min-width: 390px) {
  .media-action { gap:6px; padding-inline:10px; }
  .media-action .media-action-label { position:static; width:auto; height:auto; overflow:visible; clip:auto; white-space:normal; }
}

/* Full zoomable preview */
.media-lightbox-dialog { width:min(1440px,calc(100vw - 32px)); height:min(940px,calc(100dvh - 32px)); max-height:none; display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; overflow:hidden; }
.media-lightbox-dialog > header { min-height:58px; }
.media-lightbox-close { border-radius:999px; }
.media-lightbox-toolbar { display:flex; align-items:center; gap:8px; padding:8px 14px; border-bottom:1px solid var(--vd-line); background:var(--vd-surface-muted); }
.media-lightbox-toolbar input[type="range"] { width:min(260px,32vw); }
.media-lightbox-toolbar output { min-width:58px; color:var(--vd-ink-muted); font-size:10px; text-align:right; }
.media-lightbox-body { min-height:0; height:100%; grid-template-columns:minmax(0,1fr) minmax(245px,320px); }
.media-lightbox-stage { position:relative; display:block; min-height:0; padding:14px; overflow:auto; cursor:grab; overscroll-behavior:contain; user-select:none; }
.media-lightbox-stage.is-dragging { cursor:grabbing; }
.media-lightbox-canvas { position:relative; min-width:1px; min-height:1px; margin:auto; box-shadow:0 12px 36px rgba(0,0,0,.25); }
.media-lightbox-stage img { display:block; max-width:none; max-height:none; object-fit:fill; pointer-events:none; }
#media-lightbox-meta { min-height:0; }
.media-lightbox-dialog > footer .vd-button { display:inline-flex; align-items:center; }
@media (max-width: 820px) {
  .media-lightbox-dialog { width:calc(100vw - 12px); height:calc(100dvh - 12px); }
  .media-lightbox-body { grid-template-columns:1fr; grid-template-rows:minmax(300px,1fr) auto; }
  #media-lightbox-meta { max-height:190px; border-left:0; border-top:1px solid var(--vd-line); }
  .media-lightbox-toolbar { flex-wrap:wrap; }
  .media-lightbox-toolbar input[type="range"] { flex:1; width:auto; min-width:120px; }
}

/* Publish center: full information in the middle and resilient responsive layout */
.smart-copy-center { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(250px,.55fr); gap:16px; padding:18px; }
.smart-copy-center-main,
.smart-copy-center-side { min-width:0; display:grid; align-content:start; gap:14px; }
.smart-copy-center-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.smart-copy-center-heading h3 { margin:4px 0 0; overflow-wrap:anywhere; }
.smart-copy-center-description { max-height:280px; overflow:auto; padding:14px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface-muted); color:var(--vd-ink-secondary); line-height:1.58; overflow-wrap:anywhere; }
.smart-copy-center-tags { display:flex; flex-wrap:wrap; gap:6px; }
.smart-copy-center-tags span { padding:5px 8px; border-radius:999px; background:var(--vd-surface-muted); color:var(--vd-ink-secondary); font-size:9px; }
.smart-copy-center-meta { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.smart-copy-center-meta > div { min-width:0; padding:10px; border:1px solid var(--vd-line); border-radius:10px; }
.smart-copy-center-meta span { display:block; color:var(--vd-ink-muted); font-size:8px; }
.smart-copy-center-meta strong { display:block; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.smart-copy-center-side > p { margin:0; color:var(--vd-ink-muted); line-height:1.5; }
@media (max-width: 1050px) {
  .smart-copy-center { grid-template-columns:1fr; }
  .smart-copy-center-side { grid-template-columns:minmax(120px,.35fr) minmax(0,1fr); }
  .smart-copy-center-side > p { grid-column:1/-1; }
}
@media (max-width: 680px) {
  .smart-copy-center { padding:12px; }
  .smart-copy-center-heading { align-items:stretch; flex-direction:column; }
  .smart-copy-center-heading .vd-button { width:100%; justify-content:center; }
  .smart-copy-center-meta { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .smart-copy-center-side { grid-template-columns:1fr; }
}

/* Extension center */
.extensions-page { width:100%; min-width:0; }
.extensions-heading { align-items:flex-start; }
.extensions-active-browser { display:grid; gap:4px; min-width:210px; padding:12px 14px; border:1px solid var(--vd-line); border-radius:12px; background:var(--vd-surface-raised); }
.extensions-active-browser span { color:var(--vd-ink-muted); font-size:8px; text-transform:uppercase; letter-spacing:.08em; }
.extensions-active-browser strong { display:flex; align-items:center; gap:8px; }
.extensions-notice { display:flex; gap:12px; align-items:flex-start; margin:0 0 16px; padding:14px 16px; border:1px solid color-mix(in srgb,var(--vd-brand) 24%,var(--vd-line)); border-radius:14px; background:color-mix(in srgb,var(--vd-brand) 6%,var(--vd-surface-raised)); }
.extensions-notice > span { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; background:var(--vd-brand); color:#fff; }
.extensions-notice p { margin:4px 0 0; color:var(--vd-ink-muted); }
.extensions-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,285px),1fr)); gap:14px; }
.extension-card { min-width:0; display:grid; align-content:start; gap:13px; padding:16px; border:1px solid var(--vd-line); border-radius:16px; background:var(--vd-surface-raised); box-shadow:var(--vd-shadow-card); }
.extension-card.is-active { border-color:color-mix(in srgb,var(--vd-brand) 55%,var(--vd-line)); box-shadow:0 0 0 2px color-mix(in srgb,var(--vd-brand) 12%,transparent),var(--vd-shadow-card); }
.extension-card header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; }
.extension-browser-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:13px; background:var(--vd-surface-muted); color:var(--vd-brand); }
.extension-card header span { color:var(--vd-brand); font-size:8px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.extension-card h3 { margin:2px 0 0; }
.extension-card header b { align-self:start; padding:4px 7px; border-radius:999px; background:var(--vd-surface-muted); font-size:8px; }
.extension-card > p,
.extension-card > small { margin:0; color:var(--vd-ink-muted); line-height:1.5; }
.extension-path { min-width:0; display:grid; gap:5px; padding:10px; border-radius:10px; background:var(--vd-surface-muted); }
.extension-path span { font-size:8px; color:var(--vd-ink-muted); }
.extension-path code { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:9px; }
.extension-card ol { margin:0; padding-left:20px; color:var(--vd-ink-secondary); line-height:1.7; }
.extension-card-actions { display:flex; gap:7px; align-items:center; }
.extension-card-actions .vd-button { flex:1; justify-content:center; }
.extension-card-actions .icon-button { flex:0 0 auto; }
.extensions-help-card { display:grid; gap:12px; margin-top:16px; padding:16px; border:1px solid var(--vd-line); border-radius:16px; background:var(--vd-surface-raised); }
.extensions-help-card > div { display:flex; gap:12px; }
.extensions-help-card > div > span { width:36px; height:36px; display:grid; place-items:center; border-radius:11px; background:var(--vd-surface-muted); }
.extensions-help-card p { margin:4px 0 0; color:var(--vd-ink-muted); }
.extensions-help-card ol { margin:0; padding-left:22px; line-height:1.7; }
@media (max-width: 620px) {
  .extensions-heading { display:grid; }
  .extensions-active-browser { width:100%; min-width:0; }
  .extension-card-actions { flex-wrap:wrap; }
}

/* Fee transparency */
.fee-platform { display:flex; align-items:center; gap:7px; }
.fee-platform span { padding:3px 6px; border-radius:999px; background:var(--vd-surface-muted); color:var(--vd-ink-muted); font-size:8px; }
.fee-note { margin-top:6px; max-width:700px; color:var(--vd-ink-muted); font-size:9px; line-height:1.45; }
.fee-card.is-free .fee-net-amount { color:var(--vd-success,#198754); }
.fee-card.is-free .fee-deducted { color:var(--vd-success,#198754); }

/* Vendoo 1.26.0 — article navigation, extension center, zoom preview and fee transparency */
.extensions-heading-actions { display:grid; gap:10px; justify-items:stretch; min-width:min(100%, 260px); }
.extensions-heading-actions .vd-button { justify-content:center; width:100%; }
.fee-heading { align-items:flex-start; margin-bottom:18px; }
.fee-heading > div { max-width:780px; }
.fee-verified-badge { display:inline-flex; align-items:center; min-height:34px; padding:0 12px; border:1px solid var(--vd-line); border-radius:999px; background:var(--vd-surface-raised); color:var(--vd-ink-muted); font-size:12px; font-weight:700; white-space:nowrap; }
@media (max-width: 720px) {
  .extensions-heading-actions { width:100%; min-width:0; }
  .fee-heading { display:grid; gap:12px; }
  .fee-verified-badge { width:max-content; }
}

/* Vendoo 1.26.1 — Stability, responsive and diagnostics gate */
.connection-banner {
  position: sticky;
  top: var(--topbar-height, 68px);
  z-index: 70;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px clamp(14px, 2vw, 28px);
  border-bottom: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--text);
  box-shadow: 0 8px 20px rgb(29 27 24 / 8%);
}
.connection-banner.hidden { display: none; }
.connection-banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 14%, transparent);
}
.connection-banner strong,
.connection-banner span { min-width: 0; overflow-wrap: anywhere; }
.connection-banner > span:not(.connection-banner-dot) { color: var(--text-muted); font-size: 12px; }
.connection-banner button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.system-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.system-panel-heading h3 { margin: 2px 0 5px; font-size: clamp(20px, 2vw, 27px); }
.system-panel-heading p:last-child { max-width: 760px; margin: 0; color: var(--text-muted); line-height: 1.55; }
.system-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.diagnostics-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 54px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised, var(--surface));
}
.diagnostics-summary span { color: var(--text-muted); font-size: 12px; }
.diagnostics-summary.is-ok { border-color: color-mix(in srgb, #218a55 34%, var(--border)); background: color-mix(in srgb, #218a55 6%, var(--surface)); }
.diagnostics-summary.is-warning,
.diagnostics-summary.is-running { border-color: color-mix(in srgb, #b87911 38%, var(--border)); background: color-mix(in srgb, #b87911 7%, var(--surface)); }
.diagnostics-summary.is-error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.diagnostic-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.diagnostic-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-soft, color-mix(in srgb, var(--text) 5%, transparent));
}
.diagnostic-card strong,
.diagnostic-card p { min-width: 0; overflow-wrap: anywhere; }
.diagnostic-card p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.diagnostic-card-status { padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.diagnostic-card.is-ok .diagnostic-card-status { color: #176b42; background: rgb(33 138 85 / 12%); }
.diagnostic-card.is-error .diagnostic-card-status { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.diagnostic-card.is-warning .diagnostic-card-status,
.diagnostic-card.is-optional .diagnostic-card-status { color: #8b5a08; background: rgb(184 121 17 / 13%); }
.diagnostics-loading { grid-column: 1 / -1; display: flex; justify-content: center; gap: 7px; padding: 30px; }
.diagnostics-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: vd-diagnostic-pulse 900ms infinite alternate; }
.diagnostics-loading span:nth-child(2) { animation-delay: 160ms; }
.diagnostics-loading span:nth-child(3) { animation-delay: 320ms; }
@keyframes vd-diagnostic-pulse { to { opacity: .28; transform: translateY(-4px); } }

/* Actual workspace-width contracts. These are intentionally independent from viewport width. */
.main-wrapper,
.main-wrapper main,
.tab-content,
.tab-content > *,
.page-heading,
.form-grid,
.card,
.panel { min-width: 0; max-width: 100%; }
.tab-content img,
.tab-content video,
.tab-content canvas,
.tab-content iframe { max-width: 100%; }
.tab-content input,
.tab-content select,
.tab-content textarea,
.tab-content button { max-width: 100%; }
.tab-content pre,
.tab-content code,
.tab-content td,
.tab-content th { overflow-wrap: anywhere; word-break: break-word; }
.main-wrapper[data-layout-width="phone"] .page-heading,
.main-wrapper[data-layout-width="narrow"] .page-heading,
.tab-content[data-layout-width="phone"] .page-heading,
.tab-content[data-layout-width="narrow"] .page-heading {
  align-items: stretch;
  flex-direction: column;
}
.main-wrapper[data-layout-width="phone"] .page-heading > *,
.main-wrapper[data-layout-width="narrow"] .page-heading > * { min-width: 0; max-width: 100%; }
.main-wrapper[data-layout-width="phone"] .page-heading button,
.main-wrapper[data-layout-width="phone"] .page-heading select { width: 100%; }
.main-wrapper[data-layout-width="phone"] .toolbar,
.main-wrapper[data-layout-width="narrow"] .toolbar,
.main-wrapper[data-layout-width="phone"] .filter-row,
.main-wrapper[data-layout-width="narrow"] .filter-row { flex-wrap: wrap; min-width: 0; }
.main-wrapper[data-layout-width="phone"] .toolbar > *,
.main-wrapper[data-layout-width="phone"] .filter-row > * { flex: 1 1 100%; min-width: 0; }
.main-wrapper[data-layout-width="phone"] .system-panel-heading,
.main-wrapper[data-layout-width="narrow"] .system-panel-heading { flex-direction: column; }
.main-wrapper[data-layout-width="phone"] .system-panel-actions,
.main-wrapper[data-layout-width="narrow"] .system-panel-actions { width: 100%; justify-content: stretch; }
.main-wrapper[data-layout-width="phone"] .system-panel-actions > *,
.main-wrapper[data-layout-width="narrow"] .system-panel-actions > * { flex: 1 1 180px; }

@media (max-width: 640px) {
  .connection-banner { grid-template-columns: auto minmax(0, 1fr); }
  .connection-banner > span:not(.connection-banner-dot) { grid-column: 2; }
  .connection-banner button { grid-column: 1 / -1; width: 100%; }
  .diagnostic-card { grid-template-columns: auto minmax(0, 1fr); }
  .diagnostic-card-status { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .diagnostics-loading span { animation: none; }
}

/* Vendoo 1.27.0 — Batch Image Factory */
.image-factory-page { container-type: inline-size; }
.image-factory-heading-actions,
.image-factory-job-tools,
.image-factory-source-tools,
.image-factory-heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.image-factory-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: 18px; align-items: start; }
.surface-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.image-factory-config,
.image-factory-status,
.image-factory-jobs { padding: clamp(16px, 2vw, 24px); min-width: 0; }
.section-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section-title-row h3 { margin: 2px 0 0; }
.image-factory-selection { padding: 7px 10px; border-radius: 999px; background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.image-factory-source-head,
.image-factory-profile-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin: 24px 0 10px; }
.image-factory-source-head > div:first-child,
.image-factory-profile-head > div:first-child { display: grid; gap: 3px; }
.image-factory-source-head span,
.image-factory-profile-head span { color: var(--text-muted); font-size: 12px; }
.image-factory-source-tools input,
.image-factory-source-tools select { min-width: 150px; }
.image-factory-source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; max-height: 390px; overflow: auto; padding: 2px; }
.image-factory-source-card { position: relative; display: grid; grid-template-rows: minmax(90px, 1fr) auto; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-page); cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.image-factory-source-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.image-factory-source-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.image-factory-source-card > input { position: absolute; opacity: 0; pointer-events: none; }
.image-factory-source-card > img { width: 100%; height: 100%; min-height: 100px; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-card); }
.image-factory-source-check { position: absolute; top: 7px; left: 7px; width: 23px; height: 23px; border-radius: 7px; display: grid; place-items: center; color: transparent; background: color-mix(in srgb, var(--bg-card) 92%, transparent); border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.image-factory-source-card.is-selected .image-factory-source-check { background: var(--accent); border-color: var(--accent); color: white; }
.image-factory-source-caption { display: grid; gap: 2px; padding: 8px 9px; min-width: 0; }
.image-factory-source-caption strong,
.image-factory-source-caption small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-factory-source-caption strong { font-size: 11px; }
.image-factory-source-caption small { font-size: 10px; color: var(--text-muted); }
.image-factory-profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.image-factory-profile-card { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-page); }
.image-factory-profile-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent); }
.image-factory-profile-select { position: absolute; inset: 0; cursor: pointer; z-index: 1; }
.image-factory-profile-select input { position: absolute; opacity: 0; }
.image-factory-profile-select span { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: transparent; border: 1px solid var(--border); background: var(--bg-card); }
.image-factory-profile-card.is-selected .image-factory-profile-select span { color: white; border-color: var(--accent); background: var(--accent); }
.image-factory-profile-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-light); color: var(--accent); font-weight: 800; }
.image-factory-profile-copy { min-width: 0; padding-right: 24px; }
.image-factory-profile-copy strong { font-size: 13px; }
.image-factory-profile-copy p { margin: 4px 0 7px; color: var(--text-secondary); font-size: 11px; line-height: 1.35; }
.image-factory-profile-copy small { color: var(--text-muted); font-size: 10px; }
.image-factory-profile-badge { align-self: end; padding: 3px 7px; border-radius: 999px; background: var(--bg-card); color: var(--text-muted); font-size: 9px; text-transform: uppercase; font-weight: 700; }
.image-factory-profile-actions { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 4px; }
.image-factory-profile-actions button { border: 0; background: transparent; color: var(--text-muted); font-size: 10px; cursor: pointer; padding: 4px; }
.image-factory-profile-actions button:hover { color: var(--accent); }
.image-factory-options { margin-top: 20px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.image-factory-options summary { cursor: pointer; padding: 13px 15px; font-weight: 700; background: var(--bg-page); }
.image-factory-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.image-factory-options .toggle-row { align-self: center; }
.image-factory-submit { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.image-factory-submit > div { display: grid; gap: 3px; min-width: 0; }
.image-factory-submit span { color: var(--text-muted); font-size: 11px; }
.image-factory-status { position: sticky; top: 18px; }
.image-factory-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 16px; }
.image-factory-stat-grid > div { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-page); }
.image-factory-stat-grid span { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.image-factory-stat-grid strong { font-size: 21px; }
.image-factory-help { margin-top: 16px; padding: 13px; border-radius: 11px; background: var(--accent-light); }
.image-factory-help p { margin: 5px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.image-factory-jobs { margin-top: 18px; }
.image-factory-job-list { display: grid; gap: 10px; }
.image-factory-job { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-page); }
.image-factory-job-head { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 13px 14px 10px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.image-factory-job-chevron { font-size: 22px; color: var(--text-muted); transition: transform .18s ease; }
.image-factory-job.is-expanded .image-factory-job-chevron { transform: rotate(90deg); }
.image-factory-job-title { display: grid; min-width: 0; }
.image-factory-job-title strong,
.image-factory-job-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-factory-job-title small { color: var(--text-muted); font-size: 10px; margin-top: 3px; }
.image-factory-job-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.image-factory-job-status { padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; background: var(--bg-card); }
.image-factory-job.is-running .image-factory-job-status { background: #e8f2ff; color: #175fae; }
.image-factory-job.is-completed .image-factory-job-status { background: #e7f6ed; color: #257046; }
.image-factory-job.is-failed .image-factory-job-status { background: #ffeded; color: #a93838; }
.image-factory-job.is-partial .image-factory-job-status,
.image-factory-job.is-paused .image-factory-job-status { background: #fff5dc; color: #8d6411; }
.image-factory-job-progress { height: 4px; margin: 0 14px; overflow: hidden; border-radius: 99px; background: var(--border); }
.image-factory-job-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.image-factory-job-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding: 10px 14px 13px; }
.image-factory-job-detail { border-top: 1px solid var(--border); padding: 12px 14px 14px; }
.image-factory-job-loading { color: var(--text-muted); font-size: 12px; }
.image-factory-job-items { display: grid; gap: 7px; }
.image-factory-job-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card); }
.image-factory-job-item img { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; background: var(--bg-page); }
.image-factory-job-item > div { display: grid; min-width: 0; }
.image-factory-job-item strong,
.image-factory-job-item span,
.image-factory-job-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-factory-job-item span,
.image-factory-job-item small { color: var(--text-muted); font-size: 10px; }
.image-factory-job-item small { color: var(--danger); }
.image-factory-item-status { padding: 4px 7px; border-radius: 999px; background: var(--bg-page); font-size: 10px; font-weight: 700; }
.image-factory-pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 16px; }
.image-factory-profile-modal { max-width: 620px; }
.image-factory-profile-form { display: grid; gap: 13px; }

@container (max-width: 900px) {
  .image-factory-layout { grid-template-columns: 1fr; }
  .image-factory-status { position: static; }
  .image-factory-stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@container (max-width: 680px) {
  .image-factory-source-head,
  .image-factory-profile-head,
  .image-factory-submit,
  .section-title-row { align-items: stretch; flex-direction: column; }
  .image-factory-source-tools > * { flex: 1 1 160px; min-width: 0; }
  .image-factory-options-grid { grid-template-columns: 1fr; }
  .image-factory-submit .primary-btn { width: 100%; }
  .image-factory-job-head { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .image-factory-job-status { grid-column: 2 / -1; justify-self: start; }
  .image-factory-job-item { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .image-factory-job-item img { width: 42px; height: 42px; }
  .image-factory-job-item .vd-button { grid-column: 2 / -1; width: 100%; }
}
@container (max-width: 430px) {
  .image-factory-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-factory-profile-grid { grid-template-columns: 1fr; }
  .image-factory-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .image-factory-job-actions > * { flex: 1 1 100%; text-align: center; }
}
.media-source-chip.is-batch { background:color-mix(in srgb,var(--accent) 14%,var(--bg-card)); color:var(--accent); }

/* Vendoo 1.28.0 · Article Quality Center */
.quality-center-page { container-type: inline-size; }
.quality-center-heading { align-items:flex-start; gap:24px; }
.quality-center-heading .page-heading-actions { display:flex; flex-wrap:wrap; gap:10px; }
.quality-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.quality-summary-grid article { min-width:0; padding:18px 20px; border:1px solid var(--border); border-radius:18px; background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--surface) 90%,var(--accent) 10%)); box-shadow:var(--shadow-sm); }
.quality-summary-grid span,.quality-summary-grid small { display:block; color:var(--text-muted); font-size:12px; }
.quality-summary-grid strong { display:block; margin:5px 0 2px; font-size:30px; line-height:1; letter-spacing:-.04em; color:var(--text); }
.quality-toolbar { display:grid; grid-template-columns:minmax(240px,1.6fr) repeat(3,minmax(130px,.55fr)); gap:12px; padding:14px; margin-bottom:16px; }
.quality-toolbar label { display:grid; gap:6px; min-width:0; }
.quality-toolbar label>span { font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.08em; }
.quality-toolbar input,.quality-toolbar select { width:100%; min-width:0; }
.quality-workspace { display:grid; grid-template-columns:minmax(350px,.88fr) minmax(440px,1.32fr); gap:16px; align-items:start; }
.quality-list-panel,.quality-detail-panel { min-width:0; padding:16px; }
.quality-list { display:grid; gap:8px; }
.quality-list-item { width:100%; display:grid; grid-template-columns:52px minmax(0,1fr) 54px auto; gap:12px; align-items:center; padding:10px; border:1px solid transparent; border-radius:15px; background:var(--surface-2); color:var(--text); text-align:left; cursor:pointer; transition:.18s ease; }
.quality-list-item:hover { transform:translateY(-1px); border-color:color-mix(in srgb,var(--accent) 45%,var(--border)); background:color-mix(in srgb,var(--surface-2) 88%,var(--accent) 12%); }
.quality-list-item.is-active { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 16%,transparent); }
.quality-list-thumb { width:52px; aspect-ratio:1; display:grid; place-items:center; overflow:hidden; border-radius:12px; background:var(--surface); color:var(--text-muted); }
.quality-list-thumb img { width:100%; height:100%; object-fit:cover; }
.quality-list-copy { min-width:0; display:grid; gap:3px; }
.quality-list-copy strong,.quality-list-copy small,.quality-list-copy span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quality-list-copy strong { font-size:14px; }
.quality-list-copy small { color:var(--text-muted); font-size:11px; }
.quality-list-copy span { color:var(--text-soft); font-size:12px; }
.quality-list-score { width:48px; height:48px; border-radius:50%; display:grid; place-content:center; text-align:center; background:var(--surface); border:2px solid var(--border); }
.quality-list-score b { font-size:15px; line-height:1; }
.quality-list-score em { font-style:normal; font-size:9px; color:var(--text-muted); }
.quality-list-score.is-a,.quality-list-score.is-b { border-color:#39a56f; color:#237c51; }
.quality-list-score.is-c { border-color:#c49a32; color:#8d6811; }
.quality-list-score.is-d,.quality-list-score.is-e { border-color:#d45c55; color:#a33a34; }
.quality-list-state { padding:5px 8px; border-radius:999px; font-size:10px; font-weight:800; white-space:nowrap; }
.quality-list-item.is-ready .quality-list-state { background:rgba(57,165,111,.13); color:#278158; }
.quality-list-item.is-review .quality-list-state { background:rgba(196,154,50,.14); color:#8d6811; }
.quality-list-item.is-blocked .quality-list-state { background:rgba(212,92,85,.13); color:#a33a34; }
.quality-pagination { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:14px; }
.quality-detail-panel { position:sticky; top:16px; max-height:calc(100vh - 118px); overflow:auto; scrollbar-width:thin; }
.quality-detail-empty { min-height:420px; display:grid; place-content:center; text-align:center; gap:8px; color:var(--text-muted); padding:30px; }
.quality-empty-icon { width:64px; height:64px; margin:auto; border-radius:20px; display:grid; place-items:center; font-size:28px; background:color-mix(in srgb,var(--accent) 12%,var(--surface-2)); color:var(--accent); }
.quality-detail-content { display:grid; gap:16px; }
.quality-detail-content.is-loading { opacity:.58; pointer-events:none; }
.quality-detail-head { display:grid; grid-template-columns:92px minmax(0,1fr); gap:16px; align-items:center; }
.quality-score-ring { --quality-score:0deg; width:88px; aspect-ratio:1; border-radius:50%; display:grid; place-content:center; text-align:center; background:radial-gradient(circle at center,var(--surface) 61%,transparent 63%),conic-gradient(var(--accent) var(--quality-score),var(--surface-3) 0); }
.quality-score-ring[data-grade="A"],.quality-score-ring[data-grade="B"] { background:radial-gradient(circle at center,var(--surface) 61%,transparent 63%),conic-gradient(#39a56f var(--quality-score),var(--surface-3) 0); }
.quality-score-ring[data-grade="D"],.quality-score-ring[data-grade="E"] { background:radial-gradient(circle at center,var(--surface) 61%,transparent 63%),conic-gradient(#d45c55 var(--quality-score),var(--surface-3) 0); }
.quality-score-ring strong { font-size:25px; line-height:1; }
.quality-score-ring span { font-size:10px; color:var(--text-muted); }
.quality-detail-head h3 { margin:3px 0 5px; font-size:20px; overflow-wrap:anywhere; }
.quality-detail-head p { margin:0; color:var(--text-muted); }
.quality-readiness { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:12px 14px; border-radius:14px; background:var(--surface-2); }
.quality-readiness span { color:var(--text-muted); font-size:12px; }
.quality-detail-actions { display:flex; flex-wrap:wrap; gap:8px; }
.quality-financials { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.quality-financials div { padding:12px; border:1px solid var(--border); border-radius:13px; background:var(--surface-2); min-width:0; }
.quality-financials span { display:block; font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; }
.quality-financials strong { display:block; margin-top:4px; overflow-wrap:anywhere; }
.quality-issue-tabs { display:flex; gap:6px; overflow:auto; padding-bottom:2px; }
.quality-issue-tabs button { flex:0 0 auto; border:1px solid var(--border); border-radius:999px; padding:7px 11px; background:var(--surface); color:var(--text-muted); font-size:11px; font-weight:700; }
.quality-issue-tabs button.active { background:var(--text); color:var(--surface); border-color:var(--text); }
.quality-issues { display:grid; gap:8px; }
.quality-issue { display:grid; grid-template-columns:34px minmax(0,1fr) auto; gap:10px; align-items:start; padding:12px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.quality-issue.is-error { border-left:3px solid #d45c55; }
.quality-issue.is-warning { border-left:3px solid #c49a32; }
.quality-issue.is-recommendation { border-left:3px solid #5181ba; }
.quality-issue-icon { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:var(--surface); }
.quality-issue strong { display:block; font-size:13px; }
.quality-issue p { margin:3px 0 4px; color:var(--text-soft); font-size:12px; line-height:1.45; }
.quality-issue small { color:var(--text-muted); font-size:10px; }
.quality-issue-points { font-size:11px; font-weight:800; color:var(--text-muted); }
.quality-all-clear { padding:20px; border-radius:14px; text-align:center; background:rgba(57,165,111,.09); color:#278158; }
.quality-all-clear span { display:block; margin-top:4px; font-size:12px; }
.quality-duplicates,.quality-images,.quality-history { border-top:1px solid var(--border); padding-top:14px; }
.quality-duplicates>div:last-child,.quality-images>div:last-child,.quality-history>div:last-child { display:grid; gap:7px; }
.quality-duplicates button { display:flex; justify-content:space-between; gap:12px; width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); color:var(--text); text-align:left; }
.quality-duplicates button span { color:var(--text-muted); font-size:11px; }
.quality-image-check { display:grid; grid-template-columns:28px minmax(0,1fr); gap:8px; align-items:center; padding:9px 10px; border-radius:11px; background:var(--surface-2); }
.quality-image-check>span { width:26px; height:26px; border-radius:8px; display:grid; place-items:center; background:var(--surface); color:var(--accent); }
.quality-image-check strong,.quality-image-check small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quality-image-check small { color:var(--text-muted); font-size:10px; margin-top:2px; }
.quality-history-item { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:10px; align-items:center; padding:8px 10px; border-radius:10px; background:var(--surface-2); font-size:11px; }
.quality-history-item span { color:var(--text-muted); }
.quality-history-item strong { font-size:14px; }
.quality-history-item em { font-style:normal; color:var(--text-muted); }
#quality-score-delta[data-tone="up"] { color:#278158; }
#quality-score-delta[data-tone="down"] { color:#a33a34; }
.quality-empty-note { margin:0; padding:10px; color:var(--text-muted); font-size:12px; }
.quality-loading { min-height:220px; display:flex; align-items:center; justify-content:center; gap:6px; flex-wrap:wrap; color:var(--text-muted); }
.quality-loading span { width:7px; height:7px; border-radius:50%; background:var(--accent); animation:qualityPulse 1s infinite alternate; }
.quality-loading span:nth-child(2){animation-delay:.15s}.quality-loading span:nth-child(3){animation-delay:.3s}.quality-loading p{flex-basis:100%;text-align:center;margin:4px 0 0}
@keyframes qualityPulse { to { opacity:.25; transform:translateY(-4px); } }
.quality-ai-modal { width:min(1120px,calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto; }
.quality-ai-options { display:flex; flex-wrap:wrap; gap:10px; align-items:end; padding:14px; border-radius:14px; background:var(--surface-2); }
.quality-ai-options label:not(.quality-ai-mode) { display:flex; align-items:center; gap:7px; padding:8px 10px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
.quality-ai-mode { margin-left:auto; display:grid; gap:5px; min-width:160px; }
.quality-ai-status { padding:11px 13px; border-radius:12px; background:color-mix(in srgb,var(--accent) 9%,var(--surface-2)); color:var(--text-soft); font-size:12px; }
.quality-ai-compare { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.quality-ai-compare section { min-width:0; display:grid; gap:10px; padding:14px; border:1px solid var(--border); border-radius:16px; background:var(--surface-2); }
.quality-ai-compare h3 { margin:0; }
.quality-ai-compare label { display:grid; gap:5px; font-size:11px; font-weight:700; color:var(--text-muted); }
.quality-ai-compare textarea { width:100%; min-height:62px; resize:vertical; }
.quality-ai-compare label:nth-of-type(2) textarea { min-height:190px; }
.quality-ai-reasons { display:flex; flex-wrap:wrap; gap:7px; }
.quality-ai-reasons span { padding:6px 9px; border-radius:999px; background:var(--surface-2); color:var(--text-muted); font-size:10px; }
.quality-ai-modal footer { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }

@container (max-width: 920px) {
  .quality-workspace { grid-template-columns:1fr; }
  .quality-detail-panel { position:static; max-height:none; }
}
@container (max-width: 680px) {
  .quality-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quality-toolbar { grid-template-columns:1fr 1fr; }
  .quality-search { grid-column:1/-1; }
  .quality-list-item { grid-template-columns:46px minmax(0,1fr) 48px; }
  .quality-list-state { grid-column:2/-1; justify-self:start; }
  .quality-financials { grid-template-columns:1fr; }
}
@container (max-width: 460px) {
  .quality-summary-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .quality-summary-grid article { padding:13px; }
  .quality-summary-grid strong { font-size:24px; }
  .quality-toolbar { grid-template-columns:1fr; }
  .quality-search { grid-column:auto; }
  .quality-detail-head { grid-template-columns:72px minmax(0,1fr); }
  .quality-score-ring { width:68px; }
  .quality-detail-actions>* { flex:1 1 100%; }
  .quality-list-copy span { display:none; }
}
@media (max-width: 760px) {
  .quality-ai-compare { grid-template-columns:1fr; }
  .quality-ai-mode { margin-left:0; width:100%; }
}

/* Vendoo 1.29.0 — Publishing Hardening */
.publishing-hardened-header { align-items: flex-start; gap: 18px; }
.publishing-toolbar { display:grid; grid-template-columns:minmax(220px,1fr) repeat(3,minmax(130px,auto)); gap:10px; padding:14px 18px; border-bottom:1px solid var(--border); background:color-mix(in srgb,var(--surface) 94%,transparent); }
.publishing-toolbar select,.publishing-toolbar input { min-width:0; width:100%; }
.publishing-selection-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 18px; border-bottom:1px solid var(--border); background:var(--surface-soft); }
.publishing-selection-bar > span { margin-right:auto; color:var(--text-muted); font-size:.84rem; }
.publishing-job-list { display:grid; gap:10px; padding:14px; }
.publish-operation-row.publishing-job-row { display:grid; grid-template-columns:28px minmax(210px,1.3fr) minmax(120px,.65fr) minmax(150px,.75fr) minmax(100px,.5fr) minmax(160px,1fr) auto; gap:12px; align-items:center; padding:13px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.publishing-job-row.status-failed,.publishing-job-row.status-blocked { border-color:color-mix(in srgb,var(--danger) 45%,var(--border)); }
.publishing-job-row.status-running { border-color:color-mix(in srgb,var(--accent) 50%,var(--border)); }
.publishing-job-check { display:grid; place-items:center; }
.publishing-job-check input { width:16px; height:16px; }
.publishing-job-actions { display:flex; align-items:center; justify-content:flex-end; gap:5px; flex-wrap:wrap; }
.publish-operation-meta small { display:block; color:var(--text-muted); margin-top:3px; font-size:.72rem; }
.publishing-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 18px; border-top:1px solid var(--border); }
.publishing-pagination > div { display:flex; gap:8px; }
.publishing-error-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:16px 18px; }
.publishing-error-summary article { border:1px solid var(--border); border-radius:14px; padding:16px; background:var(--surface); display:grid; gap:4px; }
.publishing-error-summary strong { font-size:1.65rem; }
.publishing-error-summary span { color:var(--text-muted); font-size:.8rem; }
.publishing-event-list { display:grid; gap:8px; padding:0 18px 18px; }
.publishing-event-row { display:grid; grid-template-columns:10px minmax(0,1fr) auto auto; gap:12px; align-items:center; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.publishing-event-row.level-error { border-color:color-mix(in srgb,var(--danger) 40%,var(--border)); }
.publishing-event-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); }
.publishing-event-row.level-error .publishing-event-dot { background:var(--danger); }
.publishing-event-row > div { min-width:0; }
.publishing-event-row strong,.publishing-event-row small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.publishing-event-row small { color:var(--text-muted); margin-top:3px; }
.publishing-event-type { font-size:.72rem; padding:4px 8px; border-radius:999px; background:var(--surface-soft); color:var(--text-muted); }
.operation-status.status-awaiting_user { color:#7b4cc7; background:color-mix(in srgb,#8b5cf6 14%,transparent); }
.operation-status.status-retry_wait { color:#a15c00; background:color-mix(in srgb,#f59e0b 14%,transparent); }
.operation-status.status-ended,.operation-status.status-cancelled { color:var(--text-muted); background:var(--surface-soft); }

@media (max-width: 1240px) {
  .publish-operation-row.publishing-job-row { grid-template-columns:28px minmax(200px,1fr) minmax(130px,.7fr) minmax(150px,.8fr) auto; }
  .publishing-job-row .publish-operation-meta:nth-of-type(3), .publishing-job-row .publish-operation-error { grid-column:2 / -2; }
  .publishing-job-actions { grid-column:-2 / -1; grid-row:1 / span 2; }
}
@media (max-width: 820px) {
  .publishing-toolbar { grid-template-columns:1fr 1fr; }
  .publishing-toolbar .publish-search-field { grid-column:1 / -1; }
  .publish-operation-row.publishing-job-row { grid-template-columns:24px minmax(0,1fr) auto; align-items:start; }
  .publishing-job-row .publish-operation-product { grid-column:2 / 3; }
  .publishing-job-row .publish-operation-meta,.publishing-job-row .publish-operation-error { grid-column:2 / -1 !important; }
  .publishing-job-actions { grid-column:2 / -1; grid-row:auto; justify-content:flex-start; }
  .publishing-error-summary { grid-template-columns:1fr; }
  .publishing-event-row { grid-template-columns:10px minmax(0,1fr) auto; }
  .publishing-event-type { display:none; }
}
@media (max-width: 520px) {
  .publishing-toolbar { grid-template-columns:1fr; }
  .publishing-toolbar .publish-search-field { grid-column:auto; }
  .publishing-pagination { align-items:stretch; flex-direction:column; }
  .publishing-pagination > div,.publishing-pagination button { width:100%; }
  .publishing-hardened-header > div:last-child { width:100%; display:grid; grid-template-columns:1fr; }
}

/* Vendoo 1.30.0 — Operations Center */
.operations-center { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); min-width: 0; }
.operations-center-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.operations-center-head h3 { margin: 3px 0 5px; font-size: 20px; }
.operations-center-head p { margin: 0; color: var(--text-muted); max-width: 760px; }
.operations-tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-page); overflow-x: auto; margin-bottom: 16px; }
.operations-tab { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
.operations-tab:hover { color: var(--text); background: var(--bg-card); }
.operations-tab.active { color: white; background: var(--accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 25%, transparent); }
.operations-panel { display: none; min-width: 0; }
.operations-panel.active { display: block; }
.operations-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.operations-update-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.operations-update-upload { grid-column: 1 / -1; }
.operations-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); box-shadow: 0 8px 24px rgba(20, 24, 35, .04); }
.operations-card > header { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 15px; }
.operations-card > header > span { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.operations-card h4, .operations-list-head h4 { margin: 0 0 3px; font-size: 14px; }
.operations-card p, .operations-list-head p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.operation-field { display: grid; gap: 6px; margin-bottom: 11px; min-width: 0; }
.operation-field > span { font-size: 11px; font-weight: 750; color: var(--text-muted); }
.operation-field input, .operation-field select { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-page); color: var(--text); }
.operation-check { display: flex; gap: 9px; align-items: flex-start; padding: 9px 0; cursor: pointer; }
.operation-check input { margin-top: 3px; accent-color: var(--accent); }
.operation-check span { min-width: 0; }
.operation-check strong, .operation-check small { display: block; }
.operation-check strong { font-size: 12px; }
.operation-check small { margin-top: 2px; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.operation-check.warning strong { color: var(--warning, #b7791f); }
.operation-inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.operation-dropzone { display: grid; place-items: center; min-height: 112px; padding: 15px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--bg-page)); text-align: center; cursor: pointer; }
.operation-dropzone:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-page)); }
.operation-dropzone > span { color: var(--accent); margin-bottom: 6px; }
.operation-dropzone strong, .operation-dropzone small { display: block; }
.operation-dropzone strong { font-size: 12px; }
.operation-dropzone small { margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.operation-file-state { min-height: 30px; margin: 8px 0; padding: 7px 9px; border-radius: 8px; background: var(--bg-page); color: var(--text-muted); font: 600 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.operations-list-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 20px 0 10px; }
.operations-backup-list { display: grid; gap: 7px; }
.operations-backup-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(120px, auto) auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-card); min-width: 0; }
.operations-backup-row.is-missing { opacity: .55; }
.operation-backup-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.operation-backup-main { min-width: 0; }
.operation-backup-main strong, .operation-backup-main span, .operation-backup-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-backup-main strong { font-size: 12px; }
.operation-backup-main span { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.operation-backup-main small { margin-top: 2px; color: var(--text-muted); font-size: 9px; }
.operation-backup-hash { color: var(--text-muted); font-size: 9px; }
.operation-backup-actions { display: flex; gap: 5px; }
.operation-backup-actions .icon-button { width: 32px; height: 32px; }
.operations-pending { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--warning, #d97706) 45%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--warning, #d97706) 8%, var(--bg-card)); }
.operations-pending > span { color: var(--warning, #d97706); }
.operations-pending > div { flex: 1; min-width: 0; }
.operations-pending strong, .operations-pending p { display: block; margin: 0; }
.operations-pending p { margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.operation-version-card { display: grid; gap: 4px; padding: 14px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 8%, var(--bg-page)); }
.operation-version-card strong { font-size: 18px; }
.operation-version-card span { color: var(--text-muted); font-size: 10px; }
.operation-migration-list { display: grid; gap: 6px; margin-top: 12px; max-height: 220px; overflow: auto; }
.operation-migration-list > div { display: flex; gap: 8px; align-items: flex-start; padding: 7px; border-radius: 8px; background: var(--bg-page); }
.operation-migration-list > div > span { color: var(--success, #20875d); }
.operation-migration-list p { min-width: 0; }
.operation-migration-list strong, .operation-migration-list small { display: block; }
.operation-migration-list small { color: var(--text-muted); font-size: 9px; }
.operation-card-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.operation-result { display: grid; gap: 3px; min-height: 52px; margin-top: 10px; padding: 10px; border-radius: 9px; background: var(--bg-page); color: var(--text-muted); font-size: 10px; }
.operation-result strong { color: var(--text); font-size: 12px; }
.operations-instruction { display: flex; gap: 11px; padding: 13px; margin-top: 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--bg-card)); }
.operations-instruction > span { color: var(--accent); }
.operations-instruction strong, .operations-instruction p { display: block; margin: 0; }
.operations-instruction p { margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.operations-extension-summary > article { display: flex; gap: 12px; align-items: center; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--bg-card); }
.operations-extension-summary > article > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.operations-extension-summary strong, .operations-extension-summary p { display: block; margin: 0; }
.operations-extension-summary p { color: var(--text-muted); font-size: 11px; }
.operations-extension-packages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.operations-extension-packages article { display: flex; gap: 8px; align-items: center; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
.operations-extension-packages article > span { color: var(--text-muted); }
.operations-extension-packages article.is-ok > span { color: var(--success, #20875d); }
.operations-extension-packages article.is-warning > span { color: var(--warning, #d97706); }
.operations-extension-packages strong, .operations-extension-packages small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-extension-packages strong { font-size: 11px; }
.operations-extension-packages small { color: var(--text-muted); font-size: 9px; }
.operations-extension-clients { display: grid; gap: 7px; }
.operations-extension-client { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
.operation-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.operations-extension-client.is-live .operation-live-dot { background: var(--success, #20875d); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success, #20875d) 15%, transparent); }
.operations-extension-client strong, .operations-extension-client span, .operations-extension-client small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-extension-client strong { font-size: 11px; }
.operations-extension-client span, .operations-extension-client small { color: var(--text-muted); font-size: 9px; }
.operations-extension-client b { font-size: 9px; color: var(--text-muted); }
.operations-extension-client.is-live b { color: var(--success, #20875d); }

@media (max-width: 1180px) {
  .operations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-restore-card { grid-column: 1 / -1; }
  .operations-extension-packages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .operations-center-head { display: grid; }
  .operations-center-head .secondary-btn { width: 100%; }
  .operations-grid, .operations-update-grid { grid-template-columns: minmax(0, 1fr); }
  .operations-restore-card, .operations-update-upload { grid-column: auto; }
  .operations-backup-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .operation-backup-hash { display: none; }
  .operations-pending { align-items: flex-start; flex-wrap: wrap; }
  .operations-pending .secondary-btn { width: 100%; }
}
@media (max-width: 520px) {
  .operation-inline-fields, .operations-extension-packages { grid-template-columns: minmax(0, 1fr); }
  .operations-backup-row { grid-template-columns: 32px minmax(0, 1fr); }
  .operation-backup-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .operations-extension-client { grid-template-columns: 10px minmax(0, 1fr); }
  .operations-extension-client b { grid-column: 2; }
}

/* Vendoo 1.31.0 — Multi-user, RBAC & server security */
.role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}
.role-card,
.security-card,
.security-env-guide {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface, var(--card-bg));
  padding: 16px;
  min-width: 0;
}
.role-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.role-card p,
.security-card p,
.security-env-guide p { color: var(--text-muted); margin: 0; line-height: 1.55; }
.role-badge.manager { background: color-mix(in srgb, #7c3aed 14%, transparent); color: #6d28d9; }
.role-badge.publisher { background: color-mix(in srgb, #0284c7 14%, transparent); color: #0369a1; }
.role-badge.viewer { background: color-mix(in srgb, #64748b 16%, transparent); color: #475569; }

.role-permission-matrix { display: grid; gap: 20px; }
.role-matrix-group h4 { margin: 0 0 9px; }
.role-matrix-table {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  background: var(--surface, var(--card-bg));
}
.role-matrix-head,
.role-matrix-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.8fr) repeat(5, minmax(96px, .7fr));
  min-width: 760px;
  align-items: center;
}
.role-matrix-head { background: var(--surface-soft, rgba(127,127,127,.06)); font-size: 12px; }
.role-matrix-head > *, .role-matrix-row > * { padding: 10px 12px; border-right: 1px solid var(--border); }
.role-matrix-head > *:last-child, .role-matrix-row > *:last-child { border-right: 0; }
.role-matrix-row { border-top: 1px solid var(--border); }
.role-matrix-row i { font-style: normal; text-align: center; font-weight: 800; }
.role-matrix-row i.is-allowed { color: var(--success, #15803d); }
.role-matrix-row i.is-denied { color: var(--text-muted); }

.security-panel-heading,
.security-lock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.security-panel-heading h3,
.security-lock-head h4 { margin: 2px 0 5px; }
.security-panel-heading p,
.security-lock-head p { margin: 0; color: var(--text-muted); }
.security-status-summary { margin-bottom: 12px; }
.security-score {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface, var(--card-bg));
}
.security-score > span { width: 34px; height: 34px; }
.security-score.is-good { border-color: color-mix(in srgb, #16a34a 42%, var(--border)); }
.security-score.is-warning { border-color: color-mix(in srgb, #d97706 48%, var(--border)); }
.security-score strong { display: block; font-size: 16px; }
.security-score p { margin: 3px 0 0; color: var(--text-muted); }
.security-warning-list { display: grid; gap: 8px; margin-bottom: 16px; }
.security-warning,
.security-ok {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 12px;
  padding: 11px 13px;
}
.security-warning { background: color-mix(in srgb, #f59e0b 11%, transparent); color: #92400e; }
.security-ok { background: color-mix(in srgb, #22c55e 10%, transparent); color: #166534; }
.security-warning p { margin: 0; }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.security-card h4 { margin: 0 0 12px; }
.security-card dl { display: grid; grid-template-columns: minmax(115px, .8fr) minmax(0, 1.2fr); gap: 9px 14px; margin: 0; }
.security-card dt { color: var(--text-muted); }
.security-card dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.security-lock-list { display: grid; gap: 8px; margin-bottom: 22px; }
.security-lock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, var(--card-bg));
}
.security-lock-row p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.security-env-guide pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-soft, rgba(127,127,127,.06));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
}

.listing-lock-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
}
.listing-lock-banner.is-mine { background: color-mix(in srgb, #22c55e 9%, var(--surface, transparent)); border-color: color-mix(in srgb, #22c55e 38%, var(--border)); }
.listing-lock-banner.is-foreign { background: color-mix(in srgb, #f59e0b 10%, var(--surface, transparent)); border-color: color-mix(in srgb, #f59e0b 44%, var(--border)); }
.listing-lock-banner > span { width: 24px; height: 24px; flex: 0 0 auto; }
.listing-lock-banner strong { display: block; }
.listing-lock-banner p { margin: 2px 0 0; color: var(--text-muted); font-size: 12px; }

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .8fr) 145px 145px 135px auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.audit-toolbar > * { min-width: 0; }
.audit-summary { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.audit-user { display: grid; gap: 2px; }
.audit-user small, .audit-action small { color: var(--text-muted); }
.audit-action p { margin: 4px 0 0; color: var(--text-muted); overflow-wrap: anywhere; }
.audit-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }

body[data-user-role="viewer"] .danger-zone,
body[data-user-role="publisher"] .danger-zone { display: none !important; }

@media (max-width: 1050px) {
  .audit-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-toolbar button { width: 100%; }
}
@media (max-width: 760px) {
  .security-grid { grid-template-columns: 1fr; }
  .security-panel-heading, .security-lock-head, .security-lock-row { align-items: stretch; flex-direction: column; }
  .security-card dl { grid-template-columns: 1fr; gap: 3px; }
  .security-card dd { margin-bottom: 8px; }
  .audit-toolbar { grid-template-columns: 1fr; }
}

/* 1.37.0 – Security Dashboard Foundation */
.security-secret-list{display:flex;flex-wrap:wrap;gap:var(--vd-space-2,8px);margin-top:var(--vd-space-3,12px)}
.security-secret-list .status-badge{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
