/* BlancoLab · Diagnóstico gratis. Usa las variables y componentes de styles.css (.btn, .field, .gap-chart, .data-table). */
.diag [hidden], .diag-hero [hidden] { display: none !important; }
.diag-hero { padding-bottom: 48px; }
.diag-hero h1 { max-width: 22ch; }
.diag-start { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.diag-privacy, .diag-foot { color: var(--muted); font-size: 0.95rem; max-width: 60ch; margin: 0; }
.diag-noscript { border-left: 3px solid var(--blue); padding-left: 16px; max-width: 60ch; }
.diag-foot-sec { padding: 32px 0; }
button.btn { cursor: pointer; }
.diag button.btn-line { background: transparent; }
.btn-solid { background: var(--blue); color: #fff; }
.btn-solid:hover { background: #075985; }

.diag { padding-top: 48px; }
.diag-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; margin: 0 0 24px; }
.diag h2[tabindex], .diag h3[tabindex] { scroll-margin-top: 16px; }
.diag h2:focus, .diag h3:focus { outline: none; }
.diag h2:focus-visible, .diag h3:focus-visible { outline: 3px solid var(--amber); }
.diag-help { color: var(--muted); font-size: 0.95rem; margin: 4px 0 12px; }
.diag-notice { font-weight: 600; min-height: 1.6em; margin: 8px 0; }
.diag-intro { max-width: 64ch; }

/* Paso 1 */
.diag-progress { margin: 4px 0 28px; max-width: 420px; }
.diag-progress p { margin: 0 0 6px; color: var(--muted); font-size: 0.95rem; }
.diag-progress-track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.diag-progress-track span { display: block; height: 100%; width: 33%; background: var(--blue); transition: width 0.3s ease; }
.diag-q { border: 0; padding: 0; margin: 0 0 32px; min-width: 0; }
.diag-q legend, .diag-part legend { font: 700 1.25rem/1.3 var(--display); padding: 0; margin-bottom: 4px; }
.diag-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.diag-opts-1 { grid-template-columns: 1fr; }
.diag-opt {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; cursor: pointer;
  border: 1px solid #94a3b8; border-radius: var(--radius); background: var(--paper);
}
.diag-opt input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--blue); }
.diag-opt:hover { border-color: var(--blue); }
.diag-opt:has(input:checked) { border: 2px solid var(--blue); padding: 11px 15px; background: rgba(3, 105, 161, 0.08); font-weight: 600; }
.diag-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.diag-nav #d-next { margin-left: auto; }

/* Resultado del paso 1 */
.diag-res1-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.diag-label { display: inline-block; font: 700 0.875rem var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--link); margin: 0 0 8px; }
.diag-chart { padding: 24px 0 0; border: 0; background: none; }
.diag-chart .gap-label span:last-child { color: var(--muted); font-weight: 500; }
.diag-recs { list-style: none; padding: 0; margin: 0; }
.diag-recs li { border-left: 3px solid var(--blue); padding: 2px 0 2px 16px; margin-bottom: 14px; }
.diag-invite { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 28px; }
.diag-links p { margin: 8px 0 0; color: var(--muted); }
.diag-link { font: inherit; color: var(--link); background: none; border: 0; padding: 10px 2px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.diag-status { white-space: pre-wrap; font-weight: 600; min-height: 1.6em; }

/* Paso 2 */
.diag-part { border: 1px solid var(--line); }
.diag-part fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.diag-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.diag-part .field { margin-top: 12px; }
.diag-fields .field { margin-top: 0; }
.diag-helper { margin-top: 16px; }
.diag-helper summary { cursor: pointer; color: var(--link); font-weight: 600; padding: 8px 0; }
.diag-tasks { list-style: none; padding: 0; margin: 0 0 8px; }
.diag-tasks li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.diag-tasks li > span { display: grid; }
.diag-tasks .muted { font-size: 0.95rem; }

.diag-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.diag-figs div { border-top: 3px solid var(--blue); padding-top: 10px; }
.diag-figs dt { color: var(--muted); font-size: 0.95rem; }
.diag-figs dd { margin: 4px 0 0; font: 700 1.75rem/1.2 var(--display); }
.diag-win { border-left: 4px solid var(--blue); background: rgba(3, 105, 161, 0.06); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin-bottom: 28px; }
.diag-win p { margin: 0 0 8px; max-width: 70ch; }
.diag-win p:last-child { margin: 0; }
.diag-win-t { font-family: var(--display); font-size: 1.25rem; }
.diag-win-note { color: var(--muted); }

.diag-map-box { margin: 0 0 28px; max-width: 640px; }
.diag-map-box h4 { font: 700 1.125rem var(--display); margin: 0; }
.diag-map { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; }
.diag-quad { position: absolute; padding: 8px 10px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.q-escribir { left: 0; top: 0; width: 60.5%; height: 41%; }
.q-automatizar { right: 0; top: 0; width: 39.5%; height: 41%; background: rgba(3, 105, 161, 0.08); color: var(--link); border-radius: 0 var(--radius) 0 0; }
.q-dejar { left: 0; bottom: 0; width: 60.5%; height: 59%; display: flex; align-items: flex-end; }
.q-rutina { right: 0; bottom: 0; width: 39.5%; height: 59%; display: flex; align-items: flex-end; }
.q-escribir, .q-dejar { border-right: 1px dashed var(--line); }
.q-escribir, .q-automatizar { border-bottom: 1px dashed var(--line); }
#d-dots { position: absolute; inset: 0; }
.diag-dot {
  position: absolute; transform: translate(-50%, 50%); border-radius: 50%; padding: 0; cursor: pointer;
  background: rgba(71, 85, 105, 0.55); border: 2px solid var(--card);
}
.diag-dot.win { background: var(--blue); z-index: 2; }
.diag-tip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 220px;
  background: var(--ink); color: #f1f5f9; font-size: 0.8125rem; line-height: 1.4; text-align: left; padding: 6px 10px; border-radius: 6px;
  visibility: hidden; pointer-events: none; z-index: 3;
}
.tip-r .diag-tip { left: auto; right: -8px; transform: none; }
.tip-l .diag-tip { left: -8px; transform: none; }
.diag-dot:hover, .diag-dot:focus-visible { z-index: 4; }
.diag-dot:hover .diag-tip, .diag-dot:focus .diag-tip { visibility: visible; }
.diag-axis { color: var(--muted); font-size: 0.875rem; margin: 6px 0; text-align: right; }
.diag-axis-y { text-align: left; }

#d-tabla th button { font: inherit; color: inherit; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; }
#d-tabla th[aria-sort="ascending"] button::after { content: " ↑"; }
#d-tabla th[aria-sort="descending"] button::after { content: " ↓"; }
#d-tabla tr.win th, #d-tabla tr.win td { background: rgba(3, 105, 161, 0.08); }
.diag-summary { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 24px 0 0; max-width: 75ch; background: var(--paper); }

.diag-close { border-top: 1px solid var(--line); padding-top: 40px; margin-top: 16px; }
.diag-close > p { max-width: 68ch; }

@media (prefers-color-scheme: dark) {
  .btn-solid { background: var(--sky); color: var(--ink); }
  .btn-solid:hover { background: #7dd3fc; }
  .diag-progress-track span, .diag-dot.win { background: var(--sky); }
  .diag-recs li, .diag-figs div, .diag-win { border-color: var(--sky); }
  .diag-opt:has(input:checked) { border-color: var(--sky); background: rgba(56, 189, 248, 0.1); }
  .diag-opt input { accent-color: var(--sky); }
  .diag-dot { background: rgba(163, 177, 198, 0.55); }
  .diag-win, .q-automatizar, #d-tabla tr.win th, #d-tabla tr.win td { background: rgba(56, 189, 248, 0.08); }
}

@media (max-width: 900px) {
  .diag-res1-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .diag-card { padding: 20px 16px; }
  .diag-opts, .diag-fields, .diag-figs { grid-template-columns: 1fr; }
  .diag-map { aspect-ratio: 1 / 1; }
  .diag-quad { font-size: 0.75rem; padding: 6px; }
  .diag-nav .btn { flex: 1; }
}
