/* Ninja Motion device system — tokens + class constants (see ninja/motion/classes.py).
   Pressure language: rest = hollow grey · tap = amber ring · click = blue fill · force = orange double ring · hold = sweeping arc. */

:root {
  --nm-tap: #f2ac52;
  --nm-tap-ink: #a85b12;
  --nm-click: #238bb2;
  --nm-click-ink: #175f7a;
  --nm-force: #c2410c;
  --nm-force-ink: #7c2d12;
  --nm-rest: #94a3b8;
  --nm-hold: #7c3aed;
  --nm-arrow: #086b64;
  --nm-ghost: rgba(35, 139, 178, .35);
  --nm-button-press: #fbbf24;
  --nm-button-hold: #f59e0b;
  --nm-key-held: #fbbf24;
  --nm-key-held-ink: #b45309;
  --nm-callout-bg: #172536;
  --nm-callout-ink: #f4f7fa;
  --nm-rig-ink: #1e293b;
  --nm-rig-muted: #64748b;
  --nm-rig-paper: #f7f9fc;
  --nm-rig-shell: #e2e8f0;
  --nm-rig-line: #94a3b8;
  --nm-rig-key: #cbd5e1;
  --nm-rig-surface: #1e293b;
  --nm-rig-surface-line: #334155;
  --nm-rig-surface-muted: #8fa0b0;
  --nm-rig-grid: #3b4a5e;
  --nm-rig-screen: #ffffff;
  --nm-rig-screen-line: #cbd5e1;
  --nm-rig-glass: #0f172a;
  --nm-rig-metal: #cbd5e1;
  --nm-rig-metal-dark: #94a3b8;
  --nm-selection: #c9e5ff;
  --nm-selection-ink: #1674d1;
}

/* ---------- Stage ---------- */
.nm-stage { display: block; width: 100%; height: auto; border: 1px solid var(--line, #dce3e9); border-radius: 10px; background: var(--nm-rig-paper); }
.nm-rig-base text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; pointer-events: none; user-select: none; }
.nm-layer--dynamic text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.nm-anchor-label { font-size: 10px; fill: var(--nm-rig-muted); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Touches ---------- */
.nm-touch { color: var(--nm-click); }
.nm-touch--rest { color: var(--nm-rest); }
.nm-touch--tap { color: var(--nm-tap); }
.nm-touch--click { color: var(--nm-click); }
.nm-touch--force { color: var(--nm-force); }
.nm-touch-core { fill: currentColor; stroke: #0f172a; stroke-width: 1.5; }
.nm-touch--rest .nm-touch-core { fill: none; stroke: currentColor; stroke-width: 2; }
.nm-touch--tap .nm-touch-core { fill-opacity: .35; stroke: var(--nm-tap-ink); }
.nm-touch--click .nm-touch-core { fill-opacity: .92; }
.nm-touch--force .nm-touch-core { fill-opacity: .95; stroke: var(--nm-force-ink); stroke-width: 2.5; }
.nm-touch-ring { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .85; }
.nm-touch--force .nm-touch-ring { stroke-width: 2.5; }
.nm-touch--hold .nm-touch-ring { stroke: var(--nm-hold); }
.nm-touch-count { font-size: 11px; font-weight: 700; fill: var(--nm-rig-ink); }
.nm-touch-count rect, rect.nm-touch-count { fill: #fff; stroke: var(--nm-rig-line); }

/* ---------- Motion ---------- */
.nm-arrow { fill: none; stroke: var(--nm-arrow); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 7; }
.nm-arrow--repeat { stroke-dasharray: 4 7; }
.nm-arrow-head { fill: var(--nm-arrow); stroke: none; }
.nm-ghost { fill: currentColor; fill-opacity: .32; stroke: none; }
.nm-rig--trackpad .nm-touch-core { stroke: #f8fafc; }
.nm-rig--trackpad .nm-touch--tap .nm-touch-core { fill-opacity: .55; }
.nm-rig--trackpad .nm-arrow { stroke: #5ecfc0; }
.nm-rig--trackpad .nm-arrow-head { fill: #5ecfc0; }
.nm-rig--trackpad .nm-touch-count rect, .nm-rig--trackpad rect.nm-touch-count { fill: #f8fafc; }

/* ---------- Buttons & keys ---------- */
.nm-button { transition: fill 80ms linear; }
.nm-button--press, .nm-button--hold { fill: var(--nm-button-press) !important; stroke: var(--nm-key-held-ink) !important; stroke-width: 2.5 !important; }
.nm-button--hold { fill: var(--nm-button-hold) !important; }
.nm-button-ring { fill: none; stroke: var(--nm-hold); stroke-width: 3.5; stroke-linecap: round; }
.nm-key { transition: fill 80ms linear; }
.nm-key--held { fill: var(--nm-key-held) !important; stroke: var(--nm-key-held-ink) !important; stroke-width: 2 !important; }

/* ---------- Screen layer ---------- */
.nm-screen-selection { fill: var(--nm-selection); }
.nm-screen-result { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; fill: var(--nm-rig-ink); }

/* ---------- Callouts ---------- */
.nm-callout rect { fill: var(--nm-callout-bg); stroke: none; }
.nm-callout text { fill: var(--nm-callout-ink); font-size: 11px; font-weight: 600; }
.nm-callout line { stroke: var(--nm-callout-bg); stroke-width: 1.5; }
/* ---------- Player window ---------- */
.nm-player { max-width: none; }
.nm-player-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.nm-player-controls button, .nm-player-controls output { font: inherit; }
.nm-player-status { color: var(--muted, #586575); font-size: .85rem; margin: .4rem 0 0; }
.nm-motion-steps { list-style: disc; margin: .75rem 0; padding: .25rem 0 .25rem 1.4rem; display: grid; gap: .3rem; }
.nm-motion-steps li { padding: .35rem .55rem; border-radius: .45rem; color: var(--muted, #586575); transition: background-color .18s ease, color .18s ease; }
.nm-motion-steps li.is-current { background: #e8f5ef; color: #145f50; font-weight: 700; box-shadow: inset 3px 0 #16806c; }

@media (prefers-reduced-motion: reduce) {
  .nm-button, .nm-key { transition: none; }
}
@media (max-width: 575px) {
  .nm-player-controls { gap: .4rem; }
}
