.value-page {
  --wv-blue: #2563eb;
  --wv-blue-soft: #eef4ff;
  --wv-cyan: #0891b2;
  --wv-green: #15803d;
  --wv-amber: #b45309;
  --wv-rose: #be123c;
  --wv-violet: #7c3aed;
  --wv-text: #111827;
  --wv-muted: #64748b;
  --wv-dim: #94a3b8;
  --wv-border: #dce3ec;
  --wv-surface: #ffffff;
  --wv-subtle: #f7f9fc;
  --wv-panel: #f2f6fc;
  color: var(--wv-text);
  font-family: 'Geist', Arial, sans-serif;
  padding-bottom: 52px;
}

.value-wrap { width: min(100%, 1600px); margin: 0 auto; }
.value-page *, .value-page *::before, .value-page *::after { box-sizing: border-box; }
.value-page button, .value-page input, .value-page select, .value-page textarea { font: inherit; letter-spacing: 0; }
.value-page button, .value-page summary { -webkit-tap-highlight-color: transparent; }

.value-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.value-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--wv-blue);
  font: 600 11px/1.3 'Geist Mono', monospace;
  letter-spacing: 1.6px;
}
.value-tag span { width: 6px; height: 6px; transform: rotate(45deg); background: var(--wv-blue); }
.value-header h1 { margin: 0; color: var(--wv-text); font-size: 26px; line-height: 1.08; font-weight: 720; letter-spacing: 0; }
.value-header h1 span { color: var(--wv-blue); }
.value-header p { margin: 9px 0 0; color: var(--wv-muted); font-size: 14px; line-height: 1.55; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.icon-button, .secondary-button, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 41px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.icon-button { width: 42px; padding: 0; border: 1px solid var(--wv-border); color: var(--wv-muted); background: var(--wv-surface); }
.icon-button svg, .secondary-button svg, .primary-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.secondary-button { padding: 0 15px; border: 1px solid var(--wv-border); color: var(--wv-muted); background: var(--wv-surface); font-size: 13px; font-weight: 550; text-decoration: none; }
.primary-button { padding: 0 18px; border: 1px solid var(--wv-blue); color: #fff; background: var(--wv-blue); box-shadow: 0 4px 10px rgba(37, 99, 235, .16); font-size: 13px; font-weight: 650; }
.icon-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) { border-color: #b8c5d8; color: var(--wv-text); background: #f9fbfd; }
.primary-button:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; transform: translateY(-1px); }
.icon-button:focus-visible, .secondary-button:focus-visible, .primary-button:focus-visible, .value-page input:focus-visible, .value-page select:focus-visible, .value-page textarea:focus-visible, .value-page summary:focus-visible { outline: 3px solid rgba(37, 99, 235, .18); outline-offset: 1px; }
.icon-button:disabled, .secondary-button:disabled, .primary-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; transform: none; }
.secondary-button.compact { min-height: 36px; padding: 0 12px; }
.icon-button.bordered { width: 39px; min-height: 39px; }

.tool-panel {
  border: 1px solid var(--wv-border);
  border-radius: 8px;
  background: var(--wv-surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
}
.fetch-panel { padding: 24px 28px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2, .analysis-head h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.3; font-weight: 680; letter-spacing: 0; }
.panel-kicker { display: flex; align-items: center; gap: 7px; color: var(--wv-muted); font: 650 10px/1.3 'Geist Mono', monospace; letter-spacing: 1px; }
.panel-kicker svg { width: 15px; height: 15px; fill: none; stroke: var(--wv-blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.source-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.source-badges span { padding: 5px 8px; border: 1px solid #c7d7fb; border-radius: 5px; color: #1d4ed8; background: #f4f7ff; font: 650 10px/1 'Geist Mono', monospace; }
.source-badges .ai-source-badge { border-color: #d9cdfa; color: #6d28d9; background: #f7f4ff; }

.connection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: var(--wv-muted); }
.field > span { font: 550 11px/1.3 'Geist Mono', monospace; letter-spacing: .45px; text-transform: uppercase; }
.field small { color: var(--wv-dim); font-size: 11px; line-height: 1.45; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--wv-border);
  border-radius: 7px;
  color: var(--wv-text);
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.field input, .field select { height: 42px; padding: 0 12px; }
.field textarea { min-height: 72px; padding: 11px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #9ab5f4; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.field input:disabled, .field select:disabled { color: var(--wv-dim); background: #f2f4f7; cursor: not-allowed; }
.period-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(150px, .65fr) minmax(150px, .65fr) minmax(290px, 1.25fr); align-items: end; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #e7ebf2; }
.comparison-switch { display: flex; align-items: center; min-height: 42px; gap: 11px; padding: 8px 12px; border: 1px solid var(--wv-border); border-radius: 7px; background: #f8fafc; cursor: pointer; }
.comparison-switch > input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 36px; height: 20px; flex: 0 0 auto; border-radius: 20px; background: #cbd5e1; transition: background-color .16s ease; }
.switch-track span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .28); transition: transform .16s ease; }
.comparison-switch input:checked + .switch-track { background: var(--wv-blue); }
.comparison-switch input:checked + .switch-track span { transform: translateX(16px); }
.comparison-switch > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.comparison-switch strong { font-size: 12px; line-height: 1.25; }
.comparison-switch small { color: var(--wv-dim); font-size: 10px; line-height: 1.25; }
.comparison-fields { margin-top: 12px; padding: 15px; border: 1px solid #cbd9f5; border-radius: 7px; background: #f5f8ff; }
.comparison-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.comparison-heading strong { font-size: 12px; }
.comparison-presets { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid #d7e1f5; border-radius: 6px; background: #fff; }
.comparison-presets button { min-height: 29px; padding: 0 10px; border: 0; border-radius: 4px; color: var(--wv-muted); background: transparent; font-size: 11px; cursor: pointer; }
.comparison-presets button[aria-pressed="true"] { color: #1d4ed8; background: #eaf1ff; font-weight: 620; }
.date-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; }

.advanced-settings { margin-top: 14px; border: 1px solid var(--wv-border); border-radius: 7px; background: var(--wv-subtle); }
.advanced-settings summary { display: flex; align-items: center; justify-content: space-between; min-height: 45px; padding: 0 14px; color: var(--wv-muted); cursor: pointer; list-style: none; font: 600 11px/1.3 'Geist Mono', monospace; letter-spacing: .55px; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary span { display: flex; align-items: center; gap: 8px; }
.advanced-settings summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.advanced-settings summary .chevron { transition: transform .16s ease; }
.advanced-settings[open] summary .chevron { transform: rotate(180deg); }
.advanced-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 16px; border-top: 1px solid var(--wv-border); }
.ai-sources-field { grid-column: span 4; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-radius: 7px 0 0 7px; }
.input-suffix span { display: grid; min-width: 52px; place-items: center; border: 1px solid var(--wv-border); border-left: 0; border-radius: 0 7px 7px 0; color: var(--wv-muted); background: #f1f5f9; font: 600 10px/1 'Geist Mono', monospace; }
.fetch-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.fetch-status { min-width: 220px; color: var(--wv-muted); font-size: 12px; line-height: 1.45; }
.fetch-status[data-state="error"] { color: #b91c1c; }
.fetch-status[data-state="ok"] { color: var(--wv-green); }
.fetch-status[data-state="loading"] { color: var(--wv-blue); }
.measurement-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 17px; padding-top: 15px; border-top: 1px solid #e7ebf2; color: var(--wv-muted); font-size: 11.5px; line-height: 1.55; }
.measurement-note svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--wv-violet); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.measurement-note strong { color: #6d28d9; }

.empty-state { display: grid; justify-items: center; margin-top: 18px; padding: 62px 24px; border: 1px dashed #ccd6e4; border-radius: 8px; background: #fbfcfe; text-align: center; }
.empty-state[hidden], .report[hidden], .comparison-fields[hidden], .chart-tooltip[hidden], .ai-overlay[hidden] { display: none !important; }
.empty-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 14px; border: 1px solid #cddaf6; border-radius: 8px; color: var(--wv-blue); background: var(--wv-blue-soft); }
.empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
.empty-state p { max-width: 560px; margin: 8px 0 0; color: var(--wv-muted); font-size: 13px; line-height: 1.55; }

.report { display: grid; gap: 18px; margin-top: 18px; }
.overview-section, .insight-section { display: grid; gap: 10px; }
.section-titlebar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-titlebar h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.3; font-weight: 680; letter-spacing: 0; }
.heading-with-info { position: relative; display: flex; min-width: 0; align-items: center; gap: 10px; }
.info-details { position: relative; z-index: 24; flex: 0 0 auto; }
.info-details summary { display: grid; width: 27px; height: 27px; padding: 0; place-items: center; border: 1px solid #cbd5e1; border-radius: 50%; color: #475569; background: #fff; font: 700 12px/1 Georgia, serif; cursor: pointer; list-style: none; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.info-details summary::-webkit-details-marker { display: none; }
.info-details summary:hover, .info-details[open] summary { border-color: var(--wv-blue); color: var(--wv-blue); background: var(--wv-blue-soft); }
.info-card { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(430px, calc(100vw - 36px)); padding: 15px 16px; border: 1px solid #cbd8ed; border-radius: 8px; color: #475569; background: #fff; box-shadow: 0 18px 38px rgba(15, 23, 42, .16); font-size: 12px; line-height: 1.58; text-align: left; }
.info-card.align-left { right: auto; left: 0; }
.info-card strong { display: block; margin-bottom: 7px; color: var(--wv-text); font-size: 13px; }.info-card p { margin: 7px 0 0; }
.report-context { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr auto; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--wv-border); border-radius: 8px; background: #fff; }
.report-context > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.report-context span { color: var(--wv-dim); font: 550 9px/1.2 'Geist Mono', monospace; letter-spacing: .65px; text-transform: uppercase; }
.report-context strong { overflow: hidden; color: var(--wv-text); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.report-context .report-badge { justify-self: end; padding: 6px 9px; border: 1px solid #d7dfeb; border-radius: 5px; color: var(--wv-muted); background: #f5f7fa; }
.report-context .report-badge.active { border-color: #bfd1f7; color: #1d4ed8; background: #eef4ff; }
.kpi-section { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.overview-section .section-titlebar { padding: 0 2px; }
.kpi-card { display: flex; min-width: 0; align-items: center; gap: 11px; min-height: 105px; padding: 16px; border: 1px solid var(--wv-border); border-radius: 8px; background: #fff; }
.kpi-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 7px; }
.kpi-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi-icon.blue { color: #2563eb; background: #eef4ff; }.kpi-icon.cyan { color: #0e7490; background: #ecfeff; }.kpi-icon.green { color: #15803d; background: #eefbf2; }.kpi-icon.amber { color: #b45309; background: #fff7ed; }.kpi-icon.rose { color: #be123c; background: #fff1f2; }.kpi-icon.violet { color: #7c3aed; background: #f5f3ff; }
.kpi-card > div:last-child { display: flex; min-width: 0; flex-direction: column; }
.kpi-card span { overflow: hidden; color: var(--wv-muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.kpi-card strong { margin-top: 5px; overflow: hidden; color: var(--wv-text); font-size: 19px; line-height: 1.1; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.kpi-card small { min-height: 14px; margin-top: 5px; color: var(--wv-dim); font: 550 10px/1.35 'Geist Mono', monospace; }
.kpi-card small.positive { color: var(--wv-green); }.kpi-card small.negative { color: #dc2626; }

.trend-panel { padding: 22px 24px 17px; }
.trend-heading { align-items: center; margin-bottom: 12px; }
.trend-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.metric-switch { display: flex; width: 100%; max-width: 100%; align-items: center; gap: 4px; overflow-x: auto; padding: 3px; border: 1px solid var(--wv-border); border-radius: 7px; background: var(--wv-subtle); scrollbar-width: thin; }
.metric-switch button { display: inline-flex; min-height: 32px; align-items: center; gap: 7px; padding: 0 10px; border: 0; border-radius: 5px; color: var(--wv-muted); background: transparent; font-size: 10.5px; white-space: nowrap; cursor: pointer; }
.metric-switch button i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; opacity: .5; }
.metric-switch button[aria-pressed="true"] { color: #1d4ed8; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); font-weight: 620; }
.metric-switch button[aria-pressed="true"] i { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor; }
.chart-scale-note { margin: 7px 2px 8px; color: var(--wv-dim); font: 500 10px/1.45 'Geist Mono', monospace; }
.chart-wrap { position: relative; min-height: 300px; overflow: hidden; border-top: 1px solid #edf0f5; border-bottom: 1px solid #edf0f5; }
.chart-wrap svg { display: block; width: 100%; height: 300px; overflow: visible; touch-action: none; }
.chart-grid { stroke: #e7ebf2; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-series-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-series-line.baseline { stroke-width: 1.6; stroke-dasharray: 6 5; opacity: .55; }
.chart-series-point { fill: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }.chart-series-point.baseline { opacity: .6; }
.chart-cursor { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-label { fill: #94a3b8; font: 10px 'Geist Mono', monospace; }
.chart-tooltip { position: absolute; z-index: 4; min-width: 220px; pointer-events: none; padding: 10px 11px; border: 1px solid #cfd8e6; border-radius: 6px; background: rgba(255, 255, 255, .98); box-shadow: 0 8px 20px rgba(15, 23, 42, .1); font-size: 11px; }
.chart-tooltip strong { display: block; margin-bottom: 7px; color: var(--wv-text); }.chart-tooltip strong small { color: var(--wv-dim); font-size: 9.5px; font-weight: 500; }.chart-tooltip span { color: var(--wv-muted); }
.chart-tooltip-row { display: grid; grid-template-columns: 8px minmax(90px, 1fr) auto auto; align-items: center; gap: 6px; margin-top: 5px; }
.chart-tooltip-row i { width: 7px; height: 7px; border-radius: 50%; }.chart-tooltip-row b { color: var(--wv-text); font-family: 'Geist Mono', monospace; }.chart-tooltip-row em { padding-left: 5px; border-left: 1px solid #e2e8f0; color: var(--wv-dim); font: normal 500 9.5px/1 'Geist Mono', monospace; }
.chart-foot { display: flex; justify-content: space-between; gap: 14px; padding-top: 11px; color: var(--wv-dim); font: 500 10px/1.4 'Geist Mono', monospace; }

.insight-section { position: relative; }
.insight-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px; }
.insight-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--wv-border); border-radius: 8px; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .035); }
.insight-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.insight-card-head span { color: var(--wv-muted); font: 650 9.5px/1.3 'Geist Mono', monospace; letter-spacing: .8px; }.insight-card-head h3 { margin: 4px 0 0; font-size: 15px; line-height: 1.3; }.insight-card-head small { max-width: 52%; color: var(--wv-dim); font: 500 9.5px/1.45 'Geist Mono', monospace; text-align: right; }
.seo-funnel { display: grid; gap: 13px; }
.funnel-row { display: grid; grid-template-columns: minmax(130px, .9fr) minmax(120px, 1.2fr) minmax(110px, .7fr); align-items: center; gap: 10px; }
.funnel-label { display: flex; min-width: 0; flex-direction: column; gap: 3px; }.funnel-label span { color: var(--wv-muted); font-size: 10.5px; }.funnel-label strong { color: var(--wv-text); font: 650 13px/1.2 'Geist Mono', monospace; }
.funnel-track { height: 10px; overflow: hidden; border-radius: 10px; background: #edf1f6; }.funnel-track i { display: block; height: 100%; border-radius: inherit; }.funnel-row small { color: var(--wv-dim); font-size: 9.5px; line-height: 1.35; }
.matrix-wrap { position: relative; min-height: 300px; overflow: hidden; border: 1px solid #edf0f5; border-radius: 6px; background: #fff; }.matrix-wrap svg { display: block; width: 100%; height: 300px; touch-action: none; }.matrix-wrap circle { cursor: crosshair; }.matrix-wrap circle:hover { fill-opacity: 1; stroke: #0f172a; }
.matrix-split { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.matrix-tooltip span, .matrix-tooltip div { display: block; margin-top: 4px; }.matrix-tooltip div { color: var(--wv-muted); }.matrix-tooltip b { color: var(--wv-text); font-family: 'Geist Mono', monospace; }
.matrix-legend { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-top: 10px; color: var(--wv-muted); font-size: 9.5px; }.matrix-legend span { display: inline-flex; align-items: center; gap: 5px; }.matrix-legend i { width: 7px; height: 7px; border-radius: 50%; }.matrix-legend .opportunity { background: #16a34a; }.matrix-legend .star { background: #2563eb; }.matrix-legend .leak { background: #ea580c; }.matrix-legend .low { background: #94a3b8; }

.analysis-panel { overflow: visible; border: 1px solid #cbd8ed; border-radius: 8px; background: #f2f6fc; box-shadow: 0 3px 10px rgba(15, 23, 42, .04); }
.analysis-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 16px; }
.analysis-tabs { display: flex; align-items: stretch; gap: 3px; overflow-x: auto; padding: 0 18px 12px; scrollbar-width: thin; }
.analysis-tabs button { display: flex; min-height: 39px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; color: var(--wv-muted); background: transparent; font-size: 11.5px; white-space: nowrap; cursor: pointer; }
.analysis-tabs button span { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 4px; color: var(--wv-dim); background: rgba(148, 163, 184, .13); font: 600 9px/1 'Geist Mono', monospace; }
.analysis-tabs button[aria-selected="true"] { border-color: #cbd7ea; color: #1d4ed8; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .05); font-weight: 620; }
.analysis-tabs button:disabled { opacity: .42; cursor: not-allowed; }
.analysis-notice { margin: 0 18px 12px; padding: 10px 12px; border: 1px solid #f2d59c; border-radius: 6px; color: #92400e; background: #fffaf0; font-size: 11.5px; }
.table-toolbar { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border-top: 1px solid #dce4ef; border-bottom: 1px solid #dce4ef; background: #fff; }
.search-box { position: relative; display: flex; min-width: 240px; max-width: 430px; flex: 1; align-items: center; }
.search-box svg { position: absolute; left: 11px; width: 16px; height: 16px; fill: none; stroke: var(--wv-dim); stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; height: 39px; padding: 0 12px 0 35px; border: 1px solid var(--wv-border); border-radius: 6px; color: var(--wv-text); background: #f8fafc; font-size: 12px; }
.column-picker { position: relative; }
.column-picker summary { display: flex; min-height: 39px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--wv-border); border-radius: 6px; color: var(--wv-muted); background: #fff; font-size: 11.5px; cursor: pointer; list-style: none; }
.column-picker summary::-webkit-details-marker { display: none; }
.column-picker summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.column-options { position: absolute; z-index: 15; top: calc(100% + 6px); right: 0; display: grid; min-width: 220px; max-height: 310px; gap: 2px; overflow: auto; padding: 8px; border: 1px solid var(--wv-border); border-radius: 7px; background: #fff; box-shadow: 0 12px 28px rgba(15, 23, 42, .14); }
.column-options label { display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 0 7px; border-radius: 4px; color: var(--wv-muted); font-size: 11.5px; cursor: pointer; }
.column-options label:hover { background: #f4f7fb; }.column-options input { accent-color: var(--wv-blue); }
.table-wrap { position: relative; overflow-x: auto; background: #fff; }
.data-table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: auto; }
.data-table th { padding: 11px 13px; border-bottom: 1px solid var(--wv-border); color: var(--wv-muted); background: #f8fafc; font: 650 9.5px/1.25 'Geist Mono', monospace; letter-spacing: .55px; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table th:has(.table-sort) { padding: 0; }
.table-sort { display: flex; width: 100%; min-height: 39px; align-items: center; justify-content: flex-start; gap: 7px; padding: 9px 13px; border: 0; color: inherit; background: transparent; font: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; cursor: pointer; }
.table-sort::after { content: '↕'; color: #b2bdca; font-size: 11px; }.table-sort:hover, .table-sort:focus-visible { color: #1d4ed8; background: #eef4ff; outline: none; }
.table-sort[data-sort-direction="asc"]::after { content: '↑'; color: #1d4ed8; }.table-sort[data-sort-direction="desc"]::after { content: '↓'; color: #1d4ed8; }
.data-table td { max-width: 360px; padding: 13px; border-bottom: 1px solid #edf0f4; color: #334155; font-size: 11.5px; line-height: 1.45; vertical-align: top; }
.data-table tbody tr:hover > td { background: #fbfcfe; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-primary { display: block; color: var(--wv-text); font-weight: 600; overflow-wrap: anywhere; }
.cell-primary a { color: #1d4ed8; text-decoration: none; }.cell-primary a:hover { text-decoration: underline; }
.cell-secondary { display: block; margin-top: 4px; color: var(--wv-dim); font-size: 10.5px; overflow-wrap: anywhere; }
.metric-value { color: var(--wv-text); font: 600 11px/1.4 'Geist Mono', monospace; white-space: nowrap; }
.delta { display: inline-flex; margin-top: 3px; font: 600 9.5px/1.3 'Geist Mono', monospace; }.delta.positive { color: var(--wv-green); }.delta.negative { color: #dc2626; }.delta.neutral { color: var(--wv-dim); }
.type-badge, .status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 7px; border: 1px solid #d9e2ef; border-radius: 5px; color: #475569; background: #f8fafc; font-size: 10px; font-weight: 620; }
.status-badge.ok { border-color: #bde5c9; color: #15803d; background: #f0fdf4; }.status-badge.warning { border-color: #f0d398; color: #a16207; background: #fffbeb; }.status-badge.info { border-color: #cbd9f7; color: #1d4ed8; background: #eff6ff; }
.query-list { display: grid; gap: 5px; margin-top: 8px; }.query-list span { display: flex; justify-content: space-between; gap: 10px; color: var(--wv-muted); font-size: 10px; }.query-list b { color: var(--wv-text); font-family: 'Geist Mono', monospace; }
.row-details { margin-top: 7px; }.row-details summary { display: inline-flex; align-items: center; gap: 5px; color: #2563eb; font-size: 10px; cursor: pointer; }.row-details-content { display: grid; min-width: 260px; gap: 7px; margin-top: 8px; padding: 9px; border: 1px solid #dce4ef; border-radius: 6px; background: #f8fafc; }
.table-empty { padding: 44px 20px; color: var(--wv-muted); text-align: center; font-size: 12px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid #dce4ef; color: var(--wv-muted); background: #fff; font: 500 10.5px/1.4 'Geist Mono', monospace; }
.pagination { display: flex; align-items: center; gap: 8px; }.pagination .icon-button { width: 32px; min-height: 32px; }.pagination .icon-button svg { width: 15px; height: 15px; }

.ai-overlay { position: fixed; z-index: 5000; inset: 0; display: grid; place-items: center; padding: 24px; }
.ai-overlay[hidden] { display: none; }
.ai-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15, 23, 42, .52); backdrop-filter: blur(2px); cursor: default; }
.ai-modal { position: relative; display: flex; width: min(980px, calc(100vw - 32px)); max-height: min(850px, calc(100vh - 32px)); flex-direction: column; overflow: hidden; border: 1px solid #d9e1ec; border-radius: 8px; background: #fff; box-shadow: 0 28px 70px rgba(15, 23, 42, .24); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--wv-border); background: #f8fafc; }
.ai-title-row { display: flex; min-width: 0; align-items: center; gap: 11px; }.ai-title-row h2 { margin: 0; font-size: 17px; letter-spacing: 0; }.ai-title-row p { margin: 4px 0 0; color: var(--wv-muted); font-size: 11.5px; line-height: 1.4; }
.ai-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: #6d28d9; background: #f2efff; }.ai-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ai-body { overflow-y: auto; padding: 20px; }.ai-section-label { margin-bottom: 8px; color: var(--wv-muted); font: 650 9.5px/1.3 'Geist Mono', monospace; letter-spacing: .8px; text-transform: uppercase; }
.ai-mode-switch { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }.ai-mode-switch button { min-height: 34px; padding: 0 11px; border: 1px solid var(--wv-border); border-radius: 6px; color: var(--wv-muted); background: #fff; font-size: 10.5px; white-space: nowrap; cursor: pointer; }.ai-mode-switch button[aria-pressed="true"] { border-color: #b8caf2; color: #1d4ed8; background: #f1f5ff; font-weight: 620; }.ai-mode-switch button:disabled { opacity: .4; cursor: not-allowed; }
.ai-note { margin-top: 9px; color: var(--wv-muted); font-size: 11px; line-height: 1.5; }.ai-instruction { margin-top: 16px; }.ai-actions { display: flex; align-items: center; gap: 9px; margin-top: 14px; }.ai-status { min-height: 18px; margin-top: 10px; color: var(--wv-muted); font-size: 11.5px; }.ai-status[data-state="error"] { color: #b91c1c; }.ai-status[data-state="ok"] { color: var(--wv-green); }
.ai-result { margin-top: 14px; border-top: 1px solid var(--wv-border); padding-top: 15px; }.ai-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.ai-result-head strong { font-size: 12px; }.ai-result-head span { color: var(--wv-dim); font: 500 9.5px/1.3 'Geist Mono', monospace; }.ai-result-text { margin-top: 13px; color: #1f2937; font-size: 12.5px; line-height: 1.65; }.ai-result-text h3 { margin: 17px 0 6px; color: var(--wv-text); font-size: 11px; letter-spacing: .45px; }.ai-result-text h3:first-child { margin-top: 0; }.ai-result-text p { margin: 7px 0; }.ai-result-text ul { margin: 6px 0 10px; padding-left: 19px; }.ai-result-text li { margin: 4px 0; }
.is-loading svg { animation: wv-spin .8s linear infinite; } @keyframes wv-spin { to { transform: rotate(360deg); } }

.ai-overlay {
  --wv-blue: #2563eb; --wv-blue-soft: #eef4ff; --wv-green: #15803d; --wv-text: #111827; --wv-muted: #64748b; --wv-dim: #94a3b8; --wv-border: #dce3ec; --wv-surface: #fff;
  color: var(--wv-text); font-family: 'Geist', Arial, sans-serif;
}
.ai-overlay *, .ai-overlay *::before, .ai-overlay *::after { box-sizing: border-box; }
.ai-overlay button, .ai-overlay textarea { font: inherit; letter-spacing: 0; }
.value-modal-open { overflow: hidden; }
.ai-backdrop { width: 100%; height: 100%; padding: 0; background: rgba(15, 23, 42, .42); backdrop-filter: none; }
.ai-modal { z-index: 1; width: min(860px, 100%); max-height: min(820px, calc(100vh - 48px)); border-color: #cbd5e1; border-radius: 8px; box-shadow: 0 24px 60px rgba(15, 23, 42, .24); }
.ai-head { padding: 20px 22px 16px; background: #fff; }
.ai-title-row h2 { font-size: 16px; font-weight: 700; }.ai-title-row p { margin-top: 3px; font-size: 12.5px; line-height: 1.45; }
.ai-icon { width: 36px; height: 36px; color: var(--wv-blue); background: var(--wv-blue-soft); border: 1px solid #c7d7fb; }
.ai-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.ai-body { padding: 20px 22px 22px; }
.ai-section-label { margin-bottom: 8px; font-size: 11px; letter-spacing: .6px; }
.ai-mode-switch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; overflow: visible; padding: 0; }
.ai-mode-switch button { min-height: 37px; padding: 7px 8px; overflow: hidden; border-radius: 6px; background: #f8fafc; font-size: 12px; font-weight: 500; text-overflow: ellipsis; }
.ai-mode-switch button:hover:not(:disabled), .ai-mode-switch button[aria-pressed="true"] { border-color: var(--wv-blue); color: var(--wv-blue); background: var(--wv-blue-soft); }
.ai-note { min-height: 38px; margin: 9px 0 16px; font-size: 12.5px; line-height: 1.5; }
.ai-instruction { margin-top: 0; }.ai-instruction textarea { min-height: 90px; }.ai-instruction small { font-size: 11.5px; line-height: 1.45; }
.ai-request-context { margin-top: 16px; padding: 10px 12px; border-left: 3px solid var(--wv-blue); color: var(--wv-muted); background: #f3f7ff; font-size: 12px; line-height: 1.55; }
.ai-actions { flex-wrap: wrap; margin-top: 16px; }
.ai-run-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 10px 19px; border: 0; border-radius: 8px; color: #fff; background: var(--wv-blue); box-shadow: 0 2px 7px rgba(37, 99, 235, .24); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, box-shadow .15s, transform .15s; }
.ai-run-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }.ai-run-button:hover:not(:disabled) { background: #1d4ed8; box-shadow: 0 5px 14px rgba(37, 99, 235, .27); transform: translateY(-1px); }.ai-run-button:disabled { background: #b9c5d6; box-shadow: none; cursor: not-allowed; transform: none; }
.ai-status { min-height: 20px; margin-top: 9px; font-size: 12px; line-height: 1.45; }.ai-status[data-state="loading"] { color: var(--wv-blue); }
.ai-result { margin-top: 18px; padding-top: 17px; }.ai-result-head strong { font-size: 13px; }.ai-result-head span { font-size: 10.5px; }
.ai-result-text { margin-top: 10px; font-size: 13px; line-height: 1.65; }

@media (max-width: 1350px) {
  .connection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-section { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .insight-grid { grid-template-columns: 1fr; }
  .period-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comparison-switch { grid-column: span 3; }
  .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.ai-sources-field { grid-column: span 2; }
  .report-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }.report-context .report-badge { justify-self: start; }
  .trend-heading { align-items: flex-start; flex-direction: column; }.metric-switch { width: 100%; }
}
@media (max-width: 760px) {
  .value-page { padding-inline: 0; }
  .section-titlebar { align-items: flex-start; }
  .info-card, .info-card.align-left { position: fixed; top: 80px; right: 16px; left: 16px; width: auto; max-height: calc(100vh - 100px); overflow: auto; }
  .value-header { flex-direction: column; }.header-actions { width: 100%; justify-content: flex-start; }
  .value-header h1 { font-size: 26px; }.value-header p { font-size: 13px; }
  .fetch-panel { padding: 19px 15px; }.panel-heading { align-items: flex-start; flex-direction: column; }
  .connection-grid, .period-row, .advanced-grid, .date-pair { grid-template-columns: 1fr; }
  .comparison-switch, .ai-sources-field { grid-column: auto; }
  .comparison-heading { align-items: flex-start; flex-direction: column; }.comparison-presets { width: 100%; overflow-x: auto; }
  .fetch-actions .primary-button { width: 100%; }.fetch-status { width: 100%; min-width: 0; }
  .report-context { grid-template-columns: 1fr; }.kpi-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }.kpi-card { min-height: 95px; padding: 13px; }
  .trend-panel { padding: 18px 14px 13px; }.trend-actions { width: 100%; justify-content: flex-start; }.trend-actions .secondary-button { flex: 1; }.chart-wrap, .chart-wrap svg { min-height: 250px; height: 250px; }.chart-foot { flex-direction: column; }
  .insight-card { padding: 17px 14px; }.insight-card-head { flex-direction: column; }.insight-card-head small { max-width: none; text-align: left; }.funnel-row { grid-template-columns: minmax(125px, 1fr) minmax(100px, 1fr); }.funnel-row small { grid-column: 1 / -1; }.matrix-wrap, .matrix-wrap svg { min-height: 260px; height: 260px; }
  .analysis-head { align-items: flex-start; padding: 17px 14px 13px; }.analysis-tabs { padding-inline: 10px; }.table-toolbar { flex-wrap: wrap; padding: 10px; }.search-box { min-width: 100%; max-width: none; }.column-picker { flex: 1; }.column-picker summary { justify-content: center; }.column-options { left: 0; right: auto; }
  .ai-overlay { padding: 8px; }.ai-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }.ai-head, .ai-body { padding: 15px; }.ai-title-row p { display: none; }
  .ai-mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .funnel-row { grid-template-columns: 1fr; }.funnel-row small { grid-column: auto; }
  .header-actions .secondary-button { flex: 1; }.kpi-section { grid-template-columns: 1fr; }.kpi-card { min-height: 82px; }
  .source-badges { display: none; }.analysis-head { flex-direction: column; }.analysis-head .secondary-button { width: 100%; }
}

.help-wrap { max-width: 1180px; }
.help-section { padding: 24px 26px; }
.help-section h2 { margin: 7px 0 11px; font-size: 17px; letter-spacing: 0; }
.help-section p, .help-section li, .help-section dd { color: var(--wv-muted); font-size: 13px; line-height: 1.65; }
.help-section ol { display: grid; gap: 8px; margin: 0; padding-left: 21px; }
.help-section strong { color: var(--wv-text); }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.help-grid .help-section { min-height: 185px; }
.help-definitions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.help-definitions div { padding: 13px 0; border-bottom: 1px solid #e8edf3; }
.help-definitions dt { margin-bottom: 4px; color: var(--wv-text); font-size: 13px; font-weight: 650; }
.help-definitions dd { margin: 0; }
@media (max-width: 760px) {
  .help-grid, .help-definitions { grid-template-columns: 1fr; }
  .help-section { padding: 20px 17px; }
  .help-grid .help-section { min-height: 0; }
}
/* Rozszerzenia raportu: wykluczenia, podsumowania źródeł i zakresy wykresu */
.excluded-urls-field { grid-column: span 3; }
.exclude-presets { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #dbe3ef; border-radius: 10px; background: #f8fafc; cursor: pointer; }
.exclude-presets input { margin-top: 3px; accent-color: #2563eb; }
.exclude-presets span { display: grid; gap: 3px; }
.exclude-presets strong { color: #26354d; font-size: 13px; }
.exclude-presets small { color: #64748b; font-size: 11px; line-height: 1.4; }
.source-summary-wrap { width: 100%; contain: inline-size; overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.source-summary-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.source-summary-table th, .source-summary-table td { padding: 12px 14px; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: top; }
.source-summary-table thead th { background: #f8fafc; color: #64748b; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.source-summary-table tbody th { color: #26354d; font-size: 13px; white-space: nowrap; }
.source-summary-table tbody tr:last-child th, .source-summary-table tbody tr:last-child td { border-bottom: 0; }
.source-summary-table td strong, .source-summary-table td span, .source-summary-table td small { display: block; }
.source-summary-table td strong { color: #17233a; font-size: 14px; }
.source-summary-table td span { margin-top: 2px; color: #64748b; font-size: 11px; }
.source-summary-table td small { margin-top: 4px; font-size: 10px; }
.summary-empty { color: #94a3b8 !important; font-size: 14px !important; }
.chart-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.chart-control-group { display: grid; gap: 6px; }
.chart-control-group > strong { color: #64748b; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.segmented-control { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid #dbe3ef; border-radius: 9px; background: #fff; }
.segmented-control button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; color: #56657b; background: transparent; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.segmented-control button:hover { color: #1d4ed8; background: #eff6ff; }
.segmented-control button[aria-pressed="true"] { color: #fff; background: #2563eb; box-shadow: 0 1px 3px rgba(37,99,235,.25); }
.chart-selection-info { margin: 0; padding: 8px 12px; border-left: 3px solid #2563eb; color: #526177; background: #f8fafc; font-size: 12px; line-height: 1.45; }
.chart-selection { pointer-events: none; stroke-width: 1; stroke-dasharray: 4 3; }
@media (max-width: 900px) { .excluded-urls-field { grid-column: span 2; }.chart-controls { align-items: stretch; }.chart-control-group { width: 100%; }.segmented-control { width: 100%; }.segmented-control button { flex: 1; } }
@media (max-width: 620px) { .excluded-urls-field { grid-column: span 1; } }
.report, .report > *, .overview-section, .trend-panel, .insight-section, .analysis-panel, .source-summary-wrap, .table-wrap { min-width: 0; max-width: 100%; }
.report > *, .overview-section, .trend-panel, .insight-section, .analysis-panel { width: 100%; }
.report, .overview-section { grid-template-columns: minmax(0, 1fr); }
