/* เรดาร์รถไฟ — "รถไฟผ่านใกล้ฉัน" + "ฉันอยู่บนรถไฟ" (ใช้ตัวแปรสีเดียวกับ app.css) */

/* ---------- แผง (ต่อยอดจาก .detail) ---------- */
@media (min-width: 900px) {
  .locate {
    bottom: auto;
    max-height: calc(100dvh - 32px);
  }

  .has-locate .map-ctl,
  .has-locate .leaflet-bottom.leaflet-right {
    right: calc(32px + var(--detail-w));
  }
}

.locate .dt-body {
  gap: 12px;
}

.loc-head {
  --grip: currentcolor;

  overflow: hidden;
}

.loc-head.is-nearby {
  padding-bottom: 22px;
  color: #1c1406;
  background: linear-gradient(135deg, #fcd34d, #f59e0b 70%, #ea8a0b);
}

.loc-head.is-detect {
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
}

.loc-head.is-train {
  color: var(--tfg, #fff);
  background: linear-gradient(135deg, var(--tbg, #1968ab), color-mix(in srgb, var(--tbg, #1968ab) 60%, #000));
}

.loc-title {
  --i: 26px;

  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.loc-title h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.loc-title-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #dc2626;
  background: #fff;
  border: 3px solid #dc2626;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgb(0 0 0 / 22%);
}

.is-detect .loc-title-ico,
.is-train .loc-title-ico {
  color: #1d4ed8;
  border-color: #fff;
}

.loc-place {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0.9;
}

/* แถบไม้กั้นทางรถไฟ แดง-ขาว */
.loc-stripes {
  position: absolute;
  inset: auto 0 0;
  height: 7px;
  background: repeating-linear-gradient(-45deg, #dc2626 0 12px, #fff 12px 24px);
}

/* ---------- ฮีโร่: ขบวนต่อไป ---------- */
.loc-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 16px 14px 14px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tbg, #1968ab) 30%, transparent), transparent 70%),
    var(--card);
  border: 2px solid color-mix(in srgb, var(--tbg, #1968ab) 60%, var(--line));
  border-radius: 20px;
  transition: transform 0.12s, background 0.15s;
}

.loc-hero:hover {
  background-color: var(--card-hover);
}

.loc-hero:active {
  transform: scale(0.98);
}

.loc-hero-k {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.loc-count {
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.01em;
}

/* คำเตือนความปลอดภัย (ต้องเห็นเสมอใต้ตัวนับถอยหลัง / ใต้การ์ดว่าง) */
.loc-safety {
  display: block;
  max-width: 34em;
  margin: 2px auto 4px;
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--warn-t);
  text-align: center;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent);
  border-radius: 10px;
}

p.loc-safety {
  margin: 10px 0 4px;
}

.loc-count.is-now {
  color: #f97316;
  animation: loc-pulse 0.9s ease-in-out infinite;
}

.loc-hero-train {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 100%;
  text-align: left;
}

.loc-hero-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.loc-hero-txt b {
  font-size: 18px;
  line-height: 1.3;
}

.loc-hero-txt small {
  font-size: 13px;
  color: var(--muted);
}

.loc-hero-dir {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 14px;
  font-size: 15px;
  background: var(--card-hover);
  border-radius: 999px;
}

.loc-hero-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.loc-arrow {
  --i: 18px;

  display: inline-grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  transform: rotate(var(--r, 0deg));
}

.loc-arrow.sm {
  --i: 12px;

  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: -3px;
}

.loc-approx {
  display: inline-block;
  padding: 0 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 18px;
  color: var(--warn-t);
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  border-radius: 999px;
}

/* ---------- รายการ ---------- */
.loc-h {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 4px 4px 0;
  font-size: 15px;
  font-weight: 700;
}

.loc-count-n {
  padding: 0 8px;
  font-size: 12px;
  line-height: 20px;
  color: var(--muted);
  background: var(--card-hover);
  border-radius: 999px;
}

.loc-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.loc-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  text-align: left;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 0.15s;
}

.loc-row:hover {
  background: var(--card-hover);
  border-color: var(--line);
}

.loc-row.is-passed {
  opacity: 0.62;
}

.loc-row-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.loc-row-main b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-row-main small {
  overflow: hidden;
  font-size: 12.5px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-row-time {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 1px;
  align-items: flex-end;
}

.loc-row-time b {
  font-size: 17px;
  font-weight: 600;
}

.loc-row-time small {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.loc-none {
  padding: 14px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- สถานะรอ/ผิดพลาด/ว่าง ---------- */
.loc-wait,
.loc-empty,
.loc-end {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 22px 14px;
  text-align: center;
}

.loc-wait b,
.loc-empty b,
.loc-end b {
  font-size: 17px;
  line-height: 1.4;
}

.loc-wait p,
.loc-empty p,
.loc-end p {
  max-width: 320px;
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.loc-empty > span,
.loc-end > span {
  font-size: 46px;
  line-height: 1.1;
}

.loc-radar {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 4px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 50%;
}

.loc-radar::before {
  position: absolute;
  inset: 0;
  content: "";
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent 30%);
  border-radius: 50%;
  animation: loc-spin 1.6s linear infinite;
}

.loc-radar i {
  position: absolute;
  inset: 32px;
  background: var(--accent);
  border-radius: 50%;
}

.loc-err-ico {
  --i: 30px;

  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--warn-t);
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  border-radius: 50%;
}

.loc-dots {
  display: inline-flex;
  gap: 5px;
  margin-left: 4px;
  vertical-align: middle;
}

.loc-dots i {
  width: 9px;
  height: 9px;
  background: var(--line);
  border-radius: 50%;
}

.loc-dots i.on {
  background: var(--ok);
}

.loc-far {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  border-radius: 14px;
}

.loc-far > span {
  font-size: 30px;
  line-height: 1.1;
}

.loc-far b {
  font-size: 15.5px;
}

.loc-far p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.loc-note {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  background: var(--card);
  border-radius: 10px;
}

.loc-foot {
  margin: 4px 6px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

/* ---------- ปุ่ม/สวิตช์ ---------- */
.loc-ctl {
  display: grid;
  gap: 12px;
}

.loc-tog {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.loc-tog > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.loc-tog b {
  font-size: 14.5px;
  font-weight: 600;
}

.loc-tog small {
  font-size: 12px;
  color: var(--muted);
}

.loc-tog input {
  position: relative;
  flex: none;
  order: 2;
  width: 46px;
  height: 28px;
  margin: 0 0 0 auto;
  cursor: pointer;
  background: var(--line);
  border-radius: 999px;
  transition: background 0.2s;
  appearance: none;
}

.loc-tog input::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  content: "";
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(0 0 0 / 35%);
  transition: transform 0.2s var(--ease);
}

.loc-tog input:checked {
  background: var(--ok);
}

.loc-tog input:checked::before {
  transform: translateX(18px);
}

.loc-horn,
.loc-ghost {
  justify-self: start;
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--card-hover);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.loc-cta {
  width: 100%;
  min-height: 46px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 14px;
  transition: transform 0.1s, background 0.15s;
}

.loc-wait .loc-cta,
.loc-end .loc-cta {
  width: auto;
  min-width: 160px;
  margin-top: 6px;
}

.loc-horn:active,
.loc-ghost:active,
.loc-cta:active {
  transform: scale(0.97);
}

.loc-cta.is-on {
  color: #fff;
  background: var(--ok);
}

.loc-cta.big {
  min-height: 56px;
  font-size: 18px;
}

.loc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* ---------- หาขบวน ---------- */
.loc-cands {
  gap: 8px;
}

.loc-cand {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  transition: background 0.15s, transform 0.1s;
}

.loc-cand:hover {
  background: var(--card-hover);
}

.loc-cand:active {
  transform: scale(0.98);
}

.loc-cand.is-top {
  padding: 16px 14px;
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--tbg, #1968ab) 26%, transparent), transparent 70%),
    var(--card);
  border-color: color-mix(in srgb, var(--tbg, #1968ab) 70%, var(--line));
}

.loc-cand-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.loc-cand-q {
  font-size: 14.5px;
  line-height: 1.45;
}

.loc-cand-q b {
  margin-right: 4px;
  font-weight: 700;
}

.is-top .loc-cand-q {
  font-size: 16px;
}

.loc-cand-main small {
  font-size: 12px;
  color: var(--muted);
}

.loc-cand-yes {
  flex: none;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--ok);
  border-radius: 999px;
}

.loc-manual {
  display: grid;
  gap: 8px;
}

.loc-lbl {
  margin: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.loc-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: 600 16px var(--mono);
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

.loc-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ---------- บนขบวน ---------- */
.loc-gps {
  margin: 0;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border-radius: 10px;
}

.loc-gps.is-ok {
  color: var(--ok-t);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.loc-gps.is-warn {
  color: var(--warn-t);
  background: color-mix(in srgb, var(--warn) 13%, transparent);
}

.loc-gps.is-bad {
  color: var(--bad-t);
  background: color-mix(in srgb, var(--bad) 12%, transparent);
}

.loc-gps-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok-t);
  background: color-mix(in srgb, var(--ok) 13%, transparent);
  border-radius: 999px;
}

.loc-speed {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 14px;
}

.loc-gauge {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.loc-gauge-bg,
.loc-gauge-fg {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.loc-gauge-bg {
  stroke: var(--line);
}

.loc-gauge-fg {
  stroke: var(--accent);
  transition: stroke-dasharray 0.8s var(--ease);
}

.loc-speed-n {
  margin-top: -64px;
  font-size: 54px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.loc-speed-u {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.loc-speed-k {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.loc-next {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.loc-next > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.loc-k {
  font-size: 12.5px;
  color: var(--muted);
}

.loc-next-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.loc-next small {
  font-size: 13px;
  color: var(--muted);
}

.loc-next-time {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
}

.loc-next-time b {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--accent);
}

.loc-next-time span {
  margin-top: 2px;
  font-size: 13.5px;
  font-weight: 600;
}

.loc-prog-ends {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.loc-prog {
  position: relative;
  height: 10px;
  margin: 18px 14px 12px;
  background: var(--line);
  border-radius: 999px;
}

.loc-prog-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, transparent), var(--accent));
  border-radius: inherit;
  transition: width 1s linear;
}

.loc-prog-train {
  --i: 16px;

  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
  transition: left 1s linear;
}

.loc-dest-txt {
  margin: 0;
  font-size: 13.5px;
  text-align: center;
}

.loc-stops {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.loc-stops li {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  font-size: 14px;
  border-radius: 10px;
}

.loc-stops li:nth-child(odd) {
  background: var(--card);
}

.loc-stops li.is-next {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.loc-stops .mono {
  font-size: 13.5px;
  color: var(--muted);
}

.loc-stops b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-stops small {
  font-size: 12px;
  color: var(--muted);
}

.loc-alarm-card {
  display: grid;
  gap: 10px;
}

.loc-alarm-card .loc-h {
  margin: 0;
}

.loc-alarm-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px;
}

.loc-sel {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.loc-sel span {
  font-size: 12px;
  color: var(--muted);
}

.loc-sel select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* ---------- ปุ่มลอยเมื่อย่อ ---------- */
.loc-pill {
  position: fixed;
  bottom: 64px;
  left: calc(32px + var(--panel-w));
  z-index: 1150;
  max-width: min(460px, calc(100vw - var(--panel-w) - 48px));
  padding: 10px 18px;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--panel-solid);
  border: 2px solid var(--accent);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: loc-pill-in 0.3s var(--ease);
}

.loc-pill:hover {
  background: var(--card-hover);
}

/* ---------- หน้าต่างปลุก ---------- */
.loc-alarm {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(2 6 23 / 62%);
  backdrop-filter: blur(4px);
}

.loc-alarm-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: min(380px, 100%);
  padding: 26px 22px 22px;
  text-align: center;
  background: var(--panel-solid);
  border: 2px solid var(--warn);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.loc-alarm-ico {
  font-size: 64px;
  line-height: 1;
  animation: loc-shake 0.5s ease-in-out infinite;
}

.loc-alarm-box h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
}

.loc-alarm-box p {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- หมุดบนแผนที่ ---------- */
.loc-x-icon,
.loc-gps-icon {
  background: none;
  border: 0;
}

.loc-x {
  position: absolute;
  top: -22px;
  left: -22px;
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.loc-x-ring {
  position: absolute;
  inset: 0;
  border: 3px solid #facc15;
  border-radius: 50%;
  animation: loc-ring 1.8s ease-out infinite;
}

.loc-x-sign {
  --i: 22px;

  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  color: #dc2626;
  background: #fff;
  border: 3px solid #dc2626;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgb(0 0 0 / 45%);
}

.loc-gpsm {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.loc-gpsm-ring {
  position: absolute;
  inset: -8px;
  border: 3px solid #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 14px rgb(34 197 94 / 70%);
  animation: loc-ring 2s ease-out infinite;
}

.loc-gpsm-puck {
  --i: 20px;

  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tfg, #fff);
  background: var(--tbg, #1968ab);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgb(0 0 0 / 50%);
}

.loc-gpsm-label {
  position: absolute;
  top: 46px;
  left: 50%;
  padding: 1px 8px;
  font: 600 12px/18px var(--mono);
  color: #fff;
  white-space: nowrap;
  background: #15803d;
  border-radius: 999px;
  transform: translateX(-50%);
}

.is-sched .loc-gpsm-ring {
  border-color: var(--idle, #94a3b8);
  border-style: dashed;
  box-shadow: none;
  animation: none;
}

.is-sched .loc-gpsm-label {
  background: #475569;
}

/* หมุดประมาณการของขบวนที่เรานั่งอยู่ (ใช้หมุด GPS แทน) */
.leaflet-marker-icon.loc-hidden {
  display: none;
}

/* ---------- มือถือ: แผ่นเลื่อนด้านล่าง ---------- */
@media (max-width: 899px) {
  .locate {
    transform: translateY(calc(48dvh - 48px));
  }

  .locate[data-snap="full"] {
    transform: none;
  }

  .locate[data-snap="half"] .dt-body {
    padding-bottom: calc(48dvh - 24px);
  }

  .loc-head {
    padding-top: 0;
  }

  .loc-title {
    margin-top: 6px;
  }

  .loc-title h2 {
    font-size: 21px;
  }

  .loc-title-ico {
    width: 38px;
    height: 38px;
  }

  .loc-count {
    font-size: 42px;
  }

  .loc-speed {
    padding: 8px 12px 10px;
  }

  .loc-gauge {
    width: 170px;
  }

  .loc-speed-n {
    margin-top: -50px;
    font-size: 46px;
  }

  .loc-speed-k {
    margin-top: 2px;
  }

  .loc-head.is-train .dt-kicker {
    margin-top: 2px;
  }

  .loc-pill {
    inset: calc(10px + env(safe-area-inset-top)) 62px auto 10px;
    max-width: none;
    padding: 10px 14px;
    font-size: 14px;
    text-align: center;
  }

  .has-locpill .legend {
    visibility: hidden;
  }
}

/* มือถือแนวนอน: แผงอยู่ซ้ายสูงตามเนื้อหา เลื่อนทั้งแผ่น (app.css) · ปุ่มลอยอยู่บนแผนที่ด้านขวา */
@media (max-width: 899px) and (max-height: 500px) {
  .locate,
  .locate[data-snap] {
    bottom: auto;
    max-height: calc(100dvh - 16px);
    transform: none;
  }

  .locate[data-snap="half"] .dt-body {
    padding-bottom: 16px;
  }

  .loc-count {
    font-size: 34px;
  }

  .loc-pill {
    inset: calc(8px + env(safe-area-inset-top)) 62px auto calc(var(--side-l) + var(--side-w) + 8px);
  }
}

@media (max-width: 380px) {
  .loc-count {
    font-size: 38px;
  }

  .loc-hero-txt b {
    font-size: 16px;
  }

  .loc-speed-n {
    font-size: 42px;
  }

  .loc-next-name {
    font-size: 19px;
  }
}

/* ---------- animations ---------- */
@keyframes loc-pulse {
  50% {
    opacity: 0.75;
    transform: scale(1.08);
  }
}

@keyframes loc-spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes loc-ring {
  0% {
    opacity: 0.9;
    transform: scale(0.8);
  }

  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes loc-shake {
  25% {
    transform: rotate(-12deg);
  }

  75% {
    transform: rotate(12deg);
  }
}

@keyframes loc-pill-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
