:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #0d1118;
  --surface-2: #111722;
  --border: #202938;
  --text: #f4f7fb;
  --muted: #8490a2;
  --blue: #627eea;
  --blue-soft: rgba(98, 126, 234, .16);
  --green: #43d69c;
  --amber: #f5bd58;
  --red: #ff6b75;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 70% -20%, rgba(98,126,234,.18), transparent 38%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 40px 0 64px; }
.topbar, .address-card, .panel-head, .dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 5px 0 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.055em; line-height: .95; }
.product-scope { margin: 12px 0 0; color: var(--muted); font-size: .82rem; letter-spacing: .035em; }
.product-nav { margin-top: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 17px; color: var(--muted); font-size: .82rem; letter-spacing: .035em; }
.product-nav a { position: relative; color: #9cabc0; text-decoration: none; }
.product-nav a:hover, .product-nav a.active { color: var(--text); }
.product-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; border-radius: 2px; background: var(--blue); }
.product-nav span { color: #5f6a7b; }
h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.connection { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: rgba(13,17,24,.78); font-size: .875rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #566071; }
.connection.live .dot { background: var(--green); box-shadow: 0 0 0 5px rgba(67,214,156,.1); }
.connection.live { color: var(--green); }
.connection.error .dot { background: var(--red); }
.connection.error { color: var(--red); }
.address-card { margin-top: 32px; padding: 22px 24px; border: 1px solid var(--border); background: linear-gradient(120deg, var(--surface-2), var(--surface)); border-radius: 16px; }
.address-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.label { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 7px; }
.address { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; text-decoration: none; overflow-wrap: anywhere; }
.address:hover { color: #9eafff; }
.address-list { display: flex; flex-wrap: wrap; gap: 7px; }
.address-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid #29354a; border-radius: 999px; background: rgba(98,126,234,.08); color: #afbdff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; text-decoration: none; }
.address-chip:hover { border-color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.stats article { min-height: 114px; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: rgba(13,17,24,.76); display: flex; flex-direction: column; justify-content: space-between; }
.stats span { color: var(--muted); font-size: .82rem; }
.stats strong { font-size: 2rem; letter-spacing: -.04em; }
.stats strong.small { font-size: 1rem; letter-spacing: 0; }
.pending-sync-notice { margin: 0 0 14px; padding: 15px 17px; border: 1px solid rgba(245,189,88,.32); border-radius: 13px; background: linear-gradient(135deg, rgba(245,189,88,.09), rgba(17,23,34,.78)); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.pending-sync-notice[hidden] { display: none; }
.pending-sync-notice strong { color: var(--amber); font-size: .88rem; }
.pending-sync-notice p { margin: 5px 0 0; color: #aeb8c8; font-size: .78rem; line-height: 1.45; }
.pending-sync-notice button { flex: 0 0 auto; min-height: 34px; font-size: .76rem; }
.pending-sync-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.pending-sync-actions [hidden] { display: none; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 13px; border: 1px solid #26334a; border-radius: 9px; color: #dbe6f8; text-decoration: none; font-size: .76rem; }
.button-link:hover { border-color: #52698f; background: #151e2d; }
.optional { margin-left: 6px; color: #75839a; font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.balances-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .8fr); gap: 14px; margin-bottom: 14px; }
.balance-panel { min-width: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.balance-head { min-height: 72px; padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.balance-head p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; }
.balance-actions { display: flex; gap: 7px; }
.balance-actions button, .balance-head > button { min-height: 34px; padding: 0 11px; font-size: .78rem; }
.wallet-balances-body { min-height: 132px; }
.wallet-balance-row { padding: 15px 18px; border-bottom: 1px solid #18202d; }
.wallet-balance-row:last-child { border-bottom: 0; }
.wallet-balance-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.wallet-balance-title strong { font-size: .88rem; }
.wallet-balance-title span { color: var(--muted); font: .72rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.token-balances { display: grid; grid-template-columns: repeat(6, minmax(82px, 1fr)); gap: 7px; }
.token-balance { min-width: 0; padding: 9px 10px; border-radius: 9px; background: var(--surface-2); }
.token-balance span { display: block; color: var(--muted); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.token-balance strong { display: block; margin-top: 4px; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balance-empty { min-height: 132px; padding: 46px 18px; color: var(--muted); text-align: center; font-size: .82rem; }
.gas-balance-body { min-height: 202px; padding: 18px; }
.gas-name { color: var(--muted); font-size: .75rem; }
.gas-address { margin-top: 4px; color: #b7c2d2; font: .73rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.gas-amount { margin: 22px 0 6px; font-size: 2rem; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.gas-change { display: inline-flex; margin: 2px 0 9px; padding: 6px 9px; border-radius: 999px; font-size: .72rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.gas-change.positive { color: var(--green); background: rgba(67,214,156,.1); border: 1px solid rgba(67,214,156,.22); }
.gas-change.negative { color: var(--red); background: rgba(255,107,117,.1); border: 1px solid rgba(255,107,117,.22); }
.gas-change.neutral { color: var(--muted); background: rgba(132,144,162,.08); border: 1px solid rgba(132,144,162,.14); }
.gas-minimum { color: var(--muted); font-size: .75rem; }
.gas-status { margin-top: 16px; padding: 10px 11px; border-radius: 9px; color: var(--green); background: rgba(67,214,156,.1); font-size: .78rem; font-weight: 700; }
.gas-status.low { color: var(--red); background: rgba(255,107,117,.1); }
.gas-refresh { width: 100%; margin-top: 12px; }
.exchange-panel { margin-bottom: 14px; }
.exchange-overview-actions { display: flex; align-items: center; gap: 8px; }
.exchange-overview-actions .button-link { min-height: 40px; }
.exchange-overview-foot { margin-top: 10px; padding: 12px 4px 0; border-top: 1px solid #1d2736; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .76rem; }
.exchange-overview-foot a { color: #91a6ff; text-decoration: none; }
.exchange-overview-foot a:hover { text-decoration: underline; }
.exchange-title-line { display: flex; align-items: center; gap: 10px; }
.exchange-mark { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #090d14; background: linear-gradient(135deg, #35e7b0, #54a6ff); font-size: .78rem; font-weight: 900; }
.exchange-body { padding: 14px; }
.exchange-empty { min-height: 130px; padding: 52px 20px; color: var(--muted); text-align: center; font-size: .82rem; }
.exchange-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.exchange-summary article { min-width: 0; min-height: 112px; padding: 15px 16px; border: 1px solid #1d2736; border-radius: 12px; background: linear-gradient(145deg, #111824, #0c1119); display: flex; flex-direction: column; }
.exchange-summary span, .exchange-summary small { color: var(--muted); font-size: .75rem; }
.exchange-summary strong { margin: 9px 0 5px; font-size: 1.42rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exchange-summary small { margin-top: auto; }
.exchange-warning { margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(245,189,88,.3); border-radius: 10px; background: rgba(245,189,88,.07); color: var(--amber); font-size: .76rem; }
.exchange-sections { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 10px; margin-top: 10px; }
.exchange-section { min-width: 0; border: 1px solid #1d2736; border-radius: 12px; background: #0b1017; overflow: hidden; }
.exchange-subhead { min-height: 65px; padding: 12px 14px; border-bottom: 1px solid #1d2736; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.exchange-subhead h3 { margin: 0; font-size: .88rem; }
.exchange-subhead p, .exchange-subhead > span { margin: 4px 0 0; color: var(--muted); font-size: .72rem; }
.exchange-table-wrap { max-height: 320px; overflow: auto; }
.exchange-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.exchange-table th { position: sticky; top: 0; z-index: 1; padding: 10px 11px; color: #78869a; background: #0d131c; text-align: left; text-transform: uppercase; letter-spacing: .045em; font-size: .68rem; white-space: nowrap; }
.exchange-table td { padding: 11px; border-top: 1px solid #18212e; color: #dbe4f1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exchange-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.exchange-table .numeric { text-align: right; }
.exchange-account-badge, .position-side { padding: 4px 7px; border-radius: 999px; color: #aab7c9; background: #151d29; font-size: .68rem; }
.position-side { font-weight: 750; text-transform: capitalize; }
.position-side.long { color: var(--green); background: rgba(67,214,156,.1); }
.position-side.short { color: var(--red); background: rgba(255,107,117,.1); }
.exchange-pnl.positive { color: var(--green); }
.exchange-pnl.negative { color: var(--red); }
.exchange-pnl.neutral { color: #dbe4f1; }
.exchange-table-empty { height: 86px; color: var(--muted) !important; text-align: center; }

/* Product views and command-center overview */
.legacy-data-module, .overview-dashboard, .view-wallets, .view-networks, .view-market { display: none !important; }
body[data-view="overview"] .overview-dashboard { display: block !important; }
body[data-view="overview"] .view-overview { display: block !important; }
body[data-view="wallets"] .view-wallets.address-card { display: flex !important; }
body[data-view="wallets"] .view-wallets.stats { display: grid !important; }
body[data-view="wallets"] .view-wallets.pending-sync-notice:not([hidden]) { display: flex !important; }
body[data-view="wallets"] .view-wallets.balances-layout { display: grid !important; }
body[data-view="wallets"] .view-wallets.panel,
body[data-view="networks"] .view-networks.panel,
body[data-view="market"] .view-market.panel { display: block !important; }
body[data-view="wallets"] .address-card,
body[data-view="networks"] .network-health-panel,
body[data-view="market"] .news-panel { margin-top: 32px; }
body[data-view="networks"] .topbar > .connection,
body[data-view="market"] .topbar > .connection { display: none; }

.overview-dashboard { margin-top: 32px; }
.overview-commandbar { min-height: 92px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(120deg, #121a27, #0d121b); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.overview-commandbar h2 { margin-top: 5px; font-size: 1.25rem; }
.overview-commandbar p { margin: 6px 0 0; color: var(--muted); font-size: .78rem; }
.overview-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.overview-actions .button-link { min-height: 40px; }
.overview-kpis { margin: 14px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.overview-kpis article { min-width: 0; min-height: 118px; padding: 17px 18px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg, #111824, #0b1017); display: flex; flex-direction: column; }
.overview-kpis span, .overview-kpis small { color: var(--muted); font-size: .74rem; }
.overview-kpis strong { margin: 10px 0 6px; overflow: hidden; font-size: 1.72rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.overview-kpis small { margin-top: auto; }
.overview-kpis strong.positive, .overview-table .positive { color: var(--green); }
.overview-kpis strong.negative, .overview-table .negative { color: var(--red); }
.overview-kpis strong.neutral, .overview-table .neutral { color: #d8e0ec; }
.overview-primary-grid, .overview-secondary-grid { margin-bottom: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.overview-card { min-width: 0; border: 1px solid var(--border); border-radius: 16px; background: rgba(13,17,24,.92); overflow: hidden; }
.overview-dashboard > .overview-card { margin-bottom: 14px; }
.overview-card + .overview-card:not(.overview-primary-grid .overview-card):not(.overview-secondary-grid .overview-card) { margin-top: 14px; }
.overview-card-head { min-height: 72px; padding: 14px 17px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.overview-card-head h2 { margin-top: 4px; font-size: 1rem; }
.overview-card-head > a { color: #91a6ff; font-size: .73rem; text-decoration: none; white-space: nowrap; }
.overview-card-head > a:hover { text-decoration: underline; }
.overview-count { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid rgba(245,189,88,.25); border-radius: 999px; color: var(--amber); background: rgba(245,189,88,.08); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 800; }
.overview-count.clear { border-color: rgba(67,214,156,.25); color: var(--green); background: rgba(67,214,156,.08); }
.connection.compact { padding: 7px 10px; font-size: .72rem; }
.overview-list { min-height: 176px; }
.overview-list-item { min-height: 58px; padding: 11px 15px; border-bottom: 1px solid #18212e; color: inherit; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; text-decoration: none; }
.overview-list-item:last-child { border-bottom: 0; }
a.overview-list-item:hover { background: #111824; }
.overview-list-item strong, .overview-list-item small { display: block; }
.overview-list-item strong { color: #dce4ef; font-size: .78rem; }
.overview-list-item small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: .68rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.overview-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #566071; }
.overview-status-dot.ok { background: var(--green); box-shadow: 0 0 0 5px rgba(67,214,156,.08); }
.overview-status-dot.warning { background: var(--amber); box-shadow: 0 0 0 5px rgba(245,189,88,.08); }
.overview-status-dot.critical { background: var(--red); box-shadow: 0 0 0 5px rgba(255,107,117,.08); }
.overview-arrow { color: #71809a; }
.overview-system-grid { min-height: 176px; padding: 5px 15px; }
.overview-system-item { min-height: 42px; border-bottom: 1px solid #18212e; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.overview-system-item:last-child { border-bottom: 0; }
.overview-system-item span { color: var(--muted); font-size: .72rem; }
.overview-system-item strong { font-size: .73rem; text-align: right; }
.overview-system-item strong.ok { color: var(--green); }
.overview-system-item strong.warning { color: var(--amber); }
.overview-system-item strong.critical { color: var(--red); }
.overview-system-item strong.neutral { color: #aeb9c9; }
.overview-account-grid { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.overview-account-card { min-width: 0; min-height: 118px; padding: 15px; border: 1px solid #202b3b; border-radius: 12px; color: inherit; background: linear-gradient(135deg, #111925, #0c1119); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; text-decoration: none; }
.overview-account-card:hover { border-color: #35445c; background: linear-gradient(135deg, #141e2c, #0e141d); }
.overview-account-card h3 { margin: 8px 0 5px; font-size: .9rem; }
.overview-account-card p { margin: 0; color: var(--muted); font-size: .69rem; }
.account-provider { color: #91a6ff; font-size: .62rem; font-weight: 800; letter-spacing: .1em; }
.account-value { text-align: right; }
.account-value strong, .account-value small { display: block; }
.account-value strong { font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.account-value small { margin-top: 7px; color: var(--muted); font-size: .66rem; }
.overview-table-wrap { overflow-x: auto; }
.overview-table { min-width: 560px; }
.overview-table th, .overview-table td { padding: 12px 15px; font-size: .73rem; }
.overview-table th { font-size: .62rem; }
.overview-table th:not(:first-child), .overview-table td:not(:first-child) { text-align: right; }
.overview-table td strong, .overview-table td small { display: block; }
.overview-table td small { margin-top: 3px; color: var(--muted); font-size: .62rem; }
.overview-empty { min-height: 120px; padding: 50px 18px; color: var(--muted); text-align: center; font-size: .75rem; }
.overview-market-pulse { margin-top: 0; }
.overview-news-grid { padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.overview-news-card { min-width: 0; min-height: 145px; padding: 13px; border: 1px solid #202b3b; border-radius: 12px; background: #0f151f; }
.overview-news-card h3 { margin: 10px 0 7px; font-size: .79rem; line-height: 1.35; }
.overview-news-card h3 a { color: #e2e8f2; text-decoration: none; }
.overview-news-card h3 a:hover { color: #aebcff; }
.overview-news-card p { margin: 0; overflow: hidden; color: var(--muted); font-size: .68rem; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

/* Network control */
.network-health-head { align-items: flex-start; }
.network-health-head h2 { margin-top: 5px; }
.network-health-actions { display: flex; align-items: center; gap: 9px; }
.network-health-body { padding: 14px; }
.network-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.network-kpis article { min-width: 0; min-height: 108px; padding: 15px; border: 1px solid #202b3b; border-radius: 12px; background: linear-gradient(145deg, #111824, #0b1017); display: flex; flex-direction: column; }
.network-kpis span, .network-kpis small { color: var(--muted); font-size: .69rem; }
.network-kpis strong { margin: 10px 0 5px; overflow: hidden; font-size: 1.42rem; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.network-kpis small { margin-top: auto; }
.network-control-grid { margin-top: 12px; display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.45fr); gap: 12px; }
.network-subcard { min-width: 0; border: 1px solid #202b3b; border-radius: 12px; background: #0a0f16; overflow: hidden; }
.network-subhead { min-height: 62px; padding: 12px 14px; border-bottom: 1px solid #1d2736; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.network-subhead h3 { margin-top: 4px; font-size: .86rem; }
.network-subhead > small { color: var(--muted); font-size: .65rem; }
.network-readiness-list { padding: 4px 14px; }
.network-readiness-item { min-height: 50px; border-bottom: 1px solid #18212e; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.network-readiness-item:last-child { border-bottom: 0; }
.network-readiness-item strong, .network-readiness-item small { display: block; }
.network-readiness-item strong { font-size: .75rem; }
.network-readiness-item small { margin-top: 3px; color: var(--muted); font-size: .65rem; line-height: 1.3; }
.network-readiness-value { color: #aeb9c9; font-size: .69rem; font-weight: 750; text-align: right; }
.network-readiness-value.ok { color: var(--green); }
.network-readiness-value.warning { color: var(--amber); }
.network-readiness-value.critical { color: var(--red); }
.network-empty { min-height: 150px; padding: 65px 10px; color: var(--muted); text-align: center; font-size: .72rem; }
.fee-planner-wrap { overflow-x: auto; }
.fee-planner-table { min-width: 660px; }
.fee-planner-table th, .fee-planner-table td { padding: 13px 14px; font-size: .72rem; }
.fee-planner-table th { font-size: .61rem; }
.fee-planner-table th:not(:first-child), .fee-planner-table td:not(:first-child) { text-align: right; }
.fee-planner-table td strong, .fee-planner-table td small { display: block; }
.fee-planner-table td strong { color: #e0e7f1; font-size: .76rem; }
.fee-planner-table td small { margin-top: 3px; color: var(--muted); font-size: .62rem; }
.fee-mode { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #b7c2d3; background: #151d29; font-size: .65rem; font-weight: 750; }
.fee-mode.standard { color: #aebcff; background: rgba(98,126,234,.12); }
.fee-mode.priority { color: var(--amber); background: rgba(245,189,88,.1); }

/* Dedicated exchange workspace */
.exchange-shell { width: min(1760px, calc(100% - 48px)); margin: 0 auto; padding: 32px 0 64px; }
.exchange-page-topbar { margin-bottom: 24px; }
.exchange-page-topbar h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.exchange-page-actions { display: flex; align-items: center; gap: 9px; }
.exchange-workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.account-sidebar { position: sticky; top: 20px; min-height: 520px; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: rgba(13,17,24,.94); }
.account-sidebar-head { min-height: 56px; padding-bottom: 15px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.account-sidebar-head h2 { margin-top: 4px; font-size: 1rem; }
.account-sidebar-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.add-account-button { min-height: 30px; padding: 0 9px; border-color: rgba(98,126,234,.38); color: #c3ccff; background: rgba(98,126,234,.1); font-size: .7rem; }
.add-account-button:hover { border-color: rgba(98,126,234,.65); background: rgba(98,126,234,.18); }
.text-button { min-height: 30px; padding: 0; border: 0; background: transparent; color: #91a6ff; font-size: .75rem; }
.text-button:hover { color: #bdc8ff; }
.account-tree { padding: 12px 0; }
.tree-exchange + .tree-exchange { border-top: 1px solid #18212e; }
.tree-row { min-height: 42px; display: flex; align-items: center; gap: 8px; }
.tree-parent label, .tree-child { cursor: pointer; }
.tree-parent label { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; }
.tree-row input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--blue); }
.tree-caret { width: 22px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.exchange-tree-mark { width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #091019; background: linear-gradient(135deg, #35e7b0, #54a6ff); font-size: .7rem; font-weight: 900; }
.tree-row strong { font-size: .82rem; }
.tree-status { padding: 3px 6px; border-radius: 999px; color: var(--muted); background: #151d29; font-size: .6rem; text-transform: capitalize; }
.tree-status.connected { color: var(--green); background: rgba(67,214,156,.1); }
.tree-child { padding-left: 22px; color: #bdc7d5; }
.tree-child > span:last-child { min-width: 0; }
.tree-child strong, .tree-child small { display: block; }
.tree-child small { margin-top: 2px; color: var(--muted); font-size: .65rem; text-transform: capitalize; }
.tree-spacer { width: 2px; height: 28px; margin-right: 2px; background: #202938; }
.tree-loading { padding: 30px 8px; color: var(--muted); font-size: .76rem; text-align: center; }
.account-sidebar-note { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: .7rem; line-height: 1.45; }
.account-sidebar-note a { color: #91a6ff; }
.exchange-content { min-width: 0; }
.exchange-commandbar { min-height: 80px; padding: 15px 18px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(120deg, var(--surface-2), var(--surface)); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.exchange-commandbar strong, .exchange-commandbar small { display: block; }
.exchange-commandbar strong { font-size: .92rem; }
.exchange-commandbar small { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.view-switch { display: inline-flex; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: #090d13; }
.view-switch button { min-height: 34px; border: 0; background: transparent; color: var(--muted); font-size: .76rem; }
.view-switch button.active { color: var(--text); background: #1a2331; box-shadow: 0 0 0 1px #29364a inset; }
.pending-exchange-update { width: 100%; min-height: 38px; margin-top: 10px; border-color: rgba(98,126,234,.38); color: #bac5ff; background: rgba(98,126,234,.1); font-size: .78rem; }
.exchange-page-error { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(255,107,117,.3); border-radius: 11px; color: var(--red); background: rgba(255,107,117,.07); font-size: .78rem; }
.exchange-page-warning { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(245,189,88,.3); border-radius: 11px; color: #d7b96f; background: rgba(245,189,88,.07); font-size: .78rem; }
.exchange-page-warning strong, .exchange-page-warning span { display: block; }
.exchange-page-warning span { margin-top: 4px; color: #b9aa86; }
.exchange-page-warning details { margin-top: 8px; color: var(--muted); }
.exchange-page-warning summary { cursor: pointer; }
.exchange-page-warning ul { margin: 8px 0 0; padding-left: 18px; }
.exchange-add-dialog { width: min(610px, calc(100% - 32px)); }
.exchange-add-dialog .dialog-note { margin-top: 16px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.exchange-permission-confirm { margin-top: 20px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; display: flex; align-items: flex-start; gap: 10px; color: #b9c4d3; font-weight: 500; line-height: 1.45; }
.exchange-permission-confirm input { width: 16px; height: 16px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--blue); }
.exchange-kpis { margin: 14px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.exchange-kpis article { min-width: 0; min-height: 116px; padding: 16px 17px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg, #111824, #0c1119); display: flex; flex-direction: column; }
.exchange-kpis span, .exchange-kpis small { color: var(--muted); font-size: .74rem; }
.exchange-kpis strong { margin: 10px 0 6px; overflow: hidden; color: var(--text); font-size: 1.55rem; font-variant-numeric: tabular-nums; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.exchange-kpis strong.positive, .exchange-page-table .positive { color: var(--green); }
.exchange-kpis strong.negative, .exchange-page-table .negative { color: var(--red); }
.exchange-kpis small { margin-top: auto; }
.exchange-data-panel { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.exchange-data-head { min-height: 72px; padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.exchange-tabs { display: flex; align-items: center; gap: 4px; }
.exchange-tabs button { border: 0; background: transparent; color: var(--muted); font-size: .82rem; }
.exchange-tabs button.active { color: var(--text); background: #18212e; }
.exchange-tabs span { margin-left: 5px; color: #7f8ba0; font-size: .68rem; }
.exchange-table-tools { display: flex; align-items: center; gap: 9px; }
.exchange-table-tools input { width: 260px; min-height: 38px; padding: 0 12px; }
.compact-check { min-height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; display: flex; align-items: center; gap: 8px; color: #abb7c8; background: var(--surface-2); font-size: .75rem; white-space: nowrap; }
.compact-check input { width: 15px; height: 15px; accent-color: var(--blue); }
.exchange-page-table-wrap { overflow-x: auto; }
.exchange-page-table { min-width: 920px; }
.exchange-page-table th { padding: 12px 15px; font-size: .68rem; }
.exchange-page-table td { padding: 14px 15px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.exchange-page-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: .67rem; }
.exchange-page-table .numeric { text-align: right; }
.exchange-page-empty { height: 220px; color: var(--muted) !important; text-align: center; }

/* Transfer planning workspace */
.transfer-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 64px; }
.transfer-page-topbar { margin-bottom: 24px; }
.transfer-page-topbar h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.transfer-header-actions, .wallet-source-actions { display: flex; align-items: center; gap: 9px; }
.transfer-mode-switch { width: min(620px, 100%); margin-bottom: 14px; padding: 5px; border: 1px solid var(--border); border-radius: 14px; background: #090d13; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.transfer-mode-switch button { min-height: 58px; padding: 10px 14px; border: 0; background: transparent; color: var(--muted); text-align: left; }
.transfer-mode-switch button.active { color: var(--text); background: #17202d; box-shadow: 0 0 0 1px #2a374b inset; }
.transfer-mode-switch strong, .transfer-mode-switch small { display: block; }
.transfer-mode-switch strong { font-size: .86rem; }
.transfer-mode-switch small { margin-top: 4px; color: inherit; font-size: .7rem; }
.transfer-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(350px, .85fr); gap: 14px; align-items: start; }
.transfer-form-panel, .transfer-preview-panel, .wallet-sources-panel, .transfer-drafts-panel { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.transfer-preview-panel { position: sticky; top: 18px; }
.transfer-section-head { min-height: 78px; padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.transfer-section-head h2 { margin-top: 4px; font-size: 1.05rem; }
.transfer-section-head p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.draft-only-badge, .preview-status { padding: 5px 8px; border: 1px solid #2a3547; border-radius: 999px; color: var(--muted); background: #111823; font-size: .68rem; white-space: nowrap; }
.preview-status.ready { border-color: rgba(67,214,156,.3); color: var(--green); background: rgba(67,214,156,.08); }
.transfer-form-body { padding: 18px; }
.transfer-form-body label { display: block; margin: 16px 0 7px; color: #c6d0de; font-size: .8rem; font-weight: 700; }
.transfer-form-body label:first-child { margin-top: 0; }
.transfer-form-body select, .transfer-form-body input { width: 100%; min-height: 46px; padding: 0 12px; }
.transfer-form-body select:focus, .transfer-form-body input:focus, .exchange-table-tools input:focus { outline: 2px solid rgba(98,126,234,.35); border-color: var(--blue); }
.transfer-field-meta { min-height: 17px; margin: 6px 0 0; color: var(--muted); font-size: .7rem; }
.amount-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.amount-field button { min-height: 46px; }
.transfer-form-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 9px; }
.transfer-form-actions button { min-width: 150px; }
.transfer-form-actions button:disabled { cursor: default; opacity: .42; }
.transfer-safety-note { margin: 12px 0 0; color: #718096; font-size: .69rem; text-align: right; }
.transfer-summary { margin: 0; padding: 8px 18px 4px; }
.transfer-summary div { min-height: 51px; border-bottom: 1px solid #18212e; display: grid; grid-template-columns: 145px minmax(0, 1fr); align-items: center; gap: 16px; }
.transfer-summary div:last-child { border-bottom: 0; }
.transfer-summary dt { color: var(--muted); font-size: .75rem; }
.transfer-summary dd { margin: 0; overflow-wrap: anywhere; color: #dce5f2; font-size: .82rem; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.transfer-summary .summary-emphasis { min-height: 62px; }
.transfer-summary .summary-emphasis dd { color: var(--blue); font-size: 1rem; }
.transfer-checks { padding: 13px 18px 18px; border-top: 1px solid var(--border); display: grid; gap: 7px; }
.transfer-check { min-height: 34px; padding: 8px 10px; border-radius: 9px; display: flex; align-items: center; gap: 9px; color: #aab5c6; background: #111722; font-size: .72rem; }
.transfer-check span { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 900; }
.transfer-check.ok span { color: var(--green); background: rgba(67,214,156,.11); }
.transfer-check.failed span { color: var(--red); background: rgba(255,107,117,.11); }
.transfer-check.warning { color: var(--amber); }
.transfer-check.warning span { color: var(--amber); background: rgba(245,189,88,.11); }
.wallet-sources-panel, .transfer-drafts-panel { margin-top: 14px; }
.wallet-source-grid { min-height: 120px; padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wallet-source-card { min-width: 0; min-height: 112px; padding: 14px; border: 1px solid #1d2736; border-radius: 12px; background: linear-gradient(145deg, #111824, #0c1119); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wallet-source-card h3 { margin: 7px 0 5px; font-size: .86rem; }
.wallet-source-card code { color: var(--muted); font-size: .68rem; }
.wallet-type { color: #91a6ff; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.wallet-source-balance { text-align: right; }
.wallet-source-balance span, .wallet-source-balance strong { display: block; }
.wallet-source-balance span { color: var(--muted); font-size: .66rem; }
.wallet-source-balance strong { margin-top: 7px; font-size: .82rem; font-variant-numeric: tabular-nums; }
.transfer-empty { grid-column: 1 / -1; min-height: 105px; padding: 42px 16px; color: var(--muted); text-align: center; font-size: .78rem; }
.draft-table-wrap { overflow-x: auto; }
.draft-table { min-width: 960px; }
.draft-table th, .draft-table td { padding: 13px 15px; font-size: .75rem; }
.draft-type { padding: 4px 7px; border-radius: 999px; color: #aebaff; background: rgba(98,126,234,.1); font-size: .66rem; text-transform: capitalize; }
.watch-wallet-dialog { width: min(560px, calc(100% - 32px)); }
.panel { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.news-side { display: none; }
.news-panel { margin-bottom: 14px; }
.source-link { color: #91a6ff; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.news-controls select { min-width: 145px; }
.news-grid { min-height: 190px; padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.news-card { min-width: 0; min-height: 178px; padding: 15px; border: 1px solid #1c2635; border-radius: 12px; background: linear-gradient(145deg, #111824, #0c1119); display: flex; flex-direction: column; }
.news-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .68rem; }
.news-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #98a9c0; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.news-card h3 { margin: 12px 0 8px; font-size: .91rem; line-height: 1.35; }
.news-card h3 a { color: #edf2fb; text-decoration: none; }
.news-card h3 a:hover { color: #aab9ff; }
.news-summary { margin: 0; color: #8f9bad; font-size: .74rem; line-height: 1.48; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.news-footer { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.news-tags { display: flex; min-width: 0; gap: 5px; overflow: hidden; }
.news-tag { padding: 4px 7px; border-radius: 999px; background: rgba(98,126,234,.1); color: #99aaff; font-size: .62rem; white-space: nowrap; }
.news-read { flex: 0 0 auto; color: #91a6ff; font-size: .7rem; text-decoration: none; }
.news-read:hover { text-decoration: underline; }
.news-empty { grid-column: 1 / -1; min-height: 160px; padding: 58px 20px; color: var(--muted); text-align: center; font-size: .82rem; }
.gas-analytics-panel { margin-bottom: 14px; }
.gas-analytics-body { padding: 16px; }
.gas-live-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gas-live-grid article { min-width: 0; padding: 15px 16px; border: 1px solid #1d2736; border-radius: 12px; background: linear-gradient(145deg, #111824, #0c1119); }
.gas-live-grid article.gas-live-primary { border-color: rgba(98,126,234,.48); background: linear-gradient(145deg, rgba(98,126,234,.17), #0d121a); }
.gas-live-grid span, .gas-live-grid small { display: block; color: var(--muted); font-size: .72rem; }
.gas-live-grid strong { display: inline-block; margin: 8px 5px 0 0; font-size: 1.65rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.gas-live-grid small { display: inline; }
.gas-recommendation { min-height: 66px; margin: 12px 0; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: var(--surface-2); }
.gas-recommendation.low { border-color: rgba(67,214,156,.35); background: rgba(67,214,156,.08); }
.gas-recommendation.normal { border-color: rgba(245,189,88,.32); background: rgba(245,189,88,.07); }
.gas-recommendation.high { border-color: rgba(255,107,117,.35); background: rgba(255,107,117,.07); }
.gas-traffic-light { width: 12px; height: 12px; border-radius: 50%; background: #657187; box-shadow: 0 0 0 6px rgba(101,113,135,.1); }
.gas-recommendation.low .gas-traffic-light { background: var(--green); box-shadow: 0 0 0 6px rgba(67,214,156,.1); }
.gas-recommendation.normal .gas-traffic-light { background: var(--amber); box-shadow: 0 0 0 6px rgba(245,189,88,.1); }
.gas-recommendation.high .gas-traffic-light { background: var(--red); box-shadow: 0 0 0 6px rgba(255,107,117,.1); }
.gas-recommendation strong, .gas-recommendation small { display: block; }
.gas-recommendation strong { font-size: .9rem; }
.gas-recommendation small { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.gas-change-pill { padding: 6px 9px; border: 1px solid #2a3547; border-radius: 999px; color: #aeb8c8; font-size: .72rem; font-variant-numeric: tabular-nums; }
.gas-change-pill.spike { border-color: rgba(255,107,117,.35); color: var(--red); background: rgba(255,107,117,.08); }
.gas-history-layout { display: grid; grid-template-columns: minmax(420px, .95fr) minmax(0, 1.25fr); gap: 12px; }
.gas-history-card { min-width: 0; border: 1px solid #1d2736; border-radius: 12px; background: #0a0f16; overflow: hidden; }
.gas-subhead { min-height: 64px; padding: 13px 15px; border-bottom: 1px solid #1d2736; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gas-subhead h3 { margin: 0; font-size: .86rem; }
.gas-subhead p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.gas-hourly-wrap { max-height: 330px; overflow: auto; }
.gas-hourly-table { min-width: 520px; }
.gas-hourly-table th, .gas-hourly-table td { padding: 10px 12px; font-size: .72rem; }
.gas-hourly-table th { font-size: .64rem; }
.gas-hourly-table td strong { color: var(--text); font-variant-numeric: tabular-nums; }
.gas-level { display: inline-flex; min-width: 50px; justify-content: center; padding: 4px 7px; border-radius: 999px; font-size: .64rem; font-weight: 750; }
.gas-level.low { color: var(--green); background: rgba(67,214,156,.1); }
.gas-level.normal { color: var(--amber); background: rgba(245,189,88,.1); }
.gas-level.high { color: var(--red); background: rgba(255,107,117,.1); }
.gas-level.collecting { color: var(--muted); background: rgba(132,144,162,.1); }
.gas-heatmap-wrap { min-height: 330px; padding: 18px 14px 12px; overflow-x: auto; }
.gas-heatmap-grid { min-width: 570px; display: grid; grid-template-columns: 34px repeat(24, minmax(14px, 1fr)); grid-auto-rows: 29px; gap: 3px; align-items: center; }
.heatmap-corner { width: 34px; }
.heatmap-hour { color: #6f7c90; font-size: .58rem; text-align: center; }
.heatmap-day { color: #8490a2; font-size: .64rem; font-weight: 650; }
.heatmap-cell { width: 100%; height: 100%; border: 1px solid rgba(98,126,234,.13); border-radius: 4px; }
.heatmap-cell.missing { background: #101722; border-color: #172131; }
.heatmap-scale { min-width: 570px; margin-top: 12px; display: flex; justify-content: space-between; color: var(--muted); font-size: .64rem; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .62rem; }
.heatmap-legend i { width: 11px; height: 11px; border-radius: 3px; background: rgba(98,126,234,.2); }
.heatmap-legend i:nth-of-type(2) { background: rgba(98,126,234,.4); }
.heatmap-legend i:nth-of-type(3) { background: rgba(98,126,234,.65); }
.heatmap-legend i:nth-of-type(4) { background: rgba(98,126,234,.9); }
.gas-history-empty { color: var(--muted); text-align: center; font-size: .75rem; }
.gas-heatmap-wrap > .gas-history-empty { padding: 120px 16px; }
.panel-head { padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel-head p { color: var(--muted); font-size: .83rem; margin: 6px 0 0; }
.sync-status { color: #aab5c6; }
.controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.search-input { width: min(330px, 34vw); min-height: 40px; padding: 0 13px; }
.search-input:focus { outline: 2px solid rgba(98,126,234,.35); border-color: var(--blue); }
button, select, input { border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--surface-2); }
button, select { min-height: 40px; padding: 0 14px; }
.secondary:hover, select:hover { border-color: #3a4659; }
.danger { color: #f49aa1; }
.primary { border-color: transparent; background: var(--blue); font-weight: 700; }
.primary:hover { background: #718bf0; }
.table-wrap { min-height: 340px; max-height: 68vh; overflow: auto; position: relative; }
table { width: 100%; border-collapse: collapse; min-width: 1340px; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid #18202d; font-size: .86rem; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 3; color: #697588; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; background: #0a0e14; box-shadow: 0 1px 0 #18202d; }
td { color: #c9d1dd; }
.transaction-row { cursor: pointer; }
.transaction-row:hover td, .transaction-row:focus td { background: #101621; }
.transaction-row:focus { outline: 2px solid rgba(98,126,234,.55); outline-offset: -2px; }
.sort-button { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-button:hover, .sort-button:focus-visible { color: #aab5c6; outline: none; }
.sort-indicator { display: inline-block; min-width: 13px; margin-left: 3px; color: #59667a; }
th[aria-sort]:not([aria-sort="none"]) .sort-indicator { color: var(--blue); }
.hash { color: #91a6ff; text-decoration: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hash:hover { text-decoration: underline; }
.hash-cell { display: inline-flex; align-items: center; gap: 8px; }
.copy-button { min-height: 28px; padding: 0 9px; border-radius: 7px; color: #aeb8c8; font-size: .72rem; }
.copy-button:hover { color: var(--text); border-color: #3a4659; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.pending { color: var(--amber); background: rgba(245,189,88,.1); }
.status.confirmed { color: var(--green); background: rgba(67,214,156,.1); }
.status.failed, .status.dropped, .status.replaced { color: var(--red); background: rgba(255,107,117,.1); }
.gas-check { display: inline-flex; flex-direction: column; gap: 2px; }
.gas-check strong { font-size: .76rem; color: var(--green); }
.gas-check small { color: var(--muted); font-size: .7rem; }
.gas-check.boost strong { color: var(--amber); }
.queue-state { display: inline-flex; flex-direction: column; gap: 2px; }
.queue-state strong { color: var(--red); font-size: .76rem; }
.queue-state small { color: var(--muted); font-size: .7rem; }
.queue-state.blocked strong { color: var(--amber); }
.empty { min-height: 290px; padding: 70px 20px; text-align: center; }
.empty.hidden { display: none; }
.empty h3 { margin: 18px 0 7px; font-size: 1rem; }
.empty p { margin: 0; color: var(--muted); font-size: .86rem; }
.pagination { min-height: 62px; padding: 10px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: .8rem; }
.pagination-controls { display: flex; align-items: center; gap: 8px; }
.pagination-controls label { font-size: .75rem; }
.pagination-controls select, .pagination-controls button { min-height: 34px; padding: 0 10px; font-size: .78rem; }
.pagination-controls button:disabled { cursor: default; opacity: .42; }
.transaction-dialog { width: min(720px, calc(100% - 32px)); }
.notification-dialog { width: min(690px, calc(100% - 32px)); }
.transaction-dialog-body { padding: 24px; }
.detail-status { margin: -6px 0 14px; }
.transaction-details dl { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.transaction-detail { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 1.8fr); gap: 18px; padding: 12px 14px; border-bottom: 1px solid #18202d; }
.transaction-detail:last-child { border-bottom: 0; }
.transaction-detail dt { color: var(--muted); font-size: .78rem; }
.transaction-detail dd { margin: 0; color: #d9e0ea; font-size: .82rem; text-align: right; }
.transaction-detail .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.transaction-detail .wrap-value { white-space: normal; overflow-wrap: anywhere; }
.transaction-detail-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; }
.link-button { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--surface-2); text-decoration: none; }
.pulse-ring { width: 32px; height: 32px; margin: 0 auto; border: 1px solid var(--blue); border-radius: 50%; box-shadow: 0 0 0 9px var(--blue-soft), 0 0 40px rgba(98,126,234,.3); }
dialog { width: min(540px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 0; border: 1px solid #2a3547; border-radius: 16px; background: #0d121a; color: var(--text); box-shadow: 0 24px 100px #000; }
dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(5px); }
dialog form { padding: 24px; }
.dialog-head { margin-bottom: 24px; }
.dialog-head h2 { margin-top: 5px; font-size: 1.5rem; }
.icon-button { width: 38px; padding: 0; font-size: 1.5rem; color: var(--muted); }
dialog label { display: block; margin-bottom: 8px; font-size: .86rem; font-weight: 700; }
dialog input { width: 100%; height: 48px; padding: 0 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dialog-select { width: 100%; height: 48px; padding: 0 13px; }
dialog textarea { width: 100%; min-height: 104px; resize: vertical; padding: 12px 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.55; }
dialog input:focus, dialog textarea:focus { outline: 2px solid rgba(98,126,234,.35); border-color: var(--blue); }
dialog label:not(:first-of-type) { margin-top: 20px; }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-field button { height: 48px; }
.full-width { width: 100%; }
.check-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-label input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.dialog-section-title { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-fields label { margin-top: 20px; }
.test-status { min-height: 19px; margin-top: 8px; color: var(--green); font-size: .8rem; }
.test-status.error { color: var(--red); }
.hint { color: var(--muted); font-size: .78rem; line-height: 1.5; margin: 9px 0 0; }
.dialog-error { min-height: 20px; color: var(--red); font-size: .8rem; margin-top: 10px; }
.dialog-actions { justify-content: flex-end; margin-top: 12px; }
.settings-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.settings-section.first-section { margin-top: 0; padding-top: 0; border-top: 0; }
.settings-section h3 { margin: 0 0 14px; color: #b9c4d4; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.toggle-grid, .event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 16px; margin-bottom: 14px; }
.toggle-grid .check-label, .event-grid .check-label { margin: 0; padding: 10px 11px; border: 1px solid #222c3b; border-radius: 9px; background: rgba(17,23,34,.62); font-size: .8rem; }
.alert-rule { margin-top: 12px; padding: 14px; border: 1px solid #222c3b; border-radius: 12px; background: rgba(17,23,34,.55); }
.alert-rule:first-of-type { margin-top: 0; }
.alert-rule.urgent-rule { border-color: rgba(245,189,88,.32); background: linear-gradient(135deg, rgba(245,189,88,.07), rgba(17,23,34,.55)); }
.alert-rule-head .check-label { margin: 0; align-items: flex-start; }
.alert-rule-head .check-label input { margin-top: 3px; flex: 0 0 auto; }
.alert-rule-head strong { display: block; color: var(--text); font-size: .87rem; }
.alert-rule-head small { display: block; margin-top: 4px; color: var(--muted); font-size: .74rem; font-weight: 400; line-height: 1.4; }
.rule-channels { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 13px 0; padding: 10px 0; border-top: 1px solid #202938; border-bottom: 1px solid #202938; }
.rule-channels .check-label { margin: 0; font-size: .76rem; font-weight: 600; }
.rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rule-fields.single-rule-field { grid-template-columns: minmax(0, 1fr); }
.rule-fields label { margin: 0 0 7px; color: var(--muted); font-size: .74rem; }
.rule-fields input, .rule-fields select { height: 42px; }
.compact-fields label { margin-top: 0; }
.number-suffix { position: relative; }
.number-suffix input { padding-right: 48px; }
.number-suffix span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .78rem; pointer-events: none; }

@media (min-width: 1800px) {
  body[data-view] .shell { width: min(1500px, calc(100% - 64px)); }
  .shell { width: min(1280px, calc(100% - 560px)); }
  .news-panel { display: none; }
  .news-side { position: fixed; z-index: 5; top: 24px; bottom: 24px; width: clamp(220px, calc((100vw - 1280px) / 2 - 30px), 280px); padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: rgba(10,14,20,.96); box-shadow: 0 18px 55px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
  .news-side-left { left: 16px; }
  .news-side-right { right: 16px; }
  .news-side-head { min-height: 76px; padding-bottom: 12px; border-bottom: 1px solid #1c2635; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .news-side-head h2 { margin-top: 4px; font-size: 1rem; }
  .news-side-head p { max-width: 150px; margin: 5px 0 0; color: var(--muted); font-size: .66rem; line-height: 1.35; }
  .news-side-head select { width: 105px; min-height: 34px; padding: 0 8px; font-size: .7rem; }
  .news-side-head button { min-height: 34px; padding: 0 10px; font-size: .7rem; }
  .news-side-grid { min-height: 0; flex: 1; padding: 10px 4px 10px 0; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .news-side .news-card { min-height: 168px; height: auto; flex: 0 0 auto; padding: 12px; overflow: hidden; }
  .news-side .news-card h3 { margin: 10px 0 6px; font-size: .79rem; line-height: 1.35; }
  .news-side .news-summary { display: -webkit-box; font-size: .67rem; line-height: 1.42; -webkit-line-clamp: 3; }
  .news-side .news-footer { padding-top: 8px; }
  .news-side .news-read { display: inline; font-size: .62rem; }
  .news-side .news-tag { padding: 3px 6px; font-size: .56rem; }
  .news-side-empty { padding: 40px 8px; color: var(--muted); text-align: center; font-size: .72rem; }
  .news-side-source { color: #91a6ff; font-size: .66rem; text-decoration: none; text-align: center; }
}

@media (max-width: 1100px) {
  .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .network-control-grid { grid-template-columns: 1fr; }
  .gas-history-layout { grid-template-columns: 1fr; }
  .exchange-sections { grid-template-columns: 1fr; }
  .exchange-workspace { grid-template-columns: 230px minmax(0, 1fr); }
  .exchange-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .shell { width: min(100% - 24px, 720px); padding-top: 24px; }
  .overview-commandbar { align-items: flex-start; flex-direction: column; }
  .overview-actions { width: 100%; }
  .overview-primary-grid, .overview-secondary-grid { grid-template-columns: 1fr; }
  .overview-account-grid, .overview-news-grid { grid-template-columns: 1fr; }
  .network-health-head { align-items: stretch; flex-direction: column; }
  .network-health-actions { justify-content: space-between; }
  .network-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .address-card, .panel-head { align-items: flex-start; }
  .address-card, .panel-head { flex-direction: column; }
  .pending-sync-notice { align-items: flex-start; flex-direction: column; }
  .pending-sync-notice button { width: 100%; }
  .pending-sync-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .pending-sync-actions .button-link { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .address-card button { width: 100%; }
  .address-actions { width: 100%; }
  .balances-layout { grid-template-columns: 1fr; }
  .exchange-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exchange-shell { width: min(100% - 24px, 720px); padding-top: 24px; }
  .exchange-page-topbar { align-items: flex-start; }
  .exchange-page-actions { align-items: flex-end; flex-direction: column; }
  .exchange-workspace { grid-template-columns: 1fr; }
  .account-sidebar { position: static; min-height: 0; }
  .account-sidebar-note { display: none; }
  .exchange-data-head { align-items: stretch; flex-direction: column; }
  .exchange-table-tools input { width: 100%; }
  .transfer-shell { width: min(100% - 24px, 720px); padding-top: 24px; }
  .transfer-page-topbar { align-items: flex-start; }
  .transfer-layout { grid-template-columns: 1fr; }
  .transfer-preview-panel { position: static; }
  .wallet-source-grid { grid-template-columns: 1fr; }
  .wallet-source-actions { width: 100%; }
  .wallet-source-actions button { flex: 1; }
  .token-balances { grid-template-columns: repeat(3, minmax(82px, 1fr)); }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gas-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .overview-dashboard { margin-top: 22px; }
  .overview-commandbar { padding: 16px; }
  .overview-actions { align-items: stretch; flex-direction: column; }
  .overview-actions > * { width: 100%; }
  .overview-kpis { grid-template-columns: 1fr 1fr; }
  .overview-kpis article { min-height: 104px; padding: 14px; }
  .overview-kpis strong { font-size: 1.38rem; }
  .overview-card-head { align-items: flex-start; }
  .overview-list-item { grid-template-columns: auto minmax(0, 1fr); }
  .overview-list-item small { overflow: visible; white-space: normal; }
  .overview-arrow { display: none; }
  .overview-account-card { flex-direction: column; }
  .account-value { text-align: left; }
  .network-health-body { padding: 10px; }
  .network-health-actions { align-items: stretch; flex-direction: column; }
  .network-health-actions .connection { justify-content: center; }
  .network-kpis article { min-height: 98px; padding: 13px; }
  .network-kpis strong { font-size: 1.18rem; }
  .network-readiness-item { grid-template-columns: auto minmax(0, 1fr); padding: 8px 0; }
  .network-readiness-value { grid-column: 2; text-align: left; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats article { min-height: 98px; padding: 15px; }
  .stats strong { font-size: 1.6rem; }
  .controls { width: 100%; flex-direction: column; }
  .controls > * { width: 100%; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-controls { width: 100%; flex-wrap: wrap; }
  .pagination-controls button { flex: 1; }
  .transaction-detail { grid-template-columns: 1fr; gap: 5px; }
  .transaction-detail dd { text-align: left; }
  .balance-head { align-items: flex-start; flex-direction: column; }
  .balance-actions { width: 100%; }
  .balance-actions button { flex: 1; }
  .token-balances { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
  .exchange-summary { grid-template-columns: 1fr; }
  .exchange-page-topbar { flex-direction: column; }
  .exchange-page-actions { width: 100%; align-items: stretch; }
  .exchange-page-actions .connection { justify-content: center; }
  .exchange-kpis { grid-template-columns: 1fr 1fr; }
  .exchange-kpis article { min-height: 102px; padding: 14px; }
  .exchange-kpis strong { font-size: 1.25rem; }
  .exchange-commandbar { align-items: stretch; flex-direction: column; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; }
  .exchange-table-tools { align-items: stretch; flex-direction: column; }
  .transfer-page-topbar { flex-direction: column; }
  .transfer-header-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .transfer-header-actions .connection { justify-content: center; }
  .transfer-mode-switch { grid-template-columns: 1fr; }
  .transfer-section-head { align-items: flex-start; flex-direction: column; }
  .transfer-form-actions { flex-direction: column; }
  .transfer-form-actions button { width: 100%; }
  .transfer-summary div { grid-template-columns: 105px minmax(0, 1fr); }
  .wallet-source-actions { flex-direction: column; }
  .news-grid { grid-template-columns: 1fr; }
  .gas-analytics-body { padding: 12px; }
  .gas-live-grid { grid-template-columns: 1fr 1fr; }
  .gas-live-grid article { padding: 13px; }
  .gas-live-grid strong { font-size: 1.35rem; }
  .gas-recommendation { grid-template-columns: auto 1fr; }
  .gas-change-pill { grid-column: 2; justify-self: start; }
  .gas-subhead { align-items: flex-start; flex-direction: column; }
  .split-fields { grid-template-columns: 1fr; gap: 0; }
  .toggle-grid, .event-grid { grid-template-columns: 1fr; }
  .rule-fields { grid-template-columns: 1fr; }
}
