/* Shared surfaces and typography use the user-supplied CSLUP palette. */
:root {
  --canvas: var(--color-background);
  --panel: var(--color-surface);
  --surface-raised: var(--color-surface-alt);
  --surface-input: var(--color-surface-control);
  --surface-selected: var(--color-surface-control-hover);
  --line: var(--color-border-strong);
  --line-strong: var(--color-border-light);
  --text: var(--color-foreground);
  --muted: var(--color-text-secondary);
  --accent: #bc416b;
  --rose: #bc416b;
  --green: #1fad82;
  --red: #cf3f52;
}
body { background: var(--canvas); color: var(--text); }
html { scroll-padding-block: 16px; scrollbar-gutter: stable; }
:where(button,a,input,select,summary,label,[role=button],[role=option]) { -webkit-tap-highlight-color: transparent; }
:where(button,a,input,select,summary,[tabindex]) { scroll-margin-block: 16px; }
:where(h1,h2,h3) { text-wrap: balance; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 999; padding: 10px 16px; border: 1px solid var(--color-focus); border-radius: var(--ui-radius-control); background: var(--panel); color: var(--text); transform: translateY(calc(-100% - 16px)); }
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--color-focus); outline-offset: 3px; }
#main-content:focus { outline: none; }
@media (max-width:640px) { html { scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom)); } }
button, input, select { font: inherit; }
button {
  background:linear-gradient(120deg,#302831,#252127);
  border-color:#564450;
  border-radius:10px 10px 10px 5px;
}
button:enabled:hover { background:#372b35; border-color:#846475; }
input, select { background: var(--surface-input); border-color: var(--line); color: var(--text); }
input::placeholder { color: var(--muted); opacity: 1; }
:where(button, a, input, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brand-btn, .brand-btn:hover, .topbar.fusion-header>.brand-btn { background: #d2d2d2; color: #19191c; border-color: transparent; box-shadow: none; }
.brand-btn:hover, .topbar.fusion-header>.brand-btn:hover { background: #d2d2d2; }
.ghost { background: var(--surface-raised); border-color: var(--line); color: var(--text); }
.ghost:hover { background: #313034; }
.exchange-rail, .topbar.fusion-header { background: #101012; border-color: var(--line); }
.exchange-rail nav a, .rail-bottom button, .header-help, .markets-link { color: var(--muted); }
.exchange-rail nav a.active { background: var(--surface-selected); color: #d2d2d2; }
.exchange-rail nav a.active:before { background: var(--accent); }
.exchange-rail nav a:hover { background: var(--surface-raised); color: var(--text); }
.fusion-wordmark>span, .markets-link:hover { color: var(--accent); }
.fusion-wordmark>small, .fusion-header .header-account>small, .fusion-header .header-account strong small { color: var(--muted); }
.exchange-environment { color: #d2d2d2; border-color: #313034; }
.fusion-shell .panel, .fusion-shell .simple-market, .fusion-shell .simple-order,
.fusion-shell .mini-market, .fusion-shell .shop-cart, .fusion-shell .shop-intro,
.fusion-shell .simple-inventory-bar, .fusion-shell .stat-card,
.fusion-shell .simple-position-card { background: var(--panel); border-color: var(--line); }
.pair-watchlist, .fusion-shell .market-details, .fusion-shell .pro-flow { background: #19191c; border-color: var(--line); }
.instrument-bar, .fusion-shell .pro-market-stats, .fusion-shell .order-pair-caption,
.fusion-shell .simple-order .trade-settings, .simple-position-market, .simple-selected-total,
.simple-details, .exit-fields, .fusion-shell .footer { border-color: var(--line); }
.pair-watchlist button.active>span, .pair-trigger:hover { color: var(--accent); }
.instrument-quote>strong { color: var(--text); }
.pair-menu { background: var(--panel); border-color: #313034; }
.pair-menu input { background: var(--surface-input); border-color: var(--line); }
.pair-menu-tabs button.active { color: var(--accent); border-color: var(--accent); }
.pair-option:hover, .pair-option.current { background: var(--surface-raised); }
.pair-star.saved { color: var(--accent); }
.pair-menu-note { border-color: var(--line); }
.fusion-shell .mode-picker, .fusion-shell .toolbar .segmented, .speed-picker { background: var(--surface-input); border-color: var(--line); }
.fusion-shell .mode-picker button.active, .segmented button.active, .speed-picker button.active,
.pro-chart-tools button.active { background: var(--surface-selected); color: #d2d2d2; }
.inventory-emblem, .history-icon, .count { background: var(--surface-selected); color: #d2d2d2; }
.fusion-shell .simple-pick, .fusion-shell .mini-skin, .fusion-shell .simple-result-skin,
.fusion-shell .skin-card, .fusion-shell .shop-card .skin-card-content { background: var(--surface-raised); border-color: #313034; }
.fusion-shell .skin-art, .fusion-shell .shop-card .skin-art { background: radial-gradient(ellipse at 50% 40%, #d2d2d22a, transparent 75%), #19191c; }
.fusion-shell .simple-pick.selected { background: var(--surface-selected); border-color: #d2d2d2; box-shadow: inset 0 0 0 1px #d2d2d222; }
.fusion-shell .simple-pick.selected .pick-check { background: #d2d2d2; border-color: #d2d2d2; color: #19191c; }
.fusion-shell .simple-pick .collateral-price, .simple-result-skin>b, .result-upgrade b { color: #d2d2d2; }
.fusion-shell .go-up, .fusion-shell .simple-take { background: #d2d2d2; color: #19191c; }
.fusion-shell .go-up:hover, .fusion-shell .simple-take:hover { background: #d2d2d2; }
.fusion-shell .go-down { background: #d2d2d2; color: #19191c; }
.fusion-shell .go-down:hover { background: #d2d2d2; }
.fusion-shell .mini-buy, .fusion-shell .shop-card .skin-card-content button, .skin-card-content button { background: #313034; border-color: #313034; color: #d2d2d2; }
.fusion-shell .mini-buy:hover, .fusion-shell .shop-card .skin-card-content button:hover { background: #313034; color: #d2d2d2; }
.upgrade-track { background: #313034; }
.upgrade-track i { background: #d2d2d2; }
.shop-filters input, .shop-filters select, .simple-shop-filters .shop-filter-details,
.fusion-shell .mini-filters input { background: var(--surface-input); border-color: var(--line); }
.mobile-cart-jump, .mobile-cart-jump.has-items { background: #313034; border-color: #313034; color: #d2d2d2; }
.notice, .notice.amber, .modal-body .notice { background: #19191c; border-color: #313034; color: #d2d2d2; }
.live-controls { background: var(--surface-input); border-color: var(--line); }
.live-options select, .live-options>button { background-color: var(--surface-raised); border-color: var(--line); }
.topup-summary, .deposit-preview, .claim-item, .balance-large { background: var(--surface-raised); border-color: var(--line); }
.topup-summary b, .deposit-preview p { color: var(--green)!important; }
.simple-help-steps b { background: var(--surface-selected); color: #d2d2d2; }
.toast { background: #313034; border-color: #313034; color: var(--text); }
.toast:not(.error) { border-left-color: var(--green); }
.budget-control { background: var(--surface-raised); border-color: var(--line); }
.budget-control input[type=number] { background: var(--surface-input); border-color: #313034; color: #d2d2d2; }
.budget-control input[type=range]::-webkit-slider-thumb { background: #d2d2d2; border-color: #d2d2d2; }
.budget-control input[type=range]::-moz-range-thumb { background: #d2d2d2; border-color: #d2d2d2; }
.budget-presets button:hover { color: var(--text); }
.simple-subtitle, .simple-picker-note, .simple-risk-copy, .simple-take-note,
.fusion-shell .simple-chart-hint, .simple-details, .details-content p,
.simple-result-note, .modal-body .simple-result-note, .simple-result-value>span,
.simple-result-value>div>span, .simple-result-remainder, .simple-result-skin small,
.simple-inventory-bar>div:first-child>span, .simple-inventory-bar strong small,
.simple-shell .shop-result-count, .simple-shop-description, .exit-fields label,
.pair-watchlist button, .pair-menu-note, .pair-columns, .budget-range-caption,
.budget-control>label>span, .budget-control>label small, .budget-presets button,
.topup-summary>span, .topup-summary>strong small, .topup-summary>div,
.selection-toolbar, .selection-toolbar button, .claim-item small,
.fusion-shell .footer, .fusion-shell .footer .text-btn { color: var(--muted); }

/* Dialogs have independent header, scroll area and action row. */
dialog:not(.picker-dialog) { width: 480px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); padding: 22px; background: var(--panel); border: 1px solid #313034; border-radius: 14px; color: var(--text); overflow: hidden; box-shadow: 0 24px 80px #0007; }
dialog:not(.picker-dialog)[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #101012c4; backdrop-filter: blur(4px); }
dialog:not(.picker-dialog) .modal-head { flex: none; gap: 16px; margin: 0 0 18px; align-items: flex-start; }
dialog:not(.picker-dialog) .modal-head h2 { font-size: 20px; font-weight: 600; line-height: 1.35; letter-spacing: -.3px; padding-top: 3px; }
.close-x { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border-radius: 7px; color: var(--muted); line-height: 1; }
.close-x:hover { background: var(--surface-raised); color: var(--text); }
dialog:not(.picker-dialog) .modal-body { display: grid; gap: 16px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 3px 1px 0; }
dialog:not(.picker-dialog) .modal-body p { font-size: var(--type-subhead); font-weight: 400; line-height: 1.55; color: var(--muted); margin: 0; }
dialog:not(.picker-dialog) .kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; font-size: var(--type-body); line-height: 1.5; }
dialog:not(.picker-dialog) .kv>span { color: var(--muted); min-width: 0; }
dialog:not(.picker-dialog) .kv>strong { font-size: var(--type-body); font-weight: 500; text-align: right; flex: none; max-width: 60%; }
dialog:not(.picker-dialog) .notice { font-size: var(--type-body); line-height: 1.5; padding: 12px 14px; }
dialog:not(.picker-dialog) .modal-actions { display: flex; flex: none; gap: 10px; margin: 20px 0 0; padding: 16px 0 0; position: static; background: transparent; border-top: 1px solid var(--line); backdrop-filter: none; }
dialog:not(.picker-dialog) .modal-actions button { min-width: 0; min-height: 44px; padding: 10px 12px; font-size: var(--type-body); line-height: 1.4; font-weight: 500; white-space: normal; }
#modal-error:empty { display: none; }
#modal-error { flex: none; font-size: var(--type-body); line-height: 1.5; }
.settlement-summary { padding: 20px 16px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); text-align: center; }
.settlement-label { display: block; font-size: var(--type-body); line-height: 1.5; color: var(--muted); }
.settlement-amount {font-size: clamp(30px, 7vw, 40px); display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.settlement-amount>strong { font-size:inherit; line-height: 1.2; letter-spacing: -1px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.settlement-amount>span { font-size: var(--type-body); font-weight: 400; color: var(--muted); }
.settlement-breakdown { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); text-align: left; }
.simple-help-steps { gap: 20px; }
.simple-help-steps>div>div { min-width: 0; }
.simple-help-steps h3 { font-size: var(--type-subhead); font-weight: 600; line-height: 1.4; }
dialog .simple-confirm-direction { padding: 0 0 8px; font-size: 25px; line-height: 1.3; }
dialog .simple-confirm-direction small { color: var(--muted); font-size: var(--type-body); }
dialog .simple-details summary { font-size: var(--type-body); padding: 12px 0; }
dialog .details-content { padding: 0 0 14px; gap: 14px; }
dialog .simple-details .details-content p { font-size: var(--type-body); }
dialog .simple-result-note { font-size: var(--type-label)!important; }
dialog .simple-basket { margin-top: 0!important; }
dialog .simple-result-skin { background: var(--surface-raised); border-color: #313034; }
dialog .simple-result-skin small { font-size: var(--type-label)!important; }
dialog .simple-result-value>span { font-size: var(--type-body)!important; }
dialog .simple-result-value>div { font-size: var(--type-label)!important; }
dialog .simple-result-remainder { font-size: var(--type-label); }
dialog .live-controls { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; margin: 0; padding: 14px; gap: 12px; }
dialog .live-state { flex: none; align-self: stretch; }
dialog .live-caption { flex: none; align-self: stretch; width: auto; line-height: 1.5; }
dialog .live-heading, dialog .live-caption { font-size: var(--type-body); color: var(--muted); }
dialog .live-options { display: flex; width: 100%; gap: 10px; flex-wrap: wrap; }
dialog .live-options button, dialog .live-options select, dialog .demo-setting button { font-size: var(--type-body); min-height: 36px; }
dialog .speed-picker { display: flex; flex: none; }
dialog .demo-setting .flex { flex-wrap: wrap; gap: 10px; }
dialog .demo-setting h3 { font-size: var(--type-body); }
dialog .claim-item { gap: 12px; text-align: left; font-size: var(--type-body); min-width: 0; }
dialog .claim-item img { flex: none; width: 60px; }
dialog .claim-item>span:not(.price), dialog .claim-item>div { min-width: 0; }
dialog .claim-item .price { font-size: var(--type-body); white-space: nowrap; }
dialog .exit-fields { padding-top: 0; border: 0; }
dialog .exit-fields label { font-size: var(--type-body); }
dialog .exit-fields input { font-size: var(--type-subhead); }

/* The compact skin picker keeps its existing footprint. */
.picker-dialog[open] { background: var(--panel); border-color: #313034; }
.picker-dialog .picker-budget-stats>div { background: var(--surface-raised); }
.picker-dialog .picker-budget-stats>div:last-child { background: var(--surface-selected); }
.picker-dialog .picker-budget-stats>div:last-child strong { color: #d2d2d2; }
.picker-dialog .picker-budget-stats span, .picker-dialog .picker-weapon, .picker-dialog .picker-card-foot { color: var(--muted); }
.picker-dialog .picker-card { background: var(--surface-raised); border-color: #313034; }
.picker-dialog .picker-card.selected { background: var(--surface-selected); border-color: #d2d2d2; }
.picker-dialog .picker-card:hover { background: #313034; }
.picker-dialog .picker-card-price { color: #d2d2d2; }
.picker-dialog .selected .picker-tick { background: #d2d2d2; border-color: #d2d2d2; color: #19191c; }
.picker-dialog .picker-select strong { font-size: var(--type-label); white-space: normal; overflow-wrap: normal; min-height: 35px; display: block; }
.picker-dialog .picker-select { min-height: 132px; }
.picker-dialog .picker-footer-action>.brand-btn { background: #d2d2d2; color: #19191c; min-height: 40px; }
.picker-dialog .picker-controls input { background: var(--surface-input); border-color: var(--line); }
.picker-dialog .picker-card-foot button, .picker-dialog .picker-clear { background: #313034; border-color: var(--line); color: var(--text); }
.picker-dialog .budget-control { background: transparent; }
.picker-dialog .modal-actions { background: transparent; }
.picker-dialog #picker-catalog { scrollbar-color: #313034 var(--surface-input); }
.instrument-quote>small, .fusion-shell .mini-catalog-count { color: var(--muted); }
.instrument-quote>span, .instrument-quote>small, .pair-trigger strong small,
.fusion-header .header-account strong small { font-size: var(--type-label); }
.fusion-shell .simple-selected-total small, .fusion-shell .footer .text-btn,
.fusion-shell .pro-flow .tape-columns time, .count { font-size: var(--type-label); }
.fusion-shell .mini-market small, .fusion-shell .simple-result-value>strong small { font-size: var(--type-label); }
@media (max-width: 640px) {
  .exchange-rail { background: #101012f5; }
  dialog:not(.picker-dialog) { padding: 18px; max-height: calc(100dvh - 24px); }
  dialog:not(.picker-dialog) .modal-head h2 { font-size: 19px; }
  dialog:not(.picker-dialog) .modal-body p { font-size: var(--type-lead); }
  dialog:not(.picker-dialog) .modal-actions button { font-size: var(--type-body); }
  .settlement-summary { padding: 18px 12px 14px; }
}
@media (max-width: 370px) {
  dialog:not(.picker-dialog) .modal-actions { flex-direction: column-reverse; gap: 8px; }
  dialog:not(.picker-dialog) .kv { gap: 8px; font-size: var(--type-label); }
  dialog:not(.picker-dialog) .kv>strong { font-size: var(--type-label); }
  dialog .claim-item { flex-wrap: wrap; }
}
