/* Parts Locator — mobile first. Brand tokens come from ../_shared/brand/tokens.css */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--pp-font-body); color: var(--pp-text); background: var(--pp-bg);
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .head { font-family: var(--pp-font-head); font-weight: 600; color: var(--pp-ink); }
a { color: var(--pp-blue-dark); }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--pp-muted); }

/* brand colours: each brand exposes --b for chips, pins and bars */
.b-mr { --b: #e51b24; } .b-ltc { --b: #00a3da; } .b-pw { --b: #719430; } .b-hg { --b: #e0a400; } .b-sp { --b: #6a4c93; } .b-pt { --b: #f26522; } .b-nf { --b: #231f20; }

/* ---------- top bar ---------- */
.topbar {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: #fff; border-bottom: 1px solid var(--pp-line); z-index: 700; position: relative;
}
.topbar__brand img { height: 26px; display: block; }
.topbar__title { font-family: var(--pp-font-head); font-size: 17px; color: var(--pp-ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; border-left: 1px solid var(--pp-line); margin-left: 2px; padding-left: 10px; }
.topbar__nav { display: flex; align-items: center; gap: 4px; }
.iconbtn { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--pp-ink); background: none; border: 0; text-decoration: none; }
.iconbtn:hover { background: var(--pp-surface); }
.iconbtn__badge { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pp-red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--pp-blue); color: #fff; font-weight: 700; font-size: 13px; margin-left: 4px; }

/* ---------- layout ---------- */
.app { flex: 1; position: relative; min-height: 0; }
.map { position: absolute; inset: 0; background: #e9eef2; }
.mapctl { position: absolute; top: 10px; right: 10px; z-index: 450; display: flex; flex-direction: column; gap: 8px; }
.mapctl__btn { width: 44px; height: 44px; border-radius: 10px; border: 0; background: #fff; box-shadow: var(--pp-shadow); color: var(--pp-ink); display: flex; align-items: center; justify-content: center; }
.mapctl__btn.on { background: var(--pp-blue); color: #fff; }
.leaflet-control-zoom { display: none; }
.leaflet-bottom { bottom: var(--sheet-h, 140px); transition: bottom .25s ease; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75) !important; }

/* bottom sheet (mobile) */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--sheet-h, 52vh); z-index: 600;
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: var(--pp-shadow-lg);
  display: flex; flex-direction: column; transition: height .25s ease; touch-action: none;
}
.panel.dragging { transition: none; }
.panel__handle { flex: 0 0 22px; display: flex; align-items: center; justify-content: center; cursor: grab; }
.panel__handle span { width: 42px; height: 5px; border-radius: 3px; background: #d5d5d5; }
.panel__head { flex: 0 0 auto; padding: 0 12px 8px; touch-action: auto; }
.panel__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 12px 24px; touch-action: pan-y; }
.panel__foot { flex: 0 0 auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--pp-line); background: #fff; touch-action: auto; }

/* ---------- search ---------- */
.search { position: relative; display: flex; align-items: center; background: var(--pp-surface); border: 1.5px solid var(--pp-line); border-radius: 12px; height: 48px; padding: 0 8px 0 12px; }
.search:focus-within { border-color: var(--pp-blue); background: #fff; }
.search__icon { color: var(--pp-muted); flex: 0 0 22px; }
.search__input { flex: 1; min-width: 0; border: 0; background: none; font-size: 16px; padding: 0 10px; height: 100%; outline: 0; color: var(--pp-ink); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear { width: 36px; height: 36px; border: 0; background: none; color: var(--pp-muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 16px; border: 1.5px solid var(--pp-line); background: #fff; font-size: 13px; font-weight: 600; color: var(--pp-text); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--b, #999); display: inline-block; }
.chip.on { border-color: var(--b, var(--pp-ink)); background: color-mix(in srgb, var(--b, #999) 12%, #fff); color: var(--pp-ink); }
.chip--all.on { background: var(--pp-ink); color: #fff; border-color: var(--pp-ink); }

/* view header (order / cart / requests) */
.viewhead { display: flex; align-items: center; gap: 6px; min-height: 48px; }
.viewhead .iconbtn { width: 40px; height: 40px; margin-left: -6px; }
.viewhead h2 { flex: 1; margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewhead .sub { display: block; font-family: var(--pp-font-body); font-weight: 400; font-size: 12px; color: var(--pp-muted); }

/* ---------- results ---------- */
.section { margin-top: 14px; }
.section__title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--pp-muted); font-weight: 700; margin: 0 0 6px; }
.section__title .link { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; color: var(--pp-blue-dark); background: none; border: 0; padding: 0; }
.empty { padding: 26px 8px; text-align: center; color: var(--pp-muted); font-size: 14px; line-height: 1.5; }
.empty strong { color: var(--pp-ink); }

.card { display: flex; gap: 10px; padding: 10px 10px 10px 0; border-bottom: 1px solid var(--pp-line); cursor: pointer; align-items: stretch; }
.card:active { background: var(--pp-surface); }
.card__bar { flex: 0 0 4px; border-radius: 2px; background: var(--b, #999); }
.card__main { flex: 1; min-width: 0; }
.card__title { font-weight: 700; color: var(--pp-ink); font-size: 15px; display: flex; gap: 6px; align-items: baseline; }
.card__title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__sub { font-size: 13px; color: #666; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta { font-size: 12px; color: var(--pp-muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.card__hit { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--pp-green-dark); background: #eef5e4; border-radius: 6px; padding: 2px 8px; max-width: 100%; }
.card__hit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.dist { font-size: 12px; font-weight: 700; color: var(--pp-ink); white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--pp-surface); color: #666; white-space: nowrap; }
.tag--kind-Replacement { background: #fff1d6; color: #8a5a00; }
.tag--kind-Install { background: #e6f5fb; color: #006b8f; }
.tag--src { border: 1px solid var(--pp-line); background: #fff; }
.tag--review { background: #fff4d6; color: #7a4d00; }
.btn--show { border: 1.5px solid var(--pp-line); background: #fff; border-radius: 8px; font-size: 12px; font-weight: 700; padding: 5px 9px; color: var(--pp-blue-dark); }

.place { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--pp-line); cursor: pointer; }
.place svg { color: var(--pp-blue); flex: 0 0 22px; }
.place__label { font-size: 14px; color: var(--pp-ink); font-weight: 600; }
.place__sub { font-size: 12px; color: var(--pp-muted); }
.pinbar { display: flex; align-items: center; gap: 8px; background: #e6f5fb; border-radius: 10px; padding: 8px 10px; margin-top: 10px; font-size: 13px; color: #00546f; }
.pinbar svg { color: var(--pp-blue); flex: 0 0 20px; width: 20px; height: 20px; }
.pinbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinbar button { border: 0; background: none; color: inherit; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.loading { font-size: 12px; color: var(--pp-muted); padding: 6px 4px; }

/* ---------- order detail ---------- */
.hero { padding: 6px 0 10px; border-bottom: 1px solid var(--pp-line); }
.hero__brand { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--pp-ink); }
.hero__brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--b); }
.hero h3 { margin: 6px 0 2px; font-size: 19px; }
.hero .addr { font-size: 14px; color: #555; line-height: 1.4; }
.hero__actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: 1.5px solid var(--pp-line); background: #fff; text-decoration: none; color: var(--pp-ink); font-size: 13px; font-weight: 600; }
.pill svg { width: 18px; height: 18px; color: var(--pp-blue); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--pp-line); font-size: 13px; }
.kv div { min-width: 0; }
.kv dt { font-size: 11px; color: var(--pp-muted); text-transform: uppercase; letter-spacing: .05em; }
.kv dd { margin: 2px 0 0; color: var(--pp-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv dd.wrap { white-space: normal; }
.banner { display: flex; gap: 10px; align-items: flex-start; background: #fff4d6; border: 1px solid #f3d48a; border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-size: 13px; color: #6a4300; }
.banner svg { color: #b07300; flex: 0 0 22px; }
.banner .btn { margin-top: 8px; }
.banner--ok { background: #eef5e4; border-color: #cfe3b0; color: #2f5200; }
.banner--ok svg { color: var(--pp-green); }
.related { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.related a { font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px; background: var(--pp-surface); text-decoration: none; color: var(--pp-ink); }

.bom { margin-top: 14px; }
.bom__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.bom__head h3 { margin: 0; font-size: 16px; }
.bom__search { display: flex; align-items: center; background: var(--pp-surface); border: 1.5px solid var(--pp-line); border-radius: 10px; height: 42px; padding: 0 10px; margin-bottom: 6px; }
.bom__search:focus-within { border-color: var(--pp-blue); background: #fff; }
.bom__search svg { color: var(--pp-muted); width: 18px; height: 18px; }
.bom__search input { flex: 1; border: 0; background: none; outline: 0; font-size: 15px; padding: 0 8px; min-width: 0; }
.cat { margin-top: 10px; }
.cat__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pp-muted); margin: 8px 0 4px; display: flex; justify-content: space-between; }
.line { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px 10px; padding: 9px 0; border-bottom: 1px solid var(--pp-line); align-items: center; }
.line__icon { width: 34px; height: 34px; border-radius: 8px; background: var(--pp-surface); display: flex; align-items: center; justify-content: center; color: var(--pp-ink); }
.line__icon svg { width: 20px; height: 20px; }
.line__main { min-width: 0; }
.line__pn { font-weight: 700; color: var(--pp-ink); font-size: 13px; }
.line__desc { font-size: 13px; color: #555; line-height: 1.35; }
.line__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--pp-muted); margin-top: 3px; align-items: center; }
.w { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.w--ok { color: var(--pp-green-dark); } .w--expired { color: #999; } .w--none { color: #999; }
.w i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mark { background: #fff2a8; border-radius: 3px; padding: 0 1px; }
.add { height: 36px; min-width: 64px; padding: 0 12px; border-radius: 18px; border: 0; background: var(--pp-red); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.add svg { width: 16px; height: 16px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--pp-red); border-radius: 18px; height: 36px; overflow: hidden; }
.stepper button { width: 34px; height: 100%; border: 0; background: #fff; color: var(--pp-red); display: flex; align-items: center; justify-content: center; }
.stepper button svg { width: 16px; height: 16px; }
.stepper b { min-width: 26px; text-align: center; font-size: 14px; color: var(--pp-ink); }

/* ---------- cart / request ---------- */
.group { margin-top: 12px; }
.group__title { font-size: 13px; font-weight: 700; color: var(--pp-ink); }
.group__sub { font-size: 12px; color: var(--pp-muted); margin-bottom: 4px; }
.field { margin-top: 12px; }
.field label, .field .lbl { display: block; font-size: 12px; font-weight: 700; color: var(--pp-ink); margin-bottom: 4px; }
.field input[type=text], .field input[type=tel], .field input[type=email], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1.5px solid var(--pp-line); border-radius: 10px; background: #fff; color: var(--pp-ink);
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--pp-blue); }
.radios { display: flex; flex-direction: column; gap: 6px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--pp-line); border-radius: 10px; font-size: 14px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--pp-blue); background: #f3fafd; }
.radio input { margin-top: 3px; }
.radio small { display: block; color: var(--pp-muted); font-size: 12px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--pp-line); }
.photos .addph { width: 64px; height: 64px; border-radius: 8px; border: 1.5px dashed #bbb; display: flex; align-items: center; justify-content: center; color: var(--pp-muted); background: #fff; }
.totals { margin-top: 14px; border-top: 1px solid var(--pp-line); padding-top: 10px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-weight: 700; color: var(--pp-ink); font-size: 16px; border-top: 1px solid var(--pp-line); margin-top: 6px; padding-top: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--pp-red); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.btn:hover { background: var(--pp-red-dark); }
.btn--block { width: 100%; }
.btn--ghost { background: #fff; color: var(--pp-ink); border: 1.5px solid var(--pp-line); }
.btn--ghost:hover { background: var(--pp-surface); }
.btn--sm { height: 36px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.btn--ms { background: #2f2f2f; }
.btn--ms svg { width: 18px; height: 18px; }
.footbar { display: flex; align-items: center; gap: 12px; }
.footbar__sum { flex: 1; font-size: 13px; color: #555; }
.footbar__sum b { display: block; color: var(--pp-ink); font-size: 15px; }

.timeline { list-style: none; padding: 0; margin: 14px 0 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--pp-ink); position: relative; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 28px; bottom: -6px; width: 2px; background: var(--pp-line); }
.timeline li:last-child::before { display: none; }
.timeline i { width: 22px; height: 22px; border-radius: 50%; background: var(--pp-line); display: flex; align-items: center; justify-content: center; color: #fff; }
.timeline li.done i { background: var(--pp-green); }
.timeline li.now i { background: var(--pp-blue); animation: pulse 1.4s infinite; }
.timeline i svg { width: 14px; height: 14px; }
.timeline small { display: block; color: var(--pp-muted); font-size: 12px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(0,163,218,.5);} 50% { box-shadow: 0 0 0 8px rgba(0,163,218,0);} }
.confirm { text-align: center; padding: 18px 0 6px; }
.confirm .big { width: 64px; height: 64px; border-radius: 50%; background: var(--pp-green); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.confirm .big svg { width: 34px; height: 34px; }
.confirm h3 { margin: 12px 0 4px; font-size: 20px; }
.confirm .ref { font-size: 22px; font-weight: 700; color: var(--pp-red); }
.req { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--pp-line); cursor: pointer; }
.req__main { flex: 1; min-width: 0; }
.req__title { font-weight: 700; color: var(--pp-ink); font-size: 15px; }
.req__sub { font-size: 13px; color: #666; }

/* ---------- map pins ---------- */
/* Teardrop pin: a 26px square rotated about its sharp bottom-left corner, which is placed at (16,38) — the marker anchor.
   Scaling the selected pin therefore grows it upward and the tip stays exactly on the coordinate. */
.pin { position: relative; width: 32px; height: 40px; }
.pin::before { content: ""; position: absolute; left: 16px; top: 12px; width: 26px; height: 26px; box-sizing: border-box; background: var(--b, #999); border: 2.5px solid #fff; border-radius: 50% 50% 50% 0; transform-origin: 0 100%; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .15s ease; }
.pin--review::before { background: #fff; border: 2.5px dashed var(--b, #999); }
.pin__count { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--pp-ink); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.pin--active { z-index: 1000 !important; }
.pin--active::before { transform: rotate(-45deg) scale(1.35); box-shadow: 0 0 0 4px rgba(229,27,36,.3), 0 3px 8px rgba(0,0,0,.4); }
.pin--dim::before { opacity: .35; }
.cluster { width: 38px; height: 38px; border-radius: 50%; background: rgba(35,31,32,.9); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.searchpin { width: 34px; height: 34px; color: var(--pp-blue); filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.searchpin svg { width: 34px; height: 34px; }
.me { width: 18px; height: 18px; border-radius: 50%; background: var(--pp-blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(0,163,218,.25); }

/* ---------- toast / sign-in ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--pp-ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: all .25s ease; z-index: 900; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.signin { position: fixed; inset: 0; background: linear-gradient(160deg, #fff 0%, #f3f6f8 100%); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.signin__card { background: #fff; border-radius: 16px; box-shadow: var(--pp-shadow-lg); padding: 28px 24px; max-width: 360px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.signin__logo { height: 36px; }
.signin h1 { margin: 0; font-size: 22px; }
.signin p { margin: 0; font-size: 14px; color: #666; line-height: 1.5; }
.signin__bio { font-size: 13px; color: #555; display: flex; align-items: center; gap: 6px; }
.signin small { color: var(--pp-muted); font-size: 12px; }

@media (max-width: 419px) { .topbar__title { display: none; } }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 440px 1fr; }
  .map { position: relative; inset: auto; grid-column: 2; }
  .panel { position: relative; grid-column: 1; grid-row: 1; height: auto !important; border-radius: 0; box-shadow: none; border-right: 1px solid var(--pp-line); touch-action: auto; }
  .panel__handle { display: none; }
  .panel__head { padding-top: 12px; }
  .mapctl { right: 12px; top: 12px; }
  .leaflet-control-zoom { display: block; }
  .leaflet-bottom { bottom: 0; }
  .topbar { padding: 0 16px; }
  .topbar__brand img { height: 30px; }
  .card:hover { background: var(--pp-surface); }
}
