/* Pro, the trading screen (Figma, Kassandra · Trading: "Desktop / Trade ·
   Pro", 1280 × 876, and "Mobile / Trade · Pro"): the app's own 60 px bar
   and 60 px rail, the 44 px strip of pools, the 72 px asset header, and the
   main row: the chart, the 240 px order book and the 280 px order form,
   each column ruled off by a 1 px Kgrey line. The site's own bar and
   footer step aside, as they do for signing in. Its own rules hang on
   [data-pro], not .pro: other pages use .pro too (the home page's mission
   marks the word "professionals", and the fence around them in its crowd,
   with it), and every page loads this file. */

.site:has([data-pro]) .announce,
.site:has([data-pro]) .nav,
.site:has([data-pro]) .footer,
.site:has([data-pro]) .curtain,
.site:has([data-pro]) .scrollbar { display: none; }

[data-pro] {
  --rule: var(--border);
  --hair: rgba(255, 255, 255, 0.08);
  --raised: var(--card);
  --bar-h: 60px;
  --rail-w: 60px;
  --mev: var(--klavender);
  --mev-wash: color-mix(in srgb, var(--klavender) 14%, transparent);
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
[data-theme="light"] [data-pro] { --hair: rgba(30, 29, 30, 0.08); --mev: var(--strong-kpurple); }
[data-pro] .up { color: var(--positive); }
[data-pro] .down { color: var(--negative); }
.pro-muted { color: var(--faint); }
.pro-muted.small, [data-pro] .small { font-size: 13px; }

/* ---- The bar --------------------------------------------------------------------- */

.pro-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  height: var(--bar-h); padding: 0 16px 0 15px;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.pro-bar .brand { font-size: 17px; gap: 9px; }
.pro-bar .brand .mark { width: 30px; height: 30px; }
/* The site's tabs beside the brand: the Exchange (this page) and AI. */
.pro-site { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); border: 1px solid var(--rule); background: var(--raised); }
.pro-site a {
  display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: var(--radius-pill);
  color: var(--muted); font-size: 13px; font-weight: 500;
  transition: background-color var(--dur-quick) var(--ease-ui), color var(--dur-quick) var(--ease-ui);
}
.pro-site a:hover { color: var(--text); }
.pro-site a.on { background: var(--rule); color: var(--text); }
.pro-search {
  display: inline-flex; align-items: center; gap: 10px;
  width: min(420px, 34vw); min-width: 0; height: 38px; padding: 0 8px 0 14px; margin-left: 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--rule); background: var(--raised);
  color: var(--faint); font-size: 14px; text-align: left;
  transition: border-color var(--dur-quick) var(--ease-ui);
}
.pro-search:hover { border-color: var(--border-strong); }
.pro-search span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-search kbd { margin: 0; }
.pro-bar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pro-wallet-wrap { position: relative; }
.pro-wallet {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--rule); background: var(--raised); font-size: 14px; font-weight: 500;
}
.pro-wallet img { border-radius: 50%; }
.pro-wallet .ico { width: 14px; height: 14px; color: var(--faint); }
.pro-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 200px;
  display: flex; flex-direction: column; padding: 6px;
  border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow);
}
.pro-menu a, .pro-menu button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 8px; font-size: 14px; text-align: left; }
.pro-menu a:hover, .pro-menu button:hover { background: var(--raised); }
.pro-menu .ico { width: 14px; height: 14px; color: var(--faint); }


/* The market search opens the markets list under the bar. */
.pro-switcher {
  position: absolute; left: 196px; top: calc(var(--bar-h) + 6px); z-index: 45;
  width: min(640px, calc(100vw - 32px)); padding: 10px;
  border-radius: 16px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow);
}
.pro-switcher-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; color: var(--muted); font-size: 13px; }
.pro-switcher-row { display: grid; grid-template-columns: 2.4fr 1fr 0.8fr 0.9fr 0.7fr; align-items: center; gap: 8px; width: 100%; padding: 9px 8px; border-radius: 10px; text-align: right; font-size: 14px; }
.pro-switcher-row > :first-child { text-align: left; }
.pro-switcher-row.head { color: var(--faint); font-size: 12px; padding-top: 4px; padding-bottom: 4px; }
.pro-switcher-row.on { background: var(--raised); }
.pro-switcher-market { display: flex; align-items: center; gap: 10px; }
.pro-switcher-market span { display: flex; flex-direction: column; }
.pro-switcher-market small { color: var(--faint); font-size: 12px; }
.pro-switcher-foot { padding: 10px 8px 2px; color: var(--faint); font-size: 12px; }
.pro-favs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 8px 10px; border-bottom: 1px solid var(--hair); }
.pro-favs-head { display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; color: var(--faint); font-size: 12px; font-weight: 600; }
.pro-fav { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 6px; border: 1px solid var(--rule); border-radius: var(--radius-pill); font-size: 13px; cursor: pointer; }
.pro-fav:hover { border-color: var(--border-strong); background: var(--hair); }
.pro-fav.on { border-color: var(--klavender); }
.pro-fav img { border-radius: 50%; }
.pro-fav b { font-weight: 600; }
.pro-fav-x { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: pointer; }
.pro-fav-x:hover { color: var(--text); background: var(--raised); }
.pro-fav-x .ico { width: 12px; height: 12px; }
.pro-x { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--faint); }
.pro-x:hover { background: var(--raised); color: var(--text); }
.pro-x .ico { width: 16px; height: 16px; }

/* ---- The rail -------------------------------------------------------------------- */

.pro-side {
  position: fixed; left: 0; top: var(--bar-h); bottom: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: var(--rail-w); padding: 12px 0;
  border-right: 1px solid var(--rule); background: var(--bg);
}
.pro-side a, .pro-side button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--faint); transition: background-color var(--dur-quick) var(--ease-ui), color var(--dur-quick) var(--ease-ui); }
.pro-side a:hover, .pro-side button:hover { background: var(--raised); color: var(--text); }
.pro-side a.on { background: var(--raised); color: var(--text); }
.pro-side .ico { width: 20px; height: 20px; }
.pro-side-gap { flex: 1; }

.pro-body { margin-left: var(--rail-w); }

/* ---- The banner of favorite tokens ------------------------------------------------- */

.pro-strip {
  display: flex; align-items: center; gap: 2px;
  height: 44px; padding: 0 20px 0 16px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--hair); white-space: nowrap; font-size: 13px;
}
.pro-strip::-webkit-scrollbar { display: none; }
.pro-strip-item { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: var(--radius-pill); }
.pro-strip-item:hover { background: var(--raised); }
a.pro-strip-item { color: inherit; text-decoration: none; }
.pro-strip-item.idle { opacity: 0.45; }
.pro-strip-item b { font-weight: 600; }
.pro-strip-item small { color: var(--faint); font-size: 12px; }
.pro-strip-item small.up { color: var(--positive); }
.pro-strip-item small.down { color: var(--negative); }
.pro-strip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mev); opacity: 0.7; }
.pro-strip-end { margin-left: auto; padding-left: 16px; color: var(--muted); font-size: 12px; }
.pro-strip-line b { color: var(--mev); font-weight: 600; }
/* The wallet's favorites with the top tokens favorited automatically
   alongside them, all on one belt that fills the banner and drifts
   slowly sideways, merry-go-round style: the tokens ride four times
   over and the belt slides by half its length, so the loop has no
   seam. It holds still under the pointer or focus, and for a reader
   who prefers no motion it stands still and scrolls by hand instead,
   showing each token once. */
.pro-banner { overflow: hidden; }
.pro-banner-head { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 0 8px 0 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pro-banner-head .pro-star { font-size: 13px; }
.pro-banner-viewport { flex: 1; min-width: 0; height: 100%; overflow: hidden; }
.pro-banner-belt { display: flex; align-items: center; gap: 2px; width: max-content; height: 100%; animation: banner-belt var(--belt-s, 60s) linear infinite; }
.pro-banner:hover .pro-banner-belt, .pro-banner:focus-within .pro-banner-belt { animation-play-state: paused; }
.pro-banner-belt.still { animation: none; }
@keyframes banner-belt { to { transform: translateX(-50%); } }
.pro-banner-item {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-pill);
  background: none; color: var(--text); font: inherit; white-space: nowrap; cursor: pointer;
}
.pro-banner-item:hover { background: var(--raised); }
.pro-banner-item img { border-radius: 50%; flex: none; }
.pro-banner-item b { font-weight: 600; }
.pro-banner-item small { color: var(--faint); font-size: 12px; }
.pro-banner-item .pro-star { font-size: 12px; }
.pro-banner-price { font-weight: 600; }
.pro-banner-empty { display: inline-flex; align-items: center; height: 100%; color: var(--faint); font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) {
  .pro-banner-viewport { overflow-x: auto; }
  .pro-banner-belt { animation: none; }
  .pro-banner-item.copy { display: none; }
}

/* ---- The asset header --------------------------------------------------------------- */

.pro-asset {
  display: flex; align-items: center; gap: var(--space-l);
  min-height: 72px; padding: 0 var(--space-s);
  border-bottom: 1px solid var(--rule);
}
.pro-asset-name { display: flex; align-items: center; gap: 12px; }
.pro-asset-name img { border-radius: 50%; }
.pro-asset-name div { display: flex; flex-direction: column; }
.pro-asset-name b { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.pro-asset-name small { color: var(--faint); font-size: 12px; }
.pro-star { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--faint); font-size: 17px; line-height: 1; cursor: pointer; transition: color var(--dur-quick) var(--ease-ui); }
.pro-star:hover { color: var(--text); background: var(--hair); }
.pro-star.on { color: var(--klavender); }
span.pro-star { width: auto; height: auto; cursor: default; background: none; }
/* The arrows that turn the pair around: SOL/USDC ⇄ USDC/SOL. */
.pro-flip {
  display: grid; place-items: center; width: 32px; height: 32px; margin-left: 2px;
  border-radius: var(--radius-pill); border: 1px solid var(--rule); background: var(--raised); color: var(--muted);
  transition: color var(--dur-quick) var(--ease-ui), border-color var(--dur-quick) var(--ease-ui), transform var(--dur-quick) var(--ease-ui);
}
.pro-flip .ico { width: 16px; height: 16px; }
.pro-flip:hover { color: var(--text); border-color: var(--border-strong); }
.pro-flip.on { color: var(--klavender); border-color: color-mix(in srgb, var(--klavender) 45%, transparent); }
.pro-asset-price { display: flex; flex-direction: column; }
.pro-asset-price b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.pro-asset-price small { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; }
.pro-asset-price small .ico { width: 14px; height: 14px; }
.pro-asset-price small.down .ico { transform: scaleY(-1); }
.pro-asset-stats { display: flex; gap: var(--space-m); }
.pro-asset-stats div { display: flex; flex-direction: column; gap: 2px; }
.pro-asset-stats dt { color: var(--faint); font-size: 12px; }
.pro-asset-stats dd { font-size: 15px; font-weight: 600; }
.pro-asset-stats .fills dd { color: var(--mev); }
/* The market's LPs, beside the day's high and volume: the pools that
   filled the banner before favorites took it over. One horizontal row:
   it takes the width left beside the stats and scrolls sideways, so
   however many pools there are the header never grows taller. */
.pro-asset-pools { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.pro-asset-pools::-webkit-scrollbar { display: none; }
.pro-asset-pools .pro-strip-item { flex: none; }
.pro-asset-pools-label { flex: none; color: var(--faint); font-size: 12px; margin-right: 4px; }
.pro-asset-pools-none { color: var(--faint); font-size: 15px; font-weight: 600; }
/* Live: the chain was read in the last few seconds. The dot breathes. */
.pro-live { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 26px; padding: 0 10px; margin-right: 6px; border-radius: var(--radius-pill); background: var(--positive-wash); color: var(--positive); font-size: 12px; font-weight: 600; }
.pro-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s var(--ease-out) infinite; }
.pro-live.stale { background: rgba(242, 179, 91, 0.14); color: #F2B35B; }
.pro-live.stale i { animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
/* A price that just moved flashes its direction for a moment. */
.pro-asset-price b { border-radius: 6px; padding: 0 4px; margin: 0 -4px; transition: background-color 600ms var(--ease-out), color 600ms var(--ease-out); }
.pro-asset-price b.tick-up { color: var(--positive); background: var(--positive-wash); transition: none; }
.pro-asset-price b.tick-down { color: var(--negative); background: var(--negative-wash); transition: none; }
.pro-open { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--rule); font-size: 13px; color: var(--muted); margin-left: auto; }
.pro-open i { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); }
.pro-mode { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); border: 1px solid var(--rule); background: var(--raised); }
.pro-mode a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--radius-pill); color: var(--muted); font-size: 13px; font-weight: 500; }
.pro-mode a .ico { width: 15px; height: 15px; }
.pro-mode a.on { background: var(--rule); color: var(--text); }

/* ---- The main row ------------------------------------------------------------------- */

.pro-main {
  display: grid; grid-template-columns: minmax(0, 1fr) 240px 280px;
  height: max(700px, calc(100svh - var(--bar-h) - 44px - 73px));
}
.pro-left { display: flex; flex-direction: column; min-width: 0; }

/* The chart. */
.pro-chart { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 12px 0 0 var(--space-s); }
.pro-chart-bar { display: flex; align-items: center; justify-content: space-between; padding-right: 16px; }
.pro-spans { display: flex; gap: 6px; }
.pro-spans button { height: 30px; min-width: 44px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--rule); color: var(--muted); font-size: 13px; font-weight: 500; }
.pro-spans button:hover { color: var(--text); }
.pro-spans button.on { background: var(--rule); border-color: var(--rule); color: var(--text); }
.pro-chart-tools { display: flex; align-items: center; gap: 16px; color: var(--faint); }
.pro-chart-tools .ico { width: 18px; height: 18px; }
.pro-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.pro-legend i.mev { width: 14px; border-top: 2px dashed var(--mev); }
.pro-chart-area { position: relative; flex: 1; min-height: 220px; margin: 12px 0 0; }
/* The candles fill exactly the box the axis and the times are laid out on. */
.pro-candles { position: absolute; left: 0; top: 0; right: 76px; bottom: 22px; width: calc(100% - 76px); height: calc(100% - 22px); overflow: visible; }
.pro-candles line { vector-effect: non-scaling-stroke; }
.pro-candles .grid { stroke: var(--hair); stroke-width: 1; }
.pro-candles g line { stroke-width: 1.2; }
.pro-candles g.up line { stroke: var(--positive); }
.pro-candles g.up rect { fill: var(--positive); }
.pro-candles g.down line { stroke: var(--negative); }
.pro-candles g.down rect { fill: var(--negative); }
.pro-candles rect.vol { opacity: 0.32; }
.pro-candles .last { stroke: var(--klavender); stroke-width: 1; opacity: 0.85; }
.pro-candles .mev { stroke: var(--mev); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: 0.75; }
.pro-axis { position: absolute; right: 0; top: 0; bottom: 22px; width: 76px; }
.pro-axis span { position: absolute; left: 8px; transform: translateY(-50%); color: var(--faint); font-size: 12px; }
.pro-axis span.mev { left: 4px; padding: 1px 5px; border-radius: 4px; color: var(--mev); background: var(--mev-wash); font-size: 11px; font-weight: 600; }
.pro-axis span.now { left: 0; padding: 2px 6px; border-radius: 4px; background: var(--klavender); color: var(--kblack); font-weight: 600; z-index: 1; }
.pro-times { position: absolute; left: 0; right: 76px; bottom: 0; height: 18px; }
.pro-times span { position: absolute; transform: translateX(-50%); color: var(--faint); font-size: 12px; white-space: nowrap; }
.pro-chart-empty { display: flex; align-items: center; justify-content: center; gap: 10px; height: 100%; color: var(--faint); }

/* The tabs under the chart. */
.pro-activity { display: flex; flex-direction: column; height: 214px; border-top: 1px solid var(--rule); }
.pro-tabs { display: flex; gap: 24px; padding: 0 var(--space-s); border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.pro-tabs button { position: relative; height: 44px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.pro-tabs button:hover { color: var(--text); }
.pro-tabs button.on { color: var(--text); }
.pro-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--klavender); }
.pro-table-wrap { flex: 1; overflow: auto; padding: 0 var(--space-s); }
.pro-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pro-table th { position: sticky; top: 0; z-index: 1; height: 34px; text-align: left; font-weight: 400; color: var(--faint); background: var(--bg); }
.pro-table td { height: 38px; border-top: 1px solid var(--hair); }
.pro-table .num { text-align: right; padding-right: 18px; }
.pro-table .act { text-align: right; width: 1%; white-space: nowrap; }
.pro-side-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.pro-side-tag .ico { width: 14px; height: 14px; }
.pro-link { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--faint); }
.pro-link:hover { background: var(--raised); color: var(--text); }
.pro-link .ico { width: 14px; height: 14px; transform: rotate(-45deg); }
.pro-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 0; color: var(--faint); font-size: 14px; max-width: 64ch; }

/* ---- The order book ------------------------------------------------------------------ */

.pro-book { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 0 8px; border-left: 1px solid var(--rule); overflow: hidden; font-variant-numeric: tabular-nums; }
.pro-book-tabs { display: flex; gap: 18px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--hair); flex: none; }
.pro-book-tabs button { position: relative; height: 40px; color: var(--muted); font-size: 14px; font-weight: 600; }
.pro-book-tabs button:hover { color: var(--text); }
.pro-book-tabs button.on { color: var(--text); }
.pro-book-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--klavender); }
.pro-book-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 6px 12px; flex: none; }
.pro-book-views { display: flex; gap: 2px; }
.pro-book-view { display: grid; place-items: center; width: 26px; height: 24px; border-radius: 6px; opacity: 0.55; }
.pro-book-view:hover, .pro-book-view.on { opacity: 1; background: var(--hair); }
.pro-book-view i { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; width: 12px; height: 12px; }
.pro-book-view i b { border-radius: 1.5px; }
.pro-book-view i.both b:first-child, .pro-book-view i.asks b { background: var(--negative); }
.pro-book-view i.both b:last-child, .pro-book-view i.bids b { background: var(--positive); }
.pro-book-opts { display: flex; align-items: center; gap: 6px; }
.pro-book-unit { height: 26px; padding: 0 9px; border-radius: var(--radius-pill); border: 1px solid var(--rule); color: var(--text); font-size: 12px; font-weight: 600; }
.pro-book-unit:hover { border-color: var(--klavender); }
.pro-select { position: relative; display: inline-flex; align-items: center; }
.pro-select select {
  appearance: none; -webkit-appearance: none;
  height: 26px; padding: 0 26px 0 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--rule); background: transparent; color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.pro-select select option { background: var(--surface); color: var(--text); }
.pro-select .ico { position: absolute; right: 8px; width: 12px; height: 12px; color: var(--faint); pointer-events: none; }
.pro-select.plain select { height: auto; padding: 0 20px 0 0; border: 0; text-align: right; font-size: 13px; }
.pro-select.plain .ico { right: 0; }
.pro-book-cols, .pro-level, .pro-trade { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 4px; padding: 0 10px 0 12px; }
.pro-book-cols { color: var(--faint); font-size: 11px; padding-bottom: 4px; flex: none; white-space: nowrap; }
.pro-book-cols span { overflow: hidden; text-overflow: ellipsis; }
.pro-book-cols span:not(:first-child), .pro-level span:not(:first-child), .pro-trade span:not(:first-child) { text-align: right; }
/* Each side fills the panel, nearest the price first; never fewer than eight rows. */
.pro-book-side { display: flex; flex-direction: column; flex: 1 1 0; min-height: 152px; overflow: hidden; }
.pro-book-side.asks { justify-content: flex-end; }
.pro-book.only-bids .pro-book-side.asks, .pro-book.only-asks .pro-book-side.bids { display: none; }
/* A level's two bars, both on one scale for the two sides: the running total
   to it (light, `--d`) and its own size (strong, `--s`), so the depth reads
   at a glance and a large level stands out within it. */
.pro-level { position: relative; flex: none; width: 100%; height: 19px; align-items: center; font-size: 12px; cursor: pointer; }
.pro-level::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: var(--d); pointer-events: none; transition: width 260ms var(--ease-ui); }
.pro-level.ask::before { background: color-mix(in srgb, var(--negative) 24%, transparent); }
.pro-level.bid::before { background: color-mix(in srgb, var(--positive) 22%, transparent); }
.pro-level.swept { background: var(--hair); }
.pro-level.ask.swept::before { background: color-mix(in srgb, var(--negative) 34%, transparent); }
.pro-level.bid.swept::before { background: color-mix(in srgb, var(--positive) 32%, transparent); }
.pro-level span { position: relative; z-index: 1; }
.pro-level.ask span:first-child { color: var(--negative); }
.pro-level.bid span:first-child { color: var(--positive); }
.pro-level span:last-child { color: var(--muted); }
.pro-level:hover { background: var(--hair); }
.pro-level.mine span:first-child::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 5px; vertical-align: middle; border-radius: 50%; background: var(--text); }
.pro-book-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 6px 12px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); flex: none; }
.pro-book-mid b { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.pro-book-mid b.up { color: var(--positive); }
.pro-book-mid b.down { color: var(--negative); }
.pro-book-last { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; }
.pro-book-last.up { color: var(--positive); }
.pro-book-last.down { color: var(--negative); }
.pro-book-last:hover { text-decoration: underline; text-underline-offset: 3px; }
.pro-book-fill { color: var(--faint); }
.pro-book-fill.on { border-color: var(--klavender); color: var(--klavender); }
/* What an order that sweeps the book to the level under the pointer gets,
   beside the book (over the chart's edge), the way the big venues show it. */
.pro-book-tip { position: fixed; z-index: 30; display: grid; gap: 3px; min-width: 168px; padding: 9px 11px; transform: translate(calc(-100% - 10px), -50%); border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--raised); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); font-size: 12px; pointer-events: none; }
.pro-book-tip div { display: flex; justify-content: space-between; gap: 14px; }
.pro-book-tip span { color: var(--faint); }
.pro-book-tip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pro-book-mid > span { color: var(--faint); font-size: 11px; white-space: nowrap; }
.pro-arrow .ico { width: 15px; height: 15px; transform: rotate(-90deg); transition: transform 260ms var(--ease-ui); }
.pro-arrow.fall .ico { transform: rotate(90deg); }
/* Where an order fills at once: a sell at or below the first price, a buy at
   or above the second. */
.pro-book-fills {
  display: flex; align-items: center; gap: 8px; flex: none;
  margin: 5px 10px 5px 12px; padding: 3px 8px; border-radius: 7px;
  background: var(--hair); color: var(--muted); font-size: 11.5px; font-weight: 500;
}
.pro-book-fills span { flex: 1; }
.pro-book-fills b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pro-book-fills b.up { color: var(--positive); }
.pro-book-fills b.down { color: var(--negative); }

/* The depth chart under the book: running totals against price, the U a
   book's depth makes. */
.pro-depth { position: relative; flex: none; height: 104px; margin: 8px 10px 0 12px; padding-top: 4px; border-top: 1px solid var(--hair); cursor: crosshair; }
.pro-depth svg { display: block; width: 100%; height: 84px; overflow: visible; }
.pro-depth path.fill.bid { fill: color-mix(in srgb, var(--positive) 16%, transparent); }
.pro-depth path.fill.ask { fill: color-mix(in srgb, var(--negative) 16%, transparent); }
.pro-depth path.edge { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.pro-depth path.edge.bid { stroke: var(--positive); }
.pro-depth path.edge.ask { stroke: var(--negative); }
.pro-depth line.mid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 3; }
.pro-depth line.cross { stroke: var(--faint); stroke-width: 1; }
.pro-depth-axis { display: flex; justify-content: space-between; margin-top: 2px; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.pro-depth-tip {
  position: absolute; top: 6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 3px 7px; border: 1px solid var(--rule); border-radius: 7px; background: var(--surface);
  font-size: 11px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums;
}
.pro-depth-tip b { font-weight: 600; }
.pro-depth-tip b.up { color: var(--positive); }
.pro-depth-tip b.down { color: var(--negative); }
.pro-depth-tip span { color: var(--muted); }
.pro-book-ratio { display: flex; align-items: center; gap: 8px; padding: 8px 10px 0 12px; border-top: 1px solid var(--hair); flex: none; font-size: 11.5px; font-weight: 600; }
.pro-book-ratio .pro-ratio-bar { flex: 1; margin: 0; }
.pro-ratio-bar { display: flex; gap: 2px; height: 4px; margin-top: 6px; }
.pro-ratio-bar i { border-radius: 2px; transition: flex-basis 400ms var(--ease-ui); }
.pro-ratio-bar i:first-child { flex: 0 0 var(--r); background: var(--positive); }
.pro-ratio-bar i:last-child { flex: 1; background: var(--negative); }
.pro-book-cols.trades { padding-top: 8px; }
.pro-trades { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.pro-trade { flex: none; height: 19px; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer; }
.pro-trade a { color: inherit; text-align: right; }
.pro-trade a:hover { color: var(--text); text-decoration: underline; }
.pro-trade:hover { background: var(--hair); }
.pro-trade span:first-child { display: inline-flex; align-items: center; gap: 3px; }
.pro-trade span.up { color: var(--positive); }
.pro-trade span.down { color: var(--negative); }
.pro-trades-empty { padding: 16px 12px; color: var(--faint); font-size: 12px; }

/* ---- The order form ------------------------------------------------------------------ */

.pro-ticket { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 14px 16px 16px; border-left: 1px solid var(--rule); overflow-y: auto; scrollbar-width: thin; }
.pro-sides { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--radius-pill); border: 1px solid var(--rule); background: var(--raised); }
.pro-sides button { height: 38px; border-radius: var(--radius-pill); color: var(--text); font-size: 15px; font-weight: 600; transition: background-color var(--dur-fast) var(--ease-ui), color var(--dur-fast) var(--ease-ui); }
.pro-sides .buy.on { background: var(--positive-wash); color: var(--positive); }
.pro-sides .sell.on { background: var(--negative-wash); color: var(--negative); }
.pro-kinds { display: flex; gap: 16px; border-bottom: 1px solid var(--hair); }
.pro-kinds button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; color: var(--muted); font-size: 14px; font-weight: 600; }
.pro-kinds button.on { color: var(--text); }
.pro-kinds button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--klavender); }
.pro-soon { padding: 1px 6px; border-radius: var(--radius-pill); background: var(--raised); color: var(--faint); font-size: 10px; font-weight: 600; }
.pro-field { display: flex; flex-direction: column; gap: 7px; }
.pro-field-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.pro-use-mev { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--mev-wash); color: var(--mev); font-size: 12px; font-weight: 600; }
.pro-use-mev .ico { width: 12px; height: 12px; }
.pro-input { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: var(--radius-m); border: 1px solid var(--rule); transition: border-color var(--dur-quick) var(--ease-ui); }
.pro-input:focus-within { border-color: var(--klavender); }
.pro-input.picked { border-color: var(--klavender); box-shadow: 0 0 0 3px color-mix(in srgb, var(--klavender) 28%, transparent); }
.pro-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; }
.pro-input input::placeholder { color: var(--dim-kgrey); }
.pro-input small { color: var(--faint); font-size: 13px; }
.pro-input.readonly { background: var(--raised); }
.pro-input.readonly span { flex: 1; font-size: 15px; }
.pro-hint { color: var(--faint); font-size: 12px; line-height: 1.45; }
.pro-shares { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pro-shares button { height: 34px; border-radius: var(--radius-pill); border: 1px solid var(--rule); font-size: 13px; font-weight: 500; color: var(--text); }
.pro-shares button:hover { border-color: var(--border-strong); background: var(--hair); }
.pro-sum { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.pro-sum div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pro-sum dt { color: var(--muted); white-space: nowrap; }
.pro-sum dd { text-align: right; }
.pro-sum .total dd { font-weight: 600; font-size: 14px; }
.pro-sum .seat dd { color: var(--mev); }
.pro-route { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--surface); font-size: 12.5px; }
.pro-route.quiet, .pro-route.bad { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--faint); }
.pro-route.bad { color: var(--negative); border-color: color-mix(in srgb, var(--negative) 30%, transparent); }
.pro-route .ico { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.pro-route-title { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.pro-route ol { display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.pro-route li { position: relative; display: flex; flex-direction: column; gap: 2px; padding-left: 24px; counter-increment: step; }
.pro-route li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 600; }
.pro-route li b { font-weight: 600; }
.pro-route li span { color: var(--faint); line-height: 1.45; }
.pro-route li.mev::before { background: var(--mev); color: var(--kblack); }
.pro-route li.mev b { color: var(--mev); }
.pro-warn { display: flex; gap: 8px; color: #F2B35B; line-height: 1.45; }
.pro-book-note { display: flex; gap: 8px; color: var(--faint); font-size: 12px; line-height: 1.45; }
.pro-book-note .ico { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.pro-stop { display: flex; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1.5; }
.pro-stop .ico { width: 18px; height: 18px; flex: none; color: var(--faint); }
.pro-stop b { color: var(--text); }
.pro-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex: none; height: 48px; border-radius: var(--radius-pill);
  background: var(--positive); color: var(--kblack); font-size: 15px; font-weight: 600;
  transition: filter var(--dur-quick) var(--ease-ui), transform var(--dur-quick) var(--ease-ui);
}
.pro-submit.sell { background: var(--negative); color: var(--white); }
.pro-submit:hover:not(:disabled) { filter: brightness(1.06); }
.pro-submit:active:not(:disabled) { transform: scale(0.98); }
.pro-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.pro-submit .ico { width: 17px; height: 17px; }
/* Proceeds in the seat, waiting for the wallet: above the form, one click away. */
.pro-seat-note {
  display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 4px;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--klavender) 45%, transparent);
  background: color-mix(in srgb, var(--klavender) 10%, transparent); font-size: 12.5px; line-height: 1.45;
}
.pro-seat-note p { flex: 1; color: var(--muted); }
.pro-seat-note b { display: block; color: var(--text); font-size: 13.5px; font-weight: 600; }
.pro-seat-note .btn { flex: none; }
.pro-balances { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule); }
.pro-balances-head { display: flex; align-items: center; justify-content: space-between; }
.pro-balances-head b { font-size: 15px; font-weight: 600; }
/* A resting order: how long it's good for, its tip, its rows' notes, what's
   said of its hold before the wallet opens, what the wallet signs, and who
   fills it. */
.pro-goodfor { display: flex; }
.pro-goodfor select { width: 100%; height: 44px; padding: 0 36px 0 14px; border-radius: var(--radius-m); font-size: 15px; }
.pro-goodfor .ico { right: 14px; }
/* The tip: Min, Fast or Custom, picked as Buy and Sell are, each with what
   it tips small under its name, in --muted (on the dark track 6.3:1, and
   4.9:1 under the pointer); the one picked ringed, as the slippage presets
   are. Held still while a press places the order: the others dim, and the
   tip being placed, picked or typed, stays as legible as before. */
.pro-sides.pro-tips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pro-tips button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.2; }
.pro-tips button:not(.on):not(:disabled):hover { background: var(--hair); }
.pro-tips button.on { background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.pro-tips button:disabled { cursor: not-allowed; }
.pro-tips button:disabled:not(.on) { opacity: 0.45; }
.pro-tips small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pro-input input:disabled { opacity: 1; -webkit-text-fill-color: currentColor; cursor: not-allowed; }
.pro-input.bad { border-color: color-mix(in srgb, var(--negative) 60%, transparent); }
/* A row's note under its figure; a deposit row's lists each deposit, and
   wraps. */
.pro-sum dd small { display: block; color: var(--faint); font-size: 11.5px; overflow-wrap: anywhere; }
.pro-sum div.bad dd { color: var(--negative); }
.pro-slip.hidden { display: none; }
/* Where what a resting order pays waits, and what may move it, said before
   the wallet opens, ruled off as the route is. */
.pro-rest-note { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--surface); color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pro-rest-note p:last-child { color: var(--faint); }
.pro-sign-note { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pro-disclose { color: var(--faint); font-size: 11.5px; line-height: 1.5; }
/* Resting orders under the chart: what each is doing, the ones resting on
   other markets, and the holds that need the trader, with Withdraw and
   Approve again. A plain wait reads plainly, one being sent is lit, and one
   that needs the trader (paused, expiring, not open to the wallet yet) is
   marked as the form's warnings are. */
.pro-resting .pro-resting-status { min-width: 9em; padding-right: 12px; color: var(--muted); line-height: 1.35; }
.pro-resting .pro-resting-status.waiting { color: var(--text); }
.pro-resting .pro-resting-status.pending, .pro-resting .pro-resting-status.filling { color: var(--accent); }
/* An order on its way in or out pulses, so the seconds it takes read as work. */
.pro-resting .pro-resting-status.pending::before, .pro-resting .pro-resting-status.filling::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: live-pulse 1.6s ease-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .pro-resting .pro-resting-status.pending::before, .pro-resting .pro-resting-status.filling::before { animation: none; }
}
.pro-resting .pro-resting-status.act { color: #F2B35B; }
[data-theme="light"] .pro-resting .pro-resting-status.act { color: #A86A12; }
/* When it expires sits in its own column; on a phone, under its status. */
.pro-resting .pro-resting-when { display: none; }
.pro-resting .act .btn + .btn { margin-left: 6px; }
.pro-resting-note { padding: 10px 0 4px; }
.pro-resting-else { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 0; color: var(--faint); font-size: 13px; }
.pro-resting-else .pro-link { width: auto; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--rule); color: var(--text); font-size: 12.5px; }
.pro-resting-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0 14px; border-top: 1px solid var(--hair); color: var(--faint); font-size: 12.5px; line-height: 1.45; }
.pro-resting-foot p { flex: 1 1 220px; }
.pro-resting-foot .btn { white-space: normal; height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; text-align: center; }
/* A hold's buttons sit together beside its words, and under them where the
   words take the width (a phone). */
.pro-hold p { color: var(--muted); }
.pro-hold-act { display: flex; flex-wrap: wrap; gap: 6px; }
.pro-hold-act:empty { display: none; }

/* ---- Dialogs and notes ------------------------------------------------------------------ */

.pro-modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(10, 9, 10, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade-in 200ms var(--ease-out); }
.pro-modal {
  position: fixed; left: 50%; top: 50%; z-index: 81; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: 12px;
  width: min(420px, calc(100vw - 32px)); max-height: calc(100svh - 48px); overflow-y: auto; padding: 18px;
  border-radius: var(--radius-box); border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow);
  animation: modal-in 260ms var(--ease);
}
.pro-modal.wide { width: min(640px, calc(100vw - 32px)); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(0.98); } }
.pro-modal-head { display: flex; align-items: center; justify-content: space-between; }
.pro-modal-head b { font-size: 17px; font-weight: 600; }
.pro-modal-lede { color: var(--muted); font-size: 14px; line-height: 1.5; }
.pro-modal .wallet-row { width: 100%; }
.pro-wallet-none { display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.pro-error { color: var(--negative); font-size: 13px; }
.pro-explain { display: flex; flex-direction: column; gap: 14px; }
.pro-explain li { display: flex; gap: 12px; }
.pro-explain-num { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--mev-wash); color: var(--mev); font-weight: 600; font-size: 13px; }
.pro-explain b { font-size: 15px; }
.pro-explain p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 2px; }
.pro-explain-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--hair); font-size: 13px; }
.pro-explain-facts dt { color: var(--faint); font-size: 12px; }
.pro-explain-facts a { color: var(--mev); }
.pro-toast {
  position: fixed; right: 20px; bottom: calc(20px + var(--dock-h, 0px)); z-index: 90;
  display: flex; align-items: flex-start; gap: 12px; width: min(380px, calc(100vw - 32px)); padding: 14px;
  border-radius: 16px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow);
  animation: modal-in-corner 320ms var(--ease);
}
@keyframes modal-in-corner { from { opacity: 0; transform: translateY(10px); } }
.pro-toast > .ico { width: 20px; height: 20px; color: var(--positive); }
.pro-toast.bad > .ico { color: var(--negative); }
.pro-toast div { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.pro-toast b { font-size: 14px; }
.pro-toast p { color: var(--muted); line-height: 1.45; }
.pro-toast a { display: inline-flex; align-items: center; gap: 4px; color: var(--mev); font-weight: 600; }
.pro-toast a .ico { width: 13px; height: 13px; }

/* ---- Narrower screens ------------------------------------------------------------------- */

/* The book and the form share a column beside the chart. */
@media (max-width: 1180px) {
  .pro-main { grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: auto auto; height: auto; }
  .pro-left { grid-row: 1 / span 2; min-height: 760px; }
  .pro-book { grid-column: 2; border-bottom: 1px solid var(--rule); }
  .pro-ticket { grid-column: 2; overflow: visible; }
  .pro-asset { flex-wrap: wrap; row-gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .pro-asset-stats .mev { display: none; }
}

/* Phones (Figma "Mobile / Trade · Pro", 360 px): one column, no rail. */
@media (max-width: 760px) {
  [data-pro] { --rail-w: 0px; }
  /* One column: there's no room beside the book for its readout. */
  .pro-book-tip { display: none; }
  .pro-side { display: none; }
  .pro-bar { gap: 10px; padding: 0 12px; }
  .pro-bar .brand span { display: none; }
  /* Only the way out to the rest of Kassandra; this page is the Exchange. */
  .pro-site { padding: 2px; }
  .pro-site a { height: 28px; padding: 0 10px; }
  .pro-site a.on { display: none; }
  .pro-search { width: auto; flex: 1; margin-left: 0; }
  .pro-search kbd { display: none; }
  .pro-mev { display: none; }
  .pro-switcher { left: 12px; }
  .pro-switcher-row { grid-template-columns: 2fr 1fr 0.9fr; }
  .pro-switcher-row > :nth-child(n + 4) { display: none; }
  .pro-asset { gap: 14px; padding: 12px 16px; }
  .pro-asset-stats { width: 100%; justify-content: space-between; gap: 8px; }
  .pro-asset-pools { width: 100%; }
  .pro-asset-stats dd { font-size: 14px; }
  .pro-open { margin-left: 0; }
  .pro-mode { margin-left: auto; }
  /* The chart, then the book, the form, and the orders and trades last. */
  .pro-main { display: flex; flex-direction: column; }
  .pro-left { display: contents; }
  .pro-chart { padding-left: 12px; }
  .pro-chart-area { flex: none; height: 280px; }
  .pro-times span:nth-child(even) { display: none; }
  .pro-chart-tools .ico { display: none; }
  .pro-book { order: 1; }
  .pro-ticket { order: 2; }
  .pro-book, .pro-ticket { border-left: 0; border-top: 1px solid var(--rule); }
  .pro-activity { order: 3; height: auto; max-height: 420px; }
  .pro-table th:nth-child(1), .pro-table td:nth-child(1) { display: none; }
  /* A resting order's buttons stack in their column. */
  .pro-resting .act .btn { display: block; width: 100%; }
  .pro-resting .act .btn + .btn { margin: 6px 0 0; }
  .pro-resting .num { padding-right: 10px; }
}

/* A phone has no room for a resting order's six columns: each order takes
   three lines, its side and price, its amount (each saying its coin, as the
   heads do), and what it's doing and when it expires. Its buttons sit
   beside all three in a column of its own width, so a label that changes
   as it works moves nothing, and the amount is never cut short. */
@media (max-width: 520px) {
  .pro-resting, .pro-resting tbody { display: block; }
  .pro-resting thead { display: none; }
  .pro-resting tr { display: grid; grid-template-columns: auto minmax(0, 1fr) 7.5rem; align-items: start; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--hair); }
  .pro-resting td { height: auto; padding: 0; border-top: 0; }
  .pro-resting td.num { text-align: left; padding-right: 0; overflow-wrap: anywhere; }
  .pro-resting td.num::after { content: " " attr(data-unit); color: var(--faint); }
  .pro-resting td:nth-child(2) { grid-column: 1; grid-row: 1; }
  .pro-resting td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .pro-resting td:nth-child(4) { grid-column: 1 / 3; grid-row: 2; }
  .pro-resting .pro-resting-status { grid-column: 1 / 3; grid-row: 3; min-width: 0; padding-right: 0; }
  .pro-resting .pro-resting-when { display: block; color: var(--faint); font-size: 12px; }
  .pro-resting .pro-resting-expires { display: none; }
  .pro-resting .act { grid-column: 3; grid-row: 1 / 4; width: auto; white-space: normal; }
  .pro-resting .act .btn { height: auto; min-height: 32px; padding: 6px 8px; font-size: 13px; line-height: 1.2; white-space: normal; }
}

/* Swap: what you pay over what you receive, with an arrow to turn it round. */
.pro-sides.hidden { display: none; }
.pro-swap { position: relative; display: flex; flex-direction: column; gap: 6px; }
.pro-swap-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid var(--rule); background: var(--raised); transition: border-color var(--dur-quick) var(--ease-ui); }
.pro-swap-box:focus-within { border-color: var(--klavender); }
.pro-swap-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.pro-swap-max { color: var(--faint); font-size: 12px; }
.pro-swap-max:hover { color: var(--text); }
.pro-swap-field { display: flex; align-items: center; gap: 10px; }
.pro-swap-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pro-swap-field input::placeholder { color: var(--dim-kgrey); }
.pro-coin { flex: none; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--rule); background: var(--surface); font-size: 14px; font-weight: 600; }
.pro-swap-flip { align-self: center; display: grid; place-items: center; width: 34px; height: 34px; margin: -16px 0; z-index: 1; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); color: var(--text); transition: transform var(--dur-fast) var(--ease-ui), border-color var(--dur-fast) var(--ease-ui); }
.pro-swap-flip .ico { width: 16px; height: 16px; transform: rotate(90deg); }
.pro-swap-flip:hover { border-color: var(--klavender); transform: rotate(180deg); }
.pro-swap-rate { color: var(--faint); font-size: 12px; line-height: 1.45; }

/* Every coin: the market search over Jupiter's list and the chain. */
.pro-picker-back { position: fixed; inset: 0; z-index: 44; }
.pro-picker { display: flex; flex-direction: column; max-height: min(640px, calc(100vh - var(--bar-h) - 24px)); }
.pro-picker-search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px; margin-bottom: 8px; border-radius: var(--radius-m); border: 1px solid var(--rule); background: var(--raised); }
.pro-picker-search:focus-within { border-color: var(--klavender); }
.pro-picker-search > .ico { width: 16px; height: 16px; color: var(--faint); flex: none; }
.pro-picker-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 15px; }
.pro-picker-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.pro-picker .pro-switcher-row { cursor: pointer; }
.pro-picker .pro-switcher-row:not(.head):hover { background: var(--hair); }
.pro-picker .pro-switcher-market img { border-radius: 50%; background: var(--raised); object-fit: cover; }
.pro-picker .pro-switcher-market b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.pro-picker .pro-switcher-market small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.pro-picker-quotes { display: inline-flex; justify-content: flex-end; gap: 4px; }
.pro-picker-quotes button { height: 24px; padding: 0 8px; border-radius: var(--radius-pill); border: 1px dashed var(--rule); color: var(--faint); font-size: 11.5px; font-weight: 600; }
.pro-picker-quotes button.has { border-style: solid; color: var(--text); background: var(--surface); }
.pro-picker-quotes button:hover { border-color: var(--klavender); color: var(--text); }
.pro-picker-empty { padding: 18px 8px; color: var(--faint); font-size: 13px; }
.pro-switcher-row.head { cursor: default; }
.pro-asset-switch { display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--text); }
.pro-asset-switch b { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.pro-asset-switch small { color: var(--faint); font-size: 12px; }
.pro-asset-name > .ico { width: 16px; height: 16px; color: var(--faint); margin-left: -4px; }
.pro-coin { gap: 6px; cursor: pointer; }
.pro-coin .ico { width: 13px; height: 13px; color: var(--faint); }
.pro-coin:hover { border-color: var(--klavender); }
@media (max-width: 760px) {
  .pro-picker .pro-switcher-row { grid-template-columns: 2fr 1fr auto; }
  .pro-picker .pro-switcher-row > :nth-child(3), .pro-picker .pro-switcher-row > :nth-child(4) { display: none; }
  .pro-picker .pro-switcher-row > :nth-child(5) { display: inline-flex; }
  .pro-picker .pro-switcher-market b { max-width: 110px; }
  .pro-picker .pro-switcher-market small { max-width: 120px; }
}

/* The chart: TradingView's Lightweight Charts with Kassandra's toolbars
   (assets/js/kchart.js). Its colors come from these same variables. */
.pro-chart { padding: 0; }
.kc-root { position: relative; height: 560px; min-height: 420px; }
.kc { display: grid; grid-template-rows: 40px 1fr 30px; background: var(--surface); color: var(--muted); font-size: 12px; user-select: none; }
.kc:fullscreen { height: 100vh; width: 100vw; }
.kc button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.kc svg { width: 18px; height: 18px; flex: none; }
.kc-top { display: flex; align-items: center; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.kc-frames { display: flex; gap: 1px; }
.kc-frame { height: 28px; min-width: 32px; padding: 0 7px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.kc-frame:hover { background: var(--hair); color: var(--text); }
.kc-frame.on { color: var(--klavender); background: color-mix(in srgb, var(--klavender) 12%, transparent); }
.kc-btn { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 5px; border-radius: 6px; color: var(--muted); }
.kc-btn:hover { background: var(--hair); color: var(--text); }
.kc-btn.on { color: var(--klavender); background: color-mix(in srgb, var(--klavender) 12%, transparent); }
.kc-drop { display: inline-flex; align-items: center; gap: 1px; }
.kc-drop svg + svg { width: 12px; height: 12px; opacity: 0.7; }
.kc-text { display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; font-size: 13px; font-weight: 500; }
.kc-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--rule); flex: none; }
.kc-grow { flex: 1; }
.kc-body { display: flex; min-height: 0; }
.kc-left { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 44px; padding: 6px 0; border-right: 1px solid var(--hair); overflow-y: auto; scrollbar-width: none; }
.kc-left .kc-btn { width: 34px; height: 34px; }
.kc-left svg { width: 20px; height: 20px; }
.kc-group { position: relative; }
.kc-more { position: absolute; right: -3px; bottom: 2px; display: grid; place-items: center; width: 12px; height: 14px; border-radius: 3px; opacity: 0; color: var(--faint); }
.kc-more svg { width: 10px; height: 10px; }
.kc-group:hover .kc-more { opacity: 1; }
.kc-more:hover { background: var(--hair); color: var(--text); }
.kc-hsep { width: 24px; height: 1px; margin: 4px 0; background: var(--rule); flex: none; }
.kc-stage { position: relative; flex: 1; min-width: 0; }
.kc-host { position: absolute; inset: 0; }
.kc-legend, .kc-pane-legends { position: absolute; left: 10px; top: 6px; z-index: 3; display: flex; flex-direction: column; gap: 3px; pointer-events: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.kc-pane-legends { top: 0; height: 0; }
.kc-pane-legend { position: absolute; left: 0; }
.kc-legend-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
.kc-legend-row b { color: var(--text); font-size: 13px; font-weight: 600; }
.kc-legend-row i { font-style: normal; }
.kc-legend-row span > i { margin-left: 3px; }
.kc-legend-row .up { color: var(--positive); }
.kc-legend-row .down { color: var(--negative); }
.kc-dim { color: var(--faint); }
.kc-study { pointer-events: auto; padding: 1px 4px 1px 0; border-radius: 4px; }
.kc-study:hover { background: color-mix(in srgb, var(--surface) 85%, transparent); }
.kc-study.off { opacity: 0.5; }
.kc-study .kc-name { color: var(--muted); }
.kc-acts { display: inline-flex; gap: 1px; opacity: 0; transition: opacity var(--dur-fast) var(--ease-ui); }
.kc-study:hover .kc-acts { opacity: 1; }
.kc-acts button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; color: var(--muted); }
.kc-acts button:hover { background: var(--hair); color: var(--text); }
.kc-acts svg { width: 14px; height: 14px; }
.kc-float { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 3px; padding: 4px 6px; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow); }
.kc-swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.kc-swatch.on { outline: 2px solid var(--text); outline-offset: 1px; }
.kc-width { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.kc-width i { display: block; width: 14px; background: currentColor; border-radius: 1px; }
.kc-width.on, .kc-width:hover { background: var(--hair); color: var(--text); }
.kc-textbtn { font-size: 12px; font-weight: 600; padding: 0 8px; }
.kc-textedit { position: absolute; z-index: 7; width: 180px; height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--klavender); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; outline: 0; }
.kc-status { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: var(--faint); font-size: 13px; pointer-events: none; }
.kc-bottom { display: flex; align-items: center; gap: 2px; padding: 0 8px 0 52px; border-top: 1px solid var(--hair); }
.kc-ranges { display: flex; gap: 1px; }
.kc-range { height: 22px; padding: 0 7px; border-radius: 5px; font-size: 12px; color: var(--muted); }
.kc-range:hover { background: var(--hair); color: var(--text); }
.kc-clock { color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.kc-clock:hover { color: var(--text); }
.kc-toggle { height: 22px; padding: 0 7px; border-radius: 5px; font-size: 12px; color: var(--muted); }
.kc-toggle:hover { background: var(--hair); color: var(--text); }
.kc-toggle.on { color: var(--klavender); }
.kc-menu { position: absolute; z-index: 20; min-width: 210px; padding: 5px; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow); }
.kc-menu-head { padding: 7px 10px 4px; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.kc-menu-sep { height: 1px; margin: 4px 6px; background: var(--hair); }
.kc-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text); font-size: 13px; text-align: left; }
.kc-menu-item span { flex: 1; }
.kc-menu-item small { color: var(--klavender); font-size: 13px; }
.kc-menu-item:hover { background: var(--hair); }
.kc-menu-item.on { color: var(--klavender); background: color-mix(in srgb, var(--klavender) 10%, transparent); }
.kc-dialog-back { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); }
.kc-dialog { display: flex; flex-direction: column; width: min(440px, 92%); max-height: 82%; border-radius: 16px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.kc-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--hair); font-size: 15px; }
.kc-dialog-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 18px; overflow-y: auto; }
.kc-search { height: 38px; padding: 0 12px; border-radius: var(--radius-m); border: 1px solid var(--rule); background: var(--raised); color: var(--text); font: inherit; font-size: 14px; outline: 0; }
.kc-search:focus { border-color: var(--klavender); }
.kc-ind-list { display: flex; flex-direction: column; }
.kc .kc-ind-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 8px; text-align: left; color: var(--text); }
.kc-ind-row b { font-weight: 500; font-size: 14px; }
.kc-ind-row small { color: var(--faint); font-size: 12px; }
.kc-ind-row:hover { background: var(--hair); }
.kc-form { display: flex; flex-direction: column; gap: 10px; }
.kc-field { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.kc-field input, .kc-field select { width: 140px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rule); background: var(--raised); color: var(--text); font: inherit; }
.kc-field input[type="color"] { width: 48px; padding: 2px; }
.kc-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.kc .kc-ghost, .kc .kc-primary { height: 34px; padding: 0 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; }
.kc .kc-ghost { border: 1px solid var(--rule); color: var(--text); }
.kc .kc-primary { background: var(--klavender); color: var(--kblack, #111); }
@media (max-width: 760px) {
  .kc-root { height: 440px; }
  .kc-left { width: 38px; }
  .kc-left .kc-btn { width: 30px; height: 30px; }
  .kc-bottom { padding-left: 8px; }
  .kc-ranges .kc-range:nth-child(n + 4) { display: none; }
}
/* A cancel said first: "Cancel anyway" opens the wallet, "Keep the order" doesn't. */
.pro-resting-ask { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 10px; }
