/* Shared by the learningphysics.ch apps (canonical copy in shared/, copied by sync.sh with
   arrow.js): vector arrows placed and turned on a figure, and their palette. Only what the arrows
   need; their colours are the app's (the classes of each kind, as currentColor). Load it after
   ui.css and before the app's style.css. */
/* no scrolling or selecting text while an arrow is dragged */
.arrows { touch-action: none; user-select: none; -webkit-user-select: none; }
.arrows .ar-arrow { cursor: grab; }
.arrows.dragging, .arrows.dragging .ar-arrow { cursor: grabbing; }
.arrows .ar-arrow:focus { outline: none; }
.arrows .ar-shaft { stroke: currentColor; stroke-width: 2.2; fill: none; }
.arrows .ar-fill { fill: currentColor; stroke: none; }
.arrows .ar-ring { fill: var(--card); stroke: currentColor; stroke-width: 1.8; }
.arrows .ar-cross { stroke: currentColor; stroke-width: 1.8; fill: none; }
.arrows .ar-label { fill: currentColor; }
/* the halo under an arrow: selected, focused, right or wrong */
.arrows .ar-halo { stroke: transparent; stroke-width: 10; stroke-linecap: round; fill: none; }
.arrows .ar-ok .ar-halo { stroke: var(--ok); stroke-opacity: 0.3; }
.arrows .ar-bad .ar-halo { stroke: var(--bad); stroke-opacity: 0.35; }
.arrows .ar-active .ar-halo, .arrows .ar-arrow:focus-visible .ar-halo { stroke: var(--accent); stroke-opacity: 0.3; }
.arrows .ar-arrow:focus-visible .ar-halo { stroke-opacity: 0.5; }
/* the handle of the selected arrow's tip */
.arrows .ar-tip { fill: var(--card); fill-opacity: 0.6; stroke: currentColor; stroke-width: 1.5; }
.arrows .ar-moving { opacity: 0.7; }
.arrows .ar-off .ar-moving { opacity: 0.3; }
/* where an arrow can go, while one is placed or dragged */
.arrows .ar-target { fill: var(--accent); fill-opacity: 0.08; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 5 3; cursor: pointer; }
.arrows .ar-target.over { fill-opacity: 0.22; }
.arrows .ar-target:focus { outline: none; }
.arrows .ar-target:focus-visible { fill-opacity: 0.22; stroke-width: 2.6; }

/* the palette: a button per kind, ⊙ ⊗ (outIn), then Remove */
.ar-palette .ar-note { margin: 0 0 8px; }
.ar-kinds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ar-kind {
  max-width: 100%; text-align: left; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); font-weight: 600;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; line-height: 1.35;
}
.ar-kind:hover:not(:disabled) { border-color: var(--accent); }
.ar-kind.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.ar-kind:disabled { cursor: default; opacity: 0.55; }
.ar-swatch { display: inline-block; font-weight: 700; }
.ar-ghost { position: fixed; z-index: 1000; pointer-events: none; cursor: grabbing; opacity: 0.95; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); margin: 0; }
.ar-remove { margin-left: auto; }
.ar-oi {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); line-height: 1.35;
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
}
.ar-oi:hover:not(:disabled) { border-color: var(--accent); }
.ar-oi[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); font-weight: 600; }
.ar-oi:disabled { opacity: 0.55; cursor: default; }
.ar-oi-sym { font-size: 1.25em; line-height: 1; }
