.flow-main { width: min(1560px, calc(100% - 48px)); gap: 14px; padding: 20px 0; }
.flow-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.protocol-page-title { display: flex; align-items: baseline; gap: 16px; }
.protocol-page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 16px; }
.protocol-view-selector { display: flex; gap: 16px; align-self: stretch; }
.protocol-view-tab { position: relative; min-height: 36px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 13px; white-space: nowrap; }
.protocol-view-tab:hover, .protocol-view-tab[aria-selected=true] { color: var(--text); }
.protocol-view-tab[aria-selected=true]::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--primary); }
.protocol-animation-view { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.protocol-playback { display: flex; align-items: center; gap: 6px; }
.protocol-icon-button, .protocol-speed-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text-secondary); }
.protocol-icon-button svg { width: 16px; height: 16px; }
.protocol-speed-button { width: 42px; font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.protocol-icon-button:hover:not(:disabled), .protocol-speed-button:hover { border-color: var(--border-hover); background: var(--neutral-0); }
.protocol-play-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 94px; height: 36px; padding: 0 14px; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground); font-size: 13px; }
.protocol-play-button:hover { background: var(--primary-hover); }
.protocol-play-button svg { width: 15px; height: 15px; }
.protocol-phase-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.protocol-phase-button { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text-secondary); font-size: 13px; }
.protocol-phase-button > .mono { color: var(--faint); font-size: 11px; }
.protocol-phase-button:hover { background: var(--neutral-0); border-color: var(--border-hover); }
.protocol-phase-button[aria-pressed=true] { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
.protocol-phase-button[aria-pressed=true] > .mono { color: var(--primary-muted); }
.protocol-phase-button[data-current=true]:not([aria-pressed=true]) { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-surface); }
.protocol-phase-button[data-current=true]:not([aria-pressed=true]) > .mono { color: var(--cyan); }
.protocol-layout { --protocol-tone: var(--cyan); display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: stretch; }
.protocol-layout[data-tone=amber] { --protocol-tone: var(--amber); }
.protocol-layout[data-tone=green] { --protocol-tone: var(--green); }
.protocol-diagram-panel, .protocol-step-panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.protocol-diagram-panel { display: flex; flex-direction: column; }
.protocol-stage-heading, .protocol-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 10px 16px; background: var(--panel-heading-background); border-bottom: 1px solid var(--border); }
.protocol-stage-heading h2, .protocol-list-heading h2 { font-size: 13px; font-weight: 600; }
.protocol-stage-heading > span, .protocol-list-heading > span { color: var(--muted); font-size: 12px; }
.protocol-list-heading { flex-shrink: 0; padding: 0 12px; gap: 8px; }
.protocol-sidebar-tabs { display: flex; align-self: stretch; gap: 16px; }
.protocol-sidebar-tab { position: relative; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.protocol-sidebar-tab:hover, .protocol-sidebar-tab[aria-selected=true] { color: var(--text); }
.protocol-sidebar-tab[aria-selected=true]::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--primary); }
.protocol-layout[data-playback=running] #protocol-playback-status { color: var(--cyan); }
.protocol-layout[data-playback=complete] #protocol-playback-status { color: var(--green); }
.protocol-diagram { min-height: 444px; height: calc(clamp(360px, calc(100dvh - 360px), 620px) + 84px); overflow: auto; background-color: var(--canvas-background); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; }
.protocol-svg { display: block; width: 100%; min-width: 700px; height: 100%; stroke-linecap: round; stroke-linejoin: round; }
.protocol-svg :is(rect,path,circle) { vector-effect: non-scaling-stroke; }
.protocol-svg clipPath rect { fill: var(--neutral-0); stroke: none; }
.protocol-svg text { stroke: none; fill: var(--text); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.protocol-guides path { fill: none; stroke: var(--diagram-lifeline); stroke-width: 1.25; stroke-dasharray: 4 7; }
.protocol-message-route, .protocol-arrow-head { fill: none; stroke: var(--protocol-tone); stroke-width: 1.75; }
.protocol-packet circle { fill: var(--protocol-tone); stroke: var(--canvas-background); stroke-width: 1.5; }
.protocol-party-body { fill: var(--neutral-0); stroke: var(--diagram-node-border); stroke-width: 1.25; }
.protocol-party-progress { fill: none; stroke: var(--protocol-tone); stroke-width: 1.75; pointer-events: none; }
.protocol-svg .protocol-party-name { font: 500 21px var(--mono); }
.protocol-svg .protocol-party-role { fill: var(--muted); font-size: 14px; }
.protocol-party[data-active=true] .protocol-party-name { fill: var(--protocol-tone); }
.protocol-party[data-active=true] .protocol-party-body { fill: var(--neutral-0); stroke: var(--protocol-tone); }
.protocol-party[data-active=true][data-processing=true] .protocol-party-body { stroke: var(--diagram-node-border); }
.protocol-party[data-verified=true] .protocol-party-body { fill: var(--green-surface); stroke: var(--green); }
.protocol-party[data-verified=true] .protocol-party-name { fill: var(--green); }
.protocol-artifact { pointer-events: none; }
.protocol-artifact text { font-size: 13px; }
.protocol-main-card { fill: var(--green-surface); stroke: var(--green); stroke-width: 1; }
.protocol-lvvc-card { fill: var(--cyan-surface); stroke: var(--cyan); stroke-width: 1; }
.protocol-private-card { fill: var(--amber-surface); stroke: var(--amber); stroke-width: 1; }
.protocol-svg .protocol-main-label { fill: var(--green); }
.protocol-svg .protocol-lvvc-label { fill: var(--cyan); }
.protocol-svg .protocol-private-label { fill: var(--amber); }
.protocol-step-number { color: var(--muted); font-size: 12px; }
.protocol-step-panel { display: flex; flex-direction: column; min-height: 0; max-height: calc(clamp(360px, calc(100dvh - 360px), 620px) + 132px); }
.protocol-sidebar-body { position: relative; flex: 1; min-height: 0; }
.protocol-side-view { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.protocol-operation-view { display: block; overflow: auto; padding: 20px 16px; }
.protocol-operation-parties { margin-top: 20px; color: var(--protocol-tone); font: 12px/1.8 var(--mono); overflow-wrap: anywhere; }
.protocol-operation-name { margin-top: 12px; font-size: 16px; font-weight: 600; line-height: 1.7; }
.protocol-operation-symbols { display: block; margin-top: 20px; padding: 12px; border-radius: var(--radius); background: var(--surface); color: var(--protocol-tone); font: 13px/1.9 var(--mono); font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.protocol-operation-detail { margin-top: 20px; color: var(--text-secondary); font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.protocol-step-list { flex: 1; min-height: 0; max-height: 700px; overflow: auto; margin: 0; padding: 8px; list-style: none; }
.protocol-step-button { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 46px; padding: 12px 10px; border: 0; border-left: 2px solid transparent; border-radius: 0 4px 4px 0; background: none; color: var(--muted); text-align: left; font-size: 12px; line-height: 1.7; }
.protocol-step-button > .mono { flex-shrink: 0; color: var(--faint); font-size: 11px; }
.protocol-step-button:hover { color: var(--text); background: var(--surface-hover); }
.protocol-step-button[data-step=complete] > .mono { color: var(--green); }
.protocol-step-button[aria-current=step] { color: var(--text); border-left-color: var(--cyan); background: var(--cyan-surface); }
.protocol-step-button[aria-current=step] > .mono { color: var(--cyan); }
.protocol-symbol-guide { flex-shrink: 0; border-top: 1px solid var(--border); background: var(--panel-heading-background); }
.protocol-symbol-guide summary { padding: 12px 16px; color: var(--muted); cursor: pointer; font-size: 12px; }
.protocol-symbol-guide dl { max-height: 240px; overflow: auto; margin: 0; padding: 0 16px 12px; }
.protocol-symbol-guide dl > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; padding: 7px 0; font-size: 12px; }
.protocol-symbol-guide dt { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.protocol-symbol-guide dd { margin: 0; color: var(--muted); line-height: 1.65; }
.protocol-sequence-panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.protocol-sequence-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 56px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--panel-heading-background); }
.protocol-sequence-heading h2 { font-size: 13px; font-weight: 600; }
.protocol-sequence-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.protocol-sequence-details { display: flex; align-items: center; gap: 6px; margin-right: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.protocol-sequence-details input { accent-color: var(--primary); }
.protocol-sequence-button { min-height: 32px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.protocol-sequence-button:hover { border-color: var(--border-hover); background: var(--neutral-0); }
.protocol-sequence-button[aria-pressed=true] { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.protocol-sequence-zoom-controls { display: flex; align-items: center; gap: 4px; }
.protocol-sequence-zoom-controls > button { width: 32px; height: 32px; }
.protocol-sequence-zoom { min-width: 50px; color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.protocol-sequence-viewport { height: clamp(480px, calc(100dvh - 244px), 900px); min-width: 0; overflow: auto; overscroll-behavior: contain; background: var(--canvas-background); }
.protocol-sequence-sheet { width: max-content; min-width: 100%; min-height: 100%; padding: 20px; }
.protocol-sequence-svg { display: block; max-width: none; margin: 0 auto; flex-shrink: 0; }
.protocol-sequence-svg .sequence-step:focus { outline: none; }
.protocol-sequence-svg .sequence-step:focus-visible .sequence-computation { stroke: var(--focus-ring); stroke-width: 2; }
.protocol-sequence-svg .sequence-step:focus-visible > path { stroke-width: 3; }

@media (max-width: 1100px) {
  .protocol-layout { grid-template-columns: minmax(0, 1fr) 228px; gap: 12px; }
  .protocol-step-button { gap: 10px; padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 900px) {
  .protocol-layout { grid-template-columns: minmax(0, 1fr); }
  .protocol-step-panel { height: 380px; max-height: 380px; }
  .protocol-diagram { height: 564px; }
}
@media (max-width: 720px) {
  .flow-main { width: calc(100% - 32px); }
  .flow-page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .protocol-page-actions { justify-content: flex-start; gap: 12px; }
  .protocol-page-title { flex-wrap: wrap; gap: 10px; }
  .protocol-phase-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .protocol-phase-button { justify-content: center; padding-left: 10px; padding-right: 10px; font-size: 12px; }
  .protocol-diagram { height: 484px; }
  .protocol-sequence-heading { padding: 12px; }
  .protocol-sequence-controls { gap: 6px; }
  .protocol-sequence-viewport { height: 560px; }
}
@media (prefers-reduced-motion: reduce) {
  .protocol-layout *, .protocol-playback *, .protocol-phase-controls * { transition: none; animation: none; }
}
