:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1b1f24;
  --muted: #5d6673;
  --line: #e1e5ea;
  --accent: #d6285a;
  --accent-ink: #ffffff;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body { display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: #16191d;
  color: #fff;
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent) 0 55%, #fff 56% 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .25);
}
.brand h1 { margin: 0; font-size: 17px; line-height: 1.1; }
.brand p { margin: 2px 0 0; font-size: 12px; color: #aab2bd; }

.btn {
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { background: #f0f2f5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.on { background: #fff3f6; border-color: var(--accent); color: var(--accent); }
.topbar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.topbar .btn:hover { background: rgba(255, 255, 255, .12); }

/* ---------- layout ---------- */
#app { flex: 1 1 auto; display: flex; min-height: 0; }
#panel {
  flex: 0 0 390px;
  max-width: 100%;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
#map { flex: 1 1 auto; min-width: 0; background: #dfe6ec; }

/* ---------- filters ---------- */
.filters {
  position: sticky; top: 0; z-index: 5;
  padding: 12px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.filters input[type="search"], .filters select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.filters .row { display: flex; gap: 8px; margin-top: 8px; }
.filters .row label { flex: 1 1 0; display: block; font-size: 12px; color: var(--muted); }
.filters .row select { margin-top: 3px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 13px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.ring { box-shadow: 0 0 0 3px rgba(230, 0, 40, .45); background: #888; width: 8px; height: 8px; margin: 0 3px; }

/* ---------- map pins ---------- */
.pin-wrap { background: none; border: 0; }
.pin {
  display: block; width: 16px; height: 16px; margin: 4px;
  border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  transition: transform .12s;
}
.pin.has-cam { box-shadow: 0 0 0 3px rgba(230, 0, 40, .55), 0 1px 4px rgba(0, 0, 0, .5); }
.pin.sel { transform: scale(1.45); }

/* ---------- place card ---------- */
.card { padding: 14px; border-bottom: 8px solid var(--bg); }
.card h2 { margin: 0; font-size: 19px; line-height: 1.25; }
.card .ja { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.badge {
  font-size: 11.5px; padding: 3px 8px; border-radius: 999px;
  background: #eef1f5; color: #3a4350;
}
.card .desc { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }

.player { margin: 0 0 8px; }
.player .frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.player .meta a { color: var(--accent); }

.cams { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.cams li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px;
}
.cams .cam-title { min-width: 0; overflow-wrap: anywhere; }
.cams .cam-title small { display: block; color: var(--muted); font-size: 11.5px; }
.cams .cam-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.empty { margin: 0 0 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.actions a.btn { text-decoration: none; display: inline-block; }

details.add { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
details.add summary { cursor: pointer; font-weight: 600; }
details.add form { display: grid; gap: 6px; margin-top: 8px; }
details.add input[type="text"], details.add input[type="url"] {
  font: inherit; font-size: 13.5px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; width: 100%;
}
details.add .note { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
details.add .msg { margin: 0; font-size: 12.5px; color: var(--accent); min-height: 1em; }

/* ---------- results list ---------- */
.results { padding: 6px 0 24px; }
.count { margin: 0; padding: 10px 14px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li button {
  width: 100%; text-align: left; font: inherit; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 10px 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.list li button:hover, .list li button.active { background: #f3f5f8; }
.list .place-name { font-size: 14px; font-weight: 600; }
.list .place-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.list .tags { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: 12px; }
.live-tag { color: #fff; background: #d0002a; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.empty-list { padding: 18px 14px; color: var(--muted); font-size: 13.5px; }

/* ---------- small screens: map on top, panel below ---------- */
@media (max-width: 800px) {
  #app { flex-direction: column-reverse; }
  #map { flex: 0 0 42vh; }
  #panel { flex: 1 1 auto; border-right: 0; border-top: 1px solid var(--line); }
  .filters { position: static; }
}

/* ---------- temperature ---------- */
.temp { margin: 8px 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.temp-val { font-size: 20px; font-weight: 700; color: var(--ink); }
.temp-sub { font-size: 12.5px; }

/* ---------- map popup ---------- */
.jp-popup .leaflet-popup-content { margin: 12px 14px; max-height: 60vh; overflow-y: auto; font-family: inherit; }
.pop h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.pop .ja { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.pop .temp { margin: 6px 0; }
.pop-img { display: block; width: 100%; max-height: 170px; object-fit: cover; border-radius: 8px; margin: 6px 0 8px; }
.pop-label { margin: 8px 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pop-desc { margin: 0 0 6px; font-size: 13px; line-height: 1.55; }
.pop-loading { margin: 4px 0; font-size: 12.5px; color: var(--muted); }
.pop-src { margin: 4px 0 8px; font-size: 11.5px; color: var(--muted); }
.pop-src a { color: var(--accent); }
.pop-cams { margin: 6px 0 4px; font-size: 12.5px; font-weight: 600; }
.pop-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-links a.btn { text-decoration: none; font-size: 12.5px; padding: 5px 10px; color: var(--ink); }
.pop-links a.btn.primary { color: #fff; }

/* ================= v7: quick search, drawer, modal ================= */
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.quick { position: sticky; top: 0; z-index: 6; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.quick input[type="search"] {
  width: 100%; font: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.suggest {
  list-style: none; margin: 6px 0 0; padding: 0; max-height: 50vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.suggest li button {
  width: 100%; text-align: left; font: inherit; background: none; border: 0; cursor: pointer;
  padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.suggest li:last-child button { border-bottom: 0; }
.suggest li button:hover, .suggest li button.hl { background: #f3f5f8; }
.suggest small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.suggest .add-row button { color: var(--accent); font-weight: 600; }

.drawer { position: fixed; inset: 0; z-index: 2000; display: flex; }
.drawer[hidden], .modal[hidden] { display: none; }
.drawer-back, .modal-back { position: absolute; inset: 0; background: rgba(15, 18, 22, .45); }
.drawer-box {
  position: relative; width: 420px; max-width: 100%; height: 100%; overflow-y: auto;
  background: var(--panel); box-shadow: 4px 0 24px rgba(0,0,0,.25);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer .filters { top: 0; }
.filters input[type="search"] { width: 100%; }

.modal { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box {
  position: relative; width: 520px; max-width: 100%; max-height: 92vh; overflow-y: auto;
  background: var(--panel); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.modal-body { padding: 14px; display: grid; gap: 10px; font-size: 13.5px; }
.modal-body label { display: block; font-size: 12px; color: var(--muted); }
.modal-body input[type="text"], .modal-body select {
  display: block; width: 100%; margin-top: 3px; font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.modal-body .row2 { display: flex; gap: 8px; }
.modal-body .row2 > * { flex: 1 1 0; }
.modal-body .hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-body .msg { margin: 0; font-size: 12.5px; color: var(--accent); min-height: 1em; }
.found { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 190px; overflow-y: auto; }
.found:empty { display: none; }
.found li button { width: 100%; text-align: left; font: inherit; font-size: 13px; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; cursor: pointer; }
.found li:last-child button { border-bottom: 0; }
.found li button:hover { background: #f3f5f8; }
.pick-banner {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 1900;
  background: #16191d; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.pick-banner button { margin-left: 10px; }
.map-picking, .map-picking .leaflet-interactive { cursor: crosshair !important; }

/* การ์ดข้อมูลหลัก (แสดงตลอด) */
.card .hero { display: block; width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; margin: 0 0 10px; }
.card .sec-label { margin: 12px 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.card .wiki p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }
.card .wiki .src { font-size: 12px; color: var(--muted); }
.card .wiki .src a, .card .wiki a { color: var(--accent); }
.card .wiki .loading { color: var(--muted); font-size: 13px; }
.badge.wh { background: #fff4d6; color: #7a5600; }
.badge.mine { background: #e6f4ea; color: #1e6b34; }
.wh-star { color: #c28a00; }
.card .coords { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

.leaflet-tooltip.jp-tip { font-family: inherit; font-size: 12.5px; font-weight: 600; }

@media (max-width: 800px) {
  .quick { position: static; }
  .brand p { display: none; }
  .top-actions .btn { padding: 6px 9px; font-size: 12.5px; }
  .drawer-box { width: 100%; }
}

/* ---------- 7-day forecast ---------- */
.forecast { display: flex; gap: 6px; overflow-x: auto; margin: 2px 0 10px; padding-bottom: 2px; }
.forecast .loading { margin: 0; font-size: 12.5px; color: var(--muted); }
.fday {
  flex: 0 0 auto; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; font-size: 12px;
}
.fd-name { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.fd-ic { font-size: 16px; }
.fd-max { font-weight: 700; }
.fd-min { color: var(--muted); font-size: 11px; }

/* ---------- presented by (channel credit) ---------- */
.presented-by {
  display: flex; align-items: center; gap: 6px; margin: 0 auto 0 16px;
  font-size: 11.5px; color: #c7cdd6; text-decoration: none; white-space: nowrap;
}
.presented-by:hover { color: #fff; }
.presented-by .channel-badge {
  width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #fff;
}
.presented-by .channel-name { font-weight: 600; color: #e7eaef; }

/* ---------- account button / avatar ---------- */
.account-btn { display: inline-flex; align-items: center; gap: 6px; }
.account-avatar { width: 18px; height: 18px; border-radius: 50%; background-size: cover; background-position: center; flex: 0 0 auto; }
.account-avatar.letter {
  display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
}

/* ---------- account modal ---------- */
.acct-guest-note { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--ink); }
.acct-reason { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #fff3f6; color: var(--accent); font-size: 12.5px; }
.acct-provider { margin: 6px 0; }
.acct-provider.disabled { opacity: .55; }
.acct-provider .btn[disabled] { cursor: not-allowed; }
.acct-note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.acct-profile { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.acct-profile img { width: 44px; height: 44px; border-radius: 50%; }
.acct-profile .name { font-weight: 700; font-size: 15px; }
.acct-profile .email { font-size: 12px; color: var(--muted); }
.acct-perks { margin: 10px 0; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

@media (max-width: 800px) {
  .presented-by { display: none; }
}

/* ---------- language switch (TH / EN) ---------- */
.lang-switch {
  display: inline-flex; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; overflow: hidden;
}
.lang-opt {
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border: 0; background: transparent;
  color: rgba(255,255,255,.75); cursor: pointer; line-height: 1;
}
.lang-opt.on { background: #fff; color: #16191d; }
.lang-opt:not(.on):hover { color: #fff; background: rgba(255,255,255,.12); }

@media (max-width: 800px) {
  .lang-opt { padding: 6px 9px; font-size: 11.5px; }
}

/* ---------- camera-only quick filter (topbar icon button) ---------- */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 9px; line-height: 0; }
.icon-btn svg { display: block; }
.icon-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.icon-btn:not(.on):hover { background: rgba(255,255,255,.12); }

/* ---------- v14: compact mobile layout (final override) ---------- */
.btn .ico { margin-right: 5px; }
@media (max-width: 800px) {
  .topbar { padding: 6px 10px; gap: 8px; flex-wrap: nowrap; }
  .brand { gap: 7px; min-width: 0; flex: 0 1 auto; }
  .brand-mark { width: 20px; height: 20px; flex: 0 0 auto; }
  .brand h1 { font-size: 14px; white-space: nowrap; }
  .top-actions { flex-wrap: nowrap; gap: 5px; flex: 0 0 auto; }
  .top-actions .btn { padding: 5px 8px; font-size: 12px; line-height: 1.2; white-space: nowrap; }
  .btn .ico { margin-right: 0; font-size: 14px; }
  #btn-all .lbl, #btn-add .lbl { display: none; }
  .icon-btn { padding: 5px 8px; }
  .icon-btn svg { width: 15px; height: 15px; }
  .account-btn { gap: 4px; max-width: 84px; }
  .account-btn #account-label { overflow: hidden; text-overflow: ellipsis; }
  .lang-opt { padding: 5px 8px; font-size: 11px; }
  /* map gets most of the screen; panel below is slim */
  #map { flex: 1 1 auto; min-height: 0; }
  #app { flex-direction: column-reverse; }
  #panel { flex: 0 0 auto; max-height: 42%; }
  .quick { padding: 6px 10px; }
  .quick input[type="search"] { padding: 7px 10px; font-size: 14px; }
  .card { padding: 10px 12px; }
  .card h2 { font-size: 17px; }
}
@media (max-width: 360px) {
  .brand h1 { font-size: 12.5px; }
  .account-btn #account-label { display: none; }
}

/* ---------- v14: small brand icons on link buttons ---------- */
.ico-yt::before, .ico-gm::before {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px;
  background-repeat: no-repeat; background-size: contain; background-position: center;
}
.ico-yt::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='1' y='4.5' width='22' height='15' rx='4.5' fill='%23ff0000'/%3E%3Cpath d='M10 8.8v6.4l5.6-3.2z' fill='%23fff'/%3E%3C/svg%3E"); }
.ico-gm::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5a7.5 7.5 0 0 0-7.5 7.5c0 5.4 7.5 13.5 7.5 13.5s7.5-8.1 7.5-13.5A7.5 7.5 0 0 0 12 1.5z' fill='%23ea4335'/%3E%3Ccircle cx='12' cy='9' r='3' fill='%23fff'/%3E%3C/svg%3E"); }

/* ---------- v15: card toolbar sits beside the title ---------- */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { min-width: 0; flex: 1 1 auto; }
.tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; flex: 0 0 auto; max-width: 96px; }
.btn.tool { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 34px; padding: 0; font-size: 16px; line-height: 1; text-decoration: none; }
.btn.tool.ico-yt::before, .btn.tool.ico-gm::before { margin-right: 0; width: 18px; height: 18px; vertical-align: 0; }
@media (max-width: 800px) { .tools { max-width: 160px; } }

/* ---------- v19: swipeable photo gallery ---------- */
.gallery { position: relative; margin: 0 0 10px; }
.gtrack { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: 8px; }
.gtrack::-webkit-scrollbar { display: none; }
.gtrack img { flex: 0 0 100%; width: 100%; height: 200px; object-fit: cover; scroll-snap-align: center; border-radius: 8px; background: #e9edf1; margin: 0; max-height: none; }
.gnav { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 0 3px; }
.gnav:hover { background: rgba(0,0,0,.65); }
.gprev { left: 8px; } .gnext { right: 8px; }
.gcount { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }

/* ---------- v23: main-photo picker ---------- */
.gpick { margin: 0 0 10px; font-size: 12.5px; padding: 5px 10px; }
.gmain { order: -1; }
.photo-box { max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.pthumb { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #e9edf1; cursor: pointer; aspect-ratio: 4 / 3; }
.pthumb:hover { border-color: var(--accent); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ppreview { display: grid; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ppreview[hidden] { display: none; }
.pbig { width: 100%; max-height: 260px; object-fit: contain; background: #111; border-radius: 8px; }

/* ---------- v25: hidden slides must really be hidden (.card .hero sets display:block) ---------- */
.gtrack img[hidden], .gallery [hidden] { display: none !important; }

/* v26: ป๊อปอัปกล้องสด */
.cam-box { width: min(860px, 96vw); max-height: 94vh; display: flex; flex-direction: column; }
.cam-box .modal-body { overflow: auto; padding: 10px 14px 14px; }
.cam-box .frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.cam-box .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cam-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px; }
.cam-tabs .btn { white-space: nowrap; flex: 0 0 auto; }
.cam-tabs .btn.on { background: #1f6feb; color: #fff; }
.cam-box h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .cam-box { width: 100vw; max-height: 100vh; border-radius: 0; } }



/* v28: หมุดรวมกลุ่มแบบป้ายหมุด + ลูกเล่น */
.jp-cl-wrap { background: none; border: 0; }
.jp-cl {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px 0 6px; border-radius: 13px;
  background: #fff; border: 1px solid #e3dccd; color: #2b2b2b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
  font: 700 12px/1 system-ui, sans-serif; white-space: nowrap;
  transform-origin: 50% 100%;
  animation: jp-pop .28s cubic-bezier(.2, 1.5, .4, 1) both;
  transition: transform .15s, box-shadow .15s;
}
.jp-cl-pin { width: 16px; height: 16px; fill: #d6453d; flex: none; transform-origin: 50% 90%; }
.jp-cl-m { height: 28px; font-size: 13px; padding-right: 11px; }
.jp-cl-l { height: 32px; font-size: 14px; padding: 0 13px 0 8px; border-color: #d6453d; border-width: 1.5px; }
.jp-cl-l .jp-cl-pin, .jp-cl-m .jp-cl-pin { width: 18px; height: 18px; }
.jp-cl-wrap:hover .jp-cl { transform: translateY(-3px) scale(1.1); box-shadow: 0 6px 12px rgba(0, 0, 0, .3); }
.jp-cl-wrap:hover .jp-cl-pin { animation: jp-wiggle .5s ease-in-out; }
.jp-cl-cam {
  position: absolute; top: -9px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
  background: #e5173f; border: 2px solid #fff; display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35); animation: jp-live 1.8s ease-out infinite;
}
.jp-cl-cam svg { width: 10px; height: 10px; fill: #fff; }

/* หมุดเดี่ยว: ลอยขึ้นเมื่อชี้ + วงแหวนสะท้อนที่กล้องสด + เด้งตอนเลือก */
.pin-wrap:hover .pin { transform: scale(1.3); }
.pin-wrap:hover .pin.sel { transform: scale(1.55); }
.pin.sel { animation: jp-bounce .5s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes jp-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes jp-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 60% { transform: rotate(14deg); } }
@keyframes jp-live { 0% { box-shadow: 0 1px 4px rgba(0, 0, 0, .5), 0 0 0 0 rgba(229, 23, 63, .55); } 70%, 100% { box-shadow: 0 1px 4px rgba(0, 0, 0, .5), 0 0 0 9px rgba(229, 23, 63, 0); } }
@keyframes jp-bounce { 0% { transform: scale(1) translateY(0); } 40% { transform: scale(1.7) translateY(-6px); } 100% { transform: scale(1.45) translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .jp-cl, .jp-cl-cam, .pin, .pin.has-cam, .pin.sel, .jp-cl-pin { animation: none !important; }
}

/* v29: หมุดมีไอคอนตามหมวด + ป้ายกล้องที่มุมขวาบน */
.pin { position: relative; display: grid; place-items: center; width: 24px; height: 24px; margin: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.pin-ico { width: 14px; height: 14px; display: block; }
.pin-cam {
  position: absolute; top: -7px; right: -7px; width: 15px; height: 15px; border-radius: 50%;
  background: #e5173f; border: 1.5px solid #fff; display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4); animation: jp-live 2s ease-out infinite;
}
.pin-cam svg { width: 8px; height: 8px; fill: #fff; }
.dot { width: 16px; height: 16px; display: inline-grid; place-items: center; flex: none; }
.dot .pin-ico { width: 10px; height: 10px; }
.dot.camdot { background: #e5173f; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #e5173f55; }
.dot.camdot svg { width: 9px; height: 9px; fill: #fff; }
@media (prefers-reduced-motion: reduce) { .pin-cam { animation: none !important; } }
.pin.has-cam { box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }

/* v30: ป้ายชื่อภูมิภาค/จังหวัด/เมืองตามระดับซูม */
.geo-label { background: none; border: 0; pointer-events: none; }
.geo-label span {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-family: system-ui, sans-serif;
  color: #2c3e5c; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 5px #fff;
  animation: geo-fade .25s ease-out both;
}
.geo-region span { font-size: 17px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .78; }
.geo-pref span { font-size: 13.5px; font-weight: 700; opacity: .8; }
.geo-city span { font-size: 12px; font-weight: 600; color: #46526a; opacity: .9; }
@keyframes geo-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .geo-label span { animation: none; } }

/* v31: My CCTV */
.btn[hidden] { display: none !important; }
#btn-mycctv { display: inline-flex; align-items: center; gap: 2px; }
#btn-mycctv .cnt { margin-left: 5px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: #e5173f; color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
#btn-mycctv .cnt:empty { display: none; }
.cam-save { white-space: nowrap; margin-left: auto; margin-right: 6px; }
.cam-save.on { background: #f5b301; color: #222; border-color: #f5b301; }
.cam-box .drawer-head h2 { margin-right: 0; flex: 1 1 auto; min-width: 0; }
.my-box { width: min(1320px, 98vw); height: 94vh; max-height: 94vh; display: flex; flex-direction: column; }
.my-box .drawer-head .meta { margin: 0 10px; white-space: nowrap; }
.my-body { overflow: auto; padding: 10px 14px 16px; }
.my-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.my-wall:empty { display: none; }
.tile { background: #111; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.tile-head { display: flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px; background: #1c1c1c; color: #fff; font-size: 12px; }
.tile-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-btn { padding: 2px 7px; font-size: 12px; line-height: 1.4; }
.tile .frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.tile .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tile .frame.nofr { display: grid; place-items: center; color: #ddd; font-size: 13px; padding: 8px; text-align: center; }
.my-wall.focus { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.my-wall.focus .tile.big { grid-column: 1 / -1; grid-row: 1; }
.my-wall.focus .tile.big .frame { aspect-ratio: auto; height: min(62vh, 52vw); }
.my-wall.focus .tile:not(.big) .tile-head { font-size: 11px; }
.my-list h3 { margin: 16px 0 6px; font-size: 14px; }
.my-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid rgba(128, 128, 128, .25); cursor: pointer; }
.my-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 800px) {
  #btn-mycctv .lbl { display: none; }
  .my-box { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .my-wall, .my-wall.focus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-wall.focus .tile.big .frame { height: 56vw; }
  .cam-save { font-size: 12px; padding: 4px 8px; }
}
.my-row .my-name { font-size: 13px; color: inherit; }
.my-row input[type=checkbox] { width: 16px; height: 16px; flex: none; margin: 0; }
.my-row .tile-btn { margin-left: auto; flex: none; }

/* v32: สถานะกล้อง / ข้อความช่วยเหลือ */
.frame.checking { display: grid; place-items: center; min-height: 160px; aspect-ratio: 16 / 9; background: #111; color: #cfd3da; font-size: 13px; border-radius: 10px; }
.tile .frame.checking { min-height: 0; }
.cam-help { margin-top: 6px; font-size: 12.5px; color: var(--muted, #666); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cam-help .btn { padding: 3px 9px; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5000; max-width: 90vw; padding: 9px 16px; border-radius: 22px; background: rgba(30, 30, 34, .94); color: #fff; font-size: 13px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); animation: geo-fade .25s ease-out both; }

/* v34: ข่าวอากาศ/ภัยพิบัติ */
#btn-news { position: relative; }
#btn-news .cnt { margin-left: 4px; min-width: 15px; padding: 0 4px; border-radius: 8px; background: #e5173f; color: #fff; font-size: 11px; line-height: 15px; text-align: center; }
#btn-news .cnt:empty { display: none; }
.news-box { width: min(760px, 96vw); max-height: 92vh; display: flex; flex-direction: column; }
.news-body { overflow: auto; padding: 8px 16px 16px; }
.news-body h3 { margin: 16px 0 6px; font-size: 14px; }
.news-warn { background: #fff4d6; color: #6b4b00; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.news-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; border-left: 5px solid #8a94a6; background: rgba(128, 128, 128, .1); color: inherit; text-decoration: none; }
.news-item.lv-high { border-color: #e5173f; background: rgba(229, 23, 63, .1); }
.news-item.lv-mid { border-color: #f08c00; background: rgba(240, 140, 0, .1); }
.news-item small { grid-column: 2; opacity: .75; }
.news-type { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: rgba(0, 0, 0, .12); white-space: nowrap; }
.news-title { font-weight: 600; }
.news-card { padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: rgba(128, 128, 128, .1); }
.news-card p { margin: 4px 0 2px; font-size: 13.5px; line-height: 1.5; }
.news-card small { opacity: .7; display: block; font-size: 11.5px; }
.news-tag { display: inline-block; margin-left: 6px; padding: 0 7px; font-size: 11px; border-radius: 9px; background: #2f6fd1; color: #fff; }
.news-temps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.news-temp { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 10px; background: rgba(128, 128, 128, .1); font-size: 13px; }
.news-temp b { font-size: 16px; }
.news-temp small { opacity: .75; }
@media (max-width: 800px) { .news-box { width: 100vw; max-height: 100vh; border-radius: 0; } #btn-news .cnt { margin-left: 2px; } }

/* ===== v35: การ์ดข่าวอากาศมีพื้นหลัง/ไอคอน/แอนิเมชันตามสภาพอากาศ ===== */
.news-card, .news-temp { position: relative; overflow: hidden; }
.news-card::before, .news-temp::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.news-card > *:not(.news-ico), .news-temp > * { position: relative; }
.news-card { padding-right: 64px; min-height: 76px; }
.news-ico { position: absolute; right: 12px; top: 8px; font-size: 38px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); animation: nw-float 4s ease-in-out infinite; }
.news-tr { opacity: .8 !important; font-style: italic; }
@keyframes nw-float { 50% { transform: translateY(-4px); } }
@keyframes nw-fall { to { background-position: 0 28px; } }
@keyframes nw-fall2 { to { background-position: 0 40px; } }
@keyframes nw-drift { to { background-position: 160px 0; } }
@keyframes nw-drift2 { to { background-position: 90px 0; } }
@keyframes nw-wave { to { background-position: 40px 100%; } }
@keyframes nw-pulse { 50% { opacity: .45; } }
@keyframes nw-flash { 0%, 86%, 92%, 100% { opacity: 0; } 88%, 95% { opacity: .55; } }
@keyframes nw-spin { to { transform: rotate(360deg); } }
.sky-clear { background: linear-gradient(120deg, rgba(255, 214, 102, .28), rgba(255, 160, 60, .10)) , rgba(128,128,128,.06); }
.sky-clear::before { background: radial-gradient(circle at 92% 14%, rgba(255, 196, 40, .55), transparent 55%); animation: nw-pulse 3.5s ease-in-out infinite; }
.sky-cloud { background: linear-gradient(120deg, rgba(150, 165, 190, .28), rgba(190, 200, 215, .10)), rgba(128,128,128,.06); }
.sky-cloud::before { background: radial-gradient(60px 14px at 30px 22%, rgba(150,165,190,.45), transparent), radial-gradient(80px 16px at 100px 68%, rgba(150,165,190,.35), transparent); background-size: 160px 100%; background-repeat: repeat-x; animation: nw-drift 22s linear infinite; }
.sky-rain { background: linear-gradient(120deg, rgba(70, 120, 200, .30), rgba(90, 110, 150, .12)), rgba(128,128,128,.06); }
.sky-rain::before { background: radial-gradient(1px 8px at 12px 8px, rgba(80,140,230,.75), transparent), radial-gradient(1px 8px at 30px 20px, rgba(80,140,230,.6), transparent); background-size: 38px 28px; animation: nw-fall .7s linear infinite; }
.sky-snow { background: linear-gradient(120deg, rgba(150, 195, 245, .32), rgba(215, 230, 250, .12)), rgba(128,128,128,.06); }
.sky-snow::before { background: radial-gradient(2.5px 2.5px at 10px 10px, rgba(255,255,255,.95), transparent), radial-gradient(2px 2px at 32px 26px, rgba(190,215,250,.95), transparent); background-size: 44px 40px; animation: nw-fall2 5s linear infinite; }
.sky-thunder { background: linear-gradient(120deg, rgba(95, 70, 160, .34), rgba(60, 60, 110, .14)), rgba(128,128,128,.06); }
.sky-thunder::before { background: radial-gradient(circle at 85% 20%, rgba(255, 235, 120, .8), transparent 50%); animation: nw-flash 4.5s linear infinite; }
.sky-wind { background: linear-gradient(120deg, rgba(110, 170, 175, .28), rgba(150, 190, 190, .10)), rgba(128,128,128,.06); }
.sky-wind::before { background: radial-gradient(34px 1px at 20px 8px, rgba(90,130,140,.6), transparent), radial-gradient(26px 1px at 60px 18px, rgba(90,130,140,.5), transparent); background-size: 90px 26px; animation: nw-drift2 1.6s linear infinite; }
.sky-waves { background: linear-gradient(180deg, rgba(60, 140, 215, .12), rgba(30, 110, 200, .30)), rgba(128,128,128,.06); }
.sky-waves::before { background: radial-gradient(circle at 50% 100%, transparent 0 9px, rgba(60,130,210,.4) 9px 11px, transparent 11px) 0 100% / 40px 20px repeat-x; animation: nw-wave 3s linear infinite; }
.sky-typhoon { background: linear-gradient(120deg, rgba(200, 60, 80, .30), rgba(60, 90, 140, .16)), rgba(128,128,128,.06); }
.sky-typhoon .news-ico { animation: nw-spin 6s linear infinite; }
.sky-typhoon::before { background: radial-gradient(circle at 90% 25%, rgba(229, 23, 63, .35), transparent 55%); animation: nw-pulse 2s ease-in-out infinite; }
.news-temp.sky-clear::before, .news-temp.sky-cloud::before { opacity: .8; }
@media (prefers-reduced-motion: reduce) { .news-card::before, .news-temp::before, .news-ico { animation: none !important; } }

/* ===== v35b: การ์ดอากาศรายเมือง (ไอคอน + อุณหภูมิ + สภาพอากาศสั้นๆ ไม่มีคำบรรยายยาว) ===== */
.news-temps { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.news-city { padding: 10px 64px 10px 12px; min-height: 96px; gap: 1px; }
.news-city .city { font-weight: 700; font-size: 14px; }
.news-city b { font-size: 22px; }
.news-city .cond { opacity: .9; font-size: 12.5px; }
.news-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.news-tags .news-tag { margin-left: 0; }

/* ===== v36: เมฆเต็มก้อน (ไอคอนเมฆเป็น SVG อยู่ในกรอบ tile ไม่โดนตัดขอบ) ===== */
@keyframes nw-cl1 { from { background-position: 0 6px; } to { background-position: 240px 6px; } }
@keyframes nw-cl2 { from { background-position: 0 18px; } to { background-position: 320px 18px; } }
.sky-cloud::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='70' viewBox='0 0 240 70'%3E%3Cg fill='%23b4bfd3' fill-opacity='.62'%3E%3Ccircle cx='70' cy='42' r='15'/%3E%3Ccircle cx='92' cy='32' r='20'/%3E%3Ccircle cx='116' cy='41' r='15'/%3E%3Crect x='56' y='41' width='74' height='16' rx='8'/%3E%3C/g%3E%3C/svg%3E") 0 6px / 240px 70px repeat-x; animation: nw-cl1 40s linear infinite; }
.sky-cloud::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='70' viewBox='0 0 320 70'%3E%3Cg fill='%23b4bfd3' fill-opacity='.45'%3E%3Ccircle cx='230' cy='40' r='11'/%3E%3Ccircle cx='246' cy='33' r='15'/%3E%3Ccircle cx='264' cy='40' r='11'/%3E%3Crect x='219' y='40' width='56' height='12' rx='6'/%3E%3C/g%3E%3C/svg%3E") 0 18px / 320px 70px repeat-x; animation: nw-cl2 65s linear infinite; }
.sky-cloud .news-ico { filter: drop-shadow(0 2px 3px rgba(60, 70, 100, .35)); }
@media (prefers-reduced-motion: reduce) { .sky-cloud::after { animation: none !important; } }

/* ===== v36: ป๊อปอัพหน้าแรก — มีอะไรใหม่ / ช่อง YouTube / วิดีโอล่าสุด ===== */
.news-new { margin: 4px 0 8px; padding: 6px 12px 10px; border-radius: 12px; background: linear-gradient(120deg, rgba(47, 111, 209, .14), rgba(150, 90, 220, .10)); border: 1px solid rgba(47, 111, 209, .25); }
.news-new h3 { margin: 6px 0 4px; }
.news-ver { margin: 6px 0; }
.news-ver ul { margin: 3px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.linkish { background: none; border: 0; padding: 2px 0; color: #2f6fd1; font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.news-chan { margin: 6px 0 8px; }
.chan-cta { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(120deg, rgba(229, 23, 63, .16), rgba(255, 140, 0, .10)); border: 1px solid rgba(229, 23, 63, .3); }
.chan-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.chan-txt { display: flex; flex-direction: column; font-size: 13px; line-height: 1.4; min-width: 0; flex: 1; }
.btn-sub { flex: none; background: #e5173f; color: #fff !important; font-weight: 700; padding: 9px 16px; border-radius: 999px; text-decoration: none; box-shadow: 0 2px 8px rgba(229, 23, 63, .4); animation: nw-beat 2.4s ease-in-out infinite; }
.btn-sub:hover { background: #c20f33; }
@keyframes nw-beat { 50% { transform: scale(1.06); } }
.vid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vid { display: flex; flex-direction: column; gap: 3px; color: inherit; text-decoration: none; min-width: 0; }
.vid-th { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: rgba(128,128,128,.25); }
.vid-th img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.vid:hover .vid-th img { transform: scale(1.05); }
.vid-th i { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(229, 23, 63, .92); color: #fff; font-size: 11px; display: grid; place-items: center; font-style: normal; }
.vid-t { font-size: 12.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid small { opacity: .65; font-size: 11px; }
.chan-all { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: #e5173f; text-decoration: none; }
@media (max-width: 800px) { .vid-grid { grid-template-columns: repeat(2, 1fr); } .chan-cta { flex-wrap: wrap; } .btn-sub { width: 100%; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .btn-sub { animation: none; } }

/* ===== v37: ป้ายชวนติดตามช่อง + ปุ่มติดตามในหน้าเว็บ ===== */
.sub-nudge { position: fixed; right: 16px; bottom: 16px; z-index: 4500; display: flex; align-items: center; gap: 10px; max-width: min(430px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 16px; background: var(--panel, #fff); color: inherit; border: 1px solid rgba(229, 23, 63, .35); box-shadow: 0 8px 28px rgba(0, 0, 0, .3); font-size: 13px; line-height: 1.4; animation: nudge-in .35s ease-out both; }
.sub-nudge img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.sub-nudge span { flex: 1; min-width: 0; }
.sub-nudge .btn-sub { padding: 7px 12px; font-size: 12.5px; animation: none; white-space: nowrap; }
.nudge-x { background: none; border: 0; color: inherit; opacity: .55; cursor: pointer; font-size: 14px; padding: 4px; }
.nudge-x:hover { opacity: 1; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(14px); } }
.chan-inline { margin: 6px 0 2px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
@media (max-width: 800px) { .sub-nudge { left: 12px; right: 12px; bottom: 12px; max-width: none; } }

/* ===== v39: ปลดล็อกช่อง My CCTV + บล็อกติดตามแยกจากวิดีโอ ===== */
.chan-cta.thanks { background: linear-gradient(120deg, rgba(255, 190, 60, .20), rgba(255, 140, 0, .08)); border-color: rgba(255, 170, 40, .45); }
.chan-inline { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
.chan-inline-w { display: flex; flex-direction: column; gap: 4px; }
.nudge-done { background: none; border: 0; color: #2f6fd1; cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; white-space: nowrap; }

/* ===== v43: ป๊อปอัพข่าว — ลดช่องว่าง (เดิม .modal-body เป็น grid + gap ทำให้ margin ซ้อนกัน) ===== */
.news-body { display: block; padding: 6px 16px 14px; }
.news-body > * { margin-top: 0; }
.news-body h3 { margin: 14px 0 6px; line-height: 1.3; }
.news-body > p { margin: 4px 0; line-height: 1.5; }
.news-body > .news-new { margin: 6px 0; }
.news-body > .news-chan { margin: 6px 0; }
.news-body > .news-chan h3:first-child { margin-top: 12px; }
.news-body > .news-warn { margin: 6px 0; }
.news-temps { margin-bottom: 4px; }

/* ===== v47: ป้ายชวนติดตามบนมือถือ — เล็กลง ไม่บังแผนที่มาก (ยังขึ้นไม่เกินวันละครั้ง ปิดเองใน 20 วินาที) ===== */
@media (max-width: 800px) {
  .sub-nudge { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 6px; padding: 6px 8px; border-radius: 12px; font-size: 12px; line-height: 1.3; }
  .sub-nudge img { display: none; }
  .sub-nudge .btn-sub { width: auto; padding: 5px 10px; font-size: 12px; }
  .sub-nudge .nudge-done { font-size: 11px; }
}

/* ===== v44: ป้ายโบนัสในบล็อกติดตาม ===== */
.chan-bonus { margin-top: 4px; align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: linear-gradient(90deg, #ffb703, #fb8500); color: #3b2200; font-weight: 700; font-size: 12.5px; box-shadow: 0 1px 4px rgba(251, 133, 0, .4); }

/* ===== v47: มือถือ — แผนที่ใหญ่ขึ้น แผงข้อมูลเป็น bottom sheet (ย่อ ↔ ขยาย) · เดสก์ท็อปไม่เปลี่ยน ===== */
.sheet-handle { display: none; }
@media (max-width: 800px) {
  html, body { height: 100%; height: 100dvh; }            /* ไม่ใช้ 100vh (แถบที่อยู่ของ Safari บน iPhone บังด้านล่าง) */
  #map { flex: 1 1 auto; min-height: 0; }
  #panel {
    flex: 0 0 auto; max-height: 22vh; max-height: 22dvh; overflow: hidden;   /* ย่อ: หัวแผง + ช่องค้นหา (+ ต้นการ์ดถ้ามีที่) */
    border-top: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -3px 14px rgba(0, 0, 0, .16);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: max-height .25s ease;
  }
  #panel.sheet-open { max-height: 60vh; max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain; }
  .sheet-handle {
    display: block; position: sticky; top: 0; z-index: 8; width: 100%; height: 20px; padding: 0; margin: 0;
    border: 0; border-radius: 14px 14px 0 0; background: var(--panel); cursor: pointer; touch-action: none;
  }
  .sheet-handle span { display: block; width: 40px; height: 5px; margin: 7px auto 0; border-radius: 3px; background: #b9c1cc; }
  .sheet-handle:focus-visible span { background: var(--accent); }
  .quick { position: sticky; top: 20px; }
  .suggest { max-height: 36vh; max-height: 36dvh; }
}
@media (max-width: 800px) and (orientation: landscape) {
  #panel { max-height: 70px; }                             /* จอเตี้ย: ย่อเหลือหัวแผง + ช่องค้นหา */
  #panel.sheet-open { max-height: 68vh; max-height: 68dvh; }
}
@media (prefers-reduced-motion: reduce) { #panel { transition: none; } }
/* ===== v47: ปุ่ม News มีป้ายข้อความ + กระพริบแดงเฉพาะประกาศเตือนภัยระดับสูง (high) ===== */
#btn-news { gap: 5px; line-height: 1.2; }
#btn-news .news-lbl { font-size: 12.5px; font-weight: 600; letter-spacing: .2px; }
#btn-news.emergency { background: #e5173f; border-color: #e5173f; color: #fff; }
#btn-news.emergency .cnt { background: #fff; color: #c20f33; }
#btn-news.pulse { animation: news-pulse 1.1s ease-in-out infinite; }
@keyframes news-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 23, 63, .75); background: #e5173f; }
  50% { box-shadow: 0 0 0 7px rgba(229, 23, 63, 0); background: #ff5470; }
}
@media (prefers-reduced-motion: reduce) { #btn-news.pulse { animation: none; } }
@media (max-width: 800px) {
  #btn-news { gap: 3px; }
  #btn-news .news-lbl { font-size: 11.5px; }
}/* จอแคบ: ชื่อเว็บเดิมซ้อนใต้ปุ่มบนแถบ (ปุ่มกินที่เกือบทั้งแถบ) → เหลือแค่โลโก้วงกลม */
@media (max-width: 520px) {
  .brand h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top-actions { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
}@media (max-width: 420px) {
  .top-actions { gap: 3px; }
  .top-actions .btn, .icon-btn { padding: 5px 6px; }
  .lang-switch { flex: none; }
  .lang-opt { padding: 5px 6px; }
}
/* ===== v47: My CCTV — กล่องเงื่อนไขโบนัสอยู่ท้ายหน้าต่าง (ต่อจากกริดกล้อง ไม่ลอยทับกริด) ===== */
.my-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.my-list { flex: 1 0 auto; display: flex; flex-direction: column; }
.my-list .bonus-box { margin-top: auto; }                  /* กล้องน้อย → กล่องชิดล่างของหน้าต่าง · กล้องเยอะ → อยู่ท้ายพื้นที่เลื่อน */
.bonus-box { display: flex; flex-direction: column; gap: 5px; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; background: linear-gradient(120deg, rgba(229, 23, 63, .10), rgba(255, 140, 0, .07)); border: 1px dashed rgba(229, 23, 63, .45); }
.bonus-box.tier-full { background: linear-gradient(120deg, rgba(255, 190, 60, .18), rgba(255, 140, 0, .06)); border: 1px solid rgba(255, 170, 40, .45); }
.bonus-slots { display: flex; gap: 6px; font-size: 15px; line-height: 1; }
.bonus-slots span { width: 26px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(128, 128, 128, .12); }
.bonus-slots .on { background: #2f9e5a; color: #fff; }
.bonus-slots .next { outline: 2px dashed rgba(229, 23, 63, .55); outline-offset: -2px; }
.bonus-slots .off { opacity: .55; }
.bonus-title { font-size: 13.5px; }
.bonus-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 2px; }
.bonus-actions .btn-sub { animation: none; padding: 7px 14px; font-size: 13px; width: auto; }
@media (max-width: 800px) {
  .my-box { height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; }
  .my-body { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
/* ---------------------------------------------------------------- */
/* v48: ป๊อปอัพบนมือถือไม่ล้นจอ (iPhone Safari / เบราว์เซอร์ในแอป)     */
/* 100vh บน iPhone สูงกว่าพื้นที่ที่มองเห็นจริง → กล่องถูกจัดกึ่งกลาง  */
/* แล้วหัวกล่อง (ปุ่ม ✕) หลุดขอบบน · ใช้ 100% ของ .modal (fixed inset 0) */
/* + dvh + safe-area และเพิ่มแถบ "ปิดหน้านี้" ท้ายกล่อง               */
/* ---------------------------------------------------------------- */
.modal-closebar { display: none; }
@media (max-width: 800px) {
  .modal { padding: 0; align-items: stretch; }
  .modal-box { max-height: 100%; max-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .modal-box > .modal-body, .modal-box > .my-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .modal-box > .drawer-head { flex: 0 0 auto; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .news-box, .cam-box, .my-box, .photo-box { width: 100%; height: 100%; height: 100dvh; max-height: 100%; max-height: 100dvh; border-radius: 0; }
  .my-body { padding-bottom: 10px; }
  .modal-closebar {
    display: block; flex: 0 0 auto; width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); background: var(--panel); cursor: pointer;
  }
  .modal-closebar:active { background: rgba(128, 128, 128, .15); }
}
/* กล่องเล็ก (ล็อกอิน เพิ่มจุด) ไม่ต้องเต็มจอ: จัดกลางและเว้นขอบตามเดิม */
@media (max-width: 800px) {
  #modal, #account-modal { padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px)); align-items: center; }
}

/* ---------------------------------------------------------------- */
/* v50: เลเยอร์สภาพอากาศ (JMA) — คำอธิบายสี มุมซ้ายล่าง + ไอคอนภูเขาไฟ  */
/* ---------------------------------------------------------------- */
.wx-lbl { white-space: nowrap; }
.wx-legend { background: rgba(255, 255, 255, .94); border-radius: 10px; padding: 7px 9px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  font-size: 11.5px; line-height: 1.35; color: var(--ink); max-width: 260px; display: grid; gap: 6px; }
.wx-legend[hidden] { display: none; }
.wx-row-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wx-row-h span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.wx-bar { display: flex; align-items: stretch; margin-top: 3px; }
.wx-bar span { flex: 1 1 0; min-width: 18px; height: 14px; font-size: 9.5px; line-height: 14px; text-align: center; color: #1b1f24; border-right: 1px solid rgba(255, 255, 255, .6); }
.wx-bar span:first-child { border-radius: 4px 0 0 4px; }
.wx-bar span:last-of-type { border-radius: 0 4px 4px 0; border-right: 0; }
.wx-bar em { font-style: normal; color: var(--muted); font-size: 10.5px; margin-left: 5px; white-space: nowrap; align-self: center; }
.wx-volc span { color: #fff; font-weight: 700; }
.wx-note { color: var(--muted); font-size: 11px; }
.wx-src { color: var(--muted); font-size: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
.volc-ic { background: none; border: 0; }
.volc-ic span { position: relative; display: grid; place-items: center; width: 30px; height: 30px; font-size: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px var(--c), 0 2px 6px rgba(0, 0, 0, .3); }
.volc-ic i { position: absolute; right: -6px; top: -6px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--c);
  color: #fff; font: 700 10px/15px system-ui, sans-serif; font-style: normal; text-align: center; }
.volc-pop { display: grid; gap: 4px; min-width: 200px; font-size: 13px; }
.volc-lv { border-left: 4px solid; padding: 2px 8px; font-weight: 600; }
.volc-pop small { color: var(--muted); }
@media (max-width: 800px) {
  .wx-legend { max-width: 205px; padding: 5px 7px; font-size: 10.5px; gap: 4px; }
  .wx-bar span { min-width: 14px; font-size: 9px; }
  .wx-src { font-size: 9.5px; }
}
.wx-legend { cursor: pointer; }
.wx-legend.mini { gap: 2px; }
.wx-legend.mini .wx-bar, .wx-legend.mini .wx-note, .wx-legend.mini .wx-src { display: none; }
.wx-legend.mini .wx-row:first-child .wx-row-h b::after { content: ' ▾'; color: var(--muted); font-weight: 400; }

/* v51: ปุ่ม "สภาพอากาศ" บนแผนที่ + แผงเลือกชั้น */
.wx-ctl { background: #fff; border-radius: 10px; overflow: hidden; }
.wx-ctl.leaflet-bar { border: 2px solid rgba(0, 0, 0, .2); }
.wx-btn { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: #fff; cursor: pointer; padding: 7px 10px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.wx-btn:hover { background: #f3f5f8; }
.wx-btn.on { background: #e8f4ff; color: #0b5cad; }
.wx-btn-ic { font-size: 17px; line-height: 1; }
.wx-btn-n { min-width: 18px; height: 18px; border-radius: 9px; background: #2f6fd1; color: #fff; font-size: 11px; line-height: 18px; text-align: center; padding: 0 5px; }
.wx-panel { display: grid; gap: 2px; padding: 4px 6px 8px; border-top: 1px solid var(--line); }
.wx-opt { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13.5px; cursor: pointer; border-radius: 6px; white-space: nowrap; }
.wx-opt:hover { background: #f3f5f8; }
.wx-opt input { width: 17px; height: 17px; margin: 0; accent-color: #2f6fd1; }
@media (max-width: 800px) {
  .wx-btn { padding: 6px 8px; font-size: 12.5px; }
  .wx-opt { padding: 8px 4px; font-size: 14px; }
}

/* v52: การ์ดอากาศรายเมืองในหน้าข่าว — เล็กลง แถวละ 5 ช่อง (มือถือ 3 · จอแคบมาก 2) */
.news-temps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.news-city { padding: 7px 8px 8px; min-height: 0; border-radius: 9px; }
.news-city .city { font-size: 12.5px; padding-right: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-city b { font-size: 16px; line-height: 1.25; white-space: nowrap; }
.news-city .cond { font-size: 11px; line-height: 1.3; }
.news-city small { font-size: 10.5px; }
.news-city .news-ico { font-size: 22px; right: 6px; top: 6px; }
.news-city .news-tags { gap: 3px; margin-top: 2px; }
.news-city .news-tag { font-size: 9.5px; padding: 0 5px; line-height: 1.5; }
@media (max-width: 800px) { .news-temps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 360px) { .news-temps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* v53: ปุ่มสภาพอากาศ = ไอคอนอย่างเดียว ขนาด/กรอบเท่าปุ่มเลเยอร์ของ Leaflet (44×44) แบบไอคอนแอป */
.wx-ctl { position: relative; background: none; overflow: visible; border-radius: 5px; }
.wx-btn { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 4px;
  background: linear-gradient(135deg, #38bdf8 0%, #6366f1 60%, #a855f7 100%); }
.wx-btn:hover { background: linear-gradient(135deg, #0ea5e9 0%, #4f46e5 60%, #9333ea 100%); }
.wx-btn.on { background: linear-gradient(135deg, #38bdf8 0%, #6366f1 60%, #a855f7 100%); color: inherit; }
.wx-btn svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.wx-btn-n { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #ff3b5c; color: #fff; font: 700 11px/18px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 2px #fff; }
.wx-panel { position: absolute; top: calc(100% + 6px); right: -2px; z-index: 1000; min-width: 210px; background: #fff; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .22); border-top: 0; padding: 6px 6px 8px; }
.wx-panel-h { font-weight: 700; font-size: 13px; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.wx-panel-note { font-size: 11.5px; color: var(--muted); padding: 4px 6px 0; max-width: 220px; white-space: normal; }
@media (max-width: 800px) { .wx-btn { padding: 0; } }

/* v54: หน้าต่างล็อกอินต้องเปิดทับป๊อปอัพอื่น (ข่าว / My CCTV / กล้อง) ได้เสมอ */
#account-modal { z-index: 2300; }
.chan-login { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px;
  padding: 8px 10px; border-radius: 10px; background: #fff7e0; border: 1px solid #f3d27a; font-size: 13px; color: #6b4b00; }
.chan-login .btn-login { font-weight: 700; padding: 6px 14px; }

/* v56: ฝน/หิมะ ขอบฟุ้งนุ่ม (แบบ B ที่ผู้ใช้เลือก) · เมฆขาวนวลมีเงา (สีแผนที่หลักเดิม) */
.wx-rain canvas, .wx-snow canvas { filter: blur(1.8px) saturate(1.5) contrast(1.1); }
.wx-cloud canvas { filter: blur(.6px) drop-shadow(0 2px 3px rgba(30, 50, 90, .6)); }

/* v59: การ์ดกล้องเว็บลิงก์ในป๊อปอัพ (กรอบ 16:9 เท่ากล้อง YouTube) */
.frame.lk-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #3a5f8a 0%, #1b2a44 55%, #0d1422 100%); }
.lk-in { height: 100%; display: grid; place-items: center; align-content: center; gap: 12px; color: #fff; text-align: center; padding: 14px; }
.lk-live { display: inline-flex; gap: 6px; align-items: center; font: 700 12px system-ui, sans-serif; background: rgba(229, 23, 63, .92); padding: 4px 11px; border-radius: 999px; }
.lk-live i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: lk-blink 1.4s ease-in-out infinite; }
@keyframes lk-blink { 50% { opacity: .3; } }
.lk-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); }
.lk-go { border: 0; border-radius: 999px; padding: 13px 26px; font: 700 17px system-ui, sans-serif; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #ff3b5c, #e5173f); box-shadow: 0 8px 24px rgba(229, 23, 63, .45); }
.lk-go:hover { filter: brightness(1.08); }
.lk-site { font-size: 13.5px; opacity: .85; }
.lk-note { font-size: 12px; opacity: .7; max-width: 440px; }
@media (max-width: 480px) { .lk-ic { display: none; } .lk-in { gap: 8px; } .lk-go { padding: 11px 22px; font-size: 15px; } .lk-note { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .lk-live i { animation: none; } }

/* v60: บล็อกล็อกอินอยู่บนการ์ดติดตาม · ปุ่มใหญ่ขึ้น */
.news-chan > .chan-login { margin: 0 0 8px; }
.chan-login .btn-login { font-size: 15px; padding: 9px 20px; border-radius: 10px; }

/* v61: เลเยอร์แผ่นดินไหว */
.qk-ring { animation: qk-pulse 1.8s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes qk-pulse { 0% { opacity: .9; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.8); } }
@media (prefers-reduced-motion: reduce) { .qk-ring { animation: none; } }
.qk-pop { display: grid; gap: 3px; min-width: 210px; font-size: 13px; }
.qk-pop b { font-size: 14px; }
.qk-pop small { color: var(--muted); }
.qk-int { display: inline-block; padding: 1px 8px; border-radius: 6px; color: #fff; font-weight: 700; }
.qk-note { font-size: 11px; }

/* v62: โลโก้ลาพักร้อนที่หัวเว็บ (แทนวงกลมแดง) · ไอคอน YouTube ใน "นำเสนอโดย" */
img.brand-mark { width: 34px; height: 34px; border-radius: 50%; background: #fff; object-fit: contain; padding: 1px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); flex: 0 0 auto; }
.presented-by .channel-badge.yt { width: 22px; height: 22px; border-radius: 0; background: none; object-fit: contain; }
@media (max-width: 800px) { img.brand-mark { width: 30px; height: 30px; } }

/* v63: แถบชวนติดตั้งแอป (PWA) */
.pwa-hint { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 2050;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; color: var(--ink);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28); font-size: 13.5px; line-height: 1.4; max-width: 520px; margin: 0 auto; }
.pwa-hint img { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pwa-txt { flex: 1 1 auto; }
.pwa-hint .btn.primary { flex: 0 0 auto; white-space: nowrap; }
.pwa-x { border: 0; background: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 4px 6px; flex: 0 0 auto; }

/* v64: กล่องโบนัสโทนฟ้าพาสเทล + ปุ่มขั้นตอน ①② · ค้นหากล้องใน My CCTV */
.bonus-box, .bonus-box.tier-full { background: #eaf4fd; border: 1px solid #9cc8ef; color: #0c447c; }
.bonus-box .bonus-body { color: #185fa5; }
.bonus-slots span { background: #fff; }
.bonus-slots .on { background: #378add; color: #fff; }
.bonus-slots .next { outline: 2px dashed #378add; outline-offset: -2px; }
.bonus-actions { gap: 8px 10px; }
.bonus-step { display: inline-flex; align-items: center; gap: 7px; }
.bonus-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 system-ui, sans-serif; background: #185fa5; color: #fff; flex: none; }
.bonus-num.done { background: #2f8f2f; }
.bonus-btn { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1.5px solid; border-radius: 999px; padding: 7px 15px 7px 11px;
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.bonus-btn.red { border-color: #f09595; color: #791f1f; }
.bonus-btn.green { border-color: #97c459; color: #27500a; }
.bonus-btn:hover { filter: brightness(.97); }
.bonus-ico { display: inline-grid; place-items: center; }
.bonus-arrow { color: #378add; font-size: 16px; }
.bonus-hint { font-size: 12px; color: #185fa5; }
.my-search { display: grid; gap: 8px; margin: 0 0 10px; }
.my-search-in { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; background: #fff; }
.my-search-in input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 14px; background: transparent; min-width: 0; }
.my-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.my-chip { border: 0; background: rgba(128, 128, 128, .12); color: inherit; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.my-chip:hover { background: rgba(128, 128, 128, .2); }
.my-search-res { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.my-search-res[hidden] { display: none; }
.my-search-res .meta { margin: 0; padding: 10px 12px; }
.my-hit { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.my-hit:last-child { border-bottom: 0; }
.my-th { width: 64px; height: 36px; border-radius: 6px; object-fit: cover; background: #1c2433; flex: none; }
.my-th-ic { display: grid; place-items: center; color: #fff; font-size: 14px; }
.my-hit-t { flex: 1; min-width: 0; display: grid; }
.my-hit-t b, .my-hit-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-hit-t small { color: var(--muted); }
.my-add { flex: none; font-size: 12.5px; padding: 5px 11px; }
.my-add.on { background: #eaf3de; border-color: #97c459; color: #27500a; }

/* v65: การ์ดติดตั้งบนหน้าจอโฮม (มือถือ) ในป๊อปอัพข่าว */
.install-box { background: #eaf4fd; border: 1px solid #9cc8ef; border-radius: 14px; padding: 12px 12px 10px; margin: 14px 0 6px; color: #0c447c; }
.install-box .in-head { display: flex; gap: 10px; align-items: center; }
.install-box .in-head img { width: 44px; height: 44px; border-radius: 10px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.15); background: #fff; }
.install-box .in-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.install-box .in-subt { font-size: 12.5px; color: #185fa5; margin-top: 2px; }
.install-box .in-tabs { display: flex; gap: 6px; margin: 10px 0 8px; }
.install-box .in-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 1px solid #9cc8ef; background: #fff; color: #185fa5; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.install-box .in-tab.on { background: #185fa5; border-color: #185fa5; color: #fff; }
.install-box .in-ico { display: inline-flex; vertical-align: middle; }
.install-box .in-share { background: #fff; border: 1px solid #9cc8ef; border-radius: 6px; padding: 2px; color: #185fa5; }
.install-box .in-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.install-box .in-step { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.install-box .in-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #185fa5; color: #fff; font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.install-box .in-sub { font-size: 12px; color: #3b6fa3; margin-top: 2px; }
.install-box .in-btn { display: block; width: 100%; min-height: 42px; margin: 0 0 10px; border: 0; border-radius: 10px; background: #1a8f3c; color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.install-box .in-note { font-size: 12px; color: #3b6fa3; margin: 10px 0 0; }

/* v66: มือถือ — คำอธิบายสีสภาพอากาศ มุมซ้ายล่าง ย่อ 70% พื้นโปร่งขึ้น 20% (ระยะเหนือแถบเครดิตตั้งใน liftLegend()) */
@media (max-width: 800px) {
  .leaflet-bottom.leaflet-left .wx-legend { background: rgba(255, 255, 255, .74); transform: scale(.7); transform-origin: bottom left; margin-left: 8px; }
}
