:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #fff;
  --panel-soft: #fafafa;
  --line: #e5e7eb;
  --ink: #171a21;
  --muted: #69707d;
  --muted-soft: #8a909b;
  --red: #d62828;
  --red-dark: #b91f24;
  --red-pale: #fff1f1;
  --green: #16845d;
  --amber: #a66a12;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; padding: 26px 16px 18px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 9px 35px; }
.brand-mark { display: inline-flex; width: 40px; height: 40px; justify-content: center; align-items: center; background: linear-gradient(145deg, #f04444, #c91f25); color: #fff; border-radius: 12px; font-size: 20px; font-weight: 800; letter-spacing: -2px; box-shadow: 0 7px 17px rgba(214,40,40,.18); }
.brand-mark span { color: #ffdcdc; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.brand-name > span { color: var(--red); }
.brand-name small { display: block; margin-top: 5px; color: var(--muted-soft); font: 9px var(--mono); letter-spacing: 1px; }
.side-label { color: #9a9eaa; font: 10px var(--mono); letter-spacing: 1.3px; padding: 0 12px 10px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 13px; margin: 2px 0; color: #626977; border-radius: 8px; transition: .18s ease; }
.nav-item span { width: 16px; color: #8b909c; font-size: 16px; text-align: center; }
.nav-item:hover { color: var(--ink); background: #f5f6f8; }
.nav-item.active { color: var(--red-dark); background: var(--red-pale); font-weight: 700; }
.nav-item.active span { color: var(--red); }
.sidebar-bottom { margin-top: auto; }
.side-account { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 16px 8px 13px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--red); border-radius: 50%; font-weight: 700; }
.account-copy strong, .account-copy small { display: block; }
.account-copy strong { font-size: 12px; }
.account-copy small { margin-top: 2px; color: var(--muted-soft); font-size: 10px; }
.logout-button { display: flex; width: 100%; justify-content: space-between; background: transparent; border: 0; padding: 10px 11px; border-radius: 7px; color: #737987; text-align: left; font-size: 12px; }
.logout-button:hover { background: #f6f6f7; color: var(--red-dark); }
.build-note { margin: 18px 10px 0; color: #989da7; font: 9px var(--mono); letter-spacing: .7px; }
.build-note span { float: right; color: var(--red); }
.main-content { min-height: 100vh; margin-left: 250px; }
.topbar { position: sticky; top: 0; display: flex; height: 60px; align-items: center; justify-content: space-between; padding: 0 34px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); z-index: 4; }
.breadcrumbs { color: #737987; font-size: 12px; }
.breadcrumbs span { color: #9a9eaa; }
.breadcrumbs b { color: #c1c4ca; margin: 0 8px; font-weight: 400; }
.topbar-right { display: flex; gap: 18px; align-items: center; }
.mode-pill, .source-tag, .history-label, .settings-lock, .live-tag { font: 10px var(--mono); letter-spacing: .3px; }
.mode-pill { display: flex; gap: 7px; align-items: center; color: var(--red-dark); background: var(--red-pale); border: 1px solid #f5d2d2; border-radius: 20px; padding: 7px 11px; }
.mode-pill i, .live-tag i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(214,40,40,.1); }
.top-date { color: #7b818c; font: 11px var(--mono); }
.page-wrap { max-width: 1500px; padding: 34px 36px 32px; margin: 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--red); font: 10px var(--mono); letter-spacing: 1px; }
.hero h1 { margin: 0; color: var(--ink); font-size: clamp(28px, 3vw, 36px); font-weight: 750; letter-spacing: -1.4px; line-height: 1.15; }
.accent { color: var(--red); }
.hero-copy { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.scan-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 11px var(--mono); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(214,40,40,.1); animation: pulse 1.9s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(214,40,40,0); } }
.button { display: inline-flex; min-height: 40px; gap: 12px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; padding: 0 16px; color: #fff; font-size: 12px; font-weight: 700; transition: .18s ease; }
.button span { font-size: 14px; }
.button-primary { color: #fff; background: var(--red); box-shadow: 0 5px 14px rgba(214,40,40,.16); }
.button-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.button-secondary { color: #383d47; background: #fff; border-color: #dfe1e5; }
.button-secondary:hover { color: var(--red-dark); border-color: #e5aaaa; background: #fffafa; }
.button-stop { color: #fff; background: #5c2022; border-color: #5c2022; }
.button-stop:hover { background: #421719; }
.notice-bar { display: flex; align-items: center; gap: 11px; padding: 13px 15px; margin-bottom: 18px; color: #5f6068; background: #fff; border: 1px solid #f0d4d4; border-left: 4px solid var(--red); border-radius: 8px; font-size: 12px; line-height: 1.55; box-shadow: 0 3px 12px rgba(28,31,36,.025); }
.notice-bar strong { color: #272a31; }
.notice-icon { flex: none; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: var(--red); border: 1px solid #e7aaaa; font: 11px var(--mono); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 118px; padding: 17px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 16px rgba(28,31,36,.035); }
.stat-card-accent { border-color: #edc4c4; background: linear-gradient(145deg,#fff,#fff7f7); }
.stat-heading { display: flex; justify-content: space-between; align-items: center; color: #717784; font: 10px var(--mono); letter-spacing: .4px; }
.stat-icon { color: #b7bbc3; font-size: 15px; }
.stat-value { margin-top: 13px; color: var(--ink); font: 600 25px var(--mono); letter-spacing: -1px; }
.stat-caption { margin-top: 5px; color: #858a95; font-size: 11px; }
.stat-unit { color: #858a95; font-size: 13px; }
.status-value { font-family: var(--sans); font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.panel { overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 17px rgba(28,31,36,.035); }
.scanner-panel { margin-bottom: 15px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 21px 16px; }
.panel-head h2 { margin: 0; color: #20232a; font-size: 17px; font-weight: 700; letter-spacing: -.35px; }
.panel-sub { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.panel-head-actions { display: flex; align-items: center; gap: 10px; }
.source-tag { color: #777d88; padding: 7px 9px; background: #f7f7f8; border: 1px solid var(--line); border-radius: 5px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; color: var(--red); background: #fff; border: 1px solid var(--line); border-radius: 7px; font-size: 20px; }
.icon-button:hover { background: var(--red-pale); border-color: #edc4c4; }
.spinning { animation: spin .55s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 730px; }
thead { background: #f8f8f9; }
th { color: #727884; padding: 12px 14px; text-align: left; white-space: nowrap; font: 10px var(--mono); font-weight: 500; letter-spacing: .25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
td { padding: 13px 14px; color: #343943; font-size: 12px; border-bottom: 1px solid #eff0f2; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffafa; }
td:first-child, th:first-child { padding-left: 21px; }
.numeric { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.token-cell { min-width: 185px; }
.token-name { display: block; width: fit-content; max-width: 160px; overflow: hidden; color: #22252c; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.token-name:hover { color: var(--red); }
.token-cell small, .position-token small { display: block; margin-top: 4px; color: #8a909b; font: 10px var(--mono); }
.status-badge { display: inline-flex; padding: 4px 7px; border: 1px solid #e7e8eb; border-radius: 20px; color: #646a75; background: #f7f7f8; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-badge.status-good { color: #176f50; background: #eaf7f1; border-color: #cfe9dc; }
.status-badge.status-warn { color: #a51f27; background: #fff0f0; border-color: #f1d1d1; }
.status-badge.status-neutral { color: #696f79; background: #f4f4f5; border-color: #e7e8eb; }
.status-reason { display: block; max-width: 210px; margin-top: 4px; color: #858b96; font-size: 10px; line-height: 1.35; }
.empty-cell { padding: 22px 18px; color: #898f99; text-align: center; font-size: 12px; }
.panel-foot { display: flex; justify-content: space-between; gap: 15px; padding: 11px 20px; color: #7c828d; background: #fcfcfc; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.5; }
.panel-foot span:last-child { flex: none; font-family: var(--mono); }
.content-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 15px; margin-bottom: 15px; }
.compact-head { align-items: center; padding: 18px 19px 14px; }
.compact-head .eyebrow { margin-bottom: 6px; }
.count-badge { min-width: 29px; padding: 5px 8px; color: var(--red-dark); background: var(--red-pale); border-radius: 6px; text-align: center; font: 11px var(--mono); }
.compact-table { min-width: 410px; }
.compact-table th { font-size: 10px; }
.compact-table td { font-size: 11px; }
.position-token strong { display: block; color: #343943; font-size: 12px; }
.history-label { padding: 5px 8px; color: var(--red-dark); background: var(--red-pale); border-radius: 5px; }
.history-list { padding: 0 18px 9px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid #eff0f2; }
.history-row strong, .history-row small { display: block; }
.history-row strong { color: #343943; font-size: 11px; }
.history-row small { margin-top: 4px; color: #858b96; font-size: 10px; }
.history-pnl { font: 11px var(--mono); white-space: nowrap; }
.history-empty { padding: 24px 0; }
.settings-panel { margin-bottom: 15px; }
.settings-lock { align-self: center; color: #747a85; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 15px; padding: 2px 21px 20px; }
.setting-field > span, .watch-form label > span { display: block; margin-bottom: 6px; color: #626875; font-size: 11px; font-weight: 600; }
.setting-field input, .watch-form input { display: block; width: 100%; height: 39px; padding: 0 11px; color: #272b33; background: #fff; border: 1px solid #dfe1e5; border-radius: 6px; outline: none; font: 12px var(--mono); transition: .18s ease; }
.setting-field input:focus, .watch-form input:focus { border-color: #e47b7b; box-shadow: 0 0 0 3px rgba(214,40,40,.09); }
.settings-submit { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 5px; }
.form-message { color: #777d88; font-size: 11px; line-height: 1.45; }
.lower-grid { grid-template-columns: 1fr 1fr; }
.watch-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 0 19px 19px; }
.watch-form label em { color: #9297a0; font-style: normal; font-weight: 400; }
.watch-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.safeguard-list { list-style: none; margin: 0; padding: 0 19px 12px; }
.safeguard-list li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid #eff0f2; }
.check-mark { flex: none; width: 18px; height: 18px; display: grid; place-items: center; margin-top: 1px; border-radius: 50%; color: var(--red); background: var(--red-pale); font-size: 11px; }
.safeguard-list strong, .safeguard-list small { display: block; }
.safeguard-list strong { color: #343943; font-size: 11px; }
.safeguard-list small { margin-top: 3px; color: #777d88; font-size: 10px; line-height: 1.45; }
.pump-attribution { padding: 0 19px 16px; margin: 0; color: #777d88; font-size: 10px; }
.account-password { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 0 19px 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.password-title { grid-column: 1 / -1; color: #343943; font-size: 12px; font-weight: 700; }
.account-password label > span { display: block; margin-bottom: 5px; color: #626875; font-size: 10px; font-weight: 600; }
.account-password input { width: 100%; height: 37px; padding: 0 10px; color: #272b33; background: #fff; border: 1px solid #dfe1e5; border-radius: 6px; outline: none; font-size: 11px; }
.account-password input:focus { border-color: #e47b7b; box-shadow: 0 0 0 3px rgba(214,40,40,.09); }
.account-password .watch-actions { grid-column: 1 / -1; }
.activity-panel { margin-bottom: 14px; }
.live-tag { display: flex; align-items: center; gap: 8px; color: #777d88; }
.activity-list { padding: 0 19px 9px; }
.activity-row { display: grid; grid-template-columns: 44px 1fr 68px; align-items: center; gap: 11px; min-height: 40px; border-top: 1px solid #eff0f2; }
.activity-kind { width: 40px; padding: 5px 0; border-radius: 4px; text-align: center; color: #666d78; background: #f1f2f4; font: 9px var(--mono); }
.kind-buy { color: #176f50; background: #eaf7f1; }
.kind-sell { color: #a51f27; background: #fff0f0; }
.kind-error { color: #9a5b11; background: #fff6e8; }
.activity-message { color: #4e535d; font-size: 11px; }
.activity-row time { color: #898f99; font: 10px var(--mono); text-align: right; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 8px 1px 0; color: #7e848f; font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 20px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 13px 16px; opacity: 0; transform: translateY(8px); pointer-events: none; color: #fff; background: #292d34; border: 1px solid rgba(0,0,0,.12); border-radius: 8px; box-shadow: 0 12px 35px rgba(0,0,0,.18); font-size: 12px; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a51f27; border-color: #a51f27; color: #fff; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 20%, #ffe7e7 0, transparent 44%), #f5f5f7; }
.login-shell { width: min(100%, 420px); }
.login-card { padding: 38px; background: #fff; border: 1px solid #e7e3e3; border-radius: 16px; box-shadow: 0 20px 60px rgba(40,27,27,.11); }
.login-card .brand-mark { margin-bottom: 25px; }
.login-card .eyebrow { margin-bottom: 8px; }
.login-card h1 { margin: 0; color: var(--ink); font-size: 30px; letter-spacing: -1px; }
.login-card > .muted { margin: 9px 0 24px; color: var(--muted); font-size: 13px; }
.login-form label { display: block; margin: 16px 0 7px; color: #515662; font-size: 12px; font-weight: 600; }
.login-form input { width: 100%; height: 44px; padding: 0 12px; color: #242832; background: #fff; border: 1px solid #dfe1e5; border-radius: 7px; outline: none; }
.login-form input:focus { border-color: #e47b7b; box-shadow: 0 0 0 3px rgba(214,40,40,.09); }
.button-wide { width: 100%; margin-top: 23px; }
.login-foot { display: flex; align-items: center; gap: 8px; margin-top: 20px; color: #777d88; font: 10px var(--mono); }
.login-foot .status-dot { width: 7px; height: 7px; background: var(--red); border-radius: 50%; }
.login-note { margin-top: 15px; color: #858b96; text-align: center; font-size: 10px; }
.form-error { margin: 13px 0; padding: 11px; color: #a51f27; background: #fff0f0; border: 1px solid #f1d1d1; border-radius: 6px; font-size: 12px; }
@media (max-width: 1100px) {
  .sidebar { width: 218px; }
  .main-content { margin-left: 218px; }
  .page-wrap { padding: 28px 24px; }
  .topbar { padding: 0 24px; }
  .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; min-height: 0; padding: 10px 12px; flex-flow: row wrap; align-items: center; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 6px 6px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
  .brand-name { font-size: 14px; }
  .brand-name small, .side-label, .sidebar-bottom { display: none; }
  .nav-item { min-height: 34px; padding: 0 9px; margin: 0; font-size: 11px; }
  .nav-item span { width: 14px; font-size: 14px; }
  .main-content { margin-left: 0; }
  .topbar { height: 50px; padding: 0 16px; }
  .page-wrap { padding: 24px 16px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .notice-bar { align-items: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { min-height: 106px; padding: 13px; }
  .stat-heading { font-size: 9px; }
  .stat-value { font-size: 21px; }
  .content-grid, .lower-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 2px 15px 17px; gap: 12px; }
  .panel-head { padding-left: 15px; padding-right: 15px; }
  .settings-lock, .source-tag { display: none; }
  .panel-foot { padding: 11px 15px; flex-direction: column; }
  .panel-foot span:last-child { white-space: normal; }
  .page-footer { flex-direction: column; }
}
@media (max-width: 480px) {
  .breadcrumbs { font-size: 10px; }
  .topbar-right { gap: 8px; }
  .mode-pill { padding: 6px 8px; font-size: 9px; }
  .top-date { font-size: 9px; }
  .nav-item { flex: 1 0 40%; justify-content: center; }
  .watch-form, .account-password { grid-template-columns: 1fr; }
  .account-password .watch-actions { flex-direction: row; align-items: center; }
  .watch-actions { align-items: flex-start; flex-direction: column; }
  .settings-submit { align-items: flex-start; flex-direction: column; }
  .settings-submit .button { width: 100%; }
  .activity-row { grid-template-columns: 40px 1fr 55px; gap: 8px; }
  .login-card { padding: 29px 23px; }
}

