/* Fuera de Planificación (p. ej. pausa táctica) los controles añadidos no interfieren. */
.v1055-step-btn{display:none}
.v1055-range-shell{min-width:0}
.tactical-controls .v1055-range-shell{display:block;width:100%}
.tactical-controls .v1055-range-shell input[type="range"]{width:100%}

/* Coffee Rush STA v10.5.5 · planificación centrada en controles
   En planificación desaparece la ilustración. El objetivo es que analizar,
   probar y decidir resulte claro, cómodo y agradable. */

body[data-interface-phase="planning"] .workspace{
  width:min(100%,1680px);
  max-width:1680px;
  padding-inline:clamp(12px,1.35vw,22px);
}

/* La pantalla de planificación es ahora una mesa de trabajo, no una escena. */
body[data-interface-phase="planning"] .v1055-planning-grid{
  display:grid;
  grid-template-columns:minmax(290px,.82fr) minmax(470px,1.38fr) minmax(320px,.9fr);
  gap:12px;
  align-items:start;
}
body[data-interface-phase="planning"] .v1055-planning-grid>*{min-width:0}
body[data-interface-phase="planning"] .v1055-briefing,
body[data-interface-phase="planning"] .v1055-decisions-panel,
body[data-interface-phase="planning"] .v1055-plan-summary,
body[data-interface-phase="planning"] .v1055-resources-panel{
  margin:0;
  border:1px solid #d6e3ec;
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 26px rgba(20,53,81,.055);
}
body[data-interface-phase="planning"] .v1055-briefing,
body[data-interface-phase="planning"] .v1055-decisions-panel,
body[data-interface-phase="planning"] .v1055-plan-summary{padding:14px}
body[data-interface-phase="planning"] .v1055-resources-panel{margin-top:12px;padding:14px}

body[data-interface-phase="planning"] .v1055-section-intro{
  margin:3px 0 0;
  max-width:660px;
  color:#60758a;
  font-size:10.5px;
  line-height:1.35;
}

/* Contexto: lectura completa y relajada. */
body[data-interface-phase="planning"] .v1055-briefing .briefing-title{margin-bottom:10px}
body[data-interface-phase="planning"] .v1055-briefing .briefing-title h2{font-size:17px}
body[data-interface-phase="planning"] .v1055-briefing .compact-scenario-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box{
  min-height:118px;
  padding:10px;
  grid-template-columns:34px minmax(0,1fr);
  gap:8px;
  border-radius:13px;
  align-content:start;
}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box .brief-icon{
  width:34px;height:34px;border-radius:10px;
}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box small{font-size:9px}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box strong{
  margin-top:1px;
  font-size:12px;
  line-height:1.25;
}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box p{
  margin-top:5px;
  font-size:10px;
  line-height:1.38;
  color:#526b82;
}
body[data-interface-phase="planning"] .v1055-reading-block{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid #e7eef3;
}
body[data-interface-phase="planning"] .v1055-reading-title{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom:7px;
}
body[data-interface-phase="planning"] .v1055-reading-title>span{
  color:#2d536f;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.045em;
}
body[data-interface-phase="planning"] .v1055-reading-title small{
  color:#738699;
  font-size:9px;
  text-align:right;
}
body[data-interface-phase="planning"] .v1055-reading-block .v105-market-strip{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  border:0;
}
body[data-interface-phase="planning"] .v1055-reading-block .market-pill{
  min-height:58px;
  padding:8px 9px;
  border:1px solid #e0e9f0!important;
  border-radius:11px!important;
  background:#f8fbfd;
}
body[data-interface-phase="planning"] .v1055-reading-block .market-pill>span{font-size:8.5px}
body[data-interface-phase="planning"] .v1055-reading-block .market-pill strong{font-size:11px;line-height:1.25}

/* Decisiones: controles grandes, precisos y agradables. */
body[data-interface-phase="planning"] .v1055-decisions-panel .section-heading-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
body[data-interface-phase="planning"] .v1055-decisions-panel h2{font-size:18px}
body[data-interface-phase="planning"] .v1055-decision-legend{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:4px;
  max-width:250px;
}
body[data-interface-phase="planning"] .v1055-decision-legend span{
  padding:4px 7px;
  border:1px solid #dfebf2;
  border-radius:999px;
  background:#f7fafc;
  color:#526b82;
  font-size:8.5px;
  font-weight:800;
  white-space:nowrap;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:9px;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .v1055-decision-card{
  position:relative;
  display:grid;
  grid-template-columns:58px minmax(0,1fr);
  grid-auto-rows:auto;
  column-gap:11px;
  row-gap:6px;
  padding:11px 12px;
  border:1px solid #dbe7ef;
  border-radius:14px;
  background:linear-gradient(180deg,#fff,#fbfdff);
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .v1055-decision-card:focus-within{
  border-color:#8fc1e2;
  box-shadow:0 0 0 3px rgba(0,90,155,.09),0 10px 24px rgba(23,64,96,.08);
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-title{
  grid-column:1;
  grid-row:1/-1;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
  gap:3px;
  margin:0;
  padding-top:2px;
  text-align:center;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-title .decision-icon-badge{
  width:44px;height:44px;border-radius:12px;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-title>span:not(.decision-icon-badge){
  font-size:9px;
  letter-spacing:.035em;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-title strong{
  max-width:64px;
  font-size:13px;
  line-height:1.15;
  overflow-wrap:normal;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-number{
  top:9px;right:9px;
  width:24px;height:24px;
  font-size:10px;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .compact-field,
body[data-interface-phase="planning"] .v1055-decisions-panel .v1055-range-shell,
body[data-interface-phase="planning"] .v1055-decisions-panel .scale,
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-help,
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-impact{
  grid-column:2;
  width:100%;
  max-width:100%;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .compact-field>span{display:block;margin-bottom:4px;font-size:9px;color:#6a7d90;font-weight:800}
body[data-interface-phase="planning"] .v1055-decisions-panel .compact-field select{
  width:100%;
  min-height:46px;
  padding:8px 38px 8px 11px;
  border:1px solid #cddde8;
  border-radius:11px;
  background:#fff;
  color:#18354f;
  font-size:12.5px;
  font-weight:800;
}

body[data-interface-phase="planning"] .v1055-range-shell{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) 42px;
  align-items:center;
  gap:9px;
}
body[data-interface-phase="planning"] .v1055-step-btn{
  display:grid;
  width:42px;height:42px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid #cbdde8;
  border-radius:11px;
  background:#f3f8fb;
  color:#0b5f96;
  font-size:22px;
  font-weight:900;
  line-height:1;
  box-shadow:0 2px 5px rgba(18,60,90,.04);
  transition:background .15s ease,border-color .15s ease,transform .08s ease;
}
body[data-interface-phase="planning"] .v1055-step-btn:hover{background:#e8f4fb;border-color:#9cc7e2}
body[data-interface-phase="planning"] .v1055-step-btn:active{transform:translateY(1px) scale(.98)}
body[data-interface-phase="planning"] .v1055-step-btn:focus-visible{outline:3px solid rgba(0,90,155,.2);outline-offset:2px}
body[data-interface-phase="planning"] .v1055-range-shell input[type="range"]{
  width:100%;
  min-width:0;
  height:42px;
  min-height:42px;
  margin:0;
}
body[data-interface-phase="planning"] .v1055-decisions-panel input[type="range"]::-webkit-slider-runnable-track,
body[data-interface-phase="planning"] .v1055-purchases-panel input[type="range"]::-webkit-slider-runnable-track{
  height:9px;
  border-radius:999px;
  background:linear-gradient(90deg,#0b6da9 0 var(--cr-range-fill,50%),#dce6ed var(--cr-range-fill,50%) 100%);
}
body[data-interface-phase="planning"] .v1055-decisions-panel input[type="range"]::-webkit-slider-thumb,
body[data-interface-phase="planning"] .v1055-purchases-panel input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:24px;height:24px;
  margin-top:-8px;
  border:4px solid #fff;
  border-radius:50%;
  background:#0b6da9;
  box-shadow:0 2px 8px rgba(13,74,115,.28);
}
body[data-interface-phase="planning"] .v1055-decisions-panel input[type="range"]::-moz-range-track,
body[data-interface-phase="planning"] .v1055-purchases-panel input[type="range"]::-moz-range-track{
  height:9px;border-radius:999px;background:#dce6ed;
}
body[data-interface-phase="planning"] .v1055-decisions-panel input[type="range"]::-moz-range-progress,
body[data-interface-phase="planning"] .v1055-purchases-panel input[type="range"]::-moz-range-progress{
  height:9px;border-radius:999px;background:#0b6da9;
}
body[data-interface-phase="planning"] .v1055-decisions-panel input[type="range"]::-moz-range-thumb,
body[data-interface-phase="planning"] .v1055-purchases-panel input[type="range"]::-moz-range-thumb{
  width:18px;height:18px;border:4px solid #fff;border-radius:50%;background:#0b6da9;box-shadow:0 2px 8px rgba(13,74,115,.28);
}
body[data-interface-phase="planning"] .v1055-decisions-panel .scale{
  display:flex;
  justify-content:space-between;
  margin-top:-5px;
  padding:0 52px;
  color:#74889a;
  font-size:9.5px;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-help{
  margin:0;
  color:#5f7386;
  font-size:10px;
  line-height:1.35;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-impact{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:0;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-impact span{
  padding:4px 7px;
  font-size:9px;
  line-height:1.2;
}
body[data-interface-phase="planning"] .v1055-control-tip{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
  padding:9px 11px;
  border:1px solid #d7e8f3;
  border-radius:12px;
  background:#f1f8fc;
  color:#315d7d;
  font-size:10px;
  line-height:1.35;
  font-weight:700;
}
body[data-interface-phase="planning"] .v1055-control-tip .ui-icon{width:18px;height:18px;flex:0 0 auto}

/* Plan: compacto, claro y con CTA inequívoca. */
body[data-interface-phase="planning"] .v1055-plan-summary{
  position:sticky;
  top:78px;
  padding:14px;
}
body[data-interface-phase="planning"] .v1055-plan-summary h2{font-size:18px}
body[data-interface-phase="planning"] .v1055-plan-summary>div:first-child p{margin-top:3px;color:#647b90;font-size:10.5px}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger{margin:11px 0}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger>div{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:7px 0;
}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger dt{font-size:10.5px}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger dd{font-size:12.5px;white-space:nowrap}
body[data-interface-phase="planning"] .v1055-plan-summary .ledger-emphasis{
  margin:3px -3px;
  padding:9px 8px!important;
  border-radius:10px;
}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-warning{
  margin:8px 0;
  padding:9px 10px;
  border-radius:10px;
  font-size:10px;
  line-height:1.35;
}
body[data-interface-phase="planning"] .v1055-plan-summary .open-btn{
  width:100%;
  min-height:52px;
  border-radius:12px;
  font-size:15px;
  font-weight:900;
}

/* Recursos a todo el ancho: comparar stock y compra resulta inmediato. */
body[data-interface-phase="planning"] .v1055-resources-panel .section-heading-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:10px;
}
body[data-interface-phase="planning"] .v1055-resources-panel h2{font-size:17px}
body[data-interface-phase="planning"] .v1055-resource-layout{
  display:grid;
  grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr);
  gap:14px;
  align-items:start;
}
body[data-interface-phase="planning"] .v1055-stock-zone,
body[data-interface-phase="planning"] .v1055-buy-zone{
  min-width:0;
  padding:10px;
  border:1px solid #e1eaf0;
  border-radius:14px;
  background:#f9fbfd;
}
body[data-interface-phase="planning"] .inventory-subheading,
body[data-interface-phase="planning"] .purchase-subheading{
  margin:0 0 8px;
  padding:0;
  border:0;
  font-size:9px;
}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card{
  min-height:100px;
  padding:9px;
  border:1px solid #dce7ee;
  border-radius:11px;
  background:#fff;
}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card .icon{margin-bottom:4px}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card .name{font-size:9.5px}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card .amount{font-size:15px}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card .note{font-size:9px;line-height:1.3}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:0;
}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row{
  display:grid;
  grid-template-columns:minmax(90px,.85fr) minmax(180px,1.7fr) auto;
  grid-template-rows:auto;
  align-items:center;
  gap:8px;
  min-height:74px;
  padding:8px 9px;
  border:1px solid #dce7ee;
  border-radius:11px;
  background:#fff;
  box-shadow:none;
}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row>span:first-child{
  grid-column:1;
  grid-row:1;
  min-width:0;
}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row>.v1055-range-shell{
  grid-column:2;
  grid-row:1;
}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row>strong{
  grid-column:3;
  grid-row:1;
  min-width:62px;
  text-align:right;
  white-space:nowrap;
  color:#153b58;
  font-size:10.5px;
}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row b{font-size:10px}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row small{font-size:8.5px}
body[data-interface-phase="planning"] .v1055-range-shell.compact{
  grid-template-columns:32px minmax(0,1fr) 32px;
  gap:6px;
}
body[data-interface-phase="planning"] .v1055-range-shell.compact .v1055-step-btn{
  width:32px;height:32px;border-radius:9px;font-size:18px;
}
body[data-interface-phase="planning"] .v1055-range-shell.compact input[type="range"]{
  min-height:32px;height:32px;
}

/* En planificación no se reserva ningún espacio para una ilustración. */
body[data-interface-phase="planning"] .v105-scene-panel{display:none!important}
body[data-interface-phase="planning"] .app-footer{display:none}

@media(max-width:1380px){
  body[data-interface-phase="planning"] .v1055-planning-grid{
    grid-template-columns:minmax(280px,.82fr) minmax(430px,1.25fr) minmax(300px,.88fr);
  }
  body[data-interface-phase="planning"] .v1055-stock-zone .inventory-grid{grid-template-columns:1fr 1fr}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row{
    grid-template-columns:minmax(82px,.8fr) minmax(145px,1.5fr) auto;
  }
}

@media(max-width:1160px){
  body[data-interface-phase="planning"] .v1055-planning-grid{
    grid-template-columns:minmax(290px,.82fr) minmax(460px,1.18fr);
    grid-template-areas:"context decisions" "plan plan";
  }
  body[data-interface-phase="planning"] .v1055-briefing{grid-area:context}
  body[data-interface-phase="planning"] .v1055-decisions-panel{grid-area:decisions}
  body[data-interface-phase="planning"] .v1055-plan-summary{
    grid-area:plan;
    position:static;
    display:grid;
    grid-template-columns:minmax(220px,.7fr) minmax(390px,1.3fr);
    column-gap:18px;
    align-items:start;
  }
  body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger{margin-top:0}
  body[data-interface-phase="planning"] .v1055-plan-summary .plan-warning,
  body[data-interface-phase="planning"] .v1055-plan-summary .open-btn,
  body[data-interface-phase="planning"] .v1055-plan-summary .v105-open-note{grid-column:1/-1}
  body[data-interface-phase="planning"] .v1055-resource-layout{grid-template-columns:1fr}
  body[data-interface-phase="planning"] .v1055-stock-zone .inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

@media(max-width:900px){
  body[data-interface-phase="planning"] .v1055-planning-grid{
    grid-template-columns:1fr;
    grid-template-areas:"context" "decisions" "plan";
  }
  body[data-interface-phase="planning"] .v1055-plan-summary{display:block}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-grid{grid-template-columns:1fr}
  body[data-interface-phase="planning"] .v1055-stock-zone .inventory-grid{grid-template-columns:1fr 1fr}
  body[data-interface-phase="planning"] .v1055-decision-legend{display:none}
}

@media(max-width:620px){
  body[data-interface-phase="planning"] .v1055-briefing .compact-scenario-grid{grid-template-columns:1fr}
  body[data-interface-phase="planning"] .v1055-reading-block .v105-market-strip{grid-template-columns:1fr}
  body[data-interface-phase="planning"] .v1055-resources-panel .section-heading-row{display:block}
  body[data-interface-phase="planning"] .v1055-resources-panel .section-heading-row>p{margin-top:5px}
  body[data-interface-phase="planning"] .v1055-stock-zone .inventory-grid{grid-template-columns:1fr}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row{
    grid-template-columns:minmax(80px,1fr) auto;
    grid-template-rows:auto auto;
  }
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row>.v1055-range-shell{grid-column:1/-1;grid-row:2}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row>strong{grid-column:2;grid-row:1}
}

@media(max-width:480px){
  body[data-interface-phase="planning"] .v1055-decisions-panel .v1055-decision-card{
    grid-template-columns:50px minmax(0,1fr);
    padding:9px;
  }
  body[data-interface-phase="planning"] .v1055-range-shell{grid-template-columns:38px minmax(0,1fr) 38px;gap:7px}
  body[data-interface-phase="planning"] .v1055-step-btn{width:38px;height:38px}
  body[data-interface-phase="planning"] .v1055-decisions-panel .scale{padding-inline:46px}
}
