/* Smart Touch LATAM — panel de cartelería digital.
   Concepto: barra lateral en tinta azul con el logo en blanco; superficie clara y fría; el azul de marca
   marca lo interactivo y lo que está "en vivo" (ondas del logo = estado en línea). */
@font-face { font-family: "Poppins"; src: url("fonts/poppins-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Heros"; src: url("fonts/texgyreheros-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Heros"; src: url("fonts/texgyreheros-bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  /* Marca */
  --brand: #009fe3;          /* azul del logo */
  --brand-ink: #0b1828;      /* tinta (barra lateral, títulos) */
  --brand-gray: #c7c7c6;     /* gris de la mano */
  /* Tema claro */
  --bg: #f1f4f8; --surface: #ffffff; --surface-2: #e8edf3; --surface-3: #dde4ec;
  --text: #0e1a29; --muted: #59687b; --border: #d6dee8; --border-strong: #b9c5d3;
  --primary: #0077b6; --primary-hover: #00669c; --primary-text: #ffffff; --primary-soft: #e0f2fb;
  --link: #006da6;
  --viz-income: #0b84c6; --viz-expense: #e0732e;
  --ok: #157a4a; --ok-bg: #dff3e8; --warn: #9a5b00; --warn-bg: #fdf0d8; --bad: #b3261e; --bad-bg: #fde6e4;
  --side-bg: #0b1828; --side-text: #c5d1de; --side-muted: #7f90a3; --side-active: rgba(0, 159, 227, .16);
  --shadow: 0 1px 2px rgba(11, 24, 40, .06), 0 2px 8px rgba(11, 24, 40, .05);
  --shadow-lg: 0 18px 50px rgba(11, 24, 40, .22);
  --canvas-bg: #e3e9f0; --canvas-dot: rgba(11,24,40,.10);
  --radius: 10px; --radius-sm: 7px;
  --font-display: "Poppins", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Heros", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
  font-family: var(--font-body); font-size: 15px;
}
/* Tema oscuro: por elección del usuario (data-theme="dark") o del sistema si eligió «Automático». */
:root[data-theme="dark"] {
    --bg: #070f19; --surface: #0e1a28; --surface-2: #142335; --surface-3: #1b2e44;
    --text: #e6eef7; --muted: #8fa1b6; --border: #1f3147; --border-strong: #2f465f;
    --primary: #1fb0ee; --primary-hover: #4cc2f3; --primary-text: #04121f; --primary-soft: rgba(31, 176, 238, .14);
    --link: #5cc6f4;
    --viz-income: #2196da; --viz-expense: #dd7432;
    --ok: #5fd39a; --ok-bg: #11301f; --warn: #f2b45c; --warn-bg: #352812; --bad: #ff8a80; --bad-bg: #3a1a18;
    --side-bg: #040a12; --shadow: 0 1px 2px rgba(0,0,0,.45), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 18px 50px rgba(0,0,0,.65);
    --canvas-bg: #050b13; --canvas-dot: rgba(255,255,255,.07);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070f19; --surface: #0e1a28; --surface-2: #142335; --surface-3: #1b2e44;
      --text: #e6eef7; --muted: #8fa1b6; --border: #1f3147; --border-strong: #2f465f;
      --primary: #1fb0ee; --primary-hover: #4cc2f3; --primary-text: #04121f; --primary-soft: rgba(31, 176, 238, .14);
      --link: #5cc6f4;
      --viz-income: #2196da; --viz-expense: #dd7432;
      --ok: #5fd39a; --ok-bg: #11301f; --warn: #f2b45c; --warn-bg: #352812; --bad: #ff8a80; --bad-bg: #3a1a18;
      --side-bg: #040a12; --shadow: 0 1px 2px rgba(0,0,0,.45), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 18px 50px rgba(0,0,0,.65);
      --canvas-bg: #050b13; --canvas-dot: rgba(255,255,255,.07);
      color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; text-wrap: balance; color: var(--text); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; } h2 { font-size: 1.1rem; margin: 1.75rem 0 .65rem; } h3 { font-size: .98rem; margin: 1rem 0 .4rem; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ico { display: inline-flex; width: 1.25em; height: 1.25em; flex-shrink: 0; }
.ico svg { width: 100%; height: 100%; }
.boot, .loading { padding: 2rem; color: var(--muted); }
.boot { display: grid; place-items: center; min-height: 60vh; font-family: var(--font-display); }

/* Botones y formularios */
button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .9rem; cursor: pointer; min-height: 38px; font-family: var(--font-display); font-weight: 500; font-size: .88rem; transition: background .15s, border-color .15s, color .15s; }
button:hover { background: var(--surface-2); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--primary); color: var(--primary-text); border-color: transparent; }
button.primary:hover { background: var(--primary-hover); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: transparent; }
button.danger:hover { background: var(--bad-bg); }
button.link { background: none; border: none; color: var(--link); padding: .2rem .35rem; min-height: 0; font-family: var(--font-body); font-weight: 400; }
button.icon { padding: .25rem .55rem; min-width: 38px; }
input, select { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .65rem; min-height: 40px; max-width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
input[type=checkbox] { min-height: 0; width: 18px; height: 18px; accent-color: var(--primary); }
input[type=color] { padding: 2px; width: 64px; }
input.narrow { width: 6.5rem; }
input.code-input { font-family: var(--font-mono); font-size: 1.5rem; letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; min-width: 0; }
.field label, .field .label { font-family: var(--font-display); font-weight: 500; font-size: .82rem; color: var(--text); }
.help, small.help { color: var(--muted); font-size: .86rem; max-width: 70ch; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 1rem; align-items: end; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); grid-column: 1 / -1; padding: .75rem 1rem .25rem; }
legend { font-family: var(--font-display); font-weight: 500; font-size: .85rem; padding: 0 .35rem; }
.days { display: flex; gap: .4rem; flex-wrap: wrap; }
.chk { display: inline-flex; gap: .3rem; align-items: center; padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; }
label.inline { display: inline-flex; flex-direction: column; font-size: .75rem; color: var(--muted); gap: 2px; }
details.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
details.box summary { cursor: pointer; font-family: var(--font-display); font-weight: 500; }
details.box[open] summary { margin-bottom: .75rem; }

/* Estructura */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; justify-content: center; padding: 1.4rem 1.2rem 1rem; }
.side-brand img { width: 150px; height: auto; display: block; }
.side-tag { text-align: center; font-family: var(--font-display); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--side-muted); margin: -.35rem 0 1rem; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 .75rem 1rem; }
.side-sec { font-family: var(--font-display); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); padding: 1rem .7rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--side-text); text-decoration: none; font-size: .92rem; transition: background .15s, color .15s; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a.active { background: var(--side-active); color: #fff; }
.side-nav a.active .ico { color: var(--brand); }
.side-nav a.dim { opacity: .45; }
.side-foot { margin-top: auto; padding: 1rem 1.2rem 1.2rem; font-size: .75rem; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.06); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .9rem; padding: .65rem max(16px, 1.75rem); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar .grow { flex: 1; }
.tenant-select { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.tenant-select select { min-width: 220px; }
.userchip { display: flex; align-items: center; gap: .6rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-ink); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .8rem; border: 2px solid var(--brand); }
.userchip .who { display: flex; flex-direction: column; line-height: 1.15; }
.userchip .who strong { font-size: .88rem; }
.userchip .who small { color: var(--muted); font-size: .75rem; }
.menu-btn { display: none; }
.content { padding: 1.6rem max(16px, 1.75rem) 3.5rem; outline: none; max-width: 1360px; width: 100%; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.head h1, .head h2 { margin: 0; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1.1rem; }
.empty { color: var(--muted); padding: 1.25rem; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.error { color: var(--bad); }
.notice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.notice h2 { margin-top: 0; }
.notice.error { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); }
code.small { font-family: var(--font-mono); font-size: .75rem; white-space: pre-wrap; word-break: break-all; color: var(--muted); }

/* Tarjetas e indicadores */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .85rem; margin: .75rem 0 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.card-title { color: var(--muted); font-size: .72rem; font-family: var(--font-display); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.card-value { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.card-value.small { font-size: 1.05rem; }
.card small { color: var(--muted); }
.card .badge { align-self: flex-start; }
.meter { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; flex: 1; min-width: 80px; margin-top: .25rem; }
.meter > div { height: 100%; background: var(--brand); border-radius: 3px; }
.meter > div.full { background: var(--bad); }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
/* "En línea": ondas del logo */
.badge.ok::before { box-shadow: 0 0 0 0 currentColor; animation: ripple 2.2s ease-out infinite; }
@keyframes ripple { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .badge.ok::before { animation: none; } * { transition: none !important; } }

/* Tablas */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-family: var(--font-display); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--surface-2); }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
tr:last-child td { border-bottom: none; }
td a { font-weight: 700; text-decoration: none; color: var(--text); }
td a:hover { color: var(--link); text-decoration: underline; }

/* Inicio de sesión */
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero { position: relative; overflow: hidden; background: var(--brand-ink); color: #e8f1f8; padding: 3rem clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.login-hero img { width: min(260px, 70%); height: auto; position: relative; }
.login-hero h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.12; margin: 0 0 .75rem; max-width: 16ch; position: relative; }
.login-hero h2 em { font-style: normal; color: var(--brand); }
.login-hero p { color: #a9bccf; max-width: 46ch; margin: 0; position: relative; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; position: relative; }
.fact strong { display: block; font-family: var(--font-display); color: #fff; font-size: .95rem; }
.fact span { color: #8fa4b9; font-size: .82rem; }
.rings { position: absolute; right: -140px; top: -140px; width: 520px; height: 520px; border-radius: 50%; border: 46px solid rgba(0, 159, 227, .14); }
.rings::after { content: ""; position: absolute; inset: 80px; border-radius: 50%; border: 34px solid rgba(0, 159, 227, .22); }
.login-side { position: relative; display: grid; place-items: center; padding: 2rem max(16px, 2rem); background: var(--bg); }
.login-theme { position: absolute; top: 1rem; right: max(16px, 1rem); }
.theme-btn { border-radius: 999px; min-width: 38px; }
.theme-btn .ico { color: var(--brand); }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 1.7rem; margin-bottom: .2rem; }
.login-card .sub { color: var(--muted); margin: 0 0 1.5rem; }
.login-card button[type=submit] { width: 100%; min-height: 44px; margin-top: .25rem; }

/* Diálogos y avisos */
dialog.modal { border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(720px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(1180px, calc(100vw - 2rem)); }
dialog.modal::backdrop { background: rgba(5, 12, 21, .55); backdrop-filter: blur(2px); }
dialog.modal header, dialog.modal footer { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.2rem; gap: .5rem; }
dialog.modal header h2 { margin: 0; }
dialog.modal footer { justify-content: flex-end; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-body { padding: .25rem 1.2rem 1.1rem; overflow: auto; max-height: calc(100vh - 11rem); }
#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; max-width: calc(100vw - 2rem); }
.toast { background: var(--brand-ink); color: #eef4fa; border-radius: var(--radius-sm); padding: .7rem 1rem; box-shadow: var(--shadow-lg); border-left: 4px solid var(--brand); font-size: .9rem; }
.toast.ok { border-left-color: #3ccf8e; } .toast.error { border-left-color: #ff6b5e; }

/* Biblioteca */
.quota { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; color: var(--muted); font-size: .88rem; max-width: 520px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 1.6rem; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--primary-soft); color: var(--text); }
.uploads { display: flex; flex-direction: column; gap: .3rem; margin: .5rem 0; }
.upload-row { display: flex; gap: .75rem; align-items: center; font-size: .86rem; flex-wrap: wrap; }
.upload-row.done .meter > div { background: var(--ok); } .upload-row.failed .meter > div { background: var(--bad); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.filters input[type=search] { flex: 1; min-width: 200px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.media-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11,24,40,.12); }
.thumb { aspect-ratio: 16/9; background: #0b1828; display: grid; place-items: center; position: relative; color: #fff; font-size: 1.5rem; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(5,12,21,.8); font-size: .72rem; padding: 2px 7px; border-radius: 4px; font-family: var(--font-display); }
.thumb.small { width: 104px; flex-shrink: 0; border-radius: 6px; }
.meta { padding: .7rem .8rem .8rem; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.meta small { color: var(--muted); font-size: .78rem; }
.tags { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
button.tag { padding: 0 .55rem; min-height: 22px; font-size: .74rem; border-radius: 999px; font-family: var(--font-body); background: var(--primary-soft); border-color: transparent; color: var(--link); }
.preview { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 6px; }

/* Listas y diseños */
.pl-items { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; counter-reset: pl; }
.pl-item { display: flex; gap: .85rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .7rem; flex-wrap: wrap; box-shadow: var(--shadow); counter-increment: pl; }
.pl-item::before { content: counter(pl); font-family: var(--font-display); font-weight: 700; color: var(--muted); width: 1.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.pl-item .grow { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.pl-item .grow small { color: var(--muted); }
.pl-item input { width: 5.5rem; }
.layout-editor { margin: 1rem 0; overflow-x: auto; padding: 1rem; background: var(--surface-2); border-radius: var(--radius); }
.layout-canvas, .preview-stage { position: relative; border: 1px solid var(--border); margin: 0 auto; overflow: hidden; border-radius: 4px; }
.zone { position: absolute; border: 2px solid var(--brand); background: rgba(0, 159, 227, .2); color: #fff; font-size: .78rem; padding: 3px 6px; text-shadow: 0 1px 2px #000; font-family: var(--font-display); }
.zone-play { position: absolute; overflow: hidden; }
.zone-play img, .zone-play video { width: 100%; height: 100%; object-fit: contain; display: block; }
.screenshot { max-width: 100%; max-height: 360px; border: 1px solid var(--border); border-radius: var(--radius); display: block; }
.cmds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.cmd { display: flex; flex-direction: column; gap: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; }
section { margin-bottom: .5rem; }

/* Inicio (dashboard) */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; background: var(--brand-ink); color: #e8f1f8; border-radius: 14px; padding: 1.4rem 1.6rem; position: relative; overflow: hidden; margin-bottom: 1.1rem; }
.welcome h1 { color: #fff; margin: 0; font-size: 1.45rem; position: relative; }
.welcome p { margin: .25rem 0 0; color: #a9bccf; position: relative; }
.welcome .actions { position: relative; }
.welcome button { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.welcome button:hover { background: rgba(255,255,255,.16); }
.welcome button.primary { background: var(--brand); color: #04121f; border-color: transparent; }
.welcome .rings { width: 300px; height: 300px; right: -90px; top: -150px; border-width: 30px; }
.welcome .rings::after { inset: 50px; border-width: 22px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.split h2 { margin-top: .5rem; }
.screens { display: flex; flex-direction: column; gap: .45rem; }
.screen-row { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; text-decoration: none; color: var(--text); }
.screen-row:hover { border-color: var(--brand); }
.screen-row .ico { color: var(--muted); width: 1.5em; height: 1.5em; }
.screen-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.screen-row small { color: var(--muted); }
ul.notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
ul.notes li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; }
ul.notes p { margin: .2rem 0; font-size: .88rem; color: var(--muted); }
ul.notes small { color: var(--muted); font-size: .75rem; }

/* Móvil */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .userchip .who { display: none; }
  .tenant-select { order: 5; width: 100%; } .tenant-select select { flex: 1; min-width: 0; }
  .content { padding: 1.1rem max(16px, env(safe-area-inset-left, 0px)) 3rem; }
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 1.6rem max(16px, 1.25rem); gap: 1rem; }
  .login-hero .facts, .login-hero p { display: none; }
  .split { grid-template-columns: 1fr; }
  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--border); padding: .45rem 0; }
  td { border: none; padding: .25rem .8rem; display: flex; gap: .5rem; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; min-width: 7.5rem; flex-shrink: 0; font-family: var(--font-display); }
}

/* --- Portal administrador --------------------------------------------------- */
.sidebar.admin { box-shadow: inset 3px 0 0 var(--brand); }
.sidebar.admin .side-tag { color: var(--brand); }
.welcome.admin { background: linear-gradient(120deg, #0b1828 0%, #0b1828 55%, #06324d 100%); }
.empty-hero { text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 14px; padding: 2.5rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.empty-hero .ico { width: 44px; height: 44px; color: var(--brand); }
.empty-hero h2 { margin: .25rem 0 0; }
.empty-hero p { color: var(--muted); margin: 0 0 .5rem; }

/* --- Diseñador ----------------------------------------------------------------- */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.design-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.design-thumb { display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; padding: .9rem; min-height: 200px; }
.design-meta { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .75rem .9rem; flex-wrap: wrap; }
.design-meta strong { display: block; } .design-meta small { color: var(--muted); font-size: .78rem; }
.mini-wrap { position: relative; overflow: hidden; border-radius: 4px; box-shadow: 0 2px 10px rgba(11,24,40,.25); flex-shrink: 0; }
.mini-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.mini-stage .el, .stage .el { position: absolute; }
.el-content { position: absolute; inset: 0; overflow: hidden; }
.el-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: repeating-linear-gradient(45deg, rgba(0,159,227,.16) 0 24px, rgba(0,159,227,.08) 24px 48px); color: #cfe9f7; font-family: var(--font-display); font-size: 40px; text-align: center; padding: 20px; border: 4px dashed rgba(0,159,227,.7); }
.el-ph .ico { width: 80px; height: 80px; }
.preview-big { margin: 0 auto; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-top: .5rem; }
.tpl { flex-direction: column; align-items: flex-start; gap: .4rem; padding: .6rem; text-align: left; min-height: 0; height: auto; font-family: var(--font-body); }
.tpl strong { font-family: var(--font-display); } .tpl small { color: var(--muted); font-weight: 400; }
.tpl.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--primary-soft); }
.props textarea { width: 100%; font: inherit; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem; background: var(--surface); color: var(--text); resize: vertical; }
.prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
.prop-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 .4rem; }
.prop-grid4 input, .prop-grid input { width: 100%; }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { flex: 1; border: none; border-radius: 0; min-height: 34px; padding: .3rem .4rem; font-size: .78rem; background: var(--surface); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--primary); color: var(--primary-text); }
.color-row { display: flex; align-items: center; gap: .6rem; }
.actions.wrap { margin-top: .75rem; }
.media-pick { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.media-pick img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.pick-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.pm { flex-direction: column; align-items: stretch; padding: .4rem; gap: .3rem; height: auto; text-align: left; font-family: var(--font-body); font-weight: 400; }
.pm img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; background: #0b1828; }
.pm span { font-size: .75rem; color: var(--muted); } .pm small { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-list { display: flex; flex-direction: column; gap: .35rem; margin: .5rem 0 1rem; }
.pick-sec { font-family: var(--font-display); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pick-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.pick-row:hover { border-color: var(--brand); }
.pick-row .grow { flex: 1; display: flex; flex-direction: column; } .pick-row small { color: var(--muted); }
/* --- Planes ------------------------------------------------------------------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.3rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; box-shadow: var(--shadow); }
.plan-card.featured { border: 2px solid var(--brand); box-shadow: 0 10px 30px rgba(0,159,227,.18); }
.plan-flag { position: absolute; top: -12px; left: 1.2rem; background: var(--brand); color: #04121f; font-family: var(--font-display); font-weight: 700; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 999px; }
.plan-card h3 { margin: 0; font-size: 1.15rem; }
.plan-price strong { font-family: var(--font-display); font-size: 2rem; } .plan-price span { color: var(--muted); font-size: .85rem; }
.plan-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.plan-feats li::before { content: "✓"; color: var(--brand); font-weight: 700; margin-right: .45rem; }
.plan-buy { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; margin-top: auto; }
.plan-total { font-family: var(--font-display); font-size: .95rem; }
.plan-card > button { width: 100%; }
.prop-grid4 input { padding: .4rem .3rem; font-size: .8rem; min-width: 0; }

/* --- Estudio de diseño ------------------------------------------------------------ */
.content.content-studio { max-width: none; padding: .75rem max(12px, 1rem) 1rem; }
.studio { display: flex; flex-direction: column; gap: .6rem; height: calc(100vh - 78px); min-height: 520px; }
.st-top { display: flex; align-items: center; gap: .45rem; flex-wrap: nowrap; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .4rem .5rem; box-shadow: var(--shadow); }
.st-top .grow { flex: 1; }
.st-top .title-input { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; border-color: transparent; background: transparent; min-width: 90px; flex: 0 1 260px; }
.st-top > button { flex-shrink: 0; }
.st-top .title-input:hover { border-color: var(--border); }
.st-group { display: flex; align-items: center; gap: 2px; padding: 0 .3rem; border-left: 1px solid var(--border); }
.st-group button, .st-top > button.icon { border-color: transparent; background: transparent; min-width: 36px; min-height: 36px; padding: .2rem .45rem; }
.st-group button:hover, .st-top > button.icon:hover { background: var(--surface-2); }
.st-group button.toggle.on { background: var(--primary-soft); color: var(--link); }
.st-group button:disabled { opacity: .35; }
.st-zoomlbl { min-width: 62px !important; font-variant-numeric: tabular-nums; font-size: .8rem !important; }
.st-save { font-size: .78rem; color: var(--muted); padding: 0 .4rem; white-space: nowrap; }
.st-save.ok::before { content: "● "; color: var(--ok); } .st-save.dirty::before { content: "● "; color: var(--warn); } .st-save.bad { color: var(--bad); }
.st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 268px minmax(0, 1fr) 312px; gap: .6rem; }
.st-left, .st-right { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.st-tabs { display: flex; gap: 2px; padding: .35rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.st-tabs:empty { display: none; }
.st-tabs button { flex: 1; flex-direction: column; gap: 2px; border: none; background: transparent; min-height: 44px; padding: .25rem .2rem; font-size: .7rem; border-radius: 9px; color: var(--muted); }
.st-right .st-tabs button { min-height: 34px; font-size: .78rem; flex-direction: row; }
.st-tabs button .ico { width: 18px; height: 18px; }
.st-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.st-tabs button.on .ico { color: var(--brand); }
.st-left-body, .st-insp-body { flex: 1; overflow: auto; padding: .7rem; }
.st-search { width: 100%; margin-bottom: .4rem; }
.st-cat { margin-bottom: .4rem; }
.st-cat .pane-title { margin: .7rem 0 .35rem; }
.st-lib { display: flex; flex-direction: column; gap: 4px; }
.st-item { justify-content: flex-start; text-align: left; gap: .6rem; padding: .45rem .55rem; border: 1px solid transparent; background: transparent; font-family: var(--font-body); font-weight: 400; min-height: 48px; cursor: grab; }
.st-item:hover { background: var(--surface-2); border-color: var(--border); }
.st-item:active { cursor: grabbing; }
.st-item-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--brand); flex-shrink: 0; }
.st-item-ic .ico { width: 19px; height: 19px; }
.st-item-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.st-item-t strong { font-family: var(--font-display); font-weight: 500; font-size: .86rem; }
.st-item-t small { color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font-family: var(--font-mono); font-size: .7rem; padding: .05rem .38rem; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.st-hint { font-size: .78rem; margin-top: .9rem; }
.st-layers { display: flex; flex-direction: column; gap: 2px; }
.st-layer { display: flex; align-items: center; gap: .35rem; padding: .15rem .25rem; border-radius: 8px; border: 1px solid transparent; }
.st-layer:hover { background: var(--surface-2); }
.st-layer.on { background: var(--primary-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.st-layer.over { border-top: 2px solid var(--brand); }
.st-layer.off .st-layer-name { opacity: .45; text-decoration: line-through; }
.st-layer-ic { color: var(--muted); display: grid; place-items: center; width: 22px; }
.st-layer-name { flex: 1; justify-content: flex-start; border: none; background: none; min-height: 30px; padding: 0 .2rem; font-family: var(--font-body); font-weight: 400; font-size: .86rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; text-align: left; }
button.icon.mini { min-width: 28px; min-height: 28px; padding: 0; border: none; background: transparent; color: var(--muted); }
button.icon.mini:hover { color: var(--text); background: var(--surface-3); }
.st-upload { width: 100%; margin-bottom: .6rem; }
.st-files { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.st-file { flex-direction: column; padding: 3px; gap: 2px; min-height: 0; cursor: grab; background: var(--surface-2); border-color: transparent; }
.st-file img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; background: #0b1828; pointer-events: none; }
.st-file span { font-size: .68rem; color: var(--muted); font-family: var(--font-body); font-weight: 400; }
.st-tpl { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem; display: flex; flex-direction: column; gap: .2rem; }
.st-tpl small { color: var(--muted); font-size: .78rem; }
.st-tpl .actions { margin-top: .35rem; } .st-tpl button { min-height: 32px; padding: .25rem .6rem; font-size: .8rem; }

/* Lienzo */
.st-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.st-viewport { position: relative; flex: 1; overflow: auto; background-color: var(--canvas-bg); background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1.2px); background-size: 22px 22px; outline: none; cursor: default; overscroll-behavior: contain; }
.st-viewport.drop { box-shadow: inset 0 0 0 3px var(--brand); }
.st-viewport.can-pan, .st-viewport.can-pan * { cursor: grab !important; }
.st-viewport.panning, .st-viewport.panning * { cursor: grabbing !important; }
.st-world { position: relative; }
.st-stage { position: absolute; transform-origin: 0 0; overflow: hidden; box-shadow: 0 18px 60px rgba(5, 12, 21, .35), 0 0 0 1px rgba(5,12,21,.12); }
.st-stage .el { position: absolute; cursor: move; touch-action: none; }
.st-stage .el.is-hidden { opacity: .18 !important; outline: 4px dashed rgba(255,255,255,.5); outline-offset: -4px; pointer-events: none; }
.st-stage .el.is-locked { cursor: not-allowed; }
.st-stage .el:not(.is-locked):hover { outline: 3px solid rgba(0,159,227,.7); outline-offset: -3px; }
.st-stage .el.editing { outline: none !important; }
.st-grid { position: absolute; inset: 0; pointer-events: none; z-index: 100000; background-image: linear-gradient(to right, rgba(0,159,227,.28) 1px, transparent 1px), linear-gradient(to bottom, rgba(0,159,227,.28) 1px, transparent 1px); }
.st-inline { position: absolute; inset: 0; z-index: 10; width: 100%; height: 100%; resize: none; border: none; outline: 6px solid var(--brand); background: rgba(0,0,0,.25); caret-color: #fff; box-sizing: border-box; }
.st-overlay { position: absolute; inset: 0; pointer-events: none; }
.st-outline { position: absolute; outline: 1px solid var(--brand); transform-origin: center; }
.st-box { position: absolute; border: 2px solid var(--brand); transform-origin: center; pointer-events: none; }
.st-box.multi { border-style: dashed; background: rgba(0,159,227,.05); }
.st-box.locked { border-color: var(--warn); border-style: dashed; }
.st-lock { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 50%; background: var(--warn); color: #fff; display: grid; place-items: center; }
.st-lock .ico { width: 14px; height: 14px; }
.st-h { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; pointer-events: auto; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.st-h.nw { left: -7px; top: -7px; cursor: nwse-resize; } .st-h.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.st-h.sw { left: -7px; bottom: -7px; cursor: nesw-resize; } .st-h.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.st-h.n { left: calc(50% - 7px); top: -7px; cursor: ns-resize; } .st-h.s { left: calc(50% - 7px); bottom: -7px; cursor: ns-resize; }
.st-h.e { right: -7px; top: calc(50% - 7px); cursor: ew-resize; } .st-h.w { left: -7px; top: calc(50% - 7px); cursor: ew-resize; }
.st-rot { position: absolute; left: calc(50% - 13px); top: -40px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; pointer-events: auto; cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.st-rot::after { content: ""; position: absolute; top: 26px; left: 12px; width: 2px; height: 14px; background: var(--brand); }
.st-rot .ico { width: 15px; height: 15px; }
.st-dim { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); background: var(--brand); color: #04121f; font-family: var(--font-display); font-weight: 700; font-size: .7rem; padding: .1rem .45rem; border-radius: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-guide { position: absolute; background: #ff3d8b; z-index: 5; }
.st-guide.v { width: 1px; } .st-guide.h { height: 1px; }
.st-marquee { position: absolute; border: 1px solid var(--brand); background: rgba(0,159,227,.12); pointer-events: none; }
.st-tip { position: absolute; z-index: 20; pointer-events: none; background: #0b1828; color: #fff; font-family: var(--font-display); font-size: .74rem; padding: .2rem .5rem; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-lg); }
.st-status { display: flex; gap: 1rem; align-items: center; padding: .3rem .8rem; background: var(--surface); border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.st-status .grow { flex: 1; } .st-status .bad { color: var(--bad); }
.st-status kbd { font-size: .66rem; }

/* Inspector */
.st-insp-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.st-name { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 500; }
.st-align { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: .7rem; background: var(--surface-2); }
.st-align button { flex: 1; min-width: 30px; min-height: 30px; padding: 0; border: none; background: transparent; }
.st-align button:hover { background: var(--surface); }
.st-geo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 .3rem; }
.st-geo .field label { font-size: .7rem; color: var(--muted); }
.st-geo input { width: 100%; padding: .35rem .3rem; font-size: .8rem; min-height: 34px; }
.st-insp-body .field { margin-bottom: .65rem; }
.st-insp-body .pane-title { margin-top: 1rem; }
.st-insp-body select, .st-insp-body input:not([type=checkbox]):not([type=range]):not([type=color]) { width: 100%; }
.st-insp-body .seg button { font-size: .74rem; }
.st-insp-body .seg button .ico { width: 17px; height: 17px; }
.st-slider { display: flex; align-items: center; gap: .5rem; }
.st-slider input { flex: 1; accent-color: var(--brand); min-height: 0; padding: 0; border: none; }
.st-slider output { font-size: .74rem; color: var(--muted); min-width: 3.6rem; text-align: right; font-variant-numeric: tabular-nums; }
.st-color { display: flex; flex-direction: column; gap: .35rem; }
.st-color .color-row input[type=range] { flex: 1; accent-color: var(--brand); border: none; padding: 0; min-height: 0; }
.st-color input[type=color] { width: 44px; height: 32px; min-height: 0; }
.st-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.st-sw { width: 22px; height: 22px; min-height: 0; min-width: 0; padding: 0; border-radius: 6px; border: 1px solid var(--border-strong); }
.st-sw.none { background: linear-gradient(135deg, transparent 45%, #e5484d 45% 55%, transparent 55%), var(--surface); }
.st-place { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: .65rem; }
.st-place div { display: flex; flex-direction: column; } .st-place small { color: var(--muted); font-size: .74rem; }
.st-detect { display: flex; align-items: center; gap: .4rem; color: var(--link); font-size: .82rem; margin: -.3rem 0 .6rem; }
.st-anims { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: .7rem; }
.st-anims button { min-height: 32px; font-size: .76rem; padding: .2rem .4rem; }
.st-anims button.on { border-color: var(--brand); background: var(--primary-soft); color: var(--link); }
.st-tips ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .82rem; display: flex; flex-direction: column; gap: .35rem; }

/* Menú contextual, paleta de comandos y ayuda */
.st-menu { position: fixed; z-index: 200; min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .3rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.st-menu button { justify-content: space-between; border: none; background: transparent; min-height: 32px; padding: .3rem .6rem; font-family: var(--font-body); font-weight: 400; font-size: .86rem; border-radius: 7px; }
.st-menu button:hover:not(:disabled) { background: var(--primary-soft); color: var(--link); }
.st-menu button.danger { color: var(--bad); }
.st-menu kbd { border: none; background: none; }
.st-sep { height: 1px; background: var(--border); margin: .25rem .3rem; }
.st-palette-wrap { position: fixed; inset: 0; z-index: 210; background: rgba(5, 12, 21, .45); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.st-palette { width: min(620px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.st-palette-in { width: 100%; border: none; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 1.05rem; padding: 1rem 1.1rem; min-height: 56px; background: transparent; }
.st-palette-in:focus { box-shadow: none; }
.st-palette-list { max-height: 50vh; overflow: auto; padding: .35rem; display: flex; flex-direction: column; }
.st-cmd { justify-content: flex-start; gap: .7rem; border: none; background: transparent; min-height: 40px; font-family: var(--font-body); font-weight: 400; text-align: left; border-radius: 9px; }
.st-cmd span:nth-child(2) { flex: 1; }
.st-cmd .ico { color: var(--brand); }
.st-cmd.on { background: var(--primary-soft); color: var(--link); }
.st-help { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .25rem 1.4rem; }
.st-help h3 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: .9rem 0 .4rem; }
.st-help dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: 0; font-size: .86rem; align-items: center; }
.st-help dt { white-space: nowrap; } .st-help dd { margin: 0; color: var(--muted); }
.preview-holder { display: flex; justify-content: center; }

@media (max-width: 1640px) { .hide-sm { display: none; } }
@media (max-width: 1280px) { .st-body { grid-template-columns: 228px minmax(0, 1fr) 290px; } }
@media (max-width: 1020px) {
  .studio { height: auto; }
  .st-body { grid-template-columns: 1fr; }
  .st-center { height: 62vh; order: -1; }
  .st-left, .st-right { max-height: 60vh; }
  .st-kbd-hint { display: none; }
}

/* --- Almacenamiento (administración) ------------------------------------------- */
.st-meter { display: flex; align-items: center; gap: .5rem; min-width: 140px; }
.st-meter small { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.6rem; }
.st-modes { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0 .75rem; }
.st-mode { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.st-mode.on { border-color: var(--brand); background: var(--primary-soft); }
.st-mode span { display: flex; flex-direction: column; } .st-mode small { color: var(--muted); }
.st-preview { background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; margin: .25rem 0 0; }
.st-size-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: .35rem; align-items: end; }
.st-size-row .field { margin-bottom: 0; }
.st-size-row > span { padding-bottom: .65rem; color: var(--muted); }
.st-sizes { display: flex; flex-direction: column; gap: 3px; margin: .4rem 0 .7rem; }
.st-sizes .st-sz { display: flex; align-items: center; gap: .4rem; }
.st-sizes .st-sz > button:first-child { flex: 1; justify-content: space-between; min-height: 32px; font-family: var(--font-body); font-weight: 400; font-size: .82rem; padding: .25rem .55rem; }
.st-sizes .st-sz small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Táctil ---------------------------------------------------------------------- */
.st-viewport { touch-action: none; }
.st-tapmark { position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #ff3d8b; color: #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); pointer-events: none; }
.st-tapmark .ico { width: 14px; height: 14px; }
@media (pointer: coarse) {
  .st-h { width: 24px; height: 24px; border-radius: 6px; }
  .st-h.nw { left: -13px; top: -13px; } .st-h.ne { right: -13px; top: -13px; } .st-h.sw { left: -13px; bottom: -13px; } .st-h.se { right: -13px; bottom: -13px; }
  .st-h.n { left: calc(50% - 13px); top: -13px; } .st-h.s { left: calc(50% - 13px); bottom: -13px; } .st-h.e { right: -13px; top: calc(50% - 13px); } .st-h.w { left: -13px; top: calc(50% - 13px); }
  .st-rot { width: 36px; height: 36px; top: -54px; left: calc(50% - 18px); } .st-rot::after { top: 36px; left: 17px; height: 18px; }
  .st-item, .st-layer-name, .st-menu button, .st-cmd { min-height: 44px; }
  button.icon.mini { min-width: 40px; min-height: 40px; }
  .st-kbd-hint { display: none; }
}

/* Descargas e instalación de reproductores; encendido programado */
.dl-box { display: flex; gap: 1rem; align-items: center; background: var(--surface-2); border-radius: 12px; padding: .8rem; margin-bottom: 1rem; }
.dl-qr { width: 120px; height: 120px; flex-shrink: 0; background: #fff; border-radius: 8px; overflow: hidden; }
.dl-box p { margin: .2rem 0 .4rem; }
.power-grid { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.power-grid .field { margin-bottom: 0; }
.power-grid > .chk { margin-bottom: .5rem; }

.st-grids { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .6rem; }
.st-grid-btn { flex-direction: column; gap: .3rem; padding: .4rem; min-height: 0; font-family: var(--font-body); font-weight: 400; }
.st-grid-btn small { font-size: .72rem; color: var(--muted); }
.st-grid-thumb { position: relative; width: 100%; aspect-ratio: 16/9; background: var(--surface-3); border-radius: 5px; }
.st-grid-thumb span { position: absolute; box-sizing: border-box; border: 2px solid var(--surface); background: color-mix(in srgb, var(--brand) 55%, #0b1828); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .72rem; border-radius: 4px; }

/* --- Contabilidad ------------------------------------------------------------------ */
a.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .9rem; min-height: 38px; font-family: var(--font-display); font-weight: 500; font-size: .88rem; color: var(--text); text-decoration: none; }
a.button:hover { background: var(--surface-2); }
a.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.acc-per { display: inline-flex; align-items: center; gap: .5rem; }
.acc-custom { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.card.acc-ok .card-value { color: var(--ok); } .card.acc-bad .card-value { color: var(--bad); }
.acc-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; }
.acc-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; box-shadow: var(--shadow); min-width: 0; }
.acc-sec h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.acc-sec-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.acc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; }
.acc-chart-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.acc-legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--muted); }
.acc-legend span, .acc-tip div { display: inline-flex; align-items: center; gap: .35rem; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw.inc { background: var(--viz-income); } .sw.exp { background: var(--viz-expense); }
.acc-chart-box { position: relative; }
.acc-svg { width: 100%; height: auto; display: block; overflow: visible; }
.acc-svg .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.acc-svg .base { stroke: var(--border-strong); stroke-width: 1; }
.acc-svg .tick { fill: var(--muted); font-size: 11px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.acc-svg path.inc { fill: var(--viz-income); } .acc-svg path.exp { fill: var(--viz-expense); }
.acc-svg .acc-month { transition: opacity .12s; } .acc-svg .acc-month.dim path { opacity: .35; }
.acc-svg .hit { fill: transparent; cursor: default; outline: none; }
.acc-tip { position: absolute; top: 0; width: 170px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); padding: .5rem .65rem; font-size: .82rem; display: grid; gap: .15rem; pointer-events: none; z-index: 2; }
.acc-tip b { margin-left: auto; font-variant-numeric: tabular-nums; }
.acc-tip div { display: flex; }
.acc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.acc-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.acc-list li:last-child { border-bottom: 0; }
.acc-catval { display: inline-flex; align-items: center; gap: .6rem; min-width: 180px; }
.acc-catval .meter { margin: 0; }
td.num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-in { color: var(--ok); } .acc-out { color: var(--bad); }
tr.acc-void td { opacity: .55; } tr.acc-void td strong { text-decoration: line-through; }
.acc-calc input[type=number] { width: 6rem; }
.acc-calc-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-top: .75rem; }
.acc-calc-out > div { background: var(--surface-2); border-radius: 10px; padding: .7rem .85rem; display: flex; flex-direction: column; }
.acc-calc-out b { font-family: var(--font-display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.acc-calc-out small { color: var(--muted); }
.acc-up { color: var(--ok); }
.acc-foot { margin-top: 1rem; }
.span2 { grid-column: 1 / -1; }

/* --- Descargar player ---------------------------------------------------------------- */
.dl-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dl-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.dl-hero-head { display: flex; gap: .9rem; align-items: center; padding: 1.1rem 1.25rem; background: linear-gradient(120deg, var(--brand-ink), #12324f); color: #fff; }
.dl-hero.windows .dl-hero-head { background: linear-gradient(120deg, var(--brand-ink), #1d3a5c); }
.dl-hero-head h2 { margin: 0; color: #fff; font-size: 1.5rem; }
.dl-hero-head small { color: #b9cbe0; }
.dl-hero-ico { width: 56px; height: 56px; border-radius: 14px; background: rgba(0, 159, 227, .2); display: grid; place-items: center; flex-shrink: 0; }
.dl-hero-ico .ico svg { width: 32px; height: 32px; color: #6fd0ff; }
.dl-hero-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.dl-hero-body.empty { justify-content: center; align-items: flex-start; }
.dl-hero-ver { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.dl-hero-ver span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.dl-hero-ver strong { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
.dl-notes { margin: .2rem 0; white-space: pre-line; }
.dl-hero-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .4rem 0; }
.dl-big { font-size: 1.05rem !important; padding: .85rem 1.3rem !important; min-height: 52px !important; border-radius: 12px !important; }
.dl-hero-qr { width: 132px; height: 132px; background: #fff; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.dl-hero-qr:empty { display: none; }
.dl-hero-qr svg { width: 100%; height: 100%; display: block; }
.dl-link code { word-break: break-all; }
.dl-steps summary { cursor: pointer; font-weight: 600; }
.dl-steps ol { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.dl-sha { opacity: .8; }
.dl-old { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.dl-old h2 { margin-top: 0; }
.dl-hero-ico .ico { width: 32px; height: 32px; }

/* --- Pantallas: lista con acciones, licencia, menú ------------------------------------ */
.muted { color: var(--muted); }
.dev-name { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.dev-name small { color: var(--muted); }
.np { display: flex; gap: .5rem; align-items: flex-start; min-width: 160px; }
.np div { display: flex; flex-direction: column; }
.np small { color: var(--muted); font-size: .8rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); margin-top: .4rem; flex-shrink: 0; }
.np-dot.live, .now-dot.live { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .np-dot.live, .now-dot.live { animation: none; } }
.dev-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.icon-btn .ico { width: 1.25rem; height: 1.25rem; }
.icon-btn.gear:hover .ico { transform: rotate(45deg); }
.icon-btn .ico { transition: transform .25s; }
.spin .ico { animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.switch { position: relative; width: 46px; height: 26px; min-height: 0; padding: 0; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--border-strong); flex-shrink: 0; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .18s; }
.switch.on { background: var(--ok); border-color: var(--ok); }
.switch.on .knob { left: 22px; }
.switch:hover { background: var(--surface-2); } .switch.on:hover { background: var(--ok); filter: brightness(1.05); }
.lic-cell { display: flex; align-items: center; gap: .55rem; }
.lic-cell small { color: var(--muted); font-size: .78rem; }
.lic-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem 1rem; margin: 0 0 1rem; box-shadow: var(--shadow); }
.lic-bar-stats { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.lic-bar .meter { max-width: 220px; margin: 0; }
.pop-menu { position: absolute; z-index: 50; width: 260px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: .35rem; display: flex; flex-direction: column; animation: popin .12s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(-4px); } }
.pop-head { padding: .45rem .6rem .5rem; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); margin-bottom: .25rem; }
.pop-head small { color: var(--muted); }
.pop-item { justify-content: flex-start; border: 0; background: none; border-radius: 9px; min-height: 40px; padding: .4rem .6rem; display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; text-align: left; font-weight: 500; }
.pop-item small { grid-column: 2; color: var(--muted); font-weight: 400; font-size: .76rem; margin-top: -.15rem; }
.pop-item:hover, .pop-item:focus-visible { background: var(--surface-2); }
.pop-item.danger { color: var(--bad); }
.pop-item[disabled] { opacity: .45; }
.pop-menu hr { border: 0; border-top: 1px solid var(--border); margin: .25rem 0; width: 100%; }

/* --- Detalle de pantalla: ahora + historial ------------------------------------------- */
.now-hero { background: linear-gradient(120deg, var(--brand-ink), #12324f); color: #fff; border-radius: 18px; padding: 1.1rem 1.25rem; margin-bottom: 1rem; display: grid; gap: .9rem; box-shadow: var(--shadow); }
.now-main { display: flex; gap: .9rem; align-items: flex-start; }
.now-main small { color: #9fb6cf; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.now-main h2 { color: #fff; margin: .1rem 0 .15rem; font-size: 1.55rem; }
.now-main p { margin: 0; color: #c9d7e6; }
.now-main .muted { color: #9fb6cf; }
.now-dot { width: 14px; height: 14px; border-radius: 50%; background: #5a6f86; margin-top: .35rem; flex-shrink: 0; }
.qa-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.qa { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #fff; border-radius: 12px; min-height: 44px; }
.qa:hover { background: rgba(255,255,255,.16); }
.qa[disabled] { opacity: .4; }
.qa-lic { margin-left: auto; background: rgba(255,255,255,.08); border-radius: 12px; padding: .35rem .7rem; }
.qa-lic small { color: #c9d7e6; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.chip { min-height: 32px; padding: .25rem .8rem; border-radius: 999px; font-size: .82rem; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .4rem; border-left: 2px solid var(--border); }
.tl-day { margin: .9rem 0 .35rem -.4rem; padding-left: .9rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.tl-day:first-child { margin-top: 0; }
.tl-item { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .4rem 0 .4rem .2rem; margin-left: -1.05rem; }
.tl-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--surface); display: grid; place-items: center; color: var(--muted); }
.tl-ico .ico { width: 16px; height: 16px; }
.tl-item.play .tl-ico { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); color: var(--brand); }
.tl-item.ok .tl-ico { color: var(--ok); background: var(--ok-bg); } .tl-item.bad .tl-ico { color: var(--bad); background: var(--bad-bg); }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-body small { color: var(--muted); font-size: .78rem; }
.tl-item time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) { .qa-lic { margin-left: 0; } .now-main h2 { font-size: 1.25rem; } }

/* --- Galería de plantillas (nuevo diseño) ---------------------------------------------- */
dialog.modal.tg-dialog { width: min(1280px, 96vw); max-width: 96vw; }
dialog.tg-dialog .modal-body { padding: 0; }
.tg { display: grid; grid-template-columns: 210px 1fr 380px; min-height: min(70vh, 680px); max-height: 74vh; }
.tg-left { border-right: 1px solid var(--border); padding: 1rem .75rem; display: flex; flex-direction: column; gap: .75rem; overflow: auto; background: var(--surface-2); }
.tg-search input { width: 100%; }
.tg-side { display: flex; flex-direction: column; gap: .15rem; }
.tg-cat { justify-content: flex-start; border: 0; background: none; border-radius: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: .55rem; text-align: left; min-height: 40px; }
.tg-cat small { color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-cat:hover { background: var(--surface-3); }
.tg-cat.on { background: var(--brand); color: #fff; } .tg-cat.on small { color: #e0f4ff; }
.tg-center { padding: 1rem 1.1rem; overflow: auto; }
.tg-center-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .75rem; }
.tg-center-head h3 { margin: 0; }
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .85rem; }
.tg-card { display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--border); background: var(--surface); gap: 0; transition: transform .15s, box-shadow .15s, border-color .15s; min-height: 0; }
.tg-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.14); border-color: var(--border-strong); }
.tg-card.on { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
.tg-thumb { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface-3) 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; height: 146px; padding: 7px; }
.tg-thumb > * { box-shadow: 0 4px 14px rgba(0,0,0,.25); border-radius: 4px; overflow: hidden; }
.tg-meta { padding: .6rem .75rem .2rem; display: flex; flex-direction: column; }
.tg-meta small { color: var(--muted); font-weight: 400; font-family: var(--font-body); }
.tg-tags { display: flex; gap: .3rem; flex-wrap: wrap; padding: .3rem .75rem .7rem; }
.tg-tags span { font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 500; }
.tg-right { border-left: 1px solid var(--border); padding: 1rem 1.1rem; overflow: auto; display: flex; flex-direction: column; gap: .5rem; }
.tg-stage { background: radial-gradient(circle at 30% 20%, #1b3550, #0b1828); border-radius: 14px; display: grid; place-items: center; min-height: 230px; padding: 12px; }
.tg-stage > * { box-shadow: 0 10px 30px rgba(0,0,0,.45); border-radius: 4px; overflow: hidden; }
.tg-info h3 { margin: .6rem 0 .1rem; }
.tg-info p { margin: 0 0 .45rem; color: var(--muted); }
.tg-kinds { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .35rem; }
.tg-kind { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--text); }
.tg-kind .ico { width: 14px; height: 14px; color: var(--brand); }
.tg-sizes { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.tg-size { justify-content: flex-start; gap: .55rem; text-align: left; border-radius: 10px; min-height: 48px; padding: .35rem .55rem; }
.tg-size span { display: flex; flex-direction: column; line-height: 1.15; }
.tg-size small { color: var(--muted); font-weight: 400; font-size: .72rem; font-family: var(--font-body); }
.tg-size.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); box-shadow: inset 0 0 0 1px var(--brand); }
.tg-ratio { display: block !important; border: 2px solid currentColor; border-radius: 3px; flex-shrink: 0; opacity: .7; }
@media (max-width: 1000px) {
  .tg { grid-template-columns: 1fr; max-height: none; }
  .tg-left { border-right: 0; border-bottom: 1px solid var(--border); }
  .tg-side { flex-direction: row; overflow-x: auto; }
  .tg-cat { grid-template-columns: auto auto auto; white-space: nowrap; }
  .tg-right { border-left: 0; border-top: 1px solid var(--border); }
}
details.more-actions { margin: 1.25rem 0; }
details.more-actions > summary { cursor: pointer; list-style: none; }
details.more-actions > summary h2 { display: inline; }
details.more-actions > summary::before { content: '▸ '; color: var(--muted); }
details.more-actions[open] > summary::before { content: '▾ '; }
.tg-stage { overflow: hidden; }

/* --- Estudio: selector de fuentes y formas --------------------------------------------- */
.font-btn { width: 100%; justify-content: space-between; font-size: 1.05rem; min-height: 44px; }
.font-btn small { color: var(--muted); font-size: 1.1rem; }
.font-pop { position: fixed; z-index: 60; width: 330px; max-height: 430px; display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 14px 36px rgba(0,0,0,.28); padding: .6rem; }
.font-pop input { width: 100%; }
.font-list { overflow: auto; display: flex; flex-direction: column; gap: .1rem; }
.font-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: .45rem .4rem .15rem; }
.font-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: 0; background: none; border-radius: 9px; padding: .45rem .6rem; min-height: 0; text-align: left; }
.font-item span { font-size: 1.15rem; }
.font-item small { color: var(--muted); font-size: .9rem; }
.font-item:hover, .font-item:focus-visible { background: var(--surface-2); }
.font-item.on { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.shape-opt { aspect-ratio: 1; min-height: 0; padding: .45rem; border-radius: 10px; }
.shape-opt svg { width: 100%; height: 100%; fill: var(--muted); }
.shape-opt:hover svg { fill: var(--text); }
.shape-opt.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.shape-opt.on svg { fill: var(--brand); }

/* --- Detalle de pantalla: secciones más aireadas ---------------------------------------- */
.card-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.2rem 1.35rem 1.35rem; margin: 0 0 1.1rem; box-shadow: var(--shadow); }
.card-sec > h2, .card-sec .sec-head h2 { margin: 0 0 .35rem; font-size: 1.1rem; display: flex; align-items: center; gap: .45rem; }
.card-sec .help { margin: 0 0 .9rem; max-width: 70ch; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.row.gap { gap: .75rem; flex-wrap: wrap; align-items: center; }
.sec-actions { margin-top: 1.1rem; }
.dev-cards { margin-bottom: 1.1rem; }
.dev-form .name-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.dev-form .name-row .field { flex: 1; min-width: 220px; margin: 0; }
.dev-form .name-row input { font-size: 1.05rem; }
details.more-opts { margin-top: 1rem; }
details.more-opts > summary { cursor: pointer; color: var(--link); font-weight: 500; }
details.more-opts[open] > summary { margin-bottom: .75rem; }
.switch-row { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; font-weight: 600; padding: .35rem .2rem; }
.rules { display: grid; gap: .9rem; margin-top: .4rem; }
.rules.off { opacity: .5; }
.rule { border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; background: var(--surface-2); }
.rule-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem; }
.rule-head .link { margin-left: auto; }
.rule-body { display: grid; gap: .9rem; }
.times { display: flex; align-items: flex-end; gap: .9rem; flex-wrap: wrap; }
.time-f { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--muted); font-weight: 500; }
.time-f input { min-width: 150px; font-size: 1.05rem; padding: .55rem .8rem; border-radius: 12px; }
.times .arrow { color: var(--muted); font-size: 1.3rem; padding-bottom: .55rem; }
.day-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.day-pill { min-width: 52px; min-height: 40px; border-radius: 999px; padding: .3rem .85rem; font-weight: 600; background: var(--surface); }
.day-pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.presets { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: -.3rem; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.shot { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.shot figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem .7rem; font-size: .85rem; flex-wrap: wrap; }
.shot figcaption .row { gap: .35rem; }
/* Casillas y opciones del panel: más amplias y redondeadas */
input[type=checkbox] { accent-color: var(--brand); width: 18px; height: 18px; }
label.chk { gap: .55rem; padding: .45rem .8rem; border-radius: 999px; }
.st-hero { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.st-ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; flex-shrink: 0; }
.st-ring > div { width: 112px; height: 112px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.st-ring strong { font-family: var(--font-display); font-size: 1.7rem; }
.st-ring small { color: var(--muted); }
.st-hero-txt { flex: 1; min-width: 240px; }
.st-hero-txt h2 { margin: 0 0 .2rem; font-size: 1.4rem; }
.st-hero-txt p { margin: 0 0 .7rem; color: var(--muted); }
.meter.big { height: 10px; border-radius: 5px; }
.st-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; margin-top: 1rem; }
.st-kind { display: flex; align-items: center; gap: .65rem; background: var(--surface-2); border-radius: 12px; padding: .65rem .8rem; }
.st-kind div { display: flex; flex-direction: column; flex: 1; }
.st-kind small { color: var(--muted); }
.st-kpct { font-weight: 700; font-variant-numeric: tabular-nums; }
.prov-form { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.prov-form input { flex: 1; min-width: 160px; }
.prov-out { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-top: .6rem; }
.prov-qr { width: 260px; height: 260px; background: #fff; padding: 10px; border-radius: 12px; flex-shrink: 0; }
.prov-qr svg { width: 100%; height: 100%; display: block; }
.prov-out ol { margin: .4rem 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.font-list > * { flex-shrink: 0; }
.font-item { width: 100%; }

/* --- Entrega del contenido y órdenes (detalle de pantalla) ----------------- */
.hidden-slot { display: none; }
.spinner { display: inline-block; width: .85em; height: .85em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.1em; margin-right: .4rem; }
.delivery .dl-msg { margin: .2rem 0 0; color: var(--muted); }
.delivery.playing .dl-msg { color: var(--ok); font-weight: 600; }
.delivery.error .dl-msg { color: var(--bad); }
.delivery.offline .dl-msg { color: var(--warn); }
.dl-pct { font-family: var(--font-display); font-size: 1.6rem; color: var(--primary); }
.dl-steps { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; counter-reset: s; }
.dl-step { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: .7rem .75rem; border-radius: 12px; background: var(--surface-2); color: var(--muted); min-width: 0; }
.dl-step strong { font-size: .86rem; color: inherit; }
.dl-step small { font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--surface-3); color: var(--muted); }
.dl-step.done { background: var(--ok-bg); color: var(--ok); }
.dl-step.done .dl-dot { background: var(--ok); color: #fff; }
.dl-step.active { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.dl-step.active .dl-dot { background: var(--primary); color: #fff; animation: pulse 1.6s infinite; box-shadow: 0 0 0 0 var(--primary); }
.dl-step.err { background: var(--bad-bg); color: var(--bad); }
.dl-step.err .dl-dot { background: var(--bad); color: #fff; }
.dl-step.wait { background: var(--warn-bg); color: var(--warn); }
.dl-step .meter { margin-top: .1rem; }
@media (max-width: 760px) { .dl-steps { grid-template-columns: 1fr; } .dl-step { flex-direction: row; align-items: center; } .dl-step .meter { flex: 1; } }
.cmd-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.cmd-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .75rem; border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.cmd-name { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.cmd-name small { color: var(--muted); }
.mini-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: .3rem; }
.mini-steps li { display: flex; flex-direction: column; align-items: center; padding: .2rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface-3); color: var(--muted); min-width: 84px; }
.mini-steps li small { font-weight: 500; font-size: .7rem; }
.mini-steps li.done { background: var(--ok-bg); color: var(--ok); }
.mini-steps li.active { background: var(--primary-soft); color: var(--primary); }
.mini-steps li.err { background: var(--bad-bg); color: var(--bad); }
.dl-badge { display: inline-flex; align-items: center; margin-top: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.dl-badge.bad { background: var(--bad-bg); color: var(--bad); }
.dl-badge.warn { background: var(--warn-bg); color: var(--warn); }

/* --- Entrada: pestañas, Google, registro y demo ----------------------------- */
.login-tabs { display: flex; gap: .25rem; padding: .25rem; background: var(--surface-2); border-radius: 12px; margin-bottom: 1.4rem; }
.login-tabs:empty { display: none; }
.login-tab { flex: 1; border: 0; background: transparent; padding: .55rem .4rem; border-radius: 9px; font-weight: 700; font-size: .86rem; color: var(--muted); cursor: pointer; }
.login-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.login-card { max-width: 440px; }
.login-card form > .grid2 { gap: .75rem; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 44px; margin: .25rem 0 .5rem;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font-weight: 700; border-radius: var(--radius); text-decoration: none; }
.google-btn:hover { background: var(--surface-2); text-decoration: none; }
.g-logo { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font: 800 14px/1 var(--font-display);
  color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.g-logo.small { width: 18px; height: 18px; font-size: 11px; vertical-align: -3px; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; margin: .6rem 0 .9rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.switch-line { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1rem; }
.login-card label.chk { display: flex; border: 0; padding: .3rem 0; border-radius: 0; font-size: .86rem; align-items: flex-start; }
.login-card label.chk input { margin-top: .2rem; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.done-card h1 { font-size: 1.8rem; }
.terms p { margin: 0 0 .7rem; }
.notice.standalone { max-width: 560px; margin: 12vh auto; padding: 2rem; }
/* Aviso de prueba gratis */
.trial-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 clamp(16px, 2.5vw, 2rem);
  margin-top: .75rem; padding: .6rem .9rem; border-radius: 12px; background: var(--primary-soft); color: var(--text); font-weight: 600; }
.trial-banner.soon { background: var(--warn-bg); color: var(--warn); }
.trial-banner.ended { background: var(--bad-bg); color: var(--bad); }
.trial-banner .button { min-height: 34px; }
/* Comercial */
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.setup-grid .card-sec { margin: 0; }
code.copy { user-select: all; word-break: break-all; }
.contact-cell { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.contact-cell a { word-break: break-all; }
.lead-msg p { margin: 0; max-width: 38ch; white-space: pre-wrap; }
.dl-step > div:not(.meter) { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
@media (max-width: 900px) { .login-side { padding-top: 4.2rem; } .trial-banner { margin: .75rem 16px 0; } }
