/* CSPC WhereITis — qr-sticker.css
   Digital QR Code Stickers modal, QR Scanner, Mobile Drawer, Belongings Vault,
   Public QR Scan Landing Page, and Sticker Print Sheet. */

/* ===== HEADER SCAN ICON ===== */
.nav-scan-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass, var(--card));
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.nav-scan-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-050);
}
.nav-scan-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1220px) and (min-width: 861px) {
  .site-header--glass .primary-nav a {
    padding: .38rem .58rem !important;
    font-size: .81rem;
  }
}

/* ===== BOTTOM NAV (.glass-dock) + UPWARD MENU SHEET ===== */
@media (max-width: 860px) {
  body:has(.glass-dock) .site-header .nav-icon {
    display: inline-grid !important;
  }
  .glass-dock {
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: end;
  }
  .glass-dock__btn {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .glass-dock__btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .glass-dock__btn:hover,
  .glass-dock__btn[aria-expanded="true"],
  .glass-dock__btn[aria-current="page"] {
    color: var(--brand);
  }
  .glass-dock__btn[aria-current="page"] span {
    font-weight: 800;
  }
}

.dock-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem .65rem calc(82px + env(safe-area-inset-bottom));
}
.dock-sheet[hidden] { display: none; }

.dock-sheet__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 17, 30, .48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
}
.dock-sheet.is-open .dock-sheet__backdrop { opacity: 1; }

.dock-sheet__panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  padding: 1rem 1rem 1.05rem;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 22px 54px -16px rgba(10, 20, 38, .48);
  transform: translateY(16px);
  opacity: 0;
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), opacity .18s ease;
}
.dock-sheet.is-open .dock-sheet__panel {
  transform: translateY(0);
  opacity: 1;
}

.dock-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.dock-sheet__brand {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.dock-sheet__brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
}
.dock-sheet__brand strong {
  display: block;
  font-size: .95rem;
  line-height: 1.15;
}
.dock-sheet__brand small {
  display: block;
  font-size: .72rem;
  color: var(--muted);
}
.dock-sheet__close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.dock-sheet__close:hover {
  color: var(--ink);
  border-color: var(--brand);
}

.dock-sheet__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  min-height: 46px;
  margin-top: .85rem;
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 38%, transparent);
  background: color-mix(in srgb, var(--brand) 10%, var(--card));
  color: var(--brand);
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.dock-sheet__cta:hover {
  background: color-mix(in srgb, var(--brand) 16%, var(--card));
  border-color: var(--brand);
  color: var(--brand);
}
.dock-sheet__cta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock-sheet__grid {
  list-style: none;
  margin: .8rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
}
.dock-sheet__grid li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.dock-sheet__link {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .55rem .75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand-050) 35%, var(--card));
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: border-color .15s, background .15s, color .15s;
}
.dock-sheet__link:hover,
.dock-sheet__link[aria-current="page"] {
  border-color: var(--brand);
  background: var(--brand-050);
  color: var(--brand);
}
.dock-sheet__link svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ----- Mobile menu sheet: sections, badge, guest CTA ----- */
.dock-sheet__label {
  margin: .95rem 0 .15rem;
  padding: 0 .15rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted, #5d6673);
}
.dock-sheet__head + .dock-sheet__label,
.dock-sheet__head + ul { margin-top: .8rem; }
.dock-sheet__label + .dock-sheet__grid { margin-top: .4rem; }
.dock-sheet__link span { flex: 1 1 auto; min-width: 0; }
.dock-sheet__badge {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-style: normal;
  font-size: .7rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.dock-sheet__cta--solid {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.dock-sheet__cta--solid:hover {
  background: color-mix(in srgb, var(--brand) 88%, #000);
  border-color: color-mix(in srgb, var(--brand) 88%, #000);
  color: #fff;
}
.dock-sheet__alt {
  margin: .65rem 0 0;
  text-align: center;
  font-size: .85rem;
  color: var(--muted, #5d6673);
}
.dock-sheet__alt a { color: var(--brand); font-weight: 700; text-decoration: none; }
.dock-sheet__alt a:hover { text-decoration: underline; }

/* ===== HOME BELONGINGS / QR PROTECTION CALLOUT ===== */
.qr-promo {
  margin: var(--s-4) 0 var(--s-5);
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  border: 1px solid var(--glass-border, var(--border));
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    var(--glass, var(--card));
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--glass-shadow, 0 10px 28px -18px rgba(15, 23, 42, .2));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: center;
}
.qr-promo__eyebrow {
  margin: 0 0 .25rem;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
}
.qr-promo__text h2 {
  margin: 0 0 .35rem;
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
}
.qr-promo__text p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}
.qr-promo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}
@media (max-width: 820px) {
  .qr-promo { grid-template-columns: 1fr; }
}

/* ===== DIGITAL QR CODE STICKERS MODAL & STICKER CARD ===== */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow-y: auto;
}
.qr-modal[hidden] { display: none; }

.qr-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 17, 30, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.qr-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: 0 28px 65px -20px rgba(0, 0, 0, .55);
}

.qr-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.qr-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
}
.qr-modal__sub {
  margin: .3rem 0 0;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.45;
}
.qr-modal__close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.qr-modal__close:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: var(--brand-050);
}

/* Always crisp white surface & dark ink so physical stickers print & scan cleanly */
.sticker-card {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  padding: 1.4rem 1.25rem 1.3rem;
  text-align: center;
  box-shadow: 0 12px 28px -20px rgba(15, 23, 42, .35);
}
.sticker-card__org {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: .55rem;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #10427a;
}
.sticker-card__seal {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #cbd5e1;
}
.sticker-card__item {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  overflow-wrap: anywhere;
}
.sticker-card__code {
  margin: .22rem 0 .9rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #475569;
}
.sticker-card__qr-frame {
  display: inline-grid;
  place-items: center;
  padding: .8rem;
  border-radius: 14px;
  border: 1px solid #d5dde7;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .03);
}
.sticker-card__qr-img {
  display: block;
  width: 176px;
  height: 176px;
}
.sticker-card__cta {
  margin: .95rem 0 .2rem;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #1d4ed8;
}
.sticker-card__hint {
  margin: 0;
  font-size: .8rem;
  color: #64748b;
}

.sticker-callouts {
  display: grid;
  gap: .6rem;
  margin-top: .95rem;
}
.sticker-callout {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .72rem .85rem;
  border-radius: 12px;
  font-size: .83rem;
  line-height: 1.45;
  border: 1px solid transparent;
}
.sticker-callout__icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.sticker-callout--how {
  background: color-mix(in srgb, #2563eb 10%, var(--card));
  border-color: color-mix(in srgb, #2563eb 28%, transparent);
  color: var(--ink);
}
.sticker-callout--how .sticker-callout__icon { color: #2563eb; }
.sticker-callout--why {
  background: color-mix(in srgb, #059669 10%, var(--card));
  border-color: color-mix(in srgb, #059669 28%, transparent);
  color: var(--ink);
}
.sticker-callout--why .sticker-callout__icon { color: #059669; }
:root[data-theme="dark"] .sticker-callout--how .sticker-callout__icon { color: #60a5fa; }
:root[data-theme="dark"] .sticker-callout--why .sticker-callout__icon { color: #34d399; }

.qr-modal__actions {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: .55rem;
  margin-top: 1rem;
}
.qr-modal__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .55rem .9rem;
  font-size: .88rem;
}
.qr-modal__actions svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 520px) {
  .qr-modal__actions {
    grid-template-columns: 1fr 1fr;
  }
  .qr-modal__actions > :first-child {
    grid-column: 1 / -1;
    order: 3;
  }
}

.qr-modal__tip {
  margin: .75rem 0 0;
  text-align: center;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.45;
}
.qr-modal__sheet-link {
  display: block;
  margin-top: .45rem;
  text-align: center;
  font-size: .78rem;
  color: var(--brand);
}

/* ===== REPORT BEACON UPGRADE (REAL QR) ===== */
.beacon__qr-wrap {
  display: inline-grid;
  place-items: center;
  padding: .5rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 6px 18px -12px rgba(15, 23, 42, .4);
  transition: transform .15s, border-color .15s;
}
.beacon__qr-wrap:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
}
.beacon__qr {
  display: block;
  width: 88px;
  height: 88px;
}
@media (max-width: 860px) {
  .beacon__qr-wrap { justify-self: start; }
  .beacon__actions { flex-direction: row !important; flex-wrap: wrap; }
}
@media (min-width: 720px) {
  .my-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
}
@media (max-width: 719px) {
  .my-stats > li:first-child { grid-column: 1 / -1; }
}
.receipt__qr-img {
  display: block;
  width: 144px;
  height: 144px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

/* ===== QR SCANNER UI ===== */
.qr-scanner-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #0b1322;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}
.qr-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qr-scanner-video[hidden],
.qr-scanner-placeholder[hidden] { display: none !important; }
.qr-scanner-video { transform: none; background: #0b1322; }
.qr-scanner-placeholder {
  padding: 1.5rem;
  text-align: center;
  color: #cbd5e1;
  font-size: .9rem;
  max-width: 32ch;
}
.qr-scanner-reticle {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(210px, 60%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, .65);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(8, 15, 28, .35);
  pointer-events: none;
}
.qr-scanner-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .85rem;
}
.qr-scanner-status {
  margin-top: .75rem;
  padding: .62rem .8rem;
  border-radius: 10px;
  font-size: .85rem;
  background: var(--brand-050);
  color: var(--ink);
  border: 1px solid var(--border);
}
.qr-scanner-status.is-error {
  background: color-mix(in srgb, #dc2626 12%, var(--card));
  border-color: color-mix(in srgb, #dc2626 35%, transparent);
  color: var(--lost, #b42318);
}
.qr-scanner-manual {
  margin-top: 1rem;
  padding-top: .95rem;
  border-top: 1px solid var(--border);
}
.qr-scanner-manual__row {
  display: flex;
  gap: .5rem;
  margin-top: .45rem;
}
.qr-scanner-manual__row .input { flex: 1 1 auto; min-width: 0; }
.qr-file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  cursor: pointer;
}
.qr-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ===== BELONGINGS VAULT ===== */
.vault-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--s-4);
}
.vault-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.vault-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: var(--s-4);
}
.vault-stat {
  padding: .9rem 1rem;
  border-radius: 14px;
  background: var(--glass, var(--card));
  border: 1px solid var(--glass-border, var(--border));
}
.vault-stat__label {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.vault-stat__value {
  margin-top: .25rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--brand);
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}
.belonging-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .85rem;
  padding: 1.1rem 1.15rem;
  border-radius: 18px;
  background: var(--glass, var(--card));
  border: 1px solid var(--glass-border, var(--border));
  box-shadow: var(--glass-shadow, 0 10px 26px -18px rgba(15, 23, 42, .25));
}
.belonging-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.belonging-card__thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--brand-050);
  flex: none;
}
.belonging-card__qr-mini {
  width: 56px;
  height: 56px;
  padding: 4px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  flex: none;
}
.belonging-card__code {
  display: inline-block;
  margin-top: .25rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .78rem;
  color: var(--muted);
}
.belonging-card__title {
  margin: .3rem 0 .2rem;
  font-size: 1.08rem;
}
.belonging-card__title a {
  text-decoration: none;
  color: var(--ink);
}
.belonging-card__title a:hover { color: var(--brand); }
.belonging-card__meta {
  font-size: .85rem;
  color: var(--muted);
}
.belonging-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .7rem;
  border-top: 1px solid var(--border);
}
.belonging-card__actions .btn {
  flex: 1 1 auto;
  min-height: 40px;
  padding: .42rem .75rem;
  font-size: .84rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status-pill--safe {
  background: color-mix(in srgb, #059669 14%, var(--card));
  color: #059669;
  border: 1px solid color-mix(in srgb, #059669 35%, transparent);
}
.status-pill--lost {
  background: color-mix(in srgb, #dc2626 14%, var(--card));
  color: #b42318;
  border: 1px solid color-mix(in srgb, #dc2626 40%, transparent);
}
.status-pill--alert {
  background: color-mix(in srgb, #d97706 16%, var(--card));
  color: #b45309;
  border: 1px solid color-mix(in srgb, #d97706 40%, transparent);
}
:root[data-theme="dark"] .status-pill--safe { color: #34d399; }
:root[data-theme="dark"] .status-pill--lost { color: #fca5a5; }
:root[data-theme="dark"] .status-pill--alert { color: #fbbf24; }

/* ===== BELONGING DETAIL & SCAN LANDING ===== */
.belonging-layout {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) {
  .belonging-layout { grid-template-columns: 1fr; }
}
.belonging-panel {
  padding: 1.25rem;
  border-radius: 18px;
  background: var(--glass, var(--card));
  border: 1px solid var(--glass-border, var(--border));
}
.belonging-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .85rem;
  margin: 1rem 0 0;
}
.belonging-specs dt {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.belonging-specs dd {
  margin: .2rem 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.alert-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: .75rem;
}
.alert-item {
  padding: .95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}
.alert-item.is-unread {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--card));
}
.alert-item__head {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.alert-item__body {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}
.alert-item__meta {
  margin: .45rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}

/* ===== SCAN LANDING (finder opens a tagged item's QR) ===== */
.scan-landing {
  max-width: 920px;
  margin-inline: auto;
  padding-block: var(--s-4) var(--s-6);
}
.scan-notice {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font-size: .9rem;
  color: var(--muted);
}
.scan-notice svg { width: 20px; height: 20px; flex: none; color: var(--brand); }
.scan-notice strong { color: var(--ink); font-weight: 700; }

.scan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 760px) { .scan-grid { grid-template-columns: minmax(0, 1fr); } }

.scan-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow, none);
}
@media (max-width: 520px) { .scan-card { padding: 1.1rem; border-radius: 14px; } }

.scan-item__top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .65rem; }
.scan-item__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  letter-spacing: .04em;
  padding: .2rem .55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--bg);
}
.scan-item__title { margin: 0; font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
.scan-item__meta { margin: -.5rem 0 0; color: var(--muted); font-size: .92rem; }
.scan-item__photo {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 4 / 3;
}
.scan-item__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.scan-note { padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--brand-050); }
.scan-note__label { display: block; margin-bottom: .2rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.scan-note p { margin: 0; overflow-wrap: anywhere; }

.scan-item__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.scan-item__actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
.scan-owner-row { display: flex; flex-direction: column; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.scan-owner-row p { margin: 0; font-size: .9rem; color: var(--muted); }

.scan-contact__head { display: flex; align-items: flex-start; gap: .85rem; }
.scan-contact__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-050);
  color: var(--brand);
}
.scan-contact__icon svg { width: 22px; height: 22px; }
.scan-contact__head h2 { margin: 0; font-size: 1.2rem; line-height: 1.25; }
.scan-contact__head p { margin: .2rem 0 0; font-size: .9rem; color: var(--muted); }

.scan-form { display: flex; flex-direction: column; gap: 1.1rem; margin: 0; }
.scan-form .field { margin: 0; }
.scan-form label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .92rem; }
.scan-form .textarea, .scan-form .input { width: 100%; }
.scan-form .textarea { min-height: 7rem; resize: vertical; }
.scan-form__submit { width: 100%; justify-content: center; }
.scan-card__text { margin: 0; font-size: .9rem; color: var(--muted); }
.scan-form__fine { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }

/* Error banner: a plain full border (no coloured edge on one side) */
.scan-landing .form-alert {
  border: 1px solid color-mix(in srgb, var(--accent-red) 45%, var(--border));
  border-left-width: 1px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-red) 7%, var(--card));
  color: var(--ink);
  padding: .7rem .9rem;
  margin: 0;
  font-size: .9rem;
}

/* ===== PRINT MODE FOR DIGITAL STICKER MODAL ===== */
@media print {
  .dock-sheet { display: none !important; }
  body[data-printing-sticker="1"] > *:not([data-qr-sticker-modal]) {
    display: none !important;
  }
  body[data-printing-sticker="1"] [data-qr-sticker-modal] {
    position: static !important;
    inset: auto !important;
    display: block !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body[data-printing-sticker="1"] .qr-modal__backdrop,
  body[data-printing-sticker="1"] .qr-modal__head,
  body[data-printing-sticker="1"] .sticker-callouts,
  body[data-printing-sticker="1"] .qr-modal__actions,
  body[data-printing-sticker="1"] .qr-modal__tip,
  body[data-printing-sticker="1"] .qr-modal__sheet-link {
    display: none !important;
  }
  body[data-printing-sticker="1"] .qr-modal__dialog {
    box-shadow: none !important;
    border: 0 !important;
    max-height: none !important;
    width: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: transparent !important;
  }
  body[data-printing-sticker="1"] .sticker-card {
    width: 340px;
    margin: 18mm auto;
    border: 1.5px dashed #94a3b8 !important;
    box-shadow: none !important;
  }
}

/* ===== HOME QR PROMO: phone layout ===== */
.qr-promo__icon { display: none; }
@media (max-width: 820px) {
  .qr-promo { padding: 1.25rem; gap: 1.25rem; border-radius: 18px; background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--card-shadow, var(--glass-shadow)); }
  .qr-promo__eyebrow { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; }
  .qr-promo__icon {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; border-radius: 12px; background: var(--brand-050); color: var(--brand);
  }
  .qr-promo__icon svg { width: 24px; height: 24px; }
  .qr-promo__text h2 { margin: 0 0 .5rem; font-size: 1.35rem; line-height: 1.25; }
  .qr-promo__text p { font-size: .95rem; line-height: 1.55; }
  .qr-promo .qr-promo__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .qr-promo .qr-promo__actions > .btn:first-child { grid-column: 1 / -1; }
  .qr-promo .qr-promo__actions .btn {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin: 0;
    padding: 0 1rem; border-radius: 12px; font-size: .95rem; font-weight: 600; text-align: center; white-space: nowrap;
  }
}

/* ===== TAGGED ITEM MANAGE PAGE ===== */
.tag-page { max-width: 1080px; }
.tag-hero { margin: .6rem 0 var(--s-4); }
.tag-hero__meta { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.tag-hero__code { margin: 0; }
.tag-hero__title {
  margin: .55rem 0 .2rem;
  font-size: clamp(1.6rem, 5.5vw, 2.1rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.tag-hero__sub { margin: 0; color: var(--muted); }

.tag-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 1.25rem;
  align-items: start;
}
.tag-main { display: grid; gap: 1.1rem; min-width: 0; grid-column: 1; grid-row: 1; }
.tag-side { grid-column: 2; grid-row: 1; position: sticky; top: 1rem; min-width: 0; }
.tag-side__actions { display: grid; gap: .55rem; margin-top: .85rem; }
.tag-side__actions .btn { width: 100%; }

/* Quick actions: icon tiles */
.tag-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.tag-action-form { margin: 0; display: contents; }
.tag-action {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon label" "icon sub";
  column-gap: .8rem;
  row-gap: .05rem;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: .8rem .95rem;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.tag-action:hover { border-color: var(--brand); background: var(--brand-050); color: var(--ink); }
.tag-action:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tag-action__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-050);
  color: var(--brand);
}
.tag-action__icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tag-action__label { grid-area: label; font-weight: 700; font-size: .95rem; line-height: 1.25; align-self: end; }
.tag-action__sub { grid-area: sub; font-size: .8rem; color: var(--muted); line-height: 1.25; align-self: start; }
.tag-action--warn .tag-action__icon { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.tag-action--safe .tag-action__icon { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tag-action--warn:hover { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, var(--card)); }
.tag-action--safe:hover { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--card)); }

/* Sections */
.tag-section { padding: 1.15rem 1.25rem; }
.tag-section__title {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 0 .9rem;
  font-size: 1.1rem;
}
.tag-count {
  display: inline-grid; place-items: center;
  min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem;
  border-radius: 999px;
  background: var(--brand-050); color: var(--brand);
  font-family: system-ui, sans-serif; font-size: .8rem; font-weight: 700;
}
.tag-photo { margin: 0 0 1rem; }
.tag-photo img {
  display: block; width: 100%; max-height: 240px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--border);
}
.tag-photo figcaption { margin-top: .35rem; }
.tag-details { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tag-details > div { padding: .75rem 0; border-top: 1px solid var(--border); min-width: 0; }
.tag-details > div:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.tag-details dt {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .15rem;
}
.tag-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.tag-details__wide { grid-column: 1 / -1; }
.tag-details__wide dd { font-weight: 400; color: var(--muted); }
.tag-empty { padding: 1rem 1.1rem; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); }
.tag-empty p { margin: 0; font-size: .92rem; }
.tag-empty__title { color: var(--ink); font-weight: 700; margin-bottom: .15rem !important; }

/* Danger zone */
.tag-danger {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--accent-red) 35%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-red) 4%, var(--card));
}
.tag-danger__title { margin: 0 0 .15rem; font-size: 1rem; font-family: inherit; color: var(--accent-red); }
.tag-danger__text { margin: 0; font-size: .86rem; color: var(--muted); max-width: 46ch; }
.tag-danger__btn { color: var(--accent-red); border-color: var(--accent-red); }
.tag-danger__btn:hover { background: color-mix(in srgb, var(--accent-red) 10%, transparent); color: var(--accent-red); }

/* Tablet / phone: single column, sticker first */
@media (max-width: 860px) {
  .tag-grid { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .tag-main, .tag-side { grid-column: 1; position: static; }
  .tag-side { grid-row: 1; }
  .tag-main { grid-row: 2; }
  .tag-side .sticker-card { max-width: 380px; margin-inline: auto; }
  .tag-side__actions { max-width: 380px; margin-inline: auto; }
}
@media (max-width: 520px) {
  .tag-section { padding: 1rem; }
  /* Stacked tiles: icon on top, text below, so every tile is the same height. */
  .tag-action {
    grid-template-columns: 1fr;
    grid-template-areas: "icon" "label" "sub";
    justify-items: start;
    align-content: start;
    row-gap: .1rem;
    min-height: 112px;
    padding: .85rem .9rem;
  }
  .tag-action__icon { width: 38px; height: 38px; margin-bottom: .5rem; }
  .tag-action__label { font-size: .92rem; align-self: auto; }
  .tag-action__sub { align-self: auto; }
  .tag-details { grid-template-columns: minmax(0, 1fr); }
  .tag-details > div:nth-child(2) { border-top: 1px solid var(--border); padding-top: .75rem; }
  .tag-danger { flex-direction: column; align-items: stretch; }
  .tag-danger__btn { width: 100%; }
}

/* Sticker pop-up on phones: Print first and full width, Scan + Close below it. */
@media (max-width: 520px) {
  .qr-modal { padding: .6rem; }
  .qr-modal__dialog { padding: 1.1rem 1rem 1rem; border-radius: 16px; max-height: calc(100dvh - 1.2rem); }
  .qr-modal__actions > [data-sticker-print] { grid-column: 1 / -1; order: -1; min-height: 48px; }
  .qr-modal__actions > :first-child { grid-column: auto; order: 0; }
  .qr-modal__actions > :first-child:nth-last-child(2) { grid-column: 1 / -1; }
}
