/* Live layers (web/js/live.js): Live button + layer list, forecast card, warnings, wind canvas */

.lv-btn, .lv-panel, .lv-bottom, .lv-card, .lv-row { box-sizing: border-box; }

.lv-btn { position: absolute; left: 12px; bottom: 100px; z-index: 3; min-width: 64px; max-width: 140px; height: 36px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: 600 13px/1 system-ui, sans-serif;
  box-shadow: 0 2px 8px rgb(0 0 0 / .18); cursor: pointer; }
.lv-btn:focus-visible, .lv-row:focus-visible, .lv-x:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lv-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #9a9a9a; }
.lv-active .lv-dot { background: #d93025; box-shadow: 0 0 0 0 rgb(217 48 37 / .6); animation: lv-pulse 2s infinite; }
@keyframes lv-pulse { 70% { box-shadow: 0 0 0 7px rgb(217 48 37 / 0); } 100% { box-shadow: 0 0 0 0 rgb(217 48 37 / 0); } }
@media (prefers-reduced-motion: reduce) { .lv-active .lv-dot { animation: none; } }

.lv-panel { position: absolute; left: 84px; bottom: 28px; z-index: 4; width: min(270px, calc(100vw - 96px));
  max-height: calc(100vh - 220px); overflow-y: auto; background: var(--panel); color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px rgb(0 0 0 / .22); padding: 6px; }
.lv-panel[hidden] { display: none; }
.lv-row { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; align-items: center;
  column-gap: 8px; padding: 8px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit;
  font-size: 15px; text-align: left; cursor: pointer; }
.lv-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lv-ico { grid-row: 1 / 3; font-size: 19px; text-align: center; }
.lv-name { grid-column: 2; }
.lv-state { grid-column: 2; grid-row: 2; font-size: 12px; opacity: .7; }
.lv-state:empty { display: none; }
.lv-switch { grid-column: 3; grid-row: 1 / 3; width: 36px; height: 20px; border-radius: 10px; background: var(--line);
  position: relative; transition: background .15s; }
.lv-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.lv-row[aria-pressed="true"] .lv-switch { background: var(--accent); }
.lv-row[aria-pressed="true"] .lv-switch::after { transform: translateX(16px); }
.lv-note { margin: 4px 8px 6px; font-size: 12px; opacity: .7; }
.lv-note[hidden] { display: none; }

/* forecast card and warnings, stacked at the bottom next to the map buttons */
.lv-bottom { position: absolute; left: 88px; right: 56px; bottom: 28px; z-index: 2; max-width: 400px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.lv-bottom > * { pointer-events: auto; }
.lv-alerts { display: flex; flex-direction: column; gap: 8px; }
.lv-alerts:empty { display: none; }
.lv-card { position: relative; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 3px 12px rgb(0 0 0 / .18); padding: 10px 12px; }
.lv-card[hidden] { display: none; }
.lv-x { position: absolute; top: 4px; right: 6px; width: 32px; height: 32px; border: 0; background: none; color: var(--fg);
  font-size: 22px; line-height: 1; cursor: pointer; border-radius: 8px; }
.lv-msg { margin: 4px 30px 4px 0; font-size: 14px; }

.lv-fc-head { display: flex; gap: 8px; align-items: baseline; margin-right: 30px; font-size: 13px; }
.lv-fc-place { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-fc-now { opacity: .65; }
.lv-fc-main { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
.lv-fc-icon { font-size: 34px; line-height: 1; }
.lv-fc-temp { font-size: 30px; font-weight: 600; }
.lv-fc-desc { display: grid; font-size: 14px; }
.lv-fc-desc small { opacity: .75; font-size: 12px; }
.lv-arrow { display: inline-block; }
.lv-fc-hours, .lv-fc-days { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px 0;
  border-top: 1px solid var(--line); }
.lv-fc-hours::-webkit-scrollbar, .lv-fc-days::-webkit-scrollbar { display: none; }
.lv-fc-hours > div, .lv-fc-days > div { flex: 1 0 44px; display: grid; justify-items: center; gap: 1px; font-size: 13px; }
.lv-fc-hours small, .lv-fc-days small { font-size: 11px; opacity: .75; white-space: nowrap; }
.lv-rainmm { color: #2b6cd4; opacity: 1 !important; }
.lv-credit { display: block; text-align: right; font-size: 10px; opacity: .6; }
.lv-credit a { color: inherit; }

.lv-alert { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding-right: 36px;
  border-left: 5px solid #1f6f8b; }
.lv-alert p { margin: 0 0 2px; font-size: 14px; }
.lv-alert small { font-size: 12px; opacity: .8; }
.lv-alert a { color: var(--accent); }
.lv-alert-ico { font-size: 18px; }
.lv-watch { border-left-color: #e8a10a; }
.lv-warning { border-left-color: #d93025; }

.lv-wind { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; }
.lv-wind[hidden] { display: none; }

@media (max-width: 480px) {
  /* full width above the Live / Satellite buttons */
  .lv-bottom { left: 12px; right: 12px; bottom: 146px; max-width: none; }
  .lv-panel { left: 12px; bottom: 146px; width: calc(100vw - 24px); max-height: calc(100vh - 300px); }
  .lv-alert p { font-size: 13px; }
  .lv-fc-icon { font-size: 28px; }
  .lv-fc-temp { font-size: 26px; }
}

/* colour keys for rain and clouds */
.lv-legend { display: grid; gap: 10px; padding: 8px 12px; font-size: 12px; }
.lv-key { display: grid; gap: 3px; }
.lv-key b { font-weight: 600; font-size: 12px; }
.lv-key small { opacity: .7; font-size: 11px; }
.lv-bar { height: 10px; border-radius: 5px; border: 1px solid var(--line); }
.lv-cloudbar { background: linear-gradient(90deg, rgb(120 120 120 / 0), rgb(120 120 120 / .45) 45%, rgb(110 110 110 / .95)); }
.lv-ticks { display: flex; justify-content: space-between; font-size: 11px; opacity: .8; }
.lv-words span:last-child { text-align: right; }

/* weather popup at a tapped place, and the small menu for empty spots */
.lv-wxpop .maplibregl-popup-content { padding: 10px 12px; }
.lv-wxpop .lv-fc { min-width: 250px; max-width: 300px; }
.lv-wxpop .lv-fc-head { margin-right: 18px; }
.lv-menu .maplibregl-popup-content { padding: 4px; border-radius: 10px; }
.lv-menu-btn { font: inherit; font-size: 14px; padding: 8px 12px; border: 0; border-radius: 8px; background: none;
  color: var(--fg); cursor: pointer; white-space: nowrap; }
.lv-menu-btn:hover, .lv-menu-btn:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lv-hint { margin-top: 0; }
.cm-actions { margin-top: 8px; display: flex; gap: 6px; }
@media (max-width: 480px) {
  .lv-wxpop { max-width: calc(100vw - 24px) !important; }
  .lv-wxpop .lv-fc { min-width: 0; max-width: calc(100vw - 50px); }
}

/* warnings: popup text and the banner's "Show on map" */
.lv-warn p { margin: 4px 0 6px; font-size: 14px; }
.lv-warn small { display: block; font-size: 12px; opacity: .8; margin-bottom: 3px; }
.lv-warn .cm-kind { font-weight: 600; opacity: 1; }
.lv-showmap { font: inherit; font-size: 12px; margin-left: 6px; padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; }
.lv-menu-list { display: grid; }
.lv-menu-btn { text-align: left; }
