:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #eceff3;
  --text: #17202b;
  --muted: #55606d;
  --border: #dce1e7;
  --brand: #16314f;
  --brand-ink: #ffffff;
  --accent: #e8891c;
  --ok: #1d7a46;
  --ok-bg: #e3f3e9;
  --warn: #9a5b00;
  --warn-bg: #fdf0d9;
  --bad: #b42318;
  --bad-bg: #fde7e4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 30, 0.06), 0 2px 8px rgba(20, 24, 30, 0.04);
  --font-display: "Archivo", "Arial Narrow", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: var(--font-body);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-family: var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

/* Buttons and forms */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 0.5rem 0.9rem; border-radius: 8px; text-decoration: none; display: inline-flex;
  align-items: center; gap: 0.4rem; font-weight: 500;
}
button:hover, .btn:hover { border-color: #b9c2cd; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: #18304f; }
.btn-accent { background: var(--accent); color: #1c1f24; border-color: var(--accent); }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
button:disabled { opacity: 0.6; cursor: default; }
label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.75rem; }
input, select, textarea {
  font: inherit; display: block; width: 100%; margin-top: 0.25rem; padding: 0.5rem 0.65rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.error { color: var(--bad); font-size: 0.9rem; min-height: 1.2em; }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand); color: #dfe6f0; padding: 1.25rem 0.9rem; display: flex; flex-direction: column; gap: 0.25rem; }
.logo { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; font-size: 1.2rem; color: #fff; display: flex; align-items: center; gap: 0.5rem; margin: 0 0.5rem 1.25rem; text-decoration: none; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--brand); font-size: 0.95rem; }
.nav a { display: block; color: #dfe6f0; text-decoration: none; padding: 0.5rem 0.75rem; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,0.08); }
.nav a.active { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar .foot { margin-top: auto; font-size: 0.85rem; padding: 0 0.5rem; }
.sidebar .foot button { background: transparent; color: #dfe6f0; border-color: rgba(255,255,255,0.25); margin-top: 0.5rem; }
main { padding: 1.75rem 2rem 3rem; max-width: 1150px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat .n { font-size: 2rem; font-weight: 700; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 0.9rem; }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--warn); } .stat.bad .n { color: var(--bad); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
td { font-variant-numeric: tabular-nums; padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }
.dots { display: flex; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.ok { background: var(--ok); } .dot.expiring { background: var(--accent); } .dot.expired, .dot.missing { background: var(--bad); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.req-list { display: grid; gap: 0.6rem; }
.req { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 8px; flex-wrap: wrap; }
.copy-box { display: flex; gap: 0.5rem; }
.copy-box input { margin: 0; font-size: 0.85rem; }
.banner { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
pre.email { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); padding: 0.75rem; border-radius: 8px; margin: 0.5rem 0 0; font-size: 0.9rem; }

dialog { border: none; border-radius: 12px; padding: 1.5rem; width: min(520px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
dialog::backdrop { background: rgba(20, 24, 30, 0.45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }

/* Auth and portal pages */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card { width: min(420px, 100%); }
.auth-card .logo { color: var(--brand); margin: 0 0 1rem; }
.portal { max-width: 680px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 0.6rem 1rem; border-radius: 8px; z-index: 50; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 0.75rem 1rem; }
  .logo { margin: 0 1rem 0 0; }
  .nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .sidebar .foot { display: none; }
  main { padding: 1.25rem 1rem 2.5rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .grid-2 { grid-template-columns: 1fr; }
}
button, .btn { white-space: nowrap; }
.req .error { margin: 0.25rem 0 0; min-height: 0; }
.mono { font-family: var(--font-mono); font-size: 0.9em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
#trialbar .banner { margin-bottom: 1.25rem; }
@media (min-width: 861px) { .plans { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
/* Guide (SEO article) pages */
.guide-page { background: #fff; }
.guide-wrap { max-width: 1140px; margin: 0 auto; padding-inline: 20px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.guide-top { border-bottom: 1px solid var(--border); position: sticky; top: env(safe-area-inset-top, 0px); background: rgba(255,255,255,.95); z-index: 5; }
.guide-top .guide-wrap { height: 60px; }
.guide-top .logo { color: var(--brand); margin: 0; }
main.guide-main { max-width: none; padding: 0 20px 3rem; }
.article { max-width: 720px; margin: 0 auto; padding-top: 2.5rem; font-size: 1.05rem; line-height: 1.7; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1rem; }
.article h2 { font-size: 1.4rem; margin-top: 2.25rem; }
.article .lede { font-size: 1.2rem; color: var(--muted); }
.article li { margin-bottom: .45rem; }
.article table { margin: 1rem 0; font-size: .95rem; }
.article td, .article th { border: 1px solid var(--border); vertical-align: top; }
.crumbs { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin: 0 0 .75rem; }
.crumbs a { color: var(--muted); }
.guide-cta { background: var(--brand); color: #fff; border-radius: 14px; padding: 1.75rem; margin: 2.5rem 0; }
.guide-cta h2 { color: #fff; margin-top: 0; }
.guide-cta p { color: #c9d5e5; }
.more ul, .guide-list { list-style: none; padding: 0; }
.guide-list li { border-bottom: 1px solid var(--border); padding: 1.1rem 0; }
.guide-list p { margin: .25rem 0 0; color: var(--muted); }
.guide-foot { border-top: 1px solid var(--border); padding-block: 1.5rem 2.5rem; color: var(--muted); font-size: .9rem; }
.guide-foot a { color: var(--muted); }
.article tr:last-child td { border-bottom: 1px solid var(--border); }
.waiver-form { border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; margin: 1.5rem 0; background: #fff; }
.waiver-form h2 { margin-top: 0; font-size: 1.2rem; }
.wf-row { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.wf-row > span:first-child { white-space: nowrap; }
.wf-line { flex: 1; min-width: 160px; border-bottom: 1px solid var(--text); min-height: 1.6em; outline: none; }
.wf-line:focus { background: var(--surface-2); }
@media print {
  body.guide-page .guide-top, body.guide-page .guide-foot, body.guide-page .crumbs, body.guide-page h1, body.guide-page .article > :not(.waiver-form) { display: none !important; }
  .waiver-form { border: none; padding: 0; margin: 0; }
}
