:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7f3;
  color: #13201d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.2), transparent 32rem),
    linear-gradient(160deg, #f7faf6 0%, #eef4f1 55%, #f9fbff 100%);
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero {
  position: relative;
  min-height: 96px;
  padding-right: 104px;
  padding-top: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 11vw, 54px);
  line-height: 0.96;
  letter-spacing: 0;
}

.status-pill {
  position: absolute;
  top: 8px;
  right: 0;
  min-width: 88px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #115e59;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.readout {
  min-height: 118px;
  border: 1px solid rgba(19, 32, 29, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 42px rgba(31, 41, 55, 0.08);
}

.readout.primary,
.readout.altitude {
  grid-column: 1 / -1;
  min-height: 134px;
}

.readout span {
  color: #58716b;
  font-size: 14px;
  font-weight: 700;
}

.readout strong {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  color: #102522;
  font-size: clamp(25px, 8vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.readout:not(.primary):not(.altitude) strong {
  font-size: clamp(19px, 5vw, 28px);
}

.readout small {
  color: #6b7f79;
  font-size: 13px;
}

.controls {
  position: sticky;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 6px 0;
  background: linear-gradient(180deg, transparent 0%, rgba(244, 247, 243, 0.92) 36%, rgba(244, 247, 243, 0.98) 100%);
  backdrop-filter: blur(8px);
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  cursor: pointer;
}

button.secondary {
  border: 1px solid rgba(15, 118, 110, 0.24);
  background: rgba(255, 255, 255, 0.82);
  color: #0f766e;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.details {
  border-left: 4px solid #0f766e;
  padding: 4px 0 4px 12px;
  color: #334a45;
  font-size: 14px;
  line-height: 1.5;
}

.details p {
  margin: 0 0 8px;
}

.details p:last-child {
  margin-bottom: 0;
}

@media (max-width: 390px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .readout {
    padding: 12px;
  }
}

@media (max-width: 430px) {
  .hero {
    min-height: 88px;
    padding-right: 94px;
  }

  h1 {
    max-width: 270px;
    font-size: 34px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    background: #071311;
    color: #eef8f5;
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(45, 212, 191, 0.22), transparent 30rem),
      linear-gradient(160deg, #06110f 0%, #10201d 60%, #111827 100%);
  }

  .status-pill,
  .readout,
  button.secondary {
    background: rgba(11, 24, 22, 0.82);
    border-color: rgba(148, 163, 184, 0.18);
  }

  .controls {
    background: linear-gradient(180deg, transparent 0%, rgba(7, 19, 17, 0.9) 36%, rgba(7, 19, 17, 0.98) 100%);
  }

  .readout strong {
    color: #f6fffd;
  }

  .readout span,
  .readout small,
  .details {
    color: #b8ccc6;
  }
}
