.motion-toggle { background: rgba(37,70,77,.96); border-color: #77dbc1a0; }
#motion-panel[hidden] { display: none; }
#motion-panel { position: fixed; z-index: 56; top: 66px; right: 16px; width: min(410px, calc(100vw - 24px)); max-height: calc(100dvh - 82px); overflow: auto;
  padding: 18px; border: 1px solid #536d73; border-radius: 14px; background: rgba(12,27,35,.98); color: #eaf6f4;
  box-shadow: 0 18px 55px #000a; backdrop-filter: blur(16px); font: 13px/1.5 "Microsoft YaHei", system-ui, sans-serif; }
#motion-panel * { box-sizing: border-box; }
#motion-panel header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#motion-panel header strong { display: block; font-size: 18px; }
#motion-panel header small { display: block; color: #82d9b9; font-size: 11px; margin-top: 2px; }
#motion-panel h2 { margin: 0 0 9px; font-size: 14px; font-weight: 650; color: #cbebe5; }
#motion-panel p { margin: 7px 0 0; font-size: 11px; line-height: 1.55; color: #a6bfca; }
#motion-panel .motion-note { margin: 12px 0 14px; padding: 10px 11px; border-left: 3px solid #e3ad70; background: #2c3031; color: #ebd4b4; }
#motion-panel section { margin-top: 16px; padding-top: 15px; border-top: 1px solid #ffffff20; }
#motion-panel button, #motion-panel input, #motion-panel select { font: inherit; }
#motion-panel button, #motion-panel .motion-import { color: #eaf6f4; background: #244752; border: 1px solid #55747d; border-radius: 7px; padding: 7px 9px; cursor: pointer; }
#motion-panel button:hover, #motion-panel .motion-import:hover { background: #30616d; }
#motion-panel button:focus-visible, #motion-panel input:focus-visible, #motion-panel select:focus-visible, .motion-toggle:focus-visible { outline: 2px solid #8de7c9; outline-offset: 2px; }
#motion-close { min-width: 30px; font-size: 20px !important; line-height: 1; padding: 4px !important; }
#motion-panel input[type=text], #motion-panel input[type=number], #motion-panel select { min-width: 0; width: 100%; color: #effaf8; background: #112b34; border: 1px solid #516b75; border-radius: 6px; padding: 6px 8px; }
#motion-panel input[type=checkbox], #motion-panel input[type=range] { accent-color: #7ae0c1; }
#motion-panel label { display: block; color: #c7d9de; }
.motion-enable { display: flex !important; align-items: center; gap: 7px; font-weight: 650; }
.motion-endpoint { display: grid; grid-template-columns: 1fr 112px; gap: 9px; }
.motion-endpoint label, .motion-tuning label { font-size: 11px; }
.motion-endpoint input, .motion-tuning input { margin-top: 4px; }
.motion-gain { display: grid !important; grid-template-columns: 62px 1fr 36px; gap: 8px; align-items: center; margin: 5px 0; }
.motion-gain input { width: 100%; }
.motion-gain output { color: #9de2cf; text-align: right; font-variant-numeric: tabular-nums; }
.motion-tuning { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.motion-slot-row { display: grid; grid-template-columns: 24px 1fr 65px 57px; gap: 7px; align-items: center; margin: 6px 0; }
.motion-slot-row strong { color: #80dfc6; }
.motion-slot-row label { display: flex !important; align-items: center; gap: 2px; white-space: nowrap; font-size: 11px; }
.motion-value-row { display: grid; grid-template-columns: 24px 1fr 47px; gap: 9px; align-items: center; margin: 8px 0; }
.motion-value-row strong { color: #80dfc6; }
.motion-value-row output { color: #e5f5f2; text-align: right; font-variant-numeric: tabular-nums; }
.motion-track { position: relative; height: 11px; border-radius: 20px; border: 1px solid #49646c; background: linear-gradient(90deg,#1a3946 49.5%,#a7d3cc 50%,#1a3946 50.5%); overflow: hidden; }
.motion-track span { position: absolute; top: 0; bottom: 0; background: #7fe0ba; }
.motion-track span[data-sign=negative] { background: #f0af78; }
.motion-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.motion-import { position: relative; overflow: hidden; display: inline-flex !important; align-items: center; }
.motion-import input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
#motion-status { display: block; min-height: 1.5em; color: #93dfbc; margin-top: 12px; }
#motion-status.error { color: #ffba9f; }
@media (max-width: 760px) { #motion-panel { top: 76px; right: 8px; width: min(410px, calc(100vw - 16px)); max-height: calc(100dvh - 90px); } }
