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

/* CM4-owned styling. Shared TOKENS.css remains the source for the deck frame. */
:root { --warm: var(--caution); }
.healthy-text { color: var(--healthy); }
.caution-text { color: var(--caution); }
.anchor-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 0; width: 100%; }
.anchor-visual { display: block; width: 100%; height: auto; max-height: 390px; min-height: 0; }
.anchor-visual text { font-family: var(--sans); }
.anchor-visual .svg-topology-shell, .anchor-visual .svg-request-shell, .anchor-visual .svg-evidence-shell { fill: rgba(255,255,255,.38); stroke: var(--blue); stroke-width: 3; }
.anchor-visual .svg-kicker { font-size: 22px; font-weight: 700; letter-spacing: .1em; fill: var(--blue); }
.anchor-visual .svg-kicker.healthy { fill: var(--healthy); }
.anchor-visual .svg-kicker.caution { fill: var(--caution); }
.anchor-visual .svg-kicker.danger { fill: var(--danger); }
.anchor-visual .svg-title { font-size: 28px; font-weight: 600; fill: var(--ink); }
.anchor-visual .svg-copy { font-size: 20px; fill: var(--muted); }
.anchor-visual .svg-boundary-label { font-size: 19px; fill: var(--muted); }
.anchor-visual .svg-boundary-label.healthy { fill: var(--healthy); }
.anchor-visual .svg-boundary-label.caution { fill: var(--caution); }
.anchor-visual .svg-boundary-label.danger { fill: var(--danger); }
.anchor-visual .svg-arrow { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.anchor-visual .svg-arrow.healthy { stroke: var(--healthy); }
.anchor-visual .svg-arrow.caution { stroke: var(--caution); }
.anchor-visual .svg-arrow.danger { stroke: var(--danger); }
.anchor-visual .svg-arrow-label { font-size: 20px; font-weight: 600; fill: var(--blue); }
.anchor-visual .svg-arrow-label.healthy { fill: var(--healthy); }
.anchor-visual .svg-arrow-label.caution { fill: var(--caution); }
.anchor-visual .svg-arrow-label.danger { fill: var(--danger); }
.anchor-visual .svg-causal { transition: opacity .18s ease; }
.anchor-visual .svg-causal.is-muted { opacity: .14; }
.anchor-visual .svg-topology-node { fill: rgba(255,255,255,.64); stroke: var(--blue); stroke-width: 2; }
.anchor-visual .svg-topology-host, .anchor-visual .svg-topology-proxy { stroke: var(--caution); fill: rgba(255,248,230,.72); }
.anchor-visual .svg-topology-api { stroke: var(--blue); }
.anchor-visual .svg-topology-db { stroke: var(--healthy); fill: rgba(236,247,242,.72); }
.anchor-visual .svg-topology-network { fill: rgba(226,237,240,.46); stroke: var(--blue); stroke-width: 2; stroke-dasharray: 8 7; }
.anchor-visual .svg-topology-network.data { fill: rgba(236,247,242,.52); stroke: var(--healthy); }
.anchor-visual .svg-topology-volume { fill: rgba(236,247,242,.72); stroke: var(--healthy); stroke-width: 2; }
.anchor-visual .svg-topology-evidence { fill: rgba(255,248,230,.72); stroke: var(--caution); stroke-width: 2; }
.anchor-visual .svg-request-card { fill: rgba(255,255,255,.64); stroke: var(--blue); stroke-width: 2; }
.anchor-visual .svg-request-card.proxy { stroke: var(--caution); fill: rgba(255,248,230,.72); }
.anchor-visual .svg-request-card.api { stroke: var(--caution); fill: rgba(255,248,230,.58); }
.anchor-visual .svg-request-card.failure { stroke: var(--danger); fill: rgba(250,235,234,.72); }
.anchor-visual .svg-request-check { fill: rgba(236,247,242,.72); stroke: var(--healthy); stroke-width: 2; }
.anchor-visual .svg-evidence-rung { stroke-width: 2; }
.anchor-visual .svg-evidence-rung.impact, .anchor-visual .svg-evidence-rung.model { fill: rgba(255,255,255,.64); stroke: var(--blue); }
.anchor-visual .svg-evidence-rung.state, .anchor-visual .svg-evidence-rung.test { fill: rgba(236,247,242,.72); stroke: var(--healthy); }
.anchor-visual .svg-evidence-rung.history { fill: rgba(255,248,230,.72); stroke: var(--caution); }
.anchor-visual .svg-evidence-limit { fill: rgba(255,248,230,.72); stroke: var(--caution); stroke-width: 2; }
.anchor-visual .svg-evidence-rail { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 5 7; }
.anchor-controls { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.anchor-controls button { font-size: 17px; padding: 6px 12px; border-color: var(--blue); }
.anchor-controls button[aria-pressed="true"] { background: var(--pale); border-color: var(--blue); }
.anchor-status { font-size: 18px; color: var(--muted); margin-left: 6px; }
.narrow-only { display: none; }
.narrow-summary { border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 12px 0; gap: 10px; }
.narrow-step { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.narrow-step:last-child { border-bottom: 0; }
.narrow-step b { font-size: 20px; color: var(--blue); }
.narrow-step span { font-size: 20px; color: var(--ink); }
.narrow-step small { grid-column: 1 / -1; font-size: 18px; color: var(--muted); }
.topology-shell, .dependency-map, .restart-map, .diagnosis-object { width: 100%; }
.topology-shell { display: grid; gap: 12px; }
.topology-host, .topology-network, .topology-state { border: 2px solid var(--line); padding: 12px; background: rgba(255,255,255,.45); }
.topology-host { border-color: var(--warm); }
.topology-networks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topology-network { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 10px; min-width: 0; }
.topology-network .label { grid-column: 1 / -1; margin-bottom: 0; }
.topology-node { padding: 10px 12px; border-top: 3px solid var(--blue); background: var(--pale); min-width: 0; }
.topology-node b, .topology-node small { display: block; }
.topology-node small { font-size: clamp(18px, 1.35vw, 24px); color: var(--muted); margin-top: 5px; line-height: 1.15; }
.topology-link, .instance-arrow, .dependency-arrow, .restart-arrow, .rollback-lane > span, .handoff-chain > span { color: var(--blue); font-size: 32px; flex: 0 0 auto; }
.topology-state { display: grid; grid-template-columns: minmax(180px, .65fr) 1.35fr; gap: 16px; align-items: center; }
.topology-state .volume { border-color: var(--warm); background: #f2e4da; }
.topology-note { font-size: clamp(20px, 1.65vw, 28px); line-height: 1.2; color: var(--muted); }
.service-instance-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.role-card, .instance-card { border: 2px solid var(--line); padding: 22px; background: rgba(255,255,255,.55); }
.instance-card { border-color: var(--warm); background: #f2e4da; }
.role-card p, .instance-card p { margin: 10px 0 0; font-size: clamp(20px, 1.7vw, 29px); line-height: 1.25; }
.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.health-card, .instrument, .incident-views > div, .record-sheet > div { padding: 18px; border-top: 4px solid var(--blue); background: rgba(255,255,255,.55); }
.health-card.health { border-color: var(--healthy); background: #e3eee8; }
.health-card.ready { border-color: var(--caution); background: #f2e4da; }
.health-card.crud { border-color: var(--healthy); background: #e3eee8; }
.health-card p, .instrument small, .incident-views small, .record-sheet b { display: block; font-size: clamp(18px, 1.45vw, 25px); line-height: 1.2; margin-top: 8px; }
.dependency-map, .restart-map { display: grid; gap: 16px; }
.dependency-lane, .restart-lane { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--line); background: rgba(255,255,255,.45); min-width: 0; }
.dependency-lane.later, .restart-lane.process-lane { border-color: var(--warm); background: #f2e4da; }
.dependency-lane .label, .restart-lane .label { flex: 0 0 190px; margin: 0; }
.dependency-step, .restart-box { flex: 1; min-width: 0; padding: 16px 12px; border-top: 3px solid var(--blue); background: var(--pale); }
.dependency-step.changed, .restart-box.changed { border-color: var(--warm); background: #f2e4da; }
.dependency-step b, .dependency-step small, .restart-box b, .restart-box small { display: block; }
.dependency-step small, .restart-box small { color: var(--muted); font-size: clamp(18px, 1.3vw, 23px); line-height: 1.15; margin-top: 5px; }
.restart-arrow { font-size: 28px; }
.instrument-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.instrument { border-color: var(--blue); }
.instrument.test { border-color: #4d8a76; background: #e3eee8; }
.evidence-rail { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 16px 0 0; color: var(--muted); font-size: clamp(21px, 1.7vw, 29px); }
.evidence-rail b { color: var(--blue); }
.incident-views { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.incident-views > div:nth-child(3) { border-color: var(--warm); background: #f2e4da; }
.view-number { font-family: var(--mono); color: var(--blue); font-size: 18px; }
.record-sheet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.record-sheet > div:nth-child(4) { border-color: var(--warm); background: #f2e4da; }
.rollback-lane, .handoff-chain { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.rollback-node, .handoff-chain > div { flex: 1; min-width: 0; padding: 20px 14px; border-top: 4px solid var(--blue); background: rgba(255,255,255,.55); }
.rollback-node.changed, .handoff-chain > div.changed { border-color: var(--warm); background: #f2e4da; }
.rollback-node b, .rollback-node small, .handoff-chain b, .handoff-chain small { display: block; }
.rollback-node small, .handoff-chain small { font-size: clamp(18px, 1.4vw, 24px); line-height: 1.15; color: var(--muted); margin-top: 8px; }
.diagnosis-loop { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 12px; border: 2px solid var(--line); background: rgba(255,255,255,.45); font-size: clamp(20px, 1.7vw, 30px); }
.diagnosis-loop span { padding: 8px 10px; border-bottom: 3px solid var(--line); }
.diagnosis-loop span.active { border-color: var(--warm); color: var(--warm); }
.diagnosis-boundary { margin: 8px 0; color: var(--muted); font-size: 18px; text-align: center; }
.diagnosis-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); }
.diagnosis-controls label { color: var(--blue); font-weight: 700; font-size: 18px; line-height: 1.2; }
.diagnosis-controls select, .diagnosis-controls button { min-height: 40px; padding: 7px 10px; font-size: 18px; }
.diagnosis-status, .diagnosis-detail { margin: 8px 0 0; padding: 9px 12px; border-left: 4px solid var(--warm); background: #f2e4da; font-size: clamp(20px, 1.55vw, 27px); line-height: 1.25; }
.diagnosis-detail { border-color: var(--blue); background: var(--pale); font-size: clamp(24px, 1.8vw, 30px); }
.diagnosis-stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.diagnosis-stages li { padding: 9px 6px; border-bottom: 3px solid var(--line); text-align: center; font-size: clamp(18px, 1.35vw, 23px); }
.diagnosis-stages li.current { border-color: var(--warm); color: var(--warm); background: #f2e4da; }
.diagnosis-stages li.complete { border-color: var(--blue); background: var(--pale); }
.diagnosis-static { color: var(--muted); font-size: 20px; line-height: 1.25; }
.pause-card { border: 3px solid var(--warm); padding: 44px 28px; text-align: center; background: #f2e4da; }
.pause-card .caption { margin-top: 18px; }
.question { font-size: clamp(32px, 3.2vw, 46px); line-height: 1.08; }
@media screen and (min-width: 701px) {
  .topology-shell { grid-template-columns: minmax(190px, .8fr) minmax(0, 2fr); grid-template-rows: auto auto; }
  .topology-host { grid-column: 1; grid-row: 1; align-self: stretch; }
  .topology-networks { grid-column: 2; grid-row: 1; grid-template-columns: 1fr 1fr; gap: 8px; }
  .topology-state { grid-column: 1 / -1; grid-row: 2; }
  .topology-network { padding: 8px; }
  .topology-node { padding: 8px 10px; }
}
@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; }
  .topology-networks, .topology-state, .health-grid, .service-instance-grid, .instrument-grid, .incident-views, .record-sheet { grid-template-columns: 1fr 1fr; }
  .topology-networks { grid-template-columns: 1fr; }
  .topology-network { grid-template-columns: 1fr; }
  .topology-network .label { grid-column: 1; }
  .topology-link { justify-self: center; }
  .dependency-lane, .restart-lane, .rollback-lane, .handoff-chain { flex-wrap: wrap; }
  .dependency-lane .label, .restart-lane .label { flex-basis: 100%; }
  .topology-state { grid-template-columns: 1fr; }
  .dependency-step, .restart-box { flex-basis: 35%; }
  .diagnosis-controls { grid-template-columns: 1fr 1fr; }
  .diagnosis-controls label { grid-column: 1 / -1; }
  .diagnosis-controls select { width: 100%; }
  .diagnosis-controls button { width: 100%; }
  .diagnosis-stages li { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
  .evidence-rail { flex-wrap: wrap; gap: 8px; }
  .rollback-lane, .handoff-chain { display: grid; grid-template-columns: 1fr; }
  .rollback-lane > span, .handoff-chain > span { transform: rotate(90deg); justify-self: center; }
  .anchor-visual { display: none; }
  .narrow-only { display: grid; }
  .anchor-controls { justify-content: flex-start; }
  .anchor-controls button { font-size: 15px; padding: 6px 8px; }
  .anchor-status { font-size: 15px; margin-left: 0; }
}
@media print {
  .diagnosis-controls, .diagnosis-boundary, .diagnosis-status, .diagnosis-detail, .diagnosis-stages { display: none !important; }
  .diagnosis-static { display: block !important; font-size: 24px; line-height: 1.4; }
  .anchor-controls { display: none !important; }
  .anchor-visual { height: 360px !important; max-height: 360px !important; flex: none; }
  .anchor-wrap > .print-only { display: none !important; }
  .anchor-visual .svg-causal { opacity: 1 !important; }
  .narrow-only { display: none !important; }
}
