:root {
  --bg: #f4f6f8;
  --panel: #fff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #0f766e;
  --brand-2: #115e59;
  --brand-soft: #e6f4f1;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --star: #f5a524;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
code { background: #f2f4f7; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; }

/* layout */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: linear-gradient(90deg, #0b1f1d 250px, var(--bg) 250px); }
.side { background: #0b1f1d; color: #cfe3df; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--brand); display: grid; place-items: center; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { color: #cfe3df; padding: 7px 10px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side nav a:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.side nav a.on { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 600; }
.side nav a.add { color: #7fd1c3; }
.navlabel { text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; color: #6f8f8a; margin: 16px 10px 4px; }
.mode { display: block; margin-top: 16px; padding: 8px 10px; border-radius: 8px; background: rgba(245, 165, 36, 0.14); color: #fcd34d; font-size: 12px; font-weight: 600; }
.mode.live { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.mode:hover { text-decoration: none; filter: brightness(1.1); }
.main { padding: 28px 36px 60px; max-width: 1200px; width: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.top p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions.wrap { margin-top: 10px; }
.actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + .grid2, .card + .grid2 { margin-top: 20px; }

/* cards & tiles */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.cardhead h2 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; border-left: 4px solid var(--line); }
.tile.warnt { border-left-color: var(--warn); }
.tile.okt { border-left-color: var(--ok); }
.tlabel { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tvalue { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; }
.tstar { color: var(--star); font-size: 22px; }
.tsub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: var(--ink); font: 600 14px/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font-family: inherit; font-size: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
form.inline { display: inline; }

/* pills, badges, stars */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f2f4f7; color: #344054; vertical-align: middle; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.new { background: var(--info-soft); color: var(--info); }
.pbadge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.pbadge i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc, #98a2b3); display: inline-block; }
h2 .pbadge { font-size: 16px; }
h2 .pbadge i { width: 11px; height: 11px; }
.stars { color: var(--star); letter-spacing: 1px; font-size: 14px; white-space: nowrap; }
.stars .off { color: #d0d5dd; }
.count { background: var(--info); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; margin-left: 2px; }

/* text helpers */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.dim { opacity: 0.55; }
.lead { font-size: 17px; color: #344054; max-width: 640px; }

/* notices & verdicts */
.notice { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; border: 1px solid; }
.notice.ok { background: var(--ok-soft); border-color: #abefc6; color: #05603a; }
.notice.warn { background: var(--warn-soft); border-color: #fedf89; color: #93370d; }
.notice.bad { background: var(--bad-soft); border-color: #fecdca; color: #912018; }
.notice.info { background: var(--info-soft); border-color: #b2ddff; color: #194185; }
.card .notice { margin: 10px 0; }
.verdict { padding: 14px 16px; border-radius: 10px; border-left: 4px solid var(--line); background: #f9fafb; margin: 10px 0 14px; }
.verdict p { margin: 6px 0 0; }
.verdict.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.verdict.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.verdict.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.findings { list-style: none; padding: 0; margin: 0 0 14px; }
.findings li { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.findings li.high { border-left-color: var(--bad); }
.findings li.medium { border-left-color: var(--warn); }
.findings li.check { border-left-color: var(--info); }
.findings li div { margin-top: 3px; }
details.more, details.rules { margin-top: 12px; }
details summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.rules ul { margin: 6px 0; padding-left: 18px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.subtabs { display: flex; gap: 8px; margin: -6px 0 16px; }
.subtabs a { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.subtabs a.on { background: var(--brand-soft); border-color: #99d5cb; color: var(--brand-2); }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.jump a { padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }

/* lists & tables */
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li { border-bottom: 1px solid var(--line); }
.rlist li:last-child { border-bottom: 0; }
.rlist li.isnew { box-shadow: inset 3px 0 0 var(--info); }
.rrow { display: block; padding: 12px 10px; color: inherit; border-radius: 8px; }
.rrow:hover { background: #f9fafb; text-decoration: none; }
.rhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rtitle { font-weight: 600; margin-top: 6px; }
.rtext { color: #344054; margin-top: 5px; }
.rbody { white-space: normal; line-height: 1.6; margin: 10px 0; }
.review .author { margin: 12px 0 2px; font-size: 18px; }
.posted { background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { padding: 7px 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; font-family: var(--font); font-size: 14px; }

/* forms */
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 13px; }
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form select, .form textarea, .linkrow input {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid #d0d5dd; border-radius: 8px; font: 400 14px/1.45 var(--font); background: #fff; color: var(--ink);
}
.form input[type="file"] { display: block; margin-top: 6px; font-weight: 400; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid #99d5cb; border-color: var(--brand); }
.form .check, .form .radio { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 14px; }
.form .check input, .form .radio input { margin-top: 3px; }
.help { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cols:has(> label:nth-child(3)) { grid-template-columns: 1fr 1fr 1fr; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 2px; margin: 0 0 14px; }
legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.checks .check { margin-bottom: 8px; }
.danger-zone { border-color: #fecdca; }
.settings .card { margin-bottom: 20px; }
.reportform { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }

/* dashboard chart */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bfill { width: 100%; max-width: 46px; background: var(--brand-soft); border-top: 3px solid var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; position: relative; }
.bfill span { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; }
.blabel { font-size: 12px; color: var(--muted); margin-top: 6px; }
.bavg { font-size: 11px; color: var(--muted); height: 14px; }

/* invites */
.sites-included { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.preview { background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.psubject { font-weight: 700; margin: 4px 0 8px; }
details.msg { margin-top: 4px; }
details.msg pre { background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }

/* links & QR */
.qrgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.qrgrid .card { margin: 0; text-align: center; }
.qrgrid img { display: block; margin: 4px auto 12px; background: #fff; }
.linkrow { display: flex; gap: 8px; align-items: center; }
.linkrow input { margin-top: 0; font-size: 12.5px; }

/* sites */
.sites { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.sites .card { margin: 0; }

/* welcome & checklist */
.hero { padding: 36px; }
.hero h1 { font-size: 28px; margin-bottom: 8px; }
.steps { margin: 20px 0; padding-left: 20px; line-height: 2; font-size: 15px; }
.checklist ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist li.done { color: var(--muted); }
.tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d0d5dd; display: inline-grid; place-items: center; font-size: 11px; color: #fff; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); }
.prose p, .prose li { line-height: 1.65; max-width: 820px; }
.prose ol, .prose ul { padding-left: 20px; }

@media (max-width: 1050px) {
  .grid2, .sites { grid-template-columns: 1fr; }
}

@media print {
  .side, .tabs, .actions, .mode { display: none; }
  .shell { display: block; }
}

/* phase 2 */
.signout { margin-top: 10px; padding: 0 10px; }
.signout .linkbtn { color: #9fbcb7; font-size: 12.5px; }
.loginbody { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
.login { width: 360px; padding: 28px; }
.login h1 { margin-bottom: 4px; }
h2.section { margin: 26px 0 12px; font-size: 18px; }
.intg ul { padding-left: 18px; }
.grid2.tight { gap: 16px; margin-top: 8px; }
.approval .rbody { margin: 0; }
.inline-form { display: flex; gap: 6px; margin-top: 6px; }
.inline-form select { padding: 4px 6px; border: 1px solid #d0d5dd; border-radius: 6px; font-family: var(--font); }

/* insights */
.spend { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.advice { margin: 0 0 14px; padding-left: 18px; }
.advice li { margin: 4px 0; }
.bar { display: inline-block; width: 90px; height: 8px; background: #f2f4f7; border-radius: 4px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); }
blockquote.q { margin: 6px 0; padding: 8px 10px; border-left: 3px solid var(--line); background: #f9fafb; border-radius: 6px; font-size: 13px; }
blockquote.q.bad { border-left-color: var(--bad); }
blockquote.q.ok { border-left-color: var(--ok); }
blockquote.q a { color: var(--ink); }
blockquote.q span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.small-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.small-tiles .tvalue { font-size: 22px; }
.small-tiles.one { grid-template-columns: 1fr 1fr 1fr; }
.small-val { font-size: 14px !important; font-weight: 600; }
tr.me td { background: var(--brand-soft); }
.gridwrap { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.rankgrid { display: grid; grid-template-columns: repeat(var(--n), 44px); gap: 4px; }
.cell { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.cell.center { box-shadow: 0 0 0 3px var(--ink); }
.g-top { background: #12b76a; }
.g-mid { background: #f79009; }
.g-low { background: #f04438; }
.g-none { background: #98a2b3; }
.legend { display: flex; gap: 8px; align-items: center; }
.legend .cell { width: auto; height: auto; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
@media (max-width: 900px) { .gridwrap { grid-template-columns: 1fr; } }

/* accounts, branding */
.brandlogo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; }
.whoami { margin-top: 10px; padding: 0 10px; }
.whoami a { color: #cfe3df; }
.banner { margin-bottom: 16px; }
.brandfooter { margin-top: 36px; text-align: center; }
.team td, .team th { vertical-align: top; }
.sharelink { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.sharelink input { flex: 1; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.plan .price { font-size: 28px; font-weight: 700; margin: 6px 0; }
.authcard { width: 420px; max-width: 94vw; }
.check-list { list-style: none; padding: 0; }
.check-list li::before { content: '✓ '; color: var(--ok); font-weight: 700; }

/* ---------- phones and small tablets ---------- */
.navtoggle { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.sidetop { display: block; }
.menubtn { display: none; }
.main { min-width: 0; overflow-wrap: break-word; }

@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }

  /* compact top bar with a Menu button instead of a giant sidebar */
  .side { position: sticky; top: 0; z-index: 50; height: auto; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); overflow: visible; display: block; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
  .sidetop { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
  .brand { padding: 0; min-width: 0; font-size: 16px; }
  .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menubtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 700; cursor: pointer; user-select: none; flex: none; }
  .menubtn::after { content: '☰'; font-size: 18px; line-height: 1; }
  .navtoggle:checked ~ .sidetop .menubtn::after { content: '✕'; }
  .navtoggle:focus-visible ~ .sidetop .menubtn { outline: 3px solid #7fd1c3; outline-offset: 2px; }
  .side nav, .side > .mode, .side > .whoami, .side > .signout { display: none; }
  .side:has(.navtoggle:checked) { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .navtoggle:checked ~ nav { display: flex; padding: 6px 0 8px; }
  .navtoggle:checked ~ .mode, .navtoggle:checked ~ .whoami, .navtoggle:checked ~ .signout { display: block; }
  .navtoggle:checked ~ .signout { padding-bottom: 14px; }
  .side nav a { padding: 12px 12px; font-size: 16px; }
  .navlabel { margin: 14px 12px 2px; }

  .main { padding: 16px 14px 48px; padding-bottom: max(48px, env(safe-area-inset-bottom)); max-width: 100%; }
  h1 { font-size: 22px; line-height: 1.2; }
  h2 { font-size: 17px; }
  .card { padding: 16px; border-radius: 12px; margin-bottom: 14px; }
  .grid2, .sites, .cols, .cols:has(> label:nth-child(3)), .checks, .gridwrap { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .grid2 { gap: 14px; }

  /* page headers: title first, then big full-width buttons */
  .top { flex-direction: column; align-items: stretch; gap: 12px; }
  .top .actions { width: 100%; }
  .top .actions .btn, .top .actions form { flex: 1 1 100%; }
  .top .actions form .btn { width: 100%; }
  .actions .btn { justify-content: center; }
  .actions.sticky { margin: 0 -14px; padding: 14px; background: var(--bg); border-top: 1px solid var(--line); bottom: 0; }
  .actions.sticky .btn { flex: 1; }

  /* touch-friendly controls; 16px text stops iPhones zooming in on forms */
  .btn { min-height: 44px; padding: 10px 16px; font-size: 15px; white-space: normal; text-align: center; }
  .btn.small { min-height: 40px; padding: 8px 14px; font-size: 14px; }
  .linkbtn { min-height: 36px; padding: 6px 2px; }
  .form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]), .form select, .form textarea, .linkrow input, .filters select { font-size: 16px; min-height: 46px; padding: 11px 12px; }
  .form textarea { min-height: 96px; }
  .form label { font-size: 14px; }
  .form .check, .form .radio { font-size: 15px; gap: 10px; align-items: flex-start; padding: 4px 0; }
  .form input[type="checkbox"], .form input[type="radio"] { width: 22px; height: 22px; flex: none; margin-top: 1px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters select { width: 100%; }
  .linkrow, .sharelink { flex-wrap: wrap; }
  .linkrow input, .sharelink input { flex: 1 1 100%; min-width: 0; }

  /* numbers */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .tile { padding: 12px; }
  .tvalue { font-size: 22px; }
  .tlabel { font-size: 12px; }

  /* tabs scroll sideways and show there is more to the right */
  .tabs { margin: 0 -14px 16px; padding: 0 14px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 12px 14px; font-size: 15px; scroll-snap-align: start; }
  .subtabs { flex-wrap: wrap; }
  .subtabs a, .jump a { padding: 8px 14px; font-size: 14px; }

  /* tables: each row becomes a small card (labels come from the column titles); odd tables scroll sideways instead */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table:not(.stack) td, .table:not(.stack) th { min-width: 110px; }
  .table.stack { overflow: visible; }
  .table.stack thead { display: none; }
  .table.stack tbody { display: block; }
  .table.stack tr { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 0 0 10px; background: #fff; }
  .table.stack tr:last-child { margin-bottom: 0; }
  .table.stack td { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); white-space: normal; }
  .table.stack td:last-child { border-bottom: 0; }
  .table.stack td.blank { display: none; }
  .table.stack td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }
  .table.stack td[data-label=""]::before { content: none; }
  .table.stack td:first-child { font-size: 16px; padding-top: 12px; }
  .table.stack td:first-child::before { content: none; }
  .table.stack td form { display: inline-block; margin: 2px 10px 2px 0; }
  .table.stack td .linkbtn { min-height: 40px; }
  .table.stack tr.me { border-color: var(--brand); background: var(--brand-soft); }
  .table.stack tr.dim { opacity: 0.6; }

  /* review rows and review pages */
  .rrow { padding: 14px 8px; }
  .rhead { gap: 6px; }
  .rtext { font-size: 15px; }
  .bars { gap: 6px; }

  /* map grid and QR cards fit the screen */
  .rankgrid { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); width: 100%; max-width: calc(var(--n) * 56px); gap: 3px; }
  .cell { width: auto; height: auto; aspect-ratio: 1; font-size: 11px; }
  .legend .cell { aspect-ratio: auto; }
  .qrgrid { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .gbpdl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gbpdl dt { margin-top: 8px; }
  blockquote.q { margin-left: 0; margin-right: 0; }

  .notice { padding: 12px; }
  .banner { margin-bottom: 12px; }
  pre, code { overflow-wrap: anywhere; }
  .authcard { width: 100%; max-width: 440px; }
  .login { width: 100%; max-width: 440px; }
  .loginbody { padding: 16px; align-items: start; padding-top: 8vh; }
}
@media (max-width: 400px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .tiles { gap: 8px; }
  .tvalue { font-size: 20px; }
}
@media (hover: none) {
  .side nav a:hover, .rrow:hover { background: none; }
}

/* anti-spam trap field: invisible to people, still filled in by bots */
.hp { position: absolute !important; left: -9999px !important; top: auto !important; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 820px) {
  .form > button.btn, .form > .btn.primary, .card > form > .btn.primary:only-child { width: 100%; }
}
@media (max-width: 820px) { .btn { justify-content: center; } }

/* tiles that open something */
a.tile.link { display: block; position: relative; color: inherit; text-decoration: none; cursor: pointer; transition: box-shadow 0.12s, transform 0.12s; }
a.tile.link:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1); transform: translateY(-1px); }
a.tile.link:active { transform: none; box-shadow: none; background: #f9fafb; }
a.tile.link:focus-visible { outline: 3px solid #99d5cb; outline-offset: 2px; }
.tile .go { position: absolute; right: 12px; top: 10px; font-size: 22px; line-height: 1; color: #98a2b3; }
.rclient { margin-bottom: 2px; color: var(--brand-2); }
a.tile.link .tlabel { padding-right: 20px; }
