: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; }

/* v0.6 preferences, day/night, modern mobile polish */
:root {
  --night-bg: #101418;
  --night-card: rgba(255,255,255,.075);
  --night-ink: #f5f5f5;
  --night-muted: #aeb7c1;
}
button, input, select { font: inherit; }
body.theme-night,
body.theme-auto.is-night {
  --bg: #101418;
  --card: rgba(255,255,255,.075);
  --ink: #f5f5f5;
  --muted: #aeb7c1;
  --brand-dark: #ffc107;
  --line: rgba(255,255,255,.12);
  --shadow: 0 18px 45px rgba(0,0,0,.35);
  background:
    radial-gradient(circle at top left, rgba(255, 193, 7, 0.22), transparent 32%),
    linear-gradient(135deg, #101418 0%, #1d242b 55%, #0d1115 100%);
  color: var(--ink);
}
body.theme-day,
body.theme-auto.is-day {
  background: radial-gradient(circle at top left, #fff4c6, transparent 36%), var(--bg);
}
body.theme-night .bm-topbar,
body.theme-auto.is-night .bm-topbar {
  background: rgba(8, 11, 14, .82);
}
body.theme-night .bm-icon-btn,
body.theme-night .ghost,
body.theme-auto.is-night .bm-icon-btn,
body.theme-auto.is-night .ghost {
  background: rgba(255,255,255,.08);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.08);
}
body.theme-night .hero-card,
body.theme-night .login-card,
body.theme-night .scale-card,
body.theme-night .stat-card,
body.theme-night .chart-card,
body.theme-night .device-hero,
body.theme-night .weight-strip,
body.theme-night .push-card,
body.theme-night .prefs-section,
body.theme-auto.is-night .hero-card,
body.theme-auto.is-night .login-card,
body.theme-auto.is-night .scale-card,
body.theme-auto.is-night .stat-card,
body.theme-auto.is-night .chart-card,
body.theme-auto.is-night .device-hero,
body.theme-auto.is-night .weight-strip,
body.theme-auto.is-night .push-card,
body.theme-auto.is-night .prefs-section {
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
}
body.theme-night .metrics-row div,
body.theme-night .measure-chip,
body.theme-night .quick-actions a,
body.theme-night .range-tabs a,
body.theme-auto.is-night .metrics-row div,
body.theme-auto.is-night .measure-chip,
body.theme-auto.is-night .quick-actions a,
body.theme-auto.is-night .range-tabs a {
  background: rgba(255,255,255,.07);
}
body.theme-night input,
body.theme-night select,
body.theme-auto.is-night input,
body.theme-auto.is-night select {
  background: rgba(7,9,11,.72);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.14);
}
.bm-version { opacity: .7; font-size: 11px; margin-left: 4px; }
.bm-bottom-nav { grid-template-columns: repeat(4, 1fr); max-width: 430px; margin: 0 auto; left: 50%; right: auto; width: calc(100% - 24px); transform: translateX(-50%); }
.bm-bottom-nav a { display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; font-size: 16px; padding: 8px 4px; }
.bm-bottom-nav a span { font-size: 10px; font-weight: 800; }
.quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.push-card.subtle-push-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 14px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.push-card h2 { margin: 0 0 4px; font-size: 18px; }
.push-card p { margin: 0 0 5px; color: var(--muted); font-weight: 700; }
.push-card small { color: var(--muted); line-height: 1.35; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.push-actions.compact { min-width: 138px; }
.push-actions.compact .ghost { padding: 8px 10px; font-size: 12px; }
[data-push-status][data-level="ok"] { color: var(--green); }
[data-push-status][data-level="warn"] { color: #d98d00; }
.prefs-hero { align-items: center; background: linear-gradient(135deg, rgba(255,193,7,.18), rgba(255,255,255,.07)); }
.prefs-bell { width: 58px; height: 58px; border-radius: 22px; display: grid; place-items: center; font-size: 30px; background: rgba(255,193,7,.18); box-shadow: 0 8px 25px rgba(255,193,7,.22); }
.prefs-form { display: grid; gap: 14px; }
.prefs-section {
  border-radius: 24px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.prefs-section h2 { margin: 0 0 12px; font-size: 18px; }
.switch-row,
.input-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.switch-row:first-of-type,
.input-row:first-of-type { border-top: 0; }
.switch-row span,
.input-row span { display: grid; gap: 3px; }
.switch-row small,
.input-row small { color: var(--muted); line-height: 1.35; }
.switch-row input[type="checkbox"] {
  appearance: none;
  width: 54px;
  min-width: 54px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(29,29,27,.16);
  position: relative;
  cursor: pointer;
}
.switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.22);
  transition: transform .18s ease;
}
.switch-row input[type="checkbox"]:checked { background: var(--brand); }
.switch-row input[type="checkbox"]:checked::after { transform: translateX(24px); }
.input-row input,
.input-row select,
.two-col-inputs input {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.8);
  min-width: 110px;
}
.two-col-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.two-col-inputs label { display: grid; gap: 6px; color: var(--muted); font-weight: 800; }
.primary.full { margin-top: 0; }
.alert.success { background: rgba(63,111,56,.12); color: var(--green); }
.hero-card.mobile-home-hero {
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 193, 7, .18), transparent 38%),
    var(--card);
}
body.theme-night .hero-card.mobile-home-hero,
body.theme-auto.is-night .hero-card.mobile-home-hero {
  background:
    radial-gradient(circle at top left, rgba(255, 193, 7, .22), transparent 32%),
    rgba(255,255,255,.075);
}
@media (max-width: 520px) {
  .push-card.subtle-push-card { flex-direction: column; }
  .push-actions { justify-content: flex-start; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .switch-row, .input-row { align-items: flex-start; }
}

/* -------------------------------------------------------------------------
 * v0.8 polishing: compact header, clean SVG icons, proportional battery/signal,
 * Open-Meteo forecast cards and modern live dashboard
 * ------------------------------------------------------------------------- */
.bm-topbar { min-height: 58px; }
.bm-brand img { height: 32px; width: 32px; max-width: 32px; border-radius: 10px; }
.logout-compact { min-width: 38px; padding: 9px 11px; font-size: 18px; line-height: 1; }
.live-dashboard-hero {
  display: grid;
  gap: 16px;
  color: #f5f5f5;
  background:
    radial-gradient(circle at top left, rgba(255,193,7,.30), transparent 34%),
    linear-gradient(135deg, #101418 0%, #1d242b 58%, #0d1115 100%) !important;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.live-dashboard-hero .eyebrow { color: #ffd766; }
.live-dashboard-hero p { color: #cbd3dc; }
.live-dashboard-hero h1 { color: #fff; }
.live-hero-top,
.live-hero-bottom { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; width: 100%; }
.live-hero-bottom { align-items: center; }
.live-pill { font-size: 12px; padding: 7px 11px; border-radius: 999px; background: rgba(46,204,113,.16); color: #6dff9d; border: 1px solid rgba(109,255,157,.35); font-weight: 900; white-space: nowrap; }
.mini-ticker { flex: 1; min-width: 0; background: #07090b; color: #f8f8f8; border: 1px solid rgba(255,255,255,.10); border-radius: 14px; padding: 11px 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sensor-svg { width: 42px; height: 42px; fill: currentColor; }
.sensor-tile.temp .sensor-svg { color: #dd790b; }
.sensor-tile.hum .sensor-svg { color: #3095a8; }
.sensor-tile .sensor-icon { display: none; }
.battery-meter { width: 58px; height: 42px; display: grid; place-items: center; position: relative; color: #4b8d3f; }
.battery-meter svg { width: 58px; height: 42px; fill: currentColor; opacity: .95; }
.battery-meter i { position: absolute; left: 12px; top: 13px; height: 16px; width: calc(var(--level) * .34); max-width: 34px; min-width: 0; border-radius: 4px; background: currentColor; opacity: .35; }
.indicator-good { color: var(--green); }
.indicator-mid { color: #b97800; }
.indicator-low { color: #d98d00; }
.indicator-critical { color: var(--danger); animation: bmPulseRed 1s ease-in-out infinite; }
@keyframes bmPulseRed { 0%,100% { filter: drop-shadow(0 0 0 rgba(181,58,47,0)); } 50% { filter: drop-shadow(0 0 9px rgba(181,58,47,.75)); } }
.signal-bars { display: inline-flex; align-items: end; gap: 2px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.signal-bars i { width: 4px; border-radius: 4px 4px 1px 1px; background: currentColor; opacity: .25; }
.signal-bars i:nth-child(1) { height: 6px; }
.signal-bars i:nth-child(2) { height: 10px; }
.signal-bars i:nth-child(3) { height: 14px; }
.signal-bars i:nth-child(4) { height: 18px; }
.indicator-good .signal-bars i { opacity: .95; }
.indicator-mid .signal-bars i:nth-child(-n+3) { opacity: .9; }
.indicator-low .signal-bars i:nth-child(-n+2) { opacity: .9; }
.indicator-critical .signal-bars i:nth-child(1) { opacity: .95; }
.weight-cockpit article small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; font-weight: 800; }
.forecast-panel {
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
body.theme-night .forecast-panel,
body.theme-auto.is-night .forecast-panel { background: rgba(255,255,255,.075); border-color: rgba(255,255,255,.10); backdrop-filter: blur(18px); }
.forecast-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.forecast-day { border-radius: 22px; padding: 13px; background: rgba(29,29,27,.045); border: 1px solid transparent; display: grid; gap: 5px; min-width: 0; }
body.theme-night .forecast-day,
body.theme-auto.is-night .forecast-day { background: rgba(255,255,255,.07); }
.forecast-day strong { font-size: 15px; }
.forecast-day span { color: var(--muted); font-size: 12px; font-weight: 850; }
.forecast-temp { font-size: 19px; font-weight: 950; }
.forecast-day small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.forecast-day small svg { width: 14px; height: 14px; fill: currentColor; vertical-align: -2px; }
.forecast-day em { font-style: normal; font-weight: 950; font-size: 12px; border-radius: 999px; padding: 6px 8px; width: fit-content; background: rgba(29,29,27,.07); }
.forecast-day.flight-good { border-color: rgba(63,111,56,.24); }
.forecast-day.flight-good em { color: var(--green); background: rgba(63,111,56,.12); }
.forecast-day.flight-warn em { color: #b97800; background: rgba(217,141,0,.12); }
.forecast-day.flight-danger em { color: var(--danger); background: rgba(181,58,47,.12); }
@media (max-width: 760px) { .forecast-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) {
  .bm-top-actions { gap: 5px; }
  .bm-icon-btn { padding: 8px 10px; }
  .bm-brand span { font-size: 14px; }
  .bm-version { font-size: 10px; }
  .live-hero-top, .live-hero-bottom { flex-direction: column; align-items: flex-start; }
  .mini-ticker { width: 100%; }
  .forecast-days { grid-template-columns: 1fr; }
}


/* -------------------------------------------------------------------------
 * v0.9 practical fixes: quick scale jump, raw gram daily difference,
 * red/green/blue trends and health alerts UI.
 * ------------------------------------------------------------------------- */
:root { --blue: #1f78b4; }
.trend-zero { color: var(--blue); }
.scale-card.trend-zero::before { background: var(--blue); }
.device-top-card.trend-zero::after { background: rgba(31,120,180,.16); }
.weight-cockpit.trend-zero .weight-divider { background: var(--blue); }
.insight-card.trend-zero { border-left-color: var(--blue); }
.goodie-card.trend-zero { color: var(--blue); }
.focus-card.trend-zero { border-left-color: var(--blue); }
.chart-bar-zero { fill: rgba(31,120,180,.82); }
.measurement-table .trend-good { color: var(--green); font-weight: 950; }
.measurement-table .trend-danger { color: var(--danger); font-weight: 950; }
.measurement-table .trend-zero { color: var(--blue); font-weight: 950; }

.scale-jump-card {
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 14px;
  margin: 12px 0 16px;
}
body.theme-night .scale-jump-card,
body.theme-auto.is-night .scale-jump-card { background: rgba(255,255,255,.075); border-color: rgba(255,255,255,.10); }
.scale-jump-form { display: grid; gap: 8px; }
.scale-jump-form label { font-weight: 950; font-size: 13px; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .06em; }
.scale-jump-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.scale-jump-row input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 13px;
  background: rgba(255,255,255,.84);
  color: var(--ink);
  font-weight: 850;
}
.scale-jump-row button {
  border: 0;
  border-radius: 16px;
  padding: 0 15px;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}
.scale-jump-form small { color: var(--muted); font-size: 12px; }
.compact-scale-jump { margin-top: 8px; }

.profile-summary { margin-top: 14px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.profile-grid div { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: rgba(29,29,27,.035); min-width: 0; }
.profile-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 850; }
.profile-grid strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }

.indicator-critical .battery-meter,
.indicator-critical .battery-meter svg,
.indicator-critical .signal-bars,
.indicator-critical .signal-bars i { color: var(--danger) !important; }
.indicator-low .battery-meter,
.indicator-low .battery-meter svg,
.indicator-low .signal-bars,
.indicator-low .signal-bars i { color: #d98d00 !important; }
.indicator-mid .battery-meter,
.indicator-mid .battery-meter svg,
.indicator-mid .signal-bars,
.indicator-mid .signal-bars i { color: #b97800 !important; }
.indicator-good .battery-meter,
.indicator-good .battery-meter svg,
.indicator-good .signal-bars,
.indicator-good .signal-bars i { color: var(--green) !important; }
.signal-bars.bars-0 i { opacity: .18; }
.signal-bars.bars-1 i:nth-child(-n+1),
.signal-bars.bars-2 i:nth-child(-n+2),
.signal-bars.bars-3 i:nth-child(-n+3),
.signal-bars.bars-4 i:nth-child(-n+4) { opacity: .95; }

@media (max-width: 520px) {
  .profile-grid { grid-template-columns: 1fr; }
  .scale-jump-row { grid-template-columns: 1fr; }
  .scale-jump-row button { padding: 12px 15px; }
}


/* -------------------------------------------------------------------------
 * v0.9.1 fixes: old-style mobile signal bars and safer health colors.
 * The smallest active bar is red; extra bars fill one by one with warmer→green colors.
 * ------------------------------------------------------------------------- */
.signal-bars i {
  background: rgba(120, 128, 138, .30) !important;
  color: inherit;
  opacity: 1;
}
.signal-bars.bars-1 i:nth-child(1),
.signal-bars.bars-2 i:nth-child(1),
.signal-bars.bars-3 i:nth-child(1),
.signal-bars.bars-4 i:nth-child(1) { background: #e53935 !important; opacity: .98; }
.signal-bars.bars-2 i:nth-child(2),
.signal-bars.bars-3 i:nth-child(2),
.signal-bars.bars-4 i:nth-child(2) { background: #f39c12 !important; opacity: .98; }
.signal-bars.bars-3 i:nth-child(3),
.signal-bars.bars-4 i:nth-child(3) { background: #f4c542 !important; opacity: .98; }
.signal-bars.bars-4 i:nth-child(4) { background: #2f9e44 !important; opacity: .98; }
.indicator-critical .signal-bars,
.indicator-critical .signal-bars i:first-child { animation: bmPulseRed 1s ease-in-out infinite; }
.indicator-critical .signal-bars i:not(:first-child) { opacity: .28; }

/* -------------------------------------------------------------------------
 * v0.9.2: offline devices, 5-bar signal indicator, stale-safe dashboard
 * ------------------------------------------------------------------------- */
.signal-bars { height: 20px; }
.signal-bars i { width: 4px; border-radius: 4px 4px 1px 1px; background: rgba(120,128,138,.28) !important; opacity: 1 !important; }
.signal-bars i:nth-child(1) { height: 5px; }
.signal-bars i:nth-child(2) { height: 8px; }
.signal-bars i:nth-child(3) { height: 11px; }
.signal-bars i:nth-child(4) { height: 15px; }
.signal-bars i:nth-child(5) { height: 19px; }
.signal-bars.bars-1 i:nth-child(1),
.signal-bars.bars-2 i:nth-child(1),
.signal-bars.bars-3 i:nth-child(1),
.signal-bars.bars-4 i:nth-child(1),
.signal-bars.bars-5 i:nth-child(1) { background: #e53935 !important; }
.signal-bars.bars-2 i:nth-child(2),
.signal-bars.bars-3 i:nth-child(2),
.signal-bars.bars-4 i:nth-child(2),
.signal-bars.bars-5 i:nth-child(2) { background: #f39c12 !important; }
.signal-bars.bars-3 i:nth-child(3),
.signal-bars.bars-4 i:nth-child(3),
.signal-bars.bars-5 i:nth-child(3) { background: #f4c542 !important; }
.signal-bars.bars-4 i:nth-child(4),
.signal-bars.bars-5 i:nth-child(4) { background: #8bc34a !important; }
.signal-bars.bars-5 i:nth-child(5) { background: #2f9e44 !important; }
.indicator-critical .signal-bars i:nth-child(1) { animation: bmPulseRed 1s ease-in-out infinite; }

.offline-banner,
.device-stopped {
  border: 1px solid rgba(181,58,47,.28) !important;
  background: rgba(181,58,47,.08) !important;
}
.offline-banner {
  border-radius: 22px;
  padding: 13px 14px;
  margin: 10px 0 12px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow);
}
.offline-banner strong { color: var(--danger); font-weight: 950; }
.offline-banner span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.device-stopped { color: var(--danger); }
.device-stopped::before { background: var(--danger) !important; }
.stopped-reason {
  margin-top: 10px;
  border-top: 1px dashed rgba(181,58,47,.25);
  padding-top: 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}
.pill.danger { background: rgba(181,58,47,.13); color: var(--danger); border-color: rgba(181,58,47,.28); }


/* v0.9.3 - app icon/account summary/old-style battery & signal */
.account-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin: 12px 0;
}
body.theme-night .account-summary-card,
body.theme-auto.is-night .account-summary-card { background: rgba(255,255,255,.075); border-color: rgba(255,255,255,.10); }
.account-money span,
.account-health small { display: block; color: var(--muted); font-size: 11px; font-weight: 850; }
.account-money strong { display: block; font-size: 26px; line-height: 1.1; margin: 4px 0; color: #0f1418; }
body.theme-night .account-money strong,
body.theme-auto.is-night .account-money strong { color: #f6f6f6; }
.account-health { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
.account-health > div { border-radius: 18px; padding: 10px; background: rgba(29,29,27,.045); display: grid; gap: 4px; align-content: center; justify-items: start; min-width: 0; }
body.theme-night .account-health > div,
body.theme-auto.is-night .account-health > div { background: rgba(255,255,255,.07); }
.account-health b { font-size: 16px; color: currentColor; }
.device-account-summary { margin-bottom: 12px; }

.battery-stack { --level: 0%; width: 44px; height: 58px; display: inline-grid; place-items: center; position: relative; color: #159447; vertical-align: middle; }
.battery-meter.battery-stack { width: 58px; height: 44px; }
.battery-stack svg { width: 44px !important; height: 58px !important; fill: none !important; stroke: currentColor; stroke-width: 1.8; }
.battery-meter.battery-stack svg { width: 58px !important; height: 44px !important; fill: currentColor !important; stroke: none; }
.battery-stack i { position: absolute; left: 13px; bottom: 10px; width: 18px; max-height: 35px; height: calc(var(--level) * .35); border-radius: 3px; background: repeating-linear-gradient(to top, currentColor 0 7px, transparent 7px 10px); opacity: .95; }
.battery-meter.battery-stack i { left: 12px; top: 13px; bottom: auto; width: calc(var(--level) * .34); height: 16px; max-width: 34px; background: currentColor; opacity: .45; }
.indicator-critical .battery-stack,
.indicator-critical .battery-meter { color: var(--danger) !important; }
.indicator-low .battery-stack,
.indicator-low .battery-meter { color: #d98d00 !important; }
.indicator-mid .battery-stack,
.indicator-mid .battery-meter { color: #b97800 !important; }
.indicator-good .battery-stack,
.indicator-good .battery-meter { color: #168a2f !important; }

.signal-bars { gap: 3px; height: 30px; margin-right: 7px; }
.signal-bars i { width: 7px; border-radius: 6px 6px 1px 1px; background: #d7d7d7; opacity: .55; }
.signal-bars i:nth-child(1) { height: 10px; }
.signal-bars i:nth-child(2) { height: 15px; }
.signal-bars i:nth-child(3) { height: 20px; }
.signal-bars i:nth-child(4) { height: 25px; }
.signal-bars i:nth-child(5) { height: 30px; }
.signal-bars.bars-1 i:nth-child(1),
.indicator-critical .signal-bars i:nth-child(1) { background: #e53935; opacity: 1; }
.signal-bars.bars-2 i:nth-child(1) { background: #e53935; opacity: 1; }
.signal-bars.bars-2 i:nth-child(2),
.indicator-low .signal-bars i:nth-child(-n+2) { background: #fb8c00; opacity: 1; }
.signal-bars.bars-3 i:nth-child(1) { background: #e53935; opacity: 1; }
.signal-bars.bars-3 i:nth-child(2) { background: #fb8c00; opacity: 1; }
.signal-bars.bars-3 i:nth-child(3),
.indicator-mid .signal-bars i:nth-child(-n+3) { background: #f4b41a; opacity: 1; }
.signal-bars.bars-4 i:nth-child(-n+4) { background: #43a047; opacity: 1; }
.signal-bars.bars-5 i { background: #111; opacity: 1; }
.indicator-good .signal-bars.bars-5 i { background: #111; }
body.theme-night .signal-bars.bars-5 i,
body.theme-auto.is-night .signal-bars.bars-5 i { background: #f5f5f5; }

@media (max-width: 440px) {
  .account-summary-card { grid-template-columns: 1fr; }
  .account-health { grid-template-columns: 1fr 1fr; }
}

/* v0.9.4 - PWA update toast */
.bm-update-toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 92px;
  z-index: 99999;
  max-width: 430px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(18, 18, 18, .96);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 44px rgba(0,0,0,.34);
}
.bm-update-title { font-weight: 900; font-size: 14px; margin-bottom: 4px; }
.bm-update-text { font-size: 12px; line-height: 1.35; color: rgba(255,255,255,.78); }
.bm-update-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.bm-update-actions button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}
.bm-update-later { background: rgba(255,255,255,.12); color: #fff; }
.bm-update-now { background: #f4b41a; color: #171717; }

/* v0.9.4 - install prompt, χαμηλά και διακριτικά */
.bm-install-box {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 92px;
  z-index: 99998;
  max-width: 430px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(20,20,20,.94);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 34px rgba(0,0,0,.32);
}
.bm-install-title { font-weight: 900; font-size: 14px; margin-bottom: 4px; }
.bm-install-text { font-size: 12px; line-height: 1.35; color: rgba(255,255,255,.78); }
.bm-install-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.bm-install-actions button { border: 0; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 800; }
.bm-install-close { background: rgba(255,255,255,.12); color: #fff; }
.bm-install-btn { background: #f4b41a; color: #171717; }

/* -------------------------------------------------------------------------
 * v0.9.5 - current reading cockpit, signal color normalization, Open-Meteo-only weather
 * ------------------------------------------------------------------------- */
.current-reading-card {
  background: rgba(255,253,247,.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}
body.theme-night .current-reading-card,
body.theme-auto.is-night .current-reading-card {
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.10);
  backdrop-filter: blur(18px);
}
.current-reading-card::after {
  content: "";
  position: absolute;
  right: -75px;
  top: -105px;
  width: 195px;
  height: 195px;
  border-radius: 999px;
  background: rgba(244,180,26,.12);
  pointer-events: none;
}
.current-reading-card.trend-good::after { background: rgba(63,111,56,.14); }
.current-reading-card.trend-danger::after { background: rgba(181,58,47,.12); }
.current-reading-card.trend-zero::after { background: rgba(31,120,180,.12); }
.current-reading-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr);
  gap: 12px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.current-reading-card article span,
.current-step-line span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .02em;
}
.current-weight strong {
  display: block;
  font-size: clamp(34px, 9vw, 50px);
  line-height: .95;
  letter-spacing: -.055em;
  margin: 8px 0 6px;
  color: var(--ink);
}
.current-day-diff {
  text-align: right;
  align-self: center;
}
.current-day-diff strong {
  display: block;
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1;
  margin: 7px 0 5px;
  letter-spacing: -.045em;
  color: currentColor;
}
.current-weight small,
.current-day-diff small,
.current-sensors-inline small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}
.current-step-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(29,29,27,.10);
  border-bottom: 1px solid rgba(29,29,27,.10);
  margin: 14px 0;
  padding: 11px 0;
  position: relative;
  z-index: 1;
}
.current-step-line strong {
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1;
  letter-spacing: -.035em;
  font-weight: 950;
}
.current-sensors-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
}
.mini-sensor {
  min-width: 0;
  border-radius: 18px;
  background: rgba(29,29,27,.045);
  padding: 10px 7px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  text-align: center;
}
body.theme-night .mini-sensor,
body.theme-auto.is-night .mini-sensor { background: rgba(255,255,255,.07); }
.mini-sensor svg.sensor-svg { width: 24px; height: 24px; }
.mini-sensor strong { font-size: clamp(15px, 4vw, 21px); line-height: 1; font-weight: 950; }
.mini-sensor .battery-meter { width: 38px; height: 28px; }
.mini-sensor .battery-meter svg { width: 38px !important; height: 28px !important; }
.mini-sensor .battery-meter i { left: 8px; top: 8px; height: 11px; max-width: 23px; width: calc(var(--level) * .23); }
.mini-sensor .signal-bars { margin-right: 0; transform: scale(.88); transform-origin: center bottom; }
.weather-source-note {
  border: 1px dashed rgba(48,149,168,.35);
  background: rgba(48,149,168,.07);
  border-radius: 22px;
  padding: 13px 14px;
  margin: 12px 0;
  display: grid;
  gap: 4px;
}
.weather-source-note strong { color: #2c7685; font-weight: 950; }
.weather-source-note span { color: var(--muted); font-size: 13px; line-height: 1.35; }
@media (max-width: 520px) {
  .current-reading-top { grid-template-columns: 1fr; }
  .current-day-diff { text-align: left; }
  .current-sensors-inline { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Final signal-bar rule: all filled bars share one color per level. */
.signal-bars i { background: rgba(120,128,138,.30) !important; opacity: 1 !important; }
.signal-bars.bars-1 i:nth-child(-n+1) { background: #e53935 !important; }
.signal-bars.bars-2 i:nth-child(-n+2) { background: #fb8c00 !important; }
.signal-bars.bars-3 i:nth-child(-n+3) { background: #f4b41a !important; }
.signal-bars.bars-4 i:nth-child(-n+4) { background: #43a047 !important; }
.signal-bars.bars-5 i:nth-child(-n+5) { background: #111 !important; }
body.theme-night .signal-bars.bars-5 i:nth-child(-n+5),
body.theme-auto.is-night .signal-bars.bars-5 i:nth-child(-n+5) { background: #f5f5f5 !important; }
.indicator-critical .signal-bars.bars-1 i:nth-child(1) { animation: bmPulseRed 1s ease-in-out infinite; }


/* -------------------------------------------------------------------------
 * v0.9.6 - dashboard device health, final signal bars, daily table for 7d/30d
 * ------------------------------------------------------------------------- */
.metrics-row-extended { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metrics-row small { display:block; color: var(--muted); font-size:10px; margin-top:2px; overflow-wrap:anywhere; }
.signal-bars.compact { height: 18px; gap: 2px; margin-right: 3px; vertical-align: -3px; }
.signal-bars.compact i { width: 4px; border-radius: 4px 4px 1px 1px; }
.signal-bars.compact i:nth-child(1) { height: 6px; }
.signal-bars.compact i:nth-child(2) { height: 9px; }
.signal-bars.compact i:nth-child(3) { height: 12px; }
.signal-bars.compact i:nth-child(4) { height: 15px; }
.signal-bars.compact i:nth-child(5) { height: 18px; }

/* Final override: all active signal bars use one color per level. */
.signal-bars i { background: rgba(120,128,138,.28) !important; opacity: 1 !important; }
.signal-bars.bars-0 i { background: rgba(120,128,138,.20) !important; }
.signal-bars.bars-1 i:nth-child(-n+1) { background: #e53935 !important; }
.signal-bars.bars-2 i:nth-child(-n+2) { background: #fb8c00 !important; }
.signal-bars.bars-3 i:nth-child(-n+3) { background: #f4b41a !important; }
.signal-bars.bars-4 i:nth-child(-n+4) { background: #43a047 !important; }
.signal-bars.bars-5 i:nth-child(-n+5) { background: #168a2f !important; }
.indicator-critical .signal-bars.bars-1 i:nth-child(1) { animation: bmPulseRed 1s ease-in-out infinite; }

.device-top-card h1 { font-size: clamp(22px, 6vw, 34px); line-height: 1.05; max-width: 100%; overflow-wrap: anywhere; }
.device-title-row { min-width: 0; }
.device-title-row > div:last-child { min-width: 0; }
.current-weight small { margin-top: 4px; }
.measurement-table td .signal-bars { margin-right: 5px; }

@media (max-width: 720px) {
  .metrics-row-extended { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .metrics-row-extended { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------------------------------------------------------------------------
 * v0.9.7 - short area names, clean account card, final signal/tech cockpit
 * ------------------------------------------------------------------------- */
.account-summary-card.account-only {
  grid-template-columns: 1fr !important;
}
.account-summary-card.account-only .account-health {
  display: none !important;
}
.device-account-summary {
  display: none !important;
}
.device-top-card h1,
.scale-card h3,
.focus-card small,
.mini-ticker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal !important;
}
.device-top-card h1 {
  max-width: min(72vw, 360px);
  font-size: clamp(24px, 7vw, 36px) !important;
}
.scale-card h3 {
  max-width: 100%;
  font-size: clamp(15px, 4.2vw, 20px);
}
.current-sensors-inline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.current-sensors-inline .mini-sensor.sig small,
.metrics-row-extended small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signal-line {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
}
.signal-line.compact-line {
  min-height: 18px;
  vertical-align: -3px;
}
.signal-antenna {
  font-size: 14px;
  line-height: 1;
  color: currentColor;
  opacity: .85;
  transform: translateY(-7px);
  display: inline-block;
}
.signal-line.compact-line .signal-antenna {
  font-size: 10px;
  transform: translateY(-4px);
}
.tech-badge,
.current-sensors-inline .sig small,
.metrics-row-extended .indicator-good small,
.metrics-row-extended .indicator-mid small,
.metrics-row-extended .indicator-low small,
.metrics-row-extended .indicator-critical small {
  font-weight: 850;
}
/* Last-word signal rule: all active bars have one color according to level. */
.signal-bars i {
  background: rgba(120,128,138,.25) !important;
  opacity: 1 !important;
}
.signal-bars.bars-0 i { background: rgba(120,128,138,.20) !important; }
.signal-bars.bars-1 i:nth-child(-n+1) { background: #e53935 !important; }
.signal-bars.bars-2 i:nth-child(-n+2) { background: #fb8c00 !important; }
.signal-bars.bars-3 i:nth-child(-n+3) { background: #f4b41a !important; }
.signal-bars.bars-4 i:nth-child(-n+4) { background: #43a047 !important; }
.signal-bars.bars-5 i:nth-child(-n+5) { background: #168a2f !important; }
.indicator-critical .signal-bars.bars-1 i:nth-child(1) { animation: bmPulseRed 1s ease-in-out infinite; }
/* Το signal block δεν χρειάζεται πια στο profile/account. Είναι ανά συσκευή. */
.account-health { display: none; }

@media (max-width: 520px) {
  .device-top-card h1 { max-width: 58vw; }
  .current-sensors-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .current-sensors-inline .mini-sensor.sig { grid-column: span 2; }
  .current-sensors-inline .mini-sensor.sig .signal-line { transform: scale(1.1); }
}


/* -------------------------------------------------------------------------
 * v0.9.9 - place-name cleanup and visible GSM/LTE signal icon
 * ------------------------------------------------------------------------- */
.device-top-card h1,
.scale-card h3 {
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.device-top-card h1 { font-size: clamp(22px, 6vw, 32px) !important; }
.scale-card h3 { font-size: clamp(15px, 4vw, 19px) !important; }

.signal-line {
  display: inline-flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 5px !important;
  min-width: 54px;
  min-height: 30px;
  color: currentColor;
  line-height: 1;
}
.signal-line.compact-line {
  min-width: 44px;
  min-height: 20px;
  gap: 3px !important;
}
.signal-antenna {
  position: relative !important;
  display: inline-block !important;
  width: 18px !important;
  height: 22px !important;
  flex: 0 0 18px !important;
  transform: none !important;
  opacity: .95 !important;
  color: currentColor !important;
  font-size: 0 !important;
  margin-right: 1px;
}
.signal-line.compact-line .signal-antenna {
  width: 14px !important;
  height: 18px !important;
  flex-basis: 14px !important;
}
.signal-antenna .wave {
  position: absolute;
  left: 50%;
  border-top: 2px solid currentColor;
  border-radius: 999px 999px 0 0;
  transform: translateX(-50%);
  opacity: .95;
}
.signal-antenna .w1 { bottom: 12px; width: 8px; height: 5px; }
.signal-antenna .w2 { bottom: 15px; width: 14px; height: 8px; }
.signal-antenna .w3 { bottom: 18px; width: 20px; height: 10px; }
.signal-antenna .mast {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 6px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 1px 1px 2px 2px;
  transform: translateX(-50%);
}
.signal-line.compact-line .signal-antenna .w1 { bottom: 10px; width: 6px; height: 4px; }
.signal-line.compact-line .signal-antenna .w2 { bottom: 13px; width: 10px; height: 6px; }
.signal-line.compact-line .signal-antenna .w3 { bottom: 16px; width: 14px; height: 7px; }
.signal-line.compact-line .signal-antenna .mast { width: 5px; height: 6px; bottom: 1px; }

.signal-bars {
  display: inline-flex !important;
  align-items: flex-end !important;
  gap: 3px !important;
  height: 24px !important;
  margin: 0 !important;
  vertical-align: baseline !important;
}
.signal-bars i {
  display: block !important;
  width: 5px !important;
  border-radius: 5px 5px 1px 1px !important;
  background: rgba(120,128,138,.24) !important;
  opacity: 1 !important;
}
.signal-bars i:nth-child(1) { height: 7px !important; }
.signal-bars i:nth-child(2) { height: 11px !important; }
.signal-bars i:nth-child(3) { height: 15px !important; }
.signal-bars i:nth-child(4) { height: 19px !important; }
.signal-bars i:nth-child(5) { height: 23px !important; }
.signal-bars.compact { height: 18px !important; gap: 2px !important; }
.signal-bars.compact i { width: 4px !important; }
.signal-bars.compact i:nth-child(1) { height: 5px !important; }
.signal-bars.compact i:nth-child(2) { height: 8px !important; }
.signal-bars.compact i:nth-child(3) { height: 11px !important; }
.signal-bars.compact i:nth-child(4) { height: 14px !important; }
.signal-bars.compact i:nth-child(5) { height: 17px !important; }
.signal-bars.bars-0 i { background: rgba(120,128,138,.20) !important; }
.signal-bars.bars-1 i:nth-child(-n+1) { background: #e53935 !important; }
.signal-bars.bars-2 i:nth-child(-n+2) { background: #fb8c00 !important; }
.signal-bars.bars-3 i:nth-child(-n+3) { background: #f4b41a !important; }
.signal-bars.bars-4 i:nth-child(-n+4) { background: #43a047 !important; }
.signal-bars.bars-5 i:nth-child(-n+5) { background: #168a2f !important; }
.indicator-critical .signal-line { color: #e53935 !important; }
.indicator-low .signal-line { color: #fb8c00 !important; }
.indicator-mid .signal-line { color: #b97800 !important; }
.indicator-good .signal-line { color: #168a2f !important; }
.indicator-critical .signal-antenna,
.indicator-critical .signal-bars.bars-1 i:nth-child(1) { animation: bmPulseRed 1s ease-in-out infinite; }
.current-sensors-inline .mini-sensor.sig strong {
  margin-top: 0;
}
.current-sensors-inline .mini-sensor.sig small {
  max-width: 100%;
}

/* v1.0.0 login, signal thresholds and SMS settings */
.pro-login-shell { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.pro-login-card { max-width: 460px; width: 100%; border-radius: 28px; padding: 22px; }
.login-brand-row { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.login-app-icon { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: rgba(244,180,26,.12); border: 1px solid rgba(244,180,26,.35); }
.login-app-icon img { width: 42px; height: 42px; object-fit: contain; }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; background: rgba(0,0,0,.05); border-radius: 18px; margin: 16px 0; }
.login-tab { border: 0; border-radius: 14px; padding: 10px 8px; font-weight: 900; background: transparent; color: var(--muted); }
.login-tab.active { background: var(--brand); color: #171717; box-shadow: 0 8px 18px rgba(244,180,26,.25); }
.login-tab-panel { display: none; }
.login-tab-panel.active { display: block; }
.register-2fa-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.register-2fa-form.verify-form { margin-top: 16px; }
.register-2fa-form select,
.register-2fa-form input { width: 100%; }
.dashboard-hero-clean { background: linear-gradient(135deg, #151b20, #0f1317); color: #fff; }
.dashboard-hero-clean p { color: rgba(255,255,255,.72); }
.dashboard-hero-clean h1 { color: #fff; }
.signal-line { display: inline-flex; align-items: end; gap: 5px; justify-content: center; }
.signal-antenna { position: relative; width: 18px; height: 22px; display: inline-block; color: currentColor; }
.signal-antenna .mast { position: absolute; left: 8px; bottom: 0; width: 3px; height: 8px; background: currentColor; border-radius: 2px; }
.signal-antenna .wave { position: absolute; left: 50%; transform: translateX(-50%); border: 2px solid currentColor; border-left-color: transparent; border-right-color: transparent; border-bottom-color: transparent; border-radius: 50%; opacity: .85; }
.signal-antenna .w1 { bottom: 8px; width: 10px; height: 10px; }
.signal-antenna .w2 { bottom: 12px; width: 16px; height: 16px; }
.signal-antenna .w3 { bottom: 16px; width: 22px; height: 22px; }
.signal-bars i { background: rgba(120,128,138,.25) !important; opacity: 1 !important; }
.signal-bars.bars-1 { color: #d93025 !important; }
.signal-bars.bars-2 { color: #fb8c00 !important; }
.signal-bars.bars-3 { color: #d6a500 !important; }
.signal-bars.bars-4,
.signal-bars.bars-5 { color: #2f9e44 !important; }
.signal-bars.bars-1 i:nth-child(-n+1),
.signal-bars.bars-2 i:nth-child(-n+2),
.signal-bars.bars-3 i:nth-child(-n+3),
.signal-bars.bars-4 i:nth-child(-n+4),
.signal-bars.bars-5 i:nth-child(-n+5) { background: currentColor !important; opacity: 1 !important; }
.indicator-critical .signal-line { color: #d93025 !important; animation: bmPulseRed 1s ease-in-out infinite; }
.indicator-low .signal-line { color: #fb8c00 !important; }
.indicator-mid .signal-line { color: #d6a500 !important; }
.indicator-good .signal-line { color: #2f9e44 !important; }
button[data-sms-test] { margin-top: 10px; }
[data-sms-test-result] { display: block; margin-top: 8px; color: var(--muted); }
@media (max-width: 420px) {
  .login-tabs { grid-template-columns: 1fr; }
}


/* -------------------------------------------------------------------------
 * v1.0.4 - contrast fixes, clearer dashboard hero and readable preferences
 * ------------------------------------------------------------------------- */
:root {
  --bm-text-main: #15120b;
  --bm-text-muted: #4d4638;
  --bm-surface: #fffdf7;
  --bm-surface-strong: #ffffff;
  --bm-primary-bg: #15120b;
  --bm-primary-text: #ffffff;
  --bm-input-bg: #ffffff;
  --bm-input-text: #15120b;
}
body.theme-day,
body.theme-auto.is-day {
  color: var(--bm-text-main);
}
.hero-card.mobile-home-hero.dashboard-hero-clean {
  background:
    radial-gradient(circle at top left, rgba(244, 180, 26, .24), transparent 34%),
    linear-gradient(135deg, #fffdf7 0%, #fff8df 52%, #f7edc2 100%) !important;
  color: var(--bm-text-main) !important;
  border-color: rgba(79, 58, 8, .14) !important;
}
.hero-card.mobile-home-hero.dashboard-hero-clean h1,
.hero-card.mobile-home-hero.dashboard-hero-clean .eyebrow {
  color: var(--bm-text-main) !important;
  text-shadow: none !important;
}
.hero-card.mobile-home-hero.dashboard-hero-clean p {
  color: var(--bm-text-muted) !important;
  font-weight: 750;
  max-width: 720px;
}
body.theme-night .hero-card.mobile-home-hero.dashboard-hero-clean,
body.theme-auto.is-night .hero-card.mobile-home-hero.dashboard-hero-clean {
  background:
    radial-gradient(circle at top left, rgba(244, 180, 26, .22), transparent 34%),
    linear-gradient(135deg, #151b20 0%, #222d34 58%, #0d1115 100%) !important;
  color: #f7f1df !important;
  border-color: rgba(255,255,255,.14) !important;
}
body.theme-night .hero-card.mobile-home-hero.dashboard-hero-clean h1,
body.theme-night .hero-card.mobile-home-hero.dashboard-hero-clean .eyebrow,
body.theme-auto.is-night .hero-card.mobile-home-hero.dashboard-hero-clean h1,
body.theme-auto.is-night .hero-card.mobile-home-hero.dashboard-hero-clean .eyebrow {
  color: #f7f1df !important;
}
body.theme-night .hero-card.mobile-home-hero.dashboard-hero-clean p,
body.theme-auto.is-night .hero-card.mobile-home-hero.dashboard-hero-clean p {
  color: #d7cfbd !important;
}
.prefs-section h2,
.push-card h2,
.profile-summary strong,
.switch-row strong,
.input-row strong {
  color: var(--ink) !important;
}
.switch-row small,
.input-row small,
.prefs-section .muted,
.push-card small,
.two-col-inputs label,
.scale-jump-form small,
.account-money small {
  color: var(--muted) !important;
}
.input-row input,
.input-row select,
.two-col-inputs input,
.two-col-inputs select,
.scale-jump-row input,
.register-2fa-form input,
.register-2fa-form select,
.login-form input {
  background: var(--bm-input-bg) !important;
  color: var(--bm-input-text) !important;
  border-color: rgba(29,29,27,.18) !important;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.02);
}
.input-row select:disabled,
.input-row input:disabled,
.two-col-inputs input:disabled {
  opacity: 1 !important;
  color: #5d5546 !important;
  background: #f3efe4 !important;
  cursor: not-allowed;
}
.primary,
.primary.full,
.scale-jump-row button,
.pro-login-card .primary {
  background: var(--bm-primary-bg) !important;
  color: var(--bm-primary-text) !important;
  border: 1px solid rgba(0,0,0,.12) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
}
.primary:disabled,
.primary.full:disabled {
  opacity: .88 !important;
  filter: grayscale(.15);
  cursor: wait;
}
.ghost.full,
button[data-sms-test] {
  border: 1px solid rgba(29,29,27,.14) !important;
  background: rgba(29,29,27,.06) !important;
  color: var(--ink) !important;
  font-weight: 850;
}
.alert.success {
  border: 1px solid rgba(63,111,56,.20);
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 850;
}
body.theme-night,
body.theme-auto.is-night {
  --bm-input-bg: #10161b;
  --bm-input-text: #f5f1e8;
  --bm-primary-bg: #f4b41a;
  --bm-primary-text: #15120b;
}
body.theme-night .input-row input,
body.theme-night .input-row select,
body.theme-night .two-col-inputs input,
body.theme-night .two-col-inputs select,
body.theme-night .scale-jump-row input,
body.theme-night .register-2fa-form input,
body.theme-night .register-2fa-form select,
body.theme-night .login-form input,
body.theme-auto.is-night .input-row input,
body.theme-auto.is-night .input-row select,
body.theme-auto.is-night .two-col-inputs input,
body.theme-auto.is-night .two-col-inputs select,
body.theme-auto.is-night .scale-jump-row input,
body.theme-auto.is-night .register-2fa-form input,
body.theme-auto.is-night .register-2fa-form select,
body.theme-auto.is-night .login-form input {
  background: #10161b !important;
  color: #f5f1e8 !important;
  border-color: rgba(255,255,255,.20) !important;
}
body.theme-night .input-row select:disabled,
body.theme-night .input-row input:disabled,
body.theme-auto.is-night .input-row select:disabled,
body.theme-auto.is-night .input-row input:disabled {
  background: #20282e !important;
  color: #cfc7b5 !important;
}
body.theme-night .ghost.full,
body.theme-night button[data-sms-test],
body.theme-auto.is-night .ghost.full,
body.theme-auto.is-night button[data-sms-test] {
  border-color: rgba(255,255,255,.16) !important;
  background: rgba(255,255,255,.10) !important;
  color: #f5f1e8 !important;
}
body.theme-night .primary,
body.theme-night .primary.full,
body.theme-night .scale-jump-row button,
body.theme-auto.is-night .primary,
body.theme-auto.is-night .primary.full,
body.theme-auto.is-night .scale-jump-row button {
  background: #f4b41a !important;
  color: #15120b !important;
  text-shadow: none !important;
}
@media (max-width: 520px) {
  .hero-card.mobile-home-hero.dashboard-hero-clean h1 { font-size: clamp(24px, 8vw, 34px); }
  .hero-card.mobile-home-hero.dashboard-hero-clean p { font-size: 13px; }
}

/* v1.0.5 SMS user/scale selection */
.admin-sms-target {
  margin-top: 14px;
}
.sms-scale-panel,
.sms-manual-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(22, 18, 11, 0.12);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.sms-scale-panel-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}
.sms-scale-panel-head strong,
.sms-manual-panel h3 {
  color: var(--text-main);
  margin: 0;
}
.sms-scale-panel-head small,
.sms-scale-item small {
  color: var(--text-muted);
}
.sms-scale-list {
  max-height: 280px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding-right: 4px;
}
.sms-scale-item {
  display: flex;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(22, 18, 11, 0.10);
  border-radius: 14px;
  padding: 9px 10px;
  background: rgba(255, 250, 235, .72);
  min-width: 0;
}
.sms-scale-item input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.sms-scale-item span {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.sms-scale-item strong,
.sms-scale-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sms-manual-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.sms-preview-box {
  margin: 12px 0 0;
  padding: 12px;
  min-height: 96px;
  white-space: pre-wrap;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(22, 18, 11, .16);
  background: #fffdf6;
  color: #16120b;
  font-size: 13px;
  line-height: 1.45;
}
.ghost.danger {
  border-color: rgba(160, 35, 35, .32);
  color: #9a2525;
}
body.theme-night .sms-scale-panel,
body.theme-night .sms-manual-panel,
body.theme-auto.is-night .sms-scale-panel,
body.theme-auto.is-night .sms-manual-panel {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
body.theme-night .sms-scale-item,
body.theme-auto.is-night .sms-scale-item {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
body.theme-night .sms-preview-box,
body.theme-auto.is-night .sms-preview-box {
  background: #111820;
  color: #f5f1e8;
  border-color: rgba(255,255,255,.14);
}
body.theme-night .ghost.danger,
body.theme-auto.is-night .ghost.danger {
  color: #ffaaa5;
  border-color: rgba(255, 120, 115, .35);
}
@media (max-width: 560px) {
  .sms-manual-actions { grid-template-columns: 1fr; }
  .sms-scale-list { grid-template-columns: 1fr; }
}
