      html { color-scheme: light; }
      :root {
        --bg: #f5f7fa;
        --panel: #ffffff;
        --panel-2: #f8fafc;
        --text: #17202a;
        --muted: #647386;
        --line: #dce3eb;
        --soft: #eef3f7;
        --accent: #087c7a;
        --accent-soft: #e3f4f2;
        --ok: #0a7a3d;
        --ok-soft: #e4f5eb;
        --warn: #925400;
        --warn-soft: #fff0d6;
        --bad: #a33b2f;
        --bad-soft: #fae7e4;
        --notice-text: #5f3900;
        --shadow: 0 12px 32px rgba(31, 45, 61, .06);
        --radius: 8px;
      }
      body[data-theme="dark"] {
        color-scheme: dark;
        --bg: #111827;
        --panel: #17202c;
        --panel-2: #1d2938;
        --text: #e5edf6;
        --muted: #a8b4c3;
        --line: #2d3a4c;
        --soft: #253244;
        --accent: #38bdb7;
        --accent-soft: #123b3b;
        --ok: #5dd38a;
        --ok-soft: #123a26;
        --warn: #f2be63;
        --warn-soft: #3b2d15;
        --bad: #ff8a7e;
        --bad-soft: #421f23;
        --notice-text: #ffe0a3;
        --shadow: 0 12px 32px rgba(0, 0, 0, .25);
      }
      * { box-sizing: border-box; }
      body {
        margin: 0;
        min-width: 320px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
        background: var(--bg);
        color: var(--text);
        transition: background .16s ease, color .16s ease;
      }
      header {
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 0 20px;
        border-bottom: 1px solid var(--line);
        background: var(--panel);
        position: sticky;
        top: 0;
        z-index: 20;
        backdrop-filter: blur(10px);
      }
      header strong { font-size: 16px; letter-spacing: 0; }
      .brand {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .brand strong { white-space: nowrap; }
      .brand .subtle { margin: 0; white-space: nowrap; font-size: 12px; }
      .header-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
      }
      #theme-toggle {
        min-width: 40px;
        padding: 7px 11px;
      }
      main {
        display: grid;
        grid-template-columns: 208px minmax(0, 1fr);
        min-height: calc(100vh - 60px);
      }
      nav {
        border-right: 1px solid var(--line);
        padding: 12px 10px;
        background: var(--panel);
        position: sticky;
        top: 60px;
        height: calc(100vh - 60px);
        overflow: auto;
      }
      nav button {
        width: 100%;
        min-height: 36px;
        border: 0;
        background: transparent;
        text-align: left;
        padding: 9px 12px;
        border-radius: var(--radius);
        color: var(--text);
        cursor: pointer;
        white-space: nowrap;
      }
      nav button:hover { background: var(--soft); }
      nav button.active {
        background: var(--accent-soft);
        color: var(--accent);
        font-weight: 650;
      }
      section {
        min-width: 0;
        padding: 14px;
      }
      h1, h2, h3 { margin: 0; letter-spacing: 0; }
      h1 { font-size: 21px; }
      h2 { font-size: 16px; }
      h3 { font-size: 15px; }
      .page-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 12px;
      }
      .page-loading {
        min-height: min(42vh, 420px);
        display: grid;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel);
      }
      .page-loading-content {
        display: grid;
        justify-items: center;
        gap: 10px;
        color: var(--muted);
      }
      .page-loading-spinner {
        width: 26px;
        height: 26px;
        border: 3px solid var(--line);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: page-loading-spin .8s linear infinite;
      }
      @keyframes page-loading-spin { to { transform: rotate(360deg); } }
      .subtle { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.5; }
      .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 8px;
      }
      .card, .panel {
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
      }
      .card { padding: 10px 11px; min-width: 0; }
      .panel { padding: 12px; margin-top: 8px; min-width: 0; }
      .grid.metrics-compact {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        gap: 8px;
      }
      .grid.metrics-compact .card {
        padding: 10px 11px;
      }
      .grid.metrics-compact .label {
        font-size: 12px;
      }
      .grid.metrics-compact .value {
        font-size: 17px;
        margin-top: 4px;
      }
      .label { color: var(--muted); font-size: 13px; line-height: 1.4; }
      .value {
        font-size: 20px;
        line-height: 1.15;
        margin-top: 6px;
        font-weight: 700;
        overflow-wrap: anywhere;
      }
      .toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        margin: 9px 0;
      }
      .toolbar.compact {
        margin-top: 10px;
        margin-bottom: 0;
      }
      .toolbar .toolbar-spacer {
        flex: 1 1 auto;
      }
      .report-range {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
      }
      .report-range label {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        gap: 6px;
        color: var(--muted);
        font-size: 13px;
        white-space: nowrap;
      }
      .report-range input[type="date"] { width: 150px; }
      @media (min-width: 561px) {
        .toolbar > .pill {
          flex: 0 0 auto;
        }
      }
      button, select, input {
        min-height: 34px;
        border: 1px solid var(--line);
        background: var(--panel);
        color: var(--text);
        border-radius: var(--radius);
        padding: 7px 10px;
        font: inherit;
        max-width: 100%;
      }
      button { cursor: pointer; }
      button:hover { border-color: var(--accent); }
      button.primary {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
      }
      button.danger {
        background: var(--bad);
        border-color: var(--bad);
        color: #fff;
      }
      button.danger:hover { filter: brightness(.94); }
      button:disabled { opacity: .55; cursor: wait; }
      .th-sort {
        min-height: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: inherit;
        font: inherit;
        font-weight: inherit;
      }
      .th-sort:hover {
        color: var(--text);
        border-color: transparent;
      }
      input:not([type="checkbox"]):not([type="radio"]) {
        min-width: min(220px, 100%);
      }
      input[type="checkbox"], input[type="radio"] {
        width: auto;
        min-width: 0;
      }
      .table-wrap {
        max-height: min(64vh, 680px);
        overflow: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel);
      }
      .table-wrap.compact-table th,
      .table-wrap.compact-table td {
        padding: 6px 7px;
        vertical-align: middle;
        line-height: 1.25;
      }
      .table-wrap.compact-table .cell-stack {
        gap: 1px;
      }
      .table-wrap.compact-table .cell-main,
      .table-wrap.compact-table .cell-sub {
        line-height: 1.2;
      }
      .table-wrap.compact-table .cell-sub {
        font-size: 11px;
      }
      .table-wrap.compact-table .cell-tags {
        gap: 4px;
      }
      .table-wrap.compact-table .pill {
        min-height: 20px;
        padding: 1px 6px;
      }
      table {
        width: 100%;
        border-collapse: collapse;
        min-width: 700px;
      }
      th, td {
        border-bottom: 1px solid var(--line);
        padding: 10px 12px;
        text-align: left;
        vertical-align: top;
        font-size: 13px;
        white-space: nowrap;
      }
      th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--panel-2);
        color: var(--muted);
        font-weight: 650;
      }
      tr:last-child td { border-bottom: 0; }
      td {
        overflow-wrap: break-word;
        word-break: normal;
      }
      th.wrap, td.wrap { white-space: normal; }
      th.right, td.right {
        text-align: right;
        font-variant-numeric: tabular-nums;
      }
      .mono {
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        font-variant-numeric: tabular-nums;
      }
      .cell-stack {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
      }
      .cell-main {
        font-weight: 600;
        line-height: 1.35;
      }
      .metric-pair > .cell-main {
        white-space: nowrap;
      }
      .cell-sub {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
      }
      .cell-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }
      .mobile-only {
        display: none;
      }
      .inline-note {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        align-items: center;
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel);
        color: var(--muted);
        font-size: 12px;
      }
      .inline-note strong {
        color: var(--text);
        font-size: 12px;
      }
      .inline-note code {
        font-size: 12px;
      }
      .form-grid {
        display: grid;
        grid-template-columns: 160px minmax(0, 1fr);
        gap: 12px 16px;
        align-items: center;
      }
      .form-grid .label {
        margin: 0;
      }
      .panel-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }
      .pill {
        display: inline-flex;
        align-items: center;
        min-height: 22px;
        border-radius: 999px;
        padding: 2px 8px;
        font-size: 12px;
        background: var(--soft);
        color: var(--muted);
        white-space: nowrap;
      }
      .pill.ok { background: var(--ok-soft); color: var(--ok); }
      .pill.warn { background: var(--warn-soft); color: var(--warn); }
      .pill.bad { background: var(--bad-soft); color: var(--bad); }
      .pill input[type="number"] {
        width: 88px;
        min-width: 0;
        min-height: 24px;
        margin-left: 6px;
        padding: 3px 6px;
      }
      .pill button {
        min-height: 22px;
        min-width: 0;
        margin-left: 4px;
        padding: 0 6px;
        border: 0;
        background: transparent;
        color: inherit;
      }
      .leverage-status {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
      }
      .capacity-ratio {
        display: inline-flex;
        align-items: center;
        min-width: 54px;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
      }
      .capacity-ratio.available { color: var(--ok); }
      .capacity-ratio.near-full { color: var(--warn); }
      .capacity-ratio.full { color: var(--bad); }
      .strategy-capacity-table .capacity-ratio {
        min-width: 0;
      }
      .strategy-capacity-table .pill {
        margin-left: 6px;
      }
      .strategy-bulk-toolbar {
        gap: 6px;
      }
      .strategy-bulk-toolbar button {
        min-height: 30px;
        padding: 5px 9px;
      }
      .strategy-bulk-account-actions {
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;
        min-width: 178px;
      }
      .strategy-bulk-account-actions .pill {
        min-width: 34px;
        text-align: center;
      }
      .strategy-bulk-account-actions button {
        min-height: 27px;
        padding: 4px 7px;
        font-size: 12px;
      }
      .dashboard-account-overview th,
      .dashboard-account-overview td {
        padding: 6px 8px;
        vertical-align: middle;
        line-height: 1.2;
      }
      .dashboard-account-overview table {
        min-width: 720px;
      }
      .dashboard-account-overview th:nth-child(6),
      .dashboard-account-overview td:nth-child(6) {
        min-width: 145px;
      }
      .dashboard-account-overview th:nth-child(7),
      .dashboard-account-overview td:nth-child(7) {
        min-width: 110px;
      }
      .dashboard-account-overview .pill {
        min-height: 20px;
        padding: 1px 6px;
      }
      .dashboard-account-overview .cell-stack {
        gap: 1px;
      }
      .dashboard-account-overview .cell-main {
        line-height: 1.2;
        white-space: nowrap;
      }
      .dashboard-account-overview .cell-sub {
        font-size: 11px;
        line-height: 1.15;
        white-space: nowrap;
      }
      .dashboard-account-overview .leverage-status {
        flex-wrap: nowrap;
        gap: 4px;
      }
      .money-inline {
        display: inline-flex;
        align-items: baseline;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
      }
      .account-management-table {
        max-height: min(66vh, 680px);
      }
      .account-management-table table {
        min-width: 860px;
      }
      .account-management-table th:nth-child(1),
      .account-management-table td:nth-child(1) { min-width: 64px; white-space: nowrap; }
      .account-management-table th:nth-child(2),
      .account-management-table td:nth-child(2) { min-width: 105px; }
      .account-management-table th:nth-child(3),
      .account-management-table td:nth-child(3) { min-width: 130px; }
      .account-management-table th:nth-child(4),
      .account-management-table td:nth-child(4) { min-width: 175px; }
      .account-management-table th:nth-child(5),
      .account-management-table td:nth-child(5) { min-width: 52px; }
      .account-management-table th:nth-child(6),
      .account-management-table td:nth-child(6) { min-width: 125px; }
      .account-management-table th:nth-child(7),
      .account-management-table td:nth-child(7) { min-width: 160px; }
      .account-management-table td:nth-child(1) {
        font-weight: 650;
      }
      .account-row-actions {
        display: flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
      }
      .account-row-actions button,
      .account-row-actions select {
        width: auto;
        min-width: 0;
        min-height: 28px;
        padding: 4px 7px;
        font-size: 12px;
      }
      .account-row-actions select {
        padding-right: 22px;
      }
      .account-secondary-actions {
        display: none;
      }
      .pager {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
      }
      .pager .subtle {
        margin: 0;
        white-space: nowrap;
      }
      .table-sort-bar {
        display: flex;
        justify-content: flex-end;
        margin: -2px 0 6px;
      }
      .table-sort-bar button {
        min-height: 28px;
        padding: 4px 8px;
        font-size: 12px;
      }
      .table-row-bad td {
        background: var(--bad-soft);
      }
      .table-row-bad td:first-child {
        box-shadow: inset 3px 0 0 var(--bad);
      }
      .table-row-warn td {
        background: var(--warn-soft);
      }
      .table-row-warn td:first-child {
        box-shadow: inset 3px 0 0 var(--warn);
      }
      .table-row-profit td {
        background: color-mix(in srgb, var(--ok-soft) 70%, transparent);
      }
      .table-row-profit td:first-child {
        box-shadow: inset 3px 0 0 var(--ok);
      }
      .table-row-loss td {
        background: color-mix(in srgb, var(--bad-soft) 55%, transparent);
      }
      .table-row-loss td:first-child {
        box-shadow: inset 3px 0 0 var(--bad);
      }
      .empty {
        padding: 28px 16px;
        color: var(--muted);
        text-align: center;
      }
      .kv {
        display: grid;
        grid-template-columns: 160px minmax(0, 1fr);
        gap: 8px 12px;
        font-size: 13px;
      }
      .kv > *, .form-grid > * {
        min-width: 0;
        overflow-wrap: anywhere;
      }
      .stacked-options {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 12px;
        align-items: center;
      }
      .checkbox-label {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-height: 30px;
        color: var(--text);
      }
      .json-box {
        max-height: 360px;
        overflow: auto;
        background: var(--panel-2);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 12px;
      }
      code, pre {
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        font-size: 12px;
      }
      code {
        background: var(--soft);
        padding: 2px 5px;
        border-radius: 4px;
      }
      pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
      .notice {
        border-left: 3px solid var(--warn);
        background: var(--warn-soft);
        padding: 10px 12px;
        border-radius: var(--radius);
        color: var(--notice-text);
        line-height: 1.6;
      }
      .hint {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.4;
      }
      .status-banner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border: 1px solid var(--line);
        border-left-width: 5px;
        border-radius: var(--radius);
        padding: 14px 16px;
        margin-top: 14px;
        background: var(--panel);
      }
      .status-banner.ok {
        border-left-color: var(--ok);
        background: var(--ok-soft);
      }
      .status-banner.bad {
        border-left-color: var(--bad);
        background: var(--bad-soft);
      }
      .status-banner strong {
        font-size: 15px;
      }
      .account-alert-banner {
        align-items: flex-start;
        margin-top: 0;
        margin-bottom: 10px;
      }
      .account-alert-copy {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
      }
      .account-alert-copy .subtle {
        margin: 0;
        color: var(--text);
      }
      .account-alert-details {
        margin: -2px 0 10px;
        padding: 8px 10px;
        border-left: 3px solid var(--bad);
        background: var(--bad-soft);
      }
      .account-issue-title {
        color: var(--bad);
        font-size: 11px;
        font-weight: 650;
        line-height: 1.25;
      }
      .chart {
        width: 100%;
        min-height: 220px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel-2);
        padding: 12px;
      }
      .chart svg {
        display: block;
        width: 100%;
        height: 180px;
      }
      .chart-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
      }
      .chart-title {
        display: flex;
        flex-direction: column;
        gap: 3px;
      }
      .chart-title strong {
        font-size: 14px;
        line-height: 1.2;
      }
      .chart-title span {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
      }
      .chart-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
      }
      .chart-summary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        gap: 8px;
        margin-top: 10px;
      }
      .chart-summary-item {
        border: 1px solid var(--line);
        border-radius: 7px;
        background: var(--panel);
        padding: 8px 9px;
      }
      .chart-summary-item .label {
        font-size: 11px;
      }
      .chart-summary-item .value {
        margin-top: 3px;
        font-size: 14px;
      }
      .chart-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 18px;
        margin-top: 8px;
        color: var(--muted);
        font-size: 12px;
      }
      .symbol-link {
        width: 100%;
        border: 0;
        background: transparent;
        color: inherit;
        padding: 0;
        min-height: 0;
        text-align: left;
      }
      .symbol-link:hover .cell-main {
        color: var(--accent);
      }
      .modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.52);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        z-index: 60;
      }
      .modal-sheet {
        width: min(1100px, 100%);
        max-height: min(88vh, 900px);
        overflow: auto;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 16px;
      }
      .modal-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
      }
      .modal-close {
        min-width: 40px;
        padding: 6px 10px;
      }
      .segmented {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 6px;
      }
      .segmented button {
        min-width: 52px;
      }
      .segmented button.active {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
      }
      .candle-chart {
        width: 100%;
        min-height: 320px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel-2);
        padding: 12px;
      }
      .candle-chart svg {
        display: block;
        width: 100%;
        height: 320px;
      }
      .candle-axis {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        margin-top: 8px;
        color: var(--muted);
        font-size: 12px;
      }
      .mini-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
        margin-top: 12px;
      }
      .mini-stat {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel);
        padding: 10px 12px;
      }
      .mini-stat .label {
        margin-bottom: 4px;
      }
      .mini-stat .value {
        margin-top: 0;
        font-size: 16px;
      }
      .split {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
        gap: 14px;
        align-items: start;
      }
      .panel-collapsed .panel-body {
        display: none;
      }
      .panel-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
      }
      .panel-head h2 {
        min-width: 0;
      }
      .panel-toggle {
        flex-shrink: 0;
        min-width: 62px;
        padding: 6px 10px;
        font-size: 12px;
      }
      @media (max-width: 960px) {
        main { grid-template-columns: 1fr; }
        nav {
          display: flex;
          gap: 6px;
          overflow-x: auto;
          border-right: 0;
          border-bottom: 1px solid var(--line);
          position: sticky;
          top: 60px;
          height: auto;
          z-index: 10;
        }
        nav button { width: auto; }
        .split { grid-template-columns: 1fr; }
        header { padding: 0 16px; }
        section { padding: 12px; }
      }
      @media (max-width: 560px) {
        header {
          align-items: flex-start;
          flex-direction: column;
          gap: 8px;
          padding: 10px 14px;
        }
        .brand {
          width: 100%;
          justify-content: space-between;
        }
        .brand .subtle { display: none; }
        .header-actions { width: 100%; justify-content: space-between; }
        main { min-height: calc(100vh - 88px); }
        nav { top: 88px; padding: 10px; }
        nav button { min-height: 34px; padding: 7px 10px; }
        section { padding: 10px; }
        .card { padding: 8px 9px; }
        .panel { padding: 10px; margin-top: 7px; }
        .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .grid.metrics-compact {
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 7px;
        }
        .grid.metrics-compact .card {
          padding: 9px 10px;
        }
        .grid.metrics-compact .value {
          font-size: 15px;
        }
        .page-head { display: block; margin-bottom: 10px; }
        .page-head h1 { font-size: 19px; }
        .page-head .subtle { display: none; }
        .subtle { font-size: 12px; line-height: 1.45; }
        .kv { grid-template-columns: 1fr; }
        .stacked-options { display: grid; grid-template-columns: 1fr; gap: 4px; }
        .form-grid { grid-template-columns: 1fr; }
        .toolbar {
          align-items: stretch;
          gap: 7px;
          margin: 10px 0;
        }
        .toolbar > * {
          flex: 1 1 100%;
        }
        .toolbar .toolbar-spacer {
          display: none;
        }
        .toolbar > .pager {
          display: grid;
          grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
          flex: 1 1 100%;
          margin-left: 0;
        }
        .toolbar > .pager button {
          width: 100%;
        }
        .strategy-bulk-toolbar {
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .strategy-bulk-toolbar > button {
          width: auto;
        }
        .strategy-bulk-toolbar > #strategy-bulk-result {
          grid-column: 1 / -1;
        }
        .strategy-bulk-account-actions {
          min-width: 0;
          display: grid;
          grid-template-columns: auto auto auto;
          align-items: center;
        }
        .strategy-bulk-account-actions .pill {
          grid-column: 1 / -1;
          justify-self: start;
        }
        .table-sort-bar {
          justify-content: stretch;
          margin-bottom: 5px;
        }
        .table-sort-bar button {
          width: 100%;
        }
        input:not([type="checkbox"]):not([type="radio"]) { width: 100%; min-width: 0; }
        input[type="checkbox"], input[type="radio"] {
          width: auto;
          min-width: 0;
        }
        #strategy-param-form td input[type="number"] {
          width: 92px;
          min-width: 0;
        }
        #strategy-param-form td label {
          display: inline-flex;
          align-items: center;
          flex-wrap: wrap;
          gap: 4px;
          max-width: 100%;
        }
        table { min-width: 0; }
        thead { display: none; }
        table, tbody, tr, td { display: block; width: 100%; }
        tr {
          border-bottom: 1px solid var(--line);
          padding: 8px 0;
        }
        tr:last-child { border-bottom: 0; }
        td {
          border-bottom: 0;
          display: grid;
          grid-template-columns: 78px minmax(0, 1fr);
          gap: 7px;
          padding: 5px 8px;
          overflow-wrap: anywhere;
        }
        td::before {
          content: attr(data-label);
          color: var(--muted);
          font-size: 11px;
          white-space: normal;
        }
        .panel-head {
          align-items: stretch;
          flex-direction: column;
        }
        .panel-toggle {
          width: 100%;
        }
        .table-wrap {
          max-height: min(64vh, 620px);
          overflow: auto;
          overscroll-behavior: contain;
          scrollbar-gutter: stable;
        }
        .table-wrap.mobile-dense td {
          grid-template-columns: 72px minmax(0, 1fr);
          gap: 5px;
          padding: 4px 8px;
        }
        .table-wrap.mobile-dense .cell-stack {
          gap: 2px;
        }
        .table-wrap.mobile-dense .cell-main {
          line-height: 1.25;
        }
        .table-wrap.mobile-dense .cell-sub {
          font-size: 11px;
          line-height: 1.25;
        }
        .table-wrap.mobile-dense .pill {
          margin-right: 4px;
        }
        .table-wrap.mobile-dense.compact-table:not(.dashboard-account-overview):not(.account-management-table) tr {
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
          column-gap: 8px;
          padding: 6px 8px;
        }
        .table-wrap.mobile-dense.compact-table:not(.dashboard-account-overview):not(.account-management-table) td {
          width: auto;
          min-width: 0;
          grid-template-columns: minmax(0, 1fr);
          gap: 1px;
          padding: 4px 0;
          white-space: normal;
        }
        .table-wrap.mobile-dense.compact-table:not(.dashboard-account-overview):not(.account-management-table) td::before {
          font-size: 10px;
          line-height: 1.1;
          text-align: left;
        }
        .table-wrap.mobile-dense.compact-table:not(.dashboard-account-overview):not(.account-management-table) .cell-sub {
          white-space: normal;
        }
        .strategy-capacity-table td {
          grid-template-columns: 64px minmax(0, 1fr);
          align-items: center;
        }
        .account-management-table table {
          min-width: 0;
        }
        .account-management-table tr {
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
          column-gap: 8px;
          padding: 6px 8px;
        }
        .table-wrap.mobile-dense.account-management-table td {
          min-width: 0;
          grid-template-columns: 54px minmax(0, 1fr);
          gap: 4px;
          padding: 4px 0;
          font-size: 12px;
          white-space: normal;
        }
        .account-management-table td:nth-child(4) {
          grid-column: 1 / -1;
          grid-row: 3;
        }
        .account-management-table td:nth-child(5) {
          grid-column: 2;
          grid-row: 2;
        }
        .account-management-table td:nth-child(6) {
          grid-column: 1;
          grid-row: 4;
        }
        .table-wrap.mobile-dense.account-management-table td:nth-child(7) {
          grid-column: 2;
          grid-row: 4;
          grid-template-columns: minmax(0, 1fr);
        }
        .account-management-table td:nth-child(7)::before {
          display: none;
        }
        .account-row-actions {
          justify-content: flex-start;
        }
        .account-row-actions > button,
        .account-row-actions > .account-more-action {
          display: none;
        }
        .account-row-actions .account-mobile-action {
          display: block;
          width: 100%;
        }
        .account-management-table .pill {
          margin-right: 0;
        }
        .dashboard-account-overview tr {
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
          column-gap: 10px;
          padding: 5px 8px;
        }
        .dashboard-account-overview table {
          min-width: 0;
        }
        .table-wrap.mobile-dense.dashboard-account-overview td {
          min-width: 0;
          grid-template-columns: 36px minmax(0, 1fr);
          gap: 2px;
          padding: 3px 0;
          font-size: 11px;
          line-height: 1.15;
          white-space: nowrap;
        }
        .table-wrap.mobile-dense.dashboard-account-overview td::before {
          font-size: 9px;
          line-height: 1.1;
        }
        .table-wrap.mobile-dense.dashboard-account-overview .cell-sub {
          font-size: 10px;
          white-space: nowrap;
        }
        .dashboard-account-overview td:nth-child(5) {
          grid-column: 1 / -1;
        }
        .mobile-only {
          display: block;
        }
        .mobile-inline {
          display: inline-flex;
        }
        .desktop-only {
          display: none !important;
        }
        .value { font-size: 18px; }
        .chart {
          min-height: 0;
          padding: 10px;
        }
        .chart svg {
          height: 160px;
        }
        .chart-head {
          flex-direction: column;
          gap: 8px;
        }
        .chart-badges {
          justify-content: flex-start;
        }
        .chart-summary {
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 7px;
        }
        .chart-summary-item {
          padding: 7px 8px;
        }
        .chart-summary-item .value {
          font-size: 13px;
        }
        .modal-sheet {
          max-height: min(90vh, 960px);
          padding: 12px;
        }
        .candle-chart {
          min-height: 0;
          padding: 10px;
        }
        .candle-chart svg {
          height: 240px;
        }
        .mini-stats {
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 8px;
        }
        .mini-stat {
          padding: 8px 10px;
        }
        .mini-stat .value {
          font-size: 14px;
        }
        .status-banner {
          align-items: flex-start;
          flex-direction: column;
        }
        .cell-sub { white-space: normal; }
      }
      @media (max-width: 380px) {
        .grid { grid-template-columns: 1fr; }
      }
      @media (max-width: 340px) {
        .dashboard-account-overview .money-unit {
          display: none;
        }
      }
