:root {
  --paper: #f3ead6;
  --paper-strong: #fff7e8;
  --ink: #20342f;
  --muted: #6f7467;
  --line: rgba(32, 52, 47, 0.14);
  --sage: #254d43;
  --sage-soft: #dfe8d6;
  --clay: #d85f45;
  --ochre: #d79c62;
  --sand: #ead9b7;
  --white: #fffdf6;
  --danger: #9f352c;
  --shadow: 0 24px 70px rgba(45, 56, 44, 0.18);
  font-family: Avenir Next, PingFang SC, Hiragino Sans GB, Kaiti SC, STKaiti, serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 5%, rgba(216, 95, 69, 0.16), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(37, 77, 67, 0.16), transparent 28rem),
    linear-gradient(135deg, #f7efd9, #ead8b7 58%, #d8c49c);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(32, 52, 47, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(32, 52, 47, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  padding: 0.12rem 0.34rem;
  border-radius: 0.45rem;
  background: rgba(37, 77, 67, 0.1);
  color: var(--sage);
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 14px calc(92px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  margin: 12px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 253, 246, 0.78), transparent 14rem),
    linear-gradient(135deg, rgba(243, 234, 214, 0.92), rgba(215, 156, 98, 0.88) 55%, rgba(37, 77, 67, 0.92));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -82px;
  width: 230px;
  height: 230px;
  border: 36px solid rgba(255, 247, 232, 0.54);
  border-radius: 999px;
}

.hero__texture {
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background-image:
    linear-gradient(120deg, transparent 0 20%, rgba(255, 255, 255, 0.2) 20% 21%, transparent 21% 43%, rgba(255, 255, 255, 0.16) 43% 44%, transparent 44%),
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 180px 180px, 18px 18px;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 240px;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}

.hero h1 {
  max-width: 9ch;
  margin: 8px 0 12px;
  color: #173630;
  font-family: Georgia, Songti SC, SimSun, serif;
  font-size: clamp(3rem, 16vw, 6rem);
  line-height: 0.86;
  letter-spacing: -0.08em;
}

.hero__subtitle {
  max-width: 30rem;
  margin: 0;
  color: rgba(23, 54, 48, 0.78);
  font-weight: 600;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--clay);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.screen,
.stack {
  display: grid;
  gap: 14px;
}

.panel,
.metric-card,
.move-card,
.course-card,
.workout-card {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background: rgba(255, 253, 246, 0.78);
  box-shadow: 0 16px 44px rgba(45, 56, 44, 0.11);
  backdrop-filter: blur(20px);
}

.panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.today-panel h2,
.food-hero h2 {
  margin: 0 0 8px;
  font-family: Georgia, Songti SC, SimSun, serif;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.section-heading p,
.today-panel p,
.food-hero p,
.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.today-panel,
.setup-nudge,
.food-hero,
.course-hero,
.injury-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.today-panel {
  background:
    linear-gradient(135deg, rgba(37, 77, 67, 0.92), rgba(37, 77, 67, 0.78)),
    radial-gradient(circle at 100% 0, rgba(216, 95, 69, 0.42), transparent 20rem);
  color: var(--white);
}

.today-panel .eyebrow,
.today-panel p {
  color: rgba(255, 247, 232, 0.78);
}

.primary,
.secondary,
.ghost,
.danger,
.install-chip,
.file-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.primary {
  background: var(--sage);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(37, 77, 67, 0.24);
}

.secondary,
.ghost,
.file-button {
  border: 1px solid rgba(37, 77, 67, 0.18);
  background: rgba(255, 253, 246, 0.72);
  color: var(--sage);
}

.ghost {
  min-height: 36px;
  padding: 0.45rem 0.72rem;
}

.danger {
  background: rgba(159, 53, 44, 0.1);
  color: var(--danger);
}

.install-chip {
  align-self: flex-start;
  background: rgba(255, 253, 246, 0.76);
  color: var(--sage);
}

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

.metric-card {
  padding: 16px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-family: Georgia, Songti SC, SimSun, serif;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-card p {
  color: var(--muted);
  font-size: 0.86rem;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist label,
.choice-row label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  line-height: 1.5;
}

.checklist input,
.choice-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--sage);
}

.soft-warning {
  border-color: rgba(216, 95, 69, 0.28);
  background: rgba(255, 247, 232, 0.72);
}

.soft-warning h3 {
  margin: 0 0 8px;
}

.injury-banner {
  border-color: rgba(216, 95, 69, 0.34);
  background:
    radial-gradient(circle at 100% 0, rgba(216, 95, 69, 0.14), transparent 12rem),
    rgba(255, 247, 232, 0.78);
}

.plan-grid {
  display: grid;
  gap: 12px;
}

.workout-card {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.92), rgba(223, 232, 214, 0.72));
}

.workout-card__head,
.move-card__top,
.log-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workout-card__head p,
.workout-card__head h3 {
  margin: 0;
}

.workout-card__head h3 {
  font-family: Georgia, Songti SC, SimSun, serif;
  font-size: 1.45rem;
}

.workout-card__head span,
.log-item span,
.move-card__top span,
.microcopy {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.workout-card ol {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding-left: 1.25rem;
}

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

.replacement-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.replacement-list span,
.risk-note,
.risk-pill {
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(216, 95, 69, 0.1);
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.5;
}

.risk-note {
  margin-bottom: 14px;
}

.filter-row,
.button-row,
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-row button {
  min-height: 38px;
  border: 1px solid rgba(37, 77, 67, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.76);
  color: var(--sage);
  font-weight: 800;
}

.filter-row button.is-active {
  background: var(--sage);
  color: var(--white);
}

.move-list {
  display: grid;
  gap: 12px;
}

.move-card {
  padding: 18px;
}

.move-card.is-risky {
  border-color: rgba(216, 95, 69, 0.32);
}

.move-card h2 {
  margin: 0;
  font-family: Georgia, Songti SC, SimSun, serif;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.why {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.65;
}

details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

details:last-of-type {
  border-bottom: 1px solid var(--line);
}

summary {
  color: var(--sage);
  cursor: pointer;
  font-weight: 900;
}

details ol,
details ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 1.25rem;
  color: var(--ink);
  line-height: 1.55;
}

.move-scale {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.move-scale span {
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(37, 77, 67, 0.08);
  color: var(--sage);
  font-weight: 800;
}

.course-list {
  display: grid;
  gap: 12px;
}

.course-card {
  padding: 18px;
}

.course-card h2 {
  margin: 0 0 4px;
  font-family: Georgia, Songti SC, SimSun, serif;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.course-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.course-card__top span,
.course-card p {
  color: var(--muted);
  line-height: 1.6;
}

.course-meta,
.course-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.course-meta span,
.course-links a {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(37, 77, 67, 0.08);
  color: var(--sage);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

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

label,
legend {
  color: var(--sage);
  font-size: 0.86rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid rgba(37, 77, 67, 0.18);
  border-radius: 17px;
  outline: 0;
  padding: 0.82rem 0.9rem;
  background: rgba(255, 253, 246, 0.82);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 77, 67, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 77, 67, 0.09);
}

textarea {
  resize: vertical;
}

input[type="range"] {
  padding-inline: 0;
  accent-color: var(--clay);
  box-shadow: none;
}

output {
  display: inline-block;
  margin-top: 6px;
  color: var(--clay);
  font-weight: 900;
}

.wide {
  grid-column: 1 / -1;
}

.choice-field {
  border: 1px dashed rgba(37, 77, 67, 0.24);
  border-radius: 20px;
  padding: 12px;
}

.log-list {
  display: grid;
  gap: 10px;
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 253, 246, 0.62);
}

.log-item strong,
.log-item span,
.log-item p {
  display: block;
}

.log-item p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(32, 52, 47, 0.08);
  color: var(--muted);
  font-size: 1.2rem;
}

.empty-state {
  border: 1px dashed rgba(37, 77, 67, 0.24);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 26px;
  align-items: end;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.timeline-item strong,
.timeline-item span {
  display: block;
}

.timeline-item span,
.timeline-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-item p {
  margin: 4px 0 0;
}

.timeline-item i {
  display: block;
  width: 18px;
  border-radius: 999px 999px 5px 5px;
  background: linear-gradient(180deg, var(--clay), var(--ochre));
}

.steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.65;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.tabbar {
  position: fixed;
  z-index: 10;
  right: max(12px, calc((100vw - 760px) / 2 + 12px));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(12px, calc((100vw - 760px) / 2 + 12px));
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  padding: 7px;
  background: rgba(255, 253, 246, 0.82);
  box-shadow: 0 18px 48px rgba(45, 56, 44, 0.22);
  backdrop-filter: blur(24px);
}

.tabbar button {
  display: grid;
  min-height: 50px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.tabbar span {
  font-size: 1rem;
  line-height: 1;
}

.tabbar button.is-active {
  background: var(--sage);
  color: var(--white);
}

.toast {
  position: fixed;
  z-index: 99;
  right: 20px;
  bottom: 96px;
  left: 20px;
  width: min(420px, calc(100% - 40px));
  margin: 0 auto;
  border-radius: 999px;
  padding: 13px 18px;
  background: rgba(32, 52, 47, 0.92);
  color: var(--white);
  font-weight: 800;
  text-align: center;
  box-shadow: 0 16px 38px rgba(32, 52, 47, 0.25);
  animation: toast-in 0.24s ease-out both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding-inline: 10px;
  }

  .hero {
    min-height: 224px;
    border-radius: 30px;
  }

  .hero__content {
    min-height: 224px;
    padding: 22px;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 18vw, 5.2rem);
  }

  .today-panel,
  .setup-nudge,
  .food-hero,
  .course-hero,
  .injury-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .section-heading,
  .workout-card__head,
  .move-card__top,
  .course-card__top {
    flex-direction: column;
  }

  .tabbar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-radius: 22px;
    padding: 5px;
  }

  .tabbar button {
    min-height: 48px;
    border-radius: 16px;
    font-size: 0.68rem;
  }
}
