/* JSerForge keyword research workspace */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: #283446;
  background: #f5f7fa;
  font-synthesis: none;
  --blue: #1967d2;
  --blue-soft: #eaf2ff;
  --ink: #202b3b;
  --muted: #6b7789;
  --border: #e3e7ed;
  --sidebar-width: 184px;
  --topbar-height: 66px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
main, section, article, aside, div { min-width: 0; }
main {
  width: calc(100% - var(--sidebar-width));
  max-width: 1800px;
  margin: 0 0 0 var(--sidebar-width);
  padding: 26px 28px 20px;
}
h1, h2, h3, p { margin: 0; }
h1 { color: var(--ink); font-size: 25px; font-weight: 650; line-height: 1.4; letter-spacing: -.6px; }
h2 { color: var(--ink); font-size: 17px; font-weight: 650; }
h3 { color: var(--ink); font-size: 14px; font-weight: 600; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { flex-shrink: 0; }
button, input, select, textarea, .button { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
button:hover:not(:disabled), .button:hover { background: #1558b5; text-decoration: none; }
button:disabled { opacity: .46; cursor: not-allowed; }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #8ab4f8;
  outline-offset: 3px;
}
.secondary { border-color: #d8dee8; background: #fff; color: #42536b; }
.secondary:hover:not(:disabled), .button.secondary:hover { border-color: #b7c9e4; background: #f3f7fe; color: var(--blue); }
.link-button { min-height: 28px; padding: 2px 0; background: transparent; color: var(--blue); font-weight: 500; }
.link-button:hover:not(:disabled) { background: transparent; color: #124e9e; text-decoration: underline; }
input:not([type="checkbox"]), textarea, select {
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cdd5df;
  border-radius: 5px;
  background: #fff;
  color: #283446;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8a94a3; }
input:hover:not(:disabled), textarea:hover:not(:disabled), select:hover:not(:disabled) { border-color: #a1afc0; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
input:disabled, textarea:disabled, select:disabled { background: #f7f9fc; color: #8b95a4; }
input[type="checkbox"] { accent-color: var(--blue); width: 15px; height: 15px; flex: 0 0 15px; }
textarea { display: block; width: 100%; min-height: 114px; resize: vertical; line-height: 1.8; }
label { display: block; margin: 0 0 6px; color: #435065; font-size: 12px; font-weight: 550; }
small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.65; }
summary { cursor: pointer; }
.muted { color: var(--muted); font-size: 12px; }
.inline { display: flex; align-items: center; gap: 8px; }
.card { border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 1px 2px #23334d04; }
.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;
}
.skip-link { position: fixed; z-index: 100; top: -100px; left: 12px; padding: 10px 18px; border-radius: 4px; background: #fff; }
.skip-link:focus { top: 12px; }

/* Persistent application shell */
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--topbar-height);
  padding: 11px 28px 11px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #24344c; font-size: 19px; font-weight: 700; letter-spacing: -.55px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 28px; height: 27px; padding: 2px; }
.brand-mark span { display: block; width: 6px; border-radius: 2px; background: var(--blue); }
.brand-mark span:nth-child(1) { height: 11px; opacity: .5; }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 16px; opacity: .75; }
.brand-product { margin-left: 14px; padding-left: 22px; border-left: 1px solid var(--border); color: #6b7789; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.account { display: flex; align-items: center; justify-content: flex-end; gap: 16px; font-size: 12px; }
.account-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
#status { max-width: 330px; color: #4c5b70; overflow-wrap: anywhere; }
.currency-label { color: #8a94a3; font-size: 10px; }
#currency { margin-left: 4px; color: #52647c; font-weight: 600; }
#connect { min-height: 34px; padding: 6px 12px; color: var(--blue); font-size: 12px; }
.sidebar { position: fixed; z-index: 20; top: var(--topbar-height); bottom: 0; left: 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 25px 12px 20px; border-right: 1px solid var(--border); background: #fff; }
.nav-label { margin: 0 14px 12px; color: #919aaa; font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; border-radius: 6px; color: #5b687a; font-weight: 550; }
.side-nav a svg { width: 19px; height: 19px; }
.side-nav a:hover, .side-nav a:focus-visible { background: var(--blue-soft); color: var(--blue); text-decoration: none; }
.sidebar-note { margin: auto 12px 0; padding-top: 20px; border-top: 1px solid var(--border); color: #8a94a3; font-size: 10px; }
.sidebar-note strong { display: inline; color: #627084; font-size: 11px; font-weight: 550; }
.sidebar-note > span:not(.source-dot) { display: block; margin: 4px 0 0 13px; }
.sidebar-note p { margin-top: 10px; line-height: 1.8; }
.source-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #42977a; vertical-align: 1px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin-bottom: 7px; color: #7a8799; font-size: 10px; letter-spacing: .7px; }
.page-heading .muted { margin-top: 7px; }
.source-label { flex-shrink: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: #627084; font-size: 11px; }

/* Query configuration */
#settings { margin-bottom: 24px; scroll-margin-top: 20px; }
#settings > summary { position: relative; padding: 17px 20px; color: #6b7789; }
#settings[open] > summary { border-bottom: 1px solid var(--border); }
.summary-title { margin-left: 5px; color: var(--ink); font-size: 15px; font-weight: 650; }
.summary-description { margin-left: 16px; color: #7c8797; font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; padding: 18px 20px; }
.settings-grid > section + section { border-left: 1px solid #edf0f4; padding-left: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-title h2, .section-title label { margin: 0; color: #3c495c; font-size: 13px; font-weight: 600; }
.badge { padding: 2px 7px; border-radius: 4px; background: #f1f5fa; color: #63748c; font-size: 10px; }
.badge:empty { display: none; }
#kw { min-height: 136px; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.field-grid select { width: 100%; font-size: 12px; }
.settings-source { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.settings-source .muted, .settings-source .link-button { font-size: 11px; }
.region-tabs, .group-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.group-tab { min-height: 30px; padding: 4px 10px; border: 1px solid #dce3ed; border-radius: 5px; background: #f7f9fc; color: #596b82; font-size: 11px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
.group-tab.active, .group-tab[aria-selected="true"] { border-color: #93baf0; background: var(--blue-soft); color: #185abc; }
.group-tab:hover:not(:disabled) { background: #edf3fc; color: var(--blue); }
.group-tab.result-tab.success { border-color: #b9dfcc; background: #f0faf5; color: #287651; }
.group-tab.result-tab.error, .group-tab.result-tab.stopped { border-color: #eac5c5; background: #fff5f4; color: #a34242; }
.group-tab.result-tab.skipped { color: #8a94a3; }
.group-tab.result-tab.running { border-color: #a8c9f8; background: var(--blue-soft); color: #1967d2; }
.group-tab.result-tab.active { box-shadow: 0 0 0 2px #1967d226; border-color: var(--blue); }
.region-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.region-toolbar .region-name { flex: 1 1 180px; }
#group-name { width: 100%; font-size: 12px; }
.region-toolbar button { min-height: 32px; padding: 5px 9px; font-size: 11px; }
#selected { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
#selected:empty { margin: 0; }
.chip { min-height: 26px; padding: 3px 9px; border-radius: 4px; background: #edf3fc; color: #3f6699; font-size: 11px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
.chip:hover:not(:disabled) { background: #dfeafa; color: #1c569d; }
.segmented { display: inline-flex; margin: 3px 0 8px; border-bottom: 1px solid var(--border); }
.segmented button { min-height: 30px; padding: 5px 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #788497; font-size: 11px; font-weight: 500; }
.segmented button[aria-pressed="true"] { border-bottom-color: var(--blue); color: var(--blue); }
.segmented button:hover:not(:disabled) { background: #f4f7fc; color: var(--blue); }
.geo-search-field input { flex: 1; width: 100%; }
#single-results { max-height: 190px; overflow: auto; }
#single-results button { display: block; width: 100%; margin: 5px 0; text-align: left; justify-content: flex-start; white-space: normal; font-size: 11px; }
#single-status:not(:empty), #geo-status:not(:empty), #region-status:not(:empty) { margin: 7px 0; }
#geo-results details > summary { padding: 6px 0; color: var(--blue); font-size: 11px; }
.geo-row { margin: 7px 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: 4px; background: #fbfcfe; overflow-wrap: anywhere; }
.geo-row strong { display: block; font-size: 11px; }
.geo-row button { max-width: 100%; margin: 5px 5px 0 0; font-size: 11px; white-space: normal; }
.geo-ok { color: #27805a; }
.geo-error { color: #b4443e; }
.geo-pending { color: #966a1c; }
#bulk-panel textarea { margin-bottom: 8px; }
.query-action { padding: 15px 20px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; background: #fbfcfe; }
.estimate { margin-bottom: 12px; color: #65748a; font-size: 11px; }
.estimate:empty { display: none; }
.estimate p { margin: 3px 0; }
.estimate-list { display: flex; flex-wrap: wrap; gap: 2px 24px; margin: 5px 0; padding-left: 18px; }
.estimate-name { margin-right: 6px; color: #43536a; font-weight: 600; }
.warning { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 12px; padding: 9px 12px; border: 1px solid #f0dca7; border-radius: 5px; background: #fffbef; color: #8a661c; }
#run { min-width: 112px; box-shadow: 0 1px 2px #1967d215; }
.run-actions { flex-wrap: wrap; }
.run-actions > .muted { margin-left: 5px; font-size: 11px; }
#progress:not(:empty) { margin-top: 11px; color: #526c91; font-size: 12px; overflow-wrap: anywhere; }

/* Overview and permanent chart hosts */
.overview { margin-bottom: 24px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.overview-heading .muted { margin-top: 4px; font-size: 11px; }
.scope-label { color: #8290a1; font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; overflow: hidden; padding: 17px 18px 14px; }
.metric-card::before { position: absolute; content: ""; left: 0; top: 20px; width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--metric-color, var(--blue)); }
.metric-blue { --metric-color: #4285e0; }
.metric-teal { --metric-color: #339aa3; }
.metric-green { --metric-color: #4b9975; }
.metric-purple { --metric-color: #8a78c3; }
.metric-card h3 { color: #68768a; font-size: 12px; font-weight: 500; }
.metric-value { margin: 9px 0 6px; color: var(--ink); font-size: 30px; line-height: 1.25; font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-description { color: #8a95a4; font-size: 10px; line-height: 1.65; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.chart-card { display: flex; flex-direction: column; padding: 18px 20px 12px; overflow: hidden; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 48px; }
.chart-heading h3 { font-size: 13px; }
.chart-heading .muted { margin-top: 3px; font-size: 10px; }
.chart-select { max-width: 48%; }
#overview-keyword { width: 100%; min-height: 31px; font-size: 11px; text-overflow: ellipsis; }
.chart-tag { padding: 3px 7px; border-radius: 4px; background: #f2f5f9; color: #8a95a4; font-size: 10px; white-space: nowrap; }
.overview-chart, .competition-chart { display: flex; flex-direction: column; justify-content: center; flex: 1; min-height: 220px; width: 100%; }
.overview-chart svg, .competition-chart svg { display: block; width: 100%; max-width: 100%; height: auto; }
.chart-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 210px; color: #9aa5b4; text-align: center; font-size: 11px; }
.chart-empty strong { color: #7c899c; font-size: 12px; font-weight: 500; }
.empty-chart-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: 3px; border-radius: 11px; background: #f0f5fc; color: #a5bbd7; font-size: 24px; line-height: 1; }
.chart-note { margin-top: 9px; padding-top: 9px; border-top: 1px solid #f0f2f6; color: #8a95a4; font-size: 10px; line-height: 1.7; }
.distribution-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 42px; align-items: center; gap: 12px; margin: 14px 0; font-size: 11px; }
.distribution-row label { display: flex; align-items: center; gap: 6px; margin: 0; color: #67768b; font-size: 11px; font-weight: 500; }
.distribution-row label span { display: inline-block; }
.distribution-track { height: 9px; overflow: hidden; border-radius: 3px; background: #f0f3f7; }
.distribution-track i { display: block; height: 100%; border-radius: inherit; background: #87a9d6; }
.distribution-row:nth-child(1) .distribution-track i { background: #69a98a; }
.distribution-row:nth-child(2) .distribution-track i { background: #e2b260; }
.distribution-row:nth-child(3) .distribution-track i { background: #d68583; }
.distribution-row:nth-child(4) .distribution-track i { background: #aab5c5; }
.distribution-count { color: #52647d; text-align: right; font-variant-numeric: tabular-nums; }

/* Results, filters and dense table */
.results { overflow: hidden; }
.result-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px 20px; padding: 20px 20px 13px; }
.result-heading { flex: 1 1 240px; }
#snapshot { margin-top: 5px; font-size: 11px; overflow-wrap: anywhere; }
.export-actions { flex-wrap: wrap; gap: 7px; }
.export-actions button { min-height: 33px; padding: 6px 11px; font-size: 11px; }
.result-meta { padding: 0 20px 12px; }
.result-meta p:not(:empty) { margin: 6px 0; font-size: 11px; overflow-wrap: anywhere; }
#result-state:not(:empty) { padding: 8px 11px; border-left: 3px solid #84aee7; border-radius: 3px; background: #f4f8fe; color: #587196; }
.conditions { color: #778397; font-size: 11px; }
.conditions summary { display: inline-block; color: var(--blue); }
.conditions summary::before { display: inline-block; content: "+"; margin-right: 5px; font-size: 13px; }
.conditions[open] summary::before { content: "−"; }
#query-conditions p { padding: 8px 11px; border-radius: 4px; background: #f7f9fc; }
.tabs { display: flex; padding: 0 20px; border-bottom: 1px solid var(--border); }
.tabs button { min-height: 44px; padding: 10px 22px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #7a8798; font-size: 12px; font-weight: 600; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--blue); color: var(--blue); }
.tabs button:hover:not(:disabled) { background: #f5f8fe; color: var(--blue); }
.filter-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid #f0f2f5; }
.search-control { position: relative; flex: 1 1 190px; max-width: 340px; }
.search-control svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: #8d99aa; pointer-events: none; }
#local-search { width: 100%; padding-left: 33px; font-size: 12px; }
.filter-field { flex: 0 1 auto; }
.filter-field label { margin-bottom: 4px; font-size: 10px; }
.filter-field select { min-width: 116px; font-size: 11px; }
.volume-filter { width: 122px; }
#min-volume { width: 100%; font-size: 11px; }
.reset-filters { min-height: 36px; margin-left: 2px; font-size: 11px; }
.filter-count { align-self: flex-end; padding: 10px 0; color: #8793a4; font-size: 10px; }
.table-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 10px 20px; background: #fcfdfe; }
#summary { color: #788599; font-size: 11px; }
.table-preferences { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.table-preferences .inline { gap: 6px; }
.table-preferences label { margin: 0; color: #8290a2; font-size: 10px; }
.table-preferences select { min-height: 27px; padding: 3px 5px; border-color: #e0e5ed; font-size: 10px; }
.tablewrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); scrollbar-color: #c6d1df #f5f7fa; scrollbar-width: thin; }
table { border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.main-table { width: 100%; min-width: 1120px; }
.main-table > thead > tr > th { height: 42px; padding: 8px 11px; border-bottom: 1px solid #dfe5ed; background: #f7f9fc; color: #66778e; text-align: right; font-size: 10px; font-weight: 550; white-space: nowrap; }
.main-table > thead > tr > th:first-child { min-width: 192px; padding-left: 20px; text-align: left; }
.main-table > thead > tr > th:nth-child(2), .main-table > thead > tr > th:nth-child(4), .main-table > thead > tr > th:last-child { text-align: left; }
button.sort { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; text-align: inherit; }
button.sort:hover:not(:disabled) { background: transparent; color: var(--blue); }
.main-table > tbody > tr > td { height: 48px; padding: 10px 11px; border-bottom: 1px solid #edf0f5; color: #53647a; text-align: right; vertical-align: middle; }
.main-table > tbody > tr:last-child > td { border-bottom: 0; }
.main-table > tbody > tr:hover { background: #f7faff; }
.main-table > tbody > tr > td:first-child { min-width: 192px; max-width: 290px; padding-left: 20px; color: #334d70; text-align: left; font-weight: 550; overflow-wrap: anywhere; }
.main-table > tbody > tr > td:nth-child(2), .main-table > tbody > tr > td:nth-child(4), .main-table > tbody > tr > td:last-child { text-align: left; }
.main-table > tbody > tr > td:last-child { min-width: 115px; max-width: 280px; font-size: 10px; }
.main-table > tbody > tr > td:last-child p { margin-bottom: 5px; overflow-wrap: anywhere; }
.main-table td small, .keyword-cell small { margin-top: 3px; color: #8b98aa; font-size: 9px; font-weight: 400; }
.main-table td details summary { color: #6783a8; white-space: nowrap; }
.main-table .table-empty, .main-table td[colspan] { height: 160px; color: #8a96a7; text-align: center; font-size: 12px; font-weight: 400; }
.volume-cell { min-width: 110px; font-weight: 550; }
.volume-meter { display: block; width: 64px; height: 3px; margin: 5px 0 0 auto; overflow: hidden; border-radius: 2px; background: #eaf0f8; }
.volume-meter i { display: block; height: 100%; border-radius: inherit; background: #8fb5e8; }
.status-pill, .competition-pill { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; white-space: nowrap; }
.status-pill.complete { background: #eef7f2; color: #3b8562; }
.status-pill.missing { background: #fff7e8; color: #a17b34; }
.competition-pill.low { background: #edf6f1; color: #458465; }
.competition-pill.medium { background: #fff7e9; color: #a07e3d; }
.competition-pill.high { background: #fbeeee; color: #ad6764; }
.competition-pill.unknown { background: #f0f3f7; color: #8995a5; }
.row-details { max-width: 310px; }
.row-details[open] { min-width: 260px; }
.row-details summary { font-size: 10px; }
.trend-button { min-height: 24px; margin-top: 3px; font-size: 10px; }
.detail-scroll { max-width: 100%; margin-top: 8px; overflow-x: auto; scrollbar-width: thin; }
.detail-scroll table { width: 100%; background: #fff; }
.detail-scroll th, .detail-scroll td { padding: 7px 9px; border-bottom: 1px solid var(--border); color: #69788d; text-align: right; font-size: 10px; white-space: nowrap; font-weight: 400; }
.detail-scroll th { background: #f5f8fc; color: #50637d; font-weight: 550; }
.detail-scroll th:first-child, .detail-scroll td:first-child { text-align: left; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 20px; }
.pagination-note { color: #97a1af; font-size: 10px; }
.pagination button { min-height: 29px; padding: 4px 10px; font-size: 10px; }
#page-label { min-width: 48px; color: #7a899d; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.notes { padding: 12px 20px; border-top: 1px solid var(--border); background: #fbfcfe; color: #8a95a5; font-size: 10px; }
.notes summary { color: #75849a; font-weight: 500; }
.notes p { margin-top: 8px; line-height: 1.8; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; color: #98a2b0; font-size: 10px; }

/* Existing per-keyword trend dialog */
.trend-dialog { width: min(940px, calc(100vw - 36px)); max-height: calc(100dvh - 40px); padding: 22px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 20px 70px #182b4a26; }
.trend-dialog::backdrop { background: #1c2d496b; backdrop-filter: blur(2px); }
.trend-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.trend-head h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.trend-head button { flex-shrink: 0; }
#trend-note { margin: 10px 0 4px; font-size: 11px; line-height: 1.8; }
.trend-body { margin: 6px 0 14px; overflow: auto; }
.trend-body svg { display: block; width: 100%; max-width: 100%; height: auto; }
#trend-table .detail-scroll { margin-top: 0; }
#trend-table th, #trend-table td { font-size: 11px; }

/* Compact laptops and mobile: only the data table scrolls sideways. */
@media (min-width: 1800px) {
  main { margin-right: auto; margin-left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width) - 1800px) / 2); }
}
@media (max-width: 1280px) {
  :root { --sidebar-width: 164px; }
  main { padding: 22px 20px 18px; }
  .sidebar { padding-right: 9px; padding-left: 9px; }
  .side-nav a { padding-right: 12px; padding-left: 12px; }
  .source-label { display: none; }
  .settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; }
  .settings-grid > section + section { padding-left: 18px; }
  .chart-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .metric-card { padding-right: 14px; padding-left: 15px; }
  .metric-card h3 { font-size: 11px; }
  .metric-value { font-size: 27px; }
  .filter-toolbar { gap: 10px; }
}
@media (max-width: 1000px) {
  :root { --sidebar-width: 0px; }
  html { scroll-padding-top: 130px; }
  .topbar { padding-right: 20px; padding-left: 20px; }
  .sidebar { position: sticky; top: var(--topbar-height); z-index: 25; width: 100%; padding: 0 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-label, .sidebar-note { display: none; }
  .side-nav { flex-direction: row; gap: 8px; }
  .side-nav a { min-height: 43px; padding: 9px 13px; border-radius: 0; font-size: 12px; }
  .side-nav a svg { width: 16px; height: 16px; }
  main { width: 100%; margin: 0; }
  .brand-product { margin-left: 6px; padding-left: 14px; }
  h1 { font-size: 23px; }
  .page-heading { margin-bottom: 18px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 65px; }
  .topbar { position: relative; gap: 10px; padding: 10px 14px; }
  .sidebar { top: 0; }
  .brand { gap: 7px; font-size: 17px; }
  .brand-product { display: none; }
  .brand-mark { width: 24px; height: 25px; }
  .account { gap: 9px; }
  #status { max-width: 190px; font-size: 10px; }
  #connect { min-height: 30px; padding: 5px 8px; font-size: 10px; }
  .sidebar { padding: 0 10px; }
  .side-nav { gap: 0; }
  .side-nav a { gap: 7px; padding: 9px 12px; font-size: 11px; }
  main { padding: 20px 14px 16px; }
  h1 { font-size: 21px; }
  .page-heading .muted { max-width: 430px; font-size: 11px; line-height: 1.8; }
  .settings-grid { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .settings-grid > section + section { padding: 17px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  #settings > summary { padding: 14px 16px; }
  .summary-description { display: block; margin: 3px 0 0 18px; font-size: 10px; }
  .query-action { padding: 14px 16px; }
  .run-actions > .muted { width: 100%; margin: 2px 0 0; }
  .overview-heading { align-items: flex-start; }
  .scope-label { max-width: 100px; font-size: 9px; text-align: right; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { padding: 14px 15px 12px; }
  .metric-value { font-size: 28px; }
  .metric-description { font-size: 9px; }
  .chart-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .chart-card { padding: 16px 16px 11px; }
  .overview-chart { min-height: 200px; }
  .competition-chart { min-height: 170px; }
  .competition-chart .chart-empty { min-height: 170px; }
  .result-top { padding: 17px 16px 12px; }
  .result-meta { padding-right: 16px; padding-left: 16px; }
  .export-actions { width: 100%; }
  .export-actions button { flex: 1 1 auto; white-space: normal; }
  .tabs { padding: 0 16px; }
  .tabs button { padding-right: 18px; padding-left: 18px; }
  .filter-toolbar { padding: 14px 16px; gap: 11px 10px; }
  .search-control { flex-basis: 100%; max-width: none; }
  .filter-field { flex: 1 1 110px; }
  .filter-field select { width: 100%; }
  .volume-filter { width: auto; }
  .reset-filters { margin-left: 0; }
  .filter-count { margin-left: auto; }
  .table-tools { padding-right: 16px; padding-left: 16px; }
  .table-preferences { gap: 8px 14px; }
  .table-preferences .inline { gap: 5px; }
  .pagination { padding: 12px 16px; }
  .notes { padding: 12px 16px; }
  footer { margin-top: 16px; font-size: 9px; }
  .trend-dialog { padding: 16px; }
}
@media (max-width: 420px) {
  .topbar { padding-right: 10px; padding-left: 10px; }
  .brand { font-size: 15px; }
  .account { flex-wrap: wrap; justify-content: flex-end; gap: 3px 7px; max-width: 175px; }
  #status { max-width: 160px; }
  #connect { min-height: 25px; padding-top: 2px; padding-bottom: 2px; }
  .side-nav { justify-content: space-between; }
  .side-nav a { padding: 9px 8px; }
  .side-nav a svg { width: 15px; height: 15px; }
  main { padding-right: 10px; padding-left: 10px; }
  h1 { font-size: 19px; }
  .field-grid { grid-template-columns: 1fr; gap: 10px; }
  .settings-source { flex-wrap: wrap; gap: 3px; }
  .region-toolbar .inline { flex-wrap: wrap; }
  .region-toolbar .region-name { flex-basis: 100%; }
  .chart-heading { flex-wrap: wrap; gap: 8px; }
  .chart-select { width: 100%; max-width: none; }
  .chart-tag { margin-left: auto; }
  .metric-card h3 { font-size: 10px; }
  .metric-value { font-size: 25px; }
  .table-preferences { width: 100%; }
  .pagination-note { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Latest-main account discovery, session and browser-local research controls. */
.workspace-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px;padding:0 26px 20px}.workspace-grid section{min-width:0}.workspace-grid select{width:100%}.workspace-grid .inline{flex-wrap:wrap}.workspace-grid input{flex:1;min-width:160px}#workspace>summary{padding:20px 26px;font-size:18px;font-weight:700}#workspace>summary span{font-size:13px;font-weight:400}.workspace-buttons{margin:12px 0}.workspace-footer{padding:0 26px 22px;border-top:1px solid #e8edf3}.workspace-footer>button{margin-top:12px}#workspace-status{overflow-wrap:anywhere}.account-filters{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.account-filters input[type=search]{flex:1;min-width:180px}.checkbox-label{display:flex;align-items:center;gap:6px;font-weight:400}#account-filter-status{font-size:13px;overflow-wrap:anywhere}@media(max-width:850px){.workspace-grid{grid-template-columns:1fr;padding:0 18px 18px;gap:18px}.workspace-footer{padding:0 18px 18px}#workspace>summary{padding:18px}#workspace>summary span{display:block}.workspace-grid .inline{align-items:stretch}.workspace-grid button{white-space:normal}}
.account-settings{padding:0 26px 24px;border-bottom:1px solid #e8edf3;margin-bottom:18px}.account-settings .inline{flex-wrap:wrap}.account-settings select{flex:1;min-width:0;width:100%}#account-status{overflow-wrap:anywhere}@media(max-width:850px){.account-settings{padding:0 18px 18px}.account-settings .inline{flex-direction:column;align-items:stretch}}
#session-info{font-size:12px;color:#64758a;white-space:nowrap}
#logout{white-space:nowrap}
#workspace { margin-bottom: 20px; }
#workspace > summary { padding: 17px 20px; font-size: 15px; }
.workspace-grid { padding: 18px 20px; gap: 24px; }
.workspace-grid h2 { margin-bottom: 12px; font-size: 14px; }
.workspace-grid label { margin-top: 12px; }
.workspace-footer { padding: 14px 20px; border-color: var(--border); background: #fbfcfe; border-radius: 0 0 8px 8px; }
.workspace-footer p { margin: 5px 0; }
.workspace-footer small { overflow-wrap: anywhere; }
.account-settings { padding: 18px 20px; margin: 0; border-color: var(--border); }
.account-settings label { margin-top: 5px; }
.account-filters { margin-bottom: 10px; }
.account-settings .inline { flex-wrap: wrap; }
#session-info { white-space: normal; overflow-wrap: anywhere; max-width: 330px; font-size: 10px; }
#geo-separator { width: 100%; margin-bottom: 8px; font-size: 11px; }
.topbar .account { flex-wrap: wrap; }
@media (max-width: 1000px) { .side-nav { flex-wrap: wrap; } }
@media (max-width: 760px) {
 .workspace-grid { grid-template-columns: minmax(0,1fr); padding: 16px; }
 .workspace-grid input { min-width: 0; width: 100%; }
 .workspace-grid .inline { flex-wrap: wrap; }
 .workspace-grid button, .account-settings button { white-space: normal; }
 #workspace > summary { padding: 14px 16px; }
 .workspace-footer, .account-settings { padding: 14px 16px; }
 .side-nav a { flex: 1 1 auto; justify-content: center; }
 #session-info { max-width: 190px; font-size: 9px; }
}
