/* Brand selector (editor) */
#brand-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: var(--spacing-xs) 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
#brand-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}
#active-brand-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* #brand-dropdown-menu is now the unified overlay - styled via .brand-export-menu below. */
#brand-list-container {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}
.brand-dropdown-header {
  padding: var(--spacing-xs);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-xs);
}
.brand-dropdown-header-main {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-width: 0;
}
.brand-dropdown-header-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.brand-dropdown-usage {
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.brand-dropdown-usage--at-limit {
  color: var(--warning-text);
}
.brand-dropdown-new-btn {
  font-size: var(--text-sm);
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
}
#export-summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
}

/* === Panel header: tabs (left) + compact brand chip (right) === */
.panel-header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-sm); }

#brand-selector-wrap { min-width: 0; flex: 0 1 auto; }
#brand-dropdown-trigger { gap: 8px; padding: var(--spacing-xs) 13px; min-width: 0; max-width: 100%; }
#brand-indicator-dot { flex-shrink: 0; }
#active-brand-label { max-width: 130px; min-width: 0; }
.brand-chip-settings-icon { color: var(--text-tertiary); flex-shrink: 0; }
.brand-chip-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}
.brand-chip-chevron.expanded { transform: rotate(180deg); }

/* === Unified overlay dropdown: brand switcher + export settings === */
.brand-export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 272px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 5px 8px 8px;
  z-index: 50;
}
.brand-menu-section + .brand-menu-section { margin-top: 6px; padding-top: 6px; }
.brand-menu-head { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-xs); padding: 2px 6px 4px; }
.brand-menu-title { font-size: var(--text-2xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); }
/* Brand list scrolls once it gets long (~5 rows) */
.brand-export-menu #brand-list-container { max-height: 176px; overflow-y: auto; }

/* Anon-only signup upsell (sits where the brand switcher is for members).
   Reuses .brand-menu-head / .brand-menu-title / .brand-dropdown-new-btn so it
   reads as a native section - just a title, a "Sign up free" link, and a note. */
.brand-upsell-sub {
  padding: 0 6px;
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Footer crop control - input + px + lock, sits under the "Adjust footer crop" title */
.footer-crop-control { display: flex; align-items: center; gap: 6px; padding: 6px 6px 2px; }
/* "Save as default" - left-aligned below the footer crop row, collapses when hidden */
.footer-save-row { text-align: left; padding: 4px 6px 2px; }
/* Lock button - match the 30px input height, shrink from .btn default (38px) */
.brand-export-menu .footer-lock-btn { height: 30px; width: 30px; padding: 0; box-shadow: none; }
.brand-export-menu .footer-lock-btn:hover:not(:disabled) { transform: none; }

/* Inline "Save as default" - left of the footer input, shown only when the crop
   differs from the active brand's saved default. */
.footer-save-inline {
  flex-shrink: 0;
  padding: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.footer-save-inline:hover { text-decoration: underline; }
.upload-max-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: var(--weight-medium);
}

/* Multi-link brand editor (brand modal + workspace inline panel) */
.brand-link-editor { display: flex; flex-direction: column; gap: 6px; }
.brand-link-row { display: flex; align-items: center; gap: 6px; }
.brand-link-default-btn {
  flex-shrink: 0; width: 26px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--border-strong);
  font-size: var(--text-md); line-height: 1; border-radius: var(--radius-sm);
}
.brand-link-default-btn:hover { color: var(--primary); background: var(--primary-subtle); }
.brand-link-default-btn.is-default { color: var(--primary); }
.brand-link-default-btn.is-placeholder,
.brand-link-default-btn.is-placeholder:hover { color: var(--border); cursor: default; background: none; }
.brand-link-input {
  flex: 1; min-width: 0; padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-input-strong); border-radius: var(--radius-md);
  font-size: var(--text-sm); box-sizing: border-box;
}
.brand-link-input:focus { outline: none; border-color: var(--primary); }
.brand-link-remove-btn {
  flex-shrink: 0; width: 26px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--text-tertiary);
  font-size: var(--text-lg); line-height: 1; border-radius: var(--radius-sm);
  opacity: 0; transition: opacity 0.12s ease;
}
.brand-link-remove-btn:hover { color: var(--danger); background: var(--danger-subtle); }
.brand-link-row:hover .brand-link-remove-btn,
.brand-link-row:focus-within .brand-link-remove-btn { opacity: 1; }
.brand-link-toggle {
  align-self: flex-start;
  margin-left: 32px;
  padding: 2px 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
}
.brand-link-toggle:hover { text-decoration: underline; }
