* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f5f7; color: #222; }
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: #1f2937; color: #fff; }
header h1 { margin: 0; font-size: 18px; } header small { font-weight: normal; opacity: .7; margin-left: 8px; }
.status { font-size: 12px; opacity: .85; white-space: nowrap; }
.tabs { display: flex; gap: 4px; padding: 8px 18px 0; background: #e5e7eb; }
.tabs button { border: 0; padding: 8px 14px; background: #d1d5db; border-radius: 6px 6px 0 0; cursor: pointer; }
.tabs button.active { background: #fff; font-weight: 600; }
main { padding: 16px 18px; }
.tab { display: none; } .tab.active { display: block; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
input[type=text], input[type=number] { padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 5px; }
#q, #b-url, #probe-q { flex: 1; min-width: 240px; } #page { width: 64px; }
button { padding: 7px 12px; border: 1px solid #94a3b8; background: #fff; border-radius: 5px; cursor: pointer; }
button[type=submit], #probe-run, #b-goto { background: #2563eb; color: #fff; border-color: #2563eb; }
button:disabled { opacity: .5; cursor: wait; }
.hint { font-size: 12px; color: #64748b; } .msg { margin: 8px 0; font-size: 13px; color: #b91c1c; white-space: pre-wrap; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.site-block { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; }
.site-block h3 { margin: 0 0 6px; font-size: 15px; display: flex; justify-content: space-between; }
.site-block h3 small { font-weight: normal; color: #64748b; }
.item { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid #f1f5f9; }
.item img { width: 64px; height: 64px; object-fit: contain; background: #f8fafc; border-radius: 4px; flex: none; }
.item .t { font-size: 13px; } .item .t a { color: #1d4ed8; text-decoration: none; }
.item .m { font-size: 12px; color: #475569; } .item .price { font-weight: 600; color: #111; }
.item .ad { font-size: 10px; background: #fde68a; padding: 0 4px; border-radius: 3px; margin-left: 4px; }
table { border-collapse: collapse; width: 100%; background: #fff; font-size: 13px; }
th, td { padding: 6px 8px; border-bottom: 1px solid #e2e8f0; text-align: left; }
tr.clickable { cursor: pointer; } tr.clickable:hover { background: #f1f5f9; }
.err { color: #b91c1c; } .ok { color: #15803d; }
.shot-wrap { overflow: auto; border: 1px solid #cbd5e1; background: #0b0e14; max-height: 75vh; width: max-content; max-width: 100%; }
#shot { display: block; max-width: 100%; cursor: crosshair; }
pre { background: #fff; border: 1px solid #e2e8f0; padding: 10px; overflow: auto; font-size: 12px; }
.item .pln { color: #15803d; font-weight: 600; }
.import { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.import summary { cursor: pointer; font-weight: 600; }
.row.cols textarea { flex: 1; min-width: 280px; font: 12px/1.4 monospace; padding: 6px; border: 1px solid #cbd5e1; border-radius: 5px; }
.item .orig { color: #475569; text-decoration: none; font-size: 12px; }
.item .promo { font-size: 10px; background: #e0f2fe; color: #075985; padding: 0 4px; border-radius: 3px; }
.item .promo-new { background: #fee2e2; color: #991b1b; }
.so-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; margin: 10px 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; }
.so-src { display: flex; gap: 8px; } .so-src img { width: 96px; height: 96px; object-fit: contain; background: #f8fafc; border-radius: 4px; }
.so-cands { display: grid; grid-template-columns: repeat(auto-fit, minmax(305px, 1fr)); gap: 8px; }
/* „Blisko"/reszta: osobny blok na CALA szerokosc .so-item (od lewej krawedzi, pod kafelkiem Allegro), poziomo jeden pod drugim */
.so-close { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.so-cand { display: flex; gap: 6px; padding: 6px; border: 1px solid #f1f5f9; border-radius: 6px; font-size: 12px; min-width: 0; } .so-cand img { width: 56px; height: 56px; object-fit: contain; background: #f8fafc; flex: 0 0 56px; }
/* dlugi opis AI (Gemini/OpenAI) nie moze rozpychac karty: dzieci flex musza moc sie kurczyc (min-width:0) i zawijac tekst -> grid trzyma kilka kart obok siebie */
.so-cand > div { min-width: 0; overflow-wrap: anywhere; word-break: break-word; } .so-cand .m { flex: 1 1 auto; } .so-cand .ai { max-width: 100%; white-space: normal; }
.so-cand.good { border-color: #86efac; background: #f0fdf4; } .so-cand.mid { border-color: #fde68a; background: #fffbeb; } .so-cand.bad { border-color: #fca5a5; background: #fef2f2; }
.so-cand .site { font-size: 10px; background: #e2e8f0; padding: 0 4px; border-radius: 3px; text-transform: uppercase; }
.so-toggles { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.so-tgl { font-size: 12px; padding: 3px 8px; border: 1px solid #cbd5e1; border-radius: 999px; background: #f8fafc; cursor: pointer; color: #334155; }
.so-tgl:hover:not(:disabled) { background: #eef2f7; }
.so-tgl.active { background: #1e293b; color: #fff; border-color: #1e293b; }
.so-tgl:disabled { opacity: .4; cursor: default; }
@media (max-width: 900px) { .so-item { grid-template-columns: 1fr; } }
.direct { font-size: 10px; background: #dcfce7; color: #166534; padding: 0 4px; border-radius: 3px; margin-left: 4px; }
.chat { font-size: 10px; background: #f1f5f9; color: #64748b; padding: 0 4px; border-radius: 3px; margin-left: 4px; }
.landed { color: #7c2d12; } .ai { font-size: 11px; margin-top: 3px; padding: 2px 4px; border-radius: 3px; background: #f1f5f9; }
.ai-ok { background: #dcfce7; color: #14532d; } .ai-mid { background: #fef9c3; color: #713f12; } .ai-bad { background: #fee2e2; color: #7f1d1d; }
.grp { font-size: 10px; background: #ede9fe; color: #4c1d95; padding: 0 4px; border-radius: 3px; margin-left: 4px; }
.net { color: #0f766e; font-weight: 600; font-size: 12px; }
.so-cand.hit { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 1px #16a34a inset; }
.hitbadge { font-size: 10px; background: #16a34a; color: #fff; padding: 0 5px; border-radius: 3px; font-weight: 700; }
.hit-card.accepted { border-color: #16a34a; } .hit-card.rejected { opacity: .6; }
.hit-card.fd-match { border-left: 4px solid #16a34a; } .hit-card.fd-close { border-left: 4px solid #eab308; } .hit-card.fd-no { border-left: 4px solid #ef4444; }

.badge{display:inline-block;padding:1px 6px;border-radius:4px;background:#e5e7eb;font-size:12px;margin-right:4px}
.badge.brand{background:#dbeafe;color:#1e3a8a}
.badge.ok{background:#dcfce7;color:#14532d}
.badge.warn{background:#fef3c7;color:#7c2d12}

pre.example{background:#f3f4f6;border:1px solid #e5e7eb;border-radius:6px;padding:8px 10px;font-size:12px;white-space:pre-wrap;margin:6px 0}
.badge.bad{background:#fee2e2;color:#7f1d1d}
.excl-dept{margin:6px 0;line-height:1.9}
.excl-rm{text-decoration:none;color:#991b1b;margin-left:3px}
