@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/assets/fonts/jetbrains-mono-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/assets/fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: var(--font-sans);
  --ink: #24131f;
  --muted: #765d69;
  --line: rgba(102, 76, 91, 0.14);
  --panel: rgba(255, 255, 255, 0.9);
  --soft: #f8eef3;
  --accent: #209b7a;
  --pink: #b24783;
  --danger: #8a1f45;
}

* { box-sizing: border-box; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 89, 151, 0.18), transparent 34rem),
    radial-gradient(circle at 94% 14%, rgba(32, 155, 122, 0.08), transparent 30rem),
    linear-gradient(145deg, #fff9fb, #f6eaf0);
}

.environment-banner {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 34px;
  padding: 7px 16px;
  background: #ffcf4a;
  color: #24131f;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-align: center;
}

.environment-banner[hidden] { display: none; }
.environment-banner span { font-family: var(--font-mono); font-weight: 700; }
body.is-staging .site-header { top: 34px; }

.trenches-head,
.trenches-bulk-actions,
.token-identity,
.trade-mode-row,
.trade-wallet-control,
.token-data-tabs { display: flex; align-items: center; }

.trenches-head,
.trade-mode-row { justify-content: space-between; gap: 16px; }
.trenches-bulk-actions { gap: 8px; }
.trenches-bulk-actions[hidden] { display: none; }
.trenches-table { min-width: 1230px; }
.trenches-table td { white-space: nowrap; }
.trenches-table .cluster-badges { min-width: 84px; }
.trenches-table .pg-green,
#token-page-pg { color: var(--accent); font-weight: 800; }
#token-page-pg-yellow { color: #b48800; font-weight: 800; }
.trench-token-image,
.token-page-image {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #f9d7e7, #d8f3ea);
  color: var(--ink);
  font-weight: 800;
}
.trench-token-image { width: 36px; height: 36px; }
.trench-token-image img,
.token-page-image img { width: 100%; height: 100%; object-fit: cover; }
.trench-status { font-weight: 700; text-transform: capitalize; }
.trench-status[data-status="active"] { color: var(--accent); }
.trench-status[data-status="dump"] { color: #c46b15; }

.token-page { display: grid; gap: 12px; }
.token-sticky-bar {
  position: fixed;
  z-index: 49;
  left: 50%;
  display: flex;
  align-items: center;
  width: min(calc(100% - 40px), 1200px);
  min-height: 58px;
  gap: 18px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: rgba(255, 252, 253, .96);
  box-shadow: 0 10px 28px rgba(76, 29, 57, .14);
  backdrop-filter: blur(18px) saturate(140%);
  transform: translateX(-50%);
}
.token-sticky-bar[hidden] { display: none; }
.token-sticky-identity { display: flex; align-items: center; min-width: 0; gap: 9px; }
.token-sticky-image { display: inline-grid; place-items: center; overflow: hidden; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 8px; background: linear-gradient(145deg, #f9d7e7, #d8f3ea); font-size: 14px; font-weight: 800; }
.token-sticky-image img { width: 100%; height: 100%; object-fit: cover; }
.token-sticky-name-wrap { min-width: 0; }
.token-sticky-name-wrap > strong { display: block; overflow: hidden; max-width: 190px; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 17px; }
.token-sticky-contract { margin-top: 2px; }
.token-sticky-contract .contract-cell { flex-wrap: nowrap; }
.token-sticky-contract .contract-link { color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 650; text-decoration: none; }
.token-sticky-summary { display: flex; align-items: center; justify-content: flex-end; min-width: 0; flex: 1 1 auto; gap: 18px; font-size: 13px; line-height: 24px; font-weight: 800; white-space: nowrap; }
.token-sticky-summary .pg-green { color: var(--accent); }
.token-sticky-summary .pg-yellow { color: #b48800; }
.token-sticky-summary .cluster-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 7px; font-size: 11px; }
#token-sticky-cluster[data-status="active"] .cluster-badge { background: #dff5ec; color: #14785f; }
#token-sticky-cluster[data-status="dump"] .cluster-badge { background: #fff0c7; color: #946500; }
#token-sticky-cluster[data-status="end"] .cluster-badge { background: #f9dce5; color: #a82d55; }
.token-sticky-trade-submit { min-width: 180px; max-width: 260px; padding: 9px 14px; overflow: hidden; background: var(--accent); text-overflow: ellipsis; white-space: nowrap; }
.token-sticky-bar[data-side="sell"] .token-sticky-trade-submit { background: var(--danger); }
.token-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 0 8px;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}
.token-identity { gap: 10px; min-width: 0; }
.token-identity .section-title { font-size: 17px; line-height: 1.1; }
.token-page-image { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 9px; font-size: 16px; }
.token-page-contract { margin-top: 3px; }
.token-page-contract .contract-cell { flex-wrap: wrap; }
.token-page-contract .contract-link,
.token-data-panel .contract-link { color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 650; text-decoration: none; }
.token-page-contract .contract-link:hover,
.token-data-panel .contract-link:hover { color: var(--pink); text-decoration: underline; text-underline-offset: 2px; }
.token-summary { display: grid; grid-template-columns: repeat(3, minmax(76px, auto)); align-items: center; gap: 14px; margin: 0; }
.token-summary > div { display: flex; align-items: center; min-width: 76px; height: 24px; padding: 0; border: 0; background: transparent; }
.token-summary dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.token-summary dd { display: inline-flex; align-items: center; height: 24px; margin: 0; font-size: 14px; line-height: 24px; font-weight: 800; }
.token-summary .token-pg-values { display: flex; align-items: center; height: 24px; gap: 6px; }
.token-summary .cluster-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 7px; font-size: 11px; }
#token-page-cluster[data-status="active"] .cluster-badge { background: #dff5ec; color: #14785f; }
#token-page-cluster[data-status="dump"] .cluster-badge { background: #fff0c7; color: #946500; }
#token-page-cluster[data-status="end"] .cluster-badge { background: #f9dce5; color: #a82d55; }
.token-pg-alert-button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.token-pg-alert-button:hover { background: var(--soft); color: var(--ink); }
.token-pg-alert-button[data-state="armed"] { color: var(--accent); }
.token-pg-alert-button[data-state="error"] { color: var(--danger); }
.token-pg-alert-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.token-pg-alert-button span { font-size: 8px; font-weight: 750; }
.token-pg-alert-popover { position: absolute; z-index: 35; top: 50px; right: 78px; display: grid; width: 250px; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(36, 19, 31, .16); }
.token-pg-alert-popover[hidden] { display: none; }
.token-pg-alert-head,
.token-pg-alert-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.token-pg-alert-head strong { font-size: 12px; }
.token-pg-alert-head button { padding: 1px 6px; background: transparent; color: var(--muted); font-size: 18px; }
.token-pg-alert-popover input,
.token-pg-alert-popover select { width: 100%; padding: 8px 10px; font-size: 11px; }
.token-pg-alert-actions button { flex: 1; padding: 7px 9px; font-size: 10px; }
.token-pg-alert-popover .status { min-height: 0; margin: 0; font-size: 10px; }
.token-chart-card > #token-page-status:empty { display: none; }
.token-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 252px); gap: 16px; align-items: stretch; }
.token-chart-card { min-width: 0; position: relative; }
.segmented-control,
.trade-side-tabs,
.trade-mode-tabs,
.token-data-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }
.segmented-control button,
.trade-side-tabs button,
.trade-mode-tabs button,
.token-data-tabs button { padding: 7px 10px; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; }
.segmented-control button[aria-selected="true"] { background: var(--ink); color: #fff; }
.trade-side-tabs button[data-trade-side="buy"][aria-selected="true"] { background: var(--accent); color: #fff; }
.trade-side-tabs button[data-trade-side="sell"][aria-selected="true"] { background: var(--danger); color: #fff; }
.trade-mode-tabs button[aria-selected="true"],
.token-data-tabs button[aria-selected="true"] { background: #8f858b; color: #fff; }
.token-price-chart { width: 100%; height: 430px; margin-top: 12px; position: relative; }
.token-chart-migration-line { position: absolute; z-index: 5; top: 0; bottom: 28px; width: 1px; background: #3578d4; pointer-events: none; transform: translateX(-.5px); }
.token-chart-migration-line[hidden] { display: none; }
.token-chart-trade-markers { position: absolute; z-index: 6; inset: 0 0 28px; overflow: hidden; pointer-events: none; }
.token-chart-trade-marker { position: absolute; display: grid; width: 16px; height: 16px; place-items: center; border: 1px solid #db5d91; border-radius: 50%; background: #fff4f8; color: #d52f76; font-size: 9px; font-weight: 800; line-height: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.token-trade-module { display: grid; align-content: start; gap: 12px; min-height: 100%; position: sticky; top: 88px; }
.trade-side-tabs { width: 100%; }
.trade-side-tabs button { flex: 1; font-size: 14px; }
.trade-mode-row { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 8px; }
.trade-mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.trade-mode-tabs button { min-width: 0; padding-inline: 5px; white-space: nowrap; }
.trade-wallet-control { display: block; width: 100%; color: var(--muted); font-size: 11px; }
.trade-wallet-control select { width: 100%; max-width: none; padding: 6px 8px; font-size: 12px; }
.trade-input { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid #dacbd3; border-radius: 13px; background: #fff; }
.trade-input[hidden] { display: none; }
.trade-input span { color: var(--muted); font-size: 12px; }
.trade-input input { min-width: 0; padding: 0; border: 0; border-radius: 0; text-align: right; font-size: 16px; outline: 0; }
.trade-input em { color: var(--muted); font-style: normal; font-size: 12px; }
.trade-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.trade-quick button { padding: 8px 5px; background: var(--soft); color: var(--ink); font-size: 12px; }
.trade-quick input { min-width: 0; width: 100%; padding: 7px 4px; text-align: center; font-size: 11px; }
.trade-quick-control { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; }
.trade-quick-edit { width: 30px; min-height: 30px; padding: 0; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 15px; }
.trade-quick-edit:hover { background: var(--soft); color: var(--ink); }
.token-trade-submit { width: 100%; background: var(--accent); }
.token-trade-module[data-side="sell"] .token-trade-submit { background: var(--danger); }
.token-trade-settings summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.token-trade-settings > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.token-trade-settings label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.token-trade-settings input { width: 100%; padding: 7px; font-size: 11px; }
.token-trade-settings .trade-checkbox { grid-column: 1 / -1; display: flex; align-items: center; }
.token-trade-settings .trade-checkbox input { width: auto; }
.token-trade-toast { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 9px 10px; border: 1px solid rgba(30, 158, 121, .28); border-radius: 11px; background: rgba(30, 158, 121, .1); color: var(--ink); font-size: 12px; box-shadow: 0 8px 24px rgba(44, 19, 32, .1); }
.token-trade-toast[hidden] { display: none; }
.token-trade-toast[data-error="true"] { border-color: rgba(183, 45, 78, .3); background: rgba(183, 45, 78, .1); color: var(--danger); }
.token-trade-toast button { flex: 0 0 auto; width: 24px; min-height: 24px; padding: 0; border: 0; background: transparent; color: currentColor; font-size: 18px; line-height: 1; }
.token-data-panel { min-width: 0; }
.order-error-message { display: block; max-width: 280px; margin-top: 3px; color: var(--danger); font-size: 10px; font-weight: 650; line-height: 1.3; white-space: normal; }
.token-data-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.token-data-tabs { margin-bottom: 0; }
.token-data-panel table { min-width: 780px; }
.token-holders-toolbar { display: grid; justify-items: end; gap: 4px; min-height: 18px; }
.token-holders-toolbar[hidden] { display: none; }
.token-holders-summary { color: var(--muted); font-size: 11px; line-height: 14px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.token-data-panel > [data-token-tab-panel="holders"] > .status:empty { display: none; }
.token-holders-table { min-width: 1080px !important; }
.token-holders-table-shell:has(.holder-filter[open]) { min-height: 285px; }
.token-holders-table th,
.token-holders-table td { vertical-align: middle; white-space: nowrap; }
.token-holders-table th:first-child,
.token-holders-table td:first-child { width: 42px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.token-holders-table th:nth-child(6),
.token-holders-table th:nth-child(7),
.token-holders-table td:nth-child(6),
.token-holders-table td:nth-child(7) { text-align: right; font-variant-numeric: tabular-nums; }
.holder-filter { position: relative; min-width: 104px; }
.holder-filter summary { min-width: 104px; padding: 7px 28px 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; list-style: none; font-size: 11px; font-weight: 650; text-transform: none; letter-spacing: 0; }
.holder-filter summary::-webkit-details-marker { display: none; }
.holder-filter summary::after { content: "▾"; position: absolute; right: 10px; color: var(--muted); }
.holder-filter[open] summary { border-color: var(--accent); }
.holder-filter > div { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; display: grid; min-width: 150px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(36, 19, 31, .14); }
.holder-filter label { display: flex; align-items: center; gap: 8px; padding: 7px; color: var(--ink); font-size: 11px; font-weight: 550; text-transform: none; letter-spacing: 0; cursor: pointer; }
.holder-filter input { width: auto; }
.holder-bulk-controls { display: flex; align-items: center; gap: 5px; }
.holder-bulk-controls[hidden] { display: none; }
.holder-bulk-controls select,
.holder-classification-select,
.holder-status-select { min-width: 76px; padding: 6px 24px 6px 8px; font-size: 11px; }
.holder-bulk-controls button { min-width: 34px; padding: 7px; border-radius: 8px; font-size: 10px; }
.holder-comment-input { width: 180px; min-width: 120px; padding: 7px 0; border: 0; border-radius: 0; background: transparent; font-size: 11px; }
.holder-comment-input:focus { border-color: transparent; outline: 0; background: transparent; }
.copy-button,
.order-icon-button { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); line-height: 1; }
.gmgn-icon-link { display: inline-grid; place-items: center; width: 22px; height: 22px; overflow: hidden; border-radius: 7px; background: transparent; color: var(--ink); text-decoration: none; transform: translateY(-2px); }
.gmgn-icon-link img { width: 22px; height: 22px; border-radius: 5px; }
.gmgn-icon-link:hover { background: var(--soft); color: var(--ink); }

@media (max-width: 1120px) {
  .token-workspace { grid-template-columns: 1fr; }
  .token-trade-module { position: static; }
  .token-hero { flex-wrap: wrap; }
  .token-summary { flex: 1 1 auto; justify-content: end; }
}

@media (max-width: 900px) {
  .token-sticky-contract { display: none; }
  .token-sticky-name-wrap > strong { max-width: 120px; }
  .token-sticky-summary { gap: 10px; }
  .token-sticky-trade-submit { min-width: 110px; }
}

@media (max-width: 720px) {
  .token-sticky-bar { width: calc(100% - 20px); min-height: 52px; gap: 9px; padding: 7px 9px; }
  .token-sticky-image { width: 32px; height: 32px; }
  .token-sticky-name-wrap > strong { max-width: 80px; font-size: 12px; }
  .token-sticky-summary { gap: 7px; font-size: 11px; }
  .token-sticky-summary .pg-yellow { display: none; }
  .token-sticky-trade-submit { min-width: 72px; max-width: 105px; padding-inline: 8px; }
  .token-summary { grid-template-columns: repeat(2, minmax(76px, 1fr)); width: 100%; justify-content: stretch; }
  .token-price-chart { height: 330px; }
}

button,
.button-link,
.file-button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover,
.file-button:hover { background: #3d2034; }
button:disabled { cursor: wait; opacity: 0.55; }
.secondary-button { background: #ded3d9; color: var(--ink); }
.danger-button { background: var(--danger); }

input,
select {
  border: 1px solid #dacbd3;
  border-radius: 12px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus { outline: 3px solid rgba(32, 155, 122, 0.16); border-color: var(--accent); }

.dialog-field[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 249, 251, 0.88);
  backdrop-filter: blur(18px) saturate(140%);
}

.site-header-inner {
  width: 100%;
  max-width: 1240px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.wordmark {
  color: #171015;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.12em;
  line-height: 1;
  text-decoration: none;
}

.wordmark strong {
  color: #ff2f8a;
  font: inherit;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.primary-nav a {
  position: relative;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.primary-nav a:hover { background: rgba(255, 47, 138, 0.07); color: var(--ink); }
.primary-nav a[aria-current="page"] { background: var(--ink); color: #fff; }

.header-metrics {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.header-usage-metric {
  position: relative;
  min-width: 66px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: #171015;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.header-usage-metric[hidden] { display: none; }

.header-review-metric {
  min-width: 0;
  padding: 0 7px;
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
  cursor: help;
}

.header-new-token-metric {
  min-width: 0;
  padding: 0 7px;
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
  cursor: help;
}

.header-review-icon,
.header-new-token-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.header-usage-metric::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  width: max-content;
  max-width: min(340px, calc(100vw - 24px));
  padding: 9px 11px;
  border-radius: 9px;
  background: #171015;
  color: #fff;
  box-shadow: 0 10px 30px rgba(23, 16, 21, 0.22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.header-usage-metric:not([data-tooltip=""]):hover::after,
.header-usage-metric:not([data-tooltip=""]):focus::after,
.header-usage-metric:not([data-tooltip=""]).is-tooltip-open::after {
  opacity: 1;
  transform: translateY(0);
}

.header-usage-metric svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.logout-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
}

.logout-button:hover { background: var(--ink); color: #fff; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 470px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(76, 29, 57, 0.14);
}

.auth-wordmark {
  color: #171015;
  font-family: var(--font-mono);
  font-size: clamp(34px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: -0.12em;
  line-height: 1;
  text-align: center;
}
.auth-wordmark strong { color: #ff2f8a; font: inherit; }
.auth-card form { display: grid; gap: 18px; margin-top: 32px; }
.auth-card form > input { width: 100%; min-height: 48px; }

.page-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  min-width: 0;
}

.dashboard-page {
  display: grid;
  gap: 20px;
  min-width: 0;
  animation: page-in 220ms ease-out both;
}

.dashboard-page[hidden] { display: none !important; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(79, 40, 60, 0.07);
  min-width: 0;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(42px, 6vw, 72px); line-height: 1; }
h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 0; font-size: 24px; }
h3 { margin-bottom: 12px; }
.section-title { font-size: 26px; line-height: 1.15; }
.hero-copy { margin: 18px 0 0; color: var(--muted); }
.hero-copy strong { color: var(--accent); }

.hero-actions { display: flex; align-items: end; gap: 16px; }
.hero-stat { min-width: 190px; text-align: right; }
.hero-stat span { display: block; color: var(--muted); font-size: 13px; }
.hero-stat strong { color: var(--accent); font-size: 48px; line-height: 1; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.status[data-error="true"] { color: #b72d4e; }
.result-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.panel-head-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}
.filter-reset-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}
.filter-reset-button[hidden] { display: none; }
.filter-reset-button:hover { background: transparent; color: var(--ink); }
.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.trade-panel { padding: 24px; }
.trade-panel-head { align-items: flex-end; margin-bottom: 6px; }
.trade-panel-head .hint { max-width: 760px; }
.trade-status { margin: 0 0 8px; }
.wallet-manager { width: 100%; min-width: 0; max-width: 100%; margin: 12px 0 22px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(248, 238, 243, 0.38); }
.wallet-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.wallet-manager-head h2 { margin: 0; font-size: 17px; }
.wallet-manager-actions { display: flex; align-items: center; gap: 8px; }
.wallet-manager-actions label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.trade-wallet-table th, .trade-wallet-table td { white-space: nowrap; }
.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}
.table-sort-button:hover { background: transparent; color: var(--accent); }
.table-sort-button span { min-width: 10px; color: var(--accent); }
.trade-wallet-table tr.is-active-wallet td { background: rgba(24, 172, 126, 0.07); }
.trade-wallet-operations { display: flex; align-items: center; gap: 5px; }
.trade-wallet-operations button { width: 30px; min-height: 30px; padding: 0; border-radius: 8px; background: #fff; color: var(--muted); border: 1px solid var(--line); }
.trade-wallet-operations button:hover { color: var(--ink); border-color: var(--ink); }
.wallet-placeholder {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.wallet-placeholder-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8b9c1;
  box-shadow: 0 0 0 4px rgba(118, 93, 105, 0.08);
}
.trade-table-shell {
  width: calc(100% + 48px);
  max-width: calc(100% + 48px);
  min-width: 0;
  margin: 0 -24px -24px;
  padding: 0 24px 18px;
  scrollbar-color: #ccb9c4 transparent;
}
.portfolio-table {
  min-width: 1810px;
  font-variant-numeric: tabular-nums;
}
.portfolio-table th,
.portfolio-table td { white-space: nowrap; }
.portfolio-table th { padding-top: 14px; padding-bottom: 14px; font-size: 12px; }
.portfolio-table .pg-green { color: #128366; font-weight: 850; }
.portfolio-position-heading { display: inline-flex; align-items: center; gap: 7px; }
.switch-control.portfolio-closed-switch span { width: 30px; height: 18px; }
.switch-control.portfolio-closed-switch span::after { width: 12px; height: 12px; }
.switch-control.portfolio-closed-switch input:checked + span::after { transform: translateX(12px); }
.portfolio-main-row { cursor: pointer; }
.portfolio-main-row td { height: 74px; transition: background 140ms ease; }
.portfolio-main-row:hover td,
.portfolio-main-row.is-expanded td { background: rgba(255, 79, 216, 0.035); }
.portfolio-main-row.is-order-only td { background: rgba(32, 155, 122, 0.025); }
.portfolio-date-wrap { display: flex; align-items: center; gap: 7px; }
.portfolio-expand {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  transition: transform 150ms ease, background 150ms ease;
}
.portfolio-expand:hover { background: var(--soft); color: var(--ink); }
.portfolio-main-row.is-expanded .portfolio-expand { transform: rotate(90deg); }
.portfolio-date { color: var(--muted); font-size: 12px; line-height: 1.35; }
.portfolio-token-image {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 7px 18px rgba(36, 19, 31, 0.13);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  object-fit: cover;
}
.portfolio-token-image[data-tone="gold"] { background: linear-gradient(145deg, #d7a53b, #5f3e17); }
.portfolio-token-image[data-tone="pink"] { background: linear-gradient(145deg, #ff66a7, #8e245b); }
.portfolio-token-image[data-tone="green"] { background: linear-gradient(145deg, #54c9a7, #155f4d); }
.portfolio-name { display: flex; align-items: center; gap: 6px; }
.portfolio-name strong { font-size: 14px; }
.portfolio-order-only-badge {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(32, 155, 122, 0.1);
  color: #128366;
  font-size: 9px;
  font-weight: 850;
}
.portfolio-copy {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
}
.portfolio-copy:hover { border-color: var(--line); background: #fff; color: var(--ink); }
.cluster-badges { display: flex; align-items: center; gap: 4px; }
.cluster-badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f4e8ee;
  color: #793450;
  font-size: 11px;
  font-weight: 850;
}
a.cluster-badge { text-decoration: none; }
a.cluster-badge:hover { filter: brightness(.95); }
.metric-stack { display: grid; gap: 3px; line-height: 1.2; }
.metric-stack strong { font-size: 13px; }
.metric-stack span { color: var(--muted); font-size: 12px; }
.metric-positive strong,
.metric-positive span { color: #128366; }
.metric-negative strong,
.metric-negative span { color: #c43f5e; }
.metric-neutral strong { color: var(--muted); }
.metric-hodl { color: #128366; font-size: 12px; font-weight: 850; }
.position-meter { display: grid; gap: 6px; min-width: 82px; }
.position-meter > span { color: var(--muted); font-size: 12px; }
.position-track { width: 70px; height: 4px; overflow: hidden; border-radius: 999px; background: #e6dce1; }
.position-track span { height: 100%; display: block; border-radius: inherit; background: var(--accent); }
.pg-value { color: #128366; font-size: 13px; font-weight: 900; }
.tx-counts { font-weight: 850; }
.tx-counts .buy-count { color: #128366; }
.tx-counts .sell-count { color: #c43f5e; }
.portfolio-sell {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  background: #b72d4e;
  font-size: 12px;
  font-weight: 850;
}
.portfolio-sell:hover { background: #911f3c; }
.portfolio-orders-row:hover { background: transparent; }
.portfolio-orders-row td { padding: 0 10px 14px 42px; background: rgba(248, 238, 243, 0.62); }
.orders-card {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}
.orders-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.orders-card-head strong { font-size: 13px; }
.order-count { color: var(--muted); font-size: 11px; }
.orders-table { min-width: 760px; }
.orders-table th,
.orders-table td { height: auto; padding: 9px 10px; background: transparent; font-size: 12px; }
.order-type { display: inline-flex; min-width: 44px; justify-content: center; padding: 4px 7px; border-radius: 8px; font-weight: 900; }
.order-type[data-type="Buy"] { background: rgba(32, 155, 122, 0.1); color: #128366; }
.order-type[data-type="Sell"] { background: rgba(196, 63, 94, 0.1); color: #b72d4e; }
.order-actions { display: flex; justify-content: flex-end; gap: 6px; }
.order-icon-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
}
.order-icon-button:hover { background: var(--soft); color: var(--ink); }
.order-icon-button[data-order-action="cancel"]:hover { color: var(--danger); }
.orders-empty { margin: 0; padding: 9px 0 3px; color: var(--muted); font-size: 12px; }

.period-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}
.period-tabs button {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.period-tabs button:hover { background: rgba(255, 255, 255, 0.75); color: var(--ink); }
.period-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: 0 4px 12px rgba(36, 19, 31, 0.16); }
.pnl-table { min-width: 1040px; font-variant-numeric: tabular-nums; }
.pnl-table th,
.pnl-table td { min-width: 82px; text-align: center; white-space: nowrap; }
.pnl-table th:first-child,
.pnl-table td:first-child { min-width: 150px; position: sticky; left: 0; z-index: 2; text-align: left; background: rgba(255, 252, 253, 0.98); }
.pnl-table thead th:first-child { z-index: 4; }
.pnl-table thead tr:first-child th { border-bottom: 0; padding-bottom: 6px; color: var(--ink); text-align: center; }
.pnl-table thead tr:first-child th:first-child { text-align: left; }
.pnl-table tbody tr[data-current="true"] td { background-color: rgba(32, 155, 122, 0.045); }
.pnl-table tbody tr[data-current="true"] td:first-child { background-color: #f6fbf9; }
.pnl-table tbody tr[data-weekend="true"] td,
.pnl-table tbody tr[data-weekend="true"] td:first-child { background-color: #f1f1f1; }
.pnl-period-label { display: grid; gap: 2px; }
.pnl-period-label strong { font-size: 12px; }
.pnl-period-label span { color: var(--accent); font-size: 10px; font-weight: 850; }
.pnl-zero { color: #b9aab2; }
.pnl-table td.metric-positive { color: #128366; }
.pnl-table td.metric-negative { color: #c43f5e; }
.pnl-total-column { background: rgba(248, 238, 243, 0.72); font-weight: 850; }
.pnl-table tbody tr[data-current="true"] .pnl-total-column { background: rgba(32, 155, 122, 0.08); }
.pnl-group-total { background: rgba(248, 238, 243, 0.72); }
.order-dialog { width: min(calc(100% - 32px), 650px); }
.dialog-kicker { margin: 0 0 3px; color: var(--pink); font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.order-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.order-form-grid .dialog-field:first-child { grid-column: 1 / -1; }
.order-form-grid input,
.order-form-grid select { width: 100%; }

.clusters-table { min-width: 920px; }
.cluster-link { color: var(--ink); font-weight: 800; text-decoration-color: rgba(255, 47, 138, 0.35); }
.cluster-link:hover { color: var(--pink); }
.cluster-refresh-input { width: 86px; }
.cluster-sync-meta { max-width: 220px; color: var(--muted); font-size: 12px; }
.cluster-sync-meta[data-error="true"] { color: #b72d4e; }
.migration-yes { color: var(--accent); font-weight: 800; }
.migrate-control { display: flex; align-items: center; gap: 9px; }
.help-tip {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: help;
}
.help-tip:hover, .help-tip:focus-visible {
  border-color: var(--pink);
  color: var(--pink);
  outline: none;
}
.help-tooltip-popup {
  position: fixed;
  z-index: 1000;
  width: min(390px, calc(100vw - 20px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #2b1523;
  color: #fff;
  box-shadow: 0 14px 36px rgba(45, 20, 34, 0.28);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  pointer-events: none;
}
.help-tooltip-popup[hidden] { display: none; }
.switch-control { display: inline-flex; align-items: center; cursor: pointer; }
.switch-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.switch-control span {
  width: 44px;
  height: 25px;
  position: relative;
  display: block;
  border: 1px solid #cdbfc7;
  border-radius: 999px;
  background: #d8cfd4;
  transition: background 150ms ease, border-color 150ms ease;
}
.switch-control span::after {
  content: "";
  width: 19px;
  height: 19px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(36, 19, 31, 0.24);
  transition: transform 150ms ease;
}
.switch-control input:checked + span { border-color: var(--accent); background: var(--accent); }
.switch-control input:checked + span::after { transform: translateX(19px); }
.switch-control input:focus-visible + span { outline: 3px solid rgba(32, 155, 122, 0.2); }
.switch-control input:disabled + span { opacity: 0.55; cursor: wait; }
.cluster-detail-panel { padding: 24px; }
.cluster-detail-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.cluster-back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 13px; font-weight: 750; text-decoration: none; }
.cluster-back-link:hover { color: var(--pink); }
.cluster-control { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; font-size: 13px; font-weight: 800; }
.cluster-control[hidden] { display: none !important; }
.cluster-tools { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.cluster-tools h2 { margin: 0 0 13px; color: var(--ink); font-size: 15px; }
.cluster-tools-controls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; column-gap: 24px; row-gap: 18px; }
.cluster-tools .cluster-control { width: fit-content; max-width: 100%; min-height: 38px; justify-self: start; justify-content: flex-start; gap: 12px; }
.cluster-tools .cluster-control[data-tooltip] { position: relative; }
.cluster-tools .cluster-control[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 100;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 9px 11px;
  border-radius: 9px;
  background: #171015;
  color: #fff;
  box-shadow: 0 10px 30px rgba(23, 16, 21, .22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.cluster-tools .cluster-control[data-tooltip]:hover::after,
.cluster-tools .cluster-control[data-tooltip]:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}
.cluster-tools .cluster-control.cluster-tooltip-right::after { right: 0; left: auto; }
.cluster-tool-button { min-width: 112px; min-height: 38px; justify-self: start; padding: 8px 14px; border-color: var(--accent); background: var(--accent); color: #fff; }
.cluster-tool-button:hover { border-color: #128366; background: #128366; color: #fff; }
.cluster-classifier-tools, .cluster-classifier-options { display: contents; }
.cluster-classifier-options[hidden] { display: none !important; }
.cluster-classifier-options select { min-width: 120px; }
.cluster-token-table-shell { margin-top: 12px; }
.cluster-token-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.cluster-token-bulk-actions { display: flex; align-items: center; gap: 12px; }
.cluster-token-status-action[data-status="active"] { background: var(--accent); color: #fff; }
.cluster-token-status-action[data-status="end"] { background: var(--danger); color: #fff; }
.cluster-detail-panel #cluster-detail-status { margin: 8px 0 4px; }
.cluster-detail-panel #cluster-detail-status + .cluster-token-table-shell { margin-top: 0; }
.cluster-token-filter-tabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.cluster-token-filter-tabs button { min-height: 34px; padding: 7px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.cluster-token-filter-tabs button:hover { background: rgba(255, 255, 255, 0.72); color: var(--ink); }
.cluster-token-filter-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: 0 2px 8px rgba(36, 19, 31, 0.14); }
.cluster-token-table { min-width: 1650px; font-size: 12px; font-variant-numeric: tabular-nums; }
.cluster-token-table th, .cluster-token-table td { white-space: nowrap; }
.cluster-token-table .pg-green { color: #128366; font-weight: 850; }
.market-cap-m { color: #128366; font-weight: 900; }
.cluster-token-date { max-width: 142px; white-space: normal !important; color: var(--muted); }
.cluster-token-image { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--soft); color: var(--pink); object-fit: cover; font-weight: 850; }
.cluster-token-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.contract-cell { display: flex; align-items: center; gap: 5px; }
.contract-copy { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); line-height: 1; }
.contract-copy:hover { background: var(--soft); color: var(--ink); }
.token-pg-chart-button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); }
.token-pg-chart-button:hover { background: var(--soft); color: var(--ink); }
.token-pg-chart-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.token-median-pg-used { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(32, 155, 122, .12); color: #128366; font-size: 13px; font-weight: 950; }
.token-median-pg-used[hidden] { display: none; }
.token-median-pg-used.is-skipped { background: rgba(196, 49, 72, .12); color: #c43148; }
.key-dialog.pg-chart-dialog { box-sizing: border-box; width: min(calc(100% - 32px), 1120px); max-width: 1120px; max-height: calc(100vh - 36px); padding: 24px; overflow: auto; }
.key-dialog.pg-chart-dialog .dialog-head { align-items: flex-start; }
.key-dialog.pg-chart-dialog .dialog-head > div { min-width: 0; padding-top: 2px; }
.key-dialog.pg-chart-dialog .dialog-kicker { margin-bottom: 6px; }
.key-dialog.pg-chart-dialog .dialog-close { flex: 0 0 auto; }
.key-dialog.pg-chart-dialog .status { margin: 8px 0 12px; }
.key-dialog.pg-chart-dialog .dialog-actions { margin-top: 18px; }
.pg-dialog-head-actions { display: flex; align-items: center; gap: 10px; }
.pg-dialog-head-actions #toggle-token-median-pg { min-width: 82px; }
.pg-chart-section { margin-top: 16px; }
.pg-chart-section h3 { margin: 0 0 8px; font-size: 15px; }
.pg-chart-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.pg-chart-section-head h3 { margin: 0; }
.pg-chart-accuracy-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; user-select: none; }
.pg-chart-accuracy-toggle input { width: 16px; height: 16px; margin: 0; accent-color: #128366; }
.pg-chart { min-height: 280px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.pg-chart svg { display: block; width: 100%; min-width: 760px; height: auto; }
.pg-chart-empty { min-height: 280px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.pg-chart-grid { stroke: rgba(118, 93, 105, .13); stroke-width: 1; }
.pg-chart-axis-label { fill: var(--muted); font-size: 10px; font-weight: 700; }
.pg-chart-axis-title { fill: var(--muted); font-size: 10px; font-weight: 850; }
.pg-chart-axis-title.pg-chart-mc-title, .pg-chart-axis-label.pg-chart-mc-title { fill: #b24783; }
.pg-chart-axis-title.pg-chart-pg-title { fill: #128366; }
.pg-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pg-chart-mc-line { stroke: #b24783; }
.pg-chart-pg-line { stroke: #128366; }
.pg-chart-point { fill: #128366; stroke: #fff; stroke-width: 1.5; cursor: help; }
.pg-chart-point.is-ath { fill: #b24783; }
.pg-chart-point.is-dump { fill: #d17c00; }
.pg-chart-point-label { fill: #24453c; font-size: 9px; font-weight: 850; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.pg-chart-hover-tooltip { position: fixed; z-index: 10000; max-width: 250px; padding: 9px 11px; border: 1px solid rgba(118, 93, 105, .2); border-radius: 10px; background: rgba(36, 19, 31, .94); color: #fff; box-shadow: 0 8px 28px rgba(36, 19, 31, .24); font-size: 12px; font-weight: 650; line-height: 1.45; white-space: pre-line; pointer-events: none; }
.pg-chart-hover-tooltip[hidden] { display: none; }

@media (max-width: 700px) {
  .key-dialog.pg-chart-dialog { width: calc(100% - 16px); max-height: calc(100vh - 16px); padding: 16px; border-radius: 16px; }
  .key-dialog.pg-chart-dialog .dialog-head h2 { font-size: 24px; line-height: 1.1; }
  .pg-chart-section h3 { font-size: 14px; line-height: 1.25; }
  .pg-chart-section-head { align-items: flex-start; }
}
.cluster-token-table [data-field="status"] { font-weight: 850; }
.cluster-token-table [data-field="status"][data-status="active"] { color: var(--accent); }
.cluster-token-table [data-field="status"][data-status="dump"] { color: #d17c00; }
.cluster-token-table [data-field="status"][data-status="end"] { color: var(--danger); }
.token-detector-select { width: 108px; min-height: 34px; padding: 6px 28px 6px 9px; border-radius: 9px; font-size: 12px; font-weight: 750; }
.token-detector-select[data-detector-status="normal"] { color: #126e57; background-color: #e8f5f0; }
.token-detector-select[data-detector-status="warning"] { color: #8a6500; background-color: #fff4cf; }
.token-detector-select[data-detector-status="scam"] { color: #8c2945; background-color: #f7e2e9; }
.cluster-pnl-input { width: 82px; padding: 7px 8px; border-radius: 9px; text-align: right; }
.empty-table-cell { padding: 34px 18px !important; color: var(--muted); text-align: center; }

@media (max-width: 700px) {
  .cluster-detail-head { align-items: flex-start; flex-direction: column; }
  .cluster-tools-controls { grid-template-columns: minmax(0, 1fr); }
  .cluster-token-actions { align-items: flex-start; flex-direction: column; }
  .cluster-token-filter-tabs { max-width: 100%; overflow-x: auto; }
}

.settings-form { display: grid; gap: 16px; }
.settings-page-grid { grid-template-columns: minmax(0, 1fr); }
.settings-panel-wide { grid-column: 1 / -1; }
.label-color-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.label-color-list { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.label-color-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.label-color-row:first-child { border-top: 0; }
.label-count { justify-self: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.label-color-row input[type="color"] { width: 74px; height: 34px; min-height: 34px; justify-self: end; padding: 2px; cursor: pointer; }
.settings-action-grid { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.settings-action-grid label,
.local-settings-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.local-api-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.local-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.local-settings-grid input { width: 100%; }
.settings-submit-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 14px; }

.secret-output {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(32, 155, 122, 0.3);
  border-radius: 14px;
  background: rgba(32, 155, 122, 0.07);
}
.secret-output[hidden] { display: none; }
.secret-output code { overflow: auto; align-self: center; color: #146d56; font-size: 12px; }
.key-list { display: grid; gap: 8px; }
.key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.key-meta { color: var(--muted); font-size: 12px; }

.key-dialog {
  width: min(calc(100% - 32px), 460px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffafb;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(55, 22, 43, 0.3);
}
.key-dialog::backdrop { background: rgba(36, 19, 31, 0.42); backdrop-filter: blur(3px); }
.key-dialog form { display: grid; gap: 18px; padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 0; }
.dialog-close { min-width: 34px; min-height: 34px; padding: 0 8px; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; }
.dialog-close:hover { background: var(--soft); color: var(--ink); }
.dialog-field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.dialog-field input { width: 100%; }
.transfer-amount-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.transfer-amount-control input { border-radius: 12px 0 0 12px; }
.transfer-amount-control button { min-width: 68px; border-radius: 0 12px 12px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.key-dialog .status { margin: -6px 0 0; }

.audit-toolbar,
.toolbar,
.transfer-bar,
.transfer-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.audit-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) 142px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.audit-toolbar > select { width: 100%; min-width: 0; }
.audit-toolbar > .date-filter { width: 100%; }
.audit-toolbar > .date-filter input[type="date"] { width: 100%; min-width: 0; }
.audit-toolbar .wallet-reason-multiselect[data-disabled="true"] { opacity: 0.6; pointer-events: none; }
.audit-toolbar [hidden] { display: none !important; }
#wallet-audit-results { display: grid; gap: 9px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.audit-result-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.audit-result-controls[hidden] { display: none; }
.audit-result-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.audit-result-filters select { width: 180px; }
.audit-result-count { color: var(--muted); font-size: 13px; font-weight: 700; }
.pagination.audit-result-pagination { margin-top: 0; }
.audit-progress-panel { display: grid; gap: 9px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.audit-progress-panel[hidden] { display: none; }
.audit-progress-head,
.audit-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audit-progress-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.audit-progress-actions [hidden] { display: none !important; }
.audit-progress-actions button { min-height: 36px; padding: 8px 14px; }
.audit-progress-head strong { color: var(--ink); font-size: 22px; }
.audit-progress-head span,
.audit-progress-meta { color: var(--muted); font-size: 13px; font-weight: 700; }
.audit-progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #eadce3; }
.audit-progress-bar { display: block; width: 0; min-width: 2px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--pink)); transition: width 0.35s ease; }
@media (max-width: 620px) { .audit-progress-meta { align-items: flex-start; flex-direction: column; gap: 4px; } }
.toolbar input[type="search"] { flex: 1 1 280px; }
#wallet-search { flex: 0 1 280px; width: 280px; max-width: 100%; }
.toolbar select { width: 150px; }
.wallets-toolbar,
.tokens-toolbar {
  display: grid;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.wallets-toolbar:has(.wallet-reason-multiselect[open]),
.audit-toolbar:has(.wallet-reason-multiselect[open]) { overflow: visible; }
.wallets-toolbar { grid-template-columns: minmax(280px, 1fr) repeat(5, minmax(125px, 150px)); }
.tokens-toolbar { grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(130px, 150px)) 142px 42px; }
.wallets-toolbar > input,
.wallets-toolbar > select,
.tokens-toolbar > input,
.tokens-toolbar > select { width: 100%; min-width: 0; }
.wallets-toolbar #wallet-search { width: 100%; max-width: none; }
.wallet-reason-filter-row { display: flex; flex: 0 0 100%; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; }
.wallets-toolbar .wallet-reason-filter-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) minmax(260px, 1fr) 142px 42px;
  flex-wrap: nowrap;
}
.wallets-toolbar .wallet-reason-multiselect,
.wallets-toolbar .wallet-found-token-input { width: 100%; max-width: none; }
.audit-toolbar .wallet-reason-filter-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) minmax(260px, 1fr) auto;
  flex-wrap: nowrap;
}
.audit-toolbar .wallet-reason-multiselect,
.audit-toolbar .wallet-found-token-input { width: 100%; max-width: none; }
.audit-start-control { display: flex; align-items: flex-end; gap: 10px; align-self: stretch; }
.audit-start-control select { width: 130px; height: 42px; }
.audit-start-control > button { width: auto; min-width: 100px; height: 42px; }
.wallet-reason-multiselect { position: relative; width: min(520px, 100%); }
.wallet-found-token-input { width: min(390px, 100%); min-height: 42px; box-sizing: border-box; }
.wallet-reason-multiselect > summary { display: flex; min-height: 42px; align-items: center; justify-content: space-between; box-sizing: border-box; padding: 9px 12px; border: 1px solid #dacbd3; border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; list-style: none; }
.wallet-reason-multiselect > summary::-webkit-details-marker { display: none; }
.wallet-reason-multiselect > summary::after { content: "⌄"; margin-left: 12px; color: var(--muted); font-size: 18px; line-height: 1; }
.wallet-reason-multiselect[open] > summary { outline: 3px solid rgba(32, 155, 122, 0.16); border-color: var(--accent); }
.wallet-reason-options { position: absolute; z-index: 45; top: calc(100% + 6px); left: 0; display: grid; width: min(720px, calc(100vw - 48px)); max-height: 420px; overflow: auto; padding: 8px; border: 1px solid #dacbd3; border-radius: 14px; background: #fff; box-shadow: 0 18px 45px rgba(36, 19, 31, 0.2); }
.wallet-reason-option { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink); cursor: pointer; line-height: 1.3; }
.wallet-reason-option:hover { background: var(--soft); }
.wallet-reason-option input { flex: 0 0 auto; width: auto; margin: 2px 0 0; }
.selection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.selection-actions[hidden] { display: none; }
.selection-count { min-width: 92px; color: var(--muted); font-size: 13px; font-weight: 700; }
.selection-actions button { min-height: 34px; padding: 7px 12px; }
.table-selectors { display: inline-flex; align-items: center; gap: 9px; }
.filtered-select-checkbox { accent-color: #d92f52; outline: 2px solid rgba(217, 47, 82, 0.65); outline-offset: 1px; border-radius: 2px; }
.date-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.date-filter input[type="date"] { width: 142px; min-width: 142px; height: 42px; box-sizing: border-box; padding: 9px 10px; }
.filter-export-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
}
.filter-export-button:hover { background: var(--soft); color: var(--ink); }
.filter-export-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.date-filter input.date-input-empty:not(:focus) { color: transparent; }
.date-filter input.date-input-empty:not(:focus)::-webkit-datetime-edit,
.date-filter input.date-input-empty:not(:focus)::-webkit-datetime-edit-text,
.date-filter input.date-input-empty:not(:focus)::-webkit-datetime-edit-day-field,
.date-filter input.date-input-empty:not(:focus)::-webkit-datetime-edit-month-field,
.date-filter input.date-input-empty:not(:focus)::-webkit-datetime-edit-year-field { color: transparent; }
.transfer-section + .transfer-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.transfer-bar { gap: clamp(30px, 5vw, 80px); }
.file-button { display: inline-flex; align-items: center; background: #ded3d9; color: var(--ink); }
.file-button input { display: none; }
.file-name { max-width: 250px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.conflict-list { display: grid; gap: 10px; }
.conflict-row { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 79, 216, 0.04); }
.conflict-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conflict-kind { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: #f3dbe6; color: #6d304a; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.conflict-token-ticker { flex: 0 0 auto; color: var(--ink); font-size: 13px; font-weight: 850; }
.conflict-address { overflow-wrap: anywhere; color: #8f3568; font-family: var(--font-mono); font-size: 12px; text-decoration: none; }
.conflict-address:hover { color: var(--pink); text-decoration: underline; }
.conflict-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.conflict-actions button { min-height: 34px; padding: 7px 10px; background: #f3dbe6; color: #4f2235; }
.audit-result-row { display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; }
.audit-result-actions { justify-content: flex-start; }

.table-shell { min-width: 0; max-width: 100%; margin-top: 8px; overflow: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-weight: 700; }
tbody tr:hover { background: rgba(255, 79, 216, 0.035); }
.address-link { color: var(--ink); text-decoration-color: #ceb9c4; }
.wallet-reason { min-width: 230px; max-width: 340px; color: var(--muted); line-height: 1.35; white-space: normal; }
.wallet-status-source { min-width: 145px; color: var(--ink); font-weight: 400; }
.labels { color: var(--pink); font-weight: 700; }
.inline-delete { min-height: 34px; padding: 7px 10px; background: #f1dce5; color: #4f2235; }
.wallet-actions { display: flex; width: max-content; min-width: 330px; flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
.wallet-actions button { min-height: 34px; padding: 7px 10px; }
.wallet-action-trust,
.wallet-action-gambler,
.wallet-action-neutral { background: #ded3d9; color: var(--ink); }
.wallet-action-trust:hover,
.wallet-action-gambler:hover,
.wallet-action-neutral:hover { background: #cbbbc4; }
.wallet-action-delete { background: #f1dce5; color: #6f2945; }
.wallet-action-delete:hover { background: #e8cad8; }
.wallet-table { min-width: 1430px; }
.tokens-table { min-width: 1540px; }
.tokens-table th, .tokens-table td { white-space: nowrap; }
.token-row-action { min-height: 34px; padding: 7px 10px; }
.token-classification-status { font-weight: 800; }
.token-classification-new { color: var(--muted); }
.token-classification-trust { color: var(--accent); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 13px; }

.backup-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.backup-panel .hint { max-width: 720px; }

.system-page { display: grid; gap: 18px; }
.system-page[hidden] { display: none; }
.system-page .panel { margin: 0; }
.system-page-head, .system-chart-head { align-items: flex-start; }
.system-subtitle, .system-panel-note { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.system-live-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.system-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(32, 155, 122, .1); animation: system-pulse 2s ease-in-out infinite; }
@keyframes system-pulse { 50% { box-shadow: 0 0 0 9px rgba(32, 155, 122, 0); } }
.system-summary-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.system-metric-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: grid; gap: 5px; }
.system-metric-card > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.system-metric-card-title { display: flex; align-items: center; gap: 6px; }
.system-metric-card-title .help-tip { width: 16px; height: 16px; flex: 0 0 16px; font-size: 10px; letter-spacing: normal; text-transform: none; }
.system-metric-card strong { overflow: hidden; font-size: clamp(20px, 2vw, 29px); line-height: 1.05; text-overflow: ellipsis; }
.system-metric-card small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.system-metric-card.is-good { border-color: rgba(32, 155, 122, .24); background: rgba(32, 155, 122, .04); }
.system-metric-card.is-warning { border-color: rgba(193, 141, 0, .3); background: rgba(255, 202, 53, .08); }
.system-metric-card.is-critical { border-color: rgba(138, 31, 69, .3); background: rgba(138, 31, 69, .06); }
.system-two-column { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; }
.system-table-shell { margin: 0 -4px; }
.system-process-table { min-width: 900px; }
.system-process-name > span:first-child { vertical-align: middle; }
.system-process-name .help-tip { width: 17px; height: 17px; margin-left: 7px; vertical-align: middle; font-size: 10px; }
.system-cluster-table { min-width: 1120px; }
.system-status-badge { display: inline-flex; align-items: center; min-width: 53px; justify-content: center; padding: 4px 8px; border-radius: 999px; background: #eee7eb; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.system-status-badge.is-ok, .system-status-badge.is-running, .system-status-badge.is-completed, .system-status-badge.is-applied { background: rgba(32, 155, 122, .12); color: #117459; }
.system-status-badge.is-warning, .system-status-badge.is-paused { background: rgba(255, 202, 53, .2); color: #8a6500; }
.system-status-badge.is-critical, .system-status-badge.is-failed { background: rgba(138, 31, 69, .12); color: var(--danger); }
.system-status-badge.is-off, .system-status-badge.is-idle, .system-status-badge.is-unknown { background: #eee8eb; color: #806d76; }
.system-trend-chart { width: 100%; min-height: 270px; margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.system-trend-chart svg { display: block; width: 100%; height: 270px; }
.system-chart-grid { stroke: rgba(118, 93, 105, .12); stroke-width: 1; }
.system-chart-axis-tick { stroke: rgba(118, 93, 105, .5); stroke-width: 1; }
.system-chart-axis-label { fill: var(--muted); font-size: 10px; font-weight: 700; }
.system-chart-axis-title { fill: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .03em; }
.system-chart-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.system-chart-line.is-cpu { stroke: #b24783; }
.system-chart-line.is-memory { stroke: #209b7a; }
.system-chart-line.is-queue { stroke: #e5a800; }
.system-chart-line.is-errors { stroke: #8a1f45; stroke-dasharray: 5 6; }
.system-chart-legend { display: flex; gap: 18px; margin-top: 10px; color: var(--muted); font-size: 11px; font-weight: 800; }
.system-chart-legend span::before { content: ""; display: inline-block; width: 15px; height: 3px; margin: 0 6px 3px 0; border-radius: 9px; background: currentColor; }
.system-chart-legend .cpu { color: #b24783; } .system-chart-legend .memory { color: #209b7a; } .system-chart-legend .queue { color: #b48400; } .system-chart-legend .errors { color: #8a1f45; }
.system-provider-list { display: grid; gap: 13px; }
.system-provider-row { display: grid; grid-template-columns: 78px minmax(80px, 1fr); gap: 5px 12px; align-items: center; }
.system-provider-row strong { font-size: 12px; }
.system-provider-row > span { grid-column: 2; color: var(--muted); font-size: 11px; }
.system-provider-bar { height: 8px; overflow: hidden; border-radius: 99px; background: #eee6ea; }
.system-provider-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.system-provider-credit { margin-top: 4px; padding: 11px 13px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; }
.system-incident-list { display: grid; gap: 10px; }
.system-incident { padding: 12px 14px; border-left: 4px solid #d5c8cf; border-radius: 10px; background: #faf6f8; display: grid; gap: 5px; }
.system-incident.is-warning { border-color: #d4a000; } .system-incident.is-critical { border-color: var(--danger); }
.system-incident > div { color: var(--muted); font-size: 11px; font-weight: 800; }
.system-incident strong { font-size: 13px; }
.system-incident p { margin: 0; color: var(--muted); font-size: 11px; }
.system-incident-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.system-incident-actions .button-link,
.system-incident-actions button { width: auto; padding: 7px 10px; border-radius: 9px; font-size: 11px; }
.system-detail-list { display: grid; gap: 0; }
.system-detail-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.system-detail-list > div:last-child { border-bottom: 0; }
.system-detail-list span { color: var(--muted); }
.system-detail-list strong { text-align: right; }
.system-empty-state { min-height: 110px; display: grid; place-items: center; padding: 24px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .site-header-inner {
    min-height: 0;
    padding: 12px 20px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px 14px;
  }
  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    padding-bottom: 1px;
  }
  .header-metrics { grid-column: 2; grid-row: 1; }
  .logout-button { grid-column: 3; grid-row: 1; }
  .settings-page-grid, .label-color-columns { grid-template-columns: 1fr; }
  .system-summary-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .system-two-column { grid-template-columns: 1fr; }
  .settings-panel-wide { grid-column: auto; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; justify-content: space-between; }
  .hero-stat { text-align: left; }
  .trade-panel-head { align-items: flex-start; }
  .wallet-manager-head, .wallet-manager-actions { align-items: stretch; flex-direction: column; }
}

@media (max-width: 620px) {
  .site-header-inner {
    padding: 12px;
  }
  .wordmark { font-size: 22px; }
  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    padding-bottom: 1px;
  }
  .primary-nav a { flex: 1 0 auto; text-align: center; }
  .header-usage-metric { min-width: 70px; height: 36px; padding: 0 8px; font-size: 15px; }
  .header-usage-metric svg { width: 18px; height: 18px; }
  .page-shell { width: 100%; padding: 16px 12px 32px; }
  .panel, .hero, .auth-card { padding: 20px; border-radius: 18px; }
  .panel-head, .hero-actions { align-items: stretch; flex-direction: column; }
  .trade-panel { padding: 18px; }
  .trade-table-shell { margin: 0 -18px -18px; padding: 0 18px 14px; }
  .period-tabs { width: 100%; overflow-x: auto; }
  .period-tabs button { flex: 1 0 auto; }
  .order-form-grid { grid-template-columns: 1fr; }
  .order-form-grid .dialog-field:first-child { grid-column: auto; }
  .settings-action-grid,
  .local-settings-grid { grid-template-columns: 1fr; }
  .settings-submit-row button { width: 100%; }
  .transfer-group > * { flex: 1 1 100%; }
  .conflict-row, .key-row { grid-template-columns: 1fr; }
  .conflict-actions { justify-content: flex-start; }
  .backup-panel { align-items: stretch; flex-direction: column; }
  .system-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-chart-head { gap: 14px; }
}

/* Platform redesign · Beautiful UI visual direction · shell and primitives */
:root {
  color-scheme: dark;
  font-family: var(--font-sans);
  --canvas: #1c1d1f;
  --page: #17181a;
  --surface: #232427;
  --field: #2b2c2f;
  --hover: #2a2b2e;
  --hover-2: #313236;
  --ink: #f2f3f4;
  --muted: #a5a8ad;
  --ink-3: #6c6f75;
  --line: #2e3033;
  --line-strong: #3a3c40;
  --panel: #232427;
  --soft: #2b2c2f;
  --accent: #3d9aff;
  --accent-ink: #7ec0ff;
  --accent-tint: rgba(61, 154, 255, 0.16);
  --pink: #7ec0ff;
  --success: #3dbb72;
  --warning: #f68f3c;
  --danger: #ee5c61;
  --radius-card: 10px;
  --radius-control: 8px;
  --radius-chip: 6px;
  --shadow-card: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-control: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-field: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

body {
  color: var(--ink);
  background-color: var(--canvas);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 9px);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

::selection { background: rgba(61, 154, 255, 0.32); color: var(--ink); }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.environment-banner {
  position: sticky;
  min-height: 34px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  background: #f6c344;
  color: #17181a;
  font-weight: 650;
}

.site-header {
  border-color: var(--line);
  background: rgba(23, 24, 26, 0.96);
  backdrop-filter: blur(20px) saturate(125%);
}

.wordmark,
.auth-wordmark { color: var(--ink); letter-spacing: -0.1em; }
.wordmark strong,
.auth-wordmark strong { color: var(--accent); }

.primary-nav a {
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.005em;
}
.primary-nav a:hover { background: var(--hover); color: var(--ink); }
.primary-nav a[aria-current="page"] {
  background: var(--hover-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 2px rgba(0, 0, 0, 0.22);
}

.header-usage-metric,
.header-review-metric,
.header-new-token-metric {
  min-width: 52px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 650;
}
.header-usage-metric::after {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--field);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}
.header-review-icon,
.header-new-token-icon { stroke: var(--muted); }
.logout-button {
  border-color: var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-control);
}
.logout-button:hover { background: var(--hover-2); color: var(--ink); }

.page-shell { padding: 32px; }
.dashboard-page { gap: 16px; }
.panel,
.auth-card {
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.panel { padding: 20px; }
.auth-card { padding: 32px; box-shadow: var(--shadow-card), 0 28px 80px rgba(0, 0, 0, 0.28); }
.auth-card form { gap: 14px; margin-top: 28px; }
.auth-card form > input { min-height: 42px; }

h1,
h2,
h3 { letter-spacing: -0.035em; }
h1 { font-size: clamp(34px, 5vw, 58px); }
h2 { font-size: 21px; }
.section-title { font-size: 20px; line-height: 1.2; }
.eyebrow { margin-bottom: 6px; color: var(--accent-ink); font-size: 11px; letter-spacing: 0.12em; }
.hero { gap: 22px; padding: 22px; }
.hero-copy,
.status { color: var(--muted); }

button,
.button-link,
.file-button {
  border: 0;
  border-radius: var(--radius-control);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-control);
  font-size: 13px;
  font-weight: 550;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}
button:hover,
.button-link:hover,
.file-button:hover { background: var(--hover-2); }
button:active,
.button-link:active,
.file-button:active { transform: translateY(1px); }
button:disabled { color: var(--ink-3); opacity: 0.58; }
.secondary-button { background: var(--field); color: var(--ink); }
.danger-button { background: var(--danger); color: #fff; }
.danger-button:hover { background: #f16b70; }

input,
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--field);
  color: var(--ink);
  box-shadow: var(--shadow-field);
}
input::placeholder,
textarea::placeholder { color: var(--ink-3); }
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-tint);
}
select { color-scheme: dark; }

.segmented-control,
.trade-side-tabs,
.trade-mode-tabs,
.token-data-tabs,
.period-tabs,
.cluster-token-filter-tabs { border: 1px solid var(--line); background: var(--page); }
.segmented-control button[aria-selected="true"],
.trade-mode-tabs button[aria-selected="true"],
.token-data-tabs button[aria-selected="true"],
.period-tabs button[aria-selected="true"],
.cluster-token-filter-tabs button[aria-selected="true"] {
  background: var(--hover-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.table-shell,
.trade-table-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--page);
}
table { border-collapse: separate; border-spacing: 0; }
th,
td { border-bottom-color: var(--line); font-size: 12px; }
th {
  background: rgba(255, 255, 255, 0.018);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.token-sticky-bar,
.token-pg-alert-popover,
.holder-filter summary,
.holder-filter > div,
.wallet-reason-multiselect > summary,
.wallet-reason-multiselect > div,
.dialog-card,
.trade-input,
.trade-quick-edit,
.copy-button,
.order-icon-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.token-sticky-bar {
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  background: rgba(35, 36, 39, 0.96);
}
.system-provider-credit,
.selection-actions,
.trade-quick button { background: var(--field); color: var(--muted); }
.system-incident { border-left-width: 3px; background: var(--field); }
.system-incident.is-warning { border-color: var(--warning); }
.switch-control span { border-color: var(--line-strong); background: var(--field); }
.switch-control span::after { background: var(--muted); }
.switch-control input:checked + span { border-color: var(--accent); background: var(--accent); }
.switch-control input:checked + span::after { background: #fff; }

@media (min-width: 1121px) {
  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    border-right: 0;
    border-bottom: 1px dashed var(--line-strong);
  }
  body.is-staging .site-header { top: 34px; }
  .site-header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    width: 100%;
    max-width: 1440px;
    min-height: 68px;
    padding: 0 24px;
    gap: 16px;
  }
  .wordmark { padding: 0; font-size: 23px; }
  .primary-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: 100%;
  }
  .primary-nav::before { content: none; }
  .primary-nav a { width: auto; padding: 8px 10px; }
  .primary-nav a[aria-current="page"]::before { content: none; }
  .header-metrics {
    display: flex;
    gap: 4px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .header-usage-metric { width: auto; }
  .header-usage-metric::after { right: 0; bottom: auto; left: auto; top: calc(100% + 9px); }
  .logout-button { width: 40px; height: 34px; border-radius: var(--radius-control); }
  .page-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 32px clamp(24px, 4vw, 64px) 56px;
  }
  .dashboard-page { width: 100%; max-width: 1440px; margin: 0 auto; }
  .token-sticky-bar { left: 50%; width: min(calc(100% - 48px), 1200px); }
}

@media (max-width: 1120px) {
  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    border-right: 0;
    border-bottom: 1px dashed var(--line-strong);
  }
  body.is-staging .site-header { top: 34px; }
  .site-header-inner {
    display: grid;
    min-height: 0;
    padding: 12px 16px 10px;
    gap: 10px 12px;
  }
  .primary-nav { gap: 4px; scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav a { flex: 0 0 auto; padding: 7px 10px; white-space: nowrap; }
  .page-shell { width: 100%; margin: 0; padding: 20px 16px 40px; }
  .token-sticky-bar { left: 50%; width: calc(100% - 24px); }
}

@media (max-width: 620px) {
  .site-header-inner { padding: 10px 12px 9px; }
  .header-usage-metric { min-width: 52px; height: 32px; font-size: 12px; }
  .page-shell { padding: 16px 12px 32px; }
  .panel,
  .hero,
  .auth-card { padding: 16px; border-radius: var(--radius-card); }
  .section-title { font-size: 18px; }
  th,
  td { padding: 10px 8px; }
}
