.problems-page {
  --pg-blue: #2563eb;
  --pg-blue-soft: #eff6ff;
  --pg-green: #15803d;
  --pg-green-soft: #f0fdf4;
  --pg-red: #b91c1c;
  --pg-red-soft: #fef2f2;
  --pg-amber: #b45309;
  --pg-amber-soft: #fffbeb;
  --pg-ink: #142033;
  --pg-muted: #64748b;
  --pg-line: #dbe3ee;
  --pg-surface: #ffffff;
  padding-bottom: 48px;
}

.problems-page [hidden] { display: none !important; }

.problems-page *, .ai-modal * { box-sizing: border-box; letter-spacing: 0; }
.problems-page button, .problems-page input, .problems-page select, .problems-page textarea,
.ai-modal button, .ai-modal textarea { font: inherit; }
.problems-page svg, .ai-modal svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.problems-page .generator-wrap { width: 100%; max-width: none; }
.problems-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.problems-header .gen-title { margin: 6px 0 6px; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.header-actions .btn-sec, .btn-icon, .section-ai-button, .fetch-actions .btn-sec, .ai-actions .btn-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
}
.btn-icon { width: 42px; padding: 0; border: 1px solid var(--pg-line); border-radius: 7px; background: #fff; color: var(--pg-blue); cursor: pointer; }
.btn-icon:hover:not(:disabled) { border-color: #93b4ef; background: var(--pg-blue-soft); }
.btn-icon:disabled { color: #aab5c5; cursor: not-allowed; background: #f7f9fc; }

.section-card, .report-section, .report-meta, .empty-state {
  border: 1px solid var(--pg-line); border-radius: 8px; background: var(--pg-surface); box-shadow: 0 4px 14px rgba(15, 23, 42, .045);
}
.section-card { margin-top: 24px; padding: 26px 28px; }
.fetch-card { border-top: 3px solid var(--pg-blue); }
.section-heading, .report-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.section-label { display: flex; align-items: center; gap: 9px; color: var(--pg-ink); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.section-label svg { color: var(--pg-blue); }
.section-subtitle { margin: 8px 0 0; color: var(--pg-muted); font-size: 13px; line-height: 1.65; }

.fetch-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.35fr) minmax(150px, .55fr); gap: 14px; margin-top: 22px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: #52627a; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.field > span em { color: #8a98ac; font-size: 10px; font-style: normal; font-weight: 500; text-transform: none; }
.field select, .field input, .field textarea, .table-toolbar input {
  width: 100%; border: 1px solid #d5deea; border-radius: 7px; background: #f8fafc; color: var(--pg-ink); outline: 0; transition: border-color .18s, box-shadow .18s, background .18s;
}
.field select, .field input { height: 43px; padding: 0 13px; }
.field textarea { min-height: 108px; resize: vertical; padding: 12px 13px; line-height: 1.55; }
.field select:focus, .field input:focus, .field textarea:focus, .table-toolbar input:focus { border-color: #7aa2ec; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.field select:disabled { color: #98a5b8; cursor: not-allowed; }

.source-panel { margin-top: 18px; padding: 18px; border: 1px solid #cbd8ee; border-radius: 8px; background: #f7faff; }
.source-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.source-panel-head strong { color: var(--pg-ink); font-size: 13px; }
.source-panel-head p { margin: 4px 0 0; color: var(--pg-muted); font-size: 12px; }
.quota-note { padding: 6px 9px; border: 1px solid #bfdbfe; border-radius: 6px; background: #fff; color: #1d4ed8; font-size: 10px; font-weight: 700; white-space: nowrap; }
.source-panel .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.url-source-fieldset { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.url-source-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.url-source-option { position: relative; min-width: 0; cursor: pointer; }
.url-source-option > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.url-source-content { display: flex; align-items: flex-start; gap: 10px; height: 100%; min-height: 82px; padding: 13px; border: 1px solid #d7e1ef; border-radius: 7px; background: #fff; transition: border-color .16s, background .16s, box-shadow .16s; }
.url-source-option:hover .url-source-content { border-color: #9ab5e4; }
.url-source-option > input:focus-visible + .url-source-content { outline: 2px solid var(--pg-blue); outline-offset: 2px; }
.url-source-option > input:checked + .url-source-content { border-color: #7aa2ec; background: var(--pg-blue-soft); box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08); }
.url-source-indicator { display: grid; width: 17px; height: 17px; margin-top: 1px; flex: 0 0 17px; place-items: center; border: 1px solid #9aa9bc; border-radius: 50%; background: #fff; }
.url-source-indicator::after { width: 7px; height: 7px; border-radius: 50%; background: var(--pg-blue); content: ''; opacity: 0; transform: scale(.5); transition: opacity .16s, transform .16s; }
.url-source-option > input:checked + .url-source-content .url-source-indicator { border-color: var(--pg-blue); }
.url-source-option > input:checked + .url-source-content .url-source-indicator::after { opacity: 1; transform: scale(1); }
.url-source-content > span:last-child { display: grid; gap: 4px; min-width: 0; }
.url-source-content strong { color: var(--pg-ink); font-size: 12px; }
.url-source-content small { color: var(--pg-muted); font-size: 11px; line-height: 1.45; }
.manual-url-panel { margin-top: 14px; padding-top: 15px; border-top: 1px solid #dbe5f2; }
.manual-url-panel > p { margin: 7px 0 0; color: var(--pg-muted); font-size: 10.5px; }
.additional-test { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #dbe5f2; }
.additional-test > div > strong { color: var(--pg-ink); font-size: 12px; }
.additional-test > div > p { margin: 4px 0 0; color: var(--pg-muted); font-size: 11px; line-height: 1.45; }
.check-option { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid #d7e1ef; border-radius: 7px; background: #fff; cursor: pointer; }
.check-option:hover { border-color: #9ab5e4; }
.check-option input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--pg-blue); flex: 0 0 auto; }
.check-option span { display: grid; gap: 3px; }
.check-option strong { color: var(--pg-ink); font-size: 12px; }
.check-option small { color: var(--pg-muted); font-size: 11px; line-height: 1.45; }
.measurement-option { width: min(100%, 430px); flex: 0 0 430px; }

.fetch-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-run { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid #1d4ed8; border-radius: 7px; background: var(--pg-blue); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 3px 7px rgba(37, 99, 235, .2); }
.btn-run:hover:not(:disabled) { background: #1d4ed8; }
.btn-run:disabled { border-color: #b9c4d4; background: #c5cedb; box-shadow: none; cursor: not-allowed; }
.fetch-status { min-width: 220px; flex: 1; color: var(--pg-muted); font-size: 12px; line-height: 1.45; }
.progress-wrap { display: grid; grid-template-columns: 1fr 42px; align-items: center; gap: 10px; margin-top: 15px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 4px; background: #e7edf5; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--pg-blue); transition: width .25s ease; }
.progress-wrap > span { color: var(--pg-blue); font-size: 11px; font-weight: 700; text-align: right; }

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

.empty-state { display: grid; justify-items: center; margin-top: 24px; padding: 52px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 50%; background: #f1f5f9; color: #77869a; }
.empty-icon svg { width: 22px; height: 22px; }
.empty-state strong { color: var(--pg-ink); font-size: 15px; }
.empty-state p { margin: 7px 0 0; color: var(--pg-muted); font-size: 12px; }

.report { margin-top: 24px; }
.report-meta { display: grid; grid-template-columns: 1.4fr .7fr 1fr; gap: 1px; overflow: hidden; padding: 0; background: var(--pg-line); }
.report-meta > div { display: grid; gap: 5px; min-width: 0; padding: 15px 18px; background: #fff; }
.report-meta span { color: #7b899d; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.report-meta strong { overflow: hidden; color: var(--pg-ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.report-section { margin-top: 18px; padding: 23px 24px; }
.overview-section { border-top: 3px solid var(--pg-blue); }
.issue-section { border-top: 3px solid #dc2626; }
.server-section { border-top: 3px solid #0891b2; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--pg-blue); font-size: 9px; font-weight: 800; }
.report-section h2 { margin: 0; color: var(--pg-ink); font-family: 'Geist', sans-serif; font-size: 18px; font-weight: 700; }
.report-section-head p { margin: 5px 0 0; color: var(--pg-muted); font-size: 11px; line-height: 1.5; }
.section-ai-button { min-height: 36px; padding: 0 11px; border: 1px solid #cbd8eb; border-radius: 7px; background: #fff; color: #315fbd; font-size: 11px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.section-ai-button:hover { border-color: #85a5df; background: var(--pg-blue-soft); }

.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.summary-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-card { min-width: 0; padding: 14px; border: 1px solid #dfe6ef; border-radius: 7px; background: #fbfcfe; }
.summary-card[data-tone="good"] { border-color: #bbdfc7; background: #f6fcf8; }
.summary-card[data-tone="bad"] { border-color: #f1c3c3; background: #fff8f8; }
.summary-card[data-tone="warn"] { border-color: #eed9a7; background: #fffcf5; }
.summary-card span { display: block; color: #77869a; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.summary-card strong { display: block; margin-top: 7px; color: var(--pg-ink); font-family: 'Geist', sans-serif; font-size: 22px; }
.summary-card small { display: block; margin-top: 3px; overflow: hidden; color: var(--pg-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.health-row { display: grid; grid-template-columns: 112px 1fr; gap: 17px; align-items: center; margin-top: 13px; padding: 16px; border: 1px solid #dbe3ed; border-radius: 7px; background: #f8fafc; }
.health-score { display: grid; justify-items: center; padding-right: 17px; border-right: 1px solid #dbe3ed; }
.health-score span { color: var(--pg-blue); font-family: 'Geist', sans-serif; font-size: 28px; font-weight: 800; }
.health-score small { color: var(--pg-muted); font-size: 9px; }
.health-details strong { color: var(--pg-ink); font-size: 13px; }
.health-details p { margin: 4px 0 9px; color: var(--pg-muted); font-size: 10px; }
.health-track { height: 7px; overflow: hidden; border-radius: 4px; background: #e2e8f0; }
.health-track span { display: block; height: 100%; width: 0; background: var(--pg-blue); }

.status-bars { display: grid; gap: 9px; margin-top: 20px; }
.status-bar { display: grid; grid-template-columns: minmax(160px, 240px) 1fr 54px; align-items: center; gap: 11px; }
.status-bar-label { overflow: hidden; color: #43526a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.status-bar-track { height: 8px; overflow: hidden; border-radius: 4px; background: #edf1f6; }
.status-bar-track span { display: block; height: 100%; min-width: 2px; background: #4c7edb; }
.status-bar strong { color: var(--pg-ink); font-size: 10px; text-align: right; }

.issue-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 19px; }
.issue-card { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid #e2e7ef; border-radius: 7px; background: #fbfcfe; }
.issue-card-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eef2f7; color: #697a91; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.issue-card[data-tone="bad"] .issue-card-icon { background: #fee2e2; color: var(--pg-red); }
.issue-card[data-tone="warn"] .issue-card-icon { background: #fef3c7; color: var(--pg-amber); }
.issue-card strong { display: block; color: var(--pg-ink); font-size: 17px; }
.issue-card span { color: var(--pg-muted); font-size: 9px; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.table-toolbar input { max-width: 390px; height: 38px; padding: 0 12px; font-size: 11px; }
.table-toolbar span { color: var(--pg-muted); font-size: 10px; }
.table-scroll { margin-top: 14px; overflow: auto; border: 1px solid #dfe5ed; border-radius: 7px; }
.table-scroll table { width: 100%; min-width: 760px; border-collapse: collapse; }
.table-scroll th { padding: 10px 12px; border-bottom: 1px solid #dce3ec; background: #f4f7fa; color: #627189; font-size: 9px; font-weight: 800; text-align: left; text-transform: uppercase; white-space: nowrap; }
.table-scroll td { padding: 11px 12px; border-bottom: 1px solid #edf1f5; color: #344258; font-size: 10px; vertical-align: top; }
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll tbody tr:hover { background: #f8fafc; }
.url-cell { display: block; max-width: 430px; overflow-wrap: anywhere; color: #1d4ed8; }
.muted-cell { color: #8491a3; }
.status-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border: 1px solid #d8e0ea; border-radius: 5px; background: #f8fafc; color: #53627a; font-size: 9px; font-weight: 700; }
.status-pill.good { border-color: #b9e2c6; background: var(--pg-green-soft); color: #166534; }
.status-pill.bad { border-color: #fecaca; background: var(--pg-red-soft); color: #991b1b; }
.status-pill.warn { border-color: #fde68a; background: var(--pg-amber-soft); color: #92400e; }
.empty-row { padding: 25px !important; color: #8491a3 !important; text-align: center; }

.ai-modal[hidden] { display: none; }
.ai-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; }
.ai-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(22, 31, 45, .48); cursor: default; }
.ai-card { position: relative; width: min(860px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid #cad5e3; border-radius: 8px; background: #fff; box-shadow: 0 22px 60px rgba(15, 23, 42, .22); }
.ai-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid #dfe5ed; background: #f7f9fc; }
.ai-title-row { display: flex; gap: 12px; }
.ai-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #bfd2f4; border-radius: 7px; background: #edf4ff; color: var(--pg-blue); }
.ai-icon svg { width: 19px; height: 19px; }
.ai-head h2 { margin: 0; color: var(--pg-ink); font-family: 'Geist', sans-serif; font-size: 17px; }
.ai-head p { margin: 4px 0 0; color: var(--pg-muted); font-size: 11px; }
.ai-close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #d6dee9; border-radius: 7px; background: #fff; color: #68778c; cursor: pointer; }
.ai-close:hover { color: var(--pg-ink); border-color: #9eacbd; }
.ai-body { padding: 21px 22px 24px; }
.ai-section-label { color: #687890; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.ai-mode-switch { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.ai-mode-switch button { min-height: 34px; padding: 0 11px; border: 1px solid #d4ddea; border-radius: 6px; background: #fff; color: #596980; font-size: 10px; font-weight: 700; cursor: pointer; }
.ai-mode-switch button[aria-pressed="true"] { border-color: #7fa3e5; background: #edf4ff; color: #1d4ed8; }
.ai-note { min-height: 18px; margin: 9px 0 15px; color: var(--pg-muted); font-size: 10px; }
.ai-instruction small { color: #8491a3; font-size: 9px; }
.ai-actions { display: flex; gap: 9px; margin-top: 15px; }
.ai-status { min-height: 20px; margin-top: 10px; color: var(--pg-muted); font-size: 10px; }
.ai-status[data-state="error"] { color: var(--pg-red); }
.ai-status[data-state="ok"] { color: var(--pg-green); }
.ai-result { margin-top: 9px; padding-top: 16px; border-top: 1px solid #dfe5ed; }
.ai-result-head { display: flex; justify-content: space-between; gap: 12px; }
.ai-result-head strong { color: var(--pg-ink); font-size: 12px; }
.ai-result-head span { color: #8491a3; font-size: 9px; }
.ai-result-text { margin-top: 13px; color: #27364c; font-size: 11px; line-height: 1.65; }
.ai-result-text h3 { margin: 16px 0 6px; color: var(--pg-ink); font-size: 11px; }
.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: 1180px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .issue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .problems-header, .section-heading, .report-section-head, .source-panel-head { flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .fetch-grid, .url-source-options, .report-meta { grid-template-columns: 1fr; }
  .additional-test { align-items: stretch; flex-direction: column; }
  .measurement-option { width: 100%; flex-basis: auto; }
  .quota-note { white-space: normal; }
  .summary-grid, .summary-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-meta { gap: 0; }
  .report-meta > div + div { border-top: 1px solid var(--pg-line); }
}

@media (max-width: 540px) {
  .section-card, .report-section { padding: 19px 16px; }
  .header-actions .btn-sec { flex: 1; }
  .summary-grid, .summary-grid.compact, .issue-grid { grid-template-columns: 1fr; }
  .health-row { grid-template-columns: 1fr; }
  .health-score { padding: 0 0 12px; border-right: 0; border-bottom: 1px solid #dbe3ed; }
  .status-bar { grid-template-columns: 120px 1fr 38px; }
  .section-ai-button span { display: none; }
  .section-ai-button { width: 36px; padding: 0; }
  .ai-modal { padding: 8px; }
  .ai-card { max-height: calc(100vh - 16px); }
}

/* Ujednolicenie z interfejsem Widocznosc GSC */
.ai-modal {
  --pg-blue: #2563eb;
  --pg-blue-soft: #eff6ff;
  --pg-green: #15803d;
  --pg-green-soft: #f0fdf4;
  --pg-red: #b91c1c;
  --pg-red-soft: #fef2f2;
  --pg-amber: #b45309;
  --pg-amber-soft: #fffbeb;
  --pg-ink: #142033;
  --pg-muted: #64748b;
  --pg-line: #dbe3ee;
}

.problems-page .generator-wrap {
  width: 100%;
  max-width: none;
  animation: fadeUp .45s ease .05s both;
}

.problems-page .gen-header { margin-bottom: 28px; }
.problems-page .gen-tag {
  margin-bottom: 8px;
  color: var(--pg-blue);
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
}
.problems-page .gen-title {
  margin: 0 0 6px;
  color: var(--pg-ink);
  font-family: 'Geist', sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
.problems-page .gen-title span { color: var(--pg-blue); }
.problems-page .gen-desc {
  max-width: 760px;
  margin: 0;
  color: var(--pg-muted);
  font-size: 13px;
  line-height: 1.6;
}
.problems-page .problems-header { align-items: center; }

.problems-page .header-actions .btn-sec,
.problems-page .fetch-actions .btn-sec,
.ai-modal .ai-actions .btn-sec {
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid var(--pg-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--pg-muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.problems-page .btn-sec:hover:not(:disabled),
.ai-modal .btn-sec:hover:not(:disabled) {
  border-color: var(--pg-blue);
  background: #fff;
  color: var(--pg-blue);
}
.problems-page .btn-sec:disabled,
.ai-modal .btn-sec:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.problems-page .btn-icon {
  width: 38px;
  min-height: 38px;
  border-radius: 8px;
  background: #f8fafc;
}

.problems-page .section-card {
  position: relative;
  overflow: hidden;
  margin: 0 0 16px;
  padding: 22px 26px;
}
.problems-page .section-label {
  gap: 8px;
  margin-bottom: 10px;
  color: var(--pg-muted);
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  font-weight: 700;
}
.problems-page .fetch-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.problems-page .field,
.ai-modal .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.problems-page .field > span,
.ai-modal .field > span {
  color: var(--pg-muted);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 400;
}
.problems-page .field select,
.problems-page .field input,
.ai-modal .field input {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 13px;
}
.problems-page .field textarea,
.ai-modal .field textarea {
  padding: 11px 12px;
  font-size: 13px;
}
.problems-page .btn-run,
.ai-modal .btn-run {
  min-height: 40px;
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, .25);
  transition: background .15s, box-shadow .15s, transform .15s;
}
.problems-page .btn-run:hover:not(:disabled),
.ai-modal .btn-run:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
  transform: translateY(-1px);
}
.problems-page .app-alert {
  margin: 0 0 16px;
  padding: 12px 16px;
  font-size: 13px;
}
.problems-page .empty-state { margin-top: 0; padding: 48px 24px; }
.problems-page .report { margin-top: 0; }
.problems-page .report-section { margin-top: 16px; padding: 22px 26px; }
.problems-page .report-section-head p { font-size: 12.5px; }
.problems-page .section-ai-button {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
}

.problems-page .summary-card span { font-size: 10.5px; }
.problems-page .summary-card small { margin-top: 4px; font-size: 10.5px; }
.problems-page .issue-card span { font-size: 10.5px; }
.problems-page .table-toolbar input { height: 40px; font-size: 13px; }
.problems-page .table-toolbar span { font-size: 11.5px; }
.problems-page .table-scroll th {
  padding: 11px 13px;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
}
.problems-page .table-scroll td {
  padding: 12px 13px;
  font-size: 12px;
  line-height: 1.45;
}
.problems-page .status-pill {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 10.5px;
}

.ai-modal .ai-card {
  z-index: 1;
  max-height: min(820px, calc(100vh - 48px));
}
.ai-modal .ai-head {
  align-items: center;
  padding: 20px 22px 16px;
  background: #fff;
}
.ai-modal .ai-title-row { align-items: center; gap: 11px; min-width: 0; }
.ai-modal .ai-head h2 { font-size: 16px; }
.ai-modal .ai-head p { margin-top: 3px; font-size: 12.5px; line-height: 1.45; }
.ai-modal .ai-body { padding: 20px 22px 22px; }
.ai-modal .ai-section-label {
  margin-bottom: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}
.ai-modal .ai-mode-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 0;
}
.ai-modal .ai-mode-switch button {
  min-height: 37px;
  padding: 7px 8px;
  overflow: hidden;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-modal .ai-mode-switch button:hover,
.ai-modal .ai-mode-switch button[aria-pressed="true"] {
  border-color: var(--pg-blue);
  background: var(--pg-blue-soft);
  color: var(--pg-blue);
}
.ai-modal .ai-note {
  min-height: 38px;
  margin: 9px 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
}
.ai-modal .ai-instruction small { font-size: 11.5px; line-height: 1.45; }
.ai-modal .ai-status { margin-top: 9px; font-size: 12px; line-height: 1.45; }
.ai-modal .ai-result-head strong { font-size: 13px; }
.ai-modal .ai-result-head span { font-family: 'Geist Mono', monospace; font-size: 10.5px; }
.ai-modal .ai-result-text { margin-top: 10px; font-size: 13px; }
.ai-modal .ai-result-text h3 { font-size: 13px; }

@media (max-width: 820px) {
  .problems-page .fetch-grid { grid-template-columns: 1fr; }
  .ai-modal .ai-mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .problems-page .section-card,
  .problems-page .report-section { padding: 19px 16px; }
  .problems-page .header-actions .btn-sec { min-width: 0; }
}

@media (max-width: 820px) {
  .problems-page .problems-header { align-items: flex-start; }
  .problems-page .header-actions { width: 100%; justify-content: flex-start; }
}

/* Czytelność raportu, sortowanie i układ szerokich tabel */
.problems-page,
.ai-modal {
  font-family: 'Geist', sans-serif;
}

.problems-page .health-row {
  grid-template-columns: minmax(128px, 150px) minmax(0, 1fr);
}
.problems-page .health-score,
.problems-page .health-details {
  min-width: 0;
}
.problems-page .health-score {
  overflow: hidden;
  padding-right: 16px;
  text-align: center;
}
.problems-page .health-score small {
  max-width: 100%;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}
.problems-page .health-details p {
  overflow-wrap: anywhere;
}

.problems-page .table-scroll table {
  min-width: 900px;
  table-layout: auto;
}
.problems-page .table-scroll th {
  vertical-align: middle;
}
.problems-page .table-scroll .url-cell {
  min-width: 220px;
  max-width: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.problems-page .table-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.problems-page .table-sort::after {
  color: #9aa7b8;
  content: '↕';
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  line-height: 1;
}
.problems-page .table-sort:hover,
.problems-page .table-sort:focus-visible {
  color: var(--pg-blue);
}
.problems-page .table-sort:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .35);
  outline-offset: 3px;
}
.problems-page .table-sort[data-sort-direction='asc']::after {
  color: var(--pg-blue);
  content: '↑';
}
.problems-page .table-sort[data-sort-direction='desc']::after {
  color: var(--pg-blue);
  content: '↓';
}

.problems-page .issues-table,
.problems-page .indexing-table {
  min-width: 980px;
}
.problems-page .canonicals-table {
  min-width: 1160px;
}
.problems-page .enhancements-table {
  min-width: 1040px;
}
.problems-page .enhancements-table th:first-child,
.problems-page .enhancements-table td:first-child {
  width: 34%;
  min-width: 280px;
}
.problems-page .enhancements-table th:last-child,
.problems-page .enhancements-table td:last-child {
  width: 40%;
  min-width: 320px;
}
.problems-page .enhancement-problems {
  max-width: 100%;
}
.problems-page .enhancement-problems summary {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: var(--pg-red-soft);
  color: #991b1b;
  font-weight: 650;
  cursor: pointer;
}
.problems-page .enhancement-problems[open] summary {
  margin-bottom: 9px;
}
.problems-page .enhancement-problems ul {
  max-width: 720px;
  margin: 0;
  padding-left: 19px;
}
.problems-page .enhancement-problems li {
  margin: 5px 0;
  overflow-wrap: anywhere;
}

@media (max-width: 540px) {
  .problems-page .health-row {
    grid-template-columns: 1fr;
  }
  .problems-page .health-score {
    padding: 0 0 12px;
  }
}
