/* Exact ports of Dusk's two flagship sliders (PR 249 head 59b2013), plain CSS:
   - .levl  the leverage lever, src/components/trading/LeverageRow.tsx + panel.css (lab orb4 panel L, round 33)
   - .ltv   Borrow's loan-to-value rail, src/components/trading/panel/LtvRail.tsx + panel-l.css (shell round 38, view A)
   Values are the app's, unchanged. A run restyles these from its own sheet; it never edits this file. */

/* ---------- Leverage ---------- */
.levl {
  --tone: color-mix(in oklch, oklch(var(--action-leverage-solid)) calc(86% + var(--pct) * 0.14%), oklch(var(--light)));
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.levl[data-off] { --tone: oklch(var(--ink-subtle)); }
.levl-track { position: relative; height: 28px; margin: 0 8px; container-type: inline-size; }
.levl-glow, .levl-rail, .levl-fill { position: absolute; top: 10px; height: 8px; border-radius: 999px; }
.levl-rail { left: 0; right: 0;
  background: oklch(var(--surface-track));
  box-shadow: inset 0 0 0 1px oklch(var(--line) / 0.7), inset 0 1px 2px oklch(var(--ink) / 0.06);
}
.levl-glow { left: 0;
  width: clamp(0px, calc(var(--pct) * 1%), 100%);
  background: var(--tone);
  filter: blur(6px);
  opacity: calc(0.18 + var(--pct) * 0.0022);
  transition: width 200ms var(--ease-system), opacity 200ms ease-out;
}
.levl-fill { left: 0; right: 0; overflow: hidden; border-radius: 0;
  clip-path: inset(0 calc(100% - clamp(0px, calc(var(--pct) * 1%), calc(100% - 2px))) 0 0 round 999px);
  background: var(--tone);
  box-shadow: inset 0 1px 0 oklch(var(--light) / 0.22);
  transition: clip-path 200ms var(--ease-system), background-color 200ms ease-out;
}
.levl-shine { position: absolute; top: 0; bottom: 0; left: 0; width: 25%;
  background: linear-gradient(90deg, transparent, oklch(var(--light) / 0.42), transparent);
  translate: -100% 0; opacity: 0;
}
.levl[data-drag] .levl-shine { opacity: 1; animation: levl-shine 1.2s linear infinite; }
@keyframes levl-shine { from { translate: -100% 0; } to { translate: 400% 0; } }
.levl-range { position: absolute; top: -8px; left: -8px; z-index: 1; margin: 0; height: 44px;
  width: calc(100% + 16px); cursor: pointer; appearance: none; -webkit-appearance: none; opacity: 0; }
.levl-range:disabled { cursor: not-allowed; }
.levl-thumb { position: absolute; top: 50%; left: 0; pointer-events: none;
  translate: calc(clamp(0.625rem, calc(var(--pct) * 1cqw), calc(100cqw - 0.625rem)) - 50%) -50%;
  width: 14px; height: 14px; border-radius: 2px; rotate: 45deg;
  background: oklch(var(--surface-card));
  box-shadow: 0 0 0 2.5px var(--tone), 0 1px 3px oklch(var(--ink) / 0.14);
  transition-property: translate, box-shadow, scale; transition-duration: 200ms; transition-timing-function: var(--ease-system);
}
.levl[data-drag] .levl-thumb { scale: 1.1; transition-property: box-shadow, scale; }
.levl[data-drag] .levl-fill { transition-property: background-color; }
.levl[data-drag] .levl-glow { transition-property: opacity; }
.levl-range:focus-visible ~ .levl-thumb {
  box-shadow: 0 0 0 2.5px var(--tone), 0 0 0 4.5px oklch(var(--surface-card)), 0 0 0 6.5px oklch(var(--select));
}
.levl-row { display: flex; min-height: 32px; align-items: center; gap: 4px; padding-left: 4px; }
.levl-chip { display: inline-flex; flex-shrink: 0; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: oklch(var(--surface-fill)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.levl-chip .muted { color: oklch(var(--ink-muted)); }
.levl-figure { min-width: 2.5ch; font-weight: 600; color: oklch(var(--ink)); }
.levl[data-off] .levl-figure { color: oklch(var(--ink-muted)); }
.levl-presets { display: flex; align-items: center; gap: 4px; transition: opacity 150ms ease-out; }
.levl[data-off] .levl-presets { opacity: 0.4; pointer-events: none; }
.levl-preset { position: relative; display: flex; align-items: center; height: 32px; padding: 0 10px; border: 0;
  border-radius: 999px; background: transparent; color: oklch(var(--ink-muted)); white-space: nowrap;
  font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out, scale 150ms ease-out; }
.levl-preset:active { scale: 0.96; }
.levl-preset:focus-visible { outline: 2px solid oklch(var(--select)); outline-offset: 2px; }
@media (hover: hover) { .levl-preset:not([data-on]):hover { background: oklch(var(--surface-fill)); color: oklch(var(--ink)); } }
.levl-preset[data-on] { background: var(--tone); color: oklch(var(--light)); }
.levl-cap { margin-left: auto; padding-right: 8px; white-space: nowrap; color: oklch(var(--ink-muted)); font-variant-numeric: tabular-nums; }
.levl-cap b { font-weight: 400; color: oklch(var(--ink)); }
.dark .levl-rail { background: oklch(var(--ink) / 0.1); box-shadow: inset 0 0 0 1px oklch(var(--ink) / 0.08); }

/* ---------- Borrow: loan to value ---------- */
.ltv { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.ltv-head, .ltv-legend { display: flex; height: 20px; align-items: center; justify-content: space-between; gap: 12px; white-space: nowrap; }
.ltv-head label, .ltv-legend { color: oklch(var(--ink-muted)); }
.ltv-reading { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; font-weight: 600; color: oklch(var(--ink)); }
.ltv-track { position: relative; height: 28px; container-type: inline-size; }
.ltv-layers { position: absolute; left: 0; right: 0; top: 10px; height: 8px; }
.ltv-layers > span { position: absolute; top: 0; bottom: 0; }
.ltv-rail { left: 0; right: 0; border-radius: 999px; background: oklch(var(--surface-track)); box-shadow: inset 0 0 0 1px oklch(var(--line) / 0.7); }
.ltv-fill { left: 0; border-radius: 999px 0 0 999px; background: var(--tone); width: calc(var(--pct) * 1%); }
.ltv-band, .ltv-key-band { background: repeating-linear-gradient(-45deg, oklch(var(--info-red) / 0.32) 0 2px, oklch(var(--info-red) / 0.1) 2px 0.25rem); }
.ltv-band { right: 0; border-radius: 0 999px 999px 0; }
.ltv-max, .ltv-key-max { background: oklch(var(--ink-muted)); }
.ltv-layers > .ltv-max { top: -6px; bottom: -6px; width: 2px; translate: -50% 0; border-radius: 999px; }
.ltv-range { position: absolute; top: -8px; left: -8px; z-index: 1; margin: 0; height: 44px; width: calc(100% + 16px);
  cursor: pointer; appearance: none; -webkit-appearance: none; opacity: 0; }
.ltv-thumb { position: absolute; top: 50%; left: 0; pointer-events: none;
  translate: calc(clamp(0.5rem, calc(var(--pct) * 1cqw), calc(100cqw - 0.5rem)) - 50%) -50%;
  width: 16px; height: 16px; border-radius: 999px; background: oklch(var(--surface-card));
  box-shadow: 0 0 0 2.5px var(--tone), 0 1px 3px oklch(var(--ink) / 0.14);
  transition: translate 160ms var(--ease-system), box-shadow 160ms ease-out; }
.ltv[data-drag] .ltv-thumb { transition-property: box-shadow; }
.ltv-range:focus-visible ~ .ltv-thumb { box-shadow: 0 0 0 2.5px var(--tone), 0 0 0 4.5px oklch(var(--surface-card)), 0 0 0 6.5px oklch(var(--select)); }
.ltv-legend > span, .ltv-legend .keys > span { display: flex; align-items: center; gap: 6px; }
.ltv-legend .keys { display: flex; gap: 12px; }
.ltv-legend b { font-weight: 400; color: oklch(var(--ink)); font-variant-numeric: tabular-nums; }
.ltv-key-band { width: 8px; height: 8px; border-radius: 2px; }
.ltv-key-max { width: 2px; height: 10px; border-radius: 999px; }
.dark .ltv-rail { background: oklch(var(--ink) / 0.1); box-shadow: inset 0 0 0 1px oklch(var(--ink) / 0.08); }

@media (prefers-reduced-motion: reduce) {
  .levl-fill, .levl-glow, .levl-thumb, .levl-presets, .ltv-thumb { transition: none; }
  .levl-shine { animation: none !important; opacity: 0 !important; }
}

/* Lab: on a phone-width panel the cap would run 6px past the row; the presets carry the reading. */
@media (max-width: 400px) { .levl-cap { display: none; } }
