/* Panel de administración. Usa los tokens de tokens.css. */
.admin .shell { max-width: 960px; }
.admin .app-bar .inner, .admin-nav .inner { max-width: 960px; }
.admin-bar .inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-bar .logo small { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-brand-2); margin-left: 4px; }
.admin-bar .out { font-size: 13px; color: var(--on-brand-2); }
.admin-nav { background: var(--brand); border-top: 1px solid color-mix(in srgb, var(--on-brand) 12%, transparent); }
.admin-nav .inner { margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-nav a { flex: none; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--on-brand-2); border-bottom: 2px solid transparent; }
.admin-nav a[aria-current="page"] { color: var(--on-brand); border-bottom-color: var(--secondary); }

.a-head { display: grid; gap: 4px; }
.a-head h1 { font-size: 26px; line-height: 1.1; }
.a-head p { margin: 0; color: var(--text-2); font-size: 14px; }
.a-progress { margin: 0; color: var(--text-2); font-size: 14px; }
.a-progress b { color: var(--text); font-size: 18px; }
.a-section { display: grid; gap: 10px; }
.a-section > h2 { font-size: 19px; }
.a-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.a-muted { color: var(--text-3); font-size: 13px; }
.a-empty { color: var(--text-2); font-size: 14px; padding: 6px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 9px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn[hidden] { display: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--live-text); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.input { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 10px; min-width: 0; }
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
select.input { padding-right: 6px; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.ok { background: var(--upcoming-soft); color: var(--upcoming-text); }
.badge.warn { background: var(--pending-soft); color: var(--pending-text); }
.badge.bad { background: var(--live-soft); color: var(--live-text); }

/* Listados del panel */
.a-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.a-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 14px; }
.a-row + .a-row { border-top: 1px solid var(--border); }
a.a-row:hover { background: var(--surface-2); }
.a-row .t { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.a-row .s { grid-column: 1; font-size: 13px; color: var(--text-3); min-width: 0; }
.a-row .r { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; align-items: center; }

/* Dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.kpi .n { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--text-2); }
.chart-box { position: relative; height: 280px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.a-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.a-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.a-table td.num, .a-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.a-table tr:last-child td { border-bottom: 0; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell i { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--series-1); }
details.table-view summary { cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 600; }
.diff { display: grid; gap: 6px; }
.diff ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.diff h4 { margin: 0; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.diff h4 a { text-decoration: underline; text-underline-offset: 3px; }

/* Fuentes */
.src-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.src-actions select.input { flex: 1 1 260px; width: auto; font-size: 14px; padding: 6px 8px; }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }

/* Pedigree */
.ped-preview { max-width: 640px; width: 100%; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.choices { display: grid; gap: 6px; }
.choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; text-align: left; width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 12px; cursor: pointer; font: inherit; color: inherit; }
.choice:hover { border-color: var(--border-strong); background: var(--surface-2); }
.choice .t { font-weight: 600; }
.choice .s { grid-column: 1; font-size: 12.5px; color: var(--text-3); }
.choice .r { grid-row: 1 / span 2; grid-column: 2; font-size: 13px; font-weight: 600; color: var(--primary); }
.parents { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .parents { grid-template-columns: 1fr; } }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border-strong); background: var(--secondary-soft); border-radius: 9px; padding: 7px 10px; font-weight: 600; font-size: 14px; }
.picked button { border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--text-2); }

/* Autocompletar */
.combo { position: relative; min-width: 0; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; margin: 0; list-style: none; }
.combo-list .g { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 8px 8px 4px; }
.combo-list .o { display: grid; gap: 1px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.combo-list .o b { font-weight: 600; font-size: 14px; }
.combo-list .o small { font-size: 12px; color: var(--text-3); }
.combo-list .o[aria-selected="true"], .combo-list .o:hover { background: var(--surface-2); }
.combo-list .msg { padding: 8px; font-size: 13px; color: var(--text-3); }

/* Editor de lista */
.editor-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--border); }
.editor-bar .state { font-size: 13.5px; color: var(--text-2); }
.team-name { font-size: 20px; padding-top: 6px; }
.e-player { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.e-player > h3 { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 16px; display: flex; gap: 8px; align-items: baseline; font-family: var(--font-body); font-weight: 600; }
.e-cols { display: grid; grid-template-columns: 1fr 1fr; }
.e-col { padding: 10px 12px 12px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.e-col + .e-col { border-left: 1px solid var(--border); background: var(--bg); }
.e-col h4 { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.e-row { display: grid; grid-template-columns: 16px 20px minmax(0, 1fr) auto 30px; gap: 6px; align-items: center; }
.e-col.subs .e-row { grid-template-columns: 16px minmax(0, 1fr) auto 30px; }
.e-row .n { font-family: var(--font-display); font-weight: 600; color: var(--text-3); text-align: right; }
.e-row .input { padding: 6px 8px; font-size: 14px; }
.e-row .x { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 7px; cursor: pointer; color: var(--text-3); font-size: 18px; }
.e-row .x:hover { background: var(--surface-2); color: var(--live-text); }
/* Caballo que no está en la lista oficial del jugador: para revisarlo antes de publicar. */
.e-row.off-list .input { background: #fff3b8; border-color: #e0b93a; }
.e-row.with-doubt { grid-template-columns: 16px 20px minmax(0, 1fr) auto auto 30px; }
.e-col.subs .e-row.with-doubt { grid-template-columns: 16px minmax(0, 1fr) auto auto 30px; }
/* Mover un caballo: su manija, el renglón que sigue al puntero y la línea de dónde queda. */
.e-hgrip { display: grid; place-items: center; width: 22px; height: 30px; margin-left: -6px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: grab; touch-action: none; opacity: .6; }
.e-hgrip:hover { background: var(--surface-2); color: var(--text); opacity: 1; }
.e-hgrip:focus-visible { outline: 2px solid var(--focus); opacity: 1; }
.e-row.dragging { position: relative; z-index: 5; background: var(--surface); border-radius: 8px; box-shadow: 0 8px 24px rgb(21 32 28 / .18); pointer-events: none; }
.e-row.dragging .e-hgrip { cursor: grabbing; }
.e-drop { position: fixed; z-index: 6; height: 2px; border-radius: 1px; background: var(--primary); pointer-events: none; }
.e-drop[hidden] { display: none; }
.doubt-tick { display: inline-flex; align-items: center; gap: 3px; padding: 6px 2px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.doubt-tick input { margin: 0; width: 15px; height: 15px; accent-color: #c99a12; cursor: inherit; }
.doubt-tick.is-hidden { visibility: hidden; }
.doubt-tick:has(input:disabled) { cursor: default; }
.e-off-note { margin: 10px 0 0; font-size: 13.5px; font-weight: 600; color: var(--pending-text); display: flex; align-items: center; gap: 8px; }
.e-off-note::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 4px; background: #fff3b8; border: 1px solid #e0b93a; }
.e-off-note[hidden] { display: none; }
.e-players { display: grid; gap: 10px; }
.e-actions { margin-left: auto; display: flex; gap: 14px; }
.e-player > h3 .combo { flex: 1; }
/* Manija para ordenar a los jugadores (arrastrar, o flechas con el teclado). */
.e-grip { flex: none; align-self: center; display: grid; place-items: center; width: 28px; height: 32px; margin: -6px 0 -6px -8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); cursor: grab; touch-action: none; }
.e-grip:hover { background: var(--surface-2); color: var(--text); }
.e-grip:focus-visible { outline: 2px solid var(--focus); }
.e-players.reordering { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.e-players.reordering .e-cols, .e-players.reordering .e-replaces, .e-players.reordering .e-joined, .e-players.reordering .e-actions { display: none; }
.e-players.reordering .e-player > h3 { border-bottom: 0; }
.e-players.reordering .e-grip { cursor: grabbing; }
.e-players.reordering .e-player { transition: transform .15s ease; }
.e-players.reordering .e-player.dragging { transition: none; border-color: var(--primary); box-shadow: 0 8px 24px rgb(21 32 28 / .18); position: relative; z-index: 2; }
.e-add-player { margin-top: 8px; }
.e-new-player { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.e-new-player .combo { flex: 1; min-width: 0; }
.add { justify-self: start; border: 0; background: transparent; color: var(--primary); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 0; }
@media (max-width: 640px) {
  .e-cols { grid-template-columns: 1fr; }
  .e-col + .e-col { border-left: 0; border-top: 1px solid var(--border); }
}
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 50; }
.toast.err { background: var(--live); color: var(--on-live); }

/* Colores de las series del gráfico (paleta validada: azul y naranja). */
:root { --series-1: #2a78d6; --series-2: #eb6834; --grid: #e4e8e5; }

.login { max-width: 360px; margin: 40px auto; width: 100%; }
.err-text { color: var(--live-text); font-size: 14px; font-weight: 600; }

/* AACCP: caballos de cada jugador en un torneo. */
.hp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.hp-bar .filters { margin-inline: 0; padding-inline: 0; }
.hp-search { flex: 0 1 300px; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
@media (max-width: 640px) { .hp-search { flex-basis: 100%; } }
@media (min-width: 641px) { .hp-teams { flex-wrap: wrap; } }
.hp-teams button { flex: none; font: inherit; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.hp-teams button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.a-section[hidden], .hp-player[hidden], .hp-block[hidden], .hp-horses li[hidden] { display: none; }
.hp-player { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.hp-player > h3 { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 16px; font-family: var(--font-body); font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.hp-block { padding: 10px 14px 12px; display: grid; gap: 6px; }
.hp-block + .hp-block { border-top: 1px solid var(--border); }
/* Lo usado fuera de la lista oficial (o todo, para un suplente) va sobre el gris. */
.hp-used { background: var(--bg); border-radius: 0 0 12px 12px; }
.hp-block h4 { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
/* Grilla y no `columns`: en columnas el globo de partidos queda partido y encerrado en la lista. */
.hp-horses { list-style: none; margin: 0; padding: 0; display: grid; column-gap: 20px; font-size: 14px;
  grid-template-columns: repeat(auto-fill, minmax(max(200px, calc((100% - 40px) / 3)), 1fr)); }
.hp-horses li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.hp-horses li.unused { color: var(--text-3); }
.hp-horses small { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hp-horses .who { display: block; font-size: 12px; color: var(--text-3); }
.hp-name { min-width: 0; }
.hp-name a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.hp-name a:hover { color: var(--primary); text-decoration-color: currentColor; }
.hp-horses .aaccp { display: inline-block; width: auto; height: 13px; vertical-align: -1px; margin-left: 3px; }
/* "3 partidos": al pasar el mouse (o tocarlo) muestra cuáles. */
.hp-n { flex: none; position: relative; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; outline-offset: 2px; }
.hp-pop { display: none; position: absolute; z-index: 30; right: 0; top: calc(100% + 4px); width: max-content; max-width: min(300px, 80vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; text-align: left; }
.hp-n:hover .hp-pop, .hp-n:focus-within .hp-pop { display: grid; }
.hp-who { font-size: inherit; color: inherit; }
.hp-who .hp-pop { left: 0; right: auto; }
.hp-pop a { display: grid; gap: 1px; padding: 6px 8px; border-radius: 7px; color: var(--text); }
.hp-pop a:hover { background: var(--surface-2); }
.hp-pop b { font-size: 13px; font-weight: 600; }
.hp-pop small { font-size: 12px; color: var(--text-3); }

/* "Buscar listas en AACCP": diferencias antes de reemplazar. */
.btn.danger-solid { background: var(--live); border-color: var(--live); color: var(--on-live); }
.btn.danger-solid:hover { filter: brightness(.94); background: var(--live); }
.a-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.a-dialog::backdrop { background: rgb(0 0 0 / .45); }
.a-dialog h2 { font-size: 19px; padding: 16px 18px 0; }
.pa-body { padding: 10px 18px; display: grid; gap: 12px; overflow-y: auto; max-height: calc(100vh - 220px); font-size: 14px; }
.pa-player h4 { margin: 0 0 4px; font-size: 14.5px; font-family: var(--font-body); font-weight: 600; }
.pa-player h4 small { font-weight: 400; color: var(--text-3); }
.pa-player ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; color: var(--text-2); }
.pa-player li b { font-weight: 600; }
.pa-player li.add b { color: var(--upcoming-text); }
.pa-player li.del b { color: var(--live-text); }
.pa-player li.move b { color: var(--pending-text); }
.a-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border); }

/* Caballo nuevo (al armar una lista). */
.nh-form { display: grid; }
.nh-form > .a-muted { padding: 0 18px; margin: 4px 0 0; }
.nh-form .nh-who { margin-top: 2px; }
.nh-fields { padding: 12px 18px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
@media (max-width: 560px) { .nh-fields { grid-template-columns: 1fr; } }
.hp-order-bar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.hp-order { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 12px; display: grid; gap: 10px; }
.hp-order[hidden] { display: none; }
.hp-order ol { margin: 0; padding-left: 24px; display: grid; gap: 4px; }
.hp-order li { padding: 2px 0; }
.hp-order li > span { display: inline-block; min-width: min(60%, 260px); font-weight: 600; }
.hp-order-actions { display: flex; gap: 8px; justify-content: flex-end; }
.photo-dialog { width: min(96vw, 560px); }
.photo-dialog img { display: block; width: calc(100% - 36px); margin: 12px 18px; height: auto; max-height: 70vh; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #fff; }

/* Partido cargado a mano: alta y edición (admin/match_form.html). */
.a-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.nh-fields .mf-wide { grid-column: 1 / -1; }
.mf-players { font-weight: 400; color: var(--text-2); min-height: 1em; }
.a-dialog-actions .mf-delete { margin-right: auto; }
.e-player > h3 .e-swap, .e-player > h3 .e-join, .e-player > h3 .e-remove { border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; }
.e-player > h3 .input { flex: 1; min-width: 0; }
.e-player > h3:has(.input) { align-items: center; }
.e-replaces, .e-joined { padding: 6px 14px 0; margin: 0; }
.e-replaces button, .e-joined button { border: 0; background: none; color: var(--text-2); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* Tilde AACCP: marca el caballo como de la AACCP aunque no esté en el registro. */
.aaccp-tick { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; vertical-align: middle; white-space: nowrap; }
.aaccp-tick input { margin: 0; width: 15px; height: 15px; accent-color: var(--primary); cursor: inherit; }
.aaccp-tick img { display: block; width: auto; height: 14px; opacity: .3; filter: grayscale(1); transition: opacity .15s, filter .15s; }
.aaccp-tick input:checked + img { opacity: 1; filter: none; }
.aaccp-tick:has(input:disabled) { cursor: default; }
.e-row .aaccp-tick { padding: 6px 2px; }
.hp-name .aaccp-tick { margin-left: 6px; }

/* Color del equipo (app/colors.py): un punto antes del nombre. */
.team-dot { display: inline-block; width: .62em; height: .62em; border-radius: 50%; background: var(--team); margin: 0 .4em .06em 0; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); flex: none; }

/* Elegir el color del equipo en el editor de la lista. */
.team-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-head .e-doubts { margin-left: auto; border: 0; background: none; padding: 0; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.color-pick { position: relative; font-size: 14px; font-weight: 400; }
.color-btn { display: block; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--team); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); }
.color-btn:hover, .color-btn[aria-expanded="true"] { outline: 2px solid var(--border-strong); outline-offset: 2px; }
.color-btn.none { background: transparent; box-shadow: none; border: 1.5px dashed var(--border-strong); }
.color-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 10px; display: grid; grid-template-columns: repeat(7, 30px); gap: 6px; }
.color-pop[hidden] { display: none; }
.color-pop .sw { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--team); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); }
.color-pop .sw[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.color-pop .other { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.color-pop .other input { width: 34px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
/* La franja de los nombres de los jugadores: el mismo círculo, con «Aa» en el color del texto. */
.band-pick .color-btn { display: grid; place-items: center; font: 700 10px/1 var(--font-body); color: var(--band-text, #fff); }
.band-pick .color-btn.auto { outline: 1.5px dashed var(--border-strong); outline-offset: 2px; }
.color-pop .pop-title { grid-column: 1 / -1; margin: 0 0 2px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.color-pop .auto-btn { grid-column: 1 / -1; justify-self: start; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--text-2); text-decoration: underline; cursor: pointer; }
.color-pop .auto-btn[aria-pressed="true"] { font-weight: 700; color: var(--text); }

/* Armar la lista oficial de un torneo (admin/listas_editar.html). */
.pe-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-actions .btn.armed { color: var(--live-text); background: var(--live-soft); }
.pe-hint { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--secondary-soft); color: var(--text-2); font-size: 14px; }
.pe-root { display: grid; gap: 22px; }
.pe-root:empty { display: none; }
.pe-team-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.pe-team-head .input { flex: 1 1 260px; width: auto; }
.pe-team-head .pe-tools { margin-left: auto; }
.pe-tools { display: inline-flex; gap: 2px; }
.pe-tools button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.pe-tools button:hover { background: var(--surface-2); color: var(--text); }
.pe-tools .pe-del:hover, .pe-tools .armed { color: var(--live-text); }
.pe-tools .armed { background: var(--live-soft); }
.linklike.armed { color: var(--live-text); }
.pe-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; align-items: start; }
.pe-player { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.pe-player > h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); font-family: var(--font-body); font-size: 16px; font-weight: 600; }
.pe-player > h3 .combo { flex: 1; }
.pe-pname { min-width: 0; overflow-wrap: anywhere; }
.pe-count { font-size: 12.5px; font-weight: 400; color: var(--text-3); }
.pe-player > h3 .pe-tools { margin-left: auto; }
.pe-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.pe-horses { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.pe-horses li { display: inline-flex; align-items: center; gap: 2px; padding-left: 9px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.pe-horses .x { border: 0; background: none; width: 26px; height: 26px; border-radius: 50%; color: var(--text-3); font-size: 16px; cursor: pointer; }
.pe-horses .x:hover { color: var(--live-text); background: var(--live-soft); }
.pe-add { font-size: 14px; padding: 7px 10px; }
.pe-tip { margin: -4px 0 0; font-size: 12px; color: var(--text-3); }
.pe-sugg { display: grid; gap: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
.pe-sugg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pe-sugg-head h4 { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.pe-sugg-head .linklike { font-size: 13px; font-weight: 600; }
.pe-sugg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pe-sugg-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.pe-sugg-list span { display: grid; min-width: 0; padding-top: 3px; }
.pe-sugg-list b { font-weight: 600; }
.pe-sugg-list small { font-size: 12px; color: var(--text-3); }
.pe-sugg-list .pe-warn { color: var(--pending-text); }
.pe-sugg-add { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--primary); font-size: 17px; font-weight: 600; line-height: 1; cursor: pointer; }
.pe-sugg-add:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pe-more { justify-self: start; font-size: 13px; }
.pe-add-player { max-width: 420px; }
.pe-new-team { display: grid; gap: 6px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 14px; }
.pe-new-team h2 { font-size: 19px; }
.pe-new-team p { margin: 0; }
.pe-new-team .combo { max-width: 420px; }
/* Caballo en la lista de dos jugadores (viene así de la planilla): sacarlo de una para poder guardar. */
.pe-horses li.dup { border-color: var(--live-text); background: var(--live-soft); color: var(--live-text); }
.pe-horses li.dup small { font-weight: 400; }
