/* ============================================================
   EnvisionSCADA Edge

   Part 1 (hv-eg-): the Edge section of the homepage. Loaded after home.css.
   Part 2 (ex-):    Pages/Edge.cshtml, a page that explains Edge in diagrams.
                    It loads site.css and this file, not home.css.
   ============================================================ */

/* ------------------------------------------------------------
   Part 1: homepage section
   ------------------------------------------------------------ */

/* The heading accent uses the solid light blue of "Edge" in the Edge page title (--ex-checkin). */
#edge.hv-light-alt .hv-gradient-text {
    background: none;
    color: #60a5fa;
    -webkit-text-fill-color: #60a5fa;
}

#edge.hv-light-alt .hv-check-list li { color: var(--hv-slate); }

/* The card is half the page wide, so the station names are drawn larger to stay readable. */
#edge .ex-fleet .ex-st-name { font-size: 22px; }

.hv-eg-diagram-note {
    margin: 1.4rem 0 0;
    color: #8fa3c0;
    font-size: 0.9rem;
    text-align: center;
}

/* ------------------------------------------------------------
   Part 2: Edge page
   One dark canvas. Each section is a large diagram with a short
   heading. Three colors run through every diagram, one per path:
   check-in (blue), history (violet), live values (teal).
   ------------------------------------------------------------ */

/* The colors also sit on the fleet graphic itself, which the homepage shows outside .ex. */
.ex,
.ex-fleet {
    --ex-bg: #070d1f;
    --ex-node: #101a36;
    --ex-node-line: #2a3a63;
    --ex-core: #14265a;
    --ex-core-line: #4f7df5;
    --ex-text: #f1f5f9;
    --ex-soft: #9fb0cc;
    --ex-dim: #6b7c9c;
    --ex-checkin: #60a5fa;
    --ex-history: #a78bfa;
    --ex-live: #2dd4bf;
    --ex-ok: #34d399;
    --ex-warn: #fbbf24;
    --ex-bad: #f87171;
}

.ex {
    background: var(--ex-bg);
    color: var(--ex-soft);
    overflow: hidden;
}

.ex-wrap {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

.ex-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.ex-svg text { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }

/* Shared diagram parts */

.ex-node { fill: var(--ex-node); stroke: var(--ex-node-line); stroke-width: 1.4; }
.ex-node-core { fill: var(--ex-core); stroke: var(--ex-core-line); stroke-width: 1.8; }
.ex-ghost { fill: #0d1730; stroke: #223258; stroke-width: 1.2; }
.ex-halo { fill: rgba(79, 125, 245, 0.1); animation: ex-breathe 3.6s ease-in-out infinite; }
.ex-row { fill: rgba(255, 255, 255, 0.04); }
.ex-wire { stroke: #1d2a4d; stroke-width: 1.4; }

.ex-t { fill: var(--ex-text); font-size: 15px; font-weight: 600; }
.ex-t-lg { font-size: 18px; font-weight: 700; }
.ex-t-xl { font-size: 28px; font-weight: 800; }
.ex-s { fill: var(--ex-soft); font-size: 13px; }

.ex-c-checkin { --c: var(--ex-checkin); }
.ex-c-history { --c: var(--ex-history); }
.ex-c-live { --c: var(--ex-live); }
.ex-c-ok { --c: var(--ex-ok); }
.ex-c-bad { --c: var(--ex-bad); }

tspan.ex-c-checkin, tspan.ex-c-history, tspan.ex-c-live { fill: var(--c); }

.ex-dot { fill: var(--c); filter: drop-shadow(0 0 6px var(--c)); }
.ex-dot-back { fill: var(--ex-bg); stroke: var(--ex-warn); stroke-width: 2; }
.ex-batch { fill: var(--c); filter: drop-shadow(0 0 5px var(--c)); }

.ex-lane { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; opacity: 0.55; }
.ex-lane-thin { stroke-width: 1.8; }
.ex-dash { stroke-dasharray: 7 7; }
.ex-head-tri { fill: var(--c); }

.ex-lane-t { font-size: 15px; font-weight: 700; }
.ex-lane-s { fill: var(--ex-soft); font-size: 13px; font-weight: 400; }

.ex-led { fill: var(--ex-ok); filter: drop-shadow(0 0 5px var(--ex-ok)); }
.ex-led-warn { fill: var(--ex-warn); filter: drop-shadow(0 0 5px var(--ex-warn)); animation: ex-blink 1.8s ease-in-out infinite; }

.ex-ok { fill: var(--ex-ok); }
.ex-bad { fill: var(--ex-bad); }
.ex-warn { fill: var(--ex-warn); }

.ex-chip { fill: rgba(255, 255, 255, 0.06); stroke: #2f4170; stroke-width: 1; }
.ex-chip-t { fill: #c8d5ea; font-size: 12px; font-weight: 500; }
.ex-chip-warm { fill: #2a2110; stroke: rgba(251, 191, 36, 0.6); }
.ex-chip-t-warm { fill: var(--ex-warn); font-weight: 600; }

.ex-x circle { fill: #2a1218; stroke: var(--ex-bad); stroke-width: 1.6; }
.ex-x path { fill: none; stroke: var(--ex-bad); stroke-width: 2.2; stroke-linecap: round; }

.ex-cert circle { fill: #0f2a22; stroke: var(--ex-ok); stroke-width: 1.6; }
.ex-cert path { fill: none; stroke: var(--ex-ok); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@keyframes ex-breathe {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes ex-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Opening graphic: outstation and server icons */

.ex-st-body { fill: var(--ex-node); stroke: #5f76ad; stroke-width: 1.6; }
.ex-st-ground { stroke: #3a4d7d; stroke-width: 1.6; stroke-linecap: round; }
.ex-st-pipe { stroke: #5f76ad; stroke-width: 3; }
.ex-st-vent { stroke: #5f76ad; stroke-width: 1.4; stroke-linecap: round; }
.ex-st-mast { stroke: #5f76ad; stroke-width: 1.6; stroke-linecap: round; }
.ex-st-tip { fill: var(--ex-live); }
.ex-st-wave { fill: none; stroke: var(--ex-live); stroke-width: 1.4; stroke-linecap: round; opacity: 0.7; animation: ex-blink 2.4s ease-in-out infinite; }
.ex-st-name { font-size: 13px; fill: #c8d5ea; }

.ex-srv-led { fill: var(--ex-checkin); animation: ex-blink 1.2s ease-in-out infinite; animation-delay: var(--d); }
.ex-srv-vent { stroke: #4f6bb8; stroke-width: 2; stroke-linecap: round; }
.ex-label-bg { fill: var(--ex-bg); opacity: 0.85; }

/* Opening */

.ex-hero {
    padding: 4.5rem 0 3rem;
    text-align: center;
    background: radial-gradient(ellipse 60% 50% at 50% 62%, rgba(79, 125, 245, 0.16), transparent 70%);
}

.ex-hero h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.4rem, 5.4vw, 4.2rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.ex-hero h1 span { color: var(--ex-checkin); }

.ex-sub {
    max-width: 620px;
    margin: 1.3rem auto 2.5rem;
    font-size: 1.1rem;
    line-height: 1.65;
}

/* Sections */

.ex-sec { padding: 5rem 0 1rem; }

.ex-sec:last-child { padding-bottom: 6rem; }

.ex-sec-next { padding-top: 1.5rem; }

.ex-head {
    max-width: 720px;
    margin: 0 auto 2.8rem;
    text-align: center;
}


.ex-head h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.ex-head h2 .ex-accent { color: var(--ex-checkin); }

.ex-head p {
    margin: 0.9rem 0 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.ex-cap {
    max-width: 760px;
    margin: 1.8rem auto 0;
    color: var(--ex-dim);
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: center;
}

.ex-cap strong { color: var(--ex-soft); font-weight: 600; }

/* Map screenshot with numbered pins */

.ex-map { margin: 0; }

.ex-map-frame {
    position: relative;
    border-radius: 18px;
    border: 1px solid #24345c;
    overflow: hidden;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(79, 125, 245, 0.08);
}

.ex-map-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.ex-map-pin,
.ex-map-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ex-core-line);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
}

.ex-map-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(79, 125, 245, 0.6);
    animation: ex-pin 2.2s ease-out infinite;
}

@keyframes ex-pin {
    0% { box-shadow: 0 0 0 0 rgba(79, 125, 245, 0.65); }
    70% { box-shadow: 0 0 0 16px rgba(79, 125, 245, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 125, 245, 0); }
}

.ex-map-keys {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.6rem 0 0;
    padding: 0;
    list-style: none;
}

.ex-map-keys li {
    padding: 1.2rem 1.3rem 1.3rem;
    border-radius: 18px;
    border: 1px solid var(--ex-node-line);
    background: var(--ex-node);
}

.ex-map-keys strong {
    display: block;
    margin: 0.8rem 0 0.3rem;
    color: var(--ex-text);
    font-size: 1.05rem;
}

.ex-map-keys li > span:last-child {
    display: block;
    font-size: 0.9rem;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .ex-map-keys { grid-template-columns: minmax(0, 1fr); }
    .ex-map-pin { width: 24px; height: 24px; font-size: 0.75rem; }
}

/* Fleet Manager window with edge device cards */

.ex-fm-window {
    border-radius: 20px;
    border: 1px solid #24345c;
    background: #0b1430;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(79, 125, 245, 0.08);
    overflow: hidden;
}

.ex-fm-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid #1c2947;
    background: #0e1938;
}

.ex-fm-dots { display: flex; gap: 6px; }
.ex-fm-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3a63; }
.ex-fm-dots i:nth-child(1) { background: #f87171; }
.ex-fm-dots i:nth-child(2) { background: #fbbf24; }
.ex-fm-dots i:nth-child(3) { background: #34d399; }

.ex-fm-title { color: var(--ex-dim); font-size: 0.85rem; }

.ex-fm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1.4rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid #1c2947;
    font-size: 0.92rem;
}

.ex-fm-project { display: inline-flex; align-items: center; gap: 0.5rem; }

.ex-fm-project svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--ex-checkin);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ex-fm-project strong,
.ex-fm-count strong { color: var(--ex-text); }

.ex-fm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-left: auto;
}

.ex-fm-btn {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid #2f4170;
    color: var(--ex-text);
    font-size: 0.88rem;
    font-weight: 600;
}

.ex-fm-deploy {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: var(--ex-core-line);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
}

.ex-fm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 1.4rem;
    list-style: none;
}

.ex-fm-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.8rem;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid #22325a;
    background: linear-gradient(180deg, #111d3e, #0d1733);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.ex-fm-card:hover { transform: translateY(-3px); border-color: #3b56a0; }

.ex-fm-device {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: radial-gradient(ellipse at 50% 60%, rgba(79, 125, 245, 0.14), transparent 70%);
}

.ex-fm-device svg { width: 150px; height: auto; overflow: visible; }

.ex-fm-meta strong { display: block; color: var(--ex-text); font-size: 1.05rem; }
.ex-fm-meta span { font-size: 0.85rem; color: var(--ex-dim); }

.ex-fm-hw {
    align-self: start;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #2f4170;
    color: #c8d5ea;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ex-fm-facts {
    display: flex;
    gap: 1.2rem;
    margin: 0.4rem 0 0;
    font-size: 0.82rem;
}

.ex-fm-facts dt { color: var(--ex-dim); }
.ex-fm-facts dd { margin: 0; color: var(--ex-text); font-weight: 600; }

.ex-fm-status {
    align-self: end;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.ex-fm-ok { background: rgba(52, 211, 153, 0.14); color: var(--ex-ok); }
.ex-fm-warn { background: rgba(251, 191, 36, 0.14); color: var(--ex-warn); }
.ex-fm-busy { background: rgba(96, 165, 250, 0.16); color: var(--ex-checkin); animation: ex-blink 1.6s ease-in-out infinite; }

/* Toolbar buttons are real buttons now */

.ex-fm-btn,
.ex-fm-deploy {
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ex-fm-btn { background: transparent; }
.ex-fm-btn:hover { border-color: var(--ex-checkin); background: rgba(96, 165, 250, 0.08); }
.ex-fm-deploy { border: 0; }
.ex-fm-deploy:hover { background: #6b91f7; }
.ex-fm-btn:active,
.ex-fm-deploy:active { transform: scale(0.97); }

.ex-fm-window { position: relative; }

/* Dialogs inside the Fleet Manager window */

.ex-fm-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: rgba(4, 8, 20, 0.66);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.ex-fm-overlay[hidden],
.ex-fm-overlay [hidden] { display: none !important; }
.ex-fm-overlay.is-open { opacity: 1; }

.ex-fm-dialog {
    width: min(560px, 100%);
    max-height: 100%;
    overflow: auto;
    padding: 1.3rem 1.4rem 1.2rem;
    border-radius: 18px;
    border: 1px solid #2f4170;
    background: #0e1938;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    transform: translateY(14px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.ex-fm-dialog-wide { width: min(720px, 100%); }
.ex-fm-dialog[hidden] { display: none; }
.is-open .ex-fm-dialog { transform: none; opacity: 1; }

.ex-fm-dhead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ex-fm-dhead h3 { margin: 0; color: #ffffff; font-size: 1.2rem; font-weight: 800; }
.ex-fm-dhead p { margin: 0.2rem 0 0; font-size: 0.88rem; }
.ex-fm-dhead strong { color: var(--ex-text); }

.ex-fm-x {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid #2f4170;
    background: transparent;
    color: var(--ex-soft);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.ex-fm-x:hover { color: #ffffff; border-color: var(--ex-checkin); }

.ex-fm-label {
    margin: 1rem 0 0.5rem;
    color: var(--ex-dim);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ex-fm-versions { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; }

.ex-fm-version {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem 0.8rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border: 1px solid #22325a;
    background: #111d3e;
    cursor: pointer;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ex-fm-version:hover { border-color: #3b56a0; }
.ex-fm-version:has(input:checked) { border-color: var(--ex-core-line); background: #15265a; }
.ex-fm-version input { accent-color: var(--ex-core-line); margin: 0; }
.ex-fm-vno { color: var(--ex-text); font-weight: 700; white-space: nowrap; }
.ex-fm-vnote { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-fm-vdate { color: var(--ex-dim); font-size: 0.8rem; white-space: nowrap; }

.ex-fm-vtag {
    grid-column: 2 / 3;
    justify-self: start;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.14);
    color: var(--ex-ok);
    font-size: 0.7rem;
    font-weight: 700;
}

.ex-fm-nodes { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.ex-fm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #2f4170;
    color: var(--ex-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.ex-fm-chip input { accent-color: var(--ex-core-line); margin: 0; }
.ex-fm-chip:has(input:checked) { border-color: var(--ex-core-line); background: rgba(79, 125, 245, 0.14); }

.ex-fm-check {
    margin: 1rem 0 0;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.08);
    color: #a7f3d0;
    font-size: 0.86rem;
    line-height: 1.5;
    animation: ex-fm-in 0.25s ease;
}

.ex-fm-check.is-empty { border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.08); color: #fde68a; }

.ex-fm-dfoot {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.3rem;
}

.ex-fm-ca {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(52, 211, 153, 0.07);
    font-size: 0.86rem;
}

.ex-fm-ca svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: var(--ex-ok); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ex-fm-ca strong { color: var(--ex-text); }

.ex-fm-tablewrap { overflow-x: auto; }

.ex-fm-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

.ex-fm-table th {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #22325a;
    color: var(--ex-dim);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.ex-fm-table td {
    padding: 0.65rem 0.6rem;
    border-bottom: 1px solid #18244a;
    white-space: nowrap;
}

.ex-fm-table td strong { color: var(--ex-text); }
.ex-fm-table tr:last-child td { border-bottom: 0; }

.ex-fm-mini {
    margin-left: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #2f4170;
    background: transparent;
    color: var(--ex-text);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.ex-fm-mini:hover { border-color: var(--ex-checkin); }

.ex-fm-addform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem 0.9rem; }
.ex-fm-addform .ex-fm-label { grid-column: 1 / -1; margin: 0.4rem 0 -0.2rem; }

.ex-fm-field { display: grid; gap: 0.3rem; font-size: 0.8rem; }

.ex-fm-field input,
.ex-fm-field select {
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 10px;
    border: 1px solid #2f4170;
    background: #0a1228;
    color: var(--ex-text);
    font: inherit;
    font-size: 0.9rem;
}

.ex-fm-field input:focus,
.ex-fm-field select:focus { outline: none; border-color: var(--ex-checkin); box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2); }

.ex-fm-error { grid-column: 1 / -1; margin: 0; color: var(--ex-bad); font-size: 0.82rem; }

.ex-fm-done {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 14px;
    background: rgba(52, 211, 153, 0.08);
    animation: ex-fm-in 0.3s ease;
}

.ex-fm-done[hidden] { display: none; }
.ex-fm-done svg { width: 38px; height: 38px; flex-shrink: 0; fill: none; stroke: var(--ex-ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ex-fm-done p { margin: 0; font-size: 0.92rem; line-height: 1.55; }
.ex-fm-done strong { color: var(--ex-text); }

/* A card that just changed: a short glow */
.ex-fm-card.is-updating { border-color: var(--ex-checkin); box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.4), 0 0 30px rgba(96, 165, 250, 0.18); }
.ex-fm-card.is-new { animation: ex-fm-new 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes ex-fm-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes ex-fm-new {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 620px) {
    .ex-fm-addform { grid-template-columns: minmax(0, 1fr); }
    .ex-fm-version { grid-template-columns: auto minmax(0, 1fr); }
    .ex-fm-vnote, .ex-fm-vdate { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
    .ex-fm-overlay, .ex-fm-dialog { transition: none; }
}

/* Device drawings */

.ex-hw-board { fill: #16305a; stroke: #4f7df5; stroke-width: 1.6; }
.ex-hw-box { fill: #1a2748; stroke: #7d93c6; stroke-width: 1.6; }
.ex-hw-sink { fill: #1a2748; stroke: #7d93c6; stroke-width: 1.4; }
.ex-hw-rail { fill: #3a4d7d; }
.ex-hw-chip { fill: #0a1228; stroke: #7d93c6; stroke-width: 1.2; }
.ex-hw-chip-s { fill: #0a1228; stroke: #5f76ad; stroke-width: 1; }
.ex-hw-port { fill: #0a1228; stroke: #9fb0cc; stroke-width: 1.2; }
.ex-hw-port-s { fill: #0a1228; stroke: #5f76ad; stroke-width: 1; }
.ex-hw-pin { fill: #fbbf24; opacity: 0.8; }
.ex-hw-fin { stroke: #5f76ad; stroke-width: 1.6; stroke-linecap: round; }
.ex-hw-fan { fill: #0a1228; stroke: #7d93c6; stroke-width: 1.4; }
.ex-hw-led { fill: var(--ex-ok); filter: drop-shadow(0 0 4px var(--ex-ok)); }
.ex-hw-led-b { fill: var(--ex-checkin); filter: drop-shadow(0 0 4px var(--ex-checkin)); animation: ex-blink 1.1s ease-in-out infinite; }

@media (max-width: 1080px) {
    .ex-fm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .ex-fm-grid { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
    .ex-fm-actions { margin-left: 0; }
}

.ex-facts,
.ex-tiles,
.ex-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 2.4rem 0 0;
    padding: 0;
    list-style: none;
}

.ex-facts li,
.ex-tiles li {
    padding: 1.3rem 1.3rem 1.4rem;
    border-radius: 18px;
    border: 1px solid var(--ex-node-line);
    background: var(--ex-node);
}

.ex-facts svg,
.ex-tiles svg {
    display: block;
    width: 26px;
    height: 26px;
    margin-bottom: 0.9rem;
    fill: none;
    stroke: var(--ex-checkin);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ex-tiles svg { width: 34px; height: 34px; stroke: var(--ex-live); }

.ex-facts strong,
.ex-tiles strong {
    display: block;
    color: var(--ex-text);
    font-size: 1.05rem;
    font-weight: 700;
}

.ex-facts span,
.ex-tiles span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Link state toggle */

.ex-toggle { margin: -1.2rem 0 2rem; text-align: center; }

.ex-toggle button {
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    border: 1.5px solid var(--ex-bad);
    background: rgba(248, 113, 113, 0.1);
    color: #fecaca;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ex-toggle button:hover { background: rgba(248, 113, 113, 0.2); }

.ex-toggle { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }

.ex-toggle .ex-deploy-btn {
    border-color: var(--ex-checkin);
    background: rgba(96, 165, 250, 0.12);
    color: #dbeafe;
}

.ex-toggle .ex-deploy-btn:hover { background: rgba(96, 165, 250, 0.22); }
.ex-toggle .ex-deploy-btn.is-busy { cursor: default; opacity: 0.75; }
.is-down .ex-toggle .ex-deploy-btn { cursor: default; opacity: 0.45; }

.ex-toggle button[aria-pressed="true"] {
    border-color: var(--ex-ok);
    background: rgba(52, 211, 153, 0.1);
    color: #a7f3d0;
}

.ex-cut { opacity: 0; transition: opacity 0.25s ease; }
.ex-cut circle { fill: #2a1218; stroke: var(--ex-bad); stroke-width: 2; }
.ex-cut path { fill: none; stroke: var(--ex-bad); stroke-width: 3; stroke-linecap: round; }

.ex-link-line { transition: stroke 0.25s ease; }
.ex-when-down { opacity: 0; }
.ex-when-up, .ex-when-down { transition: opacity 0.25s ease; }

.is-down .ex-cut { opacity: 1; }

/* The secure-by-design diagram when the link is cut: every lane breaks. */
#paths.is-down .ex-lane { stroke: var(--ex-bad); stroke-dasharray: 7 9; }
#paths.is-down .ex-head-tri { fill: var(--ex-bad); }
#paths.is-down .ex-dot,
#paths.is-down .ex-dot-back,
#paths.is-down .ex-batch,
#paths.is-down .ex-pkg-dl { display: none; }

.ex-run-pill { fill: rgba(52, 211, 153, 0.16); stroke: rgba(52, 211, 153, 0.55); stroke-width: 1; }
.ex-run-text { fill: var(--ex-ok); font-size: 12px; font-weight: 700; }

.ex-pkg-dl { opacity: 0; }
.ex-pkg-dl rect { fill: var(--ex-checkin); filter: drop-shadow(0 0 8px var(--ex-checkin)); }
.ex-pkg-dl text { fill: var(--ex-bg); font-size: 12px; font-weight: 800; }

.ex-cap-down { display: none; }
.is-down .ex-cap-up { display: none; }
.is-down .ex-cap-down { display: inline; }
.is-down .ex-link-line { stroke: var(--ex-bad); stroke-dasharray: 7 9; }
.is-down .ex-link-dot { display: none; }
.is-down .ex-when-up { opacity: 0; }
.is-down .ex-when-down { opacity: 1; }

/* Platform */

.ex-stats { margin-top: 3.5rem; text-align: left; }

.ex-stats li {
    padding: 0 1rem 0 1.2rem;
    border-left: 2px solid var(--ex-core-line);
}

.ex-stats strong {
    display: block;
    color: #ffffff;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.ex-stats em {
    color: var(--ex-dim);
    font-size: 0.55em;
    font-style: normal;
    font-weight: 500;
}

.ex-stats span {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.ex-next {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 3rem;
}

/* .landing-page main a:not(.landing-button) in site.css sets links to inherit, so these need .landing-page .ex to win. */
.landing-page .ex .ex-next a {
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    border: 1px solid var(--ex-node-line);
    color: var(--ex-text);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.landing-page .ex .ex-next a:hover { border-color: var(--ex-checkin); }

.landing-page .ex .ex-next a.ex-next-main {
    border-color: var(--ex-core-line);
    background: var(--ex-core-line);
    color: #ffffff;
}

@media (max-width: 900px) {
    .ex-facts,
    .ex-tiles,
    .ex-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .ex-stats { gap: 2rem 1rem; }
}

@media (max-width: 720px) {
    .ex-hero { padding-top: 3rem; }
    .ex-sec { padding-top: 3.5rem; }

    /* The wide diagrams keep a readable size and scroll sideways. The opening
       graphic has no small text, so it scales down to fit instead. */
    .ex-sec > .ex-wrap > .ex-svg {
        min-width: 760px;
    }

    .ex-sec > .ex-wrap {
        overflow-x: auto;
    }

    .ex-fleet .ex-st-name { font-size: 17px; }

    .ex-head,
    .ex-cap,
    .ex-toggle,
    .ex-facts,
    .ex-tiles,
    .ex-stats,
    .ex-next,
    .ex-hero h1,
    .ex-sub {
        position: sticky;
        left: 0;
    }

    .ex-facts,
    .ex-tiles { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ex-halo,
    .ex-led-warn,
    .ex-st-wave,
    .ex-srv-led,
    .ex-fm-busy,
    .ex-hw-led-b { animation: none; }
}
