/* SUB Control UI – Desktop Layout */ :root { color-scheme: dark; --bg: #0c1012; --rail: #151a1d; --panel: #f3f4f1; --card: #ffffff; --ink: #16191b; --muted: #727a7c; --line: #dfe2dd; --acid: #c9f277; --cyan: #72d8e8; --amber: #f2c675; --red: #f0958b; --shadow: 0 10px 30px rgba(0, 0, 0, 0.05); font-family: Inter, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-weight: 300; } * { box-sizing: border-box; } html { height: 100%; margin: 0; overflow: hidden; background: var(--bg); } body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); font-size: 13px; color: var(--ink); -webkit-font-smoothing: antialiased; } button, select, input { font: inherit; } /* ── App Shell (Root Desktop Split Grid) ── */ .app-shell { width: 100vw; height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); overflow: hidden; background: var(--panel); border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05); } body.maximized .app-shell { border-radius: 0; } /* ══════════════════════════════════════════════════════════════════ SIDEBAR DECK: Connection, 3D Model, Battery, Deck Controls, Status ══════════════════════════════════════════════════════════════════ */ .sidebar-deck { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 10px; background: radial-gradient(ellipse 110% 45% at 50% 28%, rgba(30, 144, 255, 0.12) 0%, rgba(0, 200, 255, 0.04) 45%, transparent 75%), linear-gradient(175deg, #1b2328 0%, #12171a 50%, #0c1012 100%); border-right: 1px solid rgba(255, 255, 255, 0.08); color: #f1f4f2; overflow-y: auto; overflow-x: hidden; } /* ── Connection Controls in Deck ── */ .deck-connection { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); } .port-row { display: flex; align-items: center; gap: 4px; } .port-row select { flex: 1; min-width: 0; height: 28px; padding: 0 8px; font-size: 10.5px; font-weight: 500; cursor: pointer; background: #20272b; color: #f1f4f2; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; outline: none; text-overflow: ellipsis; } .port-row select option { background: #171b19; color: #f1f4f2; } .button, .icon-button { height: 28px; border: 1px solid transparent; border-radius: 999px; padding: 0 12px; color: #f1f4f2; background: #20272b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 400; transition: transform 0.15s, background 0.15s, border-color 0.15s; } .button:hover, .icon-button:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.18); background: #293237; } .icon-button { width: 28px; padding: 0; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.1); } .icon-button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; } .icon-button .dots-icon { fill: currentColor; stroke: none; } .connect-button { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 29px; padding: 0 14px; background: #253036; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; color: #ffffff; font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; cursor: pointer; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); user-select: none; } .connect-button:hover { background: #313e46; border-color: rgba(255, 255, 255, 0.25); } .connect-button:active { transform: scale(0.97); } .connect-button .btn-spinner { display: none; width: 11px; height: 11px; border: 2px solid rgba(114, 216, 232, 0.25); border-top-color: #72d8e8; border-radius: 50%; animation: connect-spin 0.65s linear infinite; flex-shrink: 0; } .connect-button .btn-label { display: inline-block; white-space: nowrap; } @keyframes connect-spin { to { transform: rotate(360deg); } } @keyframes connect-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.65; transform: scale(0.98); } } body[data-app-state="connecting"] .connect-button, .connect-button.is-connecting { background: rgba(18, 36, 42, 0.95) !important; border-color: rgba(114, 216, 232, 0.6) !important; color: #72d8e8 !important; box-shadow: 0 0 12px rgba(114, 216, 232, 0.25) !important; cursor: progress !important; pointer-events: auto !important; opacity: 1 !important; } body[data-app-state="connecting"] .connect-button .btn-spinner, .connect-button.is-connecting .btn-spinner { display: inline-block !important; } body[data-app-state="connecting"] .connect-button .btn-label, .connect-button.is-connecting .btn-label { animation: connect-pulse 1.3s ease-in-out infinite; } body[data-app-state="connected_disarmed"] .connect-button, body[data-app-state="armed"] .connect-button, body[data-app-state="link_degraded"] .connect-button, .connect-button.is-connected { background: rgba(50, 18, 18, 0.85) !important; border-color: rgba(255, 107, 107, 0.4) !important; color: #ffb4b4 !important; } body[data-app-state="connected_disarmed"] .connect-button:hover, body[data-app-state="armed"] .connect-button:hover, body[data-app-state="link_degraded"] .connect-button:hover, .connect-button.is-connected:hover { background: rgba(70, 22, 22, 0.95) !important; border-color: rgba(255, 107, 107, 0.75) !important; color: #ffffff !important; } /* ── 3D Model Stage in Deck ── */ .deck-card { display: flex; flex-direction: column; } .sidebar-deck button, .sidebar-deck select, .sidebar-deck input, .sidebar-deck a, .sidebar-deck canvas { -webkit-app-region: no-drag; } .telemetry-zone { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 10px; } .telemetry-zone .model-card { flex: 1; min-height: 0; } .eyebrow { font-size: 8.5px; font-weight: 400; color: #727c80; letter-spacing: 0.03em; } .rov-stage { position: relative; height: min(24vh, 160px); min-height: 120px; display: grid; place-items: center; border-radius: 10px; transition: background 0.2s ease, border-color 0.2s ease; } .rov-stage::before { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 180, 255, 0.2) 0%, rgba(0, 120, 220, 0.06) 50%, transparent 75%); filter: blur(14px); pointer-events: none; z-index: 1; } .water-ring { position: absolute; border: 1px solid rgba(0, 200, 255, 0.2); border-radius: 50%; transform: scaleY(0.55); } .water-ring.r1 { width: 140px; height: 140px; } .water-ring.r2 { width: 95px; height: 95px; border-color: rgba(114, 216, 232, 0.28); } .rov-stage #model-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; cursor: grab; touch-action: none; } .model-status { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); padding: 2px 7px; background: rgba(18, 24, 27, 0.85); border: 1px solid rgba(79, 195, 247, 0.25); border-radius: 5px; font-size: 8px; letter-spacing: 0.04em; color: #8edcf8; z-index: 5; pointer-events: none; white-space: nowrap; backdrop-filter: blur(6px); transition: opacity 0.4s ease; } .model-status.error { border-color: rgba(255, 82, 82, 0.5); color: #ff8a80; background: rgba(40, 15, 15, 0.9); } .model-status.fade-out { opacity: 0; } .model-tools { display: none !important; } .vehicle-name { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; } .vehicle-name small, .battery-card small { font-size: 8px; color: #687276; font-weight: 400; } .vehicle-name strong { font-size: 13.5px; font-weight: 400; letter-spacing: -0.01em; } .vehicle-name span { font-size: 9px; color: #727c80; } /* ── Battery Card ── */ .battery-card { display: grid; grid-template-columns: 1fr auto; width: 100%; padding: 6px 0 8px; text-align: left; color: inherit; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: transparent; cursor: pointer; } .battery-card::after { display: none !important; } .battery-card:hover { transform: none !important; box-shadow: none !important; } .battery-card > span { display: flex; flex-direction: column; gap: 1px; } .battery-card strong { font-size: 14.5px; font-weight: 400; } .battery-card i { align-self: end; color: #859094; font-size: 9.5px; font-style: normal; } .battery-card b { grid-column: 1 / -1; height: 3px; margin-top: 5px; background: #31383c; border-radius: 999px; overflow: hidden; } .battery-card em { display: block; width: 0; height: 100%; background: var(--acid); border-radius: inherit; transition: width 0.35s; } /* ── Output Limit & Motor Setup ── */ .controls-deck { display: flex; flex-direction: column; gap: 8px; padding: 2px 0; } .output-limit { display: flex; flex-direction: column; gap: 3px; font-size: 9px; color: #8a9497; font-weight: 300; width: 100%; } .output-limit span { display: flex; justify-content: space-between; white-space: nowrap; } .output-limit b { font-weight: 500; color: #f1f4f2; } .range-pill { display: grid; grid-template-columns: 20px 1fr 20px; align-items: center; width: 100%; height: 22px; border-radius: 999px; background: #20272b; border: 1px solid rgba(255, 255, 255, 0.08); overflow: hidden; } .range-pill button { width: 20px; height: 22px; border: 0; background: transparent; color: #8a9497; cursor: pointer; display: grid; place-items: center; padding: 0; } .range-pill button:hover { color: #f1f4f2; } .range-pill button::after { display: none !important; } .range-pill input[type="range"] { width: 100%; height: 4px; margin: 0; padding: 0; border: 0; background: #394247; border-radius: 999px; outline: none; cursor: pointer; -webkit-appearance: none; } .range-pill input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #c9f277; cursor: pointer; } .config-btn { width: 100%; height: 26px; font-size: 10px; background: #20272b; color: #d1d8d6; border: 1px solid rgba(255, 255, 255, 0.08); } .config-btn:hover { background: #2b353b; color: #ffffff; } /* ── Status Bar in Deck ── */ .deck-status-bar { margin-top: auto; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); } .status-line { display: flex; align-items: center; gap: 6px; font-size: 9px; color: #8a9497; } .status-line .status-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; background: var(--muted); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); transition: background 0.25s ease, box-shadow 0.25s ease; } body[data-app-state="disconnected"] .status-line .status-dot, body[data-app-state="connecting"] .status-line .status-dot { background: var(--muted); } body[data-app-state="connected_disarmed"] .status-line .status-dot { background: var(--cyan); box-shadow: 0 0 6px rgba(114, 216, 232, 0.6); } body[data-app-state="armed"] .status-line .status-dot { background: var(--acid); box-shadow: 0 0 6px rgba(201, 242, 119, 0.65); } body[data-app-state="link_degraded"] .status-line .status-dot { background: var(--red); box-shadow: 0 0 6px rgba(240, 149, 139, 0.65); } .status-line p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .logs-link { all: unset; cursor: pointer; color: #9aa29f; font-size: 9px; letter-spacing: 0.02em; margin-left: auto; } .logs-link:hover { color: #f1f4f2; } /* ══════════════════════════════════════════════════════════════════ PRIMARY CONTROL ZONE (Workspace) Engage/Disarm banner directly above Joysticks + Controls Grid ══════════════════════════════════════════════════════════════════ */ .controls-workspace { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 10px 16px 14px; background: linear-gradient(155deg, #f7f8f6, #ebefec); min-width: 0; position: relative; } .primary-control-zone { display: grid; grid-template-rows: auto minmax(0, 1fr); flex: 1; min-height: 0; } /* ── Minimal Window Bar ── */ .workspace-topbar { display: flex; align-items: center; justify-content: space-between; height: 24px; min-height: 24px; margin-bottom: 6px; user-select: none; } .workspace-drag-area { flex: 1; height: 100%; } .window-actions { display: flex; align-items: center; gap: 4px; -webkit-app-region: no-drag; } .window-actions button { width: 22px; height: 22px; border-radius: 4px; border: 0; background: transparent; color: #7a8588; cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: none; transition: color 0.2s ease, opacity 0.2s ease; } .window-actions button::after { display: none !important; } .window-actions button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; } .window-actions button:hover { background: transparent; color: #1a1e1d; } .window-actions button:active { opacity: 0.65; } .window-actions .window-close:hover { background: transparent; color: #e04438; } /* ── Engage / Disarm Slot Above Joysticks ── */ .engage-header-zone { display: flex; align-items: center; justify-content: space-between; min-height: 42px; margin-bottom: 10px; } .zone-label { font-size: 9px; color: #727a7c; text-transform: uppercase; letter-spacing: .08em; } .engage-button { min-width: 140px; height: 32px; padding: 0 20px; font-size: 11px; font-weight: 500; border-radius: 999px; position: relative; overflow: hidden; user-select: none; } .subtle { background: #e2e6e1; color: #28302c; border: 1px solid rgba(0, 0, 0, 0.08); } .subtle:hover { background: #d7dcd5; } .arm { background: #eef3e5; color: #24351a; border: 1px solid rgba(157, 232, 72, 0.4); cursor: pointer; } .arm::before { content: ""; position: absolute; z-index: 1; inset: 0 auto 0 0; width: var(--arm-progress, 0%); border-radius: inherit; background: linear-gradient(90deg, #c9f277, #9de848); pointer-events: none; transition: width 0.04s linear; } .arm-copy { display: grid; place-items: center; width: 100%; position: relative; z-index: 2; } .arm-copy > span { grid-area: 1 / 1; transition: opacity 0.15s, transform 0.15s; } .arm-holding-label { opacity: 0; transform: translateY(3px); } .arm.charging .arm-label { opacity: 0; transform: translateY(-3px); } .arm.charging .arm-holding-label { opacity: 1; transform: translateY(0); } .arm.charged { background: #c9f277 !important; color: #14200d !important; transform: scale(1.04); } .danger { background: #f8deda; color: #7a2822; border: 1px solid rgba(240, 149, 139, 0.4); } .danger:hover { background: #f4cac4; border-color: rgba(240, 149, 139, 0.7); } /* ── Main Controls Grid ── */ .controls-grid { --joy-size: min(34vh, 230px); --joy-circle-d: calc(var(--joy-size) * 0.90); display: grid; grid-template-columns: minmax(300px, 1fr) 175px; gap: 12px; flex: 1; min-height: 0; } .control-card { display: flex; flex-direction: column; padding: 12px 14px 10px; border: 1px solid #e1e4e0; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); min-height: 0; } .control-card header { display: flex; justify-content: space-between; align-items: flex-start; } .control-card header div { display: flex; flex-direction: column; gap: 1px; } .control-card small { font-size: 8.5px; color: #828a88; font-weight: 400; } .control-card header strong { font-size: 13px; font-weight: 400; } .key-hint { padding: 2px 5px; border-radius: 5px; background: #f0f2ef; color: #7e8583; font-size: 8px; font-weight: 400; } .joystick-pad, .heave-pad { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; padding: 6px; } .joystick { --size: var(--joy-size); position: relative; width: var(--size); height: var(--size); min-width: 165px; min-height: 165px; margin: auto; border: 0; background: transparent; user-select: none; touch-action: none; } .joystick:before, .joystick:after { display: none !important; } .axis, .axis-label, .axis-copy, .stick, .stick-shadow { display: none !important; } .vertical-control { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-height: var(--joy-size); gap: 3px; font-size: 8.5px; font-weight: 400; color: #828a87; } .heave-track { position: relative; width: 36px; height: var(--joy-circle-d); border-radius: 18px; background: #eaeee8; border: 1px solid #d6dbd4; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05); touch-action: none; } .heave-track::before { display: none !important; } .heave-center { position: absolute; left: 6px; right: 6px; top: 50%; height: 1px; background: #b2b9b4; } .heave-fill { position: absolute; left: 12px; right: 12px; top: 50%; height: 0; background: rgba(188, 159, 235, 0.4); border-radius: 3px; } .heave-knob { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 48px; height: 27px; border-radius: 14px; background: linear-gradient(145deg, #687271, #3c4443); border: 1px solid #d7dedc; box-shadow: 0 3px 10px rgba(20, 30, 25, 0.18), inset 0 1px rgba(255, 255, 255, 0.55); cursor: grab; touch-action: none; transition: scale 0.12s, filter 0.12s; will-change: top; } .heave-knob::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: #8e9694; border-radius: 1px; transform: translate(-50%, -50%); } .heave-knob:active, .heave-knob.pressed { scale: 0.93; } .control-card footer { display: flex; align-items: center; height: 14px; margin-top: auto; color: #7e8583; font-size: 9px; font-weight: 300; line-height: 1; } .control-card footer b { font-weight: 400; color: #28302c; } .steer-card footer { justify-content: space-between; width: 100%; padding: 0 2px; } .steer-readout-left, .steer-readout-right { display: inline-flex; align-items: center; gap: 3px; } /* ══════════════════════════════════════════════════════════════════ MODALS ══════════════════════════════════════════════════════════════════ */ .modal { width: min(540px, calc(100vw - 40px)); padding: 22px 24px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 24px; background: rgba(247, 248, 245, 0.96); color: #1a1e1f; box-shadow: 0 30px 80px -12px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(0, 0, 0, 0.06), 0 10px 24px -6px rgba(0, 0, 0, 0.16); backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); } .modal::backdrop { background: rgba(10, 16, 18, 0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } .modal-close { position: absolute; right: 14px; top: 14px; width: 24px; height: 24px; border: 0; background: transparent; font-size: 16px; cursor: pointer; } .form-grid { display: grid; gap: 12px; margin-top: 12px; } .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid.three { grid-template-columns: 1fr 1fr 1fr; } .form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; } .number-pill { display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; height: 30px; border-radius: 999px; background: #eaede8; overflow: hidden; } .number-pill button { width: 24px; height: 30px; border: 0; background: transparent; cursor: pointer; } .number-pill input { border: 0; text-align: center; background: transparent; } .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; } .note { font-size: 9.5px; color: #7a8280; margin-top: 8px; } .motor-modal { width: min(600px, calc(100vw - 40px)); } .motor-head, .motor-row { display: grid; grid-template-columns: 70px 1fr 80px 75px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #e0e4df; font-size: 10.5px; } .motor-head { font-weight: 500; color: #727a7c; border-bottom: 1.5px solid #c8cec6; } /* ── Toast ── */ .toast { position: fixed; bottom: 16px; right: 16px; padding: 8px 14px; background: #171b19; color: #fff; border-radius: 8px; font-size: 11px; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; pointer-events: none; z-index: 100; } .toast.show { opacity: 1; transform: translateY(0); } .toast.error { background: #7a2822; } /* ══════════════════════════════════════════════════════════════════ APP-STATE CONDITIONAL GATING ══════════════════════════════════════════════════════════════════ */ body:not([data-app-state="armed"]) .controls-grid { opacity: 0.45; pointer-events: none; user-select: none; } button:disabled { opacity: 0.38 !important; pointer-events: none !important; cursor: not-allowed !important; } button:disabled::after { display: none !important; } body[data-app-state="disconnected"] #engage, body[data-app-state="connecting"] #engage, body[data-app-state="link_degraded"] #engage, body[data-app-state="connecting"] #connect, body[data-app-state="disconnected"] button[data-open="motors-modal"], body[data-app-state="connecting"] button[data-open="motors-modal"], body[data-app-state="link_degraded"] button[data-open="motors-modal"] { opacity: 0.38; pointer-events: none; cursor: not-allowed; } @media (max-width: 950px) { .app-shell { grid-template-columns: 210px minmax(0, 1fr); } .controls-grid { grid-template-columns: minmax(230px, 1fr) 150px; } .controls-workspace { padding: 8px 12px; } }