:root {
    --bg: #050807;
    --panel: #0a0f0d;
    --panel-2: #0d1411;
    --line: #203027;
    --line-bright: #395444;
    --text: #f3f7f4;
    --muted: #819087;
    --green: #70ff9b;
    --green-deep: #0da63e;
    --red: #ff2f36;
    --yellow: #ffd43b;
    --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
}

body {
    min-height: 100vh;
    display: block;
    padding: 0;
    overflow-x: hidden;
}

button {
    color: inherit;
    font: inherit;
}

.hidden {
    display: none !important;
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    background-image:
        linear-gradient(rgba(112, 255, 155, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(112, 255, 155, 0.022) 1px, transparent 1px);
    background-size: 48px 48px;
}

.topbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line);
    background: #070b09;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 2px solid var(--green);
    color: var(--green);
    font: 800 28px/1 var(--mono);
    position: relative;
}

.brand-mark::after {
    content: '';
    position: absolute;
    inset: 6px -7px -7px 6px;
    border-right: 1px solid var(--line-bright);
    border-bottom: 1px solid var(--line-bright);
}

.eyebrow,
.section-kicker,
.panel-index,
.overlay-kicker {
    color: var(--green);
    font: 600 11px/1.3 var(--mono);
    letter-spacing: .14em;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    margin-top: 4px;
    font-size: clamp(20px, 2vw, 30px);
    letter-spacing: -.04em;
}

.system-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: #a8b4ad;
    font: 600 11px/1 var(--mono);
    letter-spacing: .07em;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px rgba(112, 255, 155, .8);
    animation: statusPulse 1.8s infinite;
}

.divider {
    color: #435047;
}

#clock {
    min-width: 76px;
    margin-left: 8px;
    color: #fff;
}

.sound-toggle {
    border: 1px solid var(--line-bright);
    background: transparent;
    padding: 8px 10px;
    color: var(--muted);
    cursor: pointer;
    font: 700 10px/1 var(--mono);
}

.sound-toggle[aria-pressed="true"] {
    border-color: var(--green);
    color: var(--green);
}

.view-nav {
    min-height: 52px;
    display: flex;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 8, 7, .95);
}

.nav-btn {
    min-width: 160px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: #758179;
    padding: 0 20px;
    cursor: pointer;
    font: 700 12px/1 var(--mono);
    letter-spacing: .08em;
    text-align: left;
    position: relative;
}

.nav-btn:first-child {
    border-left: 1px solid var(--line);
}

.nav-btn span {
    margin-right: 10px;
    color: #435047;
}

.nav-btn.active {
    color: var(--green);
    background: #0b120e;
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--green);
}

.nav-alert-badge {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    font-size: 10px;
}

.content {
    min-height: 0;
    padding: 24px 28px;
}

.view-section {
    height: 100%;
}

.overview-view {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.overview-grid {
    flex: 1;
    min-height: 480px;
    display: grid;
    grid-template-columns: 1.05fr 1.35fr 1fr;
    gap: 14px;
}

.panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin-top: 6px;
    font-size: clamp(15px, 1.5vw, 21px);
    letter-spacing: -.025em;
}

.pill {
    flex: none;
    border: 1px solid var(--line-bright);
    padding: 7px 9px;
    color: #a5b2aa;
    font: 700 10px/1 var(--mono);
}

.pill-ready {
    border-color: #27613b;
    background: #0b1c11;
    color: var(--green);
}

.pill-danger {
    border-color: var(--red);
    background: var(--red);
    color: white;
}

.phone-card {
    display: flex;
    flex-direction: column;
}

.phone-visual {
    flex: 1;
    min-height: 240px;
    display: grid;
    place-items: center;
    position: relative;
}

.scan-corners {
    position: absolute;
    width: min(82%, 300px);
    height: 78%;
    border: 1px solid #284134;
}

.scan-corners::before,
.scan-corners::after {
    content: '';
    position: absolute;
    width: 34px;
    height: 34px;
    border-color: var(--green);
}

.scan-corners::before {
    top: -1px;
    left: -1px;
    border-top: 3px solid var(--green);
    border-left: 3px solid var(--green);
}

.scan-corners::after {
    right: -1px;
    bottom: -1px;
    border-right: 3px solid var(--green);
    border-bottom: 3px solid var(--green);
}

.phone-shell {
    width: 118px;
    height: 210px;
    border: 3px solid #91a098;
    border-radius: 18px;
    position: relative;
    background: #080d0a;
    box-shadow: 0 0 50px rgba(112, 255, 155, .08);
}

.phone-speaker {
    position: absolute;
    width: 38px;
    height: 4px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #536159;
    border-radius: 8px;
}

.phone-battery-mini {
    position: absolute;
    width: 58px;
    height: 29px;
    left: 50%;
    top: 72px;
    transform: translateX(-50%);
    border: 2px solid var(--green);
    padding: 3px;
}

.phone-battery-mini::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 12px;
    top: 6px;
    right: -7px;
    background: var(--green);
}

.phone-battery-mini span {
    display: block;
    width: 72%;
    height: 100%;
    background: var(--green);
}

.phone-wave {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 42px;
    height: 1px;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
    animation: phoneScan 2.2s ease-in-out infinite;
}

.card-callout {
    border-left: 3px solid var(--green);
    padding: 10px 0 10px 14px;
}

.callout-label {
    display: block;
    color: var(--muted);
    font: 600 10px/1 var(--mono);
    letter-spacing: .1em;
}

.card-callout strong {
    display: block;
    margin-top: 5px;
    font-size: clamp(19px, 2vw, 28px);
}

.outlets-card {
    display: flex;
    flex-direction: column;
}

.mini-outlets {
    display: grid;
    gap: 7px;
    padding: 14px 0;
}

.mini-outlet {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    min-height: 39px;
    padding: 0 9px;
    border: 1px solid #18261e;
    color: #d8dfda;
    font: 600 12px/1 var(--mono);
}

.mini-outlet span:first-child {
    color: #59675e;
}

.mini-outlet b {
    color: var(--green);
    font-size: 10px;
}

.overview-blacklist {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px;
    border: 2px solid var(--red);
    background: #2a090b;
    animation: alertBlink .65s steps(2) infinite;
}

.overview-blacklist > span {
    color: var(--red);
    font-size: 28px;
}

.overview-blacklist b,
.overview-blacklist strong {
    display: block;
}

.overview-blacklist b {
    color: var(--red);
    font: 800 10px/1.2 var(--mono);
}

.overview-blacklist strong {
    margin-top: 4px;
    font-size: 12px;
}

.score-card {
    display: flex;
    flex-direction: column;
}

.hero-score {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.score-ring {
    flex: none;
    width: 118px;
    height: 118px;
    display: grid;
    place-content: center;
    border: 5px solid var(--green);
    border-radius: 50%;
    box-shadow: inset 0 0 30px rgba(112, 255, 155, .09);
    text-align: center;
}

.score-ring span {
    font: 800 40px/.9 var(--mono);
}

.score-ring small {
    margin-top: 7px;
    color: var(--muted);
    font: 600 10px/1 var(--mono);
}

.crown-label {
    display: block;
    color: var(--yellow);
    font: 700 11px/1 var(--mono);
}

.hero-score strong {
    display: block;
    margin: 8px 0;
    font-size: clamp(25px, 3vw, 42px);
}

.hero-score div > small {
    display: block;
    color: var(--muted);
    font: 600 9px/1.5 var(--mono);
}

.score-bottom {
    padding: 13px;
    border: 1px solid #5a1b1e;
    background: #18090a;
}

.score-bottom span {
    display: block;
    color: #b87074;
    font: 600 9px/1 var(--mono);
}

.score-bottom b {
    display: block;
    margin-top: 5px;
    color: var(--red);
    font: 800 12px/1.2 var(--mono);
}

.system-strip {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--line);
    padding: 11px 14px;
    background: #080c0a;
    color: var(--muted);
    font: 600 10px/1 var(--mono);
}

.system-strip b {
    color: var(--text);
}

.scanner-stage {
    height: 100%;
    min-height: 560px;
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    border: 1px solid var(--line);
    background: var(--panel);
}

.scanner-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(30px, 5vw, 76px);
    border-right: 1px solid var(--line);
}

.scanner-copy h2 {
    max-width: 580px;
    margin: 15px 0 20px;
    font-size: clamp(40px, 6vw, 82px);
    line-height: .95;
    letter-spacing: -.06em;
}

.scanner-copy p {
    max-width: 600px;
    color: #a6b1aa;
    font: 500 clamp(14px, 1.5vw, 19px)/1.55 var(--mono);
}

.scan-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.scan-specs span {
    padding: 10px 12px;
    border: 1px solid var(--line);
    color: var(--muted);
    font: 600 10px/1 var(--mono);
}

.scan-specs b {
    margin-right: 7px;
    color: var(--green);
}

.scanner-machine {
    display: grid;
    place-items: center;
    align-content: center;
    position: relative;
    overflow: hidden;
}

.machine-label {
    margin-bottom: 18px;
    color: var(--muted);
    font: 600 11px/1 var(--mono);
    letter-spacing: .15em;
}

.machine-bed {
    width: min(68vh, 520px);
    max-width: 76%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid #2e4638;
    position: relative;
    background:
        linear-gradient(rgba(112, 255, 155, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(112, 255, 155, .04) 1px, transparent 1px);
    background-size: 30px 30px;
}

.machine-bed::before,
.machine-bed::after {
    content: '';
    position: absolute;
    background: #2e4638;
}

.machine-bed::before {
    width: 1px;
    height: 100%;
}

.machine-bed::after {
    width: 100%;
    height: 1px;
}

.target-ring {
    position: absolute;
    border: 1px solid #335c42;
    border-radius: 50%;
}

.ring-one {
    width: 64%;
    height: 64%;
}

.ring-two {
    width: 36%;
    height: 36%;
    border-style: dashed;
    animation: orbit 18s linear infinite;
}

.target-core {
    color: var(--green);
    font: 300 65px/1 var(--mono);
}

.scan-beam {
    position: absolute;
    left: 6%;
    right: 6%;
    height: 2px;
    background: var(--green);
    box-shadow: 0 0 18px rgba(112, 255, 155, .8);
    animation: bedScan 2.4s ease-in-out infinite;
}

.machine-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
    color: var(--green);
    font: 700 11px/1 var(--mono);
}

.machine-status span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin-top: 9px;
    font-size: clamp(25px, 3vw, 46px);
    letter-spacing: -.045em;
}

.outlet-summary,
.ranking-period {
    padding: 12px 15px;
    border: 1px solid #27613b;
    color: var(--green);
    font: 700 11px/1 var(--mono);
}

.outlet-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.outlet-summary.danger {
    border-color: var(--red);
    background: #28080a;
    color: var(--red);
}

.outlet-summary.danger .status-dot {
    background: var(--red);
    box-shadow: 0 0 14px var(--red);
}

.outlet-list {
    display: grid;
    gap: 8px;
}

.outlet-row {
    min-height: 61px;
    display: grid;
    grid-template-columns: 110px 1.3fr .8fr .7fr 150px;
    align-items: center;
    gap: 16px;
    padding: 0 18px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.outlet-number {
    color: #6d7a72;
    font: 700 12px/1 var(--mono);
}

.outlet-device {
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 800;
}

.outlet-owner,
.outlet-watts {
    color: var(--muted);
    font: 600 11px/1 var(--mono);
}

.outlet-status {
    justify-self: end;
    width: 120px;
    padding: 8px;
    border: 1px solid #27613b;
    color: var(--green);
    text-align: center;
    font: 800 10px/1 var(--mono);
}

.outlet-row.blacklisted {
    min-height: 76px;
    border: 3px solid var(--red);
    background: #3a090c;
    color: white;
    animation: rowDanger .55s steps(2) infinite;
}

.outlet-row.blacklisted .outlet-number,
.outlet-row.blacklisted .outlet-owner,
.outlet-row.blacklisted .outlet-watts {
    color: #ffafb2;
}

.outlet-row.blacklisted .outlet-status {
    border-color: white;
    background: var(--red);
    color: white;
}

.ranking-list {
    display: grid;
    gap: 9px;
}

.ranking-row {
    min-height: 78px;
    display: grid;
    grid-template-columns: 70px 1fr 180px 180px 180px;
    align-items: center;
    gap: 18px;
    padding: 0 22px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.ranking-position {
    color: #66736b;
    font: 800 25px/1 var(--mono);
}

.ranking-name {
    font-size: clamp(17px, 2vw, 25px);
    font-weight: 900;
}

.ranking-energy,
.ranking-phone {
    color: var(--muted);
    font: 600 12px/1 var(--mono);
}

.ranking-energy b,
.ranking-phone b {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 14px;
}

.ranking-title {
    justify-self: end;
    min-width: 158px;
    padding: 10px;
    border: 1px solid var(--line-bright);
    text-align: center;
    font: 800 10px/1 var(--mono);
}

.ranking-row.winner {
    border-color: var(--yellow);
    background: #171509;
}

.ranking-row.winner .ranking-position,
.ranking-row.winner .ranking-title {
    color: var(--yellow);
}

.ranking-row.winner .ranking-title {
    border-color: var(--yellow);
}

.ranking-row.loser {
    border-color: #6e2024;
    background: #1c090b;
}

.ranking-row.loser .ranking-position,
.ranking-row.loser .ranking-title {
    color: var(--red);
}

.ranking-row.loser .ranking-title {
    border-color: var(--red);
}

.ranking-rule {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 18px;
    border-left: 3px solid var(--green);
    padding: 12px 16px;
    background: #0a110d;
}

.ranking-rule span {
    flex: none;
    color: var(--green);
    font: 700 10px/1 var(--mono);
}

.ranking-rule p {
    color: #a8b2ac;
    font: 500 12px/1.4 var(--mono);
}

.footer {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 28px;
    border-top: 1px solid var(--line);
    background: #070b09;
    color: #58655d;
    font: 600 9px/1 var(--mono);
    letter-spacing: .1em;
}

#sync-label {
    color: var(--green);
}

.scan-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #020403;
}

.overlay-grid {
    position: absolute;
    inset: 0;
    opacity: .5;
    background-image:
        linear-gradient(rgba(112, 255, 155, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(112, 255, 155, .06) 1px, transparent 1px);
    background-size: 64px 64px;
}

.overlay-state {
    width: min(1100px, calc(100% - 36px));
    position: relative;
    z-index: 1;
    text-align: center;
}

.scan-orbit {
    width: 170px;
    height: 170px;
    margin: 0 auto 42px;
    border: 2px solid #274033;
    border-radius: 50%;
    position: relative;
    animation: orbit 2s linear infinite;
}

.scan-orbit::before,
.scan-orbit::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px dashed #335c42;
}

.scan-orbit::before {
    inset: 24px;
}

.scan-orbit::after {
    inset: 48px;
    background: var(--green);
    box-shadow: 0 0 35px rgba(112, 255, 155, .8);
}

.scan-orbit span {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green);
}

.scan-orbit span:nth-child(1) {
    top: -6px;
    left: 50%;
}

.scan-orbit span:nth-child(2) {
    left: 12px;
    bottom: 22px;
}

.scan-orbit span:nth-child(3) {
    right: 12px;
    bottom: 22px;
}

.scanning-state h2 {
    margin: 14px 0 24px;
    font-size: clamp(45px, 8vw, 110px);
    line-height: .95;
    letter-spacing: -.065em;
}

.scanning-state p {
    color: var(--green);
    font: 700 clamp(12px, 1.8vw, 20px)/1 var(--mono);
    letter-spacing: .12em;
}

.progress-track {
    width: min(680px, 82vw);
    height: 8px;
    margin: 24px auto 0;
    background: #15221b;
}

.progress-track span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--green);
    box-shadow: 0 0 18px rgba(112, 255, 155, .5);
}

.result-state {
    display: grid;
    justify-items: center;
}

.result-icon,
.warning-triangle {
    width: 128px;
    height: 128px;
    display: grid;
    place-items: center;
    margin-bottom: 28px;
    border: 5px solid currentColor;
    color: var(--green);
    font-size: 76px;
    font-weight: 900;
}

.result-icon {
    border-radius: 50%;
}

.battery-result {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 24px;
    margin: 16px 0 10px;
}

.battery-result span {
    color: #95a098;
    font: 700 clamp(14px, 2vw, 24px)/1 var(--mono);
    letter-spacing: .15em;
}

.battery-result strong {
    font: 900 clamp(74px, 15vw, 190px)/.8 var(--sans);
    letter-spacing: -.085em;
}

.result-state h2 {
    margin: 14px 0;
    color: var(--green);
    font-size: clamp(38px, 6vw, 78px);
}

.result-state > p {
    color: #c7d1ca;
    font: 700 clamp(13px, 1.5vw, 20px)/1 var(--mono);
    letter-spacing: .12em;
}

.critical-state {
    width: 100vw;
    min-width: 0;
    max-width: none;
    min-height: 100vh;
    align-content: center;
    padding: 40px;
    background: var(--red);
    animation: criticalFlash .46s steps(2) infinite;
}

.critical-state .overlay-kicker {
    color: white;
}

.critical-state .warning-triangle {
    width: 0;
    height: 0;
    border-left: 76px solid transparent;
    border-right: 76px solid transparent;
    border-bottom: 134px solid white;
    border-top: 0;
    color: var(--red);
    position: relative;
    font-size: 72px;
}

.warning-triangle::after {
    content: '!';
    position: absolute;
    top: 45px;
    left: -17px;
}

.critical-state .battery-result span {
    color: #fff;
}

.critical-state .battery-result strong {
    color: #fff;
}

.critical-state h2 {
    color: white;
}

.critical-order {
    max-width: 1300px;
    display: grid;
    gap: 30px;
    padding: 44px;
    border: 7px solid white;
    background: var(--red);
    color: white;
}

.critical-order span {
    font: 800 clamp(18px, 3vw, 38px)/1 var(--mono);
    letter-spacing: .08em;
}

.critical-order strong {
    font-size: clamp(46px, 7.8vw, 112px);
    line-height: .9;
    letter-spacing: -.06em;
}

.alarm-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 24px;
    background: white;
    color: var(--red);
    font: 900 13px/1 var(--mono);
}

.admin-panel {
    position: fixed;
    z-index: 1500;
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 7px;
    padding: 9px;
    border: 1px solid #536159;
    background: rgba(4, 7, 5, .96);
    box-shadow: 0 15px 50px rgba(0, 0, 0, .6);
}

.admin-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8px 0 4px;
    color: var(--green);
    font: 800 11px/1 var(--mono);
}

.admin-title small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 8px;
}

.admin-btn {
    border: 1px solid #3b4840;
    background: #111713;
    padding: 11px 13px;
    cursor: pointer;
    font: 800 10px/1 var(--mono);
}

.admin-btn:hover {
    border-color: white;
}

.admin-ok {
    border-color: #287043;
    color: var(--green);
}

.admin-critical,
.admin-danger {
    border-color: #943036;
    color: #ff777c;
}

.admin-muted {
    color: var(--muted);
}

.mode-switch {
    position: fixed;
    z-index: 1600;
    right: 8px;
    top: 8px;
    width: 34px;
    height: 26px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .22);
    cursor: pointer;
    font: 800 13px/1 var(--mono);
}

.connection-status {
    display: none !important;
}

@keyframes statusPulse {
    50% { opacity: .3; }
}

@keyframes phoneScan {
    0%, 100% { transform: translateY(-32px); }
    50% { transform: translateY(32px); }
}

@keyframes bedScan {
    0%, 100% { top: 8%; }
    50% { top: 92%; }
}

@keyframes orbit {
    to { transform: rotate(360deg); }
}

@keyframes alertBlink {
    50% { background: #5a0b0f; }
}

@keyframes rowDanger {
    50% { background: #71080e; }
}

@keyframes criticalFlash {
    50% { background: #ad0008; }
}

@media (max-width: 1050px) {
    .system-meta > span:not(.status-dot),
    .system-meta .divider {
        display: none;
    }

    .overview-grid {
        grid-template-columns: 1fr 1fr;
    }

    .score-card {
        grid-column: 1 / -1;
        min-height: 230px;
    }

    .outlet-row,
    .ranking-row {
        grid-template-columns: 100px 1fr 130px 130px;
    }

    .outlet-owner,
    .ranking-phone {
        display: none;
    }
}

@media (max-width: 720px) {
    .topbar {
        min-height: 74px;
        padding: 12px 14px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        font-size: 23px;
    }

    .eyebrow {
        font-size: 8px;
    }

    h1 {
        font-size: 17px;
    }

    .system-meta {
        gap: 7px;
    }

    #clock {
        display: none;
    }

    .sound-toggle {
        padding: 7px;
        font-size: 8px;
    }

    .view-nav {
        padding: 0;
        overflow-x: auto;
    }

    .nav-btn {
        min-width: 118px;
        height: 48px;
        padding: 0 11px;
        font-size: 9px;
    }

    .content {
        padding: 10px;
    }

    .overview-grid {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .panel {
        padding: 14px;
    }

    .phone-visual {
        min-height: 250px;
    }

    .hero-score {
        padding: 30px 0;
    }

    .score-ring {
        width: 100px;
        height: 100px;
    }

    .system-strip {
        overflow-x: auto;
        white-space: nowrap;
    }

    .scanner-stage {
        min-height: 700px;
        grid-template-columns: 1fr;
    }

    .scanner-copy {
        padding: 36px 24px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .scanner-copy h2 {
        font-size: 49px;
    }

    .scanner-machine {
        min-height: 390px;
    }

    .machine-bed {
        max-width: 72%;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .outlet-row {
        min-height: 67px;
        grid-template-columns: 76px 1fr 90px;
        gap: 8px;
        padding: 0 10px;
    }

    .outlet-watts {
        display: none;
    }

    .outlet-status {
        width: 88px;
        font-size: 8px;
    }

    .outlet-number {
        font-size: 9px;
    }

    .ranking-row {
        min-height: 83px;
        grid-template-columns: 42px 1fr 105px;
        gap: 8px;
        padding: 0 11px;
    }

    .ranking-energy {
        display: none;
    }

    .ranking-title {
        min-width: 100px;
        font-size: 8px;
    }

    .footer {
        padding: 0 12px;
    }

    .footer span:first-child,
    .footer span:last-child {
        display: none;
    }

    .footer {
        justify-content: center;
    }

    .scan-orbit {
        width: 120px;
        height: 120px;
        margin-bottom: 30px;
    }

    .scan-orbit::before {
        inset: 18px;
    }

    .scan-orbit::after {
        inset: 36px;
    }

    .critical-state {
        padding: 22px 14px 70px;
    }

    .critical-state .warning-triangle {
        border-left-width: 50px;
        border-right-width: 50px;
        border-bottom-width: 88px;
        margin-bottom: 18px;
    }

    .warning-triangle::after {
        top: 28px;
        left: -12px;
        font-size: 48px;
    }

    .critical-order {
        padding: 22px 14px;
        border-width: 4px;
        gap: 20px;
    }

    .critical-order strong {
        font-size: clamp(38px, 12vw, 68px);
    }

    .alarm-footer {
        font-size: 9px;
    }

    .alarm-footer span:nth-child(2),
    .alarm-footer span:nth-child(3) {
        display: none;
    }

    .admin-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .admin-title {
        width: 100%;
    }

    .admin-btn {
        flex: 1 1 130px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
