/* Scan Library (public/scanlib.js): category rail | catalogue | results. Theme tokens only. */
#tab-scanlib-view { --sl-buy: var(--bullish, #16a34a); --sl-sell: var(--bearish, #dc2626); --sl-neu: var(--muted-foreground, #888); --sl-line: color-mix(in srgb, var(--border) 80%, transparent); }
#tab-scanlib-view .sl-wrap { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 24px; color: var(--foreground); }

/* header */
#tab-scanlib-view .sl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 18px 20px; background: var(--card); border: 1px solid var(--sl-line); border-radius: 14px; box-shadow: var(--sms-shadow, none); }
#tab-scanlib-view .sl-kicker { font: 600 11px/1 var(--pl-mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
#tab-scanlib-view .sl-title h2 { margin: 6px 0 4px; font: 500 26px/1.15 var(--pl-serif, Georgia, serif); letter-spacing: -.01em; }
#tab-scanlib-view .sl-title h2 em { font-style: italic; color: var(--muted-foreground); }
#tab-scanlib-view .sl-sub { margin: 0; font-size: 12.5px; color: var(--muted-foreground); display: flex; align-items: center; gap: 8px; }
#tab-scanlib-view .sl-sub.warn { color: var(--sl-sell); }
#tab-scanlib-view .sl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sl-neu); opacity: .5; }
#tab-scanlib-view .sl-dot.on { background: var(--sl-buy); opacity: 1; animation: slPulse 1.8s ease-in-out infinite; }
@keyframes slPulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--sl-buy) 20%, transparent); } }
#tab-scanlib-view .sl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#tab-scanlib-view .sl-search { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; min-width: 230px; border: 1px solid var(--sl-line); border-radius: 9px; background: var(--background); }
#tab-scanlib-view .sl-search svg { width: 15px; height: 15px; fill: none; stroke: var(--muted-foreground); stroke-width: 2; }
#tab-scanlib-view .sl-search input { all: unset; flex: 1; font-size: 13px; color: var(--foreground); }
#tab-scanlib-view .sl-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--secondary); }
#tab-scanlib-view .sl-seg button { all: unset; cursor: pointer; padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
#tab-scanlib-view .sl-seg button.on { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
#tab-scanlib-view .sl-switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted-foreground); cursor: pointer; user-select: none; }
#tab-scanlib-view .sl-switch input { position: absolute; opacity: 0; pointer-events: none; }
#tab-scanlib-view .sl-switch span { width: 30px; height: 17px; border-radius: 9px; background: var(--secondary); border: 1px solid var(--sl-line); position: relative; transition: background .2s; }
#tab-scanlib-view .sl-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted-foreground); transition: transform .2s, background .2s; }
#tab-scanlib-view .sl-switch input:checked + span { background: color-mix(in srgb, var(--primary) 25%, transparent); }
#tab-scanlib-view .sl-switch input:checked + span::after { transform: translateX(13px); background: var(--primary); }
#tab-scanlib-view .sl-switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* three panes */
#tab-scanlib-view .sl-body { display: grid; grid-template-columns: 188px minmax(300px, 400px) minmax(0, 1fr); gap: 14px; align-items: start; }
#tab-scanlib-view .sl-rail { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--card); border: 1px solid var(--sl-line); border-radius: 14px; }
#tab-scanlib-view .sl-rail button { all: unset; cursor: pointer; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 9px; font-size: 13px; color: var(--muted-foreground); transition: background .15s, color .15s; }
#tab-scanlib-view .sl-rail button:hover { background: var(--secondary); color: var(--foreground); }
#tab-scanlib-view .sl-rail button.on { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--foreground); font-weight: 600; }
#tab-scanlib-view .sl-rail svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#tab-scanlib-view .sl-rail button.on svg { stroke: var(--primary); }
#tab-scanlib-view .sl-rn { font: 500 10.5px/1 var(--pl-mono, monospace); color: var(--muted-foreground); }

#tab-scanlib-view .sl-cat { background: var(--card); border: 1px solid var(--sl-line); border-radius: 14px; overflow: hidden; }
#tab-scanlib-view .sl-cat-head { display: flex; justify-content: space-between; padding: 12px 14px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-foreground); border-bottom: 1px solid var(--sl-line); }
#tab-scanlib-view .sl-list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 230px); min-height: 360px; overflow-y: auto; }
#tab-scanlib-view .sl-row { position: relative; display: grid; grid-template-columns: 4px minmax(0, 1fr) 64px 28px; gap: 10px; align-items: center; padding: 11px 12px 11px 10px; border-bottom: 1px solid var(--sl-line); cursor: pointer; transition: background .15s; animation: slIn .35s ease both; animation-delay: calc(var(--i) * 18ms); }
@keyframes slIn { from { opacity: 0; transform: translateY(4px); } }
#tab-scanlib-view .sl-row:hover { background: color-mix(in srgb, var(--secondary) 70%, transparent); }
#tab-scanlib-view .sl-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
#tab-scanlib-view .sl-row.sel { background: color-mix(in srgb, var(--primary) 9%, transparent); }
#tab-scanlib-view .sl-row.zero .sl-name, #tab-scanlib-view .sl-row.zero .sl-n { opacity: .55; }
#tab-scanlib-view .sl-side { align-self: stretch; width: 4px; border-radius: 3px; background: var(--sl-neu); }
#tab-scanlib-view .sl-side.buy { background: var(--sl-buy); }
#tab-scanlib-view .sl-side.sell { background: var(--sl-sell); }
#tab-scanlib-view .sl-name { font-size: 13.5px; font-weight: 600; }
#tab-scanlib-view .sl-desc { margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--muted-foreground); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#tab-scanlib-view .sl-top { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
#tab-scanlib-view .sl-top b { font: 500 10px/1 var(--pl-mono, monospace); padding: 3px 5px; border-radius: 4px; background: var(--secondary); color: var(--muted-foreground); }
#tab-scanlib-view .sl-count { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
#tab-scanlib-view .sl-n { font: 600 15px/1 var(--pl-mono, monospace); font-variant-numeric: tabular-nums; }
#tab-scanlib-view .sl-bar { width: 100%; height: 4px; border-radius: 2px; background: var(--secondary); overflow: hidden; }
#tab-scanlib-view .sl-bar i { display: block; height: 100%; border-radius: 2px; background: var(--primary); transition: width .5s ease; }
#tab-scanlib-view button.sl-add { all: unset; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--sl-line); font-size: 16px; line-height: 1; color: var(--muted-foreground); transition: all .15s; }
#tab-scanlib-view button.sl-add:hover { border-color: var(--primary); color: var(--primary); }
#tab-scanlib-view button.sl-add.on { background: var(--primary); border-color: var(--primary); color: var(--background); }
#tab-scanlib-view button.sl-add:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#tab-scanlib-view .sl-empty { padding: 30px 16px; text-align: center; font-size: 13px; color: var(--muted-foreground); }

/* results */
#tab-scanlib-view .sl-res { min-height: 420px; background: var(--card); border: 1px solid var(--sl-line); border-radius: 14px; padding: 16px; transition: opacity .2s; }
#tab-scanlib-view .sl-res.busy { opacity: .55; }
#tab-scanlib-view .sl-res-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 70px 20px; color: var(--muted-foreground); }
#tab-scanlib-view .sl-res-empty.small { padding: 30px 10px; }
#tab-scanlib-view .sl-res-empty svg { width: 58px; height: 58px; fill: none; stroke: var(--primary); stroke-width: 1.6; opacity: .8; }
#tab-scanlib-view .sl-res-empty h3 { margin: 12px 0 6px; font: 500 20px/1.2 var(--pl-serif, Georgia, serif); color: var(--foreground); }
#tab-scanlib-view .sl-res-empty p { max-width: 380px; font-size: 13px; line-height: 1.5; margin: 0; }
#tab-scanlib-view .sl-res-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
#tab-scanlib-view .sl-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#tab-scanlib-view .sl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: var(--secondary); border-left: 3px solid var(--sl-neu); }
#tab-scanlib-view .sl-chip.buy { border-left-color: var(--sl-buy); }
#tab-scanlib-view .sl-chip.sell { border-left-color: var(--sl-sell); }
#tab-scanlib-view .sl-chip button { all: unset; cursor: pointer; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; color: var(--muted-foreground); }
#tab-scanlib-view .sl-chip button:hover { background: var(--card); color: var(--foreground); }
#tab-scanlib-view .sl-and { font: italic 12px var(--pl-serif, Georgia, serif); color: var(--muted-foreground); }
#tab-scanlib-view .sl-res-n { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted-foreground); }
#tab-scanlib-view .sl-res-n b { font: 600 18px var(--pl-mono, monospace); color: var(--foreground); }
#tab-scanlib-view .sl-res-n span { font-size: 11.5px; }
#tab-scanlib-view button.sl-ghost, #tab-scanlib-view button.sl-more { all: unset; cursor: pointer; padding: 6px 11px; border: 1px solid var(--sl-line); border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--foreground); }
#tab-scanlib-view button.sl-ghost:hover, #tab-scanlib-view button.sl-more:hover { border-color: var(--primary); }
#tab-scanlib-view button.sl-ghost[disabled] { opacity: .4; cursor: default; }
#tab-scanlib-view button.sl-more { display: block; margin: 12px auto 0; }
#tab-scanlib-view .sl-recipes { margin: 12px 0; border: 1px dashed var(--sl-line); border-radius: 10px; padding: 8px 12px; }
#tab-scanlib-view .sl-recipes summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
#tab-scanlib-view .sl-recipe { padding: 10px 0 4px; }
#tab-scanlib-view .sl-recipe + .sl-recipe { border-top: 1px solid var(--sl-line); }
#tab-scanlib-view .sl-rh { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
#tab-scanlib-view .sl-rh .sl-side { align-self: auto; height: 14px; }
#tab-scanlib-view .sl-rh em { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted-foreground); }
#tab-scanlib-view .sl-recipe p { margin: 4px 0 6px; font-size: 12.5px; color: var(--muted-foreground); }
#tab-scanlib-view .sl-recipe ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
#tab-scanlib-view .sl-recipe li { font: 500 11.5px/1.3 var(--pl-mono, monospace); padding: 4px 8px 4px 22px; border-radius: 6px; background: var(--secondary); position: relative; }
#tab-scanlib-view .sl-recipe li::before { content: ''; position: absolute; left: 8px; top: 50%; width: 7px; height: 4px; border-left: 1.6px solid var(--primary); border-bottom: 1.6px solid var(--primary); transform: translateY(-70%) rotate(-45deg); }
#tab-scanlib-view .sl-tablewrap { overflow-x: auto; border: 1px solid var(--sl-line); border-radius: 10px; }
#tab-scanlib-view .sl-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
#tab-scanlib-view .sl-table th { position: sticky; top: 0; z-index: 1; background: var(--card); padding: 9px 10px; text-align: right; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); border-bottom: 1px solid var(--sl-line); white-space: nowrap; }
#tab-scanlib-view .sl-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--sl-line); font-family: var(--pl-mono, monospace); white-space: nowrap; }
#tab-scanlib-view .sl-table .l { text-align: left; font-family: inherit; }
#tab-scanlib-view .sl-table td.l b { font-weight: 600; }
#tab-scanlib-view .sl-table td.l small { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted-foreground); }
#tab-scanlib-view .sl-table tbody tr { cursor: pointer; transition: background .12s; }
#tab-scanlib-view .sl-table tbody tr:hover { background: var(--secondary); }
#tab-scanlib-view .sl-table tbody tr:last-child td { border-bottom: 0; }
#tab-scanlib-view .sl-table .up { color: var(--sl-buy); }
#tab-scanlib-view .sl-table .dn { color: var(--sl-sell); }
#tab-scanlib-view .sl-live { margin-left: 6px; padding: 1px 5px; border-radius: 4px; font: 600 9px/1.4 var(--pl-mono, monospace); text-transform: uppercase; color: var(--sl-buy); background: color-mix(in srgb, var(--sl-buy) 12%, transparent); vertical-align: 1px; }
#tab-scanlib-view button.sl-chart { all: unset; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted-foreground); }
#tab-scanlib-view button.sl-chart:hover { background: var(--card); color: var(--primary); }
#tab-scanlib-view button.sl-chart svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tab-scanlib-view .sl-note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted-foreground); }

@media (max-width: 1280px) {
  #tab-scanlib-view .sl-body { grid-template-columns: 56px minmax(280px, 360px) minmax(0, 1fr); }
  #tab-scanlib-view .sl-rail button { grid-template-columns: 18px; justify-content: center; }
  #tab-scanlib-view .sl-rl, #tab-scanlib-view .sl-rn { display: none; }
}
@media (max-width: 900px) {
  #tab-scanlib-view .sl-body { grid-template-columns: 1fr; }
  #tab-scanlib-view .sl-rail { position: static; flex-direction: row; overflow-x: auto; }
  #tab-scanlib-view .sl-rail button { grid-template-columns: 18px auto; }
  #tab-scanlib-view .sl-rl { display: inline; white-space: nowrap; }
  #tab-scanlib-view .sl-list { max-height: 420px; min-height: 0; }
  #tab-scanlib-view .sl-search { min-width: 0; flex: 1 1 100%; }
}
#tab-scanlib-view .sl-wrap, #tab-scanlib-view .sl-body > *, #tab-scanlib-view .sl-title { min-width: 0; }
#tab-scanlib-view .sl-title { flex: 1 1 320px; }
#tab-scanlib-view .sl-sub { flex-wrap: wrap; }
@media (max-width: 700px) {
  #tab-scanlib-view .sl-head { padding: 14px; }
  #tab-scanlib-view .sl-title h2 { font-size: 21px; }
  #tab-scanlib-view .sl-tools { width: 100%; }
  #tab-scanlib-view .sl-seg { flex-wrap: wrap; }
}
/* ================================================================ motion layer */
/* header: drifting light + a scanning beam over a field of tiny "stock" ticks */
#tab-scanlib-view .sl-head { position: relative; overflow: hidden; isolation: isolate; animation: slRise .5s cubic-bezier(.2,.7,.2,1) both; }
#tab-scanlib-view .sl-head > * { position: relative; z-index: 1; }
#tab-scanlib-view .sl-aura { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#tab-scanlib-view .sl-aura::before, #tab-scanlib-view .sl-aura::after { content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; filter: blur(60px); opacity: .16; }
#tab-scanlib-view .sl-aura::before { background: var(--primary); top: -200px; right: 8%; animation: slDrift 14s ease-in-out infinite alternate; }
#tab-scanlib-view .sl-aura::after { background: var(--sl-buy); bottom: -240px; left: 30%; animation: slDrift 18s ease-in-out infinite alternate-reverse; }
html.dark #tab-scanlib-view .sl-aura::before, html.dark #tab-scanlib-view .sl-aura::after { opacity: .22; }
@keyframes slDrift { to { transform: translate(-90px, 40px) scale(1.15); } }
#tab-scanlib-view .sl-ticks { position: absolute; right: 0; bottom: 0; width: 46%; height: 100%; display: flex; align-items: flex-end; gap: 3px; padding: 0 14px 0 0; opacity: .5; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
#tab-scanlib-view .sl-ticks i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--muted-foreground) 22%, transparent); transform-origin: bottom; animation: slTick 2.6s ease-in-out infinite; animation-delay: calc(var(--d) * -1s); }
#tab-scanlib-view .sl-ticks i.hit { background: color-mix(in srgb, var(--primary) 55%, transparent); }
@keyframes slTick { 50% { transform: scaleY(.55); } }
#tab-scanlib-view .sl-beam { position: absolute; top: 0; bottom: 0; width: 70px; left: -80px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 14%, transparent), transparent); animation: slBeam 5.5s cubic-bezier(.45,0,.55,1) infinite; }
#tab-scanlib-view .sl-beam::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: color-mix(in srgb, var(--primary) 50%, transparent); }
@keyframes slBeam { 0% { left: -80px; } 70%, 100% { left: calc(100% + 10px); } }
#tab-scanlib-view .sl-title h2 em { background: linear-gradient(90deg, var(--muted-foreground), var(--primary), var(--muted-foreground)); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: slShine 7s linear infinite; }
@keyframes slShine { to { background-position: -220% 0; } }
#tab-scanlib-view .sl-kicker::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 2px; background: var(--primary); vertical-align: 0; animation: slSpin 6s linear infinite; }
@keyframes slSpin { to { transform: rotate(360deg); } }
@keyframes slRise { from { opacity: 0; transform: translateY(10px); } }

/* pulse strip: KPIs + bull/bear breadth */
#tab-scanlib-view .sl-pulse { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(220px, 1.4fr); gap: 10px; animation: slRise .55s .08s cubic-bezier(.2,.7,.2,1) both; }
#tab-scanlib-view .sl-kpi { position: relative; overflow: hidden; padding: 12px 14px; background: var(--card); border: 1px solid var(--sl-line); border-radius: 12px; transition: transform .25s, border-color .25s; }
#tab-scanlib-view .sl-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 40%, var(--sl-line)); }
#tab-scanlib-view .sl-kpi span { display: block; font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
#tab-scanlib-view .sl-kpi b { display: block; margin-top: 4px; font: 600 22px/1 var(--pl-mono, monospace); font-variant-numeric: tabular-nums; }
#tab-scanlib-view .sl-kpi b.buy { color: var(--sl-buy); } #tab-scanlib-view .sl-kpi b.sell { color: var(--sl-sell); }
#tab-scanlib-view .sl-kpi::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--primary); transform: scaleX(0); transform-origin: left; animation: slUnder .9s .3s cubic-bezier(.2,.7,.2,1) forwards; opacity: .6; }
@keyframes slUnder { to { transform: scaleX(1); } }
#tab-scanlib-view .sl-breadth { padding: 12px 14px; background: var(--card); border: 1px solid var(--sl-line); border-radius: 12px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
#tab-scanlib-view .sl-bl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-foreground); }
#tab-scanlib-view .sl-bl b { font-family: var(--pl-mono, monospace); color: var(--foreground); }
#tab-scanlib-view .sl-bbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--secondary); gap: 2px; }
#tab-scanlib-view .sl-bbar i { display: block; height: 100%; width: 0; transition: width 1s cubic-bezier(.2,.7,.2,1); }
#tab-scanlib-view .sl-bbar i.buy { background: var(--sl-buy); border-radius: 5px 0 0 5px; }
#tab-scanlib-view .sl-bbar i.sell { background: var(--sl-sell); border-radius: 0 5px 5px 0; margin-left: auto; }

/* panes enter */
#tab-scanlib-view .sl-rail { animation: slRise .5s .14s cubic-bezier(.2,.7,.2,1) both; }
#tab-scanlib-view .sl-cat { animation: slRise .5s .2s cubic-bezier(.2,.7,.2,1) both; }
#tab-scanlib-view .sl-res { animation: slRise .5s .26s cubic-bezier(.2,.7,.2,1) both; position: relative; overflow: hidden; }

/* rail: sliding highlight */
#tab-scanlib-view .sl-rail { position: sticky; }
#tab-scanlib-view .sl-rail .sl-slide { position: absolute; left: 8px; right: 8px; top: 0; height: 0; border-radius: 9px; background: color-mix(in srgb, var(--primary) 12%, transparent); transition: transform .35s cubic-bezier(.3,.8,.3,1), height .35s; pointer-events: none; }
#tab-scanlib-view .sl-rail button { position: relative; z-index: 1; }
#tab-scanlib-view .sl-rail.slid button.on { background: transparent; }
#tab-scanlib-view .sl-rail button svg { transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
#tab-scanlib-view .sl-rail button:hover svg, #tab-scanlib-view .sl-rail button.on svg { transform: scale(1.15) rotate(-6deg); }

/* catalogue rows */
#tab-scanlib-view .sl-row::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--primary) 8%, transparent) 50%, transparent 70%); background-size: 250% 100%; background-position: 120% 0; transition: background-position .7s ease; }
#tab-scanlib-view .sl-row:hover::after { background-position: -40% 0; }
#tab-scanlib-view .sl-row .sl-side { transition: transform .25s; transform-origin: center; }
#tab-scanlib-view .sl-row:hover .sl-side { transform: scaleY(1.12) scaleX(1.4); }
#tab-scanlib-view .sl-row .sl-name { transition: transform .25s, color .25s; }
#tab-scanlib-view .sl-row:hover .sl-name { transform: translateX(3px); }
#tab-scanlib-view .sl-row.sel .sl-name { color: var(--primary); }
#tab-scanlib-view .sl-row.sel { box-shadow: inset 3px 0 0 var(--primary); }
#tab-scanlib-view .sl-top b { animation: slPop .35s cubic-bezier(.3,1.5,.5,1) both; animation-delay: calc(var(--i) * 18ms + var(--j) * 45ms + .15s); }
@keyframes slPop { from { opacity: 0; transform: scale(.7); } }
#tab-scanlib-view .sl-bar i { transition: width .9s cubic-bezier(.2,.7,.2,1); position: relative; overflow: hidden; }
#tab-scanlib-view .sl-row.sel .sl-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: slGlint 1.6s ease-in-out infinite; }
@keyframes slGlint { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
#tab-scanlib-view .sl-n.flash-up { animation: slFlashUp 1.4s ease; }
#tab-scanlib-view .sl-n.flash-dn { animation: slFlashDn 1.4s ease; }
@keyframes slFlashUp { 0%, 30% { color: var(--sl-buy); transform: scale(1.18); } }
@keyframes slFlashDn { 0%, 30% { color: var(--sl-sell); transform: scale(1.18); } }
#tab-scanlib-view .sl-n { display: inline-block; transition: transform .3s; }
#tab-scanlib-view button.sl-add { transition: transform .3s cubic-bezier(.3,1.6,.5,1), background .2s, border-color .2s, color .2s; }
#tab-scanlib-view button.sl-add:hover { transform: rotate(90deg) scale(1.08); }
#tab-scanlib-view button.sl-add.on { animation: slPop .35s cubic-bezier(.3,1.5,.5,1); }
#tab-scanlib-view button.sl-add.on:hover { transform: scale(1.08); }

/* skeleton while loading */
#tab-scanlib-view .sl-skel { padding: 13px 14px; border-bottom: 1px solid var(--sl-line); display: grid; gap: 7px; }
#tab-scanlib-view .sl-skel i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--secondary) 25%, color-mix(in srgb, var(--secondary) 40%, var(--card)) 50%, var(--secondary) 75%); background-size: 300% 100%; animation: slShimmer 1.3s linear infinite; }
#tab-scanlib-view .sl-skel i:nth-child(1) { width: 55%; height: 12px; } #tab-scanlib-view .sl-skel i:nth-child(2) { width: 85%; } #tab-scanlib-view .sl-skel i:nth-child(3) { width: 40%; }
@keyframes slShimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* results */
#tab-scanlib-view .sl-res.busy { opacity: 1; }
#tab-scanlib-view .sl-res.busy > * { opacity: .45; transition: opacity .2s; }
#tab-scanlib-view .sl-res.busy::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 3; background: linear-gradient(90deg, transparent, var(--primary), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: slLoad 1s linear infinite; }
@keyframes slLoad { from { background-position: -50% 0; } to { background-position: 150% 0; } }
#tab-scanlib-view .sl-chip { animation: slPop .4s cubic-bezier(.3,1.5,.5,1) both; animation-delay: calc(var(--j, 0) * 70ms); }
#tab-scanlib-view .sl-and { animation: slRise .4s both; }
#tab-scanlib-view .sl-res-n b { display: inline-block; }
#tab-scanlib-view .sl-table tbody tr { animation: slRow .4s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(min(var(--r), 24) * 22ms); }
@keyframes slRow { from { opacity: 0; transform: translateX(-8px); } }
#tab-scanlib-view .sl-table tbody tr td.l b { transition: color .2s; }
#tab-scanlib-view .sl-table tbody tr:hover td.l b { color: var(--primary); }
#tab-scanlib-view .sl-table tbody tr td:first-child { box-shadow: inset 0 0 0 0 var(--primary); transition: box-shadow .2s; }
#tab-scanlib-view .sl-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 0 var(--primary); }
#tab-scanlib-view .sl-mbar { display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: var(--secondary); overflow: hidden; }
#tab-scanlib-view .sl-mbar i { display: block; height: 100%; width: var(--w); background: var(--primary); opacity: .7; transform-origin: left; animation: slGrow .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(min(var(--r), 24) * 22ms + .15s); }
@keyframes slGrow { from { transform: scaleX(0); } }
#tab-scanlib-view .sl-recipe li { animation: slRise .35s both; animation-delay: calc(var(--j, 0) * 60ms + .1s); }
#tab-scanlib-view .sl-recipe li::before { animation: slCheck .4s both; animation-delay: calc(var(--j, 0) * 60ms + .3s); }
@keyframes slCheck { from { opacity: 0; transform: translateY(-70%) rotate(-45deg) scale(.2); } }
#tab-scanlib-view .sl-res-empty svg rect { animation: slBook 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
#tab-scanlib-view .sl-res-empty svg rect:nth-child(2) { animation-delay: .25s; } #tab-scanlib-view .sl-res-empty svg rect:nth-child(3) { animation-delay: .5s; }
@keyframes slBook { 50% { transform: translateY(-4px); } }
#tab-scanlib-view button.sl-chart svg path:first-child { stroke-dasharray: 30; stroke-dashoffset: 0; }
#tab-scanlib-view tr:hover button.sl-chart svg path:first-child { animation: slDraw .6s ease; }
@keyframes slDraw { from { stroke-dashoffset: 30; } }
#tab-scanlib-view .sl-kpi b.tick { animation: slFlashUp 1.2s ease; }

#tab-scanlib-view .sl-stk { display: flex; align-items: center; gap: 10px; min-width: 0; }
#tab-scanlib-view .sl-stk > div { min-width: 0; }
#tab-scanlib-view .sl-top b { display: inline-flex; align-items: center; gap: 4px; }
#tab-scanlib-view .sl-table tbody tr.sl-still, #tab-scanlib-view .sl-table tbody tr.sl-still .sl-mbar i { animation: none; }
@media (max-width: 1100px) { #tab-scanlib-view .sl-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); } #tab-scanlib-view .sl-breadth { grid-column: 1 / -1; } }
@media (max-width: 700px) { #tab-scanlib-view .sl-ticks { display: none; } }
@media (prefers-reduced-motion: reduce) {
  #tab-scanlib-view *, #tab-scanlib-view *::before, #tab-scanlib-view *::after { animation: none !important; transition: none !important; }
  #tab-scanlib-view .sl-beam, #tab-scanlib-view .sl-aura { display: none; }
}
