/* Matrix green stays in the type; the surrounding surfaces use #131418. */
:root {
  --bg: #131418;
  --panel: #1a1c22;
  --line: #272a33;
  --text: #d8d9da;
  --muted: #8b8e92;
  --green: #54d03f;
  --green-soft: #54d03f26;

  /* Verde exacto extraído de la referencia (#54d03f) */
  --green-highlight-bg: #54d03f;
  --green-highlight-text: #0b0d0b;

  --cyan: #7dcfff;
  --amber: #e6c663;
  --coral: #e58b7b;
}

/* Selección de texto: alfa 254/255 (0.996078) para evitar que Safari/WebKit
   fuerce opacidad a 0.8 en apariencia oscura (RenderThemeMac::transformSelectionBackgroundColor) */
::selection {
  background-color: rgba(84, 209, 63, 0.996078) !important;
  color: #0b0d0b !important;
}

*::selection {
  background-color: rgba(84, 209, 63, 0.996078) !important;
  color: #0b0d0b !important;
}

::-moz-selection {
  background-color: rgba(84, 209, 63, 0.996078) !important;
  color: #0b0d0b !important;
}

*::-moz-selection {
  background-color: rgba(84, 209, 63, 0.996078) !important;
  color: #0b0d0b !important;
}

body::before {
  background: radial-gradient(ellipse at 50% -35%, #23273345, transparent 65%);
}

/* Micro-textura dot-grid de ingeniería / terminal (ultra-sutil, sin interferir con la lectura) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(rgba(216, 217, 218, 0.032) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Shell width: default 720px (Boxed / Hugo style), perfectly matched with article */
.shell {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  transition: max-width 0.2s ease;
}

article {
  max-width: 100% !important;
  margin: 0 auto;
}

/* Home Layout: Explorar por tema + Publicaciones recientes */
.home-container {
  padding: 44px 0 76px;
  min-height: calc(100vh - 174px);
}

.explore-section {
  margin-bottom: 44px;
}

.explore-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #181a20;
  padding: 18px 20px 10px;
}

.explore-heading {
  margin: 0 0 10px !important;
  padding: 0 6px;
  font-size: 13px !important;
  font-weight: 400 !important;
  letter-spacing: -0.1px !important;
  line-height: 1.4 !important;
  color: var(--muted);
}

.home-posts {
  padding: 0;
  min-height: auto;
}

/* Modo: Publicaciones recientes boxed y centradas dentro de la versión ancha */
.home-posts.posts-boxed-center {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  gap: 16px;
}

.heading-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-path {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1px;
}

.section-title,
.home-posts .section-heading h1,
.home-posts .section-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}

.view-all-inline {
  font-size: 12.5px;
  color: var(--muted);
  transition: none;
}

.view-all-inline:hover,
.view-all-inline:focus-visible {
  color: var(--green);
}

/* Topic / Category Rows (Explorar por tema) */
.topic-list {
  display: flex;
  flex-direction: column;
}

.topic-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 8px;
  border-radius: 6px;
  transition: none;
}

.topic-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topic-folder {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  flex-shrink: 0;
  transition: none;
}

.topic-name {
  font-size: 14.5px;
  color: var(--text);
  letter-spacing: -0.2px;
  transition: none;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topic-count {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: right;
  transition: none;
}

.topic-arrow {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition: none;
}

/* Resaltado completo de la fila en verde estilo terminal interactivo (TUI / cursor bar) */
.topic-row:hover,
.topic-row:focus-visible {
  background: var(--green-highlight-bg) !important;
  color: var(--green-highlight-text) !important;
}

.topic-row:hover *,
.topic-row:focus-visible * {
  color: var(--green-highlight-text) !important;
  stroke: var(--green-highlight-text) !important;
}

.topic-row:hover .topic-arrow,
.topic-row:focus-visible .topic-arrow {
  transform: translateX(3px);
}

.post-row:hover,
.post-row:focus-visible,
.filters button[aria-pressed="true"],
#results a:hover,
#results a:focus {
  background: #1c1e24;
}

/* ============================================================
   Home V2: Reorganización Editorial / UX
   Secciones: Explorar compacto, Orientación, Recursos, Cyberpath
   ============================================================ */

.home-v2 .explore-section {
  margin-bottom: 38px;
}

.explore-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 8px 4px;
  border-top: 1px solid #20232b;
  margin-top: 4px;
}

.view-all-topics {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: none;
}

.view-all-topics:hover,
.view-all-topics:focus-visible {
  color: var(--green);
}

.home2-section {
  margin-bottom: 42px;
}

.terminal-nav-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.terminal-nav-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 8px;
  border-bottom: 1px solid #1f222b;
  border-radius: 4px;
  transition: none;
}

.terminal-nav-row:hover,
.terminal-nav-row:focus-visible {
  background: #1c1e24;
}

.nav-row-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.nav-row-arrow {
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
  transition: none;
}

.terminal-nav-row:hover .nav-row-arrow,
.terminal-nav-row:focus-visible .nav-row-arrow {
  color: var(--green);
  transform: translateX(2px);
}

.nav-row-title {
  font-size: 14.5px;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.4;
  transition: none;
}

.terminal-nav-row:hover .nav-row-title,
.terminal-nav-row:focus-visible .nav-row-title {
  color: var(--green);
}

.nav-row-tag {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid #272a33;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-row-type {
  font-size: 11px;
  color: var(--green);
  font-family: var(--mono);
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.9;
}

/* Cyberpath Box */
.cyberpath-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181a20;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cyberpath-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
}

.cyberpath-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(84, 208, 63, 0.45);
  border-radius: 4px;
  color: var(--green);
  font-size: 12.5px;
  font-weight: 500;
  background: rgba(84, 208, 63, 0.05);
  white-space: nowrap;
  transition: none;
}

.cyberpath-cta:hover,
.cyberpath-cta:focus-visible {
  background: var(--green);
  color: #0b0d0b;
}

@media (max-width: 650px) {
  .cyberpath-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}


/* ============================================================
   Publicaciones: 1 línea + extracto sutil debajo (Fijado)
   Título: hover con fondo verde exacto #54d03f ajustado al texto
   Columna derecha: tiempo de lectura
   ============================================================ */

.post-list {
  border-top: 1px solid var(--line);
}

.post-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 16px;
  row-gap: 4px;
  padding: 13px 4px;
  min-height: auto;
  border-bottom: 1px solid #1f222b;
  transition: none;
}

.post-row:hover,
.post-row:focus-visible,
.post-row:active {
  background: #1c1e24;
}

.post-row:active * {
  color: inherit;
}

.post-date {
  grid-column: 1;
  grid-row: 1;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-info {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.post-title {
  font-size: 14.5px;
  letter-spacing: -0.2px;
  color: var(--text);
  padding: 1px 6px;
  border-radius: 2px;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  line-height: 1.35;
  transition: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hover: título con fondo verde exacto #54d03f y texto negro #0b0d0b */
.post-row:hover .post-title,
.post-row:focus-visible .post-title {
  background: var(--green-highlight-bg) !important;
  color: #0b0d0b !important;
}

.post-description {
  display: -webkit-box !important;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.4;
  color: #7b818d;
  padding-left: 6px;
}

.row-reading-time,
.row-meta-right {
  grid-column: 3;
  grid-row: 1;
  display: inline-flex;
  justify-content: flex-end;
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row-category-pill,
.post-submeta,
.row-tag,
.row-arrow,
.row-pointer {
  display: none !important;
}

/* Archive & Category Filters */
.filter-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 70px;
}

.filter-group .filters {
  margin: 0;
}

.tags-directory,
.other-topics,
.related-posts {
  margin-top: 58px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.tag-chip {
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 11px;
  color: var(--muted);
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}

.tag-chip:hover,
.tag-chip:focus-visible {
  border-color: var(--green);
  color: var(--green);
  background: #1c1e24;
}

/* Article Header & Navigation */
.article-nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 34px 0 38px;
}

.article-nav-top .back-link {
  margin: 0;
}

.meta-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  transition: color 0.14s;
}

.meta-category .icon-folder {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.meta-category:hover,
.meta-category:hover .icon-folder {
  color: var(--green);
}

.article-lead {
  font-size: 15px;
  line-height: 1.75;
  color: #a5aab0;
  margin: 0 0 18px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.article-tags .tag {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 8px;
  transition: border-color 0.14s, color 0.14s;
}

.article-tags .tag:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Table of Contents (TOC) */
.toc {
  margin: 28px 0 34px;
  border: 1px solid var(--line);
  background: #171920;
  padding: 14px 18px;
  font-size: 12px;
}

.toc details {
  border: 0;
  padding: 0;
  margin: 0;
}

.toc summary {
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  user-select: none;
}

.toc-list {
  margin: 12px 0 4px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-item {
  margin: 0;
  padding: 0;
}

.toc-item.toc-depth-3 {
  margin-left: 16px;
  list-style-type: circle;
}

.toc-item a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.14s;
}

.toc-item a:hover {
  color: var(--green);
}

/* Editorial Typography & Headings */
.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  scroll-margin-top: 32px;
}

.prose h3 {
  font-size: 17px;
  font-weight: 500;
  margin: 36px 0 14px;
  letter-spacing: -0.4px;
}

.prose h3::before {
  content: '### ';
  color: var(--muted);
  font-size: 13px;
}

.prose h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: #e4e6e8;
}

.heading-anchor {
  opacity: 0;
  margin-left: 8px;
  font-size: 13px;
  color: var(--muted) !important;
  text-decoration: none !important;
  transition: opacity 0.14s, color 0.14s;
}

.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--green) !important;
}

.prose u,
.prose ins {
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-underline-offset: 4px;
}

.prose a.ext-link::after {
  content: ' ↗';
  font-size: 0.82em;
  opacity: 0.75;
}

/* Task Lists in Markdown */
.prose input[type="checkbox"] {
  accent-color: var(--green);
  margin-right: 8px;
  transform: translateY(1px);
}

/* CodeBlock & Syntax Highlighting */
.prose code {
  background: #1b1e26;
  border-radius: 2px;
}

.code-block,
.terminal-block {
  margin: 28px 0;
  border: 1px solid var(--line);
  background: #16181f;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #1a1d26;
  font-size: 11px;
}

.code-lang {
  color: var(--muted);
  letter-spacing: 0.2px;
}

.code-header .copy-code {
  position: static;
  font-size: 10px;
  color: var(--muted);
  padding: 2px 6px;
  border: 1px solid transparent;
}

.code-header .copy-code:hover,
.code-header .copy-code:focus-visible {
  color: var(--green);
  border-color: #32442d;
}

.code-block pre,
.terminal-block pre {
  margin: 0;
  padding: 18px 20px;
  border: 0;
  background: transparent;
  line-height: 1.75;
  font-size: 12.5px;
  overflow-x: auto;
}

.code-block pre::before,
.terminal-block pre::before {
  content: none;
}

/* Subtle Syntax Tokens */
.tok-cmt {
  color: #6c737c;
  font-style: italic;
}

.tok-str {
  color: #a8e690;
}

.tok-kw {
  color: var(--green);
}

.tok-num {
  color: #e6c663;
}

.tok-flag {
  color: #8fd3ff;
}

/* TerminalBlock specific */
.terminal-block {
  border-color: #2b3530;
}

.terminal-pre code {
  display: block;
}

.term-line {
  display: block;
}

.term-cmd {
  color: #f0f2f4;
}

.term-prompt {
  color: var(--green);
  user-select: none;
}

.term-prompt.root {
  color: var(--coral);
}

.term-comment {
  color: #6f7780;
}

.term-out {
  color: #969ba1;
}

/* Callouts: Info / Tip / Warn / Important */
blockquote {
  background: linear-gradient(90deg, #181a22, transparent);
  color: #d0d1d3;
}

.pullquote {
  border-block-color: var(--line);
  background: none;
}

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  background: #171921;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 13px;
}

.callout-body > :first-child {
  margin-top: 8px;
}

.callout-body > :last-child {
  margin-bottom: 0;
}

.callout.info {
  border-left-color: var(--cyan);
}

.callout.info .callout-label {
  color: var(--cyan);
}

.callout.tip {
  border-left-color: var(--green);
}

.callout.tip .callout-label {
  color: var(--green);
}

.callout.warn {
  border-color: #4b432b;
  border-left-color: var(--amber);
  background: #1c1a14;
}

.callout.warn .callout-label {
  color: var(--amber);
}

.callout.important {
  border-color: #4f3531;
  border-left-color: var(--coral);
  background: #1d1616;
}

.callout.important .callout-label {
  color: var(--coral);
}

/* Shared Header Bar for Educational Blocks */
.component-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.component-tag {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 10px;
}

.component-meta {
  color: var(--muted);
  font-size: 11px;
}

/* PracticeBlock */
.practice-block {
  border: 1px solid #313d35;
  background: #161921;
  padding: 20px 22px;
  margin: 32px 0;
}

.practice-pills {
  display: flex;
  gap: 8px;
}

.practice-pill {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 1px 7px;
}

.practice-title {
  margin: 4px 0 14px !important;
  font-size: 16px !important;
  color: #eef0f2;
}

.practice-title::before {
  content: none !important;
}

.practice-body {
  font-size: 13.5px;
  line-height: 1.8;
}

.practice-body > :last-child {
  margin-bottom: 0;
}

/* QuizBlock */
.quiz-block {
  border: 1px solid var(--line);
  background: #171920;
  padding: 20px 22px;
  margin: 32px 0;
}

.quiz-question {
  margin: 0 0 14px !important;
  font-size: 14px;
  color: #eef0f2;
  line-height: 1.65;
}

.quiz-hint {
  margin: -6px 0 14px !important;
  font-size: 12px;
  color: var(--muted);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: #1b1e27;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.14s, background 0.14s;
}

.quiz-option:hover {
  border-color: #4a5058;
  background: #20242f;
}

.quiz-opt-key {
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
}

.quiz-option.is-correct {
  border-color: var(--green);
  background: #142318;
}

.quiz-option.is-correct .quiz-opt-key {
  color: var(--green);
}

.quiz-option.is-wrong {
  border-color: var(--amber);
  background: #211d14;
}

.quiz-option.is-wrong .quiz-opt-key {
  color: var(--amber);
}

.quiz-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.65;
  border-left: 2px solid var(--muted);
  background: #1c1e27;
}

.quiz-feedback.ok {
  border-left-color: var(--green);
  color: #d6e8d2;
}

.quiz-feedback.retry {
  border-left-color: var(--amber);
  color: #e6dec8;
}

.quiz-reset,
.checklist-reset {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quiz-reset:hover,
.checklist-reset:hover {
  color: var(--green);
}

/* ChecklistBlock */
.checklist-block {
  border: 1px solid var(--line);
  background: #171920;
  padding: 20px 22px;
  margin: 32px 0;
}

.checklist-status {
  font-size: 11px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 6px 8px;
  border: 1px solid transparent;
  transition: background 0.14s;
}

.checklist-item:hover {
  background: #1c1e26;
}

.checklist-item input[type="checkbox"] {
  margin: 4px 2px 0 0;
  flex-shrink: 0;
}

.checklist-item.checked .checklist-text {
  color: var(--muted);
  text-decoration: line-through;
}

.checklist-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 10px;
}

.checklist-footer .checklist-reset {
  margin: 0;
}

/* DiagramBlock & Media Figures */
.diagram-block,
.media-figure {
  margin: 30px 0;
  border: 1px solid var(--line);
  background: #16181f;
  padding: 16px 20px;
}

.diagram-canvas {
  overflow-x: auto;
}

.diagram-pre {
  margin: 0 !important;
  padding: 12px 4px !important;
  border: 0 !important;
  background: transparent !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  color: #cfd4d9;
}

.diagram-pre::before {
  content: none !important;
}

.diagram-svg svg,
.media-figure img,
.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.diagram-block figcaption,
.media-figure figcaption {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #272a33;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* Tables & Resources */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--line);
}

.table-wrap table {
  margin: 0;
  display: table;
  width: 100%;
}

.resources-block {
  border: 1px solid var(--line);
  background: #171920;
  padding: 18px 22px;
  margin: 30px 0;
  font-size: 13px;
}

.resources-body ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* End of post & Dialog */
.inline-cat-link {
  display: inline !important;
  margin: 0 !important;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.end-post-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

.end-post-links a {
  margin: 0;
}

dialog {
  border-color: #3e4350;
  background: #171920;
}

/* Terminal Easter Egg Commands en Search Modal */
.terminal-cmd-output {
  margin: 4px 0 16px;
  padding: 12px 14px;
  background: #101216;
  border: 1px solid #282c37;
  border-left: 2px solid var(--green);
  border-radius: 4px;
  font-family: var(--mono);
}

.terminal-cmd-output .cmd-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #222630;
}

.terminal-cmd-output .cmd-head .cmd-prompt {
  color: var(--green);
}

.terminal-cmd-output .cmd-head .cmd-name {
  color: var(--text);
  font-weight: 500;
}

.terminal-cmd-output pre {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .home-container {
    padding: 36px 0 54px;
  }

  .explore-section {
    margin-bottom: 46px;
  }

  .topic-row {
    padding: 14px 4px;
  }

  .topic-text {
    flex-direction: column;
    gap: 3px;
  }

  .topic-name {
    font-size: 14px;
  }

  .topic-desc {
    font-size: 10.5px;
  }

  .filter-group {
    flex-direction: column;
    gap: 8px;
  }

  .code-block pre,
  .terminal-block pre {
    padding: 14px;
    font-size: 11.5px;
  }

  .practice-block,
  .quiz-block,
  .checklist-block,
  .diagram-block {
    padding: 16px;
  }
}

/* ============================================================
   Variante: Hover CRT Retro Terminal (Sutil, Minimalista, Instantáneo)
   ============================================================ */

/* Respuesta 100% instantánea sin transiciones ni fantasmeo */
[data-hover-style="crt"] .post-row,
[data-hover-style="crt"] .post-title,
[data-hover-style="crt"] .topic-row,
[data-hover-style="crt"] .topic-row *,
[data-hover-style="crt"] .terminal-nav-row,
[data-hover-style="crt"] .terminal-nav-row * {
  transition: none !important;
}

[data-hover-style="crt"] .terminal-nav-row:hover,
[data-hover-style="crt"] .terminal-nav-row:focus-visible {
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.11) 0px,
    rgba(0, 0, 0, 0.11) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  color: #0b0d0b !important;
}

[data-hover-style="crt"] .terminal-nav-row:hover *,
[data-hover-style="crt"] .terminal-nav-row:focus-visible * {
  color: #0b0d0b !important;
}

[data-hover-style="crt"] body::after {
  background-image: radial-gradient(rgba(84, 208, 63, 0.04) 1px, transparent 1px);
}

/* Hover con trama subpíxel 2px y micro-profundidad de cristal */
[data-hover-style="crt"] .post-row:hover .post-title,
[data-hover-style="crt"] .post-row:focus-visible .post-title {
  transition: none !important;
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.14) !important;
  color: #0b0d0b !important;
}

[data-hover-style="crt"] .topic-row:hover,
[data-hover-style="crt"] .topic-row:focus-visible {
  transition: none !important;
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.11) 0px,
    rgba(0, 0, 0, 0.11) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.12) !important;
  color: #0b0d0b !important;
}

[data-hover-style="crt"] .topic-row:hover *,
[data-hover-style="crt"] .topic-row:focus-visible * {
  color: #0b0d0b !important;
  stroke: #0b0d0b !important;
}

/* ============================================================
   Toggle CRT en esquina (Ultra-minimalista, discreto y sin ruido)
   ============================================================ */

.crt-toggle {
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(19, 20, 24, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(39, 42, 51, 0.6);
  border-radius: 3px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  opacity: 0.38;
  cursor: pointer;
  transition: opacity 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  user-select: none;
}

.crt-toggle:hover,
.crt-toggle:focus-visible {
  opacity: 0.95;
  border-color: #3b404d;
  color: var(--text);
}

.crt-toggle-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #394032;
  transition: background 0.18s ease;
}

.crt-toggle[aria-pressed="true"] {
  opacity: 0.75;
  border-color: rgba(84, 208, 63, 0.35);
  color: var(--text);
}

.crt-toggle[aria-pressed="true"]:hover {
  opacity: 1;
}

.crt-toggle[aria-pressed="true"] .crt-toggle-dot {
  background: var(--green);
}

.crt-toggle[aria-pressed="true"] .crt-toggle-state {
  color: var(--green);
  font-weight: 500;
}

@media (max-width: 650px) {
  .crt-toggle {
    bottom: 10px;
    right: 10px;
    padding: 2px 6px;
    font-size: 9.5px;
  }
}

/* ============================================================
   FIVUR 2.0: Componentes de Rutas, Biblioteca, Temas y Hero
   ============================================================ */

/* ============================================================
   FIVUR: Portada Índice de Contenido (Minimalista & Silenciosa)
   ============================================================ */

/* Accesibilidad: H1 visualmente oculto */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Cabecera Home */
.topbar.home-topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
  padding: 0;
}

.home-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  transition: none;
}

.home-search-btn:hover,
.home-search-btn:focus-visible {
  color: var(--green);
}

.home-search-btn kbd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid #2d313b;
  border-radius: 3px;
  padding: 1px 5px;
  background: #171920;
  margin-left: 2px;
}

.home-search-btn:hover kbd,
.home-search-btn:focus-visible kbd {
  border-color: var(--green);
  color: var(--green);
}

/* Contenedor del Índice */
.home-index {
  padding: 18px 0 24px;
}

/* Secciones del Índice */
.home-section {
  margin-bottom: 44px;
}

.home-section:last-child {
  margin-bottom: 0;
}

/* Encabezados de Sección (~15-16px, peso moderado, enlazados) */
.home-section-title {
  margin: 0 0 14px !important;
  font-size: 15.5px !important;
  font-weight: 500 !important;
  letter-spacing: -0.2px !important;
  line-height: 1.35 !important;
  color: #f0f2f5 !important;
}

.home-section-title::before {
  content: none !important;
}

.home-section-title a {
  color: #f0f2f5;
  text-decoration: none;
  transition: none;
}

.home-section-title a:hover,
.home-section-title a:focus-visible {
  color: var(--green);
}

/* Lista de Títulos (~14px, una entrada por línea, fondo continuo) */
.home-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

.home-list li {
  margin: 0 !important;
  padding: 0 !important;
}

.home-list li::marker {
  content: none !important;
}

.home-list a {
  display: block;
  font-size: 14px;
  color: #c4c7cc;
  line-height: 1.45;
  padding: 7px 0;
  text-decoration: none;
  transition: none;
  width: fit-content;
  max-width: 100%;
}

.home-list a:hover,
.home-list a:focus-visible {
  color: var(--green);
  background: none !important;
}

/* Pie discreto en Home */
.home-footer {
  margin-top: 48px;
  padding: 24px 0 64px;
  border-top: 1px solid var(--line);
}

.home-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--muted);
}

.home-footer-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: none;
}

.home-footer-nav a:hover,
.home-footer-nav a:focus-visible {
  color: var(--green);
}

.home-footer-nav .sep {
  color: #3e424e;
  user-select: none;
}

@media (max-width: 700px) {
  .topbar.home-topbar {
    height: 68px;
    padding: 0;
  }

  .home-index {
    padding: 12px 0 20px;
  }

  .home-section {
    margin-bottom: 38px;
  }

  .home-list a {
    padding: 9px 0;
  }

  .home-footer {
    margin-top: 38px;
    padding: 20px 0 48px;
  }
}

/* 3. Barra de Temas Transversales */
.topics-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 14px 18px;
  background: #181a20;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  color: #4b5260;
  line-height: 1.8;
}

.topic-chip {
  color: var(--text);
  padding: 2px 8px;
  border-radius: 3px;
  background: #131418;
  border: 1px solid #232630;
  white-space: nowrap;
  transition: none;
}

.topic-chip:hover,
.topic-chip:focus-visible {
  background: var(--green-highlight-bg) !important;
  color: var(--green-highlight-text) !important;
  border-color: var(--green-highlight-bg) !important;
}

/* 4. Meta Box (Cajas de metadatos) */
.meta-box {
  border: 1px solid var(--line);
  background: #181a20;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.6;
}

.meta-box strong {
  color: var(--text);
}

.meta-box div {
  color: #adb0b5;
}

/* 5. Rutas y Etapas */
.path-group {
  margin-bottom: 32px;
}

.sub-heading {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 14px;
}

.sub-heading::before {
  content: none !important;
}

.path-stages-wrapper {
  margin-top: 36px;
}

.path-stage {
  border: 1px solid var(--line);
  background: #181a20;
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 24px;
}

.stage-number {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stage-title {
  margin: 0 0 10px !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  letter-spacing: -0.4px !important;
  color: #f0f2f5 !important;
}

.stage-title::before {
  content: none !important;
}

.stage-goal {
  font-size: 13px;
  color: #9da1a8;
  margin: 0 0 18px;
  line-height: 1.6;
}

.stage-section {
  border-top: 1px solid #20242f;
  padding-top: 14px;
  margin-top: 14px;
}

.stage-subhead {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.stage-resources {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-item {
  background: #131418;
  border: 1px solid #232630;
  border-radius: 4px;
  padding: 10px 14px;
}

.stage-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stage-item-link {
  font-size: 13.5px;
  color: var(--text);
}

.stage-item-link:hover {
  color: var(--green);
}

.stage-item-reason {
  margin: 6px 0 0;
  font-size: 12px;
  color: #8b8f96;
  line-height: 1.5;
}

.stage-post-ref {
  padding: 6px 0;
  font-size: 12.5px;
}

.stage-post-ref a {
  color: var(--text);
}

.stage-post-ref a:hover {
  color: var(--green);
}

.advance-criteria {
  background: #14161c;
  border-radius: 6px;
  padding: 14px 16px;
}

.advance-criteria .stage-subhead {
  color: var(--green);
}

/* 6. Biblioteca de recursos */
.library-filter-bar {
  margin: 20px 0 16px;
}

.resource-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.resource-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.resource-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.resource-official-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #181a20;
  border: 1px solid rgba(84, 208, 63, 0.45);
  border-radius: 4px;
  color: var(--green);
  font-size: 12.5px;
  font-weight: 500;
  transition: none;
}

.resource-official-btn:hover,
.resource-official-btn:focus-visible {
  background: var(--green);
  color: #0b0d0b;
}

.pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.pros-box,
.cons-box {
  background: #181a20;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
}

.pros-box h3,
.cons-box h3 {
  margin: 0 0 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: -0.1px !important;
}

.pros-box h3::before,
.cons-box h3::before {
  content: none !important;
}

.pros-box h3 {
  color: var(--green);
}

.cons-box h3 {
  color: var(--muted);
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}

.clean-list li {
  padding-left: 0 !important;
  margin: 0 !important;
}

.clean-list li::marker {
  content: none !important;
}

.used-in-section {
  border-top: 1px dashed var(--line);
  padding-top: 24px;
}

.used-in-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 8px;
  border-bottom: 1px solid #1f222b;
  font-size: 13px;
  flex-wrap: wrap;
}

.used-in-row a:hover {
  color: var(--green);
}

/* 7. Certificaciones y temas */
.cert-article,
.topic-section-block {
  margin-top: 32px;
}

.prose-list {
  padding-left: 20px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.7;
}

.dim-link {
  color: var(--muted);
}

.dim-link:hover {
  color: var(--green);
}

/* 8. Estilos CRT para nuevos componentes */
[data-hover-style="crt"] .resource-card-row:hover,
[data-hover-style="crt"] .resource-card-row:focus-visible {
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.11) 0px,
    rgba(0, 0, 0, 0.11) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  color: #0b0d0b !important;
}

[data-hover-style="crt"] .resource-card-row:hover *,
[data-hover-style="crt"] .resource-card-row:focus-visible * {
  color: #0b0d0b !important;
}

[data-hover-style="crt"] .topic-chip:hover,
[data-hover-style="crt"] .topic-chip:focus-visible {
  background-color: #54d03f !important;
  color: #0b0d0b !important;
}

@media (max-width: 650px) {
  .pros-cons-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Fivur Biblioteca V2 — Componentes e Interacciones
   ============================================================ */

/* 1. Masthead V2 */
.masthead-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--line);
}

.logo-v2 {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.4px;
  white-space: nowrap;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo-v2 .sig {
  font-size: 18px;
  color: var(--green);
  margin-right: 0;
}

.logo-v2 .logo-text {
  margin-left: 8px;
  color: var(--text);
}

.logo-v2 .dim {
  color: var(--muted);
}

.nav-v2 {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-v2 a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.nav-v2 a:hover,
.nav-v2 a.active {
  color: var(--green);
}

.nav-v2 a.active {
  font-weight: 700;
}

.search-trigger-btn {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.search-trigger-btn kbd {
  border: 1px solid #454a54;
  border-radius: 3px;
  color: #9ea3ad;
  padding: 1px 6px;
  font-size: 10px;
  cursor: pointer;
}

.search-trigger-btn:hover kbd {
  border-color: var(--green);
  color: var(--green);
}

/* 2. Intro & Buscador V2 (Centrado Minimalista) */
.intro-v2 {
  padding: 32px 0 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-hero-block {
  margin: 0 0 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-hero-title {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: clamp(30px, 6.5vw, 46px);
  font-weight: 700;
  letter-spacing: -1.2px;
  color: #ffffff;
  line-height: 1.1;
  text-align: center;
}

.brand-hero-subtitle {
  margin: 0;
  display: flex;
  justify-content: center;
}

.title-v2 {
  margin: 0 0 22px;
  font-size: clamp(17px, 2.7vw, 22px);
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
}

.title-highlight-v2 {
  display: inline-block;
  background-color: var(--green);
  color: #0b0d0b;
  font-family: var(--mono);
  font-size: clamp(15px, 2.5vw, 20px);
  font-weight: 700;
  letter-spacing: -0.4px;
  padding: 4px 10px;
  border-radius: 0; /* totalmente cuadrado, como selección de texto */
  line-height: 1.35;
  box-shadow: 0 0 0 1px #54d03f;
  user-select: text;
}

[data-hover-style="crt"] .title-highlight-v2 {
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.11) 0px,
    rgba(0, 0, 0, 0.11) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  color: #0b0d0b !important;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.14) !important;
}

/* Consola Integrada de Terminal (Buscador) */
.terminal-search-console {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  background: #181b21;
  border: 1px solid #30343d;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  text-align: left;
}

.terminal-search-console:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 4px 20px rgba(84, 208, 63, 0.08);
}

.terminal-search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 44px;
}

.term-search-icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: #727885;
  transition: color 0.15s ease;
}

.terminal-search-console:focus-within .term-search-icon {
  color: var(--green);
}

.term-prompt-prefix {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  user-select: none;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.terminal-search-input-row input {
  border: 0;
  outline: 0;
  min-width: 0;
  flex: 1;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  caret-color: var(--green);
}

.terminal-search-input-row input::placeholder {
  color: #848a95;
  font-size: 14px;
  transition: opacity 0.15s ease;
}

.term-shortcut-badge {
  color: #797f8c;
  font-family: var(--mono);
  font-size: 12px;
  user-select: none;
}

.term-shortcut-badge kbd {
  border: 1px solid #3d434e;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  color: #9297a1;
  background: #1b1e26;
}

.terminal-search-console:focus-within .term-shortcut-badge kbd {
  border-color: var(--green);
  color: var(--green);
}

.terminal-console-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #111317;
  border-top: 1px solid #232730;
  font-size: 11px;
  flex-wrap: wrap;
}

.term-console-label {
  color: #707682;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  user-select: none;
  white-space: nowrap;
}

.term-format-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.term-format-link {
  font-family: var(--mono);
  font-size: 11px;
  color: #a4aab5;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 2px;
  transition: color 0.1s ease;
  cursor: pointer;
}

.term-format-link:hover,
.term-format-link:focus-visible {
  color: var(--green);
}

/* CRT Hover para los enlaces de formato */
[data-hover-style="crt"] .term-format-link:hover,
[data-hover-style="crt"] .term-format-link:focus-visible {
  background-color: #54d03f !important;
  color: #0b0d0b !important;
  text-decoration: none !important;
  box-shadow: 0 0 0 1px #54d03f !important;
}

/* 3. Secciones V2 */
.v2-section {
  margin-top: 40px;
  scroll-margin-top: 24px;
}

.v2-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.v2-section-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.3px;
  font-weight: 700;
  color: var(--text);
}

.v2-section-header .aux,
.v2-section-header a {
  font-size: 11px;
  color: #9ba0aa;
}

.v2-section-header a:hover {
  color: var(--green);
}

.v2-section-description {
  font-size: 11.5px;
  line-height: 1.6;
  color: #8f949e;
  margin: 0 0 16px;
}

/* 4. Cuadrícula de 10 Áreas (Página /materias/) */
.area-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.area-card {
  display: flex;
  align-items: start;
  gap: 11px;
  text-align: left;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  padding: 12px 14px;
  background: #181b21;
  border: 1px solid #30343d;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  text-decoration: none;
}

.area-card svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: #828894;
  margin-top: 2px;
}

.area-card-text {
  flex: 1;
  min-width: 0;
}

.area-card-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.area-card-desc {
  display: block;
  font-size: 10.5px;
  color: #8a909b;
  line-height: 1.45;
  margin-top: 3px;
}

.area-card .chevron {
  color: #7d838e;
  font-size: 15px;
  line-height: 1.2;
}

/* ============================================================
   Índice de Materias en Home — Acordeón Vertical Centrado
   ============================================================ */
.area-index-section {
  width: 100%;
  max-width: 620px;
  margin: 34px auto 0;
  text-align: left;
}

.area-index-section .v2-section-header {
  margin: 0 0 14px;
  padding: 0 2px;
  border-bottom: 0;
  text-align: center;
}

.area-index-section .v2-section-header h2 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8c93a0;
  margin: 0 auto;
  text-align: center;
}

.area-view-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  border: none;
  width: 100%;
}

.area-list-item {
  background: #181b21;
  border: 1px solid #30343d;
  border-radius: 6px;
  overflow: hidden;
  transition: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .area-list-item:hover {
    border-color: #4a5160;
  }
}

.area-list-item[open] {
  background: #181b21;
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(84, 208, 63, 0.2);
  transition: none !important;
}

.area-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  min-height: 48px;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--mono);
  background: transparent;
  transition: none !important;
  list-style: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.area-list-summary:focus,
.area-list-summary:focus-visible {
  outline: none;
}
.area-list-summary::-webkit-details-marker {
  display: none;
}

.area-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.area-folder-icon {
  width: 17px;
  height: 17px;
  flex: none;
  color: #828894;
  margin-top: 1px;
  transition: none;
}

@media (hover: hover) and (pointer: fine) {
  .area-list-item:hover .area-folder-icon {
    color: #abb2bf;
  }
}

.area-list-item[open] .area-folder-icon {
  color: var(--green);
}

.area-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.area-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.area-count {
  font-size: 11px;
  color: #7b818e;
  background: #13151a;
  border: 1px solid #282c35;
  border-radius: 3px;
  padding: 2px 8px;
}

.area-arrow {
  color: #7d838e;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.12s ease;
  flex: none;
  display: inline-block;
}

.area-list-item[open] .area-arrow {
  transform: rotate(90deg);
  color: var(--green);
}

.area-list-content {
  padding: 12px 16px 16px;
  background: #13151a;
  border-top: 1px solid #282c35;
}

.area-subjects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.area-subject-link {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--mono);
  font-size: 13px;
  color: #abb2bf;
  text-decoration: none;
  padding: 5px 8px;
  min-height: 32px;
  box-sizing: border-box;
  border-radius: 3px;
  transition: all 0.1s ease;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}

.area-subject-link .sub-bullet {
  color: #5d6370;
  font-size: 12px;
  flex: none;
}

.area-subject-link .subject-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.area-subject-link:hover {
  color: #ffffff;
  background: #1c202a;
}
.area-subject-link:hover .sub-bullet {
  color: var(--green);
}

/* Hover CRT solo en dispositivos con ratón real (evita saltos/flashes en iPad y táctiles) */
@media (hover: hover) and (pointer: fine) {
  [data-hover-style="crt"] .area-list-summary,
  [data-hover-style="crt"] .area-list-summary *,
  [data-hover-style="crt"] .area-subject-link,
  [data-hover-style="crt"] .area-subject-link * {
    transition: none !important;
  }

  [data-hover-style="crt"] .area-list-summary:hover,
  [data-hover-style="crt"] .area-list-summary:focus-visible {
    transition: none !important;
    background-color: #54d03f !important;
    background-image: repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.11) 0px,
      rgba(0, 0, 0, 0.11) 1px,
      transparent 1px,
      transparent 2px
    ) !important;
    color: #0b0d0b !important;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.12) !important;
  }

  [data-hover-style="crt"] .area-list-summary:hover *,
  [data-hover-style="crt"] .area-list-summary:focus-visible * {
    color: #0b0d0b !important;
    stroke: #0b0d0b !important;
  }

  [data-hover-style="crt"] .area-list-summary:hover .area-count,
  [data-hover-style="crt"] .area-list-summary:focus-visible .area-count {
    background: rgba(0, 0, 0, 0.16) !important;
    border-color: rgba(0, 0, 0, 0.28) !important;
    color: #0b0d0b !important;
  }

  [data-hover-style="crt"] .area-subject-link:hover,
  [data-hover-style="crt"] .area-subject-link:focus-visible {
    transition: none !important;
    background-color: #54d03f !important;
    background-image: repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.11) 0px,
      rgba(0, 0, 0, 0.11) 1px,
      transparent 1px,
      transparent 2px
    ) !important;
    color: #0b0d0b !important;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.14) !important;
  }

  [data-hover-style="crt"] .area-subject-link:hover *,
  [data-hover-style="crt"] .area-subject-link:focus-visible * {
    color: #0b0d0b !important;
  }
}

@media (max-width: 640px) {
  .area-subjects-grid {
    grid-template-columns: 1fr;
  }
}

/* 5. Panel de Contexto / Estantería Interactiva */
.context-panel {
  border: 1px solid #354c39;
  background: #161c18;
  border-radius: 6px;
  margin: 12px 0 0;
  padding: 14px 16px;
}

.context-panel[hidden] {
  display: none !important;
}

.context-bar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.context-eyebrow {
  font-size: 10px;
  color: #77c983;
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.context-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.context-close-btn {
  padding: 0 5px;
  background: none;
  border: 0;
  color: #b3bab7;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.context-close-btn:hover {
  color: var(--green);
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.v2-chip {
  border: 1px solid #3a4440;
  color: #c0c9c2;
  border-radius: 4px;
  padding: 5px 9px;
  background: #1e2821;
  font-size: 10.5px;
  font-family: var(--mono);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.v2-chip:hover,
.v2-chip:focus-visible {
  border-color: #6ea877;
  color: #d2eed6;
}

.context-linkline {
  margin: 12px 0 0;
  font-size: 11px;
  color: #9cb0a1;
  line-height: 1.6;
}

.context-linkline a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 6. Tira de Accesos Rápidos por Materia */
.quick-subjects-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-subject-btn {
  background: #181b20;
  border: 1px solid #30353d;
  border-radius: 4px;
  color: #b6bac3;
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
}

.quick-subject-btn:hover,
.quick-subject-btn[aria-pressed="true"] {
  border-color: #6fb878;
  color: #bee8c2;
}

/* 7. Colecciones Editoriales (Filas Tipo Archivo) */
.collections-table {
  border-top: 1px solid var(--line);
}

.collection-row-btn {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  cursor: pointer;
  font-family: var(--mono);
}

.collection-row-type {
  font-size: 10px;
  color: #969ba6;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.collection-row-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: block;
}

.collection-row-desc {
  font-size: 11px;
  line-height: 1.5;
  color: #8e939d;
  margin-top: 2px;
  display: block;
}

.collection-row-arrow {
  color: #858a95;
  text-align: right;
  font-size: 15px;
}

/* 8. Fichas del Catálogo (Filas Bibliográficas Densas) */
.catalog-header-labels {
  display: grid;
  grid-template-columns: 87px minmax(0, 1fr) auto 16px;
  gap: 13px;
  padding: 9px 4px;
  font-size: 10.5px;
  color: #8d929d;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.catalog-row-btn {
  display: grid;
  grid-template-columns: 87px minmax(0, 1fr) auto 16px;
  gap: 13px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 4px;
  align-items: center;
  color: inherit;
  cursor: pointer;
  font-family: var(--mono);
}

.catalog-row-type {
  font-size: 10.5px;
  color: #969ba6;
  font-weight: 600;
}

.catalog-row-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: block;
}

.catalog-row-meta {
  font-size: 11px;
  line-height: 1.5;
  color: #8e939d;
  margin-top: 2px;
  display: block;
}

.catalog-row-level {
  border: 1px solid #393e46;
  border-radius: 3px;
  padding: 2px 6px;
  color: #abb0b9;
  font-size: 10.5px;
  white-space: nowrap;
}

.catalog-detail-drawer {
  background: #161c18;
  border-bottom: 1px solid #36463a;
  padding: 16px 18px;
  color: #b1b9b1;
  font-size: 11.5px;
  line-height: 1.7;
}

.catalog-detail-drawer[hidden] {
  display: none !important;
}

.catalog-detail-drawer .review-status {
  color: #a4c2a7;
  font-size: 10px;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.catalog-meta-table {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 6px 14px;
  margin: 10px 0 12px;
}

.catalog-meta-table dt {
  color: #858f89;
}

.catalog-meta-table dd {
  margin: 0;
  color: #d1d8d2;
}

.catalog-detail-action {
  margin-top: 10px;
}

.catalog-detail-action a {
  display: inline-block;
  font-size: 11px;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

/* 9. Resultados de Búsqueda Integrada (Terminal Limpia) */
.search-results-v2 {
  background: #15171d;
  border: 1px solid #2d323b;
  border-radius: 3px;
  margin: 8px auto 0;
  padding: 8px 10px;
  width: 100%;
  max-width: 620px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.search-results-v2[hidden] {
  display: none !important;
}

.search-results-v2 .hint {
  font-size: 9.5px;
  color: #727885;
  margin-bottom: 6px;
  padding: 2px 4px;
  font-weight: 700;
  letter-spacing: 0.6px;
  font-family: var(--mono);
  border-bottom: 1px solid #22262f;
}

.search-group-title {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #6f7684;
  text-transform: uppercase;
  padding: 8px 8px 4px;
  margin-top: 6px;
  border-bottom: 1px solid #222630;
}

.search-group-title:first-child {
  margin-top: 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: 3px;
  color: #d0d5dc;
  font-family: var(--mono);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s ease, color 0.1s ease;
  box-sizing: border-box;
}

.search-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.search-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #e2e6ec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-meta {
  font-size: 10.5px;
  color: #838a96;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.4px;
  flex: none;
  background: rgba(84, 208, 63, 0.08);
  border: 1px solid rgba(84, 208, 63, 0.25);
  border-radius: 2px;
  padding: 1px 6px;
}

.search-result-item:hover,
.search-result-item:focus,
.search-result-item:focus-visible {
  background: #1c212a;
  color: #ffffff;
  outline: none;
  border-left: 2px solid var(--green);
  padding-left: 12px;
  text-decoration: none;
}

.search-result-item:hover .search-item-title,
.search-result-item:focus .search-item-title {
  color: #ffffff;
}

.search-result-item:focus .search-item-badge,
.search-result-item:hover .search-item-badge {
  border-color: var(--green);
}

.search-results-v2 .none,
.search-no-results {
  color: #8c929e;
  font-size: 11.5px;
  padding: 12px 8px;
  font-family: var(--mono);
  line-height: 1.5;
}

.search-no-results strong {
  color: #e2e6ec;
}

.search-no-results em {
  color: var(--green);
  font-style: normal;
}

/* 9.1 Estantería de Materia Estilo BestCommentaries */
.subject-aliases {
  font-size: 11.5px;
  color: #888e99;
  margin: -4px 0 16px;
  font-family: var(--mono);
}

.graph-coords {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: #9aa0ac;
  margin: 16px 0 24px;
  padding: 10px 14px;
  background: #14161c;
  border: 1px solid #232730;
  border-radius: 3px;
  font-family: var(--mono);
}

.coord-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.coord-label {
  color: #707683;
  text-transform: uppercase;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.coord-link {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.coord-link:hover {
  color: #84e872;
}

.coord-sep {
  color: #3b414e;
}

.coord-arrow {
  color: var(--green);
}

.editorial-criteria-callout {
  background: #15171e;
  border-left: 3px solid var(--green);
  border-top: 1px solid #232730;
  border-right: 1px solid #232730;
  border-bottom: 1px solid #232730;
  padding: 14px 16px;
  border-radius: 0 4px 4px 0;
  margin: 20px 0 32px;
}

.editorial-criteria-callout .callout-tag {
  display: inline-block;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--green);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.editorial-criteria-callout p {
  font-size: 12px;
  color: #b4b9c4;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   PODIO CANÓNICO OLÍMPICO (3 PUESTOS: #2 IZQ, #1 CENTRO ELEVADO, #3 DER)
   ============================================================ */
.shelf-scope-lead {
  font-family: var(--mono);
  font-size: 13px;
  color: #9aa1ad;
  margin: 0 0 20px;
  line-height: 1.5;
}

.podium-olympic-container {
  margin: 18px 0 24px;
  position: relative;
}

.podium-olympic-header {
  font-family: var(--mono);
  font-size: 10px;
  color: #727a87;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.podium-olympic-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #232731;
}

.podium-olympic-grid {
  display: grid;
  grid-template-columns: 1fr 1.18fr 1fr;
  align-items: stretch;
  gap: 14px;
}

.podium-card {
  background: #12141a;
  border: 1px solid #232731;
  border-radius: 4px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
  position: relative;
}

.podium-card:hover {
  border-color: #3b4252;
}

/* Puesto #1: Centro, más alto, destacado con verde fósforo */
.podium-rank-1 {
  order: 2;
  background: #141720;
  border: 1px solid rgba(84, 208, 63, 0.45);
  box-shadow: 0 0 16px rgba(84, 208, 63, 0.08);
  padding: 20px 16px;
  transform: translateY(-4px);
}

.podium-rank-1:hover {
  border-color: var(--green);
  box-shadow: 0 0 22px rgba(84, 208, 63, 0.18);
}

.podium-rank-1 .podium-badge-slot {
  color: var(--green);
  background: rgba(84, 208, 63, 0.1);
  border-color: rgba(84, 208, 63, 0.35);
  font-weight: 700;
}

.podium-rank-1 .podium-card-title a {
  color: #ffffff;
  font-size: 15.5px;
}

/* Puesto #2: Izquierda */
.podium-rank-2 {
  order: 1;
}

.podium-rank-2 .podium-badge-slot {
  color: #79a8ff;
  background: rgba(121, 168, 255, 0.08);
  border-color: rgba(121, 168, 255, 0.25);
}

/* Puesto #3: Derecha */
.podium-rank-3 {
  order: 3;
}

.podium-rank-3 .podium-badge-slot {
  color: #e5c07b;
  background: rgba(229, 192, 123, 0.08);
  border-color: rgba(229, 192, 123, 0.25);
}

.podium-badge-slot {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid #2d3340;
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 8px;
}

.podium-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px;
}

.podium-card-title a {
  color: #eaeef4;
  text-decoration: none;
}

.podium-card-title a:hover {
  color: var(--green);
}

.podium-card-creator {
  font-family: var(--mono);
  font-size: 11px;
  color: #8c93a0;
  margin-bottom: 8px;
}

.podium-card-chips {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.podium-chip-fmt {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--green);
  background: rgba(84, 208, 63, 0.08);
  border: 1px solid rgba(84, 208, 63, 0.3);
  padding: 1px 4px;
  border-radius: 2px;
}

.podium-chip-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: #9aa1ad;
  background: #171a22;
  border: 1px solid #262a34;
  padding: 1px 4px;
  border-radius: 2px;
}

.podium-chip-badge {
  font-family: var(--mono);
  font-size: 9px;
  color: #cbd0d8;
  background: #1b1e27;
  border: 1px solid #2e3442;
  padding: 1px 4px;
  border-radius: 2px;
}

.podium-card-note {
  font-size: 11.5px;
  color: #b5bbc6;
  line-height: 1.45;
  margin: 0 0 12px;
  flex: 1;
}

.podium-card-cta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  align-self: flex-start;
}

.podium-card-cta:hover {
  text-decoration: underline;
}

/* Drawer inferior de coordenadas y metadatos */
.shelf-meta-drawer {
  margin: 36px 0 20px;
  border-top: 1px solid #20242d;
  padding-top: 14px;
}

.shelf-meta-summary {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #8c93a0;
  cursor: pointer;
  outline: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shelf-meta-summary::-webkit-details-marker {
  display: none;
}

.shelf-meta-summary:hover {
  color: var(--text);
}

.shelf-meta-content {
  margin-top: 14px;
  padding: 14px 16px;
  background: #111318;
  border: 1px solid #222630;
  border-radius: 4px;
}

.drawer-block {
  margin-bottom: 14px;
}

.drawer-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.drawer-block p {
  font-size: 12px;
  color: #a8b0bd;
  line-height: 1.5;
  margin: 0;
}

.drawer-coords {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  padding-top: 10px;
  border-top: 1px solid #1e222a;
}

.drawer-aliases {
  font-family: var(--mono);
  font-size: 11px;
  color: #727986;
  margin: 10px 0 0;
}

@media (max-width: 820px) {
  .podium-olympic-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .podium-rank-1 {
    order: 1;
    transform: none;
  }
  .podium-rank-2 {
    order: 2;
  }
  .podium-rank-3 {
    order: 3;
  }
}

/* ============================================================
   ESTANTERÍA TEMÁTICA CURADA (MODELO BESTCOMMENTARIES)
   ============================================================ */

.shelf-complete-section {
  margin-top: 36px;
}

.shelf-empty-notice {
  font-size: 12px;
  color: var(--muted);
  padding: 24px 0;
  font-family: var(--mono);
}

/* Selector de pestañas por formato */
.shelf-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid #232731;
  padding-bottom: 14px;
}

.shelf-tabs-label {
  color: #8c93a0;
  font-family: var(--mono);
  font-size: 11px;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shelf-tab-btn {
  background: #14161d;
  border: 1px solid #282d38;
  color: #8c93a0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shelf-tab-btn:hover {
  border-color: #404859;
  color: #d1d6e0;
  background: #181b23;
}

.shelf-tab-btn.active {
  background: #1c212a;
  border-color: var(--green);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(84, 208, 63, 0.15);
}

.shelf-tab-btn .tab-indicator {
  color: var(--green);
  font-weight: bold;
}

.shelf-tab-btn .tab-count {
  color: #727a87;
  font-size: 11px;
}

.shelf-tab-btn.active .tab-count {
  color: #a4adba;
}

.shelf-tab-panel[hidden] {
  display: none !important;
}

/* Filas continuas densas tipo BestCommentaries */
.shelf-rank-item {
  background: #13151b;
  border: 1px solid #222631;
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  transition: border-color 0.15s ease;
}

.shelf-rank-item:hover {
  border-color: #384050;
}

.shelf-rank-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.shelf-rank-badge {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  background: rgba(84, 208, 63, 0.08);
  border: 1px solid rgba(84, 208, 63, 0.35);
  padding: 1px 7px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.shelf-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f3f5;
  text-decoration: none;
}

.shelf-item-title:hover {
  color: var(--green);
}

.shelf-item-author {
  font-family: var(--mono);
  font-size: 12px;
  color: #8c93a0;
  margin-bottom: 8px;
}

.shelf-chips-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.shelf-chip-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: #7b8290;
  background: #181b23;
  border: 1px solid #262b37;
  padding: 1px 6px;
  border-radius: 2px;
}

.shelf-chip-level {
  font-family: var(--mono);
  font-size: 10px;
  color: #9aa1ad;
  background: #171b24;
  border: 1px solid #2d3342;
  padding: 1px 6px;
  border-radius: 2px;
}

.shelf-chip-status {
  font-family: var(--mono);
  font-size: 10px;
  color: #9ba1ad;
  background: #151820;
  border: 1px solid #2d323e;
  padding: 1px 6px;
  border-radius: 2px;
}

.shelf-chip-free {
  font-family: var(--mono);
  font-size: 10px;
  color: #6ed075;
  background: rgba(84, 208, 63, 0.06);
  border: 1px solid rgba(84, 208, 63, 0.3);
  padding: 1px 6px;
  border-radius: 2px;
}

.shelf-chip-paid {
  font-family: var(--mono);
  font-size: 10px;
  color: #d19a66;
  background: rgba(209, 154, 102, 0.06);
  border: 1px solid rgba(209, 154, 102, 0.25);
  padding: 1px 6px;
  border-radius: 2px;
}

.shelf-item-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: #c9ced6;
  margin: 0 0 12px;
}

.shelf-companion-box {
  background: #101217;
  border-left: 2px solid var(--green);
  border-top: 1px solid #1f232c;
  border-right: 1px solid #1f232c;
  border-bottom: 1px solid #1f232c;
  padding: 8px 12px;
  margin: 10px 0 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  border-radius: 0 3px 3px 0;
}

.companion-icon {
  color: var(--green);
  font-weight: bold;
}

.companion-label {
  color: #838a97;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.companion-link {
  color: var(--green);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.companion-link:hover {
  color: #79e365;
}

.companion-note {
  color: #9fa6b2;
}

.shelf-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #1b1e27;
  font-family: var(--mono);
  font-size: 11px;
  flex-wrap: wrap;
}

.shelf-link-detail {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

.shelf-link-detail:hover {
  text-decoration: underline;
}

.shelf-link-source {
  color: #8c93a0;
  text-decoration: none;
}

.shelf-link-source:hover {
  color: #e0e4eb;
}

/* Animación flash al saltar de un libro a un laboratorio acompañante */
@keyframes flashGreenBorder {
  0% { border-color: var(--green); box-shadow: 0 0 16px rgba(84, 208, 63, 0.45); }
  100% { border-color: #222631; box-shadow: none; }
}

.highlight-flash {
  animation: flashGreenBorder 1.8s ease-out;
}

/* 10. Pie de Página V2 */
.footer-v2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 48px 0 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: #878d97;
  font-size: 11px;
}

.footer-v2 .terminal-cursor {
  color: var(--green);
  animation: crtPulse 1.2s infinite;
}

.footer-method {
  font-size: 10.5px;
  color: #797f88;
  line-height: 1.6;
  margin: 0 0 40px;
}

.footer-nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.footer-nav-links a:hover {
  color: var(--green);
}

/* ============================================================
   CRT HOVER RULES para Fivur Biblioteca V2
   (0ms latencia, fondo verde fósforo #54d03f, líneas de barrido y texto oscuro #0b0d0b)
   ============================================================ */

[data-hover-style="crt"] .area-card,
[data-hover-style="crt"] .area-card *,
[data-hover-style="crt"] .quick-subject-btn,
[data-hover-style="crt"] .v2-chip,
[data-hover-style="crt"] .collection-row-btn,
[data-hover-style="crt"] .collection-row-btn *,
[data-hover-style="crt"] .catalog-row-btn,
[data-hover-style="crt"] .catalog-row-btn * {
  transition: none !important;
}

/* Hover en las 10 tarjetas de Área */
[data-hover-style="crt"] .area-card:hover,
[data-hover-style="crt"] .area-card:focus-visible,
[data-hover-style="crt"] .area-card[aria-pressed="true"] {
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.11) 0px,
    rgba(0, 0, 0, 0.11) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  color: #0b0d0b !important;
  border-color: #54d03f !important;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.12) !important;
}

[data-hover-style="crt"] .area-card:hover *,
[data-hover-style="crt"] .area-card:focus-visible *,
[data-hover-style="crt"] .area-card[aria-pressed="true"] * {
  color: #0b0d0b !important;
  stroke: #0b0d0b !important;
}

/* Hover en accesos directos por materia */
[data-hover-style="crt"] .quick-subject-btn:hover,
[data-hover-style="crt"] .quick-subject-btn:focus-visible,
[data-hover-style="crt"] .quick-subject-btn[aria-pressed="true"] {
  background-color: #54d03f !important;
  color: #0b0d0b !important;
  border-color: #54d03f !important;
}

/* Hover en chips de estantería */
[data-hover-style="crt"] .v2-chip:hover,
[data-hover-style="crt"] .v2-chip:focus-visible {
  background-color: #54d03f !important;
  color: #0b0d0b !important;
  border-color: #54d03f !important;
}

/* Hover en colecciones editoriales */
[data-hover-style="crt"] .collection-row-btn:hover,
[data-hover-style="crt"] .collection-row-btn:focus-visible,
[data-hover-style="crt"] .collection-row-btn[aria-expanded="true"] {
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.11) 0px,
    rgba(0, 0, 0, 0.11) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  color: #0b0d0b !important;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.14) !important;
}

[data-hover-style="crt"] .collection-row-btn:hover *,
[data-hover-style="crt"] .collection-row-btn:focus-visible *,
[data-hover-style="crt"] .collection-row-btn[aria-expanded="true"] * {
  color: #0b0d0b !important;
}

/* Hover en filas de catálogo */
[data-hover-style="crt"] .catalog-row-btn:hover,
[data-hover-style="crt"] .catalog-row-btn:focus-visible,
[data-hover-style="crt"] .catalog-row-btn[aria-expanded="true"] {
  background-color: #54d03f !important;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.11) 0px,
    rgba(0, 0, 0, 0.11) 1px,
    transparent 1px,
    transparent 2px
  ) !important;
  color: #0b0d0b !important;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.14) !important;
}

[data-hover-style="crt"] .catalog-row-btn:hover *,
[data-hover-style="crt"] .catalog-row-btn:focus-visible *,
[data-hover-style="crt"] .catalog-row-btn[aria-expanded="true"] * {
  color: #0b0d0b !important;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .masthead-v2 {
    flex-wrap: wrap;
    padding: 18px 0 16px;
  }
  .nav-v2 {
    gap: 14px;
    font-size: 11px;
  }
  .nav-v2 .secondary-link {
    display: none;
  }
  .area-grid-v2 {
    grid-template-columns: 1fr;
  }
  .collection-row-btn {
    grid-template-columns: 78px minmax(0, 1fr) 12px;
    gap: 10px;
  }
  .catalog-header-labels,
  .catalog-row-btn {
    grid-template-columns: 65px minmax(0, 1fr) auto 12px;
    gap: 8px;
  }
  .catalog-row-level {
    font-size: 9.5px;
    padding: 2px 4px;
  }
  .catalog-meta-table {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 6px 10px;
  }
  .footer-v2 span:last-child {
    display: none;
  }
}




