:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #f8fafc;
  --text: #1b2430;
  --muted: #657184;
  --line: #d9e0e8;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --blue: #2454a6;
  --amber: #b86b00;
  --warn: #9a5b00;
  --danger: #b42318;
  --good: #087443;
  --shadow: 0 12px 30px rgba(20, 31, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 1080px;
  background:
    linear-gradient(180deg, #eef3f6 0, #f7f8fa 280px, var(--bg) 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 16px;
  background: linear-gradient(180deg, #12857d, var(--accent));
  color: #fff;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

button:hover {
  background: var(--accent-dark);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

button.secondary {
  background: linear-gradient(180deg, #2f4057, #233142);
}

button.secondary:hover {
  background: #111827;
}

button.ghost {
  min-height: 34px;
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

button.ghost:hover {
  background: var(--panel-strong);
  border-color: #b7c3d0;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.link-button:hover {
  background: var(--panel-strong);
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  display: none;
  position: static;
  height: auto;
  overflow: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 22px;
}

.brand {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--good);
  border-color: rgba(8, 116, 67, 0.32);
  background: rgba(8, 116, 67, 0.06);
}

.status-pill.direct {
  color: var(--blue);
  border-color: rgba(36, 84, 166, 0.28);
  background: rgba(36, 84, 166, 0.06);
}

.status-pill.bad {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.32);
  background: rgba(180, 35, 24, 0.06);
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 0;
}

.control-section {
  display: grid;
  gap: 12px;
  border: 1px solid #e6ebf0;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.control-section h2 {
  margin: 0 0 2px;
  font-size: 14px;
  color: #27364a;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.workspace {
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.type-tabs {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: var(--shadow);
}

.type-tabs .status-pill {
  margin-left: auto;
}

button.tab {
  min-height: 34px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

button.tab:hover {
  background: var(--panel-strong);
  color: var(--text);
}

button.tab.active {
  background: var(--accent);
  color: #fff;
}

.type-page {
  display: none;
}

.type-page.active {
  display: grid;
}

.topbar {
  display: none;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
  box-shadow: var(--shadow);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.metric-cell {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: none;
}

.metric-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-cell strong {
  display: block;
  margin-top: 9px;
  font-size: 22px;
  line-height: 1.1;
}

.metric-cell.accent {
  border-color: rgba(15, 118, 110, 0.32);
  background: #f1fbf9;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

body[data-type="futures"] #spotScanButton,
body[data-type="spot"] #scanButton,
body[data-type="spot"] #backtestSelectedButton,
body[data-type="spot"] #backtestManualButton,
body[data-type="spot"] #selectTopButton,
body[data-type="spot"] #backtestPage,
body[data-type="spot"] #futuresPage,
body[data-type="corpus"] .sidebar,
body[data-type="smart"] .sidebar,
body[data-type="memecoin"] .sidebar,
body[data-type="corpus"] .topbar,
body[data-type="smart"] .topbar,
body[data-type="memecoin"] .topbar,
body[data-type="corpus"] #notice,
body[data-type="smart"] #notice,
body[data-type="memecoin"] #notice,
body[data-type="corpus"] #futuresPage,
body[data-type="smart"] #futuresPage,
body[data-type="memecoin"] #futuresPage,
body[data-type="corpus"] #backtestPage,
body[data-type="smart"] #backtestPage,
body[data-type="memecoin"] #backtestPage,
body[data-type="corpus"] #spotPage,
body[data-type="smart"] #spotPage,
body[data-type="memecoin"] #spotPage,
body[data-type="corpus"] #smartPage,
body[data-type="corpus"] #memecoinPage,
body[data-type="smart"] #corpusPage,
body[data-type="smart"] #memecoinPage,
body[data-type="memecoin"] #corpusPage,
body[data-type="memecoin"] #smartPage,
body[data-type="futures"] #corpusPage,
body[data-type="futures"] #smartPage,
body[data-type="futures"] #memecoinPage,
body[data-type="spot"] #corpusPage,
body[data-type="spot"] #smartPage,
body[data-type="spot"] #memecoinPage {
  display: none;
}

body[data-type="spot"] #spotPage {
  display: grid;
}

body[data-type="corpus"] #corpusPage,
body[data-type="smart"] #smartPage,
body[data-type="memecoin"] #memecoinPage {
  display: grid;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 12px 14px;
  min-height: 44px;
  line-height: 1.45;
}

.notice.busy {
  color: var(--warn);
  border-color: rgba(154, 91, 0, 0.35);
  background: #fff8eb;
}

.notice.error {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.3);
  background: #fff4f2;
}

.notice.good {
  color: var(--good);
  border-color: rgba(8, 116, 67, 0.28);
  background: #f1fbf5;
}

.data-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.strategy-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.strategy-modules.stacked {
  grid-template-columns: 1fr;
}

.spot-module {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.compact-heading h2 {
  font-size: 16px;
}

.strategy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.futures-actions {
  display: none;
}

#backtestPage {
  display: none !important;
}

.strategy-card.active {
  border-color: rgba(15, 118, 110, 0.36);
  background: #f1fbf9;
}

.strategy-card h3,
.xzl-panel h3 {
  margin: 0;
  font-size: 16px;
}

.strategy-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f7;
  color: #41516a;
  font-weight: 650;
}

tbody tr:hover {
  background: #f7fafc;
}

tr:last-child td {
  border-bottom: 0;
}

th:nth-child(1),
td:nth-child(1),
th:nth-child(3),
td:nth-child(3) {
  text-align: left;
}

.compact th:first-child,
.compact td:first-child,
.compact th:nth-child(2),
.compact td:nth-child(2),
.trade-log th:nth-child(1),
.trade-log td:nth-child(1),
.trade-log th:nth-child(2),
.trade-log td:nth-child(2),
.trade-log th:nth-child(3),
.trade-log td:nth-child(3) {
  text-align: left;
}

.check-col {
  width: 44px;
}

td input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  vertical-align: middle;
  accent-color: var(--accent);
}

.symbol {
  color: #111827;
  font-weight: 700;
}

.empty {
  height: 86px;
  color: var(--muted);
  text-align: center !important;
}

.positive {
  color: var(--good);
  font-weight: 650;
}

.negative {
  color: var(--danger);
  font-weight: 650;
}

.muted {
  color: var(--muted);
}

.advice-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.advice-badge.positive {
  color: var(--good);
  border-color: rgba(8, 116, 67, 0.28);
  background: rgba(8, 116, 67, 0.07);
}

.advice-badge.negative {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.06);
}

.confidence {
  display: grid;
  gap: 5px;
  min-width: 76px;
}

.confidence span {
  font-weight: 750;
  color: #243246;
}

.confidence i {
  display: block;
  width: 76px;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, currentColor var(--value), #dbe3ec var(--value));
}

.confidence.high {
  color: var(--good);
}

.confidence.mid {
  color: var(--amber);
}

.confidence.low {
  color: var(--danger);
}

.reason-cell {
  max-width: 360px;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}

.detail-row {
  display: none;
}

.detail-row.open {
  display: table-row;
}

.detail-panel {
  display: grid;
  gap: 12px;
  background: #f7fafc;
  padding: 14px;
  text-align: left;
  white-space: normal;
  border-left: 3px solid rgba(15, 118, 110, 0.5);
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.detail-subtitle {
  margin: 4px 0 -4px;
  font-size: 14px;
  line-height: 1.3;
  color: #26364a;
}

.detail-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.detail-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
}

.mini-table {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  color: var(--text);
  font: inherit;
}

.xzl-page {
  gap: 18px;
  background: #f4f7f9;
}

.xzl-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.xzl-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(20, 31, 48, 0.04);
}

.xzl-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
}

.xzl-form-grid.smart {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.xzl-list {
  display: grid;
  gap: 12px;
}

.compact-list {
  max-height: 520px;
  overflow: auto;
}

.xzl-item {
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #fff;
  padding: 13px;
  box-shadow: 0 5px 16px rgba(20, 31, 48, 0.035);
}

.xzl-item-head,
.panel-title-row,
.smart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.xzl-item-head {
  align-items: flex-start;
}

.xzl-item-head strong::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #2454a6);
}

.xzl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.corpus-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid #edf1f5;
  padding-top: 10px;
}

.corpus-actions label {
  width: min(260px, 70%);
}

.corpus-actions select {
  min-height: 34px;
}

.corpus-actions button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  color: var(--danger);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.xzl-text {
  margin: 10px 0;
  color: var(--text);
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
}

.xzl-meta,
.smart-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.media-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f7;
  cursor: zoom-in;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.86);
}

.media-viewer.active {
  display: grid;
}

.media-viewer img {
  max-width: min(1200px, 96vw);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.media-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: auto;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(15, 23, 42, 0.62);
}

.smart-detail-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.smart-detail {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.meme-token {
  display: grid;
  gap: 10px;
  border-left: 4px solid var(--accent);
}

.meme-feed {
  grid-template-columns: repeat(4, minmax(240px, 1fr));
}

.meme-title-left,
.meme-chain-head,
.meme-chain-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.is-collapsed {
  display: none !important;
}

.compact-actions {
  align-items: center;
  gap: 8px;
}

.meme-toggle {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.chain-icon,
.platform-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 38px;
  height: 28px;
  border-radius: 8px;
  padding: 0 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.chain-sol {
  background: linear-gradient(135deg, #0f766e, #7c3aed);
}

.chain-bsc {
  background: linear-gradient(135deg, #b86b00, #d9a72f);
}

.chain-base {
  background: linear-gradient(135deg, #2454a6, #0f766e);
}

.chain-eth {
  background: linear-gradient(135deg, #344154, #6b7cff);
}

.platform-icon {
  max-width: 140px;
  overflow: hidden;
  background: #eef3f7;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meme-token .xzl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.meme-token .xzl-meta span,
.meme-token .meme-chip {
  border-radius: 999px;
  background: #f2f6fb;
  padding: 3px 8px;
}

.meme-token .attention-chip,
.meme-token .meme-chip.attention {
  color: var(--amber);
  background: #fff6df;
  font-weight: 750;
}

.meme-token .meme-chip.source {
  color: var(--blue);
  background: rgba(36, 84, 166, 0.08);
  font-weight: 750;
}

.meme-token .meme-chip.smart {
  color: var(--good);
  background: rgba(8, 116, 67, 0.08);
  font-weight: 750;
}

.meme-token .meme-chip.neutral {
  color: #334155;
  background: #eef3f7;
}

.meme-token .meme-chip.marketcap {
  color: #0f766e;
  background: #ccfbf1;
  font-size: 13px;
  font-weight: 800;
}

.meme-token .meme-chip.social-score {
  --social-fill: 0%;
  --social-fill-color: rgba(37, 99, 235, 0.24);
  --social-base-color: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(90deg, var(--social-fill-color) 0 var(--social-fill), var(--social-base-color) var(--social-fill) 100%);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

.meme-token .meme-chip.social-score.score-high {
  --social-fill-color: rgba(249, 115, 22, 0.3);
  --social-base-color: #fff7ed;
  border-color: rgba(249, 115, 22, 0.24);
  color: #9a3412;
}

.meme-token .meme-chip.social-score.score-mid {
  --social-fill-color: rgba(37, 99, 235, 0.24);
  --social-base-color: #eff6ff;
  border-color: rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
}

.meme-token .meme-chip.social-score.score-low {
  --social-fill-color: rgba(100, 116, 139, 0.2);
  --social-base-color: #f8fafc;
  border-color: rgba(100, 116, 139, 0.18);
  color: #475569;
}

.meme-cap {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.holder-change {
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.holder-change.up {
  color: #047857;
  background: #d1fae5;
}

.holder-change.down {
  color: #b42318;
  background: #fee2e2;
}

.meme-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.symbol-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  white-space: normal;
}

.meme-token .xzl-text {
  margin: 2px 0 0;
}

.x-call-details {
  border: 1px solid #e7edf3;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px 10px;
}

.x-call-details summary {
  cursor: pointer;
  color: #2454a6;
  font-size: 12px;
  font-weight: 800;
}

.x-call-details ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.x-call-details li {
  border-top: 1px solid #e7edf3;
  padding-top: 8px;
}

.x-call-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.x-call-head span {
  color: var(--muted);
  font-size: 12px;
}

.x-call-signal {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  border: 1px solid #bfd4ff;
  border-radius: 999px;
  background: #eef5ff;
  color: #1d4ed8;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.x-call-analysis {
  margin: 5px 0 0;
  color: #14532d;
  font-size: 12px;
  line-height: 1.45;
}

.x-call-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.x-call-reasons span {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 2px 7px;
  font-size: 11px;
}

.x-call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ghost-link {
  background: #fff;
  color: #475569;
  border-color: #d8e1ec;
}

.why-buy-answer {
  margin: 4px 0 0;
  border-left: 3px solid #16a34a;
  background: #f3faf5;
  color: #14532d;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.binance-ai-box {
  display: grid;
  gap: 7px;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 9px 10px;
}

.binance-ai-box p {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  color: #223047;
  font-size: 12px;
  line-height: 1.45;
}

.binance-ai-box strong {
  color: #1d4ed8;
  font-size: 11px;
  white-space: nowrap;
}

.binance-ai-box span {
  min-width: 0;
}

.x-call-details p {
  margin: 4px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

.x-call-image {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 6px;
  border: 1px solid #e7edf3;
}

.meme-chain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
}

.meme-chain-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.meme-chain-panel > .xzl-list {
  max-height: 68vh;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.meme-chain-panel .xzl-item,
.meme-chain-panel .meme-token,
.meme-chain-panel .x-call-details,
.meme-chain-panel .binance-ai-box {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.meme-chain-panel .meme-chip,
.meme-chain-panel .xzl-meta span,
.meme-chain-panel .binance-ai-box span,
.meme-chain-panel .x-call-details summary,
.meme-chain-panel .x-call-details p {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.meme-chain-head {
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7edf3;
}

.meme-chain-head-main {
  flex: 1 1 auto;
}

.meme-chain-head strong {
  display: block;
  font-size: 15px;
}

.meme-chain-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.compact-meme {
  box-shadow: none;
}

.rank-icon {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.rank-new {
  color: #065f46;
  background: #d1fae5;
}

.rank-6 {
  color: #7c2d12;
  background: #ffedd5;
}

.rank-12 {
  color: #581c87;
  background: #f3e8ff;
}

.rank-stay {
  color: #334155;
  background: #e2e8f0;
}

.compact-meme .xzl-meta span:nth-child(n+7) {
  display: none;
}

.smart-detail h4 {
  margin: 0;
  font-size: 13px;
  color: #26364a;
}

.smart-mini-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.smart-mini-table table {
  font-size: 12px;
}

.smart-history {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.smart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.smart-card.off {
  opacity: 0.66;
}

button.mini {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
}

.trade-log {
  max-height: 330px;
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .controls {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    align-items: start;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
    background: #f4f6f8;
  }

  .workspace,
  .sidebar {
    padding: 10px;
  }

  .workspace {
    gap: 12px;
  }

  body[data-type="memecoin"] .workspace {
    padding: 0 10px 14px;
  }

  .type-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 4px;
    margin: -10px -10px 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 8px 10px;
    box-shadow: none;
    scrollbar-width: none;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .type-tabs::-webkit-scrollbar {
    display: none;
  }

  .type-tabs .status-pill {
    display: none;
  }

  button.tab {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .controls,
  .metric-grid,
  .strategy-modules,
  .xzl-grid,
  .meme-feed,
  .meme-chain-grid,
  .xzl-form-grid,
  .xzl-form-grid.smart {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  button:not(.tab) {
    width: 100%;
  }

  .xzl-panel,
  .xzl-item,
  .meme-chain-panel {
    padding: 10px;
  }

  body[data-type="memecoin"] .xzl-page {
    gap: 10px;
  }

  body[data-type="memecoin"] .section-heading {
    align-items: flex-start;
    padding: 2px 0 0;
  }

  body[data-type="memecoin"] .section-heading h2 {
    font-size: 20px;
  }

  body[data-type="memecoin"] .section-heading p {
    font-size: 12px;
    line-height: 1.4;
  }

  .panel-title-row,
  .smart-title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .compact-actions {
    display: flex;
    flex: 0 0 auto;
    width: auto;
  }

  .panel-title-row {
    flex-wrap: nowrap;
  }

  .meme-chain-head {
    align-items: center;
  }

  .meme-toggle,
  .meme-toggle.mini {
    width: auto;
    min-width: 58px;
    min-height: 34px;
    padding: 0 10px;
  }

  .meme-title-left {
    flex: 1 1 auto;
  }

  .meme-title-left strong {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .platform-icon {
    max-width: 88px;
  }

  .meme-score-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .meme-token .meme-chip,
  .meme-token .xzl-meta span {
    border-radius: 8px;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .meme-token .xzl-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .binance-ai-box {
    padding: 8px;
  }

  .binance-ai-box p {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .holder-change {
    display: block;
    width: fit-content;
    margin: 4px 0 0;
  }

  .meme-chain-panel > .xzl-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .x-call-details {
    padding: 8px;
  }

  .x-call-details summary {
    min-height: 32px;
    display: flex;
    align-items: center;
    font-size: 13px;
  }

  .x-call-actions,
  .smart-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .x-call-actions .link-button,
  .smart-actions .link-button,
  .x-call-actions button {
    width: 100%;
    justify-content: center;
  }

  .x-call-image {
    max-height: 220px;
  }

  .table-wrap {
    margin-right: -10px;
    border-right: 0;
    border-radius: 8px 0 0 8px;
  }

  .mini-table {
    overflow-x: auto;
  }
}
