/* Capitulo 6 UI. IDs and data-* attributes are preserved for cap6.js. */

.cap6-page {
  position: relative;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 0%, rgba(96, 165, 250, .12), transparent 30rem),
    linear-gradient(180deg, #fbfdff, #f7fafc);
  transition: grid-template-columns 240ms ease;
}

.cap6-page.sidebar-collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.cap6-hero {
  position: relative;
  overflow: visible;
  text-align: left;
  color: var(--color-text);
  padding: clamp(1.25rem, 3vw, 2.5rem) 0 1.6rem;
  background: transparent;
}

.cap6-hero .hero-shell {
  position: relative;
  max-width: none;
  margin: 0 auto;
  display: block;
}

.course-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100vh;
  padding: 1.75rem 1rem;
  border-right: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(22px);
}

.sidebar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: .65rem;
  align-items: center;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .85rem;
  align-items: center;
  color: var(--color-text);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--color-primary-strong);
  background: #dbeafe;
  font-family: var(--font-display);
  font-weight: 800;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 12px;
  color: var(--color-primary-strong);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.sidebar-toggle svg {
  width: 19px;
  height: 19px;
  transition: transform var(--transition-fast);
}

.brand-lockup strong {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.2;
}

.brand-lockup small {
  margin-top: .2rem;
  color: #475569;
  font-size: .82rem;
  font-weight: 600;
}

.side-nav {
  display: grid;
  gap: .75rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 58px;
  padding: .85rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #52617b;
  text-decoration: none;
  font-weight: 650;
  font-family: var(--font-main);
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.side-button {
  width: 100%;
  box-shadow: none;
  background: transparent;
  color: #52617b;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 1rem;
}

.side-link svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.side-link:hover,
.side-link.active {
  color: var(--color-primary-strong);
  border-color: rgba(37, 99, 235, .14);
  background: linear-gradient(135deg, rgba(219,234,254,.92), rgba(239,246,255,.76));
  box-shadow: var(--shadow-soft);
}

.cap6-page.sidebar-collapsed .course-sidebar {
  padding-inline: .8rem;
}

.cap6-page.sidebar-collapsed .sidebar-head {
  grid-template-columns: 1fr;
}

.cap6-page.sidebar-collapsed .brand-lockup {
  grid-template-columns: 1fr;
  justify-items: center;
}

.cap6-page.sidebar-collapsed .brand-copy,
.cap6-page.sidebar-collapsed .side-label,
.cap6-page.sidebar-collapsed .sidebar-note {
  display: none;
}

.cap6-page.sidebar-collapsed .sidebar-toggle {
  justify-self: center;
}

.cap6-page.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.cap6-page.sidebar-collapsed .side-link {
  justify-content: center;
  padding-inline: .65rem;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: .75rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow-soft);
}

.note-icon,
.lab-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #dbeafe;
}

.note-icon::before,
.lab-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-primary);
  border-radius: 999px 999px 999px 2px;
  transform: rotate(-35deg);
}

.sidebar-note p {
  margin: 0;
  color: #52617b;
  font-size: .8rem;
  line-height: 1.5;
  font-weight: 650;
}

.cap6-main {
  min-width: 0;
  padding: 1.35rem clamp(1rem, 2.4vw, 2rem) 4rem;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  margin-bottom: 1rem;
  padding: .34rem .72rem;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #52617b;
  font-size: .82rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.cap6-hero h1,
.cap6-hero p {
  text-align: left;
  margin-left: 0;
}

.cap6-hero h1 {
  margin: 0;
  color: #081a3a;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.1;
}

.cap6-hero h1 span {
  display: block;
  color: var(--color-primary);
}

.cap6-hero p {
  max-width: 620px;
  margin-top: 1rem;
  color: #75829b;
  font-size: clamp(1rem, 1.3vw, 1.14rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.35rem;
}

.hero-cta,
.hero-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .72rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 850;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.hero-cta {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  box-shadow: 0 18px 34px rgba(37, 99, 235, .22);
}

.hero-ghost {
  color: var(--color-text);
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow-soft);
}

.hero-cta:hover,
.hero-ghost:hover {
  transform: translateY(-2px);
}

.hero-mockup {
  position: relative;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  padding: .95rem;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.mockup-panel {
  min-height: 260px;
  border-radius: 14px;
  padding: .75rem;
  color: var(--color-text);
  background: transparent;
  display: grid;
  gap: .85rem;
}

.mockup-header,
.mockup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.mockup-header {
  justify-content: flex-start;
}

.mockup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-secondary);
  box-shadow: 18px 0 0 var(--color-accent), 36px 0 0 var(--color-primary);
}

.mockup-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: .85rem;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.mockup-card strong {
  display: block;
  color: var(--color-text);
  font-size: 1.2rem;
  line-height: 1;
}

.mockup-card span {
  color: var(--color-muted);
  font-size: .82rem;
  font-weight: 700;
}

.mockup-bars,
.mockup-progress {
  display: grid;
  gap: .55rem;
  padding: .9rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.mockup-bars i,
.mockup-progress i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #12366a, #2a66d8, #8fb8ff);
}

.mockup-progress div,
.mockup-ai {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: #52617b;
  font-size: .86rem;
}

.mockup-progress strong {
  color: var(--color-primary-strong);
}

.mockup-ai {
  min-height: 58px;
  padding: .85rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
}

.mockup-ai span {
  color: #2a66d8;
  font-weight: 800;
}

.mockup-ai small {
  flex: 1;
  color: #75829b;
}

.mockup-bars i:nth-child(2) { width: 76%; opacity: .72; }
.mockup-bars i:nth-child(3) { width: 52%; opacity: .48; }

.cap6-status-card,
.hero-card {
  margin-top: 0;
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 16px 16px 0 0;
  background: rgba(255,255,255,.88);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.hero-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .45rem;
  padding: .38rem .72rem;
  border-radius: 999px;
  color: var(--color-text);
  background: transparent;
  border: 0;
  font-size: .86rem;
  font-weight: 850;
}

.hero-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #16a7d8;
}

.module-shell {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.small-note {
  color: var(--color-muted);
  font-size: .94rem;
}

.tabs,
.subtabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar,
.subtabs::-webkit-scrollbar { display: none; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 80;
  margin: 0;
  padding: 0 1.25rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: rgba(255,255,255,.92);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.tab,
.subtab {
  flex: 0 0 auto;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  background: transparent;
  color: var(--color-text-soft);
  font-family: var(--font-accent);
  font-weight: 700;
  -webkit-text-stroke: .4px currentColor;
  box-shadow: none;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

/* Main tabs — underline indicator */
.tab {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  min-height: 44px;
  padding: .55rem .2rem .85rem;
  margin-bottom: -1px;
  font-size: 1.08rem;
}

.tab:hover {
  color: var(--color-primary);
  background: transparent;
  transform: none;
}

.tab.active {
  color: var(--color-primary);
  background: transparent;
  border-bottom-color: var(--color-primary);
  box-shadow: none;
}

.subtabs {
  align-items: center;
  margin: 0;
  padding: 1.15rem 1.45rem;
  gap: .8rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.subtab {
  min-height: 42px;
  padding: .55rem 1rem;
  font-size: 1.04rem;
  border: 1px solid transparent;
  border-radius: 8px;
  margin-bottom: 0;
}

.subtab:hover {
  background: rgba(219,234,254,.5);
  color: var(--color-primary);
}

.subtab.active {
  background: rgba(219,234,254,.75);
  border-color: rgba(37,99,235,.12);
  color: var(--color-primary-strong);
}

.panel,
.subpanel { display: none; }

.panel.active,
.subpanel.active {
  display: block;
  animation: panelIn 260ms ease;
}

#p-binomio.is-bn-bank-active #bn-viz {
  display: none !important;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  scroll-margin-top: 150px;
  padding: 0 1.25rem 1.25rem;
}

.section-block {
  position: relative;
  margin: .85rem 0;
  padding: clamp(.95rem, 2vw, 1.25rem);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.74));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.learning-intro {
  display: block;
  margin: .5rem 0 .15rem;
  padding: .4rem 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.learning-intro h2 {
  margin: 0 0 .3rem;
  font-size: clamp(1.1rem, 1.55vw, 1.42rem);
  line-height: 1.2;
  color: var(--color-text);
}

.learning-intro p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: .93rem;
}

.learning-badge {
  display: none;
}

/* kept for other references, kept invisible */
.__unused_badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: .55rem .75rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  box-shadow: 0 16px 32px rgba(11,92,255,.2);
  font-weight: 900;
}

.exercise-card {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(320px, 1.28fr);
  gap: .85rem;
  align-items: start;
}

.exercise-card.is-wide {
  grid-template-columns: 1fr;
}

.exercise-card .exercise-body,
.exercise-card .exercise-workspace {
  min-width: 0;
}

.exercise-kicker {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  margin-bottom: .6rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  background: rgba(219,234,254,.72);
  color: var(--color-primary-strong);
  font-family: var(--font-accent);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.exercise-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

.exercise-card h3,
.exercise-card h4 {
  margin: 0 0 .55rem;
}

.control-panel,
.result-summary,
.insight-panel,
.media-panel {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-soft);
}

.control-panel {
  padding: .9rem;
}

.result-summary {
  margin-top: .8rem;
  padding: .9rem;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.result-summary:has(span[id]:empty):has(.formula-line:empty),
.case-card:has(.result-metric span[id]:empty):has(.formula-line:empty) {
  display: none;
}

.result-summary strong {
  color: var(--color-text);
}

.result-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem;
  margin: 0 0 .45rem;
  color: var(--color-text-soft);
}

.result-metric span[id] {
  color: var(--color-primary-strong);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 950;
  line-height: 1;
}

.rm-result-card {
  border: 1px solid rgba(30, 69, 131, .18);
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: 0 14px 34px rgba(18, 54, 106, .08);
  color: #08214a;
  overflow: hidden;
}

.rm-result-grid {
  display: grid;
  grid-template-columns: minmax(150px, .85fr) minmax(230px, 1.2fr) minmax(240px, 1.15fr);
  gap: .75rem;
}

.rm-result-panel {
  position: relative;
  min-width: 0;
  min-height: 112px;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(18, 54, 106, .14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(18, 54, 106, .08);
}

.rm-result-panel--interpretation {
  border: 1px solid rgba(30, 69, 131, .14);
  border-radius: 8px;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 10px 22px rgba(18, 54, 106, .08);
}

.rm-result-label,
.rm-steps-label {
  display: block;
  margin-bottom: .38rem;
  color: #34567f;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.rm-total-number {
  display: block;
  color: #12366a;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.rm-result-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.rm-formula-line {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  margin: 0;
  color: #08214a;
  font-size: clamp(.98rem, 1.8vw, 1.15rem);
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.rm-formula-factor {
  display: inline-block;
  padding: .03rem .18rem;
  border-radius: 5px;
  background: #e8f1ff;
  color: #12366a;
}

.rm-result-panel--interpretation p {
  margin: 0;
  color: #17385f;
  font-size: .95rem;
  line-height: 1.55;
}

.rm-result-separator {
  height: 1px;
  margin: 1rem 0 .85rem;
  background: linear-gradient(90deg, transparent, rgba(18, 54, 106, .2), transparent);
}

.rm-steps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .55rem;
}

.rm-steps-label {
  margin: 0;
  color: #12366a;
  text-transform: none;
  letter-spacing: 0;
  font-size: .86rem;
}

.rm-steps-indicator {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  color: #587190;
  font-size: .8rem;
  font-weight: 850;
}

.rm-step-control {
  min-width: 1.55rem;
  min-height: 1.55rem;
  padding: 0;
  border: 1px solid rgba(18, 54, 106, .14);
  border-radius: 6px;
  background: #edf4ff;
  box-shadow: none;
  color: #34567f;
  font: inherit;
  line-height: 1;
}

.rm-step-control.is-active {
  background: #12366a;
  border-color: #12366a;
  color: #fff;
}

.rm-step-dot {
  color: #7890ad;
}

.rm-steps-table-wrap {
  overflow-x: auto;
}

.rm-steps-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(18, 54, 106, .12);
  border-radius: 8px;
  box-shadow: none;
}

.rm-steps-table th,
.rm-steps-table td {
  padding: .72rem .8rem;
  border-bottom: 1px solid rgba(18, 54, 106, .09);
  text-align: left;
  vertical-align: top;
}

.rm-steps-table th {
  background: #f3f7fd;
  color: #34567f;
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.rm-steps-table td {
  color: #17385f;
  font-size: .92rem;
  line-height: 1.45;
}

.rm-step-badge {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border: 1px solid rgba(18, 54, 106, .15);
  border-radius: 999px;
  background: #f4f8fe;
  color: #12366a;
  font-size: .82rem;
  font-weight: 900;
}

.rm-decision-person {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 800;
}

.rm-person-avatar {
  display: inline-grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border: 1px solid rgba(18, 54, 106, .12);
  border-radius: 999px;
  background: #e8f1ff;
  color: #1e4583;
}

.rm-person-avatar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rm-steps-table td:nth-child(3) {
  color: #12366a;
  font-weight: 900;
  white-space: nowrap;
}

.rm-steps-table tbody tr {
  cursor: pointer;
  transition: background-color .18s ease, box-shadow .18s ease;
}

.rm-steps-table tbody tr:hover,
.rm-steps-table tbody tr.is-active {
  background: #eef5ff;
}

.rm-steps-table tbody tr.is-active {
  box-shadow: inset 3px 0 0 #12366a;
}

.rm-steps-table tbody tr.is-active .rm-step-badge {
  background: #12366a;
  border-color: #12366a;
  color: #fff;
}

.rm-steps-table tbody tr:last-child td {
  border-bottom: 0;
}

.rm-result-note {
  margin: .7rem 0 0;
  color: #587190;
  font-size: .85rem;
}

@media (max-width: 900px) {
  .rm-result-grid {
    grid-template-columns: 1fr;
  }

  .rm-total-number {
    font-size: clamp(1.75rem, 9vw, 2.15rem);
  }
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .85rem;
  margin-top: .9rem;
}

.case-card {
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.case-card .result-title {
  margin-top: 0;
}

.inline-actions,
.button-row {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  align-items: center;
}

.compact-actions {
  margin-top: .7rem;
}

.compact-actions button {
  min-height: 36px;
  padding: .5rem .7rem;
  font-size: .86rem;
}

.inline-actions input {
  width: 86px;
  flex: 0 0 86px;
}

.inline-actions button {
  width: auto;
}

.workspace-stack {
  display: grid;
  gap: .85rem;
}

.formula-line {
  color: var(--color-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.choice-stack label {
  display: inline-flex;
  align-items: center;
  margin: .2rem .6rem .2rem 0;
  padding: .35rem .55rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
}

.video-frame,
.media-panel {
  overflow: hidden;
}

.video-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #0f172a;
  border-radius: 18px;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.section-block::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--color-primary-strong), var(--color-primary), var(--color-secondary));
  opacity: .7;
}

.section-block h2,
.section-block h3 {
  margin: 0 0 .75rem;
  color: var(--color-text);
  line-height: 1.18;
  letter-spacing: 0;
}

.section-block h2 { font-size: clamp(1.35rem, 2vw, 1.85rem); }
.section-block h3 { font-size: clamp(1.02rem, 1.25vw, 1.18rem); }

.section-block p {
  color: var(--color-text-soft);
}

.explanation {
  position: relative;
  margin: 1rem 0;
  padding: 1rem 1.05rem 1rem 1.15rem;
  border: 1px solid rgba(11, 92, 255, .14);
  border-left: 5px solid var(--color-primary);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(238,244,255,.94), rgba(255,255,255,.86));
  color: var(--color-text-soft);
}

.result-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1rem 0 .45rem;
  color: var(--color-text);
  font-size: .9rem;
  font-weight: 850;
}

.result-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .9rem;
  align-items: end;
}

.grid > div {
  min-width: 0;
}

label {
  display: block;
  margin-bottom: .34rem;
  color: var(--color-text-soft);
  font-size: .88rem;
  font-weight: 780;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: .62rem .76rem;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: rgba(255,255,255,.9);
  color: var(--color-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-right: .35rem;
  accent-color: var(--color-primary);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--color-primary);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(11, 92, 255, .48);
  box-shadow: 0 0 0 4px rgba(11, 92, 255, .12);
  outline: none;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: .64rem .92rem;
  cursor: pointer;
  color: #fff;
  background: var(--blue-900);
  box-shadow: 0 14px 26px rgba(10, 42, 94, .22);
  font-weight: 700;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 18px 34px rgba(10, 42, 94, .28);
}

button:active {
  transform: translateY(0);
}

button.secondary,
.secondary {
  color: var(--blue-900);
  background: #fff;
  border: 1px solid var(--border-blue);
  box-shadow: var(--shadow-soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: .62;
  transform: none;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: .75rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

th,
td {
  padding: .7rem .78rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-soft);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--color-text);
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  font-size: .82rem;
}

tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fbff; }

code {
  display: inline-flex;
  margin: .18rem;
  padding: .22rem .45rem;
  border-radius: 8px;
  background: #edf4ff;
  color: var(--color-primary-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bit-board {
  display: flex;
  flex-wrap: wrap;
  gap: .48rem;
  align-items: center;
  margin: .5rem 0 .8rem;
}

.bit-toggle {
  width: 38px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-strong);
  border-radius: 13px;
  background: #fff;
  color: var(--color-primary-strong);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
  user-select: none;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.bit-toggle:hover { transform: translateY(-2px); }
.bit-toggle.one {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  border-color: transparent;
}

.bits-experience {
  display: grid;
  gap: .9rem;
  border: 1px solid rgba(18, 54, 106, .14);
  background: #fff;
}

.bits-head {
  display: grid;
  gap: .35rem;
}

.bits-head h3 {
  margin: 0;
  font-size: clamp(1.1rem, 1.55vw, 1.42rem);
  line-height: 1.2;
  color: #08214a;
}

.bits-head p {
  margin: 0;
  color: #587190;
  font-size: .93rem;
  line-height: 1.55;
}

.bits-top-grid,
.bits-metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
  gap: .85rem;
}

.bits-card {
  min-width: 0;
  padding: .95rem;
  border: 1px solid rgba(18, 54, 106, .12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 54, 106, .06);
}

.bits-card-label {
  display: block;
  margin-bottom: .45rem;
  color: #34567f;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.bits-concept {
  display: grid;
  gap: .65rem;
  background: #fff;
}

.bits-concept p {
  margin: 0;
  color: #17385f;
  line-height: 1.58;
}

.bits-concept-key {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .75rem .9rem;
  border: 1px solid rgba(11, 92, 255, .12);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(219,234,254,.55), rgba(239,246,255,.45));
  font-size: .85rem;
  color: var(--color-text-soft);
  line-height: 1.55;
  margin-top: .15rem;
}

.bits-concept-key svg {
  flex-shrink: 0;
  margin-top: .1rem;
  color: var(--color-primary);
}

.bits-concept-key p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: .85rem;
  line-height: 1.55;
}

.bits-concept-key strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--color-primary-strong);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.bits-key-formula {
  margin-top: .7rem !important;
  padding: .65rem .75rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  background: #fff;
  color: #12366a !important;
  font-weight: 900;
}

.bits-flow {
  margin-top: .65rem !important;
  color: #587190 !important;
  font-size: .9rem;
}

.bits-config-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: .75rem;
  align-items: end;
}

.bits-config-row label {
  display: block;
  margin-bottom: .32rem;
  color: #34567f;
  font-weight: 850;
}

.bits-config-row input {
  width: 100%;
}

.bits-metric-card {
  display: grid;
  align-content: start;
  gap: .35rem;
  background: #fbfdff;
}

.bits-metric-card strong {
  color: #12366a;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  line-height: 1;
}

.bits-metric-card .formula-line,
.bits-metric-card p {
  margin: 0;
  color: #17385f;
}

.bits-decimal-label {
  margin-top: .4rem;
  color: #587190;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.bits-explorer {
  background: #fbfdff;
}

.bits-experience:not(.has-result) .bits-metric-grid,
.bits-experience:not(.has-result) .bits-explorer {
  display: none;
}

.bits-section-head {
  margin-bottom: .55rem;
}

.bits-current-line {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  margin: .65rem 0 .75rem;
  color: #17385f;
}

.bits-current-line strong {
  color: #12366a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bits-samples .sample-tile {
  border-color: rgba(18, 54, 106, .13);
  background: #fff;
  color: #12366a;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.bits-samples .sample-tile:hover {
  transform: translateY(-2px);
  background: #eef5ff;
  box-shadow: 0 12px 26px rgba(18, 54, 106, .08);
}

#bits-ej4 .bit-board {
  padding: .75rem;
  border: 1px solid rgba(18, 54, 106, .11);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}

#bits-ej4 .bit-toggle {
  border-radius: 8px;
}

#bits-ej4 .bit-toggle.is-active {
  border-color: #12366a;
  box-shadow: 0 0 0 3px rgba(18, 54, 106, .1);
}

@media (max-width: 860px) {
  .bits-top-grid,
  .bits-metric-grid,
  .bits-config-row {
    grid-template-columns: 1fr;
  }
}

.samples,
.fn-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .7rem;
  margin-top: .75rem;
}

.sample-tile,
.mini-card {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #fff;
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.sample-tile {
  padding: .55rem .65rem;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.fn-builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}

.fn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .72rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.fn-row .from {
  min-width: 72px;
  color: var(--color-text);
  font-weight: 850;
}

.fn-pairs,
[id$="_formula"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.fn-diagram-wrap {
  margin-top: .85rem;
  padding: .75rem;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

/* Step-by-step tree reveal controls (Anterior/Siguiente/Mostrar todo/Reiniciar) */
.tree-step-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .75rem;
  padding: .65rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #f8fafc;
}

.tree-step-label {
  font-size: .85rem;
  font-weight: 800;
  color: var(--color-text-soft);
}

.tree-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tree-step-actions button {
  min-height: 38px;
  padding: .45rem .75rem;
  font-size: .85rem;
  border-radius: 10px;
}

.tree-step-actions button:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

.mini-card {
  padding: .6rem;
}

.fn-experience .exercise-workspace {
  display: grid;
  gap: .9rem;
}

.fn-experience:not(.has-result) .fn-summary-grid,
.fn-experience:not(.has-result) .fn-main-grid,
.fn-experience:not(.has-result) .fn-gallery-panel,
.fn-experience:not(.has-result) .fn-steps-panel {
  display: none;
}

.fn-summary-grid {
  display: grid;
  grid-template-columns: minmax(160px, .7fr) minmax(220px, 1fr) minmax(260px, 1.25fr);
  gap: .75rem;
}

.fn-summary-card,
.fn-panel {
  border: 1px solid rgba(18, 54, 106, .14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 54, 106, .06);
}

.fn-summary-card {
  min-height: 104px;
  padding: .95rem 1rem;
}

.fn-summary-card--soft {
  background: #eef5ff;
}

.fn-label {
  display: block;
  margin-bottom: .55rem;
  color: #12366a;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.fn-summary-card strong {
  color: #08214a;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1;
}

.fn-summary-card p {
  margin: 0;
  color: #17385f;
  line-height: 1.55;
}

.fn-summary-card .formula-line {
  color: #12366a;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 850;
}

.fn-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: .85rem;
}

.fn-panel {
  padding: .95rem;
}

.fn-panel h4 {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .8rem;
  color: #08214a;
  font-size: 1rem;
}

.fn-panel h4 span {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: #2f74d0;
}

.fn-builder-layout {
  display: grid;
  grid-template-columns: minmax(180px, .82fr) minmax(220px, 1fr);
  gap: .9rem;
  align-items: start;
}

.fn-subtitle {
  margin: 0 0 .55rem;
  color: #17385f;
  font-weight: 850;
}

.fn-assignments {
  display: grid;
  gap: .55rem;
}

.fn-assignment-row {
  display: grid;
  grid-template-columns: minmax(58px, auto) 34px minmax(58px, auto);
  gap: .55rem;
  align-items: center;
  color: #12366a;
  font-weight: 900;
}

.fn-assignment-row span:not(.fn-assignment-arrow) {
  display: inline-grid;
  min-height: 2.25rem;
  place-items: center;
  padding: .35rem .75rem;
  border: 1px solid rgba(18, 54, 106, .16);
  border-radius: 7px;
  background: #eef5ff;
}

.fn-assignment-arrow {
  text-align: center;
  color: #1e4583;
  font-size: 1.35rem;
}

.fn-experience .fn-builder {
  grid-template-columns: 1fr;
  gap: .55rem;
  margin-top: 0;
}

.fn-experience .fn-row {
  border-color: rgba(18, 54, 106, .14);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.fn-note {
  margin: .8rem 0 0;
  padding: .65rem .75rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  background: #eef5ff;
  color: #17385f;
}

.fn-experience .fn-diagram-wrap {
  display: grid;
  min-height: 260px;
  place-items: center;
  margin-top: 0;
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: none;
}

.fn-gallery-panel .fn-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: .65rem;
}

.fn-mini-card {
  position: relative;
  display: grid;
  width: 100%;
  padding: .45rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #12366a;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.fn-mini-card:hover {
  transform: translateY(-2px);
  background: #f7fbff;
  box-shadow: 0 12px 26px rgba(18, 54, 106, .08);
}

.fn-mini-card.is-active {
  border-color: #1e4583;
  background: #eef5ff;
  box-shadow: 0 14px 28px rgba(18, 54, 106, .1);
}

.fn-mini-card.is-active::after {
  content: "✓";
  position: absolute;
  top: .45rem;
  right: .45rem;
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 999px;
  background: #2f74d0;
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
}

.fn-mini-card .mini-title {
  color: #12366a;
  font-size: .82rem;
  line-height: 1.35;
}

.fn-steps-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  box-shadow: none;
}

.fn-steps-table th,
.fn-steps-table td {
  padding: .72rem .8rem;
  border-bottom: 1px solid rgba(18, 54, 106, .09);
  text-align: left;
}

.fn-steps-table th {
  background: #f3f7fd;
  color: #34567f;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.fn-steps-table td {
  color: #17385f;
}

.fn-steps-table tr:last-child td {
  border-bottom: 0;
}

.fn-steps-table tbody tr:hover {
  background: #eef5ff;
}

@media (max-width: 980px) {
  .fn-summary-grid,
  .fn-main-grid,
  .fn-builder-layout {
    grid-template-columns: 1fr;
  }
}

.mini-title {
  margin-top: .35rem;
  color: var(--color-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#rd_scene { transform-origin: 0 0; transition: transform .6s cubic-bezier(.4,0,.2,1); }

#rd_seats .rd-person-label {
  font: 700 10.5px ui-monospace, Menlo, Consolas, monospace;
  fill: var(--color-text);
}
#rd_seats .rd-person-chair { fill: #caa170; opacity: .85; }
#rd_seats .rd-person-avatar {
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 2px 3px rgba(15,23,42,.18));
}
#rd_seats .rd-person-initials {
  font: 800 11px ui-monospace, Menlo, Consolas, monospace;
  fill: #fff;
}

.rd-rot-arrow {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: .55;
}

/* Panel de rotación por pasos (Mesa circular) */
.rd-rotation-panel { margin-top: .85rem; padding-top: .85rem; border-top: 1px dashed var(--color-border); }
.rd-rotation-head { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-bottom: .7rem; }
.pill--accent { background: var(--color-primary); color: #fff; font-weight: 800; }
.rd-rotation-caption { color: var(--color-text-soft); font-size: .88rem; font-weight: 700; }
.rd-rotation-frames { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rd-frame { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.rd-frame svg { width: 64px; height: 64px; border-radius: 12px; background: #fff; border: 2px solid var(--color-border); }
.rd-frame.is-active svg { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.rd-frame-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #eef4ff; color: var(--color-primary-strong);
  font-size: .72rem; font-weight: 900;
}
.rd-frame.is-active .rd-frame-num { background: var(--color-primary); color: #fff; }
.rd-frame-arrow { color: var(--color-text-soft); font-weight: 700; }

/* Iconos de las tarjetas resumen */
.fn-icon-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  margin-bottom: .5rem;
}
.fn-icon-badge--blue { background: #dbeafe; color: var(--color-primary-strong); }
.fn-icon-badge--gray { background: #f1f5f9; color: #475569; }

#s-65 .edge { fill: none; stroke: rgba(15, 23, 42, .25); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s ease, stroke-width .2s ease; }
#s-65 .edge--forbidden { stroke: var(--color-error); stroke-dasharray: 5 4; opacity: .9; }
#s-65 .node circle,
#s-65 .node rect { fill: #fff; stroke: #cbd5e1; stroke-width: 1.5; filter: drop-shadow(0 1px 1px rgba(15,23,42,.08)); transition: fill .2s ease, stroke .2s ease, stroke-width .2s ease; }
#s-65 .node--root circle { stroke: #2563eb; stroke-width: 2.5; }
#s-65 .node--forbidden circle { fill: #fff7f5; stroke: #fb7b68; stroke-width: 1.8; }
#s-65 .node--forbidden text { fill: #c24135; }
#s-65 .forbidden-mark { font: 900 18px/1 var(--font-main); fill: #fff !important; stroke: #fb5a4a; stroke-width: 5px; paint-order: stroke; }
#s-65 .node text { font: 700 12px/1 var(--font-main); fill: var(--color-text); }
#s-65 .label { font: 700 11px/1 ui-monospace, Menlo, Consolas, monospace; fill: var(--color-text); }

/* Interactividad de árboles: resaltado de ruta raíz→nodo */
#s-65 .node { cursor: pointer; }
#s-65 .node:hover circle,
#s-65 .node:hover rect { stroke: var(--color-primary); stroke-width: 2.25; }
#s-65 .node.is-active circle,
#s-65 .node.is-active rect { fill: var(--color-primary); stroke: var(--color-primary-strong); stroke-width: 2.5; }
#s-65 .node.is-active text { fill: var(--color-primary-strong); font-weight: 900; }
#s-65 .node.is-active text { fill: #fff; }
#s-65 .edge.is-active { stroke: var(--color-primary); stroke-width: 2.75; }

/* El árbol de permutaciones sigue el acabado visual del árbol binario del ejercicio 01. */
.t65-tree-card { border-radius: 16px; padding: 1.25rem; box-shadow: 0 18px 40px rgba(18,54,106,.07); }
.t65-tree-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.t65-tree-heading h4 { margin: 0; }
.t65-tree-canvas { margin: 0; min-height: 260px; max-height: 560px; padding: .75rem; overflow: auto; border-color: #dbeafe; border-radius: 12px; background: #fff; box-shadow: none; }
.t65-tree-canvas svg { display: block; min-width: 100%; max-width: none; margin: 0 auto; transform-origin: top center; }
.t65-tree-zoom { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.t65-tree-zoom span { min-width: 3.25rem; color: #475569; font-size: .82rem; font-weight: 800; text-align: center; }
.t65-tree-zoom button { min-width: 34px; min-height: 34px; padding: .25rem .55rem; border-radius: 8px; font-size: .82rem; }
@media (max-width: 620px) { .t65-tree-heading { align-items: flex-start; flex-direction: column; } }

.cap6-ai-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 54px;
  height: 54px;
  border-radius: 22px;
  z-index: 10000;
  display: grid;
  place-items: center;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 22px 46px rgba(11,92,255,.34);
}

.cap6-ai-toggle svg {
  width: 24px;
  height: 24px;
}

.cap6-ai-toggle::before {
  content: none;
}

.cap6-ai-agent {
  position: fixed;
  right: 20px;
  bottom: 98px;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: min(580px, calc(100vh - 130px));
  border: 1px solid rgba(18, 54, 106, .14);
  border-radius: 16px;
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 8px 40px rgba(15, 23, 42, .18);
  z-index: 10000;
  overflow: hidden;
  display: none;
}

.cap6-ai-agent.open {
  display: flex;
  flex-direction: column;
}
.cap6-ai-agent.is-entering {
  animation: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.cap6-ai-agent.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cap6-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem;
  color: #fff;
  background: #12366a;
}

.cap6-ai-header strong {
  display: block;
  font-size: 1rem;
}

.cap6-ai-header span {
  display: block;
  max-width: 250px;
  overflow: hidden;
  color: rgba(255,255,255,.82);
  font-size: .82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cap6-ai-header button {
  min-height: 34px;
  padding: .42rem .64rem;
  border: 1px solid rgba(255,255,255,.24);
  color: #fff;
  background: rgba(255,255,255,.14);
  box-shadow: none;
}

.cap6-ai-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  padding: .75rem;
  border-bottom: 1px solid var(--color-border);
  background: rgba(248,251,255,.8);
}

.cap6-ai-modes button {
  min-height: 38px;
  padding: .5rem .45rem;
  color: var(--color-text-soft);
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: none;
}

.cap6-ai-modes button.active {
  color: #fff;
  background: #12366a;
  border-color: transparent;
}

.cap6-ai-body {
  flex: 1;
  min-height: 180px;
  overflow: auto;
  padding: .9rem;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.cap6-ai-message {
  display: flex;
  align-items: flex-end;
  gap: .45rem;
  width: 100%;
  max-width: none;
  margin: 0 0 .72rem;
  word-break: break-word;
}
.cap6-ai-avatar {
  position: relative;
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #5b7197;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 4px 10px rgba(18, 54, 106, .16);
}

.cap6-ai-avatar--bot {
  font-size: 1rem;
  line-height: 1;
}

.cap6-ai-avatar--user {
  background: #f2f5fa;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 4px 10px rgba(18, 54, 106, .12);
}

.cap6-ai-avatar--user::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 7px;
  height: 7px;
  transform: translateX(-50%);
  border: 1.7px solid #6b7280;
  border-radius: 50%;
  background: transparent;
}

.cap6-ai-avatar--user::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 15px;
  height: 8px;
  transform: translateX(-50%);
  border: 1.7px solid #6b7280;
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
  border-bottom: 0;
  background: transparent;
}

.cap6-ai-bubble {
  width: fit-content;
  max-width: min(82%, 32rem);
  padding: .7rem .82rem;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.cap6-ai-message--bot h3,
.cap6-ai-message--bot h4 {
  margin: .6rem 0 .25rem;
  font-size: .95rem;
  font-weight: 700;
}
.cap6-ai-message--bot p {
  margin: 0 0 .4rem;
}
.cap6-ai-message--bot ul {
  margin: .2rem 0 .4rem;
  padding-left: 1.2rem;
}
.cap6-ai-message--bot li {
  margin-bottom: .15rem;
}
.cap6-ai-message--bot code {
  background: rgba(18,54,106,.08);
  padding: .1rem .3rem;
  border-radius: 4px;
  font-size: .88em;
}
.cap6-ai-message--bot mjx-container {
  margin: .3rem 0;
}

.cap6-ai-message--bot {
  justify-content: flex-start;
}

.cap6-ai-message--bot .cap6-ai-bubble {
  background: #fff;
  border: 1px solid var(--color-border);
}

.cap6-ai-message--user {
  justify-content: flex-end;
}

.cap6-ai-message--user .cap6-ai-bubble {
  color: #fff;
  background: #12366a;
}

.cap6-ai-message--status {
  justify-content: flex-start;
  color: var(--color-muted);
}

.cap6-ai-message--status .cap6-ai-avatar {
  background: #8aa0c0;
}

.cap6-ai-message--status .cap6-ai-bubble {
  padding: .15rem 0;
  background: transparent;
  box-shadow: none;
}

.cap6-ai-form {
  display: flex;
  gap: .55rem;
  padding: .8rem;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.cap6-ai-form input {
  flex: 1;
  min-width: 0;
}

.cap6-ai-form button {
  flex: 0 0 auto;
}

/* ===== Exercise cards global aesthetic ===== */
.exercise-card .exercise-body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .25rem 0;
}

.exercise-card .exercise-body h3 {
  margin: 0;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.2;
}

.exercise-card .exercise-body > p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: .92rem;
  line-height: 1.55;
}

/* Primary button inside any control-panel gets full-width pill */
.control-panel .grid > div > button:not(.secondary),
.control-panel > button:not(.secondary) {
  width: 100%;
  border-radius: 14px;
  min-height: 48px;
  font-size: .95rem;
}

/* ===== Lab Hero Card (rm-ej1 split layout) ===== */
.lab-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.75rem;
  align-items: start;
  padding: 1.5rem;
}

.lab-left {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.lab-icon-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: var(--color-primary-strong);
  flex-shrink: 0;
}

.lab-hero-card h2 {
  margin: 0;
  font-size: clamp(1.1rem, 1.55vw, 1.42rem);
  line-height: 1.2;
  color: var(--color-text);
}

.lab-hero-card .lab-left > p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: .93rem;
  line-height: 1.55;
}

.idea-clave-mini {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .75rem .9rem;
  border: 1px solid rgba(11, 92, 255, .12);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(219,234,254,.55), rgba(239,246,255,.45));
  font-size: .85rem;
  color: var(--color-text-soft);
  line-height: 1.55;
  margin-top: .15rem;
}

.idea-clave-mini svg {
  flex-shrink: 0;
  margin-top: .1rem;
  color: var(--color-primary);
}

.idea-clave-mini p {
  margin: 0;
}

.idea-clave-mini strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--color-primary-strong);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .02em;
}

/* Right panel */
.lab-right {
  display: grid;
  gap: .9rem;
}

.lab-right-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}

/* Tag input */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  min-height: 44px;
  padding: .42rem .65rem;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  cursor: text;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tag-input-wrap:focus-within {
  border-color: rgba(11, 92, 255, .48);
  box-shadow: 0 0 0 4px rgba(11, 92, 255, .12);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--color-primary-strong);
  font-size: .84rem;
  font-weight: 750;
  white-space: nowrap;
  line-height: 1;
}

.tag-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-height: unset;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-primary-strong);
  box-shadow: none;
  font-size: .95rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  border: 0;
}

.tag-chip-remove:hover {
  background: rgba(37, 99, 235, .18);
  transform: none;
  box-shadow: none;
  filter: none;
}

.tag-text-input {
  flex: 1;
  min-width: 80px;
  min-height: unset;
  padding: 0 .2rem;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  font-size: .9rem;
  outline: none;
}

.tag-text-input:focus {
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none;
}

/* Calc button */
.lab-calc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  min-height: 50px;
  border-radius: 14px !important;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  color: #fff;
  font-weight: 850;
  font-size: .97rem;
  box-shadow: 0 14px 28px rgba(11, 92, 255, .22);
  border: 0;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.lab-calc-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 18px 36px rgba(11, 92, 255, .28);
}

/* Secondary action row under the calc button: two even columns, icon + label */
.lab-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.lab-secondary-grid button.secondary,
.lab-secondary-grid .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 48px;
  border-radius: 14px !important;
  font-size: .9rem;
}

@media (max-width: 540px) {
  .lab-secondary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .cap6-page {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: relative;
    min-height: auto;
    padding: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: .25rem;
  }

  .side-link {
    flex: 0 0 auto;
    min-height: 46px;
  }

  .sidebar-note {
    display: none;
  }

  .cap6-hero .hero-shell {
    grid-template-columns: 1fr;
  }

  .hero-mockup {
    display: block;
  }

  .cap6-status-card,
  .hero-card {
    grid-template-columns: 1fr;
    margin-top: -1rem;
  }

  .learning-intro,
  .exercise-card,
  .lab-hero-card {
    grid-template-columns: 1fr;
  }

  .lab-right-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .cap6-main {
    padding-inline: .75rem;
  }

  .brand-lockup {
    grid-template-columns: 42px 1fr;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .cap6-hero h1 {
    font-size: clamp(2.25rem, 12vw, 3.5rem);
  }

  .tabs {
    top: 0;
    border-radius: 0;
  }

  .tab,
  .subtab {
    max-width: 76vw;
    white-space: normal;
    text-align: left;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .inline-actions input,
  .inline-actions button {
    width: 100%;
    flex-basis: 100%;
  }

  .cap6-ai-agent {
    right: 10px;
    bottom: 88px;
    max-width: calc(100vw - 20px);
  }

  .cap6-ai-body { min-height: 140px; }
  .cap6-ai-toggle { right: 12px; bottom: 12px; }
  .cap6-ai-form { flex-direction: column; }
}

/* ===== Editorial override: Capitulo 6 as an academic chapter, not a dashboard ===== */
.cap6-page {
  display: block;
  min-height: 100vh;
  background: #fff;
}

.cap6-page.sidebar-collapsed {
  display: block;
}

.course-sidebar {
  position: relative;
  top: auto;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  width: 100%;
  min-height: auto;
  padding: 1.2rem clamp(1rem, 4vw, 4.75rem);
  border-right: 0;
  border-bottom: 0;
  color: #f8fbff;
  background: #061a38;
  backdrop-filter: none;
}

.brand-lockup {
  grid-template-columns: auto 1fr;
  color: #fff;
}

.brand-mark {
  width: auto;
  height: auto;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
}

.brand-lockup strong {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
}

.brand-lockup small {
  color: rgba(255,255,255,.68);
}

.side-nav {
  display: flex;
  justify-content: center;
  gap: clamp(.9rem, 2.4vw, 2.5rem);
  min-width: 0;
}

.side-link,
.side-button {
  position: relative;
  min-height: 42px;
  padding: .35rem .1rem;
  border: 0;
  border-radius: 0;
  color: rgba(255,255,255,.7);
  background: transparent;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 500;
}

.side-link:hover,
.side-link.active {
  color: #fff;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.side-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #dbeafe;
}

.theme-dot.side-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.theme-dot svg {
  width: 23px;
  height: 23px;
}

.cap6-main {
  padding: 0;
}

.cap6-hero {
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1rem, 4vw, 4.75rem) clamp(3rem, 6vw, 4.8rem);
  color: #f8fbff;
  background:
    radial-gradient(circle at 78% 42%, rgba(42, 102, 216, .32), transparent 26rem),
    linear-gradient(115deg, #061a38 0%, #092347 54%, #1e4583 100%);
}

.cap6-hero .hero-shell {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, .7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  width: min(1400px, 100%);
}

.eyebrow {
  margin-bottom: .65rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #8fb8ff;
  background: transparent;
  font-size: .82rem;
  letter-spacing: .02em;
  backdrop-filter: none;
}

.cap6-hero h1 {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6.5vw, 6rem);
  font-weight: 600;
  line-height: .98;
}

.cap6-hero p {
  max-width: 720px;
  color: rgba(236, 242, 255, .8);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.7;
}

.cap6-hero-diagram {
  min-height: 220px;
  color: rgba(214, 228, 255, .55);
}

.cap6-hero-diagram svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.cap6-hero-diagram text {
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
}

.module-shell {
  width: min(1400px, calc(100% - 2rem));
  margin: -2.1rem auto 3rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .12);
  overflow: visible;
}

.cap6-status-card,
.hero-card {
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,.96);
}

.tabs {
  position: sticky;
  top: 0;
  gap: .8rem;
  padding: 1rem 1.15rem 0;
  background: rgba(255,255,255,.94);
}

.tab.active {
  border-bottom-color: #12366a;
  color: #12366a;
}

.subtab {
  border-radius: 8px;
}

.subtab.active {
  color: #061a38;
  background: #e8eef7;
  border-color: rgba(18, 54, 106, .16);
}

/* Main tabs: same clean selection treatment used in Capítulo 7. */
.tabs > .tab:hover,
.tabs > .tab:focus-visible,
.tabs > .tab.active {
  color: #1e4583 !important;
  background: transparent !important;
  border-bottom-color: #1e4583 !important;
  box-shadow: none !important;
  transform: none !important;
}

.tabs > .tab:focus-visible {
  outline: none;
}

.panel {
  padding: 0 clamp(.9rem, 2vw, 1.25rem) 1.25rem;
}

.section-block,
.control-panel,
.result-summary,
.insight-panel,
.media-panel,
.case-card,
.mini-card,
.sample-tile,
.fn-row,
.fn-diagram-wrap,
table {
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

.section-block {
  background: #fff;
}

.section-block::before {
  height: 2px;
  border-radius: 8px 8px 0 0;
  background: #12366a;
  opacity: .95;
}

.exercise-kicker,
.pill {
  border-radius: 6px;
  color: #12366a;
  background: #e8eef7;
}

button,
.lab-calc-btn {
  border-radius: 14px;
  background: var(--blue-900);
  box-shadow: 0 14px 28px rgba(10, 42, 94, .2);
}

button.secondary,
.secondary {
  border-radius: 14px;
  background: #fff;
}

input,
select,
textarea,
.tag-input-wrap {
  border-radius: 14px;
}

.cap6-ai-toggle {
  border-radius: 8px;
  background: #12366a;
}

.hero-pill::before {
  background: #1e4583;
}

.lab-icon,
.lab-icon-mark {
  color: #12366a;
  background: #e8eef7;
}

.lab-icon::before {
  border-color: #12366a;
}

.lab-icon-mark {
  background: linear-gradient(135deg, #edf3fb, #dfe8f5);
}

.idea-clave-mini {
  border-color: rgba(18, 54, 106, .16);
  background: linear-gradient(135deg, rgba(232, 238, 247, .92), rgba(255,255,255,.78));
}

.idea-clave-mini svg,
.idea-clave-mini strong {
  color: #12366a;
}

/* ===== Regla de la suma: laboratorio interactivo ===== */
.rs-lab-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.35rem);
  border-color: rgba(18, 54, 106, .16);
  border-top: 3px solid #102a56;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

.rs-lab-top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 1rem;
  align-items: start;
}

.rs-concept,
.rs-config,
.rs-build-card,
.rs-distribution,
.rs-mini-card,
.rs-result-box,
.rs-list-card {
  min-width: 0;
  border: 1px solid #d6e4f5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
}

.rs-concept,
.rs-config,
.rs-build-card,
.rs-distribution,
.rs-mini-card {
  padding: 1rem;
}

.rs-title-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
}

.rs-plus-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  color: #0b1f4d;
}

.rs-lab-card h2,
.rs-lab-card h3 {
  margin: 0;
  color: #0b1f4d;
  letter-spacing: 0;
}

.rs-lab-card h2 {
  font-size: clamp(1.12rem, 1.6vw, 1.45rem);
}

.rs-lab-card h3 {
  font-size: .98rem;
}

.rs-title-row p,
.rs-mini-card p,
.rs-result-box p {
  margin: .3rem 0 0;
  color: #475569;
  line-height: 1.55;
}

.rs-key-card {
  margin-top: .85rem;
  padding: .85rem;
  border: 1px solid #d6e4f5;
  border-radius: 12px;
  background: #f8fafc;
}

.rs-key-card span,
.rs-result-box span,
.rs-mini-card > span,
.rs-result-box small {
  display: block;
  color: #334155;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.rs-key-card p {
  margin: .32rem 0;
  color: #0b1f4d;
  font-weight: 760;
  line-height: 1.55;
}

.rs-key-card small,
.rs-validation {
  color: #64748b;
  line-height: 1.45;
}

.rs-route-map {
  position: relative;
  display: grid;
  gap: .8rem;
  margin-top: .9rem;
  padding: .9rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.rs-route-root,
.rs-route-node {
  position: relative;
  z-index: 1;
  justify-self: center;
  padding: .55rem .8rem;
  border: 1px solid #d6e4f5;
  border-radius: 10px;
  background: #fff;
  color: #0b1f4d;
  font-weight: 850;
}

.rs-route-lines {
  position: absolute;
  left: 50%;
  right: 12%;
  top: 5.2rem;
  height: 1px;
  background: #d6e4f5;
  transform: translateX(-50%);
}

.rs-route-lines::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2rem;
  width: 1px;
  height: 2rem;
  background: #d6e4f5;
}

.rs-route-branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.rs-route-node {
  display: grid;
  width: 100%;
  gap: .12rem;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .2s ease, background .2s ease, transform .18s ease;
}

.rs-route-node span {
  color: #64748b;
  font-size: .78rem;
  font-weight: 750;
}

.rs-route-node:hover,
.rs-route-node.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}

.rs-config {
  display: grid;
  gap: .8rem;
  background: #f8fafc;
}

.rs-input-grid {
  display: grid;
  gap: .72rem;
}

.rs-input-grid input {
  width: 100%;
}

.rs-validation {
  min-height: 1.2rem;
  margin: -.2rem 0 0;
  font-size: .82rem;
}

.rs-action-row,
.rs-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.rs-action-row button {
  flex: 1 1 150px;
}

.rs-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.rs-list-card {
  display: grid;
  gap: .32rem;
  padding: 1rem;
  color: #0b1f4d;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
  transition: border-color .2s ease, background .2s ease, transform .18s ease, box-shadow .2s ease;
}

.rs-list-card span {
  color: #334155;
  font-size: .8rem;
  font-weight: 900;
}

.rs-list-card strong {
  color: #0b1f4d;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.1;
}

.rs-list-card small {
  color: #64748b;
  font-weight: 750;
}

.rs-list-card em {
  width: fit-content;
  margin-top: .2rem;
  padding: .18rem .48rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #0f2a5f;
  font-size: .76rem;
  font-style: normal;
  font-weight: 850;
}

.rs-list-card:hover,
.rs-list-card.is-selected,
.rs-list-card.is-suggested {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .11);
  transform: translateY(-1px);
}

.rs-list-bar,
.rs-dist-bar {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #dbeafe;
}

.rs-list-bar i,
.rs-dist-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width .32s ease;
}

.rs-selection-note {
  margin: -.25rem 0 0;
  color: #475569;
  font-weight: 750;
}

.rs-section-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  margin-bottom: .7rem;
}

.rs-section-head span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 800;
}

.rs-steps {
  display: grid;
  gap: .55rem;
}

.rs-step-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  padding: .72rem .85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.rs-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: .85rem;
  font-weight: 900;
  justify-self: start;
}

.rs-step-item p {
  margin: 0;
  color: #475569;
}

.rs-step-value {
  display: inline-flex;
  align-items: center;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--color-primary-strong);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .88rem;
  font-weight: 800;
  white-space: nowrap;
}

.rs-step-value--final {
  background: var(--blue-050);
  color: var(--blue-800);
}

.rs-result-grid,
.rs-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.rs-result-box {
  padding: 1rem;
  background: #fff;
}

.rs-result-box--soft {
  background: #eff6ff;
}

.rs-result-box strong {
  display: block;
  margin: .32rem 0 .18rem;
  color: #2563eb;
  font-size: clamp(2rem, 4vw, 2.65rem);
  line-height: 1;
}

.rs-formula-line {
  margin: .45rem 0 0;
  color: #0b1f4d;
  font-weight: 850;
  line-height: 1.7;
}

.rs-formula-term {
  display: inline-block;
  min-width: 1.55rem;
  padding: .05rem .22rem;
  border-radius: 6px;
  text-align: center;
  transition: background .2s ease, color .2s ease;
}

.rs-formula-term.is-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.rs-formula-op {
  color: #64748b;
}

.rs-distribution h3 {
  margin-bottom: .7rem;
}

.rs-dist-row {
  display: grid;
  grid-template-columns: minmax(120px, .6fr) minmax(0, 1fr) 48px;
  gap: .65rem;
  align-items: center;
}

.rs-dist-label {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .45rem;
  align-items: baseline;
  color: #334155;
}

.rs-dist-label strong {
  color: #0b1f4d;
}

.rs-dist-label span,
.rs-dist-percent {
  color: #64748b;
  font-size: .86rem;
  font-weight: 800;
}

.rs-dist-percent {
  text-align: right;
}

.rs-mini-card {
  display: grid;
  align-content: start;
  gap: .55rem;
}

.rs-suggestion-card strong {
  color: #1d4ed8;
  font-size: 1.12rem;
  line-height: 1.2;
}

.rs-choice-row button {
  flex: 1 1 120px;
}

.rs-feedback {
  min-height: 3.2rem;
}

.rs-feedback p,
.rs-overlap-formula {
  margin: 0;
  padding: .7rem .8rem;
  border: 1px solid #d6e4f5;
  border-radius: 10px;
  background: #eff6ff;
  color: #0f2a5f;
  line-height: 1.45;
}

.rs-switch-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
}

.rs-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.rs-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rs-switch span {
  width: 100%;
  border: 1px solid #d6e4f5;
  border-radius: 999px;
  background: #e2e8f0;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.rs-switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
  transition: transform .2s ease;
}

.rs-switch input:checked + span {
  border-color: #2563eb;
  background: #2563eb;
}

.rs-switch input:checked + span::after {
  transform: translateX(20px);
}

.rs-overlap-formula {
  font-weight: 850;
}

@media (max-width: 980px) {
  .rs-lab-top,
  .rs-result-grid,
  .rs-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .rs-list-grid,
  .rs-route-branches {
    grid-template-columns: 1fr;
  }

  .rs-route-lines {
    display: none;
  }

  .rs-step-item,
  .rs-dist-row {
    grid-template-columns: 1fr;
  }

  .rs-step-value,
  .rs-dist-percent {
    text-align: left;
  }

  .rs-action-row button,
  .rs-choice-row button {
    flex-basis: 100%;
  }
}

.tag-chip {
  color: #12366a;
  background: #e8eef7;
}

.tag-chip-remove {
  color: #12366a;
}

.tag-chip-remove:hover {
  background: rgba(18, 54, 106, .14);
}

.cap6-ai-toggle::before {
  content: none;
}

.cap6-ai-agent {
  border-radius: 8px;
}

.cap6-ai-header,
.cap6-ai-modes button,
.cap6-ai-message,
.cap6-ai-form button {
  border-radius: 7px;
}

@media (max-width: 1040px) {
  .course-sidebar {
    grid-template-columns: 1fr auto;
  }

  .side-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: .25rem;
  }

  .cap6-hero .hero-shell {
    grid-template-columns: 1fr;
  }

  .cap6-hero-diagram {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  .course-sidebar {
    padding-inline: 1rem;
  }

  .brand-copy small {
    display: none;
  }

  .side-link {
    flex: 0 0 auto;
  }

  .cap6-hero h1 {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }

  .cap6-hero-diagram {
    display: none;
  }

  .module-shell {
    width: min(100% - 1rem, 1400px);
  }
}

/* Placas: comparador limpio de casos */
.plates-comparator {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.15rem, 2vw, 1.6rem);
}

.plates-comparator::before {
  background: #12366a;
}

.plates-head {
  max-width: 820px;
}

.plates-head h3 {
  margin-bottom: .35rem;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.plates-head p {
  margin: 0;
  line-height: 1.65;
}

.plates-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 190px)) auto minmax(260px, 1fr);
  gap: .8rem;
  align-items: end;
  padding: .85rem;
  border: 1px solid rgba(18, 54, 106, .12);
  border-radius: 8px;
  background: #f8fbff;
}

.plates-config label {
  display: block;
  margin-bottom: .28rem;
  color: #23324a;
  font-size: .84rem;
  font-weight: 800;
}

.plates-config input {
  min-height: 42px;
}

.plates-config #pl_calc {
  min-height: 42px;
  white-space: nowrap;
}

.plates-presets {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plates-presets button,
.plate-samples button,
.plate-detail-toggle {
  min-height: 38px;
  box-shadow: none;
}

.plates-cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.plate-case {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  padding: clamp(1rem, 1.6vw, 1.35rem);
  border: 1px solid rgba(18, 54, 106, .14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .07);
}

.plate-case-b {
  border-color: rgba(15, 94, 99, .18);
}

.plate-case-head {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .7rem;
  align-items: center;
  margin-bottom: 1.4rem;
}

.plate-case-head h4 {
  margin: 0;
  color: #061a38;
  font-size: clamp(1.02rem, 1.25vw, 1.18rem);
}

.plate-case-head p {
  flex-basis: 100%;
  margin: 0;
  line-height: 1.55;
}

.plate-badge,
.plate-subbadge {
  width: fit-content;
  border-radius: 6px;
  font-size: .74rem;
  font-weight: 900;
}

.plate-badge {
  padding: .32rem .72rem;
  color: #12366a;
  background: #e8eef7;
  letter-spacing: .02em;
}

.plate-case-b .plate-badge {
  background: #155e63;
}

.plate-subbadge {
  padding: .24rem .5rem;
  color: #12366a;
  background: #e8eef7;
}

.plate-case-b .plate-subbadge {
  color: #155e63;
  background: #e7f2f1;
}

.plate-factor-block {
  display: grid;
  gap: .55rem;
  margin-top: .25rem;
}

.plate-factor-block h5 {
  margin: 0;
  color: #23324a;
  font-size: .88rem;
}

.plate-factors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: .5rem;
}

.plate-factor {
  display: grid;
  gap: .12rem;
  min-height: 64px;
  place-items: center;
  padding: .55rem .45rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  color: #12366a;
  background: linear-gradient(180deg, #f8fbff, #eef4fb);
}

.plate-case-b .plate-factor {
  border-color: rgba(21, 94, 99, .17);
  color: #155e63;
  background: linear-gradient(180deg, #f9fdfd, #edf7f6);
}

.plate-factor small {
  color: #64748b;
  font-size: .72rem;
  font-weight: 850;
}

.plate-factor strong {
  color: inherit;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1;
}

.plate-divider {
  display: grid;
  place-items: center;
  height: 24px;
  color: #8a98ad;
  font-weight: 900;
}

.plate-result-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  padding: .9rem 1rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  background: #f8fbff;
}

.plate-case-b .plate-result-box {
  border-color: rgba(21, 94, 99, .17);
  background: #f8fcfc;
}

.plate-result-box span {
  display: block;
  margin-bottom: .25rem;
  color: #23324a;
  font-weight: 900;
}

.plate-result-box .formula-line {
  margin: 0;
  color: #52617b;
  font-size: .92rem;
}

.plate-result-box strong {
  color: #061a38;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1;
  white-space: nowrap;
}

.plate-samples {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: center;
  margin-top: auto;
}

.plate-sample-list {
  display: flex;
  min-width: 0;
  min-height: 38px;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}

.plate-sample-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .25rem .55rem;
  border: 1px solid rgba(18, 54, 106, .14);
  border-radius: 7px;
  color: #12366a;
  background: #eef4fb;
  font-weight: 850;
}

.plate-case-b .plate-sample-chip {
  border-color: rgba(21, 94, 99, .18);
  color: #155e63;
  background: #edf7f6;
}

.plate-detail-toggle {
  align-self: flex-start;
  margin-top: .75rem;
}

.plate-detail {
  margin-top: .85rem;
}

.plate-detail table {
  margin: 0;
  box-shadow: none;
}

@media (max-width: 980px) {
  .plates-config,
  .plates-cases {
    grid-template-columns: 1fr;
  }

  .plates-presets {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .plate-result-box,
  .plate-samples {
    grid-template-columns: 1fr;
  }

  .plate-factor-block {
    grid-template-columns: 1fr;
    row-gap: .65rem;
  }

  .plates-config button,
  .plate-samples button,
  .plate-detail-toggle {
    width: 100%;
  }
}

/* Ajuste final: placas en una sola gama azul y resultado bajo demanda */
.plate-case:not(.has-result) .plate-factor-block,
.plate-case:not(.has-result) .plate-divider,
.plate-case:not(.has-result) .plate-result-box,
.plate-case:not(.has-result) .plate-samples,
.plate-case:not(.has-result) .plate-detail-toggle,
.plate-case:not(.has-result) .plate-detail {
  display: none;
}

.plate-case-b,
.plate-case-b .plate-result-box,
.plate-case-b .plate-factor,
.plate-case-b .plate-sample-chip {
  border-color: rgba(30, 69, 131, .18);
}

.plate-case-b .plate-badge {
  color: #fff;
  background: #1e4583;
}

.plate-case-b .plate-subbadge,
.plate-case-b .plate-factor,
.plate-case-b .plate-sample-chip {
  color: #1e4583;
}

.plate-case-b .plate-subbadge,
.plate-case-b .plate-sample-chip {
  background: #edf3fb;
}

.plate-case-b .plate-factor,
.plate-case-b .plate-result-box {
  background: linear-gradient(180deg, #f8fbff, #eef4fb);
}

.plate-factor-block {
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  column-gap: 1.35rem;
  padding: .95rem .2rem;
}

.plate-factor-block + .plate-divider {
  position: relative;
  margin: .1rem 0;
  border-top: 1px dashed rgba(18, 54, 106, .16);
}

.plate-factor-block h5 {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: .48rem;
  align-items: center;
  color: #23324a;
  font-family: var(--font-main);
  font-size: .78rem;
  line-height: 1.22;
}

.plate-factor-block h5::before {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #12366a;
  background: #e8eef7;
  font-family: var(--font-main);
  font-size: .82rem;
  font-weight: 900;
}

.plate-factor-letters h5::before {
  content: "A";
}

.plate-case-b .plate-factor-letters h5::before {
  content: "B";
}

.plate-factor-digits h5::before {
  content: "123";
  font-size: .68rem;
  line-height: .9;
}

.plate-factors {
  display: flex;
  gap: 1.45rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.plate-factor {
  position: relative;
  min-width: 94px;
  min-height: 54px;
  padding: .48rem .75rem .42rem;
  background: #fff;
}

.plate-factor:not(:last-child)::after {
  content: "x";
  position: absolute;
  top: 50%;
  right: -1rem;
  transform: translate(50%, -50%);
  color: #12366a;
  font-family: var(--font-main);
  font-size: .82rem;
  font-weight: 800;
}

.plate-factor small,
.plate-factor strong,
.plate-result-box span,
.plate-result-box .formula-line,
.plate-result-box strong,
.plate-sample-chip {
  font-family: var(--font-main);
}

.plate-factor small {
  font-size: .68rem;
}

.plate-factor strong {
  font-size: 1.08rem;
  font-weight: 900;
}

.plate-divider {
  height: 10px;
  color: #12366a;
}

.plate-divider span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e8eef7;
  transform: translateY(-13px);
}

.plate-result-box {
  margin: 1.15rem 0 .85rem;
  background: #f8fbff;
}

.plate-result-box strong {
  color: #061a38;
  font-size: clamp(1.25rem, 2vw, 1.78rem);
  font-weight: 900;
}

.plate-result-box .formula-line {
  color: #40506b;
  font-size: .86rem;
}

.plate-samples {
  padding-top: .75rem;
  border-top: 1px solid rgba(18, 54, 106, .1);
}

.plate-sample-list {
  justify-content: center;
}

.plate-detail-toggle {
  align-self: center;
  margin-top: .9rem;
  padding-inline: 1.1rem;
}

@media (max-width: 640px) {
  .plate-factor-block {
    grid-template-columns: 1fr;
    row-gap: .65rem;
  }
}

/* Tipografia del comparador alineada con el laboratorio principal */
.plates-head h3 {
  margin-bottom: .55rem;
  color: #061a38;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.55vw, 1.42rem);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
}

.plates-head p {
  margin: 0;
  color: var(--color-text-soft);
  font-family: var(--font-main);
  font-size: .93rem;
  line-height: 1.55;
}

.plate-case-head h4 {
  color: #061a38;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.28vw, 1.2rem);
  font-weight: 650;
  line-height: 1.18;
}

.plate-case-head p {
  color: #40506b;
  font-family: var(--font-main);
  font-size: .92rem;
}

.plate-badge,
.plate-subbadge {
  font-family: var(--font-main);
  font-size: .68rem;
  font-weight: 800;
}

.plate-badge {
  padding: .28rem .66rem;
}

.plate-subbadge {
  padding: .22rem .48rem;
}

.plate-factor-block h5 {
  font-family: var(--font-main);
  font-size: .8rem;
  font-weight: 800;
}

.plate-result-box span {
  font-family: var(--font-main);
  font-size: .88rem;
  font-weight: 800;
}

/* Experiencia interactiva de placas */
.plates-comparator {
  border: 1px solid rgba(18, 54, 106, .14);
  background: #fff;
}

.plates-config {
  align-items: end;
  padding: .9rem;
  border: 1px solid rgba(18, 54, 106, .12);
  border-radius: 8px;
  background: #f7fbff;
}

.plates-presets .is-active {
  background: #e8f1ff;
  border-color: rgba(18, 54, 106, .28);
  color: #12366a;
}

.plates-cases {
  align-items: stretch;
}

.plate-case {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  border-color: rgba(18, 54, 106, .14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(18, 54, 106, .07);
  transition: transform .18s ease, box-shadow .18s ease;
}

.plate-case:hover {
  transform: translateY(-2px) scale(1.005);
  box-shadow: 0 18px 38px rgba(18, 54, 106, .1);
}

.plate-case-b,
.plate-case-b .plate-result-box,
.plate-case-b .plate-factor,
.plate-case-b .plate-sample-chip {
  border-color: rgba(30, 86, 142, .2);
}

.plate-case-head {
  align-items: flex-start;
  gap: .9rem;
  padding-bottom: .35rem;
}

.plate-case-head > div {
  display: grid;
  gap: .42rem;
}

.plate-case-head h4 {
  margin-top: .12rem;
}

.plate-case-head p {
  margin-top: .12rem;
  max-width: 34rem;
  line-height: 1.65;
}

.plate-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}

.plate-section-head h5,
.plate-factor-block h5 {
  margin: 0;
  color: #12366a;
  font-size: .9rem;
  white-space: nowrap;
}

.plate-builder,
.plate-factor-block,
.plate-samples {
  padding: .85rem;
  border: 1px solid rgba(18, 54, 106, .11);
  border-radius: 8px;
  background: #fbfdff;
}

.plate-slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.plate-slot {
  display: grid;
  min-width: 3.2rem;
  min-height: 3.4rem;
  place-items: center;
  padding: .45rem .5rem;
  border: 1px solid rgba(18, 54, 106, .16);
  border-radius: 8px;
  background: #fff;
  color: #12366a;
  box-shadow: 0 8px 18px rgba(18, 54, 106, .06);
}

.plate-slot strong {
  font-size: 1.05rem;
  line-height: 1;
}

.plate-slot small {
  color: #587190;
  font-size: .66rem;
}

.plate-slot.is-active,
.plate-factor.is-active {
  border-color: #12366a;
  background: #e8f1ff;
}

.plate-slot-separator {
  color: #587190;
  font-weight: 900;
}

.plate-factor-block {
  display: grid;
  grid-template-columns: 1fr;
}

.plate-factors {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .55rem;
}

.plate-factor {
  display: grid;
  min-width: 4.2rem;
  gap: .15rem;
  padding: .55rem .62rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #12366a;
}

.plate-factor strong {
  font-size: 1.05rem;
}

.plate-factor small {
  color: #587190;
  font-size: .68rem;
}

.plate-result-box {
  border-color: rgba(18, 54, 106, .14);
  background: #f7fbff;
}

.plate-result-box .formula-line {
  color: #08214a;
}

.plate-result-box strong {
  color: #12366a;
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-align: right;
}

.plate-samples {
  grid-template-columns: 1fr;
}

.plate-sample-list {
  min-height: 2rem;
}

.plate-detail[hidden] {
  display: none;
}

.plate-detail {
  padding: .75rem;
  border: 1px solid rgba(18, 54, 106, .11);
  border-radius: 8px;
  background: #fbfdff;
}

.plates-note {
  margin: 1rem 0 0;
  padding: .75rem .85rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 8px;
  background: #eef5ff;
  color: #17385f;
  font-size: .9rem;
}

@media (max-width: 760px) {
  .plate-section-head,
  .plate-result-box {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .plate-result-box strong {
    text-align: left;
  }
}

#bits-ej4 .bit-toggle,
#bits-ej4 .sample-tile {
  background: #fff;
  box-shadow: 0 8px 18px rgba(18, 54, 106, .06);
  color: #12366a;
}

#bits-ej4 .bit-toggle.one {
  background: linear-gradient(135deg, #1e4583, #12366a);
  color: #fff;
}

#bits-ej4 .button-row .secondary {
  background: #fff;
  color: #12366a;
}

#fn-ej5 .fn-mini-card {
  background: #fff;
  color: #12366a;
  box-shadow: none;
}

#fn-ej5 .fn-mini-card:hover {
  background: #f7fbff;
}

#fn-ej5 .fn-mini-card.is-active {
  background: #eef5ff;
}

/* ── Botones de acción en comparador de placas ───────────────────
   Los botones secundarios deben distinguirse de los chips de dato
   (.plate-factor, .plate-slot) que comparten fondo blanco/borde.
   Usamos specificity element+clase para ganar a button.secondary.
   ─────────────────────────────────────────────────────────────── */

/* "Simular construcción" y "Crear muestra A / B":
   ghost-primary: borde azul sólido 2px, texto azul, fondo blanco.
   En hover: relleno muy sutil para confirmar que es clicable.      */
button.plate-simulate,
.plate-samples button {
  color: var(--color-primary-strong);
  background: #fff;
  border: 2px solid var(--color-primary-strong);
  box-shadow: none;
  font-weight: 850;
}

button.plate-simulate:hover,
.plate-samples button:hover {
  background: #f0f6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .18);
  filter: none;
}

/* "Ver detalle paso a paso": acción de revelación, no CTA.         */
button.plate-detail-toggle {
  color: #52617b;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: none;
  font-size: .84rem;
  font-weight: 700;
}

button.plate-detail-toggle:hover {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, .38);
  background: #f8fbff;
  transform: none;
  box-shadow: none;
  filter: none;
}

/* Chips de dato: cursor default deja claro que no son clicables   */
.plate-factor,
.plate-slot {
  cursor: default;
  user-select: none;
}

/* Slot activo durante simulación: anillo de foco visible           */
.plate-slot.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
  color: var(--color-primary-strong);
}

/* ══════════════════════════════════════════════════════════════════
   EXERCISE SHELL SYSTEM — cap6 s-61
   ══════════════════════════════════════════════════════════════════ */

/* ── Encabezado de capítulo ────────────────────────────────────── */
.ex-ch-head {
  padding: 1.6rem 0 .9rem;
}
.ex-ch-kicker {
  display: inline-block;
  margin-bottom: .45rem;
  color: var(--color-primary);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .02em;
}
.ex-ch-title {
  margin: 0 0 .3rem;
  color: #061a38;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0;
}
.ex-ch-sub {
  margin: 0;
  color: var(--color-text-soft);
  font-size: .93rem;
  line-height: 1.55;
}

/* ── Mini índice horizontal ────────────────────────────────────── */
.ex-ch-nav {
  position: relative;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.ex-ch-nav-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0;
}
.ex-ch-nav-scroll::-webkit-scrollbar { display: none; }

.ex-nav-item {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  position: relative;
  padding: .7rem 1.05rem .8rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast);
  min-height: unset;
}
.ex-nav-item::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 1.05rem;
  right: 1.05rem;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
  border-radius: 2px 2px 0 0;
}
.ex-nav-item:hover {
  color: var(--color-primary);
  background: transparent;
  transform: none;
  filter: none;
  box-shadow: none;
}
.ex-nav-item.is-active {
  color: var(--color-primary-strong);
  font-weight: 850;
}
.ex-nav-item.is-active::after {
  transform: scaleX(1);
}
.ex-nav-item.is-locked {
  color: #b0bec8;
  cursor: default;
  opacity: .7;
  pointer-events: none;
}
.ex-nav-num {
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .02em;
  opacity: .7;
}
.ex-nav-item.is-active .ex-nav-num { opacity: 1; }
.ex-nav-lock-icon {
  opacity: .55;
  flex-shrink: 0;
}

/* ── Exercise Shell ────────────────────────────────────────────── */
.ex-shell {
  margin-bottom: .75rem;
  border: 1px solid rgba(18, 54, 106, .13);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, .05);
  transition: box-shadow .2s ease, border-color .2s ease, transform .18s ease;
}
.ex-shell.is-expanded {
  border-color: rgba(37, 99, 235, .25);
  border-top: 3px solid var(--color-primary);
  box-shadow: 0 6px 28px rgba(37, 99, 235, .09);
}
.ex-shell.is-collapsed {
  cursor: pointer;
}
.ex-shell.is-collapsed:hover {
  border-color: rgba(37, 99, 235, .22);
  box-shadow: 0 4px 20px rgba(37, 99, 235, .08);
  transform: translateY(-1px);
}

/* ── Shell header ──────────────────────────────────────────────── */
.ex-shell-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  cursor: pointer;
  user-select: none;
  border-radius: 13px;
}
.ex-shell.is-expanded .ex-shell-head {
  border-radius: 13px 13px 0 0;
  border-bottom: 1px solid rgba(18, 54, 106, .09);
  padding-bottom: .9rem;
}
.ex-shell-head:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  border-radius: 13px;
}
.ex-shell-head-l {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  min-width: 0;
}
.ex-shell-head-r {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-shrink: 0;
}

/* Icon box */
.ex-icon-box {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: #eef4ff;
  color: var(--color-primary-strong);
  flex-shrink: 0;
  margin-top: .1rem;
}
.ex-shell.is-expanded .ex-icon-box {
  background: var(--color-primary-soft);
}

/* Meta */
.ex-shell-meta { min-width: 0; }

.ex-num-badge {
  display: inline-block;
  margin-bottom: .28rem;
  padding: .18rem .55rem;
  border-radius: 6px;
  background: #eef4ff;
  color: var(--color-primary-strong);
  font-family: var(--font-accent);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.ex-shell.is-expanded .ex-num-badge {
  background: rgba(37, 99, 235, .12);
}
.ex-shell-title {
  margin: 0 0 .3rem;
  color: #061a38;
  font-family: var(--font-display);
  font-size: clamp(.96rem, 1.15vw, 1.08rem);
  font-weight: 650;
  line-height: 1.18;
}
.ex-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .3rem;
}
.ex-chip {
  padding: .16rem .5rem;
  border-radius: 999px;
  background: #f1f5ff;
  border: 1px solid rgba(37, 99, 235, .15);
  color: #3a5080;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.ex-chip--level {
  background: #f0faf8;
  border-color: rgba(16, 130, 115, .2);
  color: #156b60;
}
.ex-shell-sub {
  margin: 0;
  color: #52617b;
  font-size: .83rem;
  line-height: 1.45;
}
.ex-shell.is-collapsed .ex-shell-sub {
  display: none;
}
.ex-shell.is-expanded .ex-shell-title,
.ex-chips {
  display: none;
}

/* Status badge */
.ex-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #f8fafc;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}
.ex-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b0bec8;
  flex-shrink: 0;
  transition: background .2s ease;
}
.ex-status-label {
  color: #64748b;
  transition: color .2s ease;
}

/* Status: pending (default) */
.ex-shell[data-ex-status="pending"] .ex-status-dot   { background: #b0bec8; }
.ex-shell[data-ex-status="pending"] .ex-status-label { color: #64748b; }

/* Status: progress */
.ex-shell[data-ex-status="progress"] .ex-status-badge  { border-color: rgba(37,99,235,.3); background: #eef4ff; }
.ex-shell[data-ex-status="progress"] .ex-status-dot    { background: var(--color-primary); }
.ex-shell[data-ex-status="progress"] .ex-status-label  { color: var(--color-primary); }

/* Status: done */
.ex-shell[data-ex-status="done"] .ex-status-badge  { border-color: rgba(37,99,235,.28); background: #eef4ff; }
.ex-shell[data-ex-status="done"] .ex-status-dot    { background: var(--color-primary-strong); }
.ex-shell[data-ex-status="done"] .ex-status-label  { color: var(--color-primary-strong); font-weight: 900; }

/* Toggle button */
.ex-toggle-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: unset;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--color-border);
  color: #52617b;
  box-shadow: none;
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.ex-toggle-btn:hover {
  background: #f0f6ff;
  border-color: rgba(37,99,235,.28);
  transform: none;
  box-shadow: none;
  filter: none;
}
.ex-chevron {
  transition: transform .22s ease;
  flex-shrink: 0;
}
/* Expanded = chevron up (rotated 180°) */
.ex-shell.is-expanded .ex-chevron { transform: rotate(180deg); }
.ex-shell.is-collapsed .ex-chevron { transform: rotate(0deg); }

/* ── Shell body ────────────────────────────────────────────────── */
.ex-shell-body {
  padding: 1rem 1.2rem .5rem;
}
/* Remove the gradient top-bar from section-blocks inside a shell
   (the shell itself provides the top accent via border-top)        */
.ex-shell-body .section-block::before { display: none; }
.ex-shell-body > .section-block:first-child { margin-top: 0; }
.ex-shell-body > .section-block:last-child  { margin-bottom: 0; }

/* ── Shell footer ──────────────────────────────────────────────── */
.ex-shell-foot {
  padding: .65rem 1.2rem;
  border-top: 1px solid rgba(18, 54, 106, .08);
  background: #fafcff;
  border-radius: 0 0 13px 13px;
  text-align: center;
}
.ex-next-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: unset;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--color-border);
  color: #52617b;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: none;
}
.ex-next-btn:hover {
  color: var(--color-primary);
  border-color: rgba(37,99,235,.38);
  background: #f0f6ff;
  transform: none;
  box-shadow: none;
  filter: none;
}
.ex-next-btn svg { transition: transform .2s ease; }
.ex-next-btn:hover svg { transform: translateY(2px); }

/* ── Separador entre ejercicios ────────────────────────────────── */
.ex-separator {
  margin: 1.1rem 0;
}
.ex-sep-line {
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(37,99,235,.18) 0,
    rgba(37,99,235,.18) 5px,
    transparent 5px,
    transparent 12px
  );
}
.ex-sep-label { display: none; }

/* ── Nota final ────────────────────────────────────────────────── */
.ex-tip-note {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin: 1.5rem 0 .5rem;
  padding: .85rem 1.1rem;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 10px;
  background: #f4f8ff;
  color: #3a5080;
}
.ex-tip-note svg { flex-shrink: 0; margin-top: .1rem; color: var(--color-primary); }
.ex-tip-note p { margin: 0; font-size: .86rem; line-height: 1.5; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .ex-ch-nav-scroll { gap: 0; }
  .ex-nav-item { padding-inline: .75rem; }
  .ex-shell-head {
    grid-template-columns: 1fr;
    gap: .65rem;
  }
  .ex-shell-head-r {
    justify-content: space-between;
  }
  .ex-shell.is-collapsed .ex-shell-sub { display: none; }
}
@media (max-width: 520px) {
  .ex-chips { display: none; }
  .ex-shell-head { padding: .85rem 1rem; }
  .ex-shell-body { padding: .85rem 1rem .4rem; }
  .ex-shell-foot { padding: .55rem 1rem; }
  .ex-sep-label { display: none; }
  .ex-separator { margin: .75rem 0; }
}

/* Minimal Seeing Theory style for Regla de la Suma */
.rs-lab-card--minimal {
  display: grid;
  gap: 1.6rem;
  padding: clamp(1.25rem, 2.6vw, 2rem);
  border: 1px solid #e2e8f0;
  border-top: 2px solid #0b1f4d;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .035);
}

.rs-min-head {
  max-width: 640px;
}

.rs-min-head span,
.rs-lab-card--minimal h3,
.rs-result-row span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.rs-min-head h2 {
  margin: .38rem 0 .25rem;
  color: #0b1f4d;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  letter-spacing: 0;
}

.rs-min-head p,
.rs-idea-line p,
.rs-selection-note,
.rs-hidden-note p,
.rs-result-row p,
.rs-step-item p,
.rs-feedback p {
  margin: 0;
  color: #334155;
  line-height: 1.6;
}

.rs-min-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.rs-min-theory,
.rs-config--minimal,
.rs-result-panel {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.rs-idea-line {
  padding: .2rem 0 .2rem 1rem;
  border-left: 3px solid #0b1f4d;
}

.rs-latex-main {
  margin: .35rem 0 .45rem;
  color: #0b1f4d;
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  line-height: 1.1;
}

.rs-routes-min {
  display: grid;
  gap: .7rem;
}

.rs-route-root {
  justify-self: start;
  padding: .38rem .65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0b1f4d;
  font-weight: 850;
}

.rs-route-branches {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
  padding-left: .9rem;
  border-left: 1px solid #dbeafe;
}

.rs-route-node {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: .48rem .65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #0b1f4d;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.rs-route-node strong {
  font-size: .95rem;
}

.rs-route-node small {
  color: #64748b;
  font-size: .84rem;
  font-weight: 700;
}

.rs-route-node:hover,
.rs-route-node.is-selected,
.rs-route-node.is-suggested {
  border-color: #dbeafe;
  background: #eff6ff;
  transform: translateY(-1px);
}

.rs-config--minimal {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rs-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}

.rs-input-grid label {
  display: block;
  margin-bottom: .28rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 850;
}

.rs-input-grid input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0b1f4d;
  box-shadow: none;
}

.rs-action-row,
.rs-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.rs-action-row button {
  flex: 1 1 150px;
}

.rs-lab-card--minimal .lab-calc-btn {
  background: #0b1f4d;
  box-shadow: none;
}

.rs-lab-card--minimal button.secondary {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0b1f4d;
  box-shadow: none;
}

.rs-validation {
  min-height: 1rem;
  margin: -.55rem 0 0;
  color: #64748b;
  font-size: .82rem;
}

.rs-suggestion-line {
  min-height: 1.55rem;
  margin: -.25rem 0 0;
  color: #1d4ed8;
  font-size: .9rem;
  font-weight: 850;
}

.rs-hidden-note {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  padding: .7rem .8rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
}

.rs-hidden-note[hidden],
.rs-result-panel[hidden] {
  display: none;
}

.rs-result-panel {
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.rs-result-min,
.rs-construction-min,
.rs-distribution,
.rs-quiz-min {
  display: grid;
  gap: .75rem;
}

.rs-result-row {
  display: grid;
  grid-template-columns: .45fr .75fr 1fr;
  gap: 1rem;
}

.rs-result-row > div {
  padding: 0;
  border: 0;
  background: transparent;
}

.rs-result-row strong {
  display: block;
  margin-top: .25rem;
  color: #0b1f4d;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1;
}

#rs_proj_formula,
.rs-final-latex {
  margin: .25rem 0 0;
  color: #0b1f4d;
  font-size: 1.08rem;
  font-weight: 850;
}

.rs-dist-row {
  display: grid;
  grid-template-columns: minmax(145px, .36fr) minmax(0, 1fr);
  gap: .8rem;
  align-items: center;
}

.rs-dist-label {
  display: flex;
  gap: .45rem;
  align-items: baseline;
}

.rs-dist-label strong {
  color: #0b1f4d;
}

.rs-dist-label span {
  color: #64748b;
  font-size: .88rem;
}

.rs-dist-bar {
  overflow: hidden;
  height: 3px;
  border-radius: 999px;
  background: #eff6ff;
}

.rs-dist-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1d4ed8;
}

.rs-feedback {
  min-height: 1.6rem;
}

.rs-feedback p {
  color: #0b1f4d;
  font-weight: 750;
}

@media (max-width: 900px) {
  .rs-min-layout,
  .rs-result-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .rs-input-grid,
  .rs-dist-row {
    grid-template-columns: 1fr;
  }

  .rs-action-row button,
  .rs-choice-row button {
    flex-basis: 100%;
  }
}

/* Resultado didáctico para Regla de la Suma */
#rs_proj_result.rs-result-shell {
  margin: 1.2rem 0;
}

#rs_proj_result .rs-result-section {
  margin-top: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
}

#rs_proj_result .rs-result-section[hidden],
#rs_proj_result .rs-result-message[hidden] {
  display: none;
}

#rs_proj_result.has-result .rs-result-section {
  display: grid;
}

#rs_proj_result .rs-result-section {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.1rem, 2vw, 1.35rem);
}

#rs_proj_result .rs-result-section h3,
#rs_proj_result .rs-result-subsection h4 {
  margin: 0;
  color: #0b1f4d;
  letter-spacing: 0;
}

#rs_proj_result .rs-result-section h3 {
  font-size: 1.05rem;
}

#rs_proj_result .rs-result-subsection h4 {
  font-size: .9rem;
}

#rs_proj_result .rs-result-cards {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 1rem;
}

#rs_proj_result .rs-result-card,
#rs_proj_result .rs-suggestion-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #d6e4f5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}

#rs_proj_result .rs-result-card--soft {
  background: #eff6ff;
}

#rs_proj_result .rs-result-card span,
#rs_proj_result .rs-suggestion-card span {
  display: block;
  margin-bottom: .35rem;
  color: #475569;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .02em;
}

#rs_proj_result .rs-result-card strong {
  display: block;
  color: #1d4ed8;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
}

#rs_proj_result .rs-result-card small,
#rs_proj_result .rs-result-card p,
#rs_proj_result .rs-suggestion-card p,
#rs_proj_result .rs-suggestion-empty {
  margin: .35rem 0 0;
  color: #475569;
  line-height: 1.55;
}

#rs_proj_result #rs_proj_formula {
  color: #0b1f4d;
  font-size: 1.08rem;
  font-weight: 850;
}

#rs_proj_result .rs-result-message {
  padding: .8rem .9rem;
  border: 1px solid #d6e4f5;
  border-radius: 12px;
  background: #f8fafc;
  color: #0b1f4d;
  font-weight: 750;
}

#rs_proj_result .rs-result-subsection {
  display: grid;
  gap: .65rem;
  padding-top: .6rem;
}

#rs_proj_result .rs-build-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}

#rs_proj_result .rs-build-chip {
  display: grid;
  gap: .1rem;
  min-width: 88px;
  padding: .58rem .7rem;
  border: 1px solid #d6e4f5;
  border-radius: 12px;
  background: #fff;
  color: #0b1f4d;
}

#rs_proj_result .rs-build-chip--total {
  background: #eff6ff;
}

#rs_proj_result .rs-build-chip span,
#rs_proj_result .rs-build-chip small {
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
}

#rs_proj_result .rs-build-chip strong {
  color: #1d4ed8;
  font-size: 1.05rem;
  line-height: 1;
}

#rs_proj_result .rs-build-op {
  color: #64748b;
  font-weight: 900;
}

#rs_proj_result .rs-distribution-list {
  display: grid;
  gap: .75rem;
}

#rs_proj_result .rs-dist-item {
  display: grid;
  gap: .35rem;
}

#rs_proj_result .rs-dist-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  color: #475569;
}

#rs_proj_result .rs-dist-head span {
  color: #334155;
  font-weight: 750;
}

#rs_proj_result .rs-dist-head strong {
  color: #0b1f4d;
  font-size: .86rem;
}

#rs_proj_result .rs-dist-track {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: #eaf2ff;
}

#rs_proj_result .rs-dist-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1d4ed8;
  transition: width .42s ease;
}

#rs_proj_result .rs-suggestion-empty {
  padding: .85rem .95rem;
  border: 1px dashed #d6e4f5;
  border-radius: 12px;
  background: #f8fafc;
}

#rs_proj_result .rs-suggestion-card strong {
  color: #1d4ed8;
  font-size: 1.05rem;
}

#rs_proj_result .rs-rule-question {
  display: grid;
  grid-template-columns: 48px minmax(220px, 1fr) minmax(260px, auto);
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
}

#rs_proj_result .rs-rule-question[hidden],
#rs_proj_result .rs-rule-feedback[hidden] {
  display: none;
}

#rs_proj_result .rs-rule-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #d6e4f5;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.35rem;
  font-weight: 900;
}

#rs_proj_result .rs-rule-copy h4 {
  margin: 0 0 .25rem;
  color: #0b1f4d;
  font-size: 1.05rem;
  letter-spacing: 0;
}

#rs_proj_result .rs-rule-copy p {
  margin: 0;
  color: #0b1f4d;
  line-height: 1.45;
}

#rs_proj_result .rs-rule-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

#rs_proj_result .rs-rule-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 132px;
  min-height: 52px;
  padding: .75rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
  color: #0b1f4d;
  font-weight: 850;
}

#rs_proj_result .rs-rule-btn.is-selected {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 1px #1d4ed8, 0 10px 22px rgba(29, 78, 216, .12);
}

#rs_proj_result .rs-rule-btn span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: .78rem;
}

#rs_proj_result .rs-rule-btn:not(.is-selected) span {
  display: none;
}

#rs_proj_result .rs-rule-feedback {
  grid-column: 2 / -1;
  justify-self: center;
  margin: -.25rem 0 0;
  font-weight: 750;
  line-height: 1.4;
}

#rs_proj_result .rs-rule-feedback.is-correct {
  color: #166534;
}

#rs_proj_result .rs-rule-feedback.is-soft {
  color: #475569;
}

@media (max-width: 920px) {
  #rs_proj_result .rs-result-cards {
    grid-template-columns: 1fr;
  }

  #rs_proj_result .rs-rule-question {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  #rs_proj_result .rs-rule-actions,
  #rs_proj_result .rs-rule-feedback {
    grid-column: 1 / -1;
  }

  #rs_proj_result .rs-rule-actions {
    justify-content: stretch;
  }

  #rs_proj_result .rs-rule-btn {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  #rs_proj_result .rs-dist-head {
    display: grid;
  }

  #rs_proj_result .rs-rule-actions {
    flex-direction: column;
  }
}

/* ── Lab contraseñas (Regla de la Suma · Ejercicio 02) ── */
.rs-phone-card {
  border: 1px solid #d6e4f5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15,23,42,.05);
  overflow: hidden;
}
.rs-phone-card.is-shaking {
  animation: rsShake 220ms ease;
}

@keyframes rsShake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}

.rs-phone-shell {
  padding: .75rem;
}
.rs-phone-top {
  width: 60px;
  height: 4px;
  margin: .1rem auto .6rem;
  border-radius: 999px;
  background: #d6e4f5;
}
.rs-phone-screen {
  display: grid;
  gap: .6rem;
  padding: .9rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}
.rs-phone-badge {
  color: #64748b;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .02em;
}
.rs-phone-screen h4 {
  margin: 0;
  color: #0b1f4d;
  font-size: .92rem;
  letter-spacing: 0;
}
.rs-phone-screen input {
  width: 100%;
  border: 1px solid #d6e4f5;
  border-radius: 9px;
  background: #fff;
  color: #0b1f4d;
  box-shadow: none;
  font-size: .93rem;
}
.rs-pass-length {
  color: #64748b;
  font-size: .83rem;
}

.rs-pass-checks {
  display: grid;
  gap: .35rem;
}
.rs-pass-checks span {
  display: flex;
  align-items: center;
  gap: .42rem;
  color: #475569;
  font-size: .83rem;
}
.rs-pass-checks span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
}
.rs-pass-checks span.is-ok::before  { background: #1d4ed8; }
.rs-pass-checks span.is-bad::before { background: #94a3b8; }
.rs-pass-checks span.is-neutral::before { background: #cbd5e1; }

.rs-pass-feedback {
  margin: 0;
  padding: .6rem .7rem;
  border-radius: 9px;
  background: #eff6ff;
  color: #0b1f4d;
  font-size: .84rem;
  line-height: 1.45;
}
.rs-pass-feedback.is-valid   { background: #f0fdf4; color: #15803d; }
.rs-pass-feedback.is-invalid { background: #fef2f2; color: #dc2626; }
.rs-pass-feedback.is-empty   { background: #f8fafc; color: #64748b; }

/* Classification panel — right of phone */
.rs-pass-classification-panel {
  display: grid;
  gap: .65rem;
  padding: .9rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  align-self: start;
}
.rs-pass-classif-header h4 {
  margin: 0 0 .2rem;
  color: #0b1f4d;
  font-size: .92rem;
  letter-spacing: 0;
}
.rs-pass-classif-sub {
  margin: 0;
  color: #64748b;
  font-size: .8rem;
}
.rs-pass-classif-rows {
  display: grid;
  gap: .45rem;
}
.rs-classif-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem .55rem;
  padding: .5rem .6rem;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}
.rs-classif-label {
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
  min-width: 6rem;
}
.rs-classif-value {
  color: #0b1f4d;
  font-size: .9rem;
  font-weight: 700;
}
.rs-classif-value.rs-classif-valid   { color: #16a34a; }
.rs-classif-value.rs-classif-invalid { color: #dc2626; }
.rs-classif-aux {
  color: #94a3b8;
  font-size: .78rem;
  flex-basis: 100%;
}
.rs-status-badge {
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.rs-status-badge--valid   { background: #f0fdf4; color: #16a34a; }
.rs-status-badge--invalid { background: #fef2f2; color: #dc2626; }
.rs-status-badge--neutral { background: #f1f5f9; color: #64748b; }
.rs-pass-classif-note {
  margin: 0;
  color: #94a3b8;
  font-size: .78rem;
  line-height: 1.5;
}

/* Scenario card (inside lab-left) */
.rs-pass-scenario {
  display: grid;
  gap: .65rem;
  padding: .85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.rs-scenario-info {
  display: grid;
  gap: .32rem;
}
.rs-scenario-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .38rem .6rem;
  border-radius: 8px;
  background: #f8fafc;
  font-size: .85rem;
}
.rs-scenario-row span { color: #64748b; }
.rs-scenario-val {
  color: #0b1f4d;
  font-weight: 700;
}
.rs-scenario-password {
  font-family: ui-monospace, 'Courier New', monospace;
  letter-spacing: .06em;
}
.rs-scenario-symbols {
  display: grid;
  gap: .35rem;
}
.rs-scenario-symbols label {
  color: #475569;
  font-size: .84rem;
  font-weight: 700;
}
.rs-scenario-symbols input {
  width: 100%;
  border: 1px solid #d6e4f5;
  border-radius: 9px;
  background: #fff;
  color: #0b1f4d;
  box-shadow: none;
}
.rs-scenario-symbols .small-note {
  margin: 0;
  color: #94a3b8;
  font-size: .78rem;
  line-height: 1.45;
}
/* Actions inside lab-right */
.rs-pass-lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .65rem;
}
.rs-pass-lab-actions button { flex: 1 1 130px; }

/* Idea clave when showing results */
.rs-pass-idea-result {
  margin-bottom: .75rem;
}

/* Results section */
.rs-pass-results {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem;
  margin-top: 2rem;
  border: 1px solid #d6e4f5;
  border-radius: 14px;
  background: #fff;
}
.rs-pass-results[hidden] { display: none; }
.rs-pass-results > h4 {
  margin: 0;
  color: #0b1f4d;
  font-size: 1rem;
  letter-spacing: 0;
}

/* 3-col + full-width hero layout */
.rs-pass-result-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
.rs-result-card-new {
  display: grid;
  gap: .3rem;
  padding: .85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

/* CONTRASEÑAS VÁLIDAS — hero card */
.rs-result-card-new--main {
  grid-column: 1 / -1;
  padding: 1.5rem;
  border: 1px solid rgba(18,54,106,.16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232,238,247,.92), rgba(255,255,255,.78));
  box-shadow: 0 4px 16px rgba(18,54,106,.08);
}
.rs-result-card-label {
  color: #64748b;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.rs-result-card-new--main .rs-result-card-label {
  color: #12366a;
  opacity: .65;
}
.rs-result-card-formula {
  color: #475569;
  font-size: .86rem;
  line-height: 1.4;
}
.rs-result-card-new--main .rs-result-card-formula {
  color: #12366a;
  font-size: .95rem;
}
.rs-result-card-value {
  display: block;
  color: #1d4ed8;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.rs-result-card-new--main .rs-result-card-value {
  color: #0b1f4d;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -.02em;
}
.rs-result-card-aux {
  color: #94a3b8;
  font-size: .78rem;
  line-height: 1.45;
}
.rs-result-card-new--main .rs-result-card-aux {
  color: #475569;
  opacity: .7;
}

/* Steps collapsible toggle */
.rs-pass-steps-section {
  display: grid;
  gap: .5rem;
}
.rs-steps-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  color: #0b1f4d;
  font-size: .9rem;
  font-weight: 700;
  text-align: left;
  transition: background .15s;
}
.rs-steps-toggle:hover { background: #f1f5f9; }
.rs-steps-toggle[aria-expanded="true"] { border-color: #1d4ed8; }
.rs-steps-chevron {
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform .2s ease;
}
.rs-steps-toggle[aria-expanded="true"] .rs-steps-chevron {
  transform: rotate(180deg);
}

/* Step-by-step */
.rs-pass-steps-section h4 {
  margin: 0 0 .6rem;
  color: #0b1f4d;
  font-size: .92rem;
  letter-spacing: 0;
}
.rs-pass-steps {
  display: grid;
  gap: .55rem;
}
.rs-pass-steps[hidden] { display: none; }
.rs-pass-step {
  padding: .7rem .85rem;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #fff;
}
.rs-pass-step-header {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
}
.rs-pass-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 800;
  flex-shrink: 0;
}
.rs-pass-step-header p {
  margin: .1rem 0 0;
  color: #475569;
  font-size: .85rem;
  line-height: 1.45;
}
.rs-pass-step-formula {
  margin-top: .45rem;
  padding: .4rem .6rem;
  border-radius: 8px;
  background: #f8fafc;
  color: #0b1f4d;
  font-size: .9rem;
  overflow-x: auto;
}

/* Interpretation box */
.rs-pass-interp {
  padding: .75rem .9rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(232,238,247,.92), rgba(255,255,255,.78));
  border: 1px solid rgba(18,54,106,.16);
}
.rs-pass-interp span {
  color: #12366a;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .02em;
  opacity: .65;
}
.rs-pass-interp p {
  margin: .3rem 0 0;
  color: #12366a;
  font-size: .85rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .rs-pass-result-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 580px) {
  .rs-pass-result-cards {
    grid-template-columns: 1fr;
  }
  .rs-result-card-new--main { grid-column: 1; }
  .rs-pass-lab-actions button { flex-basis: 100%; }
}

/* ===================== Principio del Palomar ===================== */

.pp-badge {
  display: inline-flex;
  align-items: center;
  margin-left: .4rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-family: var(--font-accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  background: #e8eef7;
  color: #12366a;
  vertical-align: middle;
}
.pp-badge--objects { background: var(--blue-100); color: var(--blue-700); }
.pp-badge--boxes { background: var(--blue-075); color: var(--blue-800); }
.pp-badge--goal { background: var(--amber-100); color: var(--amber-700); }
.pp-badge--bound { background: var(--blue-100); color: var(--blue-800); }

.pp-alert {
  margin: .6rem 0 0;
  padding: .55rem .8rem;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, .35);
  background: rgba(254, 226, 226, .6);
  color: #991b1b;
  font-size: .86rem;
  font-weight: 700;
}
.pp-alert[hidden] { display: none; }

.pp-callout {
  margin: .9rem 0;
  padding: .8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(18, 54, 106, .16);
  background: linear-gradient(135deg, rgba(232,238,247,.92), rgba(255,255,255,.78));
  color: #12366a;
  font-size: .9rem;
  line-height: 1.55;
}
.pp-callout[hidden] { display: none; }
.pp-callout strong { color: #0b1f4d; }
.pp-callout--idea { border-left: 4px solid var(--color-primary); }
.pp-callout--limit { border-left: 4px solid #b45309; background: linear-gradient(135deg, rgba(254,243,199,.7), rgba(255,255,255,.82)); color: #78350f; }
.pp-callout--conclusion { border-left: 4px solid var(--blue-700); background: linear-gradient(135deg, rgba(219,234,254,.55), rgba(255,255,255,.82)); color: var(--blue-900); }

/* Theorem cards (Concepto) */
.pp-theorem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin: 1rem 0 1.25rem;
}
.pp-theorem-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 210px;
  padding: 1.25rem 1.35rem 1.3rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.pp-theorem-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-strong), var(--color-primary));
  opacity: 1;
}
.pp-theorem-card:nth-child(2)::before { background: linear-gradient(90deg, #475569, #94a3b8); }
.pp-theorem-card:nth-child(3)::before { background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)); }
.pp-theorem-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, .25);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .1);
}
.pp-theorem-card h3 {
  margin: 0 0 .75rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.25vw, 1.18rem);
  line-height: 1.18;
  letter-spacing: 0;
}
.pp-theorem-text {
  margin: .85rem 0 0;
  color: var(--color-text-soft);
  font-size: .94rem;
  line-height: 1.48;
}
.pp-formula-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  margin: 0;
  padding: .75rem .9rem;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--blue-050), #fff);
  border: 1px solid var(--border-blue);
  color: var(--blue-900);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(.95rem, .8vw + .62rem, 1.06rem);
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  overflow-x: auto;
}
.pp-formula-box mjx-container {
  margin: 0 .12em !important;
  vertical-align: middle;
}
.pp-formula-box mjx-container[display="true"] { margin: 0 !important; }
.pp-formula-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .2rem .45rem;
}
.pp-formula-line span {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .pp-theorem-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .pp-theorem-card {
    min-height: 0;
    padding: 1.1rem 1rem 1.15rem;
  }
}

/* Box grid (Mini diagrama del Concepto) */
.pp-box-grid--mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: .7rem;
  margin: .9rem 0;
  max-width: 460px;
}
@media (max-width: 420px) {
  .pp-box-grid--mini { grid-template-columns: repeat(3, minmax(70px, 1fr)); gap: .45rem; }
}

.pp-box {
  min-width: 0;
  min-height: 96px;
  padding: .55rem .65rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .025);
  transition: outline-color .2s ease, background .2s ease;
}
.pp-box.is-max {
  outline: 2px solid rgba(37, 99, 235, .65);
  background: rgba(37, 99, 235, .06);
}
.pp-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .4rem;
}
.pp-box-title {
  font-size: .82rem;
  font-weight: 800;
  color: var(--color-text);
}
.pp-box-charge {
  font: 700 .75rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--color-muted);
}
.pp-box-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 22px;
}
.pp-token {
  display: inline-flex;
  color: var(--color-primary-strong);
  flex-shrink: 0;
  transform: translateY(-8px) scale(.6);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.pp-token svg { width: 18px; height: 18px; }
.pp-token.is-in { transform: translateY(0) scale(1); opacity: 1; }

/* Calculadora: laboratorio de cotas */
.pp-calculator-lab { display: grid; gap: 1.25rem; }
.pp-calculator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, .38fr);
  gap: 1.5rem;
  align-items: center;
  overflow: hidden;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid #dbe5f1;
  border-radius: 24px;
  background: radial-gradient(circle at 94% 8%, rgba(147,197,253,.42), transparent 28%), linear-gradient(135deg, #fff 0%, #eff6ff 55%, #fff 100%);
  box-shadow: 0 12px 32px rgba(15, 61, 120, .07);
}
.pp-calculator-kicker, .pp-calculator-badge, .pp-result-kicker {
  display: inline-flex; align-items: center; width: max-content; border-radius: 10px;
  font-size: .72rem; font-weight: 900; letter-spacing: .02em;
}
.pp-calculator-kicker { padding: .45rem .7rem; color: #fff; background: #0b2e66; }
.pp-calculator-hero h2 { margin: .8rem 0 .45rem; color: #0b1f4d; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.08; }
.pp-calculator-hero p { max-width: 720px; margin: 0; color: #4b627d; line-height: 1.65; }
.pp-distribution-illustration {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  min-height: 128px;
  padding: .4rem;
}
.pp-illustration-objects { display: grid; grid-template-columns: repeat(2, 12px); gap: 7px; }
.pp-illustration-objects i, .pp-illustration-boxes b { display: block; border-radius: 50%; background: #3b82f6; }
.pp-illustration-objects i { width: 14px; height: 14px; box-shadow: 0 3px 10px rgba(37,99,235,.3); animation: ppObjectFloat 3.5s ease-in-out infinite; }
.pp-illustration-objects i:nth-child(1) { animation-delay: -.2s; }
.pp-illustration-objects i:nth-child(2), .pp-illustration-objects i:nth-child(5) { background: #60a5fa; animation-delay: -.8s; }
.pp-illustration-objects i:nth-child(3) { background: #93c5fd; animation-delay: -1.4s; }
.pp-illustration-objects i:nth-child(4) { animation-delay: -2s; }
.pp-illustration-arrow { width: 48px; fill: none; stroke: #52749e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 58; animation: ppArrowFlow 2.6s ease-in-out infinite; }
.pp-illustration-boxes { display: grid; grid-template-columns: repeat(3, 37px); gap: 6px; align-items: end; }
.pp-illustration-boxes span { display: flex; flex-wrap: wrap; align-content: flex-end; gap: 4px; min-height: 54px; padding: 6px; border: 1px solid #b9cce4; border-radius: 10px; background: rgba(255,255,255,.84); box-shadow: inset 0 -4px 8px rgba(148,163,184,.12); animation: ppBoxReceive 3.5s ease-in-out infinite; }
.pp-illustration-boxes span:nth-child(2) { animation-delay: .45s; }
.pp-illustration-boxes span:nth-child(3) { animation-delay: .9s; }
.pp-illustration-boxes b { width: 7px; height: 7px; background: #2563eb; }
.pp-illustration-boxes span:nth-child(3) b { background: #1d4ed8; }
.pp-calculator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.pp-calculator-card { position: relative; overflow: hidden; padding: clamp(1.25rem, 2.5vw, 1.65rem); border: 1px solid #dbe5f1; border-radius: 24px; background: #fff; box-shadow: 0 8px 22px rgba(15,61,120,.06); animation: ppCardIn .48s ease-out both; transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.pp-calculator-card:nth-child(2) { animation-delay: .09s; }
.pp-calculator-card::after { content:""; position:absolute; inset:0 0 auto; height: 3px; background: linear-gradient(90deg, #1d4ed8, #60a5fa); opacity: .85; }
.pp-calculator-card:hover { transform: translateY(-4px); border-color: #93c5fd; box-shadow: 0 18px 35px rgba(15,61,120,.13); }
.pp-calculator-badge { padding: .42rem .68rem; color: #fff; background: #0b2e66; }
.pp-calculator-card h3 { margin: .85rem 0 .35rem; color: #102a57; font-size: 1.18rem; }
.pp-calculator-description { min-height: 3.15em; margin: 0; color: #58708d; font-size: .93rem; line-height: 1.55; }
.pp-calculator-formula, .pp-result-formula { overflow-x: auto; text-align: center; }
.pp-calculator-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  box-sizing: border-box;
  margin: 1rem 0;
  padding: .72rem .85rem;
  border: 1px solid var(--border-blue);
  border-radius: 14px;
  background: var(--blue-050);
  color: var(--blue-900);
}
.pp-calculator-formula mjx-container[display="true"] { margin: 0 !important; }
.pp-calculator-inputs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.pp-input-field { min-width: 0; }
.pp-input-field label { display: block; margin-bottom: .38rem; color: #29496e; font-size: .84rem; font-weight: 800; }
.pp-input-field input { width: 100%; height: 48px; box-sizing: border-box; border: 1px solid #cbd9e8; border-radius: 14px; padding: 0 .8rem; color: #102a57; font-size: 1rem; font-weight: 700; background: #fff; box-shadow: 0 2px 5px rgba(15,61,120,.04); outline: none; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.pp-input-field input:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(59,130,246,.15); }
.pp-input-field.has-error { animation: ppShakeSoft .22s ease-in-out both; }
.pp-input-field.has-error input { border-color: #ef8b8b; background: #fff8f8; box-shadow: 0 0 0 3px rgba(239,104,104,.1); }
.pp-field-error { min-height: 1.1em; margin: .32rem 0 0; color: #b42318; font-size: .76rem; font-weight: 700; }
.pp-calculator-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.pp-calculator-actions button { min-height: 44px; border-radius: 13px; padding: .65rem 1rem; font-weight: 800; transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.pp-calculator-actions button:hover { transform: translateY(-2px); }
.pp-calculator-actions button:focus-visible { outline: 3px solid rgba(37,99,235,.28); outline-offset: 2px; }
.pp-button-primary { border: 1px solid #0b2e66; color: #fff; background: #0b2e66; box-shadow: 0 8px 16px rgba(11,46,102,.18); }
.pp-button-primary:hover { background: #123f85; }
.pp-button-secondary { border: 1px solid #d3dfed; color: #365574; background: #fff; }
.pp-button-secondary:hover { border-color: #a9c8ed; background: #eff6ff; }
.pp-button-limit { border: 1px solid #f4d28a; color: #925d07; background: #fffaeb; }
.pp-button-limit:hover { background: #fff2cf; }
.pp-button-primary.is-calculating { cursor: wait; opacity: .82; }
.pp-result-panel { display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: .7rem; align-items: center; margin-top: 1.1rem; padding: 1rem; border: 1px solid var(--border-blue); border-radius: 18px; background: linear-gradient(135deg, var(--blue-050), #fff); color: var(--blue-900); animation: ppResultIn .35s ease-out both; }
.pp-result-panel[hidden], .pp-limit-case[hidden] { display: none; }
.pp-result-kicker { grid-column: 1 / -1; margin-bottom: .5rem; color: var(--blue-800); }
.pp-result-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 3rem; min-height: 2.8rem; padding: .15rem .65rem; border: 1px solid var(--border-blue); border-radius: 13px; color: var(--blue-800); background: #fff; font-size: 1.45rem; font-weight: 900; box-shadow: 0 3px 8px rgba(10,42,94,.08); animation: ppPop .32s ease-out both; }
.pp-result-formula {
  min-width: 0;
  color: var(--blue-900);
  align-self: center;
}
.pp-result-formula mjx-container[display="true"] {
  margin: 0 !important;
}
.pp-result-panel p { grid-column: 1 / -1; margin: .6rem 0 0; color: var(--ink-600); font-size: .9rem; line-height: 1.5; }
.pp-limit-case { margin-top: 1rem; padding: 1rem; border: 1px solid #f2d18d; border-radius: 16px; background: #fffbeb; color: #794b08; line-height: 1.55; animation: ppSlideDown .28s ease-out both; }
.pp-limit-case h4 { margin: 0 0 .35rem; color: #87540a; }
.pp-limit-case p { margin: .4rem 0; }
@keyframes ppTabEnter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ppResultIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes ppPop { 0% { transform: scale(.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes ppFloatSoft { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ppObjectFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(5px,-7px) scale(1.06); } }
@keyframes ppArrowFlow { 0%,100% { stroke-dashoffset: 58; opacity: .55; } 48% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ppBoxReceive { 0%,100% { transform: translateY(0); box-shadow: inset 0 -4px 8px rgba(148,163,184,.12); } 50% { transform: translateY(-3px); box-shadow: 0 8px 17px rgba(37,99,235,.16), inset 0 -4px 8px rgba(148,163,184,.12); } }
@keyframes ppCardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ppSlideDown { from { opacity: 0; transform: translateY(-8px); max-height: 0; } to { opacity: 1; transform: translateY(0); max-height: 500px; } }
@keyframes ppShakeSoft { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.animate-tab-enter { animation: ppTabEnter .45s ease-out both; }
@media (max-width: 760px) { .pp-calculator-hero, .pp-calculator-grid { grid-template-columns: 1fr; } .pp-distribution-illustration { justify-content: flex-start; } }
@media (max-width: 480px) { .pp-calculator-inputs { grid-template-columns: 1fr; } .pp-calculator-actions button { flex: 1 1 100%; } .pp-result-panel { grid-template-columns: 1fr; } .pp-result-chip { width: max-content; } }
@media (prefers-reduced-motion: reduce) { .animate-tab-enter, .pp-result-panel, .pp-result-chip, .pp-illustration-objects i, .pp-illustration-arrow, .pp-illustration-boxes span, .pp-input-field.has-error, .pp-limit-case, .pp-calculator-card { animation: none !important; } .pp-calculator-card, .pp-calculator-actions button { transition: none; } }

/* ===== Panel binomial ===== */
@keyframes bnCardEnter { 0% { opacity: 0; transform: translateY(22px) scale(.972); filter: blur(3px); } 70% { opacity: 1; transform: translateY(-2px) scale(1.004); filter: blur(0); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@keyframes bnResultIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes bnOrbit { from { transform: rotate(0deg) translateX(22px) rotate(0deg); } to { transform: rotate(360deg) translateX(22px) rotate(-360deg); } }
@keyframes bnPop { 0%{transform:scale(.92)} 65%{transform:scale(1.04)} 100%{transform:scale(1)} }
@keyframes fadeSlideUp { 0% { opacity:0; transform:translateY(18px) scale(.982); filter:blur(2px); } 72% { opacity:1; transform:translateY(-2px) scale(1.003); filter:blur(0); } 100% { opacity:1; transform:translateY(0) scale(1); filter:blur(0); } }
@keyframes softFloat { 0%,100% { transform:translateY(0) rotate(0deg); } 45% { transform:translateY(-7px) rotate(-1deg); } 70% { transform:translateY(2px) rotate(1deg); } }
@keyframes accordionDown { from { opacity:0; transform:translateY(-6px); max-height:0; } to { opacity:1; transform:translateY(0); max-height:520px; } }
@keyframes softPop { 0% { transform:scale(.98); } 60% { transform:scale(1.02); } 100% { transform:scale(1); } }
@keyframes softGlow { 0%,100% { box-shadow:0 0 0 rgba(37,99,235,0); } 50% { box-shadow:0 0 18px rgba(37,99,235,.14); } }
@keyframes buttonSweep { from { left:-35%; opacity:.35; } to { left:105%; opacity:1; } }
@keyframes bnParticleDrift { 0%,100% { opacity:.28; transform:translate(0,0) scale(.9); } 50% { opacity:.85; transform:translate(8px,-6px) scale(1.08); } }
@keyframes bnFormulaWash { 0% { background-position: 120% 50%; } 100% { background-position: -30% 50%; } }
@keyframes barRise { from { height:0; opacity:.35; } to { height:var(--bar-height); opacity:1; } }
@keyframes activePulse { 0%,100% { box-shadow:0 0 0 rgba(37,99,235,0); } 50% { box-shadow:0 0 12px rgba(37,99,235,.16); } }
@keyframes tooltipIn { from { opacity:0; transform:translateY(8px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes resultPop { 0% { transform:scale(.98); } 60% { transform:scale(1.03); } 100% { transform:scale(1); } }
.bn-tab-enter { animation: bnCardEnter .4s ease-out both; }
.bn-card-enter { animation: fadeSlideUp .4s ease-out both; }
.bn-coefficient-layout { display:grid; gap:1rem; padding:1.25rem; }
.bn-learning-layout { max-width:none; margin:0; }
.bn-calculator-layout { padding:1.25rem; max-width:980px; margin:0 auto; }
.bn-learning-column { display:grid; gap:1rem; align-content:start; }
.bn-learning-column::before { display:none; }
.bn-calculator-card,.bn-identity-card,.bn-visualizer-card,.bn-exercise-card { position:relative; overflow:hidden; border:1px solid var(--color-border); border-radius:22px; background:linear-gradient(135deg,#fff,#eff6ff99 55%,#fff); box-shadow:0 8px 22px rgba(15,23,42,.055); }
.bn-calculator-card::before,.bn-identity-card::before,.bn-visualizer-card::before,.bn-exercise-card::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; border-radius:22px 22px 0 0; background:var(--color-primary); opacity:.9; }
.bn-hero-card,.bn-info-card,.bn-guide,.bn-example-card { position:relative; overflow:hidden; border:1px solid rgba(15,23,42,.12); border-radius:18px; background:#fff; box-shadow:0 9px 24px rgba(15,23,42,.06); }
.bn-hero-card::before,.bn-info-card::before,.bn-guide::before,.bn-example-card::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; border-radius:18px 18px 0 0; background:var(--color-primary); opacity:.9; }
.bn-hero-card,.bn-info-card,.bn-guide,.bn-example-card { padding:1.35rem 1.55rem; }
.bn-hero-icon { margin-bottom:.75rem; }
.bn-hero-card .bn-hero-heading h2 { margin:.05rem 0 .35rem; }
.bn-kicker,.bn-card-label { display:inline-flex; color:var(--color-primary-strong); font-family:var(--font-accent); font-size:.84rem; font-weight:700; letter-spacing:.01em; }
.bn-hero-heading { display:flex; gap:1rem; justify-content:space-between; align-items:center; }
.bn-hero-card h2,.bn-calculator-card h3,.bn-identity-card h3,.bn-example-card h3 { margin:.35rem 0; color:var(--color-text); }
.bn-hero-card p,.bn-info-card p,.bn-guide p,.bn-example-card p { margin:.35rem 0 0; color:var(--color-text-soft); line-height:1.6; }
.bn-orbit { position:relative; width:132px; height:88px; flex:0 0 132px; border-radius:18px; background:linear-gradient(135deg,#eff6ff,#f8fbff); border:1px solid #bfdbfe; overflow:hidden; box-shadow:inset 0 0 0 1px rgba(255,255,255,.78); }
.bn-orbit::before { content:""; position:absolute; inset:16px 18px; border:1px dashed rgba(96,165,250,.42); border-radius:14px; animation:bnParticleDrift 5.2s ease-in-out infinite; }
.bn-orbit span { position:absolute; z-index:2; display:grid; place-items:center; width:38px; height:38px; border-radius:11px; color:#fff; font-weight:900; background:var(--color-primary); box-shadow:0 10px 18px #2563eb2b; animation:softFloat 3.2s ease-in-out infinite; }
.bn-orbit span:first-child { left:25px; top:17px; }.bn-orbit span:nth-child(2) { right:25px; bottom:14px; background:#0f766e; animation-delay:-1.1s; }.bn-orbit i,.bn-orbit b { position:absolute; width:6px; height:6px; border-radius:50%; background:#93c5fd; top:38px; left:63px; opacity:.8; animation:bnParticleDrift 3.8s ease-in-out infinite; }.bn-orbit b { width:5px; height:5px; top:17px; left:auto; right:25px; opacity:.7; animation-delay:-1.7s; }
.bn-formula-pair { display:grid; grid-template-columns:1fr; gap:.55rem; margin:.72rem 0 .9rem; }
.bn-formula-box { overflow-x:auto; margin:.7rem 0; padding:.35rem .75rem; border:1px solid #bfdbfe; border-radius:12px; background:#eff6ff; color:#173d79; text-align:center; }
.bn-learning-column .bn-formula-box { margin:0; padding:.78rem 1rem; border-radius:9px; background:linear-gradient(105deg,#eff6ff 0%,#f8fbff 42%,#eaf3ff 50%,#f8fbff 58%,#eff6ff 100%); background-size:240% 100%; animation:bnFormulaWash 5.8s ease-in-out infinite; }
.bn-learning-column .bn-formula-box mjx-container[display="true"] { margin:.25rem 0 !important; }
.bn-guide-steps { display:flex; align-items:stretch; gap:.9rem; margin-top:.75rem; }.bn-guide-steps>i { align-self:center; color:#3b82f6; font-size:1.55rem; font-style:normal; font-weight:900; animation:softFloat 2.8s ease-in-out infinite; }.bn-step { flex:1; display:flex; align-items:center; gap:.75rem; min-width:0; padding:.8rem .95rem; border:1px solid #d8e2f0; border-radius:9px; background:#fff; color:var(--color-text-soft); font-size:.9rem; line-height:1.35; box-shadow:0 4px 12px rgba(15,23,42,.035); transition:transform .22s ease, border-color .22s ease, box-shadow .22s ease; }.bn-step:hover { transform:translateY(-2px); border-color:#bfdbfe; box-shadow:0 10px 22px rgba(37,99,235,.1); }.bn-step b { display:grid; flex:0 0 30px; place-items:center; width:30px; height:30px; border-radius:50%; background:#17499f; color:#fff; box-shadow:0 8px 16px rgba(23,73,159,.18); }.bn-step.is-valid,.bn-step[data-status="success"] { border-color:#86efac; background:#f0fdf4; color:#166534; }.bn-step.is-invalid,.bn-step[data-status="error"] { border-color:#fecaca; background:#fef2f2; color:#b91c1c; }.bn-step[data-status="active"] { border-color:#bfdbfe; background:#eff6ff; color:#1e3a8a; }.bn-guide-note { font-size:.86rem; }
.bn-example-head { display:flex; align-items:start; justify-content:space-between; gap:1rem; }
.bn-example-chips { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.85rem; }
.bn-example-chips span { display:inline-flex; align-items:center; min-height:34px; padding:.35rem .65rem; border:1px solid #dbeafe; border-radius:999px; background:#eff6ff80; color:#173d79; font-weight:800; }
.bn-example-development { margin-top:1rem; animation:accordionDown .28s ease-out both; overflow:hidden; }
.bn-example-development[hidden] { display:none; }
.bn-example-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.7rem; }
.bn-example-steps>div { min-width:0; padding:.75rem; border:1px solid #e2e8f0; border-radius:14px; background:#fff; color:#173d79; text-align:center; }
.bn-example-steps small { display:block; color:#64748b; font-size:.7rem; font-weight:900; letter-spacing:.02em; }
.bn-example-result { margin-top:.7rem; padding:.85rem; border:1px solid var(--border-blue); border-radius:14px; background:var(--blue-050); color:var(--blue-900); text-align:center; }
.bn-example-result p { margin:.35rem 0 0; color:var(--blue-800); font-size:.86rem; }
.bn-calculator-card { padding:1.3rem; }.bn-calc-title { display:flex; justify-content:space-between; align-items:start; gap:1rem; }.bn-expression { padding:.35rem .6rem; border-radius:999px; background:#dbeafe; color:#1e40af; white-space:nowrap; }.bn-input-grid { display:grid; grid-template-columns:1fr 1fr; gap:.85rem; margin:1rem 0 .5rem; }.bn-input-grid label,.bn-identity-card label,.bn-viz-control label { display:grid; gap:.35rem; color:var(--color-text); font-size:.82rem; font-weight:800; }.bn-input-grid input,.bn-identity-card input,.bn-viz-control input,.bn-exercise-answer { min-height:44px; padding:.55rem .7rem; border:1px solid #cbd5e1; border-radius:11px; color:var(--color-text); background:#fff; font:inherit; }.bn-input-grid input:focus,.bn-identity-card input:focus,.bn-viz-control input:focus,.bn-exercise-answer:focus { outline:0; border-color:#2563eb; box-shadow:0 0 0 3px #2563eb1f; }.bn-input-grid label.is-invalid input { border-color:#fca5a5; animation:bnPop .24s ease both; }.bn-input-grid small { min-height:0; color:#dc2626; font-size:.72rem; }.bn-error { min-height:1.25rem; margin:.3rem 0; color:#b91c1c; font-size:.84rem; }.bn-actions { display:flex; gap:.65rem; }.bn-actions .lab-calc-btn { flex:1; }.bn-secondary-btn,.bn-copy-btn { min-height:44px; padding:.55rem .9rem; border:1px solid #bfdbfe; border-radius:12px; background:#fff; color:#1d4ed8; font:inherit; font-weight:800; cursor:pointer; }.bn-secondary-btn:hover,.bn-copy-btn:hover { background:#eff6ff; }.bn-result-panel { margin-top:1rem; padding:1rem; border:1px solid var(--border-blue); border-radius:16px; background:var(--blue-050); animation:bnResultIn .35s ease-out both; }.bn-result-heading { display:flex; justify-content:space-between; align-items:center; gap:.75rem; color:var(--blue-800); font-weight:900; }.bn-copy-btn { min-height:auto; padding:.35rem .6rem; font-size:.76rem; }.bn-result-steps { display:grid; grid-template-columns:1fr auto 1fr auto 1.3fr; align-items:center; gap:.4rem; margin:1rem 0; }.bn-result-steps>div { min-height:78px; padding:.6rem; border-radius:10px; background:#fff; }.bn-result-steps small,.bn-final-chip small { display:block; color:#64748b; font-size:.7rem; font-weight:800; }.bn-result-steps p { margin:.3rem 0 0; overflow-x:auto; color:var(--blue-900); font-size:.86rem; }.bn-result-steps>i { color:var(--blue-500); font-style:normal; }.bn-final-chip { padding:.8rem; border-radius:12px; background:#fff; text-align:center; }.bn-final-chip strong { display:block; margin-top:.25rem; color:#0f172a; font-size:clamp(1.05rem,2vw,1.45rem); animation:bnPop .32s ease-out both; }.bn-copy-message { min-height:1rem; margin:.35rem 0 0; text-align:right; color:var(--blue-800); font-size:.75rem; }
#bn-calc .bn-calculator-layout { display:grid; gap:1rem; max-width:none; margin:0; padding:1.25rem; }
#bn-calc .bn-calculator-hero { position:relative; overflow:hidden; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.15rem 1.35rem; border:1px solid var(--color-border); border-radius:18px; background:#fff; box-shadow:0 8px 22px rgba(15,23,42,.055); }
#bn-calc .bn-calculator-hero::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; border-radius:18px 18px 0 0; background:var(--color-primary); opacity:.9; }
#bn-calc .bn-calculator-hero h3 { margin:.25rem 0 .3rem; color:var(--color-text); font-size:1.35rem; }
#bn-calc .bn-calculator-hero p { max-width:720px; margin:0; color:var(--color-text-soft); line-height:1.55; }
#bn-calc .bn-calculator-hero .bn-expression { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:.45rem .75rem; border:1px solid #bfdbfe; border-radius:999px; background:#eff6ff; color:#1e40af; white-space:nowrap; }
#bn-calc .bn-calc-guide { display:grid; grid-template-columns:1fr auto 1fr auto 1fr; align-items:center; gap:.45rem; padding:.55rem; border:1px solid #dbeafe; border-radius:16px; background:#eff6ff66; }
#bn-calc .bn-calc-guide>i { color:#60a5fa; font-style:normal; font-weight:900; }
#bn-calc .bn-calc-guide-step { display:flex; align-items:center; gap:.5rem; min-height:42px; padding:.45rem .65rem; border:1px solid #e2e8f0; border-radius:12px; background:#fff; color:#475569; font-size:.84rem; font-weight:800; transition:background .2s ease,border-color .2s ease,color .2s ease; }
#bn-calc .bn-calc-guide-step b { display:grid; place-items:center; width:24px; height:24px; flex:0 0 24px; border-radius:999px; background:#dbeafe; color:#1d4ed8; font-size:.78rem; }
#bn-calc .bn-calc-guide-step[data-state="success"] { border-color:#bfdbfe; background:#eff6ff; color:#1e3a8a; }
#bn-calc .bn-calc-guide-step[data-state="error"] { border-color:#fecaca; background:#fffafa; color:#b91c1c; }
#bn-calc .bn-calc-guide-step[data-state="active"] { border-color:#bfdbfe; background:#eff6ff; color:#1e3a8a; }
#bn-calc .bn-calculator-card { padding:1.15rem; border-radius:18px; background:#fff; }
#bn-calc .bn-calculator-main { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr); gap:1.15rem; align-items:start; }
#bn-calc .bn-form-panel,#bn-calc .bn-output-panel { min-width:0; }
#bn-calc .bn-output-panel { display:grid; gap:.8rem; }
#bn-calc .bn-input-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem .85rem; margin:.7rem 0 .15rem; }
#bn-calc .bn-input-grid label { gap:.28rem; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
#bn-calc .bn-input-grid label>span:first-child { color:#0f172a; font-weight:900; }
#bn-calc .bn-input-grid label>small:not(.bn-field-error) { min-height:auto; color:#64748b; font-size:.74rem; font-weight:700; line-height:1.35; }
#bn-calc .bn-field-shell { display:flex; align-items:center; gap:.4rem; min-height:42px; margin-top:.08rem; padding:0 .6rem; border:1px solid #cbd5e1; border-radius:11px; background:#fff; transition:border-color .2s ease,box-shadow .2s ease; }
#bn-calc .bn-field-shell:focus-within { border-color:#2563eb; box-shadow:0 0 0 3px #2563eb1f; }
#bn-calc .bn-field-shell input { flex:1; min-width:0; min-height:40px; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; font-size:.95rem; font-weight:850; }
#bn-calc .bn-field-shell input:focus { box-shadow:none; }
#bn-calc .bn-field-shell em { color:#1d4ed8; font-style:normal; font-weight:900; }
#bn-calc .bn-input-grid label.is-invalid .bn-field-shell { border-color:#fca5a5; background:#fffafa; }
#bn-calc .bn-field-error { min-height:.9rem; color:#dc2626; font-size:.7rem; }
#bn-calc .bn-error { min-height:1.1rem; margin:.35rem 0 0; }
#bn-calc .bn-preview-card,#bn-calc .bn-result-empty,#bn-calc .bn-result-panel { margin:0; padding:.85rem; border:1px solid #dbeafe; border-radius:14px; background:#eff6ff66; box-shadow:none; }
#bn-calc .bn-preview-chips { display:flex; flex-wrap:wrap; gap:.4rem; margin:.6rem 0; }
#bn-calc .bn-preview-chips span { display:inline-flex; align-items:center; min-height:28px; padding:.24rem .5rem; border:1px solid #bfdbfe; border-radius:999px; background:#fff; color:#173d79; font-size:.82rem; font-weight:850; }
#bn-calc .bn-preview-formula { padding:.65rem; border:1px solid #dbeafe; border-radius:12px; background:#fff; color:#173d79; }
#bn-calc .bn-preview-formula small { display:block; color:#64748b; font-size:.68rem; font-weight:900; letter-spacing:.02em; }
#bn-calc .bn-preview-formula p { margin:.25rem 0 0; overflow-x:auto; }
#bn-calc .bn-preview-validation { margin:.6rem 0 0; color:#475569; font-size:.84rem; font-weight:800; line-height:1.45; transition:color .2s ease,background .2s ease,border-color .2s ease; }
#bn-calc .bn-preview-validation.is-valid { color:#1e3a8a; }
#bn-calc .bn-preview-validation.is-invalid { color:#b91c1c; }
#bn-calc .bn-result-panel { background:#fff; border-color:#bfdbfe; }
#bn-calc .bn-result-empty { display:grid; align-content:center; min-height:96px; background:#fff; }
#bn-calc .bn-result-empty[hidden],#bn-calc .bn-result-panel[hidden] { display:none; }
#bn-calc .bn-result-empty p { margin:.35rem 0 0; color:#64748b; line-height:1.45; }
#bn-calc .bn-result-heading { color:#0b1f4d; }
#bn-calc .bn-result-steps { grid-template-columns:1fr auto 1fr; gap:.35rem; margin:.65rem 0; }
#bn-calc .bn-result-steps>div { min-height:52px; padding:.5rem; border:1px solid #e2e8f0; }
#bn-calc .bn-result-steps>i { color:#60a5fa; }
#bn-calc .bn-final-chip { padding:.65rem; border:1px solid #dbeafe; background:#eff6ff66; }
#bn-calc .bn-final-chip strong { color:#0b1f4d; font-size:clamp(1.1rem,2vw,1.65rem); overflow-wrap:anywhere; }
#bn-calc .bn-result-formula { margin:.55rem 0 0; color:#1e3a8a; text-align:center; overflow-x:auto; }
#bn-calc .bn-actions { display:flex; justify-content:flex-end; gap:.75rem; margin-top:1rem; padding-top:1rem; border-top:1px solid #e2e8f0; }
#bn-calc .bn-actions .lab-calc-btn { position:relative; overflow:hidden; flex:1; min-height:48px; border-radius:12px; background:#0b1f4d; box-shadow:0 12px 22px rgba(11,31,77,.14); transition:transform .2s ease,background .2s ease,box-shadow .2s ease; }
#bn-calc .bn-actions .lab-calc-btn:hover { transform:translateY(-1px); background:#12366a; box-shadow:0 14px 24px rgba(11,31,77,.18); }
#bn-calc .bn-actions .lab-calc-btn:after { content:""; position:absolute; inset:0 auto 0 -35%; width:30%; background:linear-gradient(90deg,transparent,rgba(255,255,255,.22),transparent); transform:skewX(-18deg); opacity:0; }
#bn-calc .bn-actions .lab-calc-btn:hover:after { animation:buttonSweep .65s ease-out both; }
#bn-calc .bn-actions .bn-secondary-btn { min-height:48px; min-width:128px; border-radius:12px; }
.animate-soft-pop { animation:softPop .28s ease-out both; }
.animate-soft-glow { animation:softGlow 1.2s ease-out both; }
.animate-button-sweep { animation:buttonSweep .45s ease-out both; }
#bn-id .bn-identities-hero { position:relative; overflow:hidden; margin:1.25rem 1.25rem 0; padding:1.35rem 1.55rem; border:1px solid var(--color-border); border-radius:18px; background:#fff; box-shadow:0 9px 24px rgba(15,23,42,.06); }
#bn-id .bn-identities-hero::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; border-radius:18px 18px 0 0; background:var(--color-primary); opacity:.9; }
#bn-id .bn-identities-hero h2 { margin:.25rem 0 .3rem; color:var(--color-text); font-size:1.35rem; line-height:1.2; }
#bn-id .bn-identities-hero>p { max-width:980px; margin:0; color:var(--color-text-soft); line-height:1.55; }
#bn-id .bn-identity-note { display:flex; align-items:center; gap:.9rem; margin-top:1rem; padding:.85rem 1rem; border:1px solid #dbeafe; border-radius:14px; background:#eff6ff66; color:var(--color-text-soft); overflow:hidden; }
#bn-id .bn-identity-note .lab-icon-mark { width:42px; height:42px; flex:0 0 42px; border-radius:50%; background:#fff; border:1px solid #bfdbfe; }
#bn-id .bn-identity-note p { flex:1; min-width:0; margin:0; font-weight:750; line-height:1.55; }
#bn-id .bn-identity-note strong { flex:0 0 auto; color:var(--color-primary-strong); font-family:var(--font-display); font-size:1.05rem; font-weight:900; white-space:nowrap; }
.bn-identity-result { display:grid; gap:1.35rem; min-height:0; padding:1.05rem 0 0; border:0; border-radius:0; background:transparent; color:var(--color-text); font-weight:700; animation:bnResultIn .3s ease both; }
.bn-identity-result[hidden] { display:none; }
.bn-identity-result-box { display:grid; gap:.35rem; padding:1rem 1.15rem; border:1px solid #e2e8f0; border-radius:15px; background:#fff; box-shadow:0 6px 18px rgba(15,23,42,.035); }
.bn-identity-result-box span,.bn-sum-build-head small { color:#64748b; font-size:.68rem; font-weight:900; letter-spacing:.02em; }
.bn-identity-result-box strong { color:#0b1f4d; font-family:var(--font-display); font-size:clamp(1.25rem,2vw,1.65rem); line-height:1.25; }
.bn-identity-result-box p { margin:0; color:#475569; font-size:.9rem; font-weight:650; line-height:1.45; }
.bn-sum-build { display:grid; gap:1.05rem; padding-top:.1rem; }
.bn-sum-build-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.85rem 1rem; padding-top:0; border-top:0; }
.bn-sum-build-head .bn-card-label { color:#0b3a8a; letter-spacing:.16em; }
.bn-sum-actions { display:flex; flex-wrap:wrap; gap:.6rem; }
.bn-mini-btn,.bn-progress-play { display:inline-flex; align-items:center; justify-content:center; gap:.38rem; border:1px solid #dbeafe; border-radius:11px; background:#fff; color:#173d79; font:inherit; font-size:.82rem; font-weight:850; cursor:pointer; box-shadow:0 4px 12px rgba(15,23,42,.03); transition:background .2s ease,border-color .2s ease,transform .2s ease,color .2s ease; }
.bn-mini-btn { min-height:38px; padding:.5rem .75rem; }
.bn-mini-btn svg { flex:0 0 auto; }
.bn-mini-btn:hover,.bn-progress-play:hover { border-color:#bfdbfe; background:#f8fbff; color:#0b1f4d; transform:translateY(-1px); }
.bn-sum-info { display:none; position:relative; align-items:center; gap:.45rem; width:max-content; max-width:100%; color:#475569; font-size:.78rem; }
.bn-sum-info>span { display:grid; place-items:center; width:20px; height:20px; border:1px solid #bfdbfe; border-radius:50%; color:#1d4ed8; background:#fff; font-weight:900; }
.bn-sum-info p { position:absolute; left:0; top:calc(100% + .4rem); z-index:4; width:max-content; max-width:min(320px,80vw); margin:0; padding:.55rem .7rem; border:1px solid #bfdbfe; border-radius:10px; background:#fff; box-shadow:0 10px 22px rgba(15,23,42,.1); opacity:0; pointer-events:none; transform:translateY(-4px); transition:opacity .2s ease,transform .2s ease; }
.bn-sum-info:hover p,.bn-sum-info:focus p { opacity:1; transform:translateY(0); }
.bn-sum-chart { position:relative; min-height:270px; overflow-x:auto; padding:2.25rem 1rem .9rem; border:1px solid #e2e8f0; border-radius:14px; background-color:#fff; background-image:repeating-linear-gradient(90deg, transparent 0, transparent 8.45%, rgba(148,163,184,.15) 8.58%, transparent 8.72%); box-shadow:inset 0 1px 0 rgba(255,255,255,.85); }
.bn-sum-bars { position:relative; z-index:2; display:flex; align-items:flex-end; justify-content:space-between; gap:clamp(.28rem,1vw,.9rem); min-width:0; width:100%; height:180px; }
.bn-sum-bar { position:relative; display:grid; grid-template-rows:1fr auto; align-items:end; justify-items:center; flex:1 1 0; min-width:0; max-width:44px; height:100%; padding:0; border:0; border-radius:0; background:transparent !important; box-shadow:none !important; appearance:none; -webkit-appearance:none; color:#334155; cursor:pointer; font:inherit; }
.bn-sum-bar span { position:absolute; bottom:calc(var(--bar-height) + 2rem); max-width:52px; color:#475569; font-size:.62rem; font-weight:800; line-height:1; text-align:center; opacity:0; pointer-events:none; transition:opacity .2s ease; }
.bn-sum-bar.is-active span { opacity:1; }
.bn-sum-bar i { display:block; width:clamp(18px,2.25vw,28px); height:var(--bar-height); border:1px solid rgba(37,99,235,.16); border-radius:5px 5px 3px 3px; background:linear-gradient(180deg,rgba(96,165,250,.72),rgba(37,99,235,.58)); transition:background .22s ease,border-color .22s ease,transform .22s ease,box-shadow .22s ease; }
.bn-sum-bar b { margin-top:.42rem; color:#64748b; font-size:.72rem; font-weight:800; }
.bn-sum-bar.is-revealed i { animation:barRise .45s ease-out both; }
.bn-sum-bar.is-active i { border:2px solid #1e40af; background:linear-gradient(180deg,rgba(147,197,253,.7),rgba(37,99,235,.5)); box-shadow:0 0 0 3px rgba(37,99,235,.11); transform:translateY(-2px); }
.animate-active-pulse i { animation:activePulse .8s ease-in-out both; }
.bn-sum-line { position:absolute; inset:2.45rem 1rem 2.75rem; z-index:1; width:calc(100% - 2rem); height:180px; min-width:0; overflow:visible; pointer-events:none; }
.bn-sum-line polyline { fill:none; stroke:#2563eb; stroke-width:1.15; stroke-dasharray:4 7; opacity:.32; }
.bn-sum-dots { position:absolute; inset:2.45rem 1rem 2.75rem; z-index:3; width:calc(100% - 2rem); height:180px; min-width:0; pointer-events:none; }
.bn-sum-dot { position:absolute; width:6px; height:6px; border:1.4px solid rgba(37,99,235,.5); border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(15,23,42,.08); transform:translate(-50%,-50%); }
.bn-sum-dot.is-active { width:8px; height:8px; border-color:#2563eb; box-shadow:0 0 0 3px rgba(147,197,253,.22); }
.bn-term-tooltip { position:absolute; top:.25rem; right:.65rem; z-index:5; display:grid; gap:.16rem; min-width:130px; padding:.55rem .65rem; border:1px solid #e2e8f0; border-radius:10px; background:#fff; box-shadow:0 10px 22px rgba(15,23,42,.1); color:#0b1f4d; }
.bn-term-tooltip small { color:#64748b; font-size:.72rem; font-weight:900; letter-spacing:.02em; }
.bn-term-tooltip strong,.bn-term-tooltip span { color:#0b1f4d; font-size:.84rem; font-weight:850; }
.animate-tooltip-in { animation:tooltipIn .25s ease-out both; }
.animate-result-pop { animation:resultPop .28s ease-out both; }
.bn-sum-progress { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:1rem; padding:.25rem .35rem 0; }
.bn-progress-play { display:none; width:34px; height:34px; padding:0; border-radius:50%; }
.bn-progress-range { min-width:0; height:22px; padding:0; border:0; background:transparent; accent-color:#2563eb; appearance:none; -webkit-appearance:none; cursor:pointer; }
.bn-progress-range:focus { outline:0; box-shadow:none; }
.bn-progress-range::-webkit-slider-runnable-track { height:5px; border:0; border-radius:999px; background:linear-gradient(90deg,#2563eb 0 var(--progress,0%),#e2e8f0 var(--progress,0%) 100%); transition:background .28s ease; }
.bn-progress-range::-webkit-slider-thumb { width:18px; height:18px; margin-top:-6.5px; border:0; border-radius:50%; background:#2563eb; box-shadow:0 4px 10px rgba(37,99,235,.24); -webkit-appearance:none; transition:transform .18s ease,box-shadow .18s ease; }
.bn-progress-range:hover::-webkit-slider-thumb { transform:scale(1.06); box-shadow:0 5px 12px rgba(37,99,235,.28); }
.bn-progress-range::-moz-range-track { height:5px; border:0; border-radius:999px; background:#e2e8f0; }
.bn-progress-range::-moz-range-progress { height:5px; border:0; border-radius:999px; background:#2563eb; }
.bn-progress-range::-moz-range-thumb { width:18px; height:18px; border:0; border-radius:50%; background:#2563eb; box-shadow:0 4px 10px rgba(37,99,235,.24); transition:transform .18s ease,box-shadow .18s ease; }
.bn-progress-range:hover::-moz-range-thumb { transform:scale(1.06); box-shadow:0 5px 12px rgba(37,99,235,.28); }
.bn-sum-progress span { color:#475569; font-size:.86rem; font-weight:850; white-space:nowrap; }
.bn-sum-meter { display:none; height:6px; overflow:hidden; border-radius:999px; background:#e2e8f0; }
.bn-sum-meter i { display:block; height:100%; border-radius:inherit; background:#60a5fa; transition:width .25s ease; }
.bn-sum-callout { margin:0; padding:.25rem .35rem 0; border:0; border-radius:0; background:transparent; color:#64748b; font-size:.86rem; font-weight:650; line-height:1.55; }
.bn-identities-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; padding:1.25rem; }.bn-identity-card { display:grid; align-content:start; gap:.8rem; padding:1.2rem; }.bn-identity-card h3 { font-size:1.1rem; }.bn-identity-card .lab-calc-btn { min-height:44px; font-size:.88rem; }.bn-bars { display:flex; align-items:end; gap:3px; height:22px; margin-top:.45rem; }.bn-bars i { flex:1; border-radius:3px 3px 0 0; background:#60a5fa; }
#bn-viz { gap:.75rem; padding:1rem 1.25rem 1.25rem; background:#fff; }
#bn-viz.subpanel.active { display:grid; }
.bn-viz-hero { position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,220px); align-items:center; gap:1.25rem; padding:1.35rem 1.55rem; border:1px solid var(--color-border); border-radius:18px; background:#fff; box-shadow:0 9px 24px rgba(15,23,42,.06); overflow:hidden; }
.bn-viz-hero::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; border-radius:18px 18px 0 0; background:var(--color-primary); opacity:.9; z-index:1; }
.bn-viz-hero h2 { margin:.25rem 0 .3rem; color:var(--color-text); font-size:1.35rem; line-height:1.2; }
.bn-viz-hero-copy>p { max-width:980px; margin:0; color:var(--color-text-soft); line-height:1.55; }
.bn-viz-hero-note { display:flex; align-items:center; gap:.9rem; margin-top:1rem; padding:.85rem 1rem; border:1px solid #dbeafe; border-radius:14px; background:#eff6ff66; color:var(--color-text-soft); overflow:hidden; }
.bn-viz-hero-note .lab-icon-mark { width:42px; height:42px; flex:0 0 42px; border-radius:50%; background:#fff; border:1px solid #bfdbfe; }
.bn-viz-hero-note p { flex:1; min-width:0; margin:0; font-weight:750; line-height:1.55; }
.bn-viz-hero-note strong { flex:0 0 auto; color:var(--color-primary-strong); font-family:var(--font-display); font-size:1.05rem; font-weight:900; white-space:nowrap; }
.bn-viz-pascal-photo { align-self:stretch; display:grid; place-items:end center; min-height:110px; margin:0; border:1px solid #dbeafe; border-radius:16px; background:linear-gradient(180deg,#f8fbff,#fff); overflow:hidden; }
.bn-viz-pascal-photo img { display:block; width:min(120px,100%); height:96px; object-fit:contain; object-position:center bottom; filter:drop-shadow(0 12px 18px rgba(15,23,42,.14)); }
.bn-viz-info { display:flex; align-items:center; gap:.55rem; color:#526481; font-size:.95rem; font-weight:650; }
.bn-viz-info svg { color:#2563eb; flex:0 0 auto; }
.bn-viz-card,.bn-viz-control-card { border:1px solid #dfe7f2; border-radius:16px; background:#fff; box-shadow:0 4px 14px rgba(15,23,42,.035); }
.bn-viz-control-card { padding:.85rem 1rem; }
.bn-viz-control { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; }
.bn-viz-control label { display:grid; gap:.28rem; flex:1 1 250px; min-height:52px; padding:.65rem .85rem; border:1px solid #e4ecf7; border-radius:11px; color:#0b1f4d; font-size:.88rem; font-weight:900; }
.bn-viz-control label small { color:#526481; font-size:.82rem; font-weight:650; }
.bn-viz-control input { width:106px; min-height:46px; padding:.55rem .8rem; border:1px solid #cbd5e1; border-radius:11px; background:#fff; color:#0b1f4d; font:inherit; font-size:1.02rem; font-weight:850; }
.bn-viz-control input:focus { outline:0; border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.14); }
.bn-viz-step-btn,.bn-viz-primary-btn,.bn-viz-secondary-btn { display:inline-flex; align-items:center; justify-content:center; gap:.45rem; min-height:46px; border-radius:11px; font:inherit; font-size:.9rem; font-weight:900; cursor:pointer; transition:background .2s ease,border-color .2s ease,transform .2s ease,box-shadow .2s ease; }
.bn-viz-step-btn { width:46px; border:1px solid #cfe0f6; background:#fff; color:#173d79; font-size:1.15rem; }
.bn-viz-primary-btn { padding:.58rem 1.15rem; border:1px solid #1d4ed8; background:#2563eb; color:#fff; box-shadow:0 5px 14px rgba(37,99,235,.18); }
.bn-viz-secondary-btn { padding:.58rem 1.1rem; border:1px solid #9bbcf7; background:#fff; color:#1d4ed8; }
.bn-viz-step-btn:hover,.bn-viz-secondary-btn:hover { border-color:#7aa7f4; background:#f8fbff; transform:translateY(-1px); }
.bn-viz-primary-btn:hover { background:#1d4ed8; transform:translateY(-1px); }
.bn-viz-error { min-height:.5rem; margin:0; color:#b91c1c; font-size:.82rem; font-weight:800; }
.bn-viz-section { display:grid; gap:.7rem; padding:1rem 1.25rem; }
.bn-viz-section-head,.bn-term-detail-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.7rem; }
.bn-viz-section-head strong,.bn-term-detail-head strong { color:#526481; font-size:.88rem; font-weight:850; }
#bn-viz .bn-card-label { display:inline-flex; align-items:center; gap:.55rem; color:#1d4ed8; font-size:.78rem; font-weight:950; letter-spacing:.02em; }
.bn-pascal-triangle { display:grid; justify-items:center; gap:.22rem; min-height:270px; padding:.35rem .5rem 0; background:#fff; overflow-x:auto; }
.bn-pascal-triangle-row { display:flex; justify-content:center; gap:.31rem; min-width:max-content; padding:.04rem .35rem; border-radius:999px; }
.bn-pascal-triangle-row.is-active-row .bn-pascal-cell { border-color:#9bbcf7; background:#f8fbff; box-shadow:0 0 0 1px rgba(37,99,235,.08); }
.bn-pascal-cell { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border:1px solid #dbeafe; border-radius:999px; background:#fff; color:#0b1f4d; font:inherit; font-size:.7rem; font-weight:900; cursor:pointer; box-shadow:0 2px 7px rgba(15,23,42,.025); transition:background .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease,color .2s ease; }
.bn-pascal-cell:hover { border-color:#93c5fd; background:#eff6ff; transform:translateY(-1px); }
.bn-pascal-cell.is-selected { border-color:#2563eb !important; background:#2563eb !important; color:#fff !important; box-shadow:0 0 0 3px rgba(37,99,235,.16); }
.bn-pascal-row { position:relative; min-height:185px; padding:1rem 1rem 2.1rem 3.25rem; border:0; border-radius:0; background:#fff; overflow-x:auto; }
.bn-chart-y-axis { position:absolute; left:.25rem; top:1rem; bottom:2.1rem; width:2.4rem; color:#526481; font-size:.78rem; font-weight:800; }
.bn-chart-y-axis span { position:absolute; right:.35rem; transform:translateY(50%); }
.bn-chart-grid { position:absolute; left:3.25rem; right:1rem; top:1rem; bottom:2.1rem; border-left:1px solid #dbe5f1; border-bottom:1px solid #cbd5e1; pointer-events:none; }
.bn-chart-grid i { position:absolute; left:0; right:0; border-top:1px dashed #d5deeb; }
.bn-chart-bars { position:relative; z-index:2; display:flex; align-items:flex-end; justify-content:space-between; gap:clamp(.45rem,1.2vw,1rem); min-width:760px; height:165px; }
.bn-distribution-bar { position:relative; display:grid; grid-template-rows:1fr auto; align-items:end; justify-items:center; flex:1 1 0; min-width:54px; height:100%; min-height:0; padding:0; border:0 !important; border-radius:0; background:transparent !important; box-shadow:none !important; filter:none !important; appearance:none; -webkit-appearance:none; color:#173d79; cursor:pointer; font:inherit; font-weight:850; }
.bn-distribution-bar:hover,.bn-distribution-bar:focus,.bn-distribution-bar:active { background:transparent !important; box-shadow:none !important; filter:none !important; transform:none; }
.bn-distribution-bar i { display:block; width:clamp(34px,4.1vw,56px); height:var(--bar-height); border:1px solid rgba(37,99,235,.2); border-radius:7px 7px 3px 3px; background:linear-gradient(180deg,rgba(147,197,253,.9),rgba(96,165,250,.75)); transition:height .35s ease,background .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease; }
.bn-distribution-bar small { margin-top:.45rem; color:#526481; font-size:.82rem; font-weight:800; white-space:nowrap; }
.bn-distribution-bar:hover i,.bn-distribution-bar.is-selected i { border-color:#1d4ed8; background:#2563eb; box-shadow:0 0 0 4px rgba(37,99,235,.13); transform:translateY(-2px); }
.bn-expansion { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:.55rem; min-height:48px; padding:0; border:0; background:#fff; box-shadow:none; text-align:center; }
.bn-expansion-arrow { align-self:center; color:#94a3b8; font-size:1rem; font-style:normal; font-weight:750; line-height:1; opacity:.72; }
.bn-expansion-chip { display:inline-flex; align-items:center; justify-content:center; gap:.55rem; min-height:38px; min-width:0; padding:.5rem .7rem; border:1px solid #dbeafe; border-radius:9px; background:#fff; color:#173d79; cursor:pointer; font:inherit; font-weight:850; box-shadow:none; transition:background .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease,color .2s ease; }
.bn-expansion-chip small { color:#526481; font-size:.76rem; font-weight:850; line-height:1; }
.bn-expansion-chip strong { color:#0b1f4d; font-size:.9rem; line-height:1.2; }
.bn-expansion-chip:hover { border-color:#93c5fd; background:#eff6ff; transform:translateY(-1px); }
.bn-expansion-chip.is-selected { border-color:#2563eb; background:#2563eb; color:#fff; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.bn-expansion-chip.is-selected small,.bn-expansion-chip.is-selected strong { color:#fff; }
.bn-term-detail { display:grid; gap:.9rem; padding:1rem 1.25rem; color:#475569; }
.bn-term-detail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; }
.bn-term-detail-card { display:grid; align-content:center; gap:.55rem; min-height:92px; padding:.9rem 1rem; border:1px solid #dbe5f1; border-radius:11px; background:#fff; color:#0b1f4d; text-align:center; overflow-x:auto; }
.bn-term-detail-kicker { display:inline-flex; align-items:center; justify-content:center; gap:.45rem; color:#526481; font-size:.72rem; font-weight:900; letter-spacing:.02em; }
.bn-term-detail-kicker i { display:inline-grid; place-items:center; width:24px; height:24px; border-radius:999px; background:#8ab4ff; color:#fff; font-style:normal; letter-spacing:0; text-transform:none; }
.bn-term-detail-card>strong { color:#0b1f4d; font-family:var(--font-display); font-size:clamp(1.05rem,1.8vw,1.35rem); line-height:1.35; }
.bn-term-powers { grid-template-columns:1fr auto 1fr; align-items:center; }
.bn-term-powers .bn-term-detail-kicker { grid-column:1 / -1; }
.bn-term-powers b { display:block; width:1px; height:34px; background:#cbd5e1; }
.bn-term-built>strong { color:#2563eb; font-size:clamp(1.35rem,2.6vw,1.85rem); }
.animate-chip-enter { animation:chipEnter .3s ease-out both; }
.animate-bar-grow { animation:barGrow .45s ease-out both; }
.animate-pascal-row-in { animation:pascalRowIn .35s ease-out both; }
.animate-pascal-cell-in { animation:pascalCellIn .3s ease-out both; }
.animate-detail-in { animation:detailIn .28s ease-out both; }
.animate-active-glow { animation:activeGlow .7s ease-out both; }
@keyframes barGrow { from { opacity:.4; transform:translateY(8px) scaleY(.88); } to { opacity:1; transform:translateY(0) scaleY(1); } }
@keyframes pascalRowIn { from { opacity:0; transform:translateY(-8px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes pascalCellIn { from { opacity:0; transform:translateY(6px) scale(.92); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes chipEnter { from { opacity:0; transform:translateY(8px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes detailIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes activeGlow { 0%,100% { box-shadow:0 0 0 rgba(37,99,235,0); } 50% { box-shadow:0 0 14px rgba(37,99,235,.14); } }
.bn-exercise-list { display:grid; gap:.85rem; padding:1.25rem; }
.bn-exercise-list .ex-shell { margin-bottom:0; }
.bn-exercise-list .ex-icon-box svg,
.bn-exercise-list .pp-id-icon svg,
.bn-exercise-list .pp-answer-icon svg { display:block; }
.bn-answer-field { flex:1 1 260px; min-width:min(100%,260px); }
.bn-answer-field input.bn-exercise-answer {
  width:100%;
  min-height:44px;
  padding:.55rem .7rem;
  border:1px solid #cbd5e1;
  border-radius:11px;
  color:var(--color-text);
  background:#fff;
  font:inherit;
}
.bn-answer-field input.bn-exercise-answer:focus {
  outline:0;
  border-color:#2563eb;
  box-shadow:0 0 0 3px #2563eb1f;
}
.bn-exercise-list .pp-answer-actions { margin-left:0; }
.bn-exercise-list .pp-answer-actions button {
  min-height:40px;
  border:1px solid #bfdbfe;
  border-radius:10px;
  background:#fff;
  color:#173d79;
  font-weight:850;
}
.bn-exercise-list .pp-answer-actions button:not(.secondary) {
  border-color:#1e40af;
  background:#0f3a78;
  color:#fff;
}
.bn-exercise-list .pp-answer-actions button:hover { transform:translateY(-1px); }
.bn-solution.pp-steps-interactive {
  display:block;
  height:auto;
  min-height:0;
  max-height:none;
  margin:.6rem 0 0;
  padding:.55rem;
  border:1px solid #dbeafe;
  border-radius:14px;
  background:#f8fbff;
  overflow:visible;
}
.bn-solution.pp-steps-interactive[hidden] { display:none; }
.bn-solution .pp-proof-block {
  margin:0;
  padding:.55rem .7rem;
}
.bn-solution .pp-proof-block-title {
  margin-bottom:.2rem;
}
.bn-solution .pp-steps-final { display:block; margin-top:.65rem; }
@media (max-width:800px) { .bn-identities-grid,.bn-formula-pair,.bn-example-steps { grid-template-columns:1fr; }.bn-result-steps { grid-template-columns:1fr; }.bn-result-steps>i { display:none; }.bn-guide-steps { flex-direction:column; }.bn-guide-steps>i { display:none; } }
@media (max-width:700px) { #bn-viz { padding:.85rem; } .bn-viz-hero { grid-template-columns:1fr; padding:1rem; } .bn-viz-hero-note { align-items:flex-start; flex-direction:column; } .bn-viz-hero-note strong { white-space:normal; } .bn-viz-pascal-photo { min-height:116px; place-items:center; } .bn-viz-pascal-photo img { height:118px; } .bn-viz-control { align-items:stretch; } .bn-viz-control label,.bn-viz-control input,.bn-viz-primary-btn,.bn-viz-secondary-btn { width:100%; flex:1 1 100%; } .bn-viz-step-btn { flex:1 1 0; width:auto; } .bn-term-detail-grid { grid-template-columns:1fr; } .bn-term-powers { grid-template-columns:1fr; } .bn-term-powers b { width:100%; height:1px; } .bn-pascal-cell { width:30px; height:30px; font-size:.74rem; } .bn-pascal-triangle { justify-items:start; } }
@media (max-width:520px) { .bn-coefficient-layout,.bn-calculator-layout,.bn-identities-grid,.bn-exercise-list { padding:.8rem; } #bn-id .bn-identities-hero { margin:.8rem .8rem 0; padding:1rem; } #bn-id .bn-identity-note { align-items:flex-start; flex-direction:column; } .bn-sum-build-head,.bn-sum-progress { grid-template-columns:1fr; flex-direction:column; align-items:stretch; } .bn-sum-actions { width:100%; } .bn-mini-btn { flex:1; } .bn-sum-progress span { white-space:normal; } .bn-input-grid { grid-template-columns:1fr; }.bn-hero-heading { align-items:start; }.bn-orbit { width:80px; flex-basis:80px; transform:scale(.85); transform-origin:top right; }.bn-actions,.bn-viz-control,.bn-exercise-work { flex-direction:column; }.bn-actions>*,.bn-viz-control>*,.bn-exercise-work>* { width:100%; }.bn-result-heading { align-items:start; flex-direction:column; } }
@media (max-width:800px) { #bn-calc .bn-calculator-main,#bn-calc .bn-calc-guide,#bn-calc .bn-calc-bottom-grid,#bn-calc .bn-input-grid { grid-template-columns:1fr; } #bn-calc .bn-calc-guide>i,#bn-calc .bn-result-steps>i { display:none; } #bn-calc .bn-calculator-hero { align-items:flex-start; flex-direction:column; } }
@media (max-width:520px) { #bn-calc .bn-calculator-layout { padding:.8rem; } .bn-hero-heading,.bn-example-head { flex-direction:column; }.bn-example-head .bn-secondary-btn { width:100%; }.bn-orbit { width:88px; height:76px; flex-basis:88px; transform:none; } }
@media (prefers-reduced-motion: reduce) { .bn-tab-enter,.bn-card-enter,.bn-result-panel,.bn-final-chip strong,.bn-pascal-row button,.bn-expansion button,.bn-orbit span,.bn-orbit::before,.bn-orbit i,.bn-orbit b,.bn-learning-column .bn-formula-box,.bn-guide-steps>i,.bn-example-development,.animate-fade-slide-up,.animate-soft-float,.animate-accordion-down,.animate-soft-pop,.animate-soft-glow,.animate-button-sweep,.animate-active-pulse,.animate-tooltip-in,.animate-result-pop,.animate-chip-enter,.animate-bar-grow,.animate-pascal-row-in,.animate-pascal-cell-in,.animate-detail-in,.animate-active-glow,.bn-sum-bar.is-revealed i,#bn-calc .bn-actions .lab-calc-btn:hover:after { animation:none !important; } .bn-step:hover,.bn-pascal-row button:hover,.bn-expansion button:hover,.bn-pascal-cell:hover,.bn-distribution-bar:hover i,.bn-distribution-bar.is-selected i,.bn-expansion-chip:hover,.bn-viz-step-btn:hover,#bn-calc .bn-actions .lab-calc-btn:hover,.bn-mini-btn:hover,.bn-progress-play:hover { transform:none; } }

/* Exercise content (Ejercicios guiados, dentro de .ex-shell-body) */
.pp-exercise-statement {
  margin: .35rem 0 .7rem;
  color: var(--color-text-soft);
  font-size: .92rem;
  line-height: 1.55;
}
.pp-exercise-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .8rem;
}
.pp-exercise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: .5rem;
}

/* Identification cards: Objetos / Cajas / Meta */
.pp-id-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .7rem;
  margin-bottom: .8rem;
}
.pp-id-card {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
}
.pp-id-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eef4ff;
  color: #1d4ed8;
  flex-shrink: 0;
}
.pp-id-text { min-width: 0; display: flex; flex-direction: column; }
.pp-id-label {
  font-weight: 800;
  color: #12366a;
  font-size: .92rem;
  margin-bottom: .15rem;
}
.pp-id-value {
  color: var(--color-text-soft);
  font-size: .86rem;
  line-height: 1.4;
}
.pp-id-aux {
  margin-top: .2rem;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 700;
}

/* Answer card: Tu respuesta + Verificar / Pista / Mostrar solución */
.pp-answer-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  margin-bottom: .7rem;
}
.pp-answer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef4ff;
  color: #1d4ed8;
  flex-shrink: 0;
}
.pp-answer-field { display: flex; flex-direction: column; gap: .3rem; }
.pp-answer-field label { font-size: .85rem; font-weight: 800; color: var(--color-text); }
.pp-answer-field input { width: 140px; }
.pp-answer-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-left: auto; }
.pp-answer-actions button { display: inline-flex; align-items: center; gap: .4rem; }

/* Hint */
.pp-hint-card {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .75rem .9rem;
  border-radius: 12px;
  border: 1px solid rgba(180, 131, 9, .25);
  background: linear-gradient(135deg, rgba(254,243,199,.55), #fff);
  color: #7a5b06;
  font-size: .86rem;
  line-height: 1.5;
  margin-bottom: .7rem;
}
.pp-hint-card[hidden] { display: none; }
.pp-hint-icon { color: #b45309; flex-shrink: 0; }

/* Feedback card */
.pp-feedback-card {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .75rem .9rem;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.5;
  margin-bottom: .7rem;
}
.pp-feedback-card[hidden] { display: none; }
.pp-feedback-card.is-incorrect { background: rgba(254,226,226,.55); border: 1px solid rgba(220,38,38,.25); color: #7f1d1d; }
.pp-feedback-card.is-correct { background: rgba(220,252,231,.55); border: 1px solid rgba(22,101,52,.25); color: #14532d; }
.pp-feedback-icon { flex-shrink: 0; }
.pp-proof-block {
  padding: .65rem .8rem;
  margin-bottom: .55rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 10px;
  background: #fff;
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1);
}
.pp-proof-block.is-in { opacity: 1; transform: translateY(0) scale(1); }
.pp-proof-block:last-child { margin-bottom: 0; }
.pp-proof-block-title {
  margin: 0 0 .3rem;
  font-size: .82rem;
  font-weight: 800;
  color: #1d4ed8;
}
.pp-proof-block p {
  margin: 0;
  font-size: .88rem;
  color: var(--color-text-soft);
  line-height: 1.5;
}

/* Step reveal (soluciones interactivas) */
.pp-steps-interactive { margin-top: .8rem; }
.pp-steps-list { display: grid; gap: .5rem; margin-bottom: .6rem; }
.pp-steps-list .rs-step-item {
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
.pp-steps-list .rs-step-item.is-in { opacity: 1; transform: translateY(0) scale(1); }
.pp-steps-final {
  margin-top: .6rem;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--blue-700);
  background: linear-gradient(135deg, rgba(219,234,254,.55), #f8fafc);
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1);
}
.pp-steps-final[hidden] { display: none; }
.pp-steps-final.is-in { opacity: 1; transform: translateY(0) scale(1); }
.pp-steps-final .formula-line { overflow-x: auto; }

/* Classic case cards */
.pp-classic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .9rem;
  margin-top: .9rem;
}
.pp-classic-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.pp-classic-card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}
.pp-classic-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--color-text-soft);
}
.pp-classic-row strong { color: var(--color-text); }
.pp-classic-question {
  margin: 0;
  font-size: .88rem;
  color: var(--color-text-soft);
  line-height: 1.5;
}
.pp-classic-explain {
  padding: .65rem .8rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  font-size: .86rem;
  color: #0b1f4d;
}
.pp-classic-explain[hidden] { display: none; }
.pp-classic-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

@media (max-width: 640px) {
  .pp-answer-card { flex-direction: column; align-items: stretch; }
  .pp-answer-field input { width: 100%; }
  .pp-answer-actions { margin-left: 0; }
}

/* HIDE BUBBLES (requested) ----------------------------------------------- */
/* Oculta las 'burbujas' del chat y la pequeña etiqueta del calculador. */
.cap6-ai-bubble,
.pp-calculator-badge {
  display: none !important;
}

/* Oculta las burbujas de tipo dentro de las cards de modelos P&C. */
#permutaciones-root .pc-model-card .pc-badge {
  display: none;
}

/* ===== Binomio — hero card concepto (sin video, columna única) ===== */
.bn-concepto-hero {
  padding: 1.5rem clamp(1.25rem, 3vw, 2rem);
  border-top: 3px solid #12366a;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.bn-concepto-hero::before {
  display: none;
}
.bn-concepto-hero h2 {
  margin: 0;
  font-size: clamp(1.1rem, 1.55vw, 1.42rem);
  line-height: 1.2;
  color: var(--color-text);
}
.bn-concepto-hero > p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: .93rem;
  line-height: 1.55;
}

/* Acento navy uniforme en todas las subtabs del binomio */
#p-binomio .bn-hero-card::before,
#p-binomio .bn-info-card::before,
#p-binomio .bn-guide::before,
#p-binomio .bn-example-card::before,
#p-binomio .bn-calculator-card::before,
#p-binomio .bn-identity-card::before,
#p-binomio .bn-exercise-card::before,
#bn-calc .bn-calculator-hero::before,
#bn-id .bn-identities-hero::before,
#bn-viz .bn-viz-hero::before {
  background: #12366a;
  opacity: 1;
}
