:root {
    --bg: #1D262F;
    --bg-deep: #111920;
    --panel: #27323F;
    --panel-2: #405368;
    --green: #0FC78A;
    --green-bright: #14E19D;
    --green-soft: #47EBB4;
    --blue: #34659D;
    --blue-soft: #6E9BCF;
    --text: #EBF4FF;
    --muted: #A1AAB5;
    --border: #738191;
    --danger: #ff6b7a;
    --sidebar: 232px;
    --topbar: 72px;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(5, 11, 16, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
select { color-scheme: dark; }
select option { color: var(--text); background: var(--panel); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.skip-link {
    position: fixed;
    z-index: 200;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    color: var(--bg-deep);
    background: var(--green-bright);
    border-radius: 8px;
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* Login */
.login-page { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr); overflow: hidden; isolation: isolate; background: var(--bg-deep); }
.login-art {
    position: relative;
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(52px, 8vh, 92px) clamp(44px, 7vw, 104px);
    isolation: isolate;
    background:
        linear-gradient(105deg, rgba(10, 17, 24, .72) 0%, rgba(10, 17, 24, .38) 47%, rgba(10, 17, 24, .06) 73%),
        linear-gradient(180deg, rgba(10, 17, 24, .38) 0%, transparent 48%, rgba(10, 17, 24, .12) 100%),
        url("../img/luna-login.jpg") center 58% / cover no-repeat;
}
.login-art-copy { max-width: 680px; }
.eyebrow, .kicker { display: inline-flex; align-items: center; gap: 9px; color: var(--green-soft); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 5px rgba(20, 225, 157, .12); }
.login-art h1 { max-width: 640px; margin: 24px 0 18px; font-size: clamp(44px, 5.2vw, 82px); line-height: .98; letter-spacing: -.055em; }
.login-art-copy > p { max-width: 580px; margin: 0; color: var(--text); text-shadow: 0 2px 16px rgba(0, 0, 0, .72); font-size: clamp(16px, 1.3vw, 20px); line-height: 1.6; }
.photo-credit { position: absolute; z-index: 2; right: 20px; bottom: 16px; color: rgba(235, 244, 255, .72); text-shadow: 0 1px 5px rgba(0, 0, 0, .9); font-size: 11px; letter-spacing: .02em; }

.login-panel { display: grid; place-items: center; min-height: 100vh; padding: 32px clamp(28px, 6vw, 92px); background: var(--bg); border-left: 1px solid rgba(115, 129, 145, .22); }
.login-card { width: min(100%, 440px); padding: clamp(26px, 2.5vw, 32px); background: rgba(39, 50, 63, .74); border: 1px solid rgba(115, 129, 145, .24); border-radius: 18px; box-shadow: 0 24px 70px rgba(4, 9, 14, .2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.login-logo { width: 260px; height: 58px; object-fit: contain; object-position: left center; margin-bottom: 42px; }
.login-heading h2 { margin: 12px 0 10px; font-size: 34px; letter-spacing: -.04em; }
.login-heading p { margin: 0 0 28px; color: var(--muted); line-height: 1.5; }
.login-form { display: grid; gap: 17px; }
.field-group { display: grid; gap: 9px; }
.field-group label { color: var(--text); font-size: 13px; font-weight: 700; }
.field-wrap { display: flex; align-items: center; min-height: 52px; padding: 0 15px; gap: 12px; background: #202b36; border: 1px solid rgba(115, 129, 145, .44); border-radius: 11px; transition: border-color .2s, box-shadow .2s; }
.field-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15, 199, 138, .13); }
.field-wrap > span { color: var(--blue-soft); font-weight: 800; }
.field-wrap input { flex: 1; min-width: 0; padding: 14px 0; color: var(--text); background: transparent; border: 0; outline: 0; }
.field-wrap input::placeholder { color: #74808c; }
.password-toggle { padding: 5px; color: var(--green-soft); background: transparent; border: 0; font-size: 12px; font-weight: 800; }
.field-error { color: #ff9aa4; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--green); }
.primary-button, .secondary-button { min-height: 50px; padding: 0 20px; border: 0; border-radius: 10px; font-weight: 800; transition: transform .2s, background .2s, box-shadow .2s; }
.primary-button { color: #0b2019; background: var(--green-bright); box-shadow: 0 10px 30px rgba(20, 225, 157, .13); }
.primary-button:hover, .primary-button:focus-visible { transform: translateY(-1px); background: var(--green-soft); box-shadow: 0 12px 34px rgba(20, 225, 157, .2); }
.primary-button.inline { display: inline-flex; align-items: center; margin-top: 15px; }
.auth-switch-link { display: block; margin-top: 15px; color: var(--green-soft); font-size: 12px; font-weight: 700; text-align: center; }
.auth-switch-link:hover, .auth-switch-link:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.login-secondary-action { display: grid; gap: 9px; margin-top: 20px; }
.login-secondary-action > span { color: var(--muted); font-size: 11px; text-align: center; }
.projects-button { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 20px; gap: 10px; color: #0b2019; background: var(--green-bright); border: 1px solid rgba(71, 235, 180, .72); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 225, 157, .1); font-weight: 800; transition: transform .2s, background .2s, box-shadow .2s; }
.projects-button:hover, .projects-button:focus-visible { transform: translateY(-1px); background: var(--green-soft); box-shadow: 0 12px 34px rgba(20, 225, 157, .2); outline: none; }
.projects-button span { font-size: 18px; line-height: 1; }
.registration-card { padding-block: 24px; }
.registration-logo { margin-bottom: 24px; }
.registration-card .login-heading h2 { font-size: 30px; }
.registration-card .login-heading p { margin-bottom: 20px; }
.registration-card .login-form { gap: 12px; }
.registration-card .field-wrap { min-height: 47px; }
.registration-card .field-wrap input { padding-block: 11px; }
.registration-card .demo-note { margin-top: 18px; padding-top: 15px; }
.demo-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 26px; padding-top: 18px; color: var(--muted); border-top: 1px solid rgba(115, 129, 145, .25); font-size: 12px; line-height: 1.5; }
.demo-note i { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--blue-soft); }

/* Application shell */
.app-shell { background: #182129; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar); padding: 28px 18px 20px; background: #131c24; border-right: 1px solid rgba(115, 129, 145, .18); }
.sidebar-brand { height: 74px; display: grid; place-items: center; margin-bottom: 25px; }
.sidebar-brand img { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; }
.sidebar-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; min-height: 46px; padding: 0 13px; gap: 12px; color: var(--muted); border-radius: 9px; font-size: 13px; font-weight: 650; transition: .2s; }
.nav-item:hover, .nav-item:focus-visible { color: var(--text); background: rgba(64, 83, 104, .35); }
.nav-item.active { color: var(--green-soft); background: rgba(15, 199, 138, .09); box-shadow: inset 3px 0 var(--green); }
.nav-icon { display: grid; place-items: center; width: 25px; font-size: 20px; }
.nav-item.muted { opacity: .72; }
.sidebar-foot { margin-top: auto; padding: 18px 11px 0; border-top: 1px solid rgba(115, 129, 145, .17); }
.sidebar-foot p { margin: 10px 0 0; color: #66717c; font-size: 10px; }
.simulation-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.simulation-badge i, .status-pill i, .section-title small i, .table-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(15, 199, 138, .5); }
.app-frame { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 35; top: 0; display: flex; align-items: center; justify-content: space-between; height: var(--topbar); padding: 0 clamp(24px, 3vw, 48px); background: rgba(24, 33, 41, .91); border-bottom: 1px solid rgba(115, 129, 145, .18); backdrop-filter: blur(18px); }
.wordmark img { width: 176px; height: 39px; object-fit: contain; object-position: left center; }
.topbar-actions, .user-summary { display: flex; align-items: center; }
.topbar-actions { gap: 20px; }
.user-summary { gap: 10px; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; color: var(--bg-deep); background: var(--green-soft); border-radius: 10px; font-weight: 900; }
.user-copy { display: grid; gap: 2px; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: var(--muted); font-size: 10px; }
.icon-button { display: grid; place-items: center; width: 35px; height: 35px; color: var(--muted); background: transparent; border: 1px solid rgba(115, 129, 145, .25); border-radius: 9px; }
.icon-button:hover { color: var(--text); border-color: var(--border); }
.main-content { width: min(100%, 1560px); margin: 0 auto; padding: 36px clamp(22px, 3vw, 50px) 58px; }
.mobile-header, .sidebar-scrim { display: none; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 28px; }
.page-heading h1 { margin: 9px 0 6px; font-size: clamp(30px, 3vw, 43px); letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.telescope-picker { display: grid; min-width: 280px; gap: 7px; }
.telescope-picker label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.select-wrap { position: relative; display: flex; align-items: center; background: var(--panel); border: 1px solid rgba(115, 129, 145, .35); border-radius: 10px; }
.telescope-dot { position: absolute; left: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 5px rgba(20, 225, 157, .1); }
.select-wrap select { width: 100%; min-height: 45px; padding: 0 40px 0 35px; color: var(--text); background: transparent; border: 0; outline: none; font-size: 13px; font-weight: 700; }
.select-wrap option { color: var(--text); background: var(--panel); }

.station-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); overflow: hidden; margin-bottom: 38px; background: linear-gradient(120deg, #27323f 0%, #22313d 54%, #1b2c34 100%); border: 1px solid rgba(115, 129, 145, .3); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-main { min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; padding: 30px 34px; }
.hero-status { display: flex; align-items: center; gap: 8px; color: var(--green-soft); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.live-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 6px rgba(20, 225, 157, .1); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(20, 225, 157, 0); } }
.station-code { color: var(--blue-soft); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.hero-main h2 { margin: 7px 0 6px; font-size: clamp(34px, 4vw, 56px); letter-spacing: -.05em; }
.hero-main > div > p { margin: 0; color: var(--muted); font-size: 13px; }
.hero-coordinates { display: flex; gap: 50px; }
.hero-coordinates div { display: grid; gap: 6px; }
.hero-coordinates span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.hero-coordinates strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 16px; font-weight: 600; }
.sky-visual { position: relative; min-height: 300px; overflow: hidden; border-left: 1px solid rgba(110, 155, 207, .16); background: radial-gradient(circle at 50% 43%, rgba(20, 225, 157, .17), transparent 3%), radial-gradient(circle at 42% 35%, rgba(110, 155, 207, .13), transparent 25%), radial-gradient(circle at 75% 20%, #ebf4ff 0 1px, transparent 1.5px), radial-gradient(circle at 21% 70%, #6e9bcf 0 1px, transparent 1.5px), radial-gradient(circle at 68% 76%, #ebf4ff 0 1px, transparent 1.5px), #17242c; background-size: auto, auto, 87px 87px, 110px 110px, 143px 143px, auto; }
.reticle { position: absolute; left: 50%; top: 43%; width: 134px; height: 134px; border: 1px solid rgba(71, 235, 180, .38); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 28px rgba(71, 235, 180, .025); }
.reticle::before, .reticle::after { content: ""; position: absolute; background: rgba(71, 235, 180, .36); }
.reticle::before { width: 168px; height: 1px; left: -18px; top: 66px; }
.reticle::after { width: 1px; height: 168px; left: 66px; top: -18px; }
.reticle i { position: absolute; inset: 43px; border: 1px solid var(--green-bright); border-radius: 50%; box-shadow: 0 0 16px rgba(20, 225, 157, .35); }
.sky-label { position: absolute; left: 24px; bottom: 22px; color: var(--muted); font-size: 9px; line-height: 1.6; letter-spacing: .11em; }
.sky-label strong { color: var(--text); font-size: 11px; }
.hero-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(115, 129, 145, .2); background: rgba(13, 23, 29, .38); }
.hero-stats div { display: grid; gap: 4px; padding: 18px 30px; border-right: 1px solid rgba(115, 129, 145, .16); }
.hero-stats div:last-child { border: 0; }
.hero-stats span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.hero-stats strong { font-size: 15px; }
.hero-stats small { color: #74808c; font-size: 10px; }

.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-title span, .panel-heading > div > span { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.section-title h2, .panel-heading h2 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.025em; }
.section-title small { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.section-title small b { color: var(--text); font-weight: 600; }
.systems-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 38px; }
.system-card { min-width: 0; padding: 20px; background: var(--panel); border: 1px solid rgba(115, 129, 145, .24); border-radius: 14px; transition: border-color .2s, transform .2s; }
.system-card:hover { transform: translateY(-2px); border-color: rgba(71, 235, 180, .45); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.system-icon { display: grid; place-items: center; width: 35px; height: 35px; color: var(--green-soft); background: rgba(15, 199, 138, .09); border-radius: 9px; font-size: 20px; }
.gps .system-icon { color: var(--blue-soft); background: rgba(52, 101, 157, .18); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--green-soft); font-size: 9px; font-weight: 800; }
.system-card h3 { margin: 19px 0 5px; font-size: 14px; }
.system-card > p { min-height: 30px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.metric { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 18px; }
.metric strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 16px; }
.metric span { color: #77838e; font-size: 9px; text-transform: uppercase; }
.sparkline { display: flex; align-items: flex-end; height: 24px; margin-top: 15px; gap: 4px; }
.sparkline i { flex: 1; height: 40%; background: rgba(15, 199, 138, .18); border-radius: 2px 2px 0 0; }
.sparkline i:nth-child(2), .sparkline i:nth-child(7) { height: 70%; }
.sparkline i:nth-child(3), .sparkline i:nth-child(6) { height: 50%; }
.sparkline i:nth-child(4) { height: 85%; background: rgba(15, 199, 138, .45); }
.sparkline i:nth-child(8) { height: 62%; background: rgba(15, 199, 138, .32); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .65fr); gap: 16px; }
.panel { background: var(--panel); border: 1px solid rgba(115, 129, 145, .24); border-radius: 14px; box-shadow: 0 10px 30px rgba(5, 11, 16, .12); }
.observations-panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 24px; border-bottom: 1px solid rgba(115, 129, 145, .18); }
.text-button { padding: 6px; color: var(--green-soft); background: transparent; border: 0; font-size: 11px; font-weight: 700; }
.text-button span { margin-left: 5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 20px; color: #75818c; background: rgba(17, 25, 32, .28); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .09em; }
td { padding: 17px 20px; color: var(--muted); border-top: 1px solid rgba(115, 129, 145, .12); font-size: 11px; }
tbody tr:first-child td { border-top: 0; }
td strong, td small { display: block; }
td strong { color: var(--text); margin-bottom: 4px; font-size: 12px; }
td small { color: #75818c; font-size: 9px; }
.table-status { display: inline-flex; align-items: center; gap: 6px; color: var(--green-soft); font-size: 9px; }
.table-status.planificada { color: var(--blue-soft); }
.table-status.planificada i { background: var(--blue-soft); }
.empty-state { display: grid; place-items: center; padding: 48px 20px; text-align: center; }
.empty-state span { color: var(--green); font-size: 28px; }
.empty-state h3 { margin: 10px 0 3px; font-size: 14px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }

.raspberry-panel { padding-bottom: 20px; }
.node-name { display: flex; align-items: center; gap: 12px; margin: 20px 22px; padding: 14px; background: rgba(17, 25, 32, .35); border-radius: 10px; }
.node-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--green-soft); background: rgba(15, 199, 138, .1); border-radius: 9px; font-size: 20px; font-weight: 900; }
.node-name div { display: grid; gap: 4px; min-width: 0; }
.node-name strong { overflow: hidden; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; text-overflow: ellipsis; }
.node-name small { color: var(--muted); font-size: 9px; }
.resource { display: grid; gap: 7px; margin: 15px 22px; }
.resource div { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.resource strong { color: var(--text); font-family: "SFMono-Regular", Consolas, monospace; font-weight: 600; }
progress { width: 100%; height: 5px; appearance: none; border: 0; }
progress::-webkit-progress-bar { background: rgba(115, 129, 145, .18); border-radius: 8px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--green), var(--green-bright)); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 8px; }
.node-meta { margin: 20px 22px 18px; padding-top: 12px; border-top: 1px solid rgba(115, 129, 145, .16); }
.node-meta div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 10px; }
.node-meta dt { color: var(--muted); }
.node-meta dd { margin: 0; color: var(--text); }
.secondary-button { width: calc(100% - 44px); margin: 0 22px; color: var(--green-soft); background: rgba(15, 199, 138, .08); border: 1px solid rgba(15, 199, 138, .27); font-size: 11px; }
.secondary-button:hover { background: rgba(15, 199, 138, .14); }
.secondary-button.running { color: var(--bg-deep); background: var(--green-bright); }
.read-only-note { margin: 0 22px; padding: 12px; color: var(--muted); background: rgba(110, 155, 207, .08); border: 1px solid rgba(110, 155, 207, .17); border-radius: 9px; text-align: center; font-size: 10px; }

.flash-stack { margin-bottom: 18px; }
.flash { margin-bottom: 14px; padding: 12px 14px; color: var(--text); background: rgba(110, 155, 207, .12); border: 1px solid rgba(110, 155, 207, .3); border-radius: 9px; font-size: 12px; }
.flash.error { background: rgba(255, 107, 122, .1); border-color: rgba(255, 107, 122, .3); }
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.admin-card { padding: 28px; }
.admin-card > span { color: var(--green); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.admin-card h2 { margin: 25px 0 8px; font-size: 20px; }
.admin-card p { min-height: 62px; margin: 0 0 25px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-card button { padding: 9px 12px; color: var(--muted); background: transparent; border: 1px solid rgba(115, 129, 145, .25); border-radius: 8px; font-size: 10px; }
.error-page { display: grid; place-items: start; max-width: 600px; padding: 10vh 0; }
.error-page > span { color: var(--green); font-family: "SFMono-Regular", Consolas, monospace; font-size: 18px; }
.error-page h1 { margin: 17px 0 8px; font-size: 42px; }
.error-page p { margin: 0; color: var(--muted); }

@media (max-width: 1180px) {
    :root { --sidebar: 205px; }
    .systems-grid { grid-template-columns: repeat(3, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .raspberry-panel { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 16px; }
    .raspberry-panel .panel-heading, .raspberry-panel .node-meta, .raspberry-panel .secondary-button, .raspberry-panel .read-only-note { grid-column: 1 / -1; }
    .raspberry-panel .node-name { grid-column: 1 / -1; }
    .raspberry-panel .resource { margin-inline: 22px; }
}

@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; }
    .login-art { position: absolute; z-index: 0; inset: 0; min-height: 100svh; padding: 0; background-position: center calc(50% + 110px); }
    .login-art-copy { display: none; }
    .login-panel { position: relative; z-index: 1; place-items: start center; min-height: 100svh; padding-bottom: 150px; border: 0; background: linear-gradient(180deg, rgba(17, 25, 32, .8) 0%, rgba(17, 25, 32, .52) 55%, rgba(17, 25, 32, .06) 84%); }
    .sidebar { width: 250px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.3); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-scrim { position: fixed; z-index: 45; inset: 0; display: block; visibility: hidden; opacity: 0; background: rgba(5, 10, 15, .62); transition: .25s; }
    .sidebar.open ~ .app-frame + .sidebar-scrim { visibility: visible; opacity: 1; }
    .app-frame { margin-left: 0; padding-top: 58px; }
    .mobile-header { position: fixed; z-index: 42; inset: 0 0 auto; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 8px 18px; background: rgba(19, 28, 36, .96); border-bottom: 1px solid rgba(115, 129, 145, .2); }
    .mobile-header img { width: 42px; height: 42px; object-fit: contain; border-radius: 9px; }
    .mobile-menu { width: 40px; height: 40px; color: var(--text); background: transparent; border: 0; font-size: 20px; }
    .topbar { position: static; }
    .station-hero { grid-template-columns: 1fr .8fr; }
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .login-art { background-position: center calc(50% + 135px); }
    .login-panel { min-height: 100svh; padding: 22px 18px 160px; }
    .login-card { padding: 24px 22px; background: rgba(29, 38, 47, .84); }
    .login-logo { width: 200px; height: 46px; margin-bottom: 28px; }
    .login-heading h2 { font-size: 29px; }
    .login-heading p { margin-bottom: 24px; }
    .login-form { gap: 15px; }
    .login-secondary-action { margin-top: 17px; }
    .demo-note { margin-top: 24px; padding-top: 16px; }
    .photo-credit { right: 14px; bottom: 12px; }
    .wordmark { display: none; }
    .topbar { justify-content: flex-end; height: 62px; padding-inline: 20px; }
    .user-copy { display: none; }
    .main-content { padding: 28px 16px 45px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .telescope-picker { min-width: 0; }
    .station-hero { grid-template-columns: 1fr; }
    .hero-main { min-height: 280px; padding: 25px 23px; }
    .hero-coordinates { gap: 22px; }
    .sky-visual { min-height: 220px; border-top: 1px solid rgba(110, 155, 207, .16); border-left: 0; }
    .hero-stats { grid-template-columns: 1fr; }
    .hero-stats div { border-right: 0; border-bottom: 1px solid rgba(115, 129, 145, .16); }
    .section-title { align-items: flex-start; flex-direction: column; }
    .systems-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-card { padding: 16px; }
    .systems-grid .system-card:last-child { grid-column: 1 / -1; }
    .raspberry-panel { display: block; }
    table { min-width: 560px; }
    .panel-heading { padding: 19px; }
}

@media (max-width: 420px) {
    .systems-grid { grid-template-columns: 1fr; }
    .systems-grid .system-card:last-child { grid-column: auto; }
    .system-card > p { min-height: 0; }
    .hero-coordinates { flex-direction: column; gap: 12px; }
}

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

/* Vision control workspace */
.control-heading { margin-bottom: 34px; }
.vision-section { margin-bottom: 22px; scroll-margin-top: 90px; }
.vision-title-row { align-items: center; }
.vision-actions { display: flex; align-items: center; gap: 10px; }
.vision-actions label { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.vision-actions select, .history-filters select, .history-filters input {
    min-height: 38px;
    padding: 0 34px 0 12px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid rgba(115, 129, 145, .35);
    border-radius: 8px;
    outline: 0;
    font-size: 11px;
}
.simulation-chip { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; padding: 8px 10px; color: var(--blue-soft); background: rgba(52, 101, 157, .12); border: 1px solid rgba(110, 155, 207, .2); border-radius: 20px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.simulation-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-soft); box-shadow: 0 0 8px rgba(110, 155, 207, .7); }
.vision-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.vision-card { min-width: 0; overflow: hidden; background: #202c36; border: 1px solid rgba(115, 129, 145, .28); border-radius: 14px; box-shadow: 0 14px 38px rgba(5, 11, 16, .18); }
.vision-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 17px; border-bottom: 1px solid rgba(115, 129, 145, .2); }
.vision-card header div { min-width: 0; }
.vision-card header span:first-child { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.vision-card h3 { margin: 4px 0 0; font-size: 14px; }
.vision-card .status-pill { flex: 0 0 auto; }
.status-pill.blue { color: var(--blue-soft); }
.status-pill.blue i { background: var(--blue-soft); box-shadow: 0 0 8px rgba(110, 155, 207, .5); }
.canvas-wrap { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #070c10; }
.canvas-wrap canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.canvas-stamp { position: absolute; left: 11px; bottom: 9px; padding: 4px 6px; color: rgba(235, 244, 255, .72); background: rgba(5, 10, 14, .58); border-radius: 4px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 7px; letter-spacing: .08em; backdrop-filter: blur(5px); }
.confidence-overlay { position: absolute; top: 10px; right: 10px; display: grid; padding: 7px 9px; background: rgba(10, 19, 24, .72); border: 1px solid rgba(71, 235, 180, .34); border-radius: 7px; backdrop-filter: blur(5px); }
.confidence-overlay small { color: var(--muted); font-size: 6px; letter-spacing: .13em; }
.confidence-overlay strong { color: var(--green-soft); font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.vision-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 13px; color: #788590; background: rgba(13, 21, 27, .4); font-family: "SFMono-Regular", Consolas, monospace; font-size: 7px; }
.vision-card footer b { color: var(--text); }

.telemetry-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-bottom: 22px; }
.telemetry-panel { overflow: hidden; }
.signal-bars { display: flex; align-items: flex-end; height: 22px; gap: 3px; }
.signal-bars i { width: 4px; height: 7px; background: var(--green); border-radius: 2px; }
.signal-bars i:nth-child(2) { height: 11px; }
.signal-bars i:nth-child(3) { height: 16px; }
.signal-bars i:nth-child(4) { height: 21px; }
.telemetry-values { display: grid; grid-template-columns: repeat(5, 1fr); }
.telemetry-values > div { display: grid; gap: 5px; padding: 18px 19px; border-right: 1px solid rgba(115, 129, 145, .14); }
.telemetry-values > div:last-child { border: 0; }
.telemetry-values span, .object-metrics span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.telemetry-values strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.telemetry-values small { color: #6e7a85; font-size: 8px; }
.control-safety { margin-bottom: 22px; overflow: hidden; }
.control-safety-heading { padding: 22px 24px; border-bottom: 1px solid rgba(115, 129, 145, .16); }
.control-mode-chip { padding: 8px 12px; color: var(--blue-soft); background: rgba(52, 101, 157, .1); border: 1px solid rgba(110, 155, 207, .2); border-radius: 999px; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.control-mode-chip.safe { color: var(--green-soft); border-color: rgba(15, 199, 138, .3); }
.control-mode-chip.danger { color: #ff8a96; border-color: rgba(255, 101, 117, .35); }
.control-telemetry { display: grid; grid-template-columns: repeat(6, 1fr); }
.control-telemetry > div { display: grid; gap: 6px; min-width: 0; padding: 17px 18px; border-right: 1px solid rgba(115, 129, 145, .14); border-bottom: 1px solid rgba(115, 129, 145, .14); }
.control-telemetry > div:last-child { border-right: 0; }
.control-telemetry span, .interlock-box span, .control-events > span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.control-telemetry strong { overflow: hidden; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.control-telemetry small { color: #71808e; font-size: 8px; }
.control-safety-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.interlock-box { display: grid; gap: 5px; }
.interlock-box strong { color: var(--green-soft); font-size: 11px; }
.interlock-box strong.danger { color: #ff8a96; }
.control-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.control-buttons button, .fault-test-row button { min-height: 38px; padding: 0 14px; border-radius: 8px; font-size: 9px; font-weight: 900; }
.maintenance-button { color: var(--blue-soft); background: rgba(52, 101, 157, .12); border: 1px solid rgba(110, 155, 207, .25); }
.maintenance-button.active { color: #17221e; background: #ffcc66; border-color: #ffcc66; }
.emergency-button { color: #fff; background: #b73142; border: 1px solid #e25566; }
.emergency-reset { color: var(--muted); background: transparent; border: 1px solid rgba(115, 129, 145, .25); }
.control-buttons button:disabled, .fault-test-row button:disabled { cursor: not-allowed; opacity: .38; }
.fault-test-row { display: flex; align-items: center; gap: 9px; padding: 0 22px 18px; }
.fault-test-row label { color: var(--muted); font-size: 9px; font-weight: 800; }
.fault-test-row select { min-height: 36px; color: var(--text); background: var(--panel); border: 1px solid rgba(115, 129, 145, .24); border-radius: 7px; }
.fault-test-row button { color: var(--blue-soft); background: rgba(52, 101, 157, .1); border: 1px solid rgba(110, 155, 207, .2); }
.fault-test-row small { color: #71808e; font-size: 8px; }
.control-events { padding: 17px 22px 20px; background: rgba(14, 25, 34, .28); border-top: 1px solid rgba(115, 129, 145, .14); }
.control-events ol { display: grid; gap: 7px; max-height: 145px; margin: 10px 0 0; padding: 0; overflow: auto; list-style: none; }
.control-events li { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 9px; }
.control-events li::before { width: 6px; height: 6px; flex: 0 0 6px; background: var(--blue-soft); border-radius: 50%; content: ""; }
.control-events li.warning::before { background: #ffcc66; }
.control-events li.critical::before { background: #ff6575; }
.visitor-public-panel { margin-bottom: 22px; overflow: hidden; }
.visitor-status-grid { grid-template-columns: repeat(5, 1fr); }
.visitor-public-note { align-items: stretch; }
.visitor-privacy-copy { display: grid; min-height: 150px; place-items: center; padding: 28px; }
.visitor-privacy-copy p { max-width: 600px; margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.75; }
.moon-symbol { color: var(--green-soft); font-size: 30px; }
.object-metrics { display: grid; grid-template-columns: repeat(2, 1fr); }
.object-metrics > div { display: grid; gap: 7px; padding: 17px 20px; border-right: 1px solid rgba(115, 129, 145, .14); border-bottom: 1px solid rgba(115, 129, 145, .14); }
.object-metrics > div:nth-child(even) { border-right: 0; }
.object-metrics > div:nth-child(n+3) { border-bottom: 0; }
.object-metrics strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.green-text { color: var(--green-soft); }
.blue-text { color: var(--blue-soft); }

.settings-section, .mobile-evidence-section, .history-section { margin-bottom: 22px; overflow: hidden; scroll-margin-top: 90px; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 27px; border-bottom: 1px solid rgba(115, 129, 145, .18); }
.settings-heading > div > span { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.settings-heading h2 { margin: 6px 0 3px; font-size: 21px; }
.settings-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.role-lock, .history-count { padding: 8px 10px; color: var(--muted); background: rgba(64, 83, 104, .25); border: 1px solid rgba(115, 129, 145, .2); border-radius: 20px; font-size: 9px; }
.settings-tabs { display: flex; gap: 3px; overflow-x: auto; padding: 11px 18px 0; background: rgba(17, 25, 32, .18); border-bottom: 1px solid rgba(115, 129, 145, .16); }
.settings-tab { position: relative; flex: 0 0 auto; min-height: 42px; padding: 0 15px 10px; color: var(--muted); background: transparent; border: 0; font-size: 11px; font-weight: 750; }
.settings-tab::after { content: ""; position: absolute; right: 15px; bottom: -1px; left: 15px; height: 2px; background: transparent; }
.settings-tab.active { color: var(--text); }
.settings-tab.active::after { background: var(--green-bright); }
#settings-root { padding: 25px 27px 27px; }
.settings-context { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.settings-context h3 { margin: 0 0 5px; font-size: 16px; }
.settings-context p { max-width: 660px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.auto-button, .profile-select { min-height: 36px; padding: 0 12px; color: var(--blue-soft); background: rgba(52, 101, 157, .11); border: 1px solid rgba(110, 155, 207, .25); border-radius: 8px; font-size: 10px; font-weight: 800; }
.auto-button:disabled { cursor: not-allowed; opacity: .42; }
.profile-wrap { display: flex; align-items: center; gap: 8px; }
.profile-wrap label { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.profile-select { color: var(--text); }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
.manual-control { padding: 15px; background: rgba(17, 25, 32, .28); border: 1px solid rgba(115, 129, 145, .16); border-radius: 10px; }
.control-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.control-label-row label { font-size: 11px; font-weight: 750; }
.control-label-row small { color: #74808c; font-size: 8px; }
.numeric-control { display: grid; grid-template-columns: minmax(90px, 1fr) 32px 86px 32px; align-items: center; gap: 7px; }
.numeric-control input[type="range"] { width: 100%; accent-color: var(--green); }
.numeric-control input[type="number"], .select-control { width: 100%; height: 34px; padding: 0 8px; color: var(--text); background: #1b252e; border: 1px solid rgba(115, 129, 145, .32); border-radius: 7px; outline: 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.step-button { display: grid; place-items: center; width: 32px; height: 32px; color: var(--green-soft); background: rgba(15, 199, 138, .07); border: 1px solid rgba(15, 199, 138, .2); border-radius: 7px; font-size: 16px; }
.step-button:hover { background: rgba(15, 199, 138, .13); }
.manual-control.disabled { opacity: .5; }
.settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 19px; border-top: 1px solid rgba(115, 129, 145, .15); }
.settings-actions .scope-note { margin-right: auto; color: var(--muted); font-size: 9px; }
.apply-settings, .reset-settings, .acquisition-trigger { min-height: 38px; padding: 0 15px; border-radius: 8px; font-size: 10px; font-weight: 800; }
.apply-settings { color: #10231d; background: var(--green-bright); border: 0; }
.reset-settings { color: var(--muted); background: transparent; border: 1px solid rgba(115, 129, 145, .3); }
.acquisition-trigger { color: var(--blue-soft); background: rgba(52, 101, 157, .1); border: 1px solid rgba(110, 155, 207, .22); }
.acquisition-trigger.running { color: #10231d; background: var(--green-bright); border-color: var(--green-bright); }
.apply-settings:disabled, .reset-settings:disabled, .acquisition-trigger:disabled { cursor: not-allowed; opacity: .4; }
.permission-note { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 10px 12px; color: var(--muted); background: rgba(110, 155, 207, .07); border-radius: 8px; font-size: 9px; }
.permission-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-soft); }

.mobile-evidence-heading { border-bottom: 0; }
.mobile-evidence-tabs { display: flex; gap: 4px; padding: 10px 24px 0; background: rgba(17, 25, 32, .24); border-top: 1px solid rgba(115, 129, 145, .14); border-bottom: 1px solid rgba(115, 129, 145, .16); }
.mobile-evidence-tab { position: relative; min-height: 42px; padding: 0 15px 10px; color: var(--muted); background: transparent; border: 0; font-size: 11px; font-weight: 750; }
.mobile-evidence-tab::after { position: absolute; right: 15px; bottom: -1px; left: 15px; height: 2px; background: transparent; content: ""; }
.mobile-evidence-tab.active { color: var(--text); }
.mobile-evidence-tab.active::after { background: var(--green-bright); }
.mobile-evidence-panel { padding: 25px 27px 27px; }
.mobile-evidence-panel[hidden] { display: none; }
.mobile-evidence-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 16px; }
.mobile-evidence-form label { display: grid; gap: 8px; color: var(--text); font-size: 10px; font-weight: 750; }
.mobile-evidence-form label > small { color: var(--muted); font-size: 9px; font-weight: 500; }
.mobile-evidence-form input:not([type="file"]), .mobile-evidence-form select { width: 100%; min-height: 42px; padding: 0 12px; color: var(--text); background: #1b252e; border: 1px solid rgba(115, 129, 145, .32); border-radius: 8px; outline: 0; }
.mobile-file-field { grid-column: 1 / -1; padding: 16px; background: rgba(17, 25, 32, .28); border: 1px dashed rgba(71, 235, 180, .28); border-radius: 10px; }
.mobile-file-field input { width: 100%; color: var(--muted); font-size: 10px; }
.mobile-file-field input::file-selector-button { min-height: 36px; margin-right: 12px; padding: 0 13px; color: #10231d; background: var(--green-bright); border: 0; border-radius: 7px; font-size: 10px; font-weight: 800; }
.mobile-evidence-submit, .copy-mobile-link { min-height: 40px; padding: 0 16px; color: #10231d; background: var(--green-bright); border: 0; border-radius: 8px; font-size: 10px; font-weight: 850; }
.mobile-evidence-submit { justify-self: end; }
.mobile-evidence-submit:disabled { cursor: not-allowed; opacity: .4; }
.mobile-evidence-warning { margin: 0; padding: 11px 13px; color: #ff9ba5; background: rgba(255, 101, 117, .08); border: 1px solid rgba(255, 101, 117, .2); border-radius: 8px; font-size: 10px; line-height: 1.5; }
.mobile-connection-guide { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px; }
.mobile-connection-guide ol { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: mobile-step; }
.mobile-connection-guide li { position: relative; display: grid; gap: 6px; min-height: 104px; padding: 17px 16px 15px 47px; background: rgba(17, 25, 32, .28); border: 1px solid rgba(115, 129, 145, .16); border-radius: 10px; counter-increment: mobile-step; }
.mobile-connection-guide li::before { position: absolute; top: 15px; left: 15px; display: grid; place-items: center; width: 24px; height: 24px; color: var(--green-soft); background: rgba(15, 199, 138, .1); border-radius: 50%; content: counter(mobile-step); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; font-weight: 850; }
.mobile-connection-guide li strong { font-size: 11px; }
.mobile-connection-guide li span, .mobile-connection-guide > p { color: var(--muted); font-size: 10px; line-height: 1.6; }
.mobile-connection-guide > p { margin: 0; }

.history-heading { border-bottom: 0; }
.history-filters { display: grid; grid-template-columns: 1.05fr .9fr 1fr .9fr auto auto; align-items: end; gap: 9px; padding: 16px 25px; background: rgba(17, 25, 32, .32); border-top: 1px solid rgba(115, 129, 145, .14); border-bottom: 1px solid rgba(115, 129, 145, .16); }
.history-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.history-filters input { width: 100%; padding-right: 10px; }
.filter-button { min-height: 38px; padding: 0 16px; color: #10231d; background: var(--green-bright); border: 0; border-radius: 8px; font-size: 10px; font-weight: 800; }
.clear-filter { display: grid; place-items: center; min-height: 38px; padding: 0 10px; color: var(--muted); font-size: 9px; }
.history-table { min-width: 990px; }
.history-table td { white-space: nowrap; }
.history-table td:nth-child(4) { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.mono-code { color: var(--green-soft) !important; font-family: "SFMono-Regular", Consolas, monospace; }
.confidence-cell { color: var(--green-soft); font-family: "SFMono-Regular", Consolas, monospace; }
.table-status.interrumpida { color: #ffb36b; }
.table-status.interrumpida i { background: #ff9f43; }
.table-status.en_curso { color: var(--blue-soft); }
.table-status.en_curso i { background: var(--blue-soft); }
.table-status.fallida { color: #ff8a96; }
.table-status.fallida i { background: #ff6575; }
.download-button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 9px; color: var(--blue-soft); background: rgba(52, 101, 157, .09); border: 1px solid rgba(110, 155, 207, .2); border-radius: 7px; font-size: 9px; font-weight: 800; }
.evidence-downloads { display: flex; flex-wrap: wrap; gap: 5px; min-width: 150px; }
.evidence-unavailable { color: var(--text-muted); white-space: nowrap; }
.download-button:hover { background: rgba(52, 101, 157, .17); }
.save-toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; visibility: hidden; max-width: 330px; padding: 13px 16px; color: var(--text); background: #16231f; border: 1px solid rgba(71, 235, 180, .38); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: .2s; font-size: 11px; }
.save-toast.show { visibility: visible; opacity: 1; transform: translateY(0); }
.save-toast.error { background: #2b1d22; border-color: rgba(255, 107, 122, .4); }

@media (max-width: 1250px) {
    .vision-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .final-card { grid-column: 1 / -1; width: calc(50% - 7px); justify-self: center; }
    .telemetry-grid { grid-template-columns: 1fr; }
    .control-telemetry { grid-template-columns: repeat(3, 1fr); }
    .history-filters { grid-template-columns: repeat(4, 1fr); }
    .filter-button, .clear-filter { grid-column: auto; }
}

@media (max-width: 800px) {
    .vision-title-row, .vision-actions { align-items: flex-start; flex-direction: column; }
    .vision-grid { grid-template-columns: 1fr; }
    .final-card { grid-column: auto; width: 100%; }
    .telemetry-values { grid-template-columns: repeat(2, 1fr); }
    .control-telemetry { grid-template-columns: repeat(2, 1fr); }
    .visitor-status-grid { grid-template-columns: repeat(2, 1fr); }
    .control-safety-row, .fault-test-row { align-items: stretch; flex-direction: column; }
    .telemetry-values > div { border-bottom: 1px solid rgba(115, 129, 145, .14); }
    .telemetry-values > div:nth-child(even) { border-right: 0; }
    .control-grid { grid-template-columns: 1fr; }
    .history-filters { grid-template-columns: repeat(2, 1fr); }
    .settings-heading { align-items: flex-start; flex-direction: column; }
    .mobile-connection-guide ol { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .vision-actions { width: 100%; }
    .vision-actions select { width: 100%; }
    .telemetry-values, .object-metrics { grid-template-columns: 1fr; }
    .control-telemetry { grid-template-columns: 1fr; }
    .visitor-status-grid { grid-template-columns: 1fr; }
    .telemetry-values > div, .object-metrics > div { border-right: 0; border-bottom: 1px solid rgba(115, 129, 145, .14); }
    .object-metrics > div:nth-child(n+3) { border-bottom: 1px solid rgba(115, 129, 145, .14); }
    .object-metrics > div:last-child, .telemetry-values > div:last-child { border-bottom: 0; }
    #settings-root { padding: 20px 15px; }
    .numeric-control { grid-template-columns: 1fr 32px 76px 32px; }
    .settings-context, .settings-actions { align-items: stretch; flex-direction: column; }
    .settings-actions .scope-note { margin: 0 0 5px; }
    .history-filters { grid-template-columns: 1fr; }
    .mobile-evidence-tabs { overflow-x: auto; padding-inline: 13px; }
    .mobile-evidence-panel { padding: 20px 15px; }
    .mobile-evidence-form { grid-template-columns: 1fr; }
    .mobile-file-field { grid-column: auto; }
    .mobile-evidence-submit { width: 100%; justify-self: stretch; }
    .mobile-connection-guide { grid-template-columns: 1fr; }
    .copy-mobile-link { width: 100%; }
}

/* Raspberry Pi USB camera */
.camera-stream { position: absolute; inset: 0; display: none; width: 100%; height: 100%; object-fit: cover; background: #050a0e; }
.canvas-wrap.real-stream canvas { display: none; }
.canvas-wrap.real-stream .camera-stream { display: block; }
.camera-hardware-panel { margin-bottom: 14px; overflow: hidden; background: rgba(52, 101, 157, .08); border: 1px solid rgba(110, 155, 207, .24); border-radius: 12px; }
.camera-hardware-panel[hidden] { display: none; }
.hardware-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; border-bottom: 1px solid rgba(110, 155, 207, .16); }
.hardware-summary > div:first-child { display: flex; align-items: center; gap: 10px; }
.hardware-summary > div:first-child > div { display: grid; gap: 3px; }
.hardware-summary strong { font-size: 11px; }
.hardware-summary small { color: var(--muted); font-size: 9px; }
.hardware-state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue-soft); box-shadow: 0 0 0 5px rgba(110, 155, 207, .1); }
.camera-hardware-panel.streaming .hardware-state-dot { background: var(--green-bright); box-shadow: 0 0 0 5px rgba(20, 225, 157, .1); }
.camera-hardware-panel.error .hardware-state-dot { background: #ff6b7a; box-shadow: 0 0 0 5px rgba(255, 107, 122, .1); }
.camera-profile-picker { display: flex; align-items: center; gap: 8px; }
.camera-profile-picker label { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.camera-profile-picker select, .camera-profile-picker button { min-height: 34px; padding: 0 10px; border-radius: 7px; font-size: 9px; }
.camera-profile-picker select { color: var(--text); background: var(--panel); border: 1px solid rgba(115, 129, 145, .3); }
.camera-profile-picker button { color: #10231d; background: var(--green-bright); border: 0; font-weight: 800; }
.camera-profile-picker button:disabled { cursor: not-allowed; opacity: .4; }
.hardware-details { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0; }
.hardware-details > div { padding: 14px 18px; border-right: 1px solid rgba(110, 155, 207, .13); }
.hardware-details > div:last-child { border: 0; }
.hardware-details > div > span { color: var(--blue-soft); font-size: 7px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.capability-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.capability-list i { padding: 4px 6px; color: var(--muted); background: rgba(17, 25, 32, .34); border: 1px solid rgba(115, 129, 145, .17); border-radius: 5px; font-style: normal; font-family: "SFMono-Regular", Consolas, monospace; font-size: 7px; }
.capability-list i.unsupported { text-decoration: line-through; opacity: .42; }
.physical-focus-note p { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.hardware-control-note { display: block; margin-top: 6px; color: #ffb36b; font-size: 8px; }
.confidence-components { display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(12, 20, 26, .48); border-top: 1px solid rgba(115, 129, 145, .13); }
.confidence-components span { padding: 6px 8px; color: var(--muted); border-right: 1px solid rgba(115, 129, 145, .11); font-size: 7px; text-align: center; text-transform: uppercase; }
.confidence-components span:last-child { border: 0; }
.confidence-components b { color: var(--green-soft); font-family: "SFMono-Regular", Consolas, monospace; }

@media (max-width: 900px) {
    .hardware-summary { align-items: flex-start; flex-direction: column; }
    .hardware-details { grid-template-columns: 1fr; }
    .hardware-details > div { border-right: 0; border-bottom: 1px solid rgba(110, 155, 207, .13); }
}

@media (max-width: 560px) {
    .camera-profile-picker { align-items: stretch; flex-direction: column; width: 100%; }
}
