/* /merit-order page styles — tokens only; layout comes from the shared sheets.
   The ember token block (and the origin chrome) live in assets/energy.css. */
/* the ember token block lives once, in assets/energy.css (linked before this) */

/* chart card, then controls card — a single stacked column */
.board{display:flex;flex-direction:column;gap:24px;margin:28px auto 0}

.card{background:var(--card);border:1px solid var(--border);border-radius:0;
  box-shadow:var(--shadow);padding:22px}

/* the supply-stack SVG pans on narrow/coarse viewports rather than shrinking
   past legibility (fixed 1200-wide viewBox from render.js) */
#chartwrap{overflow-x:auto;position:relative}
/* the 1200-unit viewBox must render near 1:1 so in-chart text stays legible;
   on narrow screens the chart PANS (overflow-x above) rather than shrinking. */
#chartwrap svg{display:block;width:100%;height:auto;min-width:1160px}
/* narrow render (app toggles .mo-narrow): the SVG is already sized to the pane, so drop the
   pan floor and let it fit instead of stretching back to 1160px */
#chartwrap.mo-narrow svg{min-width:0}

/* demand-drag hit-rect (app.js): a plain HTML overlay, not part of the SVG,
   so its pointerdown listener survives the innerHTML swap every live render
   does — positioned/sized in real CSS px each render, always >=44px wide
   regardless of the chart's current scale. Screen-reader users get the
   fully-accessible #demand slider instead; this is a pointer/touch-only
   convenience, so it's hidden from the a11y tree. */
.demand-hit{position:absolute;cursor:ew-resize;background:transparent;touch-action:pan-y}

/* per-plant edit callout (tap a bar): fixed-position popover, same visual
   language as assets/workspace.css's .eip-pop but its own class — this tool
   has no text-buffer model for attachEditInPlace to rewrite, so the callout
   commits straight into the generator object instead. */
.mo-callout{position:fixed;z-index:20;background:var(--card);border:1px solid var(--border);
  border-radius:0;box-shadow:var(--shadow);padding:14px 16px;min-width:220px;max-width:280px;
  font-size:13.5px}
.mo-callout-name{font-weight:700;margin-bottom:6px}
.mo-callout-math{color:var(--muted);font-size:12.5px;line-height:1.45;margin-bottom:10px}
.mo-callout-note{color:var(--accent-ink);font-size:12.5px;line-height:1.4;margin-bottom:10px}
.mo-stepper{display:flex;align-items:center;gap:8px;margin:10px 0}
.mo-stepper-label{flex:1;font-size:12px;color:var(--muted)}
.mo-stepper-out{font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-variant-numeric:tabular-nums;min-width:70px;text-align:center;font-size:13px}
.mo-step-btn{width:28px;height:28px;flex:none;border-radius:0;border:1px solid var(--border);
  background:none;color:var(--ink);cursor:pointer;font-size:16px;line-height:1;font-family:inherit}
.mo-step-btn:hover{border-color:var(--accent);color:var(--accent-ink)}
.mo-callout .btn{margin-top:4px}
@media (pointer: coarse){
  .mo-step-btn{width:44px;height:44px}
}

.chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:16px}
.chip.on{border-color:var(--accent);color:var(--accent-ink)}

.controls{display:flex;flex-direction:column;gap:18px}
.ctl label{display:flex;justify-content:space-between;align-items:baseline;
  font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:8px}
.ctl output{font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-variant-numeric:tabular-nums;font-size:14px;font-weight:600;color:var(--ink);
  text-transform:none;letter-spacing:0}
input[type=range]{width:100%;accent-color:var(--accent);
  -webkit-appearance:none;appearance:none;height:6px;border-radius:0;background:var(--track)}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;
  width:22px;height:22px;border-radius:50%;background:var(--accent);
  border:2px solid var(--card);box-shadow:var(--shadow)}
input[type=range]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;
  background:var(--accent);border:2px solid var(--card)}
input[type=range]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}


/* Task 5 drives these on preset/dial changes: plant bars re-flow (transform),
   a value can flash to draw the eye. Both reduced-motion-guarded. */
[data-plant]{cursor:pointer}   /* FLIP glide now via .mo-flip (assets/motion.css) */
.flash{animation:merit-flash 480ms ease-out}
@keyframes merit-flash{from{opacity:.35}to{opacity:1}}
@media (prefers-reduced-motion: reduce){
  [data-plant],.flash{transition:none!important;animation:none!important}
}

/* Phone edge system — "16px prose / 10px surface": the 16px prose gutter comes
   from workspace.css's Camp A block (--page-gutter, this page links it); the
   cards full-bleed back to the viewport edge as native sheets (side borders +
   radius dropped, top/bottom hairlines kept). */
@media (max-width:640px){
  .card{margin-inline:-16px;border-inline:none;border-radius:0;padding-inline:12px}
}
