/* mapa.css v0.1 — poprawka ekranu „Projekty GitHub” w v2. Tylko nowe elementy tego widoku, na tokenach z v2.css (jasny i ciemny). */
.pm-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 10px; }
.pm-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--card); font: 600 14px var(--sans); color: var(--ink-2); white-space: nowrap; }
.pm-chip i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pm-chip small { font: 600 12.5px var(--sans); color: var(--ink-3); }
.pm-chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pm-chip[aria-pressed="true"] small { color: inherit; opacity: .8; }
.pm-chip .pm-ring { width: 12px; height: 12px; background: transparent; border: 2px solid var(--amber); }
.pm-found { margin: 0 0 10px; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 600 14.5px var(--sans); color: var(--ink); }
.pm-scope { font-weight: 400; color: var(--ink-2); font-size: 14px; }
.pm-link { min-height: 44px; padding: 0 4px; font: 650 14px var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.pm-stage { position: relative; }
.pm-canvas { position: relative; height: 560px; border-radius: 20px; overflow: hidden; background: var(--night); }
.pm-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.pm-canvas canvas:active { cursor: grabbing; }
.pm-back { position: absolute; left: 12px; top: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: calc(100% - 24px - 160px); padding: 0 14px 0 10px; border-radius: 12px; background: rgba(11,14,16,.82); color: #EEF2EF; border: 1px solid rgba(255,255,255,.22); font: 600 14px var(--sans); }
.pm-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-back[hidden] { display: none; }
.pm-zoom { position: absolute; z-index: 2; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 8px; }
.pm-back:not([hidden]) ~ .pm-zoom { top: 64px; }
.pm-zoom .ibtn { background: rgba(11,14,16,.82); color: #EEF2EF; border-color: rgba(255,255,255,.22); }
.pm-zoom .ibtn:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.pm-legend { position: absolute; z-index: 1; left: 12px; bottom: 10px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 10px; border-radius: 10px; background: rgba(11,14,16,.78); color: #D5DDDA; font: 500 12.5px var(--sans); max-width: calc(100% - 24px); pointer-events: none; }
.pm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pm-legend i { display: inline-block; flex: none; }
.pm-legend .d { width: 8px; height: 8px; border-radius: 50%; background: #60A5FA; }
.pm-legend .r { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #EC9628; }
.pm-legend .l { width: 22px; border-top: 2px solid rgba(255,255,255,.75); }
.pm-legend .l.n { border-top: 2px dashed #EC9628; }

/* karta: na komputerze przy prawej krawędzi mapy (mapa zostaje widoczna obok), na telefonie pod mapą */
.pm-card { position: absolute; z-index: 3; top: 12px; right: 12px; bottom: 12px; width: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; border-radius: 16px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-strong); }
.pm-card[hidden] { display: none; }
.pm-card:not([hidden]) ~ * { }
.pm-stage:has(.pm-card:not([hidden])) .pm-legend { max-width: calc(100% - 380px); }
.pm-ch { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -6px 0 0; }
.pm-kick { display: flex; align-items: center; gap: 8px; font: 650 13px var(--sans); color: var(--ink-2); }
.pm-kick i { width: 10px; height: 10px; border-radius: 50%; }
.pm-kick .demo { margin-left: 2px; }
.pm-name { margin: 4px 0 0; font: 740 20px/1.25 var(--sans); letter-spacing: -.02em; overflow-wrap: anywhere; }
.pm-desc { margin: 8px 0 0; font: 400 16px/1.45 var(--sans); color: var(--ink); }
.pm-desc.none { color: var(--ink-2); font-style: italic; }
.pm-from { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.pm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pm-acts .btn { padding: 0 14px; font-size: 14.5px; }
.pm-card .note { margin: 8px 0 0; font-size: 13px; }
.pm-voice { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.pm-voice a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pm-facts { margin: 14px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.pm-facts div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.pm-facts dt { font: 650 12.5px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.pm-facts dd { margin: 2px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.pm-src { display: inline-block; margin-left: 2px; padding: 1px 6px; border-radius: 6px; font: 600 12px/1.5 var(--sans); white-space: nowrap; vertical-align: 1px; border: 1px solid var(--line-2); color: var(--ink-2); }
.pm-src.gh { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.pm-src.int { color: var(--kick); border-color: color-mix(in srgb, var(--kick) 45%, transparent); }
.pm-src.miss { color: var(--ink-2); border-style: dashed; }
.pm-novoice { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.pm-novoice a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pm-rh { margin: 14px 0 4px; font: 700 16px var(--sans); }
.pm-rl { margin: 8px 0 2px; display: flex; align-items: center; gap: 8px; font: 600 13.5px var(--sans); color: var(--ink-2); }
.pm-rl svg { color: var(--ink-2); flex: none; }
.pm-rel { list-style: none; margin: 0; padding: 0; }
.pm-rel button, #pmList button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px; border-radius: 10px; text-align: left; }
.pm-rel button:hover, #pmList button:hover { background: var(--hover); }
.pm-rel i, #pmList i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pm-rel span, #pmList span { min-width: 0; display: grid; }
.pm-rel b { font: 600 14px/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-rel small { font-size: 12.5px; color: var(--ink-3); }
.pm-opt { margin-top: 10px; min-height: 44px; font: 500 13.5px var(--sans); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; opacity: .75; }
.pm-hint { margin: 8px 0 0; }

/* lista projektów: alternatywa dla mapy */
.pm-list ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
#pmList li { border-bottom: 1px solid var(--line); }
#pmList button { padding: 10px 8px; align-items: flex-start; }
#pmList i { margin-top: 6px; }
#pmList b { font: 650 15.5px/1.3 var(--sans); overflow-wrap: anywhere; }
#pmList small { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pmList em { font-style: normal; font-size: 13px; color: var(--ink-3); }
#pmList button[aria-current="true"] { background: var(--amber-soft); }
.pm-vb { color: var(--kick); font-weight: 650; }
#pmList li.pm-more { border: 0; padding-top: 12px; }
#pmList li.pm-more button { width: auto; display: inline-flex; padding: 0 18px; }
.pm-list + .ghform { margin-top: 26px; }
.pm-data { margin-top: 14px; }

@media (max-width: 1180px) and (min-width: 901px) { .pm-card { width: 320px; } }
@media (max-width: 900px) {
  .pm-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 8px; padding: 2px 16px 6px; scrollbar-width: none; }
  .pm-filters::-webkit-scrollbar { display: none; }
  .pm-canvas { height: 360px; border-radius: 16px; }
  .pm-card { position: static; width: auto; margin-top: 10px; box-shadow: none; overflow: visible; }
  .pm-stage:has(.pm-card:not([hidden])) .pm-legend { max-width: calc(100% - 24px); }
  .pm-legend { font-size: 12px; gap: 2px 10px; }
  .pm-back { max-width: calc(100% - 24px); }
}

/* kategorie zwinięte, żeby mapa była widoczna bez przewijania */
.pm-filters { align-items: flex-start; }
.pm-caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); margin-left: 4px; }
.pm-catbtn[aria-expanded="true"] { background: var(--seg); color: var(--ink); }
.pm-catbtn[aria-expanded="true"] .pm-caret { transform: rotate(-135deg) translate(-2px, -2px); }
.pm-catlist[hidden] { display: none; }
.pm-catlist { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 16px; background: var(--seg); }
@media (max-width: 900px) {
  .pm-filters { flex-wrap: wrap; overflow: visible; margin: 0 0 8px; padding: 0; }
  .pm-catlist { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pm-stage:has(.pm-card:not([hidden])) .pm-canvas { height: 300px; }
}
.pm-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: var(--on-ink); font: 700 12.5px var(--sans); }
.pm-catlist .pm-chip { flex: none; }
.pm-catlist { min-width: 0; max-width: 100%; }

/* telefon: mapa pierwsza, filtry i liczba wyników pod nią, potem karta. Po przewinięciu do mapy nad nią jest
   tylko tytuł, więc żadna kontrolka nie chowa się pod stałym nagłówkiem z polem szukania. */
@media (max-width: 900px) {
  .pm-wrap { display: flex; flex-direction: column; }
  .pm-wrap .pm-stage { display: contents; }
  .pm-wrap .pm-canvas { order: 1; }
  .pm-wrap .pm-filters { order: 2; margin: 10px 0 4px; }
  .pm-wrap .pm-found { order: 3; margin-bottom: 0; }
  .pm-wrap .pm-card { order: 4; }
  .pm-wrap:has(.pm-card:not([hidden])) .pm-canvas { height: 300px; }
  .pm-wrap:has(.pm-card:not([hidden])) .pm-legend { max-width: calc(100% - 24px); }
}

/* komputer (mysz): zwarte filtry jak na typowych portalach, a mapa wypełnia resztę ekranu.
   Przyciski 32 px (WCAG 2.5.8 wymaga 24 px); na ekranach dotykowych zostaje 44 px. */
@media (min-width: 901px) and (pointer: fine) {
  .pm-head { margin-bottom: 12px; }
  .pm-head h1 { font-size: 30px; }
  .pm-head p { margin-top: 4px; font-size: 14.5px; }
  .pm-filters { gap: 6px; margin: 0 0 6px; align-items: center; }
  .pm-chip { min-height: 32px; padding: 0 11px; gap: 6px; border-radius: 16px; font: 600 13px var(--sans); }
  .pm-chip i { width: 8px; height: 8px; }
  .pm-chip .pm-ring { width: 10px; height: 10px; }
  .pm-chip small { font: 500 12px var(--sans); }
  .pm-filters .pm-lang { padding: 0 4px 0 10px; }
  .pm-filters .pm-lang select { min-height: 30px; font-size: 13px; }
  .pm-catlist { gap: 6px; padding: 6px; border-radius: 12px; }
  .pm-n { min-width: 18px; height: 18px; font-size: 11.5px; border-radius: 9px; }
  .pm-found { min-height: 32px; margin-bottom: 6px; font-size: 13.5px; }
  .pm-scope { font-size: 13px; }
  .pm-link { min-height: 32px; font-size: 13px; }
  .pm-canvas { height: clamp(520px, calc(100vh - 230px), 900px); }
}
