/* brolly-inspired plain text market stats — light + dark */

*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light dark;
  --plain-fg: #222;
  --plain-bg: #f6f6f4;
  --plain-link: #1a56db;
  --plain-muted: #666;
  --plain-rule: #999;
  --plain-border: #ccc;
  --plain-mid: #666;
  --plain-err: #c0392b;
  --plain-current-bg: rgba(26, 86, 219, 0.08);
  --plain-btn-hover: rgba(0, 0, 0, 0.06);
}

html.dark {
  --plain-fg: #d4d4d4;
  --plain-bg: #1a1a1a;
  --plain-link: #7eb6ff;
  --plain-muted: #888;
  --plain-rule: #555;
  --plain-border: #444;
  --plain-mid: #888;
  --plain-err: #f87171;
  --plain-current-bg: rgba(126, 182, 255, 0.1);
  --plain-btn-hover: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] {
  --plain-fg: #222;
  --plain-bg: #f6f6f4;
  --plain-link: #1a56db;
  --plain-muted: #666;
  --plain-rule: #999;
  --plain-border: #ccc;
  --plain-mid: #666;
  --plain-err: #c0392b;
  --plain-current-bg: rgba(26, 86, 219, 0.08);
  --plain-btn-hover: rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --plain-fg: #d4d4d4;
    --plain-bg: #1a1a1a;
    --plain-link: #7eb6ff;
    --plain-muted: #888;
    --plain-rule: #555;
    --plain-border: #444;
    --plain-mid: #888;
    --plain-err: #f87171;
    --plain-current-bg: rgba(126, 182, 255, 0.1);
    --plain-btn-hover: rgba(255, 255, 255, 0.08);
  }
}

html.skynet {
  --plain-bg: #0a0a0a;
  --plain-fg: #39ff14;
  --plain-link: #39ff14;
  --plain-muted: #1a8f1a;
  --plain-rule: #1f521f;
  --plain-border: #2a5a2a;
  --plain-mid: #2d8a2d;
  --plain-err: #ff2d2d;
  --plain-current-bg: rgba(255, 45, 45, 0.12);
  --plain-btn-hover: rgba(57, 255, 20, 0.08);
}

html {
  font-size: 12.6px; /* ~10% smaller than 14px */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 2rem 0.75rem 3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--plain-fg);
  background: var(--plain-bg);
  transition: background 0.15s ease, color 0.15s ease;
}

.page {
  width: 100%;
  margin: 0 auto;
  text-align: left;
}

.logo {
  margin: 0 0 1.25rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.32;
  white-space: pre;
  color: inherit;
  letter-spacing: 0;
}

html.skynet .logo.skynet-logo {
  color: #ff2d2d;
  text-shadow: 0 0 10px rgba(255, 45, 45, 0.35);
}

html.skynet .section {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

html.skynet .stale-banner {
  color: #ff2d2d;
  border-left-color: #ff2d2d;
}

html.skynet .tagline,
html.skynet .headline {
  color: #39ff14;
}

html.skynet table.data-table th {
  color: #39ff14;
}

html.skynet tr.current-pair td {
  background: rgba(255, 45, 45, 0.12);
}

html.skynet a:hover {
  color: #ff2d2d;
}

a {
  color: var(--plain-link);
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}
a:hover { text-decoration: underline; }

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

.tagline {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: inherit;
}

.headline {
  margin: 0 0 0.35rem;
  line-height: 1.5;
}

.nav-top {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.nav-back {
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.theme-toggle {
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--plain-border);
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.2;
  color: var(--plain-muted);
  cursor: pointer;
}
.theme-toggle:hover {
  background: var(--plain-btn-hover);
  color: var(--plain-fg);
}

.skynet-toggle {
  font-weight: 600;
  letter-spacing: 0.04em;
}

html.skynet .skynet-toggle.skynet-active,
.skynet-toggle.skynet-active {
  color: #ff2d2d;
  border-color: #ff2d2d;
  text-shadow: 0 0 6px rgba(255, 45, 45, 0.45);
}

.theme-icon-sun { display: none; }
html.dark .theme-icon-moon,
html[data-theme="dark"] .theme-icon-moon { display: none; }
html.dark .theme-icon-sun,
html[data-theme="dark"] .theme-icon-sun { display: inline; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-icon-moon { display: none; }
  html:not([data-theme="light"]) .theme-icon-sun { display: inline; }
}

.rule,
.rule-thin {
  margin: 1.1rem 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--plain-rule);
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  display: block;
  text-align: left;
  line-height: 1.2;
}

.rule-thin { margin: 0.85rem 0; }

.section {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 400;
}

.section-note {
  font-weight: 400;
}

pre.data {
  margin: 0 0 0.25rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  text-align: left;
  display: block;
  tab-size: 4;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 0 0.25rem;
}

.table-wrap .section {
  margin-top: 0;
}

.table-foot {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.88rem;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.25rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

table.data-table th,
table.data-table td {
  padding: 0;
  text-align: left;
  vertical-align: baseline;
  white-space: nowrap;
}

table.data-table th:not(:last-child),
table.data-table td:not(:last-child) {
  padding-right: 0.65rem;
}

table.data-table th {
  font-weight: 400;
  border-bottom: 1px solid var(--plain-border);
  padding-bottom: 0.15rem;
}

table.data-table td.bar-cell,
table.data-table td.spark-cell {
  font-family: inherit;
  letter-spacing: 0;
}

table.data-table td.num {
  text-align: right;
}

table.book-table th {
  text-align: right;
}

table.data-table tr.mid-row td {
  text-align: center;
  color: var(--plain-mid);
  padding: 0.2rem 0;
  white-space: normal;
}

table.data-table a {
  text-decoration: none;
}
table.data-table a:hover {
  text-decoration: underline;
}

.listings-table td.num {
  white-space: nowrap;
}

.maker-cell {
  white-space: nowrap;
}

.maker-logo {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  border-radius: 2px;
}

tr.wizard-row td {
  background: rgba(124, 58, 237, 0.1);
}

html.skynet tr.wizard-row td {
  background: rgba(255, 45, 45, 0.1);
}

html.skynet tr.wizard-row .maker-logo {
  box-shadow: 0 0 4px rgba(255, 45, 45, 0.45);
}

tr.current-pair td {
  font-weight: 600;
  background: var(--plain-current-bg);
}

.pair-nav {
  display: block;
  margin: 0 0 0.25rem;
  max-width: 100%;
  font-size: 0.88rem;
  line-height: 1.65;
}

.pair-nav a {
  display: block;
  width: fit-content;
  max-width: 100%;
}

details {
  margin: 0.5rem 0;
  font-size: 0.92rem;
}

details summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }

details pre.data {
  margin-top: 0.5rem;
}

footer {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.65;
}

footer p {
  margin: 0.35rem 0;
}

.expand-btn {
  margin: 0.5rem 0 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.expand-btn:hover { text-decoration: underline; }

.stale-banner {
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
  border-left: 3px solid #f59e0b;
}
.stale-banner.stale-alert { border-left-color: #ef4444; }
.stale-banner.stale-warn { border-left-color: #f59e0b; }

.pair-pager {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.88rem;
}

.watch-actions {
  margin: 0.25rem 0 0.5rem;
}

.share-line {
  margin: 0.35rem 0;
  font-size: 0.88rem;
}

.embed-line {
  margin: 0.35rem 0;
  font-size: 0.82rem;
  word-break: break-all;
}

.embed-code {
  font-family: inherit;
  font-size: inherit;
}

.bulletin-list {
  margin: 0;
  padding-left: 1.25rem;
  list-style: square;
}

.bulletin-list li {
  margin: 0.2rem 0;
}

.donate-head {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.heart {
  color: #ef4444;
}

.ascii-icon {
  display: inline-block;
  font-family: inherit;
  letter-spacing: 0;
  white-space: pre;
  line-height: 1;
  vertical-align: middle;
}

.ascii-stack {
  display: inline-block;
  line-height: 1.05;
  text-align: center;
}

.beer-foam { color: #fde68a; }
.beer-body { color: #d97706; }
.beer-fill { color: #f59e0b; }

.coffee-steam { color: #a8a29e; }
.coffee-cup { color: #92400e; }
.coffee-liquid { color: #78350f; }

.donate-xmr {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-all;
}

.donate-label {
  color: #ff6600;
  font-weight: 600;
}

.donate-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--plain-muted);
  cursor: pointer;
  text-align: left;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.donate-btn:hover {
  color: var(--plain-link);
  text-decoration: underline;
}

.kbd-hint {
  font-size: 0.8rem;
}

@media print {
  body { background: #fff; color: #000; padding: 1rem; }
  a { color: #000; }
  .nav-top, .nav-back, .watch-actions, .pair-pager, .kbd-hint, .expand-btn, .theme-toggle, .skynet-toggle { display: none; }
  .donate-btn { color: #000; text-decoration: none; }
  .donate-label { color: #000; }
  details { display: block; }
  details summary { display: none; }
  details pre.data { display: block !important; }
  .stale-banner { border: 1px solid #999; }
}

@media (max-width: 480px) {
  body { padding: 1.25rem 0.5rem 2.5rem; font-size: 0.85rem; }
  .page { max-width: 100%; }
  pre.data { font-size: 0.82rem; }
  .logo { font-size: 0.72rem; }
  table.data-table th:not(:last-child),
  table.data-table td:not(:last-child) {
    padding-right: 0.45rem;
  }
}
