/* Local HUD editor. Every rule is scoped; the live HUD is styled by hudLayout.js. */
.hudle {
  position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--bg-0, #0c0f0e); color: var(--text-hi, #f2f2f2);
  font: 13px/1.4 var(--font-cjk, sans-serif); letter-spacing: 0;
  overscroll-behavior: contain; isolation: isolate;
}
.hudle *, .hudle *::before, .hudle *::after, .hudle-setting * { box-sizing: border-box; }
.hudle__header { flex: none; display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 16px; border-bottom: 1px solid var(--line, #2f3a35); background: var(--bg-1, #141816); }
.hudle__heading { flex: 1; min-width: 0; }
.hudle__heading h2 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.hudle__heading > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-lo, #8a948f); font-size: 11px; }
.hudle__actions { display: flex; align-items: center; gap: 8px; }
.hudle__button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 12px; border: 1px solid var(--line-2, #3e4b45); border-radius: 3px;
  background: var(--bg-2, #1e2421); color: var(--text-hi, #f2f2f2); font: inherit; font-weight: 500; line-height: 1.25;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; transition: background 120ms ease, border-color 120ms ease, transform 120ms var(--ease-out, ease-out);
}
.hudle__button .icon, .hudle__local .icon { width: 16px; height: 16px; flex: none; }
.hudle__button--save { background: var(--mint-500, #4ed8af); border-color: var(--mint-500, #4ed8af); color: var(--text-on-mint, #06110d); font-weight: 700; }
.hudle__button:active:not(:disabled) { transform: scale(.97); }
.hudle__button:disabled { opacity: .4; cursor: default; }
.hudle__button:focus-visible, .hudle select:focus-visible, .hudle input:focus-visible, .hudle-item__move:focus-visible, .hudle-item__resize:focus-visible { outline: 2px solid var(--mint-400, #59f4ca); outline-offset: 3px; }
.hudle__workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 236px; }
.hudle__stage-host { display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden; background: #080b0a; }
.hudle__stage {
  position: relative; flex: none; overflow: visible; border: 0; outline: 1px solid #35413b; border-radius: 3px;
  background: #080b0a; box-shadow: 0 6px 30px #0005; touch-action: none;
}
.hudle__frame { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; user-select: none; }
.hudle__guide { position: absolute; z-index: 500; pointer-events: none; color: var(--mint-400, #59f4ca); }
.hudle__guide--vertical { top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); background: repeating-linear-gradient(to bottom, currentColor 0 5px, transparent 5px 9px); }
.hudle__guide--horizontal { left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-50%); background: repeating-linear-gradient(to right, currentColor 0 5px, transparent 5px 9px); }
.hudle__loading { position: absolute; z-index: 150; inset: 0; display: grid; place-items: center; padding: 16px; background: #080b0ae8; color: var(--text-md, #c3cbc7); font-size: 12px; text-align: center; }
.hudle-item { position: absolute; left: 0; top: 0; min-width: 1px; min-height: 1px; }
.hudle-item__move { position: relative; display: block; width: 100%; height: 100%; padding: 0; overflow: visible; border: 1px solid transparent; border-radius: 2px; background: transparent; color: #d3e7dc; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; font: inherit; }
.hudle-item.is-selected .hudle-item__move { border-color: var(--mint-400, #59f4ca); box-shadow: 0 0 0 1px var(--mint-400, #59f4ca); }
.hudle.is-dragging .hudle-item.is-selected .hudle-item__move { cursor: grabbing; }
.hudle-item__label { position: absolute; bottom: calc(100% + 5px); left: 0; pointer-events: none; white-space: nowrap; font-size: 10px; font-weight: 600; line-height: 1.2; color: var(--mint-400, #59f4ca); text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.hudle-item__resize { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--mint-400, #59f4ca); cursor: nwse-resize; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.hudle-item__resize i { width: 11px; height: 11px; border: 2px solid currentColor; background: var(--bg-0, #0c0f0e); box-shadow: 0 0 0 2px #0c0f0e; }
.hudle__inspector { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; border-left: 1px solid var(--line, #2f3a35); background: var(--bg-1, #141816); }
.hudle__field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.hudle__field > span, .hudle__position > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-md, #c3cbc7); }
.hudle__field small { color: var(--text-lo, #8a948f); font-size: 10px; }
.hudle__field output, .hudle__position output { color: var(--mint-400, #59f4ca); font-family: var(--font-mono, monospace); font-size: 12px; font-variant-numeric: tabular-nums; }
.hudle select { width: 100%; min-height: 38px; border: 1px solid var(--line-2, #3e4b45); border-radius: 3px; padding: 6px 9px; font: 14px/1.3 var(--font-cjk, sans-serif); color: var(--text-hi, #f2f2f2); background: var(--bg-2, #1e2421); touch-action: manipulation; }
.hudle__selection { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hudle__selection strong { font-size: 13px; }
.hudle__selection > span { font-size: 10px; color: var(--text-lo, #8a948f); }
.hudle__scene { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line, #2f3a35); }
.hudle__board-status { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0; color: var(--text-lo, #8a948f); font-size: 10px; line-height: 1.5; }
.hudle__board-status.is-error { color: var(--amber, #ffc35a); }
.hudle__board-status .hudle__button { flex: none; min-height: 28px; padding: 3px 7px; font-size: 10px; }
.hudle__camera .set-keys { padding-top: 8px; gap: 9px; }
.hudle__camera .set-keys__head { min-height: 28px; gap: 6px; }
.hudle__camera .set-keys__head .btn { min-height: 28px; height: auto; padding: 3px 6px; font-size: 10px; letter-spacing: 0; }
.hudle__camera .set-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 6px; min-height: 0; }
.hudle__camera .set-row__label { min-width: 0; gap: 4px; flex-wrap: wrap; font-size: 11px; white-space: normal; }
.hudle__camera .set-row__label .micro { font-size: 8px; margin: 0; letter-spacing: .04em; }
.hudle__camera .set-row__val { grid-column: 2; grid-row: 1; width: auto; min-width: 4ch; font-size: 11px; }
.hudle__camera .set-range { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 28px; border: 11px solid transparent; border-left-width: 0; border-right-width: 0; background-clip: padding-box; box-shadow: inset 0 0 0 1px var(--line-2); }
.hudle input[type="range"] { display: block; width: 100%; margin: 0; min-height: 28px; accent-color: var(--mint-400, #59f4ca); cursor: ew-resize; touch-action: pan-y; }
.hudle__position { display: flex; flex-direction: column; gap: 8px; }
.hudle__nudge { display: grid; grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(3, 30px); justify-content: center; gap: 3px; }
.hudle__nudge .hudle__button { min-height: 0; padding: 0; }
.hudle__nudge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.hudle__nudge--up { grid-column: 2; grid-row: 1; }
.hudle__nudge--left { grid-column: 1; grid-row: 2; }
.hudle__nudge--left svg { rotate: -90deg; }
.hudle__nudge--right { grid-column: 3; grid-row: 2; }
.hudle__nudge--right svg { rotate: 90deg; }
.hudle__nudge--down { grid-column: 2; grid-row: 3; }
.hudle__nudge--down svg { rotate: 180deg; }
.hudle__reset-item { width: 100%; font-size: 11px; }
.hudle__hint { margin: 0; color: var(--text-lo, #8a948f); font-size: 11px; line-height: 1.65; }
.hudle__local { display: flex; align-items: flex-start; gap: 6px; margin: auto 0 0; padding-top: 10px; color: var(--text-lo, #8a948f); font-size: 10px; }
.hudle__local .icon { width: 13px; height: 13px; }
.hudle__notice { flex: none; min-height: 32px; max-height: 20vh; overflow-y: auto; overflow-wrap: anywhere; padding: 7px 16px; border-top: 1px solid var(--line, #2f3a35); color: var(--text-md, #c3cbc7); background: var(--bg-1, #141816); font-size: 11px; line-height: 1.5; }
.hudle-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: .16rem 0; border-bottom: 1px solid var(--line, #2f3a35); }
.hudle-setting__copy { min-width: 0; }
.hudle-setting__copy strong { font-size: max(12px, calc(.18 * var(--t, 1rem))); font-weight: 500; }
.hudle-setting__copy small { margin-left: 8px; color: var(--text-lo, #8a948f); font-size: max(10px, calc(.11 * var(--t, 1rem))); }
.hudle-setting__copy p { margin: 4px 0 0; color: var(--text-lo, #8a948f); font-size: max(11px, calc(.12 * var(--t, 1rem))); }
.hudle-setting > .hudle__button { flex: none; font: 12px/1.3 var(--font-cjk, sans-serif); }
@media (hover: hover) and (pointer: fine) {
  .hudle__button:hover:not(:disabled) { border-color: var(--mint-500, #4ed8af); background: var(--bg-3, #252c29); }
  .hudle__button--save:hover:not(:disabled) { background: var(--mint-400, #59f4ca); }
}
@media (pointer: coarse) {
  .hudle__button { min-height: 44px; }
  .hudle select { min-height: 44px; font-size: 16px; }
  .hudle__nudge { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); }
  .hudle__nudge .hudle__button { min-height: 44px; }
  .hudle input[type="range"] { min-height: 36px; }
  .hudle__camera .set-range { height: 36px; border-block-width: 15px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .hudle__header { min-height: 48px; padding: 4px 10px; gap: 10px; }
  .hudle__heading h2 { font-size: 14px; }
  .hudle__heading > span { font-size: 10px; }
  .hudle__workspace { grid-template-columns: minmax(0, 1fr) 205px; }
  .hudle__inspector { gap: 9px; padding: 10px; }
  .hudle__selection { display: none; }
  .hudle__nudge { grid-template-columns: repeat(4, 44px); grid-template-rows: 44px; }
  .hudle__nudge .hudle__button { grid-row: 1; grid-column: auto; }
  .hudle__hint { font-size: 10px; }
  .hudle__local { display: none; }
  .hudle__notice { min-height: 25px; padding: 4px 10px; font-size: 10px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .hudle__header { padding: 7px 10px; gap: 8px; flex-wrap: wrap; }
  .hudle__heading { order: -1; flex-basis: calc(100% - 62px); }
  .hudle__back { order: -2; }
  .hudle__actions { margin-left: auto; }
  .hudle__workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(120px, 1fr) auto; }
  .hudle__inspector { max-height: 43vh; max-height: 43dvh; border-left: 0; border-top: 1px solid var(--line, #2f3a35); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 12px; align-items: start; }
  .hudle__inspector > .hudle__field:first-child, .hudle__hint { grid-column: 1 / -1; }
  .hudle__selection, .hudle__local { display: none; }
  .hudle__scene { grid-column: 1 / -1; }
  .hudle__position { grid-row: span 2; }
  .hudle__notice { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hudle__button { transition: none; }
}
