/* qwadrat controls (2026-11-16): ONE look for segmented switches, timeframes, view toggles and selects on every legacy page
   (chart, coin page, compare, settings ...), phone and desktop. Same language as the dashboard canon chips: separate 1px tiles,
   the active one is the filled tile with a hard 3px shadow; selects get a drawn chevron instead of the native up/down glyph. Loaded last. */
html[data-theme]{--qc-sh:rgba(255,255,255,.26);--qc-chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='square'%3E%3Cpath d='M3 5.2 7 9l4-3.8'/%3E%3C/svg%3E")}
html[data-theme=light]{--qc-sh:rgba(0,0,0,.26);--qc-chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%23000000' stroke-width='1.6' stroke-linecap='square'%3E%3Cpath d='M3 5.2 7 9l4-3.8'/%3E%3C/svg%3E")}

/* segmented switch -> a row of separate tiles */
html[data-theme] .ui-segmented,html[data-theme] #qspRoot .ui-segmented{display:inline-flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important;width:max-content!important;max-width:100%!important;height:auto!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important}
html[data-theme] .ui-segmented .ui-segmented-item,html[data-theme] #qspRoot .ui-segmented .ui-segmented-item{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;min-width:44px!important;height:36px!important;margin:0!important;padding:0 16px!important;border:1px solid var(--qg-line,rgba(128,128,128,.4))!important;border-radius:0!important;background:var(--qg-panel,transparent)!important;color:var(--qg-dim,inherit)!important;font:600 12px/1 "Helvetica Neue",Helvetica,Arial,sans-serif!important;letter-spacing:.02em!important;text-transform:none!important;white-space:nowrap!important;box-shadow:none!important;cursor:pointer;transition:transform .15s ease,background .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease!important}
html[data-theme] .ui-segmented .ui-segmented-item:hover,html[data-theme] #qspRoot .ui-segmented .ui-segmented-item:hover{color:var(--qg-fg,inherit)!important;border-color:var(--qg-fg,currentColor)!important;background:var(--qg-glow,transparent)!important}
html[data-theme] .ui-segmented .ui-segmented-item.is-selected,html[data-theme] .ui-segmented .ui-segmented-item[aria-pressed=true],html[data-theme] .ui-segmented .ui-segmented-item[aria-selected=true],html[data-theme] #qspRoot .ui-segmented .ui-segmented-item.is-selected,html[data-theme] #qspRoot .ui-segmented .ui-segmented-item[aria-pressed=true]{background:var(--qg-tile,#fff)!important;color:var(--qg-ink,#000)!important;border-color:var(--qg-tile,#fff)!important;box-shadow:3px 3px 0 var(--qc-sh)!important;transform:translate(-1px,-1px)}
html[data-theme] .ui-segmented .ui-segmented-item:active{transform:translate(0,0)!important;box-shadow:none!important}
html[data-theme] .ui-segmented .ui-segmented-item:focus-visible{outline:2px solid var(--qg-fg,currentColor)!important;outline-offset:2px!important}
html[data-theme] #qspRoot .qsp-timeframes .ui-segmented-item{min-width:48px!important;font-family:"SF Mono",Menlo,monospace!important;font-size:12px!important;padding:0 12px!important}
html[data-theme] #qspRoot .qsp-view-switch .ui-segmented-item{padding:0 20px!important}

/* selects: drawn chevron, same height/frame as the tiles */
html[data-theme] select,html[data-theme] #qspRoot .qsp-select{-webkit-appearance:none!important;appearance:none!important;height:40px!important;min-height:40px!important;padding:0 38px 0 14px!important;border:1px solid var(--qg-line,rgba(128,128,128,.4))!important;border-radius:0!important;background-color:var(--qg-panel,transparent)!important;background-image:var(--qc-chev)!important;background-repeat:no-repeat!important;background-position:right 13px center!important;background-size:14px 14px!important;color:var(--qg-fg,inherit)!important;font:600 13px/1 "Helvetica Neue",Helvetica,Arial,sans-serif!important;text-overflow:ellipsis;cursor:pointer;box-shadow:none!important;transition:border-color .18s ease,background-color .18s ease}
html[data-theme] select:hover,html[data-theme] #qspRoot .qsp-select:hover{border-color:var(--qg-fg,currentColor)!important}
html[data-theme] select:focus-visible,html[data-theme] #qspRoot .qsp-select:focus-visible{outline:2px solid var(--qg-fg,currentColor)!important;outline-offset:2px!important}
html[data-theme] select:disabled{opacity:.45;cursor:default}

@media (max-width:900px){
  html[data-theme] .ui-segmented,html[data-theme] #qspRoot .ui-segmented{width:100%!important}
  html[data-theme] .ui-segmented .ui-segmented-item,html[data-theme] #qspRoot .ui-segmented .ui-segmented-item{flex:1 1 0!important;min-width:0!important;height:44px!important;padding:0 6px!important}
  html[data-theme] select,html[data-theme] #qspRoot .qsp-select{height:44px!important;min-height:44px!important;font-size:14px!important}
}
@media (prefers-reduced-motion:reduce){html[data-theme] .ui-segmented .ui-segmented-item,html[data-theme] select{transition:none!important}}

/* static blocks: nothing drags sideways, nothing jumps when numbers update, long text stays inside its block */
html[data-theme],html[data-theme] body{max-width:100%!important;overflow-x:hidden!important;overscroll-behavior-x:none}
html[data-theme] #view,html[data-theme] #view>*,html[data-theme] #qspRoot,html[data-theme] #qspRoot>*{min-width:0!important;max-width:100%!important}
html[data-theme] #qspRoot [class*="qsp-"]:not(table):not(canvas):not(svg){min-width:0}
html[data-theme] #qspRoot .qsp-metrics,html[data-theme] #qspRoot [class*="qsp-stat"],html[data-theme] #qspRoot [class*="qsp-metric"],html[data-theme] #qspRoot [class*="qsp-card"],html[data-theme] #qspRoot [class*="qsp-panel"]{overflow:hidden!important;overflow-x:clip!important;touch-action:pan-y!important;overscroll-behavior-x:none!important}
html[data-theme] #qspRoot [class*="qsp-"] strong,html[data-theme] #qspRoot [class*="qsp-"] b,html[data-theme] #qspRoot [class*="qsp-value"],html[data-theme] #qspRoot [class*="qsp-metric"] *{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-theme] table,html[data-theme] .num,html[data-theme] td,html[data-theme] th,html[data-theme] .mono,html[data-theme] [class*="qsp-"]{font-variant-numeric:tabular-nums}
html[data-theme] .card,html[data-theme] .panel,html[data-theme] [class*="-card"]{min-width:0;max-width:100%}

/* route tables fit their block: no clipped last column, no sideways drag; columns share the width */
html[data-theme] .asset-table-wrap,html[data-theme] .asset-card,html[data-theme] .spread-coin-page .card{overflow-x:hidden!important;max-width:100%!important;touch-action:pan-y}
html[data-theme] table.asset-table,html[data-theme] .spread-coin-page table{width:100%!important;table-layout:fixed!important}
html[data-theme] table.asset-table th,html[data-theme] table.asset-table td,html[data-theme] .spread-coin-page table th,html[data-theme] .spread-coin-page table td{padding-left:6px!important;padding-right:6px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px!important}
@media (max-width:900px){html[data-theme] .asset-table-wrap{overflow-x:auto!important;touch-action:pan-x pan-y}html[data-theme] table.asset-table{min-width:640px;table-layout:auto!important}}
html[data-theme] table.asset-table,html[data-theme] table.asset-table.qg-src{width:100%!important;min-width:0!important;max-width:100%!important}
html[data-theme] table.asset-table th:last-child,html[data-theme] table.asset-table td:last-child{width:64px!important}
html[data-theme] table.asset-table .num,html[data-theme] table.asset-table td{font-size:12px!important}
html[data-theme] .asset-table-wrap{margin:0!important;padding:0!important;box-sizing:border-box!important;width:100%!important;max-width:100%!important}
html[data-theme] .asset-card{padding:0!important;box-sizing:border-box!important}
