/* Coffee Rush STA v10.5.6 · auditoría de interfaz y accesibilidad
   Capa de presentación: no modifica economía, simulación ni persistencia. */

:root{
  --v1056-text:#153653;
  --v1056-muted:#526b82;
  --v1056-border:#c7d8e4;
  --v1056-soft:#f4f8fb;
  --v1056-blue:#005a9b;
  --v1056-good:#17603a;
  --v1056-good-bg:#eefaf3;
  --v1056-warn:#6f4e00;
  --v1056-warn-bg:#fff7d6;
  --v1056-bad:#8f241d;
  --v1056-bad-bg:#fff1ef;
}

.skip-link{
  position:fixed;
  left:16px;
  top:12px;
  z-index:1000;
  transform:translateY(-160%);
  padding:11px 15px;
  border-radius:9px;
  background:#fff;
  color:var(--v1056-blue);
  font-weight:900;
  box-shadow:0 8px 24px rgba(15,42,66,.24);
}
.skip-link:focus{transform:none}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible{
  outline:3px solid var(--v1056-blue)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 5px #fff!important;
}

body[data-interface-phase="planning"]{color:var(--v1056-text)}
body[data-interface-phase="planning"] .appbar{z-index:100;background:#fff}
body[data-interface-phase="planning"] .brand-block>div strong{font-size:23px}
body[data-interface-phase="planning"] .brand-block>div>span{font-size:13px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .app-status span{font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .app-status strong{font-size:16px}
body[data-interface-phase="planning"] .platform-session-chip strong{font-size:14px}
body[data-interface-phase="planning"] .platform-session-chip span{font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .platform-logout,
body[data-interface-phase="planning"] .tool-menu>summary{min-height:44px;font-size:14px}
body[data-interface-phase="planning"] .primary-nav{
  position:sticky;
  top:73px;
  z-index:90;
  margin:0 auto;
  border-radius:0 0 13px 13px;
  background:#fff;
}
body[data-interface-phase="planning"] .workspace{
  width:min(100%,1800px);
  max-width:1800px;
  padding:16px clamp(14px,1.5vw,26px) 48px;
}
body[data-interface-phase="planning"] #mainContent{scroll-margin-top:132px}

/* Cabecera y flujo: una sola secuencia didáctica. */
body[data-interface-phase="planning"] .v105-heading{margin:8px 0 12px}
body[data-interface-phase="planning"] .v105-heading h1{font-size:clamp(28px,2.1vw,36px);line-height:1.12}
body[data-interface-phase="planning"] .v105-heading p{
  max-width:980px;
  color:var(--v1056-muted);
  font-size:15px;
  line-height:1.5;
}
body[data-interface-phase="planning"] .section-kicker{font-size:12px;line-height:1.3}
body[data-interface-phase="planning"] .v105-heading .team-pill span,
body[data-interface-phase="planning"] .v105-heading .team-pill strong{font-size:13px}
body[data-interface-phase="planning"] .v105-learning-flow{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  height:auto;
  min-height:48px;
  margin:0 0 14px;
  padding:4px;
  list-style:none;
}
body[data-interface-phase="planning"] .v105-learning-flow li{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  padding:10px 12px;
  border-radius:9px;
  color:#526b82;
  background:#fff;
  font-size:14px;
  font-weight:850;
  text-align:center;
}
body[data-interface-phase="planning"] .v105-learning-flow li.active{
  background:var(--v1056-blue);
  color:#fff;
}

/* Orden real y visual: contexto → decisiones → recursos → resumen. */
body[data-interface-phase="planning"] .v1055-planning-grid{
  display:grid;
  grid-template-columns:minmax(330px,.78fr) minmax(570px,1.25fr) minmax(440px,1fr);
  grid-template-areas:
    "context decisions resources"
    "summary summary summary";
  gap:16px;
  align-items:start;
}
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-resources-panel{grid-area:resources}
body[data-interface-phase="planning"] .v1055-plan-summary{grid-area:summary}
body[data-interface-phase="planning"] .v1055-briefing,
body[data-interface-phase="planning"] .v1055-decisions-panel,
body[data-interface-phase="planning"] .v1055-resources-panel,
body[data-interface-phase="planning"] .v1055-plan-summary{
  margin:0;
  padding:18px;
  border-color:var(--v1056-border);
  border-radius:18px;
}

/* Texto de contexto legible en portátiles. */
body[data-interface-phase="planning"] .v1055-section-intro{
  margin-top:5px;
  color:var(--v1056-muted);
  font-size:14px;
  line-height:1.48;
}
body[data-interface-phase="planning"] .v1055-briefing .briefing-title h2,
body[data-interface-phase="planning"] .v1055-decisions-panel h2,
body[data-interface-phase="planning"] .v1055-resources-panel h2,
body[data-interface-phase="planning"] .v1055-plan-summary h2{font-size:21px;line-height:1.25}
body[data-interface-phase="planning"] .v1055-briefing .compact-scenario-grid{gap:10px}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box{
  min-height:142px;
  padding:12px;
  grid-template-columns:40px minmax(0,1fr);
  gap:10px;
  border-color:#cddce7;
}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box .brief-icon{width:40px;height:40px}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box small{font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box strong{font-size:15px;line-height:1.3}
body[data-interface-phase="planning"] .v1055-briefing .scenario-box p{
  margin-top:6px;
  color:var(--v1056-muted);
  font-size:13px;
  line-height:1.45;
}
body[data-interface-phase="planning"] .v1055-reading-title>span{font-size:12px}
body[data-interface-phase="planning"] .v1055-reading-title small{color:var(--v1056-muted);font-size:12px;line-height:1.4}
body[data-interface-phase="planning"] .v1055-reading-block .market-pill{
  min-height:76px;
  padding:10px 11px;
  border-color:#ccdce7!important;
}
body[data-interface-phase="planning"] .v1055-reading-block .market-pill>span{font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-reading-block .market-pill strong{font-size:14px;line-height:1.35}

/* Decisiones: nombres, valores y objetivos de control claros. */
body[data-interface-phase="planning"] .v1055-decisions-panel .section-heading-row{margin-bottom:13px}
body[data-interface-phase="planning"] .v1055-decision-legend span{font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-grid{gap:11px}
body[data-interface-phase="planning"] .v1055-decisions-panel .v1055-decision-card{
  grid-template-columns:68px minmax(0,1fr);
  column-gap:14px;
  row-gap:8px;
  padding:14px;
  border-color:#cbdce7;
}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-title .decision-icon-badge{width:48px;height:48px}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-title>span:not(.decision-icon-badge){font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-title strong{font-size:16px;line-height:1.25}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-number{width:28px;height:28px;font-size:12px}
body[data-interface-phase="planning"] .v1055-decisions-panel .compact-field>span{font-size:13px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-decisions-panel .compact-field select{
  min-height:48px;
  border-color:#9eb8ca;
  font-size:16px;
}
body[data-interface-phase="planning"] .v1055-range-shell{
  grid-template-columns:46px minmax(0,1fr) 46px;
  gap:10px;
}
body[data-interface-phase="planning"] .v1055-step-btn{
  width:46px;
  height:46px;
  border-color:#94b4ca;
  font-size:24px;
}
body[data-interface-phase="planning"] .v1055-range-shell input[type="range"]{min-height:46px;height:46px}
body[data-interface-phase="planning"] .v1055-decisions-panel .scale{padding:0 57px;color:var(--v1056-muted);font-size:12px}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-help{color:var(--v1056-muted);font-size:14px;line-height:1.45}
body[data-interface-phase="planning"] .v1055-decisions-panel .decision-impact span{padding:5px 8px;font-size:12px;line-height:1.35}
body[data-interface-phase="planning"] .v1055-control-tip{font-size:14px;line-height:1.45}

/* Recursos: lectura suficiente y controles con objetivo de 44 px. */
body[data-interface-phase="planning"] .v1055-resources-panel .section-heading-row{display:block;margin-bottom:12px}
body[data-interface-phase="planning"] .v1055-resources-panel .section-heading-row>p{
  margin:7px 0 0;
  color:var(--v1056-muted);
  font-size:13px;
  line-height:1.45;
}
body[data-interface-phase="planning"] .v1055-resource-layout{grid-template-columns:1fr;gap:12px}
body[data-interface-phase="planning"] .v1055-stock-zone,
body[data-interface-phase="planning"] .v1055-buy-zone{padding:12px;border-color:#cddce7}
body[data-interface-phase="planning"] .inventory-subheading,
body[data-interface-phase="planning"] .purchase-subheading{font-size:12px;color:#315d7d}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-grid{grid-template-columns:1fr 1fr;gap:9px}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card{
  min-height:118px;
  padding:11px;
  border-color:#cddce7;
}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card .name{font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card .amount{font-size:18px}
body[data-interface-phase="planning"] .v1055-stock-zone .inventory-card .note{font-size:12px;line-height:1.42;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-grid{grid-template-columns:1fr;gap:9px}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row{
  grid-template-columns:minmax(105px,.9fr) minmax(190px,1.7fr) auto;
  min-height:84px;
  padding:10px;
  border-color:#cddce7;
}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row b{font-size:14px}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row small{font-size:12px;color:var(--v1056-muted)}
body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row>strong{font-size:14px}
body[data-interface-phase="planning"] .v1055-range-shell.compact{grid-template-columns:44px minmax(0,1fr) 44px;gap:8px}
body[data-interface-phase="planning"] .v1055-range-shell.compact .v1055-step-btn{width:44px;height:44px;font-size:22px}
body[data-interface-phase="planning"] .v1055-range-shell.compact input[type="range"]{min-height:44px;height:44px}

/* Resumen final: costes visibles, viabilidad y CTA en último lugar. */
body[data-interface-phase="planning"] .v1055-plan-summary{
  position:static;
  display:grid;
  grid-template-columns:minmax(240px,.65fr) minmax(620px,1.7fr) minmax(300px,.75fr);
  grid-template-areas:
    "heading ledger feasibility"
    "heading ledger warning"
    "heading ledger actions";
  gap:12px 22px;
  align-items:start;
}
body[data-interface-phase="planning"] .plan-summary-heading{grid-area:heading}
body[data-interface-phase="planning"] .plan-summary-heading p{margin-top:6px;color:var(--v1056-muted);font-size:14px;line-height:1.48}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger{
  grid-area:ledger;
  display:grid;
  grid-template-columns:repeat(3,minmax(180px,1fr));
  gap:0 16px;
  margin:0;
}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger>div{
  min-width:0;
  padding:9px 0;
  border-bottom:1px solid #dce7ee;
}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger dt{font-size:13px;color:var(--v1056-muted);line-height:1.35}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger dd{font-size:15px;line-height:1.35}
body[data-interface-phase="planning"] .v1055-plan-summary .ledger-emphasis{margin:0;padding:9px 8px!important}
body[data-interface-phase="planning"] .ledger-balance.is-negative dd{color:var(--v1056-bad)}
body[data-interface-phase="planning"] .ledger-balance.is-positive dd{color:var(--v1056-good)}
body[data-interface-phase="planning"] .plan-feasibility{
  grid-area:feasibility;
  display:grid;
  gap:3px;
  padding:11px 12px;
  border:1px solid #b9dec7;
  border-radius:11px;
  background:var(--v1056-good-bg);
  color:var(--v1056-good);
  font-size:13px;
  line-height:1.4;
}
body[data-interface-phase="planning"] .plan-feasibility.warn{border-color:#e5cf8c;background:var(--v1056-warn-bg);color:var(--v1056-warn)}
body[data-interface-phase="planning"] .plan-feasibility.bad{border-color:#e3b7b2;background:var(--v1056-bad-bg);color:var(--v1056-bad)}
body[data-interface-phase="planning"] .plan-feasibility strong{font-size:14px}
body[data-interface-phase="planning"] .v1055-plan-summary .plan-warning{
  grid-area:warning;
  margin:0;
  padding:11px 12px;
  border:1px solid #e5cf8c;
  background:var(--v1056-warn-bg);
  color:var(--v1056-warn);
  font-size:13px;
  line-height:1.45;
}
body[data-interface-phase="planning"] .plan-warning ul{margin:0;padding-left:18px}
body[data-interface-phase="planning"] .plan-warning li+li{margin-top:5px}
body[data-interface-phase="planning"] .plan-open-actions{grid-area:actions;display:grid;gap:7px}
body[data-interface-phase="planning"] .v1055-plan-summary .open-btn{
  position:static;
  inset:auto;
  width:100%;
  min-height:54px;
  font-size:17px;
  box-shadow:none;
}
body[data-interface-phase="planning"] .v1055-plan-summary .open-btn.plan-risk{
  background:#754900;
  border-color:#754900;
  color:#fff;
}
body[data-interface-phase="planning"] .v1055-plan-summary .open-btn.plan-risk:hover{background:#603c00}
body[data-interface-phase="planning"] .v105-open-note{color:var(--v1056-muted);font-size:12px;line-height:1.4;text-align:left}

/* Colores y límites de controles con contraste suficiente. */
body[data-interface-phase="planning"] .app-status span,
body[data-interface-phase="planning"] .platform-session-chip span,
body[data-interface-phase="planning"] .scale{color:var(--v1056-muted)}
body[data-interface-phase="planning"] button,
body[data-interface-phase="planning"] summary,
body[data-interface-phase="planning"] select{border-color:#7892a6}
body[data-interface-phase="planning"] input[type="range"]{
  --cr-range-track:#c6d6e1;
  accent-color:var(--v1056-blue);
}
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{
  background:linear-gradient(90deg,#0b6da9 0 var(--cr-range-fill,50%),#7892a6 var(--cr-range-fill,50%) 100%);
}
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{background:#7892a6}

@media(max-width:1500px){
  body[data-interface-phase="planning"] .appbar{position:static}
  body[data-interface-phase="planning"] .primary-nav{top:0}
  body[data-interface-phase="planning"] .v1055-planning-grid{
    grid-template-columns:minmax(310px,.8fr) minmax(520px,1.2fr);
    grid-template-areas:
      "context decisions"
      "resources resources"
      "summary summary";
  }
  body[data-interface-phase="planning"] .v1055-resource-layout{grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr)}
  body[data-interface-phase="planning"] .v1055-stock-zone .inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-grid{grid-template-columns:1fr 1fr}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row{
    grid-template-columns:minmax(95px,.85fr) minmax(150px,1.45fr) auto;
  }
  body[data-interface-phase="planning"] .v1055-plan-summary{
    grid-template-columns:minmax(220px,.55fr) minmax(540px,1.45fr);
    grid-template-areas:
      "heading ledger"
      "feasibility ledger"
      "warning ledger"
      "actions ledger";
  }
}

@media(max-width:1050px){
  body[data-interface-phase="planning"] .v1055-planning-grid{
    grid-template-columns:1fr;
    grid-template-areas:"context" "decisions" "resources" "summary";
  }
  body[data-interface-phase="planning"] .v1055-resource-layout{grid-template-columns:1fr}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-grid{grid-template-columns:1fr 1fr}
  body[data-interface-phase="planning"] .v1055-plan-summary{
    grid-template-columns:1fr;
    grid-template-areas:"heading" "ledger" "feasibility" "warning" "actions";
  }
  body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:760px){
  body[data-interface-phase="planning"] .v105-learning-flow{display:grid;grid-template-columns:1fr 1fr;overflow:visible}
  body[data-interface-phase="planning"] .v105-learning-flow li{font-size:13px}
  body[data-interface-phase="planning"] .v1055-briefing .compact-scenario-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-buy-zone .purchase-grid{grid-template-columns:1fr}
  body[data-interface-phase="planning"] .v1055-buy-zone .purchase-row{
    grid-template-columns:minmax(100px,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}
  body[data-interface-phase="planning"] .v1055-plan-summary .plan-ledger{grid-template-columns:1fr}
}

@media(max-width:480px){
  body[data-interface-phase="planning"] .v105-heading p,
  body[data-interface-phase="planning"] .v1055-section-intro{font-size:14px}
  body[data-interface-phase="planning"] .v1055-decisions-panel .v1055-decision-card{grid-template-columns:58px minmax(0,1fr)}
  body[data-interface-phase="planning"] .v1055-range-shell{grid-template-columns:44px minmax(0,1fr) 44px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

@media(forced-colors:active){
  .plan-feasibility,.plan-warning,.decision-card,.scenario-box{border:1px solid CanvasText}
  input[type="range"]{forced-color-adjust:auto}
}
