/* Panel del promotor DevOS · prototipo estático.
   Marca "Papel y cota": todos los colores, tipos, espacios y radios salen de
   brand/tokens.css (enlace a docs/brand/tokens.css). Aquí no se definen colores. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-body)/var(--lh-body) var(--font-sans); }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1, h2 { font-family: var(--font-serif); font-variation-settings: var(--serif-settings); color: var(--heading); }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
[hidden] { display: none !important; }
.num, td.num, .kpi-v, .ficha dd { font-variant-numeric: var(--num); }
.t2 { color: var(--text-2); }
.small { font-size: var(--fs-small); line-height: var(--lh-small); }
.label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); }
.lg { font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); }
.ico { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: -4px; }
.ico.s16 { width: 16px; height: 16px; vertical-align: -3px; }
.glyph { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }

/* Logotipo: claro / oscuro / símbolo, con los mismos selectores de modo que tokens.css */
.logo { display: inline-flex; align-items: center; }
.logo img { height: 28px; width: auto; display: block; }
.logo .l-dark, .logo .l-sym { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .l-light { display: none; } :root:not([data-theme="light"]) .logo .l-dark { display: block; } }
:root[data-theme="dark"] .logo .l-light { display: none; }
:root[data-theme="dark"] .logo .l-dark { display: block; }
@media (max-width: 359px) { .logo .l-light, .logo .l-dark, :root[data-theme="dark"] .logo .l-dark { display: none !important; } .logo .l-sym { display: block; } }
.only-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .only-light { display: none; } :root:not([data-theme="light"]) .only-dark { display: block; } }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }

/* Cabecera (no fija) e índice (única pieza fija) */
.wrap { max-width: calc(var(--measure) + var(--space-8)); margin: 0 auto; padding: 0 var(--gutter-mobile); }
.top { padding-top: var(--space-4); }
.row1 { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tools { display: flex; gap: var(--space-2); align-items: center; }
.seg { display: inline-flex; border: var(--border-w) solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: var(--space-1) var(--space-3); font-size: var(--fs-small); min-height: 36px; color: var(--text); transition: background var(--transition); }
.seg button[aria-pressed="true"] { background: var(--heading); color: var(--bg); }
.tools .btn { min-height: 36px; padding: var(--space-1) var(--space-3); }
.top h1 { margin-top: var(--space-4); }
.who { margin-top: var(--space-1); }
.seal-row { margin-top: var(--space-3); }
@media (max-width: 640px) { .top h1 { font-size: var(--fs-h2); line-height: var(--lh-h2); } }
@media (max-width: 479px) { .theme-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

nav.tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: var(--border-w) solid var(--border); margin-top: var(--space-4); }
nav.tabs .wrap { display: flex; }
nav.tabs a { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: 44px; padding: 0 var(--space-2); color: var(--text-2); text-decoration: none; font-size: var(--fs-small); border-bottom: 2px solid transparent; white-space: nowrap; transition: color var(--transition); }
nav.tabs a[aria-current="page"] { color: var(--text); border-color: var(--heading); font-weight: 600; }
nav.tabs .short { display: none; }
@media (max-width: 399px) { nav.tabs .long { display: none; } nav.tabs .short { display: inline; } nav.tabs a { padding: 0 2px; gap: 2px; font-size: var(--fs-chip); } nav.tabs a .ico { width: 12px; height: 12px; } }

main.wrap { padding-top: var(--space-6); padding-bottom: var(--space-8); }
section.view > * + * { margin-top: var(--space-7); }
.sec h2 { margin-bottom: var(--space-2); }
.sec .lead { color: var(--text-2); margin-bottom: var(--space-4); }
@media (min-width: 1024px) { .wide { position: relative; width: min(var(--content-max), calc(100vw - 2 * var(--space-6))); left: 50%; transform: translateX(-50%); } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border: var(--border-w) solid var(--border-strong); background: transparent; color: var(--text); border-radius: var(--r-sm); padding: var(--space-2) var(--space-4); min-height: 40px; font-size: var(--fs-small); font-weight: 500; text-decoration: none; transition: background var(--transition), border-color var(--transition); }
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); font-weight: 600; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.link { border: 0; color: var(--link); padding: var(--space-1) var(--space-2); min-height: 32px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-chip); line-height: var(--lh-chip); font-weight: 500; padding: 2px var(--space-2); border-radius: var(--r-pill); white-space: nowrap; }
.chip.owner { color: var(--chip-owner-fg); background: var(--chip-owner-bg); }
.chip.valid { color: var(--chip-valid-fg); background: var(--chip-valid-bg); }
.chip.pending { color: var(--chip-pending-fg); background: var(--surface); border: var(--border-w) dashed var(--chip-pending-border); }
.seal { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.seal .chip { white-space: normal; }
.portrait { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--brand); object-fit: cover; flex: 0 0 auto; }

/* Estado del semáforo: glifo + palabra, en su color de texto */
.st { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
.st.s-verde { color: var(--ok-text); } .st.s-verde .glyph { color: var(--ok); }
.st.s-ambar { color: var(--warn-text); } .st.s-ambar .glyph { color: var(--warn); }
.st.s-rojo { color: var(--bad-text); } .st.s-rojo .glyph { color: var(--bad); }
.st.s-na { color: var(--text-2); font-weight: 500; }

/* Veredicto */
.verdict { border-radius: var(--r-lg); padding: var(--space-5); border-left: var(--status-rule) solid var(--border-strong); background: var(--surface); }
.verdict.v-verde { background: var(--ok-soft); border-left-color: var(--ok); }
.verdict.v-ambar { background: var(--warn-soft); border-left-color: var(--warn); }
.verdict.v-rojo { background: var(--bad-soft); border-left-color: var(--bad); }
.verdict .label { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.verdict h1 { margin: var(--space-2) 0 var(--space-3); }
.verdict h1 .glyph { width: 24px; height: 24px; margin-right: var(--space-2); vertical-align: -1px; }
.verdict.v-verde h1 .glyph { color: var(--ok); } .verdict.v-ambar h1 .glyph { color: var(--warn); } .verdict.v-rojo h1 .glyph { color: var(--bad); }
.verdict .lg + .lg { margin-top: var(--space-2); }
@media (max-width: 640px) { .verdict { padding: var(--space-4); } .verdict h1 { font-size: var(--fs-h2); line-height: var(--lh-h2); } }
.comment { margin-top: var(--space-5); border-left: 2px solid var(--border-strong); padding-left: var(--space-4); }
.comment .firma { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }

/* Tarjetas KPI */
.kpis { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: var(--border-w) solid var(--border); border-radius: var(--r-md); padding: var(--space-5); }
@media (max-width: 640px) { .card { padding: var(--space-4); } }
.kpi h3 { font-size: var(--fs-body); line-height: var(--lh-body); }
.kpi-v { font-size: var(--fs-kpi); line-height: var(--lh-kpi); font-weight: 600; letter-spacing: var(--tracking-kpi); margin: var(--space-2) 0 var(--space-1); }
.kpi .thr { margin-top: var(--space-1); }
details.why { margin-top: var(--space-2); }
details.why summary { cursor: pointer; color: var(--link); font-size: var(--fs-small); }
details.why p { margin-top: var(--space-1); font-size: var(--fs-small); color: var(--text-2); }

/* Fichas técnicas */
.ficha { margin: 0; background: var(--surface); border: var(--border-w) solid var(--border); border-radius: var(--r-md); padding: 0 var(--space-4); }
.ficha > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: var(--border-w) solid var(--border); }
.ficha > div:last-child { border-bottom: 0; }
.ficha dt { color: var(--text-2); font-size: var(--fs-small); }
.ficha dt small { display: block; font-size: var(--fs-label); }
.ficha dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }

/* Riesgos */
.risks { display: grid; gap: var(--space-3); }
.risk { background: var(--surface); border: var(--border-w) solid var(--border); border-left: var(--status-rule) solid var(--border-strong); border-radius: var(--r-md); padding: var(--space-3) var(--space-4); }
.risk.r-ambar { border-left-color: var(--warn); }
.risk.r-rojo { border-left-color: var(--bad); }
.risk.r-pend { border-left-style: dashed; border-left-color: var(--chip-pending-border); }
.risk b { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.risk p { margin-top: var(--space-1); color: var(--text-2); font-size: var(--fs-small); }
.risk .btn { margin-top: var(--space-3); }

/* Bandas neutras */
.band { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--r-md); border: var(--border-w) solid var(--border-strong); background: var(--surface); margin-bottom: var(--space-4); }
.band b { display: block; }
.band p { font-size: var(--fs-small); color: var(--text-2); margin-top: 2px; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); line-height: var(--lh-small); }
th, td { text-align: left; padding: var(--space-3) var(--space-2); border-bottom: var(--border-w) solid var(--border); vertical-align: top; }
th { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-2); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.base td { font-weight: 600; }
.sub { display: block; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); font-weight: 400; margin-top: 2px; }
@media (min-width: 641px) { .scen td:first-child { min-width: 220px; } }
@media (max-width: 640px) {
  .stack thead { display: none; }
  .stack tr { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: var(--border-w) solid var(--border); }
  .stack td { border: 0; padding: 0; }
  .stack td[data-l]::before { content: attr(data-l) " "; color: var(--text-2); font-size: var(--fs-label); }
  .stack td.full { grid-column: 1 / -1; }
  .scen td.num { white-space: normal; }
}
.box { background: var(--surface); border: var(--border-w) solid var(--border); border-radius: var(--r-md); padding: var(--space-2) var(--space-4); }

/* Gráfico de caja */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-2); font-size: var(--fs-label); font-family: var(--font-sans); }
.chart .grid { stroke: var(--border); }
.chart .zero { stroke: var(--border-strong); }
.chart .mark { stroke: var(--border-strong); stroke-dasharray: 2 4; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: color-mix(in srgb, var(--series-1) 12%, transparent); }
.chart .hatch-bg { fill: var(--bad-soft); }
.chart .hatch-ln { stroke: var(--bad); stroke-width: 1.5; }
.chart .low { fill: var(--bad); stroke: var(--surface); stroke-width: 2; }
.chart text.low-t { fill: var(--bad-text); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--fs-small); color: var(--text-2); margin-top: var(--space-2); }
.legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.sw { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.sw.line { background: var(--series-1); }
.sw.neg { background: repeating-linear-gradient(45deg, var(--bad) 0 1.5px, var(--bad-soft) 1.5px 6px); }

/* Barras */
.bars { display: grid; gap: var(--space-3); }
.bar-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) 120px; gap: var(--space-3); align-items: center; font-size: var(--fs-small); }
.bar-track { position: relative; height: 16px; background: var(--border); border-radius: var(--r-xs); }
.bar-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--r-xs); background: var(--series-2); }
.bar-fill.s3 { background: var(--series-3); }
.bar-ref { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--text-2); }
.bar-end { display: flex; justify-content: flex-end; gap: var(--space-2); align-items: center; }
.ref-note { margin-top: var(--space-3); }
@media (max-width: 640px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; } }

/* Mis datos */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.pillbtn { border: var(--border-w) solid var(--border-strong); background: transparent; border-radius: var(--r-pill); padding: var(--space-1) var(--space-3); font-size: var(--fs-small); min-height: 36px; transition: background var(--transition); }
.pillbtn[aria-pressed="true"] { background: var(--heading); color: var(--bg); border-color: var(--heading); }
.stage-h { font-size: var(--fs-h3); line-height: var(--lh-h3); margin: var(--space-6) 0 var(--space-1); }
.stage-h:first-of-type { margin-top: 0; }
.pending-note { display: block; font-size: var(--fs-small); color: var(--text); margin-top: var(--space-1); }
@media (max-width: 640px) { .drow td.chipc { grid-column: 1 / -1; } }
.edit-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-2) var(--space-3); padding: var(--space-3); background: var(--bg); border: var(--border-w) solid var(--border); border-radius: var(--r-md); margin-top: var(--space-2); }
.edit-form label { font-size: var(--fs-small); color: var(--text-2); display: grid; gap: var(--space-1); }
.edit-form input, .edit-form select { font-size: var(--fs-body); min-height: 44px; background: var(--surface); border: var(--border-w) solid var(--border-strong); border-radius: var(--r-sm); padding: var(--space-2); width: 100%; min-width: 0; color: var(--text); }
.edit-form .attach, .edit-form .actions { grid-column: 1 / -1; }
.edit-form .actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.inline { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) { .edit-form { grid-template-columns: 1fr; } }
.cart { position: sticky; bottom: var(--space-3); margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; background: var(--surface-raised); border: var(--border-w) solid var(--border); border-radius: var(--r-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-1); }
dialog { border: 0; border-radius: var(--r-lg); padding: var(--space-5); max-width: 520px; width: calc(100% - 2 * var(--gutter-mobile)); max-height: calc(100dvh - 2 * var(--space-4)); background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-2); }
/* El diálogo tiene scroll interno: el título y los botones siempre se ven. */
dialog[open] { display: flex; flex-direction: column; }
dialog .dlg-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
dialog .dlg-body > * + * { margin-top: var(--space-3); }
dialog .actions { flex: 0 0 auto; }
@media (max-width: 640px) { dialog { padding: var(--space-4); } }
.avisos { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--r-md); border: var(--border-w) solid var(--border-strong); background: var(--surface); }
.avisos p { margin-top: var(--space-2); font-size: var(--fs-small); line-height: var(--lh-small); }
.avisos .btn.link { padding: 0; min-height: 0; display: inline; text-decoration: underline; }
ul.enviado { padding-left: var(--space-5); }
dialog::backdrop { background: color-mix(in srgb, var(--text) 45%, transparent); }
dialog h2 { margin-bottom: var(--space-3); }
dialog ul { padding-left: var(--space-5); }
dialog .actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-5); flex-wrap: wrap; }

/* Exportar */
.export-grid { display: grid; gap: var(--space-3); }
.export-grid .card { display: grid; gap: var(--space-2); align-content: start; }
.export-grid p { color: var(--text-2); font-size: var(--fs-small); }

/* Estado de espera */
.wait { position: relative; overflow: hidden; background: var(--surface-raised); border: var(--border-w) solid var(--border); border-radius: var(--r-lg); padding: var(--space-6) var(--space-5); }
.wait .cotas { position: absolute; top: calc(-1 * var(--space-5)); right: calc(-1 * var(--space-6)); width: 220px; pointer-events: none; }
.wait .illu { max-width: 280px; width: 100%; mix-blend-mode: multiply; margin-bottom: var(--space-4); position: relative; }
.wait h1, .wait > p, .wait .steps, .wait .firma { position: relative; }
.wait > p { margin-top: var(--space-3); }
.wait .firma { display: flex; align-items: center; gap: var(--space-2); }
.steps { display: grid; gap: var(--space-2); margin: var(--space-5) 0; }
.step { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3); border-radius: var(--r-md); background: var(--surface); border: var(--border-w) solid var(--border); }
.step.on { border-color: var(--heading); }
.step .glyph { color: var(--ok); }
.locked { display: flex; gap: var(--space-3); align-items: center; color: var(--text-2); }

.foot { margin-top: var(--space-7); font-size: var(--fs-small); color: var(--text-2); max-width: var(--measure); }
.demo { margin-top: var(--space-5); font-size: var(--fs-small); color: var(--text-2); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

/* Portada del PDF (impresión y vista previa) */
.print-only { display: none; }
.cover { position: relative; overflow: hidden; padding: var(--space-5) 0 var(--space-6); border-bottom: 2px solid var(--heading); margin-bottom: var(--space-6); }
.cover .logo-cover { height: 40px; width: auto; display: block; position: relative; }
.cover .cotas { position: absolute; top: calc(-1 * var(--space-6)); right: calc(-1 * var(--space-7)); width: 260px; opacity: .4; }
.cover h1 { font-size: var(--fs-display); line-height: var(--lh-display); margin-top: var(--space-6); position: relative; }
.cover p { margin-top: var(--space-2); color: var(--text-2); position: relative; }
.cover .seal { margin-top: var(--space-4); position: relative; }
.cover .franja { color: var(--text); font-weight: 600; }

@page { size: A4; margin: 16mm 14mm 18mm;
  @bottom-left { content: var(--pie-pdf, ""); font-family: var(--font-sans); font-size: 8pt; color: var(--text-2); }
  @bottom-right { content: "Página " counter(page) " de " counter(pages); font-family: var(--font-sans); font-size: 8pt; color: var(--text-2); }
  @top-center { content: var(--franja-pdf, ""); font-family: var(--font-sans); font-size: 8pt; font-weight: 600; color: var(--text); } }
@media print {
  body { font-size: 10pt; line-height: 1.45; }
  .top, nav.tabs, .demo, .no-print, .cart, details.why summary, #banner { display: none !important; }
  .print-only { display: block; }
  main.wrap { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .wide { width: auto; left: auto; transform: none; }
  section.view { display: block !important; break-before: page; }
  section.view[data-view="resumen"] { break-before: auto; }
  section.view[data-view="exportar"], body.is-pendiente section.view[data-view="caja"], body.is-pendiente section.view[data-view="escenarios"] { display: none !important; }
  .card, .risk, .verdict, .ficha > div, tr, .bar-row { break-inside: avoid; }
  .verdict, .risk, .chip, .st, .sw.neg, .chart { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}
/* Vista previa en pantalla: misma maqueta que la impresión, en claro (el JS fuerza data-theme="light") */
body.preview .top, body.preview nav.tabs, body.preview .demo, body.preview .no-print, body.preview .cart, body.preview details.why summary, body.preview #banner { display: none !important; }
body.preview .print-only { display: block; }
body.preview section.view { display: block !important; }
body.preview section.view + section.view { margin-top: var(--space-7); padding-top: var(--space-7); border-top: var(--border-w) solid var(--border); }
body.preview section.view[data-view="exportar"] { display: none !important; }
body.preview main { padding-top: calc(var(--space-8) + var(--space-4)); }
.preview-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; gap: var(--space-3); justify-content: center; align-items: center; padding: var(--space-3); background: var(--surface-raised); border-bottom: var(--border-w) solid var(--border); box-shadow: var(--shadow-1); font-size: var(--fs-small); }
@media print { .preview-bar { display: none !important; } }

/* ---------- Versión conectada (Entrega 3b) ---------- */
/* Pantallas sueltas: entrada (entrar.html), sin proyectos y sus proyectos. */
body.is-screen .top, body.is-screen nav.tabs, body.is-screen main#app { display: none; }
.auth { position: relative; max-width: calc(400px + 2 * var(--gutter-mobile)); margin: 0 auto; padding: var(--space-6) var(--gutter-mobile) var(--space-8); }
.auth > * + *, .auth section > * + *, .auth form > * + * { margin-top: var(--space-4); }
.auth h1 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.auth h1:focus { outline: none; }
.auth h1:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.auth-page { position: relative; overflow: hidden; min-height: 100vh; }
.auth-page .cotas { position: absolute; top: -60px; right: -90px; width: 220px; pointer-events: none; }
.field { display: grid; gap: var(--space-1); }
.field label { font-weight: 600; font-size: var(--fs-small); line-height: var(--lh-small); }
.input { width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border: var(--border-w) solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: var(--fs-body); }
textarea.input { resize: vertical; min-height: 88px; }
.input.code { font-size: var(--fs-h2); letter-spacing: .3em; text-align: center; font-variant-numeric: var(--num); }
.input[aria-invalid="true"], .edit-form input[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.btn.block { width: 100%; min-height: 44px; }
.check { display: flex; gap: var(--space-3); align-items: center; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.alert { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-3); border-radius: var(--r-md); background: var(--bad-soft); color: var(--bad-text); border-left: var(--status-rule) solid var(--bad); font-size: var(--fs-small); line-height: var(--lh-small); }
.alert .glyph { color: var(--bad); margin-top: 2px; }
.field-err { color: var(--bad-text); font-size: var(--fs-small); line-height: var(--lh-small); }
.field-err:empty { display: none; }
.edit-form .field-err { grid-column: 1 / -1; }
.trust { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }
.trust .ico { margin-top: 0; }
details.ayuda { border-top: var(--border-w) solid var(--border); padding-top: var(--space-2); }
details.ayuda summary { cursor: pointer; color: var(--link); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details.ayuda ol { margin: var(--space-2) 0 0; padding-left: var(--space-5); font-size: var(--fs-small); line-height: var(--lh-small); display: grid; gap: var(--space-2); }
.enlaces { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: center; }
.enlaces .btn.link { min-height: 44px; padding-left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Sus proyectos */
.lista { padding-top: var(--space-4); padding-bottom: var(--space-8); }
.lista h1 { margin-top: var(--space-5); }
.lista h1:focus { outline: none; }
.proyectos { list-style: none; padding: 0; margin: var(--space-5) 0 0; display: grid; gap: var(--space-3); }
.pcard { display: block; color: inherit; text-decoration: none; background: var(--surface); border: var(--border-w) solid var(--border); border-radius: var(--r-md); padding: var(--space-4); transition: border-color var(--transition); }
.pcard:hover { border-color: var(--border-strong); }
.pcard h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.pcard > * + * { margin-top: var(--space-2); }
/* Panel: enlace a la lista, pasos de captura y línea de cuenta */
.back { margin-top: var(--space-3); font-size: var(--fs-small); }
.back a { display: inline-flex; align-items: center; min-height: 44px; }
.back + h1 { margin-top: 0; }
ol.steps { list-style: none; padding: 0; }
.step[aria-current] b { font-weight: 600; }
.account { margin-top: var(--space-7); padding-top: var(--space-3); border-top: var(--border-w) solid var(--border); font-size: var(--fs-small); color: var(--text-2); overflow-wrap: anywhere; }
.account + .foot { margin-top: var(--space-4); }
.account .btn.link { padding: 0 var(--space-1); }
.fname { font-variant-numeric: var(--num); overflow-wrap: anywhere; }
.cart .small { margin-top: 2px; }
#datosTitulo:focus { outline: none; }
/* Objetivos táctiles de 44 px en el celular */
@media (max-width: 640px) {
  .btn, .btn.link, .pillbtn { min-height: 44px; }
  .tools .btn, .seg button { min-height: 44px; }
}
