/* ==========================================================================
   INTERVENCIONISMO CON ECO EN DOLOR CURROMIR - STYLESHEET
   Apple-grade clinical UI, light-mode by default, iPad-optimized
   Includes authentic NYSORA Portable Universal Viewer styling
   ========================================================================== */

:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent-blue: #0284c7;
  --accent-blue-hover: #0369a1;
  --accent-blue-light: #e0f2fe;
  
  --accent-teal: #0d9488;
  --accent-teal-light: #ccfbf1;
  
  --accent-purple: #7c3aed;
  --accent-purple-light: #ede9fe;
  
  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  
  --accent-rose: #e11d48;
  --accent-rose-light: #ffe4e6;
  
  --accent-emerald: #059669;
  --accent-emerald-light: #d1fae5;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-surface: #1e293b;
  --bg-card: #1e293b;
  --bg-subtle: #334155;
  --bg-hover: #475569;
  --border-color: #334155;
  --border-focus: #60a5fa;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --accent-blue-light: rgba(2, 132, 199, 0.2);
  --accent-teal-light: rgba(13, 148, 136, 0.2);
  --accent-purple-light: rgba(124, 58, 237, 0.2);
  --accent-amber-light: rgba(217, 119, 6, 0.2);
  --accent-rose-light: rgba(225, 29, 72, 0.2);
  --accent-emerald-light: rgba(5, 150, 105, 0.2);
}

/* Base setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Header */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 8px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.action-pill-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.action-pill-btn.active {
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.action-pill-btn.active-purple {
  background-color: #0088cc;
  color: #ffffff;
  border-color: #0088cc;
  box-shadow: 0 2px 6px rgba(0, 136, 204, 0.25);
}

.action-pill-btn.active-purple:hover {
  background-color: #0077b3;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Joint Navigation Ribbon */
.joint-nav-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.joint-nav-bar::-webkit-scrollbar {
  display: none;
}

.joint-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.joint-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.joint-nav-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.joint-nav-btn.active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.joint-nav-btn .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background-color: rgba(0, 0, 0, 0.08);
}

.joint-nav-btn.active .count-badge {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.joint-nav-btn.nysora-universal-btn {
  border-color: #0088cc;
  color: #0088cc;
  background-color: #e0f2fe;
}

.joint-nav-btn.nysora-universal-btn.active {
  background-color: #0088cc;
  color: #ffffff;
  border-color: #0088cc;
  box-shadow: 0 2px 6px rgba(0, 136, 204, 0.3);
}

.joint-nav-btn.hub-intervencion {
  border-color: var(--accent-rose);
  color: var(--accent-rose);
  background-color: var(--accent-rose-light);
}

.joint-nav-btn.hub-intervencion.active {
  background-color: var(--accent-rose);
  color: #ffffff;
  border-color: var(--accent-rose);
}

/* Main Container */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  flex: 1;
  width: 100%;
}

/* Hero Joint Banner */
.joint-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .joint-hero-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.joint-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, #0284c7, #0d9488);
}

.joint-hero-card.hub-hero::before {
  background: linear-gradient(to bottom, #e11d48, #d97706);
}

.joint-hero-card.atlas-hero::before {
  background: linear-gradient(to bottom, #0088cc, #0366d6);
}

.joint-hero-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.joint-hero-info p {
  color: var(--text-secondary);
  font-size: 0.925rem;
  max-width: 800px;
  line-height: 1.5;
}

.joint-hero-stats {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.stat-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 100px;
  box-shadow: var(--shadow-sm);
}

.stat-box .number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-blue);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.stat-box .label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Filter & Search Bar */
.filter-bar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.search-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Pill Group Rows */
.filter-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
  min-width: 90px;
}

.pill-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pill-filter:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.pill-filter.active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.pill-filter.active-teal {
  background-color: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

.pill-filter.active-rose {
  background-color: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

.pill-filter.active-purple {
  background-color: #0088cc;
  color: #ffffff;
  border-color: #0088cc;
}

/* Results Count & Sort */
.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.results-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.results-count strong {
  color: var(--text-primary);
}

/* Card Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

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

/* Clinical Card */
.clinical-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.clinical-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-thumb-container {
  height: 180px;
  background-color: #0f172a;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.clinical-card:hover .card-thumb-img {
  transform: scale(1.04);
}

.thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.thumb-placeholder .ph-icon {
  font-size: 2.5rem;
  opacity: 0.8;
}

.play-overlay-badge {
  position: absolute;
  width: 48px;
  height: 48px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.card-thumb-container:hover .play-overlay-badge {
  transform: scale(1.1);
  background: #0284c7;
}

.duration-tag {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: rgba(15, 23, 42, 0.85);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.author-chip {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-joint {
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
}

.tag-technique {
  background-color: var(--accent-teal-light);
  color: var(--accent-teal);
}

.tag-atlas {
  background-color: #e0f2fe;
  color: #0088cc;
}

.tag-protocol {
  background-color: var(--accent-amber-light);
  color: var(--accent-amber);
}

.tag-interv {
  background-color: var(--accent-rose-light);
  color: var(--accent-rose);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title:hover {
  color: var(--accent-blue);
}

.card-target {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-target strong {
  color: var(--text-secondary);
}

.card-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-icon-group {
  display: flex;
  gap: 0.35rem;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.btn-icon-action:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon-action.starred {
  background-color: #fef3c7;
  color: #d97706;
  border-color: #f59e0b;
}

.btn-icon-action.watched {
  background-color: #d1fae5;
  color: #059669;
  border-color: #10b981;
}

.btn-icon-action.has-note {
  background-color: #e0f2fe;
  color: #0284c7;
  border-color: #38bdf8;
}

.btn-view-card {
  padding: 0.45rem 0.95rem;
  background-color: #0284c7;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.15s ease;
}

.btn-view-card:hover {
  background-color: var(--accent-blue-hover);
}

.btn-view-card.atlas-view-btn {
  background-color: #0088cc;
}

.btn-view-card.atlas-view-btn:hover {
  background-color: #0077b3;
}

/* ==========================================================================
   NYSORA PORTABLE UNIVERSAL VIEWER (AUTHENTIC TWO-PANEL LAYOUT)
   ========================================================================== */

.main-container.nysora-active {
  max-width: 100%;
  padding: 0;
}

.nysora-viewer-layout {
  display: flex;
  height: calc(100vh - 110px);
  min-height: 600px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  overflow: hidden;
}

.nysora-sidebar {
  width: 340px;
  min-width: 300px;
  background-color: #f8fafc;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  overflow-y: auto;
}

.viewer-area-picker { margin:0 0 1rem; flex-shrink:0; }
.viewer-area-picker > label { display:block; font-size:.8rem; font-weight:700; color:var(--text-primary); margin-bottom:.4rem; }
.viewer-area-picker select { width:100%; min-height:44px; padding:.55rem .6rem; font:inherit; font-size:.85rem; color:var(--text-primary); background:var(--bg-surface); border:1px solid var(--border-color); border-radius:8px; }
.viewer-area-chapters { display:grid; gap:.25rem; max-height:190px; overflow-y:auto; margin-top:.45rem; }
.viewer-area-chapters button { text-align:left; padding:.55rem .6rem; min-height:44px; border:1px solid var(--border-color); border-radius:6px; background:var(--bg-surface); color:var(--text-primary); font:inherit; font-size:.78rem; cursor:pointer; }
.viewer-area-chapters button:hover,.viewer-area-chapters button[aria-current="page"] { border-color:#0088cc; background:rgba(0,136,204,.1); color:var(--primary-color,#0088cc); }
.viewer-area-picker :focus-visible { outline:2px solid #0088cc; outline-offset:2px; }

[data-theme="dark"] .nysora-sidebar {
  background-color: #0f172a;
  border-color: #334155;
}

.nysora-brand {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.nysora-brand-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.nysora-logo-badge {
  background: linear-gradient(135deg, #0088cc 0%, #0366d6 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.08em;
}

.nysora-brand h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0088cc;
  margin: 0;
  line-height: 1.2;
}

[data-theme="dark"] .nysora-brand h2 {
  color: #60a5fa;
}

.nysora-brand p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
}

.nysora-search-box {
  margin-bottom: 1rem;
}

.nysora-search-box input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.15s ease;
}

.nysora-search-box input:focus {
  border-color: #0088cc;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.15);
}

.nysora-nav-menu {
  flex: 1;
  overflow-y: auto;
}

.nav-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #0088cc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.5rem 0.25rem;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
}

.nav-group-title:hover {
  background-color: rgba(0, 136, 204, 0.08);
}

.nav-subgroup {
  margin-left: 0.35rem;
  padding-left: 0.65rem;
  border-left: 2px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .nav-subgroup {
  border-left-color: #334155;
}

.nav-item {
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  color: #0366d6;
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 1.35;
  transition: all 0.15s ease;
  user-select: none;
}

[data-theme="dark"] .nav-item {
  color: #93c5fd;
}

.nav-item:hover {
  background-color: #f1f8ff;
  text-decoration: underline;
}

[data-theme="dark"] .nav-item:hover {
  background-color: rgba(96, 165, 250, 0.15);
}

.nav-item.active {
  background-color: #0088cc !important;
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 2px 4px rgba(0, 136, 204, 0.25);
}

/* NYSORA Main Reading Area */
.nysora-main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
}

.nysora-content-toolbar {
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nysora-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nysora-back-btn:hover {
  background-color: var(--bg-hover);
}

.nysora-current-path {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
}

.nysora-article-container {
  padding: 2.5rem 3.5rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  color: var(--text-primary);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .nysora-viewer-layout {
    flex-direction: column;
    height: auto;
  }
  .nysora-sidebar {
    width: 100%;
    max-height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .nysora-article-container {
    padding: 1.5rem;
  }
}

/* Authentic NYSORA Tip Box */
.tip-box {
  border: 1px solid #bce8f1;
  border-radius: 6px;
  margin: 25px 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 136, 204, 0.08);
}

.tip-header {
  background-color: #0088cc;
  color: #ffffff;
  padding: 10px 18px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tip-content {
  background-color: #d9edf7;
  color: #31708f;
  padding: 16px 20px;
}

[data-theme="dark"] .tip-box {
  border-color: #0284c7;
}

[data-theme="dark"] .tip-content {
  background-color: rgba(2, 132, 199, 0.15);
  color: #bae6fd;
}

.tip-content ul {
  margin: 0;
  padding-left: 20px;
}

.tip-content li {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Video Container */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 25px 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* WordPress / NYSORA Embed and Image Blocks */
.wp-block-embed {
  margin: 25px 0;
  max-width: 100%;
}

.wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  background-color: #000;
}

.wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.wp-block-image {
  margin: 20px 0;
  text-align: center;
}

.wp-block-image figure {
  margin: 0;
}

.wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.wp-element-caption {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
  text-align: center;
}

.wp-block-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.wp-block-list li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.action-pill-btn.active-nysora {
  background-color: #0088cc;
  color: #ffffff;
  border-color: #0088cc;
}

.action-pill-btn.active-nysora:hover {
  background-color: #0077b3;
}

/* NYSORA article images */
.nysora-article-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.nysora-article-container h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

[data-theme="dark"] .nysora-article-container h1 {
  color: #f8fafc;
}

.nysora-article-container h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #2c3e50;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

[data-theme="dark"] .nysora-article-container h2 {
  color: #cbd5e1;
}

.nysora-article-container h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #34495e;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .nysora-article-container h3 {
  color: #94a3b8;
}

/* Modal Player & Detail */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.modal-header-info h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.modal-header-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.modal-video-wrapper iframe,
.modal-video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Procedure Detail Sections */
.procedure-protocol-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.protocol-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.protocol-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .protocol-grid {
    grid-template-columns: 1fr;
  }
}

.protocol-field {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.field-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.danger-box {
  background-color: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  color: #9f1239;
}

[data-theme="dark"] .danger-box {
  background-color: rgba(225, 29, 72, 0.15);
  border-color: rgba(225, 29, 72, 0.3);
  color: #fecdd3;
}

/* Readers Accordion */
.readers-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reader-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  overflow: hidden;
}

.reader-header {
  padding: 0.75rem 1rem;
  background-color: var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.875rem;
}

.reader-body {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Figures Gallery in Modal */
.modal-figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.modal-figure-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-surface);
}

.modal-figure-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  cursor: zoom-in;
}

.modal-figure-caption {
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Notes Editor */
.notes-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.notes-textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.85rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  margin-top: 0.5rem;
}

.notes-textarea:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: #0f172a;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: auto;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Peng: full-length reading, matching the NYSORA two-panel layout. */
#peng-view[hidden], #peng-search-results[hidden], #peng-dialog-controls[hidden] { display: none; }
.peng-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.peng-sidebar { min-width:290px; width:320px; }
#peng-search-count { color:var(--text-muted); font-size:.75rem; margin:.5rem .1rem 0; }
.peng-area { margin:.25rem 0; }
.peng-area summary { display:flex; align-items:center; padding:.65rem .5rem; gap:.45rem; font-weight:700; font-size:.88rem; color:var(--text-primary); cursor:pointer; border-radius:6px; }
.peng-area summary:hover { background:var(--bg-hover); }
.peng-area summary::before { content:'›'; color:#0088cc; font-size:1.1rem; }
.peng-area[open] summary::before { transform:rotate(90deg); }
.peng-area summary span { margin-left:auto; color:var(--text-muted); font-size:.75rem; }
.peng-chapter-btn { text-align:left; border:0; background:transparent; font-family:inherit; }
.peng-chapter-btn small { display:block; font-size:.62rem; letter-spacing:.08em; margin-bottom:.2rem; opacity:.75; }
.peng-search-results { display:grid; gap:.35rem; margin:0 0 1rem; }
.peng-search-results button { text-align:left; border:1px solid var(--border-color); background:var(--bg-surface); padding:.65rem; border-radius:6px; cursor:pointer; color:var(--text-primary); }
.peng-search-results strong { display:block; color:#0088cc; font-size:.75rem; }
.peng-search-results span { display:block; font-size:.73rem; line-height:1.4; margin-top:.3rem; }
.peng-toolbar { flex-wrap:wrap; padding:.7rem 1.25rem; }
.peng-reader-tools { display:flex; gap:.3rem; margin-left:auto; flex-wrap:wrap; }
.peng-reader-tools a { text-decoration:none; }
.peng-section-picker { display:flex; align-items:center; gap:.7rem; padding:.65rem 1.5rem; border-bottom:1px solid var(--border-color); background:var(--bg-surface); }
.peng-section-picker label { font-size:.75rem; color:var(--text-muted); white-space:nowrap; }
.peng-section-picker select { width:100%; max-width:620px; border:1px solid var(--border-color); border-radius:6px; padding:.45rem; color:var(--text-primary); background:var(--bg-surface); font:inherit; font-size:.78rem; }
#peng-article { max-width:1000px; padding:2.25rem 3.25rem; line-height:1.8; }
.peng-eyebrow { color:#0088cc; font-size:.68rem; font-weight:800; letter-spacing:.1em; margin-bottom:.8rem; }
#peng-article h1 { font-size:2.2em; line-height:1.16; margin:0 0 .7rem; color:var(--text-primary); letter-spacing:-.035em; }
.peng-lead { font-size:.95em; color:var(--text-muted); margin:.5rem 0!important; }
.peng-source-line { font-size:.72em; color:var(--text-muted); border-bottom:1px solid var(--border-color); padding-bottom:1.3rem; }
.peng-contents { background:var(--bg-subtle); border:1px solid var(--border-color); border-radius:8px; margin:1.25rem 0 1.75rem; padding:1rem 1.2rem; }
.peng-contents summary { color:#0088cc; font-weight:700; cursor:pointer; font-size:.9em; }
.peng-contents>div { display:flex; flex-wrap:wrap; gap:.3rem .8rem; padding-top:.7rem; }
.peng-contents button { color:#0366d6; border:0; border-bottom:1px solid #0366d633; background:none; font:inherit; font-size:.77em; padding:.25rem 0; cursor:pointer; text-align:left; }
.peng-page-marker { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.35rem; border-top:1px solid var(--border-color); margin:2.25rem 0 1.3rem; padding-top:.65rem; color:var(--text-muted); font-size:.65em; }
.peng-page-marker button { border:0; background:transparent; font:inherit; color:#0088cc; padding:0; cursor:pointer; }
#peng-article h2 { margin:1.6em 0 .65em; font-size:1.45em; font-weight:750; color:#0088cc; scroll-margin-top:110px; }
#peng-article h3 { margin:1.4em 0 .6em; font-size:1.14em; color:var(--text-primary); scroll-margin-top:110px; }
#peng-article p { margin:.85em 0; overflow-wrap:anywhere; }
.peng-tip { border:1px solid #a4d6ed; border-radius:7px; background:#e9f6fc; margin:1.4em 0; overflow:hidden; color:#1e516f; }
.peng-tip-label { background:#0088cc; color:white; padding:.55rem 1rem; font-size:.75em; font-weight:800; letter-spacing:.025em; }
.peng-tip ul { margin:.9rem 1rem .9rem 2rem; padding:0; }
.peng-tip li { margin:.4em 0; }
.peng-figure { margin:1.6em 0 .6em!important; text-align:center; }
.peng-figure-open { border:1px solid var(--border-color); border-radius:9px; background:#fff; padding:.8rem; width:100%; display:block; cursor:zoom-in; }
#peng-article .peng-figure img { width:auto; max-width:100%; max-height:780px; height:auto; display:block; margin:auto; border:0; border-radius:0; }
.peng-figure-open>span { display:block; font-size:11px; color:#53667d; margin-top:.65rem; }
.peng-caption { font-size:.8em; line-height:1.6; color:var(--text-muted); margin:.55em 0 1.6em!important; }
.peng-legend { font-size:.75em; text-align:left; padding:.75rem 1rem; background:var(--bg-subtle); border-radius:6px; margin-top:.5rem; color:var(--text-secondary); }
.peng-table-block { margin:1.6em 0; }
.peng-table-title { font-size:.85em; font-weight:750; color:#0088cc; }
.peng-table-scroll { overflow-x:auto; border:1px solid var(--border-color); border-radius:7px; }
#peng-article table { width:100%; border-collapse:collapse; font-size:.8em; line-height:1.6; margin:0; }
#peng-article td,#peng-article th { padding:.75rem .85rem; border:1px solid var(--border-color); vertical-align:top; text-align:left; min-width:105px; }
#peng-article thead th { background:#0088cc; color:white; }
#peng-article tbody th { background:var(--bg-subtle); font-weight:650; }
.peng-chapter-footer { border-top:2px solid #0088cc; margin-top:2rem; padding:1rem 0; font-size:.8em; color:var(--text-muted); }
#peng-next-chapters { display:flex; justify-content:space-between; gap:.75rem; margin-top:1.3rem; }
#peng-article mark { background:#fef08a; color:#312a07; border-radius:2px; }
#peng-dialog { width:min(1120px,96vw); max-height:94dvh; border:1px solid var(--border-color); border-radius:12px; padding:0; background:var(--bg-surface); color:var(--text-primary); box-shadow:0 20px 80px #0005; }
#peng-dialog::backdrop { background:#0f172acc; }
#peng-dialog>header { display:flex; justify-content:space-between; gap:1rem; align-items:center; position:sticky; top:0; z-index:2; padding:.8rem 1rem; background:var(--bg-surface); border-bottom:1px solid var(--border-color); }
#peng-dialog-title { font-size:.95rem; margin:0; }
#peng-dialog-controls { display:flex; align-items:center; justify-content:center; gap:.6rem; padding:.6rem; border-bottom:1px solid var(--border-color); }
#peng-page-number { width:65px; border:1px solid var(--border-color); border-radius:5px; padding:.4rem; background:var(--bg-surface); color:var(--text-primary); }
#peng-dialog-body { padding:1rem; overflow:auto; }
#peng-dialog-body img { display:block; max-width:100%; height:auto; margin:auto; background:white; }
.peng-page-image { width:900px; }
.peng-full-figure { width:auto; max-height:none; }
#peng-dialog-body p { max-width:900px; margin:1rem auto; line-height:1.7; }
[data-theme="dark"] .peng-tip { background:#082f49; color:#bae6fd; border-color:#075985; }
[data-theme="dark"] .peng-contents button { color:#93c5fd; }
@media(max-width:900px) {
  .peng-viewer-layout { min-height:calc(100dvh - 110px); height:auto; overflow:visible; }
  .peng-sidebar { width:100%; min-width:0; max-height:360px; }
  #peng-reading-panel { overflow:visible; }
  #peng-article { padding:1.5rem; }
  .peng-toolbar { gap:.6rem; position:relative; }
  .peng-reader-tools { margin:0; width:100%; }
  .peng-reader-tools .nysora-back-btn { font-size:.72rem; }
  #peng-path { font-size:.7rem; }
  #peng-article h1 { font-size:1.85em; }
  .peng-section-picker { padding:.65rem 1.25rem; }
  .peng-contents>div { max-height:190px; overflow:auto; }
  #peng-dialog { width:96vw; max-height:96dvh; }
  #peng-dialog-body { padding:.5rem; }
}
@media print {
  .peng-sidebar,.peng-toolbar,.peng-section-picker,.peng-page-marker button,.peng-contents,#peng-next-chapters { display:none!important; }
  #peng-view { height:auto; overflow:visible; }
  #peng-reading-panel { overflow:visible; }
  #peng-article { max-width:none; padding:0; }
  .peng-figure { break-inside:avoid; }
}
#peng-article .peng-credit { font-size:.8em; color:var(--text-muted); }
.peng-tip>p { padding:.3rem 1rem .7rem; line-height:1.65; }
@media(min-width:901px) { .peng-viewer-layout { min-height:0; } }
@media(max-width:900px) {
  .header-inner { flex-direction:column; align-items:stretch; gap:.55rem; padding:.65rem 1rem; }
  .brand-section { min-width:0; gap:.65rem; }
  .brand-text { min-width:0; }
  .brand-text h1 { font-size:.95rem; }
  .brand-text p { display:none; }
  .brand-icon { width:34px; height:34px; font-size:1.1rem; }
  .header-actions { width:100%; overflow-x:auto; padding-bottom:.15rem; scrollbar-width:none; }
  .header-actions .action-pill-btn { flex-shrink:0; font-size:.72rem; padding:.4rem .6rem; }
  .header-actions .theme-toggle-btn { flex-shrink:0; }
}

/* Visor Narouze: mismo sistema visual del lector Peng. */
#narouze-view[hidden], #narouze-search-results[hidden], #narouze-dialog-controls[hidden] { display: none; }
.narouze-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.narouze-sidebar { min-width:290px; width:320px; }
#narouze-search-count { color:var(--text-muted); font-size:.75rem; margin:.5rem .1rem 0; }
.narouze-area { margin:.25rem 0; }
.narouze-area summary { display:flex; align-items:center; padding:.65rem .5rem; gap:.45rem; font-weight:700; font-size:.88rem; color:var(--text-primary); cursor:pointer; border-radius:6px; }
.narouze-area summary:hover { background:var(--bg-hover); }
.narouze-area summary::before { content:'›'; color:#0088cc; font-size:1.1rem; }
.narouze-area[open] summary::before { transform:rotate(90deg); }
.narouze-area summary span { margin-left:auto; color:var(--text-muted); font-size:.75rem; }
.narouze-chapter-btn { text-align:left; border:0; background:transparent; font-family:inherit; }
.narouze-chapter-btn small { display:block; font-size:.62rem; letter-spacing:.08em; margin-bottom:.2rem; opacity:.75; }
.narouze-search-results { display:grid; gap:.35rem; margin:0 0 1rem; }
.narouze-search-results button { text-align:left; border:1px solid var(--border-color); background:var(--bg-surface); padding:.65rem; border-radius:6px; cursor:pointer; color:var(--text-primary); }
.narouze-search-results strong { display:block; color:#0088cc; font-size:.75rem; }
.narouze-search-results span { display:block; font-size:.73rem; line-height:1.4; margin-top:.3rem; }
.narouze-toolbar { flex-wrap:wrap; padding:.7rem 1.25rem; }
.narouze-reader-tools { display:flex; gap:.3rem; margin-left:auto; flex-wrap:wrap; }
.narouze-reader-tools a { text-decoration:none; }
.narouze-section-picker { display:flex; align-items:center; gap:.7rem; padding:.65rem 1.5rem; border-bottom:1px solid var(--border-color); background:var(--bg-surface); }
.narouze-section-picker label { font-size:.75rem; color:var(--text-muted); white-space:nowrap; }
.narouze-section-picker select { width:100%; max-width:620px; border:1px solid var(--border-color); border-radius:6px; padding:.45rem; color:var(--text-primary); background:var(--bg-surface); font:inherit; font-size:.78rem; }
#narouze-article { max-width:1000px; padding:2.25rem 3.25rem; line-height:1.8; }
.narouze-eyebrow { color:#0088cc; font-size:.68rem; font-weight:800; letter-spacing:.1em; margin-bottom:.8rem; }
#narouze-article h1 { font-size:2.2em; line-height:1.16; margin:0 0 .7rem; color:var(--text-primary); letter-spacing:-.035em; }
.narouze-lead { font-size:.95em; color:var(--text-muted); margin:.5rem 0!important; }
.narouze-source-line { font-size:.72em; color:var(--text-muted); border-bottom:1px solid var(--border-color); padding-bottom:1.3rem; }
.narouze-contents { background:var(--bg-subtle); border:1px solid var(--border-color); border-radius:8px; margin:1.25rem 0 1.75rem; padding:1rem 1.2rem; }
.narouze-contents summary { color:#0088cc; font-weight:700; cursor:pointer; font-size:.9em; }
.narouze-contents>div { display:flex; flex-wrap:wrap; gap:.3rem .8rem; padding-top:.7rem; }
.narouze-contents button { color:#0366d6; border:0; border-bottom:1px solid #0366d633; background:none; font:inherit; font-size:.77em; padding:.25rem 0; cursor:pointer; text-align:left; }
.narouze-page-marker { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.35rem; border-top:1px solid var(--border-color); margin:2.25rem 0 1.3rem; padding-top:.65rem; color:var(--text-muted); font-size:.65em; }
.narouze-page-marker button { border:0; background:transparent; font:inherit; color:#0088cc; padding:0; cursor:pointer; }
#narouze-article h2 { margin:1.6em 0 .65em; font-size:1.45em; font-weight:750; color:#0088cc; scroll-margin-top:110px; }
#narouze-article h3 { margin:1.4em 0 .6em; font-size:1.14em; color:var(--text-primary); scroll-margin-top:110px; }
#narouze-article p { margin:.85em 0; overflow-wrap:anywhere; }
.narouze-tip { border:1px solid #a4d6ed; border-radius:7px; background:#e9f6fc; margin:1.4em 0; overflow:hidden; color:#1e516f; }
.narouze-tip-label { background:#0088cc; color:white; padding:.55rem 1rem; font-size:.75em; font-weight:800; letter-spacing:.025em; }
.narouze-tip ul { margin:.9rem 1rem .9rem 2rem; padding:0; }
.narouze-tip li { margin:.4em 0; }
.narouze-figure { margin:1.6em 0 .6em!important; text-align:center; }
.narouze-figure-open { border:1px solid var(--border-color); border-radius:9px; background:#fff; padding:.8rem; width:100%; display:block; cursor:zoom-in; }
#narouze-article .narouze-figure img { width:auto; max-width:100%; max-height:780px; height:auto; display:block; margin:auto; border:0; border-radius:0; }
.narouze-figure-open>span { display:block; font-size:11px; color:#53667d; margin-top:.65rem; }
.narouze-caption { font-size:.8em; line-height:1.6; color:var(--text-muted); margin:.55em 0 1.6em!important; }
.narouze-legend { font-size:.75em; text-align:left; padding:.75rem 1rem; background:var(--bg-subtle); border-radius:6px; margin-top:.5rem; color:var(--text-secondary); }
.narouze-table-block { margin:1.6em 0; }
.narouze-table-title { font-size:.85em; font-weight:750; color:#0088cc; }
.narouze-table-scroll { overflow-x:auto; border:1px solid var(--border-color); border-radius:7px; }
#narouze-article table { width:100%; border-collapse:collapse; font-size:.8em; line-height:1.6; margin:0; }
#narouze-article td,#narouze-article th { padding:.75rem .85rem; border:1px solid var(--border-color); vertical-align:top; text-align:left; min-width:105px; }
#narouze-article thead th { background:#0088cc; color:white; }
#narouze-article tbody th { background:var(--bg-subtle); font-weight:650; }
.narouze-chapter-footer { border-top:2px solid #0088cc; margin-top:2rem; padding:1rem 0; font-size:.8em; color:var(--text-muted); }
#narouze-next-chapters { display:flex; justify-content:space-between; gap:.75rem; margin-top:1.3rem; }
#narouze-article mark { background:#fef08a; color:#312a07; border-radius:2px; }
#narouze-dialog { width:min(1120px,96vw); max-height:94dvh; border:1px solid var(--border-color); border-radius:12px; padding:0; background:var(--bg-surface); color:var(--text-primary); box-shadow:0 20px 80px #0005; }
#narouze-dialog::backdrop { background:#0f172acc; }
#narouze-dialog>header { display:flex; justify-content:space-between; gap:1rem; align-items:center; position:sticky; top:0; z-index:2; padding:.8rem 1rem; background:var(--bg-surface); border-bottom:1px solid var(--border-color); }
#narouze-dialog-title { font-size:.95rem; margin:0; }
#narouze-dialog-controls { display:flex; align-items:center; justify-content:center; gap:.6rem; padding:.6rem; border-bottom:1px solid var(--border-color); }
#narouze-page-number { width:65px; border:1px solid var(--border-color); border-radius:5px; padding:.4rem; background:var(--bg-surface); color:var(--text-primary); }
#narouze-dialog-body { padding:1rem; overflow:auto; }
#narouze-dialog-body img { display:block; max-width:100%; height:auto; margin:auto; background:white; }
.narouze-page-image { width:900px; }
.narouze-full-figure { width:auto; max-height:none; }
#narouze-dialog-body p { max-width:900px; margin:1rem auto; line-height:1.7; }
[data-theme="dark"] .narouze-tip { background:#082f49; color:#bae6fd; border-color:#075985; }
[data-theme="dark"] .narouze-contents button { color:#93c5fd; }
@media(max-width:900px) {
  .narouze-viewer-layout { min-height:calc(100dvh - 110px); height:auto; overflow:visible; }
  .narouze-sidebar { width:100%; min-width:0; max-height:360px; }
  #narouze-reading-panel { overflow:visible; }
  #narouze-article { padding:1.5rem; }
  .narouze-toolbar { gap:.6rem; position:relative; }
  .narouze-reader-tools { margin:0; width:100%; }
  .narouze-reader-tools .nysora-back-btn { font-size:.72rem; }
  #narouze-path { font-size:.7rem; }
  #narouze-article h1 { font-size:1.85em; }
  .narouze-section-picker { padding:.65rem 1.25rem; }
  .narouze-contents>div { max-height:190px; overflow:auto; }
  #narouze-dialog { width:96vw; max-height:96dvh; }
  #narouze-dialog-body { padding:.5rem; }
}
@media print {
  .narouze-sidebar,.narouze-toolbar,.narouze-section-picker,.narouze-page-marker button,.narouze-contents,#narouze-next-chapters { display:none!important; }
  #narouze-view { height:auto; overflow:visible; }
  #narouze-reading-panel { overflow:visible; }
  #narouze-article { max-width:none; padding:0; }
  .narouze-figure { break-inside:avoid; }
}
#narouze-article .narouze-credit { font-size:.8em; color:var(--text-muted); }
.narouze-tip>p { padding:.3rem 1rem .7rem; line-height:1.65; }
@media(min-width:901px) { .narouze-viewer-layout { min-height:0; } }
@media(max-width:900px) {
  .header-inner { flex-direction:column; align-items:stretch; gap:.55rem; padding:.65rem 1rem; }
  .brand-section { min-width:0; gap:.65rem; }
  .brand-text { min-width:0; }
  .brand-text h1 { font-size:.95rem; }
  .brand-text p { display:none; }
  .brand-icon { width:34px; height:34px; font-size:1.1rem; }
  .header-actions { width:100%; overflow-x:auto; padding-bottom:.15rem; scrollbar-width:none; }
  .header-actions .action-pill-btn { flex-shrink:0; font-size:.72rem; padding:.4rem .6rem; }
  .header-actions .theme-toggle-btn { flex-shrink:0; }
}

#narouze-nav .narouze-chapter-btn { display:block; width:100%; margin:.2rem 0; padding:.7rem .65rem; }

.nysora-drive-backup { margin:1rem 0 1.5rem; padding:1rem; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-surface); }
.nysora-drive-backup h3 { margin-top:0; }
.nysora-drive-backup .nysora-back-btn { display:inline-flex; text-decoration:none; }
.nysora-drive-backup summary { padding:.6rem 0; cursor:pointer; font-weight:600; }

.jacobson-view {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}
.jacobson-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.jacobson-toolbar h2 {
  flex: 1 1 auto;
  font-size: 1rem;
}
.jacobson-toolbar a, .jacobson-hero-link, .section-nav-row a {
  text-decoration: none;
}
.jacobson-hero-link {
  display: inline-block;
  margin-top: .85rem;
}
#jacobson-frame {
  display: block;
  width: 100%;
  height: 78vh;
  height: 78dvh;
  min-height: 440px;
  border: 0;
}

/* Navegación en dos bandas: visores/secciones y áreas/articulaciones. */
.header-inner {
  flex-direction: row;
  align-items: center;
}
.header-actions {
  width: auto;
  overflow: visible;
  flex-shrink: 0;
  padding-bottom: 0;
}
.brand-section, .brand-text { min-width: 0; }
.joint-nav-bar { overflow: visible; }
.joint-nav-inner { display: block; padding-top: .65rem; padding-bottom: .65rem; }
.section-nav-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .5rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border-color);
}
.area-nav-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: .35rem;
  padding-top: .65rem;
}
.section-nav-row .joint-nav-btn, .area-nav-row .joint-nav-btn {
  min-width: 0;
  justify-content: center;
  min-height: 44px;
}
.section-nav-row .joint-nav-btn {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #bae6fd;
  font-size: .875rem;
  padding: .6rem .65rem;
}
.section-nav-row .joint-nav-btn.active {
  color: #fff;
  background: #0284c7;
  border-color: #0284c7;
}
.section-nav-row .hub-intervencion {
  color: var(--accent-rose);
  background: var(--accent-rose-light);
  border-color: var(--accent-rose);
}
.section-nav-row .hub-intervencion.active {
  color: #fff;
  background: var(--accent-rose);
  border-color: var(--accent-rose);
}
.area-nav-row .joint-nav-btn { font-size: .8rem; gap: .3rem; padding: .5rem .25rem; }
.area-nav-row .count-badge { font-size: .68rem; padding: .1rem .35rem; }
.section-nav-row .joint-nav-btn > span:first-child { white-space: normal; }
@media (max-width: 1000px) {
  .area-nav-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .section-nav-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-nav-row .joint-nav-btn { font-size: .75rem; gap: .3rem; padding: .5rem .3rem; }
  .header-actions .utility-label { display: none; }
  .header-actions #export-notes-btn { min-width: 36px; min-height: 36px; justify-content: center; }
}
@media (max-width: 480px) {
  .area-nav-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-text h1 { font-size: .85rem; }
  .header-inner { gap: .5rem; }
  .header-actions { gap: .25rem; }
}
