/* Fretboard Lab — shared styles, scoped so the site theme and wp-admin don't collide */
.glg-fretlab, .glg-fretlab-admin {
  --fl-surface: #ffffff; --fl-ink: #1e2433; --fl-muted: #6b7180; --fl-line: #d9dce2; --fl-chip: #eef0f3;
  --fl-accent: #1e2433; --fl-accent-ink: #ffffff; --fl-danger: #b8402e;
  --fl-wood: #faf5ea; --fl-fret: #b9bdc6; --fl-string: #9ca1ab; --fl-nut: #6b7180; --fl-inlay: #e5dbc5;
  --fl-note: #1e2433; --fl-note-ink: #ffffff; --fl-root: #c4412e; --fl-root-ink: #ffffff;
  --fl-ghost: #ffffff; --fl-ghost-line: #c5c9d1; --fl-ghost-ink: #8b909b;
  --fl-glow: #f2b33d; --fl-chord: rgba(64,124,196,.20); --fl-chord-line: rgba(64,124,196,.55); --fl-chord-dot: #dce8f6; --fl-chord-ink: #2a4f7c; --fl-hover: rgba(30,36,51,.06);
  --fl-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--fl-ink);
}
.glg-fretlab *, .glg-fretlab-admin * { box-sizing: border-box; }

/* ---------- viewer ---------- */
.glg-fretlab { display: flex; flex-direction: column; gap: 12px; margin: 1.5em 0; font-size: 15px; line-height: 1.5; max-width: 100%; }
.glg-fretlab .fl-title { font-weight: 700; font-size: 1.15em; }
.glg-fretlab .fl-card { background: var(--fl-surface); border: 1px solid var(--fl-line); border-radius: 18px; padding: 16px 0 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fl-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.fl-pill { flex: none; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1; color: var(--fl-ink); background: var(--fl-surface); border: 1.5px solid var(--fl-line); border-radius: 999px; padding: 13px 18px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.fl-pill:hover { border-color: var(--fl-ink); }
.fl-pill.fl-on { background: var(--fl-ink); border-color: var(--fl-ink); color: #fff; }
.fl-rootpill.fl-on { background: var(--fl-root); border-color: var(--fl-root); }
.fl-board { min-width: 0; }
.fl-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.fl-scroll:focus-visible { outline: 2px solid var(--fl-ink); outline-offset: -2px; border-radius: 8px; }
.fl-board svg.fl-svg { display: block; max-width: none; height: auto; user-select: none; -webkit-user-select: none; }
.fl-swipe { margin: 4px 16px 0; text-align: center; font-size: 13px; color: var(--fl-muted); }
.fl-roots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 4px 16px 0; }
.fl-rlabel { font-size: 15px; color: var(--fl-muted); }
.fl-rchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fl-rootpill { padding: 11px 16px; }
.fl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fl-btn { font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--fl-ink); background: var(--fl-surface); border: 1.5px solid var(--fl-line); border-radius: 999px; padding: 10px 18px; cursor: pointer; white-space: nowrap; min-height: 42px; }
.fl-btn:hover:not(:disabled) { border-color: var(--fl-ink); }
.fl-chordbtn { white-space: normal; max-width: 100%; text-align: left; }
.fl-btn:disabled { opacity: .45; cursor: not-allowed; }
.fl-btn.fl-primary { background: var(--fl-ink); color: #fff; border-color: var(--fl-ink); }
.fl-pill:focus-visible, .fl-btn:focus-visible, .fl-seg button:focus-visible, .fl-range:focus-visible { outline: 2px solid var(--fl-root); outline-offset: 2px; }
.fl-tempo { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fl-muted); margin: 0; }
/* the tempo slider is drawn entirely here, so site themes can't hide or restyle it */
.glg-fretlab input[type=range].fl-range { -webkit-appearance: none; appearance: none; width: 120px; height: 24px; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; cursor: pointer; --fl-pct: 50%; }
.glg-fretlab input[type=range].fl-range::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; border: 0; background: linear-gradient(to right, var(--fl-ink) 0 var(--fl-pct), var(--fl-line) var(--fl-pct) 100%); }
.glg-fretlab input[type=range].fl-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--fl-ink); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--fl-ink); }
.glg-fretlab input[type=range].fl-range::-moz-range-track { height: 4px; border-radius: 999px; border: 0; background: var(--fl-line); }
.glg-fretlab input[type=range].fl-range::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--fl-ink); }
.glg-fretlab input[type=range].fl-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--fl-ink); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--fl-ink); }
.glg-fretlab input[type=range].fl-range:focus { outline: none; }
.glg-fretlab input[type=range].fl-range:focus-visible { outline: 2px solid var(--fl-root); outline-offset: 4px; border-radius: 4px; }
.fl-tval { font-family: var(--fl-mono); color: var(--fl-ink); min-width: 4ch; font-variant-numeric: tabular-nums; }
.fl-seg { display: inline-flex; background: var(--fl-chip); border-radius: 999px; padding: 3px; gap: 2px; }
.fl-seg button { font-family: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--fl-muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.fl-seg button.fl-on { background: var(--fl-surface); color: var(--fl-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.fl-status { margin: 0; font-size: 14px; color: var(--fl-muted); }
.fl-status:empty { display: none; }
.fl-tabwrap { background: #fff; border: 1px solid var(--fl-line); border-radius: 14px; overflow: auto; max-height: 340px; }
.fl-tabwrap.fl-collapsed { max-height: 0; border-width: 0; }
.glg-fretlab [hidden], .glg-fretlab-admin [hidden] { display: none !important; }

/* ---------- fretboard drawing ---------- */
.fl-wood { fill: var(--fl-wood); }
.fl-fret { stroke: var(--fl-fret); stroke-width: 1.6; }
.fl-nut { fill: var(--fl-nut); }
.fl-str { stroke: var(--fl-string); }
.fl-inlay { fill: var(--fl-inlay); }
.fl-fnum { fill: var(--fl-muted); font-size: 15px; text-anchor: middle; font-family: Georgia, "Times New Roman", serif; }
.fl-dots { transition: opacity .25s ease; }
.fl-ghost circle { fill: var(--fl-ghost); stroke: var(--fl-ghost-line); stroke-width: 1.5; }
.fl-ghost text { fill: var(--fl-ghost-ink); font: 600 9.5px var(--fl-mono); text-anchor: middle; pointer-events: none; }
.fl-dot .fl-body { fill: var(--fl-note); }
.fl-dot text { fill: var(--fl-note-ink); font: 700 11px var(--fl-mono); text-anchor: middle; pointer-events: none; }
.fl-dot.fl-root .fl-body { fill: var(--fl-root); }
.fl-dot.fl-root text { fill: var(--fl-root-ink); }
.fl-halo { fill: var(--fl-chord); stroke: var(--fl-chord-line); stroke-width: 1.5; }
.fl-dot.fl-chord .fl-body { fill: var(--fl-chord-dot); stroke: var(--fl-chord-line); stroke-width: 1.5; }
.fl-dot.fl-chord text { fill: var(--fl-chord-ink); }
.fl-dot.fl-croot .fl-body { fill: #f3d3cd; stroke: var(--fl-root); }
.fl-dot.fl-croot text { fill: var(--fl-root); }
.fl-chordbtn.fl-on { background: var(--fl-chord-dot); border-color: var(--fl-chord-line); color: var(--fl-chord-ink); }
.fl-dot.fl-out .fl-body { fill: var(--fl-surface); stroke: var(--fl-note); stroke-width: 2.5; }
.fl-dot.fl-out text { fill: var(--fl-note); }
.fl-dot.fl-sounding .fl-body { fill: var(--fl-glow); }
.fl-dot.fl-sounding text { fill: var(--fl-ink); }
.fl-ring { fill: none; stroke: var(--fl-glow); stroke-width: 3.5; animation: fl-pulse .4s ease-out; pointer-events: none; }
@keyframes fl-pulse { from { opacity: 0; stroke-width: 10; } to { opacity: 1; stroke-width: 3.5; } }
.fl-badge rect { fill: var(--fl-glow); stroke: var(--fl-surface); stroke-width: 1.5; }
.fl-badge text { fill: var(--fl-ink); font: 700 9px var(--fl-mono); text-anchor: middle; }
.fl-hit { fill: transparent; cursor: pointer; }
.fl-hit:hover { fill: var(--fl-hover); }
@media (prefers-reduced-motion: reduce) { .fl-ring { animation: none; } .fl-dots { transition: none; } .fl-pill { transition: none; } }
@media (max-width: 520px) { .glg-fretlab input[type=range].fl-range { width: 96px; } .fl-pill { padding: 12px 16px; font-size: 14px; } }
