* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:#f4f6f8; color:#1c2530; }
header { display:flex; align-items:center; justify-content:space-between;
  background:#13283d; color:#fff; padding:12px 22px; }
header .brand a { color:#fff; text-decoration:none; font-weight:700; font-size:18px; }
header nav a { color:#cfe0f0; text-decoration:none; margin-left:18px; }
header nav a:hover { color:#fff; }
header nav .navuser { color:#9fd0a0; margin-left:18px; font-size:13px; }
.auth { max-width:420px; margin:40px auto; }
.auth label { margin-bottom:14px; }
.badge { padding:2px 9px; border-radius:10px; font-size:12px; font-weight:600; }
.badge.pending { background:#fff3cd; color:#856404; }
.badge.approved { background:#d4edda; color:#1c7430; }
.badge.suspended { background:#f8d7da; color:#a11; }
.adminacts { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.adminacts .inlineform { display:inline-flex; gap:4px; align-items:center; }
.mini { padding:5px 10px; font-size:12px; background:#e7eef6; color:#1c3a5e; }
.mini.ok { background:#2e9e3f; color:#fff; } .mini.warn { background:#e8941a; color:#fff; }
.credinput { width:70px; padding:5px 6px; border:1px solid #cdd8e3; border-radius:6px; font-size:12px; }
main { max-width:1700px; margin:18px auto; padding:0 28px; }
footer { text-align:center; color:#90a0b0; padding:24px; font-size:12px; }

.card { background:#fff; border:1px solid #e2e8ee; border-radius:10px; padding:18px; margin-bottom:18px; }
.card.nopad { padding:0; overflow:hidden; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media (max-width:860px){ .grid2 { grid-template-columns:1fr; } }

h2 { margin:0 0 12px; } h3 { margin:0 0 10px; }
label { display:block; font-size:13px; font-weight:600; color:#33485e; margin-bottom:12px; }
label input, label select { width:100%; margin-top:5px; padding:9px 10px; border:1px solid #cdd8e3;
  border-radius:7px; font-size:14px; font-weight:400; }
.row { display:flex; gap:12px; } .row label { flex:1; }
.req { color:#d33; }
.btnrow { display:flex; gap:10px; margin-top:4px; }
button, .btn { cursor:pointer; border:0; border-radius:7px; padding:10px 16px; font-size:14px;
  font-weight:600; text-decoration:none; display:inline-block; }
#previewBtn, #saveBizBtn { background:#e7eef6; color:#1c3a5e; }
#runBtn, .btn { background:#2e9e3f; color:#fff; }
.btn:hover, #runBtn:hover { background:#268235; }
.hint { font-size:12px; color:#6b7c8d; margin:12px 0 0; }
.status { font-size:13px; margin-top:8px; min-height:18px; }
.status.err { color:#d33; } .status.ok { color:#2e9e3f; }
.pbar { position:relative; height:24px; background:#e7eef6; border-radius:12px; overflow:hidden; margin-top:6px; }
.pfill { position:absolute; left:0; top:0; bottom:0; background:linear-gradient(90deg,#2e9e3f,#5ac46d);
  transition:width .3s ease; }
.ptext { position:absolute; left:0; right:0; top:0; line-height:24px; text-align:center;
  font-size:12px; font-weight:600; color:#13283d; }
.pfill.scanning { width:40%; background:linear-gradient(90deg,#2e9e3f,#5ac46d);
  animation:indet 1.1s ease-in-out infinite; }
@keyframes indet { 0%{margin-left:-40%} 100%{margin-left:100%} }

.map { width:100%; height:520px; } .map.tall { height:560px; } .map.huge { height:680px; }

/* results: big map + point panel */
.map-row { display:grid; grid-template-columns:1.7fr 1fr; gap:18px; margin-bottom:18px; }
@media (max-width:900px){ .map-row { grid-template-columns:1fr; } }
.pointpanel { max-height:720px; overflow:auto; }
#ptComps tr.target { background:#eafaef; }
#ptComps tr.target b { color:#2e9e3f; }

/* timeline strip */
.timeline-card { padding:14px 18px; }
.tl-head { margin-bottom:10px; }
.timeline { display:flex; gap:10px; overflow-x:auto; padding:6px 2px; align-items:flex-end; }
.tldot { flex:0 0 auto; width:44px; text-align:center; text-decoration:none; border-radius:8px;
  padding:8px 4px; color:#fff; box-shadow:0 1px 3px rgba(0,0,0,.2); position:relative; opacity:.9; }
.tldot:hover { opacity:1; transform:translateY(-2px); }
.tldot.cur { outline:3px solid #13283d; outline-offset:1px; opacity:1; }
.tldot .tlval { display:block; font-weight:700; font-size:15px; }
.tldot .tldate { display:block; font-size:10px; opacity:.9; }

/* businesses page */
.biz .bizhdr { display:flex; justify-content:space-between; align-items:flex-start; }
.linkbtn { background:none; color:#d33; padding:4px 8px; }
.kwlist { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.kwchip { display:inline-flex; align-items:center; gap:6px; background:#eef5ff; border:1px solid #cfe0f5;
  border-radius:16px; padding:5px 6px 5px 12px; font-size:13px; }
.kwchip a { color:#1769c0; text-decoration:none; font-weight:600; }
.kx { background:#dbe7f5; color:#3a5a7a; border-radius:50%; width:18px; height:18px; line-height:1;
  padding:0; font-size:13px; }
.kwsched { font-size:11px; padding:2px 4px; border:1px solid #cfe0f5; border-radius:6px; background:#fff; color:#3a5a7a; }
.kwadd { display:flex; gap:8px; align-items:center; margin-top:4px; }
.kwadd .kwinput { flex:1; max-width:340px; padding:8px 10px; border:1px solid #cdd8e3; border-radius:7px; }
.add-kw { background:#2e9e3f; color:#fff; } .suggest-kw { background:#f0e6ff; color:#5a2ea6; }
.kwsuggest { margin-top:12px; }
.sugtitle { font-size:13px; margin-bottom:8px; }
.sugchip { display:inline-flex; flex-direction:column; align-items:flex-start; gap:1px;
  background:#fff; border:1px solid #cdd8e3; border-radius:8px; padding:6px 10px; margin:0 6px 6px 0;
  cursor:pointer; font-size:13px; color:#1c2530; }
.sugchip:hover { border-color:#2e9e3f; background:#f3fbf4; }
.sugchip.local { border-color:#7a2ea6; }
.sugchip small { color:#90a0b0; font-size:11px; }
.sugchip.added { opacity:.5; }

/* AI analysis card */
.ai-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.aitext { white-space:pre-wrap; line-height:1.55; font-size:14px; color:#26323d; }

/* delta badges under metric numbers */
.metric small.up { color:#2e9e3f; font-weight:600; }
.metric small.down { color:#d33; font-weight:600; }
.metric small.flat { color:#90a0b0; }
td.up { color:#2e9e3f; font-weight:600; } td.down { color:#d33; font-weight:600; }

.tbl { width:100%; border-collapse:collapse; font-size:13px; }
.tbl th, .tbl td { text-align:left; padding:8px 10px; border-bottom:1px solid #eef2f6; }
.tbl th { color:#6b7c8d; font-weight:600; }
.muted { color:#90a0b0; } .tbl a { color:#1769c0; }

.scanhead { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:14px; }
.scanhead h2 { margin:0; } .exports .btn { margin-left:8px; }
.bizprofile { margin:4px 0 2px; font-size:13px; color:#33485e; }
.bizprofile b { color:#13283d; }
.bizprofile .star { color:#e0a800; font-weight:600; margin-left:8px; }
.bizprofile .tag { background:#eef2f6; color:#33485e; padding:2px 8px; border-radius:10px; margin-left:8px; font-size:12px; }
.bizprofile .addr { color:#7a8b9a; margin-left:8px; }
.cards4 { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
@media (max-width:700px){ .cards4 { grid-template-columns:repeat(2,1fr); } }
.metric { background:#fff; border:1px solid #e2e8ee; border-radius:10px; padding:14px; text-align:center; }
.metric span { font-size:12px; color:#6b7c8d; text-transform:uppercase; letter-spacing:.5px; }
.metric b { display:block; font-size:30px; margin:4px 0; color:#13283d; }
.metric small { color:#90a0b0; font-size:11px; }

.legend { font-size:12px; color:#6b7c8d; margin-top:12px; }
.dot { display:inline-block; width:12px; height:12px; border-radius:50%; margin:0 4px 0 12px; vertical-align:middle; }
.dot.g{background:#2e9e3f}.dot.y{background:#f2c200}.dot.o{background:#ef7d00}.dot.r{background:#d33}.dot.x{background:#9e9e9e}
.gridlbl { background:transparent!important; border:0!important; box-shadow:none!important;
  color:#fff; font-weight:700; font-size:12px; text-align:center; text-shadow:0 1px 1px rgba(0,0,0,.35);
  pointer-events:none!important; }
/* #1 star marker (Local-Dominator style): kill leaflet's default div-icon box */
.leaflet-marker-icon.star1mk { background:transparent!important; border:0!important;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
#ptComps a.gbplink { text-decoration:none; color:#94a3b8; font-weight:600; margin-left:3px; }
#ptComps a.gbplink:hover { color:#1769c0; }
/* history "In progress" mini progress bar */
.jobprog { height:6px; background:#e6ecf3; border-radius:4px; margin:6px 0 3px; max-width:200px; overflow:hidden; }
.jobprog-fill { height:100%; background:#2fa343; border-radius:4px; transition:width .4s; min-width:3px; }
.kwsug { margin:0 0 10px; }

/* rank distribution bar */
.distrib-card h3 small { font-weight:400; }
.distbar { display:flex; width:100%; height:30px; border-radius:8px; overflow:hidden; margin:6px 0 12px; background:#eef2f6; }
.distseg { display:flex; align-items:center; justify-content:center; color:#fff; font-size:12px;
  font-weight:700; min-width:0; transition:width .3s ease; }
.distlegend { display:flex; flex-wrap:wrap; gap:14px; font-size:13px; color:#33485e; }
.distleg { display:inline-flex; align-items:center; gap:6px; }
.dot2 { display:inline-block; width:11px; height:11px; border-radius:3px; }

/* timeline play button */
.tl-head { display:flex; align-items:center; gap:10px; }
#playBtn { margin-left:auto; }

/* compare page */
.cmp-pick label { flex:1; }
.btn.alt { background:#e7eef6; color:#1c3a5e; }
.cmp-summary { font-size:14px; }
#cmpMetrics .metric b { font-size:20px; }

/* trend controls */
.trend-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.trend-ctrl { display:flex; align-items:center; gap:10px; }
.trend-ctrl .chk { display:inline-flex; align-items:center; gap:4px; font-size:13px; font-weight:600;
  color:#33485e; margin:0; }
.trend-ctrl .chk input { width:auto; margin:0; }
.tsep { width:1px; height:18px; background:#d6dee6; }
.ctype { background:#e7eef6; color:#1c3a5e; }
.ctype.active { background:#13283d; color:#fff; }

#kwBox { width:100%; margin-top:5px; padding:9px 10px; border:1px solid #cdd8e3; border-radius:7px;
  font-size:14px; font-family:inherit; resize:vertical; }

/* client-ready report */
.rep-head { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:14px; }
.rep-head h2 { margin:0 0 4px; }
.summary-card .aitext { white-space:pre-wrap; line-height:1.55; font-size:14px; }
.repfoot { margin-top:16px; font-size:11px; }
.apikey { display:inline-block; background:#13283d; color:#7fe0a0; padding:6px 10px; border-radius:6px;
  font-size:13px; word-break:break-all; }
@media print {
  header, footer, nav, .noprint { display:none !important; }
  main { max-width:100%; margin:0; padding:0; }
  .card { break-inside:avoid; box-shadow:none; }
  body { background:#fff; }
}

/* admin credit pool */
.poolcard .poolbig { font-size:34px; font-weight:700; color:#13283d; margin:6px 0 14px; }
.poolcard .poolbig span { font-size:14px; font-weight:400; color:#6b7c8d; }
.poolcard .poolusd { display:block; font-size:13px; color:#2e9e3f; font-weight:600; margin-top:2px; }
.loadform { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.loadform label { flex:0 0 220px; margin-bottom:0; }
.loadhint { font-size:14px; font-weight:600; color:#2e9e3f; }

/* movers / rank-drop panel */
.movers { display:flex; flex-wrap:wrap; gap:10px; }
.mover { display:inline-flex; flex-direction:column; gap:2px; border:1px solid #e2e8ee; border-radius:9px;
  padding:8px 12px; font-size:13px; min-width:150px; }
.mover.drop { border-left:4px solid #d33; } .mover.gain { border-left:4px solid #2e9e3f; }
.mover b { color:#13283d; } .mover .mv { font-weight:700; }
.mover .mv.down { color:#d33; } .mover .mv.up { color:#2e9e3f; }

/* pre-scan cost estimate + low-balance + sanity banner */
.costline { font-size:13px; color:#33485e; margin:4px 0 0; }
.costline b { color:#13283d; } .costline b.lowbal { color:#d33; }
.sanity { background:#fff3cd; border:1px solid #ffe69c; color:#7a5b00; border-radius:10px;
  padding:12px 16px; margin-bottom:18px; font-size:13px; line-height:1.5; }
.sanity code { background:#fff; padding:1px 5px; border-radius:4px; border:1px solid #e6d8a8; }

/* scan note */
.notebox { width:100%; min-height:60px; padding:9px 10px; border:1px solid #cdd8e3; border-radius:7px;
  font-size:14px; font-family:inherit; resize:vertical; }

/* history filter + note cell + competitor overlay toggles */
.histfilter { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:12px; }
.histfilter .kwinput { flex:1; max-width:320px; padding:8px 10px; border:1px solid #cdd8e3; border-radius:7px; }
.histfilter .chk { display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:#33485e; margin:0; }
.histfilter .chk input { width:auto; margin:0; }
.notecell { color:#6b7c8d; font-size:12px; max-width:220px; }
.comp-toggles { margin-top:12px; font-size:13px; display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.comp-toggles .chk { display:inline-flex; align-items:center; gap:4px; font-weight:600; color:#33485e; margin:0; }
.comp-toggles .chk input { width:auto; margin:0; }

/* business autocomplete */
label.rel { position:relative; }
.fieldhint { display:block; font-weight:400; color:#90a0b0; font-size:11px; margin-top:3px; min-height:13px; }
.suggest { position:absolute; left:0; right:0; top:100%; z-index:1200; background:#fff;
  border:1px solid #cdd8e3; border-top:0; border-radius:0 0 7px 7px; max-height:260px; overflow:auto;
  box-shadow:0 6px 16px rgba(0,0,0,.12); display:none; }
.suggest.open { display:block; }
.suggest .item { padding:8px 10px; cursor:pointer; border-bottom:1px solid #f0f3f6; }
.suggest .item:hover, .suggest .item.active { background:#eef5ff; }
.suggest .item b { font-weight:600; font-size:13px; color:#1c2530; }
.suggest .item span { display:block; font-size:11px; color:#7a8b9a; font-weight:400; }
.suggest .loading { padding:8px 10px; color:#90a0b0; font-size:12px; }

/* ===================== premium refresh (v5) - overrides, classes unchanged ===================== */
body { font-family:'Inter',-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:#f5f8fb; color:#0f172a; letter-spacing:-.01em; -webkit-font-smoothing:antialiased; }
header { box-shadow:0 2px 16px rgba(15,23,42,.14); padding:14px 26px; }  /* keep brand_color bg */
header .brand a { letter-spacing:-.02em; font-size:19px; }
header nav a { font-weight:600; font-size:14px; padding:7px 11px; border-radius:9px; transition:.15s; margin-left:6px; }
header nav a:hover { background:rgba(255,255,255,.12); color:#fff; }
header nav .navuser { color:#a8e0b6; }
.card { border:1px solid #e7edf3; border-radius:16px;
  box-shadow:0 1px 2px rgba(15,23,42,.04), 0 14px 32px -22px rgba(15,23,42,.3); }
h2 { font-weight:800; letter-spacing:-.025em; } h3 { font-weight:700; letter-spacing:-.015em; }
label input, label select, .notebox, #kwBox, .credinput, .kwinput {
  border:1px solid #d7e0ea; border-radius:9px; transition:border-color .15s, box-shadow .15s; }
label input:focus, label select:focus, .notebox:focus, #kwBox:focus, .credinput:focus, .kwinput:focus {
  outline:none; border-color:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,.16); }
button, .btn { border-radius:10px; font-weight:600; transition:transform .16s, background .16s, box-shadow .16s; letter-spacing:-.01em; }
#runBtn, .btn { background:linear-gradient(135deg,#10b981,#059669); box-shadow:0 8px 18px -8px rgba(16,185,129,.55); }
#runBtn:hover, .btn:hover { background:linear-gradient(135deg,#0ea372,#048257); transform:translateY(-1px); }
.btn.alt { background:#eef3f8; color:#13283d; box-shadow:none; }
.btn.alt:hover { background:#e3ecf5; color:#0b1f38; }
#previewBtn, #saveBizBtn { background:#eef3f8; color:#1c3a5e; }
#previewBtn:hover, #saveBizBtn:hover { background:#e3ecf5; }
.mini { border-radius:8px; font-weight:600; }
.metric { border:1px solid #e7edf3; border-radius:16px; box-shadow:0 1px 2px rgba(15,23,42,.05); transition:.18s; }
.metric:hover { box-shadow:0 12px 26px -16px rgba(15,23,42,.32); transform:translateY(-2px); }
.metric b { font-weight:800; letter-spacing:-.02em; color:#0b1f38; }
.metric span { letter-spacing:.5px; }
.tbl th { font-weight:700; color:#64748b; text-transform:uppercase; font-size:11px; letter-spacing:.04em; }
.tbl td { border-bottom:1px solid #eef2f6; }
.tbl tr:hover td { background:#fafcfe; }
.badge { border-radius:20px; padding:3px 11px; }
.scanhead h2 { font-size:26px; }
footer { color:#94a3b8; } footer a { color:#94a3b8; }

/* ===================== print: client report fits the page cleanly ===================== */
@media print {
  header, footer, .noprint, .exports, #shareBtn, .timeline-card, .pointpanel,
  .post-related, .post-cta { display:none !important; }
  main { max-width:100% !important; margin:0 !important; padding:0 !important; }
  body { background:#fff; }
  .card { box-shadow:none !important; border:1px solid #dfe6ee; break-inside:avoid; page-break-inside:avoid; margin-bottom:12px; }
  .cards4 { grid-template-columns:repeat(4,1fr) !important; }
  .map, .map.tall, .map.huge { height:430px !important; }
  .map-row { grid-template-columns:1fr !important; }
  a { color:#0f172a !important; text-decoration:none !important; }
  .summary-card, .distrib-card, #map, #trendChart { break-inside:avoid; page-break-inside:avoid; }
}

/* ============================================================
   v6 - PREMIUM APP SHELL (sidebar + topbar) + DASHBOARD
   ============================================================ */
.has-shell { background:#eef1f5; }
.ico { width:18px; height:18px; flex:0 0 auto; }

.app-shell { display:grid; grid-template-columns:248px 1fr; min-height:100vh; }

/* ---- Sidebar ---- */
.app-sidebar {
  background:var(--brand);
  background:linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, #000 0%), color-mix(in srgb, var(--brand) 80%, #000 20%));
  color:#dbe6f1; display:flex; flex-direction:column; position:sticky; top:0; height:100vh;
  box-shadow:2px 0 14px rgba(15,23,42,.10); z-index:40;
}
.sb-brand { padding:20px 20px 14px; }
.sb-brand a { color:#fff; text-decoration:none; font-weight:800; font-size:18px; display:flex; align-items:center; gap:9px; letter-spacing:-.2px; }
.sb-brand img { height:30px; }
.sb-brand .sb-logo { font-size:20px; }
.sb-nav { flex:1; overflow-y:auto; padding:6px 12px 12px; }
.sb-group { font-size:10.5px; font-weight:800; letter-spacing:.10em; text-transform:uppercase;
  color:rgba(255,255,255,.42); padding:16px 10px 7px; }
.sb-nav a { display:flex; align-items:center; gap:11px; color:#c6d4e3; text-decoration:none;
  font-size:14px; font-weight:600; padding:9.5px 12px; border-radius:9px; margin-bottom:2px; transition:.13s; }
.sb-nav a:hover { background:rgba(255,255,255,.09); color:#fff; }
.sb-nav a.active { background:rgba(255,255,255,.15); color:#fff; box-shadow:inset 3px 0 0 #4ade80; }
.sb-nav a .ico { opacity:.85; }
.sb-nav a.active .ico { opacity:1; color:#7ef0a0; }
.sb-foot { padding:12px; border-top:1px solid rgba(255,255,255,.10); }
.sb-credits { display:flex; align-items:center; gap:10px; text-decoration:none; margin-bottom:10px;
  padding:10px 12px; border-radius:10px; background:rgba(47,163,67,.16); border:1px solid rgba(47,163,67,.35);
  color:#dff3e4; transition:.15s; }
.sb-credits:hover { background:rgba(47,163,67,.26); }

/* ---- campaign cockpit ---- */
.camp-timeline { position:relative; padding:18px 18px 6px; }
.camp-line { position:absolute; left:34px; right:34px; top:27px; height:3px; background:#dce4ec; border-radius:2px; }
.camp-dots { position:relative; display:flex; justify-content:space-between; }
.camp-dot { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; text-decoration:none; }
.camp-dot .cd-pt { width:14px; height:14px; border-radius:50%; background:#fff; border:3px solid #b9c6d4; box-shadow:0 0 0 3px #fff; transition:.15s; }
.camp-dot .cd-date { font-size:12px; color:#64748b; }
.camp-dot:hover .cd-pt { border-color:#2fa343; }
.camp-dot.sel .cd-pt { width:20px; height:20px; background:#2fa343; border-color:#2fa343; }
.camp-dot.sel .cd-date { color:#1f8a36; font-weight:600; }
.camp-kws { display:flex; gap:8px; flex-wrap:wrap; }
.camp-kw { display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:8px 12px; border:1px solid #e0e7ef;
  border-radius:10px; background:#fff; cursor:pointer; transition:.15s; text-align:left; }
.camp-kw:hover { border-color:#bcd; }
.camp-kw.sel { border:2px solid #2fa343; background:#f1faf3; }
.camp-kw .ck-name { font-size:14px; font-weight:600; color:#13283d; }
.camp-kw .ck-meta { font-size:11px; color:#64748b; }
.ck-top3 { display:inline-block; width:7px; height:7px; border-radius:50%; background:#2fa343; margin-right:6px; vertical-align:middle; }
.camp-dots.one { justify-content:center; }
/* one-fold cockpit: keyword list (left) + map & metrics (right), no scroll */
.camp-cockpit { display:flex; gap:16px; align-items:flex-start; margin-top:12px; }
.camp-kws-col { width:288px; flex:none; display:flex; flex-direction:column; gap:6px; max-height:498px; overflow-y:auto; padding-right:4px; }
.camp-kws-head { font-size:12px; color:#64748b; text-transform:uppercase; letter-spacing:.04em; margin-bottom:2px; }
.camp-kws-head .muted { text-transform:none; letter-spacing:0; }
.camp-kws-col .camp-kw { width:100%; }
.camp-main { flex:1; min-width:0; max-width:600px; }
.camp-mapwrap { position:relative; }
.camp-mapwrap #map { width:100%; height:430px; border-radius:12px; border:1px solid #e6ecf3; background:#eef2f6; }
.camp-maptitle { position:absolute; top:8px; left:8px; z-index:500; background:rgba(255,255,255,.93); padding:4px 10px; border-radius:8px; font-size:13px; font-weight:600; color:#13283d; box-shadow:0 1px 3px rgba(0,0,0,.12); }
.camp-openrep { position:absolute; top:8px; right:8px; z-index:500; padding:4px 11px; font-size:12px; }
.camp-metrics { margin-top:10px; }
@media (max-width:860px){ .camp-cockpit{ flex-direction:column; } .camp-kws-col{ width:100%; max-height:none; flex-direction:row; flex-wrap:wrap; } .camp-kws-col .camp-kw{ width:auto; } .camp-main{ max-width:none; } }
/* report-as-campaign: sticky control bar + overview strip */
.camp-sticky { position:sticky; top:0; z-index:600; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background:#fff; border:1px solid #e6ecf3; border-radius:10px; padding:8px 12px; margin:10px 0 8px; box-shadow:0 3px 12px rgba(16,33,58,.08); }
.cs-biz { font-weight:600; color:#13283d; font-size:13px; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cs-kw { padding:7px 10px; border:1px solid #cfd8e3; border-radius:8px; font-size:14px; max-width:300px; background:#fff; }
.cs-dates { display:flex; gap:5px; flex-wrap:wrap; }
.cs-date { font-size:12px; padding:4px 9px; border-radius:7px; background:#f1f5f9; color:#475569; text-decoration:none; }
.cs-date.sel { background:#2fa343; color:#fff; font-weight:600; }
.cs-actions { display:flex; gap:6px; margin-left:auto; }
.cs-actions .btn { padding:5px 11px; font-size:13px; }
.camp-overview { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 6px; }
.ov-kw { display:flex; flex-direction:column; align-items:flex-start; gap:1px; padding:6px 11px; border:1px solid #e0e7ef; border-radius:9px; background:#fff; cursor:pointer; text-align:left; }
.ov-kw:hover { border-color:#bcd; }
.ov-kw.sel { border:2px solid #2fa343; background:#f1faf3; }
.ov-name { font-size:13px; font-weight:600; color:#13283d; }
.ov-meta { font-size:11px; color:#64748b; }
/* structured AI report: severity-tagged recommendations, vulnerable competitors, geo gap */
.rec-list { display:flex; flex-direction:column; gap:7px; }
.rec-row { display:flex; gap:9px; align-items:flex-start; font-size:14px; line-height:1.45; }
.sev { flex:none; font-size:10px; font-weight:700; letter-spacing:.04em; padding:2px 7px; border-radius:5px; margin-top:2px; }
.sev-major { background:#fde7e7; color:#b3261e; }
.sev-minor { background:#eef2f7; color:#5a6b7e; }
.geo-gap { margin:12px 0 0; padding:9px 12px; background:#f1f7ff; border:1px solid #cfe2f7; border-radius:8px; font-size:13.5px; }
.vc-list { display:flex; flex-direction:column; gap:6px; }
.vc-row { font-size:14px; line-height:1.4; }
.cs-kw.loading { opacity:.55; }
/* cost-preview modal (campaign Run) */
.modal-back { position:fixed; inset:0; background:rgba(16,28,45,.45); z-index:2000; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal-box { background:#fff; border-radius:14px; padding:20px 22px; max-width:420px; width:100%; box-shadow:0 18px 50px rgba(16,28,45,.3); }
.modal-box h3 { margin:0 0 8px; }
.run-camp:disabled { opacity:.6; cursor:default; }
/* dashboard leaderboard (rank movers) */
.lb-cols { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:18px; }
@media (max-width:760px){ .lb-cols{ grid-template-columns:1fr; } }
.lb-list { display:flex; flex-direction:column; }
.lb-row { display:flex; align-items:center; gap:10px; padding:8px 4px; border-top:1px solid #eef2f6; text-decoration:none; color:#13283d; }
.lb-row:first-child { border-top:0; }
.lb-row:hover { background:#f7fafc; }
.lb-kw { flex:1; font-size:14px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lb-delta { font-size:13px; font-weight:700; white-space:nowrap; }
.lb-delta.up { color:#1f8a36; }
.lb-delta.down { color:#c0392b; }
.lb-arp { font-size:12px; color:#64748b; min-width:54px; text-align:right; }
/* near-real Google Maps look: full-colour tiles (no grey wash) so the map is clear and
   recognisable; a barely-there white veil keeps the coloured rank pins crisp on top. */
.leaflet-tile-pane { filter: saturate(0.97); }
.leaflet-tile-pane::after { content:""; position:absolute; inset:0; background:rgba(255,255,255,.06); pointer-events:none; }
.gridlbl { font-weight:800 !important; font-size:14px !important; color:#fff !important; text-shadow:0 1px 3px rgba(0,0,0,.75); }
.gridlbl::before { display:none !important; }
.rep-spin { width:38px; height:38px; margin:6px auto 2px; border:4px solid #e2e8ee; border-top-color:#2fa343; border-radius:50%; animation:repspin 0.8s linear infinite; }
@keyframes repspin { to { transform:rotate(360deg); } }
.sb-credits svg { width:18px; height:18px; flex:none; color:#5fd07c; }
.sb-cred-meta { display:flex; flex-direction:column; line-height:1.2; font-size:13px; }
.sb-cred-meta b { font-size:16px; color:#fff; }
.sb-cred-meta small { color:#9fc6ab; font-size:11px; margin-top:1px; }
.sb-user { display:flex; align-items:center; gap:10px; padding:6px 8px 10px; }
.sb-ava { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#4ade80,#22a55b);
  color:#06250f; font-weight:800; display:flex; align-items:center; justify-content:center; font-size:15px; flex:0 0 auto; }
.sb-meta { overflow:hidden; line-height:1.25; }
.sb-meta b { display:block; color:#fff; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb-meta span { font-size:11px; color:rgba(255,255,255,.5); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }
.sb-logout { display:flex; align-items:center; gap:8px; color:#cbd8e6; text-decoration:none; font-size:13px;
  font-weight:600; padding:9px 10px; border-radius:8px; }
.sb-logout:hover { background:rgba(255,80,80,.18); color:#ffd9d9; }

/* ---- Topbar ---- */
.app-body { display:flex; flex-direction:column; min-width:0; }
.app-topbar { position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:14px;
  background:rgba(255,255,255,.86); backdrop-filter:blur(10px); border-bottom:1px solid #e3e9f0;
  padding:0 26px; height:62px; }
.tb-burger { display:none; background:none; color:#33485e; padding:6px; }
.tb-title { font-size:18px; font-weight:800; color:#10233a; letter-spacing:-.2px; }
.tb-actions { margin-left:auto; display:flex; align-items:center; gap:12px; }
.tb-credits { display:flex; align-items:center; gap:7px; background:#eef6f0; color:#1c6b35;
  border:1px solid #cfe9d6; padding:7px 13px; border-radius:30px; font-size:13px; text-decoration:none; font-weight:600; }
.tb-credits b { font-size:14px; } .tb-credits .ico { width:16px; height:16px; }
.tb-credits:hover { background:#e3f1e8; }
.tb-cta { display:flex; align-items:center; gap:7px;
  background:linear-gradient(135deg,#2fa343,#1f8a36); color:#fff; padding:9px 16px; border-radius:9px;
  font-size:14px; font-weight:700; text-decoration:none; box-shadow:0 4px 12px rgba(34,140,60,.28); }
.tb-cta:hover { filter:brightness(1.06); }
.tb-cta .ico { width:16px; height:16px; }

.app-main { max-width:1500px; width:100%; margin:0 auto; padding:26px 32px 60px; }

/* ---- scrim for mobile sidebar ---- */
.sb-scrim { display:none; position:fixed; inset:0; background:rgba(8,15,28,.5); z-index:35; }
.sb-scrim.show { display:block; }

/* ---- auth (logged-out) top bar ---- */
.auth-top { display:flex; align-items:center; justify-content:space-between; padding:14px 26px; color:#fff; }
.auth-top .brand a { color:#fff; text-decoration:none; font-weight:800; font-size:18px; }
.auth-top nav a { color:#cfe0f0; text-decoration:none; margin-left:18px; font-weight:600; }
.auth-top nav a:hover { color:#fff; }

/* ============================ DASHBOARD ============================ */
.dash-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:22px; flex-wrap:wrap; }
.dash-hero h1 { font-size:25px; font-weight:850; letter-spacing:-.5px; margin:0 0 4px; color:#0e2138; }
.dash-hero p { margin:0; }
.muted { color:#64748b; } .small { font-size:12px; }
.btn-primary { display:inline-flex; align-items:center; gap:8px; background:linear-gradient(135deg,#2fa343,#1f8a36);
  color:#fff; padding:11px 18px; border-radius:10px; font-weight:700; text-decoration:none; font-size:14px;
  box-shadow:0 6px 16px rgba(34,140,60,.26); border:0; cursor:pointer; }
.btn-primary:hover { filter:brightness(1.06); }
.btn-primary.lg { padding:12px 22px; font-size:15px; }
.btn-ghost { display:inline-block; background:#fff; border:1.5px solid var(--brand); color:var(--brand);
  padding:10px 18px; border-radius:9px; font-weight:700; text-decoration:none; font-size:14px; }
.btn-ghost:hover { background:var(--brand); color:#fff; }

.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:18px; }
.stat-card { background:#fff; border:1px solid #e6ecf3; border-radius:14px; padding:18px 18px 16px; position:relative;
  overflow:hidden; box-shadow:0 1px 2px rgba(16,33,58,.04); transition:.15s; }
a.stat-card { display:block; text-decoration:none; color:inherit; cursor:pointer; }
.stat-card:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(16,33,58,.09); }
a.stat-card:hover { border-color:#cfe0d6; }
.stat-card::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; }
.stat-card.accent-green::before { background:#2fa343; } .stat-card.accent-blue::before { background:#3b82f6; }
.stat-card.accent-violet::before { background:#8b5cf6; } .stat-card.accent-amber::before { background:#f59e0b; }
.stat-ico { width:40px; height:40px; border-radius:11px; display:flex; align-items:center; justify-content:center;
  background:#f1f5fb; color:#475569; margin-bottom:12px; }
.stat-ico .ico { width:21px; height:21px; }
.accent-green .stat-ico { background:#e6f6ec; color:#1f8a36; }
.accent-blue .stat-ico { background:#e8f0fe; color:#2563eb; }
.accent-violet .stat-ico { background:#f0eafe; color:#7c3aed; }
.accent-amber .stat-ico { background:#fef3e2; color:#d97706; }
.stat-val { font-size:30px; font-weight:850; color:#0e2138; line-height:1; letter-spacing:-1px; }
.stat-val .pct { font-size:17px; font-weight:700; color:#64748b; margin-left:1px; }
.stat-lbl { font-size:13px; font-weight:700; color:#33485e; margin-top:7px; }
.stat-sub { font-size:11.5px; color:#8a98a8; margin-top:3px; }

.dash-cols { display:grid; grid-template-columns:1.9fr 1fr; gap:16px; margin-bottom:18px; }
.card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.card-head.padded { padding:16px 18px 0; margin-bottom:0; }
.card-head h3 { margin:0; font-size:15px; font-weight:800; color:#10233a; }
.link { color:#2563eb; text-decoration:none; font-size:13px; font-weight:600; }
.link:hover { text-decoration:underline; }
.empty-mini { padding:30px; text-align:center; color:#94a3b8; font-size:13px; }
.chart-wrap { position:relative; height:210px; width:100%; }
.chart-wrap canvas { position:absolute; inset:0; }

.mini-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:12px; text-align:center; }
.mini-stats > div { background:#f7f9fc; border:1px solid #eef2f7; border-radius:10px; padding:12px 6px; }
.mini-stats b { display:block; font-size:22px; font-weight:850; color:#0e2138; }
.mini-stats b.warn { color:#d97706; }
.mini-stats span { font-size:11px; color:#7c8a9a; font-weight:600; }
.mini-list { display:flex; flex-direction:column; gap:6px; }
.mini-row { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:12.5px;
  padding:7px 10px; background:#f7f9fc; border-radius:8px; }
.mini-row span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#33485e; }
.promo-card { background:linear-gradient(135deg,#0e2138,#1d3a5c); color:#fff; border:0; }
.promo-card h3 { color:#fff; } .promo-card .muted { color:#b9cbe0; }
.promo-card .btn-ghost { background:transparent; border-color:#5b80a8; color:#fff; margin-top:6px; }
.promo-card .btn-ghost:hover { background:#fff; color:#0e2138; }

.dtable { width:100%; border-collapse:collapse; }
.dtable thead th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.04em;
  color:#8a98a8; font-weight:700; padding:12px 14px; border-bottom:1px solid #eef2f7; }
.dtable tbody td { padding:13px 14px; border-bottom:1px solid #f1f4f8; font-size:13.5px; color:#1c2c40; }
.dtable tbody tr:last-child td { border-bottom:0; }
.dtable tbody tr:hover { background:#f8fafc; }
.pill { padding:3px 10px; border-radius:20px; font-size:12px; font-weight:700; }
.pill.good { background:#e6f6ec; color:#1f8a36; } .pill.mid { background:#fef3e2; color:#c2740a; }
.pill.bad { background:#fdeaea; color:#c0392b; }
.row-cta { color:#2563eb; font-weight:700; text-decoration:none; font-size:13px; }
.row-cta:hover { text-decoration:underline; }

.empty-state { text-align:center; padding:46px 20px 50px; }
.empty-state .empty-ico { width:58px; height:58px; border-radius:16px; background:#eef3f9; color:#94a3b8;
  display:flex; align-items:center; justify-content:center; margin:0 auto 14px; }
.empty-state .empty-ico .ico { width:28px; height:28px; }
.empty-state h3 { margin:0 0 6px; font-size:18px; color:#10233a; }
.empty-state p { margin:0 auto 16px; max-width:380px; }

/* ---- responsive ---- */
@media (max-width:1100px){ .dash-cols { grid-template-columns:1fr; } }
@media (max-width:960px){ .stat-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:860px){
  .app-shell { grid-template-columns:1fr; }
  .app-sidebar { position:fixed; left:0; top:0; width:264px; transform:translateX(-100%); transition:transform .22s ease; }
  .app-sidebar.open { transform:translateX(0); }
  .tb-burger { display:inline-flex; }
  .app-main { padding:18px 16px 50px; }
  .tb-credits span { display:none; }
}
@media (max-width:520px){ .stat-grid { grid-template-columns:1fr; } .dash-hero h1 { font-size:21px; } }

/* ---- print: hide app chrome ---- */
@media print {
  .app-sidebar, .app-topbar, .sb-scrim { display:none !important; }
  .app-shell { display:block; } .app-main { max-width:100% !important; padding:0 !important; }
}

/* ---- autocomplete suggestion box (GBP audit) ---- */
.sugbox { position:absolute; left:0; right:0; top:100%; z-index:50; background:#fff;
  border:1px solid #d7e0ea; border-radius:9px; box-shadow:0 10px 26px rgba(16,33,58,.14);
  margin-top:4px; max-height:280px; overflow:auto; }
.sugitem { padding:9px 12px; cursor:pointer; border-bottom:1px solid #f1f4f8; font-weight:400; }
.sugitem:last-child { border-bottom:0; }
.sugitem:hover { background:#f3f8ff; }
.sugitem b { display:block; font-size:13.5px; color:#10233a; }
.sugitem span { font-size:12px; color:#7c8a9a; }

/* ---- GBP audit result ---- */
.gbp-head { display:flex; align-items:center; gap:22px; flex-wrap:wrap; }
.gbp-score { width:120px; height:120px; border-radius:50%; flex:0 0 auto; display:flex;
  flex-direction:column; align-items:center; justify-content:center; color:#fff; }
.gbp-score-num { font-size:40px; font-weight:850; line-height:1; }
.gbp-score-lbl { font-size:12px; opacity:.9; margin-top:2px; }
.gbp-grade { display:inline-block; font-size:12px; font-weight:800; padding:3px 11px; border-radius:20px; }
.grade-A { background:#1f8a36; } .grade-B { background:#3fae53; }
.grade-C { background:#e0a019; } .grade-D { background:#e07a1f; } .grade-F { background:#c0392b; }
.gbp-grade.grade-A,.gbp-grade.grade-B,.gbp-grade.grade-C,.gbp-grade.grade-D,.gbp-grade.grade-F { color:#fff; }
.gbp-head-info h3 { font-size:19px; }
.gbp-checks { display:flex; flex-direction:column; }
.gbp-check { display:flex; gap:13px; padding:13px 18px; border-bottom:1px solid #f1f4f8; align-items:flex-start; }
.gbp-check:last-child { border-bottom:0; }
.gbp-ico { width:24px; height:24px; border-radius:50%; flex:0 0 auto; display:flex; align-items:center;
  justify-content:center; font-weight:800; font-size:13px; color:#fff; margin-top:1px; }
.gbp-check.ok .gbp-ico { background:#1f8a36; }
.gbp-check.partial .gbp-ico { background:#e0a019; }
.gbp-check.bad .gbp-ico { background:#c0392b; }
.gbp-body { flex:1; min-width:0; }
.gbp-row { display:flex; justify-content:space-between; gap:12px; align-items:baseline; }
.gbp-row b { font-size:14px; color:#1c2c40; }
.gbp-val { font-size:13px; color:#64748b; white-space:nowrap; }
.gbp-tip { font-size:12.5px; color:#8a5a00; margin-top:4px; line-height:1.45; }
.gbp-check.bad .gbp-tip { color:#9a3327; }
.topic-chips { display:flex; flex-wrap:wrap; gap:8px; }
.topic-chip { background:#eef3f9; border:1px solid #e0e8f1; border-radius:20px; padding:5px 12px;
  font-size:13px; color:#33485e; } .topic-chip b { color:#1f8a36; margin-left:3px; }
.verify-banner { background:#fff7e6; border-bottom:1px solid #f3d98a; color:#8a5a00;
  padding:10px 26px; font-size:13.5px; text-align:center; }
.verify-banner a { color:#b45309; font-weight:700; }
.share-cta { background:linear-gradient(135deg,#0e2138,#1d3a5c); color:#fff; text-align:center;
  padding:13px 20px; border-radius:12px; margin-bottom:16px; font-size:14.5px; }
.share-cta a { color:#7ef0a0; font-weight:700; text-decoration:none; }
.share-cta a:hover { text-decoration:underline; }
.btn-google { display:flex; align-items:center; justify-content:center; gap:10px; width:100%;
  background:#fff; border:1px solid #cdd8e3; border-radius:8px; padding:11px 16px; font-weight:600;
  color:#1c2530; text-decoration:none; font-size:14px; }
.btn-google:hover { background:#f6f9fc; box-shadow:0 1px 3px rgba(16,33,58,.08); }
.btn-google img { width:18px; height:18px; }
.or-div { display:flex; align-items:center; gap:12px; color:#94a3b8; font-size:12px; margin:14px 0; }
.or-div:before, .or-div:after { content:""; flex:1; height:1px; background:#e2e8ee; }


/* admin platform stats */
.kpis{display:flex;flex-wrap:wrap;gap:12px;}
.kpis .kpi{flex:1;min-width:120px;background:#fff;border:1px solid var(--line,#e8edf3);border-radius:10px;padding:14px 16px;}
.kpis .kpi b{display:block;font-size:24px;font-weight:800;color:#13283d;line-height:1.1;}
.kpis .kpi span{font-size:12px;color:#64748b;}
.kpis .kpi.money b{color:#0f766e;}
.kpis .kpi.good b{color:#16a34a;} .kpis .kpi.bad b{color:#dc2626;}

/* visually-hidden (a11y headings) */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* Import-from-Google button + GBP location picker */
.btn-google-import{display:inline-flex;align-items:center;gap:10px;background:#fff;color:#3c4043;
  border:1.5px solid #dadce0;border-radius:10px;padding:11px 18px;font-weight:600;font-size:14.5px;
  cursor:pointer;text-decoration:none;transition:.15s;}
.btn-google-import:hover{background:#f8faff;border-color:#c6d2ea;box-shadow:0 1px 4px rgba(60,64,67,.15);}
.gbp-imp-list{display:flex;flex-direction:column;gap:10px;margin-top:8px;}
.gbp-imp-item{display:flex;align-items:flex-start;gap:12px;border:1.5px solid var(--line,#e8edf3);
  border-radius:10px;padding:12px 14px;cursor:pointer;transition:.15s;}
.gbp-imp-item:hover{border-color:#c6d2ea;background:#f8faff;}
.gbp-imp-item input{margin-top:3px;}
.gbp-imp-txt b{display:block;}
