/* ============================================================
   YiQi Design System — ds-doc.css
   Estilos específicos del documento de referencia DS.
   Versión: DS v1.2.5  ·  Fecha: 30/04/2026
   Usar junto con styles.css (tokens + componentes ERP)
   ============================================================ */

button{font:inherit;cursor:pointer}

/* ── TOPBAR ── */
.ds-topbar {
  position: sticky; top: 0; z-index: 99;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 28px; height: 56px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand svg { height: 39px; width: auto; display: block; }
.topbar-logo-link { margin-left: -8px; }
.topbar-pill {
  padding: 4px 10px; border: none;
  border-radius: var(--radius-pill); background: var(--bg-elev-2);
  font: 600 10px var(--mono); color: var(--muted-2);
  text-transform: uppercase; letter-spacing: .12em;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: flex; align-items: center;
  background: var(--bg-elev-2); border-radius: var(--radius-pill);
  padding: 3px; gap: 1px;
}
.theme-opt {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 4px 10px; border: none; border-radius: var(--radius-pill);
  background: transparent; color: var(--muted-2);
  font: 500 11px var(--sans); cursor: pointer;
  transition: background var(--tr), color var(--tr);
  white-space: nowrap;
}
.theme-opt svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.theme-opt:hover { color: var(--text); }
.theme-opt.active { background: var(--bg-soft); color: var(--text); }

/* ── LAYOUT ── */
.ds-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); min-width: 0; position: relative; }
.ds-layout::before {
  /* Extiende el fondo del sidebar a toda la altura de la página */
  content: ''; position: absolute;
  top: 0; left: 0; bottom: 0; width: 240px;
  background: var(--bg-elev); border-right: 1px solid var(--line);
  pointer-events: none;
}
.ds-nav {
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
  padding: 20px 14px; z-index: 1;
  background: var(--bg-elev); border-right: 1px solid var(--line);
}
.ds-nav-inner { /* contenedor semántico */ }
.ds-nav-section { margin-bottom: 22px; }
.ds-nav-label {
  font: 700 9px var(--mono); letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted-2); padding: 0 8px 8px; display: block;
}
.ds-nav-item {
  display: block; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 12px; font-weight: 500;
  text-decoration: none; transition: all .15s ease; cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.ds-nav-item:hover { background: var(--bg-soft); color: var(--text); }
.ds-nav-item.active { background: var(--cyan-soft); color: var(--cyan); }

/* ── CONTENT ── */
.ds-content { padding: 36px 40px 80px; max-width: 1100px; }
.ds-section { margin-bottom: 64px; scroll-margin-top: calc(var(--topbar-h, 56px) + 20px); }
.ds-section-header { margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ds-section-kicker { font: 700 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; }
.ds-section-title { font-size: 26px; letter-spacing: -.03em; font-weight: 700; white-space: nowrap; }
.ds-section-sub { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ── GRID HELPERS ── */
.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.token-grid-2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.token-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }

/* ── COLOR SWATCH ── */
.swatch-card {
  border: none; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-elev-2);
}
.swatch-block { height: 60px; }
.swatch-info { padding: 10px 12px; }
.swatch-name { font: 600 11px var(--sans); color: var(--text); }
.swatch-token { font: 500 10px var(--mono); color: var(--muted-2); margin-top: 2px; }
.swatch-hex { font: 600 10px var(--mono); color: var(--muted); margin-top: 2px; }

/* semantic row */
.semantic-row { display: flex; flex-wrap: wrap; gap: 10px; }
.semantic-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: none;
  border-radius: var(--radius); background: var(--bg-elev-2); flex: 1; min-width: 180px;
}
.semantic-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.semantic-label { font: 600 11px var(--sans); color: var(--text); }
.semantic-token { font: 500 10px var(--mono); color: var(--muted-2); margin-top: 1px; }

/* ── TYPOGRAPHY ── */
.type-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: baseline; gap: 20px;
  padding: 14px 16px; border: none;
  border-radius: var(--radius); background: var(--bg-elev-2);
  margin-bottom: 8px;
}
.type-meta { text-align: right; }
.type-spec { font: 500 10px var(--mono); color: var(--muted-2); }

/* ── RADIUS ── */
.radius-card {
  padding: 16px; border: none;
  background: var(--bg-elev-2); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.radius-demo { width: 52px; height: 52px; background: var(--cyan-soft); border: 1px solid rgba(0,204,255,.22); }
.radius-token { font: 700 10px var(--mono); color: var(--cyan); }
.radius-value { font: 500 11px var(--mono); color: var(--muted-2); }

/* ── EFFECTS ── */
.effect-card {
  padding: 20px 16px; border: none;
  background: var(--bg-elev-2); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 12px;
}
.effect-demo {
  width: 100%; height: 48px; border-radius: var(--radius);
  background: var(--bg-soft);
}
.effect-name { font: 600 12px var(--sans); }
.effect-code { font: 500 10px var(--mono); color: var(--muted-2); word-break: break-all; }

/* ── COMPONENTS ── */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--bg-elev-2);
  color: var(--text); font: 600 13px var(--sans);
  cursor: pointer; transition: all .18s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.btn-primary { background: var(--cyan-soft); border-color: rgba(0,204,255,.28); color: var(--cyan); }
.btn-primary:hover { background: var(--cyan-soft-2); }
.btn-amber { background: rgba(255,176,32,.10); border-color: rgba(255,176,32,.22); color: var(--amber); }
.btn-amber:hover { background: rgba(255,176,32,.16); border-color: rgba(255,176,32,.34); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-danger { background: rgba(255,99,125,.08); border-color: rgba(255,99,125,.2); color: var(--red); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 20px; font-size: 14px; border-radius: 16px; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.btn:hover svg { transform: translateY(1px); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: var(--radius-pill);
  font: 700 10px var(--mono); border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.badge-cyan { color: var(--cyan); background: var(--cyan-soft); border-color: transparent; }
.badge-cyan::before { background: var(--cyan); }
.badge-green { color: var(--green); background: rgba(21,212,156,.08); border-color: transparent; }
.badge-green::before { background: var(--green); }
.badge-amber { color: var(--amber); background: rgba(255,176,32,.08); border-color: transparent; }
.badge-amber::before { background: var(--amber); }
.badge-red { color: var(--red); background: rgba(255,99,125,.08); border-color: transparent; }
.badge-red::before { background: var(--red); }
.badge-muted { color: var(--muted); background: var(--bg-soft); border-color: transparent; }
.badge-muted::before { background: var(--muted-2); }

/* Tags (pill variant) */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius-pill);
  border: none;
  background: var(--cyan-soft); color: var(--cyan);
  font: 700 10px var(--mono);
}

/* Placeholder tags */
.ph-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-pill);
  border: none; background: var(--bg-soft);
  color: var(--muted); font: 600 11px var(--mono);
}
.ph-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }

/* Inputs */
.input-wrap { position: relative; }
.input {
  width: 100%; height: 40px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--bg-elev-2);
  padding: 0 14px; color: var(--text); font: 500 13px var(--sans);
  outline: none; transition: all .18s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { border-color: rgba(0,204,255,.28); box-shadow: var(--glow); }
.input-with-icon { padding-left: 38px; }
.input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--muted-2); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.input-shortcut {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  height: 22px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line);
  display: flex; align-items: center; font: 600 10px var(--mono); color: var(--muted); background: var(--bg);
}
.textarea {
  width: 100%; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--bg-elev-2); padding: 12px 14px; color: var(--text);
  font: 500 13px var(--sans); outline: none; resize: vertical;
  transition: all .18s ease; min-height: 80px;
}
.textarea:focus { border-color: rgba(0,204,255,.28); box-shadow: var(--glow); }

/* Select */
.select {
  width: 100%; height: 40px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--bg-elev-2);
  padding: 0 14px; color: var(--text); font: 500 13px var(--sans);
  outline: none; appearance: none; cursor: pointer;
}

/* Toggle switch */
.switch-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-track {
  width: 34px; height: 20px; border-radius: var(--radius-pill);
  background: var(--bg-soft); border: 1px solid var(--line);
  position: relative; transition: background .2s ease;
  flex-shrink: 0;
}
.switch-track.on { background: rgba(0,204,255,.2); border-color: rgba(0,204,255,.3); }
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--muted-2);
  transition: transform .2s ease, background .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch-track.on .switch-thumb { transform: translateX(14px); background: var(--cyan); }
.switch-text { font: 600 13px var(--sans); }

/* Checkbox */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font: 500 13px var(--sans); }
.checkbox {
  width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-elev-2); display: grid; place-items: center; flex-shrink: 0;
  transition: all .15s ease;
}
.checkbox.checked { background: var(--cyan-soft); border-color: rgba(0,204,255,.3); }
.checkbox svg { width: 10px; height: 10px; stroke: var(--cyan); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Cards */
.card {
  background: var(--bg-elev-2); border: none;
  border-radius: var(--radius-lg); padding: 16px;
}
.card-accent {
  background: var(--bg-elev-2); border: 1px solid rgba(0,204,255,.22);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--glow);
}
.card-kicker { font: 700 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.card-value { font-size: 30px; font-weight: 700; letter-spacing: -.04em; margin-top: 10px; }
.card-delta { font: 600 11px var(--mono); margin-top: 8px; }
.delta-up { color: var(--green); }
.delta-down { color: var(--amber); }

/* KPI mini */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Navigation Item */
.nav-item-demo {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-md);
  color: var(--cyan); background: var(--cyan-soft);
  transition: background var(--tr);
}
.nav-item-demo:hover { background: var(--cyan-soft-2); }
.nav-item-demo .icon-box {
  width: 24px; height: 24px; border-radius: 8px; border: none;
  background: transparent; display: grid; place-items: center; color: var(--cyan);
}
.nav-item-demo span { font: 600 14px var(--sans); }

/* Module item */
.module-demo {
  border: none; border-radius: var(--radius-md);
  background: var(--bg-elev-2); overflow: hidden;
}
.module-demo.open { box-shadow: 0 0 0 1px rgba(0,204,255,.10) inset; }
.module-head-demo {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
}
.module-icon { width: 28px; height: 28px; border-radius: 10px; background: var(--cyan-soft); display: grid; place-items: center; color: var(--cyan); flex-shrink: 0; }
.module-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.module-title-text { font: 600 13px var(--sans); }
.module-meta-text { font: 400 11px var(--sans); color: var(--muted); margin-top: 2px; }
.module-count-badge { padding: 3px 7px; border-radius: var(--radius-pill); background: var(--bg-soft); border: none; font: 700 10px var(--mono); color: var(--muted); margin-left: auto; }
.chev { color: var(--muted-2); transition: transform .18s ease; margin-left: 4px; font-size: 14px; }
.module-body-demo { padding: 0 12px 12px 56px; }
.sub-item-demo {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font: 500 13px var(--sans); cursor: pointer;
  transition: all .15s ease;
}
.sub-item-demo:hover { background: var(--bg-soft); color: var(--text); }
.sub-item-demo.active { background: var(--cyan-soft); color: var(--cyan); }
.sub-item-demo svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sub-count { margin-left: auto; padding: 2px 6px; border-radius: var(--radius-pill); border: none; background: var(--bg-soft); font: 700 10px var(--mono); color: var(--muted); }

/* Table */
.table-demo { width: 100%; border-collapse: collapse; }
.table-demo th {
  padding: 11px 14px; background: var(--bg-elev); color: var(--muted-2);
  font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .12em;
  border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
}
.table-demo td {
  padding: 13px 14px; border-bottom: 1px solid var(--line);
  font-size: 13px; white-space: nowrap;
}
.table-demo tr:last-child td { border-bottom: none; }
.table-demo tr:hover td { background: rgba(127,136,150,.04); }
.mono-cell { font: 500 12px var(--mono); color: var(--muted); }

/* Changelog: sin scroll horizontal — Detalle envuelve en multilínea.
   Layout automático: las 3 primeras columnas se encogen a su contenido
   (width:1% + nowrap) y Detalle se queda con el resto y envuelve. */
#ds-changelog td { white-space: normal; vertical-align: top; line-height: 1.5; }
#ds-changelog th:nth-child(1),
#ds-changelog th:nth-child(2),
#ds-changelog th:nth-child(3),
#ds-changelog td:nth-child(1),
#ds-changelog td:nth-child(2),
#ds-changelog td:nth-child(3) { white-space: nowrap; width: 1%; }
#ds-changelog td:nth-child(4) { overflow-wrap: anywhere; }

/* Changelog en mobile: cada fila apilada como bloque (Detalle a todo el ancho) */
@media (max-width: 640px){
  #ds-changelog, #ds-changelog tbody, #ds-changelog tr, #ds-changelog td { display: block; width: auto !important; }
  #ds-changelog thead { display: none; }
  #ds-changelog tr { padding: 12px 2px; border-bottom: 1px solid var(--line); }
  #ds-changelog tr:last-child { border-bottom: none; }
  #ds-changelog tr:hover td { background: transparent; }
  #ds-changelog td { white-space: normal !important; border: none !important; padding: 0 !important; }
  #ds-changelog td:nth-child(1) { display: inline; font-weight: 600; color: var(--text); }
  #ds-changelog td:nth-child(2) { display: inline; margin-left: 8px; color: var(--muted-2); }
  #ds-changelog td:nth-child(3) { display: block; margin: 8px 0 6px; }
  #ds-changelog td:nth-child(4) { display: block; line-height: 1.55; }
}


/* Sortable table */
.table-card-demo {
  background: var(--bg-elev-2);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.table-card-title { font: 700 14px var(--sans); }
.table-card-sub { font: 400 12px var(--sans); color: var(--muted); margin-top: 2px; }
.table-toolbar-search {
  display: flex; align-items: center; gap: 8px; min-width: 300px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
}
.table-toolbar-search input {
  border: none; outline: none; background: transparent; color: var(--text); width: 100%; font: inherit;
}
.table-toolbar-search input::placeholder { color: var(--muted-2); }
.table-sortable th {
  cursor: pointer; user-select: none; position: relative; padding-right: 30px;
}
.table-sortable th::after {
  content: "↕"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font: 700 11px var(--mono); color: var(--muted-2); opacity: .55;
}
.table-sortable th.sorted-asc::after { content: "↑"; color: var(--cyan); opacity: 1; }
.table-sortable th.sorted-desc::after { content: "↓"; color: var(--cyan); opacity: 1; }
.table-empty {
  display: none; padding: 18px 16px; border-top: 1px solid var(--line);
  color: var(--muted); font: 500 12px var(--sans); background: var(--bg-elev);
}
.table-empty.show { display: block; }

/* Live dot */
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(21,212,156,.10); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* Status */
.status-ok { padding: 5px 9px; border-radius: var(--radius-pill); font: 700 10px var(--mono); color: var(--green); background: rgba(21,212,156,.08); border: 1px solid rgba(21,212,156,.18); }
.status-warn { padding: 5px 9px; border-radius: var(--radius-pill); font: 700 10px var(--mono); color: var(--amber); background: rgba(255,176,32,.08); border: 1px solid rgba(255,176,32,.18); }
.status-err { padding: 5px 9px; border-radius: var(--radius-pill); font: 700 10px var(--mono); color: var(--red); background: rgba(255,99,125,.08); border: 1px solid rgba(255,99,125,.2); }

/* Alert badge */
.alert-badge-demo {
  width: 34px; height: 34px; display: inline-flex; align-items: center;
  justify-content: center; border: none;
  background: var(--bg-elev-2); border-radius: var(--radius-sm);
  color: var(--muted); position: relative;
}
.alert-badge-dot {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: var(--radius-pill); background: var(--red);
  color: #ffffff; font: 700 10px var(--mono);
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-elev);
}
.alert-badge-demo svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(0,204,255,.24);
  font: 700 11px var(--mono);
}

/* Topbar icon */
.top-icon-demo {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: var(--bg-elev-2); color: var(--muted);
  border-radius: var(--radius-sm);
}
.top-icon-demo svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Tooltip */
.tooltip-demo {
  position: relative; display: inline-block;
}
.tooltip-box {
  padding: 6px 10px; border: none;
  background: var(--bg-elev-2); border-radius: var(--radius-sm);
  font: 500 11px var(--sans); color: var(--text); white-space: nowrap;
}
.tooltip-box--elev { background: var(--bg-elev); }

/* Integration card */
.integration-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px; background: var(--bg-elev-2);
  border: none; border-radius: var(--radius-md);
}
.integration-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--cyan-soft); display: grid; place-items: center; color: var(--cyan); }
.integration-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.integration-name { font: 600 13px var(--sans); }
.integration-meta { font: 400 11px var(--sans); color: var(--muted); margin-top: 2px; }

/* Search */
.search-demo {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius);
  border: none; background: var(--bg-elev);
  width: 320px;
}
.search-demo svg { width: 16px; height: 16px; stroke: var(--muted-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.search-demo span { font: 500 13px var(--sans); color: var(--muted-2); }
.search-kbd {
  margin-left: auto; height: 22px; padding: 0 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  display: flex; align-items: center;
  font: 600 10px var(--mono); color: var(--muted);
  background: var(--bg); flex-shrink: 0;
}

/* Spacing display */
.spacing-row { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.sp-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sp-block { background: var(--cyan-soft); border: 1px solid rgba(0,204,255,.2); border-radius: 4px; }
.sp-label { font: 600 9px var(--mono); color: var(--muted-2); }

/* Motion */
.motion-card {
  padding: 18px 16px; border: none;
  background: var(--bg-elev-2); border-radius: var(--radius);
}
.motion-demo {
  width: 32px; height: 32px; border-radius: 8px; background: var(--cyan-soft);
  border: 1px solid rgba(0,204,255,.22);
  animation: none;
}
.motion-card:hover .motion-demo { animation: var(--anim); }
.motion-name { font: 600 12px var(--sans); margin-top: 12px; }
.motion-spec { font: 500 10px var(--mono); color: var(--muted-2); margin-top: 3px; }
.motion-use { font: 400 11px var(--sans); color: var(--muted); margin-top: 4px; }

@keyframes demo-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes demo-scale { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes demo-slide { from { transform: translateX(-6px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Logo area */
.logo-demo-row { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.logo-variant { display: flex; flex-direction: column; gap: 10px; }
.logo-label { font: 600 10px var(--mono); color: var(--muted-2); text-transform: uppercase; letter-spacing: .12em; }
.logo-on-dark { padding: 16px 24px; background: #0a0a0b; border-radius: var(--radius); border: none; --cyan: #00ccff; }
.logo-on-light { padding: 16px 24px; background: #eeece7; border-radius: var(--radius); border: 1px solid rgba(0,0,0,.08); --cyan: #009fc7; }

/* divider */
.ds-divider { height: 1px; background: var(--line); margin: 24px 0; }
.subsection-title { font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 14px; margin-top: 24px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(127,136,150,.2); border-radius: 999px; }

/* icon helper */
.il { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* code chip */
.code-chip { padding: 3px 7px; border-radius: 6px; background: var(--bg-soft); border: none; font: 500 11px var(--mono); color: var(--muted); }

/* page hero */
.page-hero { padding: 40px 40px 0; border-bottom: 1px solid var(--line); background: var(--bg-elev); margin-bottom: 0; }
.page-hero-inner { max-width: 1100px; padding-bottom: 32px; }
.page-hero-kicker { font: 700 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 12px; }
.page-hero-title { font-size: 40px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.page-hero-sub { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 560px; }
.hero-meta { display: flex; align-items: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.hero-chip { padding: 6px 11px; border: none; border-radius: var(--radius-pill); font: 600 11px var(--mono); color: var(--muted); background: var(--bg-elev-2); }
.landing-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--cyan-soft); color: var(--cyan); font: 700 10px var(--mono); letter-spacing: .10em; text-transform: uppercase; margin-bottom: 20px; border: none; }


/* ── MOBILE NAV / RESPONSIVE ── */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: var(--bg-elev-2); box-shadow: var(--shadow-sm);
  color: var(--text);
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: var(--bg-soft); }
.mobile-menu-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ds-overlay {
  position: fixed;
  inset: 56px 0 0 0;
  background: rgba(5,7,10,.62);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 80;
}
.ds-overlay.show { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

/* ── PHOSPHOR ICONS ── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.icon-card {
  border: none;
  border-radius: var(--radius);
  background: var(--bg-elev-2);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background .18s ease;
}
.icon-card:hover {
  background: var(--bg-soft);
}
.icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--cyan-soft);
  border: 1px solid transparent;
  display: grid;
  place-items: center;
  color: var(--cyan);
  flex-shrink: 0;
}
.icon-box i { font-size: 18px; line-height: 1; }
.icon-meta { min-width: 0; }
.icon-meta span {
  display: block;
  font: 600 12px var(--sans);
  color: var(--text);
}
.icon-meta code {
  display: block;
  margin-top: 4px;
  font: 500 10px var(--mono);
  color: var(--muted-2);
  word-break: break-word;
}
.icon-guidelines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.icon-guidelines .card { height: 100%; }
.icon-guidelines strong { color: var(--text); }

@media (max-width: 1200px) {
  .token-grid-3, .kpi-grid, .icon-grid, .icon-guidelines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .mobile-menu-btn { display: inline-flex; }
  .ds-layout { grid-template-columns: 1fr; }
  .ds-nav {
    position: fixed;
    top: 56px;
    right: 0;
    left: auto;
    width: min(260px, calc(100vw - 32px));
    height: calc(100dvh - 56px);
    transform: translateX(110%);
    transition: transform .24s ease;
    z-index: 90;
    box-shadow: -4px 0 28px rgba(0,0,0,.32);
    padding: 16px 12px;
    border-left: 1px solid var(--line);
    border-right: none;
  }
  .ds-nav.open { transform: translateX(0); }
  .ds-layout::before { display: none; }
  .ds-nav { overflow-y: auto; padding: 16px 12px; }
  .ds-nav-inner { /* sin estilos especiales en mobile */ }
  .ds-content { padding: 28px 28px 64px 28px; max-width: 100%; }
  .page-hero { padding: 28px 28px 0; }
  .page-hero-title { font-size: 32px; }
  .topbar-right span { display: none; }
}

@media (max-width: 720px) {
  .ds-content { padding: 24px 20px 56px 24px; }
  .page-hero { padding: 24px 20px 0; }
  .page-hero-title { font-size: 28px; line-height: 1.05; }
  .page-hero-sub { font-size: 13px; }
  .hero-meta { gap: 10px; }
  .token-grid, .token-grid-2, .token-grid-3, .kpi-grid, .icon-grid, .icon-guidelines { grid-template-columns: 1fr; }
  .ds-section-title { font-size: 22px; }
  .ds-topbar { padding: 0 16px; }
  .topbar-pill { display: none; }
}


/* ── MOBILE FRAME FIX v1.2.4.1 ── */
/* overflow-x en body eliminado — rompe position:sticky
   .ds-layout excluido: overflow:hidden rompe position:sticky en .ds-nav */
.ds-content, .page-hero, .card, .table-card-demo, .token-grid, .token-grid-2, .token-grid-3, .kpi-grid, .icon-grid, .icon-guidelines {
  min-width: 0;
  overflow: hidden;
}
/* El popover de la "i" (.kpi-help-pop) debe poder salir del grid */
.kpi-grid { overflow: visible; }
img, svg { max-width: 100%; height: auto; }
.page-hero, .ds-content { width: 100%; }
.table-card-top { flex-wrap: wrap; }
.table-toolbar-search { min-width: 0; width: 100%; }
.comp-row, .semantic-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.semantic-chip, .swatch-card, .effect-card, .radius-card, .type-row, .card, .icon-card { min-width: 0; width: 100%; }

@media (max-width: 980px) {
  .page-hero { padding-inline: 20px; }
  .ds-content { width: 100%; max-width: 100%; }
  .token-grid, .token-grid-2, .token-grid-3, .kpi-grid, .icon-grid, .icon-guidelines {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  [style*="min-width:220px"] { min-width: 0 !important; width: 100% !important; }
}

@media (max-width: 720px) {
  .ds-topbar { padding-inline: 12px; }
  .topbar-brand { min-width: 0; gap: 10px; }
  .topbar-brand svg { width: 60px; height: 39px; }
  .page-hero { padding: 24px 16px 0; }
  .ds-content { padding: 22px 14px 56px 20px; }
  .token-grid, .token-grid-2, .token-grid-3, .kpi-grid, .icon-grid, .icon-guidelines,
  .comp-row, .semantic-row {
    grid-template-columns: 1fr;
  }
  .type-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .type-meta { text-align: left; }
  .table-card-top { padding: 12px; }
  .table-toolbar-search { min-width: 0; width: 100%; }
  .page-hero-title { font-size: 26px; }
}


/* KPI cards en el DS: sin gradiente decorativo */
.ds-content .kpi-card::before { display: none; }
