@import url("../_shared/TOKENS.css");

/* CM6-owned visual layer. Shared TOKENS.css remains authoritative. */
.stage .visual { gap: 18px; }
.cm6-anchor { display: flex; flex-direction: column; gap: 10px; min-height: 0; width: 100%; }
.cm6-anchor .anchor-visual { display: block; width: 100%; height: auto; max-height: 420px; min-height: 0; }
.cm6-anchor .anchor-visual text { font-family: var(--sans); }
.cm6-anchor .svg-anchor-shell { fill: rgba(255,255,255,.38); stroke: var(--blue); stroke-width: 3; }
.cm6-anchor .svg-anchor-kicker { font-size: 22px; font-weight: 700; letter-spacing: .1em; fill: var(--blue); }
.cm6-anchor .svg-anchor-kicker.healthy { fill: var(--healthy); }
.cm6-anchor .svg-anchor-kicker.caution { fill: var(--caution); }
.cm6-anchor .svg-anchor-kicker.danger { fill: var(--danger); }
.cm6-anchor .svg-anchor-title { font-size: 28px; font-weight: 600; fill: var(--ink); }
.cm6-anchor .svg-anchor-copy { font-size: 20px; fill: var(--muted); }
.cm6-anchor .svg-anchor-label { font-size: 19px; font-weight: 600; fill: var(--blue); }
.cm6-anchor .svg-anchor-label.healthy { fill: var(--healthy); }
.cm6-anchor .svg-anchor-label.caution { fill: var(--caution); }
.cm6-anchor .svg-anchor-label.danger { fill: var(--danger); }
.cm6-anchor .svg-anchor-label.inactive { fill: var(--inactive); font-weight: 500; }
.cm6-anchor .svg-anchor-arrow { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.cm6-anchor .svg-anchor-arrow.healthy { stroke: var(--healthy); }
.cm6-anchor .svg-anchor-arrow.caution { stroke: var(--caution); }
.cm6-anchor .svg-anchor-arrow.danger { stroke: var(--danger); }
.cm6-anchor .svg-causal { transition: opacity .18s ease; }
.cm6-anchor .svg-causal.is-muted { opacity: .15; }
.cm6-anchor .svg-anchor-card { stroke-width: 2; }
.cm6-anchor .svg-anchor-card.architecture { fill: rgba(226,237,240,.72); stroke: var(--blue); }
.cm6-anchor .svg-anchor-card.verified { fill: rgba(236,247,242,.78); stroke: var(--healthy); }
.cm6-anchor .svg-anchor-card.caution { fill: rgba(255,248,230,.82); stroke: var(--caution); }
.cm6-anchor .svg-anchor-card.denied { fill: rgba(250,235,234,.82); stroke: var(--danger); }
.cm6-anchor .svg-anchor-limit { fill: rgba(255,248,230,.78); stroke: var(--caution); stroke-width: 2; }
.cm6-anchor .svg-anchor-evidence { stroke-width: 2; }
.cm6-anchor .svg-anchor-evidence.verified { fill: rgba(236,247,242,.78); stroke: var(--healthy); }
.cm6-anchor .svg-anchor-evidence.caution { fill: rgba(255,248,230,.82); stroke: var(--caution); }
.cm6-anchor .anchor-controls { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.cm6-anchor .anchor-controls button { font-size: 17px; padding: 6px 12px; border-color: var(--blue); }
.cm6-anchor .anchor-controls button[aria-pressed="true"] { background: var(--pale); border-color: var(--blue); }
.cm6-anchor .anchor-status { font-size: 18px; color: var(--muted); margin-left: 6px; }
.cm6-anchor .narrow-only { display: none; }
.cm6-anchor .narrow-summary { border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 8px 0; gap: 6px; }
.cm6-anchor .narrow-step { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.cm6-anchor .narrow-step:last-child { border-bottom: 0; }
.cm6-anchor .narrow-step b { min-width: 0; font-size: 19px; line-height: 1.2; color: var(--blue); }
.cm6-anchor .narrow-step span { min-width: 0; overflow-wrap: anywhere; font-size: 19px; line-height: 1.2; color: var(--ink); }
.cm6-anchor .narrow-step small { grid-column: 1 / -1; min-width: 0; font-size: 17px; line-height: 1.2; color: var(--muted); }
.flow { gap: 12px; }
.flow .node { padding: 18px 14px; }
.flow .node small { margin-top: 7px; }
.split { gap: 36px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split > div { min-width: 0; }
.split > div + div { padding-left: 28px; }
.big { font-size: clamp(34px, 3.1vw, 58px); overflow-wrap: anywhere; }
.caption { font-size: 19px; line-height: 1.25; }
.stage .boundary { padding: 12px 16px; }
.stage .boundary .layer { padding: 8px 14px; }
.stage .boundary .layer .caption { margin-top: 4px; }
.terminal { font-size: clamp(20px, 1.65vw, 29px); line-height: 1.4; padding: 20px 24px; }
.terminal-caption { font-size: 18px; margin: 0; }
.question { max-width: 31ch; font-size: clamp(32px, 3.2vw, 46px); line-height: 1.08; }
.boundary { width: 100%; }
.identity-chain, .credential-boundary, .pipeline-track, .approval-visual, .deploy-visual, .rollback-visual, .evidence-visual, .k8s-visual, .pack-visual { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.identity-chain > div, .credential-lane, .pipeline-track > div, .approval-node, .deploy-boundary, .rollback-visual > div, .evidence-visual > div, .contract-column, .pack-visual > div { flex: 1; min-width: 0; padding: 20px 14px; border-top: 4px solid var(--blue); background: rgba(255,255,255,.55); }
.identity-chain .changed, .credential-lane.approval, .pipeline-track .changed, .approval-node.changed, .deploy-boundary.changed, .rollback-visual .changed, .evidence-visual .changed, .contract-column.changed { border-color: var(--warm); background: #f2e4da; }
.identity-chain b, .identity-chain small, .credential-lane b, .credential-lane small, .pipeline-track b, .pipeline-track small, .approval-node b, .approval-node small, .deploy-boundary b, .deploy-boundary small, .rollback-visual b, .rollback-visual small, .evidence-visual b, .evidence-visual small, .contract-column p, .pack-visual b, .pack-visual small { display: block; }
.identity-chain small, .credential-lane small, .pipeline-track small, .approval-node small, .deploy-boundary small, .rollback-visual small, .evidence-visual small, .pack-visual small { font-size: clamp(18px, 1.4vw, 24px); line-height: 1.15; color: var(--muted); margin-top: 8px; }
.identity-chain .label, .credential-lane .label, .approval-node .label { margin-bottom: 8px; }
.chain-arrow, .credential-arrow, .pipeline-track > span, .approval-bar, .deploy-arrow, .rollback-visual > span, .evidence-visual > span, .k8s-arrow, .pack-visual > span { color: var(--blue); font-size: 32px; flex: 0 0 auto; }
.credential-boundary { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.credential-lane { min-height: 120px; }
.credential-lane.untrusted { border-color: var(--warm); background: #f2e4da; }
.credential-arrow { text-align: center; }
.pipeline-visual { display: grid; gap: 16px; }
.pipeline-track { align-items: stretch; }
.pipeline-note { padding: 14px 18px; border-left: 4px solid var(--warm); background: #f2e4da; font-size: clamp(22px, 1.7vw, 30px); line-height: 1.2; }
.approval-visual, .deploy-visual, .rollback-visual, .evidence-visual, .pack-visual { align-items: stretch; }
.approval-bar { font-size: 36px; }
.deploy-boundary b { overflow-wrap: anywhere; }
.deploy-boundary:first-child { flex: 1.5; }
.deploy-boundary .registry-coordinate { font-family: var(--mono); font-size: clamp(24px, 1.9vw, 32px); overflow-wrap: normal; }
.registry-coordinate span { white-space: nowrap; }
.rollback-visual { gap: 10px; }
.k8s-visual { align-items: stretch; }
.contract-column p { margin: 10px 0 0; font-size: clamp(22px, 1.7vw, 30px); line-height: 1.25; }
.release-object { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.release-boundary { margin: 0; color: var(--muted); font-size: 18px; text-align: center; }
.release-controls { display: grid; grid-template-columns: minmax(240px, 1.8fr) repeat(4, auto); gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.58); }
.release-controls label { color: var(--blue); font-weight: 700; font-size: 18px; line-height: 1.2; }
.release-controls select, .release-controls button { min-height: 40px; padding: 7px 10px; font-size: 18px; }
.release-status, .release-detail { margin: 0; padding: 9px 12px; border-left: 4px solid var(--warm); background: #f2e4da; font-size: clamp(20px, 1.5vw, 26px); line-height: 1.25; }
.release-detail { border-color: var(--blue); background: var(--pale); font-size: clamp(24px, 1.5vw, 28px); }
.release-stages { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; list-style: none; padding: 0; margin: 0; }
.release-stages li { min-width: 0; padding: 8px 5px; border-bottom: 3px solid var(--line); text-align: center; font-size: clamp(18px, 1.25vw, 22px); overflow-wrap: anywhere; }
.release-stages li.current { color: var(--warm); border-color: var(--warm); background: #f2e4da; }
.release-stages li.complete { border-color: var(--blue); background: var(--pale); }
.release-static { color: var(--muted); font-size: 20px; line-height: 1.25; }
.pause-card, .contingency-card { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; gap: 10px; min-height: 220px; border: 2px solid var(--blue); background: var(--pale); padding: 28px; }
.contingency-card { border-color: var(--warm); background: #f2e4da; }
@media screen and (min-width: 701px) {
  .credential-boundary { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); }
}
@media screen and (max-width: 700px) {
  .flow { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; }
  .flow .node { width: 100%; min-width: 0; max-width: none; }
  .flow .arrow { transform: rotate(90deg); justify-self: center; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .split > div + div { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
  .identity-chain, .pipeline-track, .approval-visual, .deploy-visual, .rollback-visual, .evidence-visual, .k8s-visual, .pack-visual { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .identity-chain > span, .pipeline-track > span, .approval-visual > span, .deploy-visual > span, .rollback-visual > span, .evidence-visual > span, .k8s-arrow, .pack-visual > span { transform: rotate(90deg); justify-self: center; }
  .credential-boundary { grid-template-columns: 1fr; gap: 8px; }
  .credential-arrow { transform: rotate(90deg); }
  .release-controls { grid-template-columns: 1fr 1fr; }
  .release-controls label { grid-column: 1 / -1; }
  .release-controls select { width: 100%; }
  .release-controls button { width: 100%; }
  .release-stages { grid-template-columns: repeat(2, 1fr); }
  .cm6-anchor .anchor-visual { display: none; }
  .cm6-anchor .narrow-only { display: grid; }
  .cm6-anchor .anchor-controls { justify-content: flex-start; }
  .cm6-anchor .anchor-controls button { font-size: 15px; padding: 6px 8px; }
  .cm6-anchor .anchor-status { font-size: 15px; margin-left: 0; }
  .terminal { padding: 14px 16px; font-size: 18px; }
  .footnav { padding-left: 3vw; padding-right: 3vw; }
  .footnav .buttons { gap: 2px; }
  .footnav .buttons button { padding: 5px 7px; font-size: 15px; }
  .footnav #counter { max-width: 82px; overflow: hidden; white-space: nowrap; }
}
@media print {
  @page { size: 1280px 720px; margin: 0; }
  body { background: var(--paper); }
  .footnav, .private, .release-controls, .release-boundary, .release-status, .release-detail, .release-stages { display: none !important; }
  .release-static { display: block !important; font-size: 24px; line-height: 1.4; }
  .cm6-anchor .anchor-controls, .cm6-anchor .narrow-only { display: none !important; }
  .cm6-anchor .anchor-visual { display: block !important; width: 100%; height: 360px !important; max-height: 360px !important; min-height: 360px; flex: none; }
  .cm6-anchor .svg-causal { opacity: 1 !important; }
  .terminal { font-size: 22px; }
}
