/* Driftance desktop cabinet B «Тикет» — preview r6 layer over the real client. Tokens only. */

/* ── Mobile deltas ─────────────────────────────────────────── */
/* Compact account chip «Демо» (blue) / «Рынок» (red): 28 px face, 44 px hit area. */
.account-pill { position: relative; min-height: 28px; min-width: max-content; overflow: visible; padding: 0 12px; border-radius: 14px; font: 500 var(--text-12)/1 var(--font-ui); font-variant: normal; letter-spacing: 0; gap: 6px; }
.account-pill::after { content: ""; position: absolute; inset: -8px -2px; }
.account-pill .caret { color: var(--color-text); } /* r8.1: 4.1:1 → readable on both chip fills */
.account-pill .account-dot { width: 7px; height: 7px; border-radius: 50%; transform: none; box-shadow: none; }
/* B1: «Реальные средства · Binance» on Real; below 600 px only «Реальные средства» fits beside the exchange chip */
#account-label[data-ex]::after { content: attr(data-ex); }
@media (max-width: 37.49rem) { #account-label[data-ex]::after { content: none; } }
body[data-account=practice] .account-pill { background: var(--color-practice-fill); }
body[data-account=real] .account-pill { background: var(--color-real-fill); }
/* «/USDC» stacked over the change. */
.price-meta { display: inline-grid; gap: 2px; line-height: 1.1; }
.price-quote { font-size: var(--text-12); color: var(--color-text-muted); }
/* Tiles / list toggle: pill with a sunken track and a raised selected thumb. */
.rounds-tools { display: inline-flex; align-items: center; gap: var(--space-1h); }
.view-toggle { display: inline-flex; padding: 2px; border: 1px solid var(--color-frame); border-radius: 16px; background: var(--color-surface-sunken); }
.view-toggle[hidden] { display: none; }
.view-opt { position: relative; display: grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 14px; background: none; color: var(--color-text-faint); cursor: pointer; }
.view-opt::after { content: ""; position: absolute; inset: -8px -2px; }
.view-opt svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.view-opt[aria-pressed=true] { background: var(--color-surface-raised, var(--color-surface)); color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-frame-bright); }
/* List view: the same real cards, condensed into rows. */
.round-list.view-list { gap: 0; }
.view-list .round { display: grid; grid-template-columns: auto minmax(0, 1fr); /* r37: the amount keeps its width, the status gives way (390 px overlap) */ column-gap: var(--space-2); row-gap: var(--space-half); padding: var(--space-1) var(--space-2); border-radius: 0; }
.view-list .round + .round { border-top-width: 0; }
.view-list .round .leg-labels { grid-column: 1 / -1; margin: 0; }
.view-list .round .trade-row { grid-column: 1; min-height: 0; margin: 0; display: block; } /* r37: slots are hidden in the list, so the tile grid (slot · 1fr · slot) must not squeeze the amount */
.view-list .round .trade-row .slot { display: none; }
.view-list .round .trade-row .ratio-sub, .view-list .round .usd-hint, .view-list .round .round-live { display: none; }
.view-list .round .status { grid-column: 2; grid-row: 2; align-self: center; margin: 0; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.view-list .round .trade-row .ratio { padding-inline: 0; justify-items: start; text-align: left; }
.view-list .round > .round-result { grid-column: 1 / -1; } /* r37: the result line does not widen the amount column */
.view-list .round .card-sell, .view-list .round .round-actions, .view-list .round .sale-outcome { grid-column: 1 / -1; margin-top: var(--space-half); }
.view-list .round .sale-profit { align-items: flex-start; }
.view-list .round .sale-profit-line { justify-content: flex-start; }
/* Chart window: no double divider — the orders switch lends its line to «Подробнее». */
.chart-settings .chart-orders-row .setting-switch { border-bottom: 0; }
.chart-settings .sx-disclosure { margin-top: 0; }
.chart-settings .chart-advanced .settings-field:first-child { margin-top: var(--space-1); }
.chart-settings .chart-switches .setting-switch:last-child { border-bottom: 0; }
.chart-settings .chart-advanced .settings-field { margin-top: var(--c-chart-module-gap); }
/* Chart extras. */
.chart .bid-line { stroke: var(--color-buy); } .chart .ask-line { stroke: var(--color-sell); }
.chart .candle.up { fill: var(--color-buy); } .chart .candle.down { fill: var(--color-sell); }
.chart .wick { stroke-width: 1; vector-effect: non-scaling-stroke; } .chart .wick.up { stroke: var(--color-buy); } .chart .wick.down { stroke: var(--color-sell); }
.chart.axis-left .tag { right: auto; left: 0; }
.chart .tick { position: absolute; font-size: var(--text-11); color: var(--color-text-faint); font-variant-numeric: tabular-nums; pointer-events: none; }
.chart .price-tick { right: 0; transform: translateY(-50%); }
.chart.axis-left .price-tick { right: auto; left: 0; }
.chart .time-tick { bottom: -20px; transform: translateX(-50%); }
/* merge design-qa 2026-11-29: the ticket's «Ждём расчёт сервера» is a waiting state, shown as a neutral busy notice. */
/* r40 item 3 (Neil): the reason slot above the trade button keeps room for the longest reason (min-height set by
   keepReasonSpace in app.js); the reason sits at the slot's bottom, right above the button, which never moves. */
.reason-slot { position: relative; display: flex; flex-direction: column; justify-content: flex-end; }
.reason-probe { position: absolute; left: 0; right: 0; top: 0; visibility: hidden; pointer-events: none; }
.reason-probe:has(> .reason-action) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-1); row-gap: var(--space-half); }
.reason.busy { background: var(--color-surface-sunken); border-color: var(--color-line); color: var(--color-text-muted); }
.reason.busy > span:first-child { display: none; }
/* Website logotype in the header. */
.brand-inline { display: none; }
/* merge design-qa 2026-11-29: the picture hides only where the inline logotype exists (the identity pages add it in
   identity-lang.js; if brand.js fails, the picture stays). One header anatomy on every page: logo left, RU/EN right. */
@media (min-width: 360px) { .brand:has(.brand-inline) .brand-picture { display: none; } .brand-inline { display: inline-flex; } }
.beta-anonymous .top > .r30-seals { display: none; } /* signed out: no pinned pairs; the empty cell pushed RU/EN to a 2nd row */
.dk-logo-svg { display: block; height: 20px; width: auto; overflow: visible; }
.dk-lv2 { transition: transform 240ms cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) { .dk-logo:hover .dk-lv2 { transform: translateX(-2.11px); } }
.dk-logo:active .dk-lv2, .dk-logo:focus-visible .dk-lv2 { transform: translateX(-2.11px); }
@media (prefers-reduced-motion: reduce) { .dk-lv2 { transition: none; } }

/* ── Phone landscape & tablet portrait (mobile app, < 64 rem): r5 responsive rules on the real DOM ───── */
/* Tablet portrait: the phone column widens; rounds two per row. */
@media (min-width: 600px) and (max-width: 63.99rem) and (orientation: portrait) {
  html:not(.sx-desk) .app, html:not(.sx-desk) .dock { max-width: 720px; }
  html:not(.sx-desk) .round-list:not(.view-list) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1h); align-items: stretch; }
  html:not(.sx-desk) .round-list:not(.view-list) > .round { margin: 0; display: flex; flex-direction: column; }
  html:not(.sx-desk) .round-list:not(.view-list) > .round > .card-sell, html:not(.sx-desk) .round-list:not(.view-list) > .round > .round-actions { margin-top: auto; }
  html:not(.sx-desk) .chart { height: 200px; }
}
/* Phone landscape (short screen): market on the left (sticky), wallet + rounds on the right; the dock under the right column. */
@media (orientation: landscape) and (max-height: 540px) and (max-width: 63.99rem) {
  html:not(.sx-desk) .app { max-width: none; padding-inline: max(var(--space-page), env(safe-area-inset-left, 0px)) max(var(--space-page), env(safe-area-inset-right, 0px)); }
  html:not(.sx-desk) #main:not([hidden]) { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: var(--space-2); align-items: start; }
  html:not(.sx-desk) #main > * { grid-column: 2; }
  html:not(.sx-desk) #main > .dk-full-ph { grid-column: 1; grid-row: 1 / span 6; } /* r31: the placeholder holds the market's column */
  html:not(.sx-desk) #main > .market { grid-column: 1; grid-row: 1 / span 6; position: sticky; top: calc(var(--c-header-height) + var(--space-1)); margin-top: 0; padding-block: var(--space-1); }
  html:not(.sx-desk) #main > .wallet { margin-top: 0; }
  html:not(.sx-desk) .market .chart { height: 112px; }
  html:not(.sx-desk) .dock { left: auto; right: 0; max-width: none; width: calc(6 / 11 * (100% - 2 * var(--space-page) - var(--space-2)) + var(--space-page)); margin: 0; }
}

/* ── Desktop cabinet r8 (≥ 64 rem, any pointer): admin density ──────────────────────────────────────
   Real components, re-scaled through their component tokens onto the admin workspace scale
   (34 px controls, 36 px nav rows, 56 px top bar, 1600 px shell). Desktop-only small variants
   (no DS counterpart yet) are marked dk-*; promoted into tokens.json + /ds when it ships. */
.sx-desk {
  --size-touch: var(--c-workspace-control-desktop);
  --c-button-height: var(--c-workspace-control-desktop);
  --c-button-height-hero: 40px;
  --c-chip-height: 40px;
  --c-slot-size: 56px; --c-orb-size: 28px;
  --c-slide-height: 40px; --c-slide-thumb: 32px;
  --c-card-slide-height: var(--c-workspace-control-desktop); --c-card-slide-thumb: 26px;
  --c-compact-choice-touch: 28px; --c-step-chip-touch: 32px; --c-step-chip-height: 28px;
  --c-menu-row-height: 48px; --c-menu-medallion: 28px; --c-menu-label-size: var(--text-14);
  --dk-seg: 28px; --dk-row: var(--c-workspace-nav-desktop);
  --nav-w: var(--c-workspace-sidebar-width); --tk-w: 320px; --gut: var(--space-3);
  --app-max: var(--c-workspace-shell-max);
  --shell-left: max(0px, calc((100vw - var(--app-max)) / 2));
  --dk-label: 400 var(--text-12)/1.2 var(--font-display);
}
html.sx-desk, .sx-desk body { overflow-x: clip; }
.sx-desk .app { max-width: var(--app-max); margin: 0 auto; padding: 0 var(--gut) var(--gut); display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); column-gap: var(--gut); align-content: start; }
.sx-desk .app > * { grid-column: 2; }
.sx-desk .app > .beta-status, .sx-desk .app > .top { grid-column: 1 / -1; }
.sx-desk .app > .beta-status { margin-inline: calc(-1 * var(--gut)); padding-inline: var(--gut); }
/* r34 (Neil): the 17 px strip above the header moved the docked ticket, budget and book 17 px on the first scroll
   (and the book grew by the same amount): a jerk. On desktop «Демо» in the header and «Частная бета» in the sidebar
   already say it, so the strip is not drawn; the header starts at the top and nothing right of the chart moves. */
.sx-desk .app > .beta-status { height: 0; min-height: 0; overflow: hidden; padding-block: 0; border: 0; } /* stays in the grid (row 1: the sidebar is placed by row number) and for screen readers */
/* Header: the bar runs edge to edge (the shell content stays aligned inside). */
.sx-desk .top { min-height: var(--c-workspace-top-height); height: var(--c-workspace-top-height); margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut); background: none; border-bottom: 0; isolation: isolate; }
.sx-desk .top::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); z-index: -1; background: var(--color-bg-deep); border-bottom: 1px solid var(--color-frame-inner); }
.sx-desk .top + * { margin-top: 0; }
.sx-desk #menu-btn, .sx-desk #dock { display: none !important; }
.sx-desk #conn { display: inline-flex; flex-direction: row; align-items: center; gap: var(--space-1); width: auto; min-width: 34px; height: 34px; padding: 0 var(--space-1); border-radius: var(--radius-control); white-space: nowrap; }
.sx-desk #conn:hover { background: var(--color-surface-sunken); }
.sx-desk #conn .dot { flex: none; }
.sx-desk #conn .conn-text { position: static; width: auto; height: auto; clip: auto; clip-path: none; overflow: visible; white-space: nowrap; font: 400 var(--text-12)/1 var(--font-ui); color: var(--color-text-muted); }
/* Sidebar: admin rows. */
.sx-desk .desk-nav { grid-column: 1; grid-row: 3 / span 20; position: sticky; top: var(--desk-head, 56px); align-self: start; height: calc(100vh - var(--desk-head, 56px)); display: flex; flex-direction: column; justify-content: space-between; padding: var(--space-2) var(--space-1) var(--space-2) 0; border-right: 1px solid var(--color-line); margin-right: calc(-1 * var(--space-1)); margin-bottom: calc(-1 * var(--gut)); z-index: 21; }
/* r34 (Neil): the grid area ends at .app's 24 px bottom padding, so at the page end the sticky sidebar was pushed up
   under the header. The negative bottom margin lets it reach the page end and stay pinned under the header. */
.desk-nav-list { display: grid; gap: 1px; }
.desk-link { display: flex; align-items: center; gap: var(--space-1h); min-height: var(--dk-row, 36px); padding: 0 var(--space-1h); border: 0; border-radius: var(--radius-control); background: none; color: var(--color-text-muted); font: 400 var(--text-13)/1.2 var(--font-ui); text-align: left; cursor: pointer; }
.desk-link:hover { color: var(--color-text); background: var(--color-surface-sunken); }
.desk-link[aria-current] { color: var(--color-accent-strong); background: var(--color-surface-sunken); box-shadow: inset 2px 0 0 var(--color-accent); }
.desk-ic { display: inline-grid; place-items: center; width: var(--c-icon-sm); height: var(--c-icon-sm); color: var(--color-text-faint); } .desk-ic .i { width: var(--c-icon-sm); height: var(--c-icon-sm); }
.desk-link[aria-current] .desk-ic { color: var(--color-accent); }
.desk-group { margin-top: var(--space-2); display: grid; gap: 1px; }
.desk-group-title { padding: 0 var(--space-1h) var(--space-half); font: 500 var(--text-11)/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.desk-note { margin: 0; padding: 0 var(--space-1h); font-size: var(--text-11); line-height: 1.4; color: var(--color-text-muted); }
/* Main column; the ticket is docked on the right of the shell. */
.sx-desk #main { padding-right: calc(var(--tk-w) + var(--gut)); padding-top: var(--space-3); }
.sx-desk .market { margin-top: 0; padding: var(--space-2) var(--space-3); display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); }
.sx-desk .market > * { grid-column: 1 / -1; }
.sx-desk .market-head { height: var(--size-touch); }
.sx-desk .eyebrow { font-size: var(--text-13); }
.sx-desk .market-head .age { font-size: var(--text-12); color: var(--color-text-muted); }
.dk-market-tools { display: inline-flex; align-items: center; gap: var(--space-1h); }
.dk-seg { display: inline-flex; padding: 2px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-bg-deep); }
.dk-seg button { min-height: 24px; padding: 0 var(--space-1); border: 0; border-radius: 2px; background: none; color: var(--color-text-muted); font: 500 var(--text-12)/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
.dk-seg button:hover { color: var(--color-text); }
.dk-seg button[aria-pressed=true] { background: var(--color-surface-raised); color: var(--color-accent-strong); box-shadow: inset 0 0 0 1px var(--color-frame); }
.dk-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 var(--space-1h); border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-bg-deep); color: var(--color-text); font: 500 var(--text-12)/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
.dk-btn:hover { border-color: var(--color-frame-bright); }
.dk-btn .i { width: 14px; height: 14px; }
/* r22 · chart header: icon-only settings (44 px target, 28 px face, tooltip on hover/focus) + quiet stale state */
.sx-desk .dk-market-tools #market-age { display: none; }
.dk-stale { color: var(--color-text-muted); font: 500 var(--text-12)/1 var(--font-ui); white-space: nowrap; }
.dk-stale[hidden] { display: none; }
.dk-iconbtn { --hit: var(--c-workspace-control-touch); --face: var(--c-compact-choice-face); position: relative; display: inline-grid; place-items: center; width: var(--hit); height: var(--hit); margin: calc((var(--face) - var(--hit)) / 2); padding: 0; border: 0; background: none; color: var(--color-text-muted); cursor: pointer; }
.dk-iconbtn::before { content: ""; position: absolute; inset: calc((var(--hit) - var(--face)) / 2); border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-bg-deep); }
.dk-iconbtn .i { position: relative; width: var(--c-icon-sm); height: var(--c-icon-sm); }
.dk-iconbtn:hover, .dk-iconbtn:focus-visible { color: var(--color-text); outline: none; }
.dk-iconbtn:hover::before { border-color: var(--color-frame-bright); }
.dk-iconbtn:focus-visible::before { border-color: var(--color-frame-bright); box-shadow: 0 0 0 1px var(--color-frame-bright); }
.dk-iconbtn::after { content: attr(data-tip); position: absolute; top: calc(100% - 4px); right: calc((var(--hit) - var(--face)) / 2); z-index: 30; padding: var(--space-half) var(--space-1); border: 1px solid var(--color-frame-bright); border-radius: var(--radius-control); background: var(--color-bg-deep); color: var(--color-text); font: 500 var(--text-12)/1.3 var(--font-ui); white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity var(--motion-ui); }
/* r31 (design-qa M1): hover tips only where hover exists (iOS keeps :hover after a tap) */
@media (hover: hover) { .dk-iconbtn:hover::after { opacity: 1; visibility: visible; } }
.dk-iconbtn:focus-visible::after { opacity: 1; visibility: visible; }
.sx-desk .price-row { height: 44px; margin-top: var(--space-half); }
.sx-desk .price { font-size: var(--text-28); }
.sx-desk .market > .quotes { grid-column: 1; display: flex; gap: var(--space-1); margin-top: var(--space-1); }
.sx-desk .market > .pressure { grid-column: 2; grid-row: 3; align-self: center; justify-self: end; width: auto; grid-template-columns: auto clamp(72px, 9vw, 128px) auto; margin-top: var(--space-1); min-height: 28px; white-space: nowrap; cursor: help; }
.sx-desk .market > .pressure .pressure-bar { border-radius: 2px; }
.pressure.no-data .pressure-bar i { opacity: 0; }
.pressure.no-data .pressure-bar { background: var(--color-line); }
.sx-desk .quote { min-height: 0; min-width: 112px; padding: 6px var(--space-1h); font-size: var(--text-11); gap: 2px; }
.sx-desk .quote b { font-size: var(--text-14); }
/* Chart (r5 renderer). */
.sx-desk .chart { height: clamp(260px, calc(100vh - 470px), 460px); margin-top: var(--space-2); margin-bottom: 0; border-top: 1px solid var(--color-line); cursor: crosshair; touch-action: pan-y; }
@media (orientation: portrait) { .sx-desk .chart { height: clamp(320px, 34vh, 640px); } }
:is(.sx-desk, .dk-chart-full) #chart-svg, :is(.sx-desk, .dk-chart-full) #chart-tags { display: none; }
.dk-chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; font-family: var(--font-ui); }
.dk-chart-svg .dk-empty { fill: var(--color-text-muted); font-size: var(--text-13); }
.dk-grid { stroke: var(--color-line); stroke-dasharray: 1 5; }
/* r32 item 2 (Neil): grid intensity — none / light (the r5 look above) / medium / strong; the app's small chart too.
   The settings' sample strip shows the same four looks. */
#chart[data-grid=none] :is(.dk-grid, .grid) { display: none; }
#chart[data-grid=medium] :is(.dk-grid, .grid), .dk-gridprev[data-grid=medium] .dk-grid { stroke: var(--color-line-strong); stroke-dasharray: 1 3; }
#chart[data-grid=strong] :is(.dk-grid, .grid), .dk-gridprev[data-grid=strong] .dk-grid { stroke: var(--color-line-strong); stroke-dasharray: none; }
.dk-gridprev { display: block; width: 100%; height: 48px; margin-bottom: var(--space-1); border: 1px solid var(--color-line); border-radius: var(--radius-control); background: var(--color-bg-deep); }
.dk-gridprev .dk-grid { vector-effect: non-scaling-stroke; transition: stroke var(--motion-ui) var(--motion-ease), opacity var(--motion-ui) var(--motion-ease); }
.dk-gridprev[data-grid=none] .dk-grid { opacity: 0; }
/* r32 review M3: the four steps are one ordered scale — one row at every width (44 px hit area kept). */
.settings-field .compact-choices:has([data-chart-gridlevel]) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-choices:has([data-chart-gridlevel]) .compact-choice { min-width: 0; }
.compact-choices:has([data-chart-gridlevel]) .compact-choice > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-gridprev-line { fill: none; stroke: var(--color-accent); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dk-axis { fill: var(--color-text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dk-line { fill: none; stroke: var(--color-accent); stroke-width: 1.5; stroke-linejoin: round; }
.dk-line.bid { stroke: var(--color-buy); } .dk-line.ask { stroke: var(--color-sell); stroke-width: 1; }
.dk-area { fill: var(--color-highlight); }
.dk-wick { stroke-width: 1; } .dk-wick.up { stroke: var(--color-up); } .dk-wick.down { stroke: var(--color-down); }
.dk-body.up { fill: var(--color-up); } .dk-body.down { fill: var(--color-down); }
.dk-vol { opacity: .38; } .dk-vol.up { fill: var(--color-up); } .dk-vol.down { fill: var(--color-down); }
.dk-vol-base { stroke: var(--color-line); }
.dk-now { fill: var(--color-accent-strong); }
.dk-last { stroke: var(--color-accent); stroke-width: 1; stroke-dasharray: 1 3; opacity: .7; }
.dk-lvl { stroke-width: 1; stroke-dasharray: 4 4; } .dk-lvl.buy { stroke: var(--color-buy); } .dk-lvl.sell { stroke: var(--color-sell); }
.dk-tag { font-size: 11px; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--color-bg-deep); stroke-width: 3px; }
.dk-tag.buy { fill: var(--color-buy-strong); } .dk-tag.sell { fill: var(--color-sell-strong); }
.dk-pill rect { fill: var(--color-surface-raised); stroke: var(--color-frame-bright); stroke-width: 1; }
.dk-pill text { fill: var(--color-text); font-size: 11px; font-variant-numeric: tabular-nums; }
.dk-pill.now rect { fill: var(--color-accent-fill, var(--color-surface-raised)); stroke: var(--color-accent); }
.dk-pill.now text { fill: var(--color-accent-strong); font-weight: 600; }
.dk-cross line { stroke: var(--color-frame-bright); stroke-dasharray: 2 3; }
.dk-readout { min-height: 1.5em; margin: var(--space-1) 0 0; font-size: var(--text-12); line-height: 1.5; color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-readout b { color: var(--color-text); font-weight: 500; }
.dk-readout.stale { color: var(--color-sell); }
.dk-g0 { stop-color: var(--color-accent); stop-opacity: .2; } .dk-g1 { stop-color: var(--color-accent); stop-opacity: 0; }
.dk-live-line { fill: none; stroke: var(--color-accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.dk-seed { fill: none; stroke: var(--color-text-faint); stroke-width: 1.2; stroke-dasharray: 3 4; }
.dk-dot-solo { fill: var(--color-accent); }
.dk-now-v { stroke: var(--color-line-strong); stroke-dasharray: 1 3; }
.dk-axis.now { fill: var(--color-text); }
.dk-last.up { stroke: var(--color-up); } .dk-last.down { stroke: var(--color-down); }
.dk-now.up { fill: var(--color-up); } .dk-now.down { fill: var(--color-down); } .dk-now.stale { fill: var(--color-text-faint); }
.dk-pill.now.up rect { stroke: var(--color-up); } .dk-pill.now.up text { fill: var(--color-up); }
.dk-pill.now.down rect { stroke: var(--color-down); } .dk-pill.now.down text { fill: var(--color-down); }
.dk-pill.now.stale rect { stroke: var(--color-line-strong); fill: var(--color-surface-sunken); } .dk-pill.now.stale text { fill: var(--color-text-muted); }
.dk-stale { stroke: var(--color-text-faint); stroke-width: 1.2; stroke-dasharray: 2 4; }
.dk-ping { fill: none; stroke: var(--color-accent); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; animation: dk-ping 900ms var(--motion-ease) 1; }
.dk-ping.up { stroke: var(--color-up); } .dk-ping.down { stroke: var(--color-down); }
@keyframes dk-ping { from { opacity: .75; transform: scale(.35); } to { opacity: 0; transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .dk-ping { display: none; } }
.dk-readout .up { color: var(--color-up); } .dk-readout .down { color: var(--color-down); }
:is(.sx-desk, .dk-chart-full) .chart-caption, :is(.sx-desk, .dk-chart-full) .chart-note { display: none !important; }
/* Wallet: one compact strip; the budget lives in the ticket meta. */
.sx-desk .wallet { margin-top: var(--space-1); gap: var(--space-1); }
.sx-desk .stash { min-height: 0; padding: var(--space-1) var(--space-1h); display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); column-gap: var(--space-1); row-gap: 2px; align-items: baseline; text-align: left; }
.sx-desk .stash-head { grid-column: 1 / -1; min-height: 0; font-size: var(--text-11); }
.sx-desk .stash-head .gem { --orb-size: var(--c-icon-sm); }
.sx-desk .stash > b { grid-column: 1; font-size: var(--text-14); line-height: 1.3; }
.sx-desk .stash-hint { grid-column: 2; justify-self: end; min-height: 0; color: var(--color-text-muted); }
.sx-desk .wallet > .budget { display: none; }
/* Rounds: tiles and list rows in compact variants. */
.sx-desk .section-head { margin-top: var(--space-3); min-height: 34px; }
.sx-desk .banner.small { font-size: var(--text-15); }
.sx-desk .round-list { gap: var(--space-1h); }
.sx-desk .round-list:not(.view-list) { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: stretch; }
.sx-desk .round { padding: var(--space-1h) var(--space-2) var(--space-2); display: flex; flex-direction: column; }
.sx-desk .round > .round-actions, .sx-desk .round > .card-sell { margin-top: auto; padding-top: var(--space-1h); }
.sx-desk .leg-labels { font-size: var(--text-13); }
.sx-desk .round-time { font-size: var(--text-12); }
.sx-desk .trade-row { gap: var(--space-1); }
.sx-desk .ratio { padding: 6px var(--space-1); }
.sx-desk .ratio-main { font-size: var(--text-14); }
.sx-desk .ratio-sub, .sx-desk .ratio .usd-hint { font-size: var(--text-11); }
.sx-desk .status { margin-top: var(--space-1); font-size: var(--text-12); letter-spacing: 1.5px; }
.sx-desk .round-live { font-size: var(--text-12); min-height: 0; }
.sx-desk .round-result { font-size: var(--text-18); }
.sx-desk .round .btn, .sx-desk .round .sale-action { min-height: var(--c-workspace-control-desktop); padding: 0 var(--space-1h); font: 500 var(--text-13)/1 var(--font-ui); font-variant: normal; letter-spacing: 0; text-transform: none; }
.sx-desk .round .sale-action .i { display: none; }
.sx-desk .round .round-actions { gap: var(--space-1); }
.sx-desk .reward-pick { min-width: 64px; min-height: var(--c-card-slide-height); padding: 2px var(--space-1h); }
.sx-desk .reward-pick .reward-amount { font-size: var(--text-13); }
.sx-desk .reward-pick small { font-size: var(--text-11); letter-spacing: .5px; }
.sx-desk .slot .stack { left: 1px; right: 1px; max-width: none; }
.sx-desk .fuse-ends span, .sx-desk .sale-profit-value small { color: var(--color-text-muted); }
/* list rows: [round · time] [amounts] [status / outcome] [actions] */
.sx-desk .round-list.view-list { gap: 0; }
.sx-desk .view-list .round { display: grid; grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 1.2fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: var(--space-2); row-gap: 2px; padding: var(--space-1) var(--space-2); min-height: 52px; }
.sx-desk .view-list .round > * { margin: 0; padding: 0; }
.sx-desk .view-list .round .leg-labels { grid-column: 1; grid-row: 1 / span 2; display: grid; gap: 2px; }
.sx-desk .view-list .round .leg-labels .trail { display: none; }
.sx-desk .view-list .round .trade-row { grid-column: 2; grid-row: 1 / span 2; display: block; }
.sx-desk .view-list .round .ratio { display: block; border: 0; padding: 0; text-align: left; }
.sx-desk .view-list .round .ratio-main { display: inline-flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 6px; height: auto; max-width: 100%; }
.sx-desk .view-list .round .ratio-main > span { display: inline; }
.sx-desk .view-list .round .status { grid-column: 3; grid-row: 1 / span 2; align-self: center; text-align: left; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-desk .view-list .round:has(> .sale-outcome:not(:empty)) .status { grid-row: 1; align-self: end; }
.sx-desk .view-list .round .sale-outcome { grid-column: 3; grid-row: 2; align-self: start; }
.sx-desk .view-list .round .sale-profit { min-height: 0; padding: 0; border: 0; background: none; text-align: left; font-size: var(--text-12); }
.sx-desk .view-list .round .sale-profit { align-items: flex-start; }
/* r23 (Neil): «Ожидаемая прибыль» starts on the kicker's left edge; a narrow column wraps the value, never pushes left */
.sx-desk .view-list .round .sale-profit-line { justify-content: flex-start; flex-wrap: wrap; row-gap: 0; }
.sx-desk .view-list .round .sale-profit-line > * { white-space: nowrap; }
/* r23 (Neil, item 6): icon + figure pair keeps its own inline-flex centring in the list (the inline override above
   put the ⇄ on the baseline, 3 px above the figures' cap-height middle). DS rule: docs/EDGE-RULES r23 §Icon + figure. */
.sx-desk .view-list .round .ratio-main > .sale-conversion { display: inline-flex; align-items: center; }
.sx-desk .view-list .round .sale-origins { display: none; }
.sx-desk .view-list .round .card-sell, .sx-desk .view-list .round .round-actions { grid-column: 4; grid-row: 1 / span 2; flex-wrap: nowrap; justify-content: flex-end; }
.sx-desk .view-list .round .card-sell .slide { flex: 0 0 13rem; }
.sx-desk .view-list .round .card-sell .reward-pick { min-width: 56px; }
.sx-desk .view-list .round > .round-result { display: block; grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: left; font: 500 var(--text-14)/1.3 var(--font-ui); font-variant-numeric: tabular-nums; }
.sx-desk .view-list .round > :not(.leg-labels):not(.trade-row):not(.status):not(.card-sell):not(.round-actions):not(.sale-outcome):not(.round-result):not(.round-note):not(.reason.warn) { display: none; }
/* B4 (Neil 2026-11-28): list view keeps the card's state facts as one quiet line under the status.
   .round-note = partial fill, other-device / legacy order, sale revision; .reason.warn = why the card needs attention.
   Distance lines, the fuse and the remainder note stay hidden (the «Остаток» row covers remainders). */
.view-list .round > .round-note,
.view-list .round > .reason.warn { display: block; grid-column: 1 / -1; margin: 0; padding: 0; min-height: 0; border: 0; border-radius: 0; background: none; text-align: left; font-size: var(--text-12); line-height: 1.35; }
.view-list .round > .reason.warn { color: var(--color-sell-strong); }
.sx-desk .view-list .round > .round-note,
.sx-desk .view-list .round > .reason.warn { grid-column: 3; grid-row: auto; align-self: start; }
.sx-desk .view-list .round:has(> .round-note, > .reason.warn) .status { grid-row: 1; align-self: end; }
/* The reason reads as one sentence: its own line under the amount, status and actions, not squeezed into the status cell. */
.sx-desk .view-list .round > .reason.warn { grid-column: 2 / -1; }


/* ── The ticket: the real buy window, docked and compact ── */
.sx-desk .sheet-layer.sx-docked { inset: auto; top: var(--desk-top, 80px); left: var(--dk-tk-l, calc(100% - var(--shell-left) - var(--gut) - var(--tk-w))); right: auto; width: var(--tk-w); height: auto; max-height: calc(100vh - var(--desk-top, 80px) - var(--gut)); padding: 0; display: block; pointer-events: none; overflow: visible; }
.sx-desk .sx-docked .scrim, .sx-desk .sx-docked [data-window-close], .sx-desk .sx-docked [data-window-back] { display: none; }
.sx-desk .sx-docked .sheet { pointer-events: auto; max-width: none; max-height: calc(100vh - var(--desk-top, 80px) - var(--gut)); padding-top: var(--space-1h); animation: none; }
.sx-desk .sx-docked .sheet-head { justify-content: flex-start; min-height: 0; padding: 0 var(--space-2); }
.sx-desk .sx-docked .sheet-head h2.plaque { flex: 1; display: flex; align-items: center; gap: var(--space-1); padding: 0; border: 0; background: none; box-shadow: none; color: var(--color-accent); font: 400 var(--text-15)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.5px; text-align: left; }
.sx-desk .sx-docked .sheet-head h2.plaque::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--color-frame), transparent); }
.dk-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-1h); margin: 0 var(--space-2) var(--space-1h); padding-bottom: var(--space-1h); border-bottom: 1px solid var(--color-line); font: 400 var(--text-12)/1.3 var(--font-ui); color: var(--color-text-muted); }
.dk-meta button { display: inline-flex; align-items: baseline; gap: 6px; min-height: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.dk-meta button:hover span { color: var(--color-text); text-decoration: underline; text-underline-offset: 3px; }
.dk-meta b { color: var(--color-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.dk-meta b.plus { color: var(--color-buy-strong); } .dk-meta b.minus { color: var(--color-sell-strong); }
.dk-meta .sep { width: 1px; height: 10px; background: var(--color-line-strong); align-self: center; }
.sx-desk .sx-docked .sheet-body { padding: var(--space-1) var(--space-2) var(--space-2); }
.sx-desk .sx-docked .exchange, .sx-desk .sx-docked .rates, .sx-desk .sx-docked #amount-hint, .sx-desk .sx-docked #when-hint { display: none; }
.sx-desk .sx-docked .sheet #book { display: none; } /* the book lives in its own panel under the ticket */
.sx-desk .sx-docked .field-label { margin: var(--space-2) 0 var(--space-1); font: var(--dk-label); font-variant: small-caps; letter-spacing: 1.2px; align-items: center; }
.sx-desk .sx-docked .field-value { min-height: 24px; font: 500 var(--text-13)/1 var(--font-ui); font-variant: normal; letter-spacing: 0; }
.sx-desk .sx-docked .field-value small { font-size: var(--text-11); }
.sx-desk .sx-docked .chips { gap: var(--space-1); }
.sx-desk .sx-docked .chip { padding: 2px 4px; font-size: var(--text-14); line-height: 1.15; }
.sx-desk .sx-docked .chip small { font-size: var(--text-11); }
.sx-desk .sx-docked .chip > span { white-space: nowrap; }
.sx-desk .sx-docked .chip[aria-expanded]::after { right: 5px; width: 4px; height: 4px; }
.sx-desk .sx-docked .seg { display: inline-flex; gap: var(--space-1); border: 0; background: none; overflow: visible; }
.sx-desk .sx-docked .seg button { min-height: var(--dk-seg); padding: 0 var(--space-1h); border: 1px solid var(--color-line-strong); border-radius: calc(var(--dk-seg) / 2); background: var(--color-bg-deep); color: var(--color-text-muted); font: 500 var(--text-12)/1 var(--font-ui); font-variant: normal; letter-spacing: 0; }
.sx-desk .sx-docked .seg button[aria-pressed=true], .sx-desk .sx-docked .seg button.on, .sx-desk .sx-docked .seg button[aria-checked=true] { border-color: var(--color-frame-glow); color: var(--color-accent-strong); box-shadow: inset 0 0 0 1px var(--color-frame-bright), inset 0 0 10px var(--color-accent-fill); }
.sx-desk .sx-docked .hint { font-size: var(--text-12); line-height: 1.45; margin: var(--space-1) 0 0; color: var(--color-text-muted); }
.sx-desk .sx-docked .summary { margin-top: var(--space-2); padding: 6px 0; }
.sx-desk .sx-docked .summary.buy-result { border-bottom: 0; padding-bottom: 0; } /* r21: the footer's top line is the only divider */
/* r21 (Neil): the docked ticket is a resting panel — passive frame like the budget and book panels, not the hover tone */
.sx-desk .sx-docked .sheet { border-color: var(--color-frame); }
/* r21 (Neil): «Сегодня» lives in the day-budget card, above «Бюджет на день» */
.dk-budget-panel.has-day { border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-bg-deep); box-shadow: inset 0 0 0 1px var(--color-frame-inner); }
.dk-budget-panel.has-day > .dk-meta { margin: 0; padding: var(--space-1h) var(--space-2) var(--space-1); border-bottom: 1px solid var(--color-line); }
.dk-budget-panel.has-day > .budget { border: 0; box-shadow: none; background: none; }
.sx-desk .sx-docked .sum-row { min-height: 24px; font-size: var(--text-12); }
.sx-desk .sx-docked .br-kick { font: var(--dk-label); font-variant: small-caps; letter-spacing: 1.2px; }
.sx-desk .sx-docked .br-get b { font-size: var(--text-14); }
.sx-desk .sx-docked .br-eq, .sx-desk .sx-docked .br-state { font-size: var(--text-12); }
.sx-desk .sx-docked .br-col b { font-size: var(--text-13); }
.sx-desk .sx-docked .sum-row b, .sx-desk .sx-docked .sum-row.lead b { font: 500 var(--text-13)/1.2 var(--font-ui); font-variant-numeric: tabular-nums; }
.sx-desk .sx-docked .calc-state { margin-top: 6px; font-size: var(--text-11); color: var(--color-text-muted); }
.sx-desk .sx-docked .sheet-foot { padding: var(--space-1h) var(--space-2) var(--space-2); }
.sx-desk .sx-docked .reason { margin: 0 0 var(--space-1); padding: 6px var(--space-1h); font-size: var(--text-12); }
.sx-desk .sx-docked .submission-status { font-size: var(--text-12); }
/* ── Order book panel (under the ticket) ── */
.dk-book-panel { position: fixed; z-index: 19; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-bg-deep); box-shadow: inset 0 0 0 1px var(--color-frame-inner); }
.dk-book-panel[hidden], html:not(.sx-desk) .dk-book-panel { display: none; }
.dk-book-panel.dk-tight { display: none; }
.dk-book-panel.dk-mini > .dk-panel-head { display: none; } /* C4: minimal book on short screens */
.dk-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-1); padding: var(--space-1h) var(--space-2) var(--space-1); border-bottom: 1px solid var(--color-line); }
.dk-panel-head h2 { margin: 0; font: 400 var(--text-15)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.5px; color: var(--color-accent); }
.dk-panel-note { font-size: var(--text-11); color: var(--color-text-muted); white-space: nowrap; }
.dk-book-host { min-height: 0; overflow: auto; padding: var(--space-1) var(--space-1h) var(--space-1h); scrollbar-width: thin; }
.dk-book-host .book { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); margin: 0; font-size: var(--text-12); }
.dk-book-host .book h3 { margin: 0 0 4px; padding: 0 6px; font: 500 var(--text-11)/1.3 var(--font-ui); letter-spacing: .04em; text-transform: none; font-variant: normal; color: var(--color-text-muted); text-align: left; }
.dk-book-host .book-col { padding: 6px 4px; }
.dk-book-host .book-row { height: 24px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.dk-book-host .book-you { min-height: 0; padding: 4px 6px; }
.dk-book-host .book-you small { font-size: var(--text-11); }
/* Hold action (ticket 40 px / cards 34 px): one line; the label itself changes during the press. */
.sx-desk .slide.sx-hold { cursor: pointer; touch-action: none; -webkit-touch-callout: none; }
.sx-desk .slide.sx-hold .slide-goal { display: none; }
.sx-desk .slide.sx-hold:not(.compact) .slide-thumb { top: calc(50% - var(--c-slide-thumb) / 2); left: 3px; }
.sx-desk .slide.sx-hold .slide-label { display: block; padding: 0 44px; font: 500 var(--text-14)/calc(var(--c-slide-height) - 2px) var(--font-ui); font-variant: normal; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 120ms; }
.sx-desk .slide.sx-hold.compact .slide-label { padding: 0 var(--space-1) 0 36px; /* r9: the thumb is decoration on desktop; the text uses the room on its right */ font-size: var(--text-13); line-height: calc(var(--c-card-slide-height) - 2px); }
.hold-say { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 44px; font: 500 var(--text-14)/1 var(--font-ui); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; opacity: 0; }
.compact > .hold-say { padding: 0 36px; font-size: var(--text-13); }
.slide.saying > .hold-say { opacity: 1; }
.slide.saying > .slide-label { opacity: 0; }
.hold-say.swap { animation: hold-swap 180ms var(--motion-enter-ease); }
@keyframes hold-swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hold-say.swap { animation: none; } .sx-desk .slide.sx-hold .slide-label { transition: none; } }
.sx-desk .sx-docked .slide.buy:not(.disabled) { border-color: var(--color-buy-edge); background: linear-gradient(180deg, var(--color-surface-sunken), var(--color-bg-deep)); }
.sx-desk .sx-docked .slide.buy:not(.disabled):hover, .sx-desk .sx-docked .slide.buy:not(.disabled):focus-within { border-color: var(--color-buy-solid); }
.sx-desk .sx-docked .slide.buy:not(.disabled) .slide-label { color: var(--color-text); }
.sx-desk .slide.sx-hold .slide-thumb { box-shadow: none; }
.hold-txt { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-desk .slide.holding .slide-fill { opacity: 1; }
.sx-desk .slide.armed { box-shadow: inset 0 0 0 1px var(--color-real-edge); }
.sx-desk .slide.armed > .hold-say { color: var(--color-real); }

/* ── Pages: every drawer surface (menu pages, History, Account, Budget…) is a centred column in the
   content area, Linear-style. One fixed column width for every page (content never changes it):
   «‹ back» row, title, section titles, grouped cards (label + helper left, control right, 56 px rows).
   No off-canvas on desktop; the sidebar stays and navigates. ── */
.sx-desk { --pg-w: 640px; --pg-row: 56px; --pg-card: var(--color-surface-sunken); --pg-rad: 6px; }
.sx-desk .sheet-layer.sx-page { inset: var(--desk-head, 56px) 0 0 var(--dk-pg-l, calc(var(--shell-left) + var(--gut) + var(--nav-w) + var(--gut) - var(--space-1))); padding: 0 var(--dk-pg-r, 0) 0 0; display: block; overflow: auto; background: var(--color-bg-deep); scrollbar-gutter: stable; }
.sx-desk .sx-page .scrim { display: none; }
.sx-desk .sx-page .sheet.drawer { position: relative; display: block; width: min(var(--pg-w), calc(100% - 2 * var(--space-3))); max-width: none; height: auto; max-height: none; margin: 0 auto; padding: var(--space-4, 32px) 0 var(--space-5, 48px); animation: none; transform: none; background: none; border: 0; box-shadow: none; overflow: visible; }
.sx-desk .sx-page .sheet.drawer.closing, .sx-desk .sx-page .sheet.drawer.suspended { animation: none; transform: none; }
.sx-desk .sx-page .sheet.drawer::before, .sx-desk .sx-page .sheet.drawer::after { display: none; }
.sx-desk .sx-page .sheet-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-height: 0; padding: 0 0 var(--space-3); }
.sx-desk .sx-page .sheet-head [data-window-close], .sx-desk .sx-page .sheet-head [data-window-back] { display: none !important; }
.sx-desk .sx-page .sheet-head h2.plaque { position: static; width: 100%; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--color-text); font: 500 var(--text-24)/1.25 var(--font-ui); font-variant: normal; letter-spacing: 0; text-align: left; transform: none; }
.sx-desk .sx-page .sheet-head h2.plaque::before, .sx-desk .sx-page .sheet-head h2.plaque::after { display: none; }
.dk-crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin-left: -8px; padding: 0 var(--space-1); border: 0; border-radius: var(--radius-control); background: none; color: var(--color-text-muted); font: 400 var(--text-13)/1 var(--font-ui); cursor: pointer; }
.dk-crumb:hover { color: var(--color-text); background: var(--color-surface-sunken); }
.dk-crumb:focus-visible { outline: 1px solid var(--color-frame-glow); outline-offset: 1px; }
.dk-chev { width: 6px; height: 6px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
html:not(.sx-desk) .dk-crumb { display: none; }
.sx-desk .sx-page .drawer-pages, .sx-desk .sx-page .drawer-page { position: static; width: auto; height: auto; overflow: visible; transform: none; animation: none; }
.sx-desk .sx-page .sheet-body { padding: 0; overflow: visible; max-height: none; }
.sx-desk .sx-page .sheet-foot:empty { display: none; }
.sx-desk .sx-page .sheet-foot { padding: var(--space-3) 0 0; display: flex; justify-content: flex-end; gap: var(--space-1); }
.sx-desk .sx-page .sheet-foot > .btn { width: auto; flex: 0 0 auto; min-width: 120px; }
/* page text */
.sx-desk .sx-page .hint { font-size: var(--text-12); line-height: 1.45; color: var(--color-text-muted); }
.sx-desk .sx-page .sheet-body > .hint, .sx-desk .sx-page .settings-detail > .hint { margin: 0; }
/* section title (also the app's .menu-group) */
.sx-desk .sx-page .menu-group, .sx-desk .sx-page .dk-sec { margin: var(--space-3) 0 var(--space-1); font: 500 var(--text-13)/1.3 var(--font-ui); font-variant: normal; letter-spacing: 0; color: var(--color-text-muted); text-align: left; }
.sx-desk .sx-page .menu-group::after { display: none; }
/* segmented controls on pages = the desktop small pill segment */
.sx-desk .sx-page .seg { display: inline-flex; width: auto; padding: 2px; gap: 0; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-bg-deep); overflow: visible; }
.sx-desk .sx-page .seg button { flex: none; min-height: 28px; min-width: 0; padding: 0 var(--space-1h); border: 0; border-radius: 2px; background: none; color: var(--color-text-muted); font: 500 var(--text-12)/1 var(--font-ui); font-variant: normal; letter-spacing: 0; white-space: nowrap; overflow-wrap: normal; box-shadow: none; }
.sx-desk .sx-page .seg button + button { border-left: 0; }
.sx-desk .sx-page .seg button:hover { color: var(--color-text); }
.sx-desk .sx-page .seg button[aria-pressed=true] { background: var(--color-surface-raised); color: var(--color-accent-strong); box-shadow: inset 0 0 0 1px var(--color-frame); }
/* ── the card grammar ── */
.sx-desk .sx-page .settings-detail { display: grid; gap: var(--space-2); }
/* (a) a row field: label (+ helper) left, control right */
.sx-desk .sx-page .settings-detail > .settings-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: 2px; align-items: center; margin: 0; padding: var(--space-1h) var(--space-2); min-height: var(--pg-row); border: 1px solid var(--color-line); border-radius: var(--pg-rad); background: var(--pg-card); }
.sx-desk .sx-page .settings-field > .settings-heading, .sx-desk .sx-page .settings-field > .field-label { grid-column: 1; margin: 0; font: 500 var(--text-13)/1.3 var(--font-ui); font-variant: normal; letter-spacing: 0; text-transform: none; color: var(--color-text); }
.sx-desk .sx-page .settings-field > .settings-heading i { display: none; }
.sx-desk .sx-page .settings-detail > .settings-field:has(> .hint:not(:empty)) > .settings-heading { align-self: end; }
.sx-desk .sx-page .settings-detail > .settings-field > :not(.settings-heading):not(.field-label):not(.hint) { grid-column: 2; grid-row: 1 / span 2; justify-self: end; margin: 0; flex-wrap: nowrap; }
.sx-desk .sx-page .settings-detail > .settings-field > .hint { grid-column: 1; margin: 0; align-self: start; }
.sx-desk .sx-page .settings-detail > .settings-field > .hint:empty { display: none; }
.sx-desk .sx-page .settings-field > .big-value { margin: 0; font: 500 var(--text-18)/1.2 var(--font-ui); text-align: right; font-variant-numeric: tabular-nums; }
/* (b) a field that is itself a switch row (+ helper): the switch spans the card */
.sx-desk .sx-page .settings-detail > .settings-field:has(> .setting-switch) { display: block; padding: 0; }
.sx-desk .sx-page .setting-switch { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; min-height: 52px; margin: 0; padding: var(--space-1h) var(--space-2); border: 0; border-radius: 0; background: none; box-shadow: none; text-align: left; }
.sx-desk .sx-page .setting-switch .switch-label { flex: 1; min-width: 0; }
.sx-desk .sx-page .switch-caption { font: 500 var(--text-13)/1.3 var(--font-ui); color: var(--color-text); }
.sx-desk .sx-page .settings-field:has(> .setting-switch) > .hint { margin: calc(-1 * var(--space-1)) 0 0; padding: 0 var(--space-2) var(--space-1h); }
.sx-desk .sx-page .settings-field:has(> .setting-switch) > .hint:empty { display: none; }
/* (c) a group: heading becomes the section title outside, the rows share one card */
.sx-desk .sx-page .settings-detail > .settings-field:has(> .setting-stack, > .settings-field, > .menu-list) { display: block; padding: 0; min-height: 0; border: 0; background: none; }
.sx-desk .sx-page .settings-detail > .settings-field:has(> .setting-stack, > .settings-field, > .menu-list) > .settings-heading { margin: var(--space-1) 0 var(--space-1); color: var(--color-text-muted); }
.sx-desk .sx-page .setting-stack, .sx-desk .sx-page .settings-field > .settings-field, .sx-desk .sx-page .settings-field > .menu-list { display: block; width: auto; margin: 0; border: 1px solid var(--color-line); border-radius: var(--pg-rad); background: var(--pg-card); overflow: hidden; }
.sx-desk .sx-page .setting-stack > * + * { border-top: 1px solid var(--color-line); }
.sx-desk .sx-page .setting-stack .settings-field { display: block; margin: 0; padding: 0; border: 0; background: none; min-height: 0; }
.sx-desk .sx-page .settings-detail > .settings-field:has(> .setting-stack, > .settings-field, > .menu-list) > * { justify-self: stretch !important; width: auto; }
/* a row field without a visible helper: the label centres against the control */
.sx-desk .sx-page .settings-detail > .settings-field:not(:has(> .hint:not(:empty):not([hidden]))) > .settings-heading { grid-row: 1 / span 2; align-self: center; }
/* (d) menu lists (account, history export, category pages) and connection rows → one card of rows */
.sx-desk .sx-page .sheet-body > .menu-list, .sx-desk .sx-page .settings-detail > .menu-list, .sx-desk .sx-page .sheet-body > .category-list, .sx-desk .sx-page .connections-list { display: block; margin: 0; border: 1px solid var(--color-line); border-radius: var(--pg-rad); background: var(--pg-card); overflow: hidden; }
.sx-desk .sx-page .sheet-body > .menu-list.mt-2 { margin-top: var(--space-3); }
.sx-desk .sx-page .menu-list > .menu-item, .sx-desk .sx-page .category-list > *, .sx-desk .sx-page .connections-list > .menu-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; min-height: 52px; margin: 0; padding: var(--space-1h) var(--space-2); border: 0; border-radius: 0; background: none; box-shadow: none; font: 500 var(--text-13)/1.3 var(--font-ui); text-align: left; }
.sx-desk .sx-page .menu-list > .menu-item + .menu-item, .sx-desk .sx-page .category-list > * + *, .sx-desk .sx-page .connections-list > * + * { border-top: 1px solid var(--color-line); }
.sx-desk .sx-page .menu-list > .menu-item:hover, .sx-desk .sx-page .connections-list > .menu-item:hover, .sx-desk .sx-page .category-list > :hover { background: var(--color-surface-hover); }
.sx-desk .sx-page .menu-item > span:last-child:not(:first-child) { color: var(--color-text-muted); font-weight: 400; }
.sx-desk .sx-page .connections-row-main span { font: 500 var(--text-13)/1.3 var(--font-ui); } .sx-desk .sx-page .connections-row-main small { font-size: var(--text-12); color: var(--color-text-muted); }
.sx-desk .sx-page .connections-row-value { margin-left: auto; font-size: var(--text-12); color: var(--color-text-muted); }
/* History: period pill, summary card, rows card */
.sx-desk .sx-page .history-summary { min-height: 0; margin-top: var(--space-2); padding: var(--space-1h) var(--space-2); border: 1px solid var(--color-line); border-radius: var(--pg-rad); background: var(--pg-card); font-size: var(--text-13); }
.sx-desk .sx-page #history-content .history-row { margin: 0; padding: var(--space-1h) var(--space-2); border: 1px solid var(--color-line); border-bottom-width: 0; background: var(--pg-card); font-size: var(--text-13); }
.sx-desk .sx-page #history-content .menu-group + .history-row { border-radius: var(--pg-rad) var(--pg-rad) 0 0; }
.sx-desk .sx-page #history-content .history-row:last-child { border-bottom-width: 1px; border-radius: 0 0 var(--pg-rad) var(--pg-rad); }
.sx-desk .sx-page #history-content .menu-group + .history-row:last-child { border-radius: var(--pg-rad); }
.sx-desk .sx-page .history-row b { font-variant-numeric: tabular-nums; align-self: center; }

/* ── Modal windows on desktop (sale, revise, cancel, explanations, chart window): plain title, ghost close,
   right-aligned 34 px buttons, centred over a scrim. ── */
.sx-desk .sheet-layer:not(.sx-docked):not(.sx-page) .sheet:not(.drawer) { max-width: 440px; }
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) .sheet-head h2.plaque { flex: 1; display: flex; align-items: center; gap: var(--space-1); padding: 0; border: 0; background: none; box-shadow: none; color: var(--color-accent); font: 400 var(--text-15)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.5px; text-align: left; }
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) .sheet-head h2.plaque::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--color-frame), transparent); }
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) .sheet-head { justify-content: flex-start; min-height: 40px; padding: 0 56px 0 48px; }
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) .sheet-head [data-window-back]:not([hidden]) + h2 { margin-left: 0; }
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) .sheet-head:has([data-window-back][hidden]) { padding-left: var(--space-2); }
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) .sheet-foot { display: flex; justify-content: flex-end; gap: var(--space-1); }
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) .sheet-foot > .btn { width: auto; flex: 0 0 auto; min-width: 96px; }
.sx-desk .sheet .sheet-close { width: 32px; height: 32px; top: 4px; border: 1px solid transparent; background: none; color: var(--color-text-muted); box-shadow: none; }
.sx-desk .sheet .sheet-close:hover { border-color: var(--color-line-strong); color: var(--color-text); }
.sx-desk .sheet-foot .btn, .sx-desk .sheet .btn.primary { min-height: var(--c-workspace-control-desktop); padding-inline: var(--space-2); font: 500 var(--text-13)/1 var(--font-ui); font-variant: normal; letter-spacing: 0; }
.sx-desk .slide.compact .slide-label { font: 500 var(--text-13)/1.2 var(--font-ui); font-variant: normal; letter-spacing: 0; }

/* ── Widths. 64–80 rem (13" laptop with a side tab bar, tablet landscape, portrait monitor): icon rail. ── */
@media (max-width: 79.99rem) {
  .sx-desk { --nav-w: 48px; --tk-w: 296px; --gut: var(--space-2); }
  .sx-desk .desk-link { justify-content: center; padding: 0; }
  .sx-desk .desk-link > span:not(.desk-ic), .sx-desk .desk-group-title, .sx-desk .desk-note, .sx-desk .desk-build { display: none; }
  .sx-desk .desk-group { margin-top: var(--space-1h); padding-top: var(--space-1h); border-top: 1px solid var(--color-line); }
  .sx-desk .market { padding-inline: var(--space-2); }
  .sx-desk .ratio-main { font-size: var(--text-13); }
  .dk-meta .dk-left { display: none; }
  .dk-seg button { padding: 0 6px; }
}
/* r8.1 self-test: sale actions on cards and list rows share the 34 px desktop button face (no inset face). */
.sx-desk .sale-actions .sale-action.btn { min-height: var(--c-workspace-control-desktop); padding-block: 0; }
.sx-desk .sale-actions .sale-action.btn::before { inset: 0; }
/* Wide monitors: the ticket column grows a little; the chart gets more room. */
@media (min-width: 100rem) { .sx-desk { --tk-w: 360px; } }

/* ── r10 · Neil's review of r9 ─────────────────────────────────────────────────────────────────── */
/* Centred dialogs on desktop open and close twice as fast (Neil: the phone timing feels slow with a mouse). */
.sx-desk { --motion-surface-enter: calc(var(--p-duration-surface-enter) / 2); --motion-surface-leave: calc(var(--p-duration-surface-leave) / 2); }
/* A contextual picker over a page («Начало дня»): the page stays visible and inert behind a scrim (DS rule:
   a picker never changes the surface it was opened from); the picker is a centred dialog, not a phone sheet. */
.sx-desk .sheet-layer.sx-page .sheet.drawer.suspended { visibility: visible; }
.sx-desk .sheet-layer.sx-page.sx-over .scrim { display: block; position: fixed; inset: 0; z-index: 1; }
.sx-desk .sheet-layer .sheet.picker { position: fixed; z-index: 2; inset: 0; margin: auto; width: min(360px, calc(100vw - 2 * var(--space-3))); max-width: none; height: fit-content; max-height: calc(100vh - 2 * var(--space-6, 64px)); align-self: auto; justify-self: auto; border: 1px solid var(--color-frame-bright); border-radius: var(--radius-panel); animation: open var(--motion-surface-enter) var(--motion-enter-ease); }
.sx-desk .sheet-layer .sheet.picker.closing { animation: window-close var(--motion-surface-leave) var(--motion-leave-ease) forwards; }
/* Switch rows: the thumb slides; the row, its label and the track never move on press (no press transform). */
.setting-switch, .setting-switch:active, .setting-switch.metal-pressed { transform: none !important; } /* also beats the release rebound (WAAPI scale .985) */
/* Binance connection: wizard actions side by side on desktop, primary on the right (desktop dialog convention). */
.sx-desk .sx-page .connection-wizard-actions { display: flex; flex-direction: row-reverse; justify-content: flex-start; flex-wrap: wrap; gap: var(--space-1); width: auto; }
.sx-desk .sx-page .connection-wizard-actions > .connections-action { width: auto; flex: 0 0 auto; min-width: 140px; }
/* Security page: each section = title outside + one card (its heading is wrapped, so the row grammar misplaced it). */
.sx-desk .sx-page .identity-settings > .settings-field { --sec-title: 32px; display: block; position: relative; isolation: isolate; min-height: 0; padding: var(--sec-title) var(--space-2) var(--space-1h); border: 0; background: none; }
.sx-desk .sx-page .identity-settings > .settings-field::before { content: ""; position: absolute; inset: var(--sec-title) 0 0; z-index: -1; border: 1px solid var(--color-line); border-radius: var(--pg-rad); background: var(--pg-card); }
.sx-desk .sx-page .identity-settings > .settings-field > [data-security-heading], .sx-desk .sx-page .identity-settings > .settings-field > [data-security-key-heading], .sx-desk .sx-page .identity-settings > .settings-field > [data-security-session-heading] { position: absolute; top: 0; left: 0; right: 0; height: var(--sec-title); display: flex; align-items: center; }
.sx-desk .sx-page .identity-settings .settings-heading { margin: 0; font: 500 var(--text-13)/1.3 var(--font-ui); font-variant: normal; letter-spacing: 0; text-transform: none; color: var(--color-text-muted); }
.sx-desk .sx-page .identity-settings .settings-heading i { display: none; }
.sx-desk .sx-page .identity-settings > .settings-field > * { grid-column: auto; grid-row: auto; justify-self: stretch !important; width: auto; text-align: left; } /* beats the row grammar's justify-self:end (Chrome honours it in block layout) */
.sx-desk .sx-page .identity-settings > .settings-field > .hint { margin: var(--space-1) 0 0; }
.sx-desk .sx-page .identity-settings .identity-method, .sx-desk .sx-page .identity-settings .identity-add { min-height: 52px; margin: 0; padding: var(--space-1) 0; border: 0; background: none; box-shadow: none; }
.sx-desk .sx-page .identity-settings .setting-switch { padding-inline: 0; }
.sx-desk .sx-page .identity-settings + .form-error, .sx-desk .sx-page .identity-settings > .form-error { margin-top: var(--space-2); }
/* Chart window: the open-orders list is gone (their prices are drawn on the chart and listed on the cards). */
[data-chart-levels] { display: none; }
/* C3: when some order labels do not fit on the chart, «+N» under it opens these settings and the list is shown */
html[data-chart-hidden] [data-chart-levels] { display: block; }
.dk-readrow { display: flex; align-items: baseline; gap: var(--space-1); min-width: 0; }
.dk-readrow > .dk-readout { flex: 1 1 auto; min-width: 0; }
.dk-readrow > .dk-more { flex: none; min-height: var(--size-touch); margin: 0; padding: 0; font-size: var(--text-12); white-space: nowrap; }
@media (pointer: fine) { .dk-readrow > .dk-more { min-height: 0; } }
/* Market change: the percentage carries the move's colour; the period stays muted. */
#move .dk-chg { font-weight: 500; color: var(--color-text-muted); }
#move .dk-chg.up { color: var(--color-buy-strong); }
#move .dk-chg.down { color: var(--color-sell-strong); }
/* Day budget panel between the ticket and the order book (the app's real control). */
.dk-budget-panel { position: fixed; z-index: 19; }
.dk-budget-panel[hidden], .dk-budget-panel.dk-tight, html:not(.sx-desk) .dk-budget-panel { display: none; }
.dk-budget-panel > .budget { display: grid; width: 100%; min-height: 0; margin: 0; padding: var(--space-1h) var(--space-2); border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-bg-deep); box-shadow: inset 0 0 0 1px var(--color-frame-inner); text-align: left; cursor: pointer; }
.dk-budget-panel > .budget:hover { border-color: var(--color-frame-bright); }
.dk-budget-panel .budget-head { align-items: baseline; font-size: var(--text-12); }
.dk-budget-panel .budget-head b { font-variant-numeric: tabular-nums; }
/* Sign-in on a desktop-wide screen (not signed in yet, so no cabinet shell): full-bleed header bar, the card
   centred in the viewport at the modal width. */
@media (min-width: 64rem) {
  html:not(.sx-desk) body:has(#login:not([hidden])) .app { max-width: none; min-height: 100vh; display: grid; grid-template-rows: auto auto 1fr; padding: 0; }
  html:not(.sx-desk) body:has(#login:not([hidden])) .beta-status { padding-inline: max(var(--space-3), calc((100vw - var(--c-workspace-shell-max)) / 2 + var(--space-3))); }
  html:not(.sx-desk) body:has(#login:not([hidden])) .top { height: var(--c-workspace-top-height); min-height: var(--c-workspace-top-height); margin: 0; padding-inline: max(var(--space-3), calc((100vw - var(--c-workspace-shell-max)) / 2 + var(--space-3))); border-bottom: 1px solid var(--color-frame-inner); background: var(--color-bg-deep); }
  html:not(.sx-desk) body:has(#login:not([hidden])) #login { align-self: center; width: min(420px, calc(100vw - 2 * var(--space-3))); margin: 0 auto var(--space-6, 64px); padding: var(--space-4, 32px) var(--space-3); }
}
/* r28 · the passkey re-check page (/unlock.html, opened after the inactivity lock) uses the same sign-in card:
   beta band, full-bleed header on wide screens, centred 420 px card, seal, key row, «Сменить аккаунт» link. */
.identity-callback #unlock-retry { max-width: var(--identity-content-width); margin: var(--space-2) auto 0; }
.identity-callback #unlock-retry[hidden] { display: none; }
@media (min-width: 64rem) {
  body:has(.identity-callback) .app { max-width: none; min-height: 100vh; display: grid; grid-template-rows: auto auto 1fr; padding: 0; }
  body:has(.identity-callback) .beta-status { padding-inline: max(var(--space-3), calc((100vw - var(--c-workspace-shell-max)) / 2 + var(--space-3))); }
  body:has(.identity-callback) .top { height: var(--c-workspace-top-height); min-height: var(--c-workspace-top-height); margin: 0; padding-inline: max(var(--space-3), calc((100vw - var(--c-workspace-shell-max)) / 2 + var(--space-3))); border-bottom: 1px solid var(--color-frame-inner); background: var(--color-bg-deep); }
  body:has(.identity-callback) main.identity-callback { align-self: center; width: min(420px, calc(100vw - 2 * var(--space-3))); margin: 0 auto var(--space-6, 64px); padding: var(--space-4, 32px) var(--space-3); }
}
/* C6: from 64rem the RU/EN switch sits in the sign-in card's top-right corner (identity-lang.js moves it there), not in
   the far corner of the full-bleed header. Same buttons, compact 28 px faces with 44 px hit areas. */
@media (min-width: 64rem) {
  #login:has(> .identity-language.in-card), main.identity-callback:has(> .identity-language.in-card) { position: relative; }
  .identity-language.in-card { position: absolute; top: calc(var(--space-2) - var(--c-compact-choice-inset) - 1px); right: calc(var(--space-2) - 1px); z-index: 1; } /* visible faces 16 px from the card edge (design-qa) */
}

/* ── r23 item 3 · Edge system (desktop). One reason per edge; see work/desktop-cabinet-20261119/r23-edge-rules.md ──
   container = 1 px frame, 2 px radius, flat · nested group = tonal fill, no edge · divider = line ·
   control/field = line-strong → frame-bright on hover → focus/selected glow · status = fill or badge, never an edge colour ·
   persistent surface = elevation 1 · popover/tooltip = 2 · modal = 3. Side colours only on the primary action. */
.sx-desk {
  --dk-elev-1: 0 1px 3px 0 var(--color-shadow), 0 1px 2px -1px var(--color-shadow);
  --dk-elev-2: 0 4px 6px -1px var(--color-shadow), 0 2px 4px -2px var(--color-shadow);
  --dk-elev-3: 0 20px 25px -5px var(--color-shadow), 0 8px 10px -6px var(--color-shadow);
}
/* Containers: flat, one edge. */
.sx-desk .panel, .sx-desk .dk-book-panel, .sx-desk .sx-docked .sheet, .sx-desk .dk-budget-panel.has-day, .sx-desk .dk-budget-panel > .budget { border: 1px solid var(--color-frame); border-radius: var(--radius-panel); box-shadow: none; }
.sx-desk .dk-budget-panel.has-day > .budget { border: 0; }
/* Persistent while the page scrolls: elevation 1. */
.sx-desk .sx-docked .sheet, .sx-desk .dk-book-panel { box-shadow: var(--dk-elev-1); }
.sx-desk .top::before { border-bottom-color: var(--color-line); box-shadow: var(--dk-elev-1); }
/* Modal / popover / tooltip. */
.sx-desk .sheet-layer:not(.sx-docked) .sheet:not(.drawer) { border-color: var(--color-frame); box-shadow: var(--dk-elev-3); }
.sx-desk .dk-iconbtn::after { border-color: var(--color-frame); box-shadow: var(--dk-elev-2); }
/* Interactive cards: container edge, brighter on hover; status lives in the badge, not the edge. */
.sx-desk .round.panel, .sx-desk .round[data-state] { border-color: var(--color-frame); }
/* r34 (Neil): a card is not a control — no hover on the card itself (DS rule «hover only on what reacts»); its buttons keep theirs. */
.sx-desk .stash:hover { border-color: var(--color-frame-bright); } /* wallet tiles are buttons (they open the explanation): hover kept */
.sx-desk .stash { border-color: var(--color-frame); box-shadow: none; }
/* Nested groups: tonal fill instead of a second edge. */
.sx-desk .quote, .sx-desk .book-col { border: 0; background: var(--color-surface-sunken); }
.sx-desk .quote:hover { background: var(--color-surface-hover); }
.sx-desk .slot, .sx-desk .slot.want { border: 0; box-shadow: none; }
.sx-desk .book-row { border-bottom: 0; }
.sx-desk .book-row.me { outline: 0; background: var(--color-accent-fill); }
.sx-desk .trail i { border: 0; background: var(--color-line-strong); }
.sx-desk .trail i.on { background: var(--color-accent); }
.sx-desk .trail i.done { background: var(--color-buy-solid); }
/* Dividers: one token. */
.sx-desk .sx-docked .sheet-foot, .sx-desk .sx-docked .summary.buy-result { border-top-color: var(--color-line); }
/* Controls: one rest edge, one hover edge, selected = glow edge + accent fill (no second ring). */
.sx-desk .chip, .sx-desk .reward-pick, .sx-desk .sx-docked .seg button { border-color: var(--color-line-strong); border-radius: var(--radius-control); box-shadow: none; }
.sx-desk :is(.chip, .reward-pick, .sx-docked .seg button, .btn.quiet):hover { border-color: var(--color-frame-bright); }
.sx-desk :is(.chip[aria-pressed=true], .sx-docked .seg button[aria-pressed=true], .sx-docked .seg button.on, .sx-docked .seg button[aria-checked=true]) { border-color: var(--color-frame-glow); background: var(--color-accent-fill); box-shadow: none; }
/* Segmented tracks: the track is the control; the selected thumb is a raised fill without its own edge. */
.sx-desk .view-toggle { border-color: var(--color-line-strong); border-radius: var(--radius-control); }
.sx-desk .view-opt { border-radius: 2px; }
.sx-desk :is(.view-opt[aria-pressed=true], .dk-seg button[aria-pressed=true], .sx-page .seg button[aria-pressed=true]) { box-shadow: none; background: var(--color-surface-raised); }
.sx-desk .desk-link[aria-current] { box-shadow: none; }
/* Pills: fill only. */
.sx-desk .account-pill { border: 0; border-radius: var(--radius-round); }
/* Primary action: keeps its side colour edge, flat. */
.sx-desk .btn.buy, .sx-desk .btn.sell, .sx-desk .slide { box-shadow: none; }
/* Fields: rest line-strong, hover frame-bright, focus accent. */
.sx-desk .custom.amount-well { border-color: var(--color-line-strong); }
.sx-desk .custom.amount-well:hover { border-color: var(--color-frame-bright); }
.sx-desk .custom.amount-well:has(> input:focus-visible) { border-color: var(--color-focus); box-shadow: none; }
/* r23 item 4 · text action inside an alert: underlined link look, 44 px hit area, no own edge. */
.reason-action { position: relative; display: inline-flex; align-items: center; min-height: 24px; margin: 0; padding: 0; border: 0; background: none; color: var(--color-accent-strong); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; white-space: nowrap; }
.reason:has(> .reason-action:not([hidden])) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-1); row-gap: var(--space-half); }
.reason > .reason-action { grid-column: 2; justify-self: start; }
/* r4: the reason's text buttons share one row (budget + details), so the reserved slot never grows */
#reason:has(> .reason-acts > .reason-action:not([hidden])), .reason-probe:has(> .reason-acts) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-1); row-gap: var(--space-half); }
.reason > .reason-acts { display: flex; flex-wrap: wrap; column-gap: var(--space-2); row-gap: var(--space-half); }
#reason > .reason-acts, .reason-probe > .reason-acts { grid-column: 2; justify-self: start; }
.reason-acts:not(:has(> .reason-action:not([hidden]))) { display: none; }
p.reason > .reason-acts { display: inline-flex; margin-left: var(--space-1); vertical-align: baseline; }
#revision-more { margin-top: var(--space-half); }
/* r4: error tooltip — what happened / why / what to do, labels quiet, action as a text button (DS .reason-action) */
.tip-err + .tip-err { margin-top: var(--space-1h); padding-top: var(--space-1h); border-top: 1px solid var(--color-line); }
.tip-err-row, .tip-err-what, .tip-err-act { margin: 0 0 var(--space-half); }
.tip-err-what { color: var(--color-text); }
.tip-err-label { display: block; font-size: var(--text-12); color: var(--color-text-muted); letter-spacing: .02em; }
.tip-err-row:first-child { color: var(--color-text); }
.tip-err-act { margin-top: var(--space-1); }
.reason-action::after { content: ""; position: absolute; inset: -10px -6px; }
.reason-action:hover { color: var(--color-text); }
.reason-action:focus-visible { outline: 1px solid var(--color-focus); outline-offset: 2px; border-radius: 2px; }
/* r24 (Neil): a contextual picker / dialog over a settings page keeps its own insets — the page rule
   `.sx-page .sheet-body { padding: 0 }` belongs to the page, never to a window layered on it. */
.sx-desk .sheet-layer .sheet.picker .sheet-body { padding: var(--space-1) var(--space-2) var(--space-2); }
.sx-desk .sheet-layer .sheet.picker .sheet-foot { padding: var(--space-1h) var(--space-2) var(--space-2); }

/* r25 · dust remainder window (all widths). The window owns its 16 px insets (picker rule, r24);
   the body, as parent, owns the 16 px gap between the facts and the explanation. */
.sheet[data-type=dust] .sheet-body { display: flex; flex-direction: column; gap: var(--space-2); }
.sheet[data-type=dust] .explain p { margin: 0; }
.sheet[data-type=dust] .kv span, .sheet[data-type=dust] .kv b { white-space: nowrap; }
.sheet[data-type=dust] .dust-usd { display: block; margin-top: var(--space-half); color: var(--color-text-faint); font-weight: 400; font-size: var(--text-13); font-variant-numeric: tabular-nums; }
.sheet[data-type=dust] .kv b { font-variant-numeric: tabular-nums; }
.sheet[data-type=dust] .btn-row > .btn, .sheet[data-type=quick-confirm] .btn-row > .btn { white-space: nowrap; } /* r27: «Включить и поставить» wrapped to two lines */

/* r26 (Neil): a dialog over the trading page is an overlay on a separate layer; the docked ticket and the
   book stay visible and keep updating under the scrim (inert while the dialog is open). */
.sx-desk .sheet-layer.sx-docked.sx-dock-under .sheet.suspended { visibility: visible; transform: none; animation: none; }
.sx-desk .sheet-layer.sx-overlay { z-index: 30; }

/* r26 (Neil): in the connection wizard window the actions stand side by side when they fit (primary on the right);
   they were stacked because the primary took a full row (flex-basis 100%). */
.sx-desk .connection-wizard-actions { flex-direction: row-reverse; justify-content: flex-start; flex-wrap: wrap; }
.sx-desk .connection-wizard-actions > .btn, .sx-desk .connection-wizard-actions > .tertiary { flex: 0 0 auto; width: auto; min-width: 140px; white-space: nowrap; }

/* ── r27 (Neil 2026-11-24) ── */
/* item 1 · One window title (variant A, the ticket head): no gold plaque anywhere; small caps, accent, fading rule. */
.sheet-layer:not(.sx-page):not(.sx-docked) .sheet .sheet-head { justify-content: flex-start; padding: 0 calc(var(--size-touch) + var(--space-1h)) 0 var(--space-2); }
.sheet-layer:not(.sx-page):not(.sx-docked) .sheet .sheet-head:has([data-window-back]:not([hidden])) { padding-left: calc(var(--size-touch) + var(--space-1h)); }
.sheet-layer:not(.sx-page):not(.sx-docked) .sheet .sheet-head h2.plaque { flex: 1; display: flex; align-items: center; gap: var(--space-1); min-width: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--color-accent); font: 400 var(--text-15)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.5px; text-align: left; }
.sheet-layer:not(.sx-page):not(.sx-docked) .sheet .sheet-head h2.plaque::before { display: none; }
.sheet-layer:not(.sx-page):not(.sx-docked) .sheet .sheet-head h2.plaque::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--color-frame), transparent); }
/* item 2 · «Когда купить» is a mode switch, not chips: full-width segmented track, icons, dividers, a hint under it. */
.mode-zone { display: grid; gap: var(--space-1); margin: var(--space-1) 0; padding: var(--space-1h) 0; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.mode-zone .mode-hint { margin: 0; }
.sheet .mode-zone .seg.mode-switch, .sx-desk .sx-docked .mode-zone .seg.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 100%; padding: 2px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-bg-deep); overflow: visible; }
.sheet .mode-zone .seg.mode-switch button, .sx-desk .sx-docked .mode-zone .seg.mode-switch button { display: flex; align-items: center; justify-content: center; gap: var(--space-1); min-width: 0; min-height: 32px; padding: 0 var(--space-1); border: 0; border-radius: 2px; background: none; box-shadow: none; color: var(--color-text-muted); font: 500 var(--text-13)/1 var(--font-ui); font-variant: normal; letter-spacing: 0; white-space: nowrap; }
.sheet .mode-zone .seg.mode-switch button + button { box-shadow: inset 1px 0 0 var(--color-line); }
.sheet .mode-zone .seg.mode-switch button[aria-pressed=true], .sx-desk .sx-docked .mode-zone .seg.mode-switch button[aria-pressed=true] { background: var(--color-surface-raised); color: var(--color-accent-strong); box-shadow: inset 0 0 0 1px var(--color-frame); }
.mode-zone .seg.mode-switch .i { width: 16px; height: 16px; flex: none; }
@media (pointer: coarse) { .sheet .mode-zone .seg.mode-switch button { min-height: var(--size-touch); } }
/* items 3–4 · icon buttons on the right of a panel head (ticket, order book). */
.dk-head-tools { display: inline-flex; gap: var(--space-half); margin-left: var(--space-1); flex: none; }
.dk-icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-control); background: none; color: var(--color-text-muted); cursor: pointer; }
.dk-icon-btn:hover { color: var(--color-text); border-color: var(--color-line-strong); }
.dk-icon-btn:focus-visible { outline: 1px solid var(--color-focus); outline-offset: 1px; }
.dk-icon-btn .i { width: 16px; height: 16px; }
.dk-icon-btn::before { content: ""; position: absolute; inset: -8px; }
.dk-icon-btn { position: relative; }
.sx-desk .sx-docked .sheet.dk-collapsed:not(.dk-folding) > :not(.sheet-head) { display: none; } /* r29: kept while folding */
.sx-desk .sx-docked .sheet.dk-collapsed { padding-bottom: var(--space-1h); }
.dk-panel-head { align-items: center; }
.dk-panel-head h2 { flex: 1; display: flex; align-items: center; gap: var(--space-1); }
.dk-panel-head h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--color-frame), transparent); }
/* item 4 · book view (both / sellers / buyers) and layout (side by side / stacked, each side scrolls itself). */
.dk-book-panel[data-view=asks] .book-col.bids, .dk-book-panel[data-view=bids] .book-col.asks { display: none; }
.dk-book-panel:not([data-view=both]) .dk-book-host .book, .dk-book-panel[data-layout=stack] .dk-book-host .book { grid-template-columns: 1fr; }
.dk-book-panel[data-layout=stack] .dk-book-host { overflow: hidden; }
.dk-book-panel[data-layout=stack] .book-col { max-height: var(--bk-col-max, 240px); overflow: auto; scrollbar-width: thin; }
.dk-book-panel[data-layout=stack] .book-col.asks { display: flex; flex-direction: column-reverse; }
.dk-book-panel[data-layout=stack] .book-col.asks > * { flex-shrink: 0; } /* r27 check: rows kept their 24 px, the side scrolls instead */
.dk-book-panel[data-layout=stack] .book-col.asks h3 { order: 1; }
.dk-book-panel[data-layout=stack] .book-col { padding-top: 0; }
.dk-book-panel[data-layout=stack] .book-col h3 { position: sticky; top: 0; z-index: 1; margin: 0; padding: 6px 6px 4px; background: var(--color-surface-sunken); } /* r27 check: no row shows above the sticky label */
/* settings dialogs */
.tk-settings .tk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1h); }
.tk-settings .hint.error { color: var(--color-danger); }

/* r27 item 5 · hold-to-place divider on the desktop order book (Neil 2026-11-24). */
.qp-line { position: absolute; z-index: 3; height: 2px; margin-top: -1px; pointer-events: none; background: var(--color-line-strong); }
.qp-line .qp-fill { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); background: var(--color-accent); }
.qp-line[data-side=sell] .qp-fill { background: var(--color-sell); }
.qp-line.qp-hold .qp-fill { transform: scaleX(1); transition: transform 1000ms linear; }
.qp-line.qp-full .qp-fill { box-shadow: 0 0 6px var(--color-accent); }
.qp-line .qp-price { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 1px 6px; border: 1px solid var(--color-frame); border-radius: 3px; background: var(--color-bg-deep); color: var(--color-text); font: 500 var(--text-11)/1.3 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity 120ms; }
.qp-line.qp-hold .qp-price { opacity: 1; }
.dk-book-host .book-col .book-row[data-price] { cursor: ns-resize; }
/* keyboard path: the book host is one tab stop; the price label stays visible while it has keyboard focus */
.dk-book-host:focus { outline: none; }
.dk-book-host:focus-visible { outline: 1px solid var(--color-frame-glow); outline-offset: -1px; }
.qp-line.qp-kbd .qp-price { opacity: 1; }
.qp-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── r28 item 1 · «Ваши сделки» head reads as the head of its content (Neil 2026-11-24): the same panel-head grammar as
   «Стакан заявок» — a fading rule after the title, one 1 px line under the whole row, 16 px to the cards or the list. */
.rounds > .section-head { gap: var(--space-1); padding-bottom: var(--space-1); border-bottom: 1px solid var(--color-line); margin-bottom: var(--space-2); }
.rounds > .section-head > h2 { flex: 1; min-width: 0; white-space: nowrap; display: flex; align-items: center; gap: var(--space-1); }
.rounds > .section-head > h2::after { content: ""; flex: 1; max-width: none; min-width: 0; height: 1px; background: linear-gradient(90deg, var(--color-frame), transparent); }
.rounds > .section-head + * { margin-top: 0; }

/* ── r28 item 4 · order book: pointer cursor, the DS scrollbar, the hold fill grows from the price label (Neil 2026-11-24). */
/* Cursor: a pointer, not ↕ (the divider is a target, not a resize handle). */
.dk-book-host .book-col .book-row[data-price] { cursor: pointer; }
/* Scrollbar: the admin one (log feed + users/requests tables, Admin r3). Cause of the light bar: `scrollbar-width: thin`
   on these scrollers makes Chrome ignore ::-webkit-scrollbar, and app.css resets scrollbar-color to auto. */
:is(.dk-book-host, .dk-book-panel .book-col) { scrollbar-color: var(--color-frame-bright) var(--color-bg-deep); }
:is(.dk-book-host, .dk-book-panel .book-col)::-webkit-scrollbar { width: 8px; height: 8px; }
:is(.dk-book-host, .dk-book-panel .book-col)::-webkit-scrollbar-track { background: var(--color-bg-deep); }
:is(.dk-book-host, .dk-book-panel .book-col)::-webkit-scrollbar-thumb { background: var(--color-frame-bright); border: 2px solid var(--color-bg-deep); border-radius: var(--radius-control); }
/* Hold fill (timeline, trigger = press on a divider or Enter on the focused book):
   label   opacity 0 → 1            0 ms, 120 ms ease-out (the r27 rule above)
   frame   stroke 0 → full          0 ms, --qp-f linear   (round the label, from its top/bottom centre to its sides)
   line    stroke 0 → full          --qp-f, --qp-o linear (from the label's sides out to the column edges); --qp-f + --qp-o = 1000 ms
   full    glow on                  at 1000 ms, 120 ms ease-out — release now places
   cancel  everything back at once (release early, Escape, scroll, leaving the book). */
.qp-line { --qp-c: var(--color-accent); }
.qp-line[data-side=sell] { --qp-c: var(--color-sell); }
.qp-line .qp-price { z-index: 1; }
.qp-trace { position: absolute; left: 0; z-index: 2; overflow: visible; pointer-events: none; transition: filter 120ms ease-out; }
.qp-trace path { fill: none; stroke: var(--qp-c); stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.qp-trace .qp-f { stroke-width: 1; }
.qp-trace .qp-o { stroke-width: 2; }
.qp-line.qp-hold .qp-f { stroke-dashoffset: 0; transition: stroke-dashoffset var(--qp-f, 300ms) linear; }
.qp-line.qp-hold .qp-o { stroke-dashoffset: 0; transition: stroke-dashoffset var(--qp-o, 700ms) linear var(--qp-f, 300ms); }
.qp-line.qp-full .qp-trace { filter: drop-shadow(0 0 3px var(--qp-c)); }
@media (prefers-reduced-motion: reduce) {
  .qp-trace path, .qp-line.qp-hold .qp-trace path { stroke-dashoffset: 0; transition: none; }
  /* app.css switches every animation and transition off here, so the hold shows two still states instead of a sweep:
     held = the whole trace dim, full (release now places) = the trace bright. */
  .qp-trace { opacity: 0; }
  .qp-line.qp-hold .qp-trace { opacity: .35; }
  .qp-line.qp-full .qp-trace { opacity: 1; filter: none; }
}
/* r28 B - hold release (Neil 2026-11-24): the trace retracts in reverse (divider, then round the label's frame to its
   top/bottom centre), driven by layer.js: one ease-in, 225 ms x progress. The label stays lit until it is gone; the glow
   drops at once. Reduced motion: no retract (instant). */
.qp-line.qp-back .qp-price { opacity: 1; }

/* ── r29 (Neil 2026-11-24) ── */
/* item 1 · chart view: crosshair over the plot, vertical-resize on the price axis, a grabbing hand while dragging.
   No text selection while dragging; the page still scrolls vertically on touch. */
.sx-desk .chart { user-select: none; -webkit-user-select: none; }
.sx-desk .chart[data-zone=axis] { cursor: ns-resize; }
.sx-desk .chart.dk-grabbing { cursor: grabbing; }
.sx-desk .chart.dk-grabbing[data-zone=axis] { cursor: ns-resize; }
/* item 3 · expanded chart: the same panel over a scrim, inset from the viewport edges; the chart row takes the rest.
   Inside .app: scrim 24, panel 25 (over the sticky header 15 and the sidebar 21). */
html.dk-chart-full { overflow: hidden; scrollbar-gutter: stable; }
/* .app is its own stacking context (z 1): while expanded it rises over the docked ticket / book (body, 19–20). */
html.dk-chart-full .app { z-index: 25; }
.dk-full-scrim { position: fixed; inset: 0; z-index: 24; background: var(--color-scrim); animation: fade var(--motion-ui) var(--motion-ease); }
.market.dk-full { --dk-full-m: var(--space-2); position: fixed; z-index: 25; inset: var(--dk-full-m); margin: 0; grid-template-rows: auto auto auto minmax(0, 1fr) auto; align-content: stretch; box-shadow: inset 0 0 0 3px var(--color-surface-sunken), inset 0 0 0 4px var(--color-frame-inner), inset 0 0 40px var(--color-bg-deep), var(--dk-elev-3); }
.market.dk-full .chart { height: auto; min-height: 96px; }
@media (max-height: 760px), (max-width: 1279px) { .market.dk-full { --dk-full-m: var(--space-1); } }
.dk-full-ph { pointer-events: none; }
/* item 4 · «Новая покупка» fold: while the height animates the body keeps its size and is clipped by the sheet. */
.sx-desk .sx-docked .sheet.dk-folding { overflow: hidden; }
.sx-desk .sx-docked .sheet.dk-folding > * { flex-shrink: 0; }

/* ── r31 (Neil 2026-11-24): «Развернуть график» at every width ──
   The 1024 px desktop breakpoint stays. Below it the app keeps its own small chart; the expand button sits in the market
   head next to the pin (same 44 px face as the pin), and the expanded panel is the same layer as on the desktop: the r5
   chart with candles, volume, crosshair and readout, the period switch and chart settings. Crossing 1024 px while
   expanded keeps it expanded (layer.js keeps the tools box at every width). */
:root:not(.sx-desk):not(.dk-chart-full) :is(.dk-chart-svg, .dk-readout) { display: none; }
:root:not(.sx-desk) .dk-market-tools { display: contents; }
:root:not(.sx-desk) .market-head { gap: var(--space-1); }
:root:not(.sx-desk) .market-head > h2 { margin-right: auto; min-width: 0; }
:root:not(.sx-desk):not(.dk-chart-full) .dk-market-tools :is(.dk-seg, .dk-stale, [data-dk-chart]) { display: none; }
:root:not(.sx-desk) .dk-iconbtn { --face: var(--size-touch); flex: none; } /* never shrinks under a long «N s ago» */
:root:not(.sx-desk) .dk-iconbtn::before { border-color: var(--color-line); background: none; }
:root:not(.sx-desk) .market-head .r30-pin { margin-left: 0; }
/* the expanded panel below 1024 px: a column (the phone .market is a block), the chart takes the rest */
:root:not(.sx-desk) .market.dk-full { display: flex; flex-direction: column; padding: var(--space-2); overflow: hidden; }
:root:not(.sx-desk) .market.dk-full .chart { flex: 1 1 0; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.market.dk-full .chart { touch-action: none; }
:root:not(.sx-desk) .market.dk-full .market-head { flex-wrap: wrap; height: auto; min-height: var(--size-touch); row-gap: var(--space-1); }
:root:not(.sx-desk) .market.dk-full #market-age { display: none; }
:root:not(.sx-desk) .market.dk-full .dk-readout { white-space: normal; min-height: 3em; }
/* phones: the period switch takes its own full-width row under the title (touch-size segments) */
@media (max-width: 47.99rem) {
  :root:not(.sx-desk) .market.dk-full .dk-seg { order: 9; flex: 1 0 100%; }
  :root:not(.sx-desk) .market.dk-full .dk-seg button { flex: 1; }
}
/* the period segments line up with the 44 px buttons beside them (design-qa m2) */
:root:not(.sx-desk) .market.dk-full .dk-seg button { min-height: var(--size-touch); }
/* short landscape phones: the chart keeps the height, the quotes and the pressure bar yield */
@media (max-height: 600px) { :root:not(.sx-desk) .market.dk-full :is(.quotes, .pressure) { display: none; } } /* design-qa M3: 960×540 too */
/* 320 px: title and «3 s ago» stay on one line beside the two 44 px buttons (the title truncates last) */
:root:not(.sx-desk) .market-head > h2 { white-space: nowrap; overflow: hidden; }
:root:not(.sx-desk) .market-head > h2 > span { overflow: hidden; text-overflow: ellipsis; }
:root:not(.sx-desk) .market-head #market-age { white-space: nowrap; flex: none; }
@media (max-width: 22.49rem) { :root:not(.sx-desk) .market-head { gap: var(--space-half); } }
/* short landscape phones (layout above): the sticky market column must still become the fixed layer when expanded */
html.dk-chart-full #main > .market.dk-full { position: fixed; inset: var(--dk-full-m); margin: 0; }
/* below 1024 px windows (chart settings, explanations) open over the expanded chart: the phone sheet layer is z 20 */
html.dk-chart-full:not(.sx-desk) .sheet-layer { z-index: 30; }
/* r31 review fixes (design-qa) */
/* B1 · the expanded panel clears the notch, status bar and home indicator (viewport-fit=cover) */
.market.dk-full, html.dk-chart-full #main > .market.dk-full { inset: max(var(--dk-full-m), var(--safe-area-top)) max(var(--dk-full-m), env(safe-area-inset-right, 0px)) max(var(--dk-full-m), var(--safe-area-bottom)) max(var(--dk-full-m), env(safe-area-inset-left, 0px)); }
/* M4 · below 1024 px the market head is as tall as its 44 px buttons (they no longer spill over the panel frame) */
:root:not(.sx-desk) .market-head { height: var(--size-touch); }
/* M1 · on phones a tip opens to the left of its button, over the title row, never over the price or the period row below;
   from 48rem the period switch shares the head row on the left, so the tip stays below the button */
@media (max-width: 47.99rem) { :root:not(.sx-desk) .dk-iconbtn::after { top: 50%; right: calc(100% - (var(--hit) - var(--face)) / 2 + var(--space-half)); transform: translateY(-50%); } }
/* m1 · the pin is about the pair, not the chart: hidden while the chart is expanded, so chart settings hold the corner */
.market.dk-full .r30-pin { display: none; }
/* m3 · readout: a label never wraps away from its value (pairs break between each other) */
.dk-rp { white-space: nowrap; }

/* r32 item 1 (Neil 2026-11-26): the expanded chart on the desktop uses its width. The quote cards stand to the right
   of the price/change block; the pressure bar rises into the head row, left of the chart tools — the panel's top
   loses one row and the chart gains it. Docked panel, phones and tablets keep the r31 layout. While collapsing
   (.dk-full-leaving) the docked arrangement is back, so the cards travel home together with the panel (layer.js). */
.sx-desk .market.dk-full:not(.dk-full-leaving) { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: var(--size-touch) auto minmax(0, 1fr) auto; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .market-head { display: contents; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .market-head > .eyebrow { grid-row: 1; grid-column: 1; align-self: center; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .market-head > .dk-market-tools { grid-row: 1; grid-column: 3; justify-self: end; align-self: center; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .pressure { grid-row: 1; grid-column: 2; justify-self: end; align-self: center; margin-top: 0; grid-template-columns: auto clamp(48px, 7vw, 128px) auto; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .r30-cardrow { grid-row: 2; grid-column: 1; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .quotes { grid-row: 2; grid-column: 2; justify-self: start; align-self: center; margin-top: 0; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .chart { grid-row: 3; }
.sx-desk .market.dk-full:not(.dk-full-leaving) > .dk-readout { grid-row: 4; }
/* r32 review M2: the change line keeps its width across refreshes (span label, price digits), so the quote cards
   beside it never shift sideways. */
.sx-desk .market.dk-full:not(.dk-full-leaving) :is(#price, #move) { font-variant-numeric: tabular-nums; }
.sx-desk .market.dk-full:not(.dk-full-leaving) .price-meta { min-width: 18ch; }
/* travelling cards: above the chart, below the head tools' tips */
.market .dk-moving { position: relative; z-index: 2; will-change: transform; }

/* r34 (Neil): the «Бета · тренировка · виртуальные средства» label is retired at every width (the account pill says
   Демо/real, the sidebar foot says the build). The strip keeps only «Выйти» where a phone still needs it. */
#beta-status { display: none; }
.beta-status:not(:has(#beta-logout:not([hidden]))) { min-height: 0; height: 0; overflow: hidden; padding-block: 0; }
.desk-build { margin: 0; padding: 0 var(--space-1h); display: grid; gap: 2px; font: 400 var(--text-11)/1.4 var(--font-ui); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.desk-build dt, .desk-build dd { margin: 0; }
.desk-build b { font-weight: 500; color: var(--color-text-soft, var(--color-text-muted)); }
.desk-legal { display: flex; flex-wrap: wrap; gap: 0 var(--space-1h); }
.desk-legal a { display: inline-flex; align-items: center; min-height: 32px; color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.desk-legal a:hover { color: var(--color-text); }
.desk-legal a:focus-visible { outline: 1px solid var(--color-focus, currentColor); outline-offset: 2px; }

/* r35 (Neil, 2026-11-28): «Остаток» — one quiet full-width line under the trades (approved r34-remainder/v3, no «i»).
   32 px visual row, 44 px hit area, 12 px muted text on one line at every width; hairline meter 24–96 px to the
   Binance minimum. The same row in tile and list view (it sits outside the card grid). Container query drops the
   «· ниже минимума продажи» tail below 480 px; the tooltip carries every fact. Hover is allowed: the row reacts. */
.rounds { container-type: inline-size; }
.remainder { all: unset; box-sizing: border-box; position: relative; z-index: 1; display: flex; align-items: center; gap: var(--space-1); width: 100%; height: 32px; margin: var(--space-1) 0; padding: 0 var(--space-1) 0 12px; border: 1px solid var(--color-line); border-radius: var(--radius-control); cursor: pointer; font: 400 var(--text-12)/1 var(--font-ui); color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; transition: border-color var(--motion-ui, 140ms) ease, background-color var(--motion-ui, 140ms) ease; }
.remainder[hidden] { display: none; }
.remainder::before { content: ""; position: absolute; inset: -7px -1px; } /* from the padding box: 30 + 14 = 44 px tall, 1 px border included */
.remainder:hover, .remainder[aria-describedby~="sx-explanation"] { border-color: var(--color-line-strong); background: var(--color-surface-sunken); }
.remainder:focus-visible { outline: 1px solid var(--color-frame-bright); outline-offset: 2px; }
.remainder .rem-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.remainder .rem-extra { color: var(--color-text-faint); }
.remainder .rem-meter { flex: 1 1 40px; min-width: 24px; max-width: 96px; height: 2px; background: var(--color-line); position: relative; }
.remainder .rem-meter i { position: absolute; inset: 0 auto 0 0; background: var(--color-text-muted); }
@container (max-width: 480px) { .remainder .rem-extra { display: none; } }
.tip.tip-facts .tip-body { text-align: left; font-size: var(--text-12); line-height: 1.5; }
.tip.tip-facts .tip-body p { margin: 0; }
.tip-kv { display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 2px var(--space-1h); margin: var(--space-1) 0; }
.tip-kv b { color: var(--color-text); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

/* r36 (Neil, 2026-11-28, preview A «Страницы»): every explanation is one quiet panel — no plaque, 2 px gold top edge.
   Registry terms are dotted accent links with their own 14 px icon; a term opens as a page inside the same panel,
   with ← and a clickable path. The panel never reacts to hover itself; only its links and buttons do. */
.tip { width: min(340px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--color-line-strong); border-top: 2px solid var(--color-accent); background: var(--color-bg-deep);
  box-shadow: 0 12px 32px var(--color-shadow); color: var(--color-text-muted); font-size: var(--text-13); line-height: 1.5; outline: none; }
.tip .tip-head { display: flex; align-items: center; gap: var(--space-1); padding: 10px var(--space-1h) 0; background: none; text-align: left;
  color: var(--color-text); font: 600 var(--text-14)/1.3 var(--font-ui); font-variant: normal; letter-spacing: 0; }
.tip .tip-body, .tip.tip-facts .tip-body { padding: 6px var(--space-1h) var(--space-1h); text-align: left; font-size: var(--text-13); line-height: 1.5; color: var(--color-text-muted); }
.tip .tip-body p { margin: 0 0 var(--space-1); }
.tip .tip-body p:last-child { margin-bottom: 0; }
.tip .ti { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tip .ti-head { width: 16px; height: 16px; color: var(--color-accent); }
.tip-nav { display: flex; align-items: center; gap: 2px; min-height: 36px; padding: 4px var(--space-1h) 0 6px; }
.tip-nav + .tip-page .tip-head { padding-top: 2px; }
.tip-back { all: unset; position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-control); color: var(--color-text); cursor: pointer; }
.tip-back::before { content: ''; position: absolute; inset: -8px; } /* 44 px hit area around the 28 px face */
.tip-back .ti { width: 16px; height: 16px; }
.tip-back:hover { background: var(--color-surface-hover); }
.tip-path { display: flex; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: var(--text-11); color: var(--color-text-faint); }
.tip-path::-webkit-scrollbar { display: none; }
.tip-path button { all: unset; flex: none; padding: 6px 2px; cursor: pointer; }
.tip .tip-head:focus { outline: none; }
.tip .tip-head:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.tip-path button:hover { color: var(--color-text-muted); }
.tip-sep, .tip-gap { flex: none; padding: 0 3px; }
.tip .term { all: unset; display: inline; white-space: nowrap; color: var(--color-accent-strong); cursor: pointer;
  text-decoration: underline dotted 1px; text-underline-offset: 3px; }
.tip .term .ti { margin-right: 3px; vertical-align: -2px; }
.tip .term:hover { text-decoration-style: solid; }
.tip-back:focus-visible, .tip-path button:focus-visible, .tip .term:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: 2px; }
.tip-page.in-fwd { animation: tip-page-fwd var(--motion-rebound) var(--motion-ease) both; }
.tip-page.in-back { animation: tip-page-back var(--motion-rebound) var(--motion-ease) both; }
@keyframes tip-page-fwd { from { opacity: 0; transform: translateX(12px); } }
@keyframes tip-page-back { from { opacity: 0; transform: translateX(-12px); } }
@media (prefers-reduced-motion: reduce) { .tip, .tip-page.in-fwd, .tip-page.in-back { animation: none; } }
/* r36 design-qa M3 + GPT review #3: on touch, ← and path steps are real 44 px boxes in their own row space (no
   overlapping pseudo areas); inline terms keep inline faces (WCAG 2.5.8 inline exception) with looser lines and a
   small vertical extension that cannot reach the next line. */
@media (pointer: coarse) {
  .tip-nav { min-height: 44px; padding-top: 0; }
  .tip-back { width: 44px; height: 44px; margin-left: -6px; }
  .tip-back::before { content: none; }
  .tip-path { font-size: var(--text-13); }
  .tip-path button { padding: 12px 4px; }
  .tip .tip-body { line-height: 1.75; }
  .tip .term { position: relative; }
  .tip .term::before { content: ''; position: absolute; inset: -4px -1px; }
}
.tip-path.cut { -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px); mask-image: linear-gradient(90deg, transparent, #000 24px); } /* a path longer than the panel fades at its start */

/* r37 · responsive review fixes */
/* 320 px tiles: the 44 px slot cannot hold «9 000 sat» / «+0,0158»; the stack label centres under the coin, 10 px, never cut. */
@media (max-width: 359px) {
  .round:not([data-state=selling]) .slot .stack { left: 50%; right: auto; top: auto; bottom: -1px; transform: translateX(-50%); max-width: none; overflow: visible; font-size: var(--text-11); }
}
/* Narrow desktop list (1024 px: ticket + sidebar leave ~600 px): the amount is never cut, the status takes two lines, the sell slide shortens. */
@container (max-width: 760px) {
  .sx-desk .view-list .round { grid-template-columns: 6.5rem minmax(min-content, 1fr) minmax(0, 1.2fr) auto; }
  .sx-desk .view-list .round .status { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-height: 1.2; }
  .sx-desk .view-list .round .card-sell .slide { flex-basis: 10rem; }
}
