/* ---------- security: the protected path from the machine to the screen ---------- */
.secsec { background: var(--paper); color: var(--ink); padding: clamp(72px, 9vw, 120px) 0 clamp(96px, 11vw, 150px); }
.secsec > .wrap { max-width: 1200px; }
.secsec-title { text-align: center; margin: 0 auto 14px; }
.secsec-sub { text-align: center; max-width: 34em; margin: 0 auto clamp(48px, 6vw, 72px); color: var(--muted); font-size: clamp(1.02rem, 1.3vw, 1.15rem); line-height: 1.5; }

/* one grid, four bands: stations, checkpoints, protected spans, ownership */
.sp { --st: 150px; display: grid; grid-template-columns: var(--st) 1fr var(--st) 1fr var(--st) 1fr var(--st); position: relative; }

/* band 1: stations and wires */
.sp-st { grid-row: 1; grid-column: var(--col); display: grid; justify-items: center; align-content: start; text-align: center; }
.sp-st strong { margin-top: 12px; font-size: 1rem; font-weight: 650; color: var(--ink); }
.sp-ic { position: relative; z-index: 1; width: 76px; height: 76px; border-radius: 18px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: #2f7fdc; font-size: 1.8rem; box-shadow: 0 12px 30px -20px rgba(0,46,91,.5); }
.sp-ic.main { background: #0c1a2c; border-color: transparent; color: #5AA9FF; box-shadow: 0 0 0 6px rgba(90,169,255,.14), 0 20px 50px -20px rgba(0,30,60,.7); }
.sp-tiles { display: grid; grid-template-columns: repeat(3, 12px); gap: 4px; }
.sp-tiles i { height: 10px; border-radius: 3px; background: #15803d; }
.sp-tiles i:nth-child(4) { background: #b91c1c; } .sp-tiles i:nth-child(6) { background: #3d4d78; }
.sp-wire { grid-row: 1; grid-column: var(--col); height: 3px; margin: 37px calc((76px - var(--st)) / 2) 0; border-radius: 2px; }
.sp-wire.plant { background: #3dd68c; }
.sp-wire.enc { background: #2f7fdc; }
.sp-dot { grid-row: 1; grid-column: 1 / -1; position: relative; top: 32px; left: calc(var(--st) / 2); width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #3dd68c; box-shadow: 0 0 12px rgba(61,214,140,.7); animation: sp-go 8s linear infinite; pointer-events: none; z-index: 2; align-self: start; justify-self: start; }
@keyframes sp-go { 0% { left: calc(var(--st) / 2); opacity: 0; } 5% { opacity: 1; } 85% { left: calc(100% - var(--st) / 2 - 12px); opacity: 1; } 92%, 100% { left: calc(100% - var(--st) / 2 - 12px); opacity: 0; } }

/* band 2: checkpoints, one aligned row under their stations */
.sp > .sp-cp { grid-row: 2; grid-column: var(--col); justify-self: center; position: relative; margin-top: 16px; }
.sp-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(47,127,220,.35); background: #fff; color: #1d5fae; font: inherit; font-size: .84rem; font-weight: 650; white-space: nowrap; cursor: pointer; transition: background .2s, border-color .2s; }
.sp-btn:hover, .sp-btn[aria-expanded="true"] { background: #eaf3ff; border-color: #2f7fdc; }
.sp-btn:focus-visible { outline: 2px solid #2f7fdc; outline-offset: 2px; }

/* band 3: protected spans, drawn from station centre to station centre */
.sp-zone { grid-row: 3; grid-column: var(--a) / calc(var(--b) + 1); margin: 34px calc(var(--st) / 2) 0; position: relative; display: flex; justify-content: center; }
.sp-zone::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 12px; transform: translateY(-50%); border: 2px solid currentColor; border-top: 0; border-bottom: 0; }
.sp-zone::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); background: currentColor; }
.sp-zone.plant { color: #12804d; margin-right: calc(var(--st) / 2 + 6px); }
.sp-zone.enc { color: #2f7fdc; margin-left: calc(var(--st) / 2 + 6px); }
.sp-zone .sp-cp { position: relative; z-index: 1; padding: 0 8px; background: var(--paper); }
.sp-btn.zone { border: 0; background: transparent; padding: 4px 6px; color: inherit; font-size: .9rem; }
.sp-btn.zone:hover, .sp-btn.zone[aria-expanded="true"] { background: rgba(47,127,220,.08); }

/* tooltips */
.sp .ro-tip { left: 50%; margin-left: -135px; background: #0c1a2c; color: var(--on-board); }
.sp .ro-tip::before { left: calc(50% - 6px); background: #0c1a2c; }
.sp .sp-cp.end .ro-tip { left: auto; right: -20px; margin-left: 0; }
.sp .sp-cp.end .ro-tip::before { left: auto; right: 60px; }
.sp-cp:hover > .ro-tip, .sp-cp.open > .ro-tip, .sp-btn:focus-visible + .ro-tip { opacity: 1; transform: none; pointer-events: auto; }
.sp:has(.sp-cp:hover) .sp-cp:not(:hover) > .ro-tip,
.sp:has(.sp-btn:focus-visible) .sp-cp:not(:has(.sp-btn:focus-visible)) > .ro-tip { opacity: 0; transform: translateY(4px); pointer-events: none; }
.sp-cp:hover, .sp-cp.open { z-index: 7; }

/* ownership frames the whole path */
.sp-own { grid-row: 4; grid-column: 1 / -1; position: relative; margin-top: 30px; padding-top: 34px; text-align: center; }
.sp-own::before { content: ""; position: absolute; top: 0; left: calc(var(--st) / 2); right: calc(var(--st) / 2); height: 16px; border: 2px solid #2f7fdc; border-top: 0; border-radius: 0 0 14px 14px; }
.sp-own p { margin: 0; font-size: 1.05rem; line-height: 1.45; color: var(--muted); }
.sp-own strong { display: block; color: var(--ink); font-size: 1.2rem; font-weight: 700; }

@media (max-width: 860px) {
  /* one column: stations top to bottom, checkpoints under their station, spans as a short list */
  .sp { display: flex; flex-direction: column; align-items: center; }
  .sp-dot { display: none; }
  .sp-st, .sp-wire { order: calc(var(--col) * 10); }
  .sp > .sp-cp { order: calc(var(--col) * 10 + 1); }
  .sp-zone.plant { order: 21; }   /* right at its wire */
  .sp-zone.enc { order: 41; }
  .sp-own { order: 200; }
  .sp-wire { width: 3px; height: 28px; margin: 10px 0; }
  .sp > .sp-cp { margin: 10px 0 0; }
  .sp-zone, .sp-zone.plant, .sp-zone.enc { margin: 0 0 12px; width: 100%; max-width: 320px; }
  .sp-zone::before, .sp-zone::after { display: none; }
  .sp-zone .sp-cp { width: 100%; text-align: center; background: none; }
  .sp-btn.zone { border: 1px solid currentColor; padding: 7px 14px; border-radius: 999px; }
  .sp .ro-tip, .sp .sp-cp.end .ro-tip { position: static; width: min(300px, 80vw); margin: 8px auto 0; display: none; opacity: 1; transform: none; }
  .sp .ro-tip::before { display: none; }
  .sp-cp.open > .ro-tip, .sp-cp.open:hover > .ro-tip { display: block; }
  .sp-own::before { display: none; }
  .sp-own { margin-top: 36px; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .sp-dot { animation: none; opacity: 0; } }
