/* AutoLeads — «Dónde trabaja»: la app se instala, se queda en la bandeja y trabaja en segundo plano.
   Sistema «Tinta y marfil» (docs/brand/BRAND.md): solo tokens de site.css, esquinas de 8–18 px,
   sin píldoras ni degradados de color. Sin .dt-js (sin JS o con «reducir movimiento») se ve el
   estado final; donde-trabaja.js añade .dt-js y las fases .p1 … .p11 sobre .dt-art. */

.dt-fig {
  margin: 0; display: grid; column-gap: 56px; row-gap: 22px;
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas: "pick stage" "notes stage" ". steps" ". fine";
}
.dt-pick { grid-area: pick; display: grid; gap: 8px; align-content: start; }
.dt-notes { grid-area: notes; }
.dt-stage { grid-area: stage; }
.dt-steps { grid-area: steps; }
.dt-fine { grid-area: fine; }

/* Selector de equipo */
.dt-pick-label { font: 600 12.5px/1 var(--sans); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.dt-dev {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2);
  font: 500 15px/1.25 var(--sans); text-align: left; cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease);
}
.dt-dev:hover { border-color: var(--line-2); color: var(--ink); }
.dt-dev svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-3); transition: color 200ms var(--ease); }
.dt-dev[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.dt-dev[aria-pressed="true"] svg { color: var(--accent); }

.dt-notes p { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); padding-left: 16px; border-left: 2px solid var(--accent); }

/* Escenario */
.dt-stage { position: relative; container: dt-stage / inline-size; background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px; padding: 48px 40px 36px; overflow: hidden; }
.dt-stage::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 18px 18px; opacity: 0.5; pointer-events: none; }
.dt-art { position: relative; max-width: 780px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 26px; align-items: end; }
.dt-replay { position: absolute; top: 12px; right: 12px; z-index: 2; gap: 8px; height: 34px; padding: 0 12px; font-size: 13px; opacity: 0; visibility: hidden; transition: opacity 400ms var(--ease), visibility 0s linear 400ms; }
.dt-fig.dt-ended .dt-replay { opacity: 1; visibility: visible; transition-delay: 0s; }

/* Equipo: pantalla, peana y lo que cambia según el caso */
.dt-device { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 12px; padding-bottom: 0; }
.dt-device::after { content: ""; position: absolute; left: -4%; right: -4%; bottom: 0; height: 1.5px; background: var(--line-2); }
.dt-main { position: relative; z-index: 1; }
.dt-monitor { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 9px; box-shadow: var(--shadow-2); }
.dt-stand { position: relative; display: grid; justify-items: center; }
.dt-neck { display: block; width: 12%; height: 26px; background: var(--surface); border: 1px solid var(--line-2); border-top: 0; border-bottom: 0; }
.dt-foot { display: block; width: 36%; height: 9px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px 8px 2px 2px; }
.dt-extra { display: none; position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-1); }
.dt-led { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* Portátil: base plana con muesca */
.dt-fig[data-device="laptop"] .dt-monitor { border-radius: 14px 14px 4px 4px; }
.dt-fig[data-device="laptop"] .dt-stand { height: 13px; margin: 0 -7%; background: var(--surface); border: 1px solid var(--line-2); border-top: 0; border-radius: 0 0 14px 14px; }
.dt-fig[data-device="laptop"] .dt-stand::before { content: ""; position: absolute; top: 0; left: 43%; right: 43%; height: 4px; border-radius: 0 0 6px 6px; background: var(--line-2); }
.dt-fig[data-device="laptop"] .dt-neck, .dt-fig[data-device="laptop"] .dt-foot { display: none; }
/* Oficina: torre al lado */
.dt-fig[data-device="office"] .dt-extra { display: block; width: 58px; height: 168px; }
.dt-fig[data-device="office"] .dt-extra::before { content: ""; position: absolute; left: 12px; right: 12px; top: 16px; height: 22px; border-top: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); }
.dt-fig[data-device="office"] .dt-led { left: 12px; top: 52px; }
/* Siempre encendido: mini PC con su luz */
.dt-fig[data-device="always"] .dt-extra { display: block; width: 96px; height: 30px; }
.dt-fig[data-device="always"] .dt-extra::before { content: ""; position: absolute; left: 12px; top: 13px; width: 34px; height: 1.5px; background: var(--line-2); box-shadow: 0 -4px 0 var(--line-2); }
.dt-fig[data-device="always"] .dt-led { right: 12px; top: 11px; }

/* Pantalla: escritorio, barra de tareas, bloqueo y panel de la bandeja */
.dt-screen { position: relative; container: dt-screen / inline-size; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--paper-3); display: flex; flex-direction: column; }
.dt-desk { position: relative; flex: 1; }
.dt-bar { position: relative; z-index: 3; display: flex; align-items: center; gap: 1.4cqw; height: clamp(22px, 5.6cqw, 32px); padding: 0 2.2cqw; background: var(--surface); border-top: 1px solid var(--line); }
.dt-bar > i { flex: none; display: block; height: clamp(9px, 2.6cqw, 15px); border-radius: 3px; border: 1.5px solid var(--line-2); }
.dt-start { width: clamp(9px, 2.6cqw, 15px); }
.dt-search { width: 15cqw; background: var(--paper-2); border-color: var(--line) !important; }
.dt-task { width: clamp(9px, 2.6cqw, 15px); }
.dt-tray { margin-left: auto; display: flex; align-items: center; gap: 1.4cqw; }
.dt-tray-mark { width: clamp(12px, 3cqw, 17px); height: auto; border-radius: 3px; box-shadow: 0 0 0 1px var(--night-line); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
/* Pantalla bloqueada: la barra se apaga, el icono de la bandeja sigue */
.dt-bar, .dt-bar > i, .dt-bar .dt-now { transition: background-color 900ms var(--ease), border-color 900ms var(--ease), color 900ms var(--ease); }
.dt-art:not(.dt-js) .dt-bar, .dt-js.p6 .dt-bar { background: var(--night); border-top-color: var(--night-line); }
.dt-art:not(.dt-js) .dt-bar > i, .dt-js.p6 .dt-bar > i { border-color: var(--night-line) !important; background: transparent; }
.dt-art:not(.dt-js) .dt-bar .dt-now, .dt-js.p6 .dt-bar .dt-now { color: var(--night-sub); }
.dt-bar .dt-now { font: 500 clamp(9px, 1.9cqw, 11.5px)/1 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }

.dt-win { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-2); overflow: hidden; opacity: 0; pointer-events: none; }
.dt-title { display: flex; align-items: center; gap: 1.2cqw; height: clamp(18px, 4.6cqw, 26px); padding: 0 1.8cqw; background: var(--paper-2); border-bottom: 1px solid var(--line); font: 600 clamp(9px, 1.9cqw, 11.5px)/1 var(--sans); color: var(--ink-2); white-space: nowrap; }
.dt-title img { width: clamp(10px, 2.4cqw, 14px); height: auto; border-radius: 3px; }
/* Botones de ventana genéricos: guion, cuadro, aspa */
.dt-ctl { position: relative; margin-left: auto; width: 9cqw; height: 100%; }
.dt-ctl::before, .dt-ctl::after { content: ""; position: absolute; top: 50%; }
.dt-ctl::before { left: 0; width: 1.6cqw; height: 0; border-top: 1.5px solid var(--ink-3); }
.dt-ctl::after { left: 3.6cqw; width: 1.4cqw; height: 1.4cqw; margin-top: -0.7cqw; border: 1.5px solid var(--ink-3); border-radius: 1px; box-shadow: 3.2cqw 0 0 -0.4cqw var(--surface), 3.2cqw 0 0 0 var(--line-2); }

.dt-installer { left: 21cqw; top: 13cqw; width: 58cqw; transform: translateY(1.5cqw) scale(0.98); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.dt-ins-body { display: flex; align-items: center; gap: 2.6cqw; padding: 3.2cqw 3.2cqw 3.6cqw; }
.dt-ins-body img { width: clamp(24px, 7.4cqw, 42px); height: auto; border-radius: 6px; }
.dt-ins-body > div { flex: 1; min-width: 0; }
.dt-ins-body b { display: block; font: 500 clamp(12px, 3cqw, 17px)/1.1 var(--serif); }
.dt-ins-body small { display: block; margin-top: 0.6cqw; font-size: clamp(9px, 1.9cqw, 11.5px); color: var(--ink-3); white-space: nowrap; }
.dt-ins-busy { display: none; }
.dt-ins-done { color: var(--ok); font-weight: 600; }
.dt-track { display: block; margin-top: 1.6cqw; height: clamp(4px, 1.1cqw, 6px); border-radius: 4px; background: var(--paper-3); overflow: hidden; }
.dt-fill { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform 900ms var(--ease); }

.dt-app { left: 16cqw; top: 6cqw; width: 68cqw; height: 44cqw; transform: translate(36cqw, 30cqw) scale(0.05); transition: opacity 600ms var(--ease), transform 750ms var(--ease); }
.dt-app-body { display: flex; height: calc(100% - clamp(18px, 4.6cqw, 26px)); }
.dt-side { width: 13cqw; padding: 2.4cqw 1.8cqw; display: grid; gap: 1.6cqw; align-content: start; background: var(--paper-2); border-right: 1px solid var(--line); }
.dt-side i { display: block; height: clamp(4px, 1cqw, 6px); border-radius: 3px; background: var(--line-2); }
.dt-side i:first-child { background: var(--accent); width: 70%; }
.dt-app-main { flex: 1; min-width: 0; padding: 2.4cqw 3cqw; }
.dt-app-main > b { display: block; font: 500 clamp(13px, 3.6cqw, 20px)/1 var(--serif); }
.dt-ok { display: flex; align-items: center; gap: 1cqw; margin-top: 1.2cqw; font-size: clamp(9px, 1.9cqw, 11.5px); color: var(--ok); font-weight: 600; white-space: nowrap; }
.dt-ok::before { content: ""; width: 1.3cqw; height: 1.3cqw; min-width: 5px; min-height: 5px; border-radius: 50%; background: var(--ok); }
.dt-row { display: flex; align-items: center; gap: 1.8cqw; margin-top: 2.4cqw; padding-top: 2.2cqw; border-top: 1px solid var(--line); }
.dt-row i { flex: none; width: 4.4cqw; height: 4.4cqw; border-radius: 50%; background: var(--accent-soft); }
.dt-row span { flex: 1; height: clamp(4px, 1.1cqw, 7px); border-radius: 3px; background: var(--paper-3); box-shadow: 0 2.2cqw 0 -0.2cqw var(--paper-2); max-width: 70%; }

.dt-lock { position: absolute; inset: 0; z-index: 2; padding: 6cqw 6.5cqw; background: var(--night); color: var(--night-ink); transition: opacity 900ms var(--ease); }
.dt-lock b { display: block; font: 420 clamp(26px, 10cqw, 56px)/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dt-lock span { display: block; margin-top: 1.6cqw; font-size: clamp(10px, 2.3cqw, 13.5px); color: var(--night-sub); }

.dt-fly { position: absolute; z-index: 4; right: 2.4cqw; bottom: calc(clamp(22px, 5.6cqw, 32px) + 2.4cqw); width: 56cqw; padding: 2.4cqw 2.8cqw 1.6cqw; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.dt-fly-head { display: flex; align-items: center; gap: 1.6cqw; padding-bottom: 1.6cqw; border-bottom: 1px solid var(--line); }
.dt-fly-head img { width: clamp(14px, 3.6cqw, 20px); height: auto; border-radius: 4px; }
.dt-fly-head b { display: block; font-size: clamp(10.5px, 2.2cqw, 13px); line-height: 1.2; }
.dt-fly-head small { display: block; font-size: clamp(9px, 1.8cqw, 11px); line-height: 1.3; color: var(--ink-3); white-space: nowrap; }
.dt-log { list-style: none; margin: 0; padding: 0; }
.dt-log li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 1.8cqw; padding: 1.1cqw 0; font-size: clamp(10px, 2.1cqw, 12.5px); line-height: 1.3; color: var(--ink-2); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.dt-log li + li { border-top: 1px solid var(--line); }
.dt-log time { font: 500 clamp(9px, 1.8cqw, 11px)/1.3 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dt-log span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-log b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dt-l2 b { color: var(--ok); }
.dt-l3 span { color: var(--ink); }
.dt-l4 span { color: var(--accent); font-weight: 600; }

/* Móvil del comercial */
.dt-phone { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 6px; box-shadow: var(--shadow-2); aspect-ratio: 9 / 17.5; transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.dt-phone-screen { height: 100%; border-radius: 13px; background: var(--night); padding: 22px 8px 8px; display: flex; flex-direction: column; align-items: stretch; }
.dt-phone-clock { display: block; text-align: center; font: 420 34px/1 var(--serif); color: var(--night-ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dt-notif { margin-top: 18px; padding: 8px 9px 10px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-2); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.dt-notif small { display: flex; align-items: center; gap: 6px; font-size: 10.5px; line-height: 1; color: var(--ink-3); }
.dt-notif small img { width: 13px; height: 13px; border-radius: 3px; }
.dt-notif-body { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 7px; margin-top: 8px; align-items: center; }
.dt-notif .avatar { width: 26px; height: 26px; font-size: 10px; }
.dt-notif-body > div { display: contents; }
.dt-notif b { display: block; font-size: 11.5px; line-height: 1.25; color: var(--ink); }
.dt-notif p { grid-column: 1 / -1; margin-top: 6px; font-size: 10.5px; line-height: 1.35; color: var(--ink-2); }

/* Pasos, sincronizados con la animación */
.dt-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.dt-steps li { padding-top: 14px; border-top: 2px solid var(--line-2); transition: border-color 500ms var(--ease); }
.dt-steps span { display: block; font: 500 12px/1 var(--mono); color: var(--ink-3); transition: color 500ms var(--ease); }
.dt-steps b { display: block; margin-top: 10px; font-size: 15px; line-height: 1.3; }
.dt-steps p { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.dt-steps .dt-on, .dt-steps .dt-done { border-top-color: var(--accent); }
.dt-steps .dt-on span { color: var(--accent); }
.dt-fine { font-size: 12.5px; color: var(--ink-3); }

/* Fases (solo con .dt-js; sin él, todo en su estado final) */
.dt-reset, .dt-reset * { transition: none !important; }
.dt-js:not(.p2) .dt-fill { transform: scaleX(0); }
.dt-js:not(.p3) .dt-ins-busy { display: inline; }
.dt-js:not(.p3) .dt-ins-done { display: none; }
.dt-js.p1:not(.p4) .dt-installer { opacity: 1; transform: none; }
.dt-js.p4 .dt-installer { transform: scale(0.98); }
.dt-js:not(.p4) .dt-app { transform: scale(0.96); }
.dt-js.p4:not(.p5) .dt-app { opacity: 1; transform: none; }
.dt-js:not(.p5) .dt-tray-mark { opacity: 0; transform: scale(0.6); }
.dt-js:not(.p6) .dt-lock { opacity: 0; }
.dt-js:not(.p6) .dt-phone { opacity: 0; transform: translateX(14px); }
.dt-js:not(.p7) .dt-fly { opacity: 0; transform: translateY(2.4cqw); }
.dt-js:not(.p7) .dt-l1, .dt-js:not(.p8) .dt-l2, .dt-js:not(.p9) .dt-l3, .dt-js:not(.p10) .dt-l4 { opacity: 0; transform: translateY(1cqw); }
.dt-js:not(.p11) .dt-notif { opacity: 0; transform: translateY(-8px); }

@media (max-width: 1080px) {
  .dt-fig { column-gap: 36px; grid-template-columns: minmax(0, 230px) minmax(0, 1fr); }
  .dt-stage { padding: 48px 28px 28px; }
  .dt-art { grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; }
  .dt-phone-clock { font-size: 28px; }
}
@media (max-width: 900px) {
  .dt-fig { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "pick" "stage" "notes" "steps" "fine"; }
  .dt-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dt-pick-label { grid-column: 1 / -1; }
  .dt-dev { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 14px; }
  .dt-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
}
@media (max-width: 640px) {
  .dt-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-dev { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13.5px; }
  .dt-dev svg { width: 20px; height: 20px; }
  .dt-stage { padding: 54px 14px 18px; border-radius: 14px; }
  .dt-device { column-gap: 8px; }
  .dt-fig[data-device="office"] .dt-extra { width: 26px; height: 88px; }
  .dt-fig[data-device="office"] .dt-extra::before { left: 6px; right: 6px; top: 10px; height: 12px; }
  .dt-fig[data-device="office"] .dt-led { left: 6px; top: 30px; width: 5px; height: 5px; }
  .dt-fig[data-device="always"] .dt-extra { position: absolute; right: 6%; bottom: 0; width: 56px; height: 20px; }
  .dt-fig[data-device="always"] .dt-extra::before { left: 8px; top: 9px; width: 20px; }
  .dt-fig[data-device="always"] .dt-led { right: 8px; top: 6px; }
  .dt-monitor { padding: 6px; border-radius: 10px; }
  .dt-fig[data-device="laptop"] .dt-stand { margin: 0 -4%; height: 10px; }
  .dt-device::after { left: -2%; right: -2%; }
  .dt-fig[data-device="laptop"] .dt-monitor { border-radius: 10px 10px 4px 4px; }
  .dt-neck { height: 16px; }
  .dt-steps { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dt-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; padding-top: 12px; }
  .dt-steps span { grid-row: span 2; padding-top: 3px; }
  .dt-steps b { margin-top: 0; }
}
@media (max-width: 360px) {
  .dt-dev { font-size: 13px; padding: 9px 10px; gap: 8px; }
}

/* Escenario estrecho: el aviso del móvil pasa debajo del equipo */
@container dt-stage (max-width: 620px) {
  .dt-art { grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 560px; }
  .dt-notif-body { align-items: start; column-gap: 12px; }
  .dt-notif p { grid-column: 2; margin-top: 2px; }
  .dt-notif .avatar { grid-row: span 2; }
  .dt-phone { aspect-ratio: auto; background: none; border: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .dt-phone-screen { background: none; padding: 0; border-radius: 0; }
  .dt-phone-clock { display: none; }
  .dt-notif { margin-top: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
  .dt-notif small { font-size: 11.5px; }
  .dt-notif .avatar { width: 32px; height: 32px; font-size: 11.5px; }
  .dt-notif b { font-size: 14px; }
  .dt-notif p { font-size: 13px; }
  .dt-js:not(.p6) .dt-phone { transform: none; }
}
@container dt-screen (max-width: 380px) {
  .dt-installer { left: 9cqw; width: 82cqw; top: 10cqw; }
  .dt-app { left: 7cqw; width: 86cqw; top: 4cqw; height: 48cqw; }
  .dt-fly { width: 86cqw; right: 7cqw; padding: 2.6cqw 3.4cqw 1.4cqw; }
  .dt-lock { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 3cqw; padding: 5cqw 7cqw; }
  .dt-lock span { margin-top: 0; }
  .dt-search { width: 22cqw; }
}
@container dt-stage (max-width: 460px) {
  .dt-screen { aspect-ratio: 4 / 3; }
}
@container dt-stage (max-width: 400px) {
  .dt-screen { aspect-ratio: 5 / 4; }
  .dt-lock b { font-size: clamp(22px, 10cqw, 56px); }
}
