:root {
  --ink: #16233b;
  --paper: #f2f4f7;
  --field: #ffffff;
  --muted: #5b6577;
  --rule: #d5dae2;
  --gold: #c98a12;
  --gold-soft: #fbefd4;
  --green: #2e7550;
  --green-soft: #e2f1e8;
  --red: #b4432f;
  --shadow: 0 1px 2px rgba(22, 35, 59, .06), 0 8px 24px rgba(22, 35, 59, .06);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6eaf2;
    --paper: #0f1726;
    --field: #18233a;
    --muted: #9aa6ba;
    --rule: #2a3752;
    --gold: #e8b04a;
    --gold-soft: #3a2e14;
    --green: #5fb98a;
    --green-soft: #173527;
    --red: #e07a63;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 15px;
  padding: 11px 20px; border-radius: 6px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--field); border: 1.5px solid var(--rule); border-radius: 6px;
  padding: 10px 12px;
}
input:focus, select:focus { border-color: var(--ink); outline: none; }

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--rule); background: var(--paper); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  font-weight: 800; font-size: 19px; text-decoration: none;
  font-variation-settings: "wdth" 120; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.brand .mark {
  width: 26px; height: 26px; border: 2px solid var(--gold); border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; color: var(--gold);
}
.nav { display: flex; gap: 12px; align-items: center; }

/* ---------- landing ---------- */
.hero { padding: 72px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(38px, 5.4vw, 64px); line-height: 1.02; margin: 0 0 20px;
  font-variation-settings: "wdth" 118; font-weight: 780; letter-spacing: -.02em;
}
.hero p.lede { font-size: 19px; color: var(--muted); max-width: 34em; margin: 0 0 28px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .fine { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* the permit card: the one bold element */
.permit {
  position: relative; background: var(--field); border: 1.5px solid var(--rule);
  border-radius: 8px; padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.permit .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.permit h3 { font-size: 24px; margin: 6px 0 4px; font-variation-settings: "wdth" 112; font-weight: 750; }
.permit .addr { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.permit .email {
  border-top: 1px dashed var(--rule); padding-top: 14px; font-size: 14.5px; line-height: 1.55;
}
.permit .email strong { display: block; margin-bottom: 6px; }
.stamp {
  position: absolute; top: 18px; right: -14px; transform: rotate(8deg);
  border: 3px double var(--gold); color: var(--gold); border-radius: 6px;
  padding: 6px 12px; font-weight: 800; font-size: 15px; background: var(--field);
  font-variation-settings: "wdth" 125; text-align: center; line-height: 1.15;
}
.stamp small { display: block; font-weight: 600; font-size: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.chip {
  font-size: 13px; padding: 3px 9px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--rule);
}

.band { padding: 64px 0; border-top: 1px solid var(--rule); }
.band h2 {
  font-size: clamp(28px, 3.4vw, 38px); margin: 0 0 12px; line-height: 1.1;
  font-variation-settings: "wdth" 115; font-weight: 760; letter-spacing: -.01em;
}
.band p.sub { color: var(--muted); max-width: 40em; margin: 0 0 36px; font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.step .num {
  font-size: 44px; font-weight: 800; color: var(--gold); line-height: 1;
  font-variation-settings: "wdth" 125; margin-bottom: 10px; display: block;
}
.step h3 { margin: 0 0 6px; font-size: 19px; }
.step p { margin: 0; color: var(--muted); }

.stats { display: flex; gap: 48px; flex-wrap: wrap; margin-top: 8px; }
.stats div { font-size: 15px; color: var(--muted); }
.stats b { display: block; font-size: 30px; color: var(--ink); font-variation-settings: "wdth" 118; }

.price {
  max-width: 460px; background: var(--field); border: 1.5px solid var(--ink);
  border-radius: 8px; padding: 30px;
}
.price .amt { font-size: 52px; font-weight: 800; font-variation-settings: "wdth" 115; line-height: 1; }
.price .amt span { font-size: 18px; font-weight: 500; color: var(--muted); }
.price ul { padding-left: 20px; margin: 18px 0 24px; }
.price li { margin-bottom: 6px; }

footer { border-top: 1px solid var(--rule); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.auth .box {
  width: 100%; max-width: 400px; background: var(--field); border: 1.5px solid var(--rule);
  border-radius: 8px; padding: 32px; box-shadow: var(--shadow);
}
.auth h1 { margin: 0 0 6px; font-size: 28px; font-variation-settings: "wdth" 115; }
.auth p { color: var(--muted); margin: 0 0 22px; }
.auth .field { margin-bottom: 16px; }
.auth .btn { width: 100%; margin-top: 6px; }
.auth .switch { margin-top: 18px; font-size: 14px; text-align: center; }
.msg { padding: 10px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 14px; display: none; }
.msg.error { display: block; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.msg.ok { display: block; background: var(--green-soft); color: var(--green); }

/* ---------- dashboard ---------- */
.dash { padding: 28px 0 60px; }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { margin: 0; font-size: 30px; font-variation-settings: "wdth" 115; }
.dash-head p { margin: 4px 0 0; color: var(--muted); }

.filters {
  display: grid; grid-template-columns: .9fr 1.2fr 1fr .9fr .8fr .8fr; gap: 12px;
  background: var(--field); border: 1.5px solid var(--rule); border-radius: 8px; padding: 16px;
  margin-bottom: 16px;
}
.filters label { font-size: 13px; color: var(--muted); }

.table-wrap { overflow-x: auto; background: var(--field); border: 1.5px solid var(--rule); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th {
  text-align: left; font-size: 13px; color: var(--muted); font-weight: 600;
  padding: 12px 14px; border-bottom: 1.5px solid var(--rule); white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--paper); }
td .name { font-weight: 650; }
td .sub { color: var(--muted); font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.score {
  display: inline-block; min-width: 42px; text-align: center; font-weight: 750;
  padding: 3px 8px; border-radius: 5px; font-variant-numeric: tabular-nums;
}
.score.hi { background: var(--green-soft); color: var(--green); }
.score.mid { background: var(--gold-soft); color: var(--gold); }
.score.lo { background: var(--paper); color: var(--muted); }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); font-size: 14px; }
.pager .btns { display: flex; gap: 8px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* lead drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 28, .45); display: none; z-index: 20; }
.scrim.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 100%);
  background: var(--field); border-left: 1.5px solid var(--rule); z-index: 21;
  transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; padding: 28px;
}
.drawer.open { transform: none; }
.drawer h2 { margin: 0 0 4px; font-size: 26px; font-variation-settings: "wdth" 112; line-height: 1.15; }
.drawer .meta { color: var(--muted); margin-bottom: 16px; }
.drawer .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 18px 0; font-size: 14.5px; }
.drawer .facts span { display: block; color: var(--muted); font-size: 13px; }
.drawer .mail { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 16px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; }
.drawer .mail-subject { font-weight: 650; margin: 18px 0 8px; }
.drawer .row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.close { position: absolute; top: 16px; right: 16px; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--muted); }

/* ---------- billing ---------- */
.trial-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--gold-soft); border: 1.5px solid var(--gold); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 16px; font-size: 15px;
}
.paywall {
  background: var(--field); border: 1.5px solid var(--ink); border-radius: 8px;
  padding: 36px 32px; max-width: 560px; margin: 24px auto;
}
.paywall h2 { margin: 0 0 8px; font-size: 28px; font-variation-settings: "wdth" 115; line-height: 1.15; }
.paywall p { color: var(--muted); margin: 0 0 18px; }
.paywall .amt { font-size: 40px; font-weight: 800; font-variation-settings: "wdth" 115; margin-bottom: 18px; }
.paywall .amt span { font-size: 16px; font-weight: 500; color: var(--muted); }
.paywall .note { font-size: 14px; margin-top: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .stamp { right: 10px; }
}
@media (max-width: 520px) {
  .filters { grid-template-columns: 1fr; }
  .nav .hide-sm { display: none; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}
