    :root {
      color-scheme: dark;
      --bg: #080b12;
      --panel: #101620;
      --panel-2: #0c111a;
      --line: #263142;
      --text: #e7edf5;
      --muted: #8794a8;
      --up: #26d7a0;
      --down: #ff647c;
      --accent: #a7b0bd;
      --cvd: #55a7ff;
      --poly-up: #8fd3ff;
      --poly-down: #315f91;
      --fair-up: #f9a8d4;
    }

    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-width: 320px;
      background: radial-gradient(circle at top, #151d2b 0, var(--bg) 38rem);
      color: var(--text);
      font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    button, select, input { font: inherit; }
    .shell { width: min(1500px, 100%); margin: 0 auto; padding: 24px; }
    header { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 18px; }
    h1 { margin: 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.04em; }
    .page-title-row { display: flex; align-items: center; gap: 10px; }
    .chart-config-button {
      display: inline-flex; align-items: center; justify-content: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px;
      padding: 7px; border-radius: 50%; color: var(--muted); background: rgba(18,26,38,.84);
    }
    .chart-config-button[hidden] { display: none; }
    .chart-config-button:hover { color: var(--text); border-color: #64748b; }
    .chart-config-button:focus-visible { outline: 2px solid #8fd3ff; outline-offset: 2px; }
    .chart-config-button svg { display: block; width: 100%; height: 100%; fill: currentColor; }
    .subtitle { color: var(--muted); margin-top: 5px; }
    .controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
    label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
    .field { display: grid; gap: 5px; }
    input, select, button {
      min-height: 38px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #121a26; padding: 7px 11px;
    }
    input { width: 130px; text-transform: uppercase; }
    button { cursor: pointer; font-weight: 700; }
    button:hover { border-color: #53627a; }
    .chart-config-dialog {
      width: min(560px, calc(100vw - 28px)); max-height: min(720px, calc(100dvh - 28px)); margin: auto;
      padding: 0; overflow: hidden; border: 1px solid #3a485d; border-radius: 14px; color: var(--text);
      background: #101620; box-shadow: 0 22px 70px rgba(0,0,0,.68);
    }
    .chart-config-dialog::backdrop { background: rgba(2,6,12,.74); backdrop-filter: blur(3px); }
    .chart-config-dialog form { display: flex; flex-direction: column; max-height: min(720px, calc(100dvh - 28px)); }
    .chart-config-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
    .chart-config-head h2 { margin: 0; font-size: 19px; }
    .chart-config-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
    .chart-config-close { min-width: 32px; width: 32px; min-height: 32px; padding: 0; border-radius: 50%; color: var(--muted); font-size: 22px; line-height: 1; }
    .chart-config-options { overflow-y: auto; padding: 8px 20px 14px; }
    .chart-config-group { margin: 12px 0 0; }
    .chart-config-group h3 { margin: 0 0 7px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
    .chart-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
    .chart-config-option { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 8px 10px; border: 1px solid #253146; border-radius: 8px; color: #d8e1ed; cursor: pointer; }
    .chart-config-option:hover { border-color: #465976; background: #141e2c; }
    .chart-config-option input { width: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: #55a7ff; }
    .chart-config-swatch { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 3px; background: var(--swatch, #94a3b8); }
    .chart-config-range { display: grid; grid-template-columns: auto minmax(130px,1fr) 34px; align-items: center; gap: 12px; min-height: 44px; padding: 9px 10px; border: 1px solid #253146; border-radius: 8px; color: #d8e1ed; font-size: 12px; letter-spacing: 0; text-transform: none; }
    .chart-config-range input { width: 100%; min-height: 18px; height: 18px; margin: 0; padding: 0; accent-color: #55a7ff; cursor: pointer; }
    .chart-config-range output { color: var(--text); font: 12px ui-monospace,monospace; text-align: right; }
    .chart-config-actions { display: flex; justify-content: space-between; gap: 10px; padding: 13px 20px; border-top: 1px solid var(--line); background: #0c111a; }
    .chart-config-actions .primary { min-width: 90px; border-color: #496c98; background: #1c3859; }
    .statusbar {
      display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 11px 14px; margin-bottom: 14px;
      border: 1px solid var(--line); border-radius: 10px; background: rgba(16,22,32,.92); color: var(--muted);
    }
    .status { display: inline-flex; gap: 8px; align-items: center; }
    .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 10px currentColor; }
    .connected .dot { background: var(--up); }
    .metric strong { color: var(--text); margin-left: 5px; font-variant-numeric: tabular-nums; }
    .markov-value { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #1a2534; color: var(--text) !important; line-height: 1.5; }
    .markov-value.bull-trend { background: rgba(38, 215, 160, .16); color: #60f0c0 !important; }
    .markov-value.bear-trend { background: rgba(255, 100, 124, .16); color: #ff8da0 !important; }
    .markov-value.bull-range { background: rgba(255, 218, 97, .16); color: #ffe18a !important; }
    .markov-value.bear-range { background: rgba(85, 167, 255, .16); color: #8cc6ff !important; }
    .markov-value.error { background: rgba(255, 100, 124, .12); color: #ff9aaa !important; }
    #error { color: #ff9aaa; }
    .trade-panel { position: fixed; right: 10px; bottom: 10px; z-index: 50; width: min(315px,calc(100vw - 20px)); max-height: calc(100vh - 20px); overflow: hidden; border: 1px solid #344258; border-radius: 10px; background: rgba(11,16,25,.97); box-shadow: 0 14px 42px rgba(0,0,0,.55); font-size: 12px; }
    .trade-panel button { min-height: 29px; padding: 3px 7px; }
    .trade-panel label { font-size: 9px; }
    .trade-head, .trade-actions, .trade-current-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .trade-head { justify-content: space-between; padding: 7px 9px; border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
    .trade-panel.dragging .trade-head { cursor: grabbing; }
    .trade-head button { cursor: pointer; }
    .trade-head h2 { margin: 0; font-size: 12px; }
    .trade-brand { display: flex; align-items: center; gap: 7px; min-width: 0; }
    .trade-brand-logo { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
    .trade-brand-text { color: var(--text); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .trade-collapse { min-width: 25px; min-height: 25px; padding: 1px 7px; font-weight: 900; }
    .trade-panel.collapsed { width: 46px; height: 46px; border-radius: 50%; }
    .trade-panel.collapsed .trade-head { width: 100%; height: 100%; justify-content: center; padding: 0; border: 0; }
    .trade-panel.collapsed .trade-head h2,
    .trade-panel.collapsed .trade-connection,
    .trade-panel.collapsed .trade-order-pane,
    .trade-panel.collapsed .trade-current { display: none; }
    .trade-panel.collapsed .trade-collapse { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: #1b2b40; color: #fff; font-size: 16px; }
    .trade-connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
    .trade-connection .dot { background: var(--down); }
    .trade-connection.connected .dot { background: var(--up); }
    .trade-balance { color: #e7edf5; font: 12px ui-monospace,monospace; }
    .trade-order-pane { padding: 7px 9px 8px; }
    .trade-tabs { display: flex; gap: 5px; margin-bottom: 6px; }
    .trade-tab { flex: 1; min-height: 28px; padding: 3px 6px; color: var(--muted); font-size: 10px; }
    .trade-tab.active { border-color: #5b7698; background: #1b2b40; color: #fff; }
    .trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 7px; align-items: end; }
    .trade-grid.quick-q { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .trade-grid .field { min-width: 0; }
    .trade-grid [hidden] { display: none !important; }
    .trade-grid input, .trade-grid select { width: 100%; min-height: 29px; padding: 3px 6px; text-transform: none; font-size: 11px; }
    .trade-actions { margin-top: 7px; gap: 5px; }
    .trade-actions[hidden] { display: none !important; }
    .trade-actions button.primary { border-color: #32745f; background: #174737; color: #eafff7; }
    .trade-actions button.primary:disabled { cursor: not-allowed; opacity: .42; }
    .trade-actions .buy-up { flex: 1; border-color: #28785e; background: #15543f; color: #edfff8; }
    .trade-actions .buy-down { flex: 1; border-color: #8f3c4d; background: #5c2632; color: #fff1f4; }
    .trade-actions .buy-up:disabled, .trade-actions .buy-down:disabled { cursor: not-allowed; opacity: .42; }
    .trade-arm { display: inline-flex; align-items: center; gap: 4px; color: #ffbdc8; font-size: 10px; font-weight: 700; }
    .trade-arm input { width: auto; min-height: auto; }
    .trade-message { margin-top: 5px; min-height: 14px; color: #aeb8c7; font: 9px/1.3 ui-monospace,monospace; overflow-wrap: anywhere; }
    .trade-message.success { color: var(--up); }
    .trade-message.failure { color: #ff9aaa; }
    .trade-ml-panel, .trade-la-panel { margin-top: 7px; border-top: 1px solid #1b2635; padding-top: 7px; }
    .trade-ml-panel[hidden], .trade-la-panel[hidden] { display: none !important; }
    .trade-ml-head, .trade-la-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
    .trade-ml-head button, .trade-la-head button { min-width: 28px; min-height: 24px; padding: 1px 7px; border-color: #32745f; color: #eafff7; }
    .trade-ml-rows, .trade-la-rows { display: grid; gap: 5px; }
    .trade-ml-row { display: grid; grid-template-columns: 1fr 1fr 1fr 24px; gap: 4px; align-items: end; }
    .trade-la-row { display: grid; grid-template-columns: 1fr 34px 34px 24px; gap: 4px; align-items: end; }
    .trade-ml-row label, .trade-la-row label { display: grid; gap: 3px; min-width: 0; }
    .trade-ml-row input, .trade-la-row input { width: 100%; min-height: 25px; padding: 2px 5px; text-transform: none; font: 10px ui-monospace,monospace; }
    .trade-la-up, .trade-la-down { min-width: 34px; min-height: 25px !important; padding: 0 !important; font-size: 10px; }
    .trade-la-up { border-color: #28785e; background: #15543f; color: #edfff8; }
    .trade-la-down { border-color: #8f3c4d; background: #5c2632; color: #fff1f4; }
    .trade-la-up:disabled, .trade-la-down:disabled { cursor: not-allowed; opacity: .42; }
    .trade-ml-remove, .trade-la-remove { min-width: 24px; min-height: 25px !important; padding: 0 !important; border-color: #8f3c4d; color: #ffbdc8; }
    .trade-current { border-top: 1px solid var(--line); background: #090e16; }
    .trade-current-head { justify-content: space-between; padding: 5px 8px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
    .trade-current-head button { min-height: 23px; padding: 1px 6px; font-size: 9px; }
    .trade-list { height: 105px; overflow-y: auto; padding: 0 6px 6px; }
    .trade-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; padding: 5px 3px; border-top: 1px solid #1b2635; font: 9px/1.25 ui-monospace,monospace; }
    .trade-item.has-cancel { grid-template-columns: 1fr auto 20px; }
    .trade-item strong { color: var(--text); }
    .trade-item span { color: var(--muted); }
    .trade-item .up { color: var(--up); }
    .trade-item .down { color: var(--down); }
    .trade-cancel-order { grid-column: 3; grid-row: 1 / span 2; align-self: center; min-width: 18px !important; min-height: 18px !important; width: 18px; height: 18px; padding: 0 !important; border-color: #8f3c4d; border-radius: 50%; color: #ffbdc8; font-size: 11px; line-height: 1; }
    .trade-cancel-order:disabled { cursor: wait; opacity: .45; }
    .trade-sell-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
    .trade-sell-controls input { width: 68px; min-height: 24px; padding: 2px 5px; font: 9px ui-monospace,monospace; text-transform: none; }
    .trade-sell-controls button { min-height: 24px; padding: 2px 6px; border-color: #8f3c4d; color: #ffbdc8; font-size: 9px; }
    .trade-sell-controls .trade-sell-now { background: #5c2632; color: #fff1f4; }
    .trade-empty { padding: 28px 8px; text-align: center; color: #657187; font-size: 11px; }
    .live4-trading-panel-host { margin: 0 0 14px; }
    .live4-chart .live4-inline-trade-panel {
      position: static; display: flex; flex-direction: column; width: min(680px,100%); max-height: none; margin: 0; overflow: visible;
      box-shadow: 0 8px 28px rgba(0,0,0,.28); container-type: inline-size;
    }
    .live4-chart .live4-inline-trade-panel .trade-head { order: 0; }
    .live4-chart .live4-inline-trade-panel .trade-current { order: 1; border-top: 0; border-bottom: 1px solid var(--line); }
    .live4-chart .live4-inline-trade-panel .trade-current[hidden] { display: none; }
    .live4-chart .live4-inline-trade-panel .trade-order-pane { order: 2; }
    .live4-chart .live4-inline-trade-panel .trade-head { cursor: default; touch-action: auto; }
    .live4-chart .live4-inline-trade-panel .trade-brand { flex: 1; }
    .live4-chart .live4-inline-trade-panel .trade-brand h2 {
      min-width: 0; overflow: hidden; color: var(--muted); font: 9px ui-monospace,monospace;
      text-overflow: ellipsis; white-space: nowrap;
    }
    .live4-chart .live4-inline-trade-panel .trade-order-pane {
      display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 6px; align-items: end;
    }
    .live4-chart .live4-inline-trade-panel .trade-live-prices,
    .live4-chart .live4-inline-trade-panel .trade-tabs,
    .live4-chart .live4-inline-trade-panel .trade-message,
    .live4-chart .live4-inline-trade-panel .trade-ml-panel,
    .live4-chart .live4-inline-trade-panel .trade-la-panel,
    .live4-chart .live4-inline-trade-panel .trade-sym-editor { grid-column: 1 / -1; }
    .live4-chart .live4-inline-trade-panel .trade-tabs { width: min(260px,100%); }
    .live4-chart .live4-inline-trade-panel .trade-live-prices {
      display: flex; align-items: center; gap: 9px; margin-bottom: 7px; padding: 6px 8px;
      border: 1px solid #26364b; border-radius: 7px; background: #0c131d; color: var(--muted);
      font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    }
    .live4-chart .live4-inline-trade-panel .trade-live-prices strong { margin-left: auto; font: 11px ui-monospace,monospace; }
    .live4-chart .live4-inline-trade-panel .trade-live-prices .up { color: var(--up); }
    .live4-chart .live4-inline-trade-panel .trade-live-prices .down { color: var(--down); }
    .live4-chart .live4-inline-trade-panel .trade-live-prices b { color: inherit; }
    .live4-chart .live4-inline-trade-panel .trade-grid {
      grid-column: 1; grid-template-columns: repeat(4,minmax(48px,1fr)); gap: 5px;
    }
    .live4-chart .live4-inline-trade-panel .trade-actions {
      grid-column: 2; align-self: end; flex-wrap: nowrap; margin: 0; gap: 4px;
    }
    .live4-chart .live4-inline-trade-panel .trade-actions button {
      min-width: 82px; min-height: 29px; padding-inline: 6px; white-space: nowrap; font-size: 10px;
    }
    .live4-chart .live4-inline-trade-panel .trade-actions .trade-submit-symmetrical {
      min-width: 150px; border-color: #7762a8; background: #332654; color: #f1eaff;
    }
    .live4-chart .live4-inline-trade-panel .trade-sym-editor { margin: 0 0 7px; padding: 6px; border: 1px solid #2e2940; border-radius: 7px; background: #0d1019; }
    .live4-chart .live4-inline-trade-panel .trade-sym-editor[hidden] { display: none; }
    .live4-chart .live4-inline-trade-panel .trade-sym-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .live4-chart .live4-inline-trade-panel .trade-sym-head button { min-height: 24px; padding: 2px 7px; border-color: #7762a8; color: #e8ddff; font-size: 9px; }
    .live4-chart .live4-inline-trade-panel .trade-sym-rows { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
    .live4-chart .live4-inline-trade-panel .trade-sym-row { display: grid; grid-template-columns: 16px minmax(0,1fr) minmax(0,1fr) 22px; gap: 3px; align-items: end; min-width: 0; }
    .live4-chart .live4-inline-trade-panel .trade-sym-index { align-self: center; color: #9586bd; font: 10px ui-monospace,monospace; text-align: center; }
    .live4-chart .live4-inline-trade-panel .trade-sym-row label { display: grid; gap: 2px; min-width: 0; }
    .live4-chart .live4-inline-trade-panel .trade-sym-row input { width: 100%; min-height: 24px; padding: 2px 4px; text-transform: none; font: 10px ui-monospace,monospace; }
    .live4-chart .live4-inline-trade-panel .trade-sym-remove { min-width: 22px; min-height: 24px; padding: 0; border-color: #74404e; color: #ff9aaa; }
    .live4-chart .live4-inline-trade-panel .trade-sym-remove:disabled { cursor: not-allowed; opacity: .3; }
    .live4-chart .live4-inline-trade-panel .trade-list { height: auto; max-height: 120px; }
    .live4-chart .live4-inline-trade-panel .trade-sell-now { display: none; }
    @container (max-width: 560px) {
      .live4-inline-trade-panel .trade-buy-prefix { display: none; }
      .live4-inline-trade-panel .trade-actions button { min-width: 60px; padding-inline: 4px; font-size: 9px; }
      .live4-inline-trade-panel .trade-actions .trade-submit-symmetrical { min-width: 96px; }
      .live4-inline-trade-panel .trade-grid { gap: 3px; }
      .live4-inline-trade-panel .trade-grid input { padding-inline: 3px; }
    }
    @container (max-width: 500px) {
      .live4-inline-trade-panel .trade-sym-rows { grid-template-columns: minmax(0,1fr); }
    }
    body.trade-extension { min-width: 0; background: var(--bg); }
    .trade-extension .shell { width: 100%; margin: 0; padding: 0; }
    .trade-extension .shell > :not(.trade-panel) { display: none; }
    .trade-extension .trade-panel,
    .trade-extension .trade-panel.collapsed { position: static; width: 100%; height: auto; max-height: none; border: 0; border-radius: 0; box-shadow: none; font-size: 12px; }
    .trade-extension .trade-panel.collapsed .trade-head { width: auto; height: auto; justify-content: space-between; padding: 7px 9px; border-bottom: 1px solid var(--line); }
    .trade-extension .trade-panel.collapsed .trade-head h2,
    .trade-extension .trade-panel.collapsed .trade-connection { display: flex; }
    .trade-extension .trade-panel.collapsed .trade-order-pane,
    .trade-extension .trade-panel.collapsed .trade-current { display: block; }
    .trade-extension .trade-collapse { display: none !important; }
    .trade-extension .trade-head { cursor: default; touch-action: auto; }
    .trade-extension .trade-list { height: 190px; }
    .section-title { display: flex; justify-content: space-between; color: var(--muted); margin: 18px 2px 9px; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
    .chart-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(16,22,32,.96); margin-bottom: 14px; }
    .chart-card.live { border-color: #4d5360; box-shadow: 0 10px 40px rgba(0,0,0,.24); }
    .live4-vwap-chart-host { width: 100%; margin: 0 0 14px; overflow: hidden; border: 1px solid #4d5360; border-radius: 12px; background: rgba(16,22,32,.96); box-shadow: 0 10px 40px rgba(0,0,0,.24); }
    .live4-vwap-chart-host[hidden] { display: none; }
    .live4-vwap-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 12px; }
    .live4-vwap-chart-head span { color: var(--muted); font-size: 11px; }
    .live4-vwap-chart-frame { display: block; width: 100%; height: 590px; border: 0; background: #081018; }
    .chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .chart-head h2 { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 15px; }
    .polymarket-market-link { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; overflow: hidden; border-radius: 6px; }
    .polymarket-market-link:hover { box-shadow: 0 0 0 2px rgba(143,211,255,.3); }
    .polymarket-market-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .polymarket-market-link img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
    .chart-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
    .chart-stats b { color: var(--text); }
    .event-count-host { align-self: auto; line-height: inherit; }
    .chart-stats .event-count-trigger {
      color: inherit;
      font: inherit;
      letter-spacing: inherit;
      white-space: nowrap;
    }
    .flow-buy { color: var(--up); }
    .flow-sell { color: var(--down); }
    .flow-prefix,
    .flow-count,
    .flow-sep { font-weight: 400; }
    .flow-amount { font-weight: 800; }
    .positive { color: var(--up) !important; }
    .negative { color: var(--down) !important; }
    .volatility-critical { color: #ff1744 !important; }
    .volatility-quiet { color: #fb7185 !important; }
    .volatility-active { color: #22c55e !important; }
    .volatility-very-active { color: #00e676 !important; }
    canvas { display: block; width: 100%; height: 590px; background: var(--panel-2); }
    .legend { display: flex; flex-wrap: wrap; gap: 15px; padding: 9px 14px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
    .key::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; background: var(--key); }
    .empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
    .history-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 18px 0 6px; }
    #load-previous { min-width: 190px; border-color: #3d4d65; background: #152033; color: #eef5ff; }
    #load-previous:disabled { cursor: wait; opacity: .58; }
    #load-previous-status { color: var(--muted); font: 12px ui-monospace, monospace; }
    @media (max-width: 760px) {
      .shell { padding: 14px; }
      header { align-items: stretch; flex-direction: column; }
      .chart-config-grid { grid-template-columns: 1fr; }
      .chart-card { margin-left: -14px; margin-right: -14px; border-left: 0; border-right: 0; border-radius: 0; }
      .live4-vwap-chart-host { width: auto; margin-left: -14px; margin-right: -14px; border-left: 0; border-right: 0; border-radius: 0; }
      .live4-vwap-chart-frame { height: 560px; }
      canvas { height: 560px; }
      .trade-panel { right: 4px; bottom: 4px; width: min(284px,calc(100vw - 8px)); max-height: calc(100dvh - 8px); font-size: 10px; }
      .live4-chart .live4-inline-trade-panel { width: 100%; max-height: none; }
      .trade-panel button { min-height: 24px; padding: 2px 5px; }
      .trade-panel label { font-size: 8px; }
      .trade-head { gap: 4px; padding: 4px 6px; }
      .trade-head h2 { font-size: 10px; }
      .trade-brand { gap: 5px; }
      .trade-brand-logo { width: 18px; height: 18px; border-radius: 5px; }
      .trade-brand-text { font-size: 9px; }
      .trade-connection { gap: 4px; font-size: 10px; }
      .trade-connection .dot { width: 6px; height: 6px; }
      .trade-balance { font-size: 10.8px; }
      .trade-collapse { min-width: 22px; min-height: 22px; }
      .trade-panel.collapsed { width: 40px; height: 40px; }
      .trade-order-pane { padding: 4px 6px 5px; }
      .trade-tabs { gap: 3px; margin-bottom: 4px; }
      .trade-tab { min-height: 23px; padding: 1px 4px; font-size: 9px; }
      .trade-grid { gap: 3px 4px; }
      .trade-grid input, .trade-grid select { min-height: 24px; padding: 2px 4px; font-size: 10px; }
      .trade-actions { margin-top: 4px; gap: 3px; }
      .trade-message { min-height: 11px; margin-top: 3px; font-size: 8px; }
      .trade-current-head { padding: 3px 5px; }
      .trade-current-head button { min-height: 20px; }
      .trade-list { height: 78px; padding: 0 4px 4px; }
      .trade-item { gap: 1px 4px; padding: 3px 2px; font-size: 8px; }
    }
    .chart-refresh { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; width: 24px; height: 24px; padding: 0; border-radius: 999px; color: #d8e7ff; background: #152033; border-color: #3d4d65; font-size: 13px; line-height: 1; vertical-align: middle; }

    body.embedded-chart { min-width: 0; background: var(--panel-2); }
    .embedded-chart .shell { width: 100%; padding: 0; }
    .embedded-chart .shell > header,
    .embedded-chart .shell > .statusbar,
    .embedded-chart .shell > .section-title,
    .embedded-chart .shell > #history,
    .embedded-chart .shell > .history-actions { display: none; }
    .embedded-chart .chart-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
    .embedded-chart .chart-refresh,
    .embedded-chart .event-count-host { display: none; }
    .embedded-chart .chart-stats > span { display: none; }
    .embedded-chart .chart-stats > span:has([data-stat="price-path"]),
    .embedded-chart .chart-stats > span:has([data-stat="poly-up"]),
    .embedded-chart .chart-stats > span:has([data-stat="fair-up"]) { display: inline; }
    .embedded-chart canvas { height: 540px; }
    @media (max-width: 760px) {
      .embedded-chart .shell { padding: 0; }
      .embedded-chart .chart-card { margin: 0; }
      .embedded-chart canvas { height: 500px; }
    }
    .chart-refresh:hover { border-color: #6f87aa; }
    .chart-refresh:disabled { cursor: wait; opacity: .58; }
    .central-data-chart:not(.live4-chart) .chart-stats > span:has([data-stat="poly-up"]),
    .central-data-chart:not(.live4-chart) .chart-stats > span:has([data-stat="poly-down"]),
    .central-data-chart:not(.live4-chart) .chart-stats > span:has([data-stat="fair-up"]) { display: none; }
    #load-previous { min-width: 190px; border-color: #3d4d65; background: #152033; color: #eef5ff; }
    #load-previous:disabled { cursor: wait; opacity: .58; }
    #load-previous-status { color: var(--muted); font: 12px ui-monospace, monospace; }
