/* ============================================================================
   MSDL SERWIS — aplikacja mobilna konserwatorów (/msdl)
   Odrębna powłoka, mobile-first (telefon przypięty do ekranu początkowego).
   Wszystko zawężone do .mob — strona publiczna i panel NIETKNIĘTE.
   ========================================================================== */

.mob {
  /* tokeny */
  --m-bg: #0a0f14;
  --m-bg2: #0d141b;
  --m-card: #121a23;
  --m-card2: #17212c;
  --m-line: rgba(255, 255, 255, .09);
  --m-line2: rgba(255, 255, 255, .16);
  --m-text: #eef4f7;
  --m-muted: #8da0ac;
  --m-brand: #1fd3e0;
  --m-brand-deep: #0d7d82;
  --m-ok: #3fb27f;
  --m-warn: #e0a92b;
  --m-bad: #e35d6a;

  min-height: 100dvh;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(13, 125, 130, .22), transparent 60%),
    var(--m-bg);
  color: var(--m-text);
  font-family: "Segoe UI", system-ui, -apple-system, "Roboto", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mob *, .mob *::before, .mob *::after { box-sizing: border-box; }
.mob a { color: inherit; text-decoration: none; }
.mob img { display: block; max-width: 100%; }
.mob h1, .mob h2, .mob h3, .mob p { margin: 0; }

/* Treść wycentrowana — na tablecie nie rozjeżdża się na całą szerokość */
.mob-wrap {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 0 16px 28px;
}

/* ---------- Górna belka (podstrony) ---------- */
.mob-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0)) 12px 10px;
  background: rgba(10, 15, 20, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--m-line);
}
.mob-top__back {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--m-line);
  background: var(--m-card);
  color: var(--m-text);
}
.mob-top__back:active { background: var(--m-card2); }
.mob-top__back svg { width: 20px; height: 20px; }
.mob-top__title { flex: 1 1 auto; min-width: 0; }
.mob-top__title strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-top__title span {
  display: block;
  font-size: .72rem;
  color: var(--m-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.mob-top__logo { flex: 0 0 auto; height: 24px; width: auto; opacity: .92; }

/* ---------- Ekran główny ---------- */
.mob-hero {
  padding: calc(22px + env(safe-area-inset-top, 0)) 0 6px;
  text-align: center;
}
.mob-hero__logo { height: 54px; width: auto; margin: 0 auto 10px; }
.mob-hero__app {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--m-brand);
}
.mob-hero__sub { font-size: .82rem; color: var(--m-muted); margin-top: 2px; }

.mob-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  padding: 12px 14px;
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 16px;
}
.mob-user__ava {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1rem;
  color: #06282b;
  background: linear-gradient(135deg, var(--m-brand), var(--m-brand-deep));
}
.mob-user__txt { flex: 1 1 auto; min-width: 0; }
.mob-user__txt strong {
  display: block;
  font-size: .98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-user__txt span { display: block; font-size: .78rem; color: var(--m-muted); }
.mob-user__out {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--m-line);
  background: transparent;
  color: var(--m-muted);
  cursor: pointer;
}
.mob-user__out svg { width: 19px; height: 19px; }
.mob-user__out:active { color: var(--m-bad); border-color: rgba(227, 93, 106, .5); }

/* Kafelki menu głównego */
.mob-tiles { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.mob-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  min-height: 92px;
  background: linear-gradient(180deg, var(--m-card2), var(--m-card));
  border: 1px solid var(--m-line);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  transition: transform .08s ease;
}
.mob-tile:active { transform: scale(.985); }
.mob-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--m-brand), var(--m-brand-deep));
  opacity: .85;
}
.mob-tile__ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(31, 211, 224, .1);
  border: 1px solid rgba(31, 211, 224, .25);
  color: var(--m-brand);
}
.mob-tile__ic svg { width: 28px; height: 28px; }
.mob-tile__txt { flex: 1 1 auto; min-width: 0; }
.mob-tile__txt strong { display: block; font-size: 1.12rem; font-weight: 750; }
.mob-tile__txt span { display: block; font-size: .82rem; color: var(--m-muted); margin-top: 2px; }
.mob-tile__chev { flex: 0 0 auto; color: var(--m-muted); }
.mob-tile__chev svg { width: 20px; height: 20px; }
.mob-tile__badge {
  flex: 0 0 auto;
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
  color: #2b2105;
  background: linear-gradient(135deg, #ffd66b, var(--m-warn));
}
.mob-tile--soon { opacity: .55; }
.mob-tile--soon .mob-tile__ic { color: var(--m-muted); background: rgba(255, 255, 255, .05); border-color: var(--m-line); }
.mob-tile--soon::before { background: var(--m-muted); opacity: .4; }
.mob-soon {
  flex: 0 0 auto;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--m-muted);
  border: 1px solid var(--m-line2);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ---------- Sekcje / nagłówki list ---------- */
.mob-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--m-muted);
}
.mob-section::before { content: ""; width: 18px; height: 2px; background: var(--m-brand); border-radius: 2px; }

/* ---------- Karty list (zadania / zalecenia) ---------- */
.mob-list { display: flex; flex-direction: column; gap: 10px; }
.mob-card {
  display: block;
  padding: 14px 14px 12px;
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 16px;
  position: relative;
  transition: transform .08s ease;
}
a.mob-card:active { transform: scale(.985); background: var(--m-card2); }
.mob-card__title {
  display: block;
  font-size: .99rem;
  font-weight: 700;
  line-height: 1.35;
  padding-right: 22px;
}
.mob-card__chev { position: absolute; top: 16px; right: 12px; color: var(--m-muted); }
.mob-card__chev svg { width: 17px; height: 17px; }
.mob-card--done { border-left: 3px solid var(--m-ok); }

.mob-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; }
.mob-meta__row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--m-muted);
  min-width: 0;
}
.mob-meta__row svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .8; }
.mob-meta__row.is-bad { color: var(--m-bad); font-weight: 600; }
.mob-meta__row.is-ok { color: var(--m-ok); }

/* Chipy statusu */
.mob-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.mob-chip--green { color: #7fe0b4; background: rgba(63, 178, 127, .14); border-color: rgba(63, 178, 127, .4); }
.mob-chip--amber { color: #ffd98a; background: rgba(224, 169, 43, .14); border-color: rgba(224, 169, 43, .4); }
.mob-chip--red   { color: #ff9b9b; background: rgba(227, 93, 106, .14); border-color: rgba(227, 93, 106, .45); }
.mob-chip--gray  { color: var(--m-muted); background: rgba(255, 255, 255, .05); border-color: var(--m-line2); }
.mob-chip--teal  { color: var(--m-brand); background: rgba(31, 211, 224, .1); border-color: rgba(31, 211, 224, .35); }

/* ---------- Karta danych (szczegóły zadania) ---------- */
.mob-panel {
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.mob-panel__t {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--m-brand);
  margin-bottom: 10px;
}
.mob-data { display: flex; flex-direction: column; gap: 10px; }
.mob-data__row { display: flex; gap: 10px; align-items: flex-start; }
.mob-data__row > svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 3px; color: var(--m-brand); opacity: .9; }
.mob-data__row b { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--m-muted); }
.mob-data__row div { min-width: 0; }
.mob-data__row span { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.mob-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }

/* ---------- Banery ---------- */
.mob-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: .9rem;
  margin-bottom: 12px;
}
.mob-banner svg { width: 19px; height: 19px; flex: 0 0 auto; margin-top: 1px; }
.mob-banner--ok { background: rgba(63, 178, 127, .12); border: 1px solid rgba(63, 178, 127, .4); color: #9fe7c6; }
.mob-banner--err { background: rgba(227, 93, 106, .12); border: 1px solid rgba(227, 93, 106, .45); color: #ffb3b3; }

/* ---------- Formularze ---------- */
.mob-field { margin-bottom: 14px; }
.mob-field label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--m-muted);
  margin-bottom: 6px;
}
.mob-field input[type=text],
.mob-field input[type=password],
.mob-field select,
.mob-field textarea {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;              /* iOS: brak auto-zoomu */
  font-family: inherit;
  color: var(--m-text);
  background: #0e151d;
  border: 1px solid var(--m-line2);
  border-radius: 13px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.mob-field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238da0ac' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.mob-field textarea { resize: vertical; min-height: 110px; }
.mob-field input:focus, .mob-field select:focus, .mob-field textarea:focus {
  border-color: var(--m-brand);
  box-shadow: 0 0 0 3px rgba(31, 211, 224, .16);
}
.mob-field input:disabled, .mob-field select:disabled, .mob-field textarea:disabled { opacity: .55; }
.mob-hint { font-size: .78rem; color: var(--m-muted); margin-top: 6px; }

/* pole hasła z przyciskiem pokaż/ukryj */
.mob-pass { position: relative; }
.mob-pass input { padding-right: 52px !important; }
.mob-pass button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--m-muted);
  cursor: pointer;
}
.mob-pass button svg { width: 19px; height: 19px; }

/* ---------- Przyciski ---------- */
.mob-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 750;
  font-family: inherit;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
.mob-btn:active { transform: scale(.985); }
.mob-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.mob-btn--primary {
  color: #06282b;
  background: linear-gradient(135deg, var(--m-brand), #17b3c4);
  box-shadow: 0 6px 22px rgba(31, 211, 224, .22);
}
.mob-btn--ok {
  color: #08271a;
  background: linear-gradient(135deg, #5ed3a0, var(--m-ok));
  box-shadow: 0 6px 22px rgba(63, 178, 127, .22);
}
.mob-btn--ghost { color: var(--m-text); background: var(--m-card); border-color: var(--m-line2); }
.mob-btn--danger { color: #ffb3b3; background: rgba(227, 93, 106, .12); border-color: rgba(227, 93, 106, .45); }
.mob-btn[disabled] { opacity: .5; pointer-events: none; }
.mob-btn--sm { min-height: 42px; padding: 9px 14px; font-size: .9rem; border-radius: 12px; width: auto; }

/* Pasek akcji przyklejony do dołu (szczegóły zadania) */
.mob-stickybar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, transparent, var(--m-bg) 38%);
}

/* ---------- Zdjęcia ---------- */
.mob-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.mob-photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--m-line);
  background: var(--m-bg2);
  display: block;
}
.mob-photo img { width: 100%; height: 100%; object-fit: cover; }
.mob-photo__del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: rgba(8, 10, 13, .72);
  color: #ffb3b3;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.mob-file {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--m-line);
  border-radius: 12px;
  background: var(--m-bg2);
  font-size: .86rem;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.mob-file svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--m-muted); }

/* Duży przycisk „Dodaj zdjęcie" (label + ukryty input file) */
.mob-addphoto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  margin-top: 10px;
  border: 1.5px dashed rgba(31, 211, 224, .45);
  border-radius: 14px;
  background: rgba(31, 211, 224, .06);
  color: var(--m-brand);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
}
.mob-addphoto:active { background: rgba(31, 211, 224, .12); }
.mob-addphoto svg { width: 22px; height: 22px; }
.mob-addphoto input { display: none; }

/* ---------- Stany puste / stopka ---------- */
.mob-empty { text-align: center; padding: 52px 18px; color: var(--m-muted); }
.mob-empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 12px; }
.mob-empty strong { display: block; color: var(--m-text); font-size: 1rem; margin-bottom: 4px; }
.mob-empty span { font-size: .86rem; }

.mob-foot {
  text-align: center;
  font-size: .74rem;
  color: var(--m-muted);
  padding: 26px 0 8px;
  letter-spacing: .04em;
}
.mob-foot a { color: var(--m-brand); }

/* ---------- Ekran logowania ---------- */
.mob-login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 0 18px;
}
.mob-login__head { text-align: center; margin-bottom: 26px; }
.mob-login__head img { height: 64px; width: auto; margin: 0 auto 14px; filter: drop-shadow(0 0 26px rgba(31, 211, 224, .35)); }
.mob-login__head h1 { font-size: 1.3rem; font-weight: 800; letter-spacing: .02em; }
.mob-login__head p {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--m-brand);
  margin-top: 6px;
}
.mob-login__card {
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 20px;
  padding: 22px 18px 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
}

/* drobny licznik wybranych zdjęć przy formularzu zalecenia */
.mob-fotocount { font-size: .82rem; color: var(--m-brand); margin-top: 8px; font-weight: 600; }

/* ---------- Wyszukiwalny picker (pole-wyzwalacz + arkusz dolny) ---------- */
.mob-noscroll { overflow: hidden; }

/* Pole wyglądające jak input, otwiera arkusz wyszukiwania */
.mob-select {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  text-align: left;
  color: var(--m-text);
  background: #0e151d;
  border: 1px solid var(--m-line2);
  border-radius: 13px;
  cursor: pointer;
}
.mob-select:active { background: #111a23; }
.mob-select span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-select svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--m-brand); }
.mob-select--empty span { color: var(--m-muted); }

/* Arkusz wyszukiwania PRZYKLEJONY DO GÓRY ekranu (pełny ekran od góry) — nagłówek i pole szukania
   są zawsze na górze, lista przewija się pod nimi. Dzięki temu przy zawężaniu listy / otwartej
   klawiaturze pole wyszukiwania nie „ucieka" z widoku (wcześniej był to bottom sheet). */
.mob-sheet { position: fixed; inset: 0; z-index: 80; }
.mob-sheet[hidden] { display: none; }
.mob-sheet__backdrop { position: absolute; inset: 0; background: rgba(4, 7, 10, .66); }
.mob-sheet__panel {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--m-bg);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .5);
  animation: mobSheetDown .2s cubic-bezier(.16, .8, .3, 1);
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes mobSheetDown { from { transform: translateY(-12px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mob-sheet__panel { animation: none; } }

/* Nagłówek + pole wyszukiwania = przyklejone na górze (nie przewijają się z listą) */
.mob-sheet__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--m-line);
  background: var(--m-bg);
}
.mob-sheet__head strong { font-size: 1.04rem; }
.mob-sheet__close {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--m-line2);
  border-radius: 11px;
  background: var(--m-card);
  color: var(--m-muted);
  font-size: 16px;
  cursor: pointer;
}
.mob-sheet__close:active { color: var(--m-bad); }

.mob-sheet__search {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--m-line);
  background: var(--m-bg);
}
.mob-sheet__search > svg { flex: 0 0 auto; width: 19px; height: 19px; color: var(--m-muted); }
.mob-sheet__search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--m-text);
  background: #0e151d;
  border: 1px solid var(--m-line2);
  border-radius: 12px;
  outline: none;
}
.mob-sheet__search input:focus { border-color: var(--m-brand); box-shadow: 0 0 0 3px rgba(31, 211, 224, .16); }
.mob-sheet__search button {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: var(--m-muted);
  font-size: 14px;
  cursor: pointer;
}

.mob-sheet__list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 12px 16px;
}
.mob-sheet__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 11px 13px;
  text-align: left;
  background: var(--m-card);
  border: 1px solid var(--m-line);
  border-radius: 13px;
  margin-bottom: 8px;
  cursor: pointer;
}
.mob-sheet__item:active { background: var(--m-card2); }
.mob-sheet__item.is-active { border-color: var(--m-brand); background: rgba(31, 211, 224, .08); }
.mob-sheet__item-t { font-size: 1rem; font-weight: 650; color: var(--m-text); }
.mob-sheet__item-s { font-size: .82rem; color: var(--m-muted); }
.mob-sheet__empty { text-align: center; color: var(--m-muted); padding: 36px 16px; font-size: .9rem; }
.mob-sheet__more { text-align: center; color: var(--m-muted); padding: 10px 8px 4px; font-size: .8rem; }

/* ---------- Skaner rozpoznawania urządzenia (QR na żywo + zdjęcie tabliczki/AI) ---------- */
.mob-scan {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column;
  background: #05080b;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mob-scan[hidden] { display: none; }
.mob-scan__head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  color: var(--m-text);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.mob-scan__head strong { font-size: 1.04rem; }
.mob-scan__close {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--m-line2); border-radius: 11px;
  background: rgba(255, 255, 255, .06); color: var(--m-text); font-size: 16px; cursor: pointer;
}
.mob-scan__view { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #000; }
.mob-scan__view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mob-scan__frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(72vw, 320px); aspect-ratio: 1;
  border: 3px solid rgba(31, 211, 224, .9); border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .42);
}
.mob-scan__status {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  text-align: center; color: #eef4f7; font-size: .92rem; font-weight: 600;
  background: rgba(5, 8, 11, .62); padding: 10px 14px; border-radius: 12px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.mob-scan__results { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px; }
.mob-scan__rhead { color: var(--m-muted); font-size: .9rem; margin-bottom: 12px; line-height: 1.4; }
.mob-scan__item {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  min-height: 58px; padding: 12px 14px; text-align: left;
  background: var(--m-card); border: 1px solid var(--m-line); border-radius: 13px;
  margin-bottom: 9px; cursor: pointer; color: var(--m-text);
}
.mob-scan__item:active { background: var(--m-card2); }
.mob-scan__item-t { font-size: 1rem; font-weight: 700; }
.mob-scan__item-s { font-size: .82rem; color: var(--m-muted); }
.mob-scan__foot {
  flex: 0 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid rgba(255, 255, 255, .08);
}

/* ---- Nakładka „Zapisywanie…" — spinner + pasek postępu (każdy submit w aplikacji) ---- */
.mob-saving {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; flex-direction: column;
  background: rgba(6, 10, 14, .76); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.mob-saving.is-on { display: flex; }
.mob-saving__card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  min-width: 210px; max-width: 84vw; padding: 26px 30px;
  background: var(--m-card, #121922); border: 1px solid var(--m-line2, rgba(255, 255, 255, .14));
  border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.mob-saving__spin {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .14); border-top-color: var(--m-brand, #1fd3e0);
  animation: mobspin .8s linear infinite;
}
.mob-saving__txt { color: var(--m-text, #eaf1f5); font-size: 1rem; font-weight: 700; }
.mob-saving__bar {
  width: 210px; max-width: 68vw; height: 6px; border-radius: 99px;
  background: rgba(255, 255, 255, .12); overflow: hidden; position: relative;
}
.mob-saving__bar::after {
  content: ""; position: absolute; top: 0; left: -45%; height: 100%; width: 45%; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--m-brand, #1fd3e0), transparent);
  animation: mobbar 1.1s ease-in-out infinite;
}
@keyframes mobspin { to { transform: rotate(360deg); } }
@keyframes mobbar { 0% { left: -45%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .mob-saving__spin { animation-duration: 2.2s; }
  .mob-saving__bar::after { animation-duration: 2.6s; }
}

/* Podpis klienta (canvas) — protokół konserwacji */
.mob-opt { font-weight: 400; color: var(--m-muted, #8aa0ad); }
.mob-sign {
  position: relative;
  border: 1.5px dashed var(--m-line, #33414d);
  border-radius: 12px;
  background: #fbfdff;
  height: 170px;
  touch-action: none;
  overflow: hidden;
}
.mob-sign__pad { width: 100%; height: 100%; display: block; touch-action: none; }
.mob-sign__clear {
  position: absolute; top: 8px; right: 8px;
  background: rgba(20, 30, 38, .55); color: #fff;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px;
  padding: 5px 11px; font-size: .82rem;
}
