/* Keyword Research */
.research-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.research-row .field.grow { flex: 1 1 320px; min-width: 0; }
.research-row input, .research-row select { width: 100%; }
.use-gsc { align-self: center; font-size: .92rem; color: var(--ink); }

/* The set to target on one page */
.targets { gap: 16px; }
.targets .primary-kw { display: grid; gap: 4px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(160deg, var(--accent-soft), var(--surface) 80%); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.targets .primary-kw b { font-size: clamp(1.25rem, 3vw, 1.7rem); letter-spacing: -.02em; }
.targets .primary-kw .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .92rem; }
.targets .primary-kw .meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.target-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px 24px; }
.target-cols > div { min-width: 0; }
.target-cols h4 { margin: 0 0 6px; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.spellings { color: var(--muted); font-size: .9rem; }
.spellings b { color: var(--ink); font-weight: 600; }

/* Where you stand */
.st { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.st-page1 { color: var(--cov-fg); background: var(--cov-bg); }
.st-close { color: var(--gap-fg); background: var(--gap-bg); }
.st-low { color: var(--can-fg); background: var(--can-bg); }
.st-missing { color: var(--gen-fg); background: var(--gen-bg); }
.grp { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.grp-Primary { color: var(--accent-strong); background: var(--accent-soft); }
.grp-Secondary { color: var(--cov-fg); background: var(--cov-bg); }
.grp-Long-tail { color: var(--gen-fg); background: var(--gen-bg); }
.grp-Other { color: var(--unk-fg); background: var(--unk-bg); }
.why-sub { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.col-gscx.off, #tbl.nogsc .col-gscx { display: none; }

/* Groups that belong on other pages */
#others { display: grid; gap: 10px; }
#others details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
#others details[open] { box-shadow: var(--shadow); }
#others summary { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
#others summary .sum-n { color: var(--muted); font-weight: 500; font-size: .9rem; }
#others .mini { margin-top: 10px; }

@media (max-width: 860px) {
  .research-row { flex-direction: column; align-items: stretch; }
  .research-row .btn { width: 100%; }
  .targets { padding: 14px; }
}

/* The small keyword tables scroll inside their own box instead of widening the page */
.targets .mini, #others .mini { display: block; overflow-x: auto; max-width: 100%; }
.targets .mini td, .targets .mini th, #others .mini td, #others .mini th { white-space: nowrap; }
.targets .mini td:first-child, #others .mini td:first-child { white-space: normal; min-width: 170px; }
.targets .mini td .act, #others .mini td .act { white-space: normal; }
.targets, #others, #others details, .target-cols, .target-cols > div { min-width: 0; max-width: 100%; }

/* Where a keyword was found */
.src { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.src-gsc { color: var(--cov-fg); background: var(--cov-bg); }
.src-both { color: var(--accent-strong); background: var(--accent-soft); }
.src-google { color: var(--unk-fg); background: var(--unk-bg); }

/* Location, tabs, trends, bulk and landing-page views */
.market-row { align-items: end; margin-bottom: 14px; }
.market-note { align-self: center; margin: 0; flex: 1 1 220px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.pane-help { margin: 0 0 12px; }
#pane-bulk textarea { width: 100%; min-height: 140px; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); resize: vertical; }
.bulk-actions { justify-content: space-between; margin-top: 12px; }
.trend { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.spark { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: -.04em; color: var(--accent); font-size: 1.05rem; line-height: 1; }
.chg { font-weight: 700; font-size: .84rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.chg.up { color: var(--cov-fg); }
.chg.down { color: var(--can-fg); }
#tbl.notrend .col-trend { display: none; }
.bulk-wrap { overflow-x: auto; max-width: 100%; }
.bulk-wrap .mini { width: 100%; }
.bulk-wrap .mini td, .bulk-wrap .mini th { white-space: nowrap; }
.bulk-wrap .mini td:first-child { white-space: normal; min-width: 200px; word-break: break-word; }
.merged-n { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
#pdetail { gap: 12px; }
#pdetail .mini { display: block; overflow-x: auto; max-width: 100%; }
#pdetail .mini td, #pdetail .mini th { white-space: nowrap; }
#pdetail .mini td:first-child { white-space: normal; min-width: 200px; }
.page-url { word-break: break-all; font-weight: 600; }
@media (max-width: 860px) {
  .market-row { flex-direction: row; }
  .bulk-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 860px) {
  .research-row .field.grow, .research-row .market-note { flex: 0 0 auto; }
}

/* Hover chart, scrollable tables, tooltip */
.chart { display: block; overflow: visible; cursor: crosshair; touch-action: pan-y; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.trend { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.tip { position: fixed; z-index: 50; pointer-events: none; display: grid; gap: 1px; padding: 7px 11px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: .8rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.tip[hidden] { display: none; }
.tip span { opacity: .75; }
.tip b { font-size: .92rem; }
.scrollbox { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.scrollbox.tall { max-height: max(320px, 70vh); }
.scrollbox .mini { margin: 0; }
.scrollbox thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
#panalysis, #panalyse { gap: 12px; }
#panalysis .mini td, #panalysis .mini th { white-space: nowrap; }
#panalysis .mini td:first-child, #panalysis .mini td:nth-child(2) { white-space: normal; min-width: 160px; word-break: break-word; }
#pdetail .scrollbox .mini, #panalysis .scrollbox .mini { display: table; overflow: visible; }

/* Compact columns: numbers take only the room they need, the keyword takes the rest */
#tbl { min-width: 0; table-layout: auto; }
#tbl > thead th, #tbl > tbody > tr.main > td { padding: 10px 10px; }
#tbl > thead th.num, #tbl > tbody > tr.main > td.num { width: 1%; white-space: nowrap; }
/* The keyword column is the second one now (the first holds the tick box, which stays as narrow as its box). */
#tbl > thead th:nth-child(2), #tbl > tbody > tr.main > td:nth-child(2) { min-width: 180px; width: 28%; }
#tbl > thead th.sel, #tbl > tbody > tr.main > td.sel { width: 1%; min-width: 0; white-space: nowrap; padding-left: 12px; padding-right: 4px; }
#tbl > tbody > tr.main > td.pg { min-width: 120px; max-width: 220px; overflow-wrap: anywhere; }
#tbl .col-trend { white-space: nowrap; width: 1%; }
.page-url.main { color: var(--accent-strong); }
.why-sub.ok { color: var(--cov-fg); }
.why-sub.warn { color: var(--gap-fg); }
.landing { margin: 6px 0 0; }
.targets .scrollbox .mini td:nth-child(2) { min-width: 200px; white-space: normal; }
.targets .scrollbox .mini td, .targets .scrollbox .mini th { padding: 8px 10px; }
.targets .scrollbox .mini { display: table; overflow: visible; width: 100%; }
.targets .scrollbox .mini td:last-child { white-space: normal; min-width: 150px; word-break: break-all; }
.landing .warn { color: var(--gap-fg); }
.grp-Related { color: var(--cov-fg); background: var(--cov-bg); }

/* Tick boxes and the copy bar above the keyword tables */
.kwpickbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0 8px; }
.kwpickcount { font-weight: 700; margin-right: 4px; }
.kwpick { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
#tbl th.sel, #tbl td.sel, .tbl td.sel, .tbl th.sel { width: 44px; text-align: center; padding-left: 8px; padding-right: 4px; }
@media (max-width: 1099px) { #tbl > tbody > tr.main > td.sel { display: flex; align-items: center; gap: 8px; } #tbl > tbody > tr.main > td.sel::before { content: attr(data-label); } }
.kwpick { vertical-align: middle; margin: 0; } #tbl > tbody > tr.main > td.sel { vertical-align: top; padding-top: 14px; }
