/* ==========================================================================
   Portfolio: resumen, posiciones, origen, movimientos y diálogos
   ========================================================================== */

.pf-body { min-height: 100%; }

/* ---------- Resumen ----------
   La cifra grande con la letra de la marca, como la portada de un informe; debajo, la tira de KPIs. */
.pf-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.pf-hero-main { display: grid; gap: 10px; }
.pf-figure {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: var(--fs-5xl);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .95;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
}
.pf-figure-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--text-2); font-size: var(--fs-md); }
.pf-chg { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: var(--r-sm); font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; background: var(--surface-2); border: 1px solid var(--line-2); }
.pf-chg .i { width: 15px; height: 15px; }
.pf-chg.up { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.pf-chg.down { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 32%, transparent); }
.pf-kpis .kpi { animation: rv-in .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 100ms); }
/* Arriba: la cifra a la izquierda y su curva a la derecha, que se apaga hacia la cifra */
.pf-hero-top { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: end; gap: var(--sp-8); }
.pf-hero-spark { position: relative; height: 112px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 32%); mask-image: linear-gradient(90deg, transparent, #000 32%); }
.pf-spark { display: block; width: 100%; height: 100%; overflow: visible; }
.pf-spark .l { fill: none; stroke: var(--ok); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pf-spark .a { fill: color-mix(in srgb, var(--ok) 10%, transparent); }
.pf-spark.down .l { stroke: var(--bad); }
.pf-spark.down .a { fill: color-mix(in srgb, var(--bad) 10%, transparent); }
/* Mini demos de los KPIs: una barra fina al pie de cada cifra */
.kpi-viz { display: flex; gap: 2px; height: 4px; margin-top: 8px; border-radius: var(--r-pill); background: var(--surface-4); overflow: hidden; }
.kpi-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.kpi-split i { display: block; height: 100%; background: var(--ivory-3); }
.kpi-split i.up { background: var(--ok); }
.kpi-split i.down { background: var(--bad); }
.kpi-stack i { display: block; height: 100%; background: var(--accent); opacity: var(--o, 1); }
.kpi-stack i.rest { background: transparent; }

/* ---------- El reparto: tres columnas que se equilibran ----------
   Por set (la lista larga), por tipo con su anillo y, apilados, por origen y riesgo. Las tres
   columnas igualan su alto; en la pila, riesgo crece hasta el pie. */
.pf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.pf-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pf-stack > .pf-risk { flex: 1; }
.pf-donut { position: relative; width: 132px; height: 132px; margin: 2px auto 6px; }
.pf-donut svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.pf-donut circle { fill: none; stroke-width: 11; }
.pf-donut .track { stroke: var(--surface-3); }
.pf-donut g circle { transition: opacity var(--dur-2); }
.pf-donut b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: var(--fs-xl); font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.pf-page .hbars { gap: 14px; }
.pf-page .hbar-track { height: 6px; }
/* Lo que más ha movido tu valor: miniatura, nombre y una barra que sale del eje central */
.pf-lists .dbar-row { grid-template-columns: 30px minmax(0, 1.1fr) minmax(0, 1fr) 64px; gap: 12px; padding: 6px 8px; }
.pf-lists .dbar-row > img, .pf-lists .dbar-row > .ph { width: 30px; aspect-ratio: 63 / 88; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-3); box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.pf-lists .dbar-row > .box-img { aspect-ratio: 1; object-fit: contain; background: #fff; padding: 2px; }
.pf-lists .dbar-track { height: 8px; }
.pf-lists .dbar-track .zero { top: -8px; bottom: -8px; width: 1px; background: var(--line-3); }
.pf-lists .dbar-track .seg.pos { background: var(--ok); }
.pf-lists .dbar-track .seg.neg { background: var(--bad); }
.pf-lists .cv-item, .pf-lists .dbar-row { min-height: 52px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); font-size: var(--fs-xs); }
.pf-legend span { display: inline-flex; align-items: center; gap: 7px; }
/* La gráfica del valor es la pieza principal del resumen: más alta */
#pf-value { min-height: 300px; }
.st-svg .st-area { opacity: .22; }
.ck-first .st-svg .st-area { animation: rv-in .9s var(--ease) both; }
.st-svg .st-edge { fill: none; stroke-width: 2; stroke-linejoin: round; }
/* Frente a lo invertido: valor (línea), invertido (escalones discontinuos) y la ganancia o pérdida entre los dos */
.iv-svg .iv-val { stroke: var(--viz-1); stroke-width: 2.2; }
.iv-svg .iv-inv { stroke: var(--viz-7); stroke-width: 2; stroke-dasharray: 5 4; }
.iv-svg .iv-band { stroke: none; }
.iv-svg .iv-band.up { fill: var(--viz-up); opacity: .2; }
.iv-svg .iv-band.down { fill: var(--viz-down); opacity: .24; }
.ck-first .iv-svg .iv-band { animation: rv-in .9s var(--ease) both; }
.iv-svg .iv-inv-l { fill: var(--viz-7); }
.pf-chart-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pf-cover { color: var(--muted); font-size: var(--fs-xs); }
.pf-cover b { color: var(--text-2); font-weight: 600; }
.hbar-track .seg.grow, .dbar-track .seg.grow { transform-origin: left; animation: bar-grow .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.dbar-track .seg.neg.grow { transform-origin: right; }
.empty-note { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.risk-list { display: grid; gap: 0; }
.risk-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.risk-row > span:first-child { color: var(--text-2); }
.risk-row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.risk-row b { color: var(--text); font-weight: 600; }
.risk-row.warn > span:last-child b { color: var(--warn); }
.risk-row.warn > span:first-child::after { content: " ●"; color: var(--warn); font-size: var(--fs-2xs); vertical-align: 2px; }

/* ---------- Posiciones ---------- */
.pos-table .exp { width: 26px; color: var(--muted); padding-right: 0; }
.pos-table .exp .i { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.pos-row { cursor: pointer; }
.pos-row.open .exp .i { transform: rotate(90deg); color: var(--accent-2); }
.pos-row.open td { background: var(--surface-2); }
.sub-row td { background: var(--bg); font-size: var(--fs-xs); padding-top: 8px; padding-bottom: 8px; animation: rv-in .3s var(--ease) both; }
.sub-src { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); white-space: normal; }
.sub-src .i { width: 14px; height: 14px; color: var(--muted); }
.sub-actions { text-align: right; white-space: nowrap; }
.sub-actions .btn { height: 26px; padding: 0 8px; font-size: var(--fs-xs); }
.sub-actions .btn .i { width: 13px; height: 13px; }
.src-cell { max-width: 230px; white-space: normal !important; }
.src-chip { display: inline-flex; align-items: center; gap: 5px; height: 21px; margin: 1px 4px 1px 0; padding: 0 7px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 560; white-space: nowrap; }
.src-chip i { width: 7px; height: 10px; border-radius: 1.5px; box-shadow: inset -2px 0 0 rgba(0, 0, 0, .3); }
.src-chip.lot { background: color-mix(in srgb, var(--viz-5) 16%, transparent); color: #f29abb; }
.src-chip.manual { background: var(--info-soft); color: var(--info); }
.spark-cell { display: inline-flex; align-items: center; gap: 6px; }
.spark-cell small { min-width: 38px; text-align: right; font-weight: 600; }
.pos-table tfoot td { position: sticky; bottom: 0; background: var(--surface-2); border-top: 1px solid var(--line-2); font-weight: 650; }
.pos-table .cellbar i { background: var(--accent); }

/* ---------- Origen ---------- */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.src-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 16px; padding: 16px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--hairline-top); transition: opacity .2s, border-color .2s; }
.src-card.off { opacity: .55; }
.src-card:hover { border-color: var(--line-2); }
/* El lomo del binder, con su color */
.src-cover { width: 54px; height: 72px; border-radius: 5px 3px 3px 5px; background: var(--c); box-shadow: inset -6px 0 0 rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .12), var(--shadow-card); display: grid; place-items: center; font-family: var(--serif); font-size: var(--fs-xl); color: rgba(255, 255, 255, .85); }
.src-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
/* El nombre y su interruptor: si no caben juntos, el interruptor baja (el nombre no empuja fuera) */
.src-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.src-top b { flex: 0 0 auto; min-width: 0; max-width: 100%; font-family: var(--serif); font-size: 19px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: var(--fs-xs); }
.src-stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.src-excluded summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); font-size: var(--fs-xs); font-weight: 560; list-style: none; }
.src-excluded summary::-webkit-details-marker { display: none; }
.src-excluded summary .i { width: 14px; height: 14px; }
.ex-list { display: grid; gap: 6px; margin-top: 8px; }
.ex-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--fs-xs); }
.ex-row img, .ex-row .ph { width: 28px; aspect-ratio: 63 / 88; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-3); }
.ex-row span { display: grid; min-width: 0; }
.ex-row small { color: var(--muted); }
.src-actions .link-btn { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); }
.src-actions .i { width: 14px; height: 14px; }
.lot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.lot-card { display: grid; gap: 14px; padding: 16px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--hairline-top); }
.lot-thumbs { display: flex; padding-left: 12px; }
.lot-thumbs img, .lot-thumbs .ph { width: 40px; aspect-ratio: 63 / 88; margin-left: -12px; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-3); box-shadow: 0 3px 10px rgba(0, 0, 0, .5), 0 0 0 2px var(--surface); }
.lot-thumbs .box-img { aspect-ratio: 1; object-fit: contain; background: #fff; padding: 2px; }
.lot-main { display: grid; gap: 2px; }
.lot-main b { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.lot-main span { color: var(--muted); font-size: var(--fs-xs); }
/* Las tres cifras del lote, en tira con filetes */
.lot-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); }
.lot-nums div { display: grid; gap: 3px; padding: 10px 12px; }
.lot-nums div + div { border-left: 1px solid var(--line); }
.lot-nums span { color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; font-stretch: var(--label-stretch); letter-spacing: var(--label-track); text-transform: uppercase; }
.lot-nums b { font-family: var(--serif); font-size: var(--fs-xl); font-weight: 500; font-variant-numeric: tabular-nums lining-nums; }
.lot-nums small { font-size: var(--fs-xs); }
.lot-card .btn { justify-self: start; }

/* ---------- Movimientos: un libro de cuentas por meses ---------- */
.mv-list { display: grid; gap: 0; }
.mv-month { display: flex; align-items: center; gap: 12px; margin: 22px 0 6px; color: var(--text-2); font-size: var(--fs-2xs); font-weight: 600; font-stretch: var(--label-stretch); letter-spacing: var(--label-track); text-transform: uppercase; }
.mv-month::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mv-month:first-child { margin-top: 0; }
.mv-row { display: grid; grid-template-columns: 30px 38px minmax(0, 1fr) 110px 44px 130px 34px; align-items: center; gap: 12px; padding: 9px 8px; border-radius: var(--r-md); border-bottom: 1px solid var(--line-soft); }
.mv-row:hover { background: var(--surface-2); }
.mv-row img, .mv-row .ph { width: 30px; aspect-ratio: 63 / 88; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-3); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.mv-row .box-img { aspect-ratio: 1; object-fit: contain; background: #fff; padding: 2px; }
.mv-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-md); }
.mv-ic .i { width: 15px; height: 15px; }
.mv-ic.buy { background: var(--info-soft); color: var(--info); }
.mv-ic.lot { background: color-mix(in srgb, var(--viz-5) 16%, transparent); color: #f29abb; }
.mv-ic.sell { background: var(--ok-soft); color: var(--ok-2); }
/* Las miniaturas del lote caben en la columna de la imagen (se pisaban con el nombre) */
.mv-lot { display: flex; width: 38px; }
.mv-row .mv-lot img, .mv-row .mv-lot .ph { flex: none; width: 22px; margin-left: -14px; box-shadow: 0 0 0 2px var(--bg); }
.mv-row .mv-lot > :first-child { margin-left: 0; }
.mv-t { display: grid; min-width: 0; gap: 1px; }
.mv-t b { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-t small { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-d { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.mv-q { color: var(--text-2); font-size: var(--fs-xs); text-align: right; font-variant-numeric: tabular-nums; }
.mv-a { display: grid; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.mv-a small { font-size: var(--fs-xs); font-weight: 560; }

.pos-pick { display: grid; gap: 4px; margin-top: 12px; }

@media (max-width: 1100px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-stack { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pf-figure { font-size: var(--fs-4xl); }
  .pf-hero-top { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .pf-hero-spark { height: 64px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%); mask-image: linear-gradient(90deg, transparent, #000 20%); }
  .pf-grid, .pf-stack { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .pf-lists .dbar-row { grid-template-columns: 28px minmax(0, 1fr) minmax(0, .8fr) 58px; gap: 10px; }
  /* Posiciones: cada fila pasa a ser una tarjeta */
  .pos-table thead { display: none; }
  .pos-table, .pos-table tbody, .pos-table tfoot { display: block; }
  .pos-table tr.pos-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'card value' 'src pnl' 'w w'; gap: 8px 12px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
  .pos-table tr.pos-row td { display: block; padding: 0; border: 0; text-align: left; }
  .pos-table tr.pos-row:hover td:first-child { box-shadow: none; }
  .pos-table tr.pos-row td.exp, .pos-table tr.pos-row td:nth-child(4), .pos-table tr.pos-row td:nth-child(5), .pos-table tr.pos-row td:nth-child(6), .pos-table tr.pos-row td:nth-child(10), .pos-table tr.pos-row td:last-child { display: none; }
  .pos-table tr.pos-row td:nth-child(2) { grid-area: card; }
  .pos-table tr.pos-row td:nth-child(3) { grid-area: src; }
  .pos-table tr.pos-row td:nth-child(7) { grid-area: value; text-align: right; font-family: var(--serif); font-size: var(--fs-xl); }
  .pos-table tr.pos-row td:nth-child(8) { grid-area: pnl; text-align: right; }
  .pos-table tr.pos-row td:nth-child(9) { grid-area: w; }
  .pos-table .td-card .t b, .pos-table .td-card .t span { max-width: none; white-space: normal; }
  .pos-table tr.sub-row, .pos-table tr.group-row { display: block; }
  .pos-table tr.sub-row td { display: none; }
  .pos-table tfoot tr { display: flex; justify-content: space-between; padding: 12px; }
  .pos-table tfoot td { display: none; border: 0; }
  .pos-table tfoot td:nth-child(2), .pos-table tfoot td:nth-child(7), .pos-table tfoot td:nth-child(8) { display: block; }
  .src-grid, .lot-grid { grid-template-columns: minmax(0, 1fr); }
  .mv-row { grid-template-columns: 28px 30px minmax(0, 1fr) auto; }
  .mv-row .mv-d, .mv-row .mv-q, .mv-row > button { display: none; }
}

/* Guardadas fuera del álbum (Origen) */
.parked-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px; }
.parked-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-2); }
.pk-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pk-main b { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-main span { font-size: var(--fs-xs); color: var(--text-2); }
.pk-main small { font-size: var(--fs-xs); color: var(--muted); }
.parked-card .select { flex: none; width: auto; max-width: 140px; }
.parked-card > img, .parked-card > .ph { flex: none; width: 44px; aspect-ratio: 63 / 88; border-radius: var(--r-xs); object-fit: cover; background: var(--surface-3); box-shadow: var(--shadow-card); }
.cols-2.pf-lists { align-items: stretch; }

/* ---------- Todos los juegos ----------
   El total de la colección de todos los juegos. Cada juego lleva su acento en --g (--g-<juego>):
   el filete de su fila, su placa, su parte de la barra del reparto y el punto de su etiqueta. Los
   textos van siempre en los colores del texto; el color solo acompaña al nombre. */
.page-tabs a.tab-all { margin-left: auto; }
.page-tabs a.tab-all::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 1px; background: var(--line-2); }
.pt-lead { display: block; font-size: var(--fs-2xl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-kstack i { opacity: 1; }
/* Estado (al día, poniéndose al día) a la izquierda y los filtros (moneda y periodo) a la derecha */
.pt-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.pt-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.pt-status > .i { flex: none; width: 15px; height: 15px; color: var(--ok); }
.pt-status.busy > .i { color: var(--accent-2); animation: spin 1.4s linear infinite; }
.pt-status.bad > .i { color: var(--warn); }
.pt-status .btn { height: 28px; }
.pt-filters { display: flex; flex-wrap: wrap; gap: 8px; }
/* El reparto: una barra con un tramo por juego, separados por 2 px de fondo */
.pt-mix { display: flex; gap: 2px; height: 10px; margin: 4px 0 8px; }
.pt-mix i { min-width: 3px; background: var(--g); border-radius: 2px; transform-origin: left; animation: bar-grow .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.pt-mix i:first-child { border-radius: 4px 2px 2px 4px; }
.pt-mix i:last-child { border-radius: 2px 4px 4px 2px; }
.pt-mix i:only-child { border-radius: 4px; }
.pt-mix i:hover { filter: brightness(1.15); }
/* Una fila por juego, que lleva a su Portfolio */
.pt-rows { display: grid; gap: 2px; }
.pt-row { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1.3fr) 112px minmax(96px, .8fr) minmax(96px, .8fr) minmax(128px, 1fr) 16px; align-items: center; gap: 16px; padding: 10px 12px 10px 14px; border-radius: var(--r-lg); color: inherit; text-decoration: none; transition: background var(--dur-1); }
.pt-row::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: var(--g); }
.pt-row:hover { background: var(--surface-2); }
.pt-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pt-row.pending { opacity: .72; }
.pt-row.pending .skel { width: 100%; }
.pt-plate { display: grid; place-items: center; height: 46px; padding: 6px 9px; border-radius: var(--r-md); border: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 120%, color-mix(in srgb, var(--g) 24%, transparent), transparent 70%), var(--bg-2); overflow: hidden; }
.pt-logo { display: block; max-width: 100%; max-height: 30px; width: auto; height: auto; object-fit: contain; }
.pt-word { font-family: var(--serif); font-size: var(--fs-md); color: var(--text); white-space: nowrap; }
.pt-name { display: grid; gap: 3px; min-width: 0; }
.pt-name b { font-family: var(--serif); font-size: var(--fs-lg); font-weight: 500; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-name small { display: block; min-width: 0; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-name .pt-short { display: none; }
.pt-busy, .pt-failed { display: inline-flex; align-items: center; gap: 6px; }
.pt-busy .spinner { flex: none; width: 11px; height: 11px; margin: 0; border-width: 1.5px; }
.pt-failed { color: var(--warn); }
.pt-failed .i { width: 12px; height: 12px; }
.pt-spark .spark { display: block; }
.pt-spark .spark path { stroke: var(--g); stroke-width: 1.8; }
.pt-spark .spark circle { fill: var(--g); }
.pt-num { display: grid; justify-items: end; gap: 3px; min-width: 0; font-variant-numeric: tabular-nums; }
.pt-num > small { color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; font-stretch: var(--label-stretch); letter-spacing: var(--label-track); text-transform: uppercase; }
.pt-num > b { font-size: var(--fs-md); font-weight: 650; white-space: nowrap; }
.pt-num > b.muted { font-size: var(--fs-xs); font-weight: 500; }
.pt-num em { font-style: normal; font-size: var(--fs-xs); font-weight: 600; opacity: .85; }
.pt-val > b { font-family: var(--serif); font-size: var(--fs-xl); font-weight: 500; letter-spacing: -.01em; }
.pt-val > small { font-size: var(--fs-xs); font-weight: 560; letter-spacing: 0; text-transform: none; }
.pt-gain.up > b { color: var(--ok-2); }
.pt-gain.down > b { color: var(--bad-2); }
.pt-go .i { width: 16px; height: 16px; color: var(--faint); transition: color var(--dur-1), transform var(--dur-1) var(--ease); }
.pt-row:hover .pt-go .i { color: var(--text-2); transform: translateX(2px); }
/* Con un solo juego: su placa grande y qué verás aquí cuando haya más */
.pt-single { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; gap: 24px; }
.pt-plate.big { height: 104px; padding: 14px 18px; border-radius: var(--r-lg); }
.pt-plate.big .pt-logo { max-height: 64px; }
.pt-single h3 { margin: 0 0 6px; font-family: var(--serif); font-size: var(--fs-xl); font-weight: 500; letter-spacing: -.01em; }
.pt-single p { max-width: 62ch; margin: 0 0 14px; color: var(--text-2); }
/* La etiqueta del juego de una pieza (lo más valioso, lo que más se ha movido) */
.pt-chip { display: inline-flex; align-items: center; gap: 5px; height: 18px; margin-right: 7px; padding: 0 6px; border-radius: var(--r-xs); background: color-mix(in srgb, var(--g) 15%, transparent); color: var(--text-2); font-size: var(--fs-2xs); font-weight: 650; line-height: 1; vertical-align: 1px; white-space: nowrap; }
.pt-chip i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--g); }
.pt-lists a.cv-item, .pt-lists a.dbar-row { color: inherit; text-decoration: none; }
.pt-lists .cv-item .t2 { display: block; }
#pt-chart { min-height: 320px; }
.pt-tip { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.pt-first .skel { margin-top: 20px; }

@media (max-width: 1280px) {
  .pt-row { grid-template-columns: 76px minmax(0, 1.2fr) 96px minmax(92px, .8fr) minmax(120px, 1fr) 16px; }
  .pt-row .pt-cost { display: none; }
}
@media (max-width: 900px) {
  .page-tabs a.tab-all { margin-left: 0; }
  .pt-bar { flex-direction: column; align-items: stretch; }
  .pt-filters { justify-content: space-between; }
  /* Cada juego, una tarjeta: placa y nombre arriba; valor y ganancia debajo */
  .pt-row { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: 'plate name val' 'plate spark gain'; gap: 6px 12px; padding: 12px 10px 12px 14px; }
  .pt-row .pt-plate { grid-area: plate; height: 52px; padding: 5px 7px; }
  .pt-row .pt-name { grid-area: name; }
  .pt-row .pt-val { grid-area: val; }
  .pt-row .pt-spark { grid-area: spark; align-self: center; }
  .pt-row .pt-spark .spark { width: 100%; max-width: 112px; height: 24px; }
  .pt-row .pt-gain { grid-area: gain; }
  .pt-row .pt-gain > small, .pt-row .pt-cost, .pt-row .pt-go { display: none; }
  .pt-row .pt-val > b { font-size: var(--fs-lg); }
  .pt-single { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pt-plate.big { height: 84px; }
  /* En el móvil, el nombre corto del juego (Magic, Lorcana, Fusion World…) */
  .pt-name .pt-full { display: none; }
  .pt-name .pt-short { display: inline; }
  #pt-chart { min-height: 260px; }
  /* Las listas del Resumen y del total: sin la minigráfica, que le quita el sitio al nombre */
  .pf-lists .cv-item { grid-template-columns: 22px 38px minmax(0, 1fr) auto; }
  .pf-lists .cv-item > .spark, .pf-lists .cv-item > span:empty:not(.ph) { display: none; }
}

/* Las piezas sueltas de Origen en el móvil: cada una, una tarjeta (la carta arriba, sus cifras en dos
   columnas con su etiqueta y editar al pie), como Sobres o Mi colección; la tabla ya no se desplaza de lado */
@media (max-width: 700px) {
  .src-items thead { display: none; }
  .src-items, .src-items tbody { display: block; }
  .src-items tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px; border-bottom: 1px solid var(--line); }
  .src-items td { display: grid; gap: 3px; padding: 0; border: 0; text-align: left; white-space: normal; }
  .src-items td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-2xs); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
  .src-items td:first-child, .src-items td:last-child { grid-column: 1 / -1; }
  .src-items td:last-child .btn { justify-self: start; }
  /* El nombre del álbum en dos líneas antes que cortado */
  .src-top b { white-space: normal; overflow-wrap: break-word; }
}
