/* ws-annot.css : instructor annotations over the lab topology (public/ws-annot.js). Colours come from the page variables
   (--panel, --panel-2, --line, --line-2, --accent, --accent-soft, --text, --muted, --ok, --bad, --warn, --mono, --sans) so both themes work. Everything is prefixed ws-an-. */

/* ---- the annotation layer (builder: interactive, lab view: .ws-an-ro = locked, no pointer events) */
.ws-an .ws-an-text { font-family: var(--sans, system-ui, sans-serif); white-space: pre; user-select: none; }
.ws-an .ws-an-ip { font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace); }
.ws-an .ws-an-bad { fill: var(--bad); text-decoration: underline wavy var(--bad); }
.ws-an-ro, .ws-an-ro * { pointer-events: none !important; }
.ws-an-ro { user-select: none; }

/* ---- builder: the topology host, selection overlay, handles */
.ws-an-host { position: relative; }
.ws-an-host:focus { outline: none; }
.ws-an-host:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ws-an-host.ws-an-drawing { cursor: crosshair; }
.ws-an-host.ws-an-drawing[data-an-tool="text"] { cursor: text; }
.ws-an-host svg { -webkit-user-select: none; user-select: none; }
.ws-an-ov { pointer-events: none; }
.ws-an-sel { fill: none; stroke: var(--accent); pointer-events: none; }
.ws-an-h { fill: var(--panel); stroke: var(--accent); pointer-events: all; touch-action: none; }
.ws-an-layer .ws-an { touch-action: none; }

/* inline text editor (textarea over the shape) and its chips */
.ws-an-host textarea.ws-an-ed {
  position: absolute; z-index: 6; box-sizing: border-box; padding: 5px 7px; margin: 0; resize: none; line-height: 1.3; font: 13px/1.3 var(--sans, system-ui, sans-serif);
  border: 2px solid var(--accent); border-radius: 6px; background: var(--panel); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
.ws-an-host textarea.ws-an-ed:focus { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .22), 0 0 0 3px var(--accent-soft); }
.ws-an-host .ws-an-edchips { position: absolute; z-index: 6; display: flex; flex-wrap: wrap; gap: 4px; max-width: 70%; pointer-events: none; }
.ws-an-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 600 12px/18px var(--mono, ui-monospace, Menlo, Consolas, monospace); border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.ws-an-chip.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.ws-an-chip.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); text-decoration: underline wavy var(--bad); }

/* ---- toolbar */
.ws-an-tools { display: grid; gap: 8px; }
.ws-an-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ws-an-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ws-an-grp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ws-an-tools .btn { min-height: 32px; }
.ws-an-tool.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.ws-an-tools .btn:disabled { opacity: .45; cursor: default; }
.ws-an-area { border-left: 4px solid var(--accent); }
.ws-an-tools select.ws-an-kind { width: auto; min-height: 32px; padding: 3px 8px; }
.ws-an-tools input.ws-an-num { width: 104px; min-height: 32px; padding: 3px 8px; }
.ws-an-lbl { white-space: nowrap; }
.ws-an-msg { min-height: 0; color: var(--warn); font-weight: 600; display: none; }
.ws-an-msg.on { display: block; }

/* ---- inspector */
.ws-an-insp { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 12px; display: grid; gap: 10px; margin-top: 8px; }
.ws-an-insp [hidden] { display: none !important; }
.ws-an-ititle { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ws-an-body-f { display: grid; gap: 10px; }
.ws-an-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.ws-an-f { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.ws-an-f.ws-an-fc { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.ws-an-ftxt { display: grid; }
.ws-an-insp textarea.ws-an-ta { width: 100%; min-height: 54px; resize: vertical; font: 13px/1.3 var(--sans, system-ui, sans-serif); }
.ws-an-insp input[type=number].ws-an-in { width: 84px; min-height: 32px; padding: 3px 8px; }
.ws-an-insp input[type=color].ws-an-color { width: 44px; height: 32px; padding: 2px; border-radius: 6px; cursor: pointer; }
.ws-an-insp input[type=range].ws-an-range { width: 130px; min-height: 32px; padding: 0; }
.ws-an-insp input[type=checkbox] { width: auto; }
.ws-an-none { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; font-size: 12px; color: var(--muted); cursor: pointer; }
.ws-an-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ws-an-chips:empty { display: none; }
.ws-an-sw { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-an-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.ws-an-swatch:hover { box-shadow: 0 0 0 2px var(--accent); }
.ws-an-swatch:focus-visible, .ws-an-tools .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-an-acts { margin-top: 2px; }

@media (max-width: 640px) {
  .ws-an-row { gap: 8px 12px; }
  .ws-an-insp input[type=range].ws-an-range { width: 110px; }
}
