:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #0d1117;
  color: #e6edf3;
}
body { margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 24px; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.05rem; }
.panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  margin: 14px 0;
  padding: 18px;
}
.connection, .actions, .velocity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
input, button {
  border: 1px solid #484f58;
  border-radius: 6px;
  background: #21262d;
  color: inherit;
  padding: 9px 14px;
}
button { cursor: pointer; font-weight: 650; }
button:disabled { cursor: not-allowed; opacity: .42; }
.danger { background: #b62324; border-color: #f85149; }
.motion-settings {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #30363d;
  border-radius: 7px;
}
.motion-settings legend { padding: 0 6px; color: #b1c2d5; font-weight: 650; }
.motion-settings-grid { display: grid; gap: 10px; }
.motion-settings-grid label { display: grid; gap: 5px; color: #b1c2d5; font-size: .9rem; }
.motion-settings-grid input[type="number"] { width: 100%; box-sizing: border-box; }
.badge { padding: 6px 10px; border-radius: 20px; background: #30363d; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.3fr);
  gap: 14px;
}
.dashboard-grid .panel { margin: 0; }
.latency-grid { display: grid; gap: 9px; }
.latency-grid div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #0d1117;
  border-left: 3px solid #30363d;
  padding: 9px 11px;
  border-radius: 6px;
}
.latency-grid .primary-metric { border-left-color: #2f81f7; }
.latency-grid span, .metric-note { color: #8b949e; font-size: .82rem; }
.latency-grid strong { font-size: .9rem; overflow-wrap: anywhere; }
.metric-note { margin-bottom: 0; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.status-grid div { display: flex; flex-direction: column; background: #0d1117; padding: 10px; border-radius: 6px; }
.status-grid span { color: #8b949e; font-size: .82rem; }
.status-grid strong { overflow-wrap: anywhere; }
.status-grid .wide-status { grid-column: 1 / -1; }
pre { min-height: 80px; white-space: pre-wrap; color: #8b949e; }
.camera-heading, .camera-footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.camera-heading h2 { margin-right: auto; }
.camera-heading label { font-size: .9rem; }
.camera-viewport { position: relative; background: #05080c; border-radius: 8px; overflow: hidden; }
.camera-viewport video { display: block; width: 100%; height: min(52vh, 480px); object-fit: contain; }
.camera-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  background: #05080ce6; color: #b1c2d5; text-align: center; }
.camera-overlay[hidden] { display: none; }
.camera-footer { justify-content: space-between; padding-top: 10px; color: #8b949e; font-size: .85rem; }
.camera-viewport:fullscreen video { height: 100vh; }
@media (max-width: 920px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* The tower theme is scoped so the local monitor keeps its existing layout. */
[hidden] { display: none !important; }
.control-page { background: #061322 radial-gradient(ellipse at 46% 0, #0e3151, transparent 54%); color: #e8f2ff; font: 14px "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif; }
.control-page * { box-sizing: border-box; }
.control-main { max-width: 2080px; min-height: 100vh; padding: 22px 28px 25px; display: flex; flex-direction: column; gap: 16px; }
.control-main h1, .control-main h2, .control-main p { margin: 0; }
.control-main h2 { font-size: 15px; letter-spacing: 1px; font-weight: 600; }
.control-page button, .control-page input { font: inherit; }
.control-main button { min-height: 34px; font-size: 13px; font-weight: 500; color: #cbe5fb; background: #112e48; border: 1px solid #315e87; border-radius: 5px; padding: 8px 17px; white-space: nowrap; }
.control-main button:disabled { opacity: 1; color: #839bb1; background: #0a1c2d; border-color: #233e58; }
.control-page :is(button, input, select, summary):focus-visible { outline: 2px solid #79c8ff; outline-offset: 3px; }
.control-main button:not(:disabled):hover { filter: brightness(1.15); }
.control-main .primary-action { background: linear-gradient(#246195, #1b4874); border-color: #4384b5; color: #fff; }
.control-main .panel { position: relative; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 1px solid #2a5981; border-radius: 8px; background: linear-gradient(140deg, #102b4438, transparent), #091d30; box-shadow: inset 0 1px 0 #529bd624, 0 5px 25px #0002; }
.control-main .panel::before { content: ""; position: absolute; left: 0; top: 0; width: 36px; height: 2px; background: #70bded; opacity: .75; border-radius: 8px 0 0; }
.control-main .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.control-main .panel-heading { min-height: 45px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 17px; border-bottom: 1px solid #25455f; background: linear-gradient(90deg, #17406470, transparent); border-radius: 8px 8px 0 0; }
.control-main .heading-icon { color: #77bbe7; margin-right: 8px; vertical-align: middle; }
.control-main .field-caption { color: #87a8c4; font-size: 11px; }
.control-main .badge { font-size: 12px; padding: 5px 11px; border: 1px solid #365776; background: #122a40; color: #9bb7ce; border-radius: 20px; }
.control-main .badge.online { color: #6eecb1; background: #0e3b36; border-color: #235449; }
.control-main .muted-pill { font-size: 10px; border: 1px solid #365776; border-radius: 3px; color: #87afcd; padding: 3px 7px; white-space: nowrap; }
.control-main .muted-pill.online { color: #6eecb1; border-color: #235449; }
.control-main .urgent { color: #ffb5b5 !important; }
.control-header { position: sticky; top: 0; z-index: 10; min-height: 80px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 6px 12px; border-bottom: 1px solid #28649b; background: linear-gradient(180deg, #061322, #0b2641); }
.control-header::after { content: ""; position: absolute; bottom: -1px; left: 30%; width: 40%; height: 1px; background: #62beff; box-shadow: 0 0 14px #36a1fa; }
.control-brand { display: flex; align-items: center; gap: 13px; }
.control-brand .brand-mark { width: 44px; height: 44px; color: #70c7ff; }
.control-brand strong { font-size: 29px; letter-spacing: 5px; }
.control-brand small { display: block; font: 10px sans-serif; letter-spacing: 2px; color: #7da6c5; margin-top: 3px; }
.control-header h1 { font-size: 27px; letter-spacing: 4px; font-weight: 600; text-shadow: 0 0 25px #3c9be76b; white-space: nowrap; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 26px; }
.tower-date { font-size: 12px; color: #8badc9; letter-spacing: 1px; white-space: nowrap; }
.control-main .emergency-stop { min-width: 206px; min-height: 65px; display: flex; align-items: center; justify-content: center; gap: 17px; color: white; border: 1px solid #ff8c8c; border-radius: 8px; background: linear-gradient(#ef3d48, #c51f2c); box-shadow: 0 0 23px #e52d3336, inset 0 1px 0 #ff999954; padding: 7px 25px; touch-action: manipulation; }
.control-main .emergency-stop:disabled { color: #fff; background: linear-gradient(#ef3d48, #c51f2c); border-color: #ff8c8c; }
.emergency-stop .stop-symbol { width: 32px; height: 32px; flex-shrink: 0; }
.emergency-stop strong { display: block; font-size: 23px; letter-spacing: 3px; }
.emergency-stop small { display: block; font-size: 11px; letter-spacing: 1px; color: #ffe0e0; }
.emergency-stop kbd { margin-left: 5px; font: inherit; font-size: 12px; }
.control-main .connection-bar { flex-shrink: 0; display: flex; align-items: center; gap: 23px; min-height: 62px; padding: 10px 19px; border-color: #254d73; background: #0b2035b8; }
.robot-selection { display: flex; align-items: center; gap: 16px; padding-right: 23px; border-right: 1px solid #284763; }
.robot-selection > div { min-width: 105px; }
.robot-selection .field-caption { display: block; }
.robot-selection strong { display: block; font-size: 18px; line-height: 23px; letter-spacing: .6px; overflow-wrap: anywhere; }
.tower-summary { display: flex; align-items: center; gap: 7px; }
.tower-summary strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.connection-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.control-main .connection-state { font-size: 12px; color: #8badc9; white-space: nowrap; }
.connection-state::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #56738c; margin-right: 6px; }
.control-main .connection-state.online { color: #abdbc8; }
.connection-state.online::before { background: #62e6a5; box-shadow: 0 0 8px #51de945c; }
.control-main .robot-picker { position: fixed; z-index: 15; top: 180px; left: 28px; width: 380px; max-width: calc(100vw - 24px); max-height: 65vh; overflow-y: auto; padding: 15px; border-color: #467aa0; background: #102b43; box-shadow: 0 20px 60px #0007; }
.robot-picker .section-heading { flex-wrap: wrap; margin-bottom: 13px; }
.robot-picker .section-heading h2 { font-size: 13px; }
.robot-picker .section-heading button { margin-left: auto; padding: 5px 9px; min-height: 28px; font-size: 11px; }
.robot-list { display: grid; gap: 10px; }
.control-main .robot-card { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; text-align: left; white-space: normal; padding: 12px; }
.robot-card strong { grid-column: 1; font-size: 10px; color: #a5c7df; font-weight: 500; }
.robot-card .robot-identifier { grid-column: 1; font-size: 16px; overflow-wrap: anywhere; }
.robot-card .robot-presence { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 11px; color: #8dafca; }
.control-main .robot-card.selected { border-color: #417fab; background: #17486a; color: #e8f2ff; }
.control-main .robot-reserved { display: flex; flex-direction: column; text-align: center; padding: 14px; border: 1px dashed #3a5970; border-radius: 5px; color: #6f94af; font-size: 11px; }
.control-main .robot-reserved strong { font-size: 12px; }
.control-main .ui-notice { color: #cbe5fb; background: #12324b; border: 1px solid #3a6583; border-radius: 6px; padding: 9px 14px; font-size: 12px; }
.control-main .ui-notice.error, .control-main .login-error { color: #ffc3c3; background: #4c2029; border: 1px solid #9b4b59; }
.control-main .dashboard-grid { flex: 1; min-height: 812px; grid-template-columns: minmax(0, 1fr) minmax(340px, 25.2%); gap: 18px; }
.control-main .camera-panel { display: grid; grid-template-rows: 45px minmax(0, 1fr) 39px; }
.camera-heading h2 { margin-right: auto; }
.camera-actions { display: flex; gap: 8px; align-items: center; }
.control-main .camera-actions button { min-height: 26px; border-color: #3a6583; background: #12324b; color: #b5d5ed; font-size: 11px; padding: 4px 11px; }
.control-main .camera-viewport { min-height: 0; margin: 11px 11px 0; background: #050d16; border: 1px solid #213b50; border-radius: 4px; }
.control-main .camera-viewport video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.control-main .camera-overlay { background: #081827f2; color: #8dafca; font-size: 14px; }
.video-live-status { position: absolute; top: 16px; left: 17px; color: #c5dce9; font-size: 11px; text-shadow: 0 1px 5px #000; pointer-events: none; }
.video-indicators { position: absolute; top: 14px; right: 17px; display: flex; align-items: center; gap: 13px; color: #fff; font: 12px sans-serif; text-shadow: 0 1px 3px #000; pointer-events: none; }
.signal-strength { display: inline-flex; align-items: flex-end; height: 16px; gap: 3px; filter: drop-shadow(0 1px 2px #0008); }
.signal-strength i { width: 4px; background: #d9eef473; border-radius: 1px; }
.signal-strength i:nth-child(1) { height: 5px; }
.signal-strength i:nth-child(2) { height: 8px; }
.signal-strength i:nth-child(3) { height: 12px; }
.signal-strength i:nth-child(4) { height: 16px; }
.signal-strength[data-level="1"] i:nth-child(-n+1) { background: #ffaaa3; }
.signal-strength[data-level="2"] i:nth-child(-n+2) { background: #f2d278; }
.signal-strength[data-level="3"] i:nth-child(-n+3), .signal-strength[data-level="4"] i { background: #89edbf; }
.control-main .camera-footer { padding: 0 16px; font-size: 11px; color: #81a2bb; }
.camera-label { font: 10px sans-serif; letter-spacing: 1.5px; color: #608ba9; }
.control-main .fullscreen-estop { display: none; color: #fff; background: #c51f2c; border-color: #ff8c8c; }
.control-main .camera-viewport:fullscreen { margin: 0; width: 100vw; height: 100vh; }
.control-main .camera-viewport:fullscreen .fullscreen-estop { display: block; position: absolute; right: 17px; bottom: 20px; padding: 12px 24px; font-size: 20px; }
.tower-sidebar { display: grid; grid-template-rows: 184px 184px minmax(0, 1fr); gap: 12px; min-height: 0; }
.position-map { height: 106px; position: relative; background: #0b2236; background-image: linear-gradient(#1b3d574a 1px, transparent 1px), linear-gradient(90deg, #1b3d574a 1px, transparent 1px); background-size: 22px 22px; margin: 8px 12px 0; overflow: hidden; border: 1px solid #24425b; border-radius: 4px; }
.position-map .map-outline { position: absolute; width: 100%; height: 100%; stroke: #5687aa; stroke-width: 1.3; opacity: .37; }
.map-placeholder { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; color: #93b4cc; background: #0a2037ed; border: 1px solid #365570; border-radius: 4px; padding: 7px 15px; font-size: 12px; }
.coordinates { height: 22px; display: flex; gap: 40px; align-items: center; justify-content: center; font-size: 10px; color: #84a4bf; letter-spacing: 1px; }
.device-list { padding: 8px 18px; margin: 0; }
.device-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; font-size: 13px; }
.device-list dt { color: #8dafca; flex-shrink: 0; }
.device-list dd { margin: 0; text-align: right; }
.control-main .status-value { color: #9bb7ce; font-size: 13px; }
.control-main .status-value.online { color: #73e4a7; }
.battery-icon { display: inline-block; vertical-align: middle; width: 21px; height: 10px; border: 1px solid #7192ac; border-radius: 2px; margin-right: 8px; position: relative; }
.battery-icon::after { content: ""; width: 2px; height: 4px; background: #7192ac; position: absolute; right: -4px; top: 2px; }
.controls { display: flex; flex-direction: column; }
.controls-body { padding: 13px 16px; display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; }
.gamepad-controls { border: 1px solid #315372; border-radius: 5px; padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; min-height: 132px; color: #8fb0cb; font-size: 11px; }
.input-source-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; color: #8fb0cb; font-size: 11px; }
.input-source-label select { min-width: 0; height: 24px; font: inherit; background: #07192a; color: #d9edfd; border: 1px solid #315372; border-radius: 4px; padding: 2px; }
#gamepad-status { margin: 6px 0; overflow-wrap: anywhere; }
.gamepad-help { font-size: 10px; margin: 3px 0 0; }
#gamepad-speed { float: right; color: #73e4a7; }
#gamepad-inputs { color: #769bb9; }
.direction-controls { margin: 0 auto; width: 100%; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 7px; min-height: 132px; }
.direction-controls .field-caption { text-align: center; font-size: 10px; letter-spacing: 2px; }
.direction-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; max-width: 310px; margin: 0 auto; width: 100%; }
.direction-keys kbd { border: 1px solid #3b6281; background: linear-gradient(#17374f, #102a40); border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 14px; height: 37px; color: #e9f5ff; font: 15px sans-serif; box-shadow: 0 2px 0 #051728; }
.direction-keys kbd span { font-size: 14px; color: #729ebe; }
.direction-keys kbd.pressed { background: #1e5c49; border-color: #73e4a7; }
.control-main .key-help { text-align: center; font-size: 10px; color: #89a9c0; margin: 3px 0 0; }
.control-main .motion-settings { border: 0; border-top: 1px solid #223f58; border-radius: 0; padding: 10px 0 0; margin: 0; min-width: 0; flex-shrink: 0; }
.control-main .motion-settings legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.control-main .motion-settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.control-main .motion-settings-grid label { display: flex; flex-direction: column; gap: 6px; color: #8fb0cb; font-size: 10px; letter-spacing: 1px; min-width: 0; }
.speed-input { display: flex; align-items: center; border: 1px solid #315372; border-radius: 4px; background: #07192a; padding: 6px 7px; gap: 3px; }
.control-main .speed-input input { min-width: 0; width: 100%; color: #d9edfd; border: 0; border-radius: 0; background: transparent; padding: 0; font: 14px sans-serif; -moz-appearance: textfield; }
.speed-input input::-webkit-inner-spin-button, .speed-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.speed-input span { font: 10px sans-serif; color: #769bb9; white-space: nowrap; }
.control-main .start-control { min-height: 36px; font-size: 13px; align-self: stretch; padding: 7px 13px; flex-shrink: 0; }
.control-main .login-dialog { color: #e8f2ff; background: linear-gradient(140deg, #153851, #0a1c30 60%); border: 1px solid #487da6; border-radius: 11px; width: min(550px, calc(100vw - 32px)); padding: 25px; max-height: calc(100vh - 170px); overflow-y: auto; box-shadow: 0 20px 90px #0009; }
.login-dialog::backdrop { background: #020a14ad; }
.control-main .login-dialog h2 { font-size: 23px; letter-spacing: 0; }
.control-main .dialog-close { color: #8cacc4; background: none; border: 0; min-height: 0; font-size: 23px; padding: 0 4px; }
.control-main .login-intro, .control-main #authorization-status { font-size: 12px; color: #92b5cf; margin: 12px 0 19px; line-height: 1.6; }
.control-main .login-dialog label { display: flex; flex-direction: column; gap: 7px; color: #98b7cd; font-size: 12px; }
.control-main .login-dialog input { width: 100%; min-width: 0; background: #07192a; border: 1px solid #375b79; border-radius: 5px; color: #dfeeff; padding: 11px; font-size: 14px; }
.control-main .login-dialog input:disabled { color: #87a8c4; }
.login-device { margin-bottom: 17px; }
.login-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.login-wide { grid-column: 1 / -1; }
.control-main .login-error { padding: 10px; border-radius: 6px; font-size: 12px; overflow-wrap: anywhere; margin-bottom: 12px; }
.control-main #login-submit { width: 100%; min-height: 42px; }
.login-options { margin-top: 19px; padding-top: 14px; border-top: 1px solid #284763; color: #8dafca; font-size: 12px; }
.login-options summary { cursor: pointer; }
.control-main .login-options label { display: flex; flex-direction: row; align-items: center; margin: 16px 0; }
.control-main .login-options input[type="checkbox"] { width: auto; }
.control-main .login-options .metric-note { margin-top: 12px; font-size: 12px; color: #8dafca; }
/* Native dialogs are above the page; this mirrors the same emergency action. */
.control-main .login-emergency-stop { position: fixed; top: 24px; right: 34px; z-index: 1; }
@media (max-width: 1500px) {
  .control-main { padding: 16px 20px 20px; gap: 12px; }
  .control-header { min-height: 74px; gap: 15px; }
  .control-header h1 { font-size: 23px; letter-spacing: 3px; }
  .tower-date { display: none; }
  .control-main .connection-bar { gap: 16px; padding: 10px 14px; }
  .robot-selection { padding-right: 16px; }
  .connection-actions { gap: 8px; }
  .control-main .dashboard-grid { min-height: 788px; gap: 14px; }
  .tower-sidebar { grid-template-rows: 164px 184px minmax(0, 1fr); gap: 10px; }
  .position-map { height: 86px; }
  .control-main .panel-heading { padding: 0 13px; }
  .controls-body { padding: 12px; }
}
@media (max-width: 1100px) {
  .control-main { height: auto; min-height: 100vh; }
  .control-main .connection-bar { flex-wrap: wrap; }
  .connection-actions { justify-content: flex-start; margin-left: 0; width: 100%; }
  .control-main .dashboard-grid { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .control-main .camera-viewport { aspect-ratio: 16 / 9; }
  .tower-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 184px auto; }
  .position-map { height: 106px; }
  .controls { grid-column: 1 / -1; }
  .controls-body { min-height: 375px; }
  .control-main .login-dialog { max-height: calc(100vh - 140px); }
}
@media (max-width: 700px) {
  .control-main { padding: 12px 12px 16px; }
  .control-header { grid-template-columns: 1fr auto; gap: 10px; padding: 6px 4px 10px; min-height: 90px; }
  .control-brand { gap: 7px; }
  .control-brand .brand-mark { width: 30px; height: 30px; }
  .control-brand strong { font-size: 22px; letter-spacing: 3px; }
  .control-brand small { font-size: 8px; letter-spacing: 1px; }
  .control-header h1 { grid-column: 1; grid-row: 2; font-size: 17px; letter-spacing: 2px; }
  .header-actions { grid-column: 2; grid-row: 1 / 3; }
  .control-main .emergency-stop { min-width: 134px; min-height: 64px; gap: 10px; padding: 7px 15px; }
  .emergency-stop strong { font-size: 22px; }
  .emergency-stop .stop-symbol { width: 26px; height: 26px; }
  .control-main .connection-bar { gap: 12px; padding: 12px; }
  .robot-selection { width: 100%; padding-right: 0; border: 0; justify-content: space-between; gap: 10px; }
  .robot-selection > div { min-width: 0; }
  .robot-selection strong { font-size: 16px; }
  .connection-actions { gap: 8px; }
  .connection-actions .connection-state { margin-right: 4px; }
  .control-main .connection-actions button { font-size: 12px; padding: 7px 12px; }
  .control-main .connection-actions .badge { font-size: 11px; padding: 4px 8px; }
  .tower-sidebar { grid-template-columns: minmax(0, 1fr); grid-template-rows: 184px 184px auto; }
  .controls { grid-column: auto; }
  .control-main .camera-panel { grid-template-rows: auto minmax(0, 1fr) auto; }
  .control-main .camera-heading { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .control-main .camera-heading h2 { font-size: 13px; }
  .control-main .camera-actions button { padding: 4px 8px; font-size: 10px; }
  .control-main .camera-footer { min-height: 39px; padding: 10px 12px; font-size: 10px; }
  .camera-label { display: none; }
  .video-live-status { top: 10px; left: 10px; font-size: 10px; }
  .video-indicators { top: 10px; right: 10px; gap: 10px; font-size: 11px; }
  .control-main .login-dialog { padding: 20px; }
  .login-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
}

.monitor-main { max-width: 1500px; }
.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.monitor-header h1 { margin-bottom: 4px; }
.monitor-header p { margin-top: 0; color: #8b949e; }
.badge.offline { background: #6e2b2b; }
.monitor-grid {
  display: grid;
  grid-template-columns: minmax(420px, .9fr) minmax(560px, 1.1fr);
  gap: 14px;
}
.monitor-grid .panel { margin: 0; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detail-grid div, .safety-strip div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #0d1117;
  padding: 10px;
  border-radius: 6px;
}
.detail-grid .wide { grid-column: 1 / -1; }
.detail-grid span, .safety-strip span { color: #8b949e; font-size: .82rem; }
.detail-grid strong, .safety-strip strong { overflow-wrap: anywhere; }
.command-monitor h3 { color: #8b949e; font-size: .9rem; margin-top: 20px; }
.command-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}
.command-values output {
  background: #10253f;
  border: 1px solid #1f6feb;
  border-radius: 7px;
  padding: 14px 10px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}
.command-values.output-command output {
  background: #12351f;
  border-color: #2ea043;
}
.detail-grid.compact div { padding: 8px 10px; }
.safety-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1000px) {
  .monitor-grid { grid-template-columns: 1fr; }
  .safety-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .detail-grid, .command-values, .safety-strip { grid-template-columns: 1fr; }
  .detail-grid .wide, .status-grid .wide-status { grid-column: auto; }
}
