/* เรดาร์รถไฟ — เมนูล่าง (มือถือ), แท็บสถานี, ลิงก์หน้าเว็บ, ป้ายอัปเดตแบบกดได้, คำแนะนำครั้งแรก, ข้อมูลสถานี
   ใช้ตัวแปรสีเดียวกับ app.css · แนวนอน = LAND_MQ ใน util.js */

:root {
  --bnav-h: 0px;
}

/* ---------- หัวแผง: โลโก้ · ชื่อ · ? · ภาษา · ธีม / แถวสอง = ป้ายอัปเดต (ข้อความยาวไม่โดนตัดบนจอแคบ) ---------- */
.brand {
  display: grid;
  grid-template-areas:
    "logo title help lang theme"
    "logo live live live live";
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 0 8px;
}

.brand-logo {
  grid-area: logo;
  margin-right: 4px;
}

.brand-text {
  grid-area: title;
  align-self: center;
}

#helpBtn {
  grid-area: help;
}

.brand .lang-btn {
  grid-area: lang;
  align-self: center;
}

#themeBtn {
  grid-area: theme;
}

.brand .live {
  grid-area: live;
  justify-self: start;
  margin: -4px 0 0;
}

/* ---------- ป้าย "อัปเดตเมื่อ …" (ปุ่ม: แตะ = อัปเดตทันที) ---------- */
button.live {
  max-width: 100%;
  min-height: 24px;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 6px;
}

#liveLabel {
  overflow: hidden;
  text-overflow: ellipsis;
}

button.live:hover #liveLabel {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

button.live:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.live.is-busy .live-dot {
  animation: live-spin 0.8s linear infinite;
}

@keyframes live-spin {
  50% {
    transform: scale(0.5);
  }
}

/* ---------- ปุ่มลัด: ลิงก์หน้าตาเหมือนปุ่ม ---------- */
a.chip-btn {
  color: inherit;
  text-decoration: none;
}

/* ---------- ปุ่มแผนที่ที่มีข้อความกำกับ (ไอคอน + ข้อความ) ---------- */
.fab.lbl {
  --i: 19px;

  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  line-height: 1;
}

.fab.lbl span {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* ---------- ลิงก์หน้าเว็บ (SSR) ---------- */
.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  margin: 14px 8px 6px;
  font-size: 13px;
}

.page-links a,
.page-link a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-link {
  margin: 12px 4px 0;
  font-size: 13.5px;
}

.page-link a {
  --i: 15px;

  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
}

.page-link svg {
  flex: none;
  width: var(--i);
  height: var(--i);
}

/* ---------- เวลาที่ รฟท. รายงานขบวนนี้ล่าสุด ---------- */
.sum-report {
  margin: 4px 0 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.sum-report:empty {
  display: none;
}

/* ---------- การ์ดสรุปขบวน: ออกจากต้นทาง / ถึงปลายทาง ---------- */
.sum-trip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.trip-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trip-cell.end {
  align-items: flex-end;
  text-align: right;
}

.trip-cell b {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
}

.trip-cell b.lv1 {
  color: var(--warn-t);
}

.trip-cell b.lv2 {
  color: var(--bad-t);
}

.trip-cell small {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.trip-cell [data-tick="dest"] {
  font-weight: 600;
  color: var(--accent);
}

/* ---------- แท็บสถานี ---------- */
.stations-body {
  padding: 2px 0 8px;
}

.st-near {
  display: flex;
  gap: 12px;
  align-items: center;
  width: calc(100% - 8px);
  min-height: 60px;
  margin: 4px 4px 8px;
  padding: 10px 12px;
  color: #1c1406;
  text-align: left;
  background: linear-gradient(135deg, #fcd34d, #f59e0b 80%);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgb(245 158 11 / 25%);
}

.st-near-ico {
  --i: 22px;

  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgb(255 255 255 / 45%);
  border-radius: 50%;
}

.st-near-txt {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.st-near-txt b {
  font-size: 15.5px;
}

.st-near-txt small {
  font-size: 12.5px;
  opacity: 0.85;
}

.st-go {
  flex: none;
  font-size: 22px;
  line-height: 1;
  opacity: 0.6;
}

.st-group .count {
  color: var(--muted);
  background: var(--card-hover);
}

.st-list {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.st-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 6px 10px;
  text-align: left;
  border-radius: 12px;
  transition: background 0.15s;
}

.st-row:hover {
  background: var(--card-hover);
}

.st-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

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

.st-name small {
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-tel {
  --i: 15px;

  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--ok-t);
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-radius: 50%;
}

/* ---------- ข้อมูลสถานี (โทร/นำทาง/สิ่งอำนวยความสะดวก) ---------- */
.dt-info:empty {
  display: none;
}

.si-card {
  margin-top: 12px;
}

.si-h {
  margin: 0 0 10px;
  font-size: 15px;
}

.si-act {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.si-btn {
  --i: 17px;

  display: inline-flex;
  flex: 1 1 auto;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  padding: 6px 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: #04202f;
  text-decoration: none;
  background: var(--accent);
  border-radius: 12px;
}

.si-btn svg {
  flex: none;
  width: var(--i);
  height: var(--i);
}

.si-btn.alt,
.si-btn.nav {
  color: var(--text);
  background: var(--card-hover);
  border: 1px solid var(--line);
}

.si-note,
.si-none {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.si-note a {
  color: var(--accent);
}

.si-list {
  margin: 12px 0 0;
}

.si-row {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.si-row dt {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.si-row dd {
  margin: 2px 0 0;
  font-size: 13.5px;
}

.si-row ul {
  margin: 0;
  padding-left: 18px;
}

.si-src {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.si-src a {
  display: inline-block;
  min-width: 24px;
  min-height: 24px;
  color: var(--accent);
  text-align: center;
}

/* ---------- คำแนะนำครั้งแรก (dialog) ---------- */
.guide {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(3 7 18 / 62%);
  animation: guide-fade 0.2s ease-out;
}

.guide[hidden] {
  display: none;
}

.guide-card {
  width: min(400px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 20px 20px 16px;
  text-align: center;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  animation: guide-in 0.28s var(--ease);
}

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

.guide-ico {
  --i: 34px;

  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 12px 0 4px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 50%;
}

.guide-ico svg {
  width: var(--i);
  height: var(--i);
}

.guide-card h2 {
  margin: 6px 0;
  font-size: 20px;
}

.guide-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.guide-legend {
  margin: 12px 0 0;
  padding: 10px 12px;
  text-align: left;
  background: var(--card);
  border-radius: 14px;
}

.guide-legend b {
  font-size: 13px;
}

.guide-legend ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 6px 0 0;
  padding: 0;
  font-size: 12.5px;
  list-style: none;
}

.guide-legend li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.guide-legend li.wide {
  grid-column: 1 / -1;
}

.lg-seg {
  flex: none;
  width: 22px;
  height: 0;
  margin-right: 7px;
  border-top: 3px dashed var(--bad);
}

.lg-seg.warn {
  border-top-color: var(--warn);
}

.guide-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 14px 0;
}

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

.guide-dots i.on {
  width: 22px;
  background: var(--accent);
  border-radius: 4px;
}

.guide-act {
  display: flex;
  gap: 10px;
}

.guide-btn {
  flex: 1;
  min-height: 48px;
  font-size: 15.5px;
  font-weight: 700;
  color: #04202f;
  background: var(--accent);
  border-radius: 14px;
}

.guide-btn.ghost {
  color: var(--text);
  background: var(--card-hover);
}

@keyframes guide-fade {
  from {
    opacity: 0;
  }
}

@keyframes guide-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

/* ---------- เมนูล่าง: ซ่อนบนจอใหญ่ (ใช้แท็บ/ปุ่มลัดในแผงซ้าย) ---------- */
.bnav {
  display: none;
}

@media (max-width: 899px) {
  .bnav {
    position: fixed;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--panel-solid);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgb(0 0 0 / 18%);
  }

  .bnav-btn {
    --i: 22px;

    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 52px;
    padding: 4px 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 12px;
    transition: color 0.15s;
  }

  .bnav-btn svg {
    width: var(--i);
    height: var(--i);
  }

  .bnav-btn span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ส่วนที่กำลังดู: ไอคอนมีพื้นหลังแคปซูล + ตัวหนังสือสีหลัก */
  .bnav-btn::before {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 52px;
    height: 28px;
    content: "";
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-radius: 14px;
    opacity: 0;
    transform: translateX(-50%) scaleX(0.6);
    transition: opacity 0.2s, transform 0.2s var(--ease);
  }

  .bnav-btn[aria-current="page"] {
    color: var(--accent);
  }

  .bnav-btn[aria-current="page"]::before {
    opacity: 1;
    transform: translateX(-50%);
  }

  .bnav-btn svg,
  .bnav-btn span {
    position: relative;
  }

  .bnav-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }

  /* ปุ่ม "ใกล้ฉัน" ในแถวปุ่มลัด → อยู่ในเมนูล่างแล้ว (โหมดเด็กยังใช้ในแถว) */
  html:not(.kid) .quick #nearbyBtn {
    display: none;
  }

  /* โหมดเด็ก: ไม่มีเมนูล่าง (ปุ่มใหญ่ในแผงแทน) */
  .kid {
    --bnav-h: 0px;
  }

  .kid .bnav {
    display: none;
  }

  /* คำอธิบายหมุดไม่ทับปุ่มแผนที่ที่มีข้อความ (กว้าง 52px) */
  .legend {
    max-width: calc(100vw - 84px);
  }

  /* แถวปุ่มลัดบนมือถือ (ไม่มี "ใกล้ฉัน"): ฉันอยู่บนรถไฟ · รู้จักรถไฟไทย / สุ่มขบวน · โหมดเด็ก */
  html:not(.kid) .quick > #kidBtn {
    grid-column: auto;
  }
}

.kid #galleryBtn {
  display: none;
}

/* ---------- มือถือแนวตั้ง: เมนูเต็มความกว้างล่างสุด · แผ่นเลื่อนทุกแผ่นวางเหนือเมนู ---------- */
@media (max-width: 899px) and (min-height: 501px), (max-width: 899px) and (max-aspect-ratio: 4/3) {
  :root {
    --bnav-h: calc(58px + env(safe-area-inset-bottom));

    /* แผ่นย่อ = ปุ่ม ^ + หัวแผง + ช่องค้นหา + แถวตัวเลขเต็มแถว (เดิม 188 ตัดตัวเลขครึ่งช่อง) */
    --peek: 206px;
  }

  /* หัวแผงกระชับ: แผ่นย่อเห็นตัวเลขครบโดยกินแผนที่เพิ่มน้อยที่สุด */
  html:not(.kid) .panel-grip {
    min-height: 0;
    padding: 4px 0 0;
  }

  html:not(.kid) .brand {
    padding-bottom: 4px;
  }

  html:not(.kid) .stats {
    margin-top: 8px;
  }

  html:not(.kid) .stat {
    padding-block: 4px;
  }

  html:not(.kid) .stat b {
    font-size: 21px;
  }

  .bnav {
    inset: auto 0 0;
    height: var(--bnav-h);
    padding: 3px 4px env(safe-area-inset-bottom);
  }

  .panel {
    bottom: var(--bnav-h);
    height: calc(100dvh - 48px - var(--bnav-h));
    padding-bottom: 0;
    transform: translateY(calc(100% - var(--peek)));
  }

  .detail {
    bottom: var(--bnav-h);
    height: calc(100dvh - 48px - var(--bnav-h));
  }

  .leaflet-bottom.leaflet-right {
    bottom: calc(var(--peek) + var(--bnav-h));
  }

  .pwa-ios {
    bottom: calc(var(--bnav-h) + 10px);
  }

  /* โหมดเด็ก: แผงกลับไปชิดขอบล่างตามเดิม */
  .kid .panel {
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(calc(100% - var(--peek) - env(safe-area-inset-bottom)));
  }

  .kid .panel[data-snap="half"] {
    transform: translateY(calc(44dvh - 48px));
  }

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

/* ---------- คีย์บอร์ดขึ้น (viewport.js): แผ่นที่กางเต็มพอดีส่วนที่มองเห็น ช่องพิมพ์อยู่เหนือคีย์บอร์ด ---------- */
@media (max-width: 899px) {
  html.kb-open {
    --bnav-h: 0px;
  }

  html.kb-open .bnav {
    display: none;
  }

  html.kb-open .panel[data-snap="full"],
  html.kb-open .locate[data-snap="full"] {
    top: calc(var(--vvt, 0px) + 6px);
    bottom: auto;
    height: calc(var(--vvh, 100dvh) - 12px);
    transform: none;
    transition: none;
  }
}

/* ---------- มือถือแนวนอน: เมนูเป็นแถบใต้แผ่นด้านซ้าย ---------- */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) and (min-aspect-ratio: 4/3) {
  :root {
    --bnav-h: 50px;
  }

  .bnav {
    bottom: calc(6px + env(safe-area-inset-bottom));
    left: var(--side-l);
    width: var(--side-w);
    height: var(--bnav-h);
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .bnav-btn {
    --i: 17px;

    gap: 1px;
    min-height: 44px;
    padding: 2px;
    font-size: 10.5px;
  }

  .bnav-btn::before {
    top: 2px;
    width: 40px;
    height: 22px;
  }

  html:not(.kid) .panel,
  html:not(.kid) .panel[data-snap],
  html:not(.kid) .detail:not(.locate),
  html:not(.kid) .detail:not(.locate)[data-snap] {
    bottom: calc(12px + var(--bnav-h) + env(safe-area-inset-bottom));
  }

  html:not(.kid) .panel[data-snap="peek"] {
    bottom: auto;
    max-height: min(var(--peek), calc(100dvh - 26px - var(--bnav-h)));
  }

  html:not(.kid) .locate,
  html:not(.kid) .locate[data-snap] {
    max-height: calc(100dvh - 26px - var(--bnav-h));
  }
}

@media (min-width: 640px) and (max-width: 899px) and (min-height: 501px) {
  .bnav {
    padding-inline: max(4px, calc((100vw - 620px) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide,
  .guide-card,
  .bnav-btn::before {
    transition: none;
    animation: none;
  }
}

/* ---------- เที่ยวของขบวนเลขซ้ำ · งดบางช่วง "วิ่งเฉพาะ" · ชานชาลาคำยาว ---------- */
.run-chip {
  display: inline-block;
  margin: 0 6px 0 0;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  color: var(--accent);
  white-space: nowrap;
  vertical-align: 1px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 999px;
}

.sr-main b .run-chip {
  margin: 0 0 0 6px;
}

.cut-run {
  --i: 15px;

  display: flex;
  gap: 6px;
  align-items: center;
  margin: 6px 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--warn-t);
}

.cut-run svg {
  flex: none;
  width: var(--i);
  height: var(--i);
}

.bd-pf.long {
  width: auto;
  min-width: 34px;
  padding: 0 3px;
  font-size: 10.5px;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.fab.is-busy svg {
  animation: spin 1s linear infinite;
}

/* ---------- แบบแผนที่ (layers.js): มืด / สว่าง / ดาวเทียม + คำอธิบายสี ---------- */
.lyr-pop {
  position: fixed;
  right: 84px;
  bottom: 30px;
  z-index: 1250;
  width: min(320px, calc(100vw - 100px));
  max-height: calc(100dvh - 60px);
  padding: 12px 14px 14px;
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.lyr-pop[hidden] {
  display: none;
}

.lyr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lyr-head h3 {
  margin: 0;
  font-size: 15px;
}

.lyr-opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.lyr-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 4px 4px 6px;
  font-size: 12.5px;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 12px;
}

.lyr-opt img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--card);
  border-radius: 8px;
}

.lyr-opt[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.lyr-note {
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.lyr-pop .guide-legend {
  margin-top: 10px;
}

/* ดาวเทียม: ภาพถ่ายสีจริง (ไม่ใส่ฟิลเตอร์โทนเรดาร์ของธีมมืด) */
:root[data-theme] .base-sat .leaflet-tile-pane {
  filter: none;
}

/* ดาวเทียม: หมุดขบวน/สถานีมีขอบให้อ่านออกบนภาพถ่าย · ป้ายชื่อสถานีมีเงา */
.base-sat .tm-puck {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgb(0 0 0 / 55%), 0 2px 8px rgb(0 0 0 / 50%);
}

.base-sat .st-label {
  color: #fff;
  text-shadow: 0 0 3px #000, 0 0 6px #000;
}

@media (max-width: 899px) {
  .lyr-pop {
    top: calc(10px + env(safe-area-inset-top));
    right: calc(72px + env(safe-area-inset-right));
    bottom: auto;
    width: min(320px, calc(100vw - 88px));
  }
}

/* ---------- รูปสถานี (stationphoto.js) — เตี้ยพอไม่ดันตารางเวลาหลุดจอ ---------- */
.dt-photo:empty {
  display: none;
}

.st-photo {
  margin: 0 0 12px;
}

.st-photo img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--card);
  border-radius: 14px;
}

.st-photo figcaption {
  margin: 5px 2px 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.st-photo figcaption a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 899px) {
  .st-photo img {
    height: 150px;
  }
}

.tl-legend {
  margin: 0 2px 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- จอสัมผัส: พื้นที่แตะ ≥ 40 px (ภาพเท่าเดิม ขยายด้วย padding/pseudo-element) ---------- */
@media (pointer: coarse) {
  /* ป้าย "อัปเดต N วินาทีก่อน" (แตะ = อัปเดต): สูง 40 px แต่ตำแหน่งตัวหนังสือเดิม */
  .brand .live {
    min-height: 40px;
    margin: -12px 0 -8px;
  }

  /* ที่จับแผ่นเลื่อน: ขยายพื้นที่แตะลงไปด้านล่างโดยไม่ดันเนื้อหา */
  .panel-grip,
  .dt-grip {
    position: relative;
  }

  .panel-grip::after,
  .dt-grip::after {
    position: absolute;
    inset: -4px 0 -14px;
    content: "";
  }
}

/* จอแคบมาก (iPhone SE 320 px): ชื่อเว็บไม่ตัดบรรทัด */
@media (max-width: 340px) {
  .brand h1 {
    font-size: 17px;
    white-space: nowrap;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand {
    gap: 0 6px;
  }
}

/* ภาษาอังกฤษ "Rotfai Radar" ยาวกว่า "เรดาร์รถไฟ": จอแคบ/แนวนอนขึ้น 2 บรรทัดแบบชิด (ไม่ทับปุ่ม ? ที่ 320 px) */
@media (max-width: 380px), (max-width: 899px) and (max-height: 500px) and (orientation: landscape) and (min-aspect-ratio: 4/3) {
  html[lang="en"] .brand h1 {
    font-size: 17px;
    line-height: 1.1;
    white-space: normal;
  }
}
