/* ============================================================
   FLUBLER · APLICACIONESMCOM — Shell de navegación lateral
   Navegación primaria única para catálogo, estudios y negocio.
   Sin dependencias, sin emojis, con transiciones suaves.
   ============================================================ */

:root {
  --eco-w: 264px;
  --eco-w-rail: 76px;
  --eco-bar: 52px;
  --eco-bar-safe: calc(var(--eco-bar) + env(safe-area-inset-top, 0px));
  --eco-bg: #070605;
  --eco-panel: #100d0a;
  --eco-line: rgba(255, 205, 166, 0.13);
  --eco-line-soft: rgba(255, 205, 166, 0.08);
  --eco-text: #e5d8ca;
  --eco-text-strong: #f8f4ee;
  --eco-muted: #b7a99b;
  --eco-gold: #ff7a18;
  --eco-cyan: #ff8a3d;
  --eco-green: #34d399;
  --eco-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Elementos heredados que el shell reemplaza */
[data-eco-legacy] {
  display: none !important;
}

.eco-shell,
.eco-mobilebar,
.eco-scrim {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Barra lateral ---------- */
/* Por defecto ESTRICTAMENTE OCULTA para visitantes y no autenticados */
.eco-shell,
.eco-mobilebar,
.eco-scrim {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Solo se activa y muestra cuando el usuario ha iniciado sesión o se ha registrado */
body.eco-authenticated.eco-has-shell .eco-shell {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  width: var(--eco-w);
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  flex-direction: column;
  background:
    radial-gradient(120% 50% at 0% 0%, rgba(255, 122, 24, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, rgba(16, 13, 10, 0.92) 0%, rgba(7, 6, 5, 0.96) 100%);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-right: 1px solid var(--eco-line);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 18px 0 54px -44px rgba(0, 0, 0, 0.9);
  transition: width 0.22s var(--eco-ease), transform 0.24s var(--eco-ease);
  overflow: hidden;
}

body.eco-authenticated.eco-has-shell {
  padding-left: var(--eco-w) !important;
  transition: padding-left 0.22s var(--eco-ease);
}
/* Garantiza una única barra lateral cuando páginas heredadas declaran ms-rail o rieles alternos */
body.eco-authenticated.eco-has-shell #msRail,
body.eco-authenticated.eco-has-shell .ms-rail {
  display: none !important;
}
body.eco-authenticated.eco-has-shell .ms-app {
  grid-template-columns: minmax(0, 1fr) !important;
}
body.eco-authenticated.eco-has-shell .ms-menu-btn {
  display: none !important;
}

body:not(.eco-authenticated),
body.eco-guest,
body:not(.eco-has-shell) {
  padding-left: 0 !important;
}

body:not(.eco-authenticated) .eco-shell,
body:not(.eco-authenticated) .eco-mobilebar,
body:not(.eco-authenticated) .eco-scrim,
body.eco-guest .eco-shell,
body.eco-guest .eco-mobilebar,
body.eco-guest .eco-scrim {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  pointer-events: none !important;
}

.eco-guest-access {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  background: rgba(7, 11, 18, 0.94);
  color: var(--eco-text-strong);
  font: 700 12px/1 "Inter", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.eco-guest-access:hover {
  border-color: var(--eco-cyan);
  color: #fff;
}

.eco-guest-access strong {
  color: var(--eco-cyan);
  font-weight: 800;
}

body.eco-has-shell.eco-collapsed {
  padding-left: var(--eco-w-rail);
}

body.eco-has-shell.eco-collapsed .eco-shell {
  width: var(--eco-w-rail);
}

/* ---------- Marca ---------- */
.eco-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 16px 16px;
  min-height: 76px;
  border-bottom: 1px solid var(--eco-line-soft);
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}

.eco-monogram {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 122, 24, 0.22), #17120e);
  border: 1px solid rgba(255, 205, 166, 0.28);
  color: #f8f4ee;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px -18px rgba(255, 122, 24, 0.7);
}
.eco-monogram img { width: 32px; height: 32px; object-fit: contain; display: block; }

.eco-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  white-space: nowrap;
}

.eco-brand-text b {
  font-size: 13.5px;
  letter-spacing: 0.13em;
  color: var(--eco-text-strong);
  font-weight: 800;
}

.eco-brand-text span {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--eco-gold);
  font-weight: 600;
  margin-top: 3px;
}

/* ---------- Navegación ---------- */
.eco-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 10px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.eco-nav::-webkit-scrollbar {
  width: 6px;
}

.eco-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 99px;
}

.eco-group + .eco-group {
  margin-top: 18px;
}

.eco-group-label {
  padding: 0 10px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--eco-muted);
  white-space: nowrap;
}

.eco-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: var(--eco-text);
  text-decoration: none;
  font-size: 12.8px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.16s var(--eco-ease), color 0.16s var(--eco-ease);
}

.eco-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  transition: opacity 0.16s var(--eco-ease), color 0.16s var(--eco-ease);
}

.eco-link:hover {
  background: rgba(255, 122, 24, 0.12);
  color: #f8f4ee;
}

.eco-link:hover svg {
  opacity: 1;
}

.eco-link:focus-visible {
  outline: 2px solid var(--eco-cyan);
  outline-offset: 1px;
}

.eco-link[aria-current="page"] {
  color: #f8f4ee;
  background: linear-gradient(90deg, rgba(255, 122, 24, 0.16), transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 24, 0.30);
}

.eco-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--eco-gold);
}

.eco-link[aria-current="page"] svg {
  color: var(--eco-gold);
  opacity: 1;
}

.eco-link-label {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.eco-link .eco-ext {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
  margin-left: auto;
  opacity: 0.45;
}

.eco-badge i {
  display: block;
}

.eco-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.08);
  color: #6ee7b7;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.02em;
}

.eco-badge[data-state="down"] {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

.eco-link.is-locked {
  opacity: 0.88;
}
.eco-link.is-locked:hover {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}
.eco-link.is-locked svg {
  color: #f87171;
}

.eco-badge[data-state="loading"] {
  border-color: var(--eco-line);
  background: rgba(148, 163, 184, 0.06);
  color: var(--eco-muted);
}

.eco-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

/* ---------- Pie ---------- */
.eco-foot {
  flex: 0 0 auto;
  padding: 12px 10px 14px;
  border-top: 1px solid var(--eco-line-soft);
}

.eco-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--eco-line-soft);
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.03);
  color: var(--eco-muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
}

.eco-status svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.eco-status[data-state="up"] {
  color: #6ee7b7;
}

.eco-status[data-state="down"] {
  color: #fca5a5;
}

.eco-status span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.eco-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--eco-muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s var(--eco-ease), color 0.16s var(--eco-ease);
}

.eco-collapse:hover {
  background: rgba(148, 163, 184, 0.07);
  color: #cbd5e1;
}

.eco-collapse svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s var(--eco-ease);
}

/* ---------- Tarjeta de sesión y rol ---------- */
.eco-auth-card {
  margin: 10px 10px 0;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(9, 14, 24, 0.96));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eco-auth-card[data-auth="authenticated"] {
  border-color: rgba(212, 175, 55, 0.34);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), rgba(9, 14, 24, 0.96));
}

.eco-auth-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.eco-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.eco-auth-card[data-auth="authenticated"] .eco-avatar {
  color: #0b111e;
  background: linear-gradient(135deg, #facc15, #d4af37);
  border-color: rgba(250, 204, 21, 0.55);
}

.eco-auth-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.eco-auth-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eco-auth-sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--eco-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eco-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}
.eco-role-pill svg,
.eco-badge-active svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.eco-auth-card[data-role="admin"] .eco-role-pill {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.14);
  color: #fde68a;
}

.eco-auth-card[data-role="guest"] .eco-role-pill {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.eco-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.eco-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 29px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.08);
  color: #e2e8f0;
  transition: background 0.15s var(--eco-ease), border-color 0.15s var(--eco-ease);
}

.eco-auth-btn:hover {
  background: rgba(148, 163, 184, 0.16);
}

.eco-auth-btn.primary {
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
}

.eco-auth-btn.primary:hover {
  background: rgba(34, 211, 238, 0.24);
}

.eco-auth-btn.danger {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.eco-auth-btn.danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

/* ---------- Estado colapsado ---------- */
.eco-collapsed .eco-auth-card {
  margin: 10px 8px 0;
  padding: 8px 4px;
  align-items: center;
}

.eco-collapsed .eco-auth-meta,
.eco-collapsed .eco-role-pill,
.eco-collapsed .eco-auth-actions {
  display: none;
}

.eco-collapsed .eco-brand {
  padding: 18px 0 16px;
  justify-content: center;
}

.eco-collapsed .eco-brand-text,
.eco-collapsed .eco-group-label,
.eco-collapsed .eco-link-label,
.eco-collapsed .eco-badge,
.eco-collapsed .eco-status span,
.eco-collapsed .eco-collapse span {
  display: none;
}

.eco-collapsed .eco-link,
.eco-collapsed .eco-collapse {
  justify-content: center;
  padding: 0;
}

.eco-collapsed .eco-link {
  margin-left: 10px;
  margin-right: 10px;
}

.eco-collapsed .eco-status {
  justify-content: center;
  padding: 9px 0;
}

.eco-collapsed .eco-collapse svg {
  transform: rotate(180deg);
}

.eco-collapsed .eco-group + .eco-group {
  margin-top: 12px;
}

/* ---------- Barra móvil y cajón ---------- */
.eco-mobilebar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--eco-bar-safe);
  z-index: 44;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: env(safe-area-inset-top, 0px) 10px 0;
  background: rgba(7, 11, 18, 0.94);
  border-bottom: 1px solid var(--eco-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.eco-mb-left {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.eco-mobilebar a.eco-mb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  min-width: 0;
  color: var(--eco-text-strong);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.eco-mobilebar .eco-monogram {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 8px;
  font-size: 13px;
}

.eco-mb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.eco-mb-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--eco-muted);
  font-family: ui-monospace, Menlo, monospace;
}

.eco-mb-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--eco-muted);
}

.eco-mb-status[data-state="up"] i {
  background: var(--eco-green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.eco-mb-status[data-state="down"] i {
  background: #f87171;
}

.eco-menu-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #dbe4f0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s var(--eco-ease), border-color 0.18s var(--eco-ease);
}

.eco-menu-btn:hover,
.eco-menu-btn:active {
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--eco-line);
}

.eco-menu-btn:focus-visible {
  outline: 2px solid var(--eco-cyan);
  outline-offset: 2px;
}

.eco-menu-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.eco-scrim {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(2, 5, 10, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--eco-ease), visibility 0.22s;
}

/* Cabeceras densas: permiten segunda línea para no desbordar bajo el shell */
@media (max-width: 1599px) {
  body.eco-has-shell header.eco-wrap-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }
}

body.eco-has-shell header.eco-wrap-header > div:first-child {
  min-width: 0;
}

body.eco-has-shell .studio-tabs {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

body.eco-has-shell .studio-tabs::-webkit-scrollbar {
  display: none;
}

body.eco-has-shell .studio-tabs > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Visor 3D: paneles fijos alineados al shell */
@media (min-width: 1024px) {
  body.eco-has-shell.eco-immersive .header-panel {
    left: calc(var(--eco-w) + 16px);
  }

  body.eco-has-shell.eco-collapsed.eco-immersive .header-panel {
    left: calc(var(--eco-w-rail) + 16px);
  }
}

@media (max-width: 1023px) {
  body.eco-has-shell.eco-immersive .header-panel {
    top: 70px;
    left: 12px;
    max-height: calc(100vh - 150px);
  }

  body.eco-has-shell,
  body.eco-has-shell.eco-collapsed,
  body.eco-authenticated.eco-has-shell,
  body.eco-authenticated.eco-has-shell.eco-collapsed {
    padding-left: 0 !important;
    padding-top: var(--eco-bar-safe);
  }

  body.eco-has-shell header.sticky {
    top: var(--eco-bar-safe);
  }

  /* Cabeceras internas: envuelven en vez de ensanchar el lienzo del móvil */
  body.eco-has-shell > header {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  body.eco-has-shell > header > div,
  body.eco-has-shell > header a {
    min-width: 0;
  }

  /* Filas de controles: envuelven antes que forzar ancho de escritorio */
  body.eco-has-shell .flex.items-center.space-x-2,
  body.eco-has-shell .flex.items-center.space-x-3 {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  body.eco-immersive .telemetry-bar {
    left: 10px;
    right: 10px;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 4px 10px;
    font-size: 0.65rem;
  }

  body.eco-authenticated .eco-shell {
    width: min(86vw, 312px);
    padding-top: env(safe-area-inset-top, 0px);
    transform: translateX(-100%);
    z-index: 80;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0 14px 14px 0;
    box-shadow: 24px 0 60px -20px rgba(0, 0, 0, 0.85);
    transition: transform 0.26s var(--eco-ease), visibility 0.26s var(--eco-ease);
    visibility: hidden;
    overscroll-behavior: contain;
  }

  body.eco-authenticated.eco-nav-open .eco-shell {
    display: flex !important;
    transform: translateX(0);
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body:not(.eco-authenticated) .eco-shell,
  body.eco-guest .eco-shell {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    pointer-events: none !important;
  }

  body.eco-nav-open {
    overflow: hidden;
  }

  .eco-nav {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .eco-nav::-webkit-scrollbar {
    width: 4px;
  }

  .eco-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
  }

  body.eco-nav-open .eco-scrim {
    opacity: 1;
    visibility: visible;
  }

  .eco-mobilebar {
    display: flex;
  }

  /* StudioMCom en móvil: herramientas como tira horizontal, lienzo a pantalla completa */
  body.eco-has-shell main {
    flex-direction: column;
  }

  body.eco-has-shell #studioDock {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: stretch;
    border-right: 0;
    border-bottom: 1px solid var(--eco-line);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body.eco-has-shell #studioDock::-webkit-scrollbar {
    display: none;
  }

  body.eco-has-shell #studioDock > div:first-child {
    display: flex;
    flex: 0 0 auto;
    padding: 7px 8px;
    gap: 8px;
  }

  body.eco-has-shell #studioDock > div:first-child > div:first-child > div:first-child,
  body.eco-has-shell #studioDock > div:first-child > div:last-child,
  body.eco-has-shell #studioDock > div:last-child {
    display: none;
  }

  body.eco-has-shell #studioDockNav {
    display: flex;
    gap: 6px;
  }

  body.eco-has-shell .studio-dock-btn {
    width: auto;
    padding: 7px 10px;
    white-space: nowrap;
  }

  body.eco-has-shell .studio-dock-btn p:last-child,
  body.eco-has-shell .dock-key {
    display: none;
  }

  body.eco-has-shell header.glass-panel {
    padding: 9px 12px;
  }

  body.eco-has-shell header.glass-panel p.text-xs {
    display: none;
  }

  body.eco-has-shell main > .module-view {
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Estudios: barras de herramientas desplazables, nunca recortadas */
  body.eco-has-shell .module-view {
    min-width: 0;
  }

  /* Lienzos de ancho fijo: se recorren con desplazamiento, sin quedar cortados */
  body.eco-has-shell .module-view .overflow-auto {
    justify-content: flex-start;
    align-items: flex-start;
  }

  body.eco-has-shell .module-view > div:first-child {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  body.eco-has-shell .module-view > div:first-child::-webkit-scrollbar {
    display: none;
  }

  /* En móvil el cajón siempre muestra etiquetas */
  body.eco-collapsed .eco-brand {
    padding: 18px 16px 16px;
    justify-content: flex-start;
  }

  body.eco-collapsed .eco-brand-text,
  body.eco-collapsed .eco-group-label,
  body.eco-collapsed .eco-link-label,
  body.eco-collapsed .eco-badge,
  body.eco-collapsed .eco-status span,
  body.eco-collapsed .eco-collapse span {
    display: revert;
  }

  body.eco-collapsed .eco-link {
    justify-content: flex-start;
    padding: 0 10px;
  }

  body.eco-collapsed .eco-collapse {
    justify-content: flex-start;
    padding: 0 10px;
  }

  body.eco-collapsed .eco-status {
    justify-content: flex-start;
    padding: 9px 10px;
  }

  body.eco-collapsed .eco-collapse svg {
    transform: none;
  }

  .eco-collapse {
    display: none;
  }

  body.eco-has-shell {
    overflow-x: hidden;
  }
}

@media (max-width: 639px) {
  body.eco-has-shell > header span.block {
    display: none;
  }

  body.eco-has-shell > header > div {
    gap: 8px;
  }

  /* Portada: cabecera en una sola línea compacta bajo la barra del dashboard */
  body.eco-has-shell header.eco-compact-header > div {
    height: 52px;
    padding: 0 12px;
    gap: 10px;
  }

  body.eco-has-shell header.eco-compact-header > div > div:first-child {
    min-width: 0;
    gap: 8px;
  }

  body.eco-has-shell header.eco-compact-header > div > div:first-child > div:first-child {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 9px;
  }

  body.eco-has-shell header.eco-compact-header > div > div:first-child > div:last-child {
    min-width: 0;
    overflow: hidden;
  }

  body.eco-has-shell header.eco-compact-header > div > div:first-child > div:last-child > span:first-child > span {
    display: none;
  }

  body.eco-has-shell header.eco-compact-header > div > div:first-child > div:last-child > span:first-child {
    display: block;
    font-size: 12px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.eco-has-shell header.eco-compact-header [data-eco-auth-slot],
  body.eco-has-shell header.eco-compact-header [data-eco-auth-slot] > div,
  body.eco-has-shell header.eco-compact-header [data-eco-auth-slot] button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.eco-has-shell header.eco-compact-header [data-eco-auth-slot] button {
    padding: 7px 11px;
    font-size: 11.5px;
    gap: 5px;
  }

  body.eco-has-shell header.eco-compact-header {
    background: rgba(7, 11, 18, 0.96);
  }
}

@media (max-width: 380px) {
  .eco-mb-status span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eco-shell,
  body.eco-has-shell,
  .eco-scrim,
  .eco-link,
  .eco-collapse svg {
    transition: none !important;
  }
}

/* El estado de sesión prevalece sobre cualquier regla responsive. */
.eco-shell[hidden], .eco-menu-btn[hidden], .eco-scrim[hidden] { display: none !important; }
body.eco-has-shell:not(.eco-authenticated) { padding-left: 0 !important; }

/* Accesibilidad y pulido de interacción compartido. */
::selection { background: #f0d67a; color: #0a0d13; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 2px;
}
.eco-shell a:focus-visible,
.eco-shell button:focus-visible {
  outline-color: #f0d67a;
}
@media (prefers-reduced-motion: reduce) {
  .eco-shell *,
  .eco-mb-status * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Lado del menú: izquierda (por defecto) o derecha ---------- */
body.eco-authenticated.eco-has-shell.eco-dock-right {
  padding-left: 0 !important;
  padding-right: var(--eco-w) !important;
}

body.eco-has-shell.eco-collapsed.eco-dock-right {
  padding-right: var(--eco-w-rail) !important;
}

body.eco-dock-right .eco-shell,
body.eco-authenticated.eco-has-shell.eco-dock-right .eco-shell {
  left: auto;
  right: 0;
  border-right: 0;
  border-left: 1px solid var(--eco-line);
  box-shadow: -1px 0 0 rgba(255, 255, 255, 0.02), -18px 0 40px -32px rgba(0, 0, 0, 0.9);
}

body.eco-collapsed .eco-side-toggle svg {
  transform: none;
}

@media (max-width: 1023px) {
  body.eco-dock-right.eco-has-shell,
  body.eco-dock-right.eco-has-shell.eco-collapsed,
  body.eco-dock-right.eco-authenticated.eco-has-shell,
  body.eco-dock-right.eco-authenticated.eco-has-shell.eco-collapsed {
    padding-right: 0 !important;
  }

  body.eco-dock-right.eco-authenticated .eco-shell {
    border-left: 1px solid rgba(148, 163, 184, 0.18);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    transform: translateX(100%);
    box-shadow: -24px 0 60px -20px rgba(0, 0, 0, 0.85);
  }

  body.eco-dock-right.eco-authenticated.eco-nav-open .eco-shell {
    transform: translateX(0);
  }
}
