/* GBP AI Visibility Checker — slim component styles (JS-generated UI).
   Shell/nav use Tailwind (css/plugins/tailwind.css). */

:root {
  --bg: #fbf3f0;
  --card: #ffffff;
  --ink: #16202D;
  --muted: #6b7280;
  --line: #ead1c5;
  --accent: #a6653c;
  --accent-dark: #8b542f;
  --accent-bg: #f5e8e2;
  --green: #067647;
  --green-bg: #ecfdf3;
  --red: #b42318;
  --red-bg: #fef3f2;
  --amber: #b54708;
  --amber-bg: #fffaeb;
  --gray-bg: #f5e8e2;
}

/* Tailwind's .hidden loads before this file, so any component rule below that
   sets `display` beats it at equal specificity. Re-assert .hidden for those. */
.biz-card.hidden { display: none; }
.tabcount.hidden,
.tabpanel.hidden { display: none; }

/* ---------- app helpers ---------- */
.error-bar {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #fecdca;
  border-radius: 6px;
  padding: 11px 15px;
  font-size: 14px;
  margin: 0 0 14px;
  display: none;
}
.beta-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--amber-bg);
  border: 1px solid #f0c49a;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 0 0 16px;
  color: #7a3d0a;
  font-size: 13.5px;
  line-height: 1.45;
}
.beta-chip {
  flex: none;
  background: var(--amber);
  color: #fff;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.step-badge {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent-dark);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 9px;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: none;
  display: inline-block;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
button.small {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
button.small:hover { border-color: var(--accent); }
button.small:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- business picker ---------- */
.pac-container {
  z-index: 10000 !important;
  border-radius: 0 0 6px 6px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(22, 32, 45, .14);
  font-family: inherit;
}
.pac-container .pac-item { font-size: 0; padding: 10px 14px; cursor: pointer; border-top: 1px solid var(--line); }
.pac-container .pac-item:first-child { border-top: none; }
.pac-container .pac-item .pac-item-query { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.pac-container .pac-item > span:not(.pac-item-query) { display: none !important; }
.pac-container .pac-icon { display: none; }
.pac-container .pac-item:hover,
.pac-container .pac-item-selected { background: var(--accent-bg); }
.biz-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  background: var(--bg);
  margin-top: 10px;
}
.biz-card .bicon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}
.biz-card .bmeta { flex: 1; min-width: 0; }
.biz-card .bname { font-weight: 700; font-size: 16px; }
.biz-card .baddr { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.biz-card .baddr:empty { display: none; }
.biz-card .bcats { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.biz-card .bcats:empty { display: none; }
.biz-card .bchip {
  display: inline-block;
  margin-top: 8px;
  background: var(--accent-bg);
  color: var(--accent-dark);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.biz-card .bchange { flex: none; }

/* ---------- intent pills ---------- */
.intent-hint { color: var(--muted); font-size: 13.5px; margin: 0; }
.intent-locked {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ipill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 13px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.ipill:hover { border-color: var(--accent); background: var(--accent-bg); }
.ipill.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.ipill .it { font-weight: 700; font-size: 14px; color: var(--ink); }
.ipill .iv { color: var(--muted); font-size: 12px; font-weight: 600; }
.ipill-add { border-style: dashed; color: var(--accent-dark); }
.ipill-add .it { color: var(--accent-dark); }
.pill-skel {
  height: 38px;
  width: 170px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gray-bg) 25%, #ead1c5 37%, var(--gray-bg) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- search form modes ---------- */
.search-form.is-running .bchange,
.search-form.is-running .ipill,
.search-form.is-running #intent-input,
.search-form.is-running #business-input,
.search-form.is-running #run-search {
  pointer-events: none;
  opacity: .65;
  cursor: not-allowed;
}
.search-form.is-locked .bchange,
.search-form.is-locked #run-search,
.search-form.is-locked .engine-note,
.search-form.is-locked #intent-suggestions,
.search-form.is-locked #intent-custom,
.search-form.is-locked #intent-hint,
.search-form.is-locked #business-search {
  display: none !important;
}

/* Informational only — not clickable (users mistook bordered chips for buttons). */
.engine-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}
.engine-note .engine-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #4b5563;
}
.engine-note .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.run-stay-banner {
  margin: 14px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- run progress ---------- */
.runstrip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 18px;
}
.strip-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.strip-title { font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.strip-top .checkcount { margin-left: auto; }
.runstrip .status { color: var(--muted); font-size: 13.5px; min-height: 20px; margin-top: 4px; }
.progressbar {
  height: 8px;
  background: var(--gray-bg);
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progressbar .fill { height: 100%; background: var(--accent); width: 0%; transition: width .3s; }
.checkcount { font-size: 13.5px; font-weight: 700; }
.count-chip { border-radius: 6px; padding: 3px 10px; font-weight: 700; font-size: 12.5px; }
.count-chip.hit { background: var(--green-bg); color: var(--green); }
.count-chip.miss { background: var(--red-bg); color: var(--red); }
details.logbox { margin-top: 6px; }
details.logbox summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.feed {
  background: var(--ink);
  color: #d9e0ea;
  border-radius: 6px;
  padding: 16px 18px;
  font-size: 13px;
  max-height: 260px;
  overflow-y: auto;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  margin-top: 10px;
}
.feed div { padding: 2px 0; }
.feed .ok { color: #6ee7a8; }
.feed .miss { color: #fda29b; }
.feed .skip { color: #98a2b3; }

/* ---------- report / evidence grid ---------- */
.dash { margin: 24px 0 0; }
.panelbox {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
}
.verdict-big { font-size: 20px; font-weight: 700; line-height: 1.45; margin-bottom: 10px; }
.verdict-sub { color: var(--muted); font-size: 16px; line-height: 1.6; }
.engine-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.etile {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 15px;
}
.etile .nm { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.etile .nm .dot { width: 9px; height: 9px; border-radius: 50%; }
.etile .frac { font-size: 21px; font-weight: 800; margin: 3px 0 6px; }
.etile .frac span { font-size: 13px; color: var(--muted); font-weight: 600; }
.etile .bar { height: 8px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; }
.etile .bar i { display: block; height: 100%; border-radius: 6px; }
details.section-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 14px;
}
details.section-block > summary {
  list-style: none;
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
details.section-block > summary::-webkit-details-marker { display: none; }
details.section-block > summary .hintlabel { color: var(--muted); font-weight: 500; font-size: 13.5px; }
details.section-block > summary .chev { margin-left: auto; color: var(--muted); font-size: 18px; transition: transform .2s; }
details.section-block[open] > summary .chev { transform: rotate(90deg); }
details.section-block .inner { border-top: 1px solid var(--line); }
.showmore-row { text-align: center; padding: 14px; border-top: 1px solid var(--line); }
#liveGridWrap { margin-top: 26px; }

/* ---------- report tabs (folder style: active tab merges into its panel) ---------- */
.tabbar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 2px solid var(--accent);
  padding: 0;
  margin: 0;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-bg);
  border: 2px solid rgba(166, 101, 60, .35);
  border-bottom: 2px solid var(--accent);
  border-radius: 9px 9px 0 0;
  padding: 12px 19px;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.tab:hover:not(.is-active) {
  color: var(--ink);
  background: rgba(166, 101, 60, .18);
  border-color: rgba(166, 101, 60, .55);
  border-bottom-color: var(--accent);
}
.tab.is-active {
  color: var(--ink);
  background: var(--card);
  border-color: var(--accent);
  border-bottom-color: var(--card);
}
.tabcount {
  display: inline-block;
  background: rgba(166, 101, 60, .13);
  color: var(--accent-dark);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tab.is-active .tabcount { background: var(--accent); color: #fff; }

/* The panel is the folder body — inner cards drop their own frame. */
.tabpanel {
  background: var(--card);
  border: 2px solid var(--accent);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}
.tabpanel > .panel,
.tabpanel > .competitors-panel {
  border: none;
  background: transparent;
  border-radius: 0;
  margin-top: 0;
}
.tabpanel > .tabsub {
  margin: 0;
  padding: 14px 18px 0;
  font-size: 13.5px;
}
.tabloading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 54px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Below the container's full width the four labels can't share a row,
   so scroll the tabs as pills and detach the panel. */
@media (max-width: 1040px) {
  .tabbar {
    border-bottom: none;
    gap: 6px;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tab {
    margin-bottom: 0;
    border-radius: 9px;
    border-bottom-color: rgba(166, 101, 60, .35);
    padding: 10px 14px;
    font-size: 13.5px;
  }
  .tab.is-active {
    border-color: var(--accent);
    border-bottom-color: var(--accent);
  }
  .tabpanel {
    border-top: 2px solid var(--accent);
    border-radius: 8px;
    margin-top: 10px;
  }
}
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 0; }
.grid-head, .grid-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) repeat(var(--engine-count, 2), minmax(0, 1fr));
  gap: 0;
  align-items: center;
  width: 100%;
}
@media (max-width: 720px) {
  .grid-head, .grid-row {
    grid-template-columns: minmax(0, 1.6fr) repeat(var(--engine-count, 2), minmax(0, 1fr));
  }
}
.grid-head { padding: 10px 18px; border-bottom: 1px solid var(--line); }
.grid-head span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
}
.grid-head span:first-child { text-align: left; }
.grid-row { padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: default; }
.grid-row.ready { cursor: pointer; }
.grid-row.ready:hover { background: var(--bg); }
.grid-row:last-child { border-bottom: none; }
.grid-row .q { font-weight: 600; font-size: 14.5px; padding-right: 10px; }
.grid-row .angle {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 2px;
}
.cell { text-align: center; font-weight: 700; font-size: 15px; }
.cell.hit { color: var(--green); }
.cell.miss { color: var(--red); }
.cell.na { color: #c6ccd6; }
.cellwrap { text-align: center; }
.cell-spin {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
  vertical-align: -2px;
}
.rowdetail {
  grid-column: 1 / -1;
  background: var(--bg);
  border-radius: 6px;
  margin-top: 10px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  cursor: default;
}
/* Per-engine boxes carry that engine's brand color on the frame and header. */
.epanel {
  background: var(--card);
  border: 1px solid var(--eng-line, var(--line));
  border-top: 3px solid var(--eng, var(--line));
  border-radius: 6px;
  padding: 0;
  font-size: 13.5px;
  overflow: hidden;
}
.epanel h4 {
  margin: 0;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--eng-soft, var(--bg));
  border-bottom: 1px solid var(--eng-line, var(--line));
  display: flex;
  align-items: center;
  gap: 7px;
}
.epanel h4 .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--eng, var(--muted));
  flex: none;
}
.epanel .ebody { padding: 12px 14px; }
.epanel .verdict { font-weight: 700; margin-bottom: 6px; }
.epanel .verdict.hit { color: var(--green); }
.epanel .verdict.miss { color: var(--red); }
.epanel .verdict.na { color: var(--muted); }
.epanel .excerpt { color: var(--muted); font-style: italic; font-size: 12.5px; line-height: 1.45; }
.epanel .excerpt.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.epanel .pending { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.epanel .pill,
.comp-list .pill {
  display: inline-block;
  background: var(--gray-bg);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 12px;
  margin: 2px 3px 0 0;
}
.epanel .comp-inline { margin-top: 8px; font-size: 12.5px; color: var(--ink); }
.epanel .comp-label { color: var(--muted); font-weight: 600; margin-right: 4px; }
.epanel .src-count { margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.epanel .linkish {
  margin-top: 10px;
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.epanel .linkish:hover { color: var(--accent-dark); }

/* Google AI Mode reads as a Google surface: Arial/Roboto, Material greys,
   hairline dividers, chip pills, and the Gemini gradient on the top edge.
   Must stay after the base .epanel rules to win at equal specificity. */
.epanel--google_aio {
  font-family: Roboto, Arial, "Helvetica Neue", sans-serif;
  border: 1px solid #dadce0;
  border-top: none;
  border-radius: 8px;
  position: relative;
  padding-top: 3px;
}
.epanel--google_aio::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570);
}
.epanel--google_aio h4 {
  background: #fff;
  border-bottom: 1px solid #dadce0;
  color: #202124;
  font-weight: 500;
  letter-spacing: .1px;
}
.epanel--google_aio h4 .dot {
  background: linear-gradient(135deg, #4285f4, #9b72cb, #d96570);
}
.epanel--google_aio .verdict.hit { color: #188038; }
.epanel--google_aio .verdict.miss { color: #d93025; }
.epanel--google_aio .verdict.na { color: #5f6368; }
.epanel--google_aio .excerpt { color: #5f6368; }
.epanel--google_aio .comp-inline { color: #202124; }
.epanel--google_aio .comp-label,
.epanel--google_aio .src-count { color: #5f6368; }
.epanel--google_aio .pill {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 999px;
  color: #202124;
  padding: 2px 10px;
}
.epanel--google_aio .linkish {
  color: #1a73e8;
  font-weight: 500;
  text-decoration: none;
}
.epanel--google_aio .linkish:hover { color: #174ea6; text-decoration: underline; }

/* ChatGPT reads as a ChatGPT surface: near-black ink, light grey hairlines,
   soft rounded corners, dark underlined links, green only as the brand cue. */
.epanel--openai {
  font-family: "Söhne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  border: 1px solid #e5e5e5;
  border-top: none;
  border-radius: 12px;
  position: relative;
  padding-top: 3px;
}
.epanel--openai::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #10a37f;
}
.epanel--openai h4 {
  background: #f9f9f9;
  border-bottom: 1px solid #ececec;
  color: #0d0d0d;
  font-weight: 600;
}
.epanel--openai h4 .dot { background: #10a37f; }
.epanel--openai .verdict.hit { color: #0d8a68; }
.epanel--openai .verdict.miss { color: #b3261e; }
.epanel--openai .verdict.na { color: #5d5d5d; }
.epanel--openai .excerpt { color: #5d5d5d; }
.epanel--openai .comp-inline { color: #0d0d0d; }
.epanel--openai .comp-label,
.epanel--openai .src-count { color: #5d5d5d; }
.epanel--openai .pill {
  background: #f4f4f4;
  border: 1px solid #ececec;
  border-radius: 8px;
  color: #0d0d0d;
  padding: 2px 9px;
}
.epanel--openai .linkish {
  color: #0d0d0d;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.epanel--openai .linkish:hover { color: #10a37f; }

/* Full-answer modal (keeps the grid uncluttered) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 32, 45, .45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 40;
  padding: 48px 16px;
  overflow-y: auto;
}
.overlay:not(.hidden) { display: flex; }
.modal {
  background: var(--card);
  border-radius: 6px;
  width: 560px;
  max-width: 100%;
  padding: 28px 30px;
  box-shadow: 0 10px 40px rgba(22, 32, 45, .2);
  position: relative;
}
.modal .x {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--muted);
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
}
.modal .x:hover { color: var(--ink); }

/* Full-answer modal — simple: answer, competitors, sources */
.answer-modal {
  width: min(640px, 100%);
  max-height: min(85vh, 820px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 28px 28px;
  border-top: 4px solid var(--eng, var(--accent));
}
.aio-engine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 28px 10px 0;
  padding: 6px 11px;
  background: var(--eng-soft, var(--gray-bg));
  border: 1px solid var(--eng-line, var(--line));
  border-radius: 20px;
}
.aio-engine .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--eng, var(--muted));
}
.aio-query {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.aio-meta { margin-bottom: 14px; }
.aio-meta .verdict { font-weight: 700; font-size: 13px; }
.aio-meta .verdict.hit { color: var(--green); }
.aio-meta .verdict.miss { color: var(--red); }

/* Per-engine differences live in the answer text formatting only */
.aio-answer {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  word-break: break-word;
  margin-bottom: 4px;
}
.aio-answer--google {
  /* AI Mode dumps are denser — slightly more open paragraphs */
  font-family: Roboto, Arial, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #202124;
}
/* Google-flavoured modal chrome to match the AI Mode answer. The gradient is a
   background (not a pseudo-element) so it stays pinned while the modal scrolls. */
.answer-modal--google {
  font-family: Roboto, Arial, "Helvetica Neue", sans-serif;
  border-top: none;
  padding-top: 28px;
  background-image: linear-gradient(90deg, #4285f4, #9b72cb, #d96570);
  background-repeat: no-repeat;
  background-size: 100% 4px;
  background-position: top left;
}
.answer-modal--google .aio-engine {
  background: #fff;
  border: 1px solid #dadce0;
  color: #202124;
  font-weight: 500;
}
.answer-modal--google .aio-engine .dot {
  background: linear-gradient(135deg, #4285f4, #9b72cb, #d96570);
}
.answer-modal--google .aio-query { color: #202124; font-weight: 500; }
.answer-modal--google .aio-meta .verdict.hit { color: #188038; }
.answer-modal--google .aio-meta .verdict.miss { color: #d93025; }
.answer-modal--google .aio-section-label { color: #202124; font-weight: 500; }
.answer-modal--google .src-list a { color: #1a73e8; text-decoration: none; }
.answer-modal--google .src-list a:hover { text-decoration: underline; }
.answer-modal--google .src-host { color: #5f6368; }

/* ChatGPT-flavoured modal chrome to match the ChatGPT answer. */
.answer-modal--chatgpt {
  font-family: "Söhne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  border-top: none;
  padding-top: 28px;
  background-image: linear-gradient(90deg, #10a37f, #10a37f);
  background-repeat: no-repeat;
  background-size: 100% 4px;
  background-position: top left;
}
.answer-modal--chatgpt .aio-engine {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  color: #0d0d0d;
  font-weight: 600;
}
.answer-modal--chatgpt .aio-engine .dot { background: #10a37f; }
.answer-modal--chatgpt .aio-query { color: #0d0d0d; font-weight: 600; }
.answer-modal--chatgpt .aio-meta .verdict.hit { color: #0d8a68; }
.answer-modal--chatgpt .aio-meta .verdict.miss { color: #b3261e; }
.answer-modal--chatgpt .aio-section-label { color: #0d0d0d; font-weight: 600; }
.answer-modal--chatgpt .aio-empty { color: #5d5d5d; }
.answer-modal--chatgpt .comp-table th {
  background: #f9f9f9;
  color: #5d5d5d;
  border-bottom-color: #ececec;
}
.answer-modal--chatgpt .comp-table td {
  border-bottom-color: #ececec;
  color: #0d0d0d;
}
.answer-modal--chatgpt .comp-table .comp-rank { color: #8f8f8f; }
.answer-modal--chatgpt .comp-table .comp-name { color: #0d0d0d; font-weight: 600; }
.answer-modal--chatgpt .src-list a {
  color: #0d0d0d;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.answer-modal--chatgpt .src-list a:hover { color: #10a37f; }
.answer-modal--chatgpt .src-host { color: #8f8f8f; }
.aio-answer--chatgpt {
  /* ChatGPT answers often already have markdown structure */
  font-family: "Söhne", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #0d0d0d;
}
.aio-answer .aio-p { margin: 0 0 12px; }
.aio-answer .aio-h {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.aio-answer .aio-h:first-child { margin-top: 0; }
.aio-answer .aio-list {
  margin: 0 0 12px;
  padding-left: 1.25em;
}
.aio-answer .aio-list li { margin: 0 0 6px; }
.aio-answer .aio-list li::marker { color: var(--muted); }
.aio-answer strong { font-weight: 700; }
.aio-answer code {
  font-size: 0.92em;
  background: var(--gray-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Engine-native answer bodies. These must stay after the base .aio-answer
   rules above — they are the same specificity and would otherwise lose. */
.aio-answer--google .aio-h { color: #202124; font-weight: 500; }
.aio-answer--google a { color: #1a73e8; text-decoration: none; }
.aio-answer--google a:hover { text-decoration: underline; }
.aio-answer--google .aio-list li::marker { color: #5f6368; }
.aio-answer--chatgpt .aio-h { color: #0d0d0d; font-weight: 600; }
.aio-answer--chatgpt .aio-p { margin: 0 0 15px; }
.aio-answer--chatgpt .aio-list li { margin: 0 0 9px; }
.aio-answer--chatgpt .aio-list li::marker { color: #8f8f8f; }
.aio-answer--chatgpt strong { font-weight: 600; color: #0d0d0d; }
.aio-answer--chatgpt a { color: #0d0d0d; text-decoration: underline; text-underline-offset: 2px; }
.aio-answer--chatgpt a:hover { color: #10a37f; }
.aio-answer--chatgpt code { background: #f4f4f4; border: 1px solid #ececec; }
.answer-modal-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.answer-modal-note.hidden { display: none; }
.aio-section-label {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.aio-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.aio-sources { margin-top: 4px; }
.src-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.src-list li { font-size: 13px; line-height: 1.35; }
.src-list a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  word-break: break-word;
}
.src-list a:hover { opacity: .85; }
.src-host { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* Competitor leaderboard (report) + per-answer table (modal) */
.competitors-panel { margin-top: 18px; padding: 18px 20px; }
.competitors-panel .comp-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}
.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.comp-table th,
.comp-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e8eaed;
  vertical-align: middle;
}
.comp-table th {
  font-size: 12px;
  font-weight: 700;
  color: #5f6368;
  text-transform: none;
  letter-spacing: 0;
  background: #fafafa;
}
.comp-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.comp-table .comp-rank {
  width: 40px;
  color: #5f6368;
  font-weight: 600;
  vertical-align: top;
  padding-top: 14px;
}
.comp-table .comp-name {
  font-weight: 700;
  color: var(--ink);
  vertical-align: top;
  padding-top: 14px;
  min-width: 140px;
}
.comp-table .comp-count,
.comp-table .comp-share {
  vertical-align: top;
  min-width: 168px;
  white-space: nowrap;
}
.comp-total {
  font-weight: 800;
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 6px;
}
.comp-share .comp-total { color: var(--ink); }
.comp-total span {
  font-weight: 600;
  font-size: 11.5px;
  color: #5f6368;
}
.comp-split {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.comp-eng {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: #3c4043;
}
.comp-eng-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.comp-eng-lbl {
  color: #5f6368;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comp-eng-val {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.comp-table .comp-empty {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 18px 12px;
}
.comp-table--row { margin-top: 4px; }
.comp-table--row th { background: #f8f9fa; }
.comp-table tr.comp-more.hidden { display: none; }
.competitors-panel .showmore-row {
  border-top: 1px solid #e8eaed;
  margin-top: 0;
}
.competitors-panel .showmore-row button {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  padding: 4px 8px;
}
.competitors-panel .showmore-row button:hover { text-decoration: underline; }

/* Top referrals — same table frame, plus an expandable page list per site */
.ref-callout {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.45;
}
.ref-callout.good { background: var(--green-bg); color: var(--green); }
.ref-callout.warn { background: var(--amber-bg); color: var(--amber); }
.comp-table tr.ref-row { cursor: pointer; }
.comp-table tr.ref-row:hover { background: #fdf9f7; }
.comp-table tr.ref-row.ref-you { background: var(--accent-bg); }
.comp-table tr.ref-row.is-open > td { border-bottom-color: transparent; }
.ref-caret {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  margin-right: 6px;
  transition: transform .12s ease;
}
.ref-row.is-open .ref-caret { transform: rotate(90deg); }
.ref-host { word-break: break-all; }
.ref-you-pill {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}
.ref-pagecount {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.comp-table tr.ref-detail { display: none; }
.comp-table tr.ref-detail.is-open { display: table-row; }
.comp-table tr.ref-detail > td { background: #fafafa; padding: 4px 12px 16px 52px; }
.ref-detail-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #5f6368;
  margin: 10px 0 6px;
}
.ref-page-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ref-page-list a {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  word-break: break-word;
}
.ref-page-list a:hover { text-decoration: underline; }
.ref-page-path {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
}
.ref-qs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ref-qs .pill {
  background: #fff;
  border: 1px solid var(--line);
  color: #3a4454;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  white-space: normal;
}
.ref-q-extra { font-size: 11.5px; color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {
  .comp-table tr.ref-detail > td { padding-left: 16px; }
}
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
}
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.green { background: var(--green-bg); color: var(--green); }
/* ---------- content gaps ---------- */
.gap-entry { border-bottom: 1px solid var(--line); padding: 18px; }
.gap-entry:last-child { border-bottom: none; }
.gap-entry.gap-more.hidden { display: none; }
.gap-topic { font-weight: 700; font-size: 15.5px; line-height: 1.4; color: var(--ink); }
.gap-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.gap-angle {
  background: var(--gray-bg);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 700;
}
.gap-where { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: #3a4454; }
.gap-where b { color: var(--ink); }
.gap-comps { margin-top: 8px; font-size: 12.5px; }
.gap-comps-label { color: var(--muted); font-weight: 600; margin-right: 4px; }
.gap-comps .pill {
  display: inline-block;
  background: var(--gray-bg);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 12px;
  margin: 2px 3px 0 0;
}
.gap-draft-box { margin-top: 12px; }
.gap-draft-box > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.gap-draft-box > summary::-webkit-details-marker { display: none; }
.gap-draft-box > summary::before { content: "+"; font-size: 14px; line-height: 1; }
.gap-draft-box[open] > summary::before { content: "−"; }
.gap-draft-box > summary:hover { color: var(--accent-dark); }
.gap-caveat { margin: 10px 0 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.gap-draft {
  font-size: 14.5px;
  color: #3a4454;
  white-space: pre-wrap;
  background: var(--gray-bg);
  border-radius: 6px;
  padding: 12px 15px;
}
.gap-draft-box .small { margin-top: 10px; }
.comp-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.comp-list .pill span { color: var(--muted); font-weight: 500; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

.sub { color: var(--muted); margin: 0 0 10px; font-size: 15px; }
