:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b24;
  --panel-2: #1b2430;
  --line: #293342;
  --text: #eef3f8;
  --muted: #8d9aaa;
  --green: #45d19a;
  --yellow: #f7c75c;
  --red: #ff7e7e;
  --blue: #82b9ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% 0%, #1a2636 0, var(--bg) 42%); color: var(--text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.shell { max-width: 1400px; margin: 0 auto; padding: 42px 28px 72px; }
.hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 18px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 12px; }
.site-nav a:hover, .site-nav a:focus-visible { border-color: var(--line); background: rgba(130,185,255,.08); color: var(--text); }
.site-nav a[aria-current="page"] { border-color: #36587d; background: #1a2b40; color: var(--blue); }
.eyebrow { color: var(--blue); font-size: 11px; letter-spacing: .16em; font-weight: 800; margin: 0 0 7px; }
h1, h2 { margin: 0; letter-spacing: -.03em; }
h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1; }
.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover, .brand-link:focus-visible { color: var(--blue); }
h2 { font-size: 20px; }
.lede { color: var(--muted); max-width: 700px; margin: 14px 0 0; font-size: 15px; }
.status-pill { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; white-space: nowrap; }
.overview-section { margin-bottom: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(28,37,49,.96), rgba(17,23,31,.96)); }
.overview-section .hero { margin-bottom: 16px; }
.overview-section .hero h1 { font-size: clamp(28px, 4vw, 44px); }
.overview-section .lede { margin-top: 9px; font-size: 13px; }
.overview-section .config-note { gap: 6px 16px; padding: 9px 0; margin-bottom: 12px; font-size: 12px; }
.overview-section .metrics { gap: 8px; margin: 12px 0 0; }
.overview-section .metric { min-height: 0; padding: 12px 14px; }
.overview-section .metric strong { margin: 4px 0 1px; font-size: 22px; }
.overview-section .account-strip { margin: 12px 0 0; padding: 12px; }
.overview-section .account-strip-heading { margin-bottom: 9px; }
.overview-section .account-strip-heading h2 { font-size: 16px; }
.overview-section .account-cards { gap: 7px; }
.overview-section .account-card { padding: 9px 10px; }
.overview-section .account-card strong { margin: 2px 0 1px; font-size: 17px; }
.overview-section .account-note { margin-top: 8px; font-size: 11px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 12px currentColor; }
.dot.ok { background: var(--green); } .dot.screened { background: var(--yellow); } .dot.error { background: var(--red); }
.config-note { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); border-block: 1px solid var(--line); padding: 12px 0; margin-bottom: 20px; }
.config-note strong { color: var(--text); font-weight: 600; }
.account-strip { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(28,37,49,.96), rgba(17,23,31,.96)); }
.account-strip.ready { border-color: #2e6c57; }
.account-strip.blocked { border-color: #6a4c28; }
.account-strip-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.account-strip-heading h2 { font-size: 18px; }
.account-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.account-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.account-card span, .account-card small { display: block; color: var(--muted); }
.account-card span { font-size: 11px; }
.account-card strong { display: block; margin: 4px 0 2px; font-size: 20px; overflow-wrap: anywhere; }
.account-card small { font-size: 10px; }
.account-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric, .panel { background: linear-gradient(145deg, rgba(28,37,49,.96), rgba(17,23,31,.96)); border: 1px solid var(--line); border-radius: 14px; }
.metric { padding: 18px; min-height: 118px; }
.metric span, .metric small { display: block; color: var(--muted); }
.label-with-info { position: relative; display: inline-flex !important; align-items: center; gap: 6px; }
.metric strong { display: block; font-size: 28px; margin: 7px 0 2px; letter-spacing: -.04em; }
.panel { margin-top: 20px; overflow: hidden; }
.panel.compact { padding-bottom: 16px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 20px 20px 14px; }
.panel-count { color: var(--blue); font-size: 14px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.panel-actions { display: flex; align-items: center; gap: 18px; }
.filter-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.filter-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.filter-toggle:hover, .filter-toggle:has(input:focus-visible) { color: var(--text); }
.muted, small { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 780px; }
.registry-table { min-width: 0; table-layout: fixed; }
th, td { border-top: 1px solid rgba(41,51,66,.78); text-align: left; padding: 12px 20px; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; white-space: nowrap; }
td { color: #dce5ee; }
.column-header { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.sort-button, .info-button, .ghost-button { border: 1px solid transparent; font: inherit; cursor: pointer; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; background: transparent; color: var(--muted); text-transform: inherit; letter-spacing: inherit; font-size: inherit; font-weight: inherit; }
.sort-button:hover, .sort-button:focus-visible, .sort-button.active { color: var(--text); }
.sort-indicator { color: var(--blue); font-size: 13px; line-height: 1; }
.info-button { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; padding: 0; background: #26364a; color: var(--blue); font-size: 11px; font-weight: 800; text-transform: none; letter-spacing: 0; }
.info-button:hover, .info-button:focus-visible, .info-button[aria-expanded="true"] { background: var(--blue); color: #0d1117; }
.info-tip { position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; width: 230px; padding: 10px 12px; border: 1px solid #41516a; border-radius: 9px; background: #101923; color: var(--text); box-shadow: 0 10px 28px rgba(0,0,0,.35); font-size: 12px; font-weight: 500; letter-spacing: 0; line-height: 1.4; text-transform: none; white-space: normal; }
.clickable-row { cursor: pointer; transition: background .15s ease; }
.clickable-row:hover, .clickable-row:focus-visible { background: rgba(130,185,255,.08); outline: none; }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.back-link { display: inline-block; color: var(--blue); text-decoration: none; font-size: 13px; margin-bottom: 24px; }
.back-link:hover, .back-link:focus-visible { color: var(--text); text-decoration: underline; }
.detail-page-panel { margin-top: 0; }
.wallet { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue); font-size: 12px; }
.name { display: block; color: var(--text); font-family: inherit; font-size: 13px; margin-bottom: 2px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; background: #243142; color: var(--blue); }
.badge.hft { background: #432932; color: var(--red); } .badge.screened { background: #3e3420; color: var(--yellow); }
.badge.mapped { background: #1c4037; color: var(--green); } .badge.unmapped { background: #3e3420; color: var(--yellow); }
.mapping-reason { max-width: 300px; white-space: normal; }
.positive { color: var(--green); } .negative { color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px 16px; color: var(--muted); }
.pagination-controls { display: flex; align-items: center; gap: 10px; }
.page-number { min-width: 92px; text-align: center; font-size: 12px; }
.ghost-button { border-color: var(--line); border-radius: 8px; padding: 7px 11px; background: #182432; color: var(--blue); font-size: 12px; }
.ghost-button:hover:not(:disabled), .ghost-button:focus-visible { border-color: var(--blue); background: #203044; color: var(--text); }
.ghost-button:disabled { cursor: not-allowed; opacity: .4; }
.primary-button { border: 1px solid #5e9fe8; border-radius: 8px; padding: 8px 12px; background: #3976b7; color: white; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.primary-button:hover, .primary-button:focus-visible { background: #4b8bce; }
.copy-account { margin: 0 20px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted); }
.copy-account strong { color: var(--text); }
.copy-account.ready { border-color: #2e6c57; }
.copy-account.blocked { border-color: #6a4c28; }
.copy-table, .copy-orders-table { min-width: 760px; }
.copy-table { min-width: 1650px; }
.copy-table th, .copy-table td { white-space: nowrap; }
.copy-table .copy-position { white-space: normal; }
.copy-action-header, .copy-action-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 92px;
  text-align: right;
  background: var(--panel);
  box-shadow: -8px 0 14px rgba(13,17,23,.28);
}
.copy-action-header { z-index: 3; }
.copy-action-cell .copy-action { min-width: 64px; }
.copy-history-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; margin-top: 14px; border-top: 1px solid var(--line); }
.copy-history-heading h3 { margin: 0; font-size: 16px; }
.activity-summary { list-style: none; cursor: pointer; user-select: none; }
.activity-summary::-webkit-details-marker { display: none; }
.activity-summary::after { content: 'Open to load'; color: var(--blue); font-size: 12px; white-space: nowrap; }
.activity-panel[open] .activity-summary::after { content: 'Collapse'; }
.activity-summary:hover { background: rgba(130,185,255,.04); }
.copy-position { min-width: 250px; white-space: normal; }
.position-count, .position-line { display: block; }
.position-count { color: var(--green); font-weight: 700; }
.position-line { color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.copy-action { white-space: nowrap; }
.copy-action.copying { color: var(--green); border-color: #2e6c57; }
.copy-action:disabled { cursor: default; opacity: .8; }
.copy-error { color: var(--red); }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(5,9,14,.74); }
.modal { width: min(460px, 100%); padding: 24px; border: 1px solid #41516a; border-radius: 14px; background: #121b27; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.modal h2 { margin-bottom: 10px; }
.modal-copy { color: var(--muted); margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.nav-link { display: inline-flex; align-items: center; text-decoration: none; }
.rank-number { display: block; color: var(--text); font-size: 16px; }
.score-value { color: var(--blue); font-size: 16px; }
.score-details { margin-top: 6px; color: var(--muted); font-size: 11px; }
.score-details summary { color: var(--blue); cursor: pointer; list-style-position: inside; }
.score-details summary:hover, .score-details summary:focus-visible { color: var(--text); }
.score-components { display: grid; grid-template-columns: repeat(5, minmax(56px, 1fr)); gap: 6px; margin-top: 7px; }
.score-components span { display: block; color: var(--muted); font-size: 10px; line-height: 1.25; }
.score-components b { display: block; color: var(--text); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.detail-score-components { grid-column: 1 / -1; display: block !important; }
.detail-score-components > span { margin-bottom: 7px; }
.settlement-open { background: #243142; color: var(--muted); }
.settlement-settled { background: #1c4037; color: var(--green); }
.settlement-closed { background: #243142; color: var(--muted); }
.trade-settlement { display: block; margin-top: 5px; }
.trade-settlement small, .settlement-cell small { display: block; color: var(--muted); font-size: 10px; }
.settlement-price { color: var(--green) !important; }
.positions-panel { margin-top: 20px; }
.positions-table { min-width: 560px; }
.positions-table td { vertical-align: top; }
.positions-table .badge { white-space: nowrap; }
.ranking-note { display: flex; align-items: center; gap: 12px; padding: 15px 20px; color: var(--muted); }
.ranking-note strong { color: var(--text); white-space: nowrap; }
.rankings-table { min-width: 1220px; }
.rankings-table td small { display: block; overflow-wrap: normal; }
.detail-panel { scroll-margin-top: 18px; }
.auto-copy-intro { max-width: 760px; }
.auto-copy-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; padding: 0 20px 16px; color: var(--muted); }
.auto-copy-toolbar strong { color: var(--text); }
.auto-copy-note { margin: 0 20px 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted); }
.auto-copy-note strong { color: var(--text); }
.auto-copy-note.error { border-color: #6a4c28; color: var(--yellow); }
.auto-copy-changes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 20px 18px; }
.auto-copy-change { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.auto-copy-change strong { display: block; color: var(--text); font-size: 18px; }
.auto-copy-change span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.auto-copy-change.started strong { color: var(--green); }
.auto-copy-change.stopped strong { color: var(--red); }
.auto-copy-change.in-flight strong { color: var(--yellow); }
.auto-copy-table { min-width: 720px; }
.auto-copy-table td small { display: block; color: var(--muted); font-size: 11px; }
.auto-copy-wallet { display: block; color: var(--text); }
.auto-copy-wallet-address { display: block; color: var(--blue); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.auto-copy-list { display: grid; gap: 8px; padding: 0 20px 18px; }
.auto-copy-list-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.auto-copy-list-item strong { color: var(--text); }
.auto-copy-list-item small { display: block; margin-top: 2px; }
.auto-copy-list-item.started { border-color: #2e6c57; }
.auto-copy-list-item.stopped { border-color: #6a3e45; }
.auto-copy-list-item.in-flight { border-color: #6a4c28; }
.auto-copy-history-table { min-width: 920px; }
.auto-copy-history-table td small { display: block; margin-top: 2px; }
.detail-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 0 20px 18px; }
.detail-summary > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.detail-summary span, .detail-summary strong { display: block; }
.detail-summary span { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.detail-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.detail-caption { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
[hidden] { display: none !important; }
.workers { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 0 20px; }
.worker { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; }
.worker strong { display: block; text-transform: capitalize; } .worker span { color: var(--muted); font-size: 12px; }
.coverage-details { padding: 0 20px 14px; color: var(--muted); }
.coverage-gaps { display: grid; gap: 8px; padding: 0 20px 18px; }
.coverage-gap { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #5a3a3f; border-radius: 9px; background: rgba(67,41,50,.35); }
.coverage-gap strong { color: var(--text); text-transform: capitalize; }
.coverage-gap span, .coverage-gap small { color: var(--muted); font-size: 12px; }
.api-health-note { padding: 0 20px 14px; color: var(--muted); font-size: 12px; }
.worker-safety { display: grid; gap: 3px; margin: 0 20px 12px; padding: 10px 12px; border: 1px solid #6a4c28; border-radius: 9px; background: #2a2319; color: var(--yellow); }
.worker-safety span { color: var(--muted); font-size: 12px; }
.api-health-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 20px 16px; }
.api-health-card { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.api-health-card > span, .api-health-card small { display: block; color: var(--muted); font-size: 11px; }
.api-health-card strong { display: block; margin: 3px 0 2px; color: var(--text); font-size: 17px; }
.api-health-card-note { margin-top: 5px; color: var(--blue) !important; }
.api-health-queue { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin: 0 20px 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.api-health-queue strong { color: var(--text); }
.api-health-queue span, .api-health-queue small { color: var(--muted); }
.api-health-table { min-width: 620px; }
.api-health-table td strong, .api-health-table td small { display: block; }
.api-health-table td small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.api-health-table td strong { color: var(--text); }
.api-health-table td:nth-child(2), .api-health-table td:nth-child(3) { min-width: 190px; }
.registry-table th, .registry-table td { overflow-wrap: anywhere; }
.registry-table td:has(.rank-number) small { display: block; overflow-wrap: normal; }
.registry-table th:nth-child(1) { width: 12%; }
.registry-table th:nth-child(2) { width: 14%; }
.registry-table th:nth-child(3) { width: 6%; }
.registry-table th:nth-child(4) { width: 13%; }
.registry-table th:nth-child(5) { width: 12%; }
.registry-table th:nth-child(6) { width: 8%; }
.registry-table th:nth-child(7) { width: 12%; }
.registry-table th:nth-child(8) { width: 12%; }
.registry-table th:nth-child(9) { width: 11%; }
@media (max-width: 800px) {
  .shell { padding: 28px 14px 60px; }
  .hero, .detail-hero { display: block; }
  .status-pill { display: inline-flex; margin-top: 18px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .account-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .overview-section { padding: 12px; }
  .overview-section .hero { margin-bottom: 10px; }
  .overview-section .config-note { gap: 5px 10px; }
  .workers { grid-template-columns: 1fr; }
  .api-health-summary { grid-template-columns: 1fr; }
  .panel-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .auto-copy-changes { grid-template-columns: 1fr; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .detail-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .modal-actions { flex-wrap: wrap; }
  .registry-table { font-size: 11px; }
  .registry-table th, .registry-table td { padding: 8px 6px; }
  .registry-table .name { font-size: 11px; overflow-wrap: anywhere; }
  .registry-table .wallet { font-size: 10px; overflow-wrap: anywhere; word-break: break-all; }
  .registry-table small { font-size: 10px; }
  .registry-table .badge { padding: 2px 5px; font-size: 9px; white-space: normal; }
  .registry-table .copy-action { padding: 5px 6px; font-size: 10px; }
}
@media (max-width: 520px) {
  .shell { padding-inline: 8px; }
  .registry-table { font-size: 10px; }
  .registry-table th, .registry-table td { padding: 7px 3px; }
  .registry-table .name { font-size: 10px; }
  .registry-table .wallet, .registry-table small { font-size: 9px; }
  .registry-table .copy-action { padding-inline: 4px; }
  .account-cards { grid-template-columns: 1fr 1fr; gap: 6px; }
  .account-strip { padding: 12px 8px; }
  .account-card { padding: 9px 7px; }
  .account-card strong { font-size: 16px; }
  .overview-section { padding: 9px; }
  .overview-section .hero h1 { font-size: 28px; }
  .overview-section .lede { font-size: 12px; }
  .overview-section .metric { padding: 9px 8px; }
}
.auth-logout { cursor: pointer; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(100%, 460px); }
.login-card { padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: rgba(21, 27, 36, .94); box-shadow: 0 24px 80px rgba(0, 0, 0, .28); }
.login-card h1 { margin: 0 0 10px; font-size: clamp(26px, 6vw, 36px); }
.login-card .lede { margin: 0 0 26px; }
.google-signin { min-height: 44px; }
.login-status { min-height: 22px; margin: 18px 0 0; color: var(--muted); }
.login-status.error { color: var(--red); }
