/* PASSWAY — theme layer on top of Bootstrap 5.
   Palette taken from Thai roads: asphalt, lane-marking yellow, route teal. */

@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-thai-400-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-thai-600-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-thai-700-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/ibm-plex-sans-thai-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --pw-asphalt: #18303A;
  --pw-asphalt-2: #22414D;
  --pw-lane: #F2B807;
  --pw-route: #0F7A6C;
  --pw-route-dark: #0B5E53;
  --pw-paper: #F6F7F4;
  --pw-mist: #DDE3E1;
  --pw-muted: #56676C;
  --pw-signal: #B83A2B;
  --pw-text: #17262C;
  --pw-radius-field: 10px;
  --pw-radius-sheet: 22px;
  --bs-body-font-family: "IBM Plex Sans Thai", "Noto Sans Thai", "Sukhumvit Set", Tahoma, system-ui, sans-serif;
  --bs-body-color: var(--pw-text);
  --bs-body-bg: var(--pw-paper);
  --bs-link-color: var(--pw-route);
  --bs-link-color-rgb: 15, 122, 108;
  --bs-link-hover-color: var(--pw-route-dark);
  --bs-link-hover-color-rgb: 11, 94, 83;
}

body { font-size: 1rem; line-height: 1.65; min-height: 100dvh; }

.pw-h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.3; margin: 0 0 .35rem; }
.pw-h2 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin: 0 0 .35rem; }
.pw-lead { color: var(--pw-muted); margin-bottom: 1.5rem; }
.pw-muted { color: var(--pw-muted); }

/* Wordmark: lane-marking dashes under the name */
.pw-wordmark {
  font-weight: 700; letter-spacing: .14em; color: #fff; text-decoration: none;
  font-size: 1.9rem; line-height: 1;
  background-image: linear-gradient(90deg, var(--pw-lane) 0 60%, transparent 60% 100%);
  background-size: 18px 4px; background-repeat: repeat-x; background-position: 0 100%;
  padding-bottom: .5rem; display: inline-block;
}
.pw-wordmark--sm { font-size: 1.15rem; padding-bottom: .3rem; background-size: 12px 3px; }
.pw-tagline { display: block; color: #C9D6D8; margin-top: .6rem; font-size: .98rem; }

/* ───────── Auth ───────── */
.pw-auth { background: var(--pw-paper); }
.pw-road {
  position: relative; background: var(--pw-asphalt); color: #fff;
  padding: calc(env(safe-area-inset-top) + 1.5rem) 1.5rem 7rem; overflow: hidden;
}
.pw-road__line { position: absolute; inset: auto 0 0 0; width: 100%; height: 100px; }
.pw-road__path {
  fill: none; stroke: var(--pw-lane); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 14 12;
  animation: pw-drive 1.6s cubic-bezier(.4,0,.2,1) both;
}
.pw-road__pickup { fill: var(--pw-paper); stroke: var(--pw-route); stroke-width: 5; }
.pw-road__flag circle { fill: var(--pw-lane); }
.pw-road__flag path { fill: none; stroke: var(--pw-asphalt); stroke-width: 2; stroke-linejoin: round; }
.pw-road__brand { position: relative; max-width: 30rem; margin: 0 auto; }
@keyframes pw-drive { from { stroke-dashoffset: 420; opacity: .2; } to { stroke-dashoffset: 0; opacity: 1; } }

.pw-auth__main { padding: 0 1rem 3rem; margin-top: -1.75rem; position: relative; }
.pw-card {
  background: #fff; border-radius: var(--pw-radius-sheet); padding: 1.75rem 1.4rem;
  max-width: 30rem; margin: 0 auto; border: 1px solid var(--pw-mist);
}
.pw-card--flat { border-radius: 14px; margin-top: 1rem; }
.pw-switch { text-align: center; margin: 1.25rem 0 0; color: var(--pw-muted); }

.form-label { font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
.form-control { background-color: #fff; border-radius: var(--pw-radius-field); padding: .7rem .85rem; border-color: #C5CFCD; font-size: 1rem; }
.form-control:focus, .form-check-input:focus { border-color: var(--pw-route); box-shadow: 0 0 0 .2rem rgba(15,122,108,.22); }
.form-check-input:checked { background-color: var(--pw-route); border-color: var(--pw-route); }
.form-text { color: var(--pw-muted); }

.pw-password { position: relative; }
.pw-password .form-control { padding-right: 3rem; }
.pw-password__toggle {
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--pw-muted); width: 2.6rem; height: 2.6rem; border-radius: 8px;
}
.pw-password__toggle:focus-visible { outline: 3px solid var(--pw-route); }

.pw-btn-primary {
  background: var(--pw-asphalt); color: #fff; font-weight: 600; padding: .8rem 1rem;
  border-radius: 12px; border: 0; position: relative;
}
.pw-btn-primary:hover, .pw-btn-primary:focus-visible { background: var(--pw-asphalt-2); color: #fff; }
.pw-btn-primary:focus-visible { outline: 3px solid var(--pw-lane); outline-offset: 2px; }
.pw-btn-primary[disabled] { opacity: .7; }
.pw-btn-quiet { background: transparent; border: 1px solid #C5CFCD; color: var(--pw-text); border-radius: 12px; padding: .7rem 1rem; }
.pw-btn-quiet:hover { border-color: var(--pw-signal); color: var(--pw-signal); }

.pw-flash {
  max-width: 30rem; margin: 0 auto 1rem; background: #E5F3F0; color: var(--pw-route-dark);
  border-left: 4px solid var(--pw-route); padding: .7rem 1rem; border-radius: 8px; position: relative;
}

/* ───────── App shell ───────── */
.pw-app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.pw-topbar {
  position: sticky; top: 0; z-index: 10; background: var(--pw-asphalt); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + .7rem) 1rem .7rem;
}
.pw-topbar__user { color: #C9D6D8; font-size: .92rem; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-app__main { max-width: 42rem; padding-top: 1.25rem; }

.pw-greet { margin-bottom: 1rem; }
.pw-notice {
  display: flex; gap: .9rem; background: #FFF7DA; border: 1px solid #EED48A; border-radius: 14px; padding: 1rem;
  margin-bottom: 1.5rem;
}
.pw-notice > i { color: #8A6A00; font-size: 1.3rem; margin-top: .2rem; }
.pw-notice p { margin-bottom: .4rem; }

.pw-feed { padding: 1rem 0; border-top: 1px solid var(--pw-mist); }
.pw-feed .pw-h2 i { color: var(--pw-route); width: 1.4rem; }
.pw-empty { color: var(--pw-muted); margin: 0; padding-left: 1.75rem; }

.pw-dl { display: grid; grid-template-columns: 1fr; gap: .1rem; margin: 1rem 0 0; }
.pw-dl dt { font-weight: 600; font-size: .88rem; color: var(--pw-muted); margin-top: .7rem; }
.pw-dl dd { margin: 0; }
.pw-badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .88rem; font-weight: 600; }
.pw-badge--pending { background: #FFF1C2; color: #6E5400; }
.pw-badge--verified { background: #D8F0EA; color: var(--pw-route-dark); }
.pw-badge--rejected, .pw-badge--suspended { background: #F7DCD8; color: var(--pw-signal); }

/* Bottom navigation — mobile first; "สร้าง" is the raised centre action */
.pw-bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 20; background: #fff; border-top: 1px solid var(--pw-mist);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.pw-bottomnav__item {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; text-decoration: none;
  color: var(--pw-muted); font-size: .76rem; padding: .3rem 0; min-height: 48px; justify-content: center;
}
.pw-bottomnav__item i { font-size: 1.15rem; }
.pw-bottomnav__item.is-active { color: var(--pw-asphalt); font-weight: 600; }
.pw-bottomnav__item.is-active i { color: var(--pw-route); }
.pw-bottomnav__item.is-soon { opacity: .45; cursor: not-allowed; }
.pw-bottomnav__item:focus-visible { outline: 3px solid var(--pw-route); border-radius: 8px; }
.pw-bottomnav__create i {
  background: var(--pw-lane); color: var(--pw-asphalt); width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.25rem; margin-top: -1.4rem; border: 4px solid #fff;
}

@media (min-width: 768px) {
  .pw-road { padding-top: 2.5rem; padding-bottom: 8rem; }
  .pw-road__line { height: 120px; }
  .pw-card { padding: 2.25rem 2rem; }
  .pw-bottomnav { max-width: 42rem; margin: 0 auto; border: 1px solid var(--pw-mist); border-bottom: 0; border-radius: 18px 18px 0 0; }
}

/* ───────── Error page ───────── */
.pw-error { display: grid; place-items: center; min-height: 100dvh; padding: 2rem; text-align: center;
  font-family: "IBM Plex Sans Thai", Tahoma, sans-serif; background: var(--pw-paper); color: var(--pw-text); margin: 0; }
.pw-error__code { font-size: 4rem; font-weight: 700; color: var(--pw-lane); margin: 0;
  -webkit-text-stroke: 2px var(--pw-asphalt); letter-spacing: .1em; }
.pw-error__home { display: inline-block; margin-top: 1rem; color: var(--pw-route); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .pw-road__path { animation: none; }
}

/* Bootstrap's invalid-state icon would collide with the show-password button */
.pw-password .form-control.is-invalid { background-image: none; padding-right: 3rem; }

/* ───────── Phase 2: profile, verification, settings ───────── */
.pw-forgot { text-align: right; margin: 0 0 1.25rem; font-size: .92rem; }
.pw-badge--muted { background: #E9EEEC; color: var(--pw-muted); }
.pw-alert { background: #FBEAE7; color: #7A2318; border-left: 4px solid var(--pw-signal); padding: .6rem .9rem; border-radius: 8px; }
.form-select { border-radius: var(--pw-radius-field); padding: .7rem .85rem; border-color: #C5CFCD; background-color: #fff; }
.form-select:focus { border-color: var(--pw-route); box-shadow: 0 0 0 .2rem rgba(15,122,108,.22); }

/* Verification steps — a real sequence, so numbered */
.pw-steps { list-style: none; counter-reset: step; padding: 0; margin: 1.25rem 0 0; }
.pw-step { counter-increment: step; position: relative; padding: 0 0 1.5rem 3rem; }
.pw-step::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: #fff; border: 2px solid var(--pw-asphalt); color: var(--pw-asphalt);
}
.pw-step:not(:last-child)::after {
  content: ""; position: absolute; left: 1rem; top: 2.3rem; bottom: .3rem; border-left: 3px dashed var(--pw-lane);
}
.pw-step.is-done::before { content: "✓"; background: var(--pw-route); border-color: var(--pw-route); color: #fff; }
.pw-step__done { color: var(--pw-route-dark); margin: 0; }
.pw-inline-form { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.pw-otp-row { display: flex; gap: .5rem; }
.pw-otp { font-size: 1.35rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; max-width: 11rem; }
.pw-otp-row .btn { white-space: nowrap; }

/* Avatars */
.pw-avatar { border-radius: 50%; object-fit: cover; background: var(--pw-mist); flex: none; }
.pw-avatar--md { width: 48px; height: 48px; }
.pw-avatar--lg { width: 72px; height: 72px; }
.pw-avatar--xl { width: 104px; height: 104px; }
.pw-avatar--initial { display: inline-grid; place-items: center; font-weight: 700; color: var(--pw-asphalt); background: var(--pw-lane); }
.pw-avatar--lg.pw-avatar--initial { font-size: 1.8rem; }
.pw-avatar--xl.pw-avatar--initial { font-size: 2.6rem; }
.pw-avatar-edit { display: flex; gap: 1rem; align-items: flex-start; }

.pw-profile { text-align: center; padding: .5rem 0 1rem; }
.pw-profile__bio { max-width: 34rem; margin: .9rem auto 0; }
.pw-profile--compact { display: flex; gap: 1rem; align-items: center; text-align: left; }
.pw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .5rem 0 1rem; }
.pw-stats > div { background: #fff; border: 1px solid var(--pw-mist); border-radius: 12px; padding: .7rem .5rem; text-align: center; }
.pw-stats dt { font-size: .8rem; color: var(--pw-muted); font-weight: 400; }
.pw-stats dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.pw-stats small { font-weight: 400; color: var(--pw-muted); }

/* Menus & lists */
.pw-menu { display: flex; flex-direction: column; border: 1px solid var(--pw-mist); border-radius: 14px; background: #fff; margin: .5rem 0 1.25rem; overflow: hidden; }
.pw-menu__item { display: grid; grid-template-columns: 1.6rem 1fr auto; align-items: center; gap: .6rem; padding: .85rem 1rem; color: var(--pw-text); text-decoration: none; }
.pw-menu__item + .pw-menu__item { border-top: 1px solid var(--pw-mist); }
.pw-menu__item i { color: var(--pw-route); }
.pw-menu__item:hover, .pw-menu__item:focus-visible { background: #F1F5F4; }
.pw-menu__item--cta { background: #FFF7DA; }
.pw-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.pw-list__item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--pw-mist); }
.pw-tabs { display: flex; gap: .4rem; margin: .5rem 0 .75rem; overflow-x: auto; }
.pw-tabs a { padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--pw-mist); text-decoration: none; color: var(--pw-text); white-space: nowrap; }
.pw-tabs a.is-active { background: var(--pw-asphalt); color: #fff; border-color: var(--pw-asphalt); }
.pw-doc { margin: 1rem 0; }
.pw-doc img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--pw-mist); background: #fff; }
.pw-doc figcaption { color: var(--pw-muted); font-size: .9rem; margin-top: .3rem; }

/* ───────── Phase 3: map ───────── */
.pw-app--map { padding-bottom: 0; overflow: hidden; }
.pw-app--map .pw-app__main { max-width: none; padding: 0; }
.pw-app--map .pw-flash { position: absolute; top: 4.2rem; left: .75rem; right: .75rem; z-index: 6; }
.pw-map { position: relative; height: calc(100dvh - 56px - 64px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); min-height: 420px; background: #E8ECE9; }
.pw-map__canvas { position: absolute; inset: 0; }
.pw-map__fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6rem 2rem 0; text-align: center; color: var(--pw-muted);
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(24,48,58,.05) 46px 48px),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(24,48,58,.05) 46px 48px), #EEF1EE;
}
.pw-map__fallback i { font-size: 2rem; margin-bottom: .5rem; color: var(--pw-route); }
.pw-map__fallback p { max-width: 22rem; }

.pw-map__search { position: absolute; top: .75rem; left: .75rem; right: 4.25rem; z-index: 5; }
.pw-map__searchbox { display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: 12px; padding: 0 .85rem; box-shadow: 0 2px 10px rgba(24,48,58,.18); }
.pw-map__searchbox i { color: var(--pw-muted); }
.pw-map__searchbox input { border: 0; outline: 0; flex: 1; padding: .75rem 0; font-size: 1rem; background: transparent; min-width: 0; }
.pw-map__searchbox:focus-within { outline: 3px solid var(--pw-route); }
#pw-place-autocomplete gmp-place-autocomplete { width: 100%; }
.pw-map__results { list-style: none; margin: .35rem 0 0; padding: .25rem 0; background: #fff; border-radius: 12px; box-shadow: 0 6px 18px rgba(24,48,58,.2); max-height: 50vh; overflow: auto; }
.pw-map__result { padding: .6rem .9rem; cursor: pointer; display: flex; flex-direction: column; line-height: 1.35; }
.pw-map__result:hover, .pw-map__result:focus { background: #F1F5F4; outline: none; }
.pw-map__result span { font-size: .85rem; }

.pw-map__controls { position: absolute; top: .75rem; right: .75rem; z-index: 5; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; }
.pw-fab { width: 46px; height: 46px; border-radius: 12px; border: 0; background: #fff; color: var(--pw-asphalt); font-size: 1.15rem; box-shadow: 0 2px 10px rgba(24,48,58,.18); }
.pw-fab[aria-pressed="true"] { background: var(--pw-asphalt); color: #fff; }
.pw-fab:focus-visible, .pw-maptype button:focus-visible { outline: 3px solid var(--pw-route); }
.pw-maptype { display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(24,48,58,.18); }
.pw-maptype button { width: 46px; height: 40px; border: 0; background: #fff; font-size: 1.05rem; }
.pw-maptype button + button { border-top: 1px solid var(--pw-mist); }
.pw-maptype button[aria-pressed="true"] { background: #FFF1C2; }

.pw-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(24,48,58,.18); padding: .25rem 1rem 1rem; max-height: 62%; overflow: auto;
}
.pw-sheet.is-collapsed #pw-sheet-body { display: none; }
.pw-sheet__handle { display: block; width: 100%; height: 22px; border: 0; background: transparent; position: relative; }
.pw-sheet__handle::after { content: ""; position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #C5CFCD; }
.pw-sheet__consent { background: #FFF7DA; border-radius: 10px; padding: .45rem .75rem; font-size: .9rem; margin-bottom: .6rem; }
.pw-sheet__error { color: var(--pw-signal); font-size: .92rem; margin: .4rem 0; }

.pw-pins { display: grid; gap: .4rem; margin-bottom: .6rem; }
.pw-pin { display: flex; align-items: center; gap: .65rem; text-align: left; border: 1.5px solid var(--pw-mist); background: #fff; border-radius: 12px; padding: .5rem .75rem; min-height: 52px; }
.pw-pin.is-active { border-color: var(--pw-route); background: #F0F8F6; }
.pw-pin__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pw-pin__text small { color: var(--pw-muted); }
.pw-pin__text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-pin__dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.pw-pin__dot--pickup { background: #fff; border: 4px solid var(--pw-route); }
.pw-pin__dot--dest { background: var(--pw-lane); border: 3px solid var(--pw-asphalt); border-radius: 3px; }
.pw-route-row { display: flex; gap: .5rem; }
.pw-route-row .form-select { flex: 1; padding: .45rem .7rem; }
.pw-route-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .7rem 0 0; }
.pw-route-result > div { background: var(--pw-paper); border-radius: 10px; padding: .45rem .5rem; text-align: center; }
.pw-route-result dt { font-size: .76rem; color: var(--pw-muted); font-weight: 400; }
.pw-route-result dd { margin: 0; font-weight: 700; }
.pw-route-note { grid-column: 1 / -1; font-size: .85rem; color: var(--pw-muted); margin: 0; }

.pw-nearby { border-top: 1px solid var(--pw-mist); margin-top: .9rem; padding-top: .7rem; }
.pw-nearby__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; flex-wrap: wrap; }
.pw-chips { display: flex; gap: .3rem; }
.pw-chip { border: 1px solid var(--pw-mist); background: #fff; border-radius: 999px; padding: .2rem .65rem; font-size: .85rem; }
.pw-chip.is-active { background: var(--pw-asphalt); color: #fff; border-color: var(--pw-asphalt); }
.pw-reward { font-weight: 700; color: var(--pw-route-dark); white-space: nowrap; }

.pw-marker { font-size: 1.35rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.pw-marker--me { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.2); }

.pw-radio-card { border: 1px solid var(--pw-mist); border-radius: 12px; padding: .65rem .75rem .65rem 2.4rem; margin-bottom: .5rem; }
.pw-radio-card:has(input:checked) { border-color: var(--pw-route); background: #F0F8F6; }
fieldset legend { margin-bottom: .6rem; }

@media (min-width: 768px) {
  .pw-sheet { left: 1rem; right: auto; bottom: 1rem; width: 380px; border-radius: 18px; max-height: calc(100% - 6rem); }
  .pw-map__search { right: auto; width: 380px; }
}

/* ───────── Phase 4: routes & matching ───────── */
.pw-choices { display: grid; gap: .75rem; margin-top: 1rem; }
.pw-choice { display: flex; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--pw-mist); border-radius: 14px; background: #fff; color: var(--pw-text); text-decoration: none; }
.pw-choice:hover, .pw-choice:focus-visible { border-color: var(--pw-route); }
.pw-choice.is-soon { opacity: .55; }
.pw-choice--quiet { background: transparent; }
.pw-choice__icon { font-size: 1.8rem; width: 3rem; text-align: center; }

.pw-form fieldset { margin-bottom: 1rem; }
.pw-form legend { font-size: 1.05rem; font-weight: 600; margin-bottom: .6rem; }
.pw-form__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.pw-pp { position: relative; margin-bottom: .9rem; }
.pw-pp__row { display: flex; gap: .4rem; }
.pw-pp__row .btn { flex: none; width: 3rem; }
.pw-pp.is-invalid .form-control { border-color: var(--bs-form-invalid-border-color, #dc3545); }
.pw-pp__results { list-style: none; position: absolute; z-index: 10; left: 0; right: 0; margin: .25rem 0 0; padding: .25rem 0; background: #fff; border: 1px solid var(--pw-mist); border-radius: 10px; box-shadow: 0 6px 18px rgba(24,48,58,.15); max-height: 18rem; overflow: auto; }
.pw-pp__item { display: flex; flex-direction: column; padding: .5rem .8rem; cursor: pointer; line-height: 1.35; }
.pw-pp__item:hover, .pw-pp__item:focus { background: #F1F5F4; outline: none; }
.pw-pp__item span { font-size: .85rem; }
.pw-pp__empty { padding: .5rem .8rem; color: var(--pw-muted); font-size: .9rem; }
.pw-pp__chosen { color: var(--pw-route-dark); font-size: .9rem; margin: .3rem 0 0; }
.pw-waypoints { padding-left: .9rem; border-left: 3px dashed var(--pw-lane); margin: 0 0 .5rem .5rem; }
.pw-waypoint { position: relative; padding-right: 2.2rem; }
.pw-waypoint__remove { position: absolute; right: 0; top: 1.9rem; border: 0; background: transparent; color: var(--pw-muted); width: 2rem; height: 2.4rem; }

.pw-segment { display: inline-flex; border: 1px solid var(--pw-mist); border-radius: 10px; overflow: hidden; }
.pw-segment label { padding: .45rem 1rem; cursor: pointer; }
.pw-segment .btn-check:checked + label { background: var(--pw-asphalt); color: #fff; }
.pw-segment .btn-check:focus-visible + label, .pw-days .btn-check:focus-visible + label { outline: 3px solid var(--pw-route); }
.pw-days { display: flex; gap: .35rem; flex-wrap: wrap; }
.pw-days label { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 1px solid var(--pw-mist); border-radius: 50%; cursor: pointer; font-weight: 600; }
.pw-days .btn-check:checked + label { background: var(--pw-lane); border-color: var(--pw-lane); color: var(--pw-asphalt); }

.pw-trip { list-style: none; padding: 0 0 0 1.4rem; margin: .5rem 0 1rem; position: relative; }
.pw-trip::before { content: ""; position: absolute; left: .45rem; top: .8rem; bottom: .8rem; border-left: 3px dashed var(--pw-lane); }
.pw-trip__stop { position: relative; padding: .25rem 0; }
.pw-trip__stop::before { content: ""; position: absolute; left: -1.2rem; top: .7rem; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--pw-muted); }
.pw-trip__stop--start::before { border: 3px solid var(--pw-route); width: 12px; height: 12px; left: -1.25rem; }
.pw-trip__stop--end::before { background: var(--pw-lane); border-color: var(--pw-asphalt); border-radius: 2px; }
.pw-stats__small { font-size: .9rem !important; }
.pw-link-danger { color: var(--pw-signal); text-decoration: underline; }
.pw-route-link { color: var(--pw-text); text-decoration: none; }

/* Match card: the score is the memorable element */
.pw-match { display: grid; grid-template-columns: 4.2rem 1fr; gap: .2rem .8rem; padding: .85rem 0; border-bottom: 1px solid var(--pw-mist); }
.pw-match__score { grid-row: span 2; width: 4.2rem; height: 4.2rem; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; border: 4px solid; }
.pw-match__score small { font-size: .55rem; letter-spacing: .08em; font-weight: 600; }
.pw-match__score strong { font-size: 1.15rem; }
.pw-match__score--high { border-color: var(--pw-route); color: var(--pw-route-dark); background: #E7F4F1; }
.pw-match__score--mid { border-color: var(--pw-lane); color: #6E5400; background: #FFF7DA; }
.pw-match__score--low { border-color: #C5CFCD; color: var(--pw-muted); }
.pw-match__title { font-size: 1rem; font-weight: 600; margin: 0 0 .15rem; }
.pw-match__side { grid-column: 2; display: flex; justify-content: space-between; gap: .5rem; }
.pw-bars { list-style: none; padding: 0; margin: .3rem 0 .2rem; display: grid; gap: .1rem; font-size: .78rem; color: var(--pw-muted); }
.pw-bars li { display: grid; grid-template-columns: 5.5rem 1fr 1.8rem; align-items: center; gap: .4rem; }
.pw-bars li span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
progress.pw-bar { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--pw-mist); overflow: hidden; }
progress.pw-bar::-webkit-progress-bar { background: var(--pw-mist); border-radius: 3px; }
progress.pw-bar::-webkit-progress-value { background: var(--pw-route); border-radius: 3px; }
progress.pw-bar::-moz-progress-bar { background: var(--pw-route); border-radius: 3px; }
.pw-weight { display: grid; grid-template-columns: 1fr 6rem; gap: .75rem; align-items: center; margin-bottom: .5rem; }

/* ───────── Phase 5: requests, bookings, handover, certificate ───────── */
.pw-topbar__right { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.pw-bell { position: relative; color: #fff; font-size: 1.15rem; padding: .35rem; line-height: 1; }
.pw-bell__dot { position: absolute; top: -.1rem; right: -.25rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem; border-radius: 999px;
  background: var(--pw-signal); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.pw-flash--error { background: #FBEAE7; color: #7A2318; border-color: #E9B8B0; }
.pw-segment a { padding: .45rem .9rem; text-decoration: none; color: var(--pw-text); white-space: nowrap; font-size: .95rem; }
.pw-segment a.is-active { background: var(--pw-asphalt); color: #fff; }
.pw-segment { max-width: 100%; overflow-x: auto; }

.pw-typegrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.pw-typecard { display: block; cursor: pointer; }
.pw-typecard__body { display: flex; align-items: center; gap: .55rem; padding: .65rem .75rem; border: 1px solid var(--pw-mist); border-radius: 12px; background: #fff; min-height: 3.2rem; font-size: .95rem; line-height: 1.3; }
.pw-typecard__body > span:first-child { font-size: 1.4rem; }
.pw-typecard__body small { display: block; color: var(--pw-muted); }
.pw-typecard .btn-check:checked + .pw-typecard__body { border-color: var(--pw-route); box-shadow: 0 0 0 2px var(--pw-route) inset; background: #EEF8F5; font-weight: 600; }
.pw-typecard .btn-check:focus-visible + .pw-typecard__body { outline: 3px solid var(--pw-route); outline-offset: 2px; }
.pw-typecard.is-off { opacity: .55; cursor: not-allowed; }

.pw-itemrow { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .6rem 0; border-bottom: 1px dashed var(--pw-mist); }
.pw-itemrow > :first-child, .pw-itemrow > :nth-child(2) { grid-column: 1 / -1; }
.pw-itemrow > :nth-child(3), .pw-itemrow > :nth-child(4), .pw-itemrow > :nth-child(5) { grid-column: auto; }
.pw-itemrow { grid-template-columns: repeat(3, 1fr); }

.pw-photos { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; align-items: center; }
.pw-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--pw-mist); background: #fff; }
.pw-photos--lg img { width: 112px; height: 112px; }
.pw-photos__sig { width: 140px !important; height: 52px !important; object-fit: contain !important; }
.pw-photo { position: relative; margin: 0; }
.pw-photo__del { position: absolute; top: -.35rem; right: -.35rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 0; background: var(--pw-signal); color: #fff; display: grid; place-items: center; }
.pw-filter { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.pw-filter select { grid-column: 1 / 2; }
.pw-filter .btn { grid-column: 2 / 3; grid-row: 1 / 3; }

.pw-list__item--col { flex-direction: column; align-items: flex-start; gap: .4rem; }
.pw-list__item.is-unread { background: #FFFBEA; margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: 8px; }
.pw-list__item.is-off { opacity: .5; }

.pw-progress { display: flex; list-style: none; padding: 0; margin: 1rem 0; gap: 2px; counter-reset: s; }
.pw-progress li { flex: 1; text-align: center; font-size: .72rem; color: var(--pw-muted); position: relative; padding-top: 1.1rem; }
.pw-progress li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--pw-mist); }
.pw-progress li.is-done::before { background: var(--pw-route); }
.pw-progress li.is-current::before { background: var(--pw-lane); }
.pw-progress li.is-current { color: var(--pw-text); font-weight: 700; }

.pw-code { text-align: center; border: 2px solid var(--pw-lane); }
.pw-code .pw-h2 { text-align: left; }
.pw-code__qr { width: min(240px, 70vw); margin: .5rem auto; background: #fff; padding: .4rem; border-radius: 10px; }
.pw-code__qr svg { width: 100%; height: auto; display: block; }
.pw-code__otp { font-size: 2.2rem; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; margin: .25rem 0; }
.pw-code__otp span + span { margin-left: .6rem; }
.pw-otpfield { text-align: center; letter-spacing: .25em; font-variant-numeric: tabular-nums; }

.pw-actions { display: grid; gap: .75rem; margin: 1rem 0; }
.pw-actions__more summary { cursor: pointer; font-weight: 600; }
.pw-handover { border: 1px solid var(--pw-route); }
.pw-scan { margin-top: .5rem; text-align: center; }
.pw-scan video { width: 100%; max-height: 320px; border-radius: 12px; background: #000; object-fit: cover; }
.pw-sign { width: 100%; height: 130px; border: 1px dashed var(--pw-muted); border-radius: 10px; background: #fff; touch-action: none; }

.pw-timeline { list-style: none; padding: 0 0 0 1rem; margin: 0 0 1rem; border-left: 3px solid var(--pw-mist); }
.pw-timeline li { padding: .25rem 0 .55rem .75rem; position: relative; }
.pw-timeline li::before { content: ""; position: absolute; left: -1.47rem; top: .65rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--pw-route); }
.pw-cert-link { display: flex; gap: .8rem; align-items: center; text-decoration: none; color: inherit; }
.pw-cert-link i { font-size: 1.8rem; color: var(--pw-lane); }

.pw-sos { position: fixed; right: .9rem; bottom: calc(env(safe-area-inset-bottom) + 5.2rem); z-index: 20; background: var(--pw-signal); color: #fff; border: 0;
  border-radius: 999px; padding: .7rem 1.1rem; font-weight: 700; letter-spacing: .05em; box-shadow: 0 4px 14px rgba(0,0,0,.3); min-height: 48px; }
.pw-sos:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--pw-signal); }
.pw-dialog { border: 0; border-radius: var(--pw-radius-sheet); padding: 1.25rem; width: min(92vw, 420px); }
.pw-dialog::backdrop { background: rgba(10, 20, 24, .6); }

.pw-cert { background: #fff; border: 2px solid var(--pw-asphalt); border-radius: 14px; padding: 1.1rem; }
.pw-cert__brand { color: var(--pw-asphalt); display: inline-block; margin-bottom: .6rem; }
.pw-cert__foot { display: flex; gap: 1rem; align-items: center; border-top: 1px dashed var(--pw-mist); padding-top: 1rem; margin-top: 1rem; }
.pw-cert__qr { width: 110px; flex: none; }
.pw-cert__qr svg { width: 100%; height: auto; display: block; }
.pw-checks { list-style: none; padding: 0; }
.pw-checks li { padding: .2rem 0; }
.pw-checks .is-ok { color: var(--pw-route-dark); }
.pw-checks .is-bad { color: var(--pw-signal); font-weight: 600; }

.pw-policy { border-left: 6px solid var(--pw-mist); }
.pw-policy--green { border-left-color: var(--pw-route); }
.pw-policy--yellow { border-left-color: var(--pw-lane); }
.pw-policy--red { border-left-color: var(--pw-signal); }
.pw-policyrow__ctl { display: flex; gap: .6rem; align-items: center; margin-top: .4rem; }
.pw-policyrow__ctl select { max-width: 11rem; }
.pw-sosrow.is-open { border: 2px solid var(--pw-signal); }
.pw-inline-form { display: flex; gap: .5rem; }

@media print {
  .pw-topbar, .pw-bottomnav, .pw-noprint, .pw-sos { display: none !important; }
  body { background: #fff; }
  .pw-cert { border-color: #000; }
}
