:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6fb;
  color: #172033;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

a {
  color: #315fdb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hero {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  background: linear-gradient(135deg, #15264f, #315fdb);
  color: #fff;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 2rem;
}

.top-links a {
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 999px;
  padding: .45rem .8rem;
  color: #fff;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 .35rem;
  color: #6f7d98;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #d9e4ff;
}

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

h1 {
  max-width: 56rem;
  margin-bottom: .75rem;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: .8rem;
  font-size: 1.7rem;
  line-height: 1.2;
}

h3 {
  margin: 1.2rem 0 .45rem;
  font-size: 1.08rem;
}

.lead {
  max-width: 58rem;
  margin-bottom: 0;
  color: #e7edff;
  font-size: 1.05rem;
}

.docs-shell {
  width: min(100%, 118rem);
  margin: 0 auto;
  padding: 1.25rem;
}

.notice-card,
.card {
  min-width: 0;
  border: 1px solid #dce2ee;
  border-radius: 1rem;
  padding: 1.2rem;
  background: #fff;
  box-shadow: 0 .5rem 1.5rem rgb(27 40 72 / 7%);
}

.notice-card {
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.tabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-list {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
  border: 1px solid #dce2ee;
  border-radius: 1rem;
  padding: .65rem;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 .5rem 1.5rem rgb(27 40 72 / 7%);
  backdrop-filter: blur(8px);
}

.tab-list label {
  cursor: pointer;
  border: 1px solid #cbd3e2;
  border-radius: 999px;
  padding: .55rem .85rem;
  background: #fff;
  color: #40506f;
  font-weight: 800;
}

#tab-core:checked ~ .tab-list label[for="tab-core"],
#tab-avatar:checked ~ .tab-list label[for="tab-avatar"],
#tab-animation:checked ~ .tab-list label[for="tab-animation"],
#tab-diary-image:checked ~ .tab-list label[for="tab-diary-image"],
#tab-insight:checked ~ .tab-list label[for="tab-insight"],
#tab-health-detail:checked ~ .tab-list label[for="tab-health-detail"],
#tab-diary:checked ~ .tab-list label[for="tab-diary"],
#tab-meta:checked ~ .tab-list label[for="tab-meta"] {
  border-color: #315fdb;
  background: #315fdb;
  color: #fff;
}

.tab-panel {
  display: none;
  border: 1px solid #dce2ee;
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 .5rem 1.5rem rgb(27 40 72 / 7%);
}

#tab-core:checked ~ .tab-panels .core-panel,
#tab-avatar:checked ~ .tab-panels .avatar-panel,
#tab-animation:checked ~ .tab-panels .animation-panel,
#tab-diary-image:checked ~ .tab-panels .diary-image-panel,
#tab-insight:checked ~ .tab-panels .insight-panel,
#tab-health-detail:checked ~ .tab-panels .health-detail-panel,
#tab-diary:checked ~ .tab-panels .diary-panel,
#tab-meta:checked ~ .tab-panels .meta-panel {
  display: block;
}

.endpoint {
  margin-top: 1rem;
  border: 1px solid #e3e8f2;
  border-radius: .85rem;
  padding: 1rem;
  background: #fbfcff;
}

.endpoint + .endpoint {
  margin-top: 1rem;
}

.endpoint h3 {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.endpoint h4 {
  margin: 1rem 0 .35rem;
  color: #40506f;
}

.endpoint h3 span {
  display: inline-flex;
  min-width: 3.6rem;
  justify-content: center;
  margin-right: .4rem;
  border-radius: .45rem;
  padding: .15rem .45rem;
  background: #315fdb;
  color: #fff;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: .78rem;
}

.endpoint-list {
  display: grid;
  gap: .55rem;
}

.endpoint-list p {
  margin: 0;
  border: 1px solid #e3e8f2;
  border-radius: .75rem;
  padding: .75rem;
  background: #fbfcff;
}

.health-detail-v3-docs .health-detail-switcher > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.health-detail-switcher-sticky {
  position: relative;
}

.health-detail-switcher-sticky > .health-detail-selector {
  position: sticky;
  top: 5.25rem;
  z-index: 1;
}

.health-detail-selector {
  display: grid;
  gap: .65rem;
  margin: .85rem 0 1rem;
  border: 1px solid #dce2ee;
  border-radius: .95rem;
  padding: .85rem;
  background: #fff;
}

.health-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.health-selector-row span {
  min-width: 5rem;
  color: #52617d;
  font-weight: 800;
}

.health-selector-row label {
  cursor: pointer;
  border: 1px solid #cbd3e2;
  border-radius: 999px;
  padding: .42rem .75rem;
  background: #fbfcff;
  color: #40506f;
  font-weight: 800;
}

.health-detail-v3-docs #health-metric-activity:checked ~ .health-detail-selector label[for="health-metric-activity"],
.health-detail-v3-docs #health-metric-rest:checked ~ .health-detail-selector label[for="health-metric-rest"],
.health-detail-v3-docs #health-metric-hr:checked ~ .health-detail-selector label[for="health-metric-hr"],
.health-detail-v3-docs #health-metric-hrv:checked ~ .health-detail-selector label[for="health-metric-hrv"],
.health-detail-v3-docs #health-metric-rr:checked ~ .health-detail-selector label[for="health-metric-rr"],
.health-detail-v3-docs #health-metric-bark:checked ~ .health-detail-selector label[for="health-metric-bark"],
.health-detail-v3-docs #health-window-day:checked ~ .health-detail-selector label[for="health-window-day"],
.health-detail-v3-docs #health-window-week:checked ~ .health-detail-selector label[for="health-window-week"],
.health-detail-v3-docs #health-window-month:checked ~ .health-detail-selector label[for="health-window-month"] {
  border-color: #315fdb;
  background: #315fdb;
  color: #fff;
}

.health-detail-v3-docs #health-metric-activity:focus-visible ~ .health-detail-selector label[for="health-metric-activity"],
.health-detail-v3-docs #health-metric-rest:focus-visible ~ .health-detail-selector label[for="health-metric-rest"],
.health-detail-v3-docs #health-metric-hr:focus-visible ~ .health-detail-selector label[for="health-metric-hr"],
.health-detail-v3-docs #health-metric-hrv:focus-visible ~ .health-detail-selector label[for="health-metric-hrv"],
.health-detail-v3-docs #health-metric-rr:focus-visible ~ .health-detail-selector label[for="health-metric-rr"],
.health-detail-v3-docs #health-metric-bark:focus-visible ~ .health-detail-selector label[for="health-metric-bark"],
.health-detail-v3-docs #health-window-day:focus-visible ~ .health-detail-selector label[for="health-window-day"],
.health-detail-v3-docs #health-window-week:focus-visible ~ .health-detail-selector label[for="health-window-week"],
.health-detail-v3-docs #health-window-month:focus-visible ~ .health-detail-selector label[for="health-window-month"] {
  outline: 3px solid #92adff;
  outline-offset: 2px;
}

.health-detail-doc-panel {
  display: none;
  margin-top: 1rem;
  border: 1px solid #e3e8f2;
  border-radius: .95rem;
  padding: 1rem;
  background: #fff;
}

/* The v3 contract replaces the retired v2 health-detail documentation. */
.health-detail-panel > :not(.health-v3-docs):not(.health-detail-v3-docs) {
  display: none;
}

.health-v3-contract pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.health-contract-details {
  margin-top: 1rem;
}

.health-contract-details summary {
  cursor: pointer;
  font-weight: 700;
}

.health-contract-details pre {
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.health-detail-doc-panel h3 {
  margin: 0 0 .75rem;
  color: #172033;
  font-size: 1.05rem;
}

.health-detail-doc-panel h4 {
  margin: 1rem 0 .35rem;
  color: #40506f;
  font-size: .92rem;
}

.health-detail-v3-docs #health-metric-activity:checked ~ #health-window-day:checked ~ .health-detail-docs #health-doc-activity-day,
.health-detail-v3-docs #health-metric-activity:checked ~ #health-window-week:checked ~ .health-detail-docs #health-doc-activity-week,
.health-detail-v3-docs #health-metric-activity:checked ~ #health-window-month:checked ~ .health-detail-docs #health-doc-activity-month,
.health-detail-v3-docs #health-metric-rest:checked ~ #health-window-day:checked ~ .health-detail-docs #health-doc-rest-day,
.health-detail-v3-docs #health-metric-rest:checked ~ #health-window-week:checked ~ .health-detail-docs #health-doc-rest-week,
.health-detail-v3-docs #health-metric-rest:checked ~ #health-window-month:checked ~ .health-detail-docs #health-doc-rest-month,
.health-detail-v3-docs #health-metric-hr:checked ~ #health-window-day:checked ~ .health-detail-docs #health-doc-hr-day,
.health-detail-v3-docs #health-metric-hr:checked ~ #health-window-week:checked ~ .health-detail-docs #health-doc-hr-week,
.health-detail-v3-docs #health-metric-hr:checked ~ #health-window-month:checked ~ .health-detail-docs #health-doc-hr-month,
.health-detail-v3-docs #health-metric-hrv:checked ~ #health-window-day:checked ~ .health-detail-docs #health-doc-hrv-day,
.health-detail-v3-docs #health-metric-hrv:checked ~ #health-window-week:checked ~ .health-detail-docs #health-doc-hrv-week,
.health-detail-v3-docs #health-metric-hrv:checked ~ #health-window-month:checked ~ .health-detail-docs #health-doc-hrv-month,
.health-detail-v3-docs #health-metric-rr:checked ~ #health-window-day:checked ~ .health-detail-docs #health-doc-rr-day,
.health-detail-v3-docs #health-metric-rr:checked ~ #health-window-week:checked ~ .health-detail-docs #health-doc-rr-week,
.health-detail-v3-docs #health-metric-rr:checked ~ #health-window-month:checked ~ .health-detail-docs #health-doc-rr-month,
.health-detail-v3-docs #health-metric-bark:checked ~ #health-window-day:checked ~ .health-detail-docs #health-doc-bark-day,
.health-detail-v3-docs #health-metric-bark:checked ~ #health-window-week:checked ~ .health-detail-docs #health-doc-bark-week,
.health-detail-v3-docs #health-metric-bark:checked ~ #health-window-month:checked ~ .health-detail-docs #health-doc-bark-month {
  display: block;
}

.health-detail-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.health-detail-table-wrap table {
  min-width: 44rem;
}

.health-detail-rules {
  display: grid;
  gap: .65rem;
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
}

.health-detail-rules li {
  display: grid;
  gap: .25rem;
  border-left: 3px solid #92adff;
  padding: .6rem .75rem;
  background: #f7f9ff;
}

code {
  border-radius: .35rem;
  padding: .1rem .25rem;
  background: #eef2fa;
  color: #173f99;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: .9em;
}

pre {
  overflow: auto;
  max-height: 26rem;
  border-radius: .85rem;
  padding: 1rem;
  background: #101827;
  color: #dce7ff;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

table {
  width: 100%;
  margin: .75rem 0;
  border-collapse: collapse;
  font-size: .9rem;
}

th,
td {
  padding: .65rem;
  border-bottom: 1px solid #e4e8f0;
  text-align: left;
  vertical-align: top;
}

th {
  color: #52617d;
  font-size: .8rem;
  text-transform: uppercase;
}

td {
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .grid.three,
  .grid.two,
  .health-window-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .layout {
    padding: .75rem;
  }

  .notice-card,
  .card,
  .tab-panel {
    padding: .85rem;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
