/* Min/Max planning tier (spec/PLAN_min_max_tier.md v1b UX).
   SKU-page explainer panel + the _order_calculation :min_max band summary.
   Loaded globally by the layout's `stylesheet_link_tag :app` glob — NO
   per-view link tag. Design-system tokens only; no hard-coded palette beyond
   the M0 slate accent (which mirrors ForecastHelper::MODELS["min_max"]). */

:root {
  --mm-slate: #64748b;
  --mm-slate-tint: #f1f5f9;
  --mm-slate-fg: #475569;
}

/* ── M0 chip + slate accent (parity with the model chip color) ── */
.mm-chip {
  background: var(--mm-slate-tint);
  color: var(--mm-slate-fg);
  font-family: var(--font-mono, monospace);
  font-weight: 600;
}
.mm-c-slate { color: var(--mm-slate); }

/* ── Company Settings fieldset spacing ── */
.mm-fieldset-intro {
  display: block;
  margin-bottom: 1rem;
}
.mm-boundary-note {
  display: block;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

/* ── Explainer panel ── */
.mm-panel .mm-intro {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.mm-block {
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
}
.mm-block:first-of-type { border-top: none; padding-top: 0; }

.mm-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.mm-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Rate derivation ── */
.mm-derivation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.mm-derivation-term {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  min-width: 96px;
}
.mm-derivation-term--result {
  background: var(--mm-slate-tint);
  border-color: var(--mm-slate);
}
.mm-derivation-num {
  font-family: var(--font-mono, monospace);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.mm-derivation-term--result .mm-derivation-num { color: var(--mm-slate-fg); }
.mm-derivation-cap {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.mm-derivation-op {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Band grid (shared by panel + order-calc summary) ── */
.mm-band-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.mm-band-cell {
  flex: 1 1 120px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  text-align: center;
}
.mm-band-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.mm-band-value {
  font-family: var(--font-mono, monospace);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.mm-band-value--sub { font-size: 18px; color: var(--mm-slate-fg); }
.mm-band-unit {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Floor edit form ── */
.mm-floor-source { margin-bottom: 10px; }
.mm-floor-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mm-floor-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.mm-floor-hint {
  font-size: 11px;
  color: var(--muted);
  flex: 1 1 160px;
}

/* ── Graduation bars (INFO only) ── */
.mm-grad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.mm-grad-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mm-grad-label {
  flex: 0 0 84px;
  font-size: 12px;
  color: var(--muted);
}
.mm-grad-track {
  flex: 1 1 auto;
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.mm-grad-fill {
  display: block;
  height: 100%;
  background: var(--mm-slate);
  border-radius: var(--radius-pill);
}
.mm-grad-fill--w0   { width: 0; }
.mm-grad-fill--w10  { width: 10%; }
.mm-grad-fill--w20  { width: 20%; }
.mm-grad-fill--w30  { width: 30%; }
.mm-grad-fill--w40  { width: 40%; }
.mm-grad-fill--w50  { width: 50%; }
.mm-grad-fill--w60  { width: 60%; }
.mm-grad-fill--w70  { width: 70%; }
.mm-grad-fill--w80  { width: 80%; }
.mm-grad-fill--w90  { width: 90%; }
.mm-grad-fill--w100 { width: 100%; background: var(--green); }
.mm-grad-figure {
  flex: 0 0 auto;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--ink);
}

.mm-metadata {
  margin-top: 14px;
  font-size: 11px;
  color: var(--light, var(--muted));
}

/* ── Order Calculation :min_max band summary ── */
.mm-order-calc {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.mm-order-calc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.mm-order-calc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.mm-band-foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.mm-band-foot-floor {
  display: inline-block;
  margin-left: 4px;
  color: var(--mm-slate-fg);
}
