/* Vista Ajustes (prefijo st-). Solo variables de tokens.css. */

.st-notice { margin-bottom: var(--s5); }

/* ── Estructura: índice lateral + panel ── */
.st-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s8); align-items: start; }
.st-panels { min-width: 0; }
.st-panel { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; outline: none; }
.st-panel-head h2 { font-size: var(--fs-xl); }
.st-panel-head p { margin-top: var(--s1); color: var(--text-2); font-size: var(--fs-sm); max-width: 62ch; }
.st-subtitle { font-size: var(--fs-md); font-weight: 650; color: var(--text); }

/* Índice: RP.ui.tabs en vertical en escritorio */
.st-nav.tabs { position: sticky; top: var(--s6); flex-direction: column; gap: 2px; margin: 0; border-bottom: 0; overflow: visible; }
.st-nav.tabs button { justify-content: flex-start; gap: var(--s3); min-height: 38px; margin: 0; padding: 0 var(--s3);
  border: 0; border-radius: var(--r-sm); text-align: left; font-size: var(--fs-md); }
.st-nav.tabs button:hover { background: var(--surface-2); }
.st-nav.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.st-nav.tabs button[aria-selected="true"] .icon { color: var(--accent); }
.st-tab-dot { flex: none; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

@media (max-width: 900px) {
  .st-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .st-nav.tabs { position: sticky; top: var(--topbar-h); z-index: 5; flex-direction: row; gap: var(--s1); overflow-x: auto;
    margin: 0 calc(-1 * var(--s4)) var(--s5); padding: 0 var(--s4); background: var(--bg); border-bottom: 1px solid var(--border); }
  .st-nav.tabs button { flex: none; min-height: 44px; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; gap: 6px; }
  .st-nav.tabs button:hover { background: transparent; }
  .st-nav.tabs button[aria-selected="true"] { background: transparent; border-bottom-color: var(--accent); }
  .st-tab-dot { margin-left: 2px; width: 7px; height: 7px; }
}

/* ── Tarjetas ── */
.st-card-title { display: flex; align-items: flex-start; gap: var(--s3); min-width: 0; }
.st-card-title h3 { font-size: var(--fs-lg); }
.st-card-title p { margin-top: 2px; max-width: 60ch; }
.st-card-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: var(--r);
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
@media (max-width: 560px) {
  .st-card-head { flex-direction: column; align-items: stretch; }
  .st-card-icon { display: none; }
}
.st-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 720px) { .st-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.st-fold { background: var(--surface-2); }
.st-fold > summary { font-size: var(--fs-sm); }
.st-text-danger { color: var(--danger); }

/* ── Barra de guardado ── */
.st-savebar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s3) var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: transparent; }
.st-savebar-text { display: flex; align-items: center; gap: var(--s2); color: var(--text-3); font-size: var(--fs-sm); }
.st-savebar.is-dirty { position: sticky; bottom: var(--s4); z-index: 6; border-style: solid;
  border-color: color-mix(in srgb, var(--warning) 50%, var(--border-strong)); background: var(--surface); box-shadow: var(--shadow-lg); }
.st-savebar.is-dirty .st-savebar-text { color: var(--text); font-weight: 600; }
.st-savebar.is-dirty .st-savebar-text .icon { color: var(--warning); }
@media (max-width: 900px) { .st-savebar.is-dirty { bottom: calc(68px + env(safe-area-inset-bottom)); } }
@media (max-width: 480px) {
  .st-savebar .btn-group { width: 100%; }
  .st-savebar .btn-group > .btn { flex: 1; }
}

/* ── Elección por tarjetas (forma de conectar, rol) ── */
.st-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); }
.st-choice { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4); border: 1px solid var(--border-strong);
  border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color 0.15s var(--ease), background 0.15s var(--ease); }
.st-choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.st-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.st-choice:has(input:focus-visible) { box-shadow: var(--focus); }
.st-choice input { margin-top: 3px; flex: none; }
.st-choice-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-choice-title { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-weight: 600; }

/* ── Cuentas de Instagram ── */
.st-acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s4); }
.st-acc { display: flex; flex-direction: column; min-width: 0; }
.st-acc.is-connected { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.st-acc-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4) var(--s5) 0; }
.st-acc-head .lang { margin-top: 2px; }
.st-acc-title { flex: 1; min-width: 0; }
.st-acc-title h3 { font-size: var(--fs-lg); }
.st-acc-body { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) var(--s5); flex: 1; }
.st-acc-who { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.st-acc-ig { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent-text); }
.st-acc-who-text { display: flex; flex-direction: column; min-width: 0; }
.st-acc-actions { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s5) var(--s4); }
.st-acc > .st-fold { margin: 0 var(--s5) var(--s4); }
.st-zernio-status { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4);
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.st-zernio-status .grow { min-width: 180px; }

/* ── Secretos ── */
.st-secret { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 38px;
  padding: 3px 4px 3px var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); background: var(--surface-2); }
.st-secret-val { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-sm); min-width: 0; }
.st-secret-edit { display: flex; gap: var(--s2); align-items: center; }
.st-secret-edit input { flex: 1; min-width: 0; }

/* ── Horas de publicación ── */
.st-slot-rows { display: flex; flex-direction: column; gap: var(--s5); }
.st-slot-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.st-slot-label { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-height: 38px; }
.st-slot-label .small { flex-basis: 100%; margin-top: -6px; }
.st-slot-editor { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.st-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.st-slot { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 3px 0 var(--s3); border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-slot > .icon { color: var(--text-3); }
.st-slot-x { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); }
.st-slot-x:hover { background: var(--danger-soft); color: var(--danger); }
.st-slots-empty { color: var(--text-3); font-size: var(--fs-sm); padding: var(--s2) 0; }
.st-slot-add { display: flex; gap: var(--s2); align-items: center; }
.st-slot-add input[type="time"] { width: 140px; flex: none; }
.st-switches { display: flex; flex-direction: column; gap: var(--s5); }
@media (max-width: 720px) {
  .st-slot-row { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .st-slot { height: 40px; }
  .st-slot-x { width: 36px; height: 36px; }
}

/* ── Avisos ── */
.st-steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: var(--s2); color: var(--text-2); font-size: var(--fs-sm); }

/* ── Equipo ── */
.st-users { border-radius: var(--r); }
.st-user { flex-wrap: wrap; }
.st-user-id { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; line-height: 1.3; }
.st-user-meta { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.st-roles { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s3) var(--s4); margin: 0; font-size: var(--fs-sm); }
.st-roles dd { margin: 0; color: var(--text-2); }
@media (max-width: 560px) { .st-roles { grid-template-columns: minmax(0, 1fr); gap: var(--s1); } .st-roles dd { margin-bottom: var(--s3); } }
.st-pass-row { display: flex; gap: var(--s2); align-items: center; }
.st-pass-row input { flex: 1; min-width: 0; font-family: var(--font-mono); }
.st-cred { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s2) var(--s4); align-items: center; margin: 0; font-size: var(--fs-sm); }
.st-cred dt { color: var(--text-3); }
.st-cred dd { margin: 0; min-width: 0; }
@media (max-width: 480px) { .st-cred { grid-template-columns: minmax(0, 1fr); } }

/* ── IA y generador ── */
.st-ai { display: flex; flex-direction: column; gap: var(--s4); }
.st-ai-head { display: flex; align-items: flex-start; gap: var(--s3); }
.st-ai-head p { margin-top: 2px; }
.st-ai-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r); background: var(--surface-2); color: var(--text-3); }
.st-tone-success { background: var(--ai-soft); color: var(--ai); }
.st-tone-warning { background: var(--warning-soft); color: var(--warning); }
.st-tone-danger { background: var(--danger-soft); color: var(--danger); }
.st-ai-kv { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.st-token-out { display: flex; flex-direction: column; gap: var(--s3); }
.st-kit-state { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.st-kit-progress { display: flex; align-items: center; gap: var(--s3); }
.st-kit-progress .progress { flex: 1; }
.st-kit-pct { min-width: 9ch; text-align: right; font-variant-numeric: tabular-nums; }
