/* The reps' own site (reps.<domain>). The Klyvelo app's look: paper and ink, seafoam for the main action, Unbounded
   for the big numbers, grouped rows with thin dividers (no stacked cards). Phone first; two columns from 900px. Light
   and dark follow the phone, or the choice in the top bar (data-theme on <html>). */
*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: light;
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-2: #eaf2ef;
  --ink: #13211d;
  --muted: #4a5c57;
  --faint: #7a8a85;
  --line: #dde7e3;
  --accent: #8edcc5;
  --accent-2: #a3e4d1;
  --on-accent: #13211d;
  --accent-soft: #ddf4ec;
  --link: #1c6e58;
  --good: #1b6b45;
  --good-bg: #e4f3ea;
  --bad: #b3261e;
  --amber: #8a5a00;
  --shadow: 0 1px 2px rgba(19, 33, 29, .05), 0 10px 30px rgba(19, 33, 29, .07);
  --display: Unbounded, "Arial Black", system-ui, sans-serif;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101615; --surface: #1a2220; --surface-2: #222c29; --ink: #eef5f2; --muted: #b9c9c3; --faint: #8fa39c;
    --line: #2a3633; --accent: #7fe0c4; --accent-2: #9be8d2; --on-accent: #0f1a17; --accent-soft: #183630; --link: #7fe0c4;
    --good: #5bc98e; --good-bg: #12271c; --bad: #f08a80; --amber: #f2be5c; --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 14px 36px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101615; --surface: #1a2220; --surface-2: #222c29; --ink: #eef5f2; --muted: #b9c9c3; --faint: #8fa39c;
  --line: #2a3633; --accent: #7fe0c4; --accent-2: #9be8d2; --on-accent: #0f1a17; --accent-soft: #183630; --link: #7fe0c4;
  --good: #5bc98e; --good-bg: #12271c; --bad: #f08a80; --amber: #f2be5c; --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 14px 36px rgba(0, 0, 0, .45);
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 20px; height: 20px; flex: none; }
.i.xs { width: 14px; height: 14px; vertical-align: -1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 8px; }

/* The light and dark mark */
.dark-only { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dark-only { display: block; } :root:not([data-theme="light"]) .light-only { display: none; } }
:root[data-theme="dark"] .dark-only { display: block; }
:root[data-theme="dark"] .light-only { display: none; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 14px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.mark { width: 28px; height: 28px; }
.brand-word { font: 600 17px/1 var(--display); letter-spacing: -.01em; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.quiet, .link-btn { border: 0; background: none; color: var(--link); font: 500 15px var(--font); cursor: pointer; padding: 10px 8px; min-height: 44px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 15px var(--font); cursor: pointer; text-decoration: none; transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 0; min-width: 120px; }

/* Signed out */
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth-h { font: 600 34px/1.1 var(--display); letter-spacing: -.02em; margin: 0 0 10px; }
.auth-h.sm { font-size: 26px; }
.lede { color: var(--muted); margin: 0 0 24px; font-size: 16px; }
.form { display: grid; gap: 14px; margin: 0 0 8px; }
.field { display: grid; gap: 6px; font-weight: 500; }
.field input {
  min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font: 400 16px var(--font);
}
.field input:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--bad); margin: 0; font-weight: 500; }
.form-note { color: var(--muted); margin: 0; }
#forgot-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* The hero: this month in one big number, then two facts side by side */
.hero { padding: 10px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hello { margin: 0 0 14px; font: 600 15px var(--font); color: var(--muted); }
.label { margin: 0; color: var(--muted); font-size: 14px; }
.big { margin: 4px 0 20px; font: 600 clamp(44px, 13vw, 68px)/1 var(--display); letter-spacing: -.03em; white-space: nowrap; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.fact { display: grid; gap: 2px; padding: 14px 14px 0 0; }
.fact + .fact { padding-left: 16px; border-left: 1px solid var(--line); }
.fact .k { color: var(--muted); font-size: 13px; }
.fact b { font: 600 22px/1.2 var(--display); letter-spacing: -.01em; }
.fact .sub { color: var(--faint); font-size: 13px; }

/* Sections: a heading, then rows with thin dividers */
.cols { display: grid; gap: 0; }
.block { padding: 22px 0 6px; }
.h2 { font: 600 18px/1.2 var(--display); letter-spacing: -.01em; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.count { font: 600 13px var(--font); color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; }
.count:empty { display: none; }

.link-box { display: flex; gap: 18px; align-items: center; }
.qr { width: 148px; height: 148px; flex: none; background: #fff; border-radius: 20px; padding: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.qr svg { display: block; width: 100%; height: 100%; }
.link-side { min-width: 0; flex: 1; display: grid; gap: 8px; }
.link-text { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
#sp-hint { margin: -8px 0 0; }
.code { font: 600 14px var(--display); letter-spacing: .06em; color: var(--ink); background: var(--accent-soft); border-radius: 8px; padding: 2px 8px; margin-left: 4px; }

.rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t > span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { display: grid; justify-items: end; gap: 3px; flex: none; text-align: right; }
.row .plan { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.row .earn { font-weight: 600; font-size: 14px; }
.founder { color: var(--amber); }
.pill { display: inline-block; font: 600 12px/1 var(--font); padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.good { background: var(--good-bg); color: var(--good); }
.empty { color: var(--muted); padding: 14px 0; margin: 0; border-bottom: 1px solid var(--line); }

.switch-row { cursor: pointer; border-top: 1px solid var(--line); }
.row-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--link); flex: none; }
.row .t > span#pitch-sub { white-space: normal; }
.tog { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; margin: 0; transition: background .15s; }
.tog::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s; }
.tog:checked { background: var(--good); }
.tog:checked::after { left: 23px; }
.tog:disabled { opacity: .45; cursor: default; }

.how { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.how li { padding: 11px 0 11px 22px; border-bottom: 1px solid var(--line); color: var(--muted); position: relative; }
.how li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  max-width: calc(100vw - 32px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px;
  font-weight: 500; box-shadow: var(--shadow);
}

@media (max-width: 420px) {
  .link-box { flex-direction: column; align-items: stretch; }
  .qr { width: min(220px, 64vw); height: min(220px, 64vw); margin: 0 auto 4px; }
  .link-text { text-align: center; }
  #link-code { text-align: center; }
}
@media (min-width: 900px) {
  .top { padding: 18px 24px; }
  .wrap { padding: 0 24px 64px; }
  .hero { display: grid; grid-template-columns: 1fr minmax(320px, 440px); align-items: end; column-gap: 40px; }
  .hero .hello, .hero .label { grid-column: 1; }
  .hero .big { grid-column: 1; margin-bottom: 0; }
  .hero .facts { grid-column: 2; grid-row: 2 / span 2; border-top: 0; }
  .cols { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 56px; }
  .qr { width: 176px; height: 176px; }
}
@media (prefers-reduced-motion: reduce) { .btn, .tog, .tog::after { transition: none; } }
