:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #203b35;
  background: #f7f7f2;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  --muted: #66766e;
  --green: #2c6757;
  --line: #dce1d8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a,
summary,
input {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
summary {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid #ad7932;
  outline-offset: 4px;
}
.masthead {
  max-width: 1160px;
  margin: auto;
  padding: 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.6px;
}
.brand span {
  font-weight: 400;
  color: var(--muted);
}
.private {
  font-size: 12px;
  color: var(--muted);
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 34px 48px 100px;
}
.eyebrow,
.section-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 1.6px;
  margin: 0;
  color: var(--muted);
}
h1 {
  font-size: 44px;
  letter-spacing: -1.8px;
  font-weight: 500;
  margin: 9px 0 36px;
}
h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin: 0;
}
p {
  line-height: 1.55;
}
.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px 56px;
}
.weight {
  grid-row: span 2;
  padding: 0 44px 0 0;
  border-right: 1px solid var(--line);
}
.section-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.through {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.hero {
  font-size: clamp(64px, 8vw, 100px);
  font-weight: 450;
  letter-spacing: -5px;
  line-height: 1.15;
  margin: 28px 0 0;
}
.unit {
  font-size: 20px;
  letter-spacing: -0.3px;
  font-weight: 400;
  margin-left: 8px;
  color: var(--muted);
}
.caption {
  font-size: 13px;
  color: var(--muted);
  margin: 3px 0 22px;
}
.rate {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin: 20px 0 0;
}
.latest {
  margin-top: 35px;
  color: var(--muted);
  font-size: 13px;
}
.latest strong {
  font-weight: 500;
  color: #203b35;
}
.energy {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.energy-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0;
}
.energy-row .label {
  font-size: 14px;
}
.energy-row .value {
  font-size: 26px;
  letter-spacing: -0.6px;
}
.energy-row .value .unit {
  font-size: 12px;
  margin-left: 5px;
}
.balance {
  background: #e8eee6;
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.balance .label {
  font-size: 13px;
}
.balance .value {
  font-size: 21px;
}
.balance .unit {
  font-size: 12px;
}
.macros {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 20px;
}
.macro .value {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -1px;
}
.macro:first-child .value {
  font-weight: 600;
}
.macro .unit {
  font-size: 14px;
  margin-left: 3px;
}
.macro p {
  margin: 5px 0;
  font-size: 12px;
  color: var(--muted);
}
details {
  font-size: 12px;
  color: var(--muted);
  margin: 20px 0 4px;
}
summary {
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
}
summary:after {
  content: "+";
  font-size: 18px;
  font-weight: 300;
}
details[open] summary:after {
  content: "−";
}
details dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  line-height: 1.5;
  margin-top: 6px;
}
dd {
  margin: 0;
  text-align: right;
  color: #344a41;
}
details p {
  max-width: 440px;
}
.note {
  color: #84622d;
  font-size: 12px;
  margin: 8px 0;
}
.unavailable {
  font-size: 18px !important;
  letter-spacing: 0 !important;
  color: var(--muted);
}
nav {
  position: fixed;
  top: 23px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: #eef0e9;
  border-radius: 30px;
  padding: 4px;
  z-index: 5;
}
nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 22px;
  font-size: 13px;
  border-radius: 24px;
  color: var(--muted);
}
nav a[aria-current] {
  background: #fff;
  color: #203b35;
  box-shadow: 0 1px 5px #203b3510;
}
nav svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.range {
  display: flex;
  gap: 5px;
  background: #e9ece4;
  border-radius: 24px;
  padding: 4px;
  width: fit-content;
}
.range button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 20px;
  min-height: 40px;
  min-width: 52px;
  font-size: 13px;
}
.range button[aria-pressed="true"] {
  background: white;
  color: #203b35;
  box-shadow: 0 1px 4px #203b3510;
}
.trends-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.trends-title h1 {
  margin-bottom: 0;
}
.chart-section {
  margin: 0 0 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.legend {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 8px;
  flex-wrap: wrap;
}
.legend span:before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 3px;
  background: var(--green);
  vertical-align: middle;
  margin-right: 7px;
}
.legend .secondary:before {
  background: #a6987f;
}
.chart {
  width: 100%;
  display: block;
  overflow: visible;
  touch-action: pan-y;
}
.chart text {
  fill: var(--muted);
  font-size: 11px;
}
.chart .grid {
  stroke: #dce1d8;
  stroke-width: 1;
}
.chart .series {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .secondary {
  stroke: #a6987f;
  stroke-width: 2;
}
.chart .measurement {
  fill: #809d90;
  opacity: 0.35;
}
.inspection {
  font-size: 12px;
  color: var(--muted);
  min-height: 68px;
  line-height: 1.7;
  background: #eef1e9;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.inspection b {
  color: #203b35;
  font-weight: 500;
}
.inspection time {
  width: 100%;
  color: #203b35;
}
.chart-slider {
  width: 100%;
  accent-color: var(--green);
  height: 24px;
  margin: 8px 0 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.error {
  padding: 24px;
  border-left: 3px solid #ad7932;
}
.retry {
  background: #203b35;
  color: white;
  border: 0;
  padding: 12px 20px;
  border-radius: 8px;
}
.empty-chart {
  padding: 45px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.range-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 0;
}
@media (max-width: 700px) {
  .masthead {
    padding: 23px 24px;
  }
  .private {
    font-size: 10px;
  }
  main {
    padding: 24px 24px 110px;
  }
  h1 {
    font-size: 36px;
    margin-bottom: 32px;
  }
  .home-grid {
    display: block;
  }
  .weight {
    border-right: 0;
    padding: 0 0 22px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
  }
  .hero {
    font-size: 82px;
    margin-top: 20px;
  }
  .rate {
    font-size: 25px;
    margin-top: 22px;
  }
  .latest {
    margin-top: 23px;
  }
  .energy {
    padding-bottom: 18px;
    margin-bottom: 28px;
  }
  .energy-row {
    margin: 22px 0;
  }
  .energy-row .value {
    font-size: 28px;
  }
  .macros {
    margin-top: 22px;
  }
  .macro .value {
    font-size: 32px;
  }
  nav {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    border-radius: 0;
    background: #f7f7f2f5;
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    justify-content: center;
    padding: 8px 18px calc(8px + env(safe-area-inset-bottom));
    gap: 16px;
  }
  nav a {
    flex: 1;
    max-width: 180px;
    flex-direction: column;
    gap: 4px;
    min-height: 48px;
    font-size: 11px;
    border-radius: 12px;
  }
  nav a[aria-current] {
    box-shadow: none;
    background: #e8eee6;
  }
  nav svg {
    width: 20px;
    height: 20px;
  }
  .trends-title {
    display: block;
    margin-bottom: 28px;
  }
  .range {
    margin-top: 22px;
    width: 100%;
    justify-content: space-between;
  }
  .range button {
    flex: 1;
  }
  .chart-section {
    margin-bottom: 30px;
  }
  .chart-section h2 {
    font-size: 21px;
  }
  .inspection {
    font-size: 11px;
    gap: 3px 16px;
    padding: 10px 12px;
  }
  .through {
    font-size: 11px;
  }
  .section-label {
    font-size: 10px;
    letter-spacing: 1.3px;
  }
  .balance {
    padding: 14px;
  }
  .balance .value {
    font-size: 20px;
  }
  .chart-section .macros {
    margin-bottom: 20px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  nav a,
  .range button {
    transition: background 0.15s;
  }
}

.estimate-date {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 5px;
}

/* Chart dragging inspects evidence instead of selecting axis labels. */
.chart { user-select: none; -webkit-user-select: none; }

.legend .measurements:before { background: #809d90; width: 5px; height: 5px; border-radius: 50%; }

/* Only installed/mobile ergonomics; dashboard layout and analytical presentation are unchanged. */
.app-menu { margin: 0; position: relative; }
.app-menu summary { min-width: 44px; justify-content: center; font-size: 18px; }
.app-menu summary:after { content: none; }
.app-menu form { position: absolute; right: 0; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; min-width: 130px; }
.app-menu button { border: 0; background: transparent; padding: 12px 18px; min-height: 44px; color: #203b35; width: 100%; }
.login-page { min-height: 100svh; display: grid; align-items: center; }
.login-card { width: 100%; max-width: 390px; padding: 36px 28px; }
.login-card img { display: block; border-radius: 18px; margin-bottom: 24px; }
.login-card h1 { font-size: 36px; margin: 0 0 8px; }
.login-card label { display: block; font-size: 13px; margin: 22px 0 8px; }
.login-card input:not([type="hidden"]) { display: block; width: 100%; min-height: 48px; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: white; color: #203b35; }
.login-card button { width: 100%; margin-top: 24px; min-height: 48px; }
@media (max-width: 700px) {
  .masthead { padding-top: calc(23px + env(safe-area-inset-top)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .login-card { padding: calc(36px + env(safe-area-inset-top)) 28px calc(36px + env(safe-area-inset-bottom)); }
}
