  :root {
    --icat-magenta: #960E53;
    --icat-naranja: #DC7F37;
    --icat-vino: #410324;
    --icat-vino-logo: #3E0D25;
    --icat-perla: #E2DBDF;
    --cinta: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20139.93%2073.68%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23dc7f37%3B%7D.cls-2%7Bfill%3A%23960e53%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cpolygon%20class%3D%22cls-2%22%20points%3D%2286.12%2010.53%2086.12%2021.05%2075.35%2021.05%2075.35%2010.53%2064.59%2010.53%2064.59%200%2075.37%200%2075.37%2010.53%2086.12%2010.53%22%2F%3E%3Cpolygon%20class%3D%22cls-2%22%20points%3D%22107.65%2031.58%20107.65%2042.11%20118.4%2042.11%20118.4%2052.63%20129.18%2052.63%20129.18%2063.15%20139.93%2063.15%20139.93%2073.68%20129.17%2073.68%20129.17%2063.15%20118.4%2063.15%20118.4%2052.65%20107.64%2052.65%20107.64%2042.12%2096.88%2042.12%2096.88%2031.59%2086.12%2031.59%2086.12%2021.06%2096.88%2021.06%2096.88%2031.58%20107.65%2031.58%22%2F%3E%3Crect%20class%3D%22cls-1%22%20x%3D%2253.82%22%20y%3D%2210.52%22%20width%3D%2210.76%22%20height%3D%2210.53%22%2F%3E%3Crect%20class%3D%22cls-1%22%20x%3D%2243.04%22%20y%3D%2221.05%22%20width%3D%2210.77%22%20height%3D%2210.53%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2232.29%2042.12%2032.29%2052.63%2021.53%2052.63%2021.53%2042.1%2032.29%2042.1%2032.29%2031.58%2043.04%2031.58%2043.04%2042.12%2032.29%2042.12%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2210.76%2063.15%2010.76%2073.68%200%2073.68%200%2063.15%2010.76%2063.15%2010.76%2052.62%2021.51%2052.62%2021.51%2063.15%2010.76%2063.15%22%2F%3E%3C%2Fsvg%3E");

    --bg: #F7F4F5;
    --surface: #FFFFFF;
    --surface2: #F0E9EC;
    --line: #E5DAE0;
    --line-strong: #CDBCC5;
    --ink: #241219;
    --ink-soft: #4E3B44;
    --muted: #8A7580;
    --brand: #960E53;
    --brand-deep: #6E0A3D;
    --on-brand: #FFFFFF;
    --brand-text: #8B0C4C;
    --brand-soft: #FBEBF2;
    --accent: #DC7F37;
    --accent-deep: #B45F1E;
    --accent-text: #96540F;
    --accent-soft: #FBEFE3;
    --band: #410324;
    --on-band: #F4E8ED;
    --plate: transparent;
    --ok: #2F6B50;
    --ok-text: #2A6049;
    --ok-soft: #E4F0E9;
    --warn: #B45F1E;
    --warn-text: #96540F;
    --warn-soft: #FBEFE3;
    --danger: #B3252E;
    --danger-soft: #FAE5E7;
    color-scheme: light;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #191016;
      --surface: #22151C;
      --surface2: #2D1D26;
      --line: #3E2B35;
      --line-strong: #553B47;
      --ink: #F5EAEF;
      --ink-soft: #D6C3CC;
      --muted: #9C8791;
      --brand: #C13172;
      --brand-deep: #A31B5C;
      --brand-text: #F09CC2;
      --on-brand: #FFFFFF;
      --brand-soft: #3A1027;
      --accent: #DC7F37;
      --accent-deep: #C1682A;
      --accent-text: #EDA76A;
      --accent-soft: #3A2617;
      --band: #2A0117;
      --on-band: #F4E8ED;
      --plate: #FFFFFF;
      --ok: #3E8265;
      --ok-text: #8CC5A9;
      --ok-soft: #1F3329;
      --warn: #C07A2C;
      --warn-text: #E8AE6E;
      --warn-soft: #3A2A18;
      --danger: #E66D65;
      --danger-soft: #3D2023;
      --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.3);
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #191016;
    --surface: #22151C;
    --surface2: #2D1D26;
    --line: #3E2B35;
    --line-strong: #553B47;
    --ink: #F5EAEF;
    --ink-soft: #D6C3CC;
    --brand: #C13172;
    --brand-deep: #A31B5C;
    --brand-text: #F09CC2;
    --on-brand: #FFFFFF;
    --brand-soft: #3A1027;
    --accent: #DC7F37;
    --accent-deep: #C1682A;
    --accent-text: #EDA76A;
    --accent-soft: #3A2617;
    --band: #2A0117;
    --on-band: #F4E8ED;
    --plate: #FFFFFF;
    --ok: #3E8265;
    --ok-text: #8CC5A9;
    --ok-soft: #1F3329;
    --warn: #C07A2C;
    --warn-text: #E8AE6E;
    --warn-soft: #3A2A18;
    --danger: #E66D65;
    --danger-soft: #3D2023;
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
  }

  .marca-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  .marca { display: block; width: auto; }
  .marca-placa {
    background: var(--plate); border-radius: 6px; padding: 5px 9px;
    display: inline-flex; align-items: center;
  }
  .cinta {
    height: 9px; background-image: var(--cinta);
    background-repeat: repeat-x; background-size: auto 100%; background-position: left bottom;
  }

  .gob-band-in {
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    font-weight: 700; text-transform: uppercase;
  }
  .gob-band-in .sede { font-weight: 500; letter-spacing: .1em; }

  header.app { background: var(--surface); }
  .header-in {
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  }
  .brand { display: flex; align-items: center; gap: 15px; min-width: 0; }
  .brand .marca-icatson { height: 40px; }
  .brand h1 {
    font-family: var(--font-display); font-weight: 800; font-size: 22px;
    margin: 0; letter-spacing: -0.01em; line-height: 1.15;
  }
  .brand .sub {
    margin: 1px 0 0; color: var(--muted); font-size: 11.5px;
    text-transform: uppercase; letter-spacing: .09em; font-weight: 600;
  }
  @media (max-width: 560px) {
    .header-in { padding: 12px 20px 11px; }
    .brand { gap: 9px; flex-wrap: wrap; }
    .brand .marca-icatson { height: 30px; }
    .brand > div { flex: 1 1 100%; }
    .brand h1 { font-size: 19px; }
  }
  .sync {
    display: inline-flex; align-items: center;
    color: var(--ink-soft);
    border-radius: 999px;
  }
  .sync .dot { border-radius: 50%; background: var(--muted); flex: none; }
  .sync.is-sync .dot { background: var(--ok); }
  .sync.is-offline .dot { background: var(--warn); }
  .sync.is-connecting .dot { background: var(--muted); animation: pulse 1.2s infinite; }
  @keyframes pulse { 50% { opacity: .3; } }
  @media (prefers-reduced-motion: reduce) { .sync.is-connecting .dot { animation: none; } }
  .sync button {
    border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: 14px;
    padding: 0 2px; line-height: 1; border-radius: 4px;
  }
  .sync button:hover { color: var(--brand-text); }

  nav.tabs {
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  nav.tabs button {
    appearance: none; background: none; cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  nav.tabs button:hover { color: var(--ink); }
  nav.tabs button[aria-selected="true"] { border-bottom-color: var(--brand); }

  .card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
  }
  h2.section {
    font-family: var(--font-display); margin: 0 0 4px;
  }
  .hint { color: var(--muted); margin: 0 0 14px; }
  label.field-label {
    display: block; color: var(--ink-soft);
    margin: 0 0 6px; letter-spacing: .01em;
  }
  input[type="text"], input[type="number"], textarea, select {
    width: 100%; font: inherit; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px;
  }
  input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
    outline: 2px solid var(--brand); outline-offset: 2px;
  }
  textarea { resize: vertical; }
  .row { display: flex; flex-wrap: wrap; }
  .row > .col { flex: 1 1 180px; min-width: 0; }

  .btn {
    appearance: none; cursor: pointer; font: inherit;
    border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--ink);
  }
  .btn:hover { border-color: var(--muted); }
  .btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
  .btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
  .btn-ghost { border-color: transparent; background: none; color: var(--ink-soft); }
  .btn-ghost:hover { background: var(--surface2); border-color: transparent; }
  .btn-danger { color: var(--danger); border-color: var(--danger); background: none; }
  .btn-danger:hover { background: var(--danger-soft); }
  .btn-sm { border-radius: 7px; }
  .btn[disabled] { opacity: .5; cursor: not-allowed; }

  .choices { display: flex; flex-wrap: wrap; gap: 7px; }
  .choices label {
    position: relative; display: inline-flex; cursor: pointer;
  }
  .choices input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
  .choices .chip {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    padding: 6px 13px; font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
    background: var(--surface);
  }
  .choices input:checked + .chip {
    font-weight: 600;
  }
  .choices input:focus-visible + .chip { outline: 2px solid var(--brand); outline-offset: 2px; }
  .choices .chip small { font-weight: 400; }

  .perfil-grid {
    display: grid;
    align-items: start;
  }
  fieldset.f-group {
    margin: 0;
    min-width: 0;
  }
  fieldset.f-group legend {
    float: left; width: 100%;
    text-transform: uppercase;
    color: var(--muted); padding: 0;
  }
  .perfil-grid .choices { clear: both; }
  .nota-perfil {
    font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); background: var(--surface2);
    border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 12px;
  }
  .sub-fields {
    margin-top: 9px; padding: 11px 13px 12px; border: 1px dashed var(--line-strong);
    border-radius: 8px; background: var(--surface2);
  }
  .sub-fields .sub-title {
    font-weight: 600; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 9px;
  }
  .sub-fields .sub-title span { font-weight: 400; color: var(--muted); }
  .sub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
  .sub-grid .field-label { font-size: 12px; }
  .sub-grid input { padding: 6px 9px; }

  .quote-grid { display: grid; align-items: start; }
  @media (max-width: 860px) { .quote-grid { grid-template-columns: 1fr; } }
  .result-sticky { position: sticky; }
  @media (max-width: 860px) { .result-sticky { position: static; } }

  .curso-info {
    color: var(--muted);
    display: flex; flex-wrap: wrap;
  }
  .curso-info b { color: var(--ink-soft); font-weight: 600; }

  .partida { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
  .partida:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
  .partida-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .partida-num { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .partidas-add { align-self: flex-start; }

  .result-head {
    justify-content: space-between; align-items: baseline; gap: 4px 12px;
    flex-wrap: wrap; border-bottom: 1px solid var(--line);
  }
  .result-head h2 {
    margin: 0; font-family: var(--font-display);
    white-space: nowrap;
  }
  .result-head .r-sub {
    flex: 1 1 auto; min-width: 150px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cost-lines { padding: 12px 18px 4px; }
  .cost-lines .line { display: flex; justify-content: space-between; gap: 10px; padding: 2.5px 0; color: var(--ink-soft); }
  .cost-lines .line.total { font-weight: 700; color: var(--ink); border-top: 1px dashed var(--line-strong); margin-top: 6px; padding-top: 7px; }
  .cost-lines .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .cost-lines .why { font-size: 11.5px; color: var(--muted); margin: -1px 0 4px; padding-right: 60px; }
  .cost-lines .grupos-note {
    font-size: 12.5px; font-weight: 600; color: var(--brand-text); background: var(--brand-soft);
    border-radius: 6px; padding: 5px 10px; margin-bottom: 8px;
  }
  .cost-lines .grupos-note span { font-weight: 400; opacity: .85; }
  .cost-lines .grupos-note.uno { background: var(--surface2); color: var(--muted); font-weight: 500; }
  .cost-lines .line.sub { color: var(--muted); }

  .factor-chips { padding: 8px 18px 2px; display: flex; flex-wrap: wrap; gap: 5px; }
  .factor-chips .fchip {
    font-size: 11px; font-weight: 500; color: var(--muted);
    background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
  }
  .factor-chips .fchip.down { color: var(--ok-text); background: var(--ok-soft); border-color: transparent; }
  .factor-chips .fchip.up { color: var(--brand-text); background: var(--brand-soft); border-color: transparent; }
  .factor-chips .fchip.total { font-weight: 700; color: var(--ink-soft); background: none; border-color: var(--line-strong); }

  .prices { display: grid; }
  .price-card {
    border: 1px solid var(--line);
    cursor: pointer; background: var(--surface);
    display: grid; align-items: center;
    text-align: left; width: 100%; font: inherit; color: inherit;
  }
  .price-card .tag { text-transform: uppercase; }
  .price-card .per {
    grid-column: 1 / -1; font-family: var(--font-display);
    color: var(--ink);
    display: flex; align-items: baseline; flex-wrap: wrap;
  }
  .price-card .per small {
    font-family: var(--font-body);
    letter-spacing: 0; color: var(--muted);
  }
  .price-card .tot { grid-column: 1 / -1; }
  .price-card .tot b { font-variant-numeric: tabular-nums; }
  .price-card .meta { grid-column: 1 / -1; color: var(--muted); }
  .price-card .check {
    align-self: center;
    font-weight: 700; color: var(--muted);
    border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap;
  }
  .price-card[aria-pressed="true"] .check { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
  .price-card.p-sug .tag { color: var(--brand-text); }

  .costos-fold { border-top: 1px solid var(--line); }
  .costos-fold > summary {
    display: flex; align-items: baseline; flex-wrap: wrap;
    cursor: pointer; color: var(--ink-soft);
    list-style: none;
  }
  .costos-fold > summary::-webkit-details-marker { display: none; }
  .costos-fold > summary::before {
    content: "▸"; color: var(--muted); font-size: 11px; margin-right: 1px;
  }
  .costos-fold[open] > summary::before { content: "▾"; }
  .costos-fold > summary:hover { background: var(--surface2); }
  .costos-fold > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
  .costos-fold .cf-label { font-weight: 600; }
  .costos-fold .cf-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
  .costos-fold .cf-util { margin-left: auto; color: var(--muted); white-space: nowrap; }
  .costos-fold .cf-util b { color: var(--ok-text); font-weight: 700; }
  .costos-fold .fold-note { padding: 6px 18px 14px; font-size: 11.5px; color: var(--muted); }

  .result-note { color: var(--muted); }
  .result-actions {
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
  }
  .result-empty { padding: 26px 18px; color: var(--muted); font-size: 14px; text-align: center; }
  .result-empty b { color: var(--warn-text); }

  .table-scroll { overflow-x: auto; }
  table.list { width: 100%; border-collapse: collapse; min-width: 560px; }
  table.list th {
    text-align: left; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line-strong);
  }
  table.list td { border-bottom: 1px solid var(--line); vertical-align: top; }
  table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  table.list .t-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

  .empty-state {
    text-align: center; color: var(--muted);
  }

  .hist-item { border-bottom: 1px solid var(--line); }
  .hist-item:last-child { border-bottom: 0; }
  .hist-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
  .hist-top .when { color: var(--muted); }
  .hist-mid { color: var(--ink-soft); }
  .hist-range { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; font-variant-numeric: tabular-nums; }
  .hist-range .r-sug {
    font-family: var(--font-display); font-size: 19px; font-weight: 800;
    color: var(--brand-text); letter-spacing: -0.01em;
  }
  .hist-range .r-sug small { font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); }
  .hist-range .r-tot { color: var(--ink-soft); }
  .hist-range .r-rango { color: var(--muted); }
  .hist-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .hist-detail { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

  .settings-grid { display: grid; align-items: start; }
  .factor-table { width: 100%; border-collapse: collapse; }
  .factor-table td { padding: 5px 0; border-bottom: 1px dashed var(--line); }
  .factor-table td:last-child { text-align: right; width: 92px; }
  .factor-table tr:last-child td { border-bottom: 0; }
  .factor-table input { width: 84px; text-align: right; padding: 5px 8px; font-variant-numeric: tabular-nums; }
  .mini-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
  .grupos-hint { margin-top: 5px; font-size: 12px; color: var(--muted); }
  .grupos-hint.varios { font-weight: 600; color: var(--brand-text); }
  .grupos-hint.falta {
    font-weight: 500; color: var(--warn-text); background: var(--warn-soft);
    border-radius: 7px; padding: 7px 10px; line-height: 1.5;
  }
  .grupos-hint.falta b { font-weight: 700; }
  .cupo-cell i.falta { color: var(--warn-text); font-weight: 600; }

  .concept-box {
    border: 1px dashed var(--line-strong); border-radius: 8px;
    padding: 11px 13px 13px; background: var(--surface);
  }
  .concept-grid { display: grid; gap: 8px; }
  .concept-head, .concept-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 108px 172px 36px; gap: 8px; align-items: center;
  }
  .concept-head {
    font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .05em;
  }
  .concept-row input, .concept-row select { padding: 7px 9px; font-size: 13px; }
  .concept-row .c-del { padding: 6px 0; width: 36px; line-height: 1.1; }
  @media (max-width: 720px) {
    .concept-head { display: none; }
    .concept-row {
      grid-template-columns: minmax(0, 1fr) 36px; gap: 7px;
      border: 1px solid var(--line); border-radius: 8px; padding: 9px;
    }
    .concept-row .c-nombre { grid-column: 1; }
    .concept-row .c-del { grid-column: 2; grid-row: 1; justify-self: end; }
    .concept-row .c-monto, .concept-row .c-base { grid-column: 1 / -1; }
  }
  .concept-empty { font-size: 12.5px; color: var(--muted); padding: 6px 0 2px; }
  .base-help { margin-top: 10px; }
  .base-help summary { font-size: 12px; font-weight: 600; color: var(--brand-text); cursor: pointer; }
  .base-help summary::marker { color: var(--muted); }
  .base-help .mini-label { margin-top: 7px; line-height: 1.55; }
  .horas-total {
    font-size: 12.5px; font-weight: 600; color: var(--brand-text);
    font-variant-numeric: tabular-nums;
  }
  .horas-total.vacio { color: var(--muted); font-weight: 400; }
  .horas-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .horas-cell .hsplit { font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 1px; }
  .cost-mini { display: grid; gap: 2px; font-size: 12px; color: var(--muted); max-width: 320px; }
  .cost-mini .cm-row { display: flex; justify-content: space-between; gap: 10px; }
  .cost-mini b { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .cost-lines .line.cero span { color: var(--muted); }
  .why.alerta { color: var(--danger); }
  .cupo-cell { font-variant-numeric: tabular-nums; }
  .cupo-cell i { color: var(--muted); font-style: normal; font-size: 12px; }
  .factor-table td .unit { color: var(--muted); font-size: 12px; margin-left: 5px; }
  .factor-table td:last-child { white-space: nowrap; }
  .factor-table .row-hint { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }

  fieldset.plantel-box { border: 0; margin-inline: 0; padding: 0; min-width: 0; }
  fieldset.plantel-box legend { padding: 0; margin: 0 0 7px; font-weight: 600; font-size: 12px; color: var(--ink-soft); letter-spacing: .01em; }
  .plantel-choices { gap: 6px; }
  .plantel-choices .chip { min-height: 36px; }
  .plantel-choices input:checked + .chip::before { content: "✓"; font-weight: 700; }
  .plantel-box.falta legend { color: var(--warn-text); }
  .plantel-box.falta .chip { border-color: var(--warn-text); }
  .plantel-pie { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; margin-top: 6px; }
  .plantel-pie .mini-label { margin-top: 0; }
  .curso-planteles { font-size: 11.5px; font-weight: 600; color: var(--brand-text); margin-top: 3px; }
  .curso-planteles.falta { color: var(--warn-text); }
  .filtros-cursos { margin-top: 20px; }
  .filtros-cursos + .search-toolbar { margin-top: 12px; }
  #course-rows tr.resaltada td { background: var(--brand-soft); transition: background .3s; }
  .pend-mas { margin-top: 12px; }
  .pend-mas > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--brand-text); }
  .set-note {
    margin-top: 12px; padding: 9px 11px; border-radius: 8px; background: var(--surface2);
    font-size: 12.5px; color: var(--ink-soft); line-height: 1.45;
  }

  .banner {
    color: var(--ink-soft);
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
  }
  .banner button { flex: none; }
  .banner.peligro {
    border-color: var(--danger);
    color: var(--ink); flex-wrap: wrap; align-items: flex-start;
  }
  .banner.peligro span { flex: 1 1 320px; line-height: 1.5; }

  .respaldo {
    display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap;
    padding: 11px 0; border-top: 1px solid var(--line);
  }
  .respaldo:first-child { border-top: 0; }
  .respaldo-info { display: grid; gap: 2px; min-width: 0; }
  .respaldo-info b { font-size: 13.5px; }
  .respaldo-info .mini-label { margin: 0; }
  .respaldo.es-actual .respaldo-info b::after {
    content: "más reciente"; margin-left: 8px; font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: var(--brand-text);
  }
  .respaldo .fija {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--warn-text);
  }

  #toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: max-content; max-width: calc(100vw - 32px); }
  .toast {
    background: var(--ink); color: var(--bg); padding: 9px 18px;
    font-weight: 600; text-align: center;
  }
  .toast.warn { background: var(--warn); color: var(--on-warn); }

  #overlay {
    position: fixed; inset: 0; z-index: 40;
    display: flex; align-items: center; justify-content: center; padding: 20px;
  }
  #overlay .panel {
    background: var(--surface);
    max-width: 560px; width: 100%;
    max-height: 86vh; overflow: auto;
  }
  #overlay h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 17px; }
  #overlay textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-height: 180px; }
  #overlay .panel-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

  #test-report {
    position: fixed; top: 12px; right: 12px; z-index: 60; background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 16px;
    font-size: 12px; max-width: 380px; max-height: 80vh; overflow: auto; box-shadow: var(--shadow);
  }
  #test-report .fail { color: var(--danger); font-weight: 700; }
  #test-report .pass { color: var(--ok-text); }

  .inst-hoja {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
  }
  .inst-membrete {
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
    padding: 22px 24px 20px;
  }
  .inst-membrete .marca-placa { padding: 8px 12px; }
  .inst-membrete .marca-lockup { height: 76px; }
  .inst-membrete .lema { flex: 1 1 260px; min-width: 0; }
  .inst-membrete .lema b {
    display: block; font-family: var(--font-display); font-weight: 800;
    font-size: 15px; line-height: 1.3; color: var(--brand-text); letter-spacing: -.005em;
  }
  .inst-membrete .lema span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
  .inst-cuerpo { padding: 20px 24px 24px; }
  .inst-mision {
    font-size: 15.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; max-width: 66ch;
  }
  .inst-mision b { color: var(--ink); font-weight: 700; }

  .inst-cifras {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px 14px; margin-top: 26px;
  }
  .cifra { text-align: center; }
  .cifra .marca-flecha { height: 42px; margin: 0 auto 6px; }
  .cifra .num {
    font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.05;
    color: var(--brand-text); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  }
  .cifra .que { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }

  .inst-planteles {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 12px;
  }
  .plantel {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px 14px;
    background: var(--surface); border-top: 3px solid var(--accent);
  }
  .plantel h3 {
    margin: 0 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 14.5px;
    letter-spacing: .02em; text-transform: uppercase; color: var(--brand-text);
  }
  .plantel p { margin: 0 0 5px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
  .plantel .ext { margin: 7px 0 0; font-size: 11.5px; color: var(--muted); }
  .plantel .ext b {
    color: var(--accent-text); font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; font-size: 10.5px;
  }

  .inst-contacto { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
  .dato { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin: 0; }
  .dato b {
    display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 3px;
  }
  .redes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
  .redes a {
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
    font-size: 12.5px; font-weight: 600; color: var(--brand-text);
    background: var(--brand-soft); border-radius: 999px; padding: 5px 13px;
  }
  .redes a:hover { background: var(--brand); color: var(--on-brand); }
  .redes a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

  .cinta.antes-del-pie { margin-top: 44px; }
  .pie-in {
    margin: 0 auto;
    display: grid; grid-template-columns: auto minmax(0, 1fr);
  }
  @media (max-width: 620px) { .pie-in { grid-template-columns: 1fr; } }
  .pie .marca-placa { background: #FFFFFF; padding: 9px 12px; }
  .pie h4 {
    font-family: var(--font-display); font-weight: 700;
    text-transform: uppercase;
  }
  .pie p { margin: 0 0 4px; line-height: 1.6; opacity: .9; }
  .pie a { color: inherit; }
  .pie .redes a { background: rgba(255,255,255,.12); color: #FFFFFF; }
  .pie .redes a:hover { background: #FFFFFF; color: var(--band); }
  .pie-legal {
    border-top: 1px solid rgba(255,255,255,.16);
    line-height: 1.55;
    margin: 0 auto;
  }
