:root {
  color-scheme: dark;
  --bg: #06120d;
  --surface: #0c2018;
  --raised: #123528;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f8f3e9;
  --muted: rgba(248, 243, 233, 0.58);
  --gold: #e9a62b;
  --gold-soft: #f2d895;
  --green: #3d8a68;
  --radius: 10px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  padding: env(safe-area-inset-top) 0 calc(86px + env(safe-area-inset-bottom));
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 18px 16px 0;
}

.screen {
  display: grid;
  gap: 16px;
  min-height: calc(100svh - 110px);
}

.hidden {
  display: none;
}

.app-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: center;
  gap: 14px;
  min-height: 160px;
}

.app-top img {
  width: 118px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.36));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: 0;
}

.dose-card,
.habit,
.metric-grid div,
.axis-list article,
.account-card,
.install-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
}

.dose-card {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.ring {
  position: relative;
  display: grid;
  place-items: center;
}

.ring svg {
  width: 116px;
  height: 116px;
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 12;
}

.ring .ring-bar {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 180ms ease;
}

.ring strong {
  position: absolute;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.pill-button,
.install-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #17110a;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.habit-list,
.axis-list,
.metric-grid {
  display: grid;
  gap: 10px;
}

.habit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  min-height: 72px;
  width: 100%;
  padding: 14px;
  color: var(--text);
  text-align: left;
}

.habit span,
.habit strong {
  display: block;
}

.habit span {
  color: var(--muted);
  font-size: 13px;
}

.habit strong {
  font-size: 18px;
}

.habit i {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.habit.done {
  border-color: rgba(242, 216, 149, 0.42);
  background: rgba(242, 216, 149, 0.1);
}

.habit.done i {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 7px #17110a;
}

.compact-head {
  padding: 20px 0 8px;
}

.chart {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 240px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.chart span {
  flex: 1;
  min-height: 38px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--gold-soft), var(--green));
}

.metric-grid {
  grid-template-columns: repeat(2, 1fr);
}

.metric-grid div {
  padding: 16px;
}

.metric-grid strong {
  display: block;
  color: var(--gold-soft);
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.metric-grid span,
.axis-list p,
.account-card span,
.legal-link {
  color: var(--muted);
  font-size: 13px;
}

.axis-list article {
  padding: 18px;
}

.axis-list span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 900;
}

.axis-list strong {
  display: block;
  font-size: 18px;
}

.axis-list p {
  margin: 4px 0 0;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.account-card img {
  width: 92px;
  height: 68px;
  object-fit: contain;
}

.account-card strong,
.account-card span {
  display: block;
}

.legal-link {
  display: inline-flex;
  justify-content: center;
  padding: 12px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(430px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(6, 18, 13, 0.92);
  backdrop-filter: blur(18px);
}

.tabbar button {
  min-height: 56px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tabbar button span {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto 5px;
  border-radius: 6px;
  border: 1px solid currentColor;
}

.tabbar button.active {
  background: rgba(242, 216, 149, 0.12);
  color: var(--gold-soft);
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: start center;
    background:
      linear-gradient(90deg, #020604, #0b2017 45%, #020604);
  }

  .app-shell {
    margin-top: 28px;
    min-height: 820px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 34px;
    background: var(--bg);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.34);
  }
}

@media (max-width: 380px) {
  .dose-card {
    grid-template-columns: 1fr;
  }

  .ring {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
