/* Nebula scenarios: one pinned scene per device */

/* ---------- Page ---------- */
.sc { position: relative; background: #14162a; }

.sc-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: #14162a;
}
.sc-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.sc-stage.has-side .sc-svg { inset: auto; left: 0; top: 50%; width: 70%; height: auto; aspect-ratio: 16 / 9; transform: translateY(-50%); }

/* ---------- Chapter navigation ---------- */
.sc-nav {
    position: fixed;
    right: 18px;
    top: 50%;
    z-index: 40;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sc-nav.show { opacity: 1; pointer-events: auto; }
.sc-nav a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: rgba(255, 255, 255, 0.55); font-size: 0.74rem; font-weight: 600; text-decoration: none; }
.sc-nav a span { padding: 4px 10px; border-radius: 999px; background: rgba(26, 26, 46, 0.85); border: 1px solid rgba(155, 139, 244, 0.3); opacity: 0; transform: translateX(6px); transition: opacity 0.2s ease, transform 0.2s ease; white-space: nowrap; }
.sc-nav a:hover span, .sc-nav a.active span { opacity: 1; transform: none; }
.sc-nav a i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); transition: background 0.2s ease, transform 0.2s ease; }
.sc-nav a.active { color: #fff; }
.sc-nav a.active i { background: #9B8BF4; transform: scale(1.4); box-shadow: 0 0 10px #9B8BF4; }

/* ---------- Zones (as on the app's floor map) ---------- */
.nb-zone { opacity: 0; transition: opacity 0.4s ease; pointer-events: none; }
.nb-zone.on { opacity: 1; }
.nb-zone-box { fill: rgba(155, 139, 244, 0.05); stroke: #9B8BF4; stroke-width: 2; stroke-dasharray: 10 7; }
.nb-zone-name { fill: #B8ABF7; font: 700 13px 'DM Sans', sans-serif; letter-spacing: 0.06em; }
.nb-zone-badge { fill: #4b3a78; stroke: #9B8BF4; stroke-width: 1.5; }
.nb-zone-count { fill: #fff; font: 700 15px 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- Reader field ---------- */
.nb-field { opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.nb-field.on { opacity: 1; }
.nb-fring { fill: none; stroke: #9B8BF4; stroke-width: 2.5; transform-box: fill-box; transform-origin: center; opacity: 0; }
.nb-field.on .nb-fring { animation: nb-fring 1.9s ease-out infinite; }
.nb-field.on .nb-fring-2 { animation-delay: 0.63s; }
.nb-field.on .nb-fring-3 { animation-delay: 1.26s; }
@keyframes nb-fring { 0% { transform: scale(0.25); opacity: 0.9; } 100% { transform: scale(4.6); opacity: 0; } }

/* ---------- Tags ---------- */
.nb-tag .nb-dot, .nb-tag .nb-ring, .nb-tag .nb-flash { transform-box: fill-box; transform-origin: center; }
.nb-tag .nb-dot { fill: #9B8BF4; stroke: #fff; stroke-width: 1.5; transform: scale(0); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.25s ease; }
.nb-tag .nb-ring { fill: none; stroke: #9B8BF4; stroke-width: 2; opacity: 0; }
.nb-tag .nb-flash { fill: none; stroke: #fff; stroke-width: 2.5; opacity: 0; }
.nb-tag.present .nb-dot { fill: #4cc38a; } .nb-tag.present .nb-ring { stroke: #4cc38a; }
.nb-tag.unexpected .nb-dot, .nb-tag.warn .nb-dot { fill: #ff9f43; } .nb-tag.unexpected .nb-ring, .nb-tag.warn .nb-ring { stroke: #ff9f43; }
.nb-tag.bad .nb-dot { fill: #ff6b6b; } .nb-tag.bad .nb-ring { stroke: #ff6b6b; }
.nb-tag.stale .nb-dot { fill: #8f8aa8; } .nb-tag.stale .nb-ring { stroke: #8f8aa8; }
.nb-tag.on .nb-dot { transform: scale(1); }
.nb-tag.on .nb-ring { animation: nb-ping 2.2s ease-out infinite; }
.nb-tag.on .nb-flash { animation: nb-flash 0.7s ease-out 1; }
@keyframes nb-ping { 0% { transform: scale(0.8); opacity: 0.9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes nb-flash { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(4.5); opacity: 0; } }

/* ---------- Data cards ---------- */
.nb-card { opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.nb-card.on { opacity: 1; }
.nb-card line { stroke: #9B8BF4; stroke-width: 1.5; }
.nb-card-in { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0.6); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.nb-card.on .nb-card-in { transform: scale(1); }
.nb-card-in rect { fill: rgba(26, 26, 46, 0.96); stroke: #9B8BF4; stroke-width: 1.5; }
.nb-card-title { fill: #fff; font: 700 15px 'DM Sans', sans-serif; }
.nb-card-epc { fill: #B8ABF7; font: 500 12px 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.nb-card-chip { fill: #7ee2a8; font: 700 12px 'DM Sans', sans-serif; }
.nb-card-chip.progress { fill: #6fb3ff; } .nb-card-chip.closed, .nb-card-chip.warn { fill: #ffb454; } .nb-card-chip.bad { fill: #ff8585; }
.nb-card-loc { fill: #9a95b4; font: 500 11.5px 'DM Sans', sans-serif; }

/* ---------- Characters ---------- */
.nb-bob { animation: nb-bob 0.9s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes nb-bob { 50% { transform: translateY(-2px); } }
.nb-beacon { animation: nb-beacon 1s steps(2, jump-none) infinite; }
.nb-beacon-glow { animation: nb-beacon-glow 1s ease-in-out infinite; }
@keyframes nb-beacon { 0% { opacity: 1; } 50% { opacity: 0.35; } 100% { opacity: 1; } }
@keyframes nb-beacon-glow { 0% { opacity: 0.35; } 50% { opacity: 0; } 100% { opacity: 0.35; } }

/* ---------- HUD ---------- */
.sc-hud { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 96px 40px 26px; pointer-events: none; }
.sc-hud::before, .sc-hud::after { content: ''; position: absolute; left: 0; right: 0; pointer-events: none; }
.sc-hud::before { top: 0; height: 260px; background: linear-gradient(180deg, rgba(14, 15, 32, 0.92) 0%, rgba(14, 15, 32, 0) 100%); }
.sc-hud::after { bottom: 0; height: 130px; background: linear-gradient(0deg, rgba(14, 15, 32, 0.95) 0%, rgba(14, 15, 32, 0.55) 60%, rgba(14, 15, 32, 0) 100%); }
.sc-top, .sc-bottom { position: relative; z-index: 1; }
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }

.sc-caps { position: relative; flex: 1 1 auto; max-width: 560px; min-height: 150px; }
.sc-device { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 7px 16px; border-radius: 999px; background: rgba(26, 26, 46, 0.82); border: 1px solid rgba(155, 139, 244, 0.35); color: #fff; font-size: 0.82rem; }
.sc-device b { font-weight: 700; letter-spacing: 0.02em; }
.sc-device em { font-style: normal; opacity: 0.6; }
.sc-device em::before { content: '· '; }
.sc-cap { position: absolute; inset: 52px auto auto 0; margin: 0; font-size: clamp(1.5rem, 3.1vw, 2.5rem); font-weight: 700; line-height: 1.1; color: #fff; text-shadow: 0 2px 24px rgba(10, 10, 25, 0.9); opacity: 0; transform: translateY(14px); transition: opacity 0.45s ease, transform 0.45s ease; }
.sc-kicker { display: block; margin-bottom: 8px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-primary-light); }
.sc-stage[data-phase="0"] .sc-cap[data-for="0"],
.sc-stage[data-phase="1"] .sc-cap[data-for="1"],
.sc-stage[data-phase="2"] .sc-cap[data-for="2"],
.sc-stage[data-phase="3"] .sc-cap[data-for="3"] { opacity: 1; transform: none; }

.sc-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 420px; padding-right: 26px; }
.sc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; color: #fff; background: rgba(26, 26, 46, 0.82); border: 1px solid rgba(155, 139, 244, 0.3); backdrop-filter: blur(10px); white-space: nowrap; transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease; }
.sc-chip i { width: 8px; height: 8px; border-radius: 50%; background: #9B8BF4; }
.sc-chip[data-state="ok"] { border-color: #4cc38a; background: rgba(76, 195, 138, 0.16); color: #7ee2a8; }
.sc-chip[data-state="ok"] i { background: #4cc38a; box-shadow: 0 0 8px #4cc38a; }
.sc-chip[data-state="bad"] { border-color: #ff6b6b; background: rgba(255, 107, 107, 0.14); color: #ff9a9a; }
.sc-chip[data-state="bad"] i { background: #ff6b6b; }
.sc-chip[data-state="warn"] { border-color: #ff9f43; background: rgba(255, 159, 67, 0.14); color: #ffb454; }
.sc-chip[data-state="warn"] i { background: #ff9f43; }
.sc-chip[data-state="info"] { border-color: #6fb3ff; background: rgba(111, 179, 255, 0.14); color: #8cc3ff; }

.sc-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.sc-kpis { display: flex; gap: 8px; flex: none; }
.sc-kpi { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 104px; height: 78px; padding: 0 14px; border-radius: 12px; background: rgba(26, 26, 46, 0.84); border: 1.5px solid rgba(155, 139, 244, 0.4); backdrop-filter: blur(10px); color: #fff; }
.sc-kpi b { font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--color-primary-light); }
.sc-kpi span { font-size: 0.72rem; opacity: 0.75; letter-spacing: 0.03em; text-align: center; }
.sc-kpi[data-tone="white"] b { color: #fff; }
.sc-kpi[data-tone="green"] { border-color: rgba(76, 195, 138, 0.7); background: rgba(76, 195, 138, 0.14); } .sc-kpi[data-tone="green"] b { color: #7ee2a8; }
.sc-kpi[data-tone="red"] { border-color: rgba(255, 107, 107, 0.7); background: rgba(255, 107, 107, 0.14); } .sc-kpi[data-tone="red"] b { color: #ff9a9a; }
.sc-kpi[data-tone="orange"] { border-color: rgba(255, 159, 67, 0.7); background: rgba(255, 159, 67, 0.14); } .sc-kpi[data-tone="orange"] b { color: #ffb454; }
.sc-kpi[data-tone="blue"] { border-color: rgba(111, 179, 255, 0.7); background: rgba(111, 179, 255, 0.14); } .sc-kpi[data-tone="blue"] b { color: #8cc3ff; }

.sc-feed { list-style: none; margin: 0; padding: 0; width: min(100%, 470px); flex: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: #fff; }
.sc-feed li { display: grid; grid-template-columns: 10px minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; background: rgba(26, 26, 46, 0.8); border: 1px solid rgba(155, 139, 244, 0.22); backdrop-filter: blur(10px); white-space: nowrap; }
.sc-feed li:nth-child(2) { opacity: 0.6; }
.sc-feed li i { width: 8px; height: 8px; border-radius: 50%; background: #9B8BF4; box-shadow: 0 0 8px #9B8BF4; }
.sc-feed li i.ok { background: #4cc38a; box-shadow: 0 0 8px #4cc38a; }
.sc-feed li i.bad { background: #ff6b6b; box-shadow: 0 0 8px #ff6b6b; }
.sc-feed li i.warn { background: #ff9f43; box-shadow: 0 0 8px #ff9f43; }
.sc-feed li i.mute { background: #8f8aa8; box-shadow: none; }
.sc-feed li b { overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.sc-feed li span { overflow: hidden; text-overflow: ellipsis; color: var(--color-primary-light); }
.sc-feed li em { font-style: normal; font-variant-numeric: tabular-nums; opacity: 0.6; font-size: 0.74rem; }
.sc-feed li.new { animation: nb-feed-in 0.35s ease-out; }
.sc-feed-empty { display: flex !important; opacity: 0.7; }
.sc-feed-empty i { animation: nb-blink 1.2s ease-in-out infinite; }
@keyframes nb-feed-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nb-blink { 50% { opacity: 0.25; } }

/* ---------- Side column (phone mock) ---------- */
.sc-side { position: absolute; top: 0; right: 0; bottom: 0; width: 30%; display: none; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.sc-stage.has-side .sc-side { display: flex; }

.phone { position: relative; width: min(250px, 80%); aspect-ratio: 9 / 18.2; padding: 10px; border-radius: 34px; background: #0b0c1a; border: 2px solid #3a3d52; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(155, 139, 244, 0.08); margin-top: 46px; }
.ph-notch { position: absolute; top: 12px; left: 50%; width: 70px; height: 16px; border-radius: 10px; background: #0b0c1a; transform: translateX(-50%); z-index: 2; }
.ph-screen { height: 100%; padding: 28px 12px 12px; border-radius: 26px; background: #f6f5fa; color: #1b1330; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ph-bar { display: flex; justify-content: center; font-size: 0.78rem; letter-spacing: 0.04em; }
.ph-chips { display: flex; gap: 6px; }
.ph-chip { padding: 3px 9px; border-radius: 999px; background: #fff; border: 1px solid #ddd8ea; font-size: 0.64rem; font-weight: 700; color: #6b5a9e; }
.ph-chip[data-on="1"] { background: #e7f6ee; border-color: #8fd3ad; color: #2e8b5c; }
.ph-chip[data-on="0"] { background: #fdeaea; border-color: #f0a5a5; color: #c24444; }
.ph-zone { font-size: 0.7rem; font-weight: 600; color: #7766aa; }
.ph-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ph-stats div { padding: 8px 6px; border-radius: 12px; background: #fff; border: 1px solid #e6e1f1; text-align: center; }
.ph-stats b { display: block; font-size: 1.35rem; line-height: 1.1; color: #7766aa; font-variant-numeric: tabular-nums; }
.ph-stats span { font-size: 0.6rem; color: #7d7690; }
.ph-list-title { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 700; }
.ph-list-title em { font-style: normal; padding: 1px 7px; border-radius: 999px; background: #ebe6f6; color: #7766aa; font-size: 0.62rem; }
.ph-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.ph-list li { position: relative; padding: 7px 8px; border-radius: 10px; background: #fff; border: 1px solid #e6e1f1; font-size: 0.6rem; }
.ph-list li b { display: block; font-size: 0.64rem; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.ph-list li span { color: #7d7690; }
.ph-list li i { position: absolute; top: 7px; right: 8px; font-style: normal; padding: 1px 6px; border-radius: 999px; background: #e7f6ee; color: #2e8b5c; font-weight: 700; font-size: 0.56rem; }
.ph-btn { padding: 10px; border-radius: 14px; background: #7766aa; color: #fff; text-align: center; font-size: 0.78rem; font-weight: 700; transition: background 0.3s ease; }
.ph-btn[data-state="run"] { background: #c24444; }
.ph-btn[data-state="done"] { background: #2e8b5c; }

@media (max-width: 1100px) {
    .sc-feed { display: none; }
}
@media (max-width: 900px) {
    .sc-stage.has-side .sc-svg { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: none; }
    .sc-stage.has-side .sc-side { display: none; }
    .sc-nav { display: none; }
}
@media (max-width: 760px) {
    .sc-hud { padding: 84px 16px 18px; }
    .sc-top { flex-direction: column; }
    .sc-chips { justify-content: flex-start; padding-right: 0; }
    .sc-kpis { width: 100%; }
    .sc-kpi { min-width: 0; flex: 1; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .nb-tag.on .nb-ring, .nb-tag.on .nb-flash, .nb-bob, .nb-beacon, .nb-beacon-glow, .nb-field.on .nb-fring { animation: none; }
    .nb-tag .nb-dot, .nb-card, .nb-card-in, .sc-cap, .nb-zone { transition: none; }
}

/* ---------- Scene 2: POI ---------- */
.nb-dim { filter: grayscale(1) brightness(0.55); transition: filter 0.5s ease; }
.nb-led { fill: #9B8BF4; opacity: 0.3; transition: opacity 0.3s ease; }
.nb-led.on { opacity: 1; }
.nb-arc { fill: none; stroke: #9B8BF4; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.nb-arcs.on .nb-arc { animation: nb-arc 1.5s ease-out infinite; }
.nb-arcs.on .nb-arc-2 { animation-delay: 0.25s; }
.nb-arcs.on .nb-arc-3 { animation-delay: 0.5s; }
@keyframes nb-arc { 0% { opacity: 0; } 30% { opacity: 0.95; } 100% { opacity: 0; } }
.nb-conf { fill: none; stroke: #ffb454; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.nb-conf.ok { stroke: #4cc38a; }

.sc-gauge { flex: 1 1 auto; max-width: 340px; padding: 12px 14px; border-radius: 12px; background: rgba(26, 26, 46, 0.86); border: 1.5px solid rgba(155, 139, 244, 0.4); backdrop-filter: blur(10px); color: #fff; opacity: 0; transform: translateY(8px); transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.3s ease; }
.sc-gauge.show { opacity: 1; transform: none; }
.sc-gauge-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.74rem; }
.sc-gauge-head span { opacity: 0.6; font-variant-numeric: tabular-nums; }
.sc-gauge-bar { position: relative; height: 10px; margin: 20px 0 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); }
.sc-gauge-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: #ffb454; transition: background 0.25s ease; }
.sc-gauge-bar i[data-ok="1"] { background: #4cc38a; }
.sc-gauge-bar u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; }
.sc-gauge-bar u::after { content: 'threshold'; position: absolute; top: -15px; left: -22px; font: 600 9px 'DM Sans', sans-serif; text-decoration: none; opacity: 0.7; }
.sc-gauge-foot { display: flex; justify-content: space-between; font-size: 0.74rem; }
.sc-gauge-foot em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-gauge[data-tone="ok"] { border-color: #4cc38a; } .sc-gauge[data-tone="warn"] { border-color: #ffb454; } .sc-gauge[data-tone="info"] { border-color: #6fb3ff; }
@media (max-width: 900px) { .sc-gauge { display: none; } }

/* ---------- Scene 3: SkyGate ---------- */
.gate-lamp { opacity: 0.22; }
.gate-lamp.on { opacity: 1; }
.gate-lamp.blink { animation: nb-lamp 0.9s ease-in-out infinite; }
.gate-lamp-glow { opacity: 0; }
.gate-lamp-glow.on { opacity: 0.25; }
.gate-lamp-glow.blink { animation: nb-lamp-glow 0.9s ease-in-out infinite; }
@keyframes nb-lamp { 50% { opacity: 1; } 0%, 100% { opacity: 0.25; } }
@keyframes nb-lamp-glow { 50% { opacity: 0.25; } 0%, 100% { opacity: 0; } }
.gate-dot { fill: #5a5670; stroke: #fff; stroke-width: 1; transition: fill 0.25s ease; }
.gate-dot[data-s="1"] { fill: #9B8BF4; }
.gate-dot[data-s="2"] { fill: #4cc38a; }
.sc-chart { max-width: 360px; }
.sc-chart svg { display: block; margin-top: 8px; }
.sc-chart .sc-gauge-head span { display: flex; align-items: center; gap: 6px; }
.sc-chart .sc-gauge-head i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.sc-chart .sc-gauge-foot { margin-top: 6px; }

/* ---------- Scene 4: RFID Tunnel ---------- */
.gate-dot[data-s="3"] { fill: #8f8aa8; }
.gate-dot[data-s="4"] { fill: #ff9f43; }
.tn-ghost { fill: rgba(255, 107, 107, 0.15); stroke: #ff6b6b; stroke-width: 2; stroke-dasharray: 3 3; }
.tn-cell { fill: #ff4d4d; opacity: 0.55; }
.tn-cell.on { fill: #3AAA35; opacity: 1; }
.tn-count { fill: #fff; font: 700 15px 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #14162a; stroke-width: 4px; }
.tn-pr { fill: rgba(76, 195, 138, 0.22); stroke: #4cc38a; stroke-width: 1.5; }
.tn-pr.bad { fill: rgba(255, 107, 107, 0.22); stroke: #ff6b6b; }
.tn-pr.ne { fill: rgba(143, 138, 168, 0.25); stroke: #8f8aa8; }
.tn-pt { fill: #7ee2a8; font: 700 13px 'DM Sans', sans-serif; }
.tn-pt.bad { fill: #ff9a9a; } .tn-pt.ne { fill: #c9c4dc; }
.tn-hmi-num { fill: #2fcf94; font: 700 46px 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; }
.tn-lamp { transition: opacity 0.2s ease; }

/* ---------- Scene 6: Diagnostic Center ---------- */
.fl-edge { stroke: #8f8aa8; stroke-width: 2.5; stroke-dasharray: 6 8; opacity: 0.45; transition: stroke 0.3s ease, opacity 0.3s ease; }
.fl-edge[data-st="ok"] { stroke: #9B8BF4; opacity: 0.8; stroke-dasharray: none; }
.fl-edge[data-st="warn"] { stroke: #ff9f43; opacity: 0.9; }
.fl-edge[data-st="bad"] { stroke: #ff6b6b; opacity: 0.9; }
.fl-card { fill: rgba(26, 26, 46, 0.96); stroke: #3a3d52; stroke-width: 2; transition: stroke 0.3s ease; }
.fl-node[data-st="ok"] .fl-card { stroke: #4cc38a; }
.fl-node[data-st="warn"] .fl-card { stroke: #ff9f43; }
.fl-node[data-st="bad"] .fl-card { stroke: #ff6b6b; }
.fl-led { fill: #8f8aa8; transition: fill 0.3s ease; }
.fl-node[data-st="ok"] .fl-led { fill: #4cc38a; }
.fl-node[data-st="warn"] .fl-led { fill: #ff9f43; }
.fl-node[data-st="bad"] .fl-led { fill: #ff6b6b; }
.fl-name { fill: #fff; font: 700 18px 'DM Sans', sans-serif; }
.fl-sub { fill: #B8ABF7; font: 500 12.5px 'DM Sans', sans-serif; }
.fl-status { fill: #8f8aa8; font: 700 11.5px 'DM Sans', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.fl-node[data-st="ok"] .fl-status { fill: #7ee2a8; }
.fl-node[data-st="warn"] .fl-status { fill: #ffb454; }
.fl-node[data-st="bad"] .fl-status { fill: #ff9a9a; }
.fl-kid { fill: #3a3d52; stroke: rgba(255, 255, 255, 0.25); stroke-width: 1; transition: fill 0.3s ease; }
.fl-kid[data-st="ok"] { fill: #4cc38a; }
.fl-kid[data-st="warn"] { fill: #ff9f43; }
.fl-kid[data-st="bad"] { fill: #ff6b6b; }
.fl-packet { fill: #B8ABF7; }
.fl-ping { fill: none; stroke: #ff6b6b; stroke-width: 3; transform-box: fill-box; transform-origin: center; opacity: 0; }
.fl-ping.on { animation: fl-ping 1.6s ease-out infinite; }
@keyframes fl-ping { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- Scene 8: Portal ---------- */
.pt-num { fill: #fff; font: 700 64px 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; transition: fill 0.25s ease; }
.pt-lamp { transition: opacity 0.2s ease; }

/* ---------- Scene 7: Printer (the app's Print screen is drawn in the scene) ---------- */
.sp-fade { transition: opacity 0.25s ease; }
.sp-sheet { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@media (prefers-reduced-motion: reduce) { .sp-fade, .sp-sheet { transition: none; } }

/* ---------- Scene 1: radio waves leaving the phone ---------- */
.app-wave { fill: rgba(155, 139, 244, 0.06); stroke: #B8ABF7; stroke-width: 3; pointer-events: none; }

/* ---------- Portrait phones: a large scene that follows the action ---------- */
@media (max-aspect-ratio: 1/1) {
    .sc-svg, .sc-stage.has-side .sc-svg {
        inset: auto;
        left: 0;
        top: 58%;
        height: 58%;
        width: auto;
        aspect-ratio: 16 / 9;
        transform: translate(var(--px, 0px), -50%);
        transition: transform 0.25s linear;
    }
    .sc-chips { display: none; }
    .sc-cap { font-size: clamp(1.35rem, 6vw, 1.7rem); }
    .sc-hud::before { height: 330px; background: linear-gradient(180deg, rgba(14, 15, 32, 0.96) 0%, rgba(14, 15, 32, 0.8) 55%, rgba(14, 15, 32, 0) 100%); }
}
@media (max-width: 640px) { .sc-device em { display: none; } }
@media (max-width: 760px) { .sc-caps { width: 100%; max-width: none; } .sc-cap { right: 0; } }
