.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.title {
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 12px;
}
.sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}
.right {
    display: flex;
    gap: 10px;
}

.ON {
    color: var(--good);
}
.OFF {
    color: var(--bad);
}

button {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: var(--gap);
    padding: var(--gap);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.panel h2 {
    margin: 0 0 10px 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.panel__subhead {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 4px 0 10px;
}

.panel--wide {
    grid-column: 1 / -1;
}

.rack {
    display: grid;
    gap: 10px;
}
.display-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.lab-grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.widget {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
}
.widget__title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 8px;
}
.widget__value {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
}
.sevenseg {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
}
.sevenseg__digit {
    position: relative;
    width: 20px;
    height: 36px;
}
.sevenseg__seg {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}
.sevenseg__seg.on {
    background: #ffb24a;
    box-shadow: 0 0 8px rgba(255, 178, 74, 0.6);
}
.sevenseg__seg--a {
    top: 0;
    left: 3px;
    width: 14px;
    height: 3px;
}
.sevenseg__seg--b {
    top: 2px;
    right: 0;
    width: 3px;
    height: 14px;
}
.sevenseg__seg--c {
    bottom: 2px;
    right: 0;
    width: 3px;
    height: 14px;
}
.sevenseg__seg--d {
    bottom: 0;
    left: 3px;
    width: 14px;
    height: 3px;
}
.sevenseg__seg--e {
    bottom: 2px;
    left: 0;
    width: 3px;
    height: 14px;
}
.sevenseg__seg--f {
    top: 2px;
    left: 0;
    width: 3px;
    height: 14px;
}
.sevenseg__seg--g {
    top: 16px;
    left: 3px;
    width: 14px;
    height: 3px;
}
.sevenseg__seg--dot {
    bottom: -4px;
    right: -4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
}
.bar {
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.bar__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3ddc97, #f2b84b);
    transition: width 120ms linear;
}
.bar__meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}
.sparkline {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sparkline svg {
    width: 120px;
    height: 36px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px;
}
.sparkline__line {
    stroke: #7fd3ff;
}
.sparkline__meta {
    display: grid;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
}
.sparkline__range {
    opacity: 0.7;
}
.synchroscope {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: radial-gradient(circle at 30% 30%, #1a2536, #0b111a);
}
.synchroscope__dial {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}
.synchroscope__needle {
    position: absolute;
    left: 50%;
    top: 14px;
    width: 2px;
    height: 46px;
    background: #f2b84b;
    transform-origin: bottom center;
    box-shadow: 0 0 6px rgba(242, 184, 75, 0.6);
}
.synchroscope__mark--in {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #59ff88;
    opacity: 0.5;
}
.synchroscope--ready .synchroscope__mark--in {
    opacity: 1;
    box-shadow: 0 0 8px rgba(89, 255, 136, 0.8);
}
.synchroscope__meta {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
}
.synchroscope__dir--fast {
    color: #ffd56a;
}
.synchroscope__dir--slow {
    color: #7fd3ff;
}
.synchroscope__dir--match {
    color: #59ff88;
}
.synchroscope__dir {
    min-width: 48px;
}
.rods {
    display: grid;
    gap: 8px;
}
.rods__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.rods__bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.rods__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7fd3ff, #ffb24a);
}
.rods__row {
    display: grid;
    grid-template-columns: 1fr 1fr 50px;
    align-items: center;
    gap: 8px;
}
.rods__label {
    font-size: 11px;
    color: var(--muted);
}
.rods input[type="range"] {
    width: 100%;
}
.rods__value {
    text-align: right;
    font-size: 11px;
}
.flux {
    display: grid;
    gap: 8px;
}
.flux__row {
    display: grid;
    grid-template-columns: 60px 1fr 50px;
    align-items: center;
    gap: 8px;
}
.flux__bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid var(--border);
}
.flux__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff7b7b, #ffd56a);
}
.flux__fill--cool {
    background: linear-gradient(90deg, #64e2ff, #6affb5);
}
.flux__value {
    text-align: right;
    font-size: 11px;
}
.flux__fill--hot {
    background: linear-gradient(90deg, #ff7b7b, #ffb24a);
}
.flux__fill--warm {
    background: linear-gradient(90deg, #ffd56a, #6affb5);
}
.flow__row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}
.flow__bar {
    height: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    overflow: hidden;
}
.flow__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6affb5, #7fd3ff);
}
.flow__fill--cool {
    background: linear-gradient(90deg, #7fd3ff, #6affb5);
}
.flow__label {
    color: var(--muted);
}
.flow__warn {
    text-align: center;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(89, 255, 136, 0.1);
    color: #59ff88;
    font-size: 11px;
}
.flow__warn--bad {
    background: rgba(255, 82, 82, 0.12);
    color: #ff7b7b;
}
.ptchart svg {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
}
.ptchart__band {
    stroke: #5ed0ff;
    stroke-width: 2;
    fill: none;
}
.ptchart__dot {
    fill: #f2b84b;
}
.ptchart__grid {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}
.ptchart__meta {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}
.trip__reset {
    font-size: 11px;
    padding: 4px 6px;
}
.trip__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.trip__reset:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.trip__list {
    display: grid;
    gap: 6px;
}
.trip__row {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 11px;
}
.trip__row--on {
    background: rgba(255, 82, 82, 0.15);
    color: #ff7b7b;
}
.gov input[type="range"] {
    width: 100%;
}
.gov__meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}
.tank {
    position: relative;
    height: 120px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
.tank__fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, #6affb5, #2da86b);
    transition: height 120ms linear;
}
.tank__band {
    position: absolute;
    left: 0;
    right: 0;
    height: 12%;
    opacity: 0.15;
}
.tank__band--low {
    bottom: 0;
    background: #ff7b7b;
}
.tank__band--high {
    top: 0;
    background: #ffd56a;
}
.tank--low .tank__fill {
    background: linear-gradient(180deg, #ff7b7b, #c83f3f);
}
.tank--high .tank__fill {
    background: linear-gradient(180deg, #ffd56a, #f2b84b);
}
.eff__bar {
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.eff__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6affb5, #7fd3ff);
}
.eff__meta {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}
.interlocks {
    display: grid;
    gap: 6px;
}
.interlocks__row {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
}
.interlocks__row--ok {
    background: rgba(89, 255, 136, 0.08);
    color: #59ff88;
}
.interlocks__row--bad {
    background: rgba(255, 82, 82, 0.12);
    color: #ff7b7b;
}
.coremap {
    display: grid;
    gap: 4px;
    height: 140px;
}
.coremap__cell {
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #2b3546;
}
.timeline {
    display: grid;
    gap: 6px;
    font-size: 11px;
}
.timeline__row {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
}
.timeline__row--info {
    border-left: 2px solid #7fd3ff;
}
.timeline__row--warn {
    border-left: 2px solid #ffd56a;
}
.timeline__row--alert {
    border-left: 2px solid #ff7b7b;
}
.alarm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.alarm--active .alarm__light {
    animation: alarmPulse 0.7s infinite;
}
.alarm__light {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
}
.alarm__light--on {
    background: #ff7b7b;
    box-shadow: 0 0 10px rgba(255, 123, 123, 0.8);
}

@keyframes alarmPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.12);
        opacity: 0.7;
    }
}

.log {
    font-family: var(--mono);
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    height: 180px;
    overflow: auto;
}
.footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}
