:root {
  color-scheme: light dark;
  --accent: #2f7d46;
  --danger: #b3372c;
  --border: #d8d8d8;
  --muted: #6b6b6b;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0 0.75rem 2rem;
  font-size: 16px;
  line-height: 1.35;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.topbar .brand { font-weight: 600; text-decoration: none; color: inherit; }
.topbar nav a { text-decoration: none; color: var(--accent); }

h1 { font-size: 1.25rem; margin: 0.4rem 0; }
h2 { font-size: 1.05rem; margin: 0.6rem 0 0.3rem; }

a.button, button, input[type="submit"] {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  width: auto;
  cursor: pointer;
}
a.button.secondary, button.secondary {
  background: transparent;
  color: var(--accent);
}
button.danger, a.button.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

ul.messages { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.message { padding: 0.4rem 0.6rem; border-radius: 6px; margin-bottom: 0.3rem; font-size: 0.9rem; }
.message.error { background: #fbe4e1; color: var(--danger); }
.message.success { background: #e3f3e6; color: var(--accent); }

.session-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.5rem;
  display: block;
  text-decoration: none;
  color: inherit;
}
.session-card .date { font-weight: 600; }
.session-card .summary { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }

.exercise-block {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
}
.exercise-block h3 { margin: 0 0 0.25rem; font-size: 1rem; }

table.sets { border-collapse: collapse; width: auto; font-size: 0.95rem; }
table.sets td { padding: 0.15rem 0.6rem 0.15rem 0; }

.set-row { display: flex; gap: 0.5rem; margin-bottom: 0.3rem; align-items: center; }
.set-row input { width: 5.5rem; padding: 0.3rem; border: 1px solid var(--border); border-radius: 4px; }
.set-row label { font-size: 0.8rem; color: var(--muted); width: 3.5rem; }

form.stacked label { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
form.stacked input, form.stacked textarea {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.inline-form { display: inline; }

.pb { font-weight: 600; color: var(--accent); }

@media (prefers-color-scheme: dark) {
  body { background: #14161a; color: #e8e8e8; }
  .set-row input, form.stacked input, form.stacked textarea { background: #1e2126; color: #e8e8e8; border-color: #3a3d42; }
  .message.error { background: #3a1f1c; }
  .message.success { background: #1c2e20; }
}
