/* ============================================================
   PREVENCIÓN DEL ASI — Confianza Lúcida v3
   Design System — Layout adaptativo por sección
   Fundación para la Confianza + CUIDA-PUC
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ─── TOKENS ─── */
:root {
  --primary:     #1a4d65;
  --primary-l:   #d2e8f1;
  --primary-d:   #0f3347;
  --green:       #4A7C59;
  --green-l:     #d4e8da;
  --alert:       #A63D40;
  --alert-l:     #f3d5d6;
  --purple:      #6B4C6E;
  --purple-l:    #e0d4e1;

  --bg:          #faf8f5;
  --bg-alt:      #f3f0ec;
  --fg:          #1e1e1e;
  --fg2:         #4a4a4a;
  --fg3:         #888;
  --border:      #e4ddd4;
  --border-l:    #eeebe6;

  --serif:       'Source Serif 4', Georgia, serif;
  --sans:        'DM Sans', system-ui, sans-serif;
  --mono:        'JetBrains Mono', monospace;

  --ease:        cubic-bezier(.16, 1, .3, 1);
  --ease-out:    cubic-bezier(.33, 1, .68, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius:      8px;
  --radius-lg:   12px;

  /* Elevation / shadows */
  --shadow-xs:   0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.10);
  --shadow-xl:   0 16px 48px rgba(0,0,0,.14);

  /* Chapter color — overridden per unit */
  --chap:        #2E6B8A;
  --chap-l:      #d2e8f1;
  --chap-d:      #1a4d65;
  --chap-fade:   rgba(46,107,138,0.08);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}
/* Grain texture */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}
img { max-width: 100%; display: block; }
a { color: var(--chap); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--chap-l); color: var(--fg); }
button { font-family: var(--sans); }

/* ─── UTILITY ─── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.fade-up { animation: fadeUp .6s var(--ease) both; }
.d1 { animation-delay: .1s; } .d2 { animation-delay: .2s; } .d3 { animation-delay: .3s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════
   LAYOUT SYSTEM — Adaptive
   ═══════════════════════════════════════ */

/* === TOP NAV === */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 500;
  padding: .75rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(250,248,245,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-l);
  transition: transform .3s var(--ease);
}
.site-nav.hidden { transform: translateY(-100%); }
.site-nav a {
  font-family: var(--sans); font-size: .75rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fg3);
}
.site-nav a:hover { color: var(--fg); text-decoration: none; }
.nav-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--chap), color-mix(in srgb, var(--chap) 70%, #fff));
  transition: width .6s var(--ease);
  box-shadow: 0 0 8px color-mix(in srgb, var(--chap) 40%, transparent);
}

/* === HERO (unit intro) === */
.unit-hero {
  min-height: 80vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 6rem 2rem 4rem;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}
.unit-hero::after {
  content: '';
  position: absolute; bottom: 0; left: 2rem; right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--chap-l), transparent);
}
.unit-hero .hero-label {
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--chap); margin-bottom: .75rem; display: block;
}
.unit-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700; line-height: 1.18;
  letter-spacing: -.02em; color: var(--fg);
  margin-bottom: 1.25rem; max-width: 640px;
}
.unit-hero .hero-desc {
  font-size: 1.05rem; color: var(--fg2);
  line-height: 1.7; max-width: 560px;
}
.unit-hero .hero-meta {
  font-family: var(--mono); font-size: .7rem;
  color: var(--fg3); margin-top: 1.5rem;
  letter-spacing: .04em;
}

/* === SECTION — Full Width === */
.section-fw {
  max-width: 780px;
  margin: 0 auto;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border-l);
}
.section-fw h2 + p:first-of-type {
  margin-top: .25rem;
}
.section-fw .section-label {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--chap); margin-bottom: .6rem; display: block;
}
.section-fw h2 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 600; line-height: 1.3;
  margin-bottom: 1rem;
}
.section-fw p {
  font-size: .95rem; color: var(--fg2);
  margin-bottom: 1em; line-height: 1.75;
}
.section-fw p strong { color: var(--fg); }
.section-fw p em { font-family: var(--serif); font-style: italic; }

/* === SECTION — Two Panel === */
.section-2p {
  display: grid;
  grid-template-columns: 45fr 55fr;
  min-height: 90vh;
  border-top: 1px solid var(--border-l);
}
.section-2p .panel-text {
  padding: 6rem 2.5rem 4rem;
  max-width: 520px;
  margin-left: auto;
}
.section-2p .panel-text .section-label {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--chap); margin-bottom: .6rem; display: block;
}
.section-2p .panel-text h2 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 600; line-height: 1.3;
  margin-bottom: 1rem;
}
.section-2p .panel-text p {
  font-size: .93rem; color: var(--fg2);
  margin-bottom: 1em; line-height: 1.75;
}
.section-2p .panel-text p strong { color: var(--fg); }

.section-2p .panel-viz {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--chap);
  padding: 2rem;
  overflow-y: auto;
}
.section-2p .panel-viz .viz-inner {
  width: 90%; max-width: 540px;
  color: #fff; text-align: center;
}
.section-2p .panel-viz h3 {
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  opacity: .6; margin-bottom: 1.5rem;
}

/* === SECTION — Dark Full Width === */
.section-dark {
  background: var(--chap-d);
  color: #fff;
  padding: 5rem 2rem;
}
.section-dark .dark-inner {
  max-width: 780px;
  margin: 0 auto;
}
.section-dark .section-label {
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  opacity: .5; margin-bottom: .6rem; display: block;
}
.section-dark h2 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 600; line-height: 1.3;
  margin-bottom: 1rem;
}
.section-dark p {
  font-size: .95rem; opacity: .75;
  margin-bottom: 1em; line-height: 1.75;
}

/* ─── DETAIL TRIGGERS ─── */
.detail-trigger {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--sans);
  font-size: .8rem; font-weight: 600; color: var(--chap);
  cursor: pointer; border-bottom: 1.5px dotted color-mix(in srgb, var(--chap) 50%, transparent);
  padding-bottom: 2px;
  transition: all .2s var(--ease);
  margin-bottom: .3rem;
}
.detail-trigger::before { content: '→'; font-size: .7rem; opacity: .5; transition: transform .2s var(--ease); }
.detail-trigger:hover { opacity: .75; border-bottom-style: solid; }
.detail-trigger:hover::before { transform: translateX(2px); }
.section-dark .detail-trigger { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.4); }

/* ═══════════════════════════════════════
   INTERACTIVE COMPONENTS
   ═══════════════════════════════════════ */

/* ─── DRAG & DROP: DEFINITION CONSTRUCTOR ─── */
.constructor-wrap {
  display: flex; flex-direction: column; gap: 1.5rem;
  text-align: left;
}
.constructor-bank {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: 1rem; border-radius: var(--radius-lg);
  background: rgba(255,255,255,.08);
  min-height: 60px;
}
.constructor-target {
  min-height: 100px;
  padding: 1.25rem;
  border: 2px dashed rgba(255,255,255,.25);
  border-radius: var(--radius-lg);
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-content: flex-start;
  transition: border-color .3s, background .3s;
}
.constructor-target.drag-over {
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.06);
}
.constructor-target .target-placeholder {
  font-size: .82rem; opacity: .35; width: 100%;
  text-align: center; padding: 1rem 0;
}
.drag-chip {
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  padding: .45rem .9rem; border-radius: 100px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: #fff; cursor: grab;
  transition: all .25s var(--ease);
  user-select: none;
  touch-action: none;
}
.drag-chip:hover { background: rgba(255,255,255,.2); }
.drag-chip.dragging { opacity: .5; cursor: grabbing; }
.drag-chip.correct { background: rgba(74,200,178,.35); border-color: rgba(74,200,178,.7); }
.drag-chip.incorrect {
  animation: shake .4s var(--ease);
  background: rgba(255,100,100,.25); border-color: rgba(255,100,100,.5);
}
.drag-chip.in-target { cursor: pointer; }
@keyframes shake { 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }

/* Chip feedback tooltip */
.chip-feedback {
  display: none; font-size: .75rem; line-height: 1.4;
  padding: .5rem .75rem; margin-top: .5rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  text-align: left; width: 100%;
}
.chip-feedback.show { display: block; animation: fadeIn .3s; }

/* ─── SCENARIO CLASSIFIER ─── */
.scenario-box {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem; margin-bottom: .75rem;
  text-align: left; transition: all .3s var(--ease);
}
.scenario-box.answered { opacity: .85; }
.scenario-num {
  font-family: var(--mono); font-size: .65rem;
  opacity: .4; display: block; margin-bottom: .35rem;
}
.scenario-text {
  font-size: .88rem; line-height: 1.55;
  margin-bottom: .75rem; opacity: .88;
}
.scenario-btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.scenario-btn {
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  padding: .45rem .9rem; border-radius: 100px;
  border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: rgba(255,255,255,.7);
  cursor: pointer; transition: all .2s var(--ease);
}
.scenario-btn:hover { background: rgba(255,255,255,.12); color: #fff; transform: translateY(-1px); }
.scenario-btn.chosen { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.45); }
.scenario-btn.correct {
  background: rgba(74,200,178,.35); border-color: rgba(74,200,178,.7); color: #fff;
  box-shadow: 0 0 0 3px rgba(74,200,178,.15);
}
.scenario-btn.wrong {
  background: rgba(255,100,100,.25); border-color: rgba(255,100,100,.5); color: #fff;
  box-shadow: 0 0 0 3px rgba(255,100,100,.1);
}
.scenario-btn:disabled { cursor: default; opacity: .7; transform: none; }
.scenario-feedback {
  font-size: .8rem; opacity: .75; line-height: 1.55;
  margin-top: .6rem; display: none;
  padding: .6rem .85rem;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
}
.scenario-feedback.show { display: block; animation: fadeIn .3s; }

/* ─── QUIZ ─── */
.quiz-wrap { text-align: left; width: 100%; }
.quiz-q {
  margin-bottom: 2rem; padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-l);
}
.quiz-q:last-of-type { border-bottom: none; }
.quiz-q-text {
  font-size: .95rem; font-weight: 500;
  margin-bottom: .75rem; line-height: 1.5; color: var(--fg);
}
.quiz-q-opt {
  display: block; width: 100%; text-align: left;
  font-family: var(--sans); font-size: .88rem;
  padding: .75rem 1.1rem; margin-bottom: .45rem;
  border-radius: var(--radius); border: 1.5px solid var(--border);
  background: #fff; color: var(--fg2);
  cursor: pointer;
  transition: all .2s var(--ease);
  box-shadow: var(--shadow-xs);
}
.quiz-q-opt:hover {
  background: var(--bg-alt); border-color: var(--chap); color: var(--fg);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
.quiz-q-opt.selected {
  background: var(--chap-fade); border-color: var(--chap); color: var(--fg);
  font-weight: 500; box-shadow: 0 0 0 3px color-mix(in srgb, var(--chap) 12%, transparent);
}
.quiz-q-opt.correct {
  background: var(--green-l); border-color: var(--green); color: var(--fg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}
.quiz-q-opt.wrong {
  background: var(--alert-l); border-color: var(--alert); color: var(--fg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--alert) 12%, transparent);
}
.quiz-q-opt:disabled { cursor: default; transform: none; }
.quiz-q-fb {
  font-size: .85rem; color: var(--fg2);
  line-height: 1.5; margin-top: .5rem;
  display: none; padding: .5rem .75rem;
  background: var(--bg-alt); border-radius: var(--radius);
}
.quiz-q-fb.show { display: block; animation: fadeIn .3s; }

/* Dark quiz variant (on viz panels) */
.on-dark .quiz-q { border-color: rgba(255,255,255,.1); }
.on-dark .quiz-q-text { color: #fff; }
.on-dark .quiz-q-opt {
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.75);
}
.on-dark .quiz-q-opt:hover { background: rgba(255,255,255,.12); color: #fff; }
.on-dark .quiz-q-opt.selected { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
.on-dark .quiz-q-opt.correct { background: rgba(74,200,178,.3); border-color: rgba(74,200,178,.6); }
.on-dark .quiz-q-opt.wrong { background: rgba(255,100,100,.2); border-color: rgba(255,100,100,.5); }
.on-dark .quiz-q-fb { background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); }

/* Quiz submit */
.quiz-actions { text-align: center; margin-top: 1.5rem; display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: var(--sans); font-size: .85rem; font-weight: 600;
  padding: .7rem 2rem; border-radius: var(--radius);
  border: 2px solid var(--chap); background: var(--chap);
  color: #fff; cursor: pointer;
  transition: all .25s var(--ease);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--chap) 25%, transparent);
}
.btn:hover {
  background: var(--chap-d); border-color: var(--chap-d);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--chap) 35%, transparent);
}
.btn:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn:disabled { opacity: .35; cursor: default; transform: none; box-shadow: none; }
.btn-outline {
  background: transparent; color: var(--chap);
}
.btn-outline:hover { background: var(--chap-fade); }
.btn-sm { font-size: .78rem; padding: .5rem 1.25rem; }

.quiz-result {
  font-family: var(--mono); font-size: 1rem; font-weight: 600;
  margin-top: 1rem; padding: 1rem 1.25rem;
  border-radius: var(--radius-lg); text-align: center;
  animation: fadeUp .4s var(--ease);
}
.quiz-result.pass {
  background: linear-gradient(135deg, var(--green-l), color-mix(in srgb, var(--green-l) 50%, #fff));
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--green) 12%, transparent);
}
.quiz-result.fail {
  background: linear-gradient(135deg, var(--alert-l), color-mix(in srgb, var(--alert-l) 50%, #fff));
  color: var(--alert);
  border: 1px solid color-mix(in srgb, var(--alert) 25%, transparent);
}

/* ─── CHECKLIST ─── */
.check-list { text-align: left; }
.check-item {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .7rem 0; border-bottom: 1px solid var(--border-l);
  font-size: .88rem; color: var(--fg2); cursor: pointer;
  transition: color .2s;
}
.check-item:hover { color: var(--fg); }
.check-item input[type="checkbox"] {
  appearance: none; width: 20px; height: 20px;
  border: 2px solid var(--border); border-radius: 4px;
  flex-shrink: 0; margin-top: 2px; cursor: pointer;
  position: relative; transition: all .2s;
  background: #fff;
}
.check-item input:checked {
  background: var(--green); border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent);
}
.check-item input:checked::after {
  content: '✓'; position: absolute; color: #fff;
  font-size: .65rem; font-weight: 700;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  animation: checkPop .3s var(--ease-spring);
}
@keyframes checkPop { from { transform: translate(-50%,-50%) scale(0); } to { transform: translate(-50%,-50%) scale(1); } }
.progress-row {
  margin-top: 1.25rem; display: flex; align-items: center; gap: .75rem;
}
.progress-track {
  flex: 1; height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 70%, #aef0c6));
  border-radius: 3px; transition: width .5s var(--ease);
  box-shadow: 0 0 6px color-mix(in srgb, var(--green) 30%, transparent);
}
.progress-label {
  font-family: var(--mono); font-size: .75rem; color: var(--fg3);
}

/* ─── CALCULATOR ─── */
.calc-form { text-align: left; }
.calc-field { margin-bottom: 1.25rem; }
.calc-field label {
  display: block; font-size: .82rem; font-weight: 600;
  color: rgba(255,255,255,.7); margin-bottom: .4rem;
}
.calc-field input, .calc-field select {
  width: 100%; font-family: var(--sans);
  font-size: 1rem; padding: .65rem .85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff; outline: none;
  transition: border-color .2s;
}
.calc-field input:focus, .calc-field select:focus {
  border-color: rgba(255,255,255,.5);
}
.calc-field input::placeholder { color: rgba(255,255,255,.3); }
.calc-result {
  margin-top: 1.5rem; padding: 1.25rem;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  text-align: center; display: none;
}
.calc-result.show { display: block; animation: fadeIn .4s; }
.calc-big {
  font-family: var(--mono); font-size: clamp(2rem,5vw,3rem);
  font-weight: 700; line-height: 1.1;
}
.calc-sub { font-size: .82rem; opacity: .6; margin-top: .35rem; }
.calc-disclaimer {
  font-size: .72rem; opacity: .35; margin-top: 1rem;
  padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.1);
  line-height: 1.4;
}

/* ─── DATA EXPLORER (bars, stats) ─── */
.bar-row {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .7rem; text-align: left;
}
.bar-label {
  width: 150px; font-size: .8rem; opacity: .75;
  flex-shrink: 0; text-align: right;
}
.bar-track {
  flex: 1; height: 12px;
  background: rgba(255,255,255,.1);
  border-radius: 6px; overflow: hidden;
  cursor: pointer; position: relative;
}
.bar-fill {
  height: 100%; background: #fff;
  border-radius: 6px;
  transition: width 1s var(--ease);
}
.bar-value {
  font-family: var(--mono); font-size: .82rem;
  font-weight: 600; width: 50px;
}
.bar-tooltip {
  display: none; position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff;
  font-size: .75rem; padding: .5rem .75rem;
  border-radius: var(--radius);
  white-space: nowrap; pointer-events: none;
  z-index: 10;
}
.bar-track:hover .bar-tooltip,
.bar-track.active .bar-tooltip { display: block; }

.stat-card {
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: 1.25rem; text-align: left;
  margin-top: 1rem;
}
.stat-card .stat-num {
  font-family: var(--mono); font-size: 2.2rem; font-weight: 700;
}
.stat-card .stat-text { font-size: .85rem; opacity: .6; margin-top: .2rem; }
.stat-card .stat-detail { font-size: .72rem; opacity: .4; margin-top: .3rem; }

/* ─── TRIANGLE DIAGRAM ─── */
.triangle-wrap {
  position: relative; width: 100%; max-width: 460px;
  margin: 0 auto; aspect-ratio: 1;
}
.triangle-svg {
  width: 100%; height: 100%;
}
.triangle-node {
  cursor: pointer; transition: transform .3s var(--ease);
}
.triangle-node:hover { transform: scale(1.05); }
.triangle-factors {
  margin-top: 1.5rem;
}
.factor-chip {
  display: inline-block;
  font-family: var(--sans); font-size: .75rem; font-weight: 600;
  padding: .35rem .7rem; margin: .2rem;
  border-radius: 100px; cursor: grab;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.8);
  transition: all .2s; user-select: none;
  touch-action: none;
}
.factor-chip:hover { background: rgba(255,255,255,.15); }
.factor-chip.placed { opacity: .4; cursor: default; }
.factor-chip.risk { border-color: rgba(255,100,100,.4); color: rgba(255,150,150,.9); }
.factor-chip.protect { border-color: rgba(74,200,178,.4); color: rgba(74,200,178,.9); }

.drop-zone {
  min-height: 50px; padding: .5rem;
  border: 2px dashed rgba(255,255,255,.15);
  border-radius: var(--radius);
  margin-top: .5rem;
  transition: all .3s;
}
.drop-zone.drag-over {
  border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.05);
}

/* ─── BARRIER SIMULATOR (Finkelhor) ─── */
.barriers-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .75rem; text-align: left;
}
.barrier-col {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  padding: 1rem .75rem;
  text-align: center;
  transition: background .3s;
}
.barrier-col.secured { background: rgba(74,200,178,.12); }
.barrier-title {
  font-family: var(--sans); font-size: .72rem;
  font-weight: 700; opacity: .6;
  margin-bottom: .5rem; min-height: 2.5em;
}
.barrier-icon {
  font-size: 2rem; margin-bottom: .5rem;
  transition: transform .3s var(--ease);
}
.barrier-col.secured .barrier-icon { transform: scale(1.1); }
.barrier-measures {
  min-height: 80px; padding: .5rem;
  border: 2px dashed rgba(255,255,255,.12);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: .3rem;
  align-items: center;
  transition: border-color .3s;
}
.barrier-measures.drag-over { border-color: rgba(255,255,255,.4); }

.measure-bank {
  display: flex; flex-wrap: wrap; gap: .4rem;
  justify-content: center; margin-top: 1.5rem;
  padding: 1rem; background: rgba(255,255,255,.04);
  border-radius: var(--radius-lg);
}
.measure-chip {
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  padding: .35rem .7rem; border-radius: 100px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
  cursor: grab; user-select: none; touch-action: none;
  transition: all .2s;
}
.measure-chip:hover { background: rgba(255,255,255,.14); }
.measure-chip.placed { opacity: .3; cursor: default; }

/* ─── RADAR CHART (self-diagnosis) ─── */
.radar-wrap {
  display: flex; gap: 2rem; align-items: flex-start;
  flex-wrap: wrap;
}
.radar-controls {
  flex: 1; min-width: 280px;
}
.radar-field {
  margin-bottom: 1rem;
}
.radar-field label {
  display: block; font-size: .82rem; font-weight: 600;
  margin-bottom: .3rem;
}
.radar-field .slider-row {
  display: flex; align-items: center; gap: .75rem;
}
.radar-field input[type="range"] {
  flex: 1; accent-color: var(--chap);
}
.radar-field .slider-val {
  font-family: var(--mono); font-size: .78rem;
  min-width: 50px; text-align: center;
}
.radar-canvas-wrap {
  flex: 0 0 260px;
}

/* ─── SLIDE-OUT PANEL ─── */
.panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 2000; opacity: 0; visibility: hidden;
  transition: all .35s var(--ease);
  backdrop-filter: blur(4px);
}
.panel-overlay.open { opacity: 1; visibility: visible; }
.slide-panel {
  position: fixed; top: 0; right: 0;
  width: min(480px, 90vw); height: 100vh;
  background: var(--bg); z-index: 2001;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0,0,0,.12);
  border-left: 1px solid var(--border-l);
}
.slide-panel.open { transform: translateX(0); }
.panel-head {
  padding: 1.75rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between;
  align-items: flex-start;
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.panel-head h3 { font-family: var(--serif); font-size: 1.15rem; max-width: 85%; }
.panel-head .panel-tag {
  font-family: var(--sans); font-size: .65rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--chap); margin-bottom: .3rem; display: block;
}
.panel-close {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--fg3); padding: .3rem;
  border-radius: 4px; flex-shrink: 0;
  line-height: 1;
}
.panel-close:hover { color: var(--fg); }
.panel-body {
  padding: 1.5rem 2rem 3rem;
  font-size: .93rem; line-height: 1.8; color: var(--fg2);
}
.panel-body p { margin-bottom: 1em; }
.panel-body strong { color: var(--fg); }
.panel-body h4 {
  font-family: var(--sans); font-size: .95rem; font-weight: 600;
  color: var(--fg); margin: 1.5rem 0 .5rem;
}
.panel-body blockquote {
  border-left: 3px solid var(--chap);
  padding: .75rem 1rem; margin: 1.25rem 0;
  background: var(--chap-fade);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif); font-style: italic;
}
.panel-body ul { padding-left: 1.2rem; margin-bottom: 1em; }
.panel-body li { margin-bottom: .3em; }

/* ─── VIDEO SLOT (capsule placeholder) ─── */
/* === CANVAS INTERACTIVO (reemplaza video-slot) === */
.canvas-slot {
  border-radius: var(--radius-lg);
  margin: 2.5rem 0;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: box-shadow .3s var(--ease);
}
.canvas-slot:hover {
  box-shadow: var(--shadow-lg);
}
.canvas-slot-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.25rem;
  background: linear-gradient(135deg, var(--bg-alt), color-mix(in srgb, var(--chap) 4%, var(--bg-alt)));
  border-bottom: 1px solid var(--border);
}
.canvas-slot-tag {
  font-size: .6rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--chap);
  background: color-mix(in srgb, var(--chap) 10%, transparent);
  padding: .22rem .6rem; border-radius: 20px;
}
.canvas-slot-title {
  font-size: .84rem; font-weight: 600; color: var(--fg2); margin: 0;
}
.canvas-slot-body {
  background: var(--bg);
  min-height: 260px;
  display: flex; align-items: center; justify-content: center;
}
.canvas-pending {
  text-align: center; padding: 3rem 2rem;
  color: var(--fg3);
}
.canvas-pending-icon {
  font-size: 2.5rem; opacity: .2; margin-bottom: 1rem; display: block;
  line-height: 1;
}
.canvas-pending p { font-size: .82rem; margin-bottom: .3rem; color: var(--fg3); }
.canvas-pending small { font-size: .7rem; opacity: .6; }
/* When canvas code is injected it fills the body */
.canvas-slot-body > *:not(.canvas-pending) {
  width: 100%; min-height: 260px;
}

.section-dark .canvas-slot { border-color: rgba(255,255,255,.12); }
.section-dark .canvas-slot-header { background: rgba(255,255,255,.04); border-bottom-color: rgba(255,255,255,.1); }
.section-dark .canvas-slot-title { color: rgba(255,255,255,.8); }
.section-dark .canvas-slot-body { background: rgba(255,255,255,.02); }

/* Legacy video-slot (mantener por compatibilidad) */
.video-slot {
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem; text-align: center;
  margin: 2rem 0;
}
.video-slot .video-icon { font-size: 2rem; opacity: .3; margin-bottom: .5rem; }
.video-slot .video-title { font-weight: 600; font-size: .9rem; color: var(--fg2); margin-bottom: .3rem; }
.video-slot .video-desc { font-size: .78rem; color: var(--fg3); line-height: 1.5; }
.section-dark .video-slot { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); }
.section-dark .video-slot .video-title { color: rgba(255,255,255,.7); }
.section-dark .video-slot .video-desc { color: rgba(255,255,255,.4); }

/* ─── UNIT FOOTER ─── */
.unit-footer {
  max-width: 780px; margin: 0 auto;
  padding: 3rem 2rem 5rem;
  border-top: 1px solid var(--border);
}
.unit-footer-nav {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem;
}
.unit-footer-nav a {
  font-family: var(--sans); font-size: .85rem;
  font-weight: 600; color: var(--fg2);
  padding: .5rem .75rem;
  border-radius: var(--radius);
  transition: all .2s var(--ease);
}
.unit-footer-nav a:hover {
  color: var(--chap); text-decoration: none;
  background: var(--chap-fade);
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 900px) {
  .section-2p {
    grid-template-columns: 1fr;
  }
  .section-2p .panel-text {
    padding: 3rem 1.5rem 2rem;
    max-width: 100%;
    margin-left: 0;
  }
  .section-2p .panel-viz {
    position: relative; height: auto;
    min-height: 60vh; padding: 2rem 1.5rem;
  }
  .unit-hero { padding: 5rem 1.5rem 3rem; min-height: 60vh; }
  .section-fw { padding: 3rem 1.5rem; }
  .section-dark { padding: 3rem 1.5rem; }
  .site-nav { padding: .6rem 1.25rem; }
  .barriers-grid { grid-template-columns: repeat(2, 1fr); }
  .radar-wrap { flex-direction: column; }
  .radar-canvas-wrap { flex: 0 0 auto; width: 100%; max-width: 300px; margin: 0 auto; }
}

@media (max-width: 480px) {
  .barriers-grid { grid-template-columns: 1fr; }
  .bar-label { width: 100px; font-size: .72rem; }
}

/* ═══════════════════════════════════════
   HOME PAGE STYLES
   ═══════════════════════════════════════ */
.home-body {
  background: #1a1a1e;
  background-image: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(46,107,138,.08) 0%, transparent 50%);
  color: #fff;
}
.home-body::before { display: none; }
.home-wrap { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.home-hero {
  min-height: 80vh; display: flex; flex-direction: column;
  justify-content: center; padding: 4rem 0;
}
.home-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700; line-height: 1.12;
  letter-spacing: -.03em; max-width: 700px;
  background: linear-gradient(135deg, #fff 60%, rgba(255,255,255,.6));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-hero .home-desc {
  font-size: 1.05rem; opacity: .6;
  max-width: 520px; margin-top: 1.25rem; line-height: 1.7;
}
.home-hero .home-meta {
  font-family: var(--mono); font-size: .72rem;
  opacity: .3; margin-top: 2rem; letter-spacing: .04em;
}

.blocks { padding: 4rem 0 6rem; }
.block-row { margin-bottom: 4.5rem; }
.block-head {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 1.25rem;
}
.block-num {
  font-family: var(--mono); font-size: .7rem;
  opacity: .3; letter-spacing: .04em;
}
.block-title {
  font-family: var(--serif); font-size: 1.45rem; font-weight: 600;
  letter-spacing: -.01em;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: .75rem;
}
.tile {
  display: block; border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.25rem; min-height: 190px;
  text-decoration: none; color: #fff;
  position: relative; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease);
}
.tile::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.08) 0%, transparent 60%);
  pointer-events: none;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
  text-decoration: none;
}
.tile .tile-label {
  font-family: var(--mono); font-size: .65rem;
  opacity: .5; display: block; margin-bottom: .5rem;
}
.tile h3 {
  font-family: var(--sans); font-size: 1rem;
  font-weight: 600; line-height: 1.35; margin-bottom: .5rem;
}
.tile p { font-size: .78rem; opacity: .6; line-height: 1.5; }
.tile .tile-dur {
  font-family: var(--mono); font-size: .65rem;
  opacity: .35; margin-top: .85rem; display: block;
}

.b1 { background: linear-gradient(145deg, #3378a0, #2E6B8A 40%, #245a75); }
.b1:hover { background: linear-gradient(145deg, #3e88b2, #357a9c 40%, #2d6b88); }
.b2 { background: linear-gradient(145deg, #7e5d82, #6B4C6E 40%, #5a3f5c); }
.b2:hover { background: linear-gradient(145deg, #8f6d93, #7d5c80 40%, #6b4f6d); }
.b3 { background: linear-gradient(145deg, #b94e52, #A63D40 40%, #8e3335); }
.b3:hover { background: linear-gradient(145deg, #c85d60, #b84d50 40%, #a04244); }
.b4 { background: linear-gradient(145deg, #5b916b, #4A7C59 40%, #3d6a4b); }
.b4:hover { background: linear-gradient(145deg, #6ba37b, #5a8e6a 40%, #4d7c5a); }

/* Disabled tiles for unpublished units */
.tile.disabled {
  opacity: .4; cursor: default;
  pointer-events: none;
}

.home-foot {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 2.5rem 0; text-align: center;
}
.home-foot p { font-size: .78rem; opacity: .3; line-height: 1.6; }
.home-foot a { color: rgba(255,255,255,.5); }

/* ═══ LOGOS ═══ */
.logo-fplc {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--serif); font-size: .65rem; font-weight: 500;
  opacity: .5; transition: opacity .3s ease;
}
.logo-fplc:hover { opacity: 1; }
.logo-fplc svg { width: 20px; height: 20px; }

.nav-logo {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--serif); font-size: .55rem; font-weight: 500;
  color: var(--chap); opacity: .6;
  text-decoration: none;
}
.nav-logo:hover { opacity: 1; text-decoration: none; }
.nav-logo svg { width: 16px; height: 16px; }

.tagline-lema {
  font-family: var(--serif); font-size: .7rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg3); margin-top: 1rem;
  opacity: .5;
}

/* ═══════════════════════════════════════
   CONTENT WARNING / TRIGGER WARNING
   ═══════════════════════════════════════ */
#content-warning {
  position: fixed; inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}
.content-warning {
  max-width: 680px; margin: 0 auto;
  padding: 2.5rem 2rem;
  background: var(--alert-l);
  border: 2px solid var(--alert);
  border-radius: var(--radius-lg);
  text-align: center;
}
.content-warning h3 {
  font-family: var(--sans); font-size: 1rem; font-weight: 700;
  color: var(--alert); margin-bottom: .75rem;
}
.content-warning p {
  font-size: .88rem; color: var(--fg2);
  line-height: 1.65; margin-bottom: .75rem;
}
.content-warning .cw-helplines {
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid rgba(166,61,64,.2);
  text-align: left;
}
.content-warning .cw-helplines h4 {
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  color: var(--alert); margin-bottom: .5rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.content-warning .cw-helplines ul {
  list-style: none; padding: 0;
}
.content-warning .cw-helplines li {
  font-size: .82rem; color: var(--fg2);
  padding: .3rem 0; line-height: 1.5;
}
.content-warning .cw-helplines li strong {
  color: var(--fg);
}
.content-warning .btn-cw {
  margin-top: 1.25rem;
  font-family: var(--sans); font-size: .85rem; font-weight: 600;
  padding: .7rem 2.5rem; border-radius: var(--radius);
  border: 2px solid var(--alert); background: var(--alert);
  color: #fff; cursor: pointer; transition: all .2s;
}
.content-warning .btn-cw:hover { background: #8a3335; border-color: #8a3335; }

/* Home page dark variant */
.home-body .content-warning {
  background: rgba(166,61,64,.15);
  border-color: rgba(166,61,64,.5);
}
.home-body .content-warning h3 { color: #e8777a; }
.home-body .content-warning p { color: rgba(255,255,255,.7); }
.home-body .content-warning .cw-helplines { border-color: rgba(166,61,64,.3); }
.home-body .content-warning .cw-helplines h4 { color: #e8777a; }
.home-body .content-warning .cw-helplines li { color: rgba(255,255,255,.6); }
.home-body .content-warning .cw-helplines li strong { color: #fff; }

/* ═══════════════════════════════════════
   LEARNING OBJECTIVES
   ═══════════════════════════════════════ */
.learning-objectives {
  background: linear-gradient(135deg, var(--chap-fade), color-mix(in srgb, var(--chap) 3%, #fff));
  border-left: 4px solid var(--chap);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.75rem 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-xs);
}
.learning-objectives h3 {
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--chap); margin-bottom: .75rem;
}
.learning-objectives ul {
  list-style: none; padding: 0; margin: 0;
}
.learning-objectives li {
  font-size: .88rem; color: var(--fg2);
  line-height: 1.6; padding: .3rem 0 .3rem 1.5rem;
  position: relative;
}
.learning-objectives li::before {
  content: '→'; position: absolute; left: 0;
  color: var(--chap); font-weight: 700;
}

/* ═══════════════════════════════════════
   BIBLIOGRAPHY / REFERENCES
   ═══════════════════════════════════════ */
.bibliography {
  max-width: 780px; margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 2px solid var(--border-l);
}
.bibliography h2 {
  font-family: var(--serif);
  font-size: 1.2rem; font-weight: 600;
  margin-bottom: 1.25rem;
}
.bibliography ol {
  padding-left: 1.5rem;
}
.bibliography li {
  font-size: .82rem; color: var(--fg2);
  line-height: 1.6; margin-bottom: .6rem;
}
.bibliography li em {
  font-family: var(--serif); font-style: italic;
}

/* ═══════════════════════════════════════
   LEGAL FRAMEWORK BOX
   ═══════════════════════════════════════ */
.legal-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--chap);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}
.legal-box h4 {
  font-family: var(--sans); font-size: .82rem; font-weight: 700;
  color: var(--fg); margin-bottom: .5rem;
}
.legal-box p {
  font-size: .85rem; color: var(--fg2);
  line-height: 1.6; margin-bottom: .5rem;
}
.legal-box .country-tag {
  display: inline-block; font-family: var(--mono);
  font-size: .65rem; font-weight: 600;
  padding: .2rem .5rem; border-radius: 100px;
  background: var(--chap-fade); color: var(--chap);
  margin-right: .3rem; margin-bottom: .3rem;
}

/* ═══════════════════════════════════════
   SELF-CARE BANNER
   ═══════════════════════════════════════ */
.selfcare-banner {
  max-width: 780px; margin: 0 auto;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #fef8e7, #fdf3d7);
  border: 1px solid #e8d48a;
  border-radius: var(--radius-lg);
  display: flex; gap: 1rem; align-items: flex-start;
  box-shadow: 0 2px 12px rgba(232,212,138,.15);
}
.selfcare-banner .sc-icon {
  font-size: 1.5rem; flex-shrink: 0; margin-top: .1rem;
}
.selfcare-banner .sc-text h4 {
  font-family: var(--sans); font-size: .85rem; font-weight: 700;
  color: #8a6d1b; margin-bottom: .3rem;
}
.selfcare-banner .sc-text p {
  font-size: .82rem; color: #6b5a2e;
  line-height: 1.5; margin: 0;
}

/* ═══════════════════════════════════════
   CERTIFICATE
   ═══════════════════════════════════════ */
.certificate-section {
  max-width: 780px; margin: 0 auto;
  padding: 4rem 2rem; text-align: center;
}
.certificate-card {
  border: 3px solid var(--chap);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  background: linear-gradient(135deg, #fff, #faf8f5);
  position: relative;
  box-shadow: var(--shadow-lg);
}
.certificate-card::before {
  content: ''; position: absolute; inset: 8px;
  border: 1px solid var(--chap-l);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
}
.certificate-card h2 {
  font-family: var(--serif);
  font-size: 1.6rem; font-weight: 700;
  color: var(--chap-d); margin-bottom: .5rem;
}
.certificate-card .cert-subtitle {
  font-family: var(--sans); font-size: .82rem;
  color: var(--fg3); margin-bottom: 2rem;
}
.certificate-card .cert-name {
  font-family: var(--serif); font-size: 1.8rem;
  font-weight: 600; font-style: italic;
  color: var(--fg); margin-bottom: 1.5rem;
  padding: .5rem 0;
  border-bottom: 2px solid var(--chap-l);
}
.certificate-card .cert-body {
  font-size: .9rem; color: var(--fg2);
  line-height: 1.7; margin-bottom: 2rem;
}
.certificate-card .cert-date {
  font-family: var(--mono); font-size: .75rem;
  color: var(--fg3);
}
.certificate-card .cert-orgs {
  margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border-l);
  font-size: .78rem; color: var(--fg3);
}

/* Certificate form */
.cert-form {
  max-width: 400px; margin: 2rem auto 0;
}
.cert-form label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--fg2); margin-bottom: .4rem; text-align: left;
}
.cert-form input {
  width: 100%; font-family: var(--sans);
  font-size: 1rem; padding: .65rem .85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff; color: var(--fg);
  outline: none; margin-bottom: 1rem;
}
.cert-form input:focus { border-color: var(--chap); }

/* ═══════════════════════════════════════
   GLOBAL PROGRESS BAR (home)
   ═══════════════════════════════════════ */
.global-progress {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem 2rem;
}
.global-progress .gp-bar {
  height: 8px; background: rgba(255,255,255,.08);
  border-radius: 4px; overflow: hidden;
}
.global-progress .gp-fill {
  height: 100%;
  background: linear-gradient(90deg, #2E6B8A, #6B4C6E, #A63D40, #4A7C59);
  background-size: 300% 100%;
  border-radius: 4px; transition: width .8s var(--ease);
  box-shadow: 0 0 12px rgba(74,124,89,.3);
}
.global-progress .gp-label {
  font-family: var(--mono); font-size: .7rem;
  color: rgba(255,255,255,.3); margin-top: .5rem;
  text-align: right;
}

/* ═══════════════════════════════════════
   ABOUT SECTION (home)
   ═══════════════════════════════════════ */
.about-section {
  max-width: 780px; margin: 0 auto;
  padding: 4rem 2rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.about-section h2 {
  font-family: var(--serif);
  font-size: 1.4rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.about-section p {
  font-size: .9rem; opacity: .6;
  line-height: 1.7; margin-bottom: 1rem;
}
.about-section .about-orgs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin-top: 2rem;
}
.about-section .org-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all .25s var(--ease);
}
.about-section .org-card:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.14);
  transform: translateY(-2px);
}
.about-section .org-card h3 {
  font-family: var(--sans); font-size: .9rem; font-weight: 600;
  margin-bottom: .5rem;
}
.about-section .org-card p {
  font-size: .82rem; opacity: .5;
  line-height: 1.55;
}
@media (max-width: 600px) {
  .about-section .about-orgs { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   SCENARIO BUILDER (protocol design)
   ═══════════════════════════════════════ */
.protocol-step {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: .75rem;
  display: flex; gap: 1rem; align-items: flex-start;
}
.protocol-step .step-num {
  font-family: var(--mono); font-size: .7rem;
  font-weight: 700; color: var(--chap);
  background: var(--chap-fade);
  width: 28px; height: 28px;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.protocol-step .step-content h4 {
  font-family: var(--sans); font-size: .88rem;
  font-weight: 600; margin-bottom: .25rem;
}
.protocol-step .step-content p {
  font-size: .82rem; color: var(--fg2);
  line-height: 1.5; margin: 0;
}

/* ═══════════════════════════════════════
   SKIP LINK (accessibility)
   ═══════════════════════════════════════ */
.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--chap); color: #fff;
  padding: .5rem 1rem; z-index: 10000;
  font-family: var(--sans); font-size: .85rem;
  font-weight: 600; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ═══════════════════════════════════════
   FOCUS STYLES (accessibility)
   ═══════════════════════════════════════ */
*:focus-visible {
  outline: 3px solid var(--chap);
  outline-offset: 2px;
}
.drag-chip:focus-visible,
.factor-chip:focus-visible,
.measure-chip:focus-visible {
  outline: 3px solid rgba(255,255,255,.8);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════
   VERSION FOOTER
   ═══════════════════════════════════════ */
.version-tag {
  font-family: var(--mono); font-size: .6rem;
  opacity: .25; margin-top: .5rem;
}

/* ═══════════════════════════════════════
   CUSTOM SCROLLBAR
   ═══════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 4px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--fg3); border: 2px solid transparent; background-clip: padding-box; }
.home-body ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border: 2px solid transparent; background-clip: padding-box; }
.home-body ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); border: 2px solid transparent; background-clip: padding-box; }

/* ═══════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════ */
.home-body ::selection { background: rgba(255,255,255,.2); color: #fff; }

/* ═══════════════════════════════════════
   LINK HOVER TRANSITIONS (global polish)
   ═══════════════════════════════════════ */
.section-fw a:not(.btn):not(.detail-trigger) {
  transition: color .2s var(--ease);
  text-underline-offset: 3px;
}

/* ═══════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════ */
@media print {
  .site-nav, .nav-progress, .panel-overlay, .slide-panel,
  .quiz-actions, .btn, .skip-link { display: none !important; }
  .section-2p { display: block; }
  .section-2p .panel-viz { position: static; height: auto; background: #eee; color: #333; }
  body::before { display: none; }
}
