:root {
  color-scheme: light;
  --ink: #202126;
  --muted: #646772;
  --paper: #efefef;
  --surface: #f4f4f6;
  --surface-strong: #fcfcfd;
  --line: #d3d4da;
  --accent: #645ea9;
  --accent-strong: #4f498f;
  --warning: #645ea9;
  --shadow: 0 24px 70px rgb(38 40 50 / 12%);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #efefef;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  padding: 0.12rem 0.32rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgb(255 255 255 / 70%);
  color: var(--accent-strong);
  font-size: 0.9em;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.today-panel {
  width: 100%;
  min-height: auto;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
  position: relative;
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgb(18 19 25 / 48%), rgb(18 19 25 / 18%)),
    url("assets/harmer-bg.jpg");
  background-size: cover;
  background-position: 78% 29%;
  color: #fffdf8;
  box-shadow: var(--shadow);
}

.brand-row {
  position: relative;
  z-index: 1;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 44%);
  border-radius: 50%;
  background: rgb(255 255 255 / 14%);
  font-size: 0.76rem;
  letter-spacing: 0;
}

.sync-pill {
  min-width: 124px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  background: rgb(0 0 0 / 24%);
  color: rgb(255 255 255 / 88%);
  font-size: 0.86rem;
  font-weight: 760;
}

.sync-pill.is-error {
  border-color: rgb(255 202 164 / 66%);
  color: #ffe1cc;
}

.sync-pill.is-success {
  border-color: rgb(182 177 240 / 78%);
  color: #f0efff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.workout-detail,
.archive-section {
  margin-top: 26px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(252 252 253 / 82%);
  box-shadow: 0 16px 46px rgb(38 40 50 / 7%);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 760;
}

.ghost-button {
  min-width: 78px;
  background: transparent;
  color: var(--accent-strong);
}

.workout-card {
  display: grid;
  gap: 18px;
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.workout-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
  align-items: stretch;
}

.session-grid.session-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.session-box {
  height: 100%;
  min-height: 240px;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f1f1f4;
}

.session-box h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.session-date {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.workout-block {
  display: grid;
  gap: 12px;
  white-space: pre-line;
}

.workout-block strong {
  color: var(--ink);
}

.notes-box {
  padding: 16px;
  border-left: 4px solid var(--warning);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #ededf4;
}

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

.archive-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.archive-item time {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 820;
}

.archive-item h3,
.archive-item p {
  margin: 0;
}

.archive-item h3 {
  font-size: 1.05rem;
}

.archive-item p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .today-panel {
    background-position: 74% 30%;
  }

  .brand-row {
    width: min(100% - 20px, 1120px);
    padding: 16px 0;
  }

  .workout-detail,
  .archive-section {
    padding: 20px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-item {
    grid-template-columns: 1fr;
  }

  .session-grid {
    grid-template-columns: 1fr;
  }

  .ghost-button {
    width: 100%;
  }
}
