/* Plus Jakarta Sans (SIL Open Font License, fonts/OFL.txt), served from here, as on the website */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* The design guide's tokens (design/README.md). No dark mode, as on the website. */
:root {
  --bg: #fff;
  --fg: #17172b;
  --muted: #5c5c70;
  --line: #ececf2;
  --night: #0a0a0a;
  --sage: #3fbf8f;
  --mist: #d4d4d4;
  /* chart marks: a deeper sage, so bars keep 3:1 against white */
  --mark: #2f9e75;
  --track: color-mix(in srgb, var(--mark) 12%, var(--bg));

  --gutter: clamp(1rem, 4vw, 3rem);
  --label-col: clamp(6rem, 14vw, 11rem);
  --sans: "Plus Jakarta Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
}

.band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background: var(--night);
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; font-weight: 600; }
.brand em { font-style: normal; font-weight: 300; opacity: 0.7; }
.who { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; min-width: 0; }
.who[hidden] { display: none; }
.who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.8; }

.link {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

main { padding: 0 var(--gutter) 4rem; }
[hidden] { display: none !important; }

.sign-in { max-width: 28rem; margin: 5rem auto; }
.sign-in h1 { margin: 0 0 0.5rem; font-size: 1.625rem; font-weight: 400; }
.sign-in p { color: var(--muted); }
.message { min-height: 1.6em; margin-top: 1rem; }

/* forms: underline inputs and pill buttons, as on the website */
.ask, .enter, .add-admin { display: grid; gap: 1.25rem; margin-top: 2rem; justify-items: start; }
.add-admin { grid-template-columns: minmax(0, 22rem) auto; align-items: end; margin-top: 1.5rem; }
.field { display: grid; gap: 0.35rem; width: 100%; }
.field span { font-size: 0.8125rem; letter-spacing: 0.04em; color: var(--muted); }
.field input {
  width: 100%;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1.125rem;
}
.field input:focus { outline: none; border-bottom-color: var(--fg); }
.enter input { letter-spacing: 0.08em; font-family: Menlo, Consolas, monospace; }

.button {
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--fg);
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.button:hover { background: transparent; color: var(--fg); }
.button:disabled { opacity: 0.5; cursor: wait; }
.button:focus-visible, .link:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.again { color: var(--muted); font-size: 0.875rem; }
.admins .link { color: var(--muted); font-size: 0.875rem; }

.label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.row {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.row .label { padding-top: 0.35rem; }

@media (max-width: 40rem) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-block: 2rem; }
}

.note { margin: 0 0 1.25rem; font-size: 0.875rem; color: var(--muted); }

/* stat tiles: one hero number, then the rest */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
}

.tile {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--mist) 25%, var(--bg));
}

.tile.hero { background: color-mix(in srgb, var(--sage) 12%, var(--bg)); }
.tile-label { font-size: 0.875rem; color: var(--muted); }
.tile-value { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero .tile-value { font-size: 3.25rem; }

/* signups per day: columns, hairline grid */
.chart { margin: 0; }
.chart figcaption { margin-bottom: 1rem; font-size: 0.875rem; color: var(--muted); }
.columns { position: relative; }
.columns svg { display: block; width: 100%; height: auto; overflow: visible; }
.columns .grid { stroke: var(--line); stroke-width: 1; }
.columns .tick { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.columns .bar { fill: var(--mark); }
.columns .hit { fill: transparent; cursor: default; }
.columns .hit:hover + .bar, .columns .bar.on { fill: color-mix(in srgb, var(--mark) 80%, var(--fg)); }

.as-table { margin-top: 1rem; font-size: 0.875rem; }
.as-table summary { cursor: pointer; color: var(--muted); }

/* devices: a card per kind, its systems as bars with the value at the tip */
.device-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.device {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.device h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 1rem; font-size: 1.125rem; font-weight: 400; }
.device h3 strong { font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.os { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 2.5rem; align-items: center; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.875rem; }
.os-name { color: var(--muted); }
.size-card { max-width: 32rem; }
.size-card .os { grid-template-columns: 6.5rem minmax(0, 1fr) 2.5rem; }
.os-count { text-align: right; font-variant-numeric: tabular-nums; }
.os-track { height: 16px; border-radius: 4px; background: var(--track); }
.os-bar { height: 100%; min-width: 0; border-radius: 0 4px 4px 0; background: var(--mark); }
.os-bar[data-zero] { display: none; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; color: var(--muted); white-space: nowrap; }
td { padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.recent td:first-child { white-space: nowrap; color: var(--muted); }
.pill {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mist) 45%, var(--bg));
  font-size: 0.8125rem;
  white-space: nowrap;
}
.pill.business { background: color-mix(in srgb, #ffc23d 30%, var(--bg)); }

.updated { margin-top: 1.5rem; }

.tooltip {
  position: fixed;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8125rem;
  line-height: 1.45;
  pointer-events: none;
  white-space: nowrap;
}
