/* Backlink app -- own styles only. Loaded by base.html on top of
   sidebar.css + base.css. Tokens (--ink, --muted, --line, --accent,
   --brand-red, --bg, --good, --warn, --bad, --radius-card, --radius-tile,
   --radius-sm, --space-card, --gap-md, --font-*, --weight-heading) all come
   from sidebar.css's :root -- don't redeclare them here. .content,
   .topbar/.hero-title, .card, .page-subtitle, .flash, and the .jsp-help
   tooltip all come from base.css -- don't redeclare those either, just use
   them. Only this app's own form/table/export/chart markup lives here. */

.sub{ color:var(--muted); margin:0 0 28px; }

/* --- "Get started" callout (inside the search card) + intro card below
   it, on the Backlink landing page only (index.html). Copied from the
   same pattern already used in competitive_research/traffic_overview.html
   (.cr-start-here / .cr-intro-card / .cr-intro-art) -- same shell, same
   --accent blue, just prefixed bl- for this app and with copy/checklist
   items specific to what this tool actually shows (Domain/URL Rank,
   Referring Domains, Link History). Keep these two files' rules in sync
   if either one's shell ever changes. */
.bl-start-here{
  display:flex; align-items:center; gap:6px; margin-top:12px;
  color:var(--accent); font-size:0.78rem; font-weight:700; letter-spacing:.03em;
}
.bl-start-here svg{ width:22px; height:16px; flex:0 0 auto; }
.bl-start-here span{ white-space:normal; }

.bl-section-title{ font-size:1.35rem; font-weight:var(--weight-heading); color:var(--ink); margin:28px 2px 16px; }

.bl-intro-card{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius-card);
  padding:var(--space-card); display:flex; align-items:center; gap:40px;
}
@media (max-width:820px){ .bl-intro-card{ flex-direction:column; align-items:stretch; } }
.bl-intro-copy{ flex:0 0 42%; }
.bl-intro-copy p{ margin:0 0 10px; font-size:0.92rem; color:var(--muted); line-height:1.55; }
.bl-intro-checklist{ list-style:none; margin:18px 0 0; padding:0; display:flex; flex-direction:column; gap:12px; }
.bl-intro-checklist li{ display:flex; gap:10px; align-items:flex-start; font-size:0.88rem; color:var(--ink); line-height:1.5; }
.bl-intro-checklist li strong{ font-weight:700; }
.bl-intro-check{ flex:0 0 auto; width:16px; height:16px; margin-top:2px; color:var(--accent); }
.bl-intro-art{ flex:1; min-width:0; display:flex; align-items:center; justify-content:center; }
.bl-intro-art svg{ width:100%; height:auto; max-width:420px; }

label{ display:block; font-weight:600; font-size:0.85rem; margin-bottom:6px; }
form.geo-form{ display:flex; gap:10px; flex-wrap:wrap; }
.field{ flex:1; min-width:220px; }
input[type=text], input[type=url]{
  width:100%; padding:12px 14px; border:1px solid var(--line);
  border-radius:var(--radius-sm); font-size:0.95rem;
}
select{
  width:100%; padding:12px 14px; border:1px solid var(--line);
  border-radius:var(--radius-sm); font-size:0.95rem; background:#fff; color:var(--muted);
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%236b7280'/></svg>");
  background-repeat:no-repeat; background-position:right 14px center; padding-right:34px;
}
select.filled{ color:var(--ink); }

button{
  background:var(--accent); color:#fff; border:none; padding:12px 20px;
  border-radius:var(--radius-sm); font-size:var(--font-btn); font-weight:700; cursor:pointer;
}
button:hover{ opacity:0.9; }
button:disabled{ opacity:0.5; cursor:not-allowed; }
button.secondary{ background:#fff; color:var(--ink); border:1px solid var(--line); }

.hidden{ display:none !important; }
.badge{ display:inline-block; padding:2px 9px; border-radius:100px; font-size:0.75rem; font-weight:600; }

table{ width:100%; border-collapse:collapse; font-size:0.88rem; }
th, td{ padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
th{ color:var(--muted); font-weight:600; text-transform:uppercase; font-size:0.72rem; letter-spacing:.03em; }

#progress-wrap{ margin-top:16px; }
.bar-track{ background:#eef0f3; border-radius:100px; height:8px; overflow:hidden; }
.bar-fill{ height:100%; border-radius:100px; background:var(--accent); width:2%; }

/* The old .info-tip/.tip-bubble tooltip is gone -- it was a byte-for-byte
   duplicate of base.css's shared .jsp-help/.jsp-help-tip "?" tooltip.
   backlinks_view.html and result.html's tip() macro now emits
   .jsp-help/.jsp-help-tip markup directly, so this app no longer needs
   its own copy. */

.chart-card .section-head{ display:flex; align-items:center; }
.chart-wrap{ position:relative; }

/* --- export buttons / dropdown menu --- */
.section-head.with-action{ justify-content:space-between; }
.section-head-label{ display:flex; align-items:center; }
.export-btn{
  display:inline-flex; align-items:center; gap:5px; background:#fff; color:var(--accent);
  border:1px solid var(--accent); border-radius:7px; padding:5px 11px; font-size:0.76rem;
  font-weight:600; cursor:pointer; white-space:nowrap; flex-shrink:0;
}
.export-btn:hover{ background:#eef3fc; }
.export-btn svg{ width:11px; height:11px; flex-shrink:0; }
/* Backlinks Report only -- same solid black pill as the dashboard's
   "Export" action. Scoped to this page's export rows so the Accumulated
   Backlinks view and the page's blue "Load 10 more" button are untouched. */
.page-backlinks-report .metric-export-row .export-btn,
.page-backlinks-report .section-head.with-action .export-btn{
  background:var(--ink); color:#fff; border-color:var(--ink);
  border-radius:999px; height:32px; padding:0 16px; gap:6px;
  font-size:13px; font-weight:600;
}
.page-backlinks-report .metric-export-row .export-btn:hover,
.page-backlinks-report .section-head.with-action .export-btn:hover{ background:#000; border-color:#000; }
.page-backlinks-report .metric-export-row .export-btn svg,
.page-backlinks-report .section-head.with-action .export-btn svg{ width:13px; height:13px; }
.export-dropdown{ position:relative; display:inline-block; flex-shrink:0; }
.export-menu{
  position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1px solid var(--line);
  border-radius:var(--radius-sm); box-shadow:0 10px 28px rgba(0,0,0,.15); min-width:200px; z-index:30;
  overflow:hidden; display:none;
}
.export-menu.open{ display:block; }
.export-menu button{
  display:block; width:100%; text-align:left; background:#fff; color:var(--ink);
  border:none; padding:10px 14px; font-size:0.85rem; cursor:pointer;
}
.export-menu button:hover{ background:var(--bg); }
.export-menu button:disabled{ opacity:0.45; cursor:not-allowed; }
.metric-export-row{ display:flex; justify-content:flex-end; margin-bottom:10px; }

.bl-select-col{ width:34px; }
.bl-row td.bl-select-cell{ padding-top:16px; }

/* --- shared "report" building blocks -- metric grid, section headers,
   the backlinks table + pager + search/filter toolbar. Used identically
   by backlinks_view.html (Accumulated view) and result.html (per-check
   Backlinks Report), which each used to carry their own byte-for-byte
   copy of all of this in a page-local <style> block. One definition
   here now; neither page should redeclare any of it locally. --- */
.metric-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
@media (max-width:900px){ .metric-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:600px){ .metric-grid{ grid-template-columns:1fr; } }
.metric-card{ background:#fff; border:1px solid var(--line); border-radius:var(--radius-tile); padding:18px; }
.metric-card .label{ color:var(--muted); font-size:0.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; display:flex; align-items:center; }
/* --font-stat is the shared "big number" token (same one overview.css's
   .metric-value and the SEO Audit donut use) -- was a locally hardcoded
   2rem before, now matches the size of every other app's big stat number
   instead of just happening to be close. */
.metric-card .value{ font-size:var(--font-stat); font-weight:700; line-height:1; }
.metric-card .sub-value{ color:var(--muted); font-size:0.78rem; margin-top:6px; }

.section-head{ margin:0 0 14px; display:flex; align-items:center; }
.section-head h3{ margin:0; font-size:1rem; }

.snapshot-note{ font-size:0.78rem; color:var(--muted); margin:0 0 24px; font-style:italic; }
.cost-note{ font-size:0.78rem; color:var(--muted); margin-top:-14px; margin-bottom:24px; }

.backlinks-table th{ white-space:nowrap; }
.backlinks-table th .jsp-help{ margin-left:4px; }
.backlinks-table td{ vertical-align:top; padding-top:12px; padding-bottom:12px; }
.bl-title{ font-weight:600; color:var(--accent); margin-bottom:2px; }
.bl-url, .bl-url-target{ color:var(--good); font-size:0.8rem; word-break:break-all; text-decoration:none; }
.bl-url:hover, .bl-url-target:hover{ text-decoration:underline; }
.bl-anchor{ font-weight:600; color:var(--accent); margin-bottom:2px; }
.nf-badge{ display:inline-block; margin-left:6px; padding:1px 6px; border:1px solid var(--line); border-radius:4px; font-size:0.65rem; color:var(--muted); vertical-align:middle; }

.bl-pager{ display:flex; align-items:center; justify-content:center; gap:12px; margin-top:18px; }
.pager-btn{ background:#fff; border:1px solid var(--line); border-radius:var(--radius-sm); padding:6px 14px; cursor:pointer; font-size:0.9rem; color:var(--ink); line-height:1; }
.pager-btn:hover:not(:disabled){ background:var(--bg); }
.pager-btn:disabled{ opacity:0.35; cursor:not-allowed; }
.pager-info{ font-size:0.82rem; color:var(--muted); min-width:100px; text-align:center; }

.bl-toolbar{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.bl-search{ flex:1; min-width:220px; padding:10px 14px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:0.88rem; }
.bl-filter-toggle{ display:inline-flex; border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; flex-shrink:0; }
.filter-btn{ background:#fff; color:var(--muted); border:none; padding:9px 14px; font-size:0.85rem; cursor:pointer; white-space:nowrap; }
.filter-btn.active{ background:var(--accent); color:#fff; }
.filter-btn:not(.active):hover{ background:var(--bg); }

/* --- backlinks_view.html only --- */
.free-badge{ display:inline-block; padding:2px 10px; border-radius:100px; font-size:0.72rem; font-weight:700; background:#e6f4ea; color:var(--good); vertical-align:middle; margin-left:8px; }
.meta-line{ font-size:0.82rem; color:var(--muted); margin:-6px 0 20px; }
.lookup-form{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:24px; }
.lookup-form .field{ flex:1; min-width:220px; }

/* --- index.html: search page --- */
.hero-sub{ color:var(--muted); font-size:0.92rem; max-width:640px; margin:18px auto 0; text-align:center; line-height:1.5; }
.hero-sub b{ color:var(--ink); }

.btn-block{ width:100%; padding:14px 20px; font-size:1rem; font-weight:700; border-radius:10px; letter-spacing:0.01em; }
.card-tagline{ text-align:center; color:var(--muted); font-size:0.85rem; margin:14px 0 0; }

.mode-toggle{ display:inline-flex; border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; }
.mode-btn{ background:#fff; color:var(--muted); border:none; padding:9px 16px; font-size:0.88rem; cursor:pointer; }
.mode-btn.active{ background:var(--accent); color:#fff; }
.mode-btn:not(.active):hover{ background:var(--bg); }