* { margin: 0; padding: 0; box-sizing: border-box; font-family: Satoshi, ui-sans-serif, system-ui, sans-serif; }

/* the hidden attribute must beat .container's display:flex, or the empty card flashes on load */
[hidden] { display: none !important; }

:root {
  --bg: #141515;
  --box: #1f2020;
  --box-2: #2d2e2e;
  --box-shaded: rgba(0, 0, 0, 0.25);
  --text-primary: #dcdde0;
  --text-secondary: hsla(225, 6%, 87%, 0.6);
  --text-tertiary: hsla(225, 6%, 87%, 0.4);
  --green: #60d8a4;
  --yellow: #f4bb3b;
  --red: #ff5a5a;
  --blue: #1682fe;
  /* categorical series (validated for dark surface) */
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #9085e9;
  --s-other: #6f7273;
}

body {
  background-color: var(--bg);
  /* mosaic of 144 llamas, pre-composed and dimmed at build time (single 88KB asset) */
  background-image: radial-gradient(ellipse 120% 90% at 50% 40%, rgba(20, 21, 21, 0.25), rgba(20, 21, 21, 0.85)),
    url("/mosaic.jpg");
  background-attachment: fixed;
  background-position: center;
  color: var(--text-primary);
  min-height: 100vh;
}

.page { display: flex; min-height: 100vh; padding: 2.5rem 1rem; }

.container {
  margin: auto;
  width: 660px;
  max-width: 100%;
  background: var(--box);
  border: 1px solid #2a2b2b;
  border-radius: 10px;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.7));
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.error { margin: auto; color: var(--red); font-size: 14px; }

/* header */
.header { display: flex; align-items: center; gap: 0.9rem; }
.logo { width: 44px; height: 44px; border-radius: 50%; }
h1 { font-size: 20px; font-weight: 900; }
.subtitle { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }

/* hero */
.hero { text-align: center; padding: 0.25rem 0 0; }
.hero-label { font-size: 13px; color: var(--text-secondary); }
.hero-value { font-size: 52px; font-weight: 900; line-height: 1.15; letter-spacing: -0.5px; }
.hero-sub { font-size: 13px; color: var(--text-tertiary); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.stat {
  background: var(--box-shaded);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label { font-size: 12px; color: var(--text-secondary); }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--text-tertiary); }
.stat-value.na { color: var(--text-tertiary); font-weight: 500; }

.premium-line { text-align: center; font-size: 14px; color: var(--text-secondary); margin-top: -0.5rem; }
.premium-line .pct { font-weight: 700; font-size: 15px; }
.good { color: var(--green); }
.warn { color: var(--yellow); }
.bad { color: var(--red); }

/* panels */
.panel { display: flex; flex-direction: column; gap: 0.75rem; }
.panel-title h2 { font-size: 16px; font-weight: 700; }
.panel-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.panel-desc a { color: var(--text-tertiary); }
.panel-desc a:hover { color: var(--text-secondary); }

/* composition bar */
.compbar {
  display: flex;
  height: 22px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px; /* surface gap between segments */
  background: var(--box);
}
.compbar .seg { min-width: 3px; }
.compbar .seg:hover { opacity: 0.85; }
.complegend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 12px; color: var(--text-secondary); }
.complegend .key { display: inline-flex; align-items: center; gap: 6px; }
.complegend .swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: right;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #2a2b2b;
}
.table td { text-align: right; padding: 0.45rem 0.5rem; font-variant-numeric: tabular-nums; }
.table th:first-child, .table td:first-child { text-align: left; }
.table td:first-child { color: var(--text-primary); font-weight: 700; }
.table .asset-sub { display: block; font-size: 11px; color: var(--text-tertiary); font-weight: 400; }
.table tbody tr:last-child { background: var(--box-shaded); }
.table tbody tr:last-child td { font-weight: 700; }
.table td.muted, .table span.muted { color: var(--text-tertiary); font-weight: 400; }
.table td .swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 7px; }

.footnote { font-size: 12px; color: var(--text-tertiary); }

.table-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0 0.5rem;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.table-toggle:hover { color: var(--text-primary); text-decoration: underline; }

/* footer */
.footer { display: flex; flex-direction: column; gap: 0.4rem; border-top: 1px solid #2a2b2b; padding-top: 1rem; }
.updated { font-size: 12px; color: var(--text-tertiary); }
.links { display: flex; gap: 1rem; font-size: 13px; }
.links a { color: var(--text-secondary); text-decoration: none; }
.links a:hover { color: var(--text-primary); text-decoration: underline; }
.disclaimer { font-size: 11px; color: var(--text-tertiary); }

/* tooltip */
.tooltip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: var(--box-2);
  border: 1px solid #3a3b3b;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 12px;
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.tooltip .tt-title { font-weight: 700; }
.tooltip .tt-sub { color: var(--text-secondary); }

@media (max-width: 480px) {
  .container { padding: 1rem; }
  .hero-value { font-size: 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .table { font-size: 12px; }
}
