/* GBP Lens report pages. Warm SaaS theme: light orange and white, deep orange for actions.
   Contrast (WCAG AA): ink 17.5:1, muted 7.2:1, primary on white 5.2:1, white on primary 5.2:1. */
:root {
  --ink: #1c1917; --muted: #57534e; --line: #efe4da; --line-strong: #8c8279;
  --primary: #c2410c; --primary-dark: #9a3412; --accent: #ea580c; --tint: #fff7ed; --tint-2: #ffedd5;
  --bg: #fffaf5; --warn: #a16207; --bad: #b42318; --good: #067647;
  --ring: 0 0 0 2px #fff, 0 0 0 4px #c2410c;
  --shadow: 0 1px 2px rgba(124, 45, 18, .06), 0 4px 14px rgba(124, 45, 18, .06);
  /* old names, kept for scripts and settings page */
  --navy: var(--ink); --teal: var(--primary); --teal-soft: var(--tint);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #fff linear-gradient(180deg, #fff7ed 0, #fffaf5 260px, #ffffff 640px) no-repeat;
  background: #fff linear-gradient(180deg in oklch, #fff7ed 0, #ffffff 640px) no-repeat;
}
a { color: var(--primary); text-decoration: none; overflow-wrap: break-word; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
a:hover { text-decoration: underline; color: var(--primary-dark); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 24px;
  background: linear-gradient(90deg, #ffffff 0, #fff7ed 100%); border-bottom: 1px solid #fed7aa; color: var(--ink);
}
.brandwrap { display: flex; align-items: center; gap: 9px; }
.logo { width: 28px; height: 28px; flex: none; }
.brand { font-weight: 800; font-size: 18px; color: var(--ink); }
.brand span { color: var(--primary); }
.top-right { display: flex; gap: 8px; flex-wrap: wrap; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 26px; line-height: 1.25; margin: 4px 0 4px; text-wrap: balance; }
h1 small { color: var(--primary); font-weight: 700; }
h2 { font-size: 17px; margin: 0 0 12px; text-wrap: balance; }
h3 { font-size: 14px; margin: 14px 0 6px; }
p { text-wrap: pretty; }
.sub { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); }
.pad { padding: 30px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 0 0 16px; box-shadow: var(--shadow); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; align-items: center; }
.btn {
  cursor: pointer; display: inline-flex; align-items: center; min-height: 34px; border: 1px solid var(--primary-dark); border-radius: 9px; padding: 6px 14px;
  background: linear-gradient(180deg, #c2410c, #9a3412); color: #fff; font: 600 13px/1.4 inherit;
  box-shadow: 0 1px 2px rgba(124, 45, 18, .18); transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out, box-shadow .15s ease-out;
}
.btn:hover { background: linear-gradient(180deg, #ad3a0b, #7c2d12); text-decoration: none; color: #fff; }
.btn.sec { background: #fff; color: var(--primary); border-color: #f2b98f; box-shadow: none; }
.btn.sec:hover { background: var(--tint); color: var(--primary-dark); border-color: var(--primary); }
.btn.ghost { background: #fff; border-color: #fed7aa; color: var(--primary-dark); box-shadow: none; }
.btn.ghost:hover { background: var(--tint-2); color: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible { box-shadow: var(--ring); border-radius: 9px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid, .grid.two { grid-template-columns: 1fr; } }
.field .k { font-weight: 700; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.field .v { color: #292524; font-size: 13px; word-break: break-word; white-space: pre-line; }
.copy { cursor: pointer; border: 1px solid #e7d8ca; background: #fff; color: var(--muted); border-radius: 6px; font-size: 12px; padding: 0 6px; line-height: 18px; transition: color .15s ease-out, border-color .15s ease-out; }
.copy:hover { color: var(--primary); border-color: var(--primary); }
.scroll { max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
ul.plain { margin: 2px 0; padding-left: 16px; }
.price { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #e7f6ee; color: var(--good); font-size: 12px; font-weight: 700; white-space: nowrap; }
.svc-desc { color: var(--muted); font-size: 12px; margin: 1px 0 4px; white-space: normal; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #f5ede6; color: var(--ink); font-size: 12px; margin: 2px 4px 2px 0; }
.chip.primary { background: var(--primary); color: #fff; font-weight: 600; }
.chip.click { cursor: pointer; transition: background-color .15s ease-out; }
.chip.click:hover { background: var(--tint-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-top: 3px solid #fdba74; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat .n { font-size: 24px; font-weight: 800; color: var(--primary); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--tint); color: #44403c; font-size: 12px; white-space: nowrap; cursor: default; }
th.sort { cursor: pointer; }
th.sort:hover { background: var(--tint-2); }
tr.me td { background: var(--tint-2); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tablewrap th { position: sticky; top: 0; z-index: 1; }
.tablewrap { overflow: auto; max-height: 640px; border: 1px solid var(--line); border-radius: 10px; }
.ok { color: var(--good); font-weight: 700; }
.warn { color: var(--warn); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar2 { fill: #fdba74; }
.chart .grid { stroke: #f1e7de; stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; }
.dist { display: grid; grid-template-columns: 34px 1fr 54px; gap: 4px 8px; align-items: center; font-size: 12px; max-width: 420px; font-variant-numeric: tabular-nums; }
.dist .track { background: #f5ede6; border-radius: 4px; height: 10px; overflow: hidden; }
.dist .fill { background: var(--accent); height: 100%; }
.form { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=number], input[type=date], input[type=password], select, textarea { border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; font: 13px/1.4 inherit; color: var(--ink); background: #fff; }
textarea { width: 100%; min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #fed7aa; }
.w-s { width: 90px; } .w-m { width: 180px; } .w-l { width: 300px; }
.rankbig { font-size: 44px; font-weight: 800; color: var(--primary); line-height: 1; font-variant-numeric: tabular-nums; }
.gridmap { border-collapse: separate; border-spacing: 5px; width: auto; }
.gridmap td { width: 62px; height: 52px; text-align: center; vertical-align: middle; border-radius: 10px; border: 0; font-weight: 800; font-size: 17px; color: #fff; }
.r-a { background: #15803d; } .r-b { background: #65a30d; } .r-c { background: #d97706; } .r-d { background: #b42318; } .r-x { background: #94a3b8; }
.note { background: var(--tint); border: 1px solid #fed7aa; border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 0 0 14px; }
.err { background: #fde8e6; border-left: 4px solid var(--bad); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 10px 0; }
.links .field .v { font-size: 12px; }
.sec-title { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 13px; margin: 18px 0 12px; }
.sec-title::before, .sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stars { color: #ea580c; letter-spacing: 1px; white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; }
.viewer .live { display: none !important; }
.sharebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 8px 20px; background: var(--tint-2); border-bottom: 1px solid #fed7aa; font-size: 13px; }
.map { height: 400px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; z-index: 0; }
.map.short { height: 280px; } .map.tall { height: 480px; } .map.pick { height: 340px; cursor: crosshair; }
.mk span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font: 800 12px/1 system-ui, Arial, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); background: #94a3b8; }
.mk.r-a span { background: #15803d; } .mk.r-b span { background: #65a30d; } .mk.r-c span { background: #d97706; } .mk.r-d span { background: #b42318; }
.mk.me span { background: var(--accent); color: #fff; } .mk.ctr span { background: var(--ink); font-size: 9px; }
.leaflet-marker-icon.mk { background: none; border: 0; }
.leaflet-tooltip { font-size: 12px; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; display: none; z-index: 50; box-shadow: 0 6px 20px rgba(28, 25, 23, .25); }
.out { white-space: pre-wrap; background: var(--tint); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-height: 120px; font-size: 14px; }
/* ---------- client-ready presentation ---------- */
.loading { display: flex; align-items: center; gap: 10px; padding: 40px 0; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fed7aa; border-top-color: var(--primary); animation: gbpx-spin .8s linear infinite; }
@keyframes gbpx-spin { to { transform: rotate(360deg); } }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.meta-i { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; box-shadow: 0 1px 2px rgba(124, 45, 18, .05); }
.meta-k { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.toc { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(124, 45, 18, .05); }
.toc-in { max-width: 1180px; margin: 0 auto; padding: 8px 20px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.toc a { flex: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #44403c; white-space: nowrap; transition: background-color .15s ease-out, color .15s ease-out; }
.toc a:hover { background: var(--tint); color: var(--primary-dark); text-decoration: none; }
.toc a[aria-current="true"] { background: var(--tint-2); color: var(--primary-dark); }
.card[id] { scroll-margin-top: 64px; }
.card > h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, #fb923c, #c2410c); flex: none; }
.foot { border-top: 1px solid var(--line); background: #fff; }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 16px 20px 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; font-size: 13px; color: var(--ink); }
.print-head { display: none; }
.posts-table.collapsed .more-row { display: none; }
.posts-table td:last-child { min-width: 320px; }
/* status words in tables become badges; status cells get a coloured dot */
table span.ok, table span.warn, table span.bad { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; line-height: 1.6; white-space: nowrap; }
table span.ok { background: #e7f6ee; }
table span.warn { background: #fdf3d8; }
table span.bad { background: #fdecea; }
td.ok, td.warn, td.bad { white-space: nowrap; }
td.ok::before, td.warn::before, td.bad::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: currentColor; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
@page { margin: 14mm 12mm; }
@media print {
  .toc, .foot .muted { display: none !important; }
  .print-head { display: flex; justify-content: space-between; padding: 0 0 10px; margin: 0 0 14px; border-bottom: 2px solid #ea580c; font-size: 12px; font-weight: 700; color: #1c1917; }
  .foot { border: 0; }
  .meta-i { box-shadow: none; }
  /* scroll boxes (also ones with an inline max-height) print in full, so nothing overlaps the next section */
  .tablewrap, .scroll, .cp-list, [style*="max-height"] { max-height: none !important; overflow: visible !important; }
  th, .tablewrap th, .cp-list th { position: static !important; }
  .posts-table .more-row { display: none !important; }
  .more-toggle { display: none !important; }
  /* tool sections that were not run stay out of the PDF */
  .card:has(#rb-out:empty), .card:has(#n-out:empty), .card:has(#a-out:empty), .card:has(#g-out:empty), .card:has(#ph-out:empty), .card:has(#v-out:empty) { display: none !important; }
  table { break-inside: auto; } tr { break-inside: avoid; } thead { display: table-header-group; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .leaflet-control-zoom { display: none !important; }
  table span.ok, table span.warn, table span.bad { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* competitor picker and research */
dialog.cp { width: min(920px, 94vw); max-height: 90vh; padding: 0; border: 1px solid #fed7aa; border-radius: 16px; box-shadow: 0 24px 60px rgba(28, 25, 23, .25); color: var(--ink); }
dialog.cp::backdrop { background: rgba(28, 25, 23, .45); }
.cp-in { padding: 18px 22px 16px; display: flex; flex-direction: column; max-height: 88vh; }
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cp-head h2 { margin: 0; }
.cp-list { overflow: auto; max-height: 46vh; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; }
.cp-list .note { margin: 10px; }
.cp-list th { position: sticky; top: 0; z-index: 1; }
.cp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cp-foot #cp-busy { flex: 1 1 200px; }
.cp-opt { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.cp-count { font-size: 13px; font-variant-numeric: tabular-nums; }
ol.acts { list-style: none; margin: 0; padding: 0; counter-reset: a; }
ol.acts li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
ol.acts li:last-child { border-bottom: 0; }
.pri { flex: none; min-width: 64px; text-align: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pri-high { background: #fdecea; color: var(--bad); } .pri-medium { background: #fdf3d8; color: var(--warn); } .pri-low { background: #e7f6ee; color: var(--good); }
td.best { color: var(--good); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print { .map { break-inside: avoid; } .top, .sharebar, .toolbar, .copy, .btn, .pager, .viewer .live { display: none !important; }
#toast { display: none !important; } body { background: #fff; } .card { box-shadow: none; } .stat, .field, tr, .meta-i, .note { break-inside: avoid; } h2, h3 { break-after: avoid; } .scroll, .tablewrap { max-height: none; overflow: visible; } }
