/* Hallmark · extends app.css (same DESIGN.md tokens, no new colours) · account and ranking screens: sign in, sign up, Google, password, profile, delete account, top 50
 * critique: plain paper cards with the ink edge; one orange button per card; the ranking marks your own row with the marker yellow, nothing else is coloured */

.cu { display: grid; gap: var(--s-5); max-width: 40rem; }
.cu[aria-busy="true"] { opacity: 0.7; }
.cu-card { color: var(--text); display: grid; gap: var(--s-4); padding: var(--s-6); border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--hard); }
.cu-card h2 { font-size: var(--t-xl); text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.cu-card p { margin: 0; line-height: 1.6; }
.cu-form { display: grid; gap: var(--s-4); }
.cu-l { display: grid; gap: var(--s-1); }
.cu-l > span { font-weight: 600; }
.cu-i { min-height: 44px; padding: 0 var(--s-3); border: 1.5px solid var(--edge); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: 500 var(--t-md)/1 var(--font-body); }
.cu-i:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cu-i:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.cu-i:hover:not(:disabled) { background: var(--surface-2); }
.cu-i:active:not(:disabled) { border-color: var(--brand-edge); }
.cu-check { display: flex; gap: var(--s-2); align-items: flex-start; line-height: 1.5; }
.cu-check input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }
.cu-check input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cu-form .btn--primary, .cu-form .btn { justify-self: start; }
.cu-google { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); }
.cu-g path { fill: currentColor; stroke: none; }
.cu-o { display: flex; align-items: center; gap: var(--s-3); color: var(--text-3); font-size: var(--t-sm); }
.cu-o::before, .cu-o::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.cu-alt { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.cu-alt .btn--text { padding-inline: 0; }
.cu-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin: 0; }
.cu-stats div { padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-cover); background: var(--surface-2); }
.cu-stats dt { font-size: var(--t-sm); color: var(--text-3); }
.cu-stats dd { margin: 0; font: 800 var(--t-2xl)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.cu-peligro { box-shadow: var(--hard), inset 5px 0 0 var(--bad); }
@media (max-width: 30rem) { .cu-stats { grid-template-columns: minmax(0, 1fr); } }

.rk { max-width: 44rem; display: grid; gap: var(--s-3); }
.rk-list { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--hard); overflow: hidden; }
.rk-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: baseline; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }
.rk-row:last-child { border-bottom: 0; }
.rk-row.is-me { background: var(--note); }
.rk-pos { font: 800 var(--t-lg)/1 var(--font-display); color: var(--text-3); font-variant-numeric: tabular-nums; }
.rk-row:nth-child(-n+3) .rk-pos { color: var(--brand-text); }
.rk-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-xp { font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-racha { font-size: var(--t-sm); }
@media (max-width: 30rem) { .rk-row { grid-template-columns: 2rem minmax(0, 1fr) auto; } .rk-racha { display: none; } }

/* v19 · contraseña con ojo, @usuario, fecha + género, aviso de disponibilidad, anti-robots */
.cu-pass, .cu-arroba { position: relative; display: block; }
.cu-pass .cu-i { width: 100%; padding-right: 52px; }
.cu-ojo { position: absolute; top: 50%; right: 4px; translate: 0 -50%; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.cu-ojo:hover { background: var(--surface-2); color: var(--text); }
.cu-ojo:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.cu-ojo:active { color: var(--brand-text); }
.cu-ojo svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cu-ojo .ojo-c { display: none; }
.cu-ojo.is-on .ojo-a { display: none; }
.cu-ojo.is-on .ojo-c { display: inline; }
.cu-arroba .cu-i { width: 100%; padding-left: 32px; }
.cu-arroba b { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--text-3); font-weight: 700; pointer-events: none; }
.cu-dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.cu-dos .cu-i, .cu-l select.cu-i { width: 100%; }
select.cu-i { appearance: none; padding-right: var(--s-6); background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.cu-bien { color: var(--ok); font-weight: 600; }
.cu-mal { color: var(--bad); font-weight: 600; }
.cu-nota { margin-top: calc(var(--s-2) * -1); }
.cu-cap:empty { display: none; }
@media (max-width: 30rem) { .cu-dos { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .cu-ojo { transition: none; } }

/* v19 · panel de admin */
.adm { max-width: 72rem; }
.adm-res { min-height: 1px; }
.adm-stats { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.adm-stats dd { font-size: var(--t-xl); }
.adm-tabs { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.adm-tabs [aria-selected="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.adm-busca { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-3); }
.adm-busca .cu-i { flex: 1; min-width: 0; }
.adm-tabla { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-cover); background: var(--surface); }
.adm-tabla:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.adm-tabla table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.adm-tabla th, .adm-tabla td { padding: var(--s-2) var(--s-3); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-tabla th { color: var(--text-3); font-weight: 600; }
.adm-tabla tr:last-child td { border-bottom: 0; }
.adm-tabla tr.is-bloq td { color: var(--text-3); }
.adm-tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--t-xs, 0.75rem); color: var(--text-2); }
.adm-tag--mal { color: var(--bad); }
.adm-qr { width: 200px; height: 200px; padding: var(--s-2); border-radius: var(--r-cover); background: var(--flik-white); }
.adm-sec { word-break: break-all; font-family: var(--font-code); }
.adm-code { max-width: 12rem; letter-spacing: 0.3em; font-family: var(--font-code); }
.adm-pasos { margin: 0; padding-left: 1.2em; line-height: 1.6; }
.adm-co .co-c { list-style: none; }

/* v22 · medidor de seguridad de la contraseña y repetición */
.cu-regular { color: var(--text-2); font-weight: 600; }
.cu-fuerza { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-1); margin-top: var(--s-1); }
.cu-fuerza i { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); }
.cu-fuerza[data-nivel="-1"] { visibility: hidden; }
.cu-fuerza[data-nivel="0"] i:nth-child(-n+1), .cu-fuerza[data-nivel="1"] i:nth-child(-n+1) { background: var(--bad); }
.cu-fuerza[data-nivel="1"] i:nth-child(2) { background: var(--bad); }
.cu-fuerza[data-nivel="2"] i:nth-child(-n+2) { background: var(--warn); }
.cu-fuerza[data-nivel="3"] i:nth-child(-n+3) { background: var(--ok); }
.cu-fuerza[data-nivel="4"] i { background: var(--ok); }

/* v23 · apuntes de la comunidad y asignaturas hechas con ellos */
.com { display: grid; gap: var(--s-10); }
.com-sec { display: grid; gap: var(--s-4); }
.com-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.com-cab h2 { font-size: var(--t-2xl); }
.com-filtros { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.com-filtros:empty { display: none; }
.com-filtros .gen-tipo[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.com-lista, .com-mios { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.com-ap { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; gap: var(--s-4); align-items: start; padding: var(--s-4) var(--s-5); border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--surface); }
.com-ap__tipo { display: grid; place-items: center; width: 3.25rem; aspect-ratio: 4 / 5; border-radius: var(--r-tag); background: var(--surface-3); color: var(--text-2); font-size: var(--t-xs); font-weight: 700; }
.com-ap__txt { display: grid; gap: var(--s-2); min-width: 0; }
.com-ap__txt h3 { font-size: var(--t-lg); overflow-wrap: break-word; min-width: 0; }
.com-ap__txt p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.com-ap__tags { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.com-ap__por { font-size: var(--t-sm); }
.com-ap__acc { display: grid; gap: var(--s-1); justify-items: end; }
.com-ap__msg:empty { display: none; }
.com-rep { gap: var(--s-2); }
.com-vacio { padding: var(--s-4) 0; }
.com-asig { --cover: oklch(72% 0.13 var(--tono, 260)); }
.com-asigs > .muted { grid-column: 1 / -1; }
.com-subir { scroll-margin-top: var(--s-6); }
.com-file { padding: var(--s-2) var(--s-3); border-radius: var(--r-cover); }
.com-mio { display: flex; align-items: start; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.com-mio:last-child { border-bottom: 0; }
.com-mio b { margin-right: var(--s-2); overflow-wrap: anywhere; }
.com-mio p { margin: var(--s-1) 0 0; font-size: var(--t-sm); }
.com-mio.is-aprobado .com-estado { background: var(--ok); color: var(--bad-ink); }
.com-mio.is-rechazado .com-estado { background: var(--bad); color: var(--bad-ink); }
.com-motivo { color: var(--text); }
@media (max-width: 40rem) {
  .com-ap { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); }
  .com-ap__tipo { display: none; }
  .com-ap__acc { justify-items: start; grid-auto-flow: column; justify-content: start; }
}

.asc { display: grid; gap: var(--s-6); min-width: 0; }
.asc-temas ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); position: sticky; top: var(--s-6); }
.asc-t { display: flex; gap: var(--s-3); align-items: center; width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-cover); background: transparent; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.asc-t:hover { background: var(--surface-2); color: var(--text); }
.asc-t:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.asc-t:active { background: var(--surface-3); }
.asc-t[aria-current="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
.asc-t__n { display: grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: var(--r-pill); background: var(--surface-3); font-size: var(--t-sm); font-weight: 700; }
.asc-tema h2 { font-size: var(--t-2xl); overflow-wrap: break-word; min-width: 0; }
.asc-res { display: grid; gap: var(--s-3); max-width: 68ch; line-height: 1.7; }
.asc-res ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-1); }
.asc-res p { margin: 0; }
.asc-li { padding-left: 1.2em; text-indent: -0.9em; }
.asc-li::before { content: "•"; display: inline-block; width: 0.9em; text-indent: 0; }
.asc-nota { font-size: var(--t-sm); }
@media (max-width: 52rem) {
  .asc-temas ol { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: var(--s-1); }
}

/* v23 · panel de admin: cola de apuntes y asignaturas */
.adm-sub { margin-bottom: var(--s-2); }
.adm-aps, .adm-asigs, .adm-tl { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.adm-ap, .adm-asig { display: grid; gap: var(--s-3); padding: var(--s-5); border: 1.5px solid var(--edge); border-radius: var(--r-card); background: var(--surface); }
.adm-t { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); }
.adm-ap__cab { display: flex; justify-content: space-between; align-items: start; gap: var(--s-3); }
.adm-ap__cab h3, .adm-ap__cab h4 { font-size: var(--t-lg); overflow-wrap: anywhere; min-width: 0; }
.adm-ap p { margin: 0; overflow-wrap: anywhere; }
.adm-ap__m:empty, .adm-edit:empty, .adm-temas:empty { display: none; }
.adm-ap__rech { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); }
.adm-ia { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--line); }
.adm-ia--ok { box-shadow: inset 3px 0 0 var(--ok); }
.adm-ia--warn { box-shadow: inset 3px 0 0 var(--warn); }
.adm-ia--bad { box-shadow: inset 3px 0 0 var(--bad); }
.adm-ia p { margin: 0; line-height: 1.5; }
.adm-ia ul { margin: 0; padding-left: 1.2em; }
.adm-alertas { color: var(--bad); font-weight: 600; }
.adm-rep { padding: var(--s-2) var(--s-3); border-radius: var(--r-cover); background: var(--note); color: var(--text); }
.adm-sel { display: grid; gap: var(--s-2); margin: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-cover); max-height: 18rem; overflow-y: auto; }
.adm-sel legend { padding: 0 var(--s-1); font-weight: 600; }
.adm-temas { display: grid; gap: var(--s-3); }
.adm-prev { padding: var(--s-4); border-radius: var(--r-cover); background: var(--surface); }
.adm-edit input[type="range"] { width: 100%; accent-color: var(--brand); }

/* v27 · cola de la IA en el panel */
.adm-trab { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.adm-trab__i { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-cover); background: var(--surface-2); }
.adm-trab__i p { margin: var(--s-1) 0 0; font-size: var(--t-sm); }
.adm-trab__i.is-error { box-shadow: inset 3px 0 0 var(--bad); }
.adm-trab__i.is-hecho { box-shadow: inset 3px 0 0 var(--ok); }
.adm-trab__i.is-haciendo { box-shadow: inset 3px 0 0 var(--brand); }

/* v27 · camino guiado de las asignaturas de la comunidad (js/camino-com.js) */
.cc-disco, .cc .cam-u, .cc-jugar { --cover: oklch(72% 0.13 var(--tono, 260)); }
.cc-extra { margin: 0; padding: 0 var(--s-5) var(--s-4) calc(var(--s-5) + 44px + var(--s-4)); font-size: var(--t-sm); }
.cc-extra a { color: var(--text-2); font-weight: 600; }
.cc-extra a:hover { color: var(--text); }
.cc-jugar { display: grid; gap: var(--s-4); max-width: 46rem; padding: var(--s-6); border-radius: var(--r-card); background: var(--surface); scroll-margin-top: var(--s-6); }
.cc-jugar h2 { font-size: var(--t-2xl); overflow-wrap: break-word; min-width: 0; }
.cc-jugar h2:focus { outline: none; }
.cc-jugar h3 { font-size: var(--t-xl); overflow-wrap: break-word; min-width: 0; }
.cc-jugar__c { display: grid; gap: var(--s-4); min-width: 0; }
.cc-jugar__u { margin: 0; font-size: var(--t-sm); font-weight: 600; color: var(--text-3); }
.cc-volver { justify-self: start; display: inline-flex; align-items: center; gap: var(--s-1); }
.cc-nota { margin: 0; color: var(--text-2); max-width: 60ch; }
.cc-lecs { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cc-lec, .cc-caso { display: grid; gap: var(--s-4); min-width: 0; }
.cc-caso + .cc-caso { padding-top: var(--s-5); border-top: 1px solid var(--line); }
.cc-vida, .cc-queda { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-radius: var(--r-card); background: var(--surface-2); }
.cc-vida p, .cc-queda p { margin: 0; }
.cc-queda { box-shadow: inset 3px 0 0 var(--moon-lit); }
.cc-queda p:last-child { font: 400 var(--t-lg)/1.4 var(--font-display); }
.cc-vida__k { font-size: var(--t-sm); font-weight: 700; color: var(--text-3); }
.cc-q { display: grid; gap: 0; min-width: 0; }
.cc-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); counter-reset: ccp; }
.cc-paso { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-card); background: var(--surface-2); counter-increment: ccp; min-width: 0; }
.cc-paso p { margin: 0; }
.cc-paso__q::before { content: "Paso " counter(ccp) ". "; font-weight: 700; }
.cc-paso__a { font-weight: 700; padding-left: var(--s-3); box-shadow: inset 2px 0 0 var(--ok); }
.cc-paso__p { color: var(--text-2); font-size: var(--t-sm); }
.cc-res:empty { display: none; }
.cc-sig { margin-top: var(--s-2); }
.adm-prev .cc-jugar, .adm-prev .camino { max-width: none; }
@media (max-width: 40rem) {
  .cc-jugar { padding: var(--s-5) var(--s-4); }
  .cc-extra { padding: 0 var(--s-2) var(--s-3) calc(var(--s-2) + 40px + var(--s-3)); }
}
