/* Prototype shell: context bar, nav rail | screen | walkthrough guide */
.pt-app { padding-inline: 16px; padding-block: 14px 40px; max-width: 1680px; margin: 0 auto; }
.pt-ctx { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; }
.pt-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-field select, .pt-field input { border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 8px; background: var(--panel); max-width: 100%; }
.pt-search { flex: 1 1 200px; }
.pt-search input { width: 100%; }
.pt-clock { display: flex; flex-direction: column; gap: 0; }
.pt-search-res { margin-bottom: 12px; }
.pt-sr { display: flex; gap: 10px; align-items: baseline; text-align: left; border: 0; background: transparent; padding: 4px 6px; border-radius: 4px; flex-wrap: wrap; }
.pt-sr:hover { background: var(--sunk); }
.pt-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.guide-open .pt-body { grid-template-columns: 200px minmax(0, 1fr) 300px; }
.pt-nav { position: sticky; top: calc(100px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 10px; }
.pt-nav-mobile { display: none; }
.pt-navg { display: flex; flex-direction: column; gap: 1px; }
.pt-navg .eyebrow { padding: 0 8px 2px; }
.pt-navg button { display: flex; justify-content: space-between; align-items: center; gap: 6px; border: 0; background: transparent; text-align: left; padding: 5px 8px; border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.pt-navg button:hover { background: var(--sunk); color: var(--ink); }
.pt-navg button[aria-current="true"] { background: var(--brand-soft); color: var(--ink); font-weight: 700; }
.pt-count { background: var(--accent); color: var(--panel); font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.pt-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pt-guide { position: sticky; top: calc(100px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 116px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pt-g-head { display: flex; flex-direction: column; gap: 6px; }
.pt-g-head select { width: 100%; }
.pt-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-step { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 6px 4px; border-radius: 6px; font-size: 12.5px; }
.pt-step > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pt-sn { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 10.5px; font-weight: 800; color: var(--muted); }
.pt-step.done { color: var(--muted); }
.pt-step.done .pt-sn { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.pt-step.now { background: var(--accent-soft); }
.pt-step.now .pt-sn { background: var(--accent); color: var(--panel); border-color: var(--accent); }
.pt-check { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.pt-audit { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.pt-navbar { display: none; }
.pt-g-close { display: none; }
.pt-scrim { display: none; }
.pt-pill { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px 6px 6px 4px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.pt-pill-open { display: flex; flex-direction: column; align-items: flex-start; text-align: left; border: 0; background: transparent; padding: 4px 8px; min-width: 0; min-height: 40px; }
.pt-pill-open span:last-child { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
@media (max-width: 1279px) {
  .guide-open .pt-body { grid-template-columns: 184px minmax(0, 1fr); }
  .pt-body { grid-template-columns: 184px minmax(0, 1fr); }
  .pt-guide { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); max-height: none; z-index: 70; border-radius: 0; border-width: 0 0 0 1px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow); overscroll-behavior: contain; }
  .pt-g-close { display: flex; justify-content: flex-end; }
  .pt-scrim { display: block; position: fixed; inset: 0; background: rgba(10, 20, 15, .32); z-index: 69; }
  .pt-cc { grid-template-columns: 1fr 1fr; }
  .pt-exc { grid-column: 1 / -1; }
  .pt-quote { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .pt-body, .guide-open .pt-body { grid-template-columns: 1fr; }
  .pt-nav { position: static; min-width: 0; }
  .pt-navbar { max-width: 100%; }
  .pt-navg { display: none; }
  .pt-navbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pt-navbar::-webkit-scrollbar { display: none; }
  .pt-navbar button { flex: none; border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 7px 13px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
  .pt-navbar button[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .pt-main { padding-bottom: 72px; }
}

/* shared */
.pt-h { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.pt-h h2 { margin-top: 2px; }
.pt-auto { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; font-size: 11px; }
.pt-auto > span:not(.eyebrow):not(.muted) { border: 1px solid var(--line-2); padding: 0 6px; border-radius: 3px; color: var(--muted); }
.pt-auto > span.on { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; }
.pt-auto .eyebrow { margin-right: 3px; }
.pt-denied { display: flex; flex-direction: column; gap: 3px; border: 1px dashed var(--crit); background: var(--crit-bg); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; }
.pt-denied b { color: var(--crit); }
.pt-empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--panel); }
.pt-ev { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--panel); display: flex; flex-direction: column; gap: 3px; border-left-width: 3px; }
.pt-ev.ok { border-left-color: var(--ok); } .pt-ev.wait { border-left-color: var(--wait); } .pt-ev.unk { border-left-color: var(--unk); } .pt-ev.crit { border-left-color: var(--crit); } .pt-ev.warn { border-left-color: var(--warn); }
.pt-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: flex-end; }
.pt-tabs .spacer { flex: 1; }
.pt-tabs button { border: 0; background: none; padding: 6px 10px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; font-size: 12.5px; }
.pt-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.pt-g { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pt-g.ok { color: var(--ok); } .pt-g.deny { color: var(--crit); }
.pt-pre { background: var(--sunk); padding: 8px; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; }
.pt-arrow { color: var(--muted); align-self: center; }
.pt-inline { display: flex !important; flex-wrap: wrap; gap: 4px 10px; }
.pt-kv4 { grid-template-columns: repeat(auto-fit, minmax(90px, max-content) minmax(140px, 1fr)); }

/* S02 */
.pt-cc { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .9fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .pt-cc { grid-template-columns: 1fr 1fr; } .pt-exc { grid-column: 1 / -1; } }
@media (max-width: 640px) { .pt-cc { grid-template-columns: 1fr; } }
.pt-xl { list-style: none; margin: 0; padding: 0; }
.pt-xl li { border-bottom: 1px solid var(--line); }
.pt-xl li.sev0 { box-shadow: inset 3px 0 0 var(--crit); }
.pt-xl li.sev1 { box-shadow: inset 3px 0 0 var(--warn); }
.pt-xrow { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; align-items: start; }
.pt-xrow:hover { background: var(--sunk); }
.pt-sev { font-size: 10px; color: var(--crit); font-weight: 800; padding-top: 3px; }
.sev2 .pt-sev { color: var(--muted); }
.pt-xmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-xmeta { display: flex; flex-direction: column; align-items: flex-end; color: var(--muted); text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .pt-xrow { grid-template-columns: 20px minmax(0, 1fr); } .pt-xmeta { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 8px; flex-wrap: wrap; } }

/* S03 / lists */
.pt-wb { display: grid; grid-template-columns: 250px minmax(0, 1fr) 240px; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); min-height: 460px; }
@media (max-width: 1100px) { .pt-wb { grid-template-columns: 220px minmax(0, 1fr); } .pt-drawer { grid-column: 1 / -1; border-top: 1px solid var(--line); } }
@media (max-width: 640px) { .pt-wb { grid-template-columns: 1fr; } .pt-clist { border-right: 0 !important; border-bottom: 1px solid var(--line); max-height: 260px; overflow-y: auto; } }
.pt-clist { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.pt-crow { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 8px 10px; min-width: 0; }
.pt-crow:hover { background: var(--sunk); }
.pt-crow.sel { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.pt-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-dot { color: var(--wait); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.pt-thread { display: flex; flex-direction: column; min-width: 0; }
.pt-th-h { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.pt-msgs { padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pt-msg { display: flex; flex-direction: column; gap: 3px; max-width: 86%; }
.pt-msg.guest { align-self: flex-start; }
.pt-msg:not(.guest) { align-self: flex-end; }
.pt-bub { background: var(--sunk); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.pt-msg:not(.guest) .pt-bub { background: var(--brand-soft); }
.pt-aidraft { margin: 0 12px 10px; border: 1px dashed var(--wait); border-radius: 6px; padding: 8px 10px; background: var(--wait-bg); display: flex; flex-direction: column; gap: 3px; }
.pt-composer { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.pt-composer textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; background: var(--panel); resize: vertical; }
.pt-drawer { padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--sunk); min-width: 0; }

/* boards */
.pt-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.pt-col { background: var(--sunk); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.pt-colh { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pt-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pt-card.live { border-color: var(--accent); }

/* S06 */
.pt-quote { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
@media (max-width: 1200px) { .pt-quote { grid-template-columns: 1fr; } }
.pt-alts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.pt-alt.chosen { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.pt-preview { display: flex; flex-direction: column; gap: 4px; }
.pt-res2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
@media (max-width: 800px) { .pt-res2 { grid-template-columns: 1fr; } }

/* S09 */
.pt-svc { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.pt-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-flow span { border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 8px; font-size: 12px; color: var(--muted); }
.pt-flow span.done { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); font-weight: 700; }

/* S11 */
.pt-canvas { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 14px; background: var(--sunk); border-radius: var(--r); border: 1px solid var(--line); }
.pt-node { flex: 0 0 140px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.pt-node.gate { border: 2px solid var(--crit); }
.pt-node.wait { border-style: dashed; }
.pt-node.ev { border: 3px double var(--ok); }
.pt-node.read { border-color: var(--unk); }
.pt-node.flag { box-shadow: 0 0 0 2px var(--warn); }

/* S12, S13 */
.pt-runs, .pt-ap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; align-items: start; }
.pt-runs .pt-clist, .pt-ap .pt-clist { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
@media (max-width: 860px) { .pt-runs, .pt-ap { grid-template-columns: 1fr; } }

/* S15 */
.pt-kn { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 860px) { .pt-kn { grid-template-columns: 1fr; } }

/* S17 */
.pt-mflow { display: flex; gap: 6px; flex-wrap: wrap; align-items: stretch; }
.pt-mstep { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; flex: 1 1 140px; }
