@font-face {
  font-family: Onest;
  src: url('./Onest-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Onest, system-ui, sans-serif;
  color: #17231d;
  background: #f4f7f4;
  --ink: #17231d;
  --muted: #4d6154;
  --line: #dce6dc;
  --green: #106c3e;
  --radius: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
:focus-visible { outline: 3px solid #007955; outline-offset: 3px; }
.skip { position: absolute; transform: translateY(-150%); z-index: 1; background: white; padding: 12px; }
.skip:focus { transform: translateY(0); }
.site-header { background: #112c22; border-bottom: 1px solid #2b493b; }
.site-header .brand span { border-color: #557465; color: #dbe9df; }
.header-inner, main { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand span { padding-left: 12px; border-left: 1px solid var(--line); font-weight: 600; color: var(--muted); }
.brand img { display: block; width: 120px; height: auto; }
main { padding-top: clamp(28px, 6vw, 64px); padding-bottom: 48px; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.welcome { max-width: 520px; margin: 8vh auto; padding: clamp(24px, 6vw, 48px); }
.welcome p { margin-bottom: 24px; }
h1 { font-size: clamp(1.85rem, 5vw, 3rem); line-height: 1.08; margin: 0; letter-spacing: -.04em; }
h2 { font-size: 1.125rem; margin: 0 0 16px; letter-spacing: -.015em; }
p { color: var(--muted); line-height: 1.5; }
.page-heading, .results-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading { margin-bottom: 24px; }
.page-heading p, .metric p, .results-heading p { margin: 8px 0 0; }
.overview { display: grid; grid-template-columns: 1.8fr 1fr; gap: 16px; margin-bottom: 16px; }
.campaign, .metric, .referrals { padding: 24px; min-width: 0; }
.metric { background: #e5f5e9; border-color: #cfe7d6; display: flex; flex-direction: column; justify-content: center; }
.metric strong { font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1; letter-spacing: -.06em; color: #115534; overflow-wrap: anywhere; }
label { display: block; color: var(--muted); font-size: .82rem; font-weight: 650; margin: 0 0 6px; }
input, select, button { font: inherit; }
input, select { width: 100%; min-width: 0; border: 1px solid #bdcec1; border-radius: 10px; background: #fcfdfc; color: var(--ink); padding: 9px 12px; min-height: 42px; }
.share { margin-top: 16px; }
.share-controls { display: flex; align-items: center; gap: 8px; }
.share-controls input { flex: 1; }
.button { min-height: 42px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; font-size: .875rem; font-weight: 650; cursor: pointer; white-space: nowrap; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover:not(:disabled) { background: #085431; }
.button-secondary { background: white; color: var(--ink); border-color: #bdcec1; }
.button-secondary:hover:not(:disabled) { background: #ecf5ed; }
.button:disabled { opacity: .55; cursor: default; }
.subtle { font-size: .875rem; }
.results-heading h2 { margin: 0; }
#filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
#filters > div { flex: 1 1 120px; }
table { width: 100%; border-collapse: collapse; margin-top: 18px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { font-size: .82rem; color: var(--muted); }
td { font-size: .9rem; }
td:first-child { font-variant-numeric: tabular-nums; }
.empty { margin: 0; padding: 24px 12px; text-align: center; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: end; margin-top: 14px; }
.pagination span { color: var(--muted); font-size: .875rem; margin-right: auto; }
.message { margin-top: 16px; }
.message:empty { display: none; }
.message:not(:empty) { border: 1px solid var(--line); background: white; padding: 12px 16px; border-radius: 10px; }
@media (max-width: 720px) {
  .results-heading { align-items: stretch; flex-direction: column; gap: 16px; }
}
@media (max-width: 580px) {
  .header-inner, main { padding-inline: 16px; }
  .brand img { width: 90px; }
  .overview { grid-template-columns: 1fr; }
  .campaign, .metric, .referrals { padding: 16px; }
  .page-heading { align-items: start; flex-wrap: wrap; gap: 12px; }
  #filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #filters input { padding-inline: 8px; }
  .pagination { flex-wrap: wrap; }
}
