  :root { --panel: rgba(255,255,255,.92); --ink: #111827; --muted: #4b5563; --line: #d1d5db; --accent: #2563eb; }
  html, body { margin: 0; height: 100%; overflow: hidden; background: #e8edf4; font: 14px/1.4 -apple-system, "Helvetica Neue", Arial, sans-serif; color: var(--ink); }
  #app { position: fixed; inset: 0; }
  .panel { position: fixed; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
  #ui { top: 12px; left: 12px; padding: 12px 14px; width: 250px; max-width: calc(100vw - 56px); }
  #ui h1 { font-size: 15px; margin: 0 0 2px; }
  #ui .sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
  .row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
  button { font: inherit; font-size: 13px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
  button:hover { border-color: var(--accent); }
  button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
  select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%; margin: 4px 0; }
  label { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 3px 0; cursor: pointer; }
  .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 10px; }
  #help { font-size: 12px; color: var(--muted); margin-top: 8px; }
  #help kbd { font: 11px ui-monospace, Menlo, monospace; background: #f3f4f6; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
  #mini { right: 12px; bottom: 12px; padding: 6px; }
  #mini canvas { display: block; cursor: crosshair; }
  #mini .cap { font-size: 11px; color: var(--muted); text-align: center; }
  #lockhint { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); padding: 14px 18px; text-align: center; display: none; }
  #cross { position: fixed; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; display: none; pointer-events: none; }
  #cross::before, #cross::after { content: ""; position: absolute; background: rgba(17,24,39,.7); }
  #cross::before { left: 4px; top: 0; width: 2px; height: 10px; }
  #cross::after { top: 4px; left: 0; height: 2px; width: 10px; }
  .lbl { font-weight: 700; font-size: 13px; color: #111827; background: rgba(255,255,255,.8); padding: 1px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
  .tlbl { font-weight: 700; font-size: 11px; color: #3b2a1c; pointer-events: none; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
  #pos { font: 11px ui-monospace, Menlo, monospace; color: var(--muted); margin-top: 6px; }
  #toggle { display: none; }
  canvas { touch-action: none; }
  #joy { position: fixed; left: 24px; bottom: 24px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.35);
         border: 2px solid rgba(17,24,39,.35); display: none; touch-action: none; z-index: 5; }
  #joy .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
               background: rgba(37,99,235,.85); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
  #joy .cap { position: absolute; left: 0; right: 0; bottom: -20px; text-align: center; font-size: 11px; color: #374151; }
  #lookcap { position: fixed; right: 16px; top: 50%; font-size: 11px; color: #374151; background: rgba(255,255,255,.7); padding: 2px 6px; border-radius: 4px; display: none; pointer-events: none; }
  @media (max-width: 640px) {
    #ui { width: auto; right: 12px; padding: 10px; }
    #ui.collapsed .body { display: none; }
    #toggle { display: inline-block; float: right; }
    #mini canvas { width: 96px !important; height: auto !important; }
    #mini .cap { display: none; }
  }
