@font-face {
  font-family: Inter;
  src: url("./inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #14241b;
  --muted: #4f6156;
  --forest: #0f4b3d;
  --warm: #f3f6f3;
  --white: #fff;
  --line: #dce5da;
  --gold: #e4ad35;
  --gutter: 16px;
  --app-width: 430px;
  --nav-height: 70px;
  color: var(--ink);
  font: 100%/1.5 Inter, system-ui, sans-serif;
  font-synthesis: none;
  background: #e8eee7;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; }

a {
  color: var(--forest);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }

a:focus-visible,
button:focus-visible { outline: 3px solid #316d4b; outline-offset: 3px; }

.dashboard-primary:focus-visible { outline-color: var(--white); }

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 4;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  transform: translateY(calc(-100% - 12px));
}

.skip-link:focus { transform: none; }

.dashboard-shell {
  inline-size: min(100%, var(--app-width));
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin-inline: auto;
  background: var(--warm);
  box-shadow: 0 0 60px #172e1c13;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top, 0px)) var(--gutter) 15px;
}

.dashboard-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 44px;
  color: var(--forest);
  font-size: 1.65rem;
  font-weight: 850;
  letter-spacing: -.06em;
  line-height: 1;
}

.dashboard-brand img { display: block; inline-size: 38px; block-size: 30px; object-fit: contain; }

.dashboard-icon {
  inline-size: 21px;
  block-size: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: #342700;
  font-weight: 800;
}

.dashboard-avatar:hover { background: #efbd51; }

.dashboard-content {
  padding: 8px var(--gutter) calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 24px);
}

.dashboard-intro { margin: 4px 1px 21px; }

.dashboard-date {
  margin-block-start: 4px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}

.dashboard-date::first-letter { text-transform: uppercase; }

.dashboard-intro h1 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.dashboard-error {
  margin-block-end: 12px;
  padding: 10px 12px;
  border: 1px solid #ead8ad;
  border-radius: 10px;
  background: #fff7e5;
  color: #624609;
  font-size: .85rem;
}

.dashboard-walk {
  padding: 18px clamp(14px, 4vw, 19px);
  border-radius: 23px;
  color: var(--white);
  background: radial-gradient(ellipse at top right, #236e58, var(--forest) 55%, #0a392e);
  box-shadow: 0 14px 28px #0f4b3d28;
}

.dashboard-walk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px 12px;
  flex-wrap: wrap;
}

.dashboard-walk h2 {
  color: #c9e1d4;
  font-size: .88rem;
  line-height: 1.35;
  font-weight: 650;
}

.dashboard-status {
  padding: 3px 10px;
  border-radius: 999px;
  color: #382a00;
  background: var(--gold);
  font-size: .72rem;
  font-weight: 800;
}

.dashboard-step-ring {
  position: relative;
  inline-size: clamp(150px, 46vw, 195px);
  aspect-ratio: 1;
  margin: 15px auto 16px;
}

.dashboard-ring {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke-width: 9;
}

.dashboard-ring-track { stroke: #ffffff26; }

.dashboard-ring-value {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  opacity: 0;
}

.dashboard-step-total {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.dashboard-step-total .dashboard-icon {
  color: var(--gold);
  inline-size: 34px;
  block-size: 34px;
}

.dashboard-step-total strong {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}

.dashboard-step-total span { color: #c9e1d4; font-size: .75rem; }

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
  padding: 10px 0;
  border-radius: 14px;
  background: #ffffff12;
  text-align: center;
}

.dashboard-metrics > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  min-inline-size: 0;
  padding: 0 3px;
}

.dashboard-metrics > div + div { border-inline-start: 1px solid #ffffff25; }
.dashboard-metrics dt { color: #c9e1d4; font-size: .68rem; line-height: 1.3; }
.dashboard-metrics dd { margin: 0; font-size: 1.12rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }

.dashboard-motion-status {
  margin-block-start: 10px;
  color: #c9e1d4;
  font-size: .75rem;
  line-height: 1.45;
  text-align: center;
}

.dashboard-rules-trigger {
  display: block;
  min-block-size: 44px;
  margin: 2px auto -5px;
  padding: 4px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: transparent;
  font-size: .76rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-rules-trigger:focus-visible { outline-color: var(--white); }

.dashboard-rules {
  inline-size: min(100%, var(--app-width));
  max-inline-size: 100%;
  max-block-size: 90vh;
  max-block-size: 90dvh;
  inset: auto 0 0;
  margin: auto auto 0;
  padding: 16px var(--gutter) calc(22px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 16px 50px #14241b3d;
}

.dashboard-rules::backdrop { background: #14241b85; }

.dashboard-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dashboard-rules-head h2 { font-size: 1.2rem; line-height: 1.3; }

.dashboard-rules-close {
  min-block-size: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--forest);
  background: var(--warm);
  font-size: .8rem;
  font-weight: 750;
}

.dashboard-rules dl { margin: 12px 0 0; }
.dashboard-rules dt { color: var(--forest); font-size: .88rem; font-weight: 750; }
.dashboard-rules dt:not(:first-child) { margin-block-start: 12px; padding-block-start: 12px; border-block-start: 1px solid var(--line); }
.dashboard-rules dd { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }

.dashboard-primary,
.dashboard-secondary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.dashboard-primary {
  min-block-size: 49px;
  padding: 9px 12px;
  background: var(--gold);
  color: #332500;
  font-size: .95rem;
}

.dashboard-primary:hover { background: #efbd51; }

.dashboard-primary[aria-disabled="true"] { opacity: .75; cursor: wait; }

.dashboard-primary .dashboard-icon {
  inline-size: 15px;
  block-size: 15px;
  fill: currentColor;
}

.dashboard-primary .dashboard-walk-stop,
.dashboard-primary.is-walking .dashboard-walk-play { display: none; }
.dashboard-primary.is-walking .dashboard-walk-stop { display: block; }

.dashboard-guest,
.dashboard-stat,
.dashboard-checkin,
.dashboard-week {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.dashboard-checkin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 11px;
  align-items: start;
  padding: 13px;
  margin-block-start: 12px;
}

.dashboard-guest {
  margin-block-start: 14px;
  padding: 16px;
  border-color: #f3dfb0;
  background: linear-gradient(135deg, #fbf1d9, #fff9ec);
}

.dashboard-guest h2,
.dashboard-checkin h2,
.dashboard-week h2 {
  font-size: .94rem;
  line-height: 1.35;
  letter-spacing: -.024em;
}

.dashboard-guest p,
.dashboard-checkin p,
.dashboard-week p {
  margin-block-start: 3px;
  color: var(--muted);
  font-size: .81rem;
  line-height: 1.45;
}

.dashboard-guest h2 { font-size: 1.05rem; }
.dashboard-guest p { margin-block-start: 6px; }

.dashboard-streak {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  padding-block-start: 10px;
  border-block-start: 1px solid var(--line);
}

.dashboard-streak-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--forest);
  font-size: .81rem;
  font-weight: 700;
}

.dashboard-streak progress {
  width: 100%;
  height: 8px;
  accent-color: var(--forest);
}

.dashboard-streak p { margin: 0; }

.dashboard-register {
  display: grid;
  place-items: center;
  min-block-size: 46px;
  margin-block-start: 13px;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--forest);
  color: var(--white);
  font-size: .9rem;
  font-weight: 750;
  text-align: center;
}

.dashboard-register:hover { background: #17604e; }
.dashboard-guest .dashboard-guest-login { margin-block-start: 0; text-align: center; }

.dashboard-guest-login a {
  display: inline-block;
  padding-block: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-feature-icon {
  inline-size: 38px;
  block-size: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--forest);
  background: #e4f1e5;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-block-start: 11px;
}

.dashboard-stat {
  position: relative;
  min-inline-size: 0;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 3px;
  padding: 11px 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.dashboard-stat-link:hover { border-color: #9bb9a1; background: #fbfdf9; }
.dashboard-stat > .dashboard-icon { margin-block-end: 3px; color: var(--forest); }

.dashboard-stat-arrow {
  position: absolute;
  inset: 11px 10px auto auto;
  inline-size: 15px;
  block-size: 15px;
}

.dashboard-stat h2,
.dashboard-stat-label,
.dashboard-stat-detail { color: var(--muted); font-size: .75rem; line-height: 1.35; }

.dashboard-stat h2,
.dashboard-stat-label { font-weight: 600; }

.dashboard-stat strong {
  font-size: 1.18rem;
  letter-spacing: -.045em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.dashboard-secondary {
  grid-column: 2;
  justify-self: start;
  min-block-size: 48px;
  padding: 8px 11px;
  border-color: #d5e8d5;
  color: var(--forest);
  background: #e5f2e3;
}

.dashboard-secondary:not(:disabled):hover { background: #d8ebd6; }
.dashboard-secondary:disabled { border-color: #e5eae1; color: #59665b; background: #edf0ea; }

.dashboard-week { padding: 13px; margin-block-start: 11px; }
.dashboard-week-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 1px 8px; }

.dashboard-week-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  padding: 0;
  margin: 11px 0 0;
  list-style: none;
}

.dashboard-day {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-block-size: 72px;
  inline-size: 100%;
  padding: 4px 1px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: .72rem;
  overflow-wrap: anywhere;
}

.dashboard-day:hover,
.dashboard-day[aria-pressed="true"] { color: var(--forest); background: #edf4eb; }
.dashboard-day[aria-pressed="true"] { font-weight: 700; }

.dashboard-day-track {
  display: flex;
  align-items: end;
  inline-size: 55%;
  max-inline-size: 22px;
  min-inline-size: 10px;
  block-size: 40px;
  overflow: hidden;
  border-radius: 5px;
  background: #e4ede2;
}

.dashboard-day-bar {
  inline-size: 100%;
  block-size: var(--bar, 0%);
  border-radius: 5px;
  background: #83a78c;
}

.dashboard-day[aria-current="date"] .dashboard-day-bar,
.dashboard-day[aria-pressed="true"] .dashboard-day-bar { background: #346347; }

.dashboard-week .dashboard-week-detail {
  min-block-size: 1.45em;
  margin-block-start: 7px;
  font-size: .74rem;
}

.bottom-nav {
  position: fixed;
  z-index: 2;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  inline-size: min(100%, var(--app-width));
  min-block-size: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  margin-inline: auto;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  border-block-start: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 -5px 18px #1934210a;
}

.bottom-nav a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-block-size: 56px;
  padding: 3px 2px;
  border-radius: 10px;
  color: #526459;
  font-size: clamp(.65rem, 2.95vw, .75rem);
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.bottom-nav a:focus-visible { outline-offset: -2px; }

.bottom-nav svg {
  inline-size: 46px;
  block-size: 28px;
  padding: 3px 12px;
  border-radius: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav a[aria-current="page"],
.bottom-nav a:hover { color: var(--forest); }
.bottom-nav a[aria-current="page"] svg { background: #dff0df; }
.bottom-nav a:hover svg { background: #edf4eb; }

@media (min-width: 385px) {
  :root { --gutter: 18px; }

  .dashboard-checkin {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .dashboard-secondary { grid-column: auto; }
}

@media (min-width: 640px) {
  .dashboard-shell { border-inline: 1px solid var(--line); }
  .dashboard-rules { inset: 0; margin: auto; border-radius: 20px; }
  .dashboard-stats { gap: 11px; }
  .dashboard-stat { padding: 13px 14px; }
  .dashboard-checkin, .dashboard-week { padding: 15px; }
}
