:root {
  --cs-midnight-teal: #063b40;
  --cs-scope-cyan: #35c7d0;
  --cs-cardano-blue: #0033ad;
  --cs-deep-navy: #071923;
  --cs-ice-white: #f6fbfc;
  --cs-graph-slate: #6b7c85;
  --cs-signal-green: #21c17a;
  --cs-warning-amber: #f4b740;
  --cs-risk-red: #e75a5a;

  --bg: var(--cs-ice-white);
  --panel: #ffffff;
  --panel-2: #eef7f8;
  --text: var(--cs-midnight-teal);
  --muted: var(--cs-graph-slate);
  --line: rgba(6, 59, 64, 0.12);
  --accent: var(--cs-midnight-teal);
  --accent-2: var(--cs-scope-cyan);
  --good: var(--cs-signal-green);
  --bad: var(--cs-risk-red);
  --warn: var(--cs-warning-amber);
  --shadow: 0 14px 40px rgba(7, 25, 35, 0.08);
  font-family:
    Inter, "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
}

html[data-theme="midnight"] {
  --bg: var(--cs-deep-navy);
  --panel: #0c2230;
  --panel-2: #102d38;
  --text: var(--cs-ice-white);
  --muted: #9bb4bc;
  --line: rgba(246, 251, 252, 0.13);
  --accent: var(--cs-scope-cyan);
  --accent-2: var(--cs-cardano-blue);
  --good: var(--cs-signal-green);
  --bad: var(--cs-risk-red);
  --warn: var(--cs-warning-amber);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(246, 251, 252, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  min-height: 72px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
}

html[data-theme="midnight"] .topbar {
  background: rgba(7, 25, 35, 0.94);
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  flex: 0 1 210px;
  min-width: 148px;
  overflow: hidden;
}

.brand-logo {
  display: block;
  height: 46px;
  max-width: 210px;
  min-width: 0;
  object-fit: contain;
  object-position: left center;
  width: min(210px, 100%);
}

.brand-logo-dark,
html[data-theme="midnight"] .brand-logo-light {
  display: none;
}

html[data-theme="midnight"] .brand-logo-dark {
  display: block;
}

.top-links {
  align-items: center;
  display: flex;
  gap: 4px;
}

.top-links a {
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  padding: 9px 10px;
  white-space: nowrap;
}

.top-links a:hover,
.top-links a.active {
  background: var(--panel-2);
  color: var(--text);
}


.global-search {
  flex: 1;
  max-width: 480px;
  min-width: 160px;
}

.global-search input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  min-height: 40px;
  padding: 9px 14px;
  width: 100%;
}

.sync-status {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  gap: 7px;
  min-height: 38px;
  max-width: 240px;
  padding: 8px 11px;
  white-space: nowrap;
}

.sync-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-dot {
  background: var(--warn);
  border-radius: 999px;
  flex: 0 0 auto;
  height: 8px;
  width: 8px;
}

.sync-status.live .sync-dot {
  background: var(--good);
}

.sync-status.lagging .sync-dot {
  background: var(--warn);
}

.sync-status.error .sync-dot {
  background: var(--bad);
}

.nav {
  align-content: start;
  background: color-mix(in srgb, var(--panel) 94%, var(--panel-2));
  border-right: 1px solid var(--line);
  bottom: 0;
  display: grid;
  gap: 10px;
  left: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 12px 28px;
  position: fixed;
  top: 72px;
  transition: transform 180ms ease;
  width: 276px;
  z-index: 20;
}

.sidebar-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 2px 10px 6px;
  text-transform: uppercase;
}

html[data-theme="midnight"] .nav {
  background: rgba(21, 27, 35, 0.97);
}

body.sidebar-collapsed .nav {
  transform: translateX(-100%);
}

body.sidebar-collapsed .shell {
  padding-left: 32px;
}

.nav-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow: visible;
  width: 100%;
}

.nav-group button {
  align-items: center;
  background: var(--panel);
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 850;
  gap: 10px;
  justify-content: space-between;
  letter-spacing: 0;
  min-height: 40px;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.nav-group button::after {
  content: "v";
  flex: 0 0 auto;
  font-size: 11px;
  transition: transform 160ms ease;
}

.nav-group.collapsed button::after {
  transform: rotate(-90deg);
}

.nav-group.collapsed .nav-menu {
  display: none;
}

.nav-menu {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px;
  width: 100%;
}

.header-tools {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.language-select {
  min-height: 38px;
  min-width: 126px;
  padding: 8px 10px;
}

.theme-toggle {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  min-height: 38px;
  padding: 4px 11px 4px 4px;
}

.theme-toggle-icon {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(31, 45, 55, 0.12);
  display: inline-grid;
  height: 28px;
  place-items: center;
  width: 28px;
}

.theme-toggle-icon::before {
  background: #172026;
  border-radius: 999px;
  content: "";
  height: 12px;
  width: 12px;
}

.theme-toggle[data-active-theme="midnight"] {
  background: #0d1117;
  border-color: #303b45;
  color: #eef4f8;
  padding-left: 11px;
  padding-right: 4px;
}

.theme-toggle[data-active-theme="midnight"] .theme-toggle-icon {
  background: #f6f7f9;
  color: #172026;
  order: 2;
}

.theme-toggle[data-active-theme="midnight"] .theme-toggle-icon::before {
  background: #f2c36b;
  box-shadow: 0 0 0 4px rgba(242, 195, 107, 0.18);
}

.nav a {
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  min-height: 36px;
  min-width: 0;
  overflow: visible;
  overflow-wrap: normal;
  padding: 9px 10px 9px 14px;
  position: relative;
  white-space: nowrap;
  width: 100%;
}

.nav > a {
  background: var(--panel);
  border: 1px solid var(--line);
  font-weight: 800;
}

.nav-menu a {
  min-width: 0;
  overflow: hidden;
  padding-left: 18px;
  text-overflow: ellipsis;
  width: 100%;
}

.nav a:hover,
.nav a.active {
  background: var(--panel-2);
  color: var(--text);
}

.nav a.active::before {
  background: var(--accent);
  border-radius: 999px;
  bottom: 8px;
  content: "";
  left: 6px;
  position: absolute;
  top: 8px;
  width: 3px;
}

.menu-button {
  background: transparent;
  border: 0;
  display: block;
  height: 40px;
  padding: 8px;
  width: 40px;
}

.menu-button span {
  background: var(--text);
  display: block;
  height: 2px;
  margin: 5px 0;
}

.shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 28px 32px 72px 300px;
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  min-height: 470px;
}

.hero-copy {
  align-content: center;
  background:
    linear-gradient(120deg, rgba(8, 124, 123, 0.13), transparent 48%),
    linear-gradient(0deg, #ffffff, #ffffff);
  border: 1px solid var(--line);
  border-radius: 8px;
  container-type: inline-size;
  display: grid;
  min-width: 0;
  overflow: hidden;
  padding: 42px;
}

html[data-theme="midnight"] .hero-copy {
  background:
    linear-gradient(120deg, rgba(56, 198, 163, 0.14), transparent 48%),
    linear-gradient(0deg, var(--panel), var(--panel));
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(38px, 5vw, 68px);
  letter-spacing: 0;
  line-height: 1.02;
  margin-bottom: 18px;
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(40px, 12cqw, 68px);
  max-width: 100%;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 27px;
  letter-spacing: 0;
  margin-bottom: 14px;
}

h3 {
  font-size: 17px;
  letter-spacing: 0;
  margin-bottom: 10px;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-copy p {
  max-width: 680px;
}

.hero-contrast {
  color: var(--text) !important;
  font-size: 20px;
  font-weight: 850;
}

.feature-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.feature-strip div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.feature-strip span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.button {
  align-items: center;
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
}

.button:hover {
  background: var(--cs-scope-cyan);
  border-color: var(--cs-scope-cyan);
  color: var(--cs-deep-navy);
}

.button.secondary {
  background: #fff;
  color: var(--text);
}

.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="midnight"] .button.secondary {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text);
}

.button.accent {
  background: var(--accent);
  border-color: var(--accent);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.market-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.market-panel {
  display: grid;
  gap: 18px;
  grid-template-rows: auto 1fr;
  padding: 22px;
}

.chart-card {
  background: #101820;
  border-radius: 8px;
  color: #fff;
  min-height: 238px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.sparkline {
  height: 154px;
  width: 100%;
}

.sparkline path.line {
  fill: none;
  stroke: #38c6a3;
  stroke-linecap: round;
  stroke-width: 3;
}

.sparkline path.area {
  fill: rgba(56, 198, 163, 0.16);
}

.metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 14px;
}

.metric small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 21px;
}

.section {
  margin-top: 26px;
}

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

.section-head p {
  margin-bottom: 0;
}

.token-header {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.token-title {
  min-width: 0;
}

.token-title h1 {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 8px;
  max-width: 100%;
}

.token-title p {
  max-width: 720px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-actions {
  align-items: stretch;
  display: grid;
  gap: 10px;
  justify-items: stretch;
  margin-top: 24px;
  min-width: 158px;
}

.token-actions .button {
  justify-content: center;
  width: 100%;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  padding: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
}

.token-row,
.flow-row,
.whale-row,
.whale-holder-row,
.tx-row,
.holding-row,
.supporter-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  min-height: 62px;
  padding: 10px 0;
}

.token-row:last-child,
.flow-row:last-child,
.whale-row:last-child,
.whale-holder-row:last-child,
.tx-row:last-child,
.holding-row:last-child,
.supporter-row:last-child {
  border-bottom: 0;
}

.token-row {
  grid-template-columns: 1.5fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr;
}

.token-row.market-row {
  grid-template-columns: var(
    --market-columns,
    minmax(180px, 1.6fr)
    repeat(4, minmax(86px, 0.75fr))
    minmax(100px, 0.85fr)
    minmax(100px, 0.85fr)
    minmax(80px, 0.7fr)
    minmax(80px, 0.7fr)
    minmax(80px, 0.65fr)
    minmax(74px, 0.65fr)
  );
  min-width: 1120px;
}

.table-label button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  padding: 0;
  text-align: left;
}

.token-main {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.token-logo {
  align-items: center;
  border-radius: 8px;
  color: #fff;
  display: grid;
  flex: 0 0 38px;
  font-size: 13px;
  font-weight: 850;
  height: 38px;
  place-items: center;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.24) 0 18%, transparent 19%),
    linear-gradient(135deg, var(--token-color, #6b7280), color-mix(in srgb, var(--token-color, #6b7280) 72%, #000));
  width: 38px;
}

.token-main strong,
.token-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-main small,
.muted,
.table-label {
  color: var(--muted);
  font-size: 13px;
}

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

.negative {
  color: var(--bad);
  font-weight: 750;
}

.warning {
  color: var(--warn);
  font-weight: 750;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
}

#market-list,
.market-table-scroll,
.table-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

#market-list .token-row,
.market-table-scroll .token-row,
.table-scroll .flow-row,
.table-scroll .whale-row,
.table-scroll .whale-holder-row,
.table-scroll .holding-row,
.table-scroll .tx-row {
  width: max-content;
}

#market-list .token-row.market-row,
.market-table-scroll .token-row.market-row {
  width: 1180px;
}

#market-list::-webkit-scrollbar,
.market-table-scroll::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar {
  height: 8px;
}

#market-list::-webkit-scrollbar-thumb,
.market-table-scroll::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.control-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.input,
.select,
.textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
}

html[data-theme="midnight"] .input,
html[data-theme="midnight"] .select,
html[data-theme="midnight"] .textarea {
  background: #0d1117;
  color: var(--text);
}

.input {
  min-width: 230px;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  width: 100%;
}

.segmented {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  padding: 3px;
}

.segmented.wrap {
  flex-wrap: wrap;
}

.segmented button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
  min-height: 34px;
  padding: 7px 12px;
}

.segmented button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(31, 45, 55, 0.1);
}

html[data-theme="midnight"] .segmented button.active {
  background: var(--panel);
}

.badge {
  background: var(--panel-2);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  padding: 7px 9px;
}

.badge.pro {
  background: rgba(8, 124, 123, 0.12);
  color: var(--accent);
}

.badge.alert {
  background: rgba(200, 77, 47, 0.12);
  color: var(--accent-2);
}

.price-card {
  display: grid;
  gap: 14px;
}

.price {
  align-items: baseline;
  display: flex;
  gap: 7px;
}

.price strong {
  font-size: 36px;
}

.feature-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
}

.feature-list li {
  align-items: start;
  color: var(--muted);
  display: grid;
  gap: 8px;
  grid-template-columns: 18px 1fr;
  line-height: 1.5;
  list-style: none;
}

.feature-list li::before {
  color: var(--accent);
  content: "✓";
  font-weight: 900;
}

.compare-table {
  border-collapse: collapse;
  width: 100%;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
}

.compare-table th {
  color: var(--muted);
  font-size: 13px;
}

.flow-row {
  grid-template-columns: 1.1fr 0.8fr 0.8fr 1fr 0.8fr;
  min-width: 760px;
}

.whale-row {
  grid-template-columns: 0.8fr 1fr 1fr 0.9fr 0.7fr 1fr;
  min-width: 880px;
}

.whale-holder-row {
  grid-template-columns: 0.45fr 1.4fr 0.9fr 0.9fr;
  min-width: 680px;
}

.tx-row {
  grid-template-columns: 1fr 1fr 0.8fr 0.8fr;
}

.holding-row {
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr;
}

.supporter-row {
  grid-template-columns: 0.8fr 0.8fr 1fr;
}

.sector-tabs {
  margin-bottom: 14px;
}

.sector-card p {
  color: var(--muted);
}

.flow-bars {
  display: grid;
  gap: 14px;
}

.flow-bar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 210px 1fr;
}

.flow-bar small {
  display: block;
  margin-top: 3px;
}

.locked-row {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.data-required {
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.data-required h3 {
  margin-bottom: 0;
}

.status-step {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.status-dot {
  background: var(--line);
  border-radius: 999px;
  height: 12px;
  width: 12px;
}

.status-step.done .status-dot {
  background: var(--good);
}

.payment-box {
  background: #101820;
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.address {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #d9f5ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  padding: 12px;
}

.qr {
  background:
    linear-gradient(90deg, #fff 12px, transparent 12px) 0 0 / 24px 24px,
    linear-gradient(#fff 12px, transparent 12px) 0 0 / 24px 24px,
    #101820;
  border: 12px solid #fff;
  border-radius: 8px;
  height: 148px;
  width: 148px;
}

.notice {
  background: rgba(183, 121, 31, 0.12);
  border: 1px solid rgba(183, 121, 31, 0.28);
  border-radius: 8px;
  color: #6f470d;
  padding: 14px;
}

.chart-host {
  height: 300px;
  min-height: 300px;
  width: 100%;
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 14px;
}

.skeleton-table {
  display: grid;
  gap: 10px;
}

.skeleton-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--cols), minmax(48px, 1fr));
}

.skeleton-row span {
  animation: shimmer 1.2s infinite linear;
  background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2));
  background-size: 200% 100%;
  border-radius: 8px;
  min-height: 34px;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.pie {
  aspect-ratio: 1;
  background: conic-gradient(#087c7b 0 48%, #c84d2f 48% 66%, #3f6f9f 66% 79%, #9a6f27 79% 91%, #5965a8 91% 100%);
  border-radius: 999px;
  margin: 0 auto 16px;
  max-width: 220px;
}

html[data-theme="midnight"] .notice {
  background: rgba(242, 195, 107, 0.12);
  border-color: rgba(242, 195, 107, 0.28);
  color: #f7d994;
}

.tabs {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.tabs a {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 780;
  min-height: 38px;
  padding: 9px 12px;
  white-space: nowrap;
}

.tabs a.active,
.tabs a:hover {
  background: var(--panel-2);
  color: var(--text);
}

.roadmap {
  display: grid;
  gap: 0;
  position: relative;
}

.roadmap-item {
  display: grid;
  gap: 14px;
  grid-template-columns: 26px 1fr;
  padding: 0 0 18px;
  position: relative;
}

.roadmap-item::before {
  background: var(--line);
  bottom: 0;
  content: "";
  left: 9px;
  position: absolute;
  top: 20px;
  width: 2px;
}

.roadmap-item:last-child::before {
  display: none;
}

.roadmap-marker {
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: 999px;
  height: 20px;
  margin-top: 6px;
  width: 20px;
}

.roadmap-body {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.roadmap-item.status-completed .roadmap-marker {
  border-color: var(--good);
}

.roadmap-item.status-inProgress .roadmap-marker {
  border-color: var(--warn);
}

.status-badge,
.health-badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 8px;
}

.status-badge.completed,
.health-badge.operational {
  background: rgba(22, 134, 90, 0.13);
  color: var(--good);
}

.status-badge.inProgress {
  background: rgba(183, 121, 31, 0.15);
  color: var(--warn);
}

.status-badge.planned,
.health-badge.pending {
  background: rgba(102, 114, 125, 0.14);
  color: var(--muted);
}

.status-badge.down,
.health-badge.down {
  background: rgba(195, 57, 57, 0.14);
  color: var(--bad);
}

.roadmap-item h3 {
  margin-top: 12px;
}

.section-head.compact {
  align-items: start;
  margin-bottom: 18px;
}

.progress-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.module-status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-status-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.module-status-card h3 {
  font-size: 18px;
  margin: 0;
}

.module-status-head,
.module-status-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-status-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.progress-track {
  background: var(--line);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-track span {
  background: linear-gradient(90deg, var(--accent), var(--good));
  display: block;
  height: 100%;
}

.sponsor-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  padding: 22px;
}

.sponsor-hero h2 {
  font-size: 28px;
  margin: 14px 0 10px;
}

.sponsor-progress-value {
  color: var(--text);
  font-size: 34px;
  font-weight: 900;
  margin: 6px 0 12px;
}

.sponsor-track {
  height: 14px;
}

.sponsor-progress-meta {
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  margin-top: 8px;
}

.sponsor-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.budget-allocation {
  border-radius: 999px;
  display: flex;
  gap: 3px;
  height: 14px;
  margin-bottom: 18px;
  overflow: hidden;
}

.budget-allocation span:nth-child(1) { background: var(--accent); }
.budget-allocation span:nth-child(2) { background: var(--accent-2); }
.budget-allocation span:nth-child(3) { background: var(--warn); }
.budget-allocation span:nth-child(4) { background: var(--good); }
.budget-allocation span:nth-child(5) { background: var(--muted); }

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

.budget-category {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.budget-category-head {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto;
}

.budget-category-head h3,
.research-plan-card h3 {
  margin: 0 0 8px;
}

.budget-category-head p,
.research-plan-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.budget-items {
  display: grid;
  gap: 8px;
}

.budget-item {
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 92px 72px;
  padding: 12px;
}

.budget-item small {
  color: var(--muted);
  display: block;
  line-height: 1.45;
  margin-top: 5px;
}

.research-plan-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
}

.account-strip {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 12px;
}

.empty {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  min-height: 120px;
  place-items: center;
  text-align: center;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 0 18px;
    gap: 12px;
  }

  .brand {
    flex-basis: 178px;
    min-width: 0;
  }

  .brand-logo {
    height: 40px;
    max-width: 178px;
  }

  .brand small {
    display: none;
  }

  .top-links {
    display: none;
  }

  .nav {
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    width: min(82vw, 310px);
  }

  body.sidebar-open .nav {
    transform: translateX(0);
  }

  body.sidebar-collapsed .nav {
    transform: translateX(-100%);
  }

  .global-search {
    max-width: none;
    min-width: 0;
  }

  .language-select {
    min-width: 106px;
  }

  .theme-toggle {
    min-width: 38px;
  }

  .theme-toggle [data-theme-label] {
    display: none;
  }

  .shell,
  body.sidebar-collapsed .shell {
    padding: 20px 18px 56px;
  }

  .nav.open {
    display: grid;
  }

  /*
   * Legacy top navigation styles are intentionally disabled here;
   * the product now uses a collapsible sidebar.
   */
  .nav {
    top: 72px;
  }

  html[data-theme="midnight"] .nav {
    background: var(--panel);
  }

  .hero,
  .sponsor-hero,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .progress-summary,
  .module-status-grid,
  .roadmap {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 28px;
  }

  .feature-strip,
  .flow-bar {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    display: grid;
  }

  .token-header {
    grid-template-columns: 1fr;
  }

  .token-actions {
    display: flex;
    flex-wrap: wrap;
    margin-top: 4px;
    min-width: 0;
  }

  .token-actions .button {
    width: auto;
  }

  .sponsor-metrics,
  .budget-category-head,
  .budget-item {
    grid-template-columns: 1fr;
  }

  .token-row,
  .flow-row,
  .whale-row,
  .whale-holder-row,
  .tx-row,
  .holding-row,
  .supporter-row {
    align-items: start;
    grid-template-columns: 1fr 1fr;
  }

  .token-row > :first-child,
  .flow-row > :first-child,
  .whale-row > :first-child,
  .whale-holder-row > :first-child,
  .tx-row > :first-child,
  .holding-row > :first-child,
  .supporter-row > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .brand {
    flex: 0 1 148px;
  }

  .brand-logo {
    height: 36px;
    max-width: 148px;
  }

  .sync-status {
    max-width: 150px;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }

  .brand {
    flex-basis: 42px;
    min-width: 42px;
  }

  .brand-logo {
    height: 34px;
    max-width: 42px;
  }

  .global-search {
    min-width: 92px;
  }

  .sync-status {
    display: none;
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 38px;
  }

  .input,
  .select,
  .button {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}
