:root {
  color-scheme: dark;
  --bg: #101215;
  --panel: #181c20;
  --panel-2: #20262b;
  --line: #303842;
  --line-soft: #252b32;
  --text: #f3f0e8;
  --muted: #a8b0b8;
  --soft: #74808b;
  --green: #55d6a0;
  --amber: #e5bd5a;
  --red: #ff7b6e;
  --blue: #75b8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 20px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

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

.refresh-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.icon-button:hover {
  border-color: var(--blue);
}

.icon-button.loading .icon {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(170px, 260px);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.search-box,
.select-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
}

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

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  white-space: nowrap;
}

.segmented button.active {
  background: var(--panel-2);
  color: var(--text);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #15191d;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.pair-cell {
  min-width: 150px;
}

.pair-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.pair-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  color: #06110c;
  background: var(--green);
}

.pair-status.partial {
  background: var(--amber);
}

.pair-status.none {
  color: var(--muted);
  background: var(--panel-2);
}

.item-cell {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 220px;
}

.item-cell img {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
  background: var(--panel-2);
}

.item-name {
  display: block;
  font-weight: 700;
  line-height: 1.2;
}

.item-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.listing-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 155px;
}

.listing-link {
  display: inline-flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #15191d;
  font-size: 12px;
}

.listing-link:hover {
  border-color: var(--blue);
}

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

.empty-listing,
.empty-state {
  color: var(--soft);
  font-size: 13px;
}

.ask-value {
  white-space: nowrap;
  font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .segmented {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  h1 {
    font-size: 24px;
  }
}

.coffee-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.coffee-icon {
  font-size: 22px;
  line-height: 1.4;
  flex-shrink: 0;
}

.coffee-box p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.btc-address {
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 13px;
  word-break: break-all;
}

.site-footer {
  margin-top: 32px;
  padding: 16px 0 24px;
  border-top: 1px solid var(--line-soft);
  color: var(--soft);
  font-size: 12px;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--text);
}
