/* Altair 5X — Simulator-specific styles (extends shared/simulator-theme.css) */

.sim-shell {
    padding: 24px;
}

.topbar,
.hero,
.sim-main,
.sim-sidebar {
    padding: 22px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.brand {
    height: 54px;
    flex-shrink: 0;
}

.eyebrow,
.section-kicker {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h2,
.sim-main h2,
.sim-sidebar h3,
.tip-card h3 {
    margin: 0;
}

.meta,
.hero-copy,
.tip-card p,
.event-log,
.status-row span {
    color: var(--muted);
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button {
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 11px 15px;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button.ghost {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary);
}

.hero {
    display: block;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #b52020, #961a1a);
    border-color: transparent;
    color: #fff;
}

.hero .eyebrow,
.hero h2,
.hero strong {
    color: #fff;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
    gap: 18px;
}

.sim-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.status-chip {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.device-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 20px;
    align-items: start;
}

.device-wrap {
    position: relative;
    width: min(100%, 720px);
    margin: 0 auto;
}

.device-image {
    width: 100%;
    display: block;
    border-radius: 28px;
}

.alarm-beacon {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    background: rgba(220, 30, 30, 0.82);
    box-shadow: 0 0 12px rgba(220, 30, 30, 0.6);
}

.screen-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    border-radius: 18px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #c8edf8 0%, #a6ddf0 100%);
    color: #0f4268;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 0 2px rgba(10, 40, 70, 0.22);
    overflow: hidden;
}

.screen-overlay.is-off {
    background: #0a0a0a;
    overflow: hidden;
}

.screen-overlay.is-off * {
    visibility: hidden !important;
    pointer-events: none;
}

/* ══ Normal operation screen ══ */
.screen-normal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* 5-channel layout: label(1) / val(2.5) / label(1) / val(2.5) / label(1) / val(2.5) / status(2) */
.screen-normal > * {
    min-height: 0;
}
.screen-normal > .screen-lbl-row {
    flex: 1 1 0;
}
.screen-normal > .screen-val-row {
    flex: 2.5 1 0;
}
.screen-normal > .screen-bot {
    flex: 2 1 0;
}

/* ── Label rows ── */
.screen-lbl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.screen-lbl-row span {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: clamp(4px, calc(var(--screen-row-unit, 20px) * 0.36), 14px);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0f4268;
    line-height: 1;
    flex: 1;
    text-align: center;
}

/* ── Value rows ── */
.screen-val-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.screen-val-row > div {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
}

.screen-val-row strong {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: clamp(8px, calc(var(--screen-row-unit, 20px) * 1.1), 80px);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1;
    color: #0b3562;
}

/* Single centered channel (SO2 bottom row) */
.screen-val-center {
    grid-template-columns: 1fr;
}

.screen-lbl-center {
    justify-content: center;
}

.screen-lbl-center span {
    flex: none;
}

/* ── Status bar ── */
.screen-bot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    padding: 0 clamp(2px, calc(var(--screen-scale, 1) * 4px), 4px);
}

.screen-bot .screen-time {
    display: inline-block;
    font-size: clamp(6px, calc(var(--screen-row-unit, 20px) * 0.9), 60px);
    line-height: 1;
}

.batt-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.08em;
    vertical-align: middle;
}

.batt-

.batt-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: currentColor;
    transition: width 0.3s ease;
}

.batt-tip {
    display: inline-block;
    width: 0.2em;
    height: 0.5em;
    background: currentColor;
    border-radius: 0 0.08em 0.08em 0;
}

.screen-batt,
.screen-alarm-lbl,
.screen-mode-lbl {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: clamp(4px, calc(var(--screen-row-unit, 20px) * 0.50), 28px);
    color: #0b3562;
    line-height: 1;
}

.screen-time {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    color: #0b3562;
    line-height: 1;
}

/* ══ Message / menu mode ══ */
.screen-normal.is-msg .screen-lbl-row,
.screen-normal.is-msg .screen-bot {
    display: none;
}

.screen-normal.is-msg .screen-val-row {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 3 1 0;
}

.screen-normal.is-msg .screen-val-row > div:last-child {
    display: none;
}

.screen-normal.is-msg .screen-val-row > div:first-child {
    width: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Row heading: large */
.screen-normal.is-msg .screen-val-row:nth-child(2) strong {
    font-size: clamp(5px, calc(var(--screen-row-unit, 20px) * 1.4), 52px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
    line-height: 1;
}

/* Row content: scales with line count */
.screen-normal.is-msg .screen-val-row:nth-child(4) strong {
    font-size: clamp(5px, calc(var(--screen-row-unit, 20px) * 1.6 / var(--msg-lines, 1)), 38px);
    white-space: pre-wrap;
    word-break: break-word;
    text-align: center;
    width: 100%;
    line-height: 1.4;
}

/* ── Flash animations ── */
.flash-warning {
    animation: blink-text 0.95s steps(2, end) infinite;
}

.flash-danger {
    animation: blink-text 0.55s steps(2, end) infinite;
}

.flash-batt {
    animation: blink-text 1.2s steps(2, end) infinite;
}

@keyframes blink-text {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.reading-alarm-warning strong {
    animation: blink-text 0.95s steps(2, end) infinite;
}

.reading-alarm-danger strong {
    animation: blink-text 0.55s steps(2, end) infinite;
}

.hotspot {
    position: absolute;
    border: 0;
    border-radius: 999px;
    background: rgba(181, 32, 32, 0.18);
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.is-held {
    transform: scale(1.05);
    background: rgba(204, 40, 40, 0.38);
    box-shadow: 0 0 0 3px rgba(255, 216, 75, 0.6);
    outline: none;
}

.hotspot span {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 10px);
    background: rgba(22, 49, 71, 0.92);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.hotspot-mode {
    left: 0;
    top: 0;
    width: 0;
    height: 0;
}

.hotspot-reset {
    left: 0;
    top: 0;
    width: 0;
    height: 0;
}

.device-help {
    display: grid;
    gap: 12px;
}

.tip-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.tip-card p {
    margin: 10px 0 0;
    line-height: 1.65;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.task-num {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--accent);
}

.task-

.task-label {
    font-weight: 600;
}

.task-hint {
    font-size: 0.85rem;
    color: var(--muted);
}

.slider-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.slider-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
}

.slider-card span {
    font-size: 0.86rem;
    color: var(--muted);
}

.slider-card strong {
    font-size: 1.1rem;
}

.slider-card input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 12px;
}

.check-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.status-list {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.status-row strong {
    color: var(--ink);
}

.event-log {
    margin: 10px 0 0 20px;
    padding: 0;
    line-height: 1.6;
}

.event-log li + li {
    margin-top: 8px;
}

.alarm-normal #alarmState,
.alarm-normal .status-chip {
    color: var(--ok);
}

.alarm-warning #alarmState,
.alarm-warning .status-chip {
    color: var(--warning);
}

.alarm-danger #alarmState,
.alarm-danger .status-chip {
    color: var(--danger);
}

.alarm-warning .alarm-beacon {
    animation: flash-beacon 0.95s steps(2, end) infinite;
}

.alarm-danger .alarm-beacon {
    animation: flash-beacon-urgent 0.55s steps(2, end) infinite;
}

@keyframes flash-beacon {
    0%, 100% { opacity: 0; }
    50%       { opacity: 0.5; }
}

@keyframes flash-beacon-urgent {
    0%, 100% { opacity: 0; }
    50%       { opacity: 0.5; }
}

/* Report modal */
.report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.report-card {
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

.report-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--muted);
}

.rpt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.rpt-kicker {
    margin: 0 0 4px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.rpt-title {
    margin: 0 0 4px;
    font-size: 1.4rem;
}

.rpt-date {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.rpt-score-block {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    padding: 16px 20px;
    min-width: 90px;
}

.rpt-score-pct {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.rpt-score-grade {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.grade-dist { background: #d0f0dc; color: #1a7a3c; }
.grade-pass { background: #d9eef8; color: #1a5278; }
.grade-partial { background: #fff3cc; color: #7a5c00; }
.grade-fail { background: #fde0df; color: #8c1c1c; }

.rpt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.rpt-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rpt-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.rpt-pass .rpt-status { color: var(--ok); font-weight: 700; }
.rpt-fail .rpt-status { color: var(--danger); font-weight: 700; }
.rpt-time { color: var(--muted); font-size: 0.82rem; }

.rpt-footer {
    font-size: 0.88rem;
    color: var(--muted);
}

.rpt-note { margin: 6px 0 0; }
.rpt-note-ok { color: var(--ok); font-weight: 600; }

@media (max-width: 1080px) {
    .device-stage,
    .layout {
        grid-template-columns: 1fr;
    }

    .device-help {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .sim-shell {
        padding: 8px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .top-actions {
        width: 100%;
    }

    .top-actions .button {
        flex: 1 1 calc(50% - 5px);
    }

    .sim-header,
    .device-help {
        grid-template-columns: 1fr;
    }

    .sim-header {
        flex-direction: column;
    }

    .sim-main {
        padding: 14px 8px;
    }

    .device-wrap {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .top-actions .button {
        flex-basis: 100%;
    }

    .hotspot span {
        font-size: 0.68rem;
        padding: 4px 8px;
    }
}
