/* AliPaczka redesign 2026 - komponenty (mobile-first, jeden responsywny layout). */

/* ---------- layout / kontener ---------- */
.ap-wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.ap-page { min-height: 100vh; display: flex; flex-direction: column; }
.ap-main { flex: 1; }
.ap-col { width: 100%; max-width: 680px; margin: 0 auto; }
.ap-fade { animation: apFade .4s ease both; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- przyciski ---------- */
.ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: var(--r-md);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; line-height: 1; padding: 0 18px; height: 46px; }
/* tekst na akcencie: --accent-strong + --on-accent (kontrast >= 4.5:1 w obu motywach, patrz tokens.css);
   hover przyciemnia (brightness < 1), żeby nie zejść poniżej progu kontrastu */
.ap-btn--primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 8px 20px -8px var(--accent); }
.ap-btn--primary:hover { filter: brightness(.95); }
.ap-btn--soft { background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent); }
.ap-btn--ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.ap-btn--block { width: 100%; }
.ap-btn--lg { height: 52px; font-size: 16.5px; }

/* ---------- app-bar / header ---------- */
.ap-appbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.ap-appbar__inner { display: flex; align-items: center; gap: 14px; height: 60px; }
.ap-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.ap-brand__mark { width: 30px; height: 30px; object-fit: contain; }
.ap-wordmark { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.ap-wordmark .a1 { color: var(--accent-2); }
.ap-wordmark .a2 { color: var(--accent); }
.ap-wordmark .a3 { color: var(--muted); font-weight: 700; }
/* "Nowa" przy logo (do AP_NEW_UNTIL) */
.ap-newbadge { align-self: flex-start; margin: 1px 0 0 -4px; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-text); font-family: var(--font-body); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; line-height: 1; text-transform: uppercase; }
.ap-appbar__spacer { flex: 1; }
.ap-appbar__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.ap-iconbtn { position: relative; width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg); text-decoration: none; }
.ap-iconbtn:hover { border-color: var(--field-line); }
.ap-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent-strong); color: var(--on-accent); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--font-body); }
.ap-badge:empty, .ap-badge[data-count="0"] { display: none; }

.ap-theme { display: none; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px 7px 10px; cursor: pointer; font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--fg); }

/* desktop nav */
.ap-nav { display: none; align-items: center; gap: 4px; }
.ap-nav__item { position: relative; }
.ap-nav__link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--fg); white-space: nowrap; }
.ap-nav__link:hover { background: var(--surface-2); }
.ap-nav__link--active { color: var(--accent-text); }
.ap-nav__link--highlight { color: var(--accent-text); }
.ap-nav__dd { position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 18px 40px -16px var(--shadow); padding: 8px; display: none; flex-direction: column; gap: 2px; z-index: 50; }
/* niewidzialny "mostek" wypełnia przerwę trigger->lista, by hover był ciągły (lista nie znika po drodze) */
.ap-nav__dd::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.ap-nav__item:hover .ap-nav__dd, .ap-nav__item:focus-within .ap-nav__dd { display: flex; }
.ap-nav__dd a { padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--fg); font-size: 13.5px; font-weight: 600; }
.ap-nav__dd a:hover { background: var(--surface-2); color: var(--accent-text); }

.ap-hamburger { display: flex; }

/* ---------- search ---------- */
.ap-hero { padding: 20px 0 8px; }
.ap-h1 { font-family: var(--font-display); font-weight: 800; font-size: 25px; line-height: 1.18; margin: 6px 0 8px; text-wrap: balance; }
.ap-lead { font-size: 14.5px; line-height: 1.5; color: var(--muted); margin: 0 0 18px; }

.ap-searchcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 14px; box-shadow: 0 8px 24px -14px var(--shadow); }
/* widoczna etykieta pola numeru (zamiast samego placeholdera) */
.ap-sf-label { display: block; margin: 0 2px 8px; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--muted); }
.ap-searchfield { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1.5px solid var(--field-line);
  border-radius: var(--r-md); padding: 0 8px 0 14px; min-height: 54px; }
.ap-searchfield:focus-within { border-color: var(--accent); }
.ap-searchfield .ap-sf-ic { color: var(--muted); display: flex; }
.ap-searchfield textarea, .ap-searchfield input { flex: 1; border: none; background: none; outline: none; font-family: var(--font-body);
  font-size: 16px; font-weight: 600; color: var(--fg); min-width: 0; resize: none; }
.ap-searchfield textarea { height: 52px; min-height: 52px; max-height: 140px; padding: 15px 0; line-height: 22px; overflow-y: auto; }
.ap-searchfield textarea::placeholder { line-height: 22px; }
.ap-sf-paste { flex: none; width: 38px; height: 38px; border-radius: 10px; border: none; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ap-sf-paste:hover { color: var(--accent); background: var(--accent-soft); }
.ap-search-submit { margin-top: 10px; width: 100%; height: 52px; }
.ap-multi-hint { font-size: 12px; color: var(--muted); margin: 8px 2px 0; }

/* ---------- sekcje ogólne ---------- */
.ap-section { margin-top: 22px; }
.ap-section__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin: 0 0 10px; }

/* przewoźnicy */
.ap-carriers { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-chip { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px 7px 9px; }
.ap-chip__abbr { width: 22px; height: 22px; border-radius: 7px; font-size: 11px; font-weight: 800; font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center; }
.ap-chip__name { font-size: 12.5px; font-weight: 600; }

/* karty narzędzi / cross-sell / discover */
.ap-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ap-toolcard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px;
  cursor: pointer; display: flex; flex-direction: column; gap: 9px; text-decoration: none; color: inherit; }
.ap-toolcard:hover { border-color: var(--field-line); transform: translateY(-1px); transition: transform .15s, border-color .15s; }
.ap-toolcard__ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.ap-toolcard__title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.ap-toolcard__sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

/* reklama */
.ap-ad { margin-top: 22px; }
.ap-ad__label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.ap-ad__slot { min-height: 104px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; text-align: center; padding: 8px 16px; }
.ap-ad--feed .ap-ad__slot { min-height: 120px; }
.ap-ad--display .ap-ad__slot { min-height: 250px; }
/* po wstawieniu <ins> (app.js ustawia data-loaded) slot jest zwykłym blokiem: jako element flex <ins> dostawał
   szerokość 0 i AdSense odrzucał jednostkę ("No slot size for availableWidth=0") */
.ap-ad__slot[data-loaded] { display: block; padding: 0; border: 0; background: none; }
/* Google nie ma reklamy (unfilled) - chowamy cały blok razem z etykietą, zamiast pustej ramki */
.ap-ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* treść SEO / dlaczego warto */
.ap-prose { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.ap-prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 0 0 10px; }
.ap-prose p { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0 0 12px; }
.ap-prose strong { color: var(--fg); font-weight: 600; }
.ap-points { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.ap-point { display: flex; gap: 10px; align-items: flex-start; }
.ap-point__ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ap-point__t { font-weight: 600; font-size: 13.5px; }
.ap-point__d { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* baner aplikacji */
.ap-appcta { margin-top: 22px; display: flex; align-items: center; gap: 13px; text-decoration: none; background: var(--fg); color: var(--bg); border-radius: var(--r-lg); padding: 15px; }
.ap-appcta__ic { flex: none; width: 42px; height: 42px; border-radius: 12px; background: rgba(128,128,128,.18); display: flex; align-items: center; justify-content: center; }
.ap-appcta__t { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.ap-appcta__s { font-size: 11.5px; opacity: .72; line-height: 1.35; }
.ap-appcta__cta { flex: none; background: var(--accent-strong); color: var(--on-accent); border-radius: 10px; padding: 9px 12px; font-weight: 700; font-size: 12px; font-family: var(--font-display); }

/* ---------- bottom nav (mobile) ---------- */
.ap-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); }
.ap-bottomnav__item { flex: 1; background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 600; }
.ap-bottomnav__item--active { color: var(--accent-text); }
/* "Zapisane" w dolnym pasku to <button> - wygląda jak linki obok; licznik przy ikonie */
button.ap-bottomnav__item { margin: 0; font-family: var(--font-body); line-height: 1.5; -webkit-appearance: none; appearance: none; }
.ap-bottomnav__ic { position: relative; display: flex; }
.ap-bottomnav__ic .ap-badge { top: -7px; right: -11px; }
.ap-bottomnav__fab { color: var(--accent); position: relative; }
/* tylko PIERWSZY span (ikona) jest podniesionym kafelkiem; drugi to zwykła etykieta */
.ap-bottomnav__fab > span:first-child { width: 46px; height: 46px; margin-top: -22px; border-radius: 15px; background: var(--accent-strong); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px -6px var(--accent); }
.ap-bottomnav__fab > span:last-child { font-size: 10.5px; font-weight: 700; line-height: 1.2; }

/* ---------- overlay / sheety ---------- */
.ap-overlay { position: fixed; inset: 0; background: rgba(10,8,6,.45); z-index: 60; display: flex; }
.ap-overlay[hidden] { display: none; }
.ap-overlay--bottom { align-items: flex-end; }
.ap-overlay--right { align-items: stretch; justify-content: flex-end; }
.ap-sheet { width: 100%; max-height: 82vh; background: var(--surface); border-radius: 24px 24px 0 0; animation: apSheet .3s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; overflow: hidden; }
.ap-sheet--right { max-height: none; height: 100%; width: 84%; max-width: 360px; border-radius: 0; animation: apSheet .3s ease; }
.ap-sheet__handle { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 12px auto 8px; }
.ap-sheet__head { padding: 4px 18px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.ap-sheet__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 0; line-height: 1.3; }

/* dialog nazwy zapisywanej przesyłki (#ap-name-dlg, saved.js) - nad innymi panelami, pod toastem */
.ap-overlay--dialog { z-index: 70; }
.ap-dialog { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.ap-dialog__num { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.ap-dialog__label { font-size: 13px; font-weight: 600; }
.ap-dialog__input { width: 100%; height: 48px; border: 1.5px solid var(--field-line); background: var(--surface-2); border-radius: var(--r-md);
  padding: 0 14px; font-family: var(--font-body); font-size: 16px; color: var(--fg); }
.ap-dialog__input:focus, .ap-dialog__input:focus-visible { outline: none; border-color: var(--accent); border-radius: var(--r-md); box-shadow: 0 0 0 3px var(--accent-soft); }
.ap-dialog__input[aria-invalid="true"] { border-color: var(--accent-strong); }
.ap-dialog__hint { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
/* błąd na tle --surface: --accent-strong ma 4.62:1 (jasny) i 6.10:1 (ciemny) */
.ap-dialog__err { margin: 0; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--accent-strong); }
.ap-dialog__err:empty { display: none; }
.ap-dialog__row { display: flex; gap: 10px; margin-top: 10px; }
.ap-dialog__row .ap-btn { flex: 1; }
.ap-sheet__body { flex: 1; overflow-y: auto; padding: 12px 14px 24px; }

/* zapisane */
.ap-saved-list { display: flex; flex-direction: column; gap: 10px; }
.ap-saved-item { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.ap-saved-item__btn { flex: 1; display: flex; align-items: center; gap: 12px; background: none; border: none; text-align: left; cursor: pointer; min-width: 0; color: inherit; }
.ap-saved-item__ic { flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ap-saved-item__name { display: block; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-saved-item__num { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-saved-item__del { flex: none; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ap-saved-foot { margin-top: 16px; text-align: center; }
.ap-saved-foot a { font-size: 12.5px; color: var(--muted); }

.ap-empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ap-empty__ic { width: 60px; height: 60px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ap-empty__t { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.ap-empty__d { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; max-width: 260px; }

/* menu sheet */
.ap-menu-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.ap-menu-list a { display: flex; align-items: center; gap: 12px; border-radius: 12px; padding: 13px 12px; text-decoration: none;
  color: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.ap-menu-list a:hover, .ap-menu-list a.is-active { background: var(--accent-soft); color: var(--accent-text); }

/* (2026-10) style własnego banera zgody (.ap-consent) usunięte - zgoda wyłącznie przez Google CMP */

/* tło pod otwartym panelem/dialogiem (app.js apOpenOverlay) - zapas dla przeglądarek bez `inert` */
[inert] { pointer-events: none; cursor: default; }

/* ---------- toast ---------- */
.ap-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 80; background: var(--fg); color: var(--bg);
  padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px -10px var(--shadow); animation: apToast .25s ease both; }
.ap-toast[hidden] { display: none; }

/* ---------- skaner kodów (kamera) ---------- */
.ap-scan { position: fixed; inset: 0; z-index: 90; background: rgba(8,6,4,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.ap-scan__box { position: relative; width: min(88vw, 420px); aspect-ratio: 1 / 1; border-radius: 20px; overflow: hidden; background: #000; }
.ap-scan__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-scan__frame { position: absolute; inset: 16%; border: 3px solid rgba(255,255,255,.92); border-radius: 16px; }
.ap-scan__cap { color: #fff; font-size: 14px; font-weight: 600; max-width: 82vw; text-align: center; padding: 0 16px; }
.ap-scan__close { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; width: 44px; height: 44px; border-radius: 12px; border: none; background: rgba(255,255,255,.16); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---------- wynik śledzenia ---------- */
.ap-result { padding: 14px 0 30px; }
.ap-result__back { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--muted);
  font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 0; margin-bottom: 8px; text-decoration: none; }
.ap-rhead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: 0 8px 24px -16px var(--shadow); }
.ap-rhead__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ap-rhead__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.ap-rhead__num { font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.ap-rhead__meta { font-size: 12.5px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.ap-pill { flex: none; display: flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 11px; font-weight: 700; font-size: 12.5px; }
.ap-pill--ok { background: var(--ok-soft); color: var(--ok); }
.ap-pill--transit { background: var(--accent-soft); color: var(--accent-text); }
.ap-pill--muted { background: var(--surface-2); color: var(--muted); }

.ap-actions { display: flex; gap: 8px; margin-top: 12px; }
.ap-actions .ap-act { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ap-actions .ap-act--save { flex: 1; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text);
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px; gap: 7px; }

.ap-share { margin-top: 12px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 5px 5px 5px 13px; }
.ap-share__url { flex: 1; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-share__copy { flex: none; height: 36px; padding: 0 13px; border-radius: 9px; border: none; background: var(--fg); color: var(--bg);
  font-weight: 700; font-size: 12.5px; font-family: var(--font-display); cursor: pointer; display: flex; align-items: center; gap: 6px; }

.ap-qr { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: flex; align-items: center; gap: 16px; }
.ap-qr[hidden] { display: none; }
.ap-qr__img { flex: none; background: #fff; padding: 8px; border-radius: 10px; }
.ap-qr__t { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.ap-qr__d { font-size: 12px; color: var(--muted); margin: 5px 0 10px; line-height: 1.4; }

/* sekcja przewoźnika + oś czasu */
.ap-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 16px 8px; margin-top: 14px; }
.ap-block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.ap-block__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ap-block__count { font-size: 11.5px; color: var(--muted); }
.ap-block__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* przełącznik kolejności osi czasu (od najstarszego / od najnowszego), stan wspólny dla wszystkich sekcji */
.ap-sortbtn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px; line-height: 1.2; white-space: nowrap; }
.ap-sortbtn:hover { border-color: var(--field-line); color: var(--fg); }
.ap-sortbtn svg { flex: none; }
.ap-timeline { position: relative; }
.ap-tl { display: flex; gap: 13px; position: relative; padding-bottom: 18px; }
.ap-tl__rail { flex: none; display: flex; flex-direction: column; align-items: center; }
.ap-tl__node { width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; z-index: 1; border: 2px solid transparent; background: var(--surface-2); color: var(--muted); }
.ap-tl__node--current { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ap-tl__line { flex: 1; width: 2px; background: var(--line); margin: 4px 0; border-radius: 2px; min-height: 8px; }
.ap-tl:last-child .ap-tl__line { display: none; }
.ap-tl__body { flex: 1; padding-top: 2px; min-width: 0; }
.ap-tl__phase { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; }
.ap-tl__when { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 8px; }
/* data + lokalizacja zdarzenia w jednym wierszu; na wąskim ekranie lokalizacja schodzi niżej */
.ap-tl__head { display: flex; flex-wrap: wrap; align-items: center; row-gap: 2px; }
.ap-tl__loc { display: inline-flex; align-items: flex-start; gap: 4px; margin-left: 8px; max-width: calc(100% - 8px); font-size: 11.5px; line-height: 1.4; font-weight: 600; color: var(--fg); overflow-wrap: break-word; }
.ap-tl__loc svg { flex: none; margin-top: 2px; }
.ap-tl__text { font-size: 12.5px; color: var(--muted); line-height: 1.48; margin-top: 3px; }
.ap-tl__text a { color: var(--info); }
/* link-przycisk pod tekstem statusu (np. "sprawdź dalej u przewoźnika"); selektor 2-klasowy wygrywa z .ap-tl__text a */
.ap-tl .ap-tl__next { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 28px; padding: 5px 11px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; line-height: 1.2; }
.ap-tl .ap-tl__next:hover { border-color: var(--field-line); color: var(--accent-text); }

/* wiele wyników na jednej stronie: odstęp + separator między kartami przesyłek */
.ap-rcard + .ap-rcard { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--field-line); }

/* tabela info */
.ap-infobox { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; }
.ap-infobox__title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; font-family: var(--font-display); margin-bottom: 6px; }
.ap-infobox__list { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.ap-infobox__list strong { color: var(--fg); font-weight: 600; }

/* cross-sell */
.ap-cross { display: flex; flex-direction: column; gap: 9px; }
.ap-cross a { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px; cursor: pointer; text-decoration: none; color: inherit; }
.ap-cross a:hover { border-color: var(--field-line); }

/* stany: skeleton / empty / error */
.ap-skel { background: var(--skeleton); background-size: 720px 100%; animation: apShimmer 1.3s infinite linear; border-radius: 6px; }
.ap-loading-dots { display: inline-flex; gap: 4px; }
.ap-loading-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: apDot 1.2s infinite; }
.ap-loading-dots span:nth-child(2) { animation-delay: .2s; }
.ap-loading-dots span:nth-child(3) { animation-delay: .4s; }
.ap-loading-row { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 16px; }
.ap-state { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 6px; }
.ap-state__ic { width: 62px; height: 62px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.ap-state__ic--empty { background: var(--accent-soft); color: var(--accent); }
.ap-state__ic--error { background: var(--warn-soft); color: var(--warn); }
.ap-state__t { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.ap-state__d { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 8px 0 0; max-width: 280px; }

/* ---------- statystyki ---------- */
.ap-stats { padding: 18px 0 30px; }
.ap-tabs { display: flex; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.ap-tab { flex: 1; height: 38px; border: none; border-radius: 9px; background: transparent; color: var(--muted);
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.ap-tab--active { background: var(--surface); color: var(--accent-text); box-shadow: 0 2px 6px -3px var(--shadow); }
.ap-statscard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.ap-statscard__title { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.ap-statscard__desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 6px 0 16px; }
.ap-bars { display: flex; flex-direction: column; gap: 13px; }
.ap-bar__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.ap-bar__label { font-size: 12.5px; font-weight: 600; }
.ap-bar__val { font-size: 12.5px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ap-bar__track { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.ap-bar__fill { height: 100%; border-radius: 6px; }
.ap-statsfoot { margin-top: 14px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ---------- about / discover / contact ---------- */
.ap-cards { display: flex; flex-direction: column; gap: 12px; }
.ap-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.ap-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ap-card__ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ap-card__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.ap-card p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.ap-contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.ap-contact-card .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.ap-contact-card .mail { display: block; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--accent-text); text-decoration: none; margin-top: 4px; }
.ap-contact-social { display: flex; gap: 10px; margin-top: 18px; }
.ap-contact-social a { flex: 1; height: 48px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--fg); font-weight: 600; font-size: 13.5px; }

/* formularz kontaktu */
.ap-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.ap-form label { font-size: 13px; font-weight: 600; }
.ap-form input[type=email], .ap-form input[type=text], .ap-form textarea { width: 100%; border: 1.5px solid var(--field-line); background: var(--surface-2); border-radius: var(--r-md);
  padding: 12px 14px; font-family: var(--font-body); font-size: 15px; color: var(--fg); }
.ap-form input:focus, .ap-form textarea:focus { outline: none; border-color: var(--accent); }
.ap-form textarea { min-height: 130px; resize: vertical; }
.ap-note { font-size: 12.5px; color: var(--muted); }
.ap-alert { border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; }
.ap-alert--ok { background: var(--ok-soft); color: var(--ok); }
.ap-alert--err { background: var(--warn-soft); color: var(--warn); }

/* ---------- stopka ---------- */
.ap-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.ap-footer__inner { padding: 28px 0; display: flex; flex-direction: column; gap: 14px; }
.ap-footer__brand { display: flex; align-items: center; gap: 10px; }
.ap-footer__tag { font-size: 13px; color: var(--muted); line-height: 1.5; }
.ap-footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
/* cel dotykowy >= 24 px wysokości (WCAG 2.2, 2.5.8) */
.ap-footer__links a { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 0; font-size: 13px; color: var(--muted); text-decoration: none; }
.ap-footer__links a:hover { color: var(--accent-text); }
.ap-footer__copy { font-size: 12px; color: var(--muted); }
.ap-footer .ap-ad { margin-top: 0; }

/* ---------- DESKTOP (≥1024px) ---------- */
@media (min-width: 1024px) {
  .ap-wrap { padding: 0 24px; }
  .ap-main { padding-bottom: 0; }
  .ap-theme { display: flex; }
  .ap-bottomnav { display: none; }
  .ap-toast { bottom: 28px; }
  .ap-h1 { font-size: 38px; }
  .ap-lead { font-size: 17px; }
  .ap-hero { padding: 40px 0 12px; text-align: left; }
  .ap-grid2 { grid-template-columns: repeat(4, 1fr); }
  .ap-result .ap-grid2, .ap-discover-grid { grid-template-columns: repeat(3, 1fr); }
  .ap-col { max-width: 760px; }
  .ap-col--wide { max-width: 980px; }
  /* sheet zapisanych jako centralny modal na desktopie */
  .ap-overlay--bottom { align-items: center; justify-content: center; }
  .ap-overlay--bottom .ap-sheet { max-width: 460px; border-radius: 20px; max-height: 80vh; }
  .ap-overlay--bottom .ap-sheet--dialog { max-width: 420px; }
  .ap-overlay--bottom .ap-sheet__handle { display: none; }
}

/* Pełne poziome menu dopiero od 1280px - w zakresie 1024-1279px sześć pozycji menu (PL/UK)
   + przełącznik języka nie mieści się bez nachodzenia, więc zostaje hamburger + drawer.
   Kompaktowy pasek (audyt 2026-10, P1 #13): .ap-wrap ma max-width 1180px, więc od ok. 1228px
   pasek ma STAŁE ~1132px treści - przy 1280px i 1920px jest tyle samo miejsca. Dlatego skrócenia
   obowiązują dla całego zakresu >= 1280px (nie tylko 1280-1439): przełącznik motywu jako sama ikona
   (etykieta ukryta wizualnie, nazwa z aria-label/title), ciaśniejsze odstępy menu. Zapas ok. 150px
   względem pomiaru UK (dokument 1294px przy 1280px). */
@media (min-width: 1280px) {
  .ap-nav { display: flex; gap: 2px; }
  .ap-hamburger { display: none; }
  .ap-overlay--right .ap-sheet--right { display: none; } /* drawer niepotrzebny przy pełnym menu */
  .ap-appbar__inner { gap: 10px; }
  .ap-nav__link { padding: 8px 8px; gap: 4px; font-size: 14px; }
  .ap-theme { position: relative; width: 38px; height: 38px; padding: 0; gap: 0; justify-content: center; flex: none; }
  .ap-theme [data-ap-theme-label] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .ap-appbar .ap-langsw__item { padding: 5px 8px; } /* 2 klasy: bazowa reguła .ap-langsw__item stoi niżej w pliku */
}

/* Tablet: 6 kart "Warto zajrzeć" w 3 kolumnach; 4 narzędzia zostają 2x2 (desktop: 4 w rzędzie).
   Wcześniej ta reguła stała po bloku desktopowym i nadpisywała 4 kolumny trzema (karta-sierota). */
@media (min-width: 600px) and (max-width: 1023px) {
  .ap-discover-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile: odstęp, by stały dolny pasek (i podniesiony przycisk "Zapisane") nie zasłaniał stopki */
@media (max-width: 1023px) {
  .ap-footer__inner { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* przełącznik języka (pill w app-barze na desktop + wiersz w mobilnym drawerze) */
.ap-langsw { display: none; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.ap-langsw__item { display: inline-block; padding: 5px 10px; border-radius: 999px; font-family: var(--font-body); font-size: 12px; font-weight: 700; line-height: 1; color: var(--muted); text-decoration: none; }
.ap-langsw__item:hover { color: var(--fg); }
.ap-langsw__item.is-active { background: var(--accent-soft); color: var(--accent-text); }
.ap-langsw--sheet { display: inline-flex; margin: 14px 12px 6px; }
@media (min-width: 1024px) {
  .ap-langsw { display: inline-flex; }
}

/* Pływająca tarcza opcji prywatności Google CMP (ft-floating-toolbar) - dodawana automatycznie,
   bez wyłącznika w panelu AdSense. Ukryta decyzją właściciela (2026-07-12); wymóg TCF
   (stały dostęp do zmiany zgody) spełnia link "Ustawienia prywatności" w stopce. */
#ft-floating-toolbar, .ft-menu, [class*="ft-floating"] { display: none !important; }

/* Pasek powitalny "nowa AliPaczka" (partials/header.php + app.js, do AP_NEW_UNTIL) */
.ap-welcome-wrap:has(> .ap-welcome[hidden]) { display: none; }
.ap-welcome { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 12px 12px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid var(--line); color: var(--fg); }
.ap-welcome[hidden] { display: none; }
.ap-welcome__ic { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.ap-welcome__txt { flex: 1; margin: 0; font-size: 14px; line-height: 1.45; }
.ap-welcome__txt strong { margin-right: 4px; }
.ap-welcome__btn { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--accent-text); border-radius: 999px;
  padding: 8px 14px; font-family: var(--font-body); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ap-welcome__btn:hover { border-color: var(--accent); }
.ap-welcome__btn[hidden] { display: none; }
.ap-welcome__close { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ap-welcome__close:hover { background: var(--surface); color: var(--fg); }
@media (max-width: 599px) {
  .ap-welcome { flex-wrap: wrap; align-items: flex-start; }
  .ap-welcome__txt { flex-basis: calc(100% - 96px); }
  .ap-welcome__btn { order: 3; margin-left: 44px; }
}
