/* The IPsec decks' shared drawings (ipsec.js): terminals with marked parts, packets field by field,
   the IKE ladder, the NAT-then-crypto flowchart. Loads after ../company.css, before the deck's own stylesheet. */

.term mark { background: #5c4a12; color: #ffe08a; border-radius: 2px; }

/* A packet: one box per field, coloured by kind; brackets for what is encrypted and what the ICV covers. */
.pk { width: 100%; max-width: 820px; display: block; }
.pk.small { max-width: 640px; }
.pk .pf rect { fill: #fff; stroke: #8795a3; stroke-width: 1.5; }
.pk .pf-n { font: 700 13px system-ui, sans-serif; fill: var(--sv-ink); text-anchor: middle; }
.pk .pf-s { font: 11px var(--mono); fill: var(--sv-ink2); text-anchor: middle; }
.pk .f-new rect, .lg.f-new { fill: #e0ecff; background: #e0ecff; stroke: #1d4ed8; border-color: #1d4ed8; }
.pk .f-ip rect, .lg.f-ip { fill: #f1f5f9; background: #f1f5f9; stroke: #64748b; border-color: #64748b; }
.pk .f-data rect { fill: #f8fafc; stroke: #94a3b8; }
.pk .f-esp rect { fill: #ccfbf1; stroke: #0f766e; }
.pk .f-trl rect { fill: #ccfbf1; stroke: #0f766e; stroke-dasharray: 4 3; }
.pk .f-icv rect { fill: #ede9fe; stroke: #7c3aed; }
.pk .f-udp rect { fill: #fef3c7; stroke: #b45309; }
.pk .f-ah rect { fill: #fce7f3; stroke: #be185d; }
.pk .f-gre rect, .lg.f-gre { fill: #fff7ed; background: #fff7ed; stroke: #c2410c; border-color: #c2410c; }
.pk .pf.enc rect { fill: #fff4e0; stroke: #d97706; stroke-dasharray: 5 3; }
.pk .br path { fill: none; stroke-width: 2; }
.pk .br text { font: 700 12px system-ui, sans-serif; text-anchor: middle; }
.pk .br-enc path { stroke: #d97706; } .pk .br-enc text { fill: #b45309; }
.pk .br-auth path { stroke: #7c3aed; } .pk .br-auth text { fill: #6d28d9; }
.pk .pk-cap { font: 700 12.5px system-ui, sans-serif; fill: var(--sv-ink2); }
.pk-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.pk-legend .lg { border: 1.5px solid; border-radius: 5px; padding: 2px 10px; }

/* The IKE ladder. */
.lad { width: 100%; max-width: 640px; display: block; }
.lad .lad-life { stroke: #94a3b8; stroke-width: 2; stroke-dasharray: 4 4; }
.lad .lad-who { font: 700 13px system-ui, sans-serif; fill: var(--sv-ink); text-anchor: middle; }
.lad .lad-band { fill: #f8fafc; stroke: #cbd5e1; }
.lad .lad-band.ph1 { fill: #eff6ff; stroke: #93c5fd; }
.lad .lad-band.ph2 { fill: #f5f3ff; stroke: #c4b5fd; }
.lad .lad-band.ph3 { fill: #f0fdfa; stroke: #5eead4; }
.lad .lad-ph { font: 700 12.5px system-ui, sans-serif; fill: #334155; }
.lad .lad-ph.ph1 { fill: #1d4ed8; } .lad .lad-ph.ph2 { fill: #6d28d9; } .lad .lad-ph.ph3 { fill: #0f766e; }
.lad .lad-m text { font: 12px system-ui, sans-serif; fill: var(--sv-ink); text-anchor: middle; }
.lad .lad-m path { stroke: #475569; stroke-width: 2; fill: none; }
.lad .lad-m .hd { fill: #475569; stroke: none; }
.lad .lad-m.sec path { stroke: #6d28d9; stroke-dasharray: 7 3; } .lad .lad-m.sec .hd { fill: #6d28d9; stroke: none; }
.lad .lad-m.esp path { stroke: #0f766e; stroke-width: 3; } .lad .lad-m.esp .hd { fill: #0f766e; stroke: none; }
.lad .lad-sa rect { fill: #fff; stroke: #1d8102; stroke-width: 1.8; }
.lad .lad-sa text { font: 700 12px system-ui, sans-serif; fill: #1d8102; text-anchor: middle; }

/* The flowchart: a packet leaving R1, without and with the NAT exemption. */
.fc { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; }
.fc-col { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px; border-radius: 12px; border: 1.5px solid var(--sv-line); background: #fff; }
.fc-col h4 { margin: 0 0 4px; font-size: 14px; }
.fc-col.without h4 { color: var(--no); } .fc-col.with h4 { color: #1d8102; }
.fc-step { font-size: 13px; text-align: center; border: 1px solid #cbd5e1; border-radius: 6px; padding: 3px 10px; background: #f8fafc; width: 100%; }
.fc-step.bad { border-color: var(--no); color: #b42318; background: #fef3f2; }
.fc-step.warn { border-color: #d97706; background: #fffbeb; }
.fc-step.good { border-color: #1d8102; background: #f0fdf4; }
.fc-dec { font: 700 12px system-ui, sans-serif; color: #334155; background: #e2e8f0; padding: 2px 12px; border-radius: 4px; transform: skewX(-12deg); margin-top: 4px; }
.fc-arr { font-style: normal; color: var(--sv-ink2); line-height: 1; }
@media (max-width: 520px) { .fc { grid-template-columns: 1fr; } }
