/* Render Studio — login, account menu and admin panel */

/* ---------- Login ---------- */
html:has(body.auth-page) { background: var(--band); }
.auth-page { display: grid; place-items: center; min-height: 100%; padding: 24px 16px; background: var(--band); }
.auth-card { width: min(420px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 32px; box-shadow: none; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand div { display: flex; flex-direction: column; }
.auth-brand b { font-size: 17px; letter-spacing: .2px; }
.auth-form h1 { font-size: 20px; margin: 0 0 6px; }
.auth-form p { margin: 0 0 14px; line-height: 1.45; }
.auth-form label, .pw-form label, .adm-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.auth-form input, .pw-form input, .adm-form input, .adm-form select, .adm-form textarea, .adm-input {
  background: var(--bg); border: 1px solid var(--line2); border-radius: 4px; padding: 10px 12px; color: var(--text); font-size: 14px; }
.auth-form input:focus, .pw-form input:focus, .adm-form :is(input, select, textarea):focus, .adm-input:focus { outline: none; border-color: var(--accent); }
.auth-err { color: var(--danger); font-size: 13px; margin-top: 10px !important; }

/* ---------- Top bar account ---------- */
.usage-chip { display: inline-flex; align-items: center; gap: 4px; }
.usage-chip svg.ic { width: 14px; height: 14px; color: var(--muted); }
.usage-chip .sep { width: 1px; height: 12px; background: var(--line2); margin: 0 6px; }
.usage-chip.low { border-color: rgba(192,57,43,.55); color: #b3261e; }
a.icon-btn { text-decoration: none; }
.user-menu { position: relative; }
.user-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 13.5px; }
.user-pop { position: absolute; right: 0; top: 42px; width: 280px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 4px; box-shadow: 0 16px 40px rgba(0,0,0,0.17); padding: 8px; z-index: 50; }
.up-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); }
.up-usage { padding: 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.up-bar-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; color: var(--muted); }
.up-bar-top b { color: var(--text); font-weight: 600; }
.meter { height: 6px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.hot i { background: var(--danger); }
.up-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 4px; background: none; border: 0; color: var(--text); text-decoration: none; cursor: pointer; font-size: 13.5px; text-align: left; }
.up-item:hover { background: var(--bg3); }
.up-item svg.ic { width: 16px; height: 16px; color: var(--muted); }
.pw-form h3, .quota-dlg h3 { margin: 0 0 14px; }
.quota-dlg { text-align: center; width: min(420px, 94vw); }
.quota-dlg .dlg-actions { justify-content: center; }
.quota-ic { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; background: rgba(192,57,43,.12); color: var(--danger); }
@media (max-width: 640px) { .usage-chip { display: none; } }

/* ---------- Admin layout ---------- */
.adm { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.adm-side { background: var(--band); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 650; }
.adm-brand small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.adm-nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 4px; color: var(--muted); text-decoration: none; font-size: 13.5px; cursor: pointer; background: none; border: 0; width: 100%; text-align: left; }
.adm-nav:hover { background: var(--bg3); color: var(--text); }
.adm-nav.active { background: rgba(17,17,17,0.07); color: var(--accent2); }
.adm-nav svg.ic { width: 17px; height: 17px; }
.adm-nav .count { margin-left: auto; font-size: 11px; background: var(--bg3); border-radius: 4px; padding: 1px 7px; color: var(--muted); }
.adm-nav .count:empty { display: none; }
.adm-nav .count.warn { background: rgba(192,57,43,.18); color: #b3261e; }
.adm-side .spacer { flex: 1; }
.adm-main { padding: 22px 28px 60px; min-width: 0; }
.adm-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.adm-head h1 { margin: 0; font-size: 22px; flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; }
.adm-head .back { color: var(--muted); }
.adm-head select, .adm-input { padding: 7px 10px; font-size: 13px; }
.adm-sub { color: var(--muted); margin: -12px 0 18px; font-size: 13px; }
.adm-mobilebar { display: none; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; }
.kpi .lbl { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi .lbl svg.ic { width: 14px; height: 14px; }
.kpi .val { font-size: 23px; font-weight: 650; margin-top: 6px; letter-spacing: -.3px; }
.kpi .hint { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.kpi.good .val { color: var(--ok); }
.kpi.bad .val { color: var(--danger); }
.kpi.gold .val { color: var(--accent2); }

/* Cards & grids */
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 16px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 .muted { font-weight: 400; font-size: 12px; margin-left: auto; }

/* Tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--bg2); }
.card .tbl-wrap { border: 0; background: none; border-radius: 0; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--bg3); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .name { font-weight: 600; }
.tbl .sub { color: var(--muted); font-size: 12px; }
.tbl input.adm-input { width: 90px; padding: 6px 8px; }
.tbl input.adm-input.wide { width: 150px; }
.tbl .thumb { width: 54px; height: 36px; border-radius: 4px; object-fit: cover; background: var(--bg3); display: block; }
.use { min-width: 120px; }
.use .meter { margin-top: 4px; }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; border-radius: 4px; padding: 2px 9px; background: var(--bg3); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(108,195,138,.35); background: rgba(108,195,138,.08); }
.badge.bad { color: #b3261e; border-color: rgba(192,57,43,.4); background: rgba(192,57,43,.08); }
.badge.warn { color: #111; border-color: rgba(17,17,17,0.24); background: rgba(17,17,17,0.05); }
.badge.gold { color: var(--accent2); border-color: rgba(17,17,17,0.28); background: rgba(17,17,17,0.05); }

/* Buttons */
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { color: #b3261e; border-color: rgba(192,57,43,.45); }
.btn svg.ic { width: 15px; height: 15px; vertical-align: -3px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--bg3); border: 1px solid var(--line); border-radius: 4px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.chip.active { border-color: var(--accent); color: var(--accent2); background: rgba(17,17,17,0.06); }

/* Bars chart */
.chart { width: 100%; height: 220px; display: block; }
.chart .ax { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 12.5px; margin-bottom: 8px; }
.hbar .meter { grid-column: 1 / -1; height: 5px; }

/* Generations grid */
.gens { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gen { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.gen .media { aspect-ratio: 16/10; background: var(--bg3); display: grid; place-items: center; color: var(--muted); position: relative; }
.gen .media img, .gen .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gen .media .badge { position: absolute; top: 8px; left: 8px; background: rgba(15,15,16,.8); }
.gen .media .badge.r { left: auto; right: 8px; }
.gen .info { padding: 10px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.gen .info b { font-size: 12.5px; }
.gen .info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Detail header */
.detail-top { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; }
.detail-top .who { flex: 1; min-width: 220px; }
.detail-top .who h2 { margin: 0 0 4px; font-size: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notes { width: 100%; min-height: 60px; resize: vertical; }

/* Dialog forms */
.adm-form { width: min(460px, 94vw); }
.adm-form h3 { margin: 0 0 14px; }
.adm-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.cred { background: var(--bg); border: 1px dashed var(--line2); border-radius: 4px; padding: 14px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.7; word-break: break-all; margin: 10px 0; }

@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: fixed; inset: 0 30% 0 0; z-index: 60; transform: translateX(-105%); transition: transform .2s; height: 100%; box-shadow: 20px 0 40px rgba(0,0,0,0.17); }
  .adm.nav-open .adm-side { transform: none; }
  .adm-main { padding: 14px 16px 60px; }
  .adm-mobilebar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; z-index: 20; }
  .adm-head h1 { font-size: 19px; }
  .kpi .val { font-size: 20px; }
  .adm-form .two { grid-template-columns: 1fr; }
}
.adm-head select, .toolbar select, .adm-head input.adm-input, .toolbar input.adm-input { width: auto; min-width: 0; }
.adm-head > select { max-width: 220px; }

/* In-app account banner */
.acct-banner { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.acct-banner span { flex: 1; }
.acct-banner svg.ic { width: 16px; height: 16px; flex-shrink: 0; }
.acct-banner a.btn { text-decoration: none; }
.acct-banner.bad { background: rgba(192,57,43,.1); color: #f5b3ad; }
.acct-banner.warn { background: rgba(17,17,17,0.05); color: #ecd29b; }
.quota-dlg a.btn { text-decoration: none; }

/* Chart tooltips */
.chart-tip { position: fixed; z-index: 200; pointer-events: none; background: #fff; color: var(--text); border: 1px solid var(--line2); border-radius: 4px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(17,17,17,.10); font-size: 12.5px; min-width: 170px; max-width: 280px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.chart-tip.on { opacity: 1; transform: none; }
.tt-title { color: var(--text); font-weight: 600; font-size: 12px; margin-bottom: 8px; text-transform: capitalize; }
.tt-row { display: grid; grid-template-columns: 10px auto 1fr; align-items: center; gap: 8px; padding: 3px 0; }
.tt-row b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.tt-row span { color: var(--muted); }
.tt-key { width: 10px; height: 10px; border-radius: 2px; display: block; }
.tt-key.blank { background: transparent; }
.tt-note { color: var(--muted); font-size: 11.5px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.chart .band { fill: transparent; }
.chart .band.on { fill: rgba(0,0,0,.04); }
.chart .hit { cursor: default; outline: none; }
.tip-target { cursor: default; border-radius: 4px; outline: none; }
.hbar.tip-target:hover, .hbar.tip-target:focus-visible { background: rgba(0,0,0,.025); box-shadow: 0 0 0 5px rgba(0,0,0,0.04); }
.hbar.tip-target:hover .meter i, .hbar.tip-target:focus-visible .meter i { filter: brightness(1.15); }

/* MFA */
.mfa-qr { background: #fff; border-radius: 4px; padding: 8px; width: fit-content; margin: 8px auto 12px; }
.mfa-qr svg { display: block; width: 188px; height: 188px; }
.mfa-steps { padding-left: 18px; margin: 0 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.mfa-steps li { margin-bottom: 6px; }
.mfa-code { width: 100%; text-align: center; font-size: 26px !important; letter-spacing: 8px; font-family: ui-monospace, Menlo, monospace; padding: 12px !important; margin: 6px 0 10px; background: var(--bg); border: 1px solid var(--line2); border-radius: 4px; color: var(--text); }
.mfa-code:focus { outline: none; border-color: var(--accent); }
.mfa-manual { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.mfa-manual code { display: block; margin-top: 6px; font-size: 14px; color: var(--text); letter-spacing: 1px; word-break: break-all; }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.recovery-grid code { background: var(--bg); border: 1px dashed var(--line2); border-radius: 4px; padding: 8px; text-align: center; font-size: 15px; letter-spacing: 1px; }
.auth-form .check { flex-direction: row !important; align-items: center; gap: 8px; color: var(--text) !important; }

/* Proveedores y modelos */
.ai-keys { gap: 16px; align-items: stretch; }
.ai-card { display: flex; flex-direction: column; gap: 12px; }
.ai-card .adm-form label { margin-bottom: 0; }
.ai-card .adm-form { display: flex; flex-direction: column; gap: 12px; }
.ai-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.ai-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.ai-status.ok i { background: var(--ok); }
.ai-status.off { color: var(--danger); } .ai-status.off i { background: var(--danger); }
@media (max-width: 900px) { .ai-keys { grid-template-columns: 1fr; } }

.up-item .up-sub { display: block; font-size: 11.5px; margin-top: 1px; }

/* ---- Prompts */
.pr-intro p { margin: 0 0 8px; line-height: 1.5; }
.pr-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.pr-search { flex: 1 1 260px; min-width: 0; }
.pr-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.pr-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pr-group { padding: 0; }
.pr-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; user-select: none; }
.pr-group > summary::-webkit-details-marker { display: none; }
.pr-group > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.pr-group[open] > summary::before { transform: rotate(45deg); }
.pr-gname { font-weight: 600; font-size: 14px; }
.pr-body { border-top: 1px solid var(--line); }
.pr-item { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pr-item:last-child { border-bottom: 0; }
.pr-item.mod { background: var(--bg3); }
.pr-item.dirty .pr-text { border-color: var(--accent); }
.pr-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-key { margin-left: auto; font-size: 11.5px; color: var(--muted); background: var(--bg3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.pr-desc { line-height: 1.45; }
.pr-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pr-var { font-size: 12px; background: var(--bg); border: 1px dashed var(--line2); border-radius: 4px; padding: 1px 6px; }
.pr-text { width: 100%; box-sizing: border-box; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; min-height: 44px; }
.pr-warn { font-size: 12.5px; color: var(--danger); }
.pr-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-actions .grow { flex: 1; }
.pr-actions .btn:disabled { opacity: .45; cursor: default; }
.pr-orig summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.pr-orig pre { white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin: 6px 0 0; color: var(--muted); max-height: 320px; overflow: auto; }
.hidden { display: none !important; }

/* Usuarios: verificación en dos pasos */
.mfa-card { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mfa-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--bg3); display: grid; place-items: center; }
.mfa-ic svg.ic { width: 18px; height: 18px; margin: 0; }
.mfa-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mfa-txt .muted { margin: 0; line-height: 1.4; }
label.mfa-toggle { display: flex; flex-direction: row; align-items: center; gap: 9px; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; line-height: 1.3; }
label.mfa-toggle input { width: 16px; height: 16px; margin: 0; flex: none; }

/* ---- Soporte */
.sup-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 14px; flex-wrap: wrap; }
.sup-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13.5px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sup-tab svg.ic { width: 15px; height: 15px; }
.sup-tab:hover { color: var(--text); }
.sup-tab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.sup-tab .count { font-size: 11px; background: var(--bg3); border-radius: 4px; padding: 1px 7px; color: var(--muted); font-weight: 600; }
.sup-tab .count.warn { background: rgba(192,57,43,.14); color: #b3261e; }
.sup-warn { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; border-color: rgba(192,57,43,.35); }
.sup-warn svg.ic { color: #b3261e; flex: none; }
.sup-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sup-tools .adm-input { flex: 1 1 220px; min-width: 0; }
.sup-seg { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.sup-seg .chip { border: 1px solid var(--line2); background: var(--bg2); border-radius: 4px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.sup-seg .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sup-dotc { width: 14px; padding-right: 0 !important; }
.sup-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.sup-dot.on { background: #1f6fd1; }
.sup-subj b { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-subj .muted { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge.plan-r4, .badge.plan-r5 { background: #111; color: #fff; border-color: #111; }
.badge.plan-r3 { background: rgba(17,17,17,.08); color: #111; border-color: rgba(17,17,17,.3); font-weight: 600; }
.sup-back { display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.sup-back:hover { color: var(--text); }
.sup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .sup-grid { grid-template-columns: 1fr; } }
.sup-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.sup-msg { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; max-width: 88%; }
.sup-msg.admin { align-self: flex-end; background: #f6f5f1; }
.sup-msg.internal { background: #fbf5e2; border-style: dashed; }
.sup-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.sup-text { white-space: pre-wrap; line-height: 1.55; font-size: 14px; word-break: break-word; }
.sup-sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--bg3); border-radius: 4px; padding: 3px 10px; }
.sup-atts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 10px; }
.sup-att { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; min-width: 0; }
.sup-att img, .sup-att video { width: 100%; max-height: 220px; object-fit: contain; background: #ecebe7; border: 1px solid var(--line); border-radius: 4px; }
.sup-att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-att.file { flex-direction: row; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 4px; }
.sup-reply textarea { width: 100%; box-sizing: border-box; resize: vertical; margin-bottom: 10px; }
.sup-reply-opts { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
label.sup-opt { font-weight: 400; font-size: 13px; }
.sup-side h3 { margin-bottom: 10px; }
.sup-kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; min-width: 0; }
.sup-kv > span:first-child { color: var(--muted); flex: none; }
.sup-kv > :last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.sup-kv.col { flex-direction: column; gap: 4px; }
.sup-kv.col > :last-child { text-align: left; }
.sup-pre { white-space: pre-wrap; word-break: break-word; font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg3); border-radius: 4px; padding: 8px 10px; margin: 0; max-height: 260px; overflow: auto; }
.sup-cfg { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.sup-steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.6; font-size: 13.5px; }
.sup-steps li { margin-bottom: 6px; }
.sup-code { display: block; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg3); border-radius: 4px; padding: 6px 8px; overflow-wrap: anywhere; }
.sup-secret { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.sup-worker { margin-top: 12px; }
.sup-worker summary { cursor: pointer; font-size: 13px; margin-bottom: 8px; }
.sup-worker .btn { margin-top: 8px; }
.sup-status { width: auto; }
.sup-tabs + .adm-sub, .sup-warn + .adm-sub { margin-top: 0; }
.sup-cfg label.mfa-toggle { font-weight: 400; font-size: 13px; margin-bottom: 14px; }
.gen .def-note { font-size: 12px; color: var(--text); font-style: italic; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.gen .def-img { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.gen .def-img img { width: 34px; height: 26px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
/* badges over images (Generaciones, Defectos, Resumen): white text on a solid dark pill, always readable */
.gen .media .badge { background: rgba(17,17,17,.88); color: #fff; border-color: transparent; font-weight: 600; font-size: 11.5px; padding: 3px 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); backdrop-filter: blur(4px); }
.gen .media .badge.bad { background: #b3261e; color: #fff; }
.gen .media .badge.warn { background: #b86e00; color: #fff; }
.gen .media .badge.ok { background: #1e8e4e; color: #fff; }

/* Registro técnico (Generaciones) */
#formDlg.wide { width: min(920px, 94vw); }
.gen .gen-log { align-self: flex-start; margin-top: 4px; font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.tl-kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 13px; margin: 10px 0 14px; }
.tl-kv .k { color: var(--muted); }
.tl-kv .v { word-break: break-word; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 14px; }
.tl-table th, .tl-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tl-sub { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0; }
.tl-pre { white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px; max-height: 340px; overflow: auto; }
.gen .gen-log { background: none; border: none; padding: 0; color: var(--accent, #2563eb); cursor: pointer; }
.gen .gen-log:hover { text-decoration: underline; }
.gen .gen-log svg { width: 13px; height: 13px; }
#formDlg.wide .adm-form { width: 100%; }
#formDlg.wide .dlg-actions { flex-wrap: wrap; justify-content: flex-end; }

/* Defectos: images the generation started from */
.gen .def-inputs { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.gen .def-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.gen .def-strip a { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; text-decoration: none; color: var(--muted); font-size: 10.5px; }
.gen .def-strip img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: var(--bg3); }
.gen .def-strip a:hover img { border-color: var(--text); }
.gen .def-strip span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gens.defects { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.gens.defects .def-strip a { width: 88px; }
.gens.defects .def-strip img { width: 88px; height: 64px; }
.gens.defects .def-strip span { max-width: 88px; }

/* Inicio con Google / Microsoft */
.oauth-row { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.oauth-top { display: flex; align-items: center; gap: 14px; }
.oauth-top b { flex: 1; }
.oauth-row .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
