.potential-page,
.ai-modal {
  --ps-blue: #2563eb;
  --ps-blue-soft: #eff6ff;
  --ps-green: #15803d;
  --ps-green-soft: #f0fdf4;
  --ps-red: #b91c1c;
  --ps-red-soft: #fef2f2;
  --ps-amber: #b45309;
  --ps-amber-soft: #fffbeb;
  --ps-cyan: #0e7490;
  --ps-ink: #142033;
  --ps-muted: #64748b;
  --ps-line: #dbe3ee;
  --ps-surface: #ffffff;
  color: var(--ps-ink);
}

.potential-page .generator-wrap { width: 100%; max-width: none; }
.potential-page .gen-header { margin-bottom: 28px; }
.potential-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.potential-page .gen-tag { margin-bottom: 8px; color: var(--ps-blue); font-family: 'Geist Mono', monospace; font-size: 10px; text-transform: uppercase; }
.potential-page .gen-title { margin: 0 0 6px; color: var(--ps-ink); font-family: 'Geist', sans-serif; font-size: 26px; font-weight: 700; line-height: 1.2; }
.potential-page .gen-title span { color: var(--ps-blue); }
.potential-page .gen-desc { max-width: 820px; margin: 0; color: var(--ps-muted); font-size: 13px; line-height: 1.6; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.potential-page button,
.potential-page input,
.potential-page select,
.potential-page textarea,
.ai-modal button,
.ai-modal input,
.ai-modal select,
.ai-modal textarea { font: inherit; }
.potential-page svg,
.ai-modal svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.potential-page .btn-sec,
.ai-modal .btn-sec { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 14px; border: 1px solid var(--ps-line); border-radius: 8px; background: #f8fafc; color: var(--ps-muted); font-size: 13px; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.potential-page .btn-sec:hover:not(:disabled),
.ai-modal .btn-sec:hover:not(:disabled) { border-color: var(--ps-blue); background: #fff; color: var(--ps-blue); }
.potential-page .btn-sec:disabled,
.ai-modal .btn-sec:disabled { opacity: .45; cursor: not-allowed; }
.potential-page .btn-icon,
.ai-modal .btn-icon { display: inline-grid; width: 40px; height: 40px; flex: 0 0 40px; padding: 0; place-items: center; border: 1px solid var(--ps-line); border-radius: 8px; background: #f8fafc; color: var(--ps-muted); cursor: pointer; }
.potential-page .btn-icon:hover:not(:disabled),
.ai-modal .btn-icon:hover:not(:disabled) { border-color: var(--ps-blue); background: #fff; color: var(--ps-blue); }
.potential-page .btn-icon:disabled { opacity: .4; cursor: not-allowed; }
.potential-page .btn-run,
.ai-modal .btn-run { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 19px; border: 0; border-radius: 8px; background: var(--ps-blue); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 7px rgba(37, 99, 235, .24); transition: background .15s, box-shadow .15s, transform .15s; }
.potential-page .btn-run:hover:not(:disabled),
.ai-modal .btn-run:hover:not(:disabled) { background: #1d4ed8; box-shadow: 0 5px 14px rgba(37, 99, 235, .27); transform: translateY(-1px); }
.potential-page .btn-run:disabled,
.ai-modal .btn-run:disabled { background: #b9c5d6; box-shadow: none; cursor: not-allowed; transform: none; }

.section-card { margin-bottom: 16px; padding: 22px 26px; border: 1px solid var(--ps-line); border-radius: 8px; background: var(--ps-surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-label { display: flex; align-items: center; gap: 8px; color: var(--ps-muted); font-family: 'Geist', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.section-label svg { width: 15px; height: 15px; color: var(--ps-blue); }
.section-subtitle { margin: 7px 0 0; color: var(--ps-muted); font-size: 12.5px; line-height: 1.55; }
.data-note { padding: 6px 9px; border: 1px solid #bfdbfe; border-radius: 6px; background: var(--ps-blue-soft); color: #1d4ed8; font-family: 'Geist Mono', monospace; font-size: 10px; white-space: nowrap; }

.fetch-grid { display: grid; gap: 12px; margin-top: 18px; }
.account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span,
.compact-field > span { color: var(--ps-muted); font-family: 'Geist Mono', monospace; font-size: 10.5px; }
.field > span em { color: #8a98ac; font-size: 10px; font-style: normal; text-transform: none; }
.field input,
.field select,
.field textarea,
.search-field input,
.compact-field select { width: 100%; border: 1px solid #d5deea; border-radius: 7px; background: #f8fafc; color: var(--ps-ink); outline: 0; transition: border-color .15s, box-shadow .15s, background .15s; }
.field input,
.field select { min-height: 41px; padding: 8px 12px; font-size: 13px; }
.field textarea { min-height: 86px; padding: 10px 12px; resize: vertical; font-size: 13px; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.compact-field select:focus { border-color: #7aa2ec; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.field input:disabled,
.field select:disabled { color: #94a3b8; background: #eef2f7; cursor: not-allowed; }

.period-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.period-group { padding: 16px; border: 1px solid #d7e1ef; border-radius: 8px; background: #fbfdff; }
.comparison-group { border-color: #cad8ef; background: #f7faff; }
.period-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.period-title strong { font-size: 12.5px; }
.period-title span { color: var(--ps-muted); font-size: 10.5px; text-align: right; }
.period-fields { display: grid; grid-template-columns: 1.25fr repeat(2, minmax(0, 1fr)); gap: 10px; }

.advanced-filters { margin-top: 16px; border-top: 1px solid var(--ps-line); }
.advanced-filters > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0 0; color: var(--ps-ink); cursor: pointer; list-style: none; }
.advanced-filters > summary::-webkit-details-marker { display: none; }
.advanced-filters > summary > span { display: grid; gap: 3px; }
.advanced-filters > summary strong { font-size: 12px; }
.advanced-filters > summary small { color: var(--ps-muted); font-size: 10.5px; font-weight: 400; }
.advanced-filters > summary svg { color: var(--ps-muted); transition: transform .18s; }
.advanced-filters[open] > summary svg { transform: rotate(180deg); }
.advanced-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 15px; }
.advanced-filters > p { margin: 9px 0 0; color: var(--ps-muted); font-size: 10.5px; line-height: 1.5; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 13px; color: var(--ps-ink); font-size: 11.5px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row > span { position: relative; width: 34px; height: 19px; flex: 0 0 34px; border-radius: 10px; background: #cbd5e1; transition: background .16s; }
.switch-row > span::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; content: ''; box-shadow: 0 1px 3px rgba(15, 23, 42, .2); transition: transform .16s; }
.switch-row input:checked + span { background: var(--ps-blue); }
.switch-row input:checked + span::after { transform: translateX(15px); }
.switch-row input:focus-visible + span { outline: 2px solid var(--ps-blue); outline-offset: 2px; }

.fetch-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fetch-status { min-width: 240px; flex: 1; color: var(--ps-muted); font-size: 12px; line-height: 1.45; }
.progress-wrap { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 10px; margin-top: 14px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 4px; background: #e7edf5; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--ps-blue); transition: width .25s ease; }
.progress-wrap > span { color: var(--ps-blue); font-family: 'Geist Mono', monospace; font-size: 10.5px; font-weight: 700; text-align: right; }

.app-alert { margin: 0 0 16px; padding: 12px 15px; border: 1px solid #bfdbfe; border-radius: 7px; background: var(--ps-blue-soft); color: #1e40af; font-size: 12.5px; }
.app-alert[data-state="error"] { border-color: #fecaca; background: var(--ps-red-soft); color: #991b1b; }
.app-alert[data-state="warn"] { border-color: #fde68a; background: var(--ps-amber-soft); color: #92400e; }
.app-alert[data-state="ok"] { border-color: #bbf7d0; background: var(--ps-green-soft); color: #166534; }

.empty-state { display: grid; justify-items: center; padding: 54px 24px; text-align: center; }
.empty-icon { display: grid; width: 48px; height: 48px; margin-bottom: 14px; place-items: center; border: 1px solid #cbd8ee; border-radius: 8px; background: #f7faff; color: var(--ps-blue); }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h2 { margin: 0 0 7px; font-family: 'Geist', sans-serif; font-size: 16px; }
.empty-state p { max-width: 620px; margin: 0; color: var(--ps-muted); font-size: 12.5px; line-height: 1.6; }

.report { margin-top: 2px; }
.report-context { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); overflow: hidden; margin-bottom: 14px; border: 1px solid var(--ps-line); border-radius: 8px; background: #fff; }
.report-context > div { min-width: 0; padding: 13px 15px; }
.report-context > div + div { border-left: 1px solid var(--ps-line); }
.report-context span { display: block; margin-bottom: 4px; color: var(--ps-muted); font-family: 'Geist Mono', monospace; font-size: 9.5px; text-transform: uppercase; }
.report-context strong { display: block; overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric-box { min-width: 0; padding: 14px; border: 1px solid var(--ps-line); border-top: 3px solid #94a3b8; border-radius: 8px; background: #fff; }
.metric-box.accent { border-top-color: var(--ps-blue); }
.metric-box.negative { border-top-color: var(--ps-red); }
.metric-box.warning { border-top-color: var(--ps-amber); }
.metric-box.positive { border-top-color: var(--ps-green); }
.metric-box > span { display: block; color: var(--ps-muted); font-size: 10.5px; }
.metric-box > strong { display: block; margin: 5px 0 3px; font-family: 'Geist', sans-serif; font-size: 23px; line-height: 1; }
.metric-box > small { display: block; min-height: 30px; color: #7b899d; font-size: 9.5px; line-height: 1.45; }

.analysis-surface { overflow: visible; border: 1px solid var(--ps-line); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.analysis-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 8px; border-bottom: 1px solid var(--ps-line); background: #f8fafc; }
.analysis-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 38px; padding: 7px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ps-muted); font-size: 11.5px; cursor: pointer; }
.analysis-tabs button:hover { color: var(--ps-blue); }
.analysis-tabs button[aria-selected="true"] { border-color: #cbdaf4; background: #fff; color: var(--ps-blue); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.analysis-tabs button span { display: inline-grid; min-width: 21px; height: 20px; padding: 0 5px; place-items: center; border-radius: 5px; background: #e8edf4; color: #526176; font-family: 'Geist Mono', monospace; font-size: 9.5px; }
.analysis-tabs button[aria-selected="true"] span { background: var(--ps-blue-soft); color: var(--ps-blue); }

.analysis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; }
.eyebrow { color: var(--ps-blue); font-family: 'Geist Mono', monospace; font-size: 9.5px; }
.analysis-head h2 { margin: 5px 0 5px; font-family: 'Geist', sans-serif; font-size: 17px; }
.analysis-head p { max-width: 760px; margin: 0; color: var(--ps-muted); font-size: 12px; line-height: 1.55; }
.ai-button { flex: 0 0 auto; }

.tab-extra { margin: 0 22px 15px; padding: 14px 0 0; border-top: 1px solid var(--ps-line); }
.tab-extra-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tab-extra-head strong { font-size: 12px; }
.tab-extra-head span { color: var(--ps-muted); font-size: 10.5px; }
.section-loss-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.section-loss-item { min-width: 0; padding: 11px 12px; border-left: 3px solid var(--ps-red); background: #fafbfc; }
.section-loss-item strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.section-loss-item span { display: block; margin-top: 4px; color: var(--ps-red); font-family: 'Geist Mono', monospace; font-size: 9.5px; }

.table-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; padding: 13px 22px; border-top: 1px solid var(--ps-line); border-bottom: 1px solid var(--ps-line); background: #fbfcfe; }
.search-field { position: relative; min-width: 250px; flex: 1; }
.search-field svg { position: absolute; top: 11px; left: 11px; width: 16px; height: 16px; color: #8290a4; pointer-events: none; }
.search-field input { height: 39px; padding: 8px 12px 8px 36px; font-size: 12px; }
.compact-field { display: grid; gap: 4px; }
.compact-field select { height: 39px; min-width: 112px; padding: 7px 10px; font-size: 11.5px; }
.column-picker { position: relative; }
.column-picker > summary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 12px; border: 1px solid var(--ps-line); border-radius: 8px; background: #f8fafc; color: var(--ps-muted); font-size: 12px; cursor: pointer; list-style: none; }
.column-picker > summary::-webkit-details-marker { display: none; }
.column-picker > summary svg { width: 15px; height: 15px; }
.column-picker[open] > summary { border-color: var(--ps-blue); color: var(--ps-blue); }
.column-picker > div { position: absolute; z-index: 12; top: calc(100% + 6px); right: 0; display: grid; min-width: 235px; max-height: 310px; overflow: auto; padding: 8px; border: 1px solid var(--ps-line); border-radius: 8px; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .14); }
.column-picker label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; color: var(--ps-ink); font-size: 11.5px; cursor: pointer; }
.column-picker input { width: 15px; height: 15px; accent-color: var(--ps-blue); }
.table-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 22px; color: var(--ps-muted); font-size: 10.5px; }
.table-scroll { overflow: auto; border-top: 1px solid #edf1f6; border-bottom: 1px solid var(--ps-line); }
.table-scroll table { width: 100%; min-width: 980px; border-collapse: collapse; }
.table-scroll th { position: sticky; top: 0; z-index: 2; padding: 0; border-bottom: 1px solid var(--ps-line); background: #f5f7fa; text-align: left; }
.table-scroll th button { display: flex; align-items: center; gap: 5px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: #59687d; font-family: 'Geist Mono', monospace; font-size: 9.5px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
.table-scroll th button:hover { color: var(--ps-blue); }
.table-scroll th button[data-active="true"] { color: var(--ps-blue); }
.table-scroll td { max-width: 360px; padding: 11px 12px; border-bottom: 1px solid #edf1f6; color: #334155; font-size: 11.5px; line-height: 1.45; vertical-align: top; }
.table-scroll tbody tr:hover { background: #fbfdff; }
.table-scroll tbody tr:last-child td { border-bottom: 0; }
.table-scroll td.numeric { font-family: 'Geist Mono', monospace; font-size: 10.5px; white-space: nowrap; }
.cell-primary { display: block; color: var(--ps-ink); font-weight: 600; overflow-wrap: anywhere; }
.cell-secondary { display: block; margin-top: 3px; color: var(--ps-muted); font-size: 10px; overflow-wrap: anywhere; }
.cell-url { color: #315d9b; text-decoration: none; }
.cell-url:hover { text-decoration: underline; }
.cell-positive { color: var(--ps-green); }
.cell-negative { color: var(--ps-red); }
.cell-neutral { color: var(--ps-muted); }
.priority-pill,
.type-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border-radius: 5px; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.priority-pill.high { background: var(--ps-red-soft); color: var(--ps-red); }
.priority-pill.medium { background: var(--ps-amber-soft); color: var(--ps-amber); }
.priority-pill.low { background: #f1f5f9; color: #59687d; }
.type-pill { background: var(--ps-blue-soft); color: var(--ps-blue); font-weight: 600; }
.empty-row { padding: 32px 20px !important; color: var(--ps-muted) !important; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 22px; }
.pagination .btn-icon { width: 34px; height: 34px; flex-basis: 34px; }
.pagination span { min-width: 100px; color: var(--ps-muted); font-size: 10.5px; text-align: center; }

.ai-modal { position: fixed; z-index: 1500; inset: 0; display: grid; padding: 24px; place-items: center; }
.ai-modal[hidden] { display: none; }
.ai-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15, 23, 42, .48); cursor: default; }
.ai-card { position: relative; z-index: 1; width: min(940px, 100%); max-height: min(820px, calc(100vh - 48px)); overflow: hidden; border: 1px solid var(--ps-line); border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .24); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 22px 16px; border-bottom: 1px solid var(--ps-line); }
.ai-title-row { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ai-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid #bfdbfe; border-radius: 8px; background: var(--ps-blue-soft); color: var(--ps-blue); }
.ai-icon svg { width: 19px; height: 19px; }
.ai-head h2 { margin: 0; font-family: 'Geist', sans-serif; font-size: 16px; }
.ai-head p { margin: 3px 0 0; color: var(--ps-muted); font-size: 12px; line-height: 1.45; }
.ai-body { max-height: calc(100vh - 145px); overflow: auto; padding: 19px 22px 22px; }
.ai-section-label { margin-bottom: 8px; color: var(--ps-muted); font-family: 'Geist Mono', monospace; font-size: 10.5px; font-weight: 600; }
.ai-mode-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.ai-mode-switch button { min-height: 37px; padding: 7px 8px; overflow: hidden; border: 1px solid var(--ps-line); border-radius: 7px; background: #f8fafc; color: var(--ps-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ai-mode-switch button:hover,
.ai-mode-switch button[aria-pressed="true"] { border-color: var(--ps-blue); background: var(--ps-blue-soft); color: var(--ps-blue); }
.ai-note { min-height: 37px; margin: 9px 0 15px; padding: 9px 11px; border-left: 3px solid #93b4ee; background: #f8fafc; color: var(--ps-muted); font-size: 12px; line-height: 1.5; }
.ai-instruction small { color: var(--ps-muted); font-size: 10.5px; line-height: 1.45; }
.ai-actions { display: flex; gap: 9px; margin-top: 12px; }
.ai-status { min-height: 18px; margin-top: 9px; color: var(--ps-muted); font-size: 11.5px; }
.ai-status[data-state="error"] { color: var(--ps-red); }
.ai-status[data-state="ok"] { color: var(--ps-green); }
.ai-result { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ps-line); }
.ai-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-result-head strong { font-size: 12.5px; }
.ai-result-head span { color: var(--ps-muted); font-family: 'Geist Mono', monospace; font-size: 9.5px; }
.ai-result-text { margin-top: 10px; color: #27364c; font-size: 12.5px; line-height: 1.65; }
.ai-result-text h3 { margin: 15px 0 5px; color: var(--ps-ink); font-size: 12.5px; }
.ai-result-text h3:first-child { margin-top: 0; }
.ai-result-text p { margin: 5px 0; }
.ai-result-text ul { margin: 5px 0; padding-left: 18px; }
.ai-result-text li { margin: 4px 0; }

@media (max-width: 1260px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analysis-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .period-layout { grid-template-columns: 1fr; }
  .report-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-context > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--ps-line); }
  .report-context > div:nth-child(4) { border-top: 1px solid var(--ps-line); }
  .section-loss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .potential-header,
  .section-heading,
  .analysis-head { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .account-grid { grid-template-columns: 1fr; }
  .period-fields { grid-template-columns: 1fr; }
  .period-title { align-items: flex-start; flex-direction: column; }
  .period-title span { text-align: left; }
  .data-note { white-space: normal; }
  .analysis-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-meta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .section-card { padding: 19px 16px; }
  .header-actions .btn-sec { flex: 1; }
  .advanced-grid,
  .metric-grid,
  .section-loss-grid,
  .report-context { grid-template-columns: 1fr; }
  .report-context > div + div { border-top: 1px solid var(--ps-line); border-left: 0; }
  .analysis-tabs { grid-template-columns: 1fr; }
  .analysis-head,
  .table-toolbar,
  .table-meta,
  .pagination { padding-right: 16px; padding-left: 16px; }
  .search-field { min-width: 100%; }
  .compact-field { flex: 1; }
  .compact-field select { width: 100%; }
  .column-picker > div { right: auto; left: 0; }
  .ai-modal { padding: 8px; }
  .ai-card { max-height: calc(100vh - 16px); }
  .ai-head { padding: 16px; }
  .ai-body { padding: 16px; }
}

.potential-page [hidden] { display: none !important; }
.comparison-toggle { margin-top: 0; }
.comparison-controls { margin-top: 13px; }
.comparison-requirement { margin: 13px 0 0; padding-top: 11px; border-top: 1px solid #d7e1ef; color: var(--ps-muted); font-size: 10.5px; line-height: 1.5; }
.comparison-requirement strong { color: #526176; }
.switch-row.is-disabled { opacity: .58; cursor: not-allowed; }
.switch-row input:disabled + span { background: #dbe2ea; }

.metric-box.is-unavailable { border-color: #e2e8f0; background: #f5f7fa; color: #94a3b8; box-shadow: none; }
.metric-box.is-unavailable > span,
.metric-box.is-unavailable > small { color: #94a3b8; }
.analysis-tabs button:disabled { border-color: transparent; background: transparent; color: #a8b2c1; cursor: not-allowed; opacity: .72; }
.analysis-tabs button:disabled:hover { color: #a8b2c1; }
.analysis-tabs button:disabled span { background: #edf1f5; color: #9aa6b5; }
.ai-mode-switch button:disabled { border-color: #e2e8f0; background: #f1f4f7; color: #a1acba; cursor: not-allowed; opacity: .68; }
.ai-mode-switch button:disabled:hover { border-color: #e2e8f0; background: #f1f4f7; color: #a1acba; }
/* Czytelność raportu zgodna z typografią Widoczność GSC. */
.potential-page,
.ai-modal { font-family: 'Geist', sans-serif; }
.report-context strong { font-size: 12.5px; line-height: 1.45; }
.metric-box > span { font-size: 11.5px; font-weight: 500; }
.metric-box > strong { font-size: 22px; }
.metric-box > small { min-height: 32px; font-size: 10.5px; line-height: 1.5; }
.analysis-tabs button { font-size: 12px; }
.analysis-head h2 { font-size: 18px; }
.analysis-head p { font-size: 12.5px; line-height: 1.6; }
.table-meta { font-size: 11.5px; }
.table-scroll th button { padding: 11px 14px; font-size: 10.5px; letter-spacing: 0; }
.table-scroll td { padding: 12px 14px; font-size: 12.5px; line-height: 1.55; }
.table-scroll td.numeric { font-size: 11.5px; }
.cell-secondary { margin-top: 4px; font-size: 11px; line-height: 1.45; }
.priority-pill,
.type-pill { font-size: 10.5px; }

.cannibalization-details { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.cannibalization-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 7px 10px; border: 1px solid #cdd9e8; border-radius: 7px; background: #f8fafc; color: #315d9b; font-size: 11.5px; font-weight: 600; cursor: pointer; list-style: none; }
.cannibalization-details > summary::-webkit-details-marker { display: none; }
.cannibalization-details > summary::after { color: #64748b; font-size: 16px; line-height: 1; content: '+'; }
.cannibalization-details[open] { width: 100%; max-width: 100%; }
.cannibalization-details[open] > summary { border-color: #93b4ee; background: #eff6ff; color: #1d4ed8; }
.cannibalization-details[open] > summary::after { content: '−'; }
.cannibalization-details > summary strong { display: inline-grid; min-width: 22px; height: 20px; padding: 0 5px; place-items: center; border-radius: 5px; background: #e4ebf4; color: #526176; font-family: 'Geist Mono', monospace; font-size: 10px; }
.cannibalization-url-list { max-width: 100%; overflow: hidden; margin-top: 8px; border: 1px solid #dbe3ee; border-radius: 7px; background: #fff; }
.cannibalization-url-item { padding: 10px 12px; }
.cannibalization-url-item + .cannibalization-url-item { border-top: 1px solid #e7edf4; }
.cannibalization-url-head { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.cannibalization-url-head a,
.cannibalization-url-head > span:last-child { min-width: 0; color: #315d9b; font-size: 11.5px; line-height: 1.45; overflow-wrap: anywhere; text-decoration: none; }
.cannibalization-url-head a:hover { text-decoration: underline; }
.url-role { flex: 0 0 auto; padding: 2px 6px; border-radius: 5px; background: #f1f5f9; color: #64748b; font-size: 9.5px; font-weight: 700; }
.url-role.dominant { background: #eff6ff; color: #1d4ed8; }
.cannibalization-url-metrics { display: flex; flex-wrap: wrap; gap: 5px 13px; margin: 7px 0 0; padding-left: 0; color: #6b7a8f; font-family: 'Geist Mono', monospace; font-size: 9.5px; }
.cannibalization-url-metrics b { color: #334155; font-weight: 600; }

@media (max-width: 760px) {
  .cannibalization-url-head { display: grid; }
  .cannibalization-url-metrics { padding-left: 0; }
}
.priority-cannibalization-details { width: 100%; min-width: 0; margin-top: 8px; }
