/* Production & Procurement page — on top of scm-page.css (stage, cockpit shell,
   journey, chips, secs, conns) + frame.css + light.css. */

/* ---- Hero site plan */
.pp-scene { position: relative; margin: 0; justify-self: center; width: min(560px, 100%); padding: 18px 0 34px; }
.pp-scene__frame {
  border: 1px solid rgba(122, 233, 255, 0.25);
  background: #0b8fa8;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.7), 0 0 80px -30px rgba(9, 187, 223, 0.45);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}
.pp-scene__bar { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid rgba(122, 233, 255, 0.15); font: 600 10.5px/1 "IBM Plex Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.pp-scene__bar span { padding: 7px 10px; color: rgba(224, 245, 250, 0.5); }
.pp-scene__bar span:first-child { display: inline-flex; align-items: center; gap: 7px; background: rgba(9, 187, 223, 0.15); color: #fff; }
.pp-scene__bar i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; animation: x-ping 2s infinite; }
.pp-site { display: block; width: 100%; height: auto; font-family: "Source Sans 3", sans-serif; }
.pp-site text { fill: rgba(224, 245, 250, 0.7); font-size: 10px; text-anchor: middle; }
.pp-site .pp-t { fill: #fff; font-size: 11px; font-weight: 600; }
.pp-site .pp-s { fill: rgba(224, 245, 250, 0.55); font-size: 9.5px; }
.pp-bld { fill: rgba(11, 143, 168, 0.85); stroke: rgba(122, 233, 255, 0.35); }
.pp-bld--main { fill: rgba(11, 143, 168, 0.7); }
.pp-lvl { fill: url(#pp-fill); opacity: 0.85; }
.pp-lvl--b { fill: #31ddff; }
.pp-lvl--warn { fill: #fb7185; }
.pp-units rect { fill: rgba(9, 187, 223, 0.18); stroke: rgba(9, 187, 223, 0.6); }
.pp-belt { fill: rgba(122, 233, 255, 0.15); stroke: rgba(122, 233, 255, 0.4); }
.pp-pack { fill: #fbbf24; animation: pp-belt 2.4s linear infinite; }
@keyframes pp-belt { to { transform: translateX(84px); } }
.pp-stack rect { fill: rgba(49, 221, 255, 0.55); stroke: rgba(122, 233, 255, 0.6); }
.pp-stack .pp-stack--low { fill: rgba(251, 113, 133, 0.6); }
.pp-road { fill: none; stroke: rgba(122, 233, 255, 0.18); stroke-width: 12; }
.pp-flow { fill: none; stroke: rgba(9, 187, 223, 0.5); stroke-width: 2; stroke-dasharray: 4 4; }
.pp-dot { fill: #e0faff; }
.pp-dot--out { fill: #34d399; }
.pp-gate { fill: rgba(251, 191, 36, 0.25); stroke: #fbbf24; }
.pp-truck rect { fill: #cceff6; }
.pp-truck--wait rect { fill: #fbbf24; }
.pp-pin { stroke: #0b8fa8; stroke-width: 2; }
.pp-pin--red { fill: #fb7185; }
.pp-pin--amber { fill: #fbbf24; }
.pp-pin-t { fill: #0b8fa8 !important; font-weight: 800; font-size: 11px !important; }
.pp-scene .float--a { top: 70px; left: -24px; }
.pp-scene .float--b { top: auto; bottom: 90px; right: -22px; }
.pp-scene .float--c { bottom: auto; top: 30px; left: auto; right: -14px; }
.pp-scene figcaption { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 11.5px; color: rgba(224, 245, 250, 0.46); }
@media (max-width: 560px) { .pp-scene .float { display: none; } }

/* ---- Planner controls */
.pp-plan-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 0 0 12px; }
.pp-btn { padding: 10px 14px; border: 1px dashed #048eaa; background: #fff; color: #048eaa; font: 700 12.5px/1 "Source Sans 3", sans-serif; letter-spacing: 0.02em; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.pp-btn:hover { background: #e8f8fb; }
.pp-btn.is-on { border-style: solid; background: #048eaa; color: #fff; }
.pp-legend { display: inline-flex; align-items: center; gap: 6px 10px; font-size: 12px; color: #79a2a8; }
.pp-legend i { display: inline-block; width: 12px; height: 8px; margin-left: 6px; }
.u1 { background: #10b981; } .u2 { background: #f59e0b; } .u3 { background: #f43f5e; }
.pp-range { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: #43757c; }
.pp-range input { width: 160px; accent-color: #048eaa; }
.pp-range output { font: 700 13px "IBM Plex Mono", monospace; color: #048eaa; min-width: 48px; }
.pp-range--col { display: grid; grid-template-columns: 1fr auto; gap: 6px; width: 100%; }
.pp-range--col input { grid-column: 1 / -1; width: 100%; }
.pp-seg { display: inline-flex; border: 1px solid #cadfe3; }
.pp-seg button { padding: 8px 12px; border: 0; background: #fff; font: 600 12.5px/1 "Source Sans 3", sans-serif; color: #43757c; cursor: pointer; }
.pp-seg button + button { border-left: 1px solid #cadfe3; }
.pp-seg button.is-on { background: #0b8fa8; color: #fff; }

/* ---- Plan grid */
.pp-grid { min-width: 720px; }
.pp-grid th, .pp-grid td { text-align: center; }
.pp-grid tbody th { text-align: left; }
.pp-grid .off { color: #b5d0d4; background: #f7fcfe; }
.pp-grid .pp-line { background: #f1fbfd; }
.pp-grid .pp-line th { font-weight: 700; }
.pp-pri { display: inline-block; margin-right: 8px; padding: 2px 5px; font: 600 10px/1.2 "IBM Plex Mono", monospace; color: #048eaa; border: 1px solid rgba(4, 142, 170, 0.35); }
.pp-load { position: relative; display: block; height: 18px; background: #eef4f5; }
.pp-load::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--r) * 100%); background: currentColor; opacity: 0.85; }
.pp-load.u1 { color: #10b981; background: #eef4f5; } .pp-load.u2 { color: #f59e0b; background: #eef4f5; } .pp-load.u3 { color: #f43f5e; background: #eef4f5; }
.pp-load b { position: relative; z-index: 1; font-size: 11px; line-height: 18px; color: #2f3a3d; }
.pp-rush { background: #fff8e6 !important; box-shadow: inset 3px 0 0 #f59e0b; }

/* ---- Procurement status */
.pp-st { display: inline-block; padding: 4px 8px; font: 600 11px/1 "IBM Plex Mono", monospace; letter-spacing: 0.02em; }
.pp-st--ok { background: #e7f8f1; color: #047857; }
.pp-st--now { background: #fde8ec; color: #be123c; }
.pp-st--week { background: #fff4dc; color: #b45309; }
.pp-st--later { background: #eef4f5; color: #43757c; }

/* ---- Twin view */
.pp-twin-view { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1150px) { .pp-twin-view { grid-template-columns: 1fr 280px; } }
.pp-twin-stage { border: 1px solid #ddebed; background: #0b8fa8; }
.pp-twin-site svg { display: block; width: 100%; height: auto; font-family: "Source Sans 3", sans-serif; }
.pp-twin-site text { fill: rgba(224, 245, 250, 0.7); font-size: 11px; text-anchor: middle; }
.pp-twin-site .tw-h { fill: #fff; font-weight: 600; font-size: 12px; }
.pp-twin-site .tw-v { fill: #fff; font-weight: 700; font-size: 11.5px; }
.pp-twin-site .tw-s { fill: rgba(224, 245, 250, 0.55); font-size: 10.5px; }
.tw-b { fill: rgba(11, 143, 168, 0.85); stroke: rgba(122, 233, 255, 0.35); }
.tw-main { fill: rgba(11, 143, 168, 0.7); }
.tw-l { fill: #09bbdf; opacity: 0.85; transition: y 0.4s ease, height 0.4s ease; }
.tw-low { fill: #fb7185; transition: y 0.4s ease, height 0.4s ease; }
.tw-warn { fill: #fbbf24; }
.tw-u { fill: rgba(9, 187, 223, 0.18); stroke: rgba(9, 187, 223, 0.6); }
.tw-hot { fill: rgba(251, 191, 36, 0.3); stroke: #fbbf24; }
.tw-gate { fill: rgba(251, 191, 36, 0.25); stroke: #fbbf24; }
.tw-truck { fill: #fbbf24; }
.tw-pin { fill: #fb7185; stroke: #0b8fa8; stroke-width: 2; }
.pp-twin-site .tw-pin-t { fill: #0b8fa8; font-weight: 800; }
.pp-scrub { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 12px 14px; background: #0b8fa8; border-top: 1px solid rgba(122, 233, 255, 0.15); }
.pp-scrub > span:first-child { font: 600 11px/1 "IBM Plex Mono", monospace; letter-spacing: 0.06em; text-transform: uppercase; color: #09bbdf; min-width: 130px; }
.pp-scrub input { width: 100%; accent-color: #09bbdf; }
.pp-scrub__ticks { grid-column: 2; display: flex; justify-content: space-between; font: 500 10px/1 "IBM Plex Mono", monospace; color: rgba(224, 245, 250, 0.45); }
.pp-scrub__ticks i { font-style: normal; }
.pp-alert-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pp-al { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 10px; border-left: 3px solid #9dbfc4; background: #f6fcfd; font-size: 12.5px; }
.pp-al b { color: #2f3a3d; }
.pp-al span { grid-column: 1; color: #43757c; }
.pp-al em { grid-row: 1; grid-column: 2; font: 600 9.5px/1.6 "IBM Plex Mono", monospace; font-style: normal; text-transform: uppercase; color: #79a2a8; }
.pp-al--now { border-left-color: #f43f5e; }
.pp-al--next7 { border-left-color: #f59e0b; }
.pp-al--data { border-left-color: #9dbfc4; }

/* ---- Forecast capacity */
.pp-cap { display: grid; gap: 4px; margin-top: 12px; }
.pp-cap b { font-size: 13.5px; color: #2f3a3d; }
.pp-cap span { display: grid; grid-template-columns: 1fr 72px; gap: 8px; align-items: center; }
.pp-cap i { display: block; height: 8px; width: calc(var(--r) * 100%); }
.pp-cap em { font-style: normal; font: 600 11px "IBM Plex Mono", monospace; color: #43757c; text-align: right; }

/* ---- Ask the data */
.pp-ask { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .pp-ask { grid-template-columns: 300px 1fr; } }
.pp-ask__chips { display: grid; gap: 8px; align-content: start; }
.pp-ask__chips button { padding: 12px 14px; border: 1px solid #ddebed; background: #fff; text-align: left; font: 500 14px/1.35 "Source Sans 3", sans-serif; color: #2f3a3d; cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease; }
.pp-ask__chips button:hover { border-color: #048eaa; background: #effafc; }
.pp-ask__log { list-style: none; margin: 0; padding: 16px; min-height: 340px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid #ddebed; }
.pp-ask__hint { color: #79a2a8; font-size: 13.5px; }
.pp-ask__q { align-self: flex-end; max-width: 80%; padding: 10px 12px; background: #0b8fa8; color: #fff; font-size: 14px; }
.pp-ask__a { align-self: flex-start; max-width: 88%; padding: 12px 14px; background: #effafc; border-left: 3px solid #09bbdf; font-size: 14.5px; color: #2f3a3d; animation: ck-in 0.4s ease both; }
.pp-ask__a p { margin: 0 0 6px; }
.pp-ask__a small { font-size: 11.5px; color: #79a2a8; }
.pp-ask__a small b { color: #048eaa; font-weight: 600; }
.pp-dots { display: inline-flex; gap: 4px; }
.pp-dots i { width: 6px; height: 6px; border-radius: 50%; background: #048eaa; animation: pp-dot 1s infinite; }
.pp-dots i:nth-child(2) { animation-delay: 0.15s; }
.pp-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pp-dot { 50% { opacity: 0.25; } }

/* ---- Twin section */
.pp-modes { display: grid; gap: 1px; grid-template-columns: 1fr; background: rgba(11, 143, 168, 0.1); border: 1px solid rgba(11, 143, 168, 0.1); }
@media (min-width: 640px) { .pp-modes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .pp-modes { grid-template-columns: repeat(3, 1fr); } }
.pp-mode { padding: 20px 22px; background: #fff; }
.pp-mode b { display: block; margin-bottom: 6px; font: 500 21px/1.2 "Newsreader", Georgia, serif; color: #2f3a3d; }
.pp-mode p { margin: 0; font-size: 14.5px; line-height: 1.5; color: #43757c; }
.pp-alerts { margin-top: 28px; }
.pp-alerts__lead { margin: 0 0 12px; font-size: 15px; color: #43757c; }
.pp-alerts__lead b { font: 500 26px/1 "Newsreader", Georgia, serif; color: #048eaa; margin-right: 6px; }

/* ---- Screen map */
.pp-map { display: grid; gap: 1px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); background: rgba(11, 143, 168, 0.1); border: 1px solid rgba(11, 143, 168, 0.1); }
.pp-map__col { padding: 16px 18px; background: #fff; }
.pp-map__col h3 { margin: 0 0 10px; font: 600 10.5px/1 "IBM Plex Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #048eaa; }
.pp-map__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: #2f3a3d; }
.pp-ai { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .pp-pack, .pp-scene__bar i, .pp-dots i { animation: none; }
}
