.astat-preview {
  --astat-surface: #ffffff;
  --astat-soft: #f3f0fa;
  --astat-ink: #25212f;
  --astat-muted: #625b70;
  --astat-line: #d8d1e2;
  --astat-accent: #6941bf;
  --astat-focus: #6941bf;
  --astat-warning: #78520c;
  --astat-notice: #fff7de;
  --astat-chart: #6553ad;
  max-width: 1248px;
  margin: 0 auto;
  padding: 118px 24px 72px;
  color: var(--astat-ink);
  font-family: "DM Sans", sans-serif;
  line-height: 1.6;
}
.dark .astat-preview {
  --astat-surface: #201b2d;
  --astat-soft: #292138;
  --astat-ink: #f2edf8;
  --astat-muted: #c0b6ce;
  --astat-line: #51465e;
  --astat-accent: #c4a8ff;
  --astat-focus: #d3bdff;
  --astat-warning: #f5d38a;
  --astat-notice: #332b1d;
  --astat-chart: #b8a0f4;
}
.astat-preview *, .astat-preview *::before, .astat-preview *::after { box-sizing: border-box; }
.astat-preview a { color: inherit; }
.astat-preview a:focus-visible,
.astat-preview summary:focus-visible,
.astat-preview [tabindex]:focus-visible {
  outline: 3px solid var(--astat-focus);
  outline-offset: 4px;
}
.astat-preview code { font-family: "JetBrains Mono", monospace; font-size: .8em; overflow-wrap: anywhere; }
.astat-notice { padding: 20px 24px; border: 1px solid var(--astat-warning); border-radius: 16px; background: var(--astat-notice); }
.astat-notice strong { font-size: 1rem; }
.astat-notice p { margin: 10px 0 0; max-width: 90ch; }
.astat-connection { display: inline-block; margin: 0 0 0 12px; padding: 3px 8px; border: 1px solid currentColor; border-radius: 6px; font: .78rem "JetBrains Mono", monospace; color: var(--astat-warning); }
.astat-modes, .astat-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.astat-modes { margin-top: 24px; }
.astat-modes a, .astat-periods a, .astat-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--astat-line); border-radius: 10px; text-decoration: none; background: var(--astat-surface); font-size: .92rem; font-weight: 600; }
.astat-modes a[aria-current], .astat-periods a[aria-current], .astat-primary { background: var(--astat-soft); border-color: var(--astat-accent); color: var(--astat-accent); }
.astat-hero { padding: 36px 0 28px; }
.astat-eyebrow { margin: 0 0 14px; color: var(--astat-accent); font: .78rem "JetBrains Mono", monospace; letter-spacing: .08em; }
.astat-hero h1 { max-width: 22ch; margin: 0 0 20px; font-size: clamp(2rem, 4.5vw, 3.8rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.13; text-wrap: balance; }
.astat-intro { max-width: 74ch; color: var(--astat-muted); font-size: 1.05rem; }
.astat-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.astat-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; }
.astat-toolbar .astat-periods { margin-right: auto; }
.astat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.astat-card { display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 1px solid var(--astat-line); border-radius: 18px; background: var(--astat-surface); text-decoration: none; }
.astat-card:hover { border-color: var(--astat-accent); }
.astat-card-label { font-weight: 650; line-height: 1.4; }
.astat-card-value { display: block; padding: 16px 0 12px; font-size: 2.8rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.astat-card-value.astat-no-value { font: .96rem/1.5 "JetBrains Mono", monospace; color: var(--astat-muted); }
.astat-card-note { display: block; margin-top: 8px; color: var(--astat-muted); font-size: .82rem; }
.astat-partial { display: block; margin-top: 10px; color: var(--astat-warning); font-size: .82rem; }
.astat-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 28px 0; padding: 24px; border-top: 1px solid var(--astat-line); border-bottom: 1px solid var(--astat-line); }
.astat-metadata dt { color: var(--astat-muted); font-size: .8rem; }
.astat-metadata dd { margin: 4px 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.astat-metrics { display: grid; gap: 12px; }
.astat-detail { min-width: 0; border: 1px solid var(--astat-line); border-radius: 14px; background: var(--astat-surface); }
.astat-detail summary { min-height: 56px; padding: 18px 22px; cursor: pointer; font-weight: 600; }
.astat-summary-hint { margin-left: 16px; color: var(--astat-muted); font-size: .8rem; font-weight: 400; }
.astat-detail-body { padding: 0 22px 24px; }
.astat-detail-body h2 { font-size: 1rem; font-weight: 650; }
.astat-detail-body p { margin: 10px 0; max-width: 90ch; }
.astat-profile { margin: 24px 0; }
.astat-bars { display: flex; gap: 2px; height: 120px; padding-top: 8px; border-bottom: 1px solid var(--astat-line); }
.astat-bar-slot { display: flex; flex: 1 1 0; align-items: end; min-width: 0; }
.astat-bar { display: block; width: 100%; background: var(--astat-chart); border-radius: 2px 2px 0 0; }
.astat-bar-missing { background: repeating-linear-gradient(135deg, transparent, transparent 5px, var(--astat-line) 5px, var(--astat-line) 6px); }
.astat-profile figcaption { margin-top: 10px; color: var(--astat-muted); font-size: .8rem; }
.astat-table-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--astat-line); border-radius: 10px; }
.astat-preview table { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; }
.astat-preview caption { text-align: left; padding: 14px; color: var(--astat-muted); }
.astat-preview th, .astat-preview td { padding: 12px 14px; border-top: 1px solid var(--astat-line); text-align: left; overflow-wrap: anywhere; }
.astat-preview thead th { position: sticky; top: 0; background: var(--astat-soft); font-weight: 650; }
.astat-preview tbody th { font-weight: 400; white-space: nowrap; }
.astat-preview td:nth-child(2) { text-align: right; }
.astat-method { margin-top: 36px; padding: 26px; border-radius: 16px; background: var(--astat-soft); }
.astat-method h2 { margin: 0 0 14px; font-size: 1.4rem; font-weight: 650; }
.astat-method p { margin: 12px 0 0; max-width: 95ch; }
@media (max-width: 850px) {
  .astat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .astat-summary-hint { display: block; margin: 8px 0 0; }
}
@media (max-width: 520px) {
  .astat-preview { padding: 104px 16px 48px; }
  .astat-notice { padding: 16px; }
  .astat-connection { margin: 8px 0 0; }
  .astat-cards, .astat-metadata { grid-template-columns: minmax(0, 1fr); }
  .astat-card { padding: 20px; }
  .astat-metadata { padding: 20px 0; }
  .astat-toolbar .astat-periods { width: 100%; }
  .astat-periods a { flex: 1; }
  .astat-detail summary { padding: 16px; }
  .astat-detail-body { padding: 0 12px 20px; }
  .astat-preview th, .astat-preview td { padding: 10px 8px; }
  .astat-method { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .astat-preview *, .astat-preview *::before, .astat-preview *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .astat-preview { padding: 12px 0; color: #111; }
  .astat-modes, .astat-toolbar, .astat-actions { display: none; }
  .astat-table-scroll { max-height: none; overflow: visible; }
}
