/* =====================================================================
   顺路 · components
   ===================================================================== */

/* ---------- logo: guide-sign plate ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo__plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px 0 9px;
  border-radius: 7px;
  background: var(--sign);
  color: var(--on-sign);
  transition: background-color 0.2s;
}
.logo__plate::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 4.5px;
  pointer-events: none;
}
.logo:hover .logo__plate { background: var(--sign-hi); }
.logo__arrow { width: 15px; height: 15px; }
.logo__plate b { font: 900 17px/1 var(--f-display); letter-spacing: 0.06em; }
.logo__en {
  font: 600 10px/1.25 var(--f-label);
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* ---------- buttons ---------- */
.btn {
  --h: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 18px;
  border-radius: var(--r-ctl);
  font: 600 15px/1 var(--f-ui);
  letter-spacing: 0.02em;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.18s var(--ease), background-color 0.2s, box-shadow 0.2s, color 0.2s, opacity 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn .ic { width: 18px; height: 18px; }
.btn--sm { --h: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn--lg { --h: 54px; padding: 0 26px; font-size: 16px; border-radius: 12px; }
.btn--block { width: 100%; }

.btn--sign {
  background: var(--sign);
  color: var(--on-sign);
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 4.5px rgba(255, 255, 255, 0.92);
}
.btn--sign:hover {
  background: var(--sign-hi);
  box-shadow: inset 0 0 0 3px var(--sign-hi), inset 0 0 0 4.5px #fff;
}
.btn--sm.btn--sign { box-shadow: inset 0 0 0 2.5px var(--sign), inset 0 0 0 3.7px rgba(255, 255, 255, 0.9); }
.btn--sm.btn--sign:hover { box-shadow: inset 0 0 0 2.5px var(--sign-hi), inset 0 0 0 3.7px #fff; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--ink-2); }
.btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--ghost { color: var(--ink-2); padding: 0 12px; }
.btn--ghost:hover { background: var(--ground-2); color: var(--ink); }
.btn--stop { background: var(--stop); color: #fff; }
.btn--stop:hover { filter: brightness(1.06); }
.btn--warn { background: var(--warn); color: var(--on-warn); }
.btn--go { background: var(--go); color: #fff; }
.btn[aria-disabled="true"],
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn[aria-disabled="true"]:active,
.btn:disabled:active { transform: none; }

.iconbtn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--ink-2);
  transition: background-color 0.2s, color 0.2s;
}
.iconbtn:hover { background: var(--ground-2); color: var(--ink); }
.iconbtn .ic { width: 22px; height: 22px; }

.badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--stop);
  color: #fff;
  font: 700 11px/18px "Barlow", var(--f-ui);
  text-align: center;
  box-shadow: 0 0 0 2px var(--paper);
  pointer-events: none;
}
.badge:empty { display: none; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--sign-ink);
  font-weight: 600;
  font-size: 14px;
}
.link .ic { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.link:hover .ic { transform: translateX(3px); }

/* ---------- chips & segmented ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--rule);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); }
.chip.is-on { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip .cb { width: 20px; height: 20px; font-size: 11.5px; border-radius: 4px; }
.chip.is-on .cb { background: var(--paper); color: var(--ink); }
.chip__n { font: 600 12px/1 "Barlow", var(--f-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip.is-on .chip__n { color: inherit; opacity: 0.7; }
.chips { display: flex; gap: 8px; }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--ground-2);
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.seg button .ic { width: 17px; height: 17px; }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }

/* ---------- small signs: category, credit pip, avatar ---------- */
.cb {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  font: 900 14px/1 var(--f-display);
}
.cb--lg { width: 40px; height: 40px; font-size: 21px; border-radius: 8px; }

.pip {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 25px;
  height: 25px;
  padding: 0 3px;
  border-radius: 50%;
  background: var(--sign);
  color: #fff;
  font: 700 11.5px/1 "Barlow", var(--f-ui);
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1.6px var(--sign), inset 0 0 0 2.7px rgba(255, 255, 255, 0.88);
}

.av {
  --s: 32px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  font: 700 calc(var(--s) * 0.44) / 1 var(--f-display);
  font-style: normal;
  color: var(--ink);
}
.av--1 { background: var(--av-1); }
.av--2 { background: var(--av-2); }
.av--3 { background: var(--av-3); }
.av--4 { background: var(--av-4); }
.av--5 { background: var(--av-5); }

/* ---------- status ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font: 600 12.5px/1 var(--f-ui);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pill--sign { background: var(--sign-tint); color: var(--sign-ink); }
.pill--warn { background: var(--warn); color: var(--on-warn); }
.pill--go { background: var(--go-tint); color: var(--go-ink); }
.pill--stop { background: var(--stop-tint); color: var(--stop-ink); }
.pill--mute { background: var(--ground-2); color: var(--ink-3); }

.due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.due .ic { width: 15px; height: 15px; }
.due.is-soon,
.due.is-late { padding: 3px 8px 3px 6px; border-radius: 5px; font-weight: 600; }
.due.is-soon { background: var(--warn); color: var(--on-warn); }
.due.is-late { background: var(--stop); color: #fff; }

.way {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px 0 6px;
  border-radius: 6px;
  font-size: 12.5px;
  white-space: nowrap;
}
.way b { font-weight: 700; }
.way span { opacity: 0.86; }
.way .ic { width: 14px; height: 14px; }
.way--go { background: var(--go); color: #fff; }
.way--sign { background: var(--sign-tint); color: var(--sign-ink); }
.way--mute { background: var(--ground); color: var(--ink-3); }

/* ---------- fee ---------- */
.fee { text-align: right; }
.fee__amt { display: flex; align-items: flex-start; justify-content: flex-end; gap: 2px; line-height: 1; }
.fee__cur { margin-top: 3px; font: 700 15px/1 "Barlow", var(--f-ui); }
.fee__amt b { font: 800 40px/0.86 "Barlow", var(--f-ui); letter-spacing: -0.02em; }
.fee__sub { margin-top: 7px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.fee--lg .fee__cur { font-size: 20px; margin-top: 6px; }
.fee--lg .fee__amt b { font-size: 68px; }

/* ---------- route list ---------- */
.rt { display: grid; min-width: 0; }
.rt__stop { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; }
.rt__dot {
  justify-self: center;
  width: 13px;
  height: 13px;
  margin-top: 4px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}
.rt__stop--end .rt__dot { border-radius: 3px; background: var(--ink); }
.rt__stop b { display: block; font-weight: 700; font-size: 16px; line-height: 1.35; }
.rt__stop span { display: block; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); overflow-wrap: anywhere; }
.rt__leg {
  position: relative;
  padding: 7px 0 7px 27px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.rt__leg::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -3px;
  bottom: -3px;
  border-left: 2px dashed var(--rule-2);
}

/* ---------- waybill (task card) ---------- */
.wb {
  --notch: var(--ground);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--r-paper);
  background: var(--paper);
  box-shadow: var(--shadow-1);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), opacity 0.4s, filter 0.4s;
}
.wb:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.wb__top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 11px 14px;
  border-bottom: 1.5px dashed var(--rule-2);
}
.wb__top::before,
.wb__top::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--notch);
}
.wb__top::before { left: -7px; }
.wb__top::after { right: -7px; }
.wb__cat { font-weight: 600; font-size: 14px; white-space: nowrap; }
.wb__cat em { margin-left: 6px; font-style: normal; font-weight: 500; color: var(--ink-3); }
.wb__no {
  margin-left: auto;
  font: 600 12px/1 var(--f-label);
  letter-spacing: 0.08em;
  color: var(--ink-3);
  white-space: nowrap;
}
.wb__mid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 15px 14px 10px;
}
.wb__note {
  padding: 0 14px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wb__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-top: 1px solid var(--rule);
}
.wb__who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13.5px; }
.wb__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb__act { margin-left: auto; position: relative; z-index: 2; }
.wb__link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.wb--mine .wb__top { background: linear-gradient(90deg, var(--warn-tint), transparent 70%); }

.wb__stamp {
  position: absolute;
  z-index: 3;
  right: 22px;
  top: 58px;
  display: none;
  place-items: center;
  padding: 8px 14px 7px;
  border: 3px double var(--sign);
  border-radius: 8px;
  color: var(--sign);
  transform: rotate(-10deg) scale(1.8);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.wb__stamp b { font: 900 20px/1 var(--f-display); letter-spacing: 0.18em; }
.wb__stamp i { margin-top: 4px; font: 700 9px/1 var(--f-label); font-style: normal; letter-spacing: 0.3em; }
.wb.is-taken .wb__stamp { display: grid; animation: stamp 0.42s var(--ease-out) forwards; }
.wb.is-taken { pointer-events: none; }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-16deg) scale(1.9); }
  60% { opacity: 1; transform: rotate(-9deg) scale(0.96); }
  100% { opacity: 1; transform: rotate(-10deg) scale(1); }
}
.wb.is-leaving {
  animation: leave 0.5s var(--ease-io) forwards;
}
@keyframes leave {
  to { opacity: 0; transform: translateY(-10px) scale(0.97); }
}
.wb.is-gone { filter: grayscale(1); opacity: 0.5; }
.wb.is-gone::after {
  content: "已被接走";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  font: 900 18px/1 var(--f-display);
  letter-spacing: 0.2em;
  color: var(--ink);
}
.wb.is-new { animation: arrive 0.7s var(--ease-out) both; }
@keyframes arrive {
  from { opacity: 0; transform: translateY(14px); }
}
.wb.is-hot { box-shadow: 0 0 0 2px var(--sign), var(--shadow-2); }

/* ---------- progress: kilometre posts ---------- */
.road {
  --p: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-top: 2px;
}
.road__bar {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 11px;
  height: 6px;
  border-radius: 3px;
  background: var(--ground-2);
  overflow: hidden;
}
.road__bar i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, var(--sign) 0 10px, var(--sign-hi) 10px 20px);
  transform: scaleX(var(--p));
  transform-origin: left;
  transition: transform 0.9s var(--ease-out);
}
.road__post { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.road__k {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 22px;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink-3);
  font: 700 11px/1 "Barlow", var(--f-ui);
  box-shadow: inset 0 0 0 1.5px var(--rule-2);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.road__post b { font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.road__post em { font-style: normal; font-size: 11.5px; line-height: 1; color: var(--ink-3); min-height: 1em; }
.road__post.is-past .road__k { background: var(--sign); color: #fff; box-shadow: none; }
.road__post.is-now .road__k { background: var(--warn); color: var(--on-warn); box-shadow: 0 0 0 4px var(--warn-tint); }
.road__post.is-past b,
.road__post.is-now b { color: var(--ink); }
.road.is-off .road__bar i { background: var(--ink-3); }
.road.is-done .road__post:last-of-type .road__k { background: var(--go); color: #fff; }
.road.is-off .road__post.is-now .road__k { background: var(--ink-3); color: var(--paper); box-shadow: none; }
.road--sm .road__post b { font-size: 11.5px; }

/* ---------- empty state ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 20px 52px;
  text-align: center;
  color: var(--ink-2);
}
.empty__art { width: 190px; height: 95px; margin-bottom: 6px; }
.empty__road { stroke: var(--road); stroke-width: 16; }
.empty__lane { stroke: var(--paper); stroke-width: 2; stroke-dasharray: 10 10; }
.empty__post { fill: var(--ink-3); }
.empty__sign { fill: var(--sign); }
.empty__mark { fill: none; stroke: #fff; stroke-width: 4; }
.empty__head { fill: #fff; }
.empty h3 { font-size: 18px; color: var(--ink); }
.empty p { max-width: 26em; font-size: 14px; }
.empty .btn { margin-top: 10px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field__label small { margin-left: 6px; font-weight: 400; color: var(--ink-3); }
.input,
.textarea,
.select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--rule-2);
  border-radius: var(--r-ctl);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: none; }
.input:focus,
.textarea:focus,
.select:focus { outline: none; border-color: var(--sign); box-shadow: 0 0 0 4px var(--sign-tint); }
.input::placeholder,
.textarea::placeholder { color: var(--ink-3); }
.input.is-bad,
.textarea.is-bad { border-color: var(--stop); box-shadow: 0 0 0 4px var(--stop-tint); }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.err { font-size: 13px; color: var(--stop-ink); }

.selectwrap { position: relative; }
.selectwrap .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-3); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 42px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: var(--rule-2);
  cursor: pointer;
  transition: background-color 0.25s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.32s var(--ease-spring);
}
.switch input:checked { background: var(--go); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2.5px solid var(--sign); outline-offset: 2px; }

.stepper {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--rule-2);
}
.stepper button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 54px;
  color: var(--ink);
  border-radius: 12px;
  transition: background-color 0.2s;
}
.stepper button:hover { background: var(--ground); }
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; background: none; }
.stepper button .ic { width: 20px; height: 20px; }
.stepper output { min-width: 86px; text-align: center; font: 800 30px/1 "Barlow", var(--f-ui); font-variant-numeric: tabular-nums; }
.stepper output small { font-size: 16px; font-weight: 700; margin-right: 2px; }

.stars { display: inline-flex; gap: 2px; }
.stars i { display: inline-flex; color: var(--rule-2); }
.stars i.is-on { color: var(--warn); }
.stars .ic { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.stars--lg .ic { width: 34px; height: 34px; }

.barcode { display: block; height: 22px; width: 96px; fill: currentColor; }

/* ---------- sheets ---------- */
.layer { position: relative; z-index: 80; }
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.32s var(--ease);
}
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(90vh, 900px);
  border-radius: 20px 20px 0 0;
  background: var(--paper);
  box-shadow: var(--shadow-3);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(104%);
  transition: transform 0.44s var(--ease-out);
}
.sheet-wrap.is-open .sheet-scrim { opacity: 1; }
.sheet-wrap.is-open .sheet { transform: none; }
.sheet__grab { display: grid; place-items: center; height: 20px; flex: none; }
.sheet__grab i { width: 40px; height: 4px; border-radius: 2px; background: var(--rule-2); }
.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 16px 12px 20px;
  flex: none;
}
.sheet__head h2 { font-size: 21px; font-weight: 900; }
.sheet__head .label { margin-bottom: 6px; }
.sheet__x { margin: -4px -4px 0 0; }
.sheet__body { min-height: 0; overflow: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.sheet__foot {
  display: flex;
  gap: 10px;
  flex: none;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--rule);
}
.sheet__foot .btn { flex: 1; }

@media (min-width: 900px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet {
    width: min(560px, 100%);
    border-radius: 16px;
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: transform 0.4s var(--ease-out), opacity 0.25s var(--ease);
  }
  .sheet--sm { width: min(440px, 100%); }
  .sheet--lg { width: min(940px, 100%); }
  .sheet-wrap.is-open .sheet { opacity: 1; transform: none; }
  .sheet__grab { display: none; }
  .sheet__head { padding: 22px 18px 12px 24px; }
  .sheet__body { padding: 4px 24px 24px; }
  .sheet__foot { justify-content: flex-end; padding: 14px 24px 18px; }
  .sheet__foot .btn { flex: none; min-width: 112px; }
  .sheet-wrap.is-side { justify-content: flex-end; align-items: stretch; padding: 12px; }
  .is-side .sheet { width: 420px; max-height: none; transform: translateX(28px); }
}

.confirm { display: grid; gap: 14px; }
.confirm__text { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.confirm__text b { color: var(--ink); }
.confirm .rs { width: 64px; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  z-index: 95;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + var(--bar-h) + 16px);
  display: grid;
  gap: 8px;
  width: min(calc(100vw - 32px), 440px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
  transition: transform 0.42s var(--ease-out), opacity 0.3s;
  pointer-events: auto;
}
.toast .ic { width: 19px; height: 19px; flex: none; }
.toast--go .ic { color: var(--go); }
.toast--stop .ic { color: var(--stop); }
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translateY(-8px); }
.toast__act { margin-left: auto; padding-left: 8px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* ---------- campus map ---------- */
.cmapbox { container-type: inline-size; }
.cmap { display: block; width: 100%; height: auto; overflow: visible; }
.cm-big {
  display: none;
  fill: var(--ink);
  font: 900 31px var(--f-display);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 8px;
  stroke-linejoin: round;
}
/* mid-width maps: Chinese names only, a size up; narrow maps: only the places that matter, large */
@container (max-width: 640px) {
  .cm-en { display: none; }
  .cm-zh { font-size: 18px; }
}
@container (max-width: 480px) {
  .cm-lab,
  .cm-zones text { display: none; }
  .cm-big { display: inline; }
  .cm-dot { stroke-width: 4; }
}
.cm-zones rect { fill: var(--zone); }
.cm-zones text { fill: var(--zone-ink); font: 600 12px var(--f-label); letter-spacing: 0.14em; }
.cm-roads line { stroke: var(--road); stroke-width: 15; stroke-linecap: round; }
.cm-lanes line { stroke: var(--paper); stroke-width: 1.6; stroke-dasharray: 7 9; opacity: 0.85; }
.cm-mine { fill: none; stroke: var(--warn); stroke-width: 24; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.cm-route-base { fill: none; stroke: var(--sign); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.3s, stroke 0.3s; }
.cm-route-flow { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1 13; animation: cm-flow 1.1s linear infinite; }
@keyframes cm-flow { to { stroke-dashoffset: -14; } }
.cm-route.is-dim .cm-route-base { stroke: var(--ink-3); opacity: 0.28; }
.cm-route.is-dim .cm-route-flow { display: none; }
.cm-route.is-ink .cm-route-base { stroke: var(--ink); }
.cm-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 3; transition: fill 0.2s, stroke 0.2s; }
.cm-zh { fill: var(--ink); font: 700 15px var(--f-ui); }
.cm-en { fill: var(--ink-3); font: 600 9.5px var(--f-label); letter-spacing: 0.1em; }
.cm-pl.is-focus .cm-dot { fill: var(--ink); }
.cm-pl.is-pick { cursor: pointer; outline: none; }
.cm-hit { fill: transparent; }
.cm-pl.is-pick:hover .cm-dot,
.cm-pl.is-pick:focus-visible .cm-dot { fill: var(--sign); stroke: var(--sign); }
.cm-pl.is-pick:hover .cm-zh,
.cm-pl.is-pick:focus-visible .cm-zh { fill: var(--sign-ink); }
.cm-you-dot { fill: var(--warn); stroke: var(--ink); stroke-width: 3; }
.cm-you-pulse { fill: var(--warn); transform-box: fill-box; transform-origin: center; animation: cm-pulse 2.2s var(--ease-out) infinite; }
@keyframes cm-pulse { from { transform: scale(0.6); opacity: 0.75; } to { transform: scale(2.3); opacity: 0; } }
.cm-goal rect { fill: var(--ink); stroke: var(--warn); stroke-width: 3; }
.cm-mk { cursor: pointer; }
.cm-mk-pin { fill: var(--sign); stroke: var(--paper); stroke-width: 2.5; transition: fill 0.2s; }
.cm-mk-ch { fill: #fff; font: 900 14px var(--f-display); pointer-events: none; }
.cm-mk-n circle { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.cm-mk-n text { fill: var(--paper); font: 700 11px "Barlow", var(--f-ui); }
.cm-mk.is-hot .cm-mk-pin,
.cm-mk:hover .cm-mk-pin { fill: var(--ink); }
.cm-end rect { fill: var(--ink); stroke: var(--paper); stroke-width: 2.5; }
.cm-end path { fill: none; stroke: var(--paper); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cm-runner circle { fill: var(--sign); stroke: var(--paper); stroke-width: 2.5; }

/* ---------- road signs ---------- */
.rs { display: block; width: 100%; height: auto; }
.rs-blue { fill: var(--rs-blue); }
.rs-rim { stroke: var(--rs-white); }
.rs-white { color: var(--rs-white); }
.rs-ink { fill: var(--rs-black); }
.rs-yellow { fill: var(--rs-yellow); }
.rs-black { color: var(--rs-black); }
.rs-face { fill: var(--rs-white); }
.rs-red { stroke: var(--rs-red); }

.picto { display: block; width: 100%; height: auto; }

/* ---------- place picker ---------- */
.picker__grid { display: grid; gap: 16px; }
.picker__map { margin: 0 -8px; border-radius: 12px; background: var(--paper-2); padding: 6px; }
.picker__list { display: grid; gap: 14px; align-content: start; }
.picker__grp .label { margin-bottom: 8px; }
.picker__chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 900px) {
  .picker__grid { grid-template-columns: 1.45fr 1fr; align-items: start; }
  .picker__map { margin: 0; }
}
