/* =========================================================
   ZARIA · Commercial Strategy & Sales · «What’s on your desk?»
   Panel móvil (≤ 820 px) que sustituye al escritorio de escenarios
   y a la simulación larga. En escritorio no se muestra.
   Jerarquía: situación (sans, marrón, 16) → decisión (serif cursiva
   cobriza, 25) → controles → resultado (cifra grande sobre marrón
   oscuro) y su significado (crema). Detalle desplegable.
   ========================================================= */
.cdesk { display: none; }

@media (max-width: 1023px) {
  .sp-desk-wrap.has-cdesk .desk { display: none; }

  /* Jerarquía (Commercial, móvil): los títulos de sección quedan
     siempre por debajo del de portada, que se reduce en pantallas
     estrechas (service-page.css: (100vw − 40px) / 8,3, máx. 46). */
  .page-css { --cd-hero: min(46px, calc((100vw - 40px) / 8.3)); }
  .page-css .sp-intro__title { font-size: min(38px, calc(var(--cd-hero) * .9)); }
  .page-css .sp-closing__title { font-size: min(32px, calc(var(--cd-hero) * .8)); }
  .example.is-cdesk-replaced { display: none; }

  .cdesk.is-ready {
    --cd-ink: var(--c-ink);            /* #3A1E12 */
    --cd-copper: #8c331f;
    --cd-paper: #f2e4d8;
    --cd-line: rgba(58, 30, 18, .16);
    display: block;
    color: var(--cd-ink);
  }
  .cdesk__eyebrow {
    margin: 0 4px;
    font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
    color: var(--c-rust);
  }
  /* Título de sección por debajo del de portada (≈ 41 px) */
  .cdesk__title {
    margin: 10px 4px 0;
    font-size: min(30px, calc(var(--cd-hero, 46px) * .76)); line-height: 1.08; font-weight: 600; letter-spacing: -.015em;
  }
  .cdesk__lead { margin: 14px 4px 0; font-size: 15px; line-height: 1.55; }

  /* Tres botones compactos que ocupan el ancho; el activo, relleno */
  .cdesk__tabs {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
    margin-top: 22px;
  }
  .cdesk__tab {
    min-height: 48px; padding: 6px 6px;
    border: 1px solid rgba(58, 30, 18, .3); border-radius: 10px;
    background: transparent;
    font: 600 13px/1.2 var(--font-sans);
    color: var(--cd-ink);
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
  }
  .cdesk__tab[aria-selected="true"] {
    background: var(--cd-copper); border-color: var(--cd-copper); color: var(--cd-paper);
    box-shadow: 0 6px 14px -8px rgba(140, 51, 31, .7);
  }
  .cdesk__tab:focus-visible { outline: 2px solid var(--cd-copper); outline-offset: 2px; }

  /* Tarjeta de la situación activa: altura según su contenido */
  .cdesk__card {
    display: block;
    margin-top: 12px;
    padding: 22px 20px 8px;
    border-radius: 14px;
    background: var(--cd-paper);
    box-shadow: 0 1px 0 rgba(58, 30, 18, .06), 0 18px 34px -24px rgba(58, 30, 18, .45);
    transition: opacity .16s ease, transform .16s ease;
  }
  .cdesk__card.is-leaving { opacity: 0; transform: translateY(6px); }
  .cdesk__card:focus-visible { outline: 2px solid var(--cd-copper); outline-offset: 3px; }

  .cdesk__kicker {
    font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
    color: rgba(58, 30, 18, .62);
  }
  /* Situación: el punto de partida, en sans y marrón */
  .cdesk__situation { margin-top: 8px; font-size: 16px; line-height: 1.5; font-weight: 500; }
  /* Decisión: lo que ayudamos a decidir, en serif cursiva cobriza */
  .cdesk__kicker--decision { margin-top: 20px; }
  .cdesk__decision {
    margin-top: 6px;
    font-family: var(--font-serif); font-style: italic; font-weight: 500;
    font-size: 25px; line-height: 1.15; letter-spacing: -.005em;
    color: var(--cd-copper);
  }

  /* Controles táctiles: etiqueta y valor arriba; deslizador ancho
     con zona táctil de 44 px y tirador de 28 px */
  .cdesk__controls { margin-top: 18px; border-top: 1px solid var(--cd-line); }
  .cdesk__control { padding: 14px 0 4px; border-bottom: 1px solid var(--cd-line); }
  .cdesk__control-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .cdesk__control-label { font-size: 14px; line-height: 1.35; }
  .cdesk__control-value { flex: 0 0 auto; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cd-copper); }
  .cdesk__range {
    --fill: 50%;
    display: block; width: 100%; height: 44px; margin: 0;
    background: transparent;
    -webkit-appearance: none; appearance: none;
    cursor: pointer;
    touch-action: pan-y;
  }
  .cdesk__range::-webkit-slider-runnable-track {
    height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, var(--cd-copper) var(--fill), rgba(58, 30, 18, .16) var(--fill));
  }
  .cdesk__range::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(58, 30, 18, .16); }
  .cdesk__range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--cd-copper); }
  .cdesk__range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 28px; height: 28px; margin-top: -11px;
    border: 3px solid var(--cd-paper); border-radius: 50%;
    background: var(--cd-copper);
    box-shadow: 0 2px 6px rgba(58, 30, 18, .35);
  }
  .cdesk__range::-moz-range-thumb {
    width: 22px; height: 22px;
    border: 3px solid var(--cd-paper); border-radius: 50%;
    background: var(--cd-copper);
  }
  .cdesk__range:focus-visible { outline: 2px solid var(--cd-copper); outline-offset: 2px; border-radius: 6px; }

  /* Resultado: lo primero que se lee, sobre marrón oscuro */
  .cdesk__result {
    margin: 18px -20px 0;
    padding: 20px 20px 22px;
    background: var(--cd-ink);
    color: var(--cd-paper);
  }
  .cdesk__kicker--light { color: rgba(242, 228, 216, .7); }
  .cdesk__figure { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; margin-top: 8px; }
  .cdesk__figure b {
    font-size: 52px; line-height: 1; font-weight: 700; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    color: #e6b496;
  }
  .cdesk__figure span { flex: 1 1 140px; font-size: 15px; line-height: 1.35; font-weight: 600; }
  .cdesk__bar { display: flex; height: 10px; margin-top: 16px; border-radius: 5px; overflow: hidden; background: rgba(242, 228, 216, .15); }
  .cdesk__bar span { display: block; height: 100%; transition: width .3s ease; }
  .cdesk__bar-a { background: rgba(242, 228, 216, .38); }
  .cdesk__bar-b { background: #e6b496; }
  .cdesk__legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12px; color: rgba(242, 228, 216, .78); }
  .cdesk__legend-b { color: #e6b496; font-weight: 600; }
  /* Implicación para el negocio: frase sencilla en crema */
  .cdesk__meaning { margin-top: 14px; font-size: 15px; line-height: 1.55; color: rgba(242, 228, 216, .92); }

  /* Desplegable: cómo lo lleva ZARIA a la práctica + supuestos */
  .cdesk__more { margin: 0 -20px; }
  .cdesk__more-toggle {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 52px; padding: 0 20px;
    font-size: 14px; font-weight: 600;
    color: var(--cd-ink);
    list-style: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .cdesk__more-toggle::-webkit-details-marker { display: none; }
  .cdesk__more-toggle::after {
    content: ""; width: 9px; height: 9px; margin-right: 4px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s ease;
  }
  .cdesk__more[open] .cdesk__more-toggle::after { transform: translateY(2px) rotate(-135deg); }
  .cdesk__more-toggle:focus-visible { outline: 2px solid var(--cd-copper); outline-offset: -2px; }
  .cdesk__how { margin: 0 20px; padding: 0; list-style: none; counter-reset: how; }
  .cdesk__how li { display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; padding: 12px 0; border-top: 1px solid var(--cd-line); counter-increment: how; }
  .cdesk__how li::before { content: "0" counter(how); grid-row: span 2; font-size: 12px; font-weight: 700; color: var(--cd-copper); padding-top: 1px; }
  .cdesk__how-who { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(58, 30, 18, .62); }
  .cdesk__how-text { margin-top: 3px; font-size: 14.5px; line-height: 1.5; }
  .cdesk__gain { margin: 4px 20px 0; padding-top: 12px; border-top: 1px solid var(--cd-line); font-size: 14px; }
  .cdesk__gain em { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 17px; color: var(--cd-copper); }
  .cdesk__assume { margin: 10px 20px 18px; font-size: 12px; line-height: 1.5; color: rgba(58, 30, 18, .62); }
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
  .cdesk__card, .cdesk__bar span { transition: none; }
}
