/* Toastie analytics page (analytics.html). Uses the site's tokens from styles.css. */

.an {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px) clamp(16px, 4vw, 40px) clamp(48px, 8vw, 84px);
}
.an > * + * { margin-top: clamp(18px, 3vw, 26px); }
.an__head > * + * { margin-top: 10px; }
.an__head h1 { font-size: var(--step-3); text-wrap: balance; }
.an__contract { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; color: var(--brown-soft); font-size: .92rem; }
.an__contract code { font-family: 'Space Mono', ui-monospace, monospace; font-size: .85rem; color: var(--brown); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; overflow-wrap: anywhere; word-break: break-all; }
.an__contract a, .an__disclaimer a, .an-note a, .an-method a { color: var(--gold-deep); }
.an__label { font-family: 'Space Mono', ui-monospace, monospace; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.an__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .9rem; color: var(--brown-soft); }
.an__disclaimer { max-width: 80ch; font-size: .85rem; line-height: 1.55; color: var(--brown-soft); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--surface); border: 1px solid var(--line); color: var(--brown-soft); }
.status-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill[data-state="live"] { color: #2F7A45; border-color: #BFDCC6; }
.status-pill[data-state="delayed"] { color: #8A5A16; border-color: #EBD3A6; }
.status-pill[data-state="unavailable"] { color: #A33B3B; border-color: #EDC3C3; }

/* stat cards */
.an__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.an-card { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.an-card h2 { font-family: 'Space Mono', ui-monospace, monospace; font-size: .7rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.an-card__value { margin-top: 6px; font-family: 'Fredoka', ui-rounded, system-ui, sans-serif; font-size: 1.55rem; line-height: 1.2; color: var(--brown); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.an-card__sub { margin-top: 4px; font-size: .82rem; line-height: 1.45; color: var(--brown-soft); }
.an-card__sub a { color: var(--gold-deep); }
.an-card--stale .an-card__value { opacity: .6; }

/* panels */
.an-panel { padding: clamp(16px, 3vw, 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.an-panel > * + * { margin-top: 12px; }
.an-panel h2 { font-size: var(--step-1); }
.an-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.an-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(18px, 3vw, 26px); }
.an-grid2 > .an-panel { margin-top: 0; }
.an-note { font-size: .82rem; line-height: 1.5; color: var(--brown-soft); }

.an-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.an-tabs button, .an-pager button {
  min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--cream); color: var(--brown); font: inherit; font-size: .88rem; cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.an-tabs button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--brown); font-weight: 700; }
.an-tabs button:hover, .an-pager button:hover:not(:disabled) { border-color: var(--gold); }
.an-tabs button:focus-visible, .an-pager button:focus-visible, .an-search input:focus-visible, .an-check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.an-pager button:disabled { opacity: .45; cursor: default; }

/* charts */
.an-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.an-chart { margin: 0; }
.an-chart figcaption { font-weight: 700; font-size: .92rem; color: var(--brown); }
.an-chart__box { margin-top: 8px; min-height: 190px; color: var(--brown-soft); font-size: .85rem; }
.an-chart__box svg { display: block; width: 100%; height: auto; overflow: visible; }
.an-chart__box .axis { font-family: 'Space Mono', ui-monospace, monospace; font-size: 10px; fill: var(--brown-soft); }
.an-chart__box .grid { stroke: var(--line); stroke-width: 1; }
.an-chart__box .line { fill: none; stroke: var(--gold-deep); stroke-width: 2; }
.an-chart__box .area { fill: rgba(217, 160, 82, .18); }
.an-chart__box .bar { fill: var(--gold); }
.an-chart__box .dot { fill: var(--gold-deep); }

/* distribution */
.an-dist { display: grid; gap: 8px; }
.an-dist__row { display: grid; grid-template-columns: 7.5em 1fr 4.2em; align-items: center; gap: 10px; font-size: .85rem; }
.an-dist__label { color: var(--brown-soft); font-variant-numeric: tabular-nums; }
.an-dist__bar { height: 12px; border-radius: 6px; background: var(--cream); border: 1px solid var(--line); overflow: hidden; }
.an-dist__bar span { display: block; height: 100%; background: var(--gold); }
.an-dist__n { text-align: right; font-variant-numeric: tabular-nums; }
.an-conc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.an-conc div { padding: 10px 12px; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; }
.an-conc dt { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brown-soft); }
.an-conc dd { margin: 2px 0 0; font-family: 'Fredoka', ui-rounded, system-ui, sans-serif; font-size: 1.2rem; font-variant-numeric: tabular-nums; }

/* tables */
.an-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
.an-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.an-table th, .an-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.an-table thead th { position: sticky; top: 0; background: var(--cream); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brown-soft); }
.an-table tbody tr:last-child td, .an-table tbody tr:last-child th { border-bottom: 0; }
.an-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.an-table code, .an-addr { font-family: 'Space Mono', ui-monospace, monospace; font-size: .8rem; }
.an-table a { color: var(--gold-deep); }
.an-table--kv th { width: 46%; font-weight: 500; color: var(--brown-soft); white-space: normal; }
.an-table--kv td { text-align: right; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.an-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; background: var(--cream); border: 1px solid var(--line); color: var(--brown-soft); }
.an-tag--buy { color: #2F7A45; border-color: #BFDCC6; }
.an-tag--sell { color: #A33B3B; border-color: #EDC3C3; }
.an-tag--infra, .an-tag--dead { color: var(--gold-deep); border-color: #EBD3A6; }
.an-tag--treasury { color: var(--brown); border-color: var(--gold); }

.an-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.an-search input { min-height: 44px; width: min(320px, 80vw); padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); color: var(--brown); font: inherit; font-size: .9rem; }
.an-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .88rem; color: var(--brown-soft); cursor: pointer; }
.an-check input { width: 18px; height: 18px; accent-color: var(--gold-deep); }
.an-pager { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: .85rem; color: var(--brown-soft); }

.an-method dl { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 10px 20px; margin: 0; }
.an-method dt { font-weight: 700; color: var(--brown); }
.an-method dd { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--brown-soft); max-width: 78ch; }
.an-method code { font-family: 'Space Mono', ui-monospace, monospace; font-size: .8em; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .an-method dl { grid-template-columns: 1fr; gap: 4px; }
  .an-method dd { margin-bottom: 10px; }
  .an-card__value { font-size: 1.35rem; }
  .an-table th, .an-table td { padding: 8px 10px; }
  .an-hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .an-tabs button, .an-pager button { transition: none; }
}

.an__icons { justify-content: flex-start; margin-top: 4px; }

/* burns page */
.an-tag--burn { color: #A0481A; border-color: #F0C9A8; }
