:root {
  --bg: #0b0e14;
  --panel: #141a24;
  --panel-2: #1b2330;
  --border: #232c3b;
  --text: #e6edf3;
  --muted: #8b97a7;
  --accent: #d97757;      /* Claude clay */
  --accent-2: #6ea8fe;
  --green: #4ade80;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai",
    Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #18222f 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; backdrop-filter: blur(8px);
  background: rgba(11,14,20,.72); z-index: 10;
}
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  display: inline-flex; line-height: 0;
  filter: drop-shadow(0 0 12px rgba(217,119,87,.45));
}
.logo svg { display: block; }
.logo .spark {
  transform-origin: 32px 32px;
  animation: spark-spin 24s linear infinite;
}
.logo:hover .spark { animation-duration: 4s; }
@keyframes spark-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .logo .spark { animation: none; }
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: .2px; }
.sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12.5px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

.kpis {
  display: grid; gap: 14px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.kpi {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.kpi .value.accent { color: var(--accent); }
.kpi .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }

.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.toggle { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.toggle button {
  background: transparent; color: var(--muted); border: 0; cursor: pointer;
  font-size: 12.5px; padding: 5px 12px; border-radius: 7px; transition: .15s;
}
.toggle button.active { background: var(--accent); color: #1a0f0a; font-weight: 600; }

.chart-wrap { position: relative; height: 320px; margin-top: 8px; }
.chart-wrap.sm { height: 220px; }

.table-wrap { margin-top: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:hover { background: var(--panel-2); }
td.cost { color: var(--accent); font-weight: 600; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }

.foot { text-align: center; margin-top: 30px; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---- Mobile ---- */
@media (max-width: 560px) {
  .topbar { padding: 14px 16px; }
  .topbar h1 { font-size: 16px; }
  .sub { font-size: 12px; }
  .meta { display: none; }                 /* snapshot date — hide to save space */
  main { padding: 16px 12px 48px; }

  .kpis { gap: 10px; grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 12px 14px; border-radius: 12px; }
  .kpi .value { font-size: 21px; }
  .kpi .label { font-size: 11px; }

  .card { padding: 14px 14px; border-radius: 14px; }
  /* let the title and toggle stack instead of cramming on one line */
  .card-head { flex-wrap: wrap; gap: 8px; }
  .card-head .muted { flex-basis: 100%; }   /* long notes drop to their own line */

  .chart-wrap { height: 260px; }
  .chart-wrap.sm { height: 200px; }
  table { font-size: 12px; }
  th, td { padding: 7px 8px; }
}
