.herr-page { background: var(--night); color: var(--night-ink); }
.herr-page > :is(main,footer) {
  color-scheme: dark;
  --ink: var(--night-ink);
  --ink-2: var(--night-dim);
  --line: var(--night-line);
  --accent: var(--glow);
  --bg: var(--night);
  --surface: #12221c;
}
.herr-page [hidden] { display: none !important; }
.herr-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.herr-page > :is(main,footer) { width: min(1120px,calc(100% - 32px)); margin-inline: auto; }
.herr-shell { padding-top: clamp(24px,5vw,64px); }
.herr-shell h1 { margin: .18em 0 .32em; font-size: clamp(2rem,5.4vw,3.65rem); letter-spacing: -.048em; line-height: 1.05; max-width: 20ch; }
.herr-shell h2 { margin: 0 0 .55em; line-height: 1.22; }
.herr-shell p { margin: .45em 0 .9em; }
.herr-intro { margin-bottom: 24px; }
.herr-intro > p:not(.herr-kicker) { max-width: 64ch; }
.herr-shell .herr-kicker { margin: .75rem 0 .2rem; color: var(--accent); font: 650 .77rem/1.3 'Geist Mono',monospace; text-transform: uppercase; letter-spacing: .1em; }
.herr-small,.herr-campo small,.herr-origen,.herr-nota { color: var(--ink-2); font-size: .87rem; }
.herr-grid,.herr-trabajo { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); align-items: start; }
.herr-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,265px),1fr)); }
.herr-card,.herr-panel,.herr-faq,.herr-puente,.herr-documento { min-width: 0; padding: clamp(16px,2.7vw,26px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface, #101e19); }
.herr-card { align-self: stretch; display: flex; flex-direction: column; align-items: start; }
.herr-card .herr-fav { margin-top: auto; }
.herr-card h2 { font-size: 1.35rem; }
.herr-shell a:not(.action) { text-underline-offset: .16em; }
.herr-faq,.herr-puente,.herr-documento,.herr-chips { margin-top: 20px; }
.herr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.herr-chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.herr-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.herr-btn,.herr-fav { min-height: 44px; border: 1px solid var(--accent); border-radius: 9px; padding: .5rem 1rem; font: inherit; font-size: .93rem; font-weight: 650; cursor: pointer; background: var(--accent); color: #10201b; }
.herr-btn-sec,.herr-fav { background: transparent; color: var(--ink); border-color: var(--line); }
.herr-fav[aria-pressed=true] { border-color: var(--accent); }
.herr-btn:disabled { opacity: .58; cursor: not-allowed; }
.herr-shell :focus-visible,.herr-shell [tabindex='-1']:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.herr-campos { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,175px),1fr)); gap: 12px; }
.herr-campo { min-width: 0; }
.herr-campo label { display: block; margin: 0 0 4px; line-height: 1.3; font-weight: 600; }
.herr-campo small,.herr-origen { display: block; }
.herr-campo input,.herr-campo select,.herr-campo textarea,.herr-copiable { display: block; color: var(--ink); background: var(--bg); font: inherit; padding: .52rem .62rem; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; }
.herr-campo input[aria-invalid=true],.herr-campo select[aria-invalid=true],.herr-campo textarea[aria-invalid=true] { border-color: #f3ab85; }
.herr-campo textarea,.herr-copiable { resize: vertical; }
.herr-origen { margin: 0 0 10px; }
.herr-shell fieldset { margin: 10px 0 14px; padding: 12px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; }
.herr-shell legend { padding: 0 6px; font-weight: 650; }
.herr-shell details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.herr-shell summary { cursor: pointer; padding: 4px 0; }
.herr-shell #herr-errores,.herr-aviso { color: #ffd3ba; }
#herr-errores,#herr-resultado:not(:empty) { margin-top: 18px; }
.herr-destacado { color: var(--accent); font-size: clamp(1.2rem,3.7vw,1.85rem); font-weight: 700; overflow-wrap: anywhere; }
.herr-filas,.doc-meta { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: .25rem .7rem; }
.herr-filas dd,.doc-meta dd { margin: 0; overflow-wrap: anywhere; }
.herr-tabla-wrap { overflow-x: auto; }
.herr-tabla,.doc-tabla { width: 100%; border-collapse: collapse; text-align: left; }
.herr-tabla :is(td,th),.doc-tabla :is(td,th) { border-bottom: 1px solid var(--line); padding: 6px; line-height: 1.3; font-size: .85rem; }
.herr-tabla .num,.doc-tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.herr-copiable { margin-bottom: 10px; overflow-wrap: anywhere; }
.herr-qr svg { width: min(100%,224px); height: auto; display: block; margin: 12px 0; }
.herr-tasa-card { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; overflow-wrap: anywhere; }
.herr-tasa-card h3 { margin: 0; font-size: 1.08rem; }
.herr-tasa-card .aviso { color: #ffd3ba; }
.herr-documento { color-scheme: light; color: #1a2b24; background: #f3f7f4; overflow-wrap: anywhere; }
.herr-documento .doc-tabla :is(td,th) { border-color: #cbd8d0; }
.herr-documento .doc-aviso { font-weight: 700; }
.doc-total { margin-top: 14px; font-weight: 700; }
.doc-notas { white-space: pre-wrap; }
.doc-tabla .num { min-width: 45px; }
@media (max-width: 520px) {
  .herr-page > :is(main,footer) { width: calc(100% - 24px); }
  .herr-tabla :is(td,th),.doc-tabla :is(td,th) { padding-inline: 3px; font-size: .76rem; }
}
@media print {
  @page { size: A4; margin: 16mm; }
  .herr-page,.herr-page > main,.herr-documento { background: white !important; color: black !important; margin: 0; padding: 0; width: 100%; border: 0; }
  .herr-page > :not(main),.herr-shell > :not(#herr-doc),#herr-imprimir { display: none !important; }
  .doc-tabla tr { break-inside: avoid; }
}
