/* El asistente «Guided setup» (F7-57, bloque B; DISENO.md §8).
 *
 * Dos columnas: las preguntas y, a la derecha, la vista previa del tablero
 * (400 px). Por debajo de 860 px **de su propio ancho** (`container`), una
 * columna con la vista previa en una franja plegable abajo: así funciona igual
 * dentro de la ventana «Customize» de A y en `/terminal/setup`.
 *
 * Sólo tokens de color. Movimiento con `transform` y `opacity`; con
 * `prefers-reduced-motion` todo queda quieto (SKILL.md §11).
 */

.wz-root { container: wz / inline-size; min-height: 0; height: 100%; }

.wz {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  min-height: 0;
  height: 100%;
  color: var(--text);
}
.wz.wz-loading { display: grid; place-items: center; min-height: 320px; padding: var(--s6); }

/* Las categorías, con sus colores (los mismos en la mini y en las listas). */
.wz-c-figures, .wz-c-markets, .wz-c-coins, .wz-c-moves { --c: var(--accent); }
.wz-c-stories, .wz-c-narratives, .wz-c-portfolio { --c: var(--info); }
.wz-c-derivatives, .wz-c-alerts { --c: var(--warn); }
.wz-c-onchain, .wz-c-yields { --c: var(--up-fill); }
.wz-c-presales { --c: var(--danger); }
.wz-c-read, .wz-c-calendar { --c: var(--blue-500); }

/* --------------------------------------------------------- las preguntas */

.wz-q { padding: var(--s5) var(--s6) var(--s6); overflow: auto; min-width: 0; }

.wz-steps { display: flex; gap: 6px; margin: 0 0 var(--s5); padding: 0; list-style: none; }
.wz-steps li { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--line-strong);
  position: relative; overflow: visible; }
.wz-steps li::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.wz-steps li.done::after, .wz-steps li.cur::after { transform: scaleX(1); }
.wz-steps li.cur::after { opacity: .55; }
.wz-steps button { position: absolute; inset: -12px 0; min-height: 0; padding: 0; border: 0; background: none;
  box-shadow: none; cursor: pointer; border-radius: 6px; }
.wz-steps button:hover { background: none; }
.wz-steps li:has(button:hover)::after { filter: brightness(1.2); }

.wz-eyebrow { margin: 0; font-size: var(--size-2xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); }
.wz-q h2 { font-size: var(--size-xl); line-height: 1.2; margin: 6px 0 4px; letter-spacing: -.01em; }
.wz-q h2:focus { outline: none; }
.wz-sub { color: var(--text-muted); margin: 0 0 var(--s5); font-size: var(--size-sm); max-width: 62ch; }
.wz-h3 { font-size: var(--size-xs); font-weight: 650; color: var(--text-muted); margin: var(--s4) 0 var(--s2);
  display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
.wz-h3:first-of-type { margin-top: 0; }
.wz-guess { font-weight: 500; color: var(--text-faint); font-size: var(--size-2xs); }

/* Las tarjetas de opción. */
.wz-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.wz-opts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wz-opt {
  position: relative; display: flex; align-items: flex-start; justify-content: flex-start; gap: var(--s3);
  min-height: 76px; padding: 14px; text-align: left; white-space: normal;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-sunken);
  box-shadow: var(--sheen); font-weight: 400; color: var(--text);
  transition: border-color .18s, background-color .18s, transform .18s;
  animation: wz-pop .36s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms);
}
.wz-opt:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--surface-hover); }
.wz-opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.wz-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.wz-ic svg { width: 18px; height: 18px; }
.wz-opt:hover .wz-ic, .wz-opt[aria-checked="true"] .wz-ic { transform: scale(1.08) rotate(-4deg); }
.wz-ot { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wz-ot b { font-size: var(--size-sm); font-weight: 650; }
.wz-ot span { font-size: var(--size-xs); color: var(--text-muted); line-height: 1.45; }
.wz-ck { margin-left: auto; flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: background-color .18s, border-color .18s; }
.wz-opt[role="radio"] .wz-ck { border-radius: 50%; }
.wz-ck svg { width: 12px; height: 12px; fill: none; stroke: var(--accent-ink); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; transform: scale(0); transition: transform .22s cubic-bezier(.3, 1.6, .5, 1); }
[aria-checked="true"] > .wz-ck, [aria-pressed="true"] > .wz-ck { background: var(--accent); border-color: var(--accent); }
[aria-checked="true"] > .wz-ck svg, [aria-pressed="true"] > .wz-ck svg { transform: scale(1); }

/* Monedas. */
.wz-short { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.wz-chip { min-height: 30px; padding: 4px 12px; border-radius: var(--radius-pill); font-size: var(--size-xs);
  font-weight: 560; background: var(--surface-sunken); gap: 6px; }
.wz-chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wz-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.wz-coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: var(--s2); }
.wz-coin { justify-content: flex-start; gap: var(--s2); min-height: 44px; padding: 6px 10px; border-radius: 10px;
  background: var(--surface-sunken); font-weight: 400; text-align: left;
  animation: wz-pop .32s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 22ms);
  transition: border-color .18s, background-color .18s, transform .18s; }
.wz-coin:hover { transform: translateY(-1px); border-color: var(--accent); }
.wz-coin[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.wz-coin b { font-size: var(--size-sm); font-weight: 650; }
.wz-cn { font-size: var(--size-2xs); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.wz-coin .wz-ck { margin-left: 0; width: 18px; height: 18px; border-radius: 50%; }
.wz-logo { width: 20px; height: 20px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface); }
.wz-logo-txt { display: grid; place-items: center; font-size: 8px; font-weight: 700; color: var(--text-muted);
  border: 1px solid var(--line-strong); }
.wz-csearch { margin-top: var(--s3); }
.wz-q-in input { width: 100%; max-width: 420px; }
.wz-cres { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); font-size: var(--size-xs); }
.wz-cres:empty { display: none; }
.wz-note { font-size: var(--size-xs); color: var(--text-faint); margin: var(--s3) 0 0; }
.wz-shake { animation: wz-shake .4s both; color: var(--warn); }

/* Densidad y pantalla, con su dibujo. */
.wz-fit { min-height: 64px; align-items: center; }
.wz-dens { flex: none; width: 44px; height: 34px; display: grid; gap: 2px;
  grid-template-columns: repeat(var(--cols, 4), 1fr); align-content: start; }
.wz-dens i { display: block; height: 7px; border-radius: 2px; background: var(--text-faint); opacity: .55;
  transition: background-color .18s, opacity .18s; }
.wz-dens[style*="--n:6"] { --cols: 3; }
.wz-dens[style*="--n:6"] i { height: 14px; }
.wz-dens[style*="--n:10"] i { height: 9px; }
.wz-dens[style*="--n:16"] { --cols: 6; }
.wz-dens[style*="--n:16"] i { height: 6px; }
.wz-fit[aria-checked="true"] .wz-dens i { background: var(--accent); opacity: .9; }
.wz-dev { flex: none; width: 44px; height: 34px; display: grid; place-items: center; }
.wz-dev i { display: block; border: 2px solid var(--text-faint); border-radius: 3px; transition: border-color .18s; }
.wz-dev-big i { width: 40px; height: 26px; }
.wz-dev-laptop i { width: 32px; height: 20px; border-bottom-width: 5px; }
.wz-dev-phone i { width: 15px; height: 27px; border-radius: 4px; }
.wz-fit[aria-checked="true"] .wz-dev i { border-color: var(--accent); }

/* Navegación. */
.wz-nav { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s5); flex-wrap: wrap; }
.wz-sp { flex: 1; }
.wz-skip { border: 0; background: none; box-shadow: none; color: var(--text-faint); text-decoration: underline;
  text-underline-offset: 3px; font-weight: 500; padding: 6px 8px; }
.wz-skip:hover { background: none; color: var(--text); }
.wz-next { min-width: 92px; }
.wz-next span, .wz-back span { transition: transform .2s; display: inline-block; }
.wz-back:hover span { transform: translateX(-3px); }

/* ---------------------------------------------------------- el resultado */

.wz-banner { margin: 0 0 var(--s3); padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent); font-size: var(--size-sm); font-weight: 600; }
.wz-name { display: flex; flex-direction: column; gap: 2px; margin: var(--s2) 0 var(--s1); max-width: 480px; }
.wz-name-l { font-size: var(--size-2xs); color: var(--text-faint); }
.wz-name input { font-size: var(--size-lg); font-weight: 700; padding: 6px 10px; min-height: 42px; }
.wz-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3) var(--s5); }
.wz-group h3 { display: flex; align-items: center; gap: var(--s2); margin: 0 0 6px; font-size: var(--size-2xs);
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.wz-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wz-group li { display: flex; align-items: center; gap: var(--s2); padding: 3px 0 3px var(--s2);
  border-left: 2px solid color-mix(in srgb, var(--c, var(--accent)) 40%, transparent); font-size: var(--size-sm);
  transition: opacity .25s, transform .25s; }
.wz-lt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-group li em, .wz-why em { font-style: normal; color: var(--text-faint); font-size: var(--size-2xs); margin-left: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
.wz-x { flex: none; width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 7px; border-color: transparent;
  background: none; box-shadow: none; color: var(--text-faint); }
.wz-x:hover { color: var(--down); border-color: var(--line-strong); background: var(--surface-hover); }
.wz-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wz-li-new { animation: wz-pop .4s cubic-bezier(.2, .8, .2, 1) both; }
.wz-li-out { opacity: 0; transform: translateX(10px); }
.wz-more-box { margin-top: var(--s4); }
.wz-more { display: flex; flex-wrap: wrap; gap: var(--s2); }
.wz-add { height: auto; padding: 6px 12px 6px 6px; text-align: left; animation: wz-pop .34s both;
  animation-delay: calc(var(--i, 0) * 40ms); }
.wz-add > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.25; }
.wz-add b { font-weight: 600; font-size: var(--size-xs); }
.wz-add em { font-style: normal; color: var(--text-faint); font-size: var(--size-2xs); }
.wz-plus { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); transition: transform .3s cubic-bezier(.2, .8, .2, 1), background-color .2s; }
.wz-add:hover .wz-plus { transform: rotate(90deg); background: var(--accent); color: var(--accent-ink); }
.wz-preset { width: 100%; justify-content: flex-start; margin-top: var(--s4); padding: 10px 14px; border-style: dashed;
  background: none; box-shadow: none; font-weight: 400; color: var(--text-muted); }
.wz-preset b { color: var(--text); }
.wz-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); align-items: center; }
.wz-wait { opacity: .7; cursor: progress; }
.wz-err { color: var(--down); font-size: var(--size-sm); margin: var(--s2) 0 0; }
.wz-nav-end { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* ------------------------------------------------------ la vista previa */

.wz-pv { border-left: 1px solid var(--line); background: var(--surface-sunken); padding: var(--s4);
  display: flex; flex-direction: column; gap: var(--s3); overflow: auto; min-width: 0; }
.wz-pv-toggle { all: unset; display: flex; align-items: center; gap: var(--s2); cursor: default; }
.wz-pv-t { font-size: var(--size-2xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.wz-count { display: inline-block; font-variant-numeric: tabular-nums; }
.wz-bump { animation: wz-bump .42s cubic-bezier(.2, .8, .2, 1); }
.wz-chev { display: none; }
.wz-pv-body { display: flex; flex-direction: column; gap: var(--s3); }
.wz-mini { --wz-mini-max: 330; position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  min-height: 120px; overflow: hidden; transition: opacity .2s, height .35s cubic-bezier(.2, .8, .2, 1); }
.wz-final .wz-mini { --wz-mini-max: 460; }
.wz-busy .wz-mini { opacity: .78; }
.wz-box { position: absolute; padding: 1.5px; will-change: transform; }
.wz-box > span { display: block; width: 100%; height: 100%; border-radius: 4px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 22%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  font-size: 10px; line-height: 1.25; font-weight: 600; color: var(--text-muted); padding: 2px 4px;
  white-space: nowrap; text-overflow: ellipsis; transition: background-color .2s; }
.wz-box-tile > span { background: color-mix(in srgb, var(--c) 34%, var(--surface)); }
.wz-box:hover > span { background: color-mix(in srgb, var(--c) 40%, var(--surface)); color: var(--text); }
.wz-box-in { animation: wz-grow .46s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
.wz-box-out { opacity: 0; transform: scale(.85); transition: opacity .24s, transform .24s; }
.wz-why { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: var(--size-xs); }
.wz-why li { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.wz-why li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-why .wz-li-first { animation: wz-pop .3s both; animation-delay: calc(var(--i, 0) * 40ms); }
.wz-why-more { color: var(--text-faint); padding-left: 18px; }
.wz-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--accent)); flex: none; }
.wz-final .wz-why { display: none; }

/* --------------------------------------------- entre pasos (dirección) */

.wz-in-f { animation: wz-slide-f .34s cubic-bezier(.2, .8, .2, 1) both; }
.wz-in-b { animation: wz-slide-b .34s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes wz-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes wz-grow { from { opacity: 0; transform: scale(.55); } }
@keyframes wz-slide-f { from { opacity: 0; transform: translateX(18px); } }
@keyframes wz-slide-b { from { opacity: 0; transform: translateX(-18px); } }
@keyframes wz-bump { 40% { transform: scale(1.3); color: var(--text); } }
@keyframes wz-shake { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }

/* ---------------------------------------------------- una sola columna */

@container wz (max-width: 860px) {
  .wz { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .wz-q { padding: var(--s4) var(--s4) var(--s5); }
  .wz-q h2 { font-size: var(--size-lg); }
  .wz-sub { margin-bottom: var(--s4); }
  .wz-opts { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s2); }
  .wz-opt { min-height: 0; padding: 12px; }
  .wz-pv { border-left: 0; border-top: 1px solid var(--line); padding: var(--s2) var(--s4) var(--s3); gap: var(--s2);
    box-shadow: 0 -12px 24px -18px rgba(0, 0, 0, .5); overflow: visible; }
  .wz-pv-open .wz-pv-body { max-height: 52vh; overflow: auto; overscroll-behavior: contain; }
  .wz-pv-toggle { cursor: pointer; min-height: 28px; justify-content: space-between; }
  .wz-pv-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
  .wz-chev { display: block; width: 16px; height: 16px; fill: none; stroke: var(--text-muted); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
  .wz-pv-open .wz-chev { transform: rotate(180deg); }
  .wz .wz-mini, .wz.wz-final .wz-mini { --wz-mini-max: 120; min-height: 60px; }
  .wz.wz-pv-open .wz-mini { --wz-mini-max: 300; }
  .wz-why { display: none; }
  .wz-pv-open .wz-why { display: flex; }
  .wz-final.wz-pv-open .wz-why { display: none; }
}
@container wz (max-width: 520px) {
  .wz-opts, .wz-opts-3 { grid-template-columns: minmax(0, 1fr); }
  .wz-coins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wz-list { grid-template-columns: minmax(0, 1fr); }
  .wz-nav .wz-skip { order: 3; width: 100%; text-align: center; }
  .wz-nav .wz-sp { display: none; }
  .wz-nav .wz-next { margin-left: auto; }
  .wz-acts > button { flex: 1 1 100%; }
  .wz-fit { min-height: 56px; }
}

/* ------------------------------------------- la página `/terminal/setup` */

.wz-page { border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow), var(--sheen); overflow: clip; min-height: 560px; }
.wz-page .wz-root, .wz-page.wz-root { height: auto; }
.wz-page .wz { min-height: 600px; }
.wz-page .wz-q { overflow: visible; }
/* En la página la columna de la derecha llega hasta abajo y lo de dentro se
   queda a la vista al bajar (dos pegajosos dentro de la misma columna). */
.wz-page .wz-pv { display: block; overflow: visible; }
.wz-page .wz-pv-toggle { position: sticky; top: 0; z-index: 1; padding: var(--s1) 0 var(--s3); background: var(--surface-sunken); }
.wz-page .wz-pv-body { position: sticky; top: 40px; }
@container wz (max-width: 860px) {
  .wz-page .wz-pv { position: sticky; bottom: 0; z-index: 2; display: flex; }
  .wz-page .wz-pv-toggle { position: static; padding: 0; }
  .wz-page .wz-pv-body { position: static; }
  .wz-page .wz { min-height: 0; }
}

/* ------------------------------------------ la invitación de la portada */

.wz-nudge { display: flex; align-items: center; gap: var(--s4); margin: 0 0 var(--s4); padding: var(--s3) var(--s4);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius);
  background: linear-gradient(100deg, var(--accent-soft), transparent 70%), var(--surface); box-shadow: var(--sheen); }
.wz-nudge-art { flex: none; width: 46px; height: 38px; display: grid; grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr); gap: 3px; }
.wz-nudge-art i { border-radius: 3px; background: var(--accent); opacity: .35; animation: wz-tick 2.4s ease-in-out infinite; }
.wz-nudge-art i:nth-child(1) { grid-column: span 2; animation-delay: 0s; }
.wz-nudge-art i:nth-child(2) { animation-delay: .3s; background: var(--info); }
.wz-nudge-art i:nth-child(3) { animation-delay: .6s; background: var(--warn); }
.wz-nudge-art i:nth-child(4) { animation-delay: .9s; }
.wz-nudge-art i:nth-child(5) { animation-delay: 1.2s; background: var(--up-fill); }
.wz-nudge-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wz-nudge-copy b { font-size: var(--size-base); }
.wz-nudge-copy span { font-size: var(--size-sm); color: var(--text-muted); }
.wz-nudge-act { display: flex; align-items: center; gap: var(--s2); flex: none; }
.wz-nudge-later { color: var(--text-muted); }
.wz-nudge-in { animation: wz-pop .45s cubic-bezier(.2, .8, .2, 1) both; }
.wz-nudge-out { opacity: 0; transform: translateY(-6px) scale(.99); transition: opacity .26s, transform .26s; }
@keyframes wz-tick { 0%, 100% { opacity: .3; transform: scale(1); } 40% { opacity: .9; transform: scale(1.06); } }
@media (max-width: 720px) {
  .wz-nudge { flex-wrap: wrap; gap: var(--s3); padding: var(--s3); }
  .wz-nudge-art { display: none; }
  .wz-nudge-act { width: 100%; }
  .wz-nudge-act .btn { flex: 1; }
}

/* --------------------------------------------------- foco y movimiento */

.wz :focus-visible, .wz-nudge :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wz-opt:focus-visible, .wz-coin:focus-visible { outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .wz *, .wz-nudge, .wz-nudge * { animation: none !important; transition: none !important; }
}
