/* ============================================================
   PRZEBIEG OBCHODU (WASM/PWA) — moduł wyłącznie mobilny.
   Neumorfizm spójny z aplikacją (#e0e5ec, --text-main).
   ============================================================ */
.pr-shell {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pr-center {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    color: #6c7293;
}

/* Ikona i tytuł zawsze idealnie wyśrodkowane (odporne na globalne reguły h1). */
.pr-center .pr-summary-icon { align-self: center; }
.pr-done-title { width: 100%; text-align: center; }

.pr-spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 6px solid #cfd4df;
    border-top-color: #4a90e2;
    animation: pr-spin 0.9s linear infinite;
}

.pr-spinner-lg { width: 84px; height: 84px; border-width: 7px; }

@keyframes pr-spin { to { transform: rotate(360deg); } }

/* ---------- Ekran ładowania danych ---------- */
.pr-loader {
    position: fixed;
    inset: 0;
    background: #e0e5ec;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 30px;
}

.pr-loader-logo {
    width: min(240px, 70vw);
    margin-bottom: 6px;
}

.pr-loader-text {
    color: #6c7293;
    font-size: 1.15rem;
    font-weight: 700;
}

/* ---------- Hero nagłówek ekranu wyboru ---------- */
.pr-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 8px 6px 4px;
    flex-shrink: 0;
}

.pr-hero-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e5ec;
    color: #4a90e2;
    box-shadow: 7px 7px 16px #c4c9d4, -7px -7px 16px #ffffff;
}

.pr-hero-title { margin: 4px 0 0; font-size: 1.5rem; font-weight: 800; color: #3d4468; }
.pr-hero-sub { margin: 0; font-size: 0.86rem; color: #9499b7; max-width: 320px; }

/* ---------- Kafelki pracowników (siatka 2 kol.) ----------
   Padding kontenera ≥ rozmiar cienia, inaczej overflow:auto ścina miękki cień
   (prosty róg w lewym górnym). */
.pr-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
}

.pr-tile {
    min-width: 0;
    aspect-ratio: 1 / 1;
    border: none;
    cursor: pointer;
    background: #e0e5ec;
    border-radius: 22px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    box-shadow: 5px 5px 12px #cdd2dd, -5px -5px 12px #f7fafe;
    transition: box-shadow 0.12s ease, transform 0.06s ease;
}

/* Avatar zawsze na górze (nie kurczy się), żeby ikona startowała z tej samej wysokości
   niezależnie od długości imienia/stanowiska. */
.pr-tile-avatar { flex-shrink: 0; }

/* Rezerwujemy stałą wysokość bloku tekstu (imię do 2 linii, stanowisko 1 linia z wielokropkiem),
   dzięki czemu kafelki mają jednakową wysokość, a ikony są wyrównane. */

.pr-tile:active { transform: scale(0.98); box-shadow: inset 5px 5px 11px #c8cdd8, inset -5px -5px 11px #f7fafe; }

.pr-tile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eef1f7, #d3d8e2);
    color: #ff9f43;
    box-shadow: inset 4px 4px 8px #c4c9d4, inset -4px -4px 8px #ffffff;
}

.pr-avatar-lg { width: 80px; height: 80px; color: #4a90e2; box-shadow: 6px 6px 14px #c4c9d4, -6px -6px 14px #ffffff; background: #e0e5ec; }

/* Imię i nazwisko zawsze w dwóch wierszach (każdy span = 1 linia, min-height rezerwuje pustą),
   dzięki czemu wszystkie kafelki mają jednakową wysokość. */
.pr-tile-title {
    font-weight: 800;
    color: #3d4468;
    font-size: 0.9rem;
    line-height: 1.22;
    display: flex;
    flex-direction: column;
}

.pr-tile-title span {
    display: block;
    min-height: 1.22em;
}

.pr-tile-role {
    width: 100%;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #d97706;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Modal PIN ---------- */
.pr-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(60, 68, 104, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.pr-modal {
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
    background: #e0e5ec;
    border-radius: 26px;
    padding: 26px 22px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 14px 14px 32px #bcc1cd, -14px -14px 32px #ffffff;
    animation: pr-modal-in 0.18s ease-out;
}

@keyframes pr-modal-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.pr-modal-avatar {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eef1f7, #d3d8e2);
    color: #ff9f43;
    box-shadow: 6px 6px 14px #c4c9d4, -6px -6px 14px #ffffff;
    margin-bottom: 14px;
}

.pr-modal-title { margin: 0; font-size: 1.3rem; font-weight: 800; color: #3d4468; }
.pr-modal-sub {
    margin: 4px 0 18px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #d97706;
}

.pr-modal-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.pr-modal-actions .pr-btn { padding: 15px; font-size: 1rem; }

/* Akcje ułożone pionowo (każdy przycisk w osobnym wierszu) — modal usterki. */
.pr-modal-actions-stacked { flex-direction: column; gap: 14px; }
.pr-modal-actions-stacked .pr-btn { width: 100%; }

/* ---------- Kafelki obchodów (pełna szerokość) ---------- */
.pr-route-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

.pr-route-tile {
    position: relative;
    border: none;
    cursor: pointer;
    width: 100%;
    background: #e0e5ec;
    border-radius: 22px;
    padding: 24px 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    box-shadow: 5px 5px 12px #cdd2dd, -5px -5px 12px #f7fafe;
    transition: box-shadow 0.12s ease, transform 0.06s ease;
}

.pr-route-tile:active { transform: scale(0.99); box-shadow: inset 5px 5px 11px #c8cdd8, inset -5px -5px 11px #f7fafe; }

/* Zaznaczona trasa — wciśnięty (inset) wygląd + fioletowy akcent z lewej (inset, więc owalny róg). */
.pr-route-tile-selected {
    box-shadow: inset 5px 0 0 0 #9b59b6, inset 6px 6px 12px #c8cdd8, inset -5px -5px 12px #f7fafe;
}

.pr-route-tile-selected:active { transform: none; }

/* Rząd przycisków (Anuluj | Rozpocznij) */
.pr-actions-row { flex-direction: row; }
.pr-actions-row .pr-btn { flex: 1 1 0; }

/* Zwykły czerwony komunikat błędu (bez wklęsłego kafelka). */
.pr-text-error {
    color: #ff3b5c;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Dwie linie w modalu potwierdzenia (bez wklęsłego kafelka). */
.pr-confirm-lines {
    margin: 12px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.pr-confirm-label { color: #6c7293; font-weight: 700; }
.pr-confirm-emp { font-weight: 800; color: #ff9f43; }
.pr-confirm-route { font-weight: 800; color: #9b59b6; }

/* Ikona obchodu u góry (jak avatar pracownika). */
.pr-route-iconwrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eef1f7, #d3d8e2);
    color: #9b59b6;
    box-shadow: inset 4px 4px 8px #c4c9d4, inset -4px -4px 8px #ffffff;
}

/* Pełna nazwa obchodu — kolor i czcionka jak dotąd. */
.pr-route-name { font-weight: 800; color: #3d4468; font-size: 1.05rem; line-height: 1.3; }

/* Budynki po przecinku — czcionka jak nazwa, kolor jak ikona obchodu (fioletowy). */
.pr-route-buildings { font-weight: 800; color: #9b59b6; font-size: 1.05rem; line-height: 1.3; }

/* Liczba punktów w prawym górnym rogu kafelka. */
.pr-route-points {
    position: absolute;
    top: 14px;
    right: 16px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #4a90e2;
}

.pr-route-points span { font-size: 0.7rem; color: #9499b7; font-weight: 700; }

/* ---------- Nagłówek ---------- */
.pr-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.pr-back {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #e0e5ec;
    color: #6c7293;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 9px #c4c9d4, -4px -4px 9px #ffffff;
}

.pr-back:active { box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff; }

.pr-title { margin: 0; font-size: 1.35rem; font-weight: 800; color: #3d4468; }
.pr-subtitle { margin: 2px 0 0; font-size: 0.85rem; color: #9499b7; }

/* ---------- Karty / pola ---------- */
.pr-card {
    background: #e0e5ec;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 6px 6px 14px #c4c9d4, -6px -6px 14px #ffffff;
}

.pr-field { margin-bottom: 16px; }
.pr-field:last-child { margin-bottom: 0; }

.pr-label {
    display: block;
    color: #6c7293;
    font-weight: 700;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.pr-select, .pr-input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    border-radius: 14px;
    background: #e0e5ec;
    color: var(--text-main);
    font-size: 16px;
    padding: 14px 16px;
    box-shadow: inset 4px 4px 9px #c4c9d4, inset -4px -4px 9px #ffffff;
}

/* Bez natywnego obrysu/strzałki — własna strzałka, neumorficzny wygląd. */
.pr-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239499b7' stroke-width='2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
}

.pr-input::placeholder { color: #a7adc4; }

.pr-pin {
    text-align: center;
    letter-spacing: 10px;
    font-weight: 800;
    font-size: 1.3rem;
    /* Pole jest type="text" (żeby Chrome nie proponował haseł), więc kropki robimy tu — cyfry
       PIN-u są maskowane wizualnie tak samo jak w polu password. */
    -webkit-text-security: disc;
    text-security: disc;
}

.pr-error { margin-top: 8px; color: #ff3b5c; font-size: 0.8rem; font-weight: 600; }

/* ---------- Duże przyciski ---------- */
.pr-btn {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 18px;
    padding: 18px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    background: #e0e5ec;
    color: #4a90e2;
    box-shadow: 6px 6px 14px #c4c9d4, -6px -6px 14px #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: box-shadow 0.12s ease, transform 0.05s ease;
}

.pr-btn:active { box-shadow: inset 4px 4px 9px #c4c9d4, inset -4px -4px 9px #ffffff; }
.pr-btn:disabled { opacity: 0.55; }

.pr-btn-primary { background: #4a90e2; color: #fff; box-shadow: 6px 6px 14px #bec3cf; }
.pr-btn-success { background: #1f9d6b; color: #fff; box-shadow: 6px 6px 14px #bec3cf; }
.pr-btn-danger { background: #ff3b5c; color: #fff; box-shadow: 6px 6px 14px #bec3cf; }
.pr-btn-scan { background: #4a90e2; color: #fff; padding: 26px; font-size: 1.25rem; box-shadow: 8px 8px 18px #bec3cf; }

.pr-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; flex-shrink: 0; }

/* ---------- Pasek postępu ---------- */
.pr-progress-wrap {
    background: #e0e5ec;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: inset 4px 4px 9px #c4c9d4, inset -4px -4px 9px #ffffff;
}

.pr-progress-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pr-progress-count { font-weight: 800; font-size: 1.35rem; color: #3d4468; }
.pr-progress-count span { color: #1f9d6b; }
.pr-progress-label { font-size: 0.82rem; color: #9499b7; font-weight: 600; }

.pr-progress-track {
    height: 12px;
    border-radius: 8px;
    background: #d3d8e2;
    box-shadow: inset 2px 2px 4px #c4c9d4, inset -2px -2px 4px #ffffff;
    overflow: hidden;
}

.pr-progress-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #1f9d6b, #2fbf4a);
    transition: width 0.3s ease;
}

/* ---------- Lista punktów ---------- */
/* Nowy pasek postępu (bez kafelka): etykieta po prawej + cienki pasek pod spodem. */
.pr-prog { flex-shrink: 0; padding: 0 4px; }

.pr-prog-label { text-align: right; font-size: 0.85rem; color: #9499b7; font-weight: 600; margin-bottom: 8px; }
.pr-prog-label b { color: #1f9d6b; font-weight: 800; font-size: 1rem; }

.pr-prog-track {
    height: 10px;
    border-radius: 6px;
    background: #d3d8e2;
    box-shadow: inset 2px 2px 4px #c4c9d4, inset -2px -2px 4px #ffffff;
    overflow: hidden;
}

.pr-prog-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #1f9d6b, #2fbf4a);
    transition: width 0.3s ease;
}

/* Padding ≥ rozmiar cienia kart, inaczej overflow:auto ścina cień (prosty róg). */
.pr-points {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.pr-point {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #e0e5ec;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 4px 4px 9px #cdd2dd, -4px -4px 9px #f7fafe;
}

.pr-point-done { box-shadow: inset 4px 4px 9px #c4c9d4, inset -4px -4px 9px #ffffff; }

.pr-point-mark {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e5ec;
    color: #b6bccf;
    box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff;
}

.pr-point-done .pr-point-mark { background: #1f9d6b; color: #fff; box-shadow: 3px 3px 6px #bec3cf; }

.pr-point-info { flex: 1 1 auto; min-width: 0; }
.pr-point-name { font-weight: 700; color: var(--text-main); font-size: 0.98rem; }
.pr-point-meta { font-size: 0.78rem; margin-top: 2px; }
.pr-point-building { color: #00a884; font-weight: 700; }
.pr-point-dot { color: #c4c9d4; margin: 0 6px; }
.pr-point-loc { color: #d97706; font-weight: 700; }
.pr-point-time { font-size: 0.74rem; color: #9499b7; margin-top: 3px; }

/* Prawa strona kafelka punktu: „Ręcznie"/„✔" + czerwona pinezka. */
.pr-point-side { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

.pr-point-check {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f9d6b;
    color: #fff;
    box-shadow: 3px 3px 6px #bec3cf;
}

.pr-point-pin {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e5ec;
    color: #ff3b5c;
    box-shadow: 3px 3px 6px #c4c9d4, -3px -3px 6px #ffffff;
}

.pr-point-pin:active { box-shadow: inset 2px 2px 5px #c4c9d4, inset -2px -2px 5px #ffffff; }

.pr-point-manual {
    flex-shrink: 0;
    border: none;
    background: #e0e5ec;
    color: #4a90e2;
    font-weight: 700;
    font-size: 0.74rem;
    padding: 9px 11px;
    border-radius: 12px;
    box-shadow: 3px 3px 6px #c4c9d4, -3px -3px 6px #ffffff;
}

.pr-point-manual:active { box-shadow: inset 2px 2px 5px #c4c9d4, inset -2px -2px 5px #ffffff; }

/* ---------- Pasek statusu (sieć / feedback skanu) ---------- */
.pr-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    font-weight: 600;
}

.pr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 3px 3px 6px #c4c9d4, -3px -3px 6px #ffffff;
}

.pr-chip-online { color: #1f9d6b; }
.pr-chip-offline { color: #d97706; }

.pr-flash {
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
}

.pr-flash-ok { color: #1f9d6b; box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff; }
.pr-flash-warn { color: #d97706; box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff; }
.pr-flash-err { color: #ff3b5c; box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff; }

/* ---------- Podsumowanie ---------- */
.pr-summary-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e5ec;
    box-shadow: 8px 8px 18px #bec3cf, -8px -8px 18px #ffffff;
}

.pr-summary-icon-ok { color: #1f9d6b; }
.pr-summary-icon-warn { color: #d97706; }

/* ---------- Toast: duży komunikat na środku ekranu po skanie ---------- */
.pr-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1200;
    width: 80vw;
    max-width: 360px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    font-weight: 800;
    padding: 40px 30px;
    border-radius: 28px;
    background: #e0e5ec;
    box-shadow: 16px 16px 36px #bcc1cd, -16px -16px 36px #ffffff;
    animation: pr-toast-in 0.16s ease-out;
    pointer-events: none;
}

@keyframes pr-toast-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.pr-toast-icon {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e5ec;
    box-shadow: 8px 8px 18px #bec3cf, -8px -8px 18px #ffffff;
}

.pr-toast-msg { font-size: 1.25rem; line-height: 1.3; }

.pr-toast-ok { color: #1f9d6b; }
.pr-toast-warn { color: #d97706; }
.pr-toast-err { color: #ff3b5c; }

/* ---------- Animacja zakończenia obchodu (przejście do podsumowania) ---------- */
.pr-complete {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    background: radial-gradient(circle at 50% 42%, #eef1f7 0%, #e0e5ec 62%);
    animation: pr-complete-in 0.4s ease both;
}

/* Faza wyjścia — overlay znika, odsłaniając gotowy ekran podsumowania pod spodem. */
.pr-complete-hide {
    animation: pr-complete-out 0.45s ease both;
    pointer-events: none;
}

@keyframes pr-complete-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pr-complete-out {
    from { opacity: 1; }
    to { opacity: 0; transform: scale(1.04); }
}

.pr-complete-badge {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0e5ec;
    box-shadow: 10px 10px 22px #bec3cf, -10px -10px 22px #ffffff;
}

/* Rozchodzące się pierścienie „pulsu" wokół odznaki. */
.pr-complete-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(31, 157, 107, 0.45);
    animation: pr-complete-ring 1.9s ease-out infinite;
}

.pr-complete-ring2 { animation-delay: 0.6s; }

@keyframes pr-complete-ring {
    0% { transform: scale(0.7); opacity: 0.85; }
    100% { transform: scale(1.55); opacity: 0; }
}

.pr-complete-svg { position: relative; z-index: 1; }

.pr-complete-circle {
    fill: none;
    stroke: #1f9d6b;
    stroke-width: 2.5;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: pr-complete-draw 0.6s ease-out 0.1s forwards;
}

.pr-complete-tick {
    stroke: #1f9d6b;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: pr-complete-draw 0.4s ease-out 0.55s forwards;
}

@keyframes pr-complete-draw {
    to { stroke-dashoffset: 0; }
}

.pr-complete-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #3d4468;
    letter-spacing: 0.3px;
    opacity: 0;
    animation: pr-complete-text 0.5s ease 0.85s both;
}

.pr-complete-sub {
    font-size: 0.95rem;
    font-weight: 600;
    color: #6c7293;
    opacity: 0;
    animation: pr-complete-text 0.5s ease 1.05s both;
}

@keyframes pr-complete-text {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pr-complete,
    .pr-complete-hide,
    .pr-complete-ring,
    .pr-complete-circle,
    .pr-complete-tick,
    .pr-complete-title,
    .pr-complete-sub {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
    }
}

/* ---------- Mapa pinezki w modalu ---------- */
.pr-map {
    position: relative;
    width: 100%;
    max-height: 56vh;
    overflow: auto;
    border-radius: 14px;
    background: #fff;
    box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff;
    margin: 6px 0 2px;
    -webkit-overflow-scrolling: touch;
}

.pr-map img { display: block; width: 100%; height: auto; }

.pr-map-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.pr-map-empty {
    width: 100%;
    text-align: center;
    color: #9499b7;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 18px 6px;
    margin: 4px 0;
}

/* ---------- Statystyki na ekranie zakończenia ---------- */
.pr-stats {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    margin: 6px 0 4px;
}

.pr-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 2px;
}

.pr-stat-row span { font-size: 0.82rem; color: #9499b7; font-weight: 700; flex-shrink: 0; }
.pr-stat-row b { color: #3d4468; font-size: 0.92rem; text-align: right; }
.pr-stat-row b.pr-confirm-emp { color: #ff9f43; }
.pr-stat-row b.pr-confirm-route { color: #9b59b6; }

/* ---------- Usterka ---------- */
.pr-btn-fault { background: #ff9f43; color: #ffffff; box-shadow: 6px 6px 14px #bec3cf; }

.pr-fault-card { max-width: 480px; max-height: 92vh; }

.pr-fault-sub { margin: 4px 0 16px; }

/* Padding ≥ rozmiar cienia przycisków, inaczej overflow:auto ścina cień (prosty róg). */
.pr-fault-body {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
    padding: 14px;
}

.pr-fault-body .pr-field { width: 100%; }

/* Dwa pola w jednym wierszu (budynek+lokalizacja, zdjęcie+plan). */
.pr-row { display: flex; gap: 12px; align-items: stretch; }
.pr-row .pr-field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }

/* Wiersz zdjęcie/plan jako SIATKA: etykiety w 1. wierszu, przyciski w 2.
   Grid wymusza wspólną wysokość wierszy, więc i etykiety, i przyciski są na tej samej linii. */
.pr-media {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 12px;
    align-items: start;
}

.pr-media-2 { grid-template-columns: 1fr 1fr; }
.pr-media .pr-label { margin-bottom: 0; }

/* Wiersz zdjęcie/plan: etykiety dwuliniowe (tekst + „(opcjonalnie)" w 2. wierszu) — równa
   wysokość obu etykiet, więc przyciski „Zdjęcie" i „Zaznacz" są dokładnie na tej samej wysokości. */
.pr-label-2 { display: flex; flex-direction: column; line-height: 1.3; }
.pr-label-2 > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-label-opt { font-weight: 600; color: #a7adc4; }

.pr-fault-err { text-align: left; margin-top: 6px; }

/* Czerwone podświetlenie niewypełnionego pola obowiązkowego. */
.pr-invalid { outline: 2px solid #ff3b5c; outline-offset: -2px; }

/* Przyciski w wierszu (zdjęcie / plan) — DOKŁADNIE jednakowe: ta sama wysokość, wyrównane
   do dołu pola (gdy etykieta zawija się do 2 linii), tekst w jednej linii i wyśrodkowany. */
.pr-photo-btn, .pr-fault-mapbtn {
    margin-top: auto;
    height: 54px;
    padding: 0 12px;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 4px 4px 9px #cdd2dd, -4px -4px 9px #f7fafe;
}

.pr-fault-mapbtn { font-size: 1rem; }
.pr-fault-mapbtn:active { box-shadow: inset 3px 3px 6px #c8cdd8, inset -3px -3px 6px #f7fafe; }

.pr-photo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px;
    font-weight: 700;
    color: #4a90e2;
    background: #e0e5ec;
    box-shadow: 4px 4px 9px #c4c9d4, -4px -4px 9px #ffffff;
}

.pr-photo-btn:active { box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff; }

.pr-fault-photo-wrap { position: relative; width: 100%; }

.pr-fault-photo {
    width: 100%;
    border-radius: 14px;
    display: block;
    box-shadow: inset 3px 3px 6px #c4c9d4, inset -3px -3px 6px #ffffff;
}

.pr-fault-photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #ff3b5c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 7px rgba(0,0,0,0.3);
}
.pr-textarea {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 14px;
    background: #e0e5ec;
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    padding: 14px 16px;
    min-height: 90px;
    resize: vertical;
    box-shadow: inset 4px 4px 9px #c4c9d4, inset -4px -4px 9px #ffffff;
}
