/* Weight dashboard — visual direction.
   Calm, precise, expensive. One accent colour. No cards, no shadows, no emoji. */

:root {
  --bg: #141210;                       /* warm near-black */
  --text: #f0ece4;                     /* warm near-white */
  --text-dim: rgba(240, 236, 228, 0.55);
  --text-faint: rgba(240, 236, 228, 0.32);
  --accent: #85b0a0;                   /* soft desaturated sea-glass */
  --accent-faint: rgba(133, 176, 160, 0.14);
  --hairline: rgba(240, 236, 228, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* -------- layout -------------------------------------------------------- */

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
  padding-top: calc(56px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* -------- hero ----------------------------------------------------------- */

.hero {
  padding-bottom: 44px;
}

.hero-number {
  margin-top: 14px;
  font-size: 68px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-unit {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.hero-rate {
  margin-top: 22px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.hero-rate.is-neutral {
  color: var(--text-dim);
}

.hero-last {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.hero-change {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-faint);
}

.hero-stale {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

/* -------- chart ----------------------------------------------------------- */

.chart-block {
  padding-bottom: 44px;
}

.range-toggles {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}

.range-toggles button {
  appearance: none;
  background: none;
  border: none;
  padding: 0 0 4px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.range-toggles button.active {
  color: var(--text);
  border-bottom-color: var(--hairline);
}

.chart-wrap {
  position: relative;
  height: 264px;
}

/* -------- recent readings ------------------------------------------------- */

.recent {
  border-top: 1px solid var(--hairline);
  padding-top: 28px;
}

.recent ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
}

.recent li:last-child {
  border-bottom: none;
}

.recent .r-date {
  flex: 1;
  font-size: 14px;
  color: var(--text-dim);
}

.recent .r-weight {
  font-size: 15px;
  color: var(--text);
}

.recent .r-delta {
  width: 56px;
  text-align: right;
  font-size: 12px;
  color: var(--text-faint);
}

.recent .r-delta.down {
  color: var(--accent);
}

/* -------- gate + error + cache note ---------------------------------------- */

.gate {
  max-width: 360px;
  margin: 0 auto;
  padding: 24px;
  padding-top: calc(120px + env(safe-area-inset-top, 0px));
}

.gate form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gate input {
  appearance: none;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  outline: none;
}

.gate input:focus {
  border-color: var(--text-faint);
}

.gate button {
  appearance: none;
  background: none;
  border: 1px solid var(--hairline);
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}

.gate-error {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.error {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px;
  padding-top: calc(120px + env(safe-area-inset-top, 0px));
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.cached-note {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-faint);
}
