:root {
  --bg: #f5f1e7;
  --card: #fffdf7;
  --ink: #1d1d1b;
  --muted: #6f6a60;
  --brand: #f4b41a;
  --brand-dark: #4f3a08;
  --green: #3f6f38;
  --danger: #b53a2f;
  --line: rgba(29,29,27,.12);
  --shadow: 0 10px 30px rgba(51, 38, 11, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fff4c6, transparent 36%), var(--bg);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.bm-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,253,247,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bm-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.bm-brand img { height: 34px; max-width: 120px; object-fit: contain; }
.bm-icon-btn, .ghost, .primary {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}
.bm-icon-btn, .ghost { background: rgba(29,29,27,.06); }
.primary { background: var(--ink); color: #fff; width: 100%; font-weight: 800; margin-top: 16px; }
.primary.link, .ghost.link { display: inline-flex; width: auto; }

.container { width: min(980px, 100%); margin: 0 auto; padding: 18px 14px; }
.with-bottom-nav { padding-bottom: 92px; }
.hero-card, .login-card, .scale-card, .stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
}
.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.hero-card.compact { align-items: flex-start; }
.hero-card h1 { margin: 2px 0 6px; font-size: clamp(26px, 6vw, 38px); line-height: 1.05; }
.hero-card p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--brand-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.hero-time { font-size: 22px; font-weight: 900; background: #1d1d1b; color: #fff; padding: 10px 13px; border-radius: 14px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
.stats-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card { padding: 14px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; font-size: 26px; line-height: 1.1; margin-top: 4px; }
.stat-card.danger strong { color: var(--danger); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px; }
.section-head h2 { margin: 0; font-size: 20px; }
.scale-list { display: grid; gap: 12px; }
.scale-card { display: block; padding: 15px; }
.scale-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.scale-id { color: var(--brand-dark); font-weight: 900; }
.scale-card h3 { margin: 3px 0 0; font-size: 18px; }
.pill { font-size: 11px; white-space: nowrap; border-radius: 999px; padding: 6px 8px; background: rgba(29,29,27,.08); color: var(--muted); }
.pill.ok { background: rgba(63,111,56,.12); color: var(--green); }
.metrics-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.metrics-row div { background: rgba(29,29,27,.045); border-radius: 14px; padding: 10px 8px; }
.metrics-row span { display: block; font-size: 11px; color: var(--muted); }
.metrics-row strong { display: block; font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 20px; text-align: center; background: rgba(255,255,255,.5); border-radius: 16px; }

.bm-bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(29,29,27,.92);
  border-radius: 20px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.bm-bottom-nav a { text-align: center; color: rgba(255,255,255,.72); padding: 11px 6px; border-radius: 14px; font-weight: 800; font-size: 13px; }
.bm-bottom-nav a.active { background: var(--brand); color: var(--ink); }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-shell { width: min(430px, 100%); }
.login-card { padding: 26px; }
.login-logo img { max-width: 220px; max-height: 82px; object-fit: contain; display: block; margin: 0 auto 16px; }
.login-card h1 { margin: 0 0 4px; font-size: 32px; }
.muted { color: var(--muted); }
.login-card label { display: block; margin: 14px 0 6px; font-weight: 800; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: #fff; }
.hp { position: absolute; left: -9999px; opacity: 0; }
.alert { border-radius: 14px; padding: 12px 14px; margin: 14px 0; font-weight: 700; }
.alert.danger { background: rgba(181,58,47,.1); color: var(--danger); }
.small-link, .back-link { display: inline-block; margin-top: 16px; color: var(--muted); font-weight: 700; }

.map-shell { height: calc(100vh - 59px); display: grid; grid-template-rows: auto 1fr; }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.map-toolbar span { display: block; color: var(--muted); font-size: 12px; }
.mobile-map { min-height: 420px; height: 100%; width: 100%; }

.table-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; }

@media (max-width: 680px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v0.2 mobile telemetry UI */
.dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 18px;
}
.quick-actions a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 16px;
  background: rgba(29,29,27,.07);
  font-weight: 900;
  font-size: 13px;
}
.scale-card { position: relative; overflow: hidden; }
.scale-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(29,29,27,.14);
}
.scale-card.trend-good::before { background: var(--green); }
.scale-card.trend-warn::before { background: #d98d00; }
.scale-card.trend-danger::before { background: var(--danger); }
.stat-card.warn strong { color: #b97800; }
.trend-good { color: var(--green); }
.trend-warn { color: #b97800; }
.trend-danger { color: var(--danger); }
.trend-neutral { color: inherit; }

.device-page .back-link { margin: 2px 0 12px; }
.device-hero,
.weight-strip,
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
}
.device-hero {
  padding: 18px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.device-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -86px;
  top: -90px;
  border-radius: 999px;
  background: rgba(244,180,26,.18);
}
.device-hero.trend-good::after { background: rgba(63,111,56,.18); }
.device-hero.trend-danger::after { background: rgba(181,58,47,.16); }
.device-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}
.device-hero h1 { margin: 2px 0 6px; font-size: clamp(25px, 7vw, 38px); line-height: 1.05; }
.device-hero p { margin: 0; color: var(--muted); }
.hero-measures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.measure-chip {
  min-height: 106px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px 8px;
  border-radius: 20px;
  background: rgba(29,29,27,.045);
}
.measure-chip strong { font-size: 24px; line-height: 1; margin-top: 3px; }
.measure-chip small { color: var(--muted); font-weight: 700; }
.measure-icon { font-size: 30px; line-height: 1; font-weight: 900; }
.icon-temp { color: #d97400; }
.icon-hum { color: #2991a5; }
.icon-bat { color: #418c39; }

.weight-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 18px;
}
.weight-strip article span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.weight-strip article strong { display: block; font-size: clamp(24px, 7vw, 36px); margin-top: 4px; }
.weight-strip article:last-child { text-align: right; }
.scale-symbol { font-size: 38px; color: var(--green); }

.range-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 8px;
}
.range-tabs a {
  text-align: center;
  padding: 12px 8px;
  border-radius: 16px;
  background: rgba(29,29,27,.06);
  font-weight: 900;
  color: var(--muted);
}
.range-tabs a.active {
  background: var(--ink);
  color: #fff;
}
.chart-card { padding: 14px; margin: 10px 0; }
.chart-title { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.chart-title strong { font-size: 16px; }
.chart-title span { color: var(--muted); font-size: 12px; font-weight: 800; }
.bm-chart {
  width: 100%;
  min-height: 210px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(29,29,27,.035), rgba(29,29,27,.015));
  overflow: hidden;
  position: relative;
}
.bm-chart.mini { min-height: 150px; }
.bm-chart svg { display: block; width: 100%; height: 100%; min-height: inherit; }
.chart-empty {
  display: grid;
  place-items: center;
  min-height: inherit;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding: 16px;
}
.chart-label {
  font-size: 11px;
  fill: #6f6a60;
}
.chart-grid-line { stroke: rgba(29,29,27,.10); stroke-width: 1; }
.chart-line { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { opacity: .08; fill: currentColor; }
.chart-point { fill: currentColor; }
.chart-bar-positive { fill: rgba(63,111,56,.82); }
.chart-bar-negative { fill: rgba(181,58,47,.82); }
.chart-zero { stroke: rgba(29,29,27,.28); stroke-width: 1.4; stroke-dasharray: 4 4; }
.mini-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.measurement-table .num { font-weight: 900; }

@media (max-width: 680px) {
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .quick-actions a { font-size: 12px; padding: 0 4px; }
  .hero-measures { grid-template-columns: repeat(3, 1fr); }
  .measure-chip { min-height: 98px; }
  .measure-chip strong { font-size: 21px; }
  .weight-strip { grid-template-columns: 1fr; text-align: left; }
  .weight-strip article:last-child { text-align: left; }
  .scale-symbol { display: none; }
  .mini-chart-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
 * v0.3 mobile cockpit
 * ------------------------------------------------------------------------- */
.device-cockpit { max-width: 760px; }
.device-top-card,
.sensor-board,
.weight-cockpit,
.insight-card,
.device-meta-grid article,
.measurement-navigator {
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.device-top-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-radius: 28px;
  padding: 18px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.device-top-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -74px;
  top: -92px;
  border-radius: 999px;
  background: rgba(244,180,26,.18);
}
.device-top-card.trend-good::after { background: rgba(63,111,56,.18); }
.device-top-card.trend-warn::after { background: rgba(217,141,0,.18); }
.device-top-card.trend-danger::after { background: rgba(181,58,47,.16); }
.device-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.device-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #1d1d1b;
  color: var(--brand);
  font-size: 28px;
  font-weight: 900;
}
.device-top-card h1 {
  margin: 2px 0 4px;
  line-height: 1.05;
  font-size: clamp(24px, 7vw, 36px);
}
.device-top-card p { margin: 0; color: var(--muted); }
.device-top-card .ghost { position: relative; z-index: 1; white-space: nowrap; }

.sensor-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-radius: 28px;
  padding: 6px;
  margin-bottom: 12px;
}
.sensor-tile {
  min-height: 132px;
  display: grid;
  grid-template-rows: 40px auto auto;
  justify-items: center;
  align-items: center;
  text-align: center;
  border-radius: 22px;
  padding: 14px 8px;
}
.sensor-tile + .sensor-tile { border-left: 1px solid rgba(29,29,27,.10); }
.sensor-tile strong {
  display: block;
  font-size: clamp(25px, 7vw, 36px);
  font-weight: 500;
  letter-spacing: -.04em;
}
.sensor-tile small { color: var(--muted); font-weight: 800; }
.sensor-icon { position: relative; display: block; }
.sensor-tile.temp .sensor-icon {
  width: 13px;
  height: 34px;
  border: 4px solid #dd790b;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}
.sensor-tile.temp .sensor-icon::after {
  content: "";
  position: absolute;
  width: 23px;
  height: 23px;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  border: 4px solid #dd790b;
  border-radius: 999px;
  background: rgba(221,121,11,.08);
}
.sensor-tile.hum .sensor-icon {
  width: 34px;
  height: 42px;
  background: #3095a8;
  border-radius: 54% 46% 62% 38% / 58% 47% 53% 42%;
  transform: rotate(45deg);
}
.sensor-tile.bat .sensor-icon {
  width: 50px;
  height: 27px;
  border: 4px solid #4b8d3f;
  border-radius: 7px;
}
.sensor-tile.bat .sensor-icon::before {
  content: "";
  position: absolute;
  right: -10px;
  top: 6px;
  width: 6px;
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: #4b8d3f;
}
.sensor-tile.bat .sensor-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 62%;
  border-radius: 3px;
  background: rgba(75,141,63,.24);
}

.weight-cockpit {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  border-radius: 28px;
  padding: 18px;
  margin-bottom: 12px;
}
.weight-cockpit article span,
.device-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.weight-cockpit article strong {
  display: block;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1;
  margin-top: 7px;
  letter-spacing: -.04em;
}
.weight-cockpit article:nth-child(3) { text-align: right; }
.weight-cockpit .step-diff {
  grid-column: 1 / -1;
  text-align: center;
  border-top: 1px solid rgba(29,29,27,.10);
  padding-top: 14px;
  margin-top: 2px;
}
.weight-cockpit .step-diff strong { font-size: clamp(22px, 6vw, 32px); }
.weight-divider {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 31px;
  box-shadow: 0 12px 24px rgba(63,111,56,.18);
}
.weight-cockpit.trend-danger .weight-divider { background: var(--danger); }
.weight-cockpit.trend-warn .weight-divider { background: #d98d00; }

.insight-card {
  border-radius: 26px;
  padding: 18px;
  margin-bottom: 12px;
  border-left: 7px solid rgba(29,29,27,.22);
}
.insight-card.trend-good { border-left-color: var(--green); }
.insight-card.trend-warn { border-left-color: #d98d00; }
.insight-card.trend-danger { border-left-color: var(--danger); }
.insight-card h2 { margin: 4px 0 6px; font-size: 22px; }
.insight-card p { margin: 0; color: var(--muted); line-height: 1.45; }

.device-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.device-meta-grid article {
  border-radius: 22px;
  padding: 14px;
  min-width: 0;
}
.device-meta-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.device-meta-grid small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.range-tabs-pro {
  position: sticky;
  top: 63px;
  z-index: 16;
  background: rgba(245,241,231,.82);
  backdrop-filter: blur(14px);
  padding: 8px 0;
}
.measurement-navigator {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  border-radius: 22px;
  padding: 8px;
  margin: 4px 0 14px;
}
.measurement-navigator button {
  border: 0;
  min-height: 44px;
  border-radius: 16px;
  background: rgba(29,29,27,.06);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}
.measurement-navigator button.active {
  background: var(--brand);
  color: var(--ink);
}
.featured-chart .bm-chart { min-height: 260px; }

@media (max-width: 520px) {
  .device-top-card { border-radius: 24px; }
  .device-avatar { width: 50px; height: 50px; flex-basis: 50px; border-radius: 18px; }
  .sensor-board { border-radius: 24px; }
  .sensor-tile { min-height: 118px; padding-left: 4px; padding-right: 4px; }
  .sensor-tile + .sensor-tile { border-left: 0; }
  .weight-cockpit { grid-template-columns: 1fr; text-align: left; }
  .weight-cockpit article:nth-child(3) { text-align: left; }
  .weight-divider { display: none; }
  .device-meta-grid { grid-template-columns: 1fr; }
  .measurement-navigator { grid-template-columns: repeat(2, 1fr); }
  .range-tabs-pro { top: 58px; }
}
.measurement-table tbody tr.flash-row {
  animation: bmFlashRow 1.2s ease-out;
}
@keyframes bmFlashRow {
  0% { background: rgba(244,180,26,.42); }
  100% { background: transparent; }
}
.today-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.focus-card {
  display: block;
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 14px;
  border-left: 6px solid rgba(29,29,27,.18);
}
.focus-card.trend-good { border-left-color: var(--green); }
.focus-card.trend-warn { border-left-color: #d98d00; }
.focus-card.trend-danger { border-left-color: var(--danger); }
.focus-card span,
.focus-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.focus-card strong {
  display: block;
  margin: 5px 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}
@media (max-width: 680px) {
  .today-focus-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
 * v0.4 SVG goodies, daily gain and weather intelligence
 * ------------------------------------------------------------------------- */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.svg-avatar svg,
.svg-divider svg,
.goodie-icon,
.weather-grid svg,
.weather-head-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
}
.svg-avatar svg { width: 34px; height: 34px; }
.svg-divider svg { width: 31px; height: 31px; }

.goodies-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.goodie-card {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: space-between;
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.goodie-card::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 96px;
  right: -36px;
  top: -38px;
  border-radius: 999px;
  background: currentColor;
  opacity: .07;
}
.goodie-card span,
.goodie-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}
.goodie-card strong {
  display: block;
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1;
  letter-spacing: -.04em;
}
.goodie-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}
.goodie-card.trend-good { color: var(--green); }
.goodie-card.trend-warn { color: #b97800; }
.goodie-card.trend-danger { color: var(--danger); }
.goodie-card.trend-neutral { color: var(--ink); }
.goodie-card.weather-score { color: #2c7685; }
.goodie-card.weather-score.score-warn { color: #b97800; }
.goodie-card.weather-score .svg-gauge {
  width: 60px;
  height: 60px;
  margin-bottom: 2px;
}
.gauge-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.gauge-bg {
  fill: none;
  stroke: rgba(29,29,27,.10);
  stroke-width: 10;
}
.gauge-value {
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 55px 55px;
}
.gauge-text {
  fill: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.weather-panel {
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}
.weather-panel::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -112px;
  top: -128px;
  border-radius: 999px;
  background: rgba(48,149,168,.12);
}
.weather-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}
.weather-head h2 {
  margin: 3px 0 0;
  font-size: 22px;
}
.weather-head-icon {
  width: 48px;
  height: 48px;
  color: #3095a8;
}
.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
  z-index: 1;
}
.weather-grid article {
  min-width: 0;
  border-radius: 22px;
  padding: 13px;
  background: rgba(29,29,27,.045);
}
.weather-grid svg {
  width: 31px;
  height: 31px;
  color: #3095a8;
  margin-bottom: 8px;
}
.weather-grid span,
.weather-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.weather-grid strong {
  display: block;
  font-size: 21px;
  line-height: 1;
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.weather-charts .chart-card { margin-top: 0; }
.chart-accent-weight { color: #3f6f38; }
.chart-accent-diff { color: #1d1d1b; }
.chart-accent-temp { color: #dd790b; }
.chart-accent-hum { color: #3095a8; }
.chart-accent-rain { color: #2c7685; }
.chart-accent-cloud { color: #687a87; }
.chart-accent-wind { color: #7462a8; }
.chart-accent-weather-risk { color: #b97800; }
.chart-accent-daily { color: var(--green); }
.chart-accent-daily-weather { color: #2c7685; }
.chart-accent-rain .chart-bar-positive,
.chart-accent-daily-weather .chart-bar-positive { fill: rgba(44,118,133,.82); }
.chart-accent-weather-risk .chart-line { stroke-width: 3.4; }

@media (max-width: 760px) {
  .goodies-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .goodie-card { min-height: 142px; }
  .weather-grid { grid-template-columns: 1fr; }
  .weather-head-icon { display: none; }
}

/* v0.5 admin impersonation + Web Push */
.bm-top-actions { display: flex; align-items: center; gap: 8px; }
.push-mini { min-width: 42px; padding-left: 12px; padding-right: 12px; }
.impersonation-banner {
  background: #1d1d1b;
  color: #fff;
  padding: 9px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.push-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 14px;
}
.push-card h2 { margin: 0 0 6px; font-size: 19px; }
.push-card p { margin: 0 0 5px; font-weight: 800; }
.push-card small { color: var(--muted); line-height: 1.35; display: block; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
[data-push-status][data-level="ok"] { color: var(--green); }
[data-push-status][data-level="warn"] { color: var(--danger); }
[data-push-status][data-level="info"] { color: var(--brand-dark); }
button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 680px) {
  .push-card { grid-template-columns: 1fr; }
  .push-actions { justify-content: stretch; }
  .push-actions button { flex: 1; }
}
.small-login-note { font-size: 13px; margin-top: 8px; }
