/* Creator Studio: neutral dark surfaces, sage actions, semantic status colours.
   The existing editor grid and data flows stay intact. The four quota values
   share four equal columns: available width = 4 columns + 3 × 16px gaps. */
:root {
  --bg: #0c0d0c;
  --surface: #161816;
  --surface-2: #232623;
  --line: #2c302c;
  --control: #414741;
  --muted: #b7bdb7;
  --faint: #a0a8a0;
  --text: #f1f4ef;
  --accent: #c2deb8;
  --accent-ink: #182415;
  --accent-soft: #1d281c;
  --danger: #f2a0ab;
  --danger-soft: #302024;
  --warn: #ebca8b;
  --warn-soft: #30291c;
  --ok: var(--accent);
  --radius: 20px;
}
html, body { background: var(--bg); }
body { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; padding: 12px 24px; background: var(--bg); border-color: var(--line); }
.wordmark { white-space: nowrap; color: var(--text); }
.wordmark span { border: 0; background: var(--surface-2); color: var(--accent); font-size: 11px; }
.topbar nav { justify-content: center; flex-wrap: nowrap; min-width: 0; }
.topbar nav button { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 8px; min-height: 44px; height: auto; padding: 10px; color: var(--muted); border-radius: 10px; font-size: 14px; font-weight: 500; }
.topbar nav button.active { background: var(--surface-2); color: var(--text); }
.topbar nav button:hover { color: var(--text); background: var(--surface); }
.topbar nav svg, .segmented svg, .secondary svg { width: 18px; height: 18px; flex: none; }
.topbar .nav-toggle { display: none; }
.account-name { color: var(--muted); }
.account-balance { padding-left: 16px; border-left: 1px solid var(--control); }
.account-balance span { color: var(--muted); font-size: 12px; }
.account-balance strong { color: var(--text); }
.role { color: var(--muted); background: var(--surface); font-size: 12px; }
.workspace { padding-top: 28px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.025em; }
.page-head > p { font-size: 14px; }
.eyebrow { color: var(--faint); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.primary { background: var(--accent); color: var(--accent-ink); min-height: 44px; }
.primary:hover { background: #d5eacf; }
.secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface-2); color: var(--text); }
.secondary:hover, .icon-button:hover { background: #343a34; }
.icon-button { background: var(--surface-2); color: var(--muted); }
.text-button { color: var(--muted); }
.text-button:hover { color: var(--text); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, textarea, select { background: #101210; border-color: var(--control); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 1px; }
input[type="range"], input[type="checkbox"] { accent-color: var(--accent); }
.quota-panel { background: var(--surface); border: 0; padding: 20px; gap: 16px; }
.quota-panel p, .quota-values small, .quota-panel > small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.quota-values { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.quota-values > div { align-content: start; gap: 8px; }
.quota-values > div > span { color: var(--muted); font-size: 12px; }
.quota-values strong { font-size: 20px; }
.header-quota { --quota-color: var(--accent); background: var(--accent-soft); border: 0; width: 280px; padding: 10px 12px; }
.header-quota.quota-medium { --quota-color: var(--warn); background: var(--warn-soft); }
.header-quota.quota-low { --quota-color: var(--danger); background: var(--danger-soft); }
.header-quota-title > span, .header-quota-title > small, .header-quota-amount > span, .header-quota-hint, .header-quota-details { font-size: 11px; }
.header-quota-title > span, .header-quota-details, .header-quota-hint, .header-quota-amount > span { color: var(--muted); }
.source-rail { background: transparent; padding: 0; }
.editor, .admin-create, .generation, .estimation-row { background: var(--surface); }
.segmented { background: var(--surface); padding: 4px; }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; color: var(--muted); }
.segmented button.active { background: var(--surface-2); color: var(--text); }
.drop-zone { min-height: 340px; background: var(--surface); border-color: var(--control); }
.drop-zone > svg { width: 32px; height: 32px; color: var(--accent); }
.drop-zone > small, .privacy-note, .empty-inline { color: var(--faint); font-size: 12px; }
.generation-estimate { background: var(--accent-soft); color: var(--accent); padding: 14px 16px; border-radius: 10px; line-height: 1.6; }
.generation-estimate:empty { padding: 0; }
.ratio-options { flex-wrap: wrap; overflow: visible; gap: 8px; }
.ratio-option { flex: 0 0 60px; background: #101210; color: var(--muted); }
.ratio-option.selected { background: var(--text); color: var(--bg); }
.ratio-option b { font-size: 12px; }
.generation-title span, .generation-title time, .generation-meta span, .generation-facts span, .review, .status, .metric-line span, .compact-inputs label, .table-head, .selected-lora label { font-size: 12px; letter-spacing: 0; text-transform: none; }
.generation-title span, .generation-title time, .review, .metric-line span, .compact-inputs label, .table-head { color: var(--faint); }
.runtime-stat, .generation-meta span, .generation-admin-note { background: var(--surface-2); }
.runtime-stat > i { background: transparent; color: var(--muted); }
.runtime-stat small, .generation-facts small, .runtime-stat span { font-size: 12px; color: var(--muted); }
.status.completed { background: var(--accent-soft); color: var(--accent); }
.status.failed, .status.unknown { background: var(--danger-soft); color: var(--danger); }
.status.cancelled { background: var(--surface-2); color: var(--muted); }
.status.queued, .status.submitted, .status.uploading { background: var(--warn-soft); color: var(--warn); }
.status.running, .status.submitting, .status.downloading { background: var(--accent-soft); color: var(--accent); }
.balance-hero strong { font-size: 36px; color: var(--text); letter-spacing: -.025em; }
.balance-hero { padding: 24px; background: var(--surface); border: 0; border-radius: var(--radius); }
.toast { background: var(--accent-soft); color: var(--text); }
.toast.danger { background: var(--danger-soft); }
.notice { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.login-brand, .login-form { background: var(--bg); }
.login-brand h1 { font-size: 32px; }
.login-brand .brand-mark { background: var(--surface-2); color: var(--accent); }
.login-form h2 { font-size: 24px; }
.catalog-dialog, .catalog-tools { background: var(--bg); }
.catalog-shell { min-height: 0; grid-template-rows: auto auto minmax(0, 1fr); }
.catalog-tools { grid-template-columns: minmax(0, 1fr) minmax(210px, .7fr); gap: 12px; }
.catalog-search, .catalog-category { display: grid; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.catalog-category select { width: 100%; height: 46px; border-color: var(--control); background: #101210; }
.catalog-tools .catalog-summary { display: flex; grid-column: 1 / -1; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; color: var(--muted); font-size: 12px; }
.catalog-list { min-height: 0; }
@media (max-width: 1250px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .admin-topbar nav { flex-wrap: wrap; }
}
@media (max-width: 820px) {
  .quota-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .catalog-tools { grid-template-columns: minmax(0, 1fr); }
  .topbar, .creator-topbar { position: relative; padding: 16px; gap: 12px; }
  .wordmark { font-size: 14px; }
  .wordmark span { font-size: 11px; }
  .creator-topbar { grid-template-columns: minmax(0, 1fr); }
  .creator-topbar .account { grid-template-columns: minmax(0, 1fr) auto 36px; gap: 8px; }
  .creator-topbar .header-quota { width: 100%; }
  .header-quota-title > small { white-space: normal; }
  .creator-topbar nav { grid-row: 3; justify-content: space-between; gap: 0; }
  .creator-topbar nav button { flex-direction: column; gap: 6px; padding: 10px 8px; font-size: 12px; flex: 1; }
  .admin-topbar { grid-template-columns: 1fr auto; }
  .admin-topbar .account { grid-column: 2; grid-row: 1; }
  .topbar .nav-toggle { display: inline-flex; grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; min-height: 44px; }
  .admin-topbar nav { display: none; }
  .admin-topbar.navigation-open nav { display: grid; grid-template-columns: 1fr 1fr; grid-row: 3; }
  .admin-topbar nav button { justify-content: flex-start; min-height: 44px; }
  .workspace { padding: 24px 16px 64px; }
  .page-head h1 { font-size: 24px; }
  .page-head > p { font-size: 14px; }
  .quota-values > div { grid-template-columns: 1fr; }
  .quota-values strong { font-size: 18px; }
  .quota-values > div > small { grid-column: auto; }
  .quota-values > div > span, .header-quota-hint, .header-quota-details { line-height: 1.5; }
  .platform-defaults { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-defaults > div:first-child, .platform-defaults > button { grid-column: 1 / -1; }
  .secondary, .icon-button { min-height: 44px; }
  .generation-facts span, .runtime-stat small { font-size: 12px; }
}
