



.pd { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1px; background: var(--line); border: 1px solid var(--line-2); }
.pd > div { background: var(--bg-2); min-width: 0; }


.pd-scene { padding: 26px 22px 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pd-flow { display: grid; grid-template-columns: minmax(0, 1fr) clamp(40px, 5vw, 72px) minmax(0, 1fr) clamp(40px, 5vw, 72px) minmax(0, 1fr); align-items: stretch; }
.pd-node { position: relative; min-width: 0; border: 1px solid var(--line-2); background: var(--bg); padding: 14px 12px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .3s, opacity .3s; }
.pd .pd-ico { flex: none; width: 44px; height: 44px; color: var(--ink-dim); }
.pd-txt { min-width: 0; max-width: 100%; }
.pd-t { font-size: 14px; font-weight: 500; line-height: 1.25; color: var(--ink); overflow-wrap: break-word; }
.pd-state { margin-top: 4px; font-family: var(--font-mono), monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); transition: color .3s; }
.pd-state.is-no { color: var(--danger); }
.pd-slot { margin-top: auto; padding-top: 8px; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 12px; }

.pd-main { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pd .pd-main .pd-ico { color: var(--accent); }

.pd-alt { border-style: dashed; opacity: 0.55; }
.pd-node.is-on { opacity: 1; border-style: solid; border-color: var(--accent); }
.pd-node.is-off { border-color: color-mix(in oklab, var(--danger) 60%, transparent); }


.pd-path { align-self: center; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 0 6px; min-width: 0; }
.pd-lane { position: relative; display: block; height: 2px; background: var(--line-2); transition: background-color .3s; }
.pd-lane::after { content: ""; position: absolute; top: -4px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.pd-lane.fwd::after { right: -1px; border-left: 8px solid var(--line-2); }
.pd-lane.back::after { left: -1px; border-right: 8px solid var(--line-2); }
.pd-lane.is-live { background: var(--accent); }
.pd-lane.fwd.is-live::after { border-left-color: var(--accent); }
.pd-lane.back.is-live::after { border-right-color: var(--accent); }
.pd-lane.is-stop { background: repeating-linear-gradient(90deg, var(--danger) 0 5px, transparent 5px 9px); }
.pd-lane.fwd.is-stop::after { border-left-color: var(--danger); }
.pd-x { display: none; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 1px solid var(--danger); background: var(--bg-2); color: var(--danger); font-style: normal; font-size: 10px; line-height: 1; place-items: center; }
.pd-x::before { content: "✕"; }
.pd-lane.is-stop .pd-x { display: grid; }


.pd-piece { position: relative; z-index: 2; flex: none; display: block; transition: transform .9s cubic-bezier(.5, 0, .2, 1), opacity .35s, visibility .35s; }
.pd-doc { order: 0; width: 26px; height: 32px; }
.pd-doc > svg { display: block; width: 26px; height: 32px; }
.pd-doc .pg { fill: var(--ink); }
.pd-doc .fold { fill: var(--ink-mute); }
.pd-doc .ln { fill: none; stroke: var(--ink-mute); stroke-width: 1.6; }
.pd-money { order: 1; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #1a0f02; display: grid; place-items: center; font-family: var(--font-mono), monospace; font-weight: 500; font-size: 15px; box-shadow: 0 0 0 4px var(--accent-soft), 0 6px 18px rgba(0, 0, 0, 0.5); }
.pd-money::before { content: "$"; }
.pd-money.is-dim { background: var(--bg-3); color: var(--ink-mute); box-shadow: 0 0 0 1px var(--line-2); }
.pd-piece.is-gone { opacity: 0; visibility: hidden; }

.pd-mark { position: absolute; right: -9px; top: -8px; width: 18px; height: 18px; border-radius: 50%; display: none; place-items: center; font-style: normal; font-size: 11px; font-weight: 600; line-height: 1; }
.pd-doc[data-mark="ok"] .pd-mark { display: grid; background: var(--accent); color: #1a0f02; }
.pd-doc[data-mark="ok"] .pd-mark::before { content: "✓"; }
.pd-doc[data-mark="no"] .pd-mark { display: grid; background: var(--danger); color: #1a0606; }
.pd-doc[data-mark="no"] .pd-mark::before { content: "✕"; }
.pd-doc[data-mark="lock"] .pd-mark { display: grid; background: var(--bg-3); border: 1px solid var(--accent); }
.pd-doc .pd-lock { display: none; width: 10px; height: 10px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.pd-doc[data-mark="lock"] .pd-lock { display: block; }
.pd-doc[data-mark="wait"]::after { content: ""; position: absolute; inset: -5px -6px; border: 1px solid var(--accent); animation: pdwait .9s ease-in-out infinite alternate; }
@keyframes pdwait { from { opacity: 0.2; } to { opacity: 1; } }


.pd-status { padding: 12px 14px; border: 1px solid var(--line-2); background: var(--bg); font-size: 14.5px; line-height: 1.5; color: var(--ink); min-height: 48px; transition: border-color .3s; }
.pd[data-kind="title"] .pd-status { min-height: 78px; }
.pd-status.is-ok { border-color: var(--accent); }
.pd-status.is-no { border-color: color-mix(in oklab, var(--danger) 60%, transparent); }
.pd-note { display: block; margin-top: 6px; font-size: 13.5px; color: var(--ink-dim); }


.pd-controls { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.pd-title { font-family: var(--font-mono), monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); }
.pd-runs { display: grid; gap: 8px; }
.pd-run { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; background: var(--bg); border: 1px solid var(--line-2); color: var(--ink-dim); font: inherit; font-size: 14px; line-height: 1.3; text-align: left; cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.pd-run:hover { border-color: var(--ink-dim); color: var(--ink); }
.pd-run[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.pd-play { flex: none; width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 50%; display: grid; place-items: center; }
.pd-play::before { content: ""; margin-left: 2px; border-left: 6px solid var(--ink-mute); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.pd-run[aria-pressed="true"] .pd-play { border-color: var(--accent); background: var(--accent); }
.pd-run[aria-pressed="true"] .pd-play::before { border-left-color: #1a0f02; }


.pd-still .pd-piece, .pd-still .pd-node, .pd-still .pd-lane, .pd-still .pd-state, .pd-still .pd-status { transition: none; }
.pd-still .pd-doc[data-mark="wait"]::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .pd-piece, .pd-node, .pd-lane, .pd-state, .pd-status { transition: none; }
  .pd-doc[data-mark="wait"]::after { animation: none; }
}

@media (max-width: 1000px) {
  .pd { grid-template-columns: 1fr; }
  .pd-runs { grid-template-columns: 1fr 1fr; }
  .pd[data-kind="title"] .pd-status { min-height: 100px; }
}
@media (max-width: 640px) {

  .pd-scene { padding: 16px 14px 14px; gap: 14px; }
  .pd-flow { grid-template-columns: minmax(0, 1fr); }
  .pd-node { flex-direction: row; text-align: left; align-items: center; gap: 10px; padding: 10px; }
  .pd-state { letter-spacing: 0.08em; }
  .pd .pd-ico { width: 34px; height: 34px; }
  .pd-txt { flex: 1; }
  .pd-slot { margin: 0; padding-top: 0; min-height: 34px; flex: none; min-width: 34px; justify-content: flex-end; }


  .pd-slot[data-slot="bank"], .pd[data-kind="title"] .pd-slot[data-slot="co"] { min-width: 72px; }
  .pd-path { align-self: stretch; height: 38px; padding: 0; flex-direction: row; justify-content: center; gap: 18px; }
  .pd-lane { width: 2px; height: 100%; }
  .pd-lane.fwd::after, .pd-lane.back::after { top: auto; right: auto; left: -4px; border-top: 0; border-bottom: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
  .pd-lane.fwd::after { bottom: -1px; border-top: 8px solid var(--line-2); }
  .pd-lane.back::after { top: -1px; border-bottom: 8px solid var(--line-2); }
  .pd-lane.fwd.is-live::after { border-left-color: transparent; border-top-color: var(--accent); }
  .pd-lane.back.is-live::after { border-right-color: transparent; border-bottom-color: var(--accent); }
  .pd-lane.fwd.is-stop::after { border-left-color: transparent; border-top-color: var(--danger); }
  .pd-lane.is-stop { background: repeating-linear-gradient(180deg, var(--danger) 0 5px, transparent 5px 9px); }
  .pd-status { min-height: 92px; }
  .pd[data-kind="title"] .pd-status { min-height: 138px; }
  .pd-controls { padding: 16px 14px; }
  .pd-runs { grid-template-columns: minmax(0, 1fr); }
}



@media (pointer: coarse) {
  .pd-state, .pd-x, .pd-mark, .pd-title { font-size: 12px; }
}
