/* The admin site (lib/src/web/admin/), in the look of the app and the legal
   pages: DM Sans, black, white and the lime for what's selected. */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/dm-sans-latin-ext.woff2) format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/dm-sans-latin.woff2) format('woff2');
  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;
}

:root {
  --lime: #d6e81e;
  --black: #0a0a0a;
  --paper: #f5f5f5;
  --white: #fff;
  --grey: #e9e9e9;
  --muted: #5c5c5c;
  --muted-on-black: #a8a8a8;
  --bad: #c62828;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--black);
}

a { color: inherit; text-underline-offset: 2px; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* The floating black bar, like the landing site's header. */
.bar {
  position: sticky;
  top: 8px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  margin: 8px;
  padding: 10px 18px;
  border-radius: 24px;
  background: var(--black);
  color: var(--white);
}

.bar a { text-decoration: none; }
.brand { font-weight: 700; letter-spacing: -0.02em; }
.brand span, .login h1 span { color: var(--lime); }
.bar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.bar nav a { padding: 4px 12px; border-radius: 999px; color: var(--muted-on-black); }
.bar nav a:hover { color: var(--white); }
.bar nav a.on { background: var(--lime); color: var(--black); font-weight: 600; }
.out { color: var(--muted-on-black); }

main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 64px; }

h1 { margin: 16px 0 4px; font-size: 28px; letter-spacing: -0.02em; line-height: 1.2; }
h2 { margin: 0 0 4px; font-size: 17px; }
h3 { margin: 0 0 8px; font-size: 15px; }
.sub, .note, .muted, .empty { color: var(--muted); }
.sub { margin: 0 0 16px; }
.note { margin: 0 0 12px; font-size: 13px; }
.empty { margin: 8px 0 0; }

section {
  margin: 16px 0;
  padding: 18px;
  border-radius: 20px;
  background: var(--white);
}

.notice {
  margin: 12px 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--lime);
  font-weight: 600;
}
.notice.bad { background: var(--bad); color: var(--white); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.tile { display: flex; flex-direction: column; padding: 16px 18px; border-radius: 20px; background: var(--white); }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.tile .detail { color: var(--muted); font-size: 13px; }

.choices { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.choices a {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--white);
  text-decoration: none;
  font-size: 14px;
}
.choices a.on { background: var(--black); color: var(--lime); font-weight: 600; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
main > .scroll { padding: 6px 18px; border-radius: 20px; background: var(--white); }
th, td { padding: 8px 12px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--grey); }
th { color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td code, td:first-child { white-space: nowrap; }
td { overflow-wrap: anywhere; }

.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: 140px; }
.chart rect { fill: var(--black); }
.chart rect:hover { fill: #777; }
.chart figcaption { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12px; }

.funnel { display: grid; gap: 10px; }
.funnel .step { display: grid; grid-template-columns: minmax(120px, 240px) 1fr 110px; gap: 12px; align-items: center; }
.funnel .track { height: 14px; border-radius: 999px; background: var(--grey); overflow: hidden; }
.funnel .fill { display: block; height: 100%; border-radius: 999px; background: var(--black); }
.funnel .count { text-align: right; font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--grey); font-size: 13px; white-space: nowrap; }
.pill.on { background: var(--lime); font-weight: 600; }
.pill.off { color: var(--muted); }
.pill.bad { background: var(--bad); color: var(--white); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 16px 0; padding: 18px; border-radius: 20px; background: var(--white); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.who { display: flex; align-items: center; gap: 16px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--grey); }

pre { margin: 0; padding: 14px; border-radius: 14px; background: var(--paper); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

.links { margin: 0; padding-left: 18px; }

input, select, button { font: inherit; }
input, select {
  padding: 8px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 12px;
  background: var(--white);
  min-width: 0;
}
button {
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--black);
  color: var(--lime);
  font-weight: 600;
  cursor: pointer;
}
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.bar :focus-visible { outline-color: var(--lime); }

.search { display: flex; gap: 8px; margin: 16px 0 0; }
.search input { flex: 1; max-width: 420px; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.actions form { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 14px; background: var(--paper); }
.actions label { display: flex; flex-direction: column; gap: 4px; width: 100%; color: var(--muted); font-size: 13px; }
.actions .note { margin: 0; }

.pager { display: flex; justify-content: space-between; margin: 16px 0; }

body.login { display: grid; place-items: center; min-height: 100vh; }
.login .card { display: flex; flex-direction: column; gap: 14px; width: min(340px, calc(100vw - 32px)); padding: 28px; border-radius: 24px; background: var(--black); color: var(--white); }
.login h1 { margin: 0; font-size: 22px; }
.login label { display: flex; flex-direction: column; gap: 6px; color: var(--muted-on-black); font-size: 13px; }
.login button { background: var(--lime); color: var(--black); }
.login .notice { margin: 0; }

@media (max-width: 600px) {
  .funnel .step { grid-template-columns: 1fr 90px; }
  .funnel .track { grid-column: 1 / -1; order: 3; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 10px; }
}
