    /* ── Variables locales ── */
    :root {
      --norm-panel-w: min(760px, 94vw);
    }

    /* ── Hero de normativa ── */
    .norm-hero {
      background: linear-gradient(135deg, var(--red) 0%, var(--red-darker) 100%);
      color: #fff;
      padding: 2.4rem 2rem 2rem;
      border-radius: var(--radius-lg);
      margin-bottom: 1.8rem;
      position: relative;
      overflow: hidden;
    }
    .norm-hero::after {
      content: '⚖';
      position: absolute;
      right: 2rem; top: 50%;
      transform: translateY(-50%);
      font-size: 6rem;
      opacity: .12;
      pointer-events: none;
    }
    .norm-hero h1 { margin: 0 0 .4rem; font-size: 1.65rem; font-weight: 800; }
    .norm-hero p  { margin: 0; opacity: .88; font-size: .97rem; max-width: 560px; line-height: 1.55; }

    /* ── Toolbar de búsqueda y filtros ── */
    .norm-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: .7rem;
      align-items: center;
      margin-bottom: 1.2rem;
    }
    .norm-search-wrap {
      position: relative;
      flex: 1 1 240px;
    }
    .norm-search-wrap::before {
      content: '🔍';
      position: absolute;
      left: .8rem; top: 50%;
      transform: translateY(-50%);
      font-size: .9rem;
      pointer-events: none;
    }
    #norm-search {
      width: 100%;
      padding: .62rem .9rem .62rem 2.2rem;
      border: 1.5px solid var(--red-border);
      border-radius: var(--radius-md);
      font-family: var(--font);
      font-size: .9rem;
      background: var(--surface);
      color: var(--text);
      transition: border-color .2s, box-shadow .2s;
      box-sizing: border-box;
    }
    #norm-search:focus {
      outline: none;
      border-color: var(--red);
      box-shadow: 0 0 0 3px var(--red-glow);
    }
    .norm-select {
      padding: .6rem .9rem;
      border: 1.5px solid #d1d5db;
      border-radius: var(--radius-md);
      font-family: var(--font);
      font-size: .88rem;
      background: var(--surface);
      color: var(--text-2);
      cursor: pointer;
      transition: border-color .2s;
    }
    .norm-select:focus, .norm-select:hover { border-color: var(--red); outline: none; }
    #filter-clear {
      padding: .6rem 1rem;
      border: 1.5px solid #d1d5db;
      border-radius: var(--radius-md);
      background: var(--surface);
      color: var(--text-2);
      font-size: .85rem;
      cursor: pointer;
      transition: all .2s;
      white-space: nowrap;
    }
    #filter-clear:hover { border-color: var(--red); color: var(--red); }

    /* ── Contador ── */
    .norm-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
    #norm-counter { font-size: .85rem; color: var(--text-3); }

    /* ── Grilla de tarjetas ── */
    #norm-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.1rem;
    }
    .norm-card {
      background: var(--surface);
      border-radius: var(--radius-md);
      border: 1.5px solid #e5e7eb;
      padding: 1.2rem;
      cursor: pointer;
      transition: box-shadow .2s, transform .18s, border-color .2s;
      display: flex;
      flex-direction: column;
      gap: .5rem;
    }
    .norm-card:hover, .norm-card:focus {
      box-shadow: var(--shadow-red);
      border-color: var(--red-border);
      transform: translateY(-3px);
      outline: none;
    }
    .norm-card-header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
    .norm-badge {
      font-size: .7rem; font-weight: 700; letter-spacing: .03em;
      padding: .18rem .6rem; border-radius: 99px;
      text-transform: uppercase;
    }
    .badge-dl { background: #dbeafe; color: #1d4ed8; }
    .badge-ds { background: #fef3c7; color: #92400e; }
    .badge-rd { background: #d1fae5; color: #065f46; }
    .norm-estado {
      font-size: .7rem; font-weight: 600; padding: .18rem .55rem;
      border-radius: 99px; margin-left: auto;
    }
    .estado-vigente   { background: #dcfce7; color: #166534; }
    .estado-modificado { background: #fef9c3; color: #713f12; }
    .estado-parcial   { background: #ffedd5; color: #9a3412; }
    .estado-derogado  { background: #fee2e2; color: #991b1b; }

    .norm-card-title  { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.38; margin: 0; }
    .norm-card-numero { font-size: .8rem; color: var(--red); font-weight: 600; margin: 0; }
    .norm-card-fecha  { font-size: .78rem; color: var(--text-3); margin: 0; }
    .norm-fases       { display: flex; flex-wrap: wrap; gap: .3rem; }
    .norm-temas       { display: flex; flex-wrap: wrap; gap: .3rem; }
    .fase-chip {
      font-size: .68rem; padding: .15rem .5rem; border-radius: 99px;
      background: var(--red-pale); color: var(--red-dark); font-weight: 600; border: 1px solid var(--red-border);
    }
    .fase-chip.large { font-size: .8rem; padding: .2rem .65rem; }
    .tema-chip {
      font-size: .68rem; padding: .15rem .5rem; border-radius: 99px;
      background: #f3f4f6; color: var(--text-2); border: 1px solid #e5e7eb;
    }
    .norm-card-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: auto;
      padding-top: .5rem;
      border-top: 1px solid #f3f4f6;
    }
    .norm-card-stats  { font-size: .73rem; color: var(--text-3); }
    .norm-card-arrow  { font-size: .78rem; color: var(--red); font-weight: 600; opacity: 0; transition: opacity .15s; }
    .norm-card:hover .norm-card-arrow, .norm-card:focus .norm-card-arrow { opacity: 1; }

    .norm-empty {
      grid-column: 1 / -1;
      text-align: center;
      color: var(--text-3);
      padding: 3rem 1rem;
      font-size: .95rem;
    }

    /* ── Loading / error ── */
    #norm-loading {
      text-align: center; padding: 3rem 1rem;
      color: var(--text-2); font-size: .95rem;
    }
    .norm-spinner {
      display: inline-block; width: 2rem; height: 2rem;
      border: 3px solid var(--red-border);
      border-top-color: var(--red);
      border-radius: 50%;
      animation: spin .7s linear infinite;
      margin-bottom: .7rem;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    #norm-error { display: none; color: var(--red); padding: 1rem; border-radius: var(--radius-md); background: var(--red-pale); }

    /* ── Panel lateral deslizante ── */
    #norm-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,.38);
      z-index: 1000;
      opacity: 0;
      pointer-events: none;
      transition: opacity .25s;
    }
    #norm-panel {
      position: fixed;
      top: 0; right: 0; bottom: 0;
      width: var(--norm-panel-w);
      background: var(--surface);
      z-index: 1001;
      transform: translateX(100%);
      transition: transform .3s cubic-bezier(.4,0,.2,1);
      overflow: hidden;
      box-shadow: -4px 0 40px rgba(0,0,0,.18);
      display: flex;
      flex-direction: column;
    }
    #norm-panel.open { transform: translateX(0); }
    #norm-panel.open ~ #norm-overlay,
    .norm-panel-open #norm-overlay { opacity: 1; pointer-events: auto; }

    .norm-panel-inner {
      overflow-y: auto;
      height: 100%;
      scroll-behavior: smooth;
    }

    /* ── Cabecera del panel ── */
    .norm-panel-head {
      padding: 1.5rem 1.5rem 1rem;
      background: linear-gradient(135deg, var(--red) 0%, var(--red-darker) 100%);
      color: #fff;
      position: relative;
    }
    .norm-panel-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .7rem; }
    .norm-panel-head .norm-badge.badge-dl { background: rgba(255,255,255,.25); color: #fff; }
    .norm-panel-head .norm-badge.badge-ds { background: rgba(255,255,255,.22); color: #fff; }
    .norm-panel-head .norm-badge.badge-rd { background: rgba(255,255,255,.22); color: #fff; }
    .norm-panel-head .norm-estado { background: rgba(255,255,255,.2); color: #fff; }
    .norm-panel-title {
      font-size: 1.12rem; font-weight: 800; margin: 0 0 .35rem;
      line-height: 1.35; padding-right: 3rem;
    }
    .norm-panel-numero { font-size: .85rem; opacity: .82; margin: 0 0 1rem; }

    .norm-btn-drive {
      display: inline-flex; align-items: center; gap: .45rem;
      background: #fff; color: var(--red);
      font-weight: 700; font-size: .85rem;
      padding: .5rem 1.1rem;
      border-radius: var(--radius-md);
      text-decoration: none;
      transition: box-shadow .2s, background .15s;
      box-shadow: 0 2px 8px rgba(0,0,0,.12);
    }
    .norm-btn-drive:hover {
      background: var(--red-pale);
      box-shadow: 0 4px 16px rgba(0,0,0,.18);
    }

    .norm-panel-close {
      position: absolute; top: 1rem; right: 1rem;
      width: 2.1rem; height: 2.1rem;
      border-radius: 50%;
      border: none;
      background: rgba(255,255,255,.25);
      color: #fff; font-size: 1.3rem; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: background .15s;
    }
    .norm-panel-close:hover { background: rgba(255,255,255,.4); }

    /* ── Tabs del panel ── */
    .norm-tabs {
      display: flex;
      overflow-x: auto;
      scrollbar-width: none;
      background: var(--surface-2);
      border-bottom: 2px solid #e5e7eb;
      padding: 0 .5rem;
      gap: 0;
    }
    .norm-tabs::-webkit-scrollbar { display: none; }
    .norm-tab {
      flex-shrink: 0;
      padding: .75rem .9rem;
      border: none; background: none;
      font-family: var(--font); font-size: .8rem; font-weight: 600;
      color: var(--text-2);
      cursor: pointer;
      border-bottom: 2.5px solid transparent;
      margin-bottom: -2px;
      transition: color .15s, border-color .15s;
      white-space: nowrap;
    }
    .norm-tab:hover { color: var(--red); }
    .norm-tab.active { color: var(--red); border-bottom-color: var(--red); }

    /* ── Contenido de tabs ── */
    .norm-tab-content { padding: 1.4rem 1.5rem; }

    /* Ficha técnica */
    .ficha-tecnica {
      background: var(--surface-2);
      border-radius: var(--radius-md);
      padding: .9rem 1rem;
      margin-bottom: 1.2rem;
      border: 1px solid #e5e7eb;
    }
    .ficha-row {
      display: flex; gap: .7rem; padding: .38rem 0;
      border-bottom: 1px solid #f3f4f6;
      align-items: flex-start;
    }
    .ficha-row:last-child { border-bottom: none; }
    .ficha-label { font-size: .78rem; font-weight: 700; color: var(--text-3); width: 90px; flex-shrink: 0; margin-top: .1rem; }
    .ficha-val   { font-size: .82rem; color: var(--text); flex: 1; }

    .resumen-block { margin-bottom: 1.2rem; }
    .resumen-block h4 { font-size: .88rem; font-weight: 700; color: var(--red); margin: 0 0 .5rem; }
    .resumen-block p  { font-size: .87rem; color: var(--text-2); line-height: 1.6; margin: 0; }
    .chip-group { display: flex; flex-wrap: wrap; gap: .35rem; }

    /* Estructura */
    .estructura-hint {
      font-size: .78rem; color: var(--text-3);
      margin-bottom: .8rem; font-style: italic;
    }
    .nodo { position: relative; }
    .nodo[data-depth="0"] { margin-bottom: .4rem; }
    .nodo[data-depth="1"] { padding-left: 1.2rem; border-left: 2px solid var(--red-border); margin-left: .6rem; }
    .nodo[data-depth="2"] { padding-left: 1rem; border-left: 2px solid #e5e7eb; margin-left: .6rem; }
    .nodo[data-depth="3"] { padding-left: .8rem; border-left: 1px solid #e5e7eb; margin-left: .6rem; }
    .nodo-header {
      display: flex; align-items: center; gap: .45rem;
      padding: .42rem .5rem;
      border-radius: var(--radius-sm);
      cursor: default;
      transition: background .15s;
    }
    .nodo-collapsible .nodo-header { cursor: pointer; }
    .nodo-collapsible .nodo-header:hover { background: var(--red-pale); }
    .nodo-icon { font-size: .9rem; flex-shrink: 0; }
    .nodo-title { font-size: .85rem; font-weight: 600; color: var(--text); flex: 1; }
    .nodo-toggle { font-size: .6rem; color: var(--text-3); transition: transform .2s; margin-left: auto; }
    .nodo-resumen {
      font-size: .8rem; color: var(--text-2); line-height: 1.58;
      margin: .2rem 0 .5rem 2.1rem; padding: .4rem .6rem;
      border-radius: var(--radius-sm);
      background: var(--surface-2);
    }
    .nodo-hijos { margin-top: .2rem; }
    .nodo-hijos.hidden { display: none; }

    /* Glosario */
    .glosario-toolbar {
      display: flex; gap: .6rem; margin-bottom: 1rem;
      align-items: center; flex-wrap: wrap;
    }
    .glosario-search {
      flex: 1 1 160px;
      padding: .55rem .8rem;
      border: 1.5px solid #d1d5db;
      border-radius: var(--radius-md);
      font-family: var(--font); font-size: .85rem;
      background: var(--surface); color: var(--text);
      transition: border-color .18s;
    }
    .glosario-search:focus { outline: none; border-color: var(--red); }
    .norm-btn-quiz {
      padding: .55rem 1rem;
      background: var(--red); color: #fff;
      border: none; border-radius: var(--radius-md);
      font-family: var(--font); font-size: .84rem; font-weight: 700;
      cursor: pointer; transition: background .15s;
      white-space: nowrap;
    }
    .norm-btn-quiz:hover { background: var(--red-dark); }

    .concepto-item {
      padding: .7rem .8rem;
      border-radius: var(--radius-sm);
      margin-bottom: .5rem;
      background: var(--surface-2);
      border: 1px solid #f3f4f6;
      transition: border-color .15s;
    }
    .concepto-item:hover { border-color: var(--red-border); }
    .concepto-termino { font-weight: 700; font-size: .9rem; color: var(--text); margin-bottom: .2rem; }
    .concepto-art {
      display: inline-block;
      font-size: .7rem; font-weight: 700;
      background: var(--red-pale); color: var(--red);
      padding: .1rem .45rem; border-radius: 99px;
      margin-bottom: .3rem;
    }
    .concepto-def { font-size: .82rem; color: var(--text-2); line-height: 1.58; margin: 0; }

    /* Plazos */
    .plazos-timeline { position: relative; padding-left: 1.8rem; }
    .plazos-timeline::before {
      content: '';
      position: absolute;
      left: .5rem; top: .5rem; bottom: .5rem;
      width: 2px; background: var(--red-border);
    }
    .plazo-item {
      position: relative;
      padding-bottom: 1.2rem;
    }
    .plazo-dot {
      position: absolute;
      left: -1.35rem; top: .3rem;
      width: .75rem; height: .75rem;
      border-radius: 50%;
      background: var(--red);
      border: 2px solid #fff;
      box-shadow: 0 0 0 2px var(--red-border);
    }
    .plazo-content { padding: .5rem .7rem; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid #e5e7eb; }
    .plazo-titulo { display: block; font-size: .87rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
    .plazo-desc  { font-size: .8rem; color: var(--text-2); margin: .25rem 0 0; line-height: 1.55; }

    /* Actores */
    .actores-grid { display: flex; flex-direction: column; gap: .7rem; }
    .actor-card {
      display: flex; gap: .8rem; align-items: flex-start;
      padding: .7rem .9rem;
      background: var(--surface-2);
      border: 1px solid #e5e7eb;
      border-radius: var(--radius-md);
      transition: border-color .15s;
    }
    .actor-card:hover { border-color: var(--red-border); }
    .actor-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: .1rem; }
    .actor-nombre { font-size: .9rem; font-weight: 700; color: var(--text); display: block; }
    .actor-tipo {
      font-size: .7rem; font-weight: 700;
      background: var(--red-pale); color: var(--red);
      padding: .1rem .5rem; border-radius: 99px;
      display: inline-block; margin: .2rem 0;
    }
    .actor-rol { font-size: .8rem; color: var(--text-2); margin: .25rem 0 0; line-height: 1.55; }

    /* Normas relacionadas */
    .normas-group { margin-bottom: 1.4rem; }
    .normas-group h4 { font-size: .88rem; font-weight: 700; color: var(--text); margin: 0 0 .6rem; }
    .normas-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
    .normas-list li {
      font-size: .83rem; color: var(--text-2);
      padding: .45rem .6rem;
      border-radius: var(--radius-sm);
      border-left: 3px solid;
      background: var(--surface-2);
      line-height: 1.5;
    }
    .rel-modifica li { border-left-color: #f59e0b; }
    .rel-deroga  li  { border-left-color: var(--red); }
    .rel-ref     li  { border-left-color: #6366f1; }

    /* ── Quiz ── */
    .quiz-container { max-width: 520px; margin: 0 auto; }
    .quiz-progress {
      height: 5px; background: #e5e7eb; border-radius: 99px;
      margin-bottom: .6rem; overflow: hidden;
    }
    .quiz-bar { height: 100%; background: var(--red); border-radius: 99px; transition: width .3s; }
    .quiz-count { font-size: .78rem; color: var(--text-3); margin-bottom: 1rem; }
    .quiz-card {
      background: var(--surface-2);
      border: 1.5px solid #e5e7eb;
      border-radius: var(--radius-lg);
      padding: 1.8rem 1.6rem;
      margin-bottom: 1.2rem;
      text-align: center;
      min-height: 200px;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: .6rem;
    }
    .quiz-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0; }
    .quiz-termino { font-size: 1.3rem; font-weight: 800; color: var(--text); margin: 0; }
    .quiz-definicion { font-size: .9rem; color: var(--text-2); line-height: 1.6; margin: 0; max-width: 400px; }
    .hidden-def { filter: blur(8px); user-select: none; }
    .hidden-def .quiz-definicion { color: var(--text-3); font-style: italic; }
    .quiz-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

    .norm-btn-primary, .norm-btn-secondary, .norm-btn-ghost,
    .norm-btn-right, .norm-btn-wrong {
      padding: .6rem 1.1rem;
      border-radius: var(--radius-md);
      font-family: var(--font); font-size: .87rem; font-weight: 700;
      cursor: pointer; border: none;
      transition: all .15s;
    }
    .norm-btn-primary { background: var(--red); color: #fff; }
    .norm-btn-primary:hover { background: var(--red-dark); }
    .norm-btn-secondary { background: var(--surface-2); color: var(--text); border: 1.5px solid #d1d5db; }
    .norm-btn-secondary:hover { border-color: var(--red); color: var(--red); }
    .norm-btn-ghost { background: none; color: var(--text-3); font-size: .82rem; font-weight: 500; }
    .norm-btn-ghost:hover { color: var(--text-2); }
    .norm-btn-right { background: #dcfce7; color: #166534; }
    .norm-btn-right:hover { background: #bbf7d0; }
    .norm-btn-wrong { background: #fee2e2; color: #991b1b; }
    .norm-btn-wrong:hover { background: #fecaca; }

    .quiz-result { text-align: center; padding: 2rem 1rem; }
    .quiz-result-icon { font-size: 3rem; margin-bottom: .7rem; }
    .quiz-result h3 { font-size: 1.5rem; margin: 0 0 .5rem; }
    .quiz-score { font-size: 1.1rem; color: var(--text-2); margin-bottom: 1.4rem; }
    .quiz-score strong { color: var(--red); font-size: 1.3rem; }

    /* ── Responsive ── */
    @media (max-width: 640px) {
      .norm-toolbar { flex-direction: column; }
      .norm-search-wrap { flex: 1 1 100%; }
      .norm-select, #filter-clear { width: 100%; }
      #norm-grid { grid-template-columns: 1fr; }
      .norm-panel-head { padding: 1.2rem; }
      .norm-tab-content { padding: 1rem; }
      .norm-tabs { padding: 0; }
      .norm-tab { padding: .65rem .7rem; font-size: .73rem; }
    }
  