/* Scalp Exchange components. Only semantic (--color-*, --space-*, ...) and
   component (--c-*) tokens from tokens.css; no raw colours here
   (enforced by test/test_tokens.cjs). References: PoE2 inventory and currency
   exchange, Dark Souls equipment — desaturated stone and bronze, gold title
   plaques, colour reserved for "magic": gems, results, the account seal. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--color-bg-deep); }
body {
  margin: 0; min-height: 100dvh; color: var(--color-text); font: var(--text-15)/1.45 var(--font-ui);
  background:
    radial-gradient(ellipse 140% 70% at 50% 0%, var(--color-surface) 0%, transparent 70%),
    radial-gradient(ellipse 120% 60% at 50% 100%, var(--color-accent-fill), transparent 75%),
    var(--color-bg-deep);
  background-attachment: fixed;
}
/* Grain: fractal noise, no colour of its own (stone texture, like the references). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("/beta-noise.svg");
}
button, input { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
[hidden] { display: none !important; }
b, .num, output { font-variant-numeric: tabular-nums; }
.muted { color: var(--color-text-muted); }
.center { text-align: center; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 16px; height: 16px; flex: none; }
.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 0 var(--space-page); padding-bottom: calc(var(--c-dock-height) + var(--safe-area-bottom) + var(--space-2)); }

/* ---------- frame: dark stone, double bronze hairline, corner ornaments ---------- */
.panel {
  position: relative; border: 1px solid var(--color-frame); border-radius: var(--radius-panel);
  background: linear-gradient(180deg, var(--color-surface-raised), var(--color-surface) 30%, var(--color-surface-sunken));
  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), 0 6px 20px var(--color-shadow);
}
.panel::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: inherit;
  --k: 10px; --w: 1px; --g: linear-gradient(var(--color-frame-bright), var(--color-frame-bright));
  background:
    var(--g) top left / var(--k) var(--w) no-repeat, var(--g) top left / var(--w) var(--k) no-repeat,
    var(--g) top right / var(--k) var(--w) no-repeat, var(--g) top right / var(--w) var(--k) no-repeat,
    var(--g) bottom left / var(--k) var(--w) no-repeat, var(--g) bottom left / var(--w) var(--k) no-repeat,
    var(--g) bottom right / var(--k) var(--w) no-repeat, var(--g) bottom right / var(--w) var(--k) no-repeat;
}
/* Engraved section title with fading bronze rules and a diamond at the end. */
.banner {
  display: flex; align-items: center; justify-content: center; gap: var(--space-1h); margin: 0;
  font: 400 var(--text-20)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 2px; color: var(--color-accent);
  text-shadow: 0 1px 0 var(--color-bg-deep);
}
.banner::before, .banner::after { content: ""; flex: 1; max-width: 80px; height: 1px; background: linear-gradient(90deg, transparent, var(--color-frame-bright)); }
.banner::after { background: linear-gradient(270deg, transparent, var(--color-frame-bright)); }
.banner.small { font-size: var(--text-18); justify-content: flex-start; }
.banner.small::before { display: none; }
/* Gold plaque with dark ink (PoE "Inventory" title). */
.plaque { display: inline-block; padding: 3px var(--space-3) 4px; border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: linear-gradient(180deg, var(--color-plaque-top), var(--color-plaque-bottom)); color: var(--color-plaque-ink); font: 600 var(--text-16)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.5px; box-shadow: 0 0 0 2px var(--color-bg-deep), 0 0 0 3px var(--color-frame), 0 3px 8px var(--color-shadow); }
.eyebrow { display: flex; align-items: center; gap: var(--space-half); margin: 0; font: 400 var(--text-14)/1 var(--font-display); font-variant: small-caps; letter-spacing: 1.4px; color: var(--color-accent); }
.rule { height: 1px; margin: var(--space-1h) 0; border: 0; background: linear-gradient(90deg, transparent, var(--color-frame-bright), transparent); }

/* ---------- gems in sockets (currency) ---------- */
.gem { --orb-size: var(--c-orb-size); width: var(--orb-size); height: var(--orb-size); flex: none; }
.gem-sm { --orb-size: 26px; }
.gem-xs { --orb-size: var(--c-orb-size-sm); }
.gem.lit { animation: lit var(--motion-ambient) ease-in-out infinite alternate; }
@keyframes lit { from { filter: drop-shadow(0 0 0 transparent); } to { filter: drop-shadow(0 0 4px var(--color-gem-btc)); } }
.gem.usdc.lit { animation-name: lit-usdc; }
@keyframes lit-usdc { from { filter: drop-shadow(0 0 0 transparent); } to { filter: drop-shadow(0 0 4px var(--color-gem-usdc)); } }

/* ---------- header (sticky: covers the status bar in home-screen mode) ---------- */
.top {
  position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-1);
  min-height: calc(var(--c-header-height) + var(--safe-area-top) + var(--c-header-content-gap)); padding-top: calc(var(--safe-area-top) + var(--c-header-content-gap));
  margin: 0 calc(-1 * var(--space-page)); padding-left: var(--space-page); padding-right: var(--space-page);
  background: var(--color-bg-deep); border-bottom: 1px solid var(--color-frame-inner);
}
.top + * { margin-top: var(--space-1); }
.top > * { min-width: 0; }
.brand { display: flex; align-items: center; gap: var(--space-1); font-family: var(--font-display); }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--color-frame-bright); border-radius: var(--radius-panel); color: var(--color-accent); font-size: var(--text-16); background: var(--color-surface-sunken); box-shadow: inset 0 0 0 2px var(--color-bg-deep); }
.brand-name { font-size: var(--text-18); font-variant: small-caps; letter-spacing: 3px; color: var(--color-accent); }
.account-pill { justify-self: start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: var(--size-touch); padding: 0 var(--space-1h); border-radius: var(--radius-panel); border: 1px solid var(--color-frame); background: var(--color-surface-sunken); font: 400 var(--text-14)/1 var(--font-display); font-variant: small-caps; letter-spacing: 1px; white-space: nowrap; overflow: hidden; }
.account-pill span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.account-dot { width: 9px; height: 9px; transform: rotate(45deg); flex: none; background: currentColor; box-shadow: 0 0 6px currentColor; }
.caret { opacity: .7; font-size: var(--text-11); }
body[data-account=practice] .account-pill { color: var(--color-practice); border-color: var(--color-practice-edge); }
body[data-account=real] .account-pill { color: var(--color-real); border-color: var(--color-real-edge); }
.conn { display: grid; place-items: center; width: var(--size-touch); height: var(--size-touch); padding: 0; border: 0; background: none; }
.conn .dot { width: 8px; height: 8px; transform: rotate(45deg); background: var(--color-text-faint); }
.conn.ok .dot { background: var(--color-buy); }
.conn.warn .dot { background: var(--color-accent); }
.conn.bad .dot { background: var(--color-danger); animation: blink 1s steps(2) infinite; }
.conn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes blink { 50% { opacity: .35; } }
.icon-btn { display: grid; place-items: center; width: var(--size-touch); height: var(--size-touch); border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-surface-sunken); color: var(--color-accent); box-shadow: inset 0 0 0 2px var(--color-bg-deep); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; }

/* ---------- choose / login ---------- */
.choose, .login { margin-top: var(--space-3); padding: var(--space-3) var(--space-2); }
.choice-list { display: grid; gap: var(--space-1h); margin-top: var(--space-2); }
.choice { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1h); align-items: center; width: 100%; padding: var(--space-2); border: 1px solid var(--color-line-strong); border-radius: var(--radius-panel); background: var(--color-bg-deep); text-align: left; transition: border-color var(--motion-ui); }
.choice[aria-pressed=true] { border-color: var(--color-frame-bright); box-shadow: inset 0 0 0 1px var(--color-frame); }
.choice-title { display: block; font: 400 var(--text-20)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1px; }
.choice-text { display: block; margin-top: var(--space-half); color: var(--color-text-muted); font-size: var(--text-14); }
.choice.practice .choice-title { color: var(--color-practice); }
.choice.real .choice-title { color: var(--color-real); }
.login form { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.login input { height: 60px; border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-bg-deep); padding: 0 var(--space-2); font-size: var(--text-28); letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: inset 0 2px 6px var(--color-shadow); }
.login input:focus-visible { outline: 1px solid var(--color-focus); outline-offset: 1px; box-shadow: inset 0 2px 6px var(--color-shadow); }
.form-error { color: var(--color-danger); min-height: 1.45em; margin: var(--space-1) 0 0; }

/* ---------- buttons: dark metal plates, no shiny fills ---------- */
.btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--c-button-height); padding: 0 var(--space-2); border: 1px solid var(--color-frame); border-radius: var(--c-button-radius); background: linear-gradient(180deg, var(--color-surface-hover), var(--color-surface-sunken)); color: var(--color-text); font: 400 var(--text-16)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1px; box-shadow: inset 0 0 0 2px var(--color-bg-deep), inset 0 0 0 3px var(--color-frame-inner); transition: transform var(--motion-press), filter var(--motion-ui), border-color var(--motion-ui); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--color-plaque-top), var(--color-plaque-bottom)); color: var(--color-plaque-ink); border-color: var(--color-frame-glow); font-weight: 600; }
.btn.buy { color: var(--color-buy-strong); border-color: var(--color-buy-edge); background: linear-gradient(180deg, var(--color-buy-fill), var(--color-surface-sunken)); }
.btn.sell { color: var(--color-sell-strong); border-color: var(--color-sell-edge); background: linear-gradient(180deg, var(--color-sell-fill), var(--color-surface-sunken)); }
.btn.quiet { background: transparent; box-shadow: none; border-color: var(--color-line-strong); color: var(--color-text-muted); }
.btn.danger { border-color: var(--color-danger-edge); color: var(--color-danger); background: var(--color-danger-fill); }
.btn.hero { min-height: var(--c-button-height-hero); border-color: var(--color-frame-bright); }
.btn.blocked { filter: saturate(.25) brightness(.75); }
:is(.ui-textured,html) .btn:is(:disabled,[aria-disabled=true]):not([aria-busy=true]) { filter:saturate(.15); background:var(--color-surface-sunken); background-image:none; border-color:var(--color-line-strong); color:var(--color-text-muted); box-shadow:inset 0 1px 0 var(--color-frame-inner); cursor:not-allowed; }
.btn[aria-busy=true] { cursor:wait; filter:saturate(.5); flex-direction:row; }
.btn:is(:disabled,[aria-disabled=true]):active { transform:none; }
.sx-busy-dots { display:inline-flex; width:1.3em; margin-inline-start:.15em; text-align:left; font-variant:normal; }
.sx-busy-dots span { animation:sx-busy-dot 1.2s infinite; }
.sx-busy-dots span:nth-child(2) { animation-delay:.2s; }
.sx-busy-dots span:nth-child(3) { animation-delay:.4s; }
.sx-busy-dots[data-static=true] span { animation:none; }
@keyframes sx-busy-dot { 0%,80%,100% { opacity:.3; } 40% { opacity:1; } }
.btn-title { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-20); letter-spacing: 1.5px; }
.btn .btn-sub { font: 400 var(--text-12)/1.3 var(--font-ui); font-variant: normal; letter-spacing: 0; opacity: .85; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-row { display: flex; gap: var(--space-1); }
.btn-row > .btn { flex: 1; }
.link { min-height: var(--size-touch); padding: 0 var(--space-1); border: 0; background: none; color: var(--color-accent); font-family: var(--font-display); font-size: var(--text-16); font-variant: small-caps; letter-spacing: 1px; }
.w-full { width: 100%; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }

/* ---------- market ---------- */
.market { margin-top: var(--space-1); padding: var(--space-2); }
.market-head { display: flex; justify-content: space-between; align-items: center; height: 20px; }
.age { font-size: var(--text-12); color: var(--color-text-faint); font-variant-numeric: tabular-nums; }
.price-row { display: flex; align-items: center; gap: var(--space-1); height: 52px; margin-top: var(--space-half); }
.price { font: 400 var(--text-36)/1.15 var(--font-display); letter-spacing: .5px; transition: color var(--motion-reveal); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.price.up { color: var(--color-up); } .price.down { color: var(--color-down); }
.move { font-size: var(--text-13); color: var(--color-text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); margin-top: var(--space-1); }
.quote { display: flex; flex-direction: column; align-items: flex-start; min-height: var(--size-touch); padding: 6px var(--space-1h); border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--color-bg-deep); font-size: var(--text-12); color: var(--color-text-muted); text-align: left; }
.quote b { font-size: var(--text-16); font-weight: 500; }
.quote.sellers b { color: var(--color-sell-strong); } .quote.buyers b { color: var(--color-buy-strong); }
.chart { position: relative; height: var(--c-chart-height); margin-top: var(--space-2); border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .line { fill: none; stroke: var(--color-text-muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .glow { display: none; }
.chart .area { fill: var(--color-highlight); }
.chart .grid { stroke: var(--color-line); stroke-width: 1; stroke-dasharray: 1 5; vector-effect: non-scaling-stroke; }
.chart .lvl { stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart .lvl.buy { stroke: var(--color-buy); } .chart .lvl.sell { stroke: var(--color-sell); }
.chart-tags { position: absolute; inset: 0; pointer-events: none; }
.now-dot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; transform: rotate(45deg); background: var(--color-accent-strong); }
.tag { position: absolute; right: 0; transform: translateY(-50%); padding: 0 6px; border-radius: var(--radius-panel); font-size: var(--text-11); font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--color-bg-deep); }
.tag.buy { color: var(--color-buy-strong); border: 1px solid var(--color-buy-edge); }
.tag.sell { color: var(--color-sell-strong); border: 1px solid var(--color-sell-edge); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-text-faint); font-size: var(--text-12); }
.pressure { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-1); width: 100%; min-height: var(--size-touch); margin-top: var(--space-1); padding: 0; border: 0; background: none; font-size: var(--text-12); color: var(--color-text-muted); }
.pressure b { color: var(--color-text); font-variant-numeric: tabular-nums; font-weight: 500; }
.pressure-bar { position: relative; height: 4px; background: var(--color-sell-edge); overflow: hidden; }
.pressure-bar i { position: absolute; inset: 0 auto 0 0; width: 50%; background: var(--color-buy-solid); transition: width var(--motion-reveal) var(--motion-ease); }
.pressure-label.right { text-align: right; }

/* ---------- wallet (stash) ---------- */
.wallet { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-1); margin-top: var(--space-1); }
.stash { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-half); min-width: 0; min-height: calc(var(--size-touch) + var(--space-5)); padding: var(--space-1) var(--space-half); border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-surface-sunken); text-align: left; box-shadow: inset 0 0 0 2px var(--color-bg-deep); }
.stash-head { display: flex; align-items: center; gap: var(--space-half); min-height: var(--c-icon-lg); color: var(--color-text-muted); font: var(--text-11)/1.2 var(--font-ui); flex-wrap: wrap; }
.stash-head .gem { --orb-size: var(--c-icon-lg); }
.gem.reserved { color: var(--color-accent); }
.stash > b { color: var(--color-text); font: 500 var(--text-14)/1.3 var(--font-ui); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stash-hint { color: var(--color-text-faint); font: var(--text-11)/1.2 var(--font-ui); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-height: 1.2em; }
@media (max-width: 360px) { .stash > b { font-size: var(--text-13); } }
.budget { grid-column: 1 / -1; display: grid; gap: 6px; min-height: var(--size-touch); padding: var(--space-1) var(--space-1h); border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--color-bg-deep); text-align: left; }
.budget-head { display: flex; justify-content: space-between; font-size: var(--text-12); color: var(--color-text-muted); }
.budget-head b { color: var(--color-text); font-size: var(--text-13); font-weight: 500; }
.gauge { position: relative; height: 3px; background: var(--color-surface-hover); overflow: hidden; }
.gauge i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--color-accent); transition: width var(--motion-reveal) var(--motion-ease); }

/* ---------- trades (PoE order cards) ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-3); }
html.list-layout, .list-moving { overflow-anchor: none; }
.round-list { display: grid; gap: var(--space-1h); margin-top: var(--space-1); }
.round { padding: var(--space-1h) var(--space-2) var(--space-2); }
/* Arrival animates one plate, never its individual values or the page layout. */
.order-arrival-rim { position:absolute; inset:0; pointer-events:none; border-radius:inherit; opacity:0; }
.order-arrival-rim::before,.order-arrival-rim::after { content:''; position:absolute; left:var(--space-1); right:var(--space-1); height:1px; background:linear-gradient(90deg,transparent,var(--color-plaque-top),transparent); }
.order-arrival-rim::before { top:0; opacity:.45; }
.order-arrival-rim::after { bottom:0; }
.round[data-state=done] { border-color: var(--color-buy-edge); }
.round[data-state=stuck] { border-color: var(--color-danger-edge); }
.round.sealed .round-result { animation: seal 900ms var(--motion-ease); }
@keyframes seal { 0% { opacity: 0; letter-spacing: 6px; } 100% { opacity: 1; } }
.leg-labels { display: flex; justify-content: space-between; align-items: baseline; font: italic 400 var(--text-15)/1.2 var(--font-display); }
.leg-labels .want { color: var(--color-buy); } .leg-labels .give { color: var(--color-sell); }
.trade-row { display: grid; grid-template-columns: var(--c-slot-size) 1fr var(--c-slot-size); align-items: center; gap: var(--space-1); margin-top: var(--space-1); }
.slot { position: relative; display: grid; place-items: center; width: var(--c-slot-size); height: var(--c-slot-size); border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: radial-gradient(circle, var(--color-surface), var(--color-bg-deep) 80%); box-shadow: inset 0 0 0 2px var(--color-bg-deep), inset 0 0 12px var(--color-bg-deep); }
.slot.want { border-color: var(--color-buy-edge); }
.slot .gem { --orb-size: var(--c-orb-size); }
.slot .stack { position: absolute; left: 3px; top: 1px; max-width: calc(100% - 4px); overflow: hidden; font-size: var(--text-11); font-weight: 600; color: var(--color-text); text-shadow: 0 1px 2px var(--color-bg-deep), 0 0 3px var(--color-bg-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ratio { display: grid; gap: 2px; justify-items: center; padding: var(--space-1); border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); text-align: center; min-width: 0; }
.ratio-main { display: flex; align-items: center; gap: 6px; font-size: var(--text-15); font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; }
.ratio-main .i { color: var(--color-accent); }
.ratio-sub { font-size: var(--text-12); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.status { margin-top: var(--space-1h); text-align: center; font: 400 var(--text-14)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 2px; color: var(--color-accent); }
.status.done { color: var(--color-buy-strong); } .status.alert { color: var(--color-danger); }
.round-live { margin: var(--space-half) 0 0; text-align: center; font-size: var(--text-13); color: var(--color-text-muted); min-height: 1.45em; font-variant-numeric: tabular-nums; }
.round-result { margin-top: var(--space-1); text-align: center; font: 400 var(--text-28)/1.1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
.round-result.plus { color: var(--color-buy-strong); } .round-result.minus { color: var(--color-sell-strong); }
.fuse { position: relative; height: 4px; margin: var(--space-1h) 0 2px; background: var(--color-bg-deep); border: 1px solid var(--color-line); }
.fuse i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--color-sell-solid); transition: width var(--motion-reveal) var(--motion-ease); }
.fuse i::after { content: ""; position: absolute; right: -4px; top: 50%; width: 7px; height: 7px; transform: translateY(-50%) rotate(45deg); background: var(--color-sell-strong); }
.fuse-ends { display: flex; justify-content: space-between; font-size: var(--text-11); color: var(--color-text-faint); font-variant-numeric: tabular-nums; }
.round-actions { display: flex; gap: var(--space-1); margin-top: var(--space-1h); }
.round-actions .btn { flex: 1; }
.round-actions .btn.quiet { flex: 0 0 auto; }
.empty { padding: var(--space-3) var(--space-2); text-align: center; margin-top: var(--space-1); }
.empty-orbs { display: flex; justify-content: center; align-items: center; gap: var(--space-1h); margin-bottom: var(--space-1); color: var(--color-accent); }
.empty-orbs .swap { width: 20px; height: 20px; }
.empty-title { margin: 0 0 var(--space-half); font: 400 var(--text-20) var(--font-display); font-variant: small-caps; letter-spacing: 1.5px; color: var(--color-accent); }
.finished { display: grid; gap: var(--space-half); margin-top: var(--space-2); }
.mini-round { display: flex; justify-content: space-between; align-items: center; min-height: var(--size-touch); padding: 0 var(--space-2); border-radius: var(--radius-panel); background: var(--color-bg-deep); border: 1px solid var(--color-line); width: 100%; font-size: var(--text-14); color: var(--color-text-muted); text-align: left; }
.mini-round b { font-weight: 500; }
.mini-round b.plus { color: var(--color-buy-strong); } .mini-round b.minus { color: var(--color-sell-strong); }

/* ---------- dock ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: auto 1fr; gap: var(--space-1); max-width: 560px; margin: 0 auto; padding: var(--space-1) var(--space-page) calc(var(--space-1) + var(--safe-area-bottom)); background: linear-gradient(180deg, transparent, var(--color-bg-deep) 30%); }
.result-chip { display: flex; flex-direction: column; justify-content: center; min-width: 92px; min-height: var(--c-button-height-hero); padding: 0 var(--space-2); border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-surface-sunken); font: 400 var(--text-12)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1px; color: var(--color-text-faint); box-shadow: inset 0 0 0 2px var(--color-bg-deep); }
.result-period { color: var(--color-text-muted); }
.result-chip b { font: 500 var(--text-16)/1.3 var(--font-ui); color: var(--color-text); }
.result-chip b.plus { color: var(--color-buy-strong); } .result-chip b.minus { color: var(--color-sell-strong); }

/* ---------- modal window (PoE window: plaque title, close seal, scroll inside) ---------- */
.sheet-layer { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; overflow: clip; padding: calc(var(--safe-area-top) + var(--space-1h)) var(--space-1) calc(var(--safe-area-bottom) + var(--space-1h)); }
.scrim { position: absolute; inset: 0; background: var(--color-scrim); animation: fade var(--motion-ui); }
@keyframes fade { from { opacity: 0; } }
.sheet { grid-area: 1 / 1; position: relative; width: 100%; max-width: var(--c-modal-max-width); max-height: min(var(--c-modal-max-height), 100%); min-height: 0; display: flex; flex-direction: column; padding-top: var(--space-2); border: 1px solid var(--color-frame-bright); border-radius: var(--radius-panel); background: linear-gradient(180deg, var(--color-surface-raised), var(--color-surface-sunken)); box-shadow: inset 0 0 0 3px var(--color-bg-deep), inset 0 0 0 4px var(--color-frame), 0 20px 60px var(--color-shadow); --surface-from-transform: none; animation: open var(--motion-surface-enter) var(--motion-enter-ease); }
@keyframes open { from { transform: translateY(100vh); } to { transform: none; } }
.grabber { display: none; }
.sheet-head { position: relative; display: flex; justify-content: center; align-items: center; flex-shrink: 0; min-height: var(--size-touch); padding: 0 calc(var(--size-touch) + var(--space-1h)); isolation: isolate; }
.sheet-head h2 { margin: 0; min-width: 0; max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.sheet-head h2:empty { display: none; }
.sheet-head .sheet-close { position: absolute; right: var(--space-1); top: 0; width: var(--size-touch); height: var(--size-touch); border-radius: 50%; border-color: var(--color-danger-edge); color: var(--color-danger); background: radial-gradient(circle, var(--color-danger-fill), var(--color-bg-deep)); }
.sheet-back { position: absolute; left: var(--space-1); top: 0; }
.sheet.suspended { visibility: hidden; pointer-events: none; }
[data-window-back][hidden] { display: none; }
.sheet.closing { pointer-events: none; animation: window-close var(--motion-surface-leave) var(--motion-leave-ease) forwards; }
.sheet-layer.closing .scrim { animation: scrim-close var(--motion-surface-leave) forwards; }
.sheet.drawer { height: 100%; max-height: 100%; max-width: min(92vw, var(--c-menu-width)); justify-self: end; animation: drawer-open var(--motion-surface-enter) var(--motion-enter-ease); }
.sheet.drawer.closing { animation: drawer-close var(--motion-surface-leave) var(--motion-leave-ease) forwards; }
.sheet.drawer.suspended { transform: translateX(-8px); }
.sheet.drawer.nav-parent { visibility: hidden; transform: none; }
@keyframes window-close { from { transform: var(--surface-from-transform); } to { transform: translateY(100vh); } }
@keyframes scrim-close { to { opacity: 0; } }
@keyframes drawer-open { from { transform: translateX(calc(100% + var(--space-2))); } to { transform: none; } }
@keyframes drawer-close { from { transform: var(--surface-from-transform); } to { transform: translateX(calc(100% + var(--space-2))); } }
.drawer-pages { display: grid; flex: 1; min-height: 0; overflow: hidden; }
.drawer-page { --surface-from-transform: none; grid-area: 1 / 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.drawer-page.suspended { display: none; pointer-events: none; }
.drawer-page.page-forward { animation: page-forward var(--motion-content) var(--motion-enter-ease); }
.drawer-page.page-return { animation: page-return var(--motion-content) var(--motion-enter-ease); }
.drawer-page.closing { pointer-events: none; animation: page-leave var(--motion-content) var(--motion-leave-ease) forwards; }
@keyframes page-forward { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes page-return { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes page-leave { from { opacity: 1; transform: var(--surface-from-transform); } to { opacity: 0; transform: translateX(18px); } }

.menu-categories { display: grid; gap: var(--space-3); padding-block: var(--space-1); }
.menu-cluster { min-width: 0; }
.menu-cluster-title { display: flex; align-items: center; gap: var(--space-1h); margin-bottom: var(--space-half); color: var(--color-accent); font: 400 var(--text-11)/1.4 var(--font-display); font-variant: small-caps; letter-spacing: 1.2px; }
.menu-cluster-title > span { flex: 1; height: 1px; background: linear-gradient(90deg, var(--color-frame-bright), transparent); }
.menu-item.menu-category { position: relative; width: 100%; min-height: var(--c-menu-row-height); display: grid; grid-template-columns: var(--c-menu-medallion) minmax(0, 1fr) var(--c-icon-sm); column-gap: var(--space-1h); padding: var(--space-1h) var(--space-half); border: 0; background: transparent; box-shadow: none; }
.menu-category .category-icon { display: grid; place-items: center; width: var(--c-menu-medallion); height: var(--c-menu-medallion); border-radius: var(--radius-round); border: 1px solid var(--color-frame-bright); background: radial-gradient(circle at 35% 20%, var(--color-surface-hover), var(--color-bg-deep)); box-shadow: inset 0 1px 0 var(--color-highlight), 0 2px 4px var(--color-shadow); color: var(--color-accent-strong); transition: border-color var(--motion-ui), transform var(--motion-ui); }
.menu-category .category-icon .i { width: var(--c-icon-md); height: var(--c-icon-md); }
.menu-category .category-copy { display: grid; gap: var(--space-half); min-width: 0; text-align: left; }
.menu-category .category-label { color: var(--color-text); font: 500 var(--c-menu-label-size)/1.3 var(--font-ui); }
.menu-category .category-copy .category-note { color: var(--color-text-faint); font: 400 var(--c-menu-note-size)/1.4 var(--font-ui); }
.menu-category .category-arrow { color: var(--color-text-faint); justify-self: end; }
.menu-item.menu-category:hover { background: linear-gradient(90deg, var(--color-highlight), transparent); }
.menu-category:hover .category-icon, .menu-category:focus-visible .category-icon { border-color: var(--color-accent-strong); transform: translateY(-1px); }
.drawer .sheet-body { padding-inline: var(--space-2); }
.menu-signature { display: grid; justify-items: center; gap: var(--space-2); padding-top: var(--space-1); }
.signature-line { position: relative; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--color-frame-bright), transparent); }
.signature-line::after { content: ''; position: absolute; width: var(--space-half); height: var(--space-half); left: calc(50% - 2px); top: -2px; background: var(--color-accent); transform: rotate(45deg); }
.menu-version { margin: 0; color: var(--color-text-faint); font-size: var(--text-11); }
.settings-section { display: grid; gap: var(--space-3); }
.settings-field { display: grid; gap: var(--space-1); min-width: 0; }
.settings-field:has(> .custom) { gap: var(--space-half); }
.settings-field > .custom { margin-top: 0; }
.setting-stack { display: grid; gap: var(--space-2); }
.settings-field > .field-label { margin: 0; font-size: var(--c-settings-heading-size); letter-spacing: 1px; }
.settings-field .hint { margin: 0; font-size: var(--c-settings-helper-size); line-height: 1.5; }
.settings-field .menu-item { width: 100%; }
.settings-field > .seg { display: flex; flex-wrap: wrap; }
.settings-field > .seg button { flex: 1 1 8ch; min-width: 0; padding: var(--space-1); line-height: 1.2; overflow-wrap: anywhere; }
.settings-section .menu-item { min-height: var(--size-touch); height: auto; padding-block: var(--space-1h); column-gap: var(--space-2); row-gap: var(--space-1); flex-wrap: wrap; font-size: var(--c-settings-label-size); line-height: 1.45; }
.settings-section .menu-category { min-height: var(--c-menu-row-height); }
.settings-section .menu-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.settings-section .menu-item[role="switch"] > span:first-child { flex: 1 1 12ch; }
.settings-section .menu-item[role="switch"] > span:last-child { margin-left: auto; }
.btn, .menu-item, .chip, .seg button, .icon-btn { transition: transform var(--motion-press), background-color var(--motion-ui), border-color var(--motion-ui), color var(--motion-ui), box-shadow var(--motion-ui), filter var(--motion-press); }
.btn:active, .menu-item:active, .chip:active, .seg button:active, .icon-btn:active { transform: translateY(1px); }
.menu-item[aria-disabled=true] { color: var(--color-text-muted); }
.setting-switch { gap: var(--space-2); min-height: var(--size-touch); padding-block: var(--space-1h); }
.setting-switch .switch-label { flex: 1 1 12ch; min-width: 0; line-height: 1.45; }
.setting-switch .switch-track { display: inline-block; flex: none; position: relative; width: var(--c-switch-width); height: var(--c-switch-height); margin-left: auto; border: 1px solid var(--color-frame); border-radius: var(--c-switch-height); background: var(--color-bg-deep); box-shadow: inset 0 1px 4px var(--color-shadow); transition: border-color var(--motion-ui), background-color var(--motion-ui); }
.switch-thumb { display: block; position: absolute; top: 2px; left: 2px; width: var(--c-switch-thumb); height: var(--c-switch-thumb); border-radius: 50%; background: linear-gradient(150deg, var(--color-text-faint), var(--color-surface-hover)); box-shadow: 0 1px 3px var(--color-shadow); transition: transform var(--motion-ui) var(--motion-ease), background var(--motion-ui), box-shadow var(--motion-ui); }
.setting-switch[aria-checked=true] .switch-track { border-color: var(--color-frame-bright); background: var(--color-accent-fill); }
.setting-switch[aria-checked=true] .switch-thumb { transform: translateX(var(--c-switch-travel)); background: linear-gradient(150deg, var(--color-plaque-top), var(--color-plaque-bottom)); box-shadow: 0 1px 3px var(--color-shadow), 0 0 4px var(--color-accent-fill); }
.setting-switch:disabled { opacity: .65; cursor: default; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-2) var(--space-2) var(--space-2); overscroll-behavior: contain; }
.sheet-foot { flex: none; padding: var(--space-1h) var(--space-2) var(--space-2); border-top: 1px solid var(--color-frame); }
.sheet-foot:empty { display: none; }
.exchange { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-1); align-items: stretch; }
.side-card { display: grid; justify-items: center; gap: var(--space-half); padding: 0 0 var(--space-1h); border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-bg-deep); min-width: 0; overflow: hidden; }
.side-label { width: 100%; padding: 3px 0; text-align: center; font: italic 400 var(--text-15)/1.3 var(--font-display); border-bottom: 1px solid var(--color-line); }
.side-card.want .side-label { color: var(--color-buy); } .side-card.give .side-label { color: var(--color-sell); }
.side-value { font-size: var(--text-16); font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; padding: 0 var(--space-half); overflow: hidden; text-overflow: ellipsis; }
.side-unit { font: 400 var(--text-12)/1 var(--font-display); font-variant: small-caps; color: var(--color-text-faint); letter-spacing: 1px; }
.exchange-swap { align-self: center; color: var(--color-accent); }
.exchange-swap .i { width: 22px; height: 22px; }
.rates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); margin-top: var(--space-1); font-size: var(--text-12); color: var(--color-text-muted); }
.rates > div { padding: 6px var(--space-1); border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); text-align: center; }
.rates b { display: block; font-size: var(--text-14); font-weight: 500; color: var(--color-text); }
.rates .yours b { color: var(--color-accent-strong); }
.field-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: var(--space-1); margin: var(--space-2) 0 var(--space-1); font: 400 var(--text-14)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.4px; color: var(--color-accent); }
.chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-1); }
.chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--c-chip-height); padding: var(--space-half) 6px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-panel); background: var(--color-bg-deep); font-size: var(--text-15); font-variant-numeric: tabular-nums; transition: border-color var(--motion-ui), box-shadow var(--motion-ui); }
.chip small { font-size: var(--text-11); color: var(--color-text-faint); }
.chip[aria-pressed=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 14px var(--color-accent-fill); }
.chip[aria-pressed=true] small { color: var(--color-accent); }
.chip[aria-expanded] { position: relative; }
/* The active chip of a dial group carries a caret: tap it again to open or close the dial. */
.chip[aria-expanded]::after { content: ""; position: absolute; right: 6px; top: 50%; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-75%) rotate(45deg); opacity: .8; transition: transform var(--motion-ui); }
.chip[aria-expanded=true]::after { transform: translateY(-25%) rotate(-135deg); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--color-frame); border-radius: var(--radius-panel); background: var(--color-bg-deep); overflow: hidden; }
.seg button { min-height: var(--size-touch); border: 0; background: transparent; color: var(--color-text-muted); font: 400 var(--text-16)/1 var(--font-display); font-variant: small-caps; letter-spacing: 1px; }
.seg button + button { border-left: 1px solid var(--color-frame); }
.seg button[aria-disabled=true] { color: var(--color-text-faint); }
.hint.shake { animation: shake .35s; }
.seg button[aria-pressed=true] { background: linear-gradient(180deg, var(--color-surface-hover), var(--color-surface-sunken)); color: var(--color-accent-strong); box-shadow: inset 0 -2px 0 var(--color-frame-glow); }
.custom { display: flex; align-items: center; gap: var(--space-1); min-height: var(--size-touch); margin-top: var(--space-1); }
.custom input { flex: 1; min-width: 0; height: max(var(--c-input-face-height), calc(var(--text-16) * 1.4 + var(--space-1))); padding: 0 var(--space-2); border: 1px solid var(--color-frame); border-radius: var(--radius-control); background: var(--color-bg-deep); font-size: var(--text-16); line-height: 1.2; font-variant-numeric: tabular-nums; }
.custom input::placeholder { color: var(--color-text-faint); opacity: 1; font-size: var(--text-14); }
.custom:has(> input:focus-visible) { outline: 0; box-shadow: none; }
.custom.amount-well:has(> input:focus-visible) { border-color: var(--color-focus); box-shadow: inset 0 2px 6px var(--color-shadow); }
.custom input:focus-visible { outline: 0; border-color: var(--color-focus); box-shadow: none; }
.hint { margin: var(--space-1) 0 0; font-size: var(--text-13); color: var(--color-text-muted); }
.summary { margin-top: var(--space-2); padding: var(--space-1) 0; border-top: 1px solid var(--color-frame); border-bottom: 1px solid var(--color-frame); }
.sum-row { display: flex; justify-content: space-between; gap: var(--space-1); align-items: baseline; min-height: 28px; font-size: var(--text-14); color: var(--color-text-muted); }
.sum-row b { color: var(--color-text); font-size: var(--text-15); font-weight: 500; text-align: right; }
.sum-row.lead b { font: 400 var(--text-20)/1.2 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
/* B3: «+ остаток q BTC» under «Вы продаёте» when the server attached earlier remainders to this sale */
.sale-attached { margin: 0; text-align: right; font-size: var(--text-12); line-height: 1.35; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.sum-row b.plus { color: var(--color-buy-strong); } .sum-row b.minus { color: var(--color-sell-strong); }
/* r20 buy result: one result line, one schematic bar, three columns, one state line */
.buy-result { font-variant-numeric: tabular-nums; }
.br-kick { margin: 0; font: 400 var(--text-14)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.4px; color: var(--color-accent); }
.br-get { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--space-1); margin: var(--space-1) 0 0; }
.br-get b { font: 500 var(--text-15)/1.2 var(--font-ui); color: var(--color-text); white-space: nowrap; }
.br-eq { font-size: var(--text-13); color: var(--color-text-muted); white-space: nowrap; }
.br-bar { display: flex; gap: var(--space-half); height: 4px; margin-top: var(--space-1h); }
.br-base { position: relative; display: block; flex: 1; overflow: hidden; border-radius: 2px; background: var(--color-buy-solid); }
.br-dev { position: absolute; top: 0; right: 0; bottom: 0; width: 0; background: var(--color-buy-edge); }
.br-fee { flex: none; width: 12px; border-radius: 2px; background: var(--color-accent); }
.buy-result.no-fee .br-fee { display: none; }
.br-cols { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; column-gap: var(--space-1h); margin-top: var(--space-1); font-size: var(--text-12); color: var(--color-text-muted); white-space: nowrap; }
.br-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.br-col b { font: 500 var(--text-14)/1.2 var(--font-ui); color: var(--color-text); }
.br-mkt { grid-column: 1; }
.br-off { grid-column: 2; align-items: center; text-align: center; }
.br-off b { color: var(--color-buy); }
.buy-result[data-dev=up] .br-off b { color: var(--color-text); }
.br-fee-col { grid-column: 3; align-items: flex-end; text-align: right; }
.br-fee-col b { color: var(--color-accent); }
.br-state { display: flex; align-items: center; gap: var(--space-1); margin: var(--space-1h) 0 0; padding-top: var(--space-1h); border-top: 1px solid var(--color-line); font-size: var(--text-13); line-height: 1.3; color: var(--color-text-muted); }
.br-state .i { flex: none; width: var(--c-icon-sm); height: var(--c-icon-sm); color: var(--color-buy-solid); }
.buy-result ~ .calc-state { display: none; } /* r21 (Neil): freshness line removed; the reason line + button carry calc/error */
.goal { margin-top: var(--space-1); padding-top: var(--space-1); border-top: 1px solid var(--color-line); font-size: var(--text-13); color: var(--color-text-muted); }
.goal strong { color: var(--color-accent-strong); font-weight: 500; }
.calc-state { min-height: 1.45em; margin: var(--space-1) 0 0; font-size: var(--text-12); color: var(--color-text-faint); }
.book { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); margin-top: var(--space-1); font-size: var(--text-12); font-variant-numeric: tabular-nums; }
.book h3 { margin: 0 0 var(--space-half); font: 400 var(--text-14)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1px; color: var(--color-accent); text-align: center; }
.book-col { padding: var(--space-1); border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--color-bg-deep); min-width: 0; }
.book-row { position: relative; display: flex; justify-content: space-between; height: 24px; align-items: center; padding: 0 6px; overflow: hidden; color: var(--color-text-muted); border-bottom: 1px solid var(--color-surface); }
.book-row i { position: absolute; inset: 0 0 0 auto; opacity: .16; }
.book .asks .book-row i { background: var(--color-sell); } .book .bids .book-row i { background: var(--color-buy); }
.book-row span { position: relative; }
.book-row.me { outline: 1px solid var(--color-frame-bright); color: var(--color-accent-strong); }
.reason { display: flex; gap: var(--space-1); margin-top: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-panel); background: var(--color-danger-fill); border: 1px solid var(--color-danger-edge); color: var(--color-danger); font-size: var(--text-14); }
.reason.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.check { display: flex; gap: var(--space-1); align-items: flex-start; margin-top: var(--space-2); min-height: var(--size-touch); font-size: var(--text-14); color: var(--color-text); }
.check input { width: 24px; height: 24px; flex: 0 0 24px; margin: 0; accent-color: var(--color-sell-solid); }

/* ---------- slide: drag the gem into the socket ---------- */
.slide { position: relative; height: var(--c-slide-height); border-radius: var(--radius-round); border: 1px solid var(--color-buy-edge); background: var(--color-bg-deep); user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden; box-shadow: inset 0 2px 8px var(--color-shadow), inset 0 0 0 3px var(--color-surface-sunken); }
.slide.sell { border-color: var(--color-sell-edge); }
.slide.loss { border-color: var(--color-danger-edge); }
.slide-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, transparent, var(--color-buy-fill)); }
.slide.sell .slide-fill { background: linear-gradient(90deg, transparent, var(--color-sell-fill)); }
.slide-label { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 72px; font: 400 var(--text-16)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1px; text-align: center; color: var(--color-buy-strong); pointer-events: none; }
.slide.sell .slide-label { color: var(--color-sell-strong); }
.slide.loss .slide-label { color: var(--color-danger); }
.slide-goal { position: absolute; right: 6px; top: 50%; width: var(--c-slide-thumb); height: var(--c-slide-thumb); transform: translateY(-50%); border-radius: 50%; border: 1px solid var(--color-frame); box-shadow: inset 0 0 0 3px var(--color-bg-deep), inset 0 0 10px var(--color-shadow); pointer-events: none; }
.slide-thumb { position: absolute; top: 5px; left: 5px; display: grid; place-items: center; width: var(--c-slide-thumb); height: var(--c-slide-thumb); padding: 0; border: 0; border-radius: 50%; background: none; touch-action: none; }
.slide-thumb .gem { width: 100%; height: 100%; }
.slide.disabled { opacity: .55; }
.slide.disabled .slide-thumb .gem { filter: grayscale(.8); }
.slide.busy .slide-thumb .gem { animation: lit 600ms ease-in-out infinite alternate; }

/* ---------- tooltip (PoE item tooltip: plaque header, centred lines) ---------- */
.tip { position: fixed; z-index: 30; max-width: min(320px, calc(100vw - 24px)); border: 1px solid var(--color-frame-bright); border-radius: var(--radius-panel); background: var(--color-bg-deep); box-shadow: inset 0 0 0 2px var(--color-bg-deep), inset 0 0 0 3px var(--color-frame), 0 10px 30px var(--color-shadow); animation: fade var(--motion-ui); }
.tip-head { padding: 4px var(--space-1h); text-align: center; background: linear-gradient(180deg, var(--color-plaque-top), var(--color-plaque-bottom)); color: var(--color-plaque-ink); font: 600 var(--text-14)/1.3 var(--font-display); font-variant: small-caps; letter-spacing: 1px; }
.tip-body { padding: var(--space-1) var(--space-1h) var(--space-1h); text-align: center; font-size: var(--text-14); color: var(--color-text-muted); }

/* ---------- menu & lists ---------- */
.menu-list { display: grid; gap: var(--space-1); }
.menu-item { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 var(--space-2); border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--color-bg-deep); text-align: left; color: var(--color-text); text-decoration: none; }
.menu-item span:last-child { color: var(--color-text-faint); font-size: var(--text-13); }
.menu-group { margin: var(--space-3) 0 var(--space-1); font: 400 var(--text-15)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1.6px; color: var(--color-accent); text-align: center; }
.menu-group::after { content: ""; display: block; height: 1px; margin-top: 6px; background: linear-gradient(90deg, transparent, var(--color-frame-bright), transparent); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--space-2); font-size: var(--text-14); color: var(--color-text-muted); }
.kv b { color: var(--color-text); text-align: right; font-weight: 500; }
.kv b.faint { color: var(--color-text-faint); font-weight: 400; }
.kv b.plus { color: var(--color-buy-strong); } .kv b.minus { color: var(--color-sell-strong); }
.big-value { font: 400 var(--text-36)/1.2 var(--font-display); font-variant-numeric: lining-nums tabular-nums; margin: var(--space-1) 0; text-align: center; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-1); padding: var(--space-1) 0; border-bottom: 1px solid var(--color-line); font-size: var(--text-14); }
.history-row small { color: var(--color-text-faint); font-size: var(--text-12); }
.history-row b { font-weight: 500; }
.history-row b.plus { color: var(--color-buy-strong); } .history-row b.minus { color: var(--color-sell-strong); }
.explain { font-size: var(--text-15); color: var(--color-text-muted); }
.explain p { margin: 0 0 var(--space-1); }

/* ---------- feedback ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--toast-viewport-top, 0px) + var(--safe-area-top) + var(--space-1)); bottom: auto; z-index: 50; transform: translate(-50%, -8px); width: min(520px, calc(100% - 32px)); padding: var(--space-1) var(--space-2); border-radius: var(--radius-panel); background: var(--color-bg-deep); border: 1px solid var(--color-frame); font-size: var(--text-14); text-align: center; opacity: 0; pointer-events: none; transition: opacity var(--motion-ui), transform var(--motion-ui); box-shadow: inset 0 0 0 2px var(--color-bg-deep), inset 0 0 0 3px var(--color-frame-inner); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--color-danger-edge); color: var(--color-danger); }
.toast.warning { border-color: var(--color-accent); color: var(--color-accent-strong); }
.toast.good { border-color: var(--color-buy-edge); color: var(--color-buy-strong); }
.burst { display: none; }

@media (max-width: 359px) {
  .app { padding: 0 var(--space-1); padding-bottom: calc(var(--c-dock-height) + var(--safe-area-bottom) + var(--space-2)); }
  .top { margin: 0 calc(-1 * var(--space-1)); padding-left: var(--space-1); padding-right: var(--space-1); }
  .brand-name { display: none; }
  .price { font-size: var(--text-28); }
  .chip { font-size: var(--text-14); }
  .trade-row { grid-template-columns: var(--c-slot-size-sm) 1fr var(--c-slot-size-sm); }
  .slot { width: var(--c-slot-size-sm); height: var(--c-slot-size-sm); }
  .slot .gem { --orb-size: 30px; }
}
@media (min-width: 720px) {
  .app, .dock { max-width: 640px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* gem parts (sprite classes; colours from tokens) */
.reason.warn { background: var(--color-sell-fill); border-color: var(--color-sell-edge); color: var(--color-sell-strong); }
.foot-reason { margin: 0 0 var(--space-1); }
/* stage trail on order cards (goal-gradient): buy · sell · result */
.trail { display: inline-flex; gap: 6px; align-items: center; }
.trail i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--color-frame-bright); }
.trail i.on { background: var(--color-accent); }
.trail i.done { background: var(--color-buy-solid); border-color: var(--color-buy-edge); }
.slot[data-explain] { cursor: help; }

/* ---- batch 2 (exchange-8): currency icon previews, dial, ≈ USDC hint, queue place, card slide */
.gem.btc { color: var(--color-gem-btc); } .gem.usdc { color: var(--color-gem-usdc); }
.ic-line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* The new icons carry no socket of their own: the thumb gets one, so it still reads as a thing to drag. */
.icons-new .slide-thumb { border: 1px solid var(--color-socket-rim); background: radial-gradient(circle, var(--color-socket-inner), var(--color-socket-hole)); box-shadow: inset 0 0 0 2px var(--color-bg-deep); }
.icons-new .slide-thumb .gem { width: 62%; height: 62%; }
.icons-new .gem.lit { animation: none; }
/* Line-sign icons sit in the DS bronze socket at 32 px and up (slots, Хочу/Отдаю, wallet): the product keeps its own anatomy. */
/* Size the inset from the icon itself: percentage padding uses its container's width and can erase the glyph. */
.icons-new .slot .gem, .icons-new .side-card .gem, .icons-new .stash .gem { box-sizing: border-box; padding: calc(var(--orb-size) * .18); border-radius: 50%; background: radial-gradient(circle, var(--color-socket-inner), var(--color-socket-hole)); box-shadow: 0 0 0 1px var(--color-socket-rim), inset 0 0 0 2px var(--color-bg-deep); }

.dial { display: grid; grid-template-columns: var(--size-touch) minmax(0, 1fr) var(--size-touch); align-items: start; gap: var(--space-1h); margin-top: var(--space-1); }
.dial-step { width: var(--size-touch); height: var(--size-touch); min-width: var(--size-touch); border: 1px solid var(--color-line-strong); border-radius: var(--radius-panel); background: var(--color-bg-deep); color: var(--color-accent); }
.dial-step svg { display: block; width: 20px; height: 20px; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dial-step:active { transform: translateY(1px); border-color: var(--color-frame-glow); }
.dial-rail { position: relative; height: calc(var(--c-dial-height) + var(--space-2)); touch-action: none; cursor: pointer; outline: none; }
.dial-rail:focus-visible { box-shadow: 0 0 0 2px var(--color-focus); border-radius: var(--radius-control); }
.dial-track { position: absolute; left: 0; right: 0; top: calc(var(--c-dial-height) / 2); height: var(--c-dial-track); transform: translateY(-50%); border-radius: var(--radius-round); background: var(--color-bg-deep); box-shadow: inset 0 1px 3px var(--color-shadow), 0 0 0 1px var(--color-frame); overflow: hidden; }
.dial-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--color-accent-fill), var(--color-frame-bright)); }
.dial-tick { position: absolute; top: calc(var(--c-dial-height) / 2 + 6px); width: 1px; height: 4px; background: var(--color-line-strong); transform: translateX(-50%); }
.dial-tick.major { height: 7px; background: var(--color-frame-bright); }
.dial-mark { position: absolute; top: calc(var(--c-dial-height) / 2 + 14px); transform: translateX(-50%); font-size: var(--text-12); line-height: 1.2; color: var(--color-text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.dial-mark.on { color: var(--color-accent-strong); }
.dial-mark.first { transform: none; }
.dial-mark.last { transform: translateX(-100%); }
.dial-mark.crowd { visibility: hidden; }
.dial-thumb { position: absolute; top: calc(var(--c-dial-height) / 2); width: var(--c-dial-thumb); height: var(--c-dial-thumb); transform: translate(-50%, -50%); pointer-events: none; transition: transform var(--motion-press); }
.dial-thumb::before { content: ""; position: absolute; inset: 5px; transform: rotate(45deg); border: 1px solid var(--color-frame-glow); background: linear-gradient(135deg, var(--color-plaque-top), var(--color-plaque-bottom)); box-shadow: 0 0 0 3px var(--color-bg-deep), 0 2px 6px var(--color-shadow); }
.dial.dragging .dial-thumb { transform: translate(-50%, -50%) scale(1.15); }
.dial.off { opacity: .5; pointer-events: none; }
.dial.shut { display: none; }
.field-value { display: inline-flex; align-items: baseline; gap: 6px; min-height: var(--size-touch); margin: -14px 0; padding: 0; border: 0; background: none; color: var(--color-text); font: 500 var(--text-15)/1.2 var(--font-ui); font-variant: normal; letter-spacing: 0; font-variant-numeric: tabular-nums; text-decoration: underline dotted var(--color-line-strong); text-underline-offset: 4px; }
.field-value small { font-size: var(--text-13); font-weight: 400; color: var(--color-text-muted); }

.usd-hint { display: block; margin-top: 2px; font: 400 var(--text-13)/1.2 var(--font-ui); color: var(--color-text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0; font-variant-caps: normal; }
.usd-hint:empty { display: none; }
.ratio .usd-hint { color: var(--color-text); } /* over the card's gradient muted measures 4.29:1 */
.sum-row b .usd-hint { text-align: right; }
.stash-text .usd-hint, .stash-text .usd-hint:empty { display: block; min-height: 1.2em; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* reserved: no jump when the quote arrives */

/* Queue place: your proposed price as its own row inside Competing (gate Q3), the DS "you" frame, fixed height. */
.book-you { box-sizing: border-box; display: grid; gap: 2px; width: 100%; min-height: 44px; margin: 2px 0; padding: 4px var(--space-1h); border: 0; border-radius: 0; outline: 1px solid var(--color-frame-bright); background: var(--color-surface-sunken); color: var(--color-accent-strong); font: inherit; text-align: left; }
.book-you-main { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: var(--space-1); }
.book-you b { font-weight: 600; }
.book-you small { font-size: var(--text-12); line-height: 1.25; color: var(--color-text-muted); }
.book-you.off b, .book-you.off .book-you-main span { color: var(--color-text-faint); }
.book-gap { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: var(--space-1); min-height: 24px; align-content: center; padding: 0 6px; color: var(--color-text-faint); }

.card-sell { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1h); }
.card-sell .slide { flex: 1 1 9em; min-width: 0; } /* wraps under the reward only when text is enlarged */
.reward-pick { flex: 0 0 auto; display: grid; place-items: center; align-content: center; min-width: 72px; min-height: var(--c-card-slide-height); padding: var(--space-half) var(--space-1h); border: 1px solid var(--color-sell-edge); border-radius: var(--radius-panel); background: var(--color-bg-deep); color: var(--color-sell-strong); font-size: var(--text-15); font-variant-numeric: tabular-nums; line-height: 1.1; }
.reward-amount { text-decoration: underline dotted var(--color-line-strong); text-underline-offset: 4px; } /* the DS signifier for "tap to change" (as .field-value) */
.reward-pick small { font: 400 var(--text-12)/1.2 var(--font-display); font-variant: small-caps; letter-spacing: 1px; color: var(--color-text-faint); }
/* Compact slide: label in flow so enlarged text grows the slide; no clipping so the thumb's 48 px hit area survives the round ends. */
.slide.compact { display: grid; height: auto; min-height: var(--c-card-slide-height); overflow: visible; }
.slide.compact .slide-fill { border-radius: inherit; }
.slide.compact .slide-thumb { top: calc(50% - var(--c-card-slide-thumb) / 2); left: 3px; width: var(--c-card-slide-thumb); height: var(--c-card-slide-thumb); }
.slide.compact .slide-thumb::after { content: ""; position: absolute; inset: -5px; } /* >= 48 px hit area (with the socket rim), 40 px visual */
.slide.compact .slide-goal { width: var(--c-card-slide-thumb); height: var(--c-card-slide-thumb); right: 3px; }
.slide.compact .slide-label { position: relative; inset: auto; padding: var(--space-half) 52px; font-size: var(--text-15); }

/* exchange-10: explicit attention states; original dock layout retained. */
.attention { padding: var(--space-1h); margin: var(--space-1) 0; border-color: var(--color-sell-edge); color: var(--color-text); }
.attention ul { margin: var(--space-1) 0; padding-left: var(--space-2); font-size: var(--text-13); }
.menu-item[role="switch"] { gap: var(--space-2); }
.menu-item[role="switch"] > span:first-child { min-width: 0; }
.menu-item[role="switch"] > span:last-child { flex: none; color: var(--color-accent); }

/* Budget: existing labels, inputs, menu rows and segments, with the DS 8/24 rhythm. */
.budget-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.budget-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-half); min-width: 0; }
.budget-field > .field-label, .budget-field > .custom, .budget-field > .hint { margin: 0; }
.budget-field > .link { justify-self: start; min-height: var(--size-touch); }
.budget-field > .menu-item { width: 100%; }

.budget-field > .custom { min-width: 0; }
.budget-field .custom input { width: 100%; }
.budget-type, .budget-period { grid-auto-flow: row; gap: 1px; background-color: var(--color-frame); }
.budget-type { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11ch), 1fr)); }
.budget-period { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9ch), 1fr)); }
.budget-field .seg button { min-width: 0; padding: var(--space-1) var(--space-half); background-color: var(--color-bg-deep); }
.budget-field .seg button + button { border-left: 0; }

.menu-item.saved, .chip.saved, .seg button.saved { animation: setting-saved var(--motion-reveal) var(--motion-ease); }
@keyframes setting-saved { 30% { box-shadow: inset 0 0 0 1px var(--color-frame-bright), inset 0 0 12px var(--color-accent-fill); } }

/* Accepted control geometry, independent from structural panel frames. */
:is(.btn, .chip, .choice, .custom input, .login input, .seg, .menu-item) { border-radius: var(--radius-control); }
.icon-btn:not(.sheet-close) { border-radius: var(--radius-control); }
.budget-field > .field-label { font-size: var(--c-settings-heading-size); letter-spacing: 1px; }
.budget-field > .hint { font-size: var(--c-settings-helper-size); line-height: 1.5; }
.budget-field > .setting-switch, .budget-field .seg button { font-size: var(--c-settings-label-size); }
/* The pill is 36px high inside an unchanged 44px touch target. */
.chips.step-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.chip.step-chip { position: relative; flex: 1 1 var(--size-touch); min-height: var(--c-step-chip-touch); padding: var(--space-half) var(--space-1h); border: 0; border-radius: var(--radius-round); background: transparent; box-shadow: none; font-size: var(--c-settings-label-size); }
.step-chip::before { content: ''; position: absolute; inset: var(--space-half) 0; border: 1px solid var(--color-line-strong); border-radius: var(--radius-round); background: linear-gradient(180deg, var(--color-surface-raised), var(--color-bg-deep)); box-shadow: inset 0 1px 0 var(--color-highlight), 0 2px 4px var(--color-shadow); transition: border-color var(--motion-ui), background-color var(--motion-ui); }
.step-chip > span { position: relative; }
.step-chip[aria-pressed=true] { color: var(--color-plaque-ink); }
.step-chip[aria-pressed=true]::before { border-color: var(--color-frame-glow); background: linear-gradient(160deg, var(--color-plaque-top), var(--color-plaque-bottom)); }
.step-chip:hover::before { border-color: var(--color-frame-bright); }

/* Settings extend the accepted medallion menu with quieter rows and varied controls. */
.settings-heading { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-1h); }
.settings-heading > span { min-width: 0; }
.settings-heading > i { flex: 1; min-width: var(--space-2); height: 1px; background: linear-gradient(90deg, var(--color-frame-bright), transparent); }
.menu-item.setting-switch { min-height: var(--size-touch); padding: var(--space-1) 0; border: 0; border-bottom: 1px solid var(--color-line); border-radius: 0; background: transparent; box-shadow: none; }
.setting-switch .switch-label { display: flex; align-items: center; gap: var(--space-1); }
.setting-switch .switch-label > .i { flex: none; width: var(--c-icon-sm); height: var(--c-icon-sm); color: var(--color-accent); }
.setting-switch .switch-caption { color: var(--color-text); font-size: var(--c-settings-label-size); }
.setting-stack .settings-field > .hint { padding-left: var(--space-3); }
.settings-section .menu-list .menu-item { padding-inline: var(--space-half); border: 0; border-bottom: 1px solid var(--color-line); background: transparent; }
.menu-item.budget-launch { position: relative; display: grid; grid-template-columns: var(--size-touch) minmax(0,1fr) var(--c-icon-sm); gap: var(--space-1); min-height: var(--space-6); padding: var(--space-2) var(--space-1h); border-color: var(--color-frame-bright); background: radial-gradient(ellipse at left top, var(--color-accent-fill), transparent), linear-gradient(160deg, var(--color-surface-hover), var(--color-bg-deep)); box-shadow: inset 0 1px 0 var(--color-highlight), 0 3px 8px var(--color-shadow); }
.budget-mark { display: grid; place-items: center; color: var(--color-accent); }
.budget-mark > .i { width: var(--c-icon-lg); height: var(--c-icon-lg); }
.budget-launch #menu-budget-value { color: var(--color-accent-strong); font: 500 var(--c-settings-value-size)/1.3 var(--font-ui); font-variant-numeric: tabular-nums; }
.budget-launch .budget-arrow { justify-self: end; }
.custom.amount-well { position: relative; border: 1px solid var(--color-frame-bright); border-radius: var(--radius-control); background: linear-gradient(160deg, var(--color-surface-sunken), var(--color-bg-deep)); box-shadow: inset 0 2px 6px var(--color-shadow); }
.amount-well input { height: var(--c-input-face-height); padding-right: var(--space-6); border: 0; background: transparent; font-size: var(--text-16); }
.amount-unit { position: absolute; top: 50%; right: var(--space-2); transform: translateY(-50%); color: var(--color-accent); font-size: var(--text-12); pointer-events: none; }
.budget-field > .reset-date { padding: var(--space-1h) 0; border-top: 1px solid var(--color-line); }
.menu-item.setting-switch .switch-caption { color: var(--color-text); font-size: var(--c-settings-label-size); }

.settings-detail { gap: var(--c-settings-group-gap); }
.settings-detail .setting-stack { gap: var(--space-1); }
.settings-field > .hint:empty { display: none; }
.menu-item.budget-launch { min-height: var(--c-button-height); padding-block: var(--c-settings-row-padding); grid-template-columns: var(--c-menu-medallion) minmax(0,1fr) var(--c-icon-sm); }
.budget-mark > .i { width: var(--c-icon-md); height: var(--c-icon-md); }

/* Compact form proportions: 44px controls, 8px field rhythm, 16px groups. */
.budget-form { gap: var(--c-settings-group-gap); }
.budget-field > .link { font: 400 var(--c-settings-helper-size)/1.4 var(--font-ui); color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 3px; }
.settings-detail .seg button { font: 400 var(--c-settings-label-size)/1.3 var(--font-ui); font-variant: normal; letter-spacing: 0; }
.sheet[data-type=budget] .sheet-foot .btn { min-height: var(--size-touch); font-size: var(--c-settings-label-size); }
.settings-detail .settings-field > .seg button { padding-inline: var(--space-half); }

/* Budget navigation: a detail page, with smaller related controls in clear modules. */
.budget-settings { display: grid; gap: var(--c-budget-module-gap); }
.budget-module { display: grid; min-width: 0; gap: var(--c-budget-field-gap); }
.budget-module > .settings-heading { margin: 0; font-size: var(--c-settings-heading-size); letter-spacing: 1px; }
.budget-module > .settings-heading > i { position: relative; }
.budget-module > .settings-heading > i::before { content: ''; position: absolute; top: -1px; left: 0; width: 3px; height: 3px; transform: rotate(45deg); background: var(--color-frame-bright); }
.budget-module > .hint { margin: 0; font-size: var(--c-settings-helper-size); line-height: 1.5; }
.budget-indent { padding-left: var(--space-3); }
.budget-calendar { display: grid; gap: var(--c-budget-related-gap); margin-top: var(--c-budget-field-gap); }
.budget-caption { color: var(--color-text-muted); font-size: var(--c-settings-helper-size); }
.budget-period-field { min-width: 0; }
.budget-settings > .budget-help { justify-self: start; min-height: var(--size-touch); padding: 0; color: var(--color-text-muted); font: 400 var(--c-settings-helper-size)/1.4 var(--font-ui); text-decoration: underline; text-underline-offset: 3px; }
.compact-choices { display: flex; flex-wrap: wrap; gap: 0 var(--space-1); }
.compact-choice { position: relative; max-width: 100%; min-height: max(var(--c-compact-choice-touch), calc(1.5em + var(--c-compact-choice-inset) * 2)); padding: var(--c-compact-choice-inset) var(--space-1h); border: 0; border-radius: var(--radius-round); background: transparent; color: var(--color-text-muted); font: 400 var(--c-compact-choice-font)/1.4 var(--font-ui); transition: color var(--motion-ui), transform var(--motion-press); }
.compact-choice::before { content: ''; position: absolute; inset: var(--c-compact-choice-inset) 0; border: 1px solid var(--color-line-strong); border-radius: var(--radius-round); background: var(--color-bg-deep); transition: background-color var(--motion-ui), border-color var(--motion-ui); }
.compact-choice > span { position: relative; }
.compact-choice[aria-pressed=true] { color: var(--color-accent-strong); }
.compact-choice[aria-pressed=true]::before { border-color: var(--color-frame-bright); background: var(--color-accent-fill); }
.compact-choice:hover::before { border-color: var(--color-frame-bright); }
.compact-choice:active { transform: translateY(1px); }
.compact-choice[aria-disabled=true] { color: var(--color-text-faint); }
.budget-mode .compact-choice, .budget-mode .compact-choice::before { border-radius: var(--radius-control); }
.time-row { display: grid; grid-template-columns: var(--c-icon-md) minmax(0,1fr) auto var(--c-icon-sm); align-items: center; gap: var(--space-1h); width: 100%; min-height: var(--size-touch); padding: var(--space-1) 0; border: 0; border-bottom: 1px solid var(--color-line); border-radius: var(--radius-control); background: transparent; text-align: left; }
.time-row-icon { display: grid; color: var(--color-accent); }
.time-row-icon .i { width: var(--c-icon-sm); height: var(--c-icon-sm); }
.time-row-copy { display: grid; gap: var(--space-half); min-width: 0; }
.time-row-label, .time-row-value { color: var(--color-text); font: 400 var(--c-settings-label-size)/1.4 var(--font-ui); }
.time-row-copy > small { color: var(--color-text-faint); font-size: var(--text-11); }
.time-row-value { font-variant-numeric: tabular-nums; color: var(--color-accent-strong); }
.time-row-arrow { color: var(--color-text-faint); text-align: right; }
.time-row:hover { background: var(--color-highlight); }
.time-row:active { transform: translateY(1px); }

/* A compact contextual time picker, not another settings page. */
.sheet.picker { align-self: end; justify-self: end; max-width: var(--c-menu-width); animation: picker-open var(--motion-surface-enter) var(--motion-enter-ease); }
.sheet.picker.closing { animation: picker-close var(--motion-surface-leave) var(--motion-leave-ease) forwards; }
.sheet.picker .sheet-foot > .btn { min-height: var(--size-touch); font-size: var(--c-settings-label-size); }
@keyframes picker-open { from { transform: translateY(calc(100% + var(--space-2))); } to { transform: none; } }
@keyframes picker-close { from { transform: var(--surface-from-transform); } to { transform: translateY(calc(100% + var(--space-2))); } }
.picker-note { margin: 0 0 var(--space-1h); color: var(--color-text-muted); font-size: var(--c-settings-helper-size); text-align: center; }
.hour-wheel-shell { --wheel-row: max(var(--c-time-wheel-row), 2em); position: relative; width: 100%; max-width: 100%; height: calc(var(--wheel-row) * 5); margin-inline: auto; font-size: var(--c-time-wheel-font); }
.hour-wheel-band { position: absolute; z-index: 1; top: calc(var(--wheel-row) * 2); left: 0; right: 0; height: var(--wheel-row); border: 0; background: none; pointer-events: none; }
.hour-wheel-edge { position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--color-frame-bright) 25%, var(--color-accent) 50%, var(--color-frame-bright) 75%, transparent); }
.hour-wheel-edge-top { top: 0; }
.hour-wheel-edge-bottom { bottom: 0; }
.hour-wheel { position: relative; height: 100%; padding-block: calc(var(--wheel-row) * 2); overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; touch-action: pan-y; font-size: inherit; }
.hour-wheel::-webkit-scrollbar { display: none; }
.hour-wheel, .hour-wheel:focus, .hour-wheel:focus-visible { outline: 0 none transparent; }
.hour-wheel:focus-visible .hour-wheel-option[aria-selected=true] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--color-accent); }
.hour-wheel-option { display: grid; place-items: center; min-height: var(--wheel-row); height: var(--wheel-row); color: var(--color-text-faint); font-size: inherit; font-variant-numeric: tabular-nums; scroll-snap-align: center; transform: scale(.94); user-select: none; }
.hour-wheel-option[aria-selected=true] { color: var(--color-text); font-weight: 600; transform: none; }

/* Optional Trading finish (?finish=engraved): material only, accepted geometry intact. */
.ui-engraved .sheet[data-type="menu:trading"] .budget-launch::before { content: ''; position: absolute; inset: var(--space-half); background: linear-gradient(135deg, transparent 5px, var(--color-frame-bright) 5px, var(--color-frame-bright) 6px, transparent 6px) top left / 12px 12px no-repeat, linear-gradient(315deg, transparent 5px, var(--color-frame-bright) 5px, var(--color-frame-bright) 6px, transparent 6px) bottom right / 12px 12px no-repeat; pointer-events: none; }
.ui-engraved .sheet[data-type="menu:trading"] .budget-launch::after { content: ''; position: absolute; inset: 1px; border-radius: inherit; background-image: var(--c-material-grain); opacity: .08; filter: grayscale(1); mix-blend-mode: soft-light; pointer-events: none; }
.ui-engraved .sheet[data-type="menu:trading"] .settings-heading > i { position: relative; }
.ui-engraved .sheet[data-type="menu:trading"] .settings-heading > i::before { content: ''; position: absolute; top: -1px; left: 0; width: 3px; height: 3px; transform: rotate(45deg); background: var(--color-frame-bright); }

/* Transparent edges preserve the material beneath; no nested wheel frame. */
.hour-wheel { mask-image: var(--c-time-wheel-mask); -webkit-mask-image: var(--c-time-wheel-mask); }
@media (max-width: 600px) {
  .sheet.picker { width: calc(100% + var(--space-1) * 2); max-width: none; margin-inline: calc(var(--space-1) * -1); margin-bottom: calc(var(--space-1h) * -1 - var(--safe-area-bottom)); padding-bottom: var(--safe-area-bottom); border: 0; border-top: 1px solid var(--color-frame-bright); border-radius: var(--radius-control) var(--radius-control) 0 0; box-shadow: 0 -16px 40px var(--color-shadow); }
  .sheet.picker .sheet-foot { border-top: 0; padding-top: var(--space-half); }
}

/* Review-only material variant (?finish=textured); background layers never cover text. */
.ui-textured body::before { display: none; }
.ui-textured body { background-image: var(--c-material-stone), radial-gradient(ellipse 140% 70% at 50% 0%, var(--color-surface) 0%, transparent 70%), radial-gradient(ellipse 120% 60% at 50% 100%, var(--color-accent-fill), transparent 75%); }
.ui-textured .sheet { background-image: var(--c-material-stone), linear-gradient(180deg, var(--color-surface-raised), var(--color-surface-sunken)); }
.ui-textured .panel { background-image: var(--c-material-stone), linear-gradient(180deg, var(--color-surface-raised), var(--color-surface) 30%, var(--color-surface-sunken)); }
.ui-textured .plaque, .ui-textured .btn.primary { background-image: var(--c-material-metal), linear-gradient(180deg, var(--color-plaque-top), var(--color-plaque-bottom)); }
.ui-textured .btn:not(.quiet):not(.primary):not(.buy):not(.sell):not(.danger):not(.tertiary) { background-image: var(--c-material-metal), linear-gradient(180deg, var(--color-surface-hover), var(--color-surface-sunken)); }
.ui-textured .btn.buy { background-image: var(--c-material-metal), linear-gradient(180deg, var(--color-buy-fill), var(--color-surface-sunken)); }
.ui-textured .btn.sell { background-image: var(--c-material-metal), linear-gradient(180deg, var(--color-sell-fill), var(--color-surface-sunken)); }
.ui-textured .btn.danger { background-image: var(--c-material-metal); }
.ui-textured .icon-btn, .ui-textured .account-pill, .ui-textured .stash { background-image: var(--c-material-metal); }
.ui-textured .sheet-head .sheet-close { background-image: var(--c-material-metal), radial-gradient(circle, var(--color-danger-fill), var(--color-bg-deep)); }
.ui-textured .menu-category .category-icon { background-image: var(--c-material-metal), radial-gradient(circle at 35% 20%, var(--color-surface-hover), var(--color-bg-deep)); }
.ui-textured .budget-launch { background-image: var(--c-material-metal), radial-gradient(ellipse at left top, var(--color-accent-fill), transparent), linear-gradient(160deg, var(--color-surface-hover), var(--color-bg-deep)); }
.ui-textured .sheet[data-type="menu:trading"] .budget-launch::after { content: none; }
.ui-textured .chip:not(.step-chip), .ui-textured .compact-choice::before { background-image: var(--c-material-metal); }
.ui-textured .step-chip::before { background-image: var(--c-material-metal), linear-gradient(180deg, var(--color-surface-raised), var(--color-bg-deep)); }
.ui-textured .step-chip[aria-pressed=true]::before { background-image: var(--c-material-metal), linear-gradient(160deg, var(--color-plaque-top), var(--color-plaque-bottom)); }
.ui-textured .seg, .ui-textured .slide, .ui-textured .side-card, .ui-textured .result-chip, .ui-textured .custom input, .ui-textured .login input { background-image: var(--c-material-well); }
.ui-textured .seg button[aria-pressed=true] { background-image: var(--c-material-metal), linear-gradient(180deg, var(--color-surface-hover), var(--color-surface-sunken)); }
.ui-textured .custom.amount-well { background-image: var(--c-material-well), linear-gradient(160deg, var(--color-surface-sunken), var(--color-bg-deep)); }
.ui-textured .amount-well input { background-image: none; }
.ui-textured .slot { background-image: var(--c-material-well), radial-gradient(circle, var(--color-surface), var(--color-bg-deep) 80%); }
.ui-textured .switch-track { background-image: var(--c-material-well); }
.ui-textured .switch-thumb { background-image: var(--c-material-metal), linear-gradient(150deg, var(--color-text-faint), var(--color-surface-hover)); }
.ui-textured .setting-switch[aria-checked=true] .switch-thumb { background-image: var(--c-material-metal), linear-gradient(150deg, var(--color-plaque-top), var(--color-plaque-bottom)); }


/* Forged metal feedback: local pressure, no layout shift, no action delay. */
.metal-pressed { transform: translateY(1px) scale(.985) !important; border-color: var(--color-frame-bright) !important; transition-duration: var(--motion-press) !important; }
.impact-layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; overflow: hidden; contain: strict; }
.impact-spark { position: absolute; left: 0; top: 0; width: var(--c-impact-spark-width); height: var(--c-impact-spark-height); border-radius: var(--radius-control); background: var(--color-plaque-top); box-shadow: 0 0 3px var(--color-accent); }
@media (prefers-reduced-motion: reduce) {
  .metal-pressed { transform: none !important; }
  .impact-layer { display: none; }
}
.wallet-sell-entry { display: flex; margin: var(--space-2) auto 0; min-height: var(--size-touch); }
.wallet-sell-entry[hidden] { display: none; }
#wallet-sales:empty { display: none; }
#wallet-sales:not(:empty) { margin-top: var(--space-2); }
.device-limits-link { display: flex; align-items: center; gap: var(--space-1); min-height: var(--size-touch); width: 100%; font: 400 var(--c-settings-label-size)/1.4 var(--font-ui); text-align: left; }
.device-limits-link > span { margin-left: auto; }
.device-budget-row { text-align: left; gap: var(--space-1); }
.device-budget-row > span:last-child { color: var(--color-text-muted); font-size: var(--c-settings-helper-size); }
.budget-inherit { justify-self: start; min-height: var(--size-touch); padding-inline: 0; font: 400 var(--c-settings-label-size)/1.4 var(--font-ui); }

.metal-pressed .category-icon { border-color: var(--color-frame-bright); }



.impact-contact { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; background: var(--color-accent); }

.time-row-label { overflow-wrap: anywhere; }

/* A drawer owns the full viewport; only its contents respect the safe areas. */
.sheet-layer.has-drawer { padding-block: 0; }
.sheet.drawer { max-height: 100%; padding-top: calc(var(--safe-area-top) + var(--space-2)); padding-bottom: var(--safe-area-bottom); }
.sheet-layer.has-drawer .sheet:not(.drawer):not(.picker) { max-height: var(--c-modal-max-height); }
.sheet-layer.has-drawer .picker { margin-bottom: 0; }
.sheet.picker, .ui-textured .sheet.picker { background: var(--color-surface-sunken); }
.main { padding-top: var(--space-1); }
.brand { min-width: var(--size-touch); min-height: var(--size-touch); padding: 0; border: 0; background: transparent; text-align: left; }
.result-chip { padding-inline: var(--space-1); }
.result-period { white-space: nowrap; }

/* Page-load feedback belongs only to a full document navigation. */
.boot-screen { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); background: var(--color-bg-deep); opacity: 1; transition: opacity var(--motion-boot-exit) var(--motion-ease); }
.boot-screen.leaving { opacity: 0; pointer-events: none; }
.booting #app, .booting #dock { visibility: hidden; }
.boot-emblem { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--color-frame-bright); border-radius: 50%; color: var(--color-accent-strong); background: var(--c-material-metal), var(--color-surface-sunken); box-shadow: inset 0 0 0 4px var(--color-bg-deep), inset 0 0 0 5px var(--color-frame), 0 0 24px var(--color-accent-fill); font: 400 var(--text-28)/1 var(--font-display); }
.boot-glyph { transform: translateY(var(--c-boot-glyph-offset)); }
.boot-screen .boot-emblem { animation: boot-breathe var(--motion-ambient) ease-in-out infinite alternate; }
.boot-caption { color: var(--color-text-muted); font-size: var(--text-12); letter-spacing: 1px; }
.boot-reveal .top, .boot-reveal #choose, .boot-reveal #login, .boot-reveal .market, .boot-reveal .wallet, .boot-reveal .rounds, .boot-reveal #dock { animation: boot-content var(--motion-surface-enter) var(--motion-enter-ease) both; }
.boot-reveal .wallet { animation-delay: var(--motion-press); }
.boot-reveal .rounds, .boot-reveal #dock { animation-delay: var(--motion-rebound); }
@keyframes boot-content { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes boot-breathe { from { opacity: .7; } to { opacity: 1; } }
/* Fixed/sticky chrome fades without translating its measured geometry. */
.boot-reveal .top, .boot-reveal #dock { animation-name: boot-fixed; }
@keyframes boot-fixed { from { opacity: 0; } to { opacity: 1; } }

.history-summary { min-height: var(--c-history-summary-height); align-content: start; }

/* Underlined detail link: quiet copy, full touch hit area, no new frame. */
.detail-link { position: relative; border: 0; padding: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--color-frame-bright); cursor: pointer; }
.detail-link::after { content: ''; position: absolute; inset: calc((1em - var(--size-touch)) / 2) 0; }
.detail-link:focus-visible { outline: 1px solid var(--color-accent); outline-offset: 3px; }
.age.detail-link { font-size: var(--text-12); color: var(--color-text-faint); }
.chart-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-1); color: var(--color-text-muted); font-size: var(--text-11); margin-top: var(--space-1); }
.chart-caption[hidden], .chart-note[hidden] { display: none; }
.chart-note { margin: var(--space-1) 0 0; font-size: var(--text-11); }
.chart-settings .settings-field { margin-top: var(--c-chart-module-gap); }
.chart-settings .settings-field:first-child { margin-top: 0; }
.chart-level-row { display: flex; justify-content: space-between; gap: var(--space-1); border-bottom: 1px solid var(--color-line); padding-block: var(--space-1); font-size: var(--text-12); }
.chart-level-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sale-origins { font-size: var(--text-12); color: var(--color-text-muted); }

.chart-retry { pointer-events: auto; width: 100%; color: var(--color-text-muted); font-size: var(--text-12); }
.chart-retry::after { inset: 0; }

.chart .leader { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .leader.buy { stroke: var(--color-buy-edge); }
.chart .leader.sell { stroke: var(--color-sell-edge); }

/* Order terms retain the established card anatomy; net profit is supporting metadata. */
.round[data-state=selling] .trade-row { grid-template-columns:var(--c-slot-size) minmax(0,1fr) var(--c-slot-size); }
.round[data-state=selling] .slot { width:var(--c-slot-size); height:var(--c-slot-size); }
.round[data-state=selling] .slot .stack { left:1px; right:1px; max-width:none; }
.sale-ratio { padding:var(--space-1) 0; --sale-fit-scale:1; }
.sale-ratio .ratio-main { justify-content:center; flex-wrap:nowrap; white-space:nowrap; overflow:visible; gap:.4em; font-size:calc(var(--c-sale-ratio-main-size) * var(--sale-fit-scale)); }
.sale-ratio .ratio-sub { display:flex; justify-content:center; align-items:baseline; gap:.25em; max-width:100%; white-space:nowrap; font-size:calc(var(--c-sale-ratio-price-size) * var(--sale-fit-scale)); }
.sale-ratio .ratio-main > span,.sale-ratio .ratio-main .i,.sale-ratio .ratio-sub > span { flex-shrink:0; }
.sale-ratio .ratio-main .i { width:1.2em; height:1.2em; }
.sale-ratio .sale-fit-wrap { flex-wrap:wrap; white-space:normal; }
.sale-ratio .ratio-main span,.sale-ratio .ratio-sub span { white-space:nowrap; }
.sale-conversion { display:inline-flex; align-items:center; gap:.266667em; }
.sale-outcome { min-width:0; margin-top:var(--space-half); font-variant-numeric:tabular-nums; }
.sale-profit { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:var(--space-half); width:100%; min-height:var(--size-touch); border:0; padding:var(--space-1) 0; background:none; color:var(--color-text); cursor:pointer; }
.sale-profit-line { display:flex; flex-wrap:wrap; justify-content:center; align-items:baseline; column-gap:var(--space-1); row-gap:var(--space-half); }
.sale-profit-label { font-size:var(--text-12); color:var(--color-text-muted); }
.sale-profit-value { display:inline-flex; align-items:baseline; gap:var(--space-half); white-space:nowrap; }
.sale-outcome strong { color:var(--color-accent-strong); font-size:var(--text-13); line-height:1.45; font-weight:500; white-space:nowrap; }
.sale-outcome.loss strong { color:var(--color-danger); }
.sale-outcome.unavailable strong { color:var(--color-text-muted); white-space:normal; }
.sale-outcome.unavailable .sale-profit-value { white-space:normal; }
.sale-profit small { font-size:var(--text-11); color:var(--color-text-faint); }
.sale-profit:focus-visible,.sale-action:focus-visible { outline:1px solid var(--color-accent); outline-offset:2px; }
.sale-profit-label { text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--color-frame); }
.round[data-state=selling] .status { margin-top:var(--space-1h); font-size:var(--text-12); letter-spacing:1px; color:var(--color-accent); }
.sale-profit .sale-origins { font-size:var(--text-11); color:var(--color-text-muted); font-weight:400; }
.round[data-state=selling] .round-live[data-live=sell-distance] { font-size:var(--text-12); }
/* Accepted sale footer: compact faces inside full touch targets. */
.sale-actions { justify-content:space-between; gap:var(--space-1); align-items:center; margin-top:var(--space-1h); border-top:1px solid var(--color-line); padding-top:var(--space-half); }
.sale-actions .sale-action.btn { position:relative; isolation:isolate; display:inline-flex; flex:0 1 auto; flex-direction:row; gap:var(--space-half); min-height:var(--c-compact-choice-touch); padding:var(--c-compact-choice-inset) var(--space-1h); border:0; border-radius:var(--radius-control); background:none; box-shadow:none; color:var(--color-accent-strong); font:400 var(--c-compact-choice-font)/1.4 var(--font-ui); font-variant:normal; letter-spacing:0; }
.sale-actions .sale-action.btn::before { content:''; position:absolute; z-index:-1; inset:var(--c-compact-choice-inset) 0; border:1px solid var(--color-frame-bright); border-radius:var(--radius-control); background:linear-gradient(180deg,var(--color-surface-hover),var(--color-surface-sunken)); box-shadow:inset 0 1px 0 var(--color-highlight); }
.ui-textured .sale-actions .sale-action.btn:not(.quiet)::before { background-image:var(--c-material-metal),linear-gradient(180deg,var(--color-surface-hover),var(--color-surface-sunken)); }
.ui-textured .sale-actions .sale-action.btn:not(.quiet):not(.primary):not(.buy):not(.sell):not(.danger):not(.tertiary),.sale-actions .sale-action.btn.quiet { background:none; }
.sale-actions .sale-action.btn.quiet { color:var(--color-text-muted); }
.sale-actions .sale-action.btn.quiet::before { background:none; border-color:var(--color-line-strong); box-shadow:none; }
.sale-actions .sale-action > span,.sale-actions .sale-action > .i { position:relative; }
.sale-actions .sale-action .i { width:var(--text-13); height:var(--text-13); }

.sale-actions .sale-action.btn:hover::before { border-color:var(--color-accent); }
.sale-actions .sale-action.btn.danger { color:var(--color-danger); background:none; }
.sale-actions .sale-action.btn.danger::before { border-color:var(--color-danger-edge); background:var(--color-danger-fill); }
.sale-actions .sale-action.btn:disabled { opacity:.65; cursor:wait; }
.revision-summary { margin-top:var(--space-3); }
.revision-summary b { font-variant-numeric:tabular-nums; }
.sale-revision-note { margin-top:var(--space-2); }

.revision-status { min-height:1.45em; }

.revision-fields .settings-field { margin-top:var(--space-3); }
.revision-fields .settings-field:first-child { margin-top:0; }
.sheet[data-type=revise] { min-width:0; max-width:min(var(--c-modal-max-width),calc(100vw - var(--space-2))); }
.revision-fields { min-width:0; }
.revision-summary .sum-row { flex-wrap:wrap; }
.revision-summary .sum-row > * { min-width:0; overflow-wrap:anywhere; }
.sheet[data-type=revise] .slide { height:max(var(--c-slide-height),calc(var(--text-16) * 3)); }
.sheet[data-type=revise] .slide-thumb { top:calc((100% - var(--c-slide-thumb)) / 2); }

.submission-status { margin:0 0 var(--space-1); color:var(--color-text-muted); font-size:var(--text-12); text-align:center; }

/* Low-emphasis actions remain buttons, including navigation to external setup. */
.btn.tertiary { background: transparent; background-image: none; border-color: transparent; box-shadow: none; color: var(--color-accent); }
@media (hover: hover) { .btn.tertiary:hover { background: var(--color-surface-hover); border-color: var(--color-line); } }
.btn.tertiary:focus-visible { outline: 1px solid var(--color-frame-bright); outline-offset: 1px; }

.field-label + .custom { margin-top: 0; }

/* Scroll chrome is quiet and never takes a separate bright surface. */
* { scrollbar-width: thin; scrollbar-color: var(--color-frame) transparent; }
*::-webkit-scrollbar { width: var(--c-scrollbar-width); height: var(--c-scrollbar-width); }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--color-frame-bright); border-radius: var(--radius-round); }
*::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }
*::-webkit-scrollbar-corner { background: transparent; }
@media (hover: none) and (pointer: coarse) {
  :is(html,body,.sheet-body,.history-list) { scrollbar-width: none; }
  :is(html,body,.sheet-body,.history-list)::-webkit-scrollbar { display: none; }
}
.sx-textarea { display: block; width: 100%; min-width: 0; max-height: 50vh; box-sizing: border-box; padding: var(--space-1h); border: 1px solid var(--color-frame); border-radius: var(--radius-control); background: var(--color-bg-deep); color: var(--color-text); font: 400 var(--text-16)/1.5 var(--font-ui); overflow: auto; overflow-wrap: anywhere; resize: none; transition: border-color var(--motion-ui) var(--motion-ease), background var(--motion-ui) var(--motion-ease); }
.sx-textarea::placeholder { color: var(--color-text-faint); opacity: 1; }
.sx-textarea:focus-visible { outline: none; border-color: var(--color-accent-strong); }
.sx-textarea[aria-invalid=true] { border-color: var(--color-danger); }
.custom input[aria-invalid=true], .custom input[aria-invalid=true]:focus-visible, .sx-textarea[aria-invalid=true]:not(:disabled), .sx-textarea[aria-invalid=true]:focus-visible { border-color:var(--color-danger); box-shadow:inset 0 0 0 1px var(--color-danger-edge); }
.settings-field.has-error .field-label { color:var(--color-danger); }
.sx-field-error { display:block; margin-top:var(--space-half); color:var(--color-danger); font:400 var(--c-settings-helper-size)/1.4 var(--font-ui); }
.sx-feedback-section { border-top:1px solid var(--color-line); margin-top:var(--space-2); padding-top:var(--space-2); }
.sx-feedback-section > .hint { margin:0; }
.sx-textarea:disabled { color: var(--color-text-faint); cursor: not-allowed; }
.sx-disclosure { min-width: 0; border-block: 1px solid var(--color-line); }
.sx-disclosure-trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1h); width: 100%; min-height: var(--size-touch); padding: var(--space-1h) 0; border: 0; background: none; color: var(--color-text); text-align: start; font: 500 var(--c-settings-label-size)/1.4 var(--font-ui); cursor: pointer; }
.sx-disclosure-trigger > .i { width: var(--space-2); height: var(--space-2); flex-shrink: 0; color: var(--color-accent); transition: transform var(--motion-content) var(--motion-ease); }
.sx-disclosure-trigger:hover { color: var(--color-accent-strong); }
.sx-disclosure-trigger:focus-visible { outline: 1px solid var(--color-accent); outline-offset: var(--space-half); }
.sx-disclosure-panel { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows var(--motion-content) var(--motion-ease), opacity var(--motion-content) var(--motion-ease), visibility var(--motion-content); }
.sx-disclosure-panel > div { min-height: 0; overflow: hidden; }
.sx-disclosure-content { padding-bottom: var(--space-1h); }
.sx-disclosure[data-open=true] > .sx-disclosure-panel { grid-template-rows: 1fr; opacity: 1; visibility: visible; }
.sx-disclosure[data-open=true] > .sx-disclosure-trigger > .i { transform: rotate(180deg); }

@supports selector(::-webkit-scrollbar) { * { scrollbar-width: auto; scrollbar-color: auto; } }
@media (hover: none) and (pointer: coarse) { :is(html,body,.sheet-body,.history-list) { scrollbar-width: none; } }

.sx-textarea[readonly] { background: var(--color-surface-sunken); border-color: var(--color-line-strong); }
.sx-textarea:disabled { border-color: var(--color-line); background: var(--color-surface-sunken); }
@media (hover: hover) and (pointer: fine) { .sx-textarea:not([readonly]) { resize: vertical; } }
.connection-wallet-facts + .sx-disclosure { border-top: 0; }
/* Approved Driftance artwork remains outlined, unfiltered and at native aspect. */
.brand-logo { display:block; height:20px; width:auto; max-width:none; object-fit:contain; }
.brand { gap:0; padding:12px; }
.boot-logo { display:block; width:auto; height:40px; }
.boot-screen .boot-emblem { background:none; border:0; box-shadow:none; animation:none; }

.brand-picture { display:block; line-height:0; }
button[data-billing-disabled] { opacity: .55; cursor: not-allowed; }
