:root {
  color-scheme: dark;
  --bg: #10151d;
  --surface: #1a2230;
  --line: #334155;
  --accent: #558dff;
  --muted: #aeb9cb;
  --text: #f5f7fb;
}
html[data-theme="green"] {
  --bg: #090d0b;
  --surface: #121d17;
  --line: #2a4232;
  --accent: #65dc92;
  --muted: #abc0b1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.5 system-ui,
    sans-serif;
}
header,
main {
  max-width: 900px;
  margin: auto;
  padding: 16px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
h1 {
  font-size: 23px;
  line-height: 1.2;
  margin: 8px 0;
}
h2 {
  font-size: 19px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 12px 0 8px;
}
p {
  margin: 8px 0;
}
small,
.muted {
  color: var(--muted);
}
section,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  min-width: 0;
}
form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
input,
select,
textarea,
button {
  font: inherit;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 9px 11px;
  max-width: 100%;
  min-width: 0;
}
input,
select,
textarea {
  background: var(--bg);
  color: var(--text);
  width: 100%;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}
button {
  background: var(--accent);
  color: #07111d;
  font-weight: 650;
  cursor: pointer;
  overflow-wrap: anywhere;
}
button.secondary {
  background: transparent;
  color: var(--text);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--accent);
  overflow-wrap: anywhere;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.row > * {
  flex: 1;
  min-width: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.actions > * {
  flex: 1;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
#notice {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
#notice.error {
  border-color: #fa9595;
  color: #ffcaca;
}
[hidden] {
  display: none !important;
}
.badge {
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
}
.item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.item:last-child {
  border: 0;
}
.plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.plan .wide {
  grid-column: 1/-1;
}
.stage {
  min-height: 170px;
  border-radius: 10px;
  background: #090d12;
  display: grid;
  place-items: center;
  margin: 12px 0;
  overflow: hidden;
}
.stage img {
  width: 100%;
  max-height: 290px;
  object-fit: contain;
}
.stage .muted {
  padding: 16px;
  text-align: center;
}
/* The shared workout renderer also serves the diagnostic staging page. */
.workout-cover {
  margin: 12px 0;
}
.workout-cover img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.big {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
}
.check input {
  flex: none;
}
details > summary {
  cursor: pointer;
  padding: 8px 0;
}
footer {
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
