/* =========================================================
   MG TOOLS · UI
   Estilos exclusivos para herramientas
   (REORDENADO · SIN CAMBIAR RESULTADO VISUAL)
   ========================================================= */

/* =========================================================
   1) BASE UI (shared)
   ========================================================= */
.mg-pill{
  font-size:.75rem;
  font-weight:700;
  padding:.25rem .6rem;
  border-radius:999px;
  background: rgba(13,110,253,.10);
  border: 1px solid rgba(13,110,253,.20);
}

.mg-section-title{
  font-weight:800;
  letter-spacing:-.2px;
}

/* Post CTA WhatsApp (bloque) */
.mg-after-cta{
  border-radius:14px;
  padding:14px;
  background: rgba(37,211,102,.08);
  border:1px solid rgba(37,211,102,.22);
}

.mg-btn-whatsapp{
  background:#25d366;
  border-color:#25d366;
  color:#0b1a10;
}
.mg-btn-whatsapp:hover{
  background:#1ebe5d;
  border-color:#1ebe5d;
  color:#0b1a10;
}

/* =========================================================
   2) OUTPUT / RESULTADOS / LOADER / ACTIONS
   ========================================================= */
.tool-result { margin-top: 20px; }

.tool-result .tool-box{
  background: #ffffff;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 16px;
  color: #2b2f33;
}

.tool-result p{
  margin-bottom: 6px;
  color: #2b2f33;
  font-size: 0.95rem;
}

.tool-badge-success{
  background: #e8f6ec;
  color: #1e7e34;
  border: 1px solid #b7e4c7;
}

.tool-badge-danger{
  background: #fdecea;
  color: #b02a37;
  border: 1px solid #f5c2c7;
}

.tool-warnings{
  margin-top: 10px;
  color: #b02a37;
  font-size: 0.9rem;
}

.tool-warnings ul{
  padding-left: 18px;
  margin-bottom: 0;
}

.mg-loader{ padding: 20px; }
.mg-loader .spinner-border{ width: 2.2rem; height: 2.2rem; }

.tool-actions{ margin-top: 18px; }
.tool-actions .btn-outline-warning{ border-width: 2px; }

/* Botón WhatsApp dentro de tool-actions (se mantiene) */
.tool-actions .btn-success{
  background-color: #25d366;
  border-color: #25d366;
}
.tool-actions .btn-success:hover{
  background-color: #1ebe5d;
}

/* =========================================================
   3) MULTICOPIAS (MOSAICO)
   ========================================================= */
.mg-paper-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

@media (max-width: 575px){
  .mg-paper-grid{ grid-template-columns: 1fr; }
}

.mg-paper-card{
  text-align:left;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  border-radius:14px;
  padding:14px;
  transition:transform .05s ease, border-color .15s ease, box-shadow .15s ease;
}
.mg-paper-card:hover{ transform: translateY(-1px); }
.mg-paper-card.is-active{
  border-color: rgba(13,110,253,.60);
  box-shadow: 0 8px 18px rgba(13,110,253,.12);
}

.mg-paper-title{ font-weight:800; font-size:16px; }
.mg-paper-sub{ font-size:13px; margin-top:2px; }

/* Copias por hoja */
.mg-copies-box{
  border: 1px solid rgba(0,0,0,.15);
  border-left: 4px solid #0d6efd;
  border-radius: 12px;
  padding: 14px 16px;
  background: #f8f9fb;
}
.mg-copies-line{
  font-size: 15px;
  font-weight: 600;
  color: #1f2933;
}
.mg-copies-line strong{ color: #0d6efd; }
.mg-copies-hint{
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* Avanzadas */
.mg-adv-toggle{
  border:none;
  background:transparent;
  padding:0;
  font-weight:700;
  color:inherit;
  display:flex;
  gap:8px;
  align-items:center;
  cursor:pointer;
}
.mg-adv-panel{
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  padding:12px;
  background:#fff;
  margin-top:10px;
}

/* =========================================================
   4) RESIZE PARA IMPRESIÓN (componentes)
   ========================================================= */
.mg-info-line{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
}

.mg-chip-group{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mg-chip{
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  line-height: 1.05;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}
.mg-chip:hover{
  transform: translateY(-1px);
  border-color: rgba(13,110,253,.45);
  box-shadow: 0 8px 18px rgba(13,110,253,.10);
}
.mg-chip-main{ font-weight: 800; font-size: 14px; }
.mg-chip-sub{ font-size: 12px; color: #6b7280; }

.mg-ir-preview{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}
.mg-ir-preview-inner{
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 240px;
  overflow: hidden;
  border-radius: 12px;
  background: #f8f9fb;
}
.mg-ir-preview img{
  max-width: 100%;
  max-height: 240px;
  height: auto;
  display: block;
}

.mg-ir-inline-preview{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  background: #f8f9fb;
  padding: 10px;
}
.mg-ir-inline-preview img{
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* Guías ANCHO / ALTO */
#tool-resize #irPreviewWrap.mg-ir-preview{ position: relative; }

#tool-resize #irPreviewWrap .mg-ir-ref-x{
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #111;
  opacity: .9;
  pointer-events: none;
}

#tool-resize #irPreviewWrap .mg-ir-ref-y{
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #111;
  opacity: .9;
  pointer-events: none;
}

/* =========================================================
   5) HUB · Herramientas (cards clickeables)
   ========================================================= */
.mg-tools-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

@media (min-width: 992px){
  .mg-tools-grid{
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

/* Card clickeable */
.mg-tool-card{
  display: flex;
  gap: 14px;
  padding: 14px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;

  height: 100%;
  align-items: stretch;
}

.mg-tool-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15,23,42,.12);
  border-color: rgba(255,122,0,.35);
}

.mg-tool-card__icon{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff7a00;
  background: rgba(255,122,0,.10);
  border: 1px solid rgba(255,122,0,.18);
  flex: 0 0 auto;
}
.mg-tool-card__icon svg{ width: 26px; height: 26px; }

.mg-tool-card__body{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.mg-tool-card__title{
  font-weight: 700;
  font-size: 16px;
  color: #0f172a;
}

.mg-tool-card__desc{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(15,23,42,.72);
  margin-bottom: auto;
}

.mg-tool-card__meta{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(15,23,42,.55);
}

.mg-tool-card__chev{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(15,23,42,.55);
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.06);
  flex: 0 0 auto;
}
.mg-tool-card__chev svg{ width: 18px; height: 18px; }

/* =========================================================
   6) HUB overrides (header + pill)
   ========================================================= */
.mg-tools-hub .mg-pill{
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}

.mg-tools-header{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

@media (min-width: 992px) {
  .mg-tools-header{
    gap: 10px;
    margin-bottom: 20px;
  }
}

.mg-tools-pill{
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 999px;
}

.mg-tools-title,
.mg-tools-lead{ margin: 0; }

.mg-tools-lead{
  line-height: 1.35;
  max-width: 62ch;
}

.mg-tools-header .mg-section-title{ color: #1f2937; }

.mg-tools-header .mg-section-title mark,
.mg-tools-header .mg-section-title .highlight{
  background: #3b82f6;
  color: #ffffff;
  padding: 0.1em 0.25em;
  border-radius: 4px;
}

/* =========================================================
   7) ACCORDION (mg-acc)
   ========================================================= */
.mg-acc { overflow: hidden; }

.mg-acc__head{
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 18px 18px;
}

.mg-acc__text{
  flex: 1;
  min-width: 0;
}

.mg-acc__head .mg-pill{
  display: inline-flex !important;
  width: auto !important;
  max-width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  margin: 0 0 8px 0 !important;
}

.mg-acc__text .mg-section-title{
  margin: 0 !important;
  line-height: 1.15;
}

.mg-acc__text .text-muted{
  margin: 6px 0 0 !important;
}

/* Chevron (base - LIGHT) */
.mg-acc__chev{
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
  line-height: 1;

  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.10);
  color: rgba(15,23,42,.70);

  transform: rotate(0deg);
  transition: transform .22s ease, opacity .22s ease, border-color .22s ease;
  opacity: .9;
}

.mg-acc__head[aria-expanded="true"] .mg-acc__chev{
  transform: rotate(180deg);
  opacity: 1;
}

.mg-acc__panel{
  max-height: 0;
  overflow: hidden;
  transition: max-height .26s ease;
  border-top: 1px solid rgba(255,255,255,.10);
}

.mg-acc__panel.is-open{
  border-top-color: rgba(255,255,255,.14);
}

@media (hover:hover){
  .mg-acc__head:hover .mg-acc__chev{
    border-color: rgba(255,122,0,.35);
    color: rgba(15,23,42,.85);
  }
}

.mg-acc__head:focus-visible{
  outline: 2px solid rgba(37,211,102,.35);
  outline-offset: 3px;
  border-radius: 16px;
}

@media (max-width: 576px){
  .mg-acc__head{
    padding: 16px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mg-acc__text{ text-align: center; }

  .mg-acc__head .mg-pill{
    align-self: center;
    margin-bottom: 0 !important;
  }

  .mg-acc__chev{
    align-self: center;
    margin-top: 2px;
  }
}

/* =========================================================
   8) THEME / LEGIBILITY OVERRIDES (page-scope)
   ========================================================= */
html.mg-theme-light .mg-page-tools .mg-card,
html.mg-theme-light .mg-page-tools .mg-card .card-body{
  color: #111 !important;
}

html.mg-theme-dark .mg-page-tools .mg-card,
html.mg-theme-dark .mg-page-tools .mg-card .card-body{
  color: var(--mg-text) !important;
}

html.mg-theme-light .mg-page-tools .mg-card .mg-section-title{
  color: #111 !important;
}

html.mg-theme-dark .mg-page-tools .mg-card .mg-section-title{
  color: var(--mg-text) !important;
}

html.mg-theme-light .mg-page-tools .mg-card .text-muted,
html.mg-theme-light .mg-page-tools .mg-card .form-text{
  color: #6c757d !important;
}

html.mg-theme-dark .mg-page-tools .mg-card .text-muted,
html.mg-theme-dark .mg-page-tools .mg-card .form-text{
  color: var(--mg-muted) !important;
}

html.mg-theme-dark .mg-tools-title{
  color: #fff !important;
}

/* Dark: accordion chev */
html.mg-theme-dark .mg-page-tools .mg-acc__chev{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
}

@media (hover:hover){
  html.mg-theme-dark .mg-page-tools .mg-acc__head:hover .mg-acc__chev{
    border-color: rgba(255,122,0,.35);
    color: rgba(255,255,255,.92);
  }
}

/* =========================================================
   9) PATCHES / FIXES (Bootstrap row negative margins)
   ========================================================= */
@media (max-width: 576px){
  .mg-page-tools section.row{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .mg-page-tools section.row > [class*="col-"]{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .mg-page-tools .mg-card{
    border-radius: 18px;
  }
}

/* =========================================================
   10) HARD OVERRIDES (tool-specific, keep last)
   ========================================================= */
/* Overrides específicos de resize (los dejo tal cual, no se tocan) */
#tool-resize,
#tool-resize .card-body{ color: #111 !important; }

#tool-resize .mg-section-title,
#tool-resize .form-label{ color: #111 !important; }

#tool-resize .text-muted,
#tool-resize .form-text{ color: #6c757d !important; }

#tool-resize .mg-info-line{
  color: #111 !important;
  background: #f8f9fb !important;
  border-color: rgba(0,0,0,.12) !important;
}

/* RESIZE: título legible en dark */
html.mg-theme-dark #tool-resize .mg-section-title{
  color: #fff !important;
}

/* Dark: labels (subtítulos) legibles en Resize */
html.mg-theme-dark #tool-resize .form-label{
  color: #fff !important;
}

/* CHIPS / TAMAÑOS COMUNES – DARK */
html.mg-theme-dark #tool-resize .mg-chip,
html.mg-theme-dark #tool-resize .mg-chip-group button,
html.mg-theme-dark #tool-resize .mg-chip-group .btn{
  color: #ff8800 !important;
}

/* PREVIEW RESIZE – TEXTO ALTO / ANCHO (DARK) */
html.mg-theme-dark #tool-resize .mg-ir-ref-x span,
html.mg-theme-dark #tool-resize .mg-ir-ref-y span{
  color: #ffffff;
  font-weight: 600;
  -webkit-text-stroke: 1.25px rgba(248, 104, 15, 0.85);
  text-shadow:
    0 1px 2px rgba(255, 125, 18, 0.9),
    0 0 4px rgba(0,0,0,.7);
  letter-spacing: 0.25em;
}

/* PREVIEW RESIZE – ALINEACIÓN "ALTO" EN DARK */
html.mg-theme-dark #tool-resize #irPreviewWrap .mg-ir-ref-y{
  left: -24px;
}

html.mg-theme-dark #tool-resize .mg-ir-ref-y span{
  letter-spacing: 0.18em;
}

/* =========================================================
   RESIZE · TAMAÑOS COMUNES (MOBILE COMPACT) – keep last
   ========================================================= */
@media (max-width: 576px){

  /* 3 por fila */
  #tool-resize #irPresets{
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  /* Ocultar el 4to (deja solo 3) */
  #tool-resize #irPresets .mg-chip:nth-child(n+4){
    display: none !important;
  }

  /* Chip: hacerlo más bajo y menos “gordo” */
  #tool-resize #irPresets .mg-chip{
    width: 100% !important;
    padding: 8px 8px !important;
    border-radius: 14px !important;    /* menos “pastilla gigante” */
    gap: 2px !important;
    min-height: 42px !important;       /* más compacto pero usable */
  }

  /* Texto principal un toque más chico */
  #tool-resize #irPresets .mg-chip .mg-chip-main{
    font-size: 13px !important;
    line-height: 1.05 !important;
  }

  /* Ocultar “común / popular” en mobile */
  #tool-resize #irPresets .mg-chip .mg-chip-sub{
    display: none !important;
  }
}
@media (max-width: 576px){
  /* que el texto se vea más “llenito” */
  #tool-resize #irPresets .mg-chip .mg-chip-main{
    font-size: 14.5px !important;
    font-weight: 800 !important;
    letter-spacing: .2px;
  }

  /* centrar mejor el contenido dentro del chip */
  #tool-resize #irPresets .mg-chip{
    min-height: 38px !important;   /* un pelín más bajo */
    padding: 7px 8px !important;
    justify-content: center !important;
  }
}

/* =========================================================
   Highlight temporal al llegar a una herramienta (Glow)
   ========================================================= */
.mg-tool-highlight {
  position: relative;
  border-radius: 18px; /* respeta tu estética de cards */
  animation: mg-glow-pulse 1.6s ease-out 1;
}

/* Glow suave (light/default) */
@keyframes mg-glow-pulse {
  0% { box-shadow: 0 0 0 rgba(255, 122, 0, 0); }
  25% {
    box-shadow:
      0 0 0 2px rgba(255, 122, 0, 0.35),
      0 0 24px rgba(255, 122, 0, 0.35);
  }
  100% { box-shadow: 0 0 0 rgba(255, 122, 0, 0); }
}

/* Dark theme: un poquito más visible */
html.mg-theme-dark .mg-tool-highlight {
  animation: mg-glow-pulse-dark 1.6s ease-out 1;
}

@keyframes mg-glow-pulse-dark {
  0% { box-shadow: 0 0 0 rgba(255, 136, 0, 0); }
  25% {
    box-shadow:
      0 0 0 2px rgba(255, 136, 0, 0.45),
      0 0 26px rgba(255, 136, 0, 0.45);
  }
  100% { box-shadow: 0 0 0 rgba(255, 136, 0, 0); }
}

/* =========================================================
   ¿SIRVE PARA IMPRIMIR? (CALIDAD DE IMAGEN)
   ========================================================= */

/*
 * La definición inicial de .mg-q-box (fondo blanco, borde, radio y padding)
 * se integra en la declaración de la caja de calidad más abajo para evitar
 * duplicaciones.  Se elimina este bloque.
 */

.mg-q-badge{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  font-weight:800;
  padding:.35rem .75rem;
  border-radius:999px;
  font-size:.9rem;
  border:1px solid transparent;
}

.mg-q-badge--good{ background:#e8f6ec; color:#1e7e34; border-color:#b7e4c7; }
.mg-q-badge--ok{ background:#fff3cd; color:#7a5b00; border-color:#ffe69c; }
.mg-q-badge--bad{ background:#fdecea; color:#b02a37; border-color:#f5c2c7; }

.mg-q-reason{
  margin-top:8px;
  color:#2b2f33;
  font-size:.95rem;
}

.mg-q-size{
  text-align:right;
  min-width: 220px;
}

.mg-q-size__label{
  font-size:.82rem;
  color:#6c757d;
  font-weight:700;
}

.mg-q-size__value{
  font-size:1.15rem;
  font-weight:900;
  letter-spacing:-.2px;
}

.mg-q-size__meta{
  font-size:.8rem;
  color:#6c757d;
}

.mg-q-sizes__title{
  font-weight:800;
  margin-bottom:10px;
}

.mg-q-sizes__grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}

.mg-q-sizes__card{
  border:1px solid rgba(0,0,0,.10);
  border-radius:12px;
  padding:12px;
  background:#f8f9fb;
}

.mg-q-sizes__k{ font-weight:800; font-size:.9rem; }
.mg-q-sizes__v{ font-weight:900; margin-top:2px; }
.mg-q-sizes__m{ color:#6c757d; font-size:.8rem; }

.mg-q-tips ul{ padding-left: 18px; }

.mg-q-advanced-toggle{
  display:inline-block;
  font-weight:700;
  text-decoration:none;
}

.mg-q-advanced{
  border:1px dashed rgba(0,0,0,.20);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}

@media (max-width: 576px){
  .mg-q-size{ text-align:left; }
  .mg-q-sizes__grid{ grid-template-columns: 1fr; }
}

/* ===============================
   QUALITY · Size cards con referencia visual
================================ */

.mg-q-sizes__card{
  position: relative;
  overflow: hidden;
}

.mg-q-sizes__card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:6px;
  border-radius: 12px 0 0 12px;
  opacity: .9;
}

/* Por orden: Excelente / Aceptable / Básico */
.mg-q-sizes__grid .mg-q-sizes__card:nth-child(1)::before{
  background: #28a745; /* verde */
}
.mg-q-sizes__grid .mg-q-sizes__card:nth-child(2)::before{
  background: #f0ad4e; /* amarillo/naranja */
}
.mg-q-sizes__grid .mg-q-sizes__card:nth-child(3)::before{
  background: #dc3545; /* rojo */
}

/* Opcional: título con un toque del color */
.mg-q-sizes__grid .mg-q-sizes__card:nth-child(1) .mg-q-sizes__k{ color:#28a745; }
.mg-q-sizes__grid .mg-q-sizes__card:nth-child(2) .mg-q-sizes__k{ color:#f0ad4e; }
.mg-q-sizes__grid .mg-q-sizes__card:nth-child(3) .mg-q-sizes__k{ color:#dc3545; }

/* =========================================================
   QUALITY BOX – legible en Light y Dark (card blanca)
   ========================================================= */

.mg-q-box{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.12) !important;
  color:#111 !important;
  /* Unificamos propiedades de la definición previa: radio y padding */
  border-radius:14px;
  padding:16px;
}

.mg-q-box .mg-q-reason,
.mg-q-box .mg-q-sizes__title,
.mg-q-box .mg-q-sizes__k,
.mg-q-box .mg-q-sizes__v,
.mg-q-box .mg-q-tips,
.mg-q-box .mg-q-tips li{
  color:#111 !important;
}

/* secundarios */
.mg-q-box .text-muted,
.mg-q-box .mg-q-size__label,
.mg-q-box .mg-q-size__meta,
.mg-q-box .mg-q-sizes__m{
  color:#6c757d !important;
}

/* cards internas */
.mg-q-sizes__card{
  background:#f8f9fb !important;
  border-color: rgba(0,0,0,.10) !important;
}

/* "Ver detalles" */
.mg-q-advanced-toggle{
  color:#0d6efd !important;
}
.mg-q-advanced-toggle:hover{
  text-decoration: underline;
}


/* =========================================================
   QUALITY SIZE CARDS – text contrast fix (dark)
   ========================================================= */

body[class*="dark"] .mg-q-sizes__card{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.14);
}

body[class*="dark"] .mg-q-sizes__card .mg-q-sizes__v{
  color: rgba(255,255,255,.95);
}

body[class*="dark"] .mg-q-sizes__card .mg-q-sizes__k{
  font-weight: 800;
}

/* =========================================================
   11) COTIZACIÓN AUTOMÁTICA (Cost Calculator)
   ========================================================= */

.mg-cost-ticket{
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.8);
}

.mg-cost-title{
  font-weight: 900;
  letter-spacing: -.2px;
  font-size: 1.05rem;
}

.mg-cost-total{
  text-align: right;
  min-width: 180px;
}

.mg-cost-total-amount{
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1.1;
}

.mg-cost-currency{
  font-size: .85rem;
  font-weight: 800;
  opacity: .8;
}

.mg-cost-item{
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.015);
  margin-bottom: 10px;
}


.mg-cost-meta{
  font-size: .92rem;
}


.mg-cost-badge{
  font-size: .72rem;
  font-weight: 900;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
}

.mg-badge-pdf{
  background: rgba(220,53,69,.12);
  border-color: rgba(220,53,69,.24);
}

.mg-badge-docx{
  background: rgba(13,110,253,.12);
  border-color: rgba(13,110,253,.24);
}

.mg-cost-notes{ margin-top: 6px; }

.mg-cost-disclaimer{
  border-radius: 12px;
  padding: 12px;
  border: 1px dashed rgba(0,0,0,.18);
  background: rgba(0,0,0,.02);
}

/* Dark theme */
body[class*="dark"] .mg-cost-ticket{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
}

body[class*="dark"] .mg-cost-item{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
}

body[class*="dark"] .mg-cost-badge{
  border-color: rgba(255,255,255,.16);
}

body[class*="dark"] .mg-cost-disclaimer{
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
}

/* =========================================================
   COTIZACIÓN · FIX CONTRASTE DARK (override final)
   ========================================================= */

html.mg-theme-dark .mg-page-tools .mg-cost-ticket{
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(255,255,255,.16) !important;
  color: #f9fafb !important;
}

html.mg-theme-dark .mg-page-tools .mg-cost-item{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.14) !important;
  color: #f9fafb !important;
}

/* títulos y nombres */
html.mg-theme-dark .mg-page-tools .mg-cost-title,
html.mg-theme-dark .mg-page-tools .mg-cost-filename{
  color: #ffffff !important;
}

/* metadatos */
html.mg-theme-dark .mg-page-tools .mg-cost-meta,
html.mg-theme-dark .mg-page-tools .mg-cost-notes,
html.mg-theme-dark .mg-page-tools .mg-cost-notes .text-muted{
  color: rgba(255,255,255,.82) !important;
}

/* total destacado */
html.mg-theme-dark .mg-page-tools .mg-cost-total-amount{
  color: #ffffff !important;
}

/* badges PDF / DOCX */
html.mg-theme-dark .mg-page-tools .mg-cost-badge{
  color: #ffffff !important;
  border-color: rgba(255,255,255,.22) !important;
}

/* disclaimer */
html.mg-theme-dark .mg-page-tools .mg-cost-disclaimer{
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.22) !important;
  color: rgba(255,255,255,.78) !important;
}

/* select simple / doble */
html.mg-theme-dark .mg-page-tools .mg-cost-mode select{
  background-color: #0b1220 !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,.25) !important;
}

/* COST · toggle FIX (sin btn-group) */
.mg-cost-toggle{
  display: flex;
  gap: 8px;
  width: 100%;
}

.mg-cost-toggle .btn{
  flex: 1 1 0;
  border-radius: 999px;
  font-weight: 900;
  padding: .42rem .55rem;
  line-height: 1;
}

/* Para que el bloque derecho no se deforme */
.mg-cost-mode{
  flex: 0 0 160px;   /* un poco más ancho */
  min-width: 160px;
}

/* COST · títulos largos (no rompen layout) */
.mg-cost-item .flex-grow-1{
  min-width: 0;
}

.mg-cost-filename{
  font-weight: 800;
  line-height: 1.1;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* COST · columna derecha estable */


/* =========================================================
   COST · CONTROLES MINIMALISTAS
   ========================================================= */

/* ---- Copias ---- */
.mg-cost-copies-row{
  display: flex;
  align-items: center;
  gap: 6px;
}

.mg-cost-copies-row button{
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.mg-cost-copies{
  width: 38px;
  height: 26px;
  padding: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
}

/* ---- Toggle Simple / Doble ---- */
.mg-cost-toggle{
  display: inline-flex;
  gap: 6px;
}

.mg-cost-toggle .btn{
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1.2;
}

/* Estado activo */
.mg-cost-toggle .btn-primary{
  background-color: var(--mg-primary);
  border-color: var(--mg-primary);
}

/* Estado inactivo más liviano */
.mg-cost-toggle .btn-outline-secondary{
  color: var(--mg-muted);
  border-color: rgba(0,0,0,.15);
}

/* Dark theme */
html.mg-theme-dark .mg-cost-toggle .btn-outline-secondary{
  color: rgba(255,255,255,.7);
  border-color: rgba(255,255,255,.25);
}

/* CTA reseña Google – bloque de cierre */
.mg-review-cta{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

/* borde degradé sutil */
.mg-review-cta::before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: inherit;
  padding:2px;
  background: linear-gradient(
    135deg,
    rgba(99,102,241,.65),
    rgba(34,197,94,.55),
    rgba(245,158,11,.55)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events:none;
}

/* glow suave decorativo */
.mg-review-cta::after{
  content:"";
  position:absolute;
  width:420px;
  height:420px;
  right:-220px;
  bottom:-260px;
  background: radial-gradient(
    circle,
    rgba(99,102,241,.18),
    transparent 60%
  );
  pointer-events:none;
}

/* fondo apenas distinto en dark */
html.mg-theme-dark .mg-review-cta{
  background: rgba(255,255,255,.035);
}

/* =========================================================
   PDF ANALYZER · Result box (Light + Dark safe)
   ========================================================= */

.mg-tool-result-box{
  background: #f8f9fb;
  border-color: rgba(0,0,0,.12);
  color: #111;
}

.mg-tool-result-box p,
.mg-tool-result-box strong{
  color: #111;
}

/* Dark theme */
html.mg-theme-dark .mg-tool-result-box{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.92);
}

html.mg-theme-dark .mg-tool-result-box p,
html.mg-theme-dark .mg-tool-result-box strong{
  color: rgba(255,255,255,.92);
}

/* =========================================================
   MULTICOPIAS · Cards A4/A3 (Dark theme fix)
   ========================================================= */
html.mg-theme-dark .mg-paper-card {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.92) !important;
}

html.mg-theme-dark .mg-paper-card * {
  color: inherit !important;
}

html.mg-theme-dark .mg-paper-card .text-muted,
html.mg-theme-dark .mg-paper-card small,
html.mg-theme-dark .mg-paper-card p {
  color: rgba(255,255,255,.70) !important;
}

/* Hover */
html.mg-theme-dark .mg-paper-card:hover {
  border-color: rgba(255,255,255,.24) !important;
}

/* Active/selected */
html.mg-theme-dark .mg-paper-card.is-active {
  background: rgba(90,110,255,.16) !important;   /* o tu accent */
  border-color: rgba(90,110,255,.55) !important;
  box-shadow: 0 0 0 2px rgba(90,110,255,.22) !important;
}

/* Si en light tienen fondo blanco forzado */
html.mg-theme-dark .mg-paper-card.bg-white,
html.mg-theme-dark .mg-paper-card.bg-light {
  background: rgba(255,255,255,.06) !important;
}

/* =========================================================
   MULTICOPIAS · Opciones avanzadas (Dark theme fix)
   ========================================================= */

html.mg-theme-dark .mg-adv-toggle {
  color: rgba(255,255,255,.92);
}

html.mg-theme-dark .mg-adv-toggle i {
  color: rgba(255,255,255,.70);
}

/* Panel contenedor */
html.mg-theme-dark .mg-adv-panel {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px; /* respeta el look pill/card */
}

/* Labels y ayudas */
html.mg-theme-dark .mg-adv-panel .form-label {
  color: rgba(255,255,255,.90);
}

html.mg-theme-dark .mg-adv-panel .form-text,
html.mg-theme-dark .mg-adv-panel .text-muted {
  color: rgba(255,255,255,.65);
}

/* Inputs number */
html.mg-theme-dark .mg-adv-panel .form-control {
  background: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
}

html.mg-theme-dark .mg-adv-panel .form-control::placeholder {
  color: rgba(255,255,255,.45);
}

html.mg-theme-dark .mg-adv-panel .form-control:focus {
  border-color: rgba(90,110,255,.55);
  box-shadow: 0 0 0 0.2rem rgba(90,110,255,.18);
}

/* Input color (bootstrap) */
html.mg-theme-dark .mg-adv-panel .form-control-color {
  background: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.14);
}

/* Para que el cuadrito del color se vea bien en dark */
html.mg-theme-dark .mg-adv-panel input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}
html.mg-theme-dark .mg-adv-panel input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
}

