:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #e7ecf3;
  --line: #eaeff5;
  --text: #1c2537;
  --muted: #66748c;
  --accent: #0f8b9d;
  --accent2: #4f67e0;
  --pink: #e0538f;
  --mint: #12a97c;
  --warm: #e8940a;
  --grad-from: #0f8b9d;
  --grad-to: #14afb6;
  --grad-warm-from: #f5920d;
  --grad-warm-to: #f5bc2e;
  --shadow: 0 10px 30px rgba(28, 37, 55, 0.05);
  --shadow-lg: 0 20px 48px rgba(28, 37, 55, 0.10);
  --ring: 0 0 0 4px rgba(15, 139, 157, 0.15);
  --ring-soft: 0 0 0 4px rgba(15, 139, 157, 0.08);
}
* { box-sizing: border-box; }
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
pre, code, pre code {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(1000px 520px at 110% -10%, #e3f4f5 0%, transparent 58%),
    radial-gradient(800px 500px at -20% 15%, #e9ecfb 0%, transparent 52%),
    radial-gradient(700px 500px at 50% 120%, #e2f2ec 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- header / hero ---------- */
header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 24px 10px;
}
header h1 { margin: 0; font-size: 30px; letter-spacing: -0.5px; }
header h1 a { text-decoration: none; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
}
.logo .mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(15, 139, 157, 0.30);
}
.logo em { font-style: normal; color: var(--accent); }
.hero {
  padding: 26px 6px 8px;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero h1 span { color: var(--accent); }
.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 560px;
}
.hero-badges { margin-top: 14px; }
nav:has(.navgroup) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px 22px;
  align-items: start;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
/* Public site nav — slim pill row (masthead style, matches homepage .chip). */
nav:not(:has(.navgroup)) {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 14px; padding: 0;
  background: none; border: none; border-radius: 0; box-shadow: none;
}
nav:not(:has(.navgroup)) a:not(.chip) {
  display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
nav:not(:has(.navgroup)) a:not(.chip):hover {
  background: #fff; border-color: var(--accent); color: var(--accent);
}
nav .navgroup { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
nav .titles {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 4px 2px; white-space: nowrap;
}
nav a {
  display: flex; align-items: center;
  padding: 7px 12px;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.14s ease, color 0.14s ease;
}
nav a:hover { background: rgba(15, 139, 157, 0.08); color: var(--accent); transform: none; box-shadow: none; }
nav a.on {
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 139, 157, 0.28);
}
nav a.primary {
  background: linear-gradient(135deg, var(--grad-warm-from), var(--grad-warm-to));
  color: #fff;
  border: none;
  box-shadow: 0 6px 14px rgba(232, 148, 10, 0.30);
}

/* ---------- layout / cards ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 22px 24px 60px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.card h1, .card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.blog-title h2 { margin-bottom: 6px; }
.blog-title { text-decoration: none; color: inherit; }
.blog-title:hover h2 { color: var(--accent); }
.card > p { margin: 0 0 12px; color: var(--muted); }
.card > p.hint { margin-top: -6px; }

/* ---------- forms ---------- */
.row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.row > * { min-width: 0; }
.row > label { flex: 1 1 200px; }
.row > input, .row > select { flex: 0 1 auto; width: auto; min-width: 160px; max-width: 380px; }
.row > button { flex: 0 0 auto; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.2px; }
input, select, textarea {
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input, select { height: 46px; box-sizing: border-box; }
textarea { padding: 11px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
button {
  font-family: inherit;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  border: none;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 139, 157, 0.30); filter: brightness(1.04); }
button:active { transform: translateY(0); }
button.warm {
  background: linear-gradient(135deg, var(--grad-warm-from), var(--grad-warm-to));
  box-shadow: 0 6px 16px rgba(232, 148, 10, 0.28);
}
button.warm:hover { box-shadow: 0 10px 24px rgba(232, 148, 10, 0.34); }
button.ghost, a.btn.ghost {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}
button.ghost:hover, a.btn.ghost:hover { box-shadow: none; filter: none; background: rgba(15, 139, 157, 0.07); transform: translateY(-1px); }
.ok { color: #12805c; font-weight: 600; }
.err { color: #b42318; font-weight: 600; }
button.mini {
  min-height: 30px;
  padding: 0 14px;
  font-size: 12.5px;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}
button.mini:hover { box-shadow: none; filter: brightness(1.02); background: rgba(15, 139, 157, 0.07); }
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 139, 157, 0.30); }
.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.msg { color: var(--muted); font-size: 13px; min-height: 18px; margin: 6px 0 0; }

/* ---------- product cards ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.feature h3 { margin: 0 0 8px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.product {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 16px 15px;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product h4 {
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.product .price {
  font-size: 19px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.3px;
}
.product .meta { color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; }
.product .stars { color: #eebc4d; letter-spacing: 1px; }
.product a {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent), var(--grad-to));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product a:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 139, 157, 0.30); }

/* ---------- niche blocks ---------- */
.niche {
  background: linear-gradient(180deg, #ffffff, #fff);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(28, 37, 55, 0.05);
}
.niche .kw { font-weight: 800; font-size: 18px; letter-spacing: -0.3px; margin-bottom: 8px; }
.badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge.demand { background: #e3f6ea; color: #159a4b; }
.badge.saturation { background: #fdf0d8; color: #d97706; }
.badge.source { background: #eef1fd; color: #4f67e0; }
.niche .save-btn {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--grad-to));
  font-size: 12.5px;
  padding: 7px 14px;
}
.niche .save-btn:hover { box-shadow: 0 6px 16px rgba(15, 139, 157, 0.30); }
.niche .grid { margin-top: 4px; }

/* ---------- saved / misc ---------- */
.saved-niche {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  margin-bottom: 14px;
}
.saved-niche b { font-size: 16px; margin-right: 10px; }

#scraper-keys { margin-top: 12px; }
#scraper-keys .prow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
#scraper-keys .prow input { flex: 1 1 200px; width: auto; min-width: 180px; }
#scraper-keys .prow .tag { font-size: 12.5px; color: var(--muted); font-weight: 600; min-width: 110px; }
#scraper-keys .prow button { flex: 0 0 auto; }

footer {
  padding: 22px 24px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  max-width: 1080px;
  margin: 0 auto;
}
a { color: var(--accent2); }

/* ---------- editorial review pages ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .sep { margin: 0 6px; opacity: 0.6; }
.byline {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.lede {
  font-size: 16px;
  color: var(--text);
  line-height: 1.65;
  margin: 0 0 16px;
}
.pick {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin: 18px 0;
  background: #fff;
}
.pick.top {
  border-color: #cfe7ea;
  background: linear-gradient(180deg, #f4fafb, #fff);
  box-shadow: var(--shadow);
}
.pick-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pick-head h3 { margin: 0; font-size: 18px; flex: 1 1 260px; min-width: 0; }
.pick .rank {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--grad-to));
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pick .badge {
  font-size: 11.5px;
  font-weight: 700;
  background: #e3f6ea;
  color: #159a4b;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.pick .quick { margin: 0 0 6px; font-size: 14.5px; }
.pick .why { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.pilo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.pilo h4 { margin: 0 0 6px; font-size: 12.5px; letter-spacing: 0.3px; }
.pilo ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.pilo .pros li::marker { color: var(--mint); }
.pilo .cons li::marker { color: var(--pink); }
.starsline { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.meta-strong { font-weight: 600; color: var(--text); }
.tbl-w { position: relative; margin: 14px 0 4px; }
.table-wrap, .tbl-flow {
  overflow-x: auto;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tbl-pill {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(28, 37, 55, .10);
  pointer-events: none;
}
table.cgrid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 680px;
}
table.cgrid caption {
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  padding-bottom: 8px;
}
table.cgrid th, table.cgrid td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.cgrid th { color: var(--muted); font-size: 12px; letter-spacing: 0.3px; white-space: nowrap; }
table.cgrid td.ct { min-width: 260px; }
table.cgrid td.ct a { text-decoration: none; font-weight: 600; }
table.cgrid td.ct a:hover { text-decoration: underline; }
table.cgrid tr.top { background: #f1f7f9; }
.faq {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 10px 0;
  background: #ffffff;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
}
.faq p { margin: 10px 0 2px; color: var(--muted); font-size: 14px; }
.trust {
  border: 1px solid #dbe2f2;
  border-radius: 16px;
  background: #f5f7fd;
  padding: 14px 18px;
  margin: 14px 0;
}
.trust h3 { margin: 0 0 6px; font-size: 14px; color: var(--accent2); }
.trust p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
a.chip {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
  color: var(--accent);
}
/* ---------- courier (opt-in + analytics) ---------- */
.courier {
  margin-top: 4px;
  background: linear-gradient(180deg, #f8fbfd, #fff);
  border: 1px solid #cfe7ea;
}
.courier h3 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.courier p { margin: 0 0 8px; }
.courier-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}
.courier-row input[type=email], .courier-row input[type=text] {
  flex: 1 1 260px;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid #f0e3d0;
  border-radius: 13px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
}
.courier-row button {
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--grad-to));
  box-shadow: 0 6px 16px rgba(15, 139, 157, 0.28);
}
.courier[disabled] { opacity: 0.7; }
.courier-msg { min-height: 18px; font-size: 13px; margin: 8px 0 0; color: #159a4b; }
table.plain {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 8px;
  min-width: 560px;
}
table.plain th, table.plain td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.plain td { word-break: break-word; overflow-wrap: anywhere; }
table.plain th { color: var(--muted); font-size: 12px; letter-spacing: 0.3px; white-space: nowrap; }
table.plain tr:hover td { background: #f4fafb; }
.book-preview { margin-top: 10px; }
.book-preview .card { box-shadow: none; }

/* ---------- shared preview / key-value list styles ---------- */
/* Used by email sequence preview, SEM/SEO pages and per-niche cards. Long
   unbroken words, URLs and pre-wrapped body text must wrap instead of spilling
   past the card edge. */
.sub { border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 14px; }
.sub:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.sub h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.sub .who { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.6; }
.sub .key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 4px 0 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  max-width: 100%;
}
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; vertical-align: middle; }

/* ---------- scrolling hygiene (clean, professional) ---------- */
/* One consistent, slim scrollbar across the whole site (public + admin). */
* { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(15, 139, 157, 0.45); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
::-webkit-scrollbar-track { background: transparent; }

/* Sticky top admin nav so the toolbar stays reachable while a long list scrolls. */
nav:has(.navgroup) { position: sticky; top: 0; z-index: 50; background: rgba(244, 247, 251, 0.90); backdrop-filter: blur(8px); margin-top: 14px; }
body > header nav:has(.navgroup) { margin-left: 0; margin-right: 0; }
/* Keep anchor targets clear of the sticky nav on in-page jumps. */
[id] { scroll-margin-top: 74px; }

/* Back-to-top pill — fixed, unobtrusive, keyboard-friendly. */
.totop {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.totop a {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--grad-to));
  color: #fff; font-size: 20px; font-weight: 800; line-height: 1;
  text-decoration: none; box-shadow: 0 8px 20px rgba(15, 139, 157, 0.30);
}
.totop.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
body:has(.totop.show) > header:first-of-type { scroll-margin-top: 0; }

/* Sticky conversion bar: reserve clearance so it never covers the site footer
   links or collides with the back-to-top pill when fully scrolled. */
body.show-sticky footer { margin-bottom: 78px; }
body.show-sticky .totop { bottom: 92px; }

/* Collapsible section navigator — a tiny floating icon (bottom-left, opposite
   the back-to-top pill) that expands into a vertical menu of in-page sections
   on tap and collapses again on tap. It occupies no page space, so long admin
   pages stay clean; the active section is highlighted as you scroll and the
   menu auto-closes when you pick a destination. */
.secfab {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 10px;
  pointer-events: none;
}
.secfab > * { pointer-events: auto; }
.secfab-btn {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 999px;
  padding: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--grad-to));
  color: #fff; font-size: 19px; font-weight: 800; line-height: 1;
  border: 0; box-shadow: 0 8px 20px rgba(15, 139, 157, 0.30);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.secfab-btn:hover, .secfab-btn:focus-visible { transform: translateY(-2px); }
.secfab.open .secfab-btn { box-shadow: 0 10px 24px rgba(15, 139, 157, 0.42); }
.secfab-menu {
  display: flex; flex-direction: column; gap: 6px;
  max-height: min(60vh, 460px); max-width: min(78vw, 300px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 8px; margin: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  opacity: 0; transform: translateY(8px) scale(0.96); transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.secfab.open .secfab-menu { opacity: 1; transform: none; pointer-events: auto; }
.secfab-menu a {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 10px;
  color: var(--text); font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.secfab-menu a:hover, .secfab-menu a:focus-visible {
  background: #f1f5fb; color: var(--accent);
}
.secfab-menu a.active {
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
}
body.show-sticky .secfab { bottom: 92px; }
@media (max-width: 640px) {
  .secfab { left: 12px; bottom: 12px; }
  .secfab-menu { max-height: min(56vh, 380px); max-width: 82vw; }
}

/* ---------- pagination ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 16px 0; }
.pager a.pg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.pager a.pg:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.pager a.pg.on {
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  border-color: transparent; color: #fff;
  box-shadow: 0 5px 12px rgba(15, 139, 157, 0.28);
}
.pager a.pg.dim { opacity: 0.45; pointer-events: none; }
.pager .pg-dots { padding: 0 2px; color: var(--muted); font-weight: 700; }
form.nper { align-items: center; margin: 16px 0 0; }
form.nper select { min-width: 180px; }

/* ---------- homepage components ---------- */
/* Quick-verdict band: decision-first picks above the fold. */
.qband { background: linear-gradient(180deg, #f5f7fd, #fff); border-color: #dbe2f2; }
.qband h2 { font-size: 20px; }
.qgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-top: 6px;
}
.qpick {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
}
.qpick.top { border-color: var(--accent); box-shadow: 0 10px 26px rgba(15, 139, 157, 0.14); }
.qpick .pick-head { align-items: flex-start; gap: 10px; }
.qpick .pick-head h3 { font-size: 16px; line-height: 1.3; }
.qpick .who { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 700; margin: 0; }
.qpick .quick { font-size: 13.5px; color: var(--muted); margin: 0; font-weight: 600; }
.qpick .why { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.qpick .starsline { font-size: 12.5px; margin: 2px 0 0; }
.qpick .btn { align-self: flex-start; margin-top: auto; min-height: 42px; padding: 0 16px; font-size: 13px; }
.r-count { color: var(--text); font-weight: 600; }
/* Honesty trust strip where most review sites stay vague. */
.trust-strip { background: #fbfbf6; border-color: var(--border); }
.trow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.tcell b { display: block; font-size: 14px; color: var(--accent2); margin-bottom: 4px; letter-spacing: 0.2px; }
.tcell span { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
/* Explore-niches tile grid. */
.ngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 4px; }
a.ntile {
  display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; text-decoration: none; color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.ntile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
a.ntile b { font-size: 14px; }
a.ntile span { font-size: 12px; color: var(--muted); }

@media (max-width: 560px) {
  .pick-head h3 { flex-basis: 100%; }
}

/* ================================================================
   BUTTON / TOOLBAR HYGIENE — no collisions, no overflow, no overlap
   Every button-bearing flex/grid container wraps, aligns and sizes so
   controls never run into each other or spill past the card edge,
   regardless of how many buttons or how narrow the viewport is.
   ================================================================ */
/* All the flex containers that hold a button next to inputs/other buttons. */
.row, .toolbar, .actions, .btn-group, .badges, .chips, .courier-row,
.sec-actions, .pick-head, #scraper-keys .prow,
[class*="btn-row"], [class*="button-row"], [class*="button-row"] {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 8px;
}

/* Buttons inside such containers stay their natural size and never shrink
   into each other or collide with an adjacent input. */
.row > button, .toolbar button, .actions button, .btn-group button,
.row > a.btn, .toolbar a.btn, .actions a.btn, .btn-group a.btn,
#scraper-keys .prow button, .sec-actions button, .courier-row button,
button.mini, a.btn {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}

/* Long button labels wrap instead of overflowing the (pill) button/container. */
button, a.btn {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  padding-top: 0;
  padding-bottom: 0;
}
button, a.btn { min-height: 46px; }
button.mini, button.mini, a.btn.mini { min-height: 32px; }

/* Small inline/secondary buttons never fan out wider than their text needs. */
button.mini { white-space: nowrap; }

/* Section/row headers: keep the heading on its own line if buttons are wide,
   so the title and the controls never overlap. */
.sec-head, .pick-head { gap: 10px 14px; }

/* Input+button-in-row baseline alignment: buttons align with the field bottom
   instead of jumping to the top when a multi-line textarea is present. */
.row { align-items: flex-end; }
.row > *:only-child { align-self: center; }

/* Solid primary action ("Generate page copy") shouldn't stretch awkwardly but
   still fit on one line when the container is wide enough. */
.bigbtn { width: 100%; display: flex; align-items: center; justify-content: center; text-align: center; }

/* Back-to-top + sticky CTA are fixed-position and must not flex-wrap, but
   their internal text lines must still wrap so long product titles never
   burst past the viewport. */
.totop, .sticky-cta { flex: 0 0 auto !important; }
.totop { white-space: nowrap; }
.sticky-cta .sticky-line { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.sticky-cta .cta { flex: 0 0 auto; white-space: nowrap; }

/* Tiny screens: let every button take full available width in a row so two
   side-by-side buttons never squeeze together. */
@media (max-width: 480px) {
  .row > button, .section-editor .sec-actions button, .courier-row button { flex: 1 1 100%; }
}

/* ================================================================
   ADMIN COMPONENTS — calming, professional subscriber + stat UI
   ================================================================ */
/* Summary stat tiles (segment mix, subscriber counts, dashboards). */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat-tile b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.stat-tile span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
  display: block;
}

/* Status pills used in subscriber tables / lifecycle lists. */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.55;
}
.status-badge.role {
  background: linear-gradient(135deg, #eef1fd, #f5f7fd);
  color: #4f67e0;
  border: 1px solid #dbe2f2;
}
.status-badge.active { background: #e6f7f0; color: #0f8b5a; }
.status-badge.pending { background: #fdf3e1; color: #b26b00; }
.status-badge.unsub { background: #eef1f5; color: #7b8799; }
.status-badge.inactive { background: #eef1f5; color: #7b8799; }
.status-badge.ok { background: #e6f7f0; color: #0f8b5a; }
.status-badge.warn { background: #fdf3e1; color: #b26b00; }
.status-badge.err { background: #fdeaec; color: #c0392b; }

/* Subscriber manager: toolbar + table inside the card. */
.subs-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.subs-toolbar .grow { flex: 1 1 220px; min-width: 0; }
.subs-toolbar input[type="search"] { flex: 1 1 220px; min-width: 0; }
.bulkbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.bulkbar .hint { margin: 0; }

/* Subscriber + generic admin tables, calm and readable. */
.subs-table { margin-top: 4px; }
.subs-table th { position: sticky; top: 0; }
.subs-table td.vt, .subs-table th.vt { vertical-align: middle; }
.subs-table .mail { font-weight: 650; color: var(--text); word-break: break-all; }
.subs-table .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.subs-table tr.sel td { background: #f0f8fa; }
.subs-table .act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.subs-table input[type="checkbox"] { width: auto; height: auto; accent-color: var(--accent); cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); }

/* Centered numeric cells for tables. */
table.plain td.ct, table.plain th.ct, .ct { text-align: right; }

/* Saved-niches tables (refresh page): the keyword is *text*, not a count, so it
   must sit flush left under its heading instead of n8n/right-aligning like the
   numeric cells; products column stays centred for a tidy grid. */
table.plain td.kw { text-align: left; }
table.plain td.np { text-align: center; }

/* Keep the recipient picker chips tidy and on-brand. */
.chipsrow {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfcfe;
}
.subchip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 13px;
  background: #fff;
  margin: 4px 0;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.subchip:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring-soft); }
.subchip input { width: auto; height: auto; }
.subchip .mail { font-weight: 600; font-size: 13px; }
.subchip .kw { color: var(--muted); font-size: 11.5px; }
.subchip .st { margin-left: auto; font-size: 11px; color: var(--muted); }

/* Destructive ghost button (delete subscriber / inbox rows). */
button.ghost.mini.danger { color: #c0392b; border-color: #e6b8bc; }
button.ghost.mini.danger:hover { background: rgba(192, 57, 43, 0.07); box-shadow: none; }

/* ================================================================
   UI POLISH — calmer, more professional controls
   A quiet hierarchy: one primary per group, neutral secondary buttons,
   keyboard-visible focus. Keeps the teal / orange pills but stops them
   shouting over each other.
   ================================================================ */
/* Neutral secondary button: bordered, dark text — sits quietly next to a
   single primary (`button` default, `.warm`, `.btn`) without competing. */
button.btnline, a.btnline {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
}
button.btnline:hover, a.btnline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 139, 157, 0.12);
  transform: translateY(-1px);
  filter: none;
}
button.btnline:active, a.btnline:active { transform: translateY(0); }

/* Grouped action toolbars: a small uppercase label, a hairline divider,
   then wrapped buttons. No two buttons ever touch or wrap into each other. */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; row-gap: 10px; margin: 14px 0 4px;
}
.toolbar .tlb-title {
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--muted); padding: 0 4px; white-space: nowrap;
}
.toolbar .sep {
  width: 1px; height: 22px;
  background: var(--border); margin: 0 2px; flex: 0 0 auto;
}
.toolbar button, .toolbar a.btn { flex: 0 0 auto; }

/* Keyboard + AT visibility: crisp focus ring on every interactive control. */
:is(button, a.btn, a.chip, a.pg, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: inherit;
}
button:focus-visible { box-shadow: var(--ring); }

/* Calmer base controls: a touch smaller, quieter resting shadow. */
button { min-height: 42px; padding: 0 18px; font-size: 13.5px; box-shadow: 0 2px 10px rgba(28, 37, 55, 0.06); }
button:hover { box-shadow: 0 8px 20px rgba(15, 139, 157, 0.24); }
a.btn { min-height: 42px; padding: 0 18px; font-size: 13.5px; }
a.btn:hover { box-shadow: 0 8px 18px rgba(15, 139, 157, 0.24); }

@media (max-width: 520px) {
  .toolbar { align-items: stretch; }
  .toolbar .tlb-title, .toolbar .sep { align-self: center; }
  .toolbar > button, .toolbar > a.btn { flex: 1 1 100%; }
}