:root {
  --lime: #d4f878;
  --on-lime: #233000;
  --bg: #101310;
  --card: #222820;
  --text: #f0f3ea;
  --muted: #bcc5b5;
  --error: #ffb4ab;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }
h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: 1.4rem; margin: 0 0 16px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.error { color: var(--error); }
.eyebrow { color: var(--lime); font-weight: 600; letter-spacing: 0.08em; font-size: 0.875rem; margin-bottom: 12px; }
.eyebrow.section { margin-top: 28px; }

.screen { max-width: 640px; margin: 0 auto; }
#home { padding: 24px; }
#workout { display: flex; flex-direction: column; height: 100%; }
#workout .scroll { flex: 1; overflow-y: auto; padding: 0 24px 12px; }
.bar { display: flex; justify-content: space-between; padding: 4px 12px; }
.footer { padding: 12px 24px 24px; border-top: 1px solid #2a3128; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; margin-bottom: 12px; }
.row > * { flex: 1; }

button, .button {
  font: inherit; font-weight: 600; color: inherit; border: 0; background: none;
  border-radius: 999px; padding: 12px 18px; cursor: pointer; text-align: center;
  display: inline-block; touch-action: manipulation;
}
button:disabled { opacity: 0.4; cursor: default; }
.primary { background: var(--lime); color: var(--on-lime); }
.outline { border: 1px solid #586152; color: var(--lime); }
.text { color: var(--lime); padding: 10px 12px; }
.wide { width: 100%; display: block; margin-bottom: 12px; }
.tall { min-height: 54px; }

.card {
  display: flex; align-items: center; gap: 20px; width: 100%; text-align: left;
  background: var(--card); border-radius: 14px; padding: 20px; font-weight: 400;
}
.card .num { color: var(--lime); font-size: 1.375rem; }
.card .body { flex: 1; min-width: 0; }
.card .name { font-size: 1.5rem; font-weight: 700; }
.card .chev { color: var(--lime); font-size: 1.75rem; }
.exercise { display: block; padding: 18px; }
.exercise .top { display: flex; align-items: center; gap: 8px; }
.exercise .title { flex: 1; font-size: 1.05rem; font-weight: 500; }
.edited { color: var(--lime); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; }
.reading { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.reading .w { font-size: 1.5rem; font-weight: 700; }
.badge { background: rgba(212, 248, 120, 0.12); color: var(--lime); border-radius: 6px; padding: 0 10px; font-size: 1.375rem; }

dialog {
  background: #1b2019; color: var(--text); border: 0; border-radius: 24px;
  padding: 24px; width: min(92vw, 420px);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.field { display: block; margin-bottom: 4px; }
.field > span:first-child { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 6px; }
.input-wrap { display: flex; align-items: center; border: 1px solid #586152; border-radius: 8px; padding: 0 14px; }
.input-wrap:focus-within { border-color: var(--lime); }
.input-wrap.invalid { border-color: var(--error); }
.input-wrap input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.25rem; color: inherit;
  background: none; border: 0; outline: none; padding: 14px 0;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { border: 1px solid #586152; border-radius: 8px; padding: 8px 14px; font-weight: 500; }
.chip[aria-pressed="true"] { background: #3c4b16; border-color: #3c4b16; color: var(--lime); }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(92vw, 560px); background: #e0e4d8; color: #1b2019; border-radius: 8px;
  padding: 14px 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); z-index: 10;
}
