* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #17202a; background: #f5f7fa; }
header { display: flex; align-items: center; gap: 24px; padding: 14px 24px; background: #17202a; color: white; }
a { color: inherit; text-decoration: none; }
.brand { font-weight: 700; }
nav { display: flex; gap: 10px; flex: 1; align-items: center; }
nav a { display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 9px 14px; background: #1f7a5b; color: white; min-height: 38px; line-height: 1.2; }
nav a:hover, .button-link:hover, button:hover { filter: brightness(0.96); }
button, .button-link { border: 0; border-radius: 6px; padding: 9px 14px; background: #1f7a5b; color: white; cursor: pointer; font: inherit; line-height: 1.2; min-height: 38px; }
.secondary-button { background: #eef2f6; color: #344054; border: 1px solid #c8d1dc; }
.danger-button { background: #b42318; color: #ffffff; }
.button-link { display: inline-flex; align-items: center; justify-content: center; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions form { margin: 0; }
.buy-lock-button { min-width: 98px; }
.buy-lock-button.active { background: #b42318; color: #ffffff; }
main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.grid article { text-align: center; }
.grid article h2 { margin-bottom: 10px; }
.grid article strong { display: block; text-align: center; }
article, section { background: white; border: 1px solid #d8dee6; border-radius: 8px; padding: 18px; margin-bottom: 18px; }
.dashboard-summary { gap: 12px; padding: 10px 18px; margin-bottom: 12px; }
.dashboard-summary article { padding: 12px 14px; margin-bottom: 0; min-height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dashboard-summary article h2 { margin-bottom: 6px; font-size: 20px; line-height: 1.15; }
.dashboard-summary article strong { font-size: 15px; line-height: 1.2; }
.metric-profit { color: #12744a; }
.metric-loss { color: #b42318; }
.dashboard-trades-panel { padding-top: 14px; }
.dashboard-trades-panel .section-header { margin-bottom: 12px; }

.main-panel { padding: 20px; }
h1, h2 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #e4e8ef; padding: 10px; text-align: center; vertical-align: middle; overflow-wrap: anywhere; }
th { white-space: nowrap; font-size: 13px; color: #526173; background: #f8fafc; }
td { font-size: 14px; }
label { display: grid; gap: 6px; margin: 10px 0; }
input { border: 1px solid #b9c2cf; border-radius: 6px; padding: 9px; }
fieldset { border: 1px solid #d8dee6; border-radius: 8px; margin: 14px 0; }
.setting-key { color: #667085; font-size: 12px; font-weight: 500; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; }
.settings-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.settings-title h1 { margin-bottom: 4px; }
.settings-title .muted { max-width: 920px; line-height: 1.45; }
.settings-message { margin: 12px 0; }
.settings-form { margin-top: 16px; }
.settings-grid { column-count: 2; column-gap: 16px; }
.settings-card { display: inline-block; width: 100%; margin: 0 0 16px; padding: 16px; background: #ffffff; break-inside: avoid; }
.settings-card legend { padding: 0 6px; font-weight: 800; color: #17202a; }
.settings-card-description { margin: 0 0 14px; color: #667085; font-size: 13px; line-height: 1.4; }
.settings-field { display: grid; gap: 6px; margin: 12px 0 0; color: #344054; font-size: 13px; font-weight: 700; }
.settings-field input { width: 100%; font-weight: 500; }
.field-help { margin: 5px 0 0; color: #667085; font-size: 12px; line-height: 1.35; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid #eef2f6; }
.switch-row:first-of-type { border-top: 0; padding-top: 0; }
.switch-row strong { display: block; color: #344054; font-size: 13px; }
.switch-row small { display: block; margin-top: 3px; color: #667085; font-size: 12px; line-height: 1.35; }
.switch-row input[type="checkbox"] { width: 38px; min-width: 38px; height: 22px; appearance: none; border: 0; border-radius: 999px; background: #c8d1dc; padding: 0; position: relative; cursor: pointer; transition: background 0.15s ease; }
.switch-row input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #ffffff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2); transition: transform 0.15s ease; }
.switch-row input[type="checkbox"]:checked { background: #1f7a5b; }
.switch-row input[type="checkbox"]:checked::after { transform: translateX(16px); }
.settings-actions { display: flex; justify-content: center; margin-top: 18px; }
.settings-actions button { min-width: 180px; }
.password-settings { max-width: 560px; margin-top: 22px; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-panel { width: min(420px, calc(100vw - 32px)); background: white; border: 1px solid #d8dee6; border-radius: 8px; padding: 24px; }
.error { color: #b42318; }
.success { color: #047857; font-weight: 700; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e4e8ef; border-radius: 8px; }
.table-wrap table { min-width: 1320px; }
.table-wrap .recent-trades-table { min-width: 0; width: 100%; }
.table-wrap .executions-table { min-width: 1120px; width: 100%; }
.table-wrap .trades-executions-table { min-width: 0; width: 100%; }
.resizable-table { table-layout: fixed; }
.resizable-table th { position: relative; user-select: none; }
.resize-handle { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 2; }
.resize-handle::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 3px; width: 1px; background: #c8d1dc; opacity: 0; transition: opacity 120ms ease; }
.resizable-table th:hover .resize-handle::after, .resizing-columns .resize-handle::after { opacity: 1; }
.resizing-columns { cursor: col-resize; user-select: none; }
.trades-table .time { min-width: 170px; max-width: 190px; color: #526173; font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
.numeric { text-align: center; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; font-variant-numeric: tabular-nums; }
.numeric[title] { cursor: help; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: #c8d1dc; text-underline-offset: 3px; }
.recent-trades-table th, .recent-trades-table td { text-align: center; padding: 8px 5px; overflow-wrap: normal; word-break: keep-all; }
.recent-trades-table td { font-size: 12px; }
.recent-trades-table .numeric { text-align: center; }
.recent-trades-table [data-col="id"] { width: 66px; }
.recent-trades-table [data-col="pair"] { width: 168px; }
.recent-trades-table [data-col="status"] { width: 72px; }
.recent-trades-table [data-col="entry"], .recent-trades-table [data-col="current"], .recent-trades-table [data-col="stop_loss"] { width: 92px; }
.recent-trades-table [data-col="size"] { width: 74px; }
.recent-trades-table [data-col="pnl"], .recent-trades-table [data-col="pnl_pct"] { width: 78px; }
.recent-trades-table [data-col="action"] { width: 92px; }
.pair-cell { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.margin-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border: 1px solid #c7b8ff; border-radius: 999px; background: #f2efff; color: #5b3cc4; font-size: 10px; font-weight: 900; letter-spacing: .01em; line-height: 1; cursor: help; }
.coin-icon { width: 22px; height: 22px; min-width: 22px; border-radius: 999px; object-fit: cover; }
.coin-icon-placeholder { display: inline-flex; align-items: center; justify-content: center; background: #e4e8ef; color: #344054; font-size: 14px; font-weight: 900; line-height: 1; }
.sell-now-button { min-height: 30px; padding: 5px 8px; border-radius: 5px; background: #b42318; color: #ffffff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.stop-now-button { min-height: 30px; min-width: 70px; padding: 5px 8px; border-radius: 5px; background: #b42318; color: #ffffff; font-size: 11px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stop-now-button.active { background: #12805c; }
.stop-now-button.paused { background: #b54708; }
.sell-now-details { display: grid; gap: 10px; margin: 16px 0 0; }
.sell-now-details div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #e4e8ef; border-radius: 6px; background: #f8fafc; }
.sell-now-details dt { color: #526173; font-size: 13px; }
.sell-now-details dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.muted { color: #667085; margin: 4px 0 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-header h1, .section-header h2 { margin-bottom: 0; }
.table-controls { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-field, .page-size-field { display: inline-flex; grid-template-columns: none; align-items: center; gap: 8px; margin: 0; color: #526173; white-space: nowrap; }
.filter-field input { width: min(320px, 34vw); min-width: 220px; }
.page-size-field { min-width: 0; }
.page-size-field select { border: 1px solid #b9c2cf; border-radius: 6px; padding: 9px; background: white; min-height: 38px; }
.stats-period-controls select { min-width: 128px; }
.pagination-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; color: #526173; font-size: 13px; }
.pagination-bar button { min-height: 32px; padding: 6px 10px; }
.pagination-bar button:disabled { opacity: 0.45; cursor: default; }
.pairs-frame { width: 100%; max-height: calc(100vh - 260px); min-height: 420px; overflow-y: auto; overflow-x: hidden; border: 1px solid #d8dee6; border-radius: 8px; }
.pairs-frame table { width: 100%; min-width: 0; }
.pairs-frame thead th { position: sticky; top: 0; z-index: 1; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.pairs-table input[type="checkbox"] { width: 18px; height: 18px; }
.pairs-table tr.pair-enabled { background: #f0fdf4; box-shadow: inset 4px 0 0 #22c55e; }
.pairs-table th, .pairs-table td { padding: 8px 6px; overflow-wrap: normal; word-break: keep-all; }
.pairs-table [data-col="enabled"] { width: 74px; }
.pairs-table [data-col="symbol"] { width: 104px; }
.pairs-table [data-col="base"] { width: 86px; }
.pairs-table [data-col="cmc_rank"] { width: 84px; }
.pairs-table [data-col="cmc"] { width: 58px; }
.pairs-table [data-col="quote"] { width: 86px; }
.pairs-table [data-col="instrument"] { width: 118px; }
.pairs-table [data-col="last"] { width: 116px; }
.pairs-table [data-col="base_volume"] { width: 134px; }
.pairs-table [data-col="quote_volume"] { width: 144px; }
.cmc-rank-cell { font-weight: 800; color: #344054; text-align: center; }
.cmc-rank-cell a { display: inline-flex; justify-content: center; min-width: 44px; color: #1f7a5b; text-decoration: none; border-bottom: 1px dotted #9db8ac; }
.cmc-rank-cell a:hover { color: #145f47; border-bottom-color: #145f47; }
.cmc-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border: 1px solid #d8dee6; background: #ffffff; color: #17202a; border-radius: 999px; white-space: nowrap; }
.cmc-button img { width: 26px; height: 26px; border-radius: 999px; object-fit: cover; }
.cmc-button.missing { color: #526173; background: #f8fafc; border-style: dashed; }
.cmc-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; background: #e4e8ef; color: #344054; font-size: 16px; font-weight: 900; line-height: 1; }
.cmc-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 23, 42, 0.54); backdrop-filter: blur(2px); }
.cmc-modal-backdrop[hidden] { display: none !important; }
.cmc-modal-panel { width: min(520px, calc(100vw - 32px)); background: #ffffff; border: 1px solid #d8dee6; border-radius: 8px; padding: 20px; box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32); }
.cmc-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.cmc-modal-header h2 { margin: 0; }
.cmc-modal-x { min-width: 34px; width: 34px; min-height: 34px; height: 34px; padding: 0; border-radius: 999px; background: #eef2f6; color: #344054; border: 1px solid #d8dee6; font-weight: 800; }
.cmc-modal-panel label { margin: 0; }
.cmc-modal-panel input { width: 100%; }
.cmc-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.stop-loss-modal { width: min(600px, calc(100vw - 32px)); }
.stop-loss-modal .cmc-modal-header { margin-bottom: 14px; }
.stop-loss-modal .cmc-modal-header h2 { font-size: 25px; line-height: 1.2; }
.stop-loss-modal .cmc-modal-header .muted { max-width: 500px; line-height: 1.45; }
.stop-loss-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.stop-loss-summary div { align-items: flex-start; flex-direction: column; gap: 4px; }
.stop-loss-summary dd { font-size: 16px; }
.stop-mode-fieldset { margin: 16px 0 0; padding: 14px; }
.stop-mode-fieldset legend { padding: 0 7px; color: #344054; font-size: 13px; font-weight: 800; }
.stop-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stop-mode-option { min-width: 0; padding: 12px; border: 1px solid #d8dee6; border-radius: 7px; background: #f8fafc; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.stop-mode-option.selected { border-color: #1f7a5b; background: #f3faf7; box-shadow: 0 0 0 1px rgba(31, 122, 91, 0.14); }
.stop-loss-modal .stop-mode-choice { display: flex; align-items: center; gap: 8px; min-height: 24px; margin: 0 0 11px; color: #17202a; font-size: 14px; font-weight: 800; cursor: pointer; }
.stop-loss-modal .stop-mode-choice input[type="radio"] { width: 18px; min-width: 18px; height: 18px; margin: 0; padding: 0; accent-color: #1f7a5b; }
.stop-loss-modal .stop-value-label { display: block; margin: 0 0 6px; color: #526173; font-size: 12px; font-weight: 700; }
.stop-mode-option input[type="number"] { min-height: 40px; background: #ffffff; font-variant-numeric: tabular-nums; }
.stop-mode-option input[type="number"]:disabled { background: #eef2f6; color: #98a2b3; cursor: not-allowed; }
.stop-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid #b7e4d2; border-radius: 7px; background: #effaf5; color: #344054; font-size: 13px; }
.stop-preview strong { color: #067a3f; font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.stop-warning { margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: #f8fafc; font-size: 12px; line-height: 1.45; }
.cancel-stop-button { color: #b42318; border-color: #f0b4ae; background: #fff1f0; }
.table-sort { min-height: 0; padding: 0; background: transparent; color: #344054; font-size: 13px; font-weight: 700; text-align: center; width: 100%; }
.table-sort:hover { text-decoration: underline; }
th[data-direction="asc"] .table-sort::after { content: " ↑"; }
th[data-direction="desc"] .table-sort::after { content: " ↓"; }
.trades-table tbody tr { transition: background-color 160ms ease, box-shadow 160ms ease; }
.trades-table tbody tr.trade-profit { background: #effaf3; box-shadow: inset 4px 0 0 #20a464; }
.trades-table tbody tr.trade-protected { background: #d9fbe7; box-shadow: inset 6px 0 0 #00a850; }
.trades-table tbody tr.trade-loss { background: #fff1f0; box-shadow: inset 4px 0 0 #d92d20; }
.trades-table tbody tr.trade-flat { background: #ffffff; box-shadow: inset 4px 0 0 #94a3b8; }
.trades-table tbody tr:hover { filter: brightness(0.985); }
.pnl { font-weight: 700; }
.trade-profit .pnl { color: #12744a; }
.trade-protected .pnl { color: #067a3f; }
.trade-loss .pnl { color: #b42318; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status.open { color: #0f5132; background: #dff7e8; }
.status.closed { color: #ffffff; background: #16a34a; }
.mode { display: inline-flex; align-items: center; border-radius: 5px; padding: 3px 7px; font-size: 11px; font-weight: 800; letter-spacing: 0; white-space: nowrap; }
.mode.live { color: #7a2e0e; background: #fff4d6; border: 1px solid #f2c94c; }
.mode.paper { color: #344054; background: #eef2f6; border: 1px solid #d8dee6; }
.side { font-weight: 700; }
.side.sell { color: #d92d20; }
.side.buy { color: #12744a; }
.executions-table th, .executions-table td { white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
.executions-table td { font-size: 13px; }
.main-panel .table-wrap, section > .table-wrap { overflow-x: hidden; }
.trades-executions-table { table-layout: fixed; }
.table-wrap .trades-executions-table { min-width: 0; width: 100%; }
.trades-executions-table th, .trades-executions-table td { padding: 8px 5px; font-size: 12px; }
.trades-executions-table [data-col="pair"] { width: 110px; }
.trades-executions-table [data-col="time"] { width: 128px; }
.trades-executions-table [data-col="type"] { width: 92px; }
.trades-executions-table [data-col="side"] { width: 60px; }
.trades-executions-table [data-col="price"] { width: 98px; }
.trades-executions-table [data-col="quantity"] { width: 102px; }
.trades-executions-table [data-col="volume"] { width: 92px; }
.trades-executions-table [data-col="fee"] { width: 84px; }
.trades-executions-table [data-col="realized_pnl"] { width: 98px; }
.trades-executions-table [data-col="order"] { width: 124px; }
.trades-executions-table .order-cell { white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.2; font-size: 12px; }
section > .stats-table-wrap { overflow-x: auto; }
.table-wrap .stats-table { table-layout: auto; min-width: 640px; width: 100%; }
.stats-page .section-header { flex-wrap: wrap; }
.stats-table th, .stats-table td { text-align: center; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
.stats-table [data-col="date"] { width: 128px; }
.stats-table [data-col="pnl"] { width: 132px; }
.stats-table [data-col="trades"] { width: 98px; }
.stats-table [data-col="volume"] { width: 150px; }
.stats-table [data-col="avg_markup"] { width: 132px; }

@media (max-width: 900px) {
  main { padding: 16px; }
  .settings-grid { column-count: 1; }
  .settings-title { flex-direction: column; }
  .switch-row { align-items: flex-start; }
  .cmc-modal-actions { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .stop-loss-modal { padding: 16px; }
  .stop-loss-summary, .stop-mode-grid { grid-template-columns: 1fr; }
  .stop-loss-modal .cmc-modal-header h2 { font-size: 21px; }
  .stop-preview { align-items: flex-start; flex-direction: column; gap: 4px; }
  .stop-preview strong { text-align: left; }
}

/* Recent Trades fits desktop panels and scrolls within its own frame on phones. */
.dashboard-trades-panel .recent-trades-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: auto; scrollbar-color: #8899ab #eef2f6; }
.recent-trades-scroll::-webkit-scrollbar { height: 10px; }
.recent-trades-scroll::-webkit-scrollbar-track { background: #eef2f6; }
.recent-trades-scroll::-webkit-scrollbar-thumb { background: #8899ab; border-radius: 5px; }
.recent-trades-scroll:focus-visible { outline: 2px solid #526d91; outline-offset: 2px; }
.recent-trades-scroll .recent-trades-table { min-width: 924px; width: 100%; }
.dashboard-trades-panel .stop-now-button.active { background: #365d85; }
@media (max-width: 900px) {
  .dashboard-trades-panel .section-header { flex-wrap: wrap; }
  .dashboard-trades-panel .table-controls { justify-content: flex-start; max-width: 100%; }
  .dashboard-trades-panel .filter-field { min-width: 0; max-width: 100%; }
  .dashboard-trades-panel .filter-field input { min-width: 0; width: min(220px, 45vw); }
}

.recent-trades-table th:last-child .resize-handle { right: 0; }

.coin-info-trigger { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; padding: 4px; min-height: 32px; min-width: 32px; background: transparent; color: inherit; border-radius: 50%; }
.coin-info-trigger:hover { background: #e7f3ee; }
.coin-info-trigger:focus-visible { outline: 2px solid #1f7a5b; outline-offset: 2px; }
.coin-cmc-edit { font-size: 16px; }
.coin-info-dialog { width: min(780px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid #d8dee6; border-radius: 16px; color: #17202a; background: #fff; box-shadow: 0 20px 60px #0003; overflow: hidden; }
.coin-info-dialog[open] { display: flex; flex-direction: column; }
#coin-info-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #a4adb9 transparent; padding-right: 10px; }
#coin-info-content::-webkit-scrollbar { width: 8px; }
#coin-info-content::-webkit-scrollbar-track { background: transparent; }
#coin-info-content::-webkit-scrollbar-thumb { background: #a4adb9; border: 2px solid #fff; border-radius: 8px; }
#coin-info-content::-webkit-scrollbar-thumb:hover { background: #788596; }
#coin-info-content::-webkit-scrollbar-button { display: none; }
.coin-info-dialog::backdrop { background: #10182888; }
.coin-info-heading { flex-shrink: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.coin-info-heading h2 { margin: 4px 0 16px; overflow-wrap: anywhere; }
.coin-info-heading p { margin: 0; }
.coin-info-dialog h3 { font-size: 16px; margin-bottom: 8px; }
.coin-info-dialog p { line-height: 1.6; }
.coin-info-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.coin-info-dialog [hidden] { display: none !important; }
#coin-info-reviewed { font-size: 12px; margin-bottom: 0; }
@media (max-width: 480px) { .coin-info-dialog { padding: 18px; } .coin-info-heading h2 { font-size: 22px; } }

.coin-info-section { margin-top: 24px; }
.coin-info-section li { line-height: 1.6; margin: 8px 0; }
.coin-info-section ul { padding-left: 22px; }
.coin-info-table-scroll { overflow-x: auto; border: 1px solid #d8dee6; border-radius: 8px; }
.coin-info-table-scroll table { width: 100%; table-layout: auto; border-collapse: collapse; }
.coin-info-table-scroll th, .coin-info-table-scroll td { white-space: normal; text-align: left; vertical-align: top; padding: 10px; min-width: 130px; overflow-wrap: anywhere; }
.coin-info-dialog p { overflow-wrap: anywhere; }
#coin-info-close { position: sticky; top: 0; flex-shrink: 0; }

/* Keep navigation and controls inside the viewport; wide data scrolls locally. */
@media (max-width: 900px) {
  header { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  header nav { flex-wrap: wrap; min-width: 0; }
  .header-actions { flex-wrap: wrap; }
  main, main > *, section, .section-header > * { min-width: 0; }
  .section-header { flex-wrap: wrap; }
  .table-controls { justify-content: flex-start; max-width: 100%; }
  .pagination-bar { flex-wrap: wrap; }
  .main-panel .table-wrap, section > .table-wrap, .pairs-frame { overflow-x: auto; }
  .pairs-frame table { min-width: 1020px; }
  .table-wrap .trades-executions-table { min-width: 1080px; }
  .cmc-modal-panel { max-height: calc(100dvh - 32px); overflow-y: auto; }
}
@media (max-width: 600px) {
  header { gap: 12px; padding: 12px; }
  header .brand { width: 100%; font-size: 18px; }
  header nav { flex: 1 0 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  header nav a { padding: 10px 4px; font-size: 13px; min-height: 44px; }
  .header-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .header-actions form, .header-actions button, .header-actions .button-link { min-width: 0; width: 100%; }
  .header-actions button, .header-actions .button-link { min-height: 44px; padding: 10px 4px; font-size: 13px; }
  main { width: 100%; padding: 12px; }
  section, .main-panel { padding: 12px; }
  .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; }
  .dashboard-summary article { min-width: 0; min-height: 84px; padding: 12px 6px; overflow-wrap: anywhere; }
  .dashboard-summary article h2 { font-size: 15px; }
  .dashboard-summary article strong { font-size: 14px; }
  .section-header { align-items: stretch; gap: 12px; }
  .section-header h1, .section-header h2 { font-size: 22px; }
  .table-controls { width: 100%; gap: 10px; }
  .filter-field, .dashboard-trades-panel .filter-field { width: 100%; min-width: 0; }
  .filter-field input, .dashboard-trades-panel .filter-field input { flex: 1; width: 0; min-width: 0; }
  input, select, textarea { font-size: 16px; max-width: 100%; }
  .pagination-bar { justify-content: center; gap: 8px; }
  .pagination-bar button { min-height: 44px; }
  .settings-card { padding: 12px; min-width: 0; }
  .stats-period-controls { align-items: stretch; }
  .stats-period-controls .page-size-field { flex: 1 1 120px; flex-direction: column; align-items: stretch; }
  .stats-period-controls select { min-width: 0; width: 100%; }
  .coin-info-links .button-link { width: 100%; min-height: 44px; }
}
