/* ============================================================
   STUDIO WORKSPACE · W4
   Single-pane (extends today.css body grid)
   Calendar + queues + brand profiles
   ============================================================ */

:root {
  --a-eden:    #ffb6e6;
  --a-maya:    #b6ff8a;
}

/* ============================================================
   AMBIENT BACKGROUND GLOW
   ============================================================ */
.studio-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.amb-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}
.amb-orb-1 {
  width: 480px; height: 480px;
  top: -80px; right: -60px;
  background: rgba(83,224,118,.05);
}
.amb-orb-2 {
  width: 380px; height: 380px;
  bottom: -60px; left: 200px;
  background: rgba(29,185,84,.04);
}

/* ── Real artist gradients ─────────────────────────── */
.valen-grad          { background: linear-gradient(135deg, #3d6fa8, #1a2878); }
.bedroom-loops-grad  { background: linear-gradient(135deg, #c08858, #6a4220); }
.palm-dust-grad      { background: linear-gradient(135deg, #c99050, #7a4818); }
.saffron-static-grad { background: linear-gradient(135deg, #d4900a, #8a5800); }

/* ── Real artist accents ───────────────────────────── */
.artist.valen          { background: rgba(126,192,238,.15); color: #7ec0ee; }
.artist.bedroom-loops  { background: rgba(201,168,124,.15); color: #c9a87c; }
.artist.palm-dust      { background: rgba(212,160,106,.15); color: #d4a06a; }
.artist.saffron-static { background: rgba(232,180,76,.15);  color: #e8b44c; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb {
  background: var(--surface-4);
  border-radius: var(--r-full);
  border: 1px solid var(--surface);
}
::-webkit-scrollbar-thumb:hover { background: #4a4949; }

/* ── Text selection ────────────────────────────────── */
::selection {
  background: rgba(83,224,118,.22);
  color: var(--text);
}

/* Artist accents (some appear only here) */
.artist.eden { background: rgba(255,182,230,.15); color: var(--a-eden); }
.artist.maya { background: rgba(182,255,138,.15); color: var(--a-maya); }

/* Gradient backgrounds (reused for cell art) */
.liran-grad   { background: linear-gradient(135deg, #c97a4a, #7a3a1a); }
.noa-grad     { background: linear-gradient(135deg, #6a4ec9, #2a2a8e); }
.gidi-grad    { background: linear-gradient(135deg, #4ac9a4, #1a7a6a); }
.avi-grad     { background: linear-gradient(135deg, #c94a8e, #7a1a4a); }
.lital-grad   { background: linear-gradient(135deg, #4a8ec9, #1a4a7a); }
.eden-grad    { background: linear-gradient(135deg, #c94a4a, #7a1a1a); }
.maya-grad    { background: linear-gradient(135deg, #8ec94a, #4a7a1a); }

.studio-topbar .workspace-tally {
  display: inline-flex; align-items: center; gap: 10px;
}

.studio-main {
  padding-top: 22px;
}

/* ============================================================
   TABS
   ============================================================ */
.studio-tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.studio-tab {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  padding: 12px 14px 14px;
  cursor: pointer;
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .15s;
}
.studio-tab:hover { color: var(--text-2); }
.studio-tab.active { color: var(--text); }
.studio-tab.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--primary-bright);
  border-radius: 1px;
}
.studio-tab .icon { width: 14px; height: 14px; }
.studio-tab.active .icon { color: var(--primary-bright); }
.ct-count {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-mute);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
}
.studio-tab.active .ct-count {
  background: var(--primary-soft); color: var(--primary-bright);
}
.ct-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--info);
  animation: pulse 2.4s ease-in-out infinite;
}
.studio-tabs-spacer { flex: 1; }

.discover-badge {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 800;
  background: var(--info-soft);
  color: var(--info);
  border: 1px solid var(--info-line);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-in .2s; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   WEEK TOOLBAR
   ============================================================ */
.week-toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-arrow {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px; height: 32px;
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.week-arrow:hover { background: var(--surface-3); color: var(--text); border-color: var(--surface-4); }
.week-arrow .icon { width: 14px; height: 14px; }

.week-label { line-height: 1.2; }
.wl-main { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.005em; }
.wl-sub  { font-size: 10.5px; color: var(--text-mute); margin-top: 2px; letter-spacing: .04em; }

.week-jump {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  margin-left: 4px;
  transition: background .15s, color .15s, border-color .15s;
}
.week-jump:hover { background: var(--surface-3); color: var(--text); border-color: var(--surface-4); }

.week-actions { display: flex; align-items: center; gap: 10px; }
.week-stats {
  display: flex; gap: 14px;
  padding: 6px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.ws-item {
  display: flex; align-items: baseline; gap: 5px;
  font-size: 11px;
  color: var(--text-3);
}
.ws-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ws-item.warn .ws-num { color: var(--warning); }
.ws-label {
  font-size: 9.5px;
  color: var(--text-mute);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ws-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 0 rgba(126,192,238,.5);
}
.ws-dot.pulse {
  animation: ws-ping 2s ease-in-out infinite;
}
@keyframes ws-ping {
  0%,100% { box-shadow: 0 0 0 0 rgba(126,192,238,.5); }
  50%     { box-shadow: 0 0 0 5px rgba(126,192,238,0); }
}

.primary-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, var(--primary-bright), var(--primary));
  color: #003914;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 0 14px rgba(83,224,118,.2);
  transition: filter .15s, transform .15s;
}
.primary-btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.primary-btn:active { transform: scale(.95); filter: brightness(.98); }
.primary-btn .icon  { width: 14px; height: 14px; }


/* ============================================================
   CALENDAR GRID
   ============================================================ */
.cal-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 18px;
}

.cal-grid {
  display: grid;
  grid-template-columns: 110px repeat(7, 1fr);
  gap: 6px;
}

.cal-row-label {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px;
  color: var(--text-2);
}
.cal-row-label.corner { border-bottom: 1px solid var(--border); }
.cal-row-label .icon { width: 15px; height: 15px; color: var(--primary-bright); }
.crl-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--text);
}
.crl-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.cal-day {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.cal-day.past { opacity: .65; }
.cal-day.today {
  background: linear-gradient(180deg, rgba(83,224,118,.07), transparent 80%);
  border-bottom-color: var(--primary-line);
}
.cd-dow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.cd-date {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.022em;
  color: var(--text);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cal-day.today .cd-date { color: var(--primary-bright); }
.cd-now-pill {
  position: absolute;
  top: 9px; right: 10px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--primary-bright);
  color: #003914;
}


/* ── Cell base ─────────────────── */
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  min-height: 140px;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  overflow: hidden;
  transition: background .12s, border-color .12s, transform .12s;
}
.cell:hover {
  background: var(--surface-3);
  border-color: var(--surface-4);
}
.cell.today-cell {
  background: linear-gradient(180deg, rgba(83,224,118,.04), var(--surface-2));
}
.cell.selected {
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 1px var(--primary-bright), 0 0 20px rgba(83,224,118,.18);
}

.cell-status {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary);
  color: #003914;
  z-index: 1;
  box-shadow: 0 0 0 2px var(--surface-2);
}
.cell-status .icon { width: 12px; height: 12px; stroke-width: 3; }
.cell-status.fail {
  background: var(--warning);
  color: #3a2a00;
}
.cell-status.queue {
  background: var(--surface-3);
  color: var(--text-2);
}
.cell-status.gen {
  background: transparent;
  position: relative;
}
.cell-status.gen .gen-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 0 rgba(126,192,238,.5);
  animation: pulse-ring 1.6s ease-in-out infinite;
}

.cell-art {
  width: 100%;
  height: 36px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.cell-art-tall {
  width: 100%;
  aspect-ratio: 9 / 5;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.cell-art-cars {
  display: flex; gap: 2px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
}
.ca-pane {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  filter: brightness(.95);
}
.cell-play-mini {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,.85);
}
.cell-play-mini .icon { width: 14px; height: 14px; margin-left: 2px; }

.gen-bar {
  position: absolute;
  bottom: 4px; left: 4px; right: 4px;
  height: 3px;
  background: rgba(0,0,0,.4);
  border-radius: 2px;
  overflow: hidden;
}
.gen-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--info), #b0e0ff);
  border-radius: 2px;
  animation: gen-pulse 1.5s ease-in-out infinite;
}
@keyframes gen-pulse {
  0%,100% { opacity: .6; }
  50% { opacity: 1; }
}

.cell-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  letter-spacing: .01em;
}
.cell-more {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--primary-soft);
  color: var(--primary-bright);
  margin-left: 4px;
}
.cell-gen-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--info);
  margin-left: 4px;
}
.cell-artist {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 4px;
  align-self: flex-start;
  line-height: 1.3;
}
.cell-meta {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.35;
}
.cell-meta.warn { color: var(--warning); font-weight: 600; }
.cell-fix {
  font-size: 11.5px;
  color: var(--warning);
  font-weight: 700;
  text-decoration: none;
  margin-top: 3px;
}
.cell-fix:hover { text-decoration: underline; }

/* Cell states */
.cell.done {
  border-left: 3px solid var(--primary-bright);
}
.cell.queued {
  border-left: 3px solid var(--surface-4);
}
.cell.generating {
  border-left: 3px solid var(--info);
  background: linear-gradient(180deg, rgba(126,192,238,.05), var(--surface-2));
}
.cell.failed {
  border-left: 3px solid var(--warning);
  background: linear-gradient(180deg, rgba(255,183,77,.05), var(--surface-2));
}
.fail-overlay {
  filter: grayscale(.7) brightness(.6);
  position: relative;
}
.fail-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg,
      transparent 0 6px,
      rgba(255,183,77,.18) 6px 12px);
}

.cell.empty {
  background: transparent;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: var(--text-mute);
}
.cell.empty:hover {
  background: var(--surface-2);
  border-color: var(--primary-line);
  color: var(--primary-bright);
}
.empty-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
}
.cell.empty:hover .empty-icon { background: var(--primary-soft); color: var(--primary-bright); }
.empty-icon .icon { width: 12px; height: 12px; }
.empty-text {
  font-size: 11px;
  font-weight: 500;
}

/* Legend below grid */
.cal-legend {
  display: flex; gap: 16px;
  padding: 14px 8px 4px;
  border-top: 1px dashed var(--border);
  margin-top: 12px;
  font-size: 10.5px;
  color: var(--text-mute);
  flex-wrap: wrap;
}
.cal-legend .leg {
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.cl-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--surface-3);
  color: var(--text-mute);
}
.cl-dot.done { background: var(--primary); color: #003914; }
.cl-dot.done .icon { width: 8px; height: 8px; stroke-width: 4; }
.cl-dot.gen { background: var(--info); }
.cl-dot.queue { background: var(--surface-4); color: var(--text); }
.cl-dot.queue .icon { width: 8px; height: 8px; }
.cl-dot.fail { background: var(--warning); color: #3a2a00; }
.cl-dot.fail .icon { width: 8px; height: 8px; }
.cl-dot.empty { background: transparent; border: 1px dashed var(--border); }
.cl-dot.empty .icon { width: 8px; height: 8px; }


/* ============================================================
   INSPECTOR CARD
   ============================================================ */
.inspector {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 22px;
  transition: background .25s, border-color .25s;
}
.inspector.shimmer {
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--surface-1) 60%);
  border-color: var(--primary-line);
}
.ins-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.commits-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eb-icon { width: 13px; height: 13px; color: var(--text-3); }
.ins-title {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.ins-artist {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
}
/* Connected-status pill badge (from design system) */
.ins-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--r-full);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.ins-status-badge.ok {
  background: var(--primary-soft);
  color: var(--primary-bright);
  border-color: var(--primary-line);
}
.ins-status-badge.warn {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning-line);
}
.isb-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
  flex-shrink: 0;
}

.ins-rotation {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.ins-rotation strong { color: var(--text); font-weight: 700; }
.ins-rotation .icon { width: 12px; height: 12px; color: var(--primary-bright); }

.bilingual-mark {
  display: inline-block;
  font-size: 14px;
  color: var(--bilingual);
  padding-left: 6px;
  border-left: 1px solid var(--bilingual-line);
  margin-left: 6px;
  font-weight: 600;
  unicode-bidi: isolate;
}

/* Preflight grid */
.preflight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.pf {
  background: var(--surface-1);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.pf-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.pf-val {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
}
.pf-pill {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--text-2);
  flex-shrink: 0;
}
.pf-pill.good {
  background: var(--primary);
  color: #003914;
}
.pf-pill .icon { width: 10px; height: 10px; stroke-width: 3; }
.pf-meta {
  font-size: 10.5px;
  color: var(--text-mute);
}

/* Activity sparkline in inspector */
.ins-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 0 14px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 14px;
}
.spark-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-mute);
  white-space: nowrap;
  margin-bottom: 2px;
  align-self: center;
}
.spark-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  flex: 1;
}
.spark-bar {
  flex: 1;
  background: rgba(83,224,118,.22);
  border-radius: 2px 2px 0 0;
  transition: background .15s;
}
.spark-bar.active {
  background: var(--primary-bright);
  box-shadow: 0 0 6px rgba(83,224,118,.5);
}
.ins-sparkline:hover .spark-bar:not(.active) { background: rgba(83,224,118,.35); }

/* Slot actions */
.slot-actions {
  display: flex; gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.slot-actions-spacer { flex: 1; }
.slot-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.slot-btn:hover  { background: var(--surface-3); border-color: var(--surface-4); }
.slot-btn:active { transform: scale(.95); }
.slot-btn .icon { width: 13px; height: 13px; }
.slot-btn.primary {
  background: linear-gradient(180deg, var(--primary-bright), var(--primary));
  color: #003914;
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 0 14px rgba(83,224,118,.2);
}
.slot-btn.primary:hover  { transform: translateY(-1px); filter: brightness(1.08); }
.slot-btn.primary:active { transform: scale(.95); }
.slot-btn-sub {
  font-size: 10px;
  font-weight: 500;
  color: rgba(0,57,20,.7);
  margin-left: 2px;
}
.slot-btn.ghost {
  background: transparent;
}
.slot-btn.ghost.danger {
  color: var(--text-mute);
}
.slot-btn.ghost.danger:hover {
  background: var(--error-soft);
  color: var(--error);
  border-color: var(--error-line);
}
.slot-btn.small {
  padding: 5px 10px;
  font-size: 11.5px;
}


/* ============================================================
   STORIES TAB
   ============================================================ */
.queue-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 22px;
}
/* Toggle switch */
.toggle-pill {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 12px;
  vertical-align: middle;
  user-select: none;
}
.toggle-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: relative;
  width: 34px; height: 18px;
  border-radius: var(--r-full);
  background: var(--surface-4);
  border: 1px solid var(--border);
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: transform .2s, background .2s, box-shadow .2s;
}
.toggle-pill input:checked ~ .toggle-track {
  background: var(--primary-soft);
  border-color: var(--primary-line);
}
.toggle-pill input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(16px);
  background: var(--primary-bright);
  box-shadow: 0 0 6px rgba(83,224,118,.5);
}
.toggle-pill input:checked ~ .toggle-label { color: var(--primary-bright); }
.toggle-label { font-size: 11px; font-weight: 600; letter-spacing: .02em; }

.queue-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 12px;
}
.queue-title {
  font-size: 14px;
  font-weight: 700;
  margin: 4px 0 0;
  color: var(--text);
}
.queue-filters { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.filter-chip {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  padding: 4px 12px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.filter-chip:hover { color: var(--text); background: var(--surface-3); }
.filter-chip.active {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}

.queue-list {
  list-style: none; margin: 0; padding: 0;
}
.queue-row {
  display: grid;
  grid-template-columns: 70px 56px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.queue-row:last-child { border-bottom: none; }
.queue-row:hover { background: var(--surface-2); border-radius: var(--r-sm); }
.queue-row::before {
  content: '';
  position: absolute; left: -22px; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity .15s;
}
.queue-row.done::before   { background: var(--primary-bright); opacity: 1; }
.queue-row.queued::before { background: var(--surface-4);      opacity: 1; }
.queue-row.dim { opacity: .6; }

.qr-time-num {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.qr-time-sub {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.qr-thumb {
  width: 56px; height: 56px;
  border-radius: 6px;
  position: relative;
}
.qr-thumb.recycled::after {
  content: '↺';
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
}
.qr-info { min-width: 0; }
.qr-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.qr-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
  display: flex; align-items: center; gap: 8px;
}
.qr-meta .meta-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.qr-route {
  font-size: 10.5px;
  color: var(--text-mute);
}
.recycle-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  background: var(--bilingual-soft);
  color: var(--bilingual);
  border: 1px solid var(--bilingual-line);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
}


/* ============================================================
   REELS TAB
   ============================================================ */
.reel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.reel-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.reel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border-color: var(--surface-4);
}
.reel-card.generating { border-color: var(--info-line); }
.reel-card.generating:hover { border-color: var(--info-line); }
.reel-card.failed { border-color: var(--warning-line); }
.reel-card.failed:hover { border-color: var(--warning-line); }

.reel-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  height: 100%;
}
.rt-gen {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.45);
  gap: 8px;
  flex-direction: column;
}
.rt-spin {
  width: 38px; height: 38px;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.rt-time {
  position: absolute;
  bottom: 10px;
  left: 50%; transform: translateX(-50%);
  font-size: 11px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
}
.rt-fail {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: var(--warning);
}
.rt-fail .icon { width: 28px; height: 28px; }
.reel-play {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,.35);
  color: #fff;
  opacity: 0;
  transition: opacity .15s;
}
.reel-card:hover .reel-play { opacity: 1; }
.reel-play .icon { width: 28px; height: 28px; margin-left: 4px; }

.reel-body {
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.reel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
}
.reel-time {
  font-size: 10.5px;
  color: var(--text-mute);
}
.reel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.005em;
}
.reel-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center;
}
.reel-meta .meta-chip {
  font-size: 10px;
  color: var(--text-3);
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.reel-preflight {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-3);
  align-items: center;
}
.reel-preflight .pf-pill {
  width: 16px; height: 16px;
}
.reel-preflight .pf-pill .icon { width: 9px; height: 9px; }
.reel-failure-note {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-line);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.reel-failure-note .icon { color: var(--warning); width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.reel-actions {
  display: flex; gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.reel-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px;
  font-size: 11.5px;
  color: var(--text-3);
  gap: 16px;
}
.reel-cap-meter {
  display: flex; align-items: center; gap: 7px;
}
.rcm-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-mute);
}
.rcm-track {
  width: 72px; height: 4px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
  border: 1px solid var(--border);
}
.rcm-fill {
  height: 100%;
  background: var(--warning);
  border-radius: var(--r-full);
  box-shadow: 0 0 6px rgba(255,183,77,.4);
  transition: width .4s;
}
.rcm-count {
  font-size: 10.5px; font-weight: 700;
}
.rcm-count.warn { color: var(--warning); }
.rcm-count.ok   { color: var(--primary-bright); }
.rcm-reset { font-size: 10px; color: var(--text-mute); }
.mini-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin: 0 4px 0 8px;
  vertical-align: 1px;
}
.mini-dot.pending { background: var(--info); }
.mini-dot.warn    { background: var(--warning); }
.mini-dot.idle    { background: var(--surface-4); }


/* ============================================================
   BRANDS TAB
   ============================================================ */
.brands-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-bright);
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.brands-banner > .icon { color: var(--primary-bright); margin-top: 1px; width: 16px; height: 16px; flex-shrink: 0; }
.brands-banner strong { color: var(--text); font-weight: 600; }

.brands-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.brand-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.brand-card:not(.add-card):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  border-color: var(--surface-4);
}
.brand-card.warn { border-color: var(--warning-line); }
.brand-card.warn:hover { border-color: var(--warning-line); }

.brand-cover {
  height: 80px;
  position: relative;
  display: grid; place-items: center;
}
.brand-cover-letter {
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 800;
  color: rgba(255,255,255,.85);
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
  letter-spacing: -.04em;
}

.brand-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.brand-line1 {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.brand-name {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.008em;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.brand-name .artist {
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand-edit {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-3);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.brand-edit:hover { background: var(--surface-3); color: var(--text); }
.brand-edit .icon { width: 12px; height: 12px; }
.brand-tag {
  font-size: 10.5px;
  color: var(--text-mute);
  letter-spacing: .04em;
}
.brand-bio {
  font-size: 11.5px;
  color: var(--text-3);
  margin: 0;
  line-height: 1.45;
}
.brand-bio em { color: var(--text-2); font-style: italic; }

.brand-stats {
  display: flex; gap: 14px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}
.brand-stats > div { display: flex; flex-direction: column; gap: 1px; }
.bs-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.005em;
}
.bs-num.warn { color: var(--warning); }
.bs-lbl {
  font-size: 9.5px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.brand-recent {
  display: flex; gap: 4px; align-items: center;
}
.br-thumb {
  width: 36px; height: 36px;
  border-radius: 4px;
}
.br-thumb-more {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  padding: 0 6px;
}

.brand-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
}
.brand-color-swatch {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 0 8px var(--swatch-color, transparent);
  --swatch-color: transparent;
  transition: box-shadow .2s;
}
.brand-card:hover .brand-color-swatch {
  box-shadow: 0 0 12px var(--swatch-color, transparent);
}
.brand-color-name {
  font-size: 10px;
  color: var(--text-mute);
}
.brand-color-spacer { flex: 1; }

/* Add card */
.brand-card.add-card {
  border: 1px dashed var(--border);
  background: transparent;
}
.add-card-btn {
  width: 100%; height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 22px;
  display: flex; align-items: center; gap: 16px;
  font-family: inherit;
  text-align: left;
  color: var(--text-3);
  transition: background .15s, color .15s, border-color .15s;
  border-radius: var(--r);
}
.brand-card.add-card:hover {
  background: var(--surface-1);
  border-color: var(--primary-line);
}
.brand-card.add-card:hover .add-card-btn { color: var(--primary-bright); }

/* Extended brand profile sections */
.brand-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.brand-section-label {
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 700;
}
.brand-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.brand-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.brand-list {
  margin: 0;
  padding-left: 16px;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.brand-list li { margin-bottom: 2px; }
.brand-list.good li::marker { color: var(--primary-bright); }
.brand-list.bad li::marker { color: var(--error); }

.add-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--surface-4);
  display: grid; place-items: center;
  color: var(--text-3);
  flex-shrink: 0;
}
.add-icon .icon { width: 20px; height: 20px; }
.add-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.add-sub {
  font-size: 11px;
  color: var(--text-mute);
}


/* ============================================================
   FAB · Floating action button (calendar tab quick add)
   ============================================================ */
.studio-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-bright), var(--primary));
  color: #003914;
  border: none;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(83,224,118,.35), 0 0 0 0 rgba(83,224,118,.3);
  z-index: 50;
  transition: transform .18s, filter .18s, box-shadow .18s;
  animation: fab-glow 3s ease-in-out infinite;
}
.studio-fab:hover {
  transform: scale(1.12) translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 28px rgba(83,224,118,.5);
  animation: none;
}
.studio-fab .icon { width: 22px; height: 22px; }
@keyframes fab-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(83,224,118,.3), 0 0 0 0 rgba(83,224,118,.25); }
  50%      { box-shadow: 0 4px 20px rgba(83,224,118,.45), 0 0 0 6px rgba(83,224,118,0); }
}

/* Ghost-btn override: pill shape in studio context */
.studio-main .ghost-btn,
.studio-tabs .ghost-btn {
  border-radius: var(--r-full);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1400px) {
  .cal-grid { grid-template-columns: 90px repeat(7, 1fr); }
  .cell { min-height: 110px; padding: 8px; }
  .brands-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1180px) {
  .preflight-grid { grid-template-columns: 1fr 1fr; }
  .reel-grid { grid-template-columns: 1fr; }
  .week-actions { flex-wrap: wrap; row-gap: 8px; }
}
@media (max-width: 960px) {
  .cal-grid {
    grid-template-columns: 80px repeat(7, minmax(96px, 1fr));
    overflow-x: auto;
  }
  .brands-grid { grid-template-columns: 1fr; }
  .reel-card { grid-template-columns: 110px 1fr; }
}
