/* Trabajar Menos — estilos. Paleta clara y tranquila, texto base de 16px y controles de 44px como mínimo. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --line: #dfe3ea;
  --line-strong: #c5ccd8;
  --ink: #1f2937;
  --muted: #5b6475;
  --primary: #2563eb;
  --primary-hover: #1d4fd8;
  --primary-soft: #e8f0fe;
  --primary-ink: #1849a9;
  --focus: 0 0 0 3px rgba(37, 99, 235, .35);
  --rec: #c62828;
  --rec-hover: #a91f1f;
  --rec-soft: #fdecec;
  --ok: #1a7f4b; --ok-soft: #e3f5ea;
  --err: #b42318; --err-soft: #fdeceb;
  --warn-ink: #8a5a00; --warn-soft: #fff4d6; --warn-line: #f1d48a;
  --logic: #6d4fc2; --logic-soft: #f6f3fe;
  --loop: #0d7f74; --loop-soft: #e7f6f3; --loop-line: #9ad9cf; --loop-ico: #cdeee8;
  --cat-act: #e8f0fe; --cat-wait: #fff4d6; --cat-logic: #efeafc; --cat-data: #e3f5ea; --cat-nav: #e6f6f8; --cat-other: #f1f4f9; --cat-desk: #fde8f3;
  --pro: #a21caf; --pro-soft: #fae8ff;
  --chip-bg: #e8f0fe; --chip-ink: #1849a9; --chip-line: #c7d8fb;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-xs: 13px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --h-sm: 36px; --h-md: 44px; --h-lg: 56px;
  --shadow-1: 0 1px 2px rgba(31, 41, 55, .06), 0 2px 8px rgba(31, 41, 55, .05);
  --shadow-2: 0 8px 28px rgba(31, 41, 55, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: var(--fs-md)/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.25; }

#app { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }
#app.sin-lateral { grid-template-columns: 1fr; }
#app.sin-lateral .side { display: none; }

/* ------------------------------------------------ Botones */
.btn { min-height: var(--h-md); padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
  font-size: var(--fs-md); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--err); }
.btn.big { min-height: var(--h-lg); padding: 0 24px; font-size: var(--fs-lg); border-radius: var(--r-md); }
.btn.sm { min-height: var(--h-sm); padding: 0 12px; font-size: var(--fs-sm); }
.btn.full { width: calc(100% - 32px); margin: 0 16px 10px; }
.btn.wide { width: 100%; margin-top: 18px; }
.btn.rec-start { border: 2px solid var(--rec); color: var(--rec); }
.btn.rec-start::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--rec); flex: none; }
.btn.rec-start:hover:not(:disabled) { background: var(--rec-soft); }
.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 4px 2px; font-size: var(--fs-sm); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------------------------ Barra lateral */
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 16px; }
.brand .logo { width: 42px; height: 42px; flex: none; filter: drop-shadow(0 3px 6px rgba(91, 70, 230, .3)); }
.brand b { display: block; font-size: var(--fs-md); }
.brand small { color: var(--muted); font-size: var(--fs-xs); }
.side-head { padding: 8px 18px 6px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.flows { flex: 1; overflow: auto; padding: 0 10px 10px; }
.flow-item { padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; margin-bottom: 2px; border: 1px solid transparent; }
.flow-item:hover { background: var(--surface-2); }
.flow-item.active { background: var(--primary-soft); border-color: var(--chip-line); }
.flow-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.flow-item small { color: var(--muted); font-size: var(--fs-xs); }
.flows .nada { color: var(--muted); padding: 10px; font-size: var(--fs-sm); }
.side-foot { padding: 10px 10px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.planes-box { background: var(--pro-soft); border: 1px solid #f0c4fb; border-radius: var(--r-md); padding: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.planes-t { font-weight: 700; font-size: var(--fs-sm); color: var(--pro); }
.plan-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: #fff; background: var(--primary);
  border-radius: var(--r-sm); padding: 8px 12px; font-weight: 600; min-height: 40px; }
.plan-link:hover { background: var(--primary-hover); }
.plan-link.plus { background: var(--pro); }
.plan-link.plus:hover { filter: brightness(.92); }
.planes-box .link-btn { font-size: var(--fs-xs); align-self: flex-start; }
.planes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 16px; text-decoration: none; color: var(--ink); background: var(--surface); }
.plan-card:hover { border-color: var(--primary); box-shadow: var(--focus); }
.plan-card.sugerido { border: 2px solid var(--primary); }
.plan-card b { font-size: var(--fs-lg); }
.plan-card small { color: var(--muted); flex: 1; }
.plan-card .btn { margin-top: 6px; justify-content: center; }
.plan-precio { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.1; }
.plan-tag { position: absolute; top: -10px; left: 12px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: var(--r-pill); padding: 2px 8px; }
/* Estado de la nube (cuenta de Google) */
.nube { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-md);
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer; width: 100%; }
.nube:hover { border-color: var(--line-strong); }
.nube .n-ico { font-size: 20px; flex: none; }
.nube .n-txt { min-width: 0; display: flex; flex-direction: column; }
.nube b { font-size: 14px; }
.nube small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nube.ok { background: var(--ok-soft); border-color: #bfe3cd; }
.nube.ok b { color: var(--ok); }
.nube.fuera { background: var(--primary-soft); border-color: var(--chip-line); }
.nube.fuera b { color: var(--primary-ink); }
.nube.error b { color: var(--err); }
.nube img { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.nube.cargando b, .nube.sincronizando b { color: var(--muted); }
.codigo { font: 700 30px/1.2 Consolas, "Cascadia Mono", monospace; letter-spacing: .12em; text-align: center; padding: 18px; margin: 6px 0 14px;
  background: var(--primary-soft); color: var(--primary-ink); border: 2px dashed var(--chip-line); border-radius: var(--r-md); user-select: all; }
.how-card .btn { margin-top: 8px; align-self: flex-start; text-decoration: none; }
.link { background: none; border: 0; color: var(--muted); text-align: left; padding: 8px 10px; cursor: pointer; border-radius: var(--r-sm); font-size: 15px; }
.link:hover { color: var(--ink); background: var(--surface-2); }
a.link { display: block; text-decoration: none; }

/* ------------------------------------------------ Principal */
main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.rec-bar { display: flex; align-items: center; gap: 20px; min-height: 84px; padding: 12px 24px; background: var(--rec); color: #fff; box-shadow: var(--shadow-2); z-index: 40; }
.rec-info { flex: 1; min-width: 0; }
.rec-live { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 700; white-space: nowrap; }
.rec-live::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; flex: none; }
.rec-last { font-size: var(--fs-md); opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-last.flash { animation: flash 1s ease-out; }
.rec-stop { min-height: 60px; min-width: 250px; padding: 0 28px; border: 0; border-radius: var(--r-md); background: #fff; color: var(--rec);
  font-size: 21px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.rec-stop:hover { background: var(--rec-soft); }
.rec-acts { display: flex; gap: 8px; }
.rec-btn { min-height: var(--h-md); padding: 0 16px; border: 1px solid rgba(255, 255, 255, .45); border-radius: var(--r-sm); background: rgba(255, 255, 255, .14);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rec-btn:hover { background: rgba(255, 255, 255, .26); }
.rec-btn.on { background: #fff; color: var(--warn-ink); border-color: #fff; }
.rec-bar.pausa { background: #92400e; }
.rec-bar.pausa .rec-live::before { animation: none; }
.rec-bar.pausa .rec-stop { color: #92400e; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes flash { from { background: rgba(255, 255, 255, .35); } to { background: transparent; } }

.banner-global { margin: 12px 24px 0; padding: 14px 18px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.banner-global .msg { flex: 1; white-space: pre-wrap; min-width: 240px; }

/* ------------------------------------------------ Bienvenida */
.welcome { flex: 1; display: grid; place-items: center; padding: 30px; overflow: auto; }
.welcome-box { max-width: 820px; text-align: center; }
.welcome-logo { width: 84px; height: 84px; filter: drop-shadow(0 8px 18px rgba(91, 70, 230, .35)); }
.welcome h1 { font-size: var(--fs-2xl); margin: 8px 0 26px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; text-align: left; }
.how-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 6px; }
.how-card b { font-size: var(--fs-lg); }
.how-card small { color: var(--muted); font-size: var(--fs-sm); }
.how-n { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; }
.welcome-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------ Encabezado de la tarea */
#editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.flow-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px 10px; flex-wrap: wrap; }
.flow-name { font-size: var(--fs-xl); font-weight: 700; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); padding: 4px 10px; min-width: 120px; flex: 0 1 440px; }
.flow-name:hover, .flow-name:focus { border-color: var(--line-strong); background: var(--surface); outline: none; }
.saved { color: var(--ok); font-size: var(--fs-sm); }
.saved.dirty { color: var(--muted); }
.chrome-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-pill);
  padding: 6px 14px; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; max-width: 300px; }
.chrome-pill span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chrome-pill:hover { border-color: var(--line-strong); color: var(--ink); }
.chrome-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #b8bfcc; flex: none; }
.chrome-pill.on .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.chrome-pill.busy .dot { background: var(--primary); animation: pulse 1s infinite; }
.flow-actions { margin-left: auto; display: flex; gap: 8px; }

/* Pestañas como pasos numerados */
.stepper { display: flex; gap: 10px; padding: 4px 24px 14px; border-bottom: 1px solid var(--line); }
.stepper button { flex: 1; max-width: 300px; display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-md); padding: 10px 14px; cursor: pointer; }
.stepper button:hover { border-color: var(--line-strong); }
.stepper button.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.stepper b { display: block; font-size: var(--fs-md); }
.stepper small { display: block; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.st-n { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-weight: 800; flex: none; }
.stepper .active .st-n { background: var(--primary); color: #fff; }
.st-n.done { background: var(--ok); color: #fff; }

.tab { flex: 1; min-height: 0; overflow: auto; padding: 18px 24px 60px; }
.tab.narrow > * { max-width: 900px; margin-left: auto; margin-right: auto; }

/* ------------------------------------------------ Lista de pasos */
.steps-wrap { max-width: 900px; margin: 0 auto; }
.steps-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: var(--fs-sm); }
.warn-box { background: var(--err-soft); border: 1px solid #f3c1bc; color: var(--err); padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 10px; font-size: var(--fs-sm); }
.info-box { background: var(--primary-soft); border: 1px solid var(--chip-line); color: var(--primary-ink); padding: 12px 16px; border-radius: var(--r-md); margin: 14px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.info-box span { flex: 1; min-width: 200px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.step { display: grid; grid-template-columns: 26px auto 40px minmax(0, 1fr) auto 40px; align-items: center; gap: 12px; min-height: 64px;
  padding: 10px 10px 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); cursor: pointer; position: relative; }
.step:hover { border-color: var(--line-strong); }
.step.sel { border-color: var(--primary); box-shadow: var(--focus); }
.step.sel.abierto { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.step .n { color: var(--muted); font-size: var(--fs-sm); text-align: right; font-variant-numeric: tabular-nums; }
.step .ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 19px; background: var(--cat-act); }
.step[data-cat="wait"] .ico { background: var(--cat-wait); }
.step[data-cat="logic"] .ico { background: var(--cat-logic); }
.step[data-cat="data"] .ico { background: var(--cat-data); }
.step[data-cat="nav"] .ico { background: var(--cat-nav); }
.step[data-cat="other"] .ico { background: var(--cat-other); }
.step[data-cat="desk"] .ico { background: var(--cat-desk); }
.step .frase { font-size: var(--fs-md); font-weight: 500; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.step .frase b { font-weight: 700; }
.step .frase .nota { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.var-token { background: var(--chip-bg); color: var(--chip-ink); border: 1px solid var(--chip-line); border-radius: 6px; padding: 0 6px; font-weight: 600; font-size: .94em; white-space: nowrap; }
.badge { font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.need { background: var(--warn-soft); color: var(--warn-ink); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.off { background: var(--surface-2); color: var(--muted); }
.badge.opc { background: var(--primary-soft); color: var(--primary-ink); }
.pro { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--pro); background: var(--pro-soft); border-radius: var(--r-pill); padding: 1px 8px; vertical-align: 2px; }
.chk.opcional { background: var(--primary-soft); border: 1px solid var(--chip-line); border-radius: var(--r-md); padding: 10px 12px; }
.chk.opcional small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.target.punto .opt-group { margin-bottom: 10px; }
.punto-vista { display: block; max-width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); margin-bottom: 10px; }
.punto-xy { align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); }
.step .mas-btn { width: 40px; height: 40px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; font-size: 20px; color: var(--muted); line-height: 1; }
.step .mas-btn:hover { background: var(--surface-2); color: var(--ink); }
.step .grip { cursor: grab; color: var(--line-strong); font-size: 14px; letter-spacing: -2px; }
.step.disabled { opacity: .55; }
.step.disabled .frase { text-decoration: line-through; }
.step.running { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.step.drag-over { box-shadow: 0 -3px 0 var(--primary); }
.step.st-err { border-left: 4px solid var(--err); }
.step.st-ok { border-left: 4px solid var(--ok); }
/* Bloques Si / Repetir: guía morada a la izquierda; "Si no" y "Fin" como etiquetas compactas */
.step.logic { background: var(--logic-soft); }
.step.etiqueta { min-height: 36px; padding-top: 4px; padding-bottom: 4px; box-shadow: none; background: transparent; border-style: dashed; }
.step.etiqueta .ico { width: 28px; height: 28px; font-size: 14px; background: transparent; }
.step.etiqueta .frase { color: var(--logic); font-weight: 700; font-size: var(--fs-sm); }
.indent { display: flex; align-self: stretch; margin: -10px 0; }
.indent i { width: 18px; border-left: 3px solid #d6ccf5; margin-left: 4px; }
/* Repeticiones (Repetir N veces / sin fin / mientras / con cada parecido): franja verde azulado y «↩ vuelve al paso N» */
.step.ciclo { background: var(--loop-soft); box-shadow: inset 4px 0 0 var(--loop), var(--shadow-1); }
.step.ciclo .ico { background: var(--loop-ico); }
.step.etiqueta.ciclo { background: var(--loop-soft); border-color: var(--loop-line); box-shadow: inset 4px 0 0 var(--loop); }
.step.etiqueta.ciclo .frase { color: var(--loop); }
.indent i.ciclo { border-left: 4px solid var(--loop-line); }
.step.ciclo.sel { box-shadow: inset 4px 0 0 var(--loop), var(--focus); }
.step.ciclo.running { box-shadow: inset 4px 0 0 var(--loop), 0 0 0 4px var(--primary-soft); }
/* Elegir qué pasos se repiten */
.rango-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 2px solid var(--loop); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 6px 18px rgba(13, 127, 116, .15); }
.rg-paso { display: flex; gap: 12px; align-items: center; }
.rg-paso b { display: block; font-size: var(--fs-lg); }
.rg-paso small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.rg-num { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--loop); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.rg-opciones { display: flex; flex-wrap: wrap; gap: 10px; flex-basis: 100%; }
.rg-op { flex: 1 1 200px; display: flex; gap: 10px; align-items: center; text-align: left; min-height: 60px; padding: 10px 14px; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--loop-line); border-radius: var(--r-md); cursor: pointer; }
.rg-op:hover, .rg-op:focus-visible { background: var(--loop-soft); border-color: var(--loop); outline: none; box-shadow: 0 0 0 3px rgba(13, 127, 116, .2); }
.rg-op b { display: block; font-size: var(--fs-md); }
.rg-op small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.rg-ico { font-size: 24px; }
.rg-veces { width: 64px; height: 32px; font: inherit; font-weight: 700; text-align: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); margin-right: 4px; }
.steps.eligiendo .step { cursor: pointer; }
.steps.eligiendo .mas-btn, .steps.eligiendo .grip { visibility: hidden; }
.steps.eligiendo .step:hover { border-color: var(--loop); }
.steps.eligiendo .step.sel:not(.en-rango) { border-color: var(--line); box-shadow: var(--shadow-1); }
#btnRepetir.on { border-color: var(--loop); background: var(--loop-soft); color: var(--loop); }
.step.en-rango { background: var(--loop-soft); border-color: var(--loop); box-shadow: inset 6px 0 0 var(--loop); }
.step.en-rango.previa { border-style: dashed; box-shadow: inset 6px 0 0 var(--loop-line); }
.step.rango-ini { border-top-width: 3px; }
.step.rango-fin { border-bottom-width: 3px; }
/* ¿Cuáles son los parecidos? */
.parecidos { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: var(--surface-2); }
.parecidos.missing { border: 2px dashed var(--warn-line); background: var(--warn-soft); }
.parecidos .par-n { margin-bottom: 10px; font-size: 15px; }
.parecidos .t-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.steps-empty { text-align: center; color: var(--muted); padding: 50px 20px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.steps-empty h2 { color: var(--ink); margin: 6px 0 8px; }
.steps-empty p { margin: 0 0 22px; }
.steps-empty .empty-ico { font-size: 40px; }
.steps-empty .link-btn { display: block; margin: 12px auto 0; }

/* ------------------------------------------------ Editor del paso (debajo del paso seleccionado) */
.editor { background: var(--surface); border: 1px solid var(--primary); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); margin-top: -8px;
  padding: 18px 20px 20px; box-shadow: var(--focus); list-style: none; cursor: default; }
.ed-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.ed-head .ayuda-tipo { color: var(--muted); font-size: var(--fs-sm); flex: 1; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--ink); margin-bottom: 14px; font-weight: 600; }
.fld input, .fld select, .fld textarea { font-size: var(--fs-md); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 12px; background: #fff; font-weight: 400; width: 100%; min-height: var(--h-md); }
.fld textarea { min-height: 70px; resize: vertical; }
.fld textarea.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: var(--fs-sm); min-height: 110px; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.fld .ayuda { font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.big-input { font-size: var(--fs-lg) !important; min-height: var(--h-lg) !important; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin-bottom: 10px; cursor: pointer; }
.chk input, .radio input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.chk small, .radio small { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 400; }
.chips .chips-t { font-size: var(--fs-xs); color: var(--muted); margin-right: 2px; }
.chip { min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--chip-line); background: var(--chip-bg); color: var(--chip-ink);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chip::before { content: "+"; font-weight: 800; }
.chip:hover { background: #d7e5fd; }
.chip.gris { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.chip.gris::before { content: ""; }
.formula-prev { font-size: var(--fs-xs); color: var(--ok); background: var(--ok-soft); border-radius: var(--r-sm); padding: 6px 10px; font-weight: 400; }
.formula-prev.err { color: var(--err); background: var(--err-soft); }
.formula-prev.pista { color: var(--muted); background: var(--surface-2); }
.formula-prev[hidden] { display: none; }
.fx-guia h4 { margin: 18px 0 6px; }
.fx-probar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.fx-probar input { flex: 1 1 260px; font-family: ui-monospace, Consolas, monospace; }
.fx-tabla { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.fx-tabla td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.fx-tabla td:first-child { white-space: nowrap; }
.fx-tabla .fx-res { color: var(--ok); font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .fx-tabla td:first-child, .fx-tabla .fx-res { white-space: normal; } }
details.mas { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
details.mas > summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; padding: 6px 0; }
details.mas > summary:hover { color: var(--ink); }
details.mas[open] > summary { margin-bottom: 10px; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); margin-top: 16px; }
.test-res { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-sm); font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.test-res.ok { background: var(--ok-soft); color: var(--ok); }
.test-res.err { background: var(--err-soft); color: var(--err); }
.vars-box { margin-top: 10px; font-size: var(--fs-xs); color: var(--muted); }
.vars-box code { margin-right: 4px; display: inline-block; margin-bottom: 3px; }

/* Dónde (elemento de la página) */
.target { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: var(--surface-2); }
.target.missing { border: 2px dashed var(--warn-line); background: var(--warn-soft); }
.target .t-label { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 10px; word-break: break-word; }
.target .t-none { color: var(--warn-ink); font-size: 15px; margin-bottom: 10px; font-weight: 600; }
.target .t-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.pick { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.pick:hover:not(:disabled) { background: var(--primary-hover); }
.btn.pick.on { animation: pulse 1s infinite; }
.sel-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.sel-row { display: flex; gap: 6px; align-items: center; }
.sel-row select { width: 84px !important; flex: none; min-height: 36px !important; padding: 4px 6px !important; font-size: var(--fs-xs) !important; }
.sel-row input { flex: 1; font-family: Consolas, monospace; font-size: var(--fs-xs) !important; min-height: 36px !important; padding: 4px 8px !important; }
.sel-row .badge-s { font-size: 12px; color: var(--muted); width: 72px; flex: none; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.sel-row button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px 6px; }
.sel-row button:hover { color: var(--err); }
.frame-info { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 400; }

/* ------------------------------------------------ Datos (asistente) */
.wz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.wz h2 { font-size: var(--fs-lg); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.wz-n { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 15px; flex: none; }
.source-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.source-card { min-height: 140px; padding: 18px; border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; }
.source-card .big-ico { font-size: 32px; }
.source-card b { font-size: var(--fs-lg); }
.source-card small { color: var(--muted); font-size: var(--fs-sm); }
.source-card:hover { border-color: var(--line-strong); }
.source-card[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.drop { min-height: 210px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; text-align: center; font-size: var(--fs-lg); padding: 20px; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
/* Con un archivo ya cargado, la zona se reduce a una línea para cambiarlo */
.drop.compacta { min-height: 0; flex-direction: row; padding: 12px 16px; font-size: var(--fs-md); gap: 12px; }
.drop.compacta .drop-ico { font-size: 22px; }
.drop.compacta small { display: none; }
.drop.compacta .btn { min-height: var(--h-sm); font-size: var(--fs-sm); }
.drop-ico { font-size: 38px; }
.pegar-lista { margin-top: 16px; }
.pegar-lista .fld { margin-bottom: 8px; }
.pegar-lista textarea { font-family: Consolas, "Cascadia Mono", monospace; font-size: var(--fs-sm); white-space: pre; }
.drop small { font-size: var(--fs-sm); }
.pills-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.pills-row:empty { display: none; }
.pills-row .t { font-size: var(--fs-sm); color: var(--muted); margin-right: 4px; }
.pill-btn { min-height: var(--h-sm); padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: var(--fs-sm); }
.pill-btn:hover { background: var(--surface-2); }
.pill-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.data-status { margin-top: 14px; padding: 12px 16px; border-radius: var(--r-md); font-size: 15px; white-space: pre-wrap; }
.data-status.cargando { background: var(--surface-2); color: var(--muted); }
.data-status.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.data-status.err { background: var(--err-soft); color: var(--err); }
.col-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; }
.col-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; min-height: var(--h-lg); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.col-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.col-card input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.col-card b { display: block; overflow-wrap: anywhere; }
.col-card small { color: var(--muted); font-size: var(--fs-sm); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.test-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.wz-foot { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ------------------------------------------------ Tarjetas, tablas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.card h3 { margin: 0; font-size: var(--fs-lg); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.row.tight { gap: 10px; align-items: center; }
.row .fld { min-width: 160px; }
.num { width: 120px !important; }
.inline { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; color: var(--muted); }
.inline input[type=number] { width: 80px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 6px 8px; min-height: 38px; }
.muted { color: var(--muted); font-weight: 400; }
.help { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; margin: 0 0 12px; }
.table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.tbl { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
.tbl th, .tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tbl th { background: var(--surface-2); position: sticky; top: 0; font-weight: 600; z-index: 1; }
.tbl tr.prueba td { background: var(--warn-soft); }
.tbl td.n { color: var(--muted); font-variant-numeric: tabular-nums; }
.tbl td.msg { white-space: normal; min-width: 240px; max-width: 460px; }
.tag { padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.error { background: var(--err-soft); color: var(--err); }
.tag.saltada { background: var(--warn-soft); color: var(--warn-ink); }

/* ------------------------------------------------ Ejecutar */
.run-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 26px; box-shadow: var(--shadow-1); margin-bottom: 16px; }
.run-status { font-size: var(--fs-xl); font-weight: 700; }
.run-now { color: var(--muted); margin-top: 4px; min-height: 24px; }
.run-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-title { font-weight: 700; margin-bottom: 2px; }
.radio { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; cursor: pointer; }
.num.sm { width: 80px !important; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 6px 8px; min-height: 38px; }
.progress { height: 16px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin: 18px 0; }
.progress > div { height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.run-pasos-wrap { margin-top: 18px; }
.run-pasos-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px;
  font-size: var(--fs-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.run-pasos-head .link-btn { text-transform: none; letter-spacing: 0; }
/* Se ven 3 pasos: el relleno de arriba y abajo (una fila) deja centrar también el primero y el último */
.run-pasos { --fila: 50px; list-style: none; margin: 0; padding: var(--fila) 0; position: relative; height: calc(var(--fila) * 3);
  box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y proximity; scroll-padding: var(--fila) 0;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.run-pasos:focus-visible { outline: none; box-shadow: var(--focus); }
.run-paso { height: var(--fila); box-sizing: border-box; display: grid; grid-template-columns: 28px 30px minmax(0, 1fr) 24px; align-items: center;
  gap: 10px; padding: 0 12px 0 calc(8px + var(--prof, 0) * 18px); scroll-snap-align: center; cursor: pointer; color: var(--muted); }
.run-paso:hover { background: var(--surface); }
.run-paso .n { text-align: right; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.run-paso .ico { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 15px; background: var(--cat-act); }
.run-paso[data-cat="wait"] .ico { background: var(--cat-wait); }
.run-paso[data-cat="logic"] .ico { background: var(--cat-logic); }
.run-paso[data-cat="data"] .ico { background: var(--cat-data); }
.run-paso[data-cat="nav"] .ico { background: var(--cat-nav); }
.run-paso[data-cat="desk"] .ico { background: var(--cat-desk); }
.run-paso .frase { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-paso .editar { opacity: 0; font-size: 14px; }
.run-paso:hover .editar, .run-paso.actual .editar { opacity: 1; }
.run-paso.off .frase { text-decoration: line-through; }
.run-paso.actual { background: var(--primary-soft); color: var(--ink); font-weight: 600; box-shadow: inset 4px 0 0 var(--primary); }
.run-paso.actual .n { color: var(--primary-ink); }
.counter { border-radius: var(--r-md); padding: 12px 16px; font-weight: 600; }
.counter b { display: block; font-size: var(--fs-2xl); line-height: 1.1; }
.counter.ok { background: var(--ok-soft); color: var(--ok); }
.counter.err { background: var(--err-soft); color: var(--err); }
.counter.skip { background: var(--warn-soft); color: var(--warn-ink); }
.review-card { background: var(--warn-soft); border: 2px solid var(--warn-line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 16px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.review-msg { flex: 1; white-space: pre-wrap; min-width: 240px; }
.review-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.opc-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 0 7px; vertical-align: 2px; margin-left: 4px; }
.wz.explica { background: var(--primary-soft); border-color: var(--chip-line); }
.wz.explica h2 { font-size: var(--fs-lg); }
.explica-pasos { margin: 8px 0; padding-left: 22px; display: grid; gap: 6px; }
/* Datos: la tabla con sus columnas y filas */
.datos-cuenta { font-size: var(--fs-md); margin-left: 4px; }
.datos-barra { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow-1); }
.datos-pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.grid-datos { max-height: 440px; background: var(--surface); }
.grid-datos .tbl th, .grid-datos .tbl td { padding: 9px 12px; }
.grid-datos th.col-t { cursor: pointer; user-select: none; white-space: nowrap; }
.grid-datos th.col-t.usada { background: var(--primary-soft); color: var(--primary-ink); }
.grid-datos th.col-t:hover { box-shadow: inset 0 -2px 0 var(--primary); }
.grid-datos th.col-t .marca { margin-right: 7px; vertical-align: -5px; }
.grid-datos .sin-usar { opacity: .4; }
.grid-datos .c-chk { width: 40px; text-align: center; }
.grid-datos .c-n, .grid-datos td.n { width: 44px; }
.grid-datos tbody tr { cursor: pointer; user-select: none; }
.grid-datos tbody tr:hover td { background: var(--primary-soft); }
.grid-datos tbody tr.no-marcada td { opacity: .4; }
.grid-datos tbody tr.no-marcada td.c-chk { opacity: 1; }
.marca { display: inline-flex; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-strong); background: var(--surface);
  align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; box-sizing: border-box; }
.marca.on { background: var(--primary); border-color: var(--primary); }
/* Ejecutar: ¿cómo correrla? */
.opt-group.ancho { grid-column: 1 / -1; }
.modo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modo-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); cursor: pointer; }
.modo-card:hover { border-color: var(--line-strong); }
.modo-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.modo-card input { position: absolute; opacity: 0; pointer-events: none; }
.modo-ico { font-size: 28px; line-height: 1; }
.modo-card b { display: block; font-size: var(--fs-md); margin-bottom: 2px; }
.modo-card small { display: block; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
kbd { font: 600 12px var(--font); padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
@media (max-width: 720px) {
  .modo-cards { grid-template-columns: 1fr; }
}
.run-buttons { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.log { background: #111827; color: #d1d5db; font-family: Consolas, "Cascadia Mono", monospace; font-size: var(--fs-xs); border-radius: var(--r-sm); padding: 10px 12px; height: 280px; overflow: auto; line-height: 1.55; margin-top: 8px; }
.log div { white-space: pre-wrap; word-break: break-word; }
.log .t { color: #6b7280; margin-right: 8px; }
.log .ok { color: #86efac; }
.log .error { color: #fca5a5; }
.log .warn { color: #fde68a; }
.log .fila { color: #fff; font-weight: 700; margin-top: 6px; }
.log .titulo { color: #a5b4fc; font-weight: 700; }
.log .logica { color: #c4b5fd; }

/* ------------------------------------------------ Ventanas, menús y avisos */
.modal { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-box { background: var(--surface); border-radius: var(--r-lg); max-width: 880px; width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-box.small { max-width: 500px; }
.m-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.m-head h3 { margin: 0; font-size: var(--fs-lg); }
.m-body { padding: 18px 22px; }
.m-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x { border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); width: 40px; height: 40px; border-radius: var(--r-sm); }
.x:hover { background: var(--surface-2); }
.palette h5 { margin: 18px 0 10px; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.palette h5:first-child { margin-top: 0; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pal-item { display: flex; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; background: #fff; cursor: pointer; align-items: flex-start; }
.pal-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.pal-item .ico { font-size: 19px; width: 38px; height: 38px; display: grid; place-items: center; background: var(--surface-2); border-radius: var(--r-sm); flex: none; }
.pal-item b { display: block; font-size: 15px; }
.pal-item small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.pal-search { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 14px; min-height: var(--h-md); }
.pal-todos { margin-top: 16px; }
.menu { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 6px; max-height: 360px; overflow: auto; min-width: 220px; }
.menu .m-sec { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 4px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; font-size: 15px; }
.menu button:hover { background: var(--surface-2); }
.menu button.peligro { color: var(--err); }
.menu .empty-m { padding: 8px 10px; color: var(--muted); font-size: var(--fs-sm); }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-2); max-width: 440px; font-size: 15px; animation: tin .2s; white-space: pre-wrap; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1000px) {
  #app { grid-template-columns: 1fr; }
  .side { display: none; }
  .how, .source-cards, .run-opts { grid-template-columns: 1fr; }
  .rec-bar { flex-wrap: wrap; }
  .rec-acts { width: 100%; }
  .rec-stop { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Aviso de la versión en el otro idioma (abajo a la izquierda, se puede cerrar) */
.aviso-idioma { position: fixed; left: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  background: var(--surface, #fff); border: 1px solid var(--line, #e3e7ef); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: 14px; }
.aviso-idioma a { font-weight: 700; text-decoration: none; }
.aviso-idioma .x { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: inherit; opacity: .6; padding: 0 6px; }

/* ------------------------------------------------ Video y manual de entrenamiento */
.modal-box.wide { max-width: 1180px; }
.vid-chip { margin-left: 8px; padding: 1px 9px; border: 1px solid var(--chip-line); border-radius: var(--r-pill); background: var(--chip-bg); color: var(--chip-ink);
  font-size: var(--fs-xs); font-weight: 600; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.vid-chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.vid-partes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.vid-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.vid-player { width: 100%; display: block; background: #000; border-radius: var(--r-md); }
.vid-info { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); }
.vid-info span { margin-right: auto; }
.link-btn.peligro { color: var(--err); }
.vid-caps { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; }
.vid-caps h5 { margin: 4px 8px 6px; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.vid-cap { width: 100%; display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: baseline; text-align: left;
  padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; color: inherit; font: inherit; cursor: pointer; }
.vid-cap:hover { background: var(--surface-2); }
.vid-cap.actual { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.vid-cap .vid-t { color: var(--primary); font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.vid-cap .n { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.vid-cap .frase { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.vid-cap .frase .nota { display: block; color: var(--muted); }
.vid-vacio { text-align: center; padding: 36px 20px; background: var(--surface-2); border-radius: var(--r-md); }
.vid-vacio .empty-ico { font-size: 40px; }
.vid-vacio h3 { margin: 6px 0; }
.vid-vacio p { max-width: 560px; margin: 8px auto; }
.vid-notas-l { display: block; margin-top: 18px; }
.vid-notas-l small { display: block; color: var(--muted); font-size: var(--fs-sm); margin-bottom: 6px; }
.vid-notas { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font: inherit; resize: vertical; }
.rec-btn#btnRecVideo.on { background: #fff; color: var(--rec); border-color: #fff; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .vid-layout { grid-template-columns: 1fr; } .vid-caps { max-height: 40vh; } }

/* ------------------------------------------------ Mis datos recolectados (3 · Ejecutar) */
#cardRecolectados { border-color: var(--loop-line); }
.rec-cuenta { font-weight: 500; font-size: var(--fs-sm); }
.rec-ayuda { margin: 0 0 10px; }
#tablaRec caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: var(--fs-xs); padding-top: 6px; }
