
.top-bar .hero-copy { order: -1; flex: 1 1 100%; display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  line-height: 1.4; min-height: 1.4em;
  color: color-mix(in srgb, var(--color-fg) 60%, transparent);
}
.hero-title { margin: 0; font-family: var(--font-display, var(--font-body)); font-weight: 500; font-size: 46px; line-height: 1.1; min-height: 1.1em; letter-spacing: .01em; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) {
  .hero-title { font-size: 30px; }
  .top-bar .hero-copy { margin-bottom: 0; gap: 10px; }
  body .top-bar { flex-wrap: wrap !important; row-gap: 14px; }
  body .top-bar .search { flex: 1 1 0 !important; min-width: 0; }
}

@media (min-width: 721px) and (not ((max-height: 500px) and (pointer: coarse))) {

  body .search {
    border: 1px solid color-mix(in srgb, var(--color-fg) 45%, transparent);
    border-radius: 16px; padding: 14px 20px;
    background: color-mix(in srgb, var(--color-bg) 94%, var(--color-fg) 6%);
  }
  body .search input { font-size: 17px; }
  body .top-bar { flex-wrap: wrap; row-gap: 0; margin-bottom: 34px; }
  body .top-bar .search { max-width: 720px; }

  body #frequent-column {
    border: 1px solid color-mix(in srgb, var(--color-fg) 28%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--color-bg) 95%, var(--color-fg) 5%);
  }
  body #frequent-column h2 { font-family: var(--font-display, var(--font-body)); font-size: 20px; font-weight: 500; letter-spacing: .01em; }
  body #frequent-column .box {
    min-height: 46px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--color-fg) 22%, transparent);
    border-radius: 10px; font-size: 15px; margin-bottom: 12px;
  }
  body #frequent-column .box:hover { border-color: var(--color-hover); }
  body #frequent-column .frequent-change-view { border-radius: 9px; }

  body #main-column > h1[data-subject-title] {
    font-family: var(--font-display, var(--font-body)); font-weight: 500; font-size: 54px; line-height: 1; letter-spacing: .01em; margin-bottom: 26px;
  }
  body #main-column > .columns .box {
    min-height: 64px; padding: 0 16px 0 20px; border-radius: 12px; font-size: 18px;
    border: 1px solid color-mix(in srgb, var(--color-fg) 24%, transparent);
    background: color-mix(in srgb, var(--color-bg) 94%, var(--color-fg) 6%);
  }
  body #main-column > .columns .box:hover { border-color: var(--color-hover); }

  body #exit-subject-btn {
    top: 24px; right: 24px; left: auto; bottom: auto; width: auto; height: 40px; padding: 0 18px 0 14px;
    border-radius: 999px; font-size: 0; opacity: .85; display: inline-flex; gap: 8px;
  }
  body #exit-subject-btn::before { content: "←  " attr(title); font-size: 13px; font-weight: 500; letter-spacing: .04em; font-family: var(--font-display, var(--font-body)); }
  body:has(#exit-subject-btn) .layout { margin-top: 52px; height: auto; min-height: calc(100vh - 112px); }
  body:has(#exit-subject-btn) #frequent-column { height: calc(100vh - 112px) !important; min-height: 0 !important; max-height: calc(100vh - 112px) !important; }
  html:has(#exit-subject-btn), body:has(#exit-subject-btn) { height: 100vh; overflow: hidden; }
  body:has(#exit-subject-btn) .layout { height: calc(100vh - 112px); min-height: 0; }
  body:has(#exit-subject-btn) #main-column { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
  body:has(#exit-subject-btn) #main-column > h1[data-subject-title], body:has(#exit-subject-btn) #main-column > .search { flex: none; }
  body:has(#exit-subject-btn) #main-column > .columns { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 24px; scrollbar-width: thin; scrollbar-color: transparent transparent; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
  body:has(#exit-subject-btn) #main-column > .columns:hover { scrollbar-color: rgba(233, 233, 234, 0.45) transparent; }
  body:has(#exit-subject-btn) #main-column > .columns::-webkit-scrollbar { width: 6px; height: 6px; display: block; background: transparent; }
  body:has(#exit-subject-btn) #main-column > .columns::-webkit-scrollbar-track { background: transparent; }
  body:has(#exit-subject-btn) #main-column > .columns::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
  body:has(#exit-subject-btn) #main-column > .columns:hover::-webkit-scrollbar-thumb { background: rgba(233, 233, 234, 0.45); }
  body:has(#exit-subject-btn) #main-column > .columns::-webkit-scrollbar-thumb:hover { background: rgba(233, 233, 234, 0.7); }
}

body.hide-hero .top-bar .hero-copy { display: none; }

.top-bar .hero-copy { align-items: center; text-align: center; min-width: 0; }
.hero-title { width: 100%; max-width: 100%; min-width: 0; height: 84px; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; }
@media (max-width: 720px), (max-height: 500px) and (pointer: coarse) { .hero-title { height: 56px; } }
.hero-title .hero-formula-caja { display: inline-block; max-width: 100%; }
.hero-title .hero-formula-caja.escribiendo { animation: hero-escribir 1.4s steps(28, end) both; }
.hero-title .hero-formula-caja.borrando { animation: hero-borrar .7s steps(14, end) both; }
@keyframes hero-escribir { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes hero-borrar { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 100% 0 0); } }
.hero-title .hero-formula-enlace { display: inline-flex; max-width: 100%; min-width: 0; color: inherit; text-decoration: none; cursor: pointer; transition: color .15s ease; }
.hero-title .hero-formula-enlace:hover, .hero-title .hero-formula-enlace:focus-visible { color: var(--color-hover); }
.top-bar .hero-copy .hero-eyebrow { align-self: flex-start; text-align: left; }

#frequent-topics[data-view="frequent"] { counter-reset: tema-frecuente; }
#frequent-topics[data-view="frequent"] > .box:not(.empty-frequent):not([data-i18n]) { justify-content: flex-start; }
#frequent-topics[data-view="frequent"] > .box:not(.empty-frequent):not([data-i18n])::before {
  counter-increment: tema-frecuente;
  content: counter(tema-frecuente) "\00B0";
  flex: none;
  min-width: 1.8em;
  margin-right: .4em;
  font-variant-numeric: tabular-nums;
  opacity: .55;
}
