:root { --ink: #16181d; --muted: #5f6673; --line: #e3e5ea; --accent: #2f5bea; --bg: #f7f8fa; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
main { max-width: 640px; margin: 0 auto; padding: 24px 20px 64px; }
a { color: var(--accent); }

.topnav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; row-gap: 10px; margin-bottom: 24px; font-size: 14px; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); text-decoration: underline; }
.topnav .brand { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; flex-shrink: 0; }
.topnav .brand:hover { color: var(--ink); text-decoration: none; }
.topnav .brand img { display: block; border-radius: 6px; }

h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 32px; }

form { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; }
input, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 20px; background: #fff; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 120px; resize: vertical; }
button { width: 100%; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 12px; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.error { color: #b42318; margin: 16px 0 0; }
.setup-hint { margin: -2px 0 10px; }
.setup-cancel { text-align: center; margin: 12px 0 0; font-size: 14px; }
.setup-cancel a { color: var(--muted); }
.tracking { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 0 0 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.tracking span { min-width: 0; overflow-wrap: anywhere; }
.tracking a { font-size: 14px; color: var(--muted); white-space: nowrap; }
.tracking a:hover { color: var(--ink); }

#results { margin-top: 32px; }
.result { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; display: flex; gap: 16px; align-items: baseline; }
.pos { font-size: 24px; font-weight: 700; min-width: 72px; }
.pos.none { font-size: 16px; color: var(--muted); font-weight: 600; }
.query { font-weight: 600; overflow-wrap: anywhere; }
.detail { color: var(--muted); font-size: 14px; }
.result-main { flex: 1; min-width: 0; }
.ranking { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.ranking-hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.ranking > li { border-radius: 8px; }
.ranking > li.yours { background: #eaf0ff; }
.plugin-row > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 6px 6px; cursor: pointer; border-radius: 8px; }
.plugin-row > summary::-webkit-details-marker { display: none; }
.plugin-row > summary:hover { background: rgba(22, 24, 29, .04); }
.plugin-row > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ranking .n { color: var(--muted); min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.icon-img, .icon-letter { width: var(--size, 28px); height: var(--size, 28px); border-radius: 7px; flex-shrink: 0; object-fit: cover; background: #f0f1f4; }
.icon-letter { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; color: var(--muted); }
.plugin-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.plugin-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.plugin-desc { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.yours .plugin-name { color: var(--ink); }
.badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; color: var(--muted); background: #eceef2; vertical-align: 1px; }
.badge-yours { color: #fff; background: var(--accent); }
.chevron { color: #b8bdc7; font-size: 18px; line-height: 1; transition: transform .15s; flex-shrink: 0; }
.plugin-row[open] > summary .chevron { transform: rotate(90deg); }
.plugin-panel { padding: 4px 8px 12px 70px; }
.plugin-detail { font-size: 14px; }
.detail-facts { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.detail-desc { margin: 0 0 10px; line-height: 1.55; }
.detail-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 10px; font-size: 13px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.detail-label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.detail-prompts { margin: 0 0 10px; padding-left: 18px; font-size: 13px; }
.detail-prompts li { margin-bottom: 2px; }
.detail-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.note { color: var(--muted); font-size: 14px; margin-top: 16px; }
.note a { color: inherit; }

/* Expandable runs (keyword report run history) */
.run { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.run summary { list-style: none; cursor: pointer; padding: 16px 20px; }
.run summary::-webkit-details-marker { display: none; }
.run summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.run-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.run-body { padding: 0 20px 8px; }
.run-body .result { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0; margin: 0; }
.run-meta { color: var(--muted); font-size: 13px; padding: 0 0 12px; overflow-wrap: anywhere; }
.empty { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--muted); }

/* Keyword reports */
.section-title { font-size: 18px; margin: 32px 0 12px; }
.keyword { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.keyword:hover { border-color: #c9cdd6; }
.keyword:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.keyword-name { font-weight: 600; overflow-wrap: anywhere; }
.keyword-plugin { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.keyword-pos { text-align: right; white-space: nowrap; }
.keyword-pos b { font-size: 18px; }
.keyword-pos .detail { display: block; }
.report-link { font-size: 14px; color: var(--muted); }

.report-actions { text-align: right; flex-shrink: 0; }
.report-actions .detail { margin-top: 6px; font-size: 13px; }
.refresh-btn { width: auto; padding: 8px 18px; }
.refresh-status { background: #eef2fd; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 16px; margin: 0 0 12px; }

.chart { width: 100%; }
.chart-wrap { position: relative; }
.chart svg { display: block; max-width: 100%; height: auto; touch-action: pan-y; }
.chart .grid { stroke: #eceef2; stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 12px; }
.chart .series-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart .series-dot-empty { fill: #fff; stroke: var(--muted); stroke-width: 2; }
.chart .crosshair { stroke: #b8bdc7; stroke-width: 1; pointer-events: none; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: 0 2px 8px rgba(22, 24, 29, .08); pointer-events: none; white-space: nowrap; }
.tip-date { color: var(--muted); }
.tip-value { font-weight: 600; }

.change-warning { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #fff7e6; color: #6b4a00; font-size: 13px; }

/* Keyword report: hero, stats, tabs */
.report-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.report-hero h1 { margin: 0; }
.hero-titles { flex: 1; min-width: 0; }
.hero-sub { color: var(--muted); margin: 2px 0 0; overflow-wrap: anywhere; }
.report-hero .icon-img, .report-hero .icon-letter { border-radius: 14px; box-shadow: 0 1px 3px rgba(22, 24, 29, .12); font-size: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; position: relative; overflow: hidden; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-row { display: flex; align-items: center; gap: 10px; }
.stat-value { font-size: 34px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 2px; }
.stat-sub { color: var(--muted); font-size: 13px; }
.stat-hero { background: linear-gradient(135deg, #f3f6ff 0%, #fff 70%); }
.sparkline { display: block; margin-top: 8px; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.delta { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; line-height: 20px; }
.delta-up { background: #e3ebff; color: #1f45c8; }
.delta-down { background: #eef0f3; color: #4a505c; }
.delta-flat { background: #f2f3f5; color: var(--muted); font-weight: 600; }

.tabs { display: flex; gap: 4px; padding: 4px; background: #eceef2; border-radius: 12px; margin: 8px 0 16px; }
.tab { flex: 1; width: auto; white-space: nowrap; display: inline-flex; justify-content: center; align-items: center; gap: 8px; background: transparent; color: var(--muted); font-weight: 600; padding: 9px 10px; border-radius: 9px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(22, 24, 29, .1); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tab-count { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: rgba(22, 24, 29, .07); line-height: 18px; }
.tab[aria-selected="true"] .tab-count { background: #e3ebff; color: #1f45c8; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-head .card-title { margin-bottom: 4px; }
.empty-inline { color: var(--muted); margin: 0; }

/* Rankings: podium + your spot */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; align-items: end; }
.podium-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 12px 14px; color: var(--ink); text-decoration: none; min-width: 0; }
.podium-card:hover { border-color: #c9cdd6; }
.podium-card.place-1 { padding-top: 26px; background: linear-gradient(180deg, #f3f6ff 0%, #fff 60%); }
.podium-card.is-you { border: 2px solid var(--accent); }
.podium-card .icon-img, .podium-card .icon-letter { border-radius: 12px; font-size: 18px; }
.place { position: absolute; top: 8px; left: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.podium-card.place-1 .place { color: #1f45c8; }
.podium-name { font-weight: 650; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.podium-desc { color: var(--muted); font-size: 12px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.podium-card .badge-yours { margin: 0; }
.neighbors { display: flex; gap: 8px; align-items: stretch; overflow-x: auto; padding: 2px 2px 4px; }
.neighbor { flex: 1 0 96px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 8px; border-radius: 12px; background: #f7f8fa; min-width: 0; }
.neighbor.is-you { background: #eaf0ff; outline: 2px solid var(--accent); outline-offset: -2px; }
.neighbor-pos { font-size: 13px; font-weight: 700; color: var(--muted); }
.neighbor.is-you .neighbor-pos { color: #1f45c8; }
.neighbor-name { font-size: 12px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.neighbor .badge-yours { margin: 0; }

/* History: run timeline */
.run-timeline { position: relative; }
.tl-run { border-top: 1px solid #f0f1f4; }
.tl-run:first-child { border-top: 0; }
.tl-head { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 4px; }
summary.tl-head { cursor: pointer; border-radius: 8px; }
summary.tl-head:hover { background: rgba(22, 24, 29, .03); }
.tl-head::-webkit-details-marker { display: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #e3ebff; flex-shrink: 0; }
.tl-dot-empty { background: #fff; border: 2px solid var(--muted); box-shadow: none; }
.tl-dot-fail { background: #c4c8d0; box-shadow: none; }
.tl-time { font-weight: 600; font-size: 14px; }
.tl-tags { flex: 1; }
.tl-pos { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tl-pos b { font-size: 16px; }
.tl-run[open] > .tl-head .chevron { transform: rotate(90deg); }
.tl-body { padding: 0 4px 12px 26px; }

/* Activity: change feed */
.feed { position: relative; padding-left: 22px; }
.feed::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: #e3e5ea; border-radius: 2px; }
.feed-item { position: relative; margin-bottom: 14px; }
.feed-dot { position: absolute; left: -22px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.feed-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.feed-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.feed-time { color: var(--muted); font-size: 13px; }
.feed-since { color: var(--muted); font-size: 12px; margin: 2px 0 12px; }
.transition { display: inline-flex; align-items: center; gap: 10px; }
.tr-pos { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.tr-from { color: #9aa0ab; }
.tr-arrow { color: #b8bdc7; font-size: 20px; }
.chip-group { margin-top: 12px; }
.chip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.chip-title { font-size: 13px; font-weight: 600; }
.chip-count { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: #eceef2; color: var(--muted); line-height: 18px; }
.tone-above .chip-count { background: #e3ebff; color: #1f45c8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 10px 4px 4px; border-radius: 999px; background: #f4f5f7; border: 1px solid #eceef2; color: var(--ink); text-decoration: none; font-size: 13px; }
.chip:hover { border-color: #c9cdd6; background: #fff; }
.chip .icon-img, .chip .icon-letter { border-radius: 50%; font-size: 11px; }
.chip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip-pos { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tone-above .chip { background: #eef3ff; border-color: #dfe7fd; }
.chip-more { padding: 4px 10px; color: var(--muted); }
.empty-visual { text-align: center; padding: 40px 24px; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; background: #eaf0ff; color: var(--accent); font-size: 26px; line-height: 52px; font-weight: 700; }
.empty-title { font-weight: 650; color: var(--ink); margin-bottom: 4px; }

/* Plugin report page */
.plugin-hero { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.plugin-hero h1 { margin: 2px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.plugin-hero h1 .badge { margin: 0; font-size: 12px; }
.plugin-hero .icon-img, .plugin-hero .icon-letter { border-radius: 16px; box-shadow: 0 1px 4px rgba(22, 24, 29, .14); font-size: 26px; }
.fact-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fact-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: #4a505c; }
.stat-of { color: var(--muted); font-size: 14px; }
.dot-meter { display: flex; gap: 5px; margin-top: 10px; }
.dot-meter .dot { width: 10px; height: 10px; border-radius: 50%; background: #e3e5ea; }
.dot-meter .dot.on { background: var(--accent); }
.kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kw-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--ink); text-decoration: none; }
.kw-card:hover { border-color: #c9cdd6; }
.kw-card.is-ahead { border-top: 3px solid var(--accent); padding-top: 14px; }
.kw-card.is-absent { background: #fafbfc; }
.kw-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kw-query { font-weight: 650; overflow-wrap: anywhere; }
.kw-pos-row { display: flex; align-items: center; gap: 8px; }
.kw-pos { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.kw-card.is-absent .kw-pos { color: #b8bdc7; }
.kw-lead { color: var(--muted); font-size: 13px; font-weight: 600; }
.kw-card.is-ahead .kw-lead { color: #1f45c8; }
.kw-foot { color: var(--muted); font-size: 12px; margin-top: 6px; }
.kw-card .sparkline { margin: 0; }
.track-wrap { margin-top: 14px; }
.rank-track { position: relative; height: 22px; margin: 0 8px; }
.track-line { position: absolute; left: 0; right: 0; top: 10px; height: 2px; border-radius: 2px; background: #e3e5ea; }
.track-marker { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(22, 24, 29, .12); }
.marker-them { background: #16181d; z-index: 2; }
.marker-you { background: var(--accent); z-index: 1; }
.marker-label { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: #1f45c8; }
.track-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; }
.listing-meta { display: flex; align-items: center; gap: 12px; }
.link-btn { width: auto; background: none; color: var(--accent); padding: 0; font-weight: 600; font-size: 14px; }
.link-btn:disabled { color: var(--muted); }
.listing-body { margin-top: 8px; }
.detail-report-link { font-weight: 600; }
.hero-icon-link { display: inline-flex; border-radius: 14px; }
.neighbor { color: var(--ink); text-decoration: none; }
.neighbor:hover { background: #eef0f3; }
.neighbor.is-you:hover { background: #e3ebff; }

/* Listing changes */
.section-head { display: flex; align-items: center; gap: 8px; margin: 32px 0 12px; }
.section-head .section-title { margin: 0; }
.fact-pill-changed { background: #e3ebff; border-color: #cfdcfd; color: #1f45c8; }
.source-badge { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.source-listing { background: #16181d; color: #fff; }
.source-results { background: #eceef2; color: #4a505c; }
.field-change { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid #f0f1f4; }
.field-change:first-of-type { border-top: 0; }
.field-label { color: var(--muted); font-size: 13px; font-weight: 600; padding-top: 2px; }
.field-body { min-width: 0; font-size: 14px; }
.diff-text { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.diff-text del { background: #fde8e8; color: #8a1c1c; text-decoration: line-through; text-decoration-color: rgba(138, 28, 28, .5); border-radius: 3px; padding: 0 2px; }
.diff-text ins { background: #e3f4e8; color: #14532d; text-decoration: none; border-radius: 3px; padding: 0 2px; }
.diff-swap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.diff-old { color: #8a1c1c; background: #fde8e8; text-decoration: line-through; padding: 2px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.diff-new { color: #14532d; background: #e3f4e8; font-weight: 600; padding: 2px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.diff-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.diff-chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; overflow-wrap: anywhere; }
.diff-chip-ins { background: #e3f4e8; color: #14532d; }
.diff-chip-del { background: #fde8e8; color: #8a1c1c; text-decoration: line-through; text-decoration-color: rgba(138, 28, 28, .4); }
.diff-icons { display: flex; align-items: center; gap: 10px; }
.diff-icons .icon-img, .diff-icons .icon-letter { border-radius: 9px; }
.tone-update .chip-count { background: #16181d; color: #fff; }
.empty-compact { padding: 28px 20px; }

/* Keywords: batch run */
.batch-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; margin-bottom: 12px; background: rgba(247, 248, 250, .92); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 12px; }
.select-all { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; font-size: 14px; cursor: pointer; }
.select-all input, .row-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.run-btn { width: auto; padding: 9px 18px; }
.keyword-row { display: flex; align-items: stretch; gap: 0; margin-bottom: 8px; border-radius: 12px; }
.keyword-row .keyword { flex: 1; margin-bottom: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; }
.row-check { display: flex; align-items: center; justify-content: center; width: 48px; margin: 0; background: #fff; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; cursor: pointer; }
.keyword-row.is-selected .row-check, .keyword-row.is-selected .keyword { background: #f3f6ff; border-color: #cfdcfd; }
.keyword-pos-top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.run-state { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; font-weight: 600; }
.run-queued { color: var(--muted); }
.run-running { color: #1f45c8; }
.run-done { color: #14532d; }
.run-recent { color: var(--muted); }
.run-failed { color: #b42318; }
.run-done::before { content: "✓"; }
.run-failed::before { content: "!"; font-weight: 800; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #cfdcfd; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* SEO analysis */
.section-title-first { margin-top: 0; }
.tab-panel .section-head:first-child { margin-top: 0; }
.finding-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.finding { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.tone-icon { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.tone-good { background: #e3f4e8; color: #14532d; }
.tone-gap { background: #fff1d6; color: #7a4b00; }
.tone-info { background: #e3ebff; color: #1f45c8; font-style: italic; font-family: Georgia, serif; }
.match-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.match-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); flex-shrink: 0; }
.match-exact { background: var(--accent); }
.match-partial { background: linear-gradient(90deg, var(--accent) 50%, #fff 50%); }
.match-none { border-color: #cfd3da; background: #fff; }
.placement-grid { display: flex; flex-direction: column; margin-top: 8px; }
.pg-row { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(4, 1fr) 64px; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid #f0f1f4; }
.pg-header { border-top: 0; padding: 4px 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.pg-header span:not(:first-child) { text-align: center; }
.pg-header span:last-child { text-align: right; }
.pg-cell { display: flex; justify-content: center; }
.pg-query { min-width: 0; }
.pg-query-text { font-weight: 650; overflow-wrap: anywhere; }
.pg-share { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.share-bar { width: 64px; height: 6px; border-radius: 3px; background: #eceef2; overflow: hidden; flex-shrink: 0; }
.share-fill { display: block; height: 100%; background: #16181d; border-radius: 3px; }
.share-text { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pg-words { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.word-chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f2f3f5; color: #4a505c; }
.pg-pos { text-align: right; font-weight: 750; font-size: 18px; }
.pg-pos.is-top { color: #1f45c8; }
.pg-pos.is-none { color: #b8bdc7; }
.entity-group { margin-bottom: 14px; }
.entity-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.entity-in { background: #eef3ff; color: #1f45c8; }
.entity-missing { background: #fff7e6; color: #7a4b00; }
.entity-kind { font-size: 10px; opacity: .7; }
.entity-count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .8); }
.entity-type { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.entity-note { margin: 4px 0 0; font-size: 12px; }
.basics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.basic { background: #f7f8fa; border-radius: 12px; padding: 12px 14px; }
.basic-value { font-size: 20px; font-weight: 700; margin: 2px 0; }
.basic-compare { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.compare-row { display: grid; grid-template-columns: 78px 1fr 24px; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.compare-bar { height: 6px; border-radius: 3px; }
.bar-you { background: var(--accent); }
.bar-them { background: #b8bdc7; }
.compare-value { text-align: right; font-variant-numeric: tabular-nums; }
.ai-card { border: 1px solid #d9e2fb; background: linear-gradient(180deg, #f6f8ff 0%, #fff 140px); }
.ai-title { display: flex; align-items: center; gap: 8px; }
.ai-spark { color: var(--accent); }
.ai-empty p { margin: 6px 0; }
.ai-summary { font-size: 16px; line-height: 1.55; margin: 6px 0 14px; }
.ai-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.ai-col .chip-title, .ai-block .chip-title { margin-bottom: 8px; display: block; }
.ai-block { margin-top: 16px; }
.opps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.opp { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.opp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.opp-keyword { font-weight: 700; }
.field-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: #16181d; color: #fff; }
.suggestion { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.suggestion-swap { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.suggestion-swap .diff-old, .suggestion-swap .diff-new { display: block; }
.badge-stale { background: #fff1d6; color: #7a4b00; }
.ai-note { margin: 14px 0 0; font-size: 12px; }
.ai-cost { margin: 6px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Signals */
.signals { margin-bottom: 8px; }
.signals-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.signals-title { font-size: 16px; margin: 0; }
.signals-head .detail { font-size: 12px; }
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.signal .stat-value { font-size: 28px; }
.signal-bar { height: 6px; border-radius: 3px; background: #eceef2; margin: 8px 0 6px; overflow: hidden; }
.signal-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.streak-dots { display: flex; gap: 4px; margin-top: 6px; }
.streak-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: #e3e5ea; }
.streak-dots .dot.on { background: #16181d; }
.signal.is-active { border-top: 3px solid var(--accent); padding-top: 14px; }

/* Rankings over time grid */
.grid-filters { display: inline-flex; gap: 2px; padding: 3px; background: #eceef2; border-radius: 9px; }
.filter-btn { width: auto; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 7px; }
.filter-btn.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(22, 24, 29, .1); }
.rank-grid-scroll { overflow-x: auto; margin: 10px -4px 0; }
.rank-grid { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.rank-grid th { font-weight: 600; color: var(--muted); font-size: 12px; text-align: center; padding: 2px 4px; white-space: nowrap; }
.rank-grid th.rg-plugin { text-align: left; }
.rg-check span { display: block; }
.rg-time { font-weight: 400; font-size: 11px; }
.rg-warn { color: #a15c00; cursor: help; }
.rank-grid tbody th.rg-plugin { font-weight: 400; padding: 0; max-width: 240px; }
.rg-link { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; padding: 4px 6px; border-radius: 6px; min-width: 0; }
.rg-link:hover { background: rgba(22, 24, 29, .04); }
.rg-link .icon-img, .rg-link .icon-letter { border-radius: 5px; font-size: 10px; }
.rg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; min-width: 0; }
.rg-cell { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 6px; padding: 6px 4px; min-width: 40px; }
.band-1 { background: #1f45c8; color: #fff; }
.band-2 { background: #3d5fd6; color: #fff; }
.band-3 { background: #b4c4f4; color: #16181d; }
.band-4 { background: #dce4fb; color: #16181d; }
.band-5 { background: #eff3fe; color: #4a505c; }
.band-none { background: #fff; color: #b8bdc7; font-weight: 400; box-shadow: inset 0 0 0 1px #eceef2; }
.rg-move { text-align: right; white-space: nowrap; }
.rank-grid tr.is-you .rg-link { background: #eaf0ff; }
.rank-grid tr.is-you .rg-cell { box-shadow: 0 0 0 2px #16181d; }
.rank-grid tr.is-dropped { opacity: .55; }
.rg-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.rg-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.rg-note { margin: 8px 0 0; font-size: 12px; }

/* Brands */
.topnav-split { gap: 16px; }
.share-intro { margin: -6px 0 12px; font-size: 13px; }
.share-chart { display: flex; flex-direction: column; gap: 8px; }
.share-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.share-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; min-width: 0; }
.share-label .badge { margin: 0; }
.share-track { height: 16px; background: #f2f3f5; border-radius: 4px; overflow: hidden; }
.share-bar-fill { display: block; height: 100%; background: #9aa0ab; border-radius: 0 4px 4px 0; }
.share-row.is-you .share-bar-fill { background: var(--accent); }
.share-value { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.share-firsts { color: #1f45c8; font-weight: 700; }
.brand-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.brand-card.is-you { border-color: #cfdcfd; box-shadow: 0 0 0 1px #cfdcfd; }
.brand-summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; flex-wrap: wrap; }
.brand-summary::-webkit-details-marker { display: none; }
.brand-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 14px; }
.brand-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 220px; }
.icon-stack { display: inline-flex; flex-shrink: 0; }
.icon-stack > * { margin-left: -8px; border: 2px solid #fff; border-radius: 9px; box-sizing: content-box; }
.icon-stack > *:first-child { margin-left: 0; }
.icon-more { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: #eceef2; color: var(--muted); font-size: 12px; font-weight: 700; }
.brand-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.brand-name .badge { margin: 0; }
.brand-dev { font-size: 12px; }
.brand-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.brand-pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f2f3f5; color: #4a505c; white-space: nowrap; }
.brand-pill b { color: var(--ink); }
.brand-pill.is-strong { background: #e3ebff; color: #1f45c8; }
.brand-pill.is-strong b { color: #1f45c8; }
.brand-card[open] > .brand-summary .chevron { transform: rotate(90deg); }
.brand-body { padding: 0 12px 14px; }

.turnstile-box { margin: 0 0 16px; }

/* Waitlist */
.waitlist-card { margin-top: 16px; border: 1px solid #d9e2fb; background: linear-gradient(135deg, #f3f6ff 0%, #fff 60%); }
.waitlist-head { display: flex; gap: 14px; align-items: flex-start; }
.waitlist-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.waitlist-title { margin: 0 0 4px; }
.waitlist-sub { margin: 0 0 12px; }
.waitlist-form { display: flex; gap: 8px; background: none; border: 0; padding: 0; border-radius: 0; }
.waitlist-form input { margin: 0; }
.waitlist-form .run-btn { flex-shrink: 0; }
.waitlist-note { margin: 8px 0 0; font-size: 12px; }
.waitlist-done { margin: 4px 0 0; font-weight: 600; color: #14532d; }

/* Operator stats */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bar { width: 100%; max-width: 24px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.is-zero { background: #eceef2; }
.bar-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.simple-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.simple-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.simple-table td { padding: 7px 8px 7px 0; border-bottom: 1px solid #f0f1f4; overflow-wrap: anywhere; }

/* Accounts */
.nav-account { display: inline-flex; align-items: center; gap: 10px; margin-left: 4px; padding-left: 14px; border-left: 1px solid var(--line); }
.nav-email { color: var(--ink); font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-signout { font-size: 14px; color: var(--muted); }
.nav-signin { color: var(--accent) !important; font-weight: 600; }
.nav-account .badge { margin: 0; }
.account-card { margin-top: 16px; border: 1px solid #f1dfb6; background: linear-gradient(135deg, #fffaf0 0%, #fff 60%); }
.account-icon { background: #16181d; }
.account-btn { display: inline-block; text-decoration: none; text-align: center; margin-top: 4px; }
a.run-btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; padding: 10px 18px; border-radius: 8px; text-decoration: none; }
a.run-btn:hover { filter: brightness(1.05); }
.account-required { background: #fff7e6; color: #6b4a00; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.account-required a { font-weight: 700; color: #6b4a00; }
.welcome-note { background: #e3f4e8; color: #14532d; }
.signin-card { max-width: 440px; }
.signin-card form { background: none; border: 0; padding: 0; }
.signin-done { text-align: center; padding: 8px 0; }

/* Operator settings */
.setting-card { max-width: 640px; }
.setting-form { background: none; border: 0; padding: 0; margin-top: 14px; }
.setting-field label { margin-bottom: 4px; }
.setting-field input { margin-bottom: 4px; }
.setting-help { margin: 0 0 14px; font-size: 12px; }
.setting-actions { display: flex; align-items: center; gap: 16px; }
.setting-actions .run-btn { width: auto; padding: 9px 22px; }
.setting-test { border-top: 1px solid #f0f1f4; padding-top: 14px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.setting-test .setting-field { flex: 1; min-width: 220px; }
.setting-test .setting-field input { margin-bottom: 0; }
.setting-test .link-btn { padding-bottom: 10px; }
.setting-status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.setting-status.is-ok .status-dot { background: #1f9d55; }
.setting-status.is-off .status-dot { background: #c4c8d0; }
.setting-status.is-off { color: var(--muted); }
.setting-message { margin-top: 12px; }

@media (max-width: 480px) {
  .topnav .brand { flex-basis: 100%; }
  .topnav { justify-content: flex-start; }
  .nav-account { margin-left: auto; }
  .pg-row { grid-template-columns: 1fr repeat(4, 34px) 44px; gap: 4px; }
  .pg-header span:not(:first-child) { font-size: 0; }
  .pg-header span:nth-child(2)::after { content: "N"; font-size: 11px; }
  .pg-header span:nth-child(3)::after { content: "T"; font-size: 11px; }
  .pg-header span:nth-child(4)::after { content: "D"; font-size: 11px; }
  .pg-header span:nth-child(5)::after { content: "P"; font-size: 11px; }
  .pg-header span:nth-child(6)::after { content: "#"; font-size: 11px; }
  .ai-columns { grid-template-columns: 1fr; }
  .share-bar { width: 36px; }
  .row-check { width: 40px; }
  .run-state { white-space: normal; text-align: right; }
  .field-change { grid-template-columns: 1fr; gap: 4px; }
  .plugin-hero { gap: 12px; }
  .kw-grid { grid-template-columns: 1fr; }
  .report-hero { flex-wrap: wrap; }
  .report-actions { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; }
  .report-actions .detail { margin: 0; }
  .podium { gap: 8px; }
  .podium-card { padding: 22px 6px 10px; }
  .podium-desc { display: none; }
  .tr-pos { font-size: 22px; }
  .tl-tags .badge { display: none; }
  .nav-email { max-width: 110px; }
  .waitlist-form { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .chart-pair { grid-template-columns: 1fr; }
  .share-row { grid-template-columns: 90px 1fr auto; }
  .share-label .badge { display: none; }
  .brand-left { min-width: 0; }
  .rank-grid tbody th.rg-plugin { max-width: 140px; }
  .tab { padding: 8px 4px; gap: 5px; font-size: 14px; min-width: 0; }
  .tab-count { padding: 0 5px; }
  .plugin-panel { padding-left: 8px; }
  .result { flex-direction: column; gap: 2px; padding: 16px; }
  .pos { min-width: 0; }
  .result-main { width: 100%; }
  .run-head { flex-direction: column; gap: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .signal-grid { grid-template-columns: 1fr 1fr; }
  .signal .stat-value { font-size: 22px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { flex: 0 0 auto; padding: 8px 10px; }
  .signal-grid .signal:first-child { grid-column: 1 / -1; }
  .stats .stat:first-child { grid-column: 1 / -1; }
}
