:root {
    color-scheme: light;
    --ink: #242520;
    --muted: #575950;
    --metal: #d6d6ce;
    --line: #a7a89d;
    --screen: #1f211e;
    --accent: #b13c21;
    --page-inset: clamp(6px, 0.85vw, 14px);
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    min-height: 100vh;
    padding: var(--page-inset);
    background: #dddcd4;
    color: var(--ink);
    font: 15px/1.5 var(--sans);
}

.instrument {
    max-width: 1480px;
    min-height: 515px;
    height: calc(100dvh - 2 * var(--page-inset));
    margin: auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid #797b70;
    border-radius: 5px;
    padding: 5px;
    background:
        repeating-linear-gradient(0deg, #00000007 0 1px, transparent 1px 3px),
        linear-gradient(110deg, #d3d3ca, #eae9e1 46%, #b6b8ae);
    box-shadow: inset 0 0 0 1px #f4f3eb, 0 18px 36px #39392d25, 0 3px 0 #a2a398;
}

.faceplate {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 7px clamp(12px, 1.6vw, 24px);
    border: 1px solid var(--line);
    border-bottom: 4px solid #31332d;
    background:
        repeating-linear-gradient(0deg, transparent 0 3px, #ffffff15 3px 4px),
        linear-gradient(100deg, #dfdfd6, #e5e4dd 52%, #d5d6cc);
}

.faceplate::after {
    content: "";
    width: clamp(45px, 12vw, 180px);
    height: 8px;
    margin-inline-start: auto;
    background: radial-gradient(circle at 3px 3px, #5c5e4e85 0 1px, transparent 1.5px) 0 0 / 6px 6px;
}

.nameplate { display: flex; align-items: center; gap: 10px; }
.signal-mark {
    flex: 0 0 9px;
    height: 9px;
    background: var(--accent);
    box-shadow: inset 0 -1px 0 #762c1c;
}
h1 { margin: 0; font-size: clamp(16px, 1.65vw, 24px); line-height: 1.2; font-weight: 740; }

.mode-selector { flex: none; }
.switch-bank {
    position: relative;
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid #73756c;
    border-radius: 3px;
    background: #292b25;
    box-shadow: inset 0 1px 3px #0006;
}
.switch-bank input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.switch-bank label {
    position: relative;
    min-width: 79px;
    min-height: 32px;
    padding: 4px 10px;
    display: flex;
    gap: 9px;
    align-items: center;
    justify-content: center;
    border: 1px solid #161713;
    border-radius: 2px;
    background: linear-gradient(#eeede4, #cecec4);
    box-shadow: inset 0 1px #faf9ef, inset 0 -2px #0002;
    cursor: pointer;
    font-weight: 650;
    white-space: nowrap;
}
.switch-bank label::before {
    content: "";
    width: 7px;
    height: 7px;
    border: 1px solid #86877b;
    border-radius: 50%;
    background: #b1b1a5;
}
.switch-bank input:checked + label {
    border-color: #5c210f;
    background: #a53820;
    color: #fff8ed;
    box-shadow: inset 0 2px 3px #40120660;
}
.switch-bank input:checked + label::before { border-color: #57210e; background: #ffe0af; }
.switch-bank label:hover { filter: brightness(1.07); }
.switch-bank input:focus-visible + label { outline: 2px solid #ffad82; outline-offset: -4px; }

.instrument-body {
    min-width: 0;
    min-height: 0;
    border: 1px solid #a2a398;
    border-top: 0;
    background: var(--metal);
}
iframe { display: block; width: 100%; height: 100%; border: 0; }
.standby {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    min-width: 0;
    background:
        radial-gradient(circle at 3px 3px, #5c5e4e 0 1px, #9b9e90 1.15px, transparent 1.5px) 0 0 / 6px 6px,
        linear-gradient(125deg, #c3c4b9, #d3d4c9);
    padding: 7px;
}
.standby-display {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 0;
    min-width: 0;
    padding: clamp(13px, 2vw, 27px);
    color: #e9e9db;
    border: 1px solid #171815;
    border-radius: 2px;
    background: var(--screen);
    box-shadow: inset 0 0 0 3px #30322b, 0 1px #eeede4;
}
.display-caption { display: flex; justify-content: space-between; padding-bottom: 12px; font-size: 13px; font-weight: 650; }
.unit { color: #c2c3ad; font: 12px/1.5 var(--mono); }
.display-grid {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 20px;
    border: 1px solid #57594e;
    background:
        repeating-linear-gradient(0deg, #585a4e60 0 1px, transparent 1px 36px),
        repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), #585a4e78 calc(20% - 1px) 20%);
}
.display-grid p {
    margin: 0;
    padding: 9px 12px;
    color: #bdbead;
    background: var(--screen);
    text-align: center;
    font-size: 13px;
}
.display-scale {
    display: flex;
    justify-content: space-between;
    min-width: 0;
    padding-top: 12px;
    color: #c2c3ad;
    background: repeating-linear-gradient(90deg, #77796a 0 1px, transparent 1px 2.5%) left top / 100% 5px no-repeat;
    font: 11px/1.3 var(--mono);
}

@media (min-width: 761px) and (max-height: 720px) {
    :root { --page-inset: 6px; }
    .instrument { padding: 3px; }
    .faceplate { padding-block: 4px; }
    .switch-bank { display: flex; }
    .switch-bank label { min-height: 30px; }
}

@media (max-width: 620px) {
    :root { --page-inset: 8px; }
    .instrument { padding: 4px; }
    .faceplate { flex-wrap: wrap; padding: 7px 10px; gap: 8px; }
    .faceplate::after { display: none; }
    .switch-bank label { min-width: 58px; padding-inline: 5px; font-size: 13px; }
    .standby { padding: 5px; }
}

@media (forced-colors: active) {
    .switch-bank input:checked + label { background: Highlight; color: HighlightText; }
    .switch-bank input:focus-visible + label { outline-color: Highlight; }
}
