/* Power Plant Chain: the work order and controls beside the plant scene / test rig, inside the practice shell's stage. */
.pp { position: absolute; inset: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; padding: 8px 12px; color: var(--tlg-text, #172c38); }
.pp-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }

/* the work order */
.pp-ticket { padding: 8px 12px 10px; border-radius: var(--tlg-radius-lg, 14px); border: 2px solid #9fb8c2; border-left-width: 8px; border-left-color: #2f5d6a; background: #f2f7f8; color: #10262c; }
.pp-ticket-k { margin: 0 0 6px; font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tlg-tracking-caps, .08em); color: #2f5d6a; }
.pp-row { margin: 4px 0 0; font-size: 16px; line-height: 1.35; }
.pp-row-k { display: block; font-weight: 800; font-size: 16px; color: #36535c; }
.pp-row-k2 { margin: 8px 0 0; }
.pp-row-v { display: block; font-weight: 600; }
.pp-stages { margin: 4px 0 0; padding-left: 24px; font-size: 16px; line-height: 1.35; font-weight: 600; }
.pp-stages li { margin: 2px 0; }
html[data-theme="dark"] .pp-ticket { background: #16262b; color: #e6f2f4; border-color: #3d5e68; border-left-color: #7fc4d4; }
html[data-theme="dark"] .pp-ticket-k { color: #9bd5df; }
html[data-theme="dark"] .pp-row-k { color: #b6d6dd; }

/* choices (chain task) */
.pp-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.pp-field legend { padding: 0; margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.pp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-choices.is-one { grid-template-columns: 1fr; }
.pp-choice { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 24px 5px 8px; min-height: 48px;
  font: inherit; text-align: left; cursor: pointer; color: var(--tlg-text, #172c38); background: var(--tlg-surface, #fff); border: 2px solid var(--tlg-border, #a5b6c1);
  border-radius: 12px; box-shadow: 0 2px 0 rgba(0, 0, 0, .1); touch-action: manipulation; }
.pp-choice-i { display: block; width: 38px; height: 38px; border-radius: 10px; background: #eef4f6; }
.pp-choice-i svg { width: 38px; height: 38px; display: block; }
.pp-choice-l { font-size: 17px; font-weight: 700; line-height: 1.2; }
.pp-choice:hover:not(:disabled) { border-color: #2f5d6a; }
.pp-choice[aria-pressed="true"] { border-color: #2f5d6a; border-width: 3px; background: #e3f1f4; box-shadow: 0 0 0 3px rgba(47, 93, 106, .25); }
.pp-choice[aria-pressed="true"] .pp-choice-l::before { content: '● '; color: #2f5d6a; }
html[data-theme="dark"] .pp-choice-i { background: #24363c; }
html[data-theme="dark"] .pp-choice[aria-pressed="true"] { background: #1d3a42; border-color: #9bd5df; }
html[data-theme="dark"] .pp-choice[aria-pressed="true"] .pp-choice-l::before { color: #9bd5df; }
.pp-choice:disabled { cursor: default; opacity: 1; }
.pp-choice.is-ok { border-color: #2e8b57; border-width: 3px; }
.pp-choice.is-bad { border-color: #b42318; border-style: dashed; border-width: 3px; }
.pp-mark { position: absolute; top: 2px; right: 6px; font-size: 18px; font-weight: 900; }
.pp-choice.is-ok .pp-mark { color: #1d6b40; }
.pp-choice.is-bad .pp-mark { color: #b42318; }
html[data-theme="dark"] .pp-choice.is-ok .pp-mark { color: #8fe0ad; }
html[data-theme="dark"] .pp-choice.is-bad .pp-mark { color: #ffb4a8; }

/* typed numbers */
.pp-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-num { width: 150px; min-height: 48px; padding: 6px 10px; font: inherit; font-size: 22px; font-weight: 800; color: var(--tlg-text, #172c38); background: var(--tlg-surface, #fff);
  border: 2px solid var(--tlg-border-strong, #6b7f8a); border-radius: 10px; }
.pp-num:focus-visible { outline: 3px solid #2f5d6a; outline-offset: 2px; }
.pp-num.is-ok { border-color: #2e8b57; border-width: 3px; }
.pp-num.is-bad { border-color: #b42318; border-width: 3px; border-style: dashed; }
.pp-unit { font-size: 18px; font-weight: 800; }
.pp-num-mark { font-size: 17px; font-weight: 800; }
.pp-num-mark.is-ok { color: #1d6b40; }
.pp-num-mark.is-bad { color: #b42318; }
html[data-theme="dark"] .pp-num-mark.is-ok { color: #8fe0ad; }
html[data-theme="dark"] .pp-num-mark.is-bad { color: #ffb4a8; }

.pp-msg { margin: 0; font-size: 16px; font-weight: 700; color: #8a3b12; }
.pp-msg:empty { display: none; }
html[data-theme="dark"] .pp-msg { color: #ffbf8a; }
.pp-about { font-size: 16px; line-height: 1.45; }
.pp-about summary { cursor: pointer; font-weight: 700; }
.pp-about p { margin: 6px 0 0; }

/* the scene */
.pp-view { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pp-scene { position: relative; width: 100%; aspect-ratio: 720 / 400; flex: none; border-radius: var(--tlg-radius-lg, 14px); overflow: hidden; border: var(--tlg-border-width, 1px) solid var(--tlg-border, #a5b6c1); user-select: none; -webkit-user-select: none; }
.pp-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pp-sky { fill: url(#pp-g-sky); }
html[data-theme="dark"] .pp-sky { fill: url(#pp-g-sky-d); }
.pp-ground { fill: url(#pp-g-ground); }
html[data-theme="dark"] .pp-ground { fill: url(#pp-g-ground-d); }
.pp-hills { fill: #a9cf8a; opacity: .8; }
html[data-theme="dark"] .pp-hills { fill: #2c4a30; }
.pp-cloud ellipse { fill: #ffffff; opacity: .85; }
html[data-theme="dark"] .pp-cloud ellipse { fill: #3a4f66; opacity: .7; }
.pp-steam { fill: #f4f6f7; }
html[data-theme="dark"] .pp-steam { fill: #c9d3da; }
.pp-plate rect { fill: #22313b; stroke: #c9a24a; stroke-width: 2; }
.pp-plate-n { fill: #c9a24a; }
.pp-tag rect { fill: #fffdf6; stroke: #8a8478; stroke-width: 2; stroke-dasharray: 6 4; }
.pp-tag.is-filled rect { stroke: #2f5d6a; stroke-width: 2.5; stroke-dasharray: none; }
.pp-tag.is-given rect { fill: #e9eef0; stroke: #6b7f8a; stroke-dasharray: none; }
.pp-note-bg { fill: #fffdf6; fill-opacity: .94; stroke: #e2572b; stroke-width: 2; }
.pp-rig-bg { fill: #eef2f4; }
html[data-theme="dark"] .pp-rig-bg { fill: #1a252b; }
.pp-rig-floor { stroke: #9aa8b0; stroke-width: 3; }
.pp-board-bg { fill: #fffdf6; }
html[data-theme="dark"] .pp-board-bg { fill: #222f36; }
.pp-machine rect { fill: url(#pp-g-steel); stroke: #4f5a63; stroke-width: 2.5; }
.pp-band-in { fill: #ffb37a; opacity: .75; }
.pp-band-unk { fill: none; stroke: #9aa8b0; stroke-width: 2; stroke-dasharray: 6 5; }
.pp-band-loss { fill: url(#pp-p-hatch); stroke: #e2572b; stroke-width: 2; }
.pp-band-out { fill: #ffd23f; opacity: .8; }
.pp-band-mine { fill: #ffd23f; opacity: .45; stroke: #8a6a12; stroke-width: 1.5; stroke-dasharray: 5 4; }
.pp-meter { fill: #fffdf6; stroke: #6b7f8a; stroke-width: 2; stroke-dasharray: 6 4; }
html[data-theme="dark"] .pp-meter { fill: #24323a; }
.pp-brace { stroke: #4f5a63; stroke-width: 2.5; }
html[data-theme="dark"] .pp-brace { stroke: #b6c4cc; }

.pp-t { font-family: var(--tlg-font-body, system-ui, sans-serif); fill: #1d2b2f; }
.pp-t-rail { font-size: 19px; font-weight: 800; fill: #f6e7c8; letter-spacing: .03em; }
.pp-t-rail2 { font-size: 17px; font-weight: 700; fill: #c9d3da; font-style: italic; }
.pp-t-plate { font-size: 17px; font-weight: 800; fill: #fffaf0; }
.pp-t-num { font-size: 16px; font-weight: 900; fill: #22313b; }
.pp-t-tag { font-size: 17px; font-weight: 800; fill: #1d2b2f; }
.pp-t-note { font-size: 17px; font-weight: 800; fill: #9a3412; }
.pp-t-small { font-size: 16px; font-weight: 700; fill: #2f5d6a; font-style: italic; }
.pp-t-cap { font-size: 18px; font-weight: 800; fill: #36535c; }
.pp-t-lab { font-size: 17px; font-weight: 800; fill: #36535c; }
.pp-t-val { font-size: 18px; font-weight: 800; fill: #1d2b2f; }
.pp-t-loss { font-size: 17px; font-weight: 800; fill: #9a3412; }
.pp-t-loss2 { font-size: 18px; font-weight: 800; fill: #9a3412; }
.pp-t-warn { font-size: 17px; font-weight: 800; fill: #b42318; }
.pp-t-mach { font-size: 17px; font-weight: 800; fill: #10262c; }
.pp-t-mach2 { font-size: 17px; font-weight: 900; fill: #2f5d6a; }
.pp-t-board { font-size: 17px; font-weight: 700; fill: #1d2b2f; }
.pp-t-board.is-me { font-weight: 900; fill: #c2410c; }
html[data-theme="dark"] .pp-t-cap, html[data-theme="dark"] .pp-t-lab { fill: #b6d6dd; }
html[data-theme="dark"] .pp-t-val, html[data-theme="dark"] .pp-t-board { fill: #eef6f8; }
html[data-theme="dark"] .pp-t-loss, html[data-theme="dark"] .pp-t-loss2 { fill: #ffb37a; }
html[data-theme="dark"] .pp-t-warn { fill: #ffb4a8; }
html[data-theme="dark"] .pp-t-board.is-me { fill: #ffbf8a; }

/* the chain of stages (order task) */
.pp-chain { width: 100%; flex: none; }
.pp-chain .pcb-slot { min-height: 74px; }
.pp-chain .pcb-tray { gap: 6px; }
.pp-chain .pcb-card { min-height: 44px; padding: 3px 10px; }
.pp-chain .pcb-note.pp-fix { background: #1d6b40; color: #fff; }

/* reveal badge (over the rail) */
.pp-badge { position: absolute; left: 2%; right: 2%; top: 1%; padding: 6px 12px; border-radius: 10px; font-size: 17px; font-weight: 700; line-height: 1.3; pointer-events: none;
  background: rgba(255, 255, 255, .97); color: #10202c; border: 3px solid #2f5d6a; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); animation: pp-pop .25s ease-out; }
.pp-badge.is-ok { border-color: #1d6b40; }
.pp-badge.is-bad { border-color: #b42318; }
@keyframes pp-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* briefing + start */
.pp-example-svg { display: block; width: 100%; height: auto; max-height: 420px; }
.pp-start-svg { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) { .pp-badge { animation: none; } }
@media (max-width: 1100px) { .pp { grid-template-columns: 290px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .pp { position: static; grid-template-columns: 1fr; }
  .pp-panel { overflow: visible; }
  .pp-view { order: -1; }
  .pp-scene { width: 100% !important; }
}
@media (max-width: 420px) { .pp-choices { grid-template-columns: 1fr; } }
.pp-surr { fill: #fbe9dc; }
html[data-theme="dark"] .pp-surr { fill: #3a2418; }
.pp-panel-bg { fill: #fffdf6; fill-opacity: .95; stroke: #6b7f8a; stroke-width: 2; }
html[data-theme="dark"] .pp-panel-bg, html[data-theme="dark"] .pp-board-bg { fill: #1d2a30; fill-opacity: .96; stroke: #4f7a9a; }
.pp-board-bg { fill-opacity: .95; stroke: #c2410c; stroke-width: 2; }
