:root {
  color-scheme: dark;
  --bg: #071017;
  --bg-deep: #03080d;
  --surface: #0d1821;
  --surface-2: #111f2a;
  --surface-3: #162734;
  --line: #223544;
  --line-soft: rgba(118, 147, 168, 0.18);
  --text: #eef6f8;
  --muted: #90a0ab;
  --faint: #5d6f7d;
  --good: #00f0a8;
  --good-2: #23c483;
  --bad: #ff5c73;
  --warn: #ffc857;
  --cyan: #4fb4ff;
  --none: #738390;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 62% 4%, rgba(0, 240, 168, 0.12), transparent 28rem),
    linear-gradient(180deg, #07111a 0%, #03080d 58%, #020609 100%);
  color: var(--text);
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: rgba(5, 13, 21, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 8px 24px;
  font-weight: 900;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 240, 168, 0.42);
  border-radius: 12px;
  background: rgba(0, 240, 168, 0.1);
  color: var(--good);
  box-shadow: 0 0 28px rgba(0, 240, 168, 0.14);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 720;
}

.side-nav a span {
  width: 18px;
  color: var(--faint);
  text-align: center;
}

.side-nav a.is-active {
  background: rgba(0, 240, 168, 0.13);
  color: var(--good);
}

.side-nav a.is-active span {
  color: var(--good);
}

.top-updated,
.eyebrow,
.kicker {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 12, 18, 0.82);
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(13, 24, 33, 0.72);
  color: var(--muted);
  white-space: nowrap;
}

.top-updated strong {
  color: var(--text);
  font-size: 0.9rem;
  letter-spacing: 0;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(13, 24, 33, 0.78);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 18px var(--good);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.16rem;
  font-weight: 900;
}

main {
  display: grid;
  gap: 14px;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 24, 33, 0.84);
  box-shadow: var(--shadow);
}

.kicker {
  color: var(--good);
}

h1 {
  margin: 8px 0 8px;
  font-size: clamp(2.1rem, 4.4vw, 4.7rem);
  line-height: 0.96;
  font-weight: 920;
}

h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.15;
}

.panel {
  padding: 20px;
}

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

.soft-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(0, 240, 168, 0.34);
  border-radius: 999px;
  background: rgba(0, 240, 168, 0.08);
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 850;
}

.add-panel {
  display: grid;
  gap: 13px;
}

.add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

.add-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(3, 9, 14, 0.76);
  color: var(--text);
  padding: 0 16px;
  text-transform: uppercase;
  font-weight: 760;
}

.add-form input:focus {
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(0, 240, 168, 0.1);
}

.add-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--good);
  color: #02110c;
  font-weight: 920;
}

.coin-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  max-height: 230px;
  overflow: auto;
}

.coin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 40px;
  padding: 0 5px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 31, 42, 0.86);
  color: var(--muted);
  font-weight: 820;
}

.coin-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.coin-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--good);
}

.coin-toggle.is-on {
  border-color: rgba(0, 240, 168, 0.52);
  background: rgba(0, 240, 168, 0.1);
  color: var(--text);
}

.coin-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  font-size: 1rem;
  font-weight: 900;
}

.coin-remove:hover {
  background: rgba(255, 92, 115, 0.14);
  color: var(--bad);
}

.coin-empty {
  width: 100%;
}

.exchange-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.exchange-tabs span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.status-list {
  min-width: 0;
}

.change-note {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(3, 9, 14, 0.38);
}

.change-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.change-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.change-more {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 39, 52, 0.68);
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 900;
}

.change-main,
.change-empty {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
}

.change-list {
  display: grid;
  gap: 8px;
}

.change-row {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
}

.change-row time {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 780;
}

.change-target {
  color: var(--text);
}

.change-value {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 950;
}

.change-value.good {
  background: rgba(0, 240, 168, 0.1);
  color: var(--good);
}

.change-value.bad {
  background: rgba(255, 92, 115, 0.12);
  color: var(--bad);
}

.change-value.unknown {
  background: rgba(255, 200, 87, 0.1);
  color: var(--warn);
}

.change-arrow,
.change-separator,
.change-network {
  color: var(--muted);
  font-weight: 850;
}

.change-separator {
  margin: 0 6px;
}

.status-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 9, 14, 0.5);
}

.status-row {
  display: grid;
  grid-template-columns: minmax(126px, 0.72fr) repeat(4, minmax(160px, 1fr));
  align-items: stretch;
  gap: 0;
  min-height: 76px;
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-head {
  min-height: 44px;
  background: rgba(22, 39, 52, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.status-row > div {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid var(--line-soft);
}

.status-row > div:last-child {
  border-right: 0;
}

.status-head > div {
  padding-top: 0;
  padding-bottom: 0;
}

.token-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.token-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 240, 168, 0.14);
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 950;
}

.exchange-summary {
  display: grid;
  align-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.exchange-summary.not-listed {
  align-content: center;
}

.network-chip {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 860;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-mark {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.mini-mark.good {
  background: rgba(0, 240, 168, 0.08);
  color: var(--good);
}

.mini-mark.bad {
  background: rgba(255, 92, 115, 0.1);
  color: var(--bad);
}

.mini-mark.unknown {
  background: rgba(255, 200, 87, 0.1);
  color: var(--warn);
}

.mini-mark.none {
  background: rgba(115, 131, 144, 0.13);
  color: var(--none);
}

.empty,
.error {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(3, 9, 14, 0.38);
  color: var(--muted);
  text-align: center;
}

.empty-market {
  display: grid;
  gap: 6px;
}

.empty-market strong {
  color: var(--text);
}

.empty-market span {
  color: var(--muted);
}

.error {
  color: var(--bad);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
  }

  .sidebar {
    position: sticky;
    z-index: 20;
    height: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 0 6px 10px;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .side-nav a {
    white-space: nowrap;
  }

}

@media (max-width: 720px) {
  main {
    padding: 14px;
  }

  .topbar {
    min-height: 54px;
    padding: 8px 12px;
  }

  .panel {
    padding: 16px;
  }

  .panel-head {
    display: grid;
  }

  .exchange-tabs {
    justify-content: flex-start;
  }

  .add-form {
    grid-template-columns: 1fr;
  }

  .status-table {
    display: grid;
    gap: 10px;
    border: 0;
    background: transparent;
  }

  .status-head {
    display: none;
  }

  .status-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-height: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(3, 9, 14, 0.48);
  }

  .status-row > div {
    display: grid;
    gap: 7px;
    padding: 0;
    border-right: 0;
  }

  .token-cell {
    grid-column: 1 / -1;
    display: flex;
  }

  .status-row:not(.status-head) > div:nth-child(2)::before,
  .status-row:not(.status-head) > div:nth-child(3)::before,
  .status-row:not(.status-head) > div:nth-child(4)::before,
  .status-row:not(.status-head) > div:nth-child(5)::before {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
  }

  .status-row:not(.status-head) > div:nth-child(2)::before {
    content: "Bitget";
  }

  .status-row:not(.status-head) > div:nth-child(3)::before {
    content: "Gate.io";
  }

  .status-row:not(.status-head) > div:nth-child(4)::before {
    content: "KuCoin";
  }

  .status-row:not(.status-head) > div:nth-child(5)::before {
    content: "Aster";
  }

  .network-cell {
    white-space: normal;
  }

  .change-head {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .status-strip {
    display: none;
  }

  h1 {
    font-size: 2.15rem;
  }

  .top-updated {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
