/* ═══════════════════════════════════════════════════
   ArticleDesk · style.css
   Dark editorial — Instrument Serif + Geist
═══════════════════════════════════════════════════ */

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

:root {
  --news:        #f5a623;
  --news-dim:    rgba(245,166,35,0.12);
  --news-border: rgba(245,166,35,0.3);

  --bg:         #0c0e13;
  --bg2:        #10121a;
  --surface:    #141720;
  --surface2:   #1b1f2e;
  --surface3:   #222740;
  --border:     #1f2435;
  --border2:    #2a3050;
  --border3:    #353d60;

  --text:       #dde1f0;
  --text-dim:   #8890b0;
  --text-muted: #4a5070;

  --muz:        #d4a96a;
  --muz-dim:    rgba(212,169,106,0.12);
  --muz-border: rgba(212,169,106,0.3);
  --nad:        #5b9cf6;
  --nad-dim:    rgba(91,156,246,0.12);
  --nad-border: rgba(91,156,246,0.3);
  --lsf:        #2dd4bf;
  --lsf-dim:    rgba(45,212,191,0.12);
  --lsf-border: rgba(45,212,191,0.3);

  --green:      #52d48a;
  --green-dim:  rgba(82,212,138,0.12);
  --red:        #e05668;
  --red-dim:    rgba(224,86,104,0.12);
  --purple:     #a07cf5;
  --purple-dim: rgba(160,124,245,0.14);
  --purple-border: rgba(160,124,245,0.35);
  --amber:      #f0b429;

  --sidebar-w:  224px;
  --topbar-h:   52px;
  --radius:     10px;
  --radius-sm:  6px;

  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans:  'Geist', system-ui, sans-serif;
  --font-mono:  'Geist Mono', 'Courier New', monospace;

  --brand:        var(--lsf);
  --brand-dim:    var(--lsf-dim);
  --brand-border: var(--lsf-border);
}

html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
}

* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ──────────────────────────────────────────────────
   LOADING / ERROR SCREENS
────────────────────────────────────────────────── */
.loading-screen,
.error-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.error-screen { display: none; }

.loading-inner,
.error-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px; text-align: center;
}
.loading-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.loading-name {
  font-family: var(--font-serif);
  font-size: 28px; letter-spacing: -0.5px;
}
.loading-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border2);
  border-top-color: var(--lsf);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-msg {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-muted);
}
.error-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--red-dim);
  border: 1px solid rgba(224,86,104,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--red);
}
.error-title { font-size: 17px; font-weight: 600; }
.error-msg {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-muted);
  max-width: 360px; line-height: 1.6;
}

/* ──────────────────────────────────────────────────
   LOGIN SCREEN
────────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: none; align-items: center; justify-content: center;
  z-index: 9000;
}
.login-screen.visible { display: flex; }

.login-box {
  width: 400px; max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.login-logo {
  display: flex; align-items: center; gap: 18px;
  justify-content: center; margin-bottom: 32px;
}
.login-brand-text { display: flex; flex-direction: column; gap: 1px; }
.login-brand-name {
  font-family: var(--font-serif); font-size: 22px;
  letter-spacing: -0.4px; line-height: 1.1;
}
.login-brand-name em { font-style: italic; }
.login-brand-sub {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 3px; color: #7986cb; margin-top: 2px;
}
.login-brand-panel {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-muted); margin-top: 4px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }

.login-error {
  display: none;
  padding: 9px 12px;
  background: var(--red-dim);
  border: 1px solid rgba(224,86,104,0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-family: var(--font-mono); font-size: 12px;
  line-height: 1.4;
}
.login-error.visible { display: block; }

/* ──────────────────────────────────────────────────
   APP WRAPPER
────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ──────────────────────────────────────────────────
   SIDEBAR OVERLAY (mobile)
────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 299;
}
.sidebar-overlay.visible { display: block; }

/* ──────────────────────────────────────────────────
   SIDEBAR
────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease, min-width 0.25s ease;
  z-index: 300;
}
.sidebar.collapsed { width: 0; min-width: 0; }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-glyph {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--muz), var(--nad));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--bg); flex-shrink: 0;
}
.logo-name { font-family: var(--font-serif); font-size: 17px; letter-spacing: -0.3px; }
.logo-ver  { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

.brand-pill-group {
  display: flex; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-pill {
  flex: 1; padding: 6px 0;
  border-radius: 20px; border: 1px solid var(--border2);
  background: transparent; color: var(--text-dim);
  font-family: var(--font-mono); font-size: 11px;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 5px;
  transition: all 0.18s;
}
.brand-pill .pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-muz.active { background: var(--muz-dim); border-color: var(--muz); color: var(--muz); }
.pill-nad.active { background: var(--nad-dim); border-color: var(--nad); color: var(--nad); }
.pill-lsf.active { background: var(--lsf-dim); border-color: var(--lsf); color: var(--lsf); }
.brand-pill:not(.active):hover { background: var(--surface2); }

.nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-group-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 1.5px; color: var(--text-muted);
  padding: 4px 8px 6px; text-transform: uppercase;
}
.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 13px;
  cursor: pointer; transition: all 0.15s;
  margin-bottom: 1px; user-select: none;
  text-decoration: none;
}
.nav-link span:first-child { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--brand-dim); color: var(--brand); }
.nav-link-external { opacity: 0.6; }
.nav-link-external:hover { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10px;
  background: var(--surface3); color: var(--text-dim);
  padding: 1px 6px; border-radius: 10px;
  border: 1px solid var(--border2);
  min-width: 20px; text-align: center;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  flex-shrink: 0;
}
.sidebar-status { margin-bottom: 10px; }
.status-apis { display: flex; flex-direction: column; gap: 4px; }
.api-indicator {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
}
.ind-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-off  { background: var(--border2); }
.dot-on   { background: var(--green); box-shadow: 0 0 6px var(--green); animation: blink 3s infinite; }
.dot-err  { background: var(--red); }
@keyframes blink { 0%,100%{opacity:1} 60%{opacity:0.5} }

.btn-logout {
  width: 100%; padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 11px;
  cursor: pointer; transition: all 0.15s;
  text-align: left;
}
.btn-logout:hover {
  color: var(--red); border-color: var(--red);
  background: var(--red-dim);
}

/* ──────────────────────────────────────────────────
   MAIN WRAP
────────────────────────────────────────────────── */
.main-wrap {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

/* ──────────────────────────────────────────────────
   TOPBAR
────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 20px; gap: 16px;
  flex-shrink: 0;
}
.topbar-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.hamburger {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 6px;
  transition: color 0.15s; line-height: 1;
  min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.hamburger:hover { color: var(--text); }

.topbar-brand {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500;
}
.tb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-muz { background: var(--muz); }
.dot-nad { background: var(--nad); }
.dot-lsf { background: var(--lsf); }

.breadcrumb { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.progress-bar { width: 100px; height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 2px; width: 0%; transition: width 0.3s; }

.top-action-btn {
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border2); background: var(--surface2);
  color: var(--text-dim); font-family: var(--font-sans); font-size: 12px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  min-height: 34px;
}
.top-action-btn:hover { color: var(--text); }
.top-action-btn.accent {
  background: var(--brand-dim); color: var(--brand);
  border-color: var(--brand-border);
}

/* ──────────────────────────────────────────────────
   VIEWS
────────────────────────────────────────────────── */
.views-wrap { flex: 1; overflow: hidden; position: relative; }
.view { position: absolute; inset: 0; display: none; overflow: hidden; }
.view.active { display: flex; flex-direction: column; }

.view-inner { flex: 1; overflow-y: auto; padding: 24px; }
.view-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.view-head h2 {
  font-family: var(--font-serif);
  font-size: 24px; font-weight: 400;
  letter-spacing: -0.3px;
}

/* ──────────────────────────────────────────────────
   COMPOSE LAYOUT
────────────────────────────────────────────────── */
.compose-layout {
  display: flex; height: 100%; overflow: hidden;
}

.compose-form {
  width: 320px; min-width: 320px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.form-scroll { flex: 1; overflow-y: auto; padding: 16px; }

.form-section-head {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px; margin-top: 4px;
}

.form-divider {
  height: 1px; background: var(--border);
  margin: 14px 0;
}

/* Generate all button — hero action */
.btn-generate-all {
  width: 100%; margin: 8px 0 4px;
  padding: 12px 14px;
  font-size: 14px !important;
  letter-spacing: -0.2px;
}
.generate-hint {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-muted); text-align: center;
  margin-bottom: 4px; letter-spacing: 0.3px;
}

/* Required field marker */
.field-required .field-hint,
.required-star { color: var(--brand); font-weight: 600; }
.field-optional {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-muted); font-weight: 400;
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* Fields */
.field { margin-bottom: 10px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 1px; color: var(--text-muted);
  margin-bottom: 4px; text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-sans); font-size: 13px;
  outline: none; transition: border-color 0.15s;
  -webkit-appearance: none;
  min-height: 36px;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a5070' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 26px; cursor: pointer;
}
.field select option { background: var(--surface2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.field textarea { resize: vertical; line-height: 1.5; min-height: 68px; }
.field-hint { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.engine-hint {
  font-family: var(--font-mono); font-size: 10px; margin-top: 5px;
  min-height: 0; transition: opacity 0.2s;
}
.engine-hint:empty { display: none; }
.engine-hint.hint-openai { color: #74c0fc; }
.engine-hint.hint-claude  { color: var(--lsf); }

.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; min-width: 0; }

.badge-mono {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--surface2); color: var(--text-muted);
  padding: 1px 6px; border-radius: 10px;
  border: 1px solid var(--border2);
  transition: color 0.15s;
}

/* Midjourney prompt button */
.mj-btn-row { margin-top: 5px; }
.btn-copy-mj {
  width: 100%; padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(63,81,181,0.35);
  border-radius: var(--radius-sm);
  color: #7986cb;
  font-family: var(--font-mono); font-size: 10px;
  cursor: pointer; transition: all 0.18s; text-align: left;
}
.btn-copy-mj:hover {
  background: rgba(26,35,126,0.18);
  border-color: #5c6bc0; color: #9fa8da;
}
.btn-copy-mj:disabled { opacity: 0.4; cursor: not-allowed; }

/* Variante OpenAI (verde esmeralda) */
.btn-gen-openai {
  margin-top: 4px;
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.btn-gen-openai:hover {
  background: rgba(6, 95, 70, 0.18);
  border-color: #10b981;
  color: #6ee7b7;
}

/* Selector de tamaño/calidad para OpenAI */
.openai-img-options {
  display: flex; gap: 8px; margin-top: 6px;
}
.openai-img-options label {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-secondary);
  display: flex; flex-direction: column; gap: 2px;
}
.openai-img-options select {
  padding: 4px 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
}

/* Featured image upload */
.image-upload-area {
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden; transition: border-color 0.18s;
}
.image-upload-area:hover { border-color: var(--border3); }
.upload-placeholder {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 11px;
  transition: background 0.18s;
}
.upload-placeholder:hover { background: var(--surface2); color: var(--text-dim); }
.upload-icon { font-size: 16px; }
.upload-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
}
.upload-preview-img { max-height: 56px; border-radius: 4px; flex-shrink: 0; }
#upload-preview-img { max-height: 56px; border-radius: 4px; flex-shrink: 0; }
.upload-preview-info {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upload-clear-btn {
  padding: 4px 8px; background: transparent;
  border: 1px solid var(--border2); border-radius: 4px;
  color: var(--text-muted); font-size: 11px;
  cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.upload-clear-btn:hover { color: var(--red); border-color: var(--red); background: var(--red-dim); }

/* Auto-completar SEO */
.seo-autofill-row { margin: 2px 0 10px; }
.btn-autofill {
  width: 100%; padding: 7px 11px;
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.3px; cursor: pointer; transition: all 0.18s;
}
.btn-autofill:hover {
  border-color: var(--brand-border);
  color: var(--brand); background: var(--brand-dim);
}
.btn-autofill:disabled { opacity: 0.5; cursor: not-allowed; }

/* Action stack */
.action-stack { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; padding-bottom: 24px; }

.btn-main {
  width: 100%; padding: 10px 14px;
  background: var(--brand); color: var(--bg);
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: filter 0.18s, transform 0.12s;
  min-height: 40px;
}
.btn-main:hover { filter: brightness(1.1); }
.btn-main:active { transform: scale(0.98); }
.btn-main:disabled { opacity: 0.5; cursor: not-allowed; filter: none; transform: none; }
.btn-glyph { font-size: 15px; flex-shrink: 0; }

.btn-social {
  background: var(--purple) !important;
  color: #fff !important;
}

.btn-row { display: flex; gap: 6px; }
.btn-sec {
  flex: 1; padding: 8px 6px;
  background: var(--surface2); color: var(--text-dim);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 11px;
  cursor: pointer; transition: all 0.15s; text-align: center;
  min-height: 36px;
}
.btn-sec:hover { color: var(--text); background: var(--surface3); }
.btn-sec:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  width: 100%; padding: 7px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 12px;
  cursor: pointer; transition: all 0.15s; min-height: 36px;
}
.btn-ghost:hover { color: var(--red); border-color: var(--red); background: var(--red-dim); }

/* ──────────────────────────────────────────────────
   EDITOR PANEL
────────────────────────────────────────────────── */
.compose-editor {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

.editor-tabs {
  display: flex; align-items: center;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 16px; flex-shrink: 0; overflow-x: auto;
}
.etab {
  padding: 13px 12px; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all 0.15s; white-space: nowrap; flex-shrink: 0;
}
.etab:hover { color: var(--text); }
.etab.active { color: var(--text); border-bottom-color: var(--brand); }
.etab-count {
  display: inline-block; padding: 1px 5px;
  background: var(--surface2); border-radius: 10px;
  font-size: 9px; margin-left: 5px; color: var(--text-dim);
}
.etab-actions { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }
.etab-btn {
  padding: 4px 8px; background: none; border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-muted); font-size: 11px;
  cursor: pointer; transition: all 0.15s; min-height: 30px;
}
.etab-btn:hover { color: var(--text); background: var(--surface2); }

.epane { display: none; flex: 1; flex-direction: column; padding: 14px 16px; overflow: hidden; }
.epane.active { display: flex; }
.epane-meta {
  display: flex; gap: 16px; align-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  margin-bottom: 8px; flex-shrink: 0;
}
.epane-meta b { color: var(--text-dim); }

.article-ta {
  flex: 1; width: 100%;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-sans); font-size: 14px; line-height: 1.75;
  padding: 16px 18px; resize: none; outline: none;
  transition: border-color 0.15s;
}
.article-ta:focus { border-color: var(--brand-border); box-shadow: 0 0 0 3px var(--brand-dim); }
.article-ta::placeholder { color: var(--text-muted); font-style: italic; }

.social-warn { color: var(--red); font-size: 11px; }
.social-format-hint {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-muted); margin-bottom: 8px; flex-shrink: 0;
  background: var(--surface2); padding: 5px 9px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.social-link-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 11px;
}
.social-link-label { color: var(--text-muted); }
.social-link-url {
  color: var(--green); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.social-link-url:hover { text-decoration: underline; }

/* ──────────────────────────────────────────────────
   YOAST SEO PANEL
────────────────────────────────────────────────── */
.yoast-panel { display: flex; flex-direction: column; gap: 16px; height: 100%; overflow-y: auto; }
.yoast-top { display: flex; gap: 20px; flex-shrink: 0; }
.yoast-score-ring { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--surface2); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--green); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.5s, stroke 0.3s; }
.ring-score {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
}
.yoast-checks { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.yc-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.yc-item:last-child { border-bottom: none; }
.yc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--border2); }
.yc-dot.pass { background: var(--green); }
.yc-dot.fail { background: var(--red); }
.yc-label { flex: 1; }

.seo-preview-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; flex-shrink: 0;
}
.spb-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }
.spb-url   { font-size: 12px; color: var(--green); margin-bottom: 3px; }
.spb-title { font-size: 16px; color: #8ab4f8; margin-bottom: 4px; font-weight: 400; }
.spb-desc  { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ──────────────────────────────────────────────────
   BORRADORES / HISTORIAL
────────────────────────────────────────────────── */
.drafts-list, .history-list { display: flex; flex-direction: column; gap: 8px; }
.draft-card, .hist-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; transition: border-color 0.15s;
}
.draft-card:hover, .hist-card:hover { border-color: var(--border2); }
.hist-card { cursor: default; }
.draft-brand-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.draft-info { flex: 1; min-width: 0; }
.draft-title { font-size: 14px; color: var(--text); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.draft-actions { display: flex; gap: 6px; align-items: flex-start; flex-shrink: 0; }
.draft-act-btn {
  padding: 5px 10px; border-radius: 4px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text-muted); font-size: 11px; cursor: pointer;
  transition: all 0.15s; text-decoration: none; display: inline-flex;
  align-items: center; min-height: 30px;
}
.draft-act-btn:hover { color: var(--text); background: var(--surface2); }

.empty-state {
  padding: 40px 20px; text-align: center;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 12px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}

/* ──────────────────────────────────────────────────
   WORDPRESS / SETTINGS
────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.sc-head { font-family: var(--font-sans); font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.sc-sub  { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; word-break: break-all; }
.conn-status {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); margin-top: 8px;
  padding: 5px 8px; background: var(--bg2);
  border-radius: 4px; border: 1px solid var(--border);
}
.conn-status.ok  { color: var(--green); background: var(--green-dim); border-color: rgba(82,212,138,0.2); }
.conn-status.err { color: var(--red);   background: var(--red-dim);   border-color: rgba(224,86,104,0.2); }

/* SocialDesk */
.sd-channel-card { cursor: pointer; transition: border-color .15s; }
.sd-channel-card:hover { border-color: var(--border3); }
.sd-channel-card.sd-channel-active { border-color: var(--brand); }

/* SocialDesk — tabs principales (Publicar / Conexiones) */
.sd-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.sd-tab-btn {
  padding: 9px 16px; background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted); font-family: var(--font-sans);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.sd-tab-btn:hover { color: var(--text-dim); }
.sd-tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.sd-tab-content { display: none; }
.sd-tab-content.active { display: block; }

/* SocialDesk — preview de archivo */
.sd-file-preview {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
}
.sd-file-preview img {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 4px; flex-shrink: 0;
}
.sd-file-icon { font-size: 26px; flex-shrink: 0; }
.sd-file-meta { flex: 1; min-width: 0; }
.sd-file-name {
  font-size: 12px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* SocialDesk — selector de redes */
.sd-network-toggles {
  display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap;
}
.sd-network-btn {
  position: relative; flex: 1; min-width: 130px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border2); background: var(--surface2);
  color: var(--text-dim); font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; transition: all 0.15s;
}
.sd-network-btn:hover:not(.disabled) { border-color: var(--border3); color: var(--text); }
.sd-network-btn.active {
  background: var(--brand-dim); border-color: var(--brand); color: var(--brand);
}
.sd-network-btn.disabled,
.sd-network-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sd-net-icon { font-size: 15px; }
.sd-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--red); box-shadow: 0 0 5px rgba(224,86,104,0.5);
}
.sd-dot.connected { background: var(--green); box-shadow: 0 0 5px rgba(82,212,138,0.5); }

/* SocialDesk — acordeón por red */
.sd-accordion { display: flex; flex-direction: column; gap: 8px; }
.sd-accordion-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  max-height: 0; opacity: 0; transition: max-height 0.25s ease, opacity 0.2s ease;
}
.sd-accordion-panel.open { max-height: none; opacity: 1; }
.sd-accordion-panel:not(.open) .sd-accordion-body { display: none; }
.sd-accordion-head {
  font-family: var(--font-sans); font-weight: 600; font-size: 13px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.sd-accordion-panel.disabled .sd-accordion-head { color: var(--text-muted); }
.sd-accordion-body { padding: 14px 16px; }
.sd-coming-soon {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  padding: 6px 0;
}

/* SocialDesk — resultados de publicación */
.sd-results { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.sd-result-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg2); border: 1px solid var(--border2);
}
.sd-result-row .sd-result-net { font-weight: 600; min-width: 70px; flex-shrink: 0; }
.sd-result-row .sd-result-msg { word-break: break-word; flex: 1; }
.sd-result-row .sd-result-msg a { color: inherit; text-decoration: underline; }
.sd-result-row.pending { color: var(--text-dim); }
.sd-result-row.success { background: var(--green-dim); border-color: rgba(82,212,138,0.25); color: var(--green); }
.sd-result-row.error   { background: var(--red-dim);   border-color: rgba(224,86,104,0.25);   color: var(--red); }

.sd-btn-publish.is-done { background: var(--green); }

.spinner-sm {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0;
}

/* SocialDesk — formulario de subida */
.sd-form-group { margin-bottom: 10px; }
.sd-form-group label {
  display: block; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 1px; color: var(--text-muted);
  margin-bottom: 4px; text-transform: uppercase;
}
.sd-form-group input[type="text"],
.sd-form-group input[type="file"],
.sd-form-group select,
.sd-form-group textarea {
  width: 100%; padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-sans); font-size: 13px;
  outline: none; transition: border-color 0.15s;
  -webkit-appearance: none; min-height: 36px;
}
.sd-form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a5070' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 26px; cursor: pointer;
}
.sd-form-group select option { background: var(--surface2); }
.sd-form-group textarea { resize: vertical; line-height: 1.5; min-height: 68px; }
.sd-form-group input:focus, .sd-form-group select:focus, .sd-form-group textarea:focus {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.sd-form-row { display: flex; gap: 8px; }
.sd-form-row .sd-form-group { flex: 1; min-width: 0; }

.sd-canal-selector { display: flex; gap: 8px; }
.sd-canal-toggle {
  flex: 1; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border2); background: var(--surface2);
  color: var(--text-dim); font-family: var(--font-sans); font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.sd-canal-toggle:hover:not(:disabled) { border-color: var(--border3); color: var(--text); }
.sd-canal-toggle.active {
  background: var(--brand-dim); border-color: var(--brand); color: var(--brand);
}
.sd-canal-toggle:disabled { opacity: 0.4; cursor: not-allowed; }

.sd-tags-container {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px 8px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  min-height: 36px;
}
.sd-tags-container:focus-within { border-color: var(--brand-border); box-shadow: 0 0 0 3px var(--brand-dim); }
.sd-tags-container input {
  flex: 1; min-width: 100px; background: none; border: none;
  outline: none; color: var(--text); font-family: var(--font-sans); font-size: 13px;
}
.sd-tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text-dim); font-family: var(--font-mono); font-size: 11px;
  white-space: nowrap;
}
.sd-tag-chip button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0;
}
.sd-tag-chip button:hover { color: var(--red); }

.sd-progress-bar {
  width: 100%; height: 6px; background: var(--border2);
  border-radius: 3px; overflow: hidden; margin-top: 10px;
}
#sd-progress-fill { height: 100%; background: var(--brand); border-radius: 3px; width: 0%; transition: width 0.2s; }
#sd-progress-label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); margin-top: 4px;
}

.recent-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }
.recent-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.recent-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.recent-title { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

/* ──────────────────────────────────────────────────
   TOASTS
────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: calc(100vw - 40px);
}
.toast {
  padding: 10px 14px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px;
  animation: toastIn 0.2s ease; pointer-events: auto;
  display: flex; align-items: flex-start; gap: 8px;
  max-width: 360px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  transition: opacity 0.2s, transform 0.2s;
  word-break: break-word;
}
.toast-success { background: var(--green-dim); border: 1px solid rgba(82,212,138,0.3); color: var(--green); }
.toast-error   { background: var(--red-dim);   border: 1px solid rgba(224,86,104,0.3); color: var(--red); }
.toast-info    { background: var(--nad-dim);    border: 1px solid var(--nad-border);    color: var(--nad); }
.toast-warn    { background: rgba(240,180,41,0.12); border: 1px solid rgba(240,180,41,0.3); color: var(--amber); }
@keyframes toastIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

@keyframes spin { to { transform: rotate(360deg); } }

/* ──────────────────────────────────────────────────
   RESPONSIVE — TABLET  ≤ 960px
────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .compose-form { width: 280px; min-width: 280px; }
  .two-col { grid-template-columns: 1fr; }
  .sd-network-btn { min-width: 45%; }
}

/* ──────────────────────────────────────────────────
   RESPONSIVE — MOBILE  ≤ 768px
────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 14px; }

  /* Sidebar: overlay fijo, oculto por defecto */
  .sidebar {
    position: fixed;
    top: 0; left: 0; height: 100%;
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 32px rgba(0,0,0,0.6);
    z-index: 300;
  }
  /* Neutralizar la clase collapsed en móvil */
  .sidebar.collapsed {
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Compose: una sola columna, scroll vertical */
  .compose-layout {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }
  .compose-form {
    width: 100% !important;
    min-width: unset !important;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    flex-shrink: 0;
  }
  .form-scroll { overflow: visible; }

  .compose-editor {
    flex: none;
    height: 520px;
    border-top: 1px solid var(--border);
  }

  /* Campos de formulario: táctiles */
  .field input,
  .field select,
  .field textarea {
    min-height: 44px;
    font-size: 15px;
    padding: 10px 12px;
  }
  .field textarea { min-height: 80px; }
  .field label { font-size: 10px; letter-spacing: 0.8px; }

  /* Botones: ancho completo y táctiles */
  .btn-row { flex-direction: column; }
  .btn-sec  { width: 100%; min-height: 44px; font-size: 13px; }
  .btn-main { min-height: 48px; font-size: 14px; }
  .btn-ghost { min-height: 44px; }
  .btn-generate-all { min-height: 52px; font-size: 15px !important; }
  .btn-logout { min-height: 40px; }
  .btn-autofill { min-height: 40px; font-size: 11px; }
  .top-action-btn { min-height: 36px; padding: 6px 10px; font-size: 11px; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 10px; }
  .breadcrumb { display: none; }
  .progress-bar { width: 80px; }

  /* Editor tabs */
  .editor-tabs { padding: 0 8px; }
  .etab { padding: 12px 10px; font-size: 11px; }

  /* Article textarea */
  .article-ta { font-size: 15px; padding: 14px; }

  /* Views */
  .view-inner { padding: 16px; }
  .view-head h2 { font-size: 20px; }

  /* Drafts / History cards */
  .draft-card, .hist-card { padding: 12px 14px; }

  /* Settings */
  .settings-card { padding: 14px; }

  /* Toast */
  .toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { max-width: 100%; font-size: 13px; }

  /* Login box */
  .login-box { padding: 28px 20px; }
}

/* ──────────────────────────────────────────────────
   VIDEODESK
────────────────────────────────────────────────── */
.videodesk-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.videodesk-form-card .field { margin-top: 0; }

/* State panels */
.vd-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 0; }

.vd-idle-icon  { font-size: 36px; opacity: .25; margin-bottom: 10px; }
.vd-idle-text  { font-size: 13px; color: var(--text-muted); }

.vd-working-label {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 14px; text-align: center;
}
.vd-progress-steps { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.vd-step           { font-size: 12px; font-family: var(--font-mono); color: var(--text); transition: color .2s; }
.vd-step-pending   { color: var(--text-muted); }
.vd-step-done      { color: var(--green); }

.vd-done-wide  { align-items: stretch; text-align: left; width: 100%; }
.vd-done-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.vd-done-icon  { font-size: 32px; color: var(--green); flex-shrink: 0; }
.vd-done-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.vd-done-sub   { font-size: 12px; color: var(--text-muted); }

.vd-script-ta {
  width: 100%; height: 220px;
  background: #0a0c11; color: #b8ffc8;
  border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.6;
  padding: 10px 12px; resize: vertical;
  box-sizing: border-box;
}
.vd-script-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.vd-run-hint {
  margin-top: 10px; font-size: 12px; color: var(--text-muted);
  background: #0a0c11; border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px; line-height: 1.6;
}
.vd-run-hint code {
  font-family: var(--font-mono); color: var(--green);
  background: #0d1a10; padding: 1px 5px; border-radius: 3px;
}

.vd-error-icon  { font-size: 36px; color: var(--red); margin-bottom: 8px; }
.vd-error-title { font-weight: 600; font-size: 14px; color: var(--red); margin-bottom: 6px; }
.vd-error-msg   { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); white-space: pre-wrap; word-break: break-word; text-align: left; max-height: 120px; overflow-y: auto; }

/* How it works */
.vd-how-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.vd-how-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-muted); }
.vd-how-num  {
  flex-shrink: 0; width: 22px; height: 22px;
  background: var(--brand); color: var(--bg);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .videodesk-layout { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────
   TOPICDESK
   ────────────────────────────────────────────────── */
.sc-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

.td-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.td-cat-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.td-cat-btn:hover {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.4);
}
.td-cat-btn.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(99,102,241,0.18));
  border-color: rgba(139,92,246,0.6);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(139,92,246,0.35) inset;
}

.td-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 0; }

.td-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  width: 100%;
}
.td-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: all 0.15s ease;
}
.td-card:hover {
  background: rgba(139,92,246,0.06);
  border-color: rgba(139,92,246,0.3);
  transform: translateY(-1px);
}
.td-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.td-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.td-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text-secondary);
}
.td-card-why {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}
.td-card-send { margin-top: auto; }

@media (max-width: 768px) {
  .td-categories { grid-template-columns: 1fr 1fr; }
  .td-grid { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────
   NEWSDESK
────────────────────────────────────────────────── */
.newsdesk-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ── Feed panel (izquierda) ── */
.nd-feed-panel {
  width: 50%;
  min-width: 300px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.nd-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}

.nd-brand-tabs {
  display: flex;
  gap: 5px;
}

.nd-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.nd-tab-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.nd-tab.active {
  background: var(--news-dim);
  border-color: var(--news-border);
  color: var(--news);
}
.nd-tab:not(.active):hover { background: var(--surface2); color: var(--text-dim); }

/* ── Lang filter row (solo Muzikali) ── */
.nd-lang-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.nd-lang-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: .05em;
  margin-right: 2px;
}

.nd-lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
}
.nd-lang-btn:hover { background: var(--surface2); color: var(--text-dim); }
.nd-lang-btn.active {
  background: var(--lsf-dim);
  border-color: var(--lsf-border);
  color: var(--lsf);
}

/* ── Badges de idioma en cada item ── */
.nd-lang-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.nd-lang-es {
  background: rgba(82, 212, 138, .14);
  color: var(--green);
  border: 1px solid rgba(82, 212, 138, .25);
}
.nd-lang-en {
  background: rgba(91, 156, 246, .12);
  color: var(--nad);
  border: 1px solid rgba(91, 156, 246, .22);
}

.nd-refresh-btn {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  min-height: 30px;
  flex-shrink: 0;
}
.nd-refresh-btn:hover { color: var(--news); border-color: var(--news-border); background: var(--news-dim); }
.nd-refresh-btn.spinning { animation: spin 0.7s linear infinite; }

.nd-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 32px 20px;
  text-align: center;
}

.nd-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* News item card */
.nd-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  transition: border-color 0.15s;
}
.nd-item:hover { border-color: var(--border2); }
.nd-item.nd-item-active { border-color: var(--news-border); background: var(--news-dim); }

.nd-item-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.nd-item-source {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--news);
  background: var(--news-dim);
  border: 1px solid var(--news-border);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.nd-item-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.nd-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 7px;
}
.nd-item-title a {
  color: inherit;
  text-decoration: none;
}
.nd-item-title a:hover { color: var(--news); }

.nd-item-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 9px;
}

.nd-gen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 12px;
  background: var(--news-dim);
  border: 1px solid var(--news-border);
  border-radius: var(--radius-sm);
  color: var(--news);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 34px;
}
.nd-gen-btn:hover { filter: brightness(1.15); }
.nd-gen-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

/* ── NewsDesk engine selector ── */
.nd-engine-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.nd-engine-select {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 8px;
  cursor: pointer;
  transition: border-color .2s;
}
.nd-engine-select:focus { outline: none; border-color: var(--brand); }
.nd-engine-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  transition: color .2s;
}
.nd-hint-claude  { color: var(--lsf); }
.nd-hint-openai  { color: #74c0fc; }

/* ── Content panel (derecha) ── */
.nd-content-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 0;
  background: var(--bg);
  min-width: 0;
}

.nd-cp-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.nd-cp-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nd-result-header {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}
.nd-result-header strong { color: var(--news); }
.nd-result-headline {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-top: 4px;
  line-height: 1.4;
}

/* Output block */
.nd-output-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nd-output-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nd-output-badge {
  font-size: 9px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--text-dim);
  font-weight: 400;
}
.nd-output-badge.over { color: var(--red); border-color: rgba(224,86,104,0.3); background: var(--red-dim); }

.nd-output-ta {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.65;
  padding: 10px 11px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  min-height: 72px;
}
.nd-output-ta:focus {
  border-color: var(--news-border);
  box-shadow: 0 0 0 3px var(--news-dim);
}

.nd-copy-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
  min-height: 28px;
}
.nd-copy-btn:hover { color: var(--text); background: var(--surface2); border-color: var(--border3); }

/* ── Trino actions row ── */
.nd-trino-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Selector formato thumbnail ── */
.nd-fmt-group {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.nd-fmt-btn {
  padding: 4px 9px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all .14s;
  line-height: 1;
  min-height: 28px;
}
.nd-fmt-btn + .nd-fmt-btn { border-left: 1px solid var(--border2); }
.nd-fmt-btn:hover { background: var(--surface2); color: var(--text-dim); }
.nd-fmt-btn.active {
  background: var(--lsf-dim);
  color: var(--lsf);
}

/* ── Thumbnail button ── */
.nd-thumb-btn {
  padding: 5px 12px;
  background: var(--lsf-dim);
  border: 1px solid var(--lsf-border);
  border-radius: var(--radius-sm);
  color: var(--lsf);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
  min-height: 28px;
}
.nd-thumb-btn:hover:not(:disabled) { background: rgba(45,212,191,.22); border-color: var(--lsf); }
.nd-thumb-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Thumbnail result ── */
.nd-thumb-result {
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding-top: 4px;
  border-top: 1px solid var(--border2);
}
.nd-thumb-img {
  width: 100%;
  max-width: 200px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  display: block;
}

/* ── Collapsible output block (Reel) ── */
.nd-output-collapsible {
  padding: 0;
  gap: 0;
}
.nd-output-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 13px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.nd-output-toggle:hover { background: var(--surface2); border-radius: var(--radius); }
.nd-output-label-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.nd-toggle-chevron {
  font-size: 16px;
  color: var(--text-muted);
  transition: transform 0.2s;
  display: inline-block;
  line-height: 1;
}
.nd-toggle-chevron.open { transform: rotate(90deg); }
.nd-output-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 13px 12px;
}

.nd-audio-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.nd-audio-btn {
  padding: 5px 13px;
  background: var(--news-dim);
  border: 1px solid var(--news-border);
  border-radius: var(--radius-sm);
  color: var(--news);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 28px;
}
.nd-audio-btn:hover { filter: brightness(1.2); }
.nd-audio-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.nd-audio-player {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.nd-audio-player audio {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-sm);
  accent-color: var(--news);
}

/* Manual news form */
.nd-manual-form {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}
.nd-manual-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--news);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nd-manual-label::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--news);
}
.nd-manual-form .field input,
.nd-manual-form .field textarea {
  font-size: 12px;
  min-height: 32px;
}
.nd-manual-form .field textarea { min-height: 52px; }
.nd-manual-form .field label {
  font-size: 8px;
  letter-spacing: 1px;
}

/* Image context zone */
.nd-img-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1.5px dashed var(--news-border);
  border-radius: var(--radius);
  background: var(--news-dim);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s, background .15s;
}
.nd-img-zone:hover,
.nd-img-zone:focus {
  border-color: var(--news);
  background: rgba(245,166,35,0.18);
}
.nd-img-zone.nd-img-loaded {
  border-style: solid;
  border-color: var(--news);
  background: rgba(245,166,35,0.08);
}
.nd-img-clear-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.nd-img-clear-btn:hover { background: rgba(255,80,80,0.25); color: #ff5050; }

@media (max-width: 960px) {
  .newsdesk-layout { flex-direction: column; }
  .nd-feed-panel {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 48vh;
  }
}

@media (max-width: 768px) {
  .nd-feed-panel { max-height: 42vh; }
  .nd-brand-tabs { flex-direction: column; gap: 4px; }
  .nd-tab { font-size: 12px; padding: 7px 12px; }
}

/* ──────────────────────────────────────────────────
   RESPONSIVE — SMALL MOBILE  ≤ 400px
────────────────────────────────────────────────── */
@media (max-width: 400px) {
  :root { --sidebar-w: 100vw; }
  .topbar-right .top-action-btn:first-child { display: none; } /* ocultar "💾 Borrador" en topbar */
}

/* ──────────────────────────────────────────────────
   PLAYDESK
────────────────────────────────────────────────── */
.playdesk-layout {
  display: grid;
  grid-template-columns: 280px 1fr 240px;
  gap: 12px;
  height: calc(100vh - var(--topbar-h) - 32px);
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.pd-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pd-panel-title {
  font-family: 'Instrument Serif', serif;
  font-size: 15px;
  color: var(--text);
  letter-spacing: .01em;
}

.pd-panel-body {
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
}

/* ── Curación ── */
.pd-curation-ta {
  width: 100%;
  height: 140px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  padding: 10px 12px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}
.pd-curation-ta:focus { border-color: var(--muz); }
.pd-curation-ta::placeholder { color: var(--text-muted); }

.pd-results { margin-top: 14px; }
.pd-results-head {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pd-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.pd-result-item:last-child { border-bottom: none; }

.pd-result-icon { font-size: 14px; flex-shrink: 0; }
.pd-result-detail { flex: 1; min-width: 0; }
.pd-result-track  { display: block; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-result-artist { display: block; font-size: 11px; color: var(--text-muted); }

/* ── Playlist ── */
.pd-playlist-info { display: flex; flex-direction: column; gap: 2px; }
.pd-track-count   { font-size: 11px; color: var(--text-muted); }

.pd-audit-btn {
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pd-audit-btn:hover { border-color: var(--muz); color: var(--muz); }
.pd-audit-btn.pd-audit-active { border-color: var(--amber); color: var(--amber); }

/* ── Botón charts (cron manual) ── */
.pd-charts-btn {
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.pd-charts-btn:hover { border-color: #1DB954; color: #1DB954; }
.pd-charts-btn:disabled { opacity: .4; cursor: not-allowed; }
.pd-clearcharts-btn {
  width: 100%; padding: 7px 12px; margin-top: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  border: 1px solid rgba(224,86,104,.4); border-radius: var(--radius-sm);
  background: rgba(224,86,104,.07); color: var(--red);
  cursor: pointer; transition: background .2s, border-color .2s; text-align: left;
}
.pd-clearcharts-btn:hover { background: rgba(224,86,104,.15); border-color: var(--red); }
.pd-clearcharts-btn:disabled { opacity: .5; cursor: not-allowed; }
.pd-dedup-btn {
  width: 100%; padding: 7px 12px; margin-top: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  cursor: pointer; transition: border-color .2s, color .2s; text-align: left;
}
.pd-dedup-btn:hover { border-color: var(--text-muted); color: var(--text); }
.pd-dedup-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Tag AUTO en log ── */
.pd-log-auto { font-size: 9px; font-family: var(--font-mono); color: var(--muz); opacity: .7; margin-left: 4px; vertical-align: middle; }

/* ── Botón conectar Spotify ── */
.pd-connect-btn {
  display: inline-block;
  padding: 9px 22px;
  background: #1DB954;
  border-radius: 20px;
  color: #000;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.pd-connect-btn:hover { opacity: .88; transform: translateY(-1px); }

/* ── Botón desconectar Spotify ── */
.pd-disconnect-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .03em;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s, border-color .15s, color .15s;
  text-align: center;
}
.pd-disconnect-btn:hover {
  opacity: 1;
  border-color: var(--red);
  color: var(--red);
}

.pd-tracks-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 14px;
}

.pd-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.pd-track:last-child { border-bottom: none; }
.pd-track-audit { background: rgba(245,158,11,.07); border-radius: 4px; padding: 8px 6px; }

.pd-track-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pd-track-name   { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-track-artist { font-size: 11px; color: var(--text-muted); }

/* ── Popularity badge ── */
.pd-pop-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-left: 8px;
  font-weight: 600;
}
.pd-pop-green { background: rgba(34,197,94,.18); color: #4ade80; }
.pd-pop-amber { background: rgba(245,158,11,.18); color: #fbbf24; }
.pd-pop-red   { background: rgba(239,68,68,.18);  color: #f87171; }

/* ── Log ── */
.pd-log-panel .pd-log-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 14px;
}

.pd-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.pd-log-entry:last-child { border-bottom: none; }
.pd-log-icon   { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.pd-log-detail { flex: 1; min-width: 0; }
.pd-log-track  { display: block; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-log-artist { display: block; font-size: 11px; color: var(--text-muted); }
.pd-log-time   { font-size: 10px; color: var(--text-muted); flex-shrink: 0; font-family: 'Geist Mono', monospace; }

/* ── Drag-and-drop reorder ── */
.pd-drag-handle {
  font-size: 14px;
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
  user-select: none;
  padding: 0 4px 0 0;
  line-height: 1;
}
.pd-track:hover .pd-drag-handle { opacity: .6; }
.pd-track { cursor: default; }
.pd-dragging {
  opacity: .4;
  background: rgba(212,169,106,.06) !important;
}
.pd-drag-over {
  border-top: 2px solid var(--muz) !important;
}
.pd-reorder-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  border: 1px solid var(--muz);
  border-radius: 6px;
  background: rgba(212,169,106,.1);
  color: var(--muz);
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.pd-reorder-btn:hover { background: rgba(212,169,106,.2); }
.pd-reorder-btn:disabled { opacity: .5; cursor: not-allowed; }

.pd-empty, .pd-log-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 0;
  text-align: center;
}

/* ── PlayDesk Rebuild (Caballo de Troya) ── */
.pd-rebuild-trigger-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; font-size: 11px; font-family: var(--font-mono);
  border: 1px solid #1DB954; border-radius: 6px;
  background: rgba(29,185,84,.1); color: #1DB954;
  cursor: pointer; transition: background .2s; white-space: nowrap;
}
.pd-rebuild-trigger-btn:hover    { background: rgba(29,185,84,.2); }
.pd-rebuild-trigger-btn:disabled { opacity: .5; cursor: not-allowed; }

.pd-rebuild {
  display: flex; flex-direction: column;
  border: 1px solid rgba(29,185,84,.3); border-radius: 8px;
  background: rgba(29,185,84,.03); margin: 0 0 10px;
  overflow: hidden; flex-shrink: 0; max-height: 60%;
}
.pd-rebuild-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: rgba(29,185,84,.07);
  border-bottom: 1px solid rgba(29,185,84,.2); flex-shrink: 0;
}
.pd-rebuild-head-left  { display: flex; align-items: center; gap: 10px; }
.pd-rebuild-icon       { font-size: 18px; line-height: 1; }
.pd-rebuild-title      { font-size: 13px; font-weight: 600; color: #1DB954; }
.pd-rebuild-stats      { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); margin-top: 1px; }
.pd-rebuild-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; cursor: pointer; padding: 2px 4px; line-height: 1;
}
.pd-rebuild-close:hover { color: var(--text); }

.pd-rebuild-legend {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; font-size: 10px; font-family: var(--font-mono);
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pd-rebuild-dot     { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.pd-dot-chart       { background: rgba(255,255,255,.25); }
.pd-dot-label       { background: var(--muz); }

.pd-rebuild-list    { overflow-y: auto; flex: 1; }
.pd-rebuild-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: 12px; transition: background .12s;
}
.pd-rebuild-row:hover        { background: rgba(255,255,255,.03); }
.pd-rebuild-row-label        { background: rgba(212,169,106,.06); }
.pd-rebuild-row-label:hover  { background: rgba(212,169,106,.1); }
.pd-rebuild-chk { flex-shrink: 0; accent-color: #1DB954; width: 14px; height: 14px; cursor: pointer; }
.pd-rebuild-pos              { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); min-width: 22px; text-align: right; flex-shrink: 0; display:none; }
.pd-dot-label-inline         { color: var(--muz); font-size: 10px; flex-shrink: 0; }
.pd-dot-chart-inline         { color: var(--text-muted); font-size: 16px; line-height: 0; flex-shrink: 0; opacity: .3; }
.pd-rebuild-info             { flex: 1; min-width: 0; }
.pd-rebuild-name             { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pd-rebuild-artist           { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-rebuild-src              { font-size: 10px; opacity: .6; font-style: normal; }

.pd-rebuild-footer {
  display: flex; gap: 8px; padding: 8px 12px;
  border-top: 1px solid rgba(29,185,84,.2);
  background: rgba(0,0,0,.15); flex-shrink: 0;
}
.pd-rebuild-apply-btn { flex: 1; padding: 8px 12px; font-size: 12px; background: #1DB954 !important; border-color: #1DB954 !important; color: #000 !important; font-weight: 700; }
.pd-rebuild-apply-btn:hover { background: #17a349 !important; }

/* ── PlayDesk Candidates Panel ── */
.pd-candidates {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(212,169,106,.04);
  margin: 0 0 10px;
  overflow: hidden;
  flex-shrink: 0;
  max-height: 55%;
}
.pd-cand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(212,169,106,.08);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muz);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pd-cand-all-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
}
.pd-cand-list {
  overflow-y: auto;
  flex: 1;
}
.pd-cand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
.pd-cand-row:hover { background: rgba(255,255,255,.03); }
.pd-cand-row.pd-cand-dup { opacity: .45; }
.pd-cand-chk { flex-shrink: 0; accent-color: var(--muz); width: 14px; height: 14px; cursor: pointer; }
.pd-cand-img {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
}
.pd-cand-noimg { width: 38px; height: 38px; border-radius: 4px; background: rgba(255,255,255,.06); flex-shrink:0; }
.pd-cand-info  { flex: 1; min-width: 0; }
.pd-cand-name  { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-cand-artist { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-cand-meta  { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.pd-cand-pop   { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.pd-cand-badge { font-size: 9px; color: var(--muz); font-family: var(--font-mono); }
.pd-cand-footer {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.15);
  flex-shrink: 0;
}
.pd-cand-add-btn { flex: 1; padding: 8px 12px; font-size: 12px; }
.pd-cand-cancel-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color .2s, color .2s;
}
.pd-cand-cancel-btn:hover { border-color: var(--text-muted); color: var(--text); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .playdesk-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    height: auto;
    overflow: visible;
  }
  .pd-log-panel { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .playdesk-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .pd-log-panel { grid-column: auto; }
}
