:root {
  color-scheme: dark;
  --bg: #090d0d; --surface: #121919; --surface-muted: #17201b;
  --line: #2a3530; --line-strong: #3e4d42; --text: #edf2e8; --muted: #a2afa7;
  --accent: #cbf884; --accent-strong: #d9ffa3; --accent-soft: #25351d;
  --buy: #c6eb9e; --sell: #f1a09b; --warn: #e2c07f; --warn-soft: #30291c;
  --danger: #e98f89; --danger-soft: #392321; --blue: #a6c5ed;
  --shadow: 0 18px 64px rgb(0 0 0 / 38%);
  font-family: 'Satoshi', 'Avenir Next', 'Segoe UI', ui-sans-serif, sans-serif;
}
html.high-contrast { --bg: #000; --surface: #070b08; --surface-muted: #101a12; --line: #718575; --line-strong: #a8baaa; --text: #fff; --muted: #c4d1c6; }
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 40px; transition: border-color .2s, background .2s, transform .2s; }
button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
[hidden] { display: none !important; }
.app-shell { max-width: 1700px; margin: 0 auto; min-height: 100svh; }
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 32px; min-height: 88px; padding: 18px 36px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { font-size: 27px; letter-spacing: .2em; font-weight: 600; }
.paper-label { color: var(--muted); font-size: 11px; letter-spacing: .12em; border: 1px solid var(--line); padding: 3px 7px; border-radius: 5px; }
.nav-list { display: flex; align-items: center; gap: 20px; }
.nav-list button { position: relative; border: 0; border-radius: 0; color: var(--muted); background: transparent; padding: 8px 0; }
.nav-list button.active { color: var(--text); }
.nav-list button.active::after { content: ''; position: absolute; inset: auto 0 -8px; height: 2px; background: var(--accent); }
.badge { display: inline-block; padding: 1px 5px; margin-left: 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.wallet-summary { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.wallet-summary > div { display: grid; gap: 3px; text-align: right; }
.wallet-summary > div span { color: var(--muted); font-size: 11px; }
.wallet-summary strong { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
#walletMenuButton { display: flex; align-items: center; gap: 10px; padding: 8px; text-align: left; max-width: 180px; }
#walletAvatar { display: grid; place-items: center; min-width: 31px; height: 31px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
#walletMenuButton strong, #walletMenuButton small { display: block; max-width: 114px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#walletMenuButton small { color: var(--muted); font-size: 11px; }
.main-area { padding: 0 36px 36px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 27px 0 16px; }
.kicker { color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 5px 0 0; font-size: 29px; font-weight: 500; letter-spacing: -.035em; }
.feed-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.feed-status { font-size: 12px; color: var(--muted); }
.feed-status[data-state='updating'] { color: var(--buy); }
#motionToggle { font-size: 12px; color: var(--muted); }
.global-banner { border: 1px solid #6e5c32; color: var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: 8px; margin: 8px 0; font-size: 12px; overflow-wrap: anywhere; }
.resource-health { color: var(--muted); font-size: 11px; margin: 4px 0 18px; }
.resource-health summary { cursor: pointer; width: fit-content; padding: 5px 0; }
.resource-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; }
.resource-status span { overflow-wrap: anywhere; }
.resource-status button { min-height: 30px; padding: 4px 8px; font-size: 11px; }
.view-panel { min-width: 0; animation: page-enter .3s both; }
.market-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; }
.category-tabs { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.category-tabs button { background: transparent; border-color: transparent; color: var(--muted); padding: 7px 11px; font-size: 13px; }
.category-tabs button.active { color: var(--accent); background: var(--accent-soft); }
.search-field { display: flex; align-items: center; flex: 0 1 276px; min-width: 180px; }
.search-field input { width: 100%; }
.collection-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.collection-tabs button { background: transparent; border-color: transparent; padding: 7px 11px; min-height: 34px; font-size: 12px; color: var(--muted); }
.collection-tabs button.active { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
#refreshMarketsButton { color: var(--muted); font-size: 12px; }
.market-workspace { display: grid; grid-template-columns: minmax(0,1fr); align-items: start; gap: 22px; }
.market-workspace.detail-open { grid-template-columns: minmax(0,1fr) 350px; }
.market-list-band { min-width: 0; }
.market-list-band > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.market-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.detail-open .market-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
.market-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 19px; transition: transform .25s, border-color .25s, box-shadow .25s; animation: card-enter .4s both; animation-delay: var(--enter-delay,0ms); }
.market-card:hover { transform: translateY(-3px); border-color: #718260; box-shadow: 0 12px 28px #0004; }
.market-card.active { border-color: var(--accent); }
.market-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.category-tag { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .055em; }
.market-card-title { display: block; width: 100%; min-height: 46px; padding: 0; margin: 12px 0 12px; text-align: left; color: var(--text); background: none; border: 0; border-radius: 0; font-size: 16px; line-height: 1.45; font-weight: 500; overflow-wrap: anywhere; }
.market-card-title:hover { background: transparent; color: var(--accent); }
.market-card-quote { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; overflow: hidden; }
.market-card-quote strong { display: block; font-size: clamp(29px,2.4vw,39px); line-height: 1.2; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.market-card-change { font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.market-card-label { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.market-card-outcomes { display: flex; gap: 7px; margin: 18px 0 10px; }
.card-outcome { display: flex; justify-content: center; gap: 8px; flex: 1; padding: 9px 6px; min-width: 0; border: 0; border-radius: 7px; background: #243322; color: #d6edbf; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.card-outcome > span { overflow-wrap: anywhere; }
.card-outcome:hover { background: #344b2d; }
.outcome-no { color: #f1b8b0; background: #342524; }
.outcome-no:hover { background: #49302e; }
.multi-outcome { display: grid; gap: 5px; }
.multi-outcome button { justify-content: space-between; }
.market-row-quality { display: block; min-height: 26px; color: var(--muted); font-size: 11px; line-height: 1.5; padding-top: 4px; }
.market-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.market-card-footer button { min-height: 30px; padding: 3px 0 3px 8px; border: 0; background: none; color: var(--muted); font-size: 11px; }
.market-card-footer button[aria-pressed='true'] { color: var(--accent); }
.market-pagination { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.market-pagination button { font-size: 12px; }
.empty-row, .empty-chart { display: grid; place-items: center; align-content: center; padding: 22px; min-height: 130px; text-align: center; color: var(--muted); }
.market-list > .empty-row { grid-column: 1 / -1; }
.market-detail { min-width: 0; padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); position: sticky; top: 18px; max-height: calc(100dvh - 36px); overflow: auto; animation: drawer-enter .32s both; }
.market-detail-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.market-detail-head > div { min-width: 0; }
.market-detail-head h2 { margin: 10px 0 6px; font-size: 18px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.market-detail-head p { color: var(--muted); font-size: 11px; margin: 0; overflow-wrap: anywhere; }
.mobile-back { display: block; margin-bottom: 12px; font-size: 12px; padding: 5px 8px; min-height: 32px; }
.watch-button { font-size: 11px; min-width: 48px; min-height: 32px; padding: 5px 8px; }
.watch-button.active { color: var(--accent); }
.market-description { margin: 14px 0; color: var(--muted); font-size: 11px; }
.market-description summary, .estimate-details summary, .book-details summary { cursor: pointer; padding: 7px 0; }
.market-description[open] p { max-height: 180px; overflow: auto; line-height: 1.6; }
.outcome-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.outcome-tabs button { min-width: 0; flex: 1; padding: 9px 6px; font-size: 12px; }
.outcome-tabs button.active { color: var(--accent); background: var(--accent-soft); border-color: var(--line-strong); }
.outcome-tabs button[data-outcome-name='NO'].active { color: var(--sell); background: var(--danger-soft); }
.trade-grid { display: flex; flex-direction: column; gap: 18px; }
.book-details { order: 2; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.book-panel > header { display: grid; gap: 6px; margin: 10px 0; font-size: 12px; }
.book-panel > header span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.order-ticket { min-width: 0; }
.order-ticket > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.order-ticket > header strong { font-weight: 500; }
.order-ticket > header span { color: var(--muted); font-size: 11px; }
.book-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.book-table th, .book-table td { padding: 5px 7px; text-align: right; font-variant-numeric: tabular-nums; }
.book-table th { color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--line); }
.book-table th:first-child, .book-table td:first-child { text-align: left; }
.book-table .ask td:first-child { color: var(--sell); }
.book-table .bid td:first-child { color: var(--buy); }
.spread-row { padding: 10px 3px; font-size: 11px; text-align: center; background: var(--surface-muted); }
.market-price-chart { position: relative; height: 130px; margin: 10px 0; }
.market-price-chart canvas { display: block; width: 100%; height: 130px; }
.market-price-chart > span { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 11px; }
.side-toggle { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 15px; }
.side-toggle button.active[data-side='BUY'] { background: var(--accent-soft); color: var(--buy); }
.side-toggle button.active[data-side='SELL'] { background: var(--danger-soft); color: var(--sell); }
.order-ticket form, .prediction-form-band form { display: grid; gap: 12px; }
label > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea { display: block; width: 100%; min-width: 0; padding: 10px 12px; min-height: 42px; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; }
input::placeholder { color: var(--muted); }
textarea { resize: vertical; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.field-grid label { min-width: 0; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; }
.checkbox-grid label, .checkbox-line { display: flex; align-items: center; gap: 8px; }
.checkbox-grid input, .checkbox-line input { width: 17px; min-height: 17px; height: 17px; margin: 0; flex: 0 0 17px; }
.checkbox-line span { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
legend { color: var(--muted); font-size: 12px; padding: 0 5px; }
.order-estimate { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 12px 0; font-size: 11px; }
.order-estimate > div { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.order-estimate .order-blocking, .order-estimate > small { grid-column: 1 / -1; }
.estimate-details { border-top: 1px solid var(--line); padding-top: 6px; font-size: 12px; color: var(--muted); }
#submitEstimateSummary { color: var(--muted); font-size: 12px; margin: 0; }
#orderBlockingReason { color: var(--warn); font-size: 12px; overflow-wrap: anywhere; margin: 0; min-height: 18px; }
.primary { color: #17220e; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.primary:hover { color: #17220e; background: var(--accent-strong); border-color: var(--accent-strong); }
.sell-action { background: var(--sell); border-color: var(--sell); }
.wide { width: 100%; }
.segmented { display: flex; flex-wrap: wrap; gap: 7px; }
.segmented button.active { background: var(--accent-soft); color: var(--accent); }
.subtabs, .leaderboard-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.pending-actions article { padding: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; margin-bottom: 12px; }
.metric-strip { display: grid; grid-template-columns: repeat(6, minmax(125px, 1fr)); border: 1px solid var(--line); background: var(--surface); }
.metric-strip.compact { grid-template-columns: repeat(4, minmax(125px, 1fr)); border-width: 0 0 1px; }
.metric-cell { min-width: 0; padding: 14px 15px; border-right: 1px solid var(--line); }
.metric-cell:last-child { border-right: 0; }
.metric-cell span, .metric-cell small { display: block; color: var(--muted); font-size: 10px; }
.metric-cell strong { display: block; margin: 5px 0 3px; overflow: hidden; font-size: 19px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; }
.positive { color: var(--buy) !important; }
.negative { color: var(--sell) !important; }
.band { margin-top: 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.band > header { display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.band > header span, .band > header strong { display: block; }
.band > header span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.band > header strong { margin-top: 3px; font-size: 14px; }
.chart-wrap { position: relative; height: 300px; padding: 12px; }
.chart-wrap canvas { width: 100%; height: 100%; }
.curve-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.curve-legend span { display: flex !important; align-items: center; gap: 5px; text-transform: none !important; }
.curve-legend i { width: 14px; height: 3px; border-radius: 1px; }
.quality-foot { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 15px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.two-column-bands { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 15px; }
.table-wrap { width: 100%; overflow: auto; }
.table-caption { padding: 12px 0 6px; color: var(--muted); font-size: 12px; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 12px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { position: sticky; top: 0; z-index: 1; color: var(--muted); background: var(--surface-muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.data-table td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.data-table button { min-height: 28px; padding: 3px 8px; border-radius: 4px; font-size: 11px; }
.definition-list { display: grid; }
.definition-list > div, .details > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.definition-list dt, .details dt { color: var(--muted); font-size: 11px; }
.definition-list dd, .details dd { margin: 0; font-variant-numeric: tabular-nums; }
.subtabs { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.subtabs button { padding: 9px 12px; border: 0; border-bottom: 3px solid transparent; background: transparent; }
.subtabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.prediction-layout { align-items: start; }
.prediction-form-band { padding-bottom: 15px; }
.prediction-form-band form { padding: 15px; }
.calibration-chart { display: grid; grid-template-columns: repeat(10, minmax(20px, 1fr)); align-items: end; gap: 6px; min-height: 190px; padding: 16px; border-bottom: 1px solid var(--line); }
.calibration-bin { display: grid; align-content: end; min-width: 0; height: 145px; }
.calibration-bin i { display: block; min-height: 2px; background: var(--blue); }
.calibration-bin span { margin-top: 5px; color: var(--muted); font-size: 9px; text-align: center; }
.settings-band { padding-bottom: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; padding: 16px; }
.settings-grid button { align-self: end; min-height: 38px; }
.leaderboard-toolbar { justify-content: space-between; }
.notification-list { display: grid; }
.notification-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 11px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.notification-item > i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.notification-item.read > i { background: #c7ced3; }
.notification-item strong, .notification-item span { display: block; }
.notification-item span, .notification-item time { margin-top: 3px; color: var(--muted); font-size: 11px; }
.notification-item button { align-self: center; min-height: 28px; padding: 4px 8px; border-radius: 4px; }
.inline-form { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)) auto; gap: 10px; align-items: end; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.inline-form button { min-height: 38px; padding: 7px 11px; border-radius: 4px; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 10px; padding: 15px; border-bottom: 1px solid var(--line); }
.action-grid button { min-height: 40px; padding: 8px 11px; border-radius: 4px; }
.danger-outline { color: var(--danger); border-color: #d99b9f; }
.wallet-list { display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.wallet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); }
.wallet-row strong, .wallet-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.wallet-row button { min-height: 30px; padding: 4px 8px; border-radius: 4px; }
.audit-content { display: grid; gap: 12px; max-height: 70vh; overflow: auto; }
.audit-section { border-top: 1px solid var(--line); }
.audit-section h3 { margin: 0; padding: 10px 0 6px; font-size: 13px; }
.audit-json { margin: 0; padding: 10px; overflow: auto; border: 1px solid var(--line); background: var(--surface-muted); font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.market-rules { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 1px; margin: 0 0 15px; background: var(--line); border: 1px solid var(--line); }
.market-rules > div { min-width: 0; padding: 9px 10px; background: var(--surface); }
.market-rules dt, .market-rules dd { margin: 0; }
.market-rules dt { color: var(--muted); font-size: 10px; }
.market-rules dd { margin-top: 3px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.market-description { margin: 10px 0 0; max-width: 900px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.allocation-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.allocation-buttons button { min-height: 30px; border-radius: 4px; font-size: 11px; }

.modal { width: min(470px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: var(--shadow); }
.modal::backdrop { background: rgb(11 22 27 / 45%); }
.wide-modal { width: min(760px, calc(100vw - 28px)); }
.modal-body { display: grid; gap: 13px; padding: 20px; }
.modal-body > header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-body h2 { margin: 3px 0 0; font-size: 19px; }
.modal-body header span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.modal-body header button { width: 32px; height: 32px; border: 0; border-radius: 50%; font-size: 20px; }
.login-body p, .fidelity-grid p, .wide-modal > .modal-body > p { margin: 0; color: var(--muted); line-height: 1.5; }
.login-body small { color: var(--muted); }
.fidelity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fidelity-grid > div { padding: 12px; border: 1px solid var(--line); }
.fidelity-grid p { margin-top: 7px; font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(480px, calc(100vw - 44px)); padding: 12px 15px; border-radius: 5px; color: var(--text); background: #263b40; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: var(--danger); }
.noscript { padding: 30px; }


.modal { background: var(--surface); color: var(--text); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 14px; }
.modal-body header button { min-width: 42px; width: auto; min-height: 36px; height: auto; padding: 5px 8px; border-radius: 6px; font-size: 12px; }
.modal-body h2 { font-weight: 500; }
.mobile-more { display: grid; gap: 8px; }
.market-rules { grid-template-columns: repeat(2,minmax(0,1fr)); }
.market-rules > div { background: var(--surface); }
.metric-cell span, .metric-cell small, .band > header span, .data-table th, .modal-body header span, .market-rules dt, .calibration-bin span { font-size: 11px; }
.toast { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-muted); color: var(--text); }
.toast.error { background: var(--danger-soft); color: var(--sell); }
.toast:not([hidden]) { animation: drawer-enter .25s both; }
.table-wrap, .band, .two-column-bands, .settings-grid, .metric-cell { min-width: 0; }
.quality-chip, .pill { color: var(--muted); background: var(--surface-muted); font-size: 11px; padding: 3px 7px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.market-card.quote-up { animation: quote-up .75s; }
.market-card.quote-down { animation: quote-down .75s; }
@keyframes card-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes page-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drawer-enter { from { opacity: 0; transform: translateX(13px); } to { opacity: 1; transform: translateX(0); } }
@keyframes quote-up { 0% { border-color: #7d9c56; background: #202b1c; } 100% { border-color: var(--line); background: var(--surface); } }
@keyframes quote-down { 0% { border-color: #9c625a; background: #2b2020; } 100% { border-color: var(--line); background: var(--surface); } }
@media (max-width: 1250px) {
  .wallet-equity { display: none !important; }
  .site-header { gap: 24px; }
  .market-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .detail-open .market-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .metric-strip.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1000px) {
  .site-header { padding: 18px 24px; gap: 20px; }
  .main-area { padding: 0 24px 28px; }
  .wallet-summary { gap: 12px; }
  #walletMenuButton > span:last-child { display: none; }
  .nav-list { gap: 16px; }
  .market-workspace.detail-open { grid-template-columns: minmax(0,1fr) 320px; gap: 16px; }
  .detail-open .market-list { grid-template-columns: minmax(0,1fr); }
  .two-column-bands, .settings-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .site-header { padding: 16px; gap: 16px; }
  .nav-list { order: 3; width: 100%; justify-content: space-between; padding-bottom: 4px; }
  .main-area { padding: 0 16px 24px; }
  .brand strong { font-size: 24px; }
  .brand { gap: 8px; }
  .wallet-summary { gap: 8px; }
  .wallet-summary strong { font-size: 12px; }
  .wallet-summary > div span { font-size: 11px; }
  .topbar h1 { font-size: 26px; }
  .category-tabs { flex-basis: 100%; }
  .search-field { flex: 1; min-width: 0; }
  .collection-tabs { gap: 3px; }
  .collection-tabs button { padding: 6px 8px; }
  .market-list, .detail-open .market-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .market-card { padding: 15px; }
  .market-card-title { font-size: 15px; min-height: 67px; }
  .market-card-quote strong { font-size: 30px; }
  .market-workspace.detail-open { display: flex; flex-direction: column; }
  .market-detail { position: relative; top: auto; order: -1; width: 100%; max-height: none; overflow: visible; }
  .market-list-band { width: 100%; }
  .market-detail-head { gap: 12px; }
  .metric-strip, .metric-strip.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-cell { border-bottom: 1px solid var(--line); }
  .fidelity-grid { grid-template-columns: minmax(0,1fr); }
  .field-grid, .inline-form, .action-grid { grid-template-columns: minmax(0,1fr); }
  .chart-wrap { height: 230px; }
  .data-table { min-width: 600px; }
  .band > header { gap: 10px; align-items: start; flex-wrap: wrap; }
  .market-card-meta, .market-card-footer { flex-wrap: wrap; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 460px) {
  .site-header { gap: 12px; }
  .brand strong { font-size: 20px; }
  .paper-label { padding: 2px 5px; font-size: 11px; }
  .wallet-summary > div { max-width: 135px; }
  #walletMenuButton { padding: 5px; }
  #walletAvatar { min-width: 28px; height: 28px; }
  .market-list, .detail-open .market-list { grid-template-columns: minmax(0,1fr); }
  .market-card-title { min-height: 43px; font-size: 16px; }
  .market-card { padding: 19px; }
  .market-card-quote strong { font-size: 38px; }
  .market-card-meta, .market-card-footer { flex-wrap: nowrap; }
  .metric-strip, .metric-strip.compact { grid-template-columns: minmax(0,1fr); }
  .definition-list > div, .details > div { grid-template-columns: minmax(0,1fr); }
  .definition-list dd, .details dd { overflow-wrap: anywhere; }
}
@media (pointer: coarse) { button, .data-table button, .market-card-footer button, .mobile-back, .watch-button { min-height: 44px; } }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
