/* Curved Fret Designer — precision instrument lab at night. */
:root {
  --bg: #07080a;
  --bg2: #0d0f12;
  --glass: rgba(16, 18, 22, 0.58);
  --glass-strong: rgba(18, 20, 25, 0.82);
  --hair: rgba(255, 255, 255, 0.075);
  --hair2: rgba(255, 255, 255, 0.13);
  --text: #e9ebee;
  --text2: #b8bdc5;
  --muted: #7d848f;
  --faint: #545a63;
  --accent: #9fdcff;
  --accent2: #6fc3f2;
  --accent-glow: rgba(159, 220, 255, 0.35);
  --nickel: #e8d6b6;
  --warn: #f0c27a;
  --error: #ff8f86;
  --ok: #9ee6c0;
  --bp-bg: #071426;
  --bp-ink: #8fdcff;
  --bp-dim: #6fb7d9;
  --ui: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 16px;
  --panelL: 316px;
  --panelR: 312px;
  --gap: 14px;
  --top: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { overflow: visible; }
::selection { background: rgba(159, 220, 255, 0.28); }

#app { position: fixed; inset: 0; overflow: hidden; }

/* --------------------------------------------------------------- stage -- */
#stage { position: absolute; inset: 0; background: radial-gradient(120% 90% at 60% 40%, #15171b 0%, #0a0b0d 55%, #050506 100%); }
.pane { position: absolute; left: 0; right: 0; transition: top .7s var(--ease), bottom .7s var(--ease), opacity .6s var(--ease); }
#pane3d { top: 0; bottom: 0; }
#pane3d canvas { width: 100%; height: 100%; display: block; outline: none; opacity: 0; transition: opacity 1.6s ease; touch-action: none; }
#app.ready #pane3d canvas { opacity: 1; }
#paneBp { top: 100%; bottom: -50%; opacity: 0; background:
  radial-gradient(90% 80% at 50% 45%, #0b2240 0%, var(--bp-bg) 60%, #040b16 100%); overflow: hidden; }
#app[data-view="split"] #pane3d { bottom: 44%; }
#app[data-view="split"] #paneBp { top: 56%; bottom: 0; opacity: 1; border-top: 1px solid rgba(143, 220, 255, 0.22); }
#app[data-view="blueprint"] #pane3d { bottom: 100%; opacity: 0; }
#app[data-view="blueprint"] #paneBp { top: 0; bottom: 0; opacity: 1; }
.stage-grain { position: absolute; inset: 0; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.gl-fallback[hidden] { display: none; }
.gl-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; padding: 40px; text-align: center; }

/* --------------------------------------------------------------- glass -- */
.glass {
  background: linear-gradient(180deg, rgba(28, 31, 37, 0.62), rgba(14, 16, 20, 0.58));
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--hair);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 0 0 1px rgba(255, 255, 255, 0.015), 0 24px 60px -20px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.25);
  border-radius: var(--r);
}
.reveal { opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d) * 110ms + 500ms); }
#app.ready .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------- topbar - */
.topbar { position: absolute; top: var(--gap); left: var(--gap); right: var(--gap); height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; z-index: 5; border-radius: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-mark path, .loader-mark path { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.brand-name { font-weight: 500; font-size: 14.5px; letter-spacing: .01em; }
.brand-sub { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.top-center { position: absolute; left: 50%; transform: translateX(-50%); }
.top-actions { display: flex; align-items: center; gap: 8px; }

.btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--hair2); background: rgba(255, 255, 255, 0.03); font-size: 12.5px; color: var(--text2); transition: background .2s, border-color .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn.accent { color: #06121b; background: linear-gradient(180deg, #c4ecff, #8fd3fb); border-color: rgba(255, 255, 255, .4); font-weight: 500; box-shadow: 0 0 0 1px rgba(159, 220, 255, .15), 0 6px 20px -6px rgba(159, 220, 255, .55); }
.btn.accent:hover { background: linear-gradient(180deg, #d6f2ff, #a3dcfd); color: #000; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn:focus-visible, .seg-btn:focus-visible, .mode:focus-visible, .thumb:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }

/* segmented */
.seg { position: relative; display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--hair); }
.seg-ind { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 7px; background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.06)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 1px rgba(255,255,255,.06); transition: transform .45s var(--ease), width .45s var(--ease), opacity .3s; opacity: 0; }
.seg-btn { position: relative; z-index: 1; border: 0; background: none; padding: 0 12px; height: 26px; font-size: 12px; color: var(--muted); border-radius: 7px; letter-spacing: .02em; transition: color .25s; }
.seg-btn.on { color: var(--text); }
.seg-btn:hover { color: var(--text2); }
.seg.small .seg-btn { padding: 0 9px; height: 24px; font-size: 11.5px; }

/* menus */
.menu-wrap { position: relative; }
.menu { position: absolute; top: 42px; right: 0; min-width: 300px; padding: 8px; z-index: 20; background: var(--glass-strong); transform-origin: top right; animation: pop .28s var(--ease); max-height: 70vh; overflow: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-title { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 8px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text2); }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, 0.06); color: var(--text); outline: none; }
.menu-item b { display: block; font-weight: 500; font-size: 13px; color: var(--text); }
.menu-item span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.menu-item .mi-tag { display: inline-block; font-family: var(--mono); font-size: 10px; color: var(--accent); margin-right: 6px; letter-spacing: .04em; }
.import-pop { width: 380px; }
.import-pop input { width: 100%; height: 34px; border-radius: 9px; border: 1px solid var(--hair2); background: rgba(0,0,0,.35); padding: 0 10px; font-family: var(--mono); font-size: 11.5px; outline: none; }
.import-pop input:focus { border-color: rgba(159, 220, 255, .5); box-shadow: 0 0 0 3px rgba(159, 220, 255, .12); }
.pop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px 2px; }
.pop-note { font-size: 11.5px; color: var(--muted); }

/* --------------------------------------------------------------- panels - */
.panel { position: absolute; top: calc(var(--gap) + 52px + 12px); bottom: calc(var(--gap) + 64px + 12px); z-index: 4; display: flex; flex-direction: column; overflow: hidden; }
.panel.left { left: var(--gap); width: var(--panelL); }
.panel.right { right: var(--gap); width: var(--panelR); }
.panel-scroll { overflow-y: auto; overflow-x: hidden; padding: 6px 0 10px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; height: 100%; }
.panel-scroll::-webkit-scrollbar { width: 6px; } .panel-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
.sec { padding: 12px 16px 14px; border-bottom: 1px solid var(--hair); }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sec-h > span:first-child { font-size: 10.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sec-aside { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* modes */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.mode { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 7px; border-radius: 10px; border: 1px solid var(--hair); background: rgba(255,255,255,.018); color: var(--muted); font-size: 10.5px; letter-spacing: .02em; transition: all .3s var(--ease); }
.mode:hover { border-color: var(--hair2); color: var(--text2); background: rgba(255,255,255,.04); }
.mode.on { color: var(--text); border-color: rgba(159, 220, 255, .38); background: linear-gradient(180deg, rgba(159,220,255,.12), rgba(159,220,255,.03)); box-shadow: 0 0 0 1px rgba(159,220,255,.08), 0 8px 24px -10px rgba(159,220,255,.45), inset 0 1px 0 rgba(255,255,255,.08); }
.glyph { width: 40px; height: 26px; }
.glyph .g-str { stroke: rgba(255,255,255,.1); stroke-width: .6; }
.glyph .g-fret { fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; opacity: .75; }
.glyph .g-node { fill: currentColor; }
.mode.on .glyph .g-fret { stroke: var(--accent); opacity: 1; filter: drop-shadow(0 0 2px var(--accent-glow)); stroke-dasharray: 1; animation: draw 1.1s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.mode:hover:not(.on) .glyph .g-fret { animation: sway 1.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sway { to { transform: skewY(0deg) scaleX(1.12); } }

.params { display: flex; flex-direction: column; gap: 13px; }
.params .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub-h { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin: 2px 0 -4px; display: flex; align-items: center; gap: 8px; }
.sub-h::after { content: ''; flex: 1; height: 1px; background: var(--hair); }
.solved { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.solved b { color: var(--accent); font-weight: 400; }
.solved:empty { display: none; }
.inline-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fit-box { margin-top: 10px; padding: 10px; border: 1px solid var(--hair); border-radius: 10px; background: rgba(0,0,0,.2); font-size: 11.5px; color: var(--text2); }
.fit-box .fit-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.fit-box .fit-row span { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

/* slider */
.ctl { user-select: none; }
.ctl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.ctl-label { font-size: 12px; color: var(--text2); letter-spacing: .01em; cursor: default; white-space: nowrap; }
.ctl-label small { color: var(--faint); font-size: 10.5px; margin-left: 4px; }
.ctl-val { display: flex; align-items: baseline; gap: 4px; padding: 2px 6px; border-radius: 6px; border: 1px solid transparent; transition: all .2s; }
.ctl-val:hover { border-color: var(--hair); background: rgba(0,0,0,.2); }
.ctl.editing .ctl-val { border-color: rgba(159,220,255,.45); background: rgba(0,0,0,.35); box-shadow: 0 0 0 3px rgba(159,220,255,.1); }
.ctl-val .num { width: 72px; text-align: right; border: 0; background: none; outline: none; font-family: var(--mono); font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; padding: 0; }
.ctl-val .unit { font-family: var(--mono); font-size: 10px; color: var(--muted); min-width: 14px; }
.track { position: relative; height: 18px; cursor: ew-resize; touch-action: none; }
.track .rail { position: absolute; left: 0; right: 0; top: 8px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.08); }
.track .fill { position: absolute; left: 0; top: 8px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(159,220,255,.25), var(--accent)); box-shadow: 0 0 10px rgba(159,220,255,.35); }
.track .thumb { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #cfd8e0 55%, #9aa6b2); box-shadow: 0 0 0 3px rgba(159,220,255,.0), 0 2px 6px rgba(0,0,0,.6); transition: box-shadow .2s, transform .2s; }
.ctl:hover .thumb { box-shadow: 0 0 0 4px rgba(159,220,255,.12), 0 2px 6px rgba(0,0,0,.6); }
.ctl.active .thumb { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(159,220,255,.16), 0 0 16px rgba(159,220,255,.5); }
.ctl.fine .fill { background: linear-gradient(90deg, rgba(232,214,182,.3), var(--nickel)); }
.ctl.fine .thumb::after { content: 'FINE'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; color: var(--nickel); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12px; color: var(--text2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.sw-track { position: relative; width: 28px; height: 16px; border-radius: 9px; background: rgba(255,255,255,.1); border: 1px solid var(--hair2); transition: background .25s; }
.sw-knob { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #cfd5dc; transition: transform .3s var(--ease), background .3s; }
.switch input:checked + .sw-track { background: rgba(159,220,255,.3); border-color: rgba(159,220,255,.5); }
.switch input:checked + .sw-track .sw-knob { transform: translateX(12px); background: #fff; box-shadow: 0 0 8px var(--accent); }
.switch input:focus-visible + .sw-track { outline: 1.5px solid var(--accent); outline-offset: 2px; }

/* profile chart */
.profile { height: 150px; margin: 0 -4px; }
.profile-svg { width: 100%; height: 100%; display: block; }
.pf-grid line { stroke: rgba(255,255,255,.06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pf-grid text, .pf-labels text { font-family: var(--mono); font-size: 8.5px; fill: var(--faint); }
.pf-labels .u { letter-spacing: .2em; }
.pf-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.pf-glow { fill: none; stroke-width: 6; opacity: .55; vector-effect: non-scaling-stroke; }
.pf-dots circle { fill: #0b0d10; stroke: var(--text); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.pf-pivot { transition: opacity .4s; }
.pf-pivot line { stroke: var(--nickel); stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pf-pivot text { font-family: var(--mono); font-size: 8px; letter-spacing: .15em; fill: var(--nickel); }
.pf-infl circle { fill: none; stroke: var(--nickel); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.pf-infl circle.halo { stroke-opacity: .3; animation: pulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* metrics */
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; }
.metric { background: rgba(12, 14, 17, .7); padding: 9px 11px 10px; min-width: 0; }
.metric .k { font-size: 9.5px; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .v { font-family: var(--mono); font-size: 14px; margin-top: 4px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .v small { font-size: 10px; color: var(--muted); margin-left: 3px; }
.metric.hi .v { color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }
.warn-badges { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.wbadge { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; line-height: 1.4; color: var(--text2); padding: 7px 9px; border-radius: 9px; border: 1px solid var(--hair); background: rgba(255,255,255,.02); }
.wbadge i { flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.wbadge.warn i { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.wbadge.error { border-color: rgba(255,143,134,.3); } .wbadge.error i { background: var(--error); box-shadow: 0 0 8px var(--error); }

/* string table */
.table-wrap { margin: 0 -6px; }
table.strings { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.strings th { font-size: 9.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); text-align: right; padding: 0 6px 6px; border-bottom: 1px solid var(--hair); }
table.strings th:first-child, table.strings td:first-child { text-align: left; }
table.strings td { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; padding: 4px 6px; color: var(--text2); border-bottom: 1px solid rgba(255,255,255,.035); white-space: nowrap; }
table.strings tr:hover td { background: rgba(255,255,255,.03); color: var(--text); }
table.strings td.idx { color: var(--muted); }
table.strings td.idx i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 0; border: 1px solid var(--text2); }
table.strings td.idx i.w { background: repeating-linear-gradient(60deg, var(--nickel) 0 1px, transparent 1px 2.4px); border-color: var(--nickel); }
table.strings td .cell { width: 64px; text-align: right; border: 1px solid transparent; background: none; border-radius: 5px; padding: 1px 4px; font-family: var(--mono); font-size: 11.5px; color: inherit; outline: none; }
table.strings td .cell.g { width: 44px; }
table.strings td .cell:hover { border-color: var(--hair2); }
table.strings td .cell:focus { border-color: rgba(159,220,255,.5); background: rgba(0,0,0,.35); color: var(--text); }
table.strings td.delta { color: var(--faint); font-size: 10.5px; }
table.strings td.note { color: var(--muted); text-align: right; }

/* --------------------------------------------------------------- dock --- */
.dock { position: absolute; left: 50%; bottom: var(--gap); transform: translateX(-50%); height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 10px; z-index: 5; border-radius: 16px; max-width: calc(100vw - 2 * var(--gap)); }
#app.ready .dock.reveal { transform: translateX(-50%); }
.dock.reveal { transform: translateX(-50%) translateY(14px); }
.dock-group { display: flex; align-items: center; gap: 3px; }
.dock-sep { width: 1px; height: 26px; background: var(--hair2); margin: 0 6px; }
.dbtn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 50px; height: 44px; padding: 0 6px; border: 1px solid transparent; border-radius: 11px; background: none; color: var(--muted); font-size: 10px; letter-spacing: .04em; transition: all .25s var(--ease); }
.dbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.dbtn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.dbtn.on { color: var(--accent); background: rgba(159,220,255,.08); border-color: rgba(159,220,255,.2); }
.dbtn:disabled { opacity: .35; cursor: not-allowed; }
.dbtn.exp { min-width: 42px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }
.dbtn.exp b { font-weight: 500; }
.dbtn.exp.soon { position: relative; }
.dbtn.exp.soon::after { content: 'soon'; position: absolute; bottom: 2px; font-size: 7.5px; letter-spacing: .14em; color: var(--faint); font-family: var(--ui); text-transform: uppercase; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); padding: 0; position: relative; transition: transform .25s var(--ease), box-shadow .25s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px #0b0d10, 0 0 0 3.5px var(--accent); }
.swatches { gap: 7px; padding: 0 4px; }

/* --------------------------------------------------------------- toasts - */
#toasts { position: absolute; left: 50%; bottom: calc(var(--gap) + 70px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 30; pointer-events: none; width: min(460px, calc(100vw - 32px)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 13px; border-radius: 12px; font-size: 12.5px; color: var(--text); background: rgba(18, 20, 25, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--hair2); box-shadow: 0 18px 40px -16px rgba(0,0,0,.8); opacity: 0; transform: translateY(10px) scale(.98); transition: all .45s var(--ease); max-width: 100%; }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast .t-ic svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; display: block; }
.toast.warn .t-ic svg { stroke: var(--warn); } .toast.error .t-ic svg { stroke: var(--error); } .toast.ok .t-ic svg { stroke: var(--ok); }
.toast .t-msg { flex: 1; line-height: 1.4; }
.toast .t-x { border: 0; background: none; color: var(--muted); font-size: 16px; width: 24px; height: 24px; border-radius: 6px; }
.toast .t-x:hover { background: rgba(255,255,255,.08); color: var(--text); }

/* --------------------------------------------------------------- loader - */
.loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; z-index: 40; background: var(--bg); transition: opacity 1s ease .2s, visibility 0s 1.3s; }
#app.ready .loader { opacity: 0; visibility: hidden; }
.loader-mark svg { width: 44px; height: 44px; }
.loader-mark path { stroke-dasharray: 40; animation: lmark 1.6s var(--ease) infinite alternate; }
.loader-mark path:nth-child(2) { animation-delay: .12s; } .loader-mark path:nth-child(3) { animation-delay: .24s; }
@keyframes lmark { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
.loader-t { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------------- blueprint */
.bp-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; font-family: var(--mono); }
.bp-svg.dragging { cursor: grabbing; }
.bp-svg * { vector-effect: non-scaling-stroke; }
.bp-grid .grid-minor { stroke: rgba(143, 220, 255, 0.055); stroke-width: 1; }
.bp-grid .grid-major { stroke: rgba(143, 220, 255, 0.12); stroke-width: 1; }
.bp-svg .outline { fill: rgba(143, 220, 255, 0.045); stroke: var(--bp-ink); stroke-width: 1.4; }
.bp-svg .string { stroke: rgba(220, 240, 255, 0.45); }
.bp-svg .string.wound { stroke: rgba(232, 214, 182, 0.55); }
.bp-svg .fret { fill: none; stroke: var(--bp-ink); stroke-width: 1.2; opacity: .9; transition: stroke .2s, opacity .2s; }
.bp-svg .fret.octave { stroke-width: 1.8; }
.bp-svg .fret.sp { stroke: #b9a8ff; }
.bp-svg .fret.s0 { stroke: var(--nickel); stroke-width: 1.8; }
.bp-svg .infl { fill: #fff; }
.bp-svg .infl-halo { fill: rgba(255,255,255,.08); stroke: #fff; stroke-width: 1; opacity: .8; }
.bp-titleblock .lg { display: inline-block; width: 10px; height: 2px; margin: 0 4px 2px 6px; vertical-align: middle; background: var(--bp-ink); }
.bp-titleblock .lg.sp { background: #b9a8ff; } .bp-titleblock .lg.in { width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.bp-titleblock .lg:first-child { margin-left: 0; }
.bp-svg .fret.hover { stroke: #fff !important; stroke-width: 2.4; filter: url(#bpGlow); opacity: 1; }
.bp-svg .hit { fill: none; stroke: transparent; cursor: crosshair; pointer-events: stroke; }
.bp-svg .nut { fill: none; stroke: #d8f2ff; stroke-width: 3; }
.bp-svg .bridge { fill: none; stroke: var(--bp-dim); stroke-width: 1.2; stroke-dasharray: 6 4; }
.bp-svg .saddle { fill: #071426; stroke: var(--bp-ink); stroke-width: 1.2; }
.bp-svg .nutpt { fill: var(--bp-ink); }
.bp-svg .marker { fill: rgba(143, 220, 255, 0.18); stroke: rgba(143, 220, 255, 0.5); stroke-width: 1; }
.bp-svg .perp { stroke: var(--nickel); stroke-width: 1; stroke-dasharray: 2 5; opacity: .85; }
.bp-svg .perp-label { fill: var(--nickel); letter-spacing: .12em; opacity: .9; }
.bp-svg .fret-num { fill: rgba(143, 220, 255, 0.6); }
.bp-svg .fret-num.octave { fill: #fff; }
.bp-svg .dim { stroke: var(--bp-dim); stroke-width: 1; color: var(--bp-dim); }
.bp-svg .ext { stroke: rgba(111, 183, 217, 0.45); stroke-width: 1; }
.bp-svg .dim-label { fill: #cdeeff; letter-spacing: .08em; paint-order: stroke; stroke: var(--bp-bg); stroke-width: 4px; stroke-linejoin: round; }
#bpArrow path { stroke: var(--bp-dim); }
.bp-tip { position: absolute; left: 0; top: 0; pointer-events: none; min-width: 190px; padding: 10px 12px; border-radius: 10px; background: rgba(4, 14, 28, .88); border: 1px solid rgba(143, 220, 255, .35); box-shadow: 0 0 0 1px rgba(143,220,255,.06), 0 16px 40px -12px rgba(0,0,0,.8), 0 0 30px -10px rgba(143,220,255,.4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity .18s; font-family: var(--mono); z-index: 3; }
.bp-tip.show { opacity: 1; }
.tip-h { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid rgba(143,220,255,.18); padding-bottom: 6px; margin-bottom: 6px; }
.tip-h span { font-size: 9.5px; letter-spacing: .2em; color: var(--bp-dim); }
.tip-h b { font-size: 18px; font-weight: 500; color: #fff; }
.tip-g { display: grid; grid-template-columns: auto auto; gap: 3px 14px; font-size: 11px; }
.tip-g span { color: var(--bp-dim); } .tip-g b { font-weight: 400; color: #e6f6ff; text-align: right; }
.bp-titleblock { position: absolute; top: calc(var(--bp-top, 0px) + 12px); right: calc(var(--bp-right, 0px) + 14px); border: 1px solid rgba(143, 220, 255, .3); font-family: var(--mono); font-size: 10px; color: #cdeeff; background: rgba(4, 14, 28, .6); min-width: 220px; pointer-events: none; transform-origin: top right; }
#app[data-view="split"] .bp-titleblock { transform: scale(.88); }
.tb-row { display: flex; border-bottom: 1px solid rgba(143, 220, 255, .18); } .tb-row:last-child { border-bottom: 0; }
.tb-k { width: 54px; padding: 4px 8px; color: var(--bp-dim); letter-spacing: .14em; border-right: 1px solid rgba(143,220,255,.18); }
.tb-v { padding: 4px 8px; letter-spacing: .05em; }

/* sheet tabs: mobile only */
.sheet-tabs { display: none; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  :root { --panelL: 292px; --panelR: 284px; }
  .dbtn { min-width: 44px; }
  .dbtn span.lbl { display: none; }
  .dbtn { height: 38px; }
}
@media (max-width: 980px) {
  .brand-sub { display: none; }
  .top-actions .btn span { display: none; }
  .top-actions .btn.accent span { display: inline; }
}
@media (max-width: 820px) {
  :root { --gap: 10px; --sheetH: 46vh; }
  .topbar { height: 48px; padding: 0 6px 0 12px; }
  .brand-name { font-size: 13px; }
  .top-center { position: static; transform: none; }
  .top-center .seg-btn { padding: 0 8px; }
  .brand { display: none; }
  .top-actions { gap: 4px; }
  .top-actions .btn.accent span { display: none; }
  .top-actions .btn { padding: 0 8px; }
  #unitSeg .seg-btn { padding: 0 7px; }
  .menu { position: fixed; top: 64px; left: 10px; right: 10px; min-width: 0; width: auto; }
  .panel, .dock { position: absolute; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; height: var(--sheetH); max-width: none; border-radius: 18px 18px 0 0; transform: translateY(105%) !important; transition: transform .5s var(--ease), opacity .4s; opacity: 1; padding-bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 6; }
  .dock { flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 10px; padding: 18px 12px calc(60px + env(safe-area-inset-bottom)); }
  .dock-sep { display: none; }
  .dbtn span.lbl { display: inline; }
  #app[data-sheet="design"] #panelDesign, #app[data-sheet="data"] #panelData, #app[data-sheet="view"] #dock { transform: none !important; }
  .sheet-tabs { display: flex; position: absolute; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); height: 42px; z-index: 8; padding: 4px; gap: 4px; border-radius: 13px; }
  .sheet-tabs button { flex: 1; border: 0; background: none; color: var(--muted); font-size: 12.5px; border-radius: 9px; }
  .sheet-tabs button:last-child { flex: 0 0 44px; font-size: 16px; }
  #app[data-sheet="design"] .sheet-tabs [data-sheet="design"], #app[data-sheet="data"] .sheet-tabs [data-sheet="data"], #app[data-sheet="view"] .sheet-tabs [data-sheet="view"] { background: rgba(255,255,255,.08); color: var(--text); }
  #toasts { bottom: calc(var(--sheetH) + 10px); }
  #app[data-sheet="none"] #toasts { bottom: 64px; }
  .bp-titleblock { display: none; }
  .modes { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
