:root {
  color-scheme: light;
  --bg: #f2f3ed;
  --card: #fffefa;
  --ink: #172d2b;
  --sub: #52645e;
  --line: #d7ded4;
  --accent: #c1ee77;
  --action: #284c38;
  --actiontext: white;
  --focus: #285d91;
  font:
    16px/1.45 "Inter",
    system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131c1a;
  --card: #1b2825;
  --ink: #eef3ea;
  --sub: #afc0b8;
  --line: #374740;
  --action: #c1ee77;
  --actiontext: #182620;
  --focus: #a4d5ff;
}
[data-accent="blue"] {
  --accent: #9cddff;
  --action: #26557a;
  --actiontext: white;
}
[data-theme="dark"][data-accent="blue"] {
  --action: #9cddff;
  --actiontext: #172d2b;
}
header {
  min-height: calc(68px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top)
    max(5vw, calc((100vw - 1080px) / 2), env(safe-area-inset-right))
    0 max(5vw, calc((100vw - 1080px) / 2), env(safe-area-inset-left));
  background: #172d2b;
  color: white;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  font-weight: 850;
  letter-spacing: -0.075em;
  font-size: 25px;
  text-decoration: none;
  color: white;
}
.brand img {
  width: 38px;
  height: 38px;
  margin-right: 7px;
}
.brand span {
  color: var(--accent);
}
#signal {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: #fff;
  border: 0;
  box-shadow: none;
}
#signal[hidden] { display: none; }
#signal[data-status="ready"] { color: #a4e7c4; }
#signal[data-status="warning"] { color: #ffd59b; }
#signal.quiet:hover:not(:disabled) { background: transparent; opacity: .8; }
#signal:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
#signal svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#update-notice { text-align: center; padding: 6px 12px 0; }
.status-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 8px; }
.status-details dd { margin: 0; overflow-wrap: anywhere; }
.status-details dt { font-weight: 650; }
.about-brand { display: flex; align-items: center; gap: 10px; }
.about-brand img { width: 48px; height: 48px; }
.release-history { padding-inline-start: 1.35em; }
.release-history li { margin-block: 0.45em; }
main {
  max-width: 1120px;
  margin: auto;
  padding: 26px max(20px, env(safe-area-inset-right))
    calc(110px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
h1,
h2,
h3,
p {
  margin: 0 0 0.55em;
}
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.065em;
}
h2 {
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 1.05rem;
}
small,
.sub {
  color: var(--sub);
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--sub);
}
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #193935 url("/plates.webp") no-repeat right center;
  background-size: auto 100%;
  color: white;
  min-height: 215px;
  padding: clamp(22px, 4vw, 40px);
  display: grid;
  align-content: center;
  justify-items: start;
}
.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #183731 12%,
    #183731ed 42%,
    transparent 85%
  );
}
.hero > * {
  position: relative;
}
.hero h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.065em;
  max-width: 72%;
}
.hero .eyebrow {
  color: var(--accent);
}
.hero button {
  background: var(--accent);
  color: #172d2b;
}
.hero button.quiet {
  background: #193935;
  color: #fff;
  border-color: #b6cfc3;
}
.hero button.quiet:hover:not(:disabled) {
  background: #34594e;
}
.hero button:focus-visible {
  outline-color: #fff;
}
.hero button.quiet:disabled {
  background: #304b44;
  color: #d3ddd8;
  border-color: #a1b7ad;
  opacity: 1;
}
.card,
dialog {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 18px;
}
.card {
  margin: 10px 0;
}
.section {
  margin-top: 25px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 12px;
}
.grid > .card {
  margin: 0;
}
.row,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.stack > * + * {
  margin-top: 10px;
}
.pill {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 650;
}
.line {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.line:first-child {
  border: 0;
}
.upcoming-title, .account-row > div { min-width: 0; overflow-wrap: anywhere; }
.upcoming-actions { flex-shrink: 0; }
.short-label { display: none; }
.accounts-summary { flex-wrap: wrap; }
.accounts-summary p, .account-row p { margin: 0; }
.row > label {
  flex: 1;
  min-width: 70px;
}
button,
.btn {
  font: inherit;
  font-weight: 680;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 11px;
  min-height: 44px;
  padding: 9px 14px;
  background: var(--action);
  color: var(--actiontext);
  text-decoration: none;
  touch-action: manipulation;
}
button.quiet,
.btn.quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--sub);
}
button.quiet:hover:not(:disabled),
.btn.quiet:hover {
  background: color-mix(in srgb, var(--ink) 8%, var(--card));
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
input,
textarea,
select {
  width: 100%;
  background: var(--card);
  color: var(--ink);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  min-height: 44px;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 640;
  margin: 7px 0;
}
label input,
label select,
label textarea {
  display: block;
  margin-top: 4px;
}
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
}
input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
}
nav {
  position: fixed;
  bottom: var(--nav-offset, 0px);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 4px env(safe-area-inset-right) calc(4px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  z-index: 3;
}
nav:empty, nav[data-keyboard], [hidden] {
  display: none;
}
nav[data-keyboard], .dialog-body [hidden], [data-timer-controls][hidden] { display: none; }
nav a {
  flex: 1;
  min-width: 0;
  max-width: 160px;
  color: var(--sub);
  text-decoration: none;
  text-align: center;
  font-size: 0.75rem;
  padding: 5px 0;
  font-weight: 650;
}
nav svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 3px;
}
nav a.sel {
  color: var(--action);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 11px;
}
dialog {
  --visible-height: 100dvh;
  --visible-center: 50dvh;
  --dialog-gap: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  position: fixed;
  inset: var(--visible-center) 0 auto;
  translate: 0 -50%;
  margin: 0 auto;
  width: min(620px, calc(100% - 2 * var(--dialog-gap)));
  max-height: min(900px, calc(var(--visible-height) - 2 * var(--dialog-gap) -
    env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  padding: 0;
  overflow: hidden;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog[data-layout="plan"], dialog[data-layout="media"] {
  width: min(760px, calc(100% - 2 * var(--dialog-gap)));
}
dialog[data-layout="media"]:has(.image-preview .compact-photo) {
  width: min(400px, calc(100% - 2 * var(--dialog-gap)));
}
.dialog-body {
  min-width: 0;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 18px 18px;
}
.dialog-toolbar, .dialog-footer:not([hidden]) {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--card);
}
.dialog-toolbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.dialog-toolbar h2 {
  margin: 0;
  min-width: 0;
  font-size: clamp(1.05rem, 3.8vw, 1.4rem);
  overflow-wrap: anywhere;
}
.dialog-footer:not([hidden]) {
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.dialog-footer .plan-more {
  flex: 0 0 44px;
  font-size: 1.4rem;
}
@media (max-width: 420px) {
  #dialogFooter:has(.plan-more) button[form="plan-editor"] {
    flex-basis: 100%;
  }
}
dialog::backdrop {
  background: #11231ec4;
}
#close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1;
}
@media (max-width: 600px) {
  dialog { --dialog-gap: max(6px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .dialog-toolbar, .dialog-footer:not([hidden]), .dialog-body { padding-inline: 10px; }
  .dialog-footer > button { flex: 1 1 max-content; }
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 85px;
  transform: translateX(-50%);
  background: #172d2b;
  color: #fff;
  border-radius: 10px;
  padding: 10px 18px;
  z-index: 8;
  max-width: 92vw;
}
#toast:empty {
  display: none;
}
.login {
  max-width: 430px;
  margin: 7vh auto;
}
.login img {
  width: 60px;
  border-radius: 16px;
}
.timer {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.counter {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.progress {
  height: 5px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.progress i {
  background: var(--action);
  display: block;
  height: 100%;
}
video,
.photo {
  max-width: 100%;
  max-height: 50vh;
  display: block;
  border-radius: 12px;
}
.compact {
  max-width: 740px;
  margin: auto;
}
summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: bold;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.tiles span {
  padding: 5px;
  text-align: center;
  border-radius: 6px;
}
.marked {
  background: var(--accent);
  color: #162a21;
}
.bar {
  background: var(--action);
  height: 5px;
  display: block;
  border-radius: 4px;
}
.num {
  font-variant-numeric: tabular-nums;
}
a {
  color: var(--action);
}
@media (max-width: 550px) {
  header {
    min-height: calc(48px + env(safe-area-inset-top));
    padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
  }
  .brand {
    font-size: 21px;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  main {
    padding: 16px max(12px, env(safe-area-inset-right))
      calc(100px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .hero {
    min-height: 186px;
  }
  .card {
    padding: 13px;
  }
  .section {
    margin-top: 18px;
  }
  button {
    padding: 8px 11px;
  }
  .timer button {
    padding: 4px 8px;
  }
  .row {
    gap: 6px;
  }
  .upcoming { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .upcoming-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upcoming-actions button { min-width: 0; }
  .upcoming-actions .wide-label { display: none; }
  .upcoming-actions .short-label { display: inline; }
}
@media (max-width: 550px), (pointer: coarse) {
  input, textarea, select {
    font-size: max(16px, 1rem);
    min-width: 0;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button:active {
    transform: translateY(1px);
  }
  dialog[open] {
    animation: enter 0.15s ease-out;
  }
  @keyframes enter {
    from {
      opacity: 0;
      transform: translateY(5px);
    }
  }
}
.timer {
  border-radius: 12px;
  margin-top: 4px;
}
.compact h1 {
  margin: 0.15em 0 0.32em;
}
.compact .progress {
  margin-bottom: 6px;
}
.compact .card p:empty {
  display: none;
}
.compact button[data-act="log"] {
  width: 100%;
  margin: 5px 0;
}
.compact .spread h3 {
  margin: 0;
}
.compact .eyebrow {
  margin-bottom: 0;
}
.compact input[type="number"] {
  font-size: 18px;
  font-weight: 700;
}
.compact .card:has(> .eyebrow) {
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
}
dialog form > button[type="submit"],
dialog form > button:not([type]) {
  margin-top: 8px;
}
nav a {
  min-height: 48px;
}
.compact .timer button[data-act="timerMore"] {
  min-width: 44px;
  font-size: 20px;
}
.photo {
  object-fit: contain;
}
.library-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.exercise-photo {
  --image-height-limit: min(440px, 55dvh);
  --image-scale: 1;
  width: auto;
  height: auto;
  max-height: var(--image-height-limit);
  margin-inline: auto;
}
.exercise-photo[style] {
  width: min(100%, calc(var(--image-width) * var(--image-scale)),
    calc(var(--image-height-limit) * var(--image-ratio)));
}
.equipment-picture {
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  margin: 8px auto;
}
.equipment-picture img {
  --image-height-limit: clamp(170px, 42vw, 240px);
  border-radius: inherit;
}
.plan-exercise.has-picture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
  align-items: start;
  gap: 8px;
}
.plan-exercise h3 { margin-top: 0; overflow-wrap: anywhere; }
.plan-exercise .sub { margin: 4px 0; }
.plan-exercise-actions { grid-column: 1 / -1; margin-top: 8px; }
.plan-exercise button { overflow-wrap: anywhere; }
.equipment-compact { justify-self: center; min-width: 0; margin: 0; }
.equipment-compact img {
  --image-height-limit: clamp(142px, 42vw, 210px);
}
.equipment-compact.illustration-picture img { --image-height-limit: 150px; }
.equipment-detail img {
  --image-height-limit: min(440px, 58dvh);
}
.image-preview {
  display: grid;
  justify-items: center;
}
.image-preview img {
  --image-height-limit: max(64px, min(660px, calc(var(--visible-height, 100dvh) - 180px)));
  --image-scale: 1.15;
  border-radius: 6px;
}
.exercise-media-detail { margin-block: 10px; }
@media (max-width: 500px) {
  .plan-exercise.has-picture:has(.illustration-picture) { grid-template-columns: minmax(0, 1fr); }
}
.exercise-animation {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
}
.exercise-animation img { max-height: min(56vh, 56dvh); }
.media-placeholder { color: var(--sub); padding: 8px; }
.equipment-placeholder {
  width: 100%;
  border: 1px dashed var(--line);
  color: var(--sub);
}
.warm-editor, .warm-editor fieldset, .history-set {
  margin: 8px 0;
  min-inline-size: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.warm-row button, .history-set button { margin-top: 6px; min-height: 44px; }
.set-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  text-align: left;
}
.set-table caption { text-align: left; font-weight: 700; padding: 6px 0; }
.set-table th, .set-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.set-table tbody th { font-weight: 500; }
.trend-grid > .card { min-width: 0; }
.trend-metric {
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  font-weight: 750;
  margin: 0.3em 0;
}
.trend-chart { margin: 0; }
.trend-scroll { overflow-x: auto; }
.trend-graph {
  position: relative;
  min-width: var(--trend-width);
  height: 13rem;
  font-size: 0.8rem;
  color: var(--sub);
}
.trend-plot {
  position: absolute;
  inset: 3.3rem 3.5rem 4rem 5.2rem;
}
.trend-plot svg {
  position: absolute;
  inset: 0;
  overflow: visible;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.trend-plot polyline { fill: none; stroke: var(--action); stroke-width: 2; }
.trend-tick {
  position: absolute;
  width: 100%;
  border-top: 1px solid var(--line);
}
.trend-tick:last-of-type { border-color: var(--sub); }
.trend-tick span {
  position: absolute;
  right: calc(100% + 10px);
  transform: translateY(-50%);
}
.trend-unit, .trend-axis {
  position: absolute;
  font-weight: 650;
}
.trend-unit { top: 0.6rem; left: 0.5rem; }
.trend-axis { bottom: 0.45rem; left: 5.2rem; }
.trend-date {
  position: absolute;
  top: calc(100% + 20px);
  transform: translateX(-50%);
  white-space: nowrap;
}
button.trend-point, button.trend-point:active {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.trend-point::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--action);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--action);
}
.trend-point:hover::after, .trend-point[aria-pressed="true"]::after {
  box-shadow: 0 0 0 3px var(--action);
}
.trend-chart output {
  display: block;
  margin-top: 0.5rem;
  color: var(--ink);
  font-weight: 680;
}
