:root {
  --bg: #0e1116;
  --surface: #161b23;
  --surface-2: #1d242f;
  --border: #2a3341;
  --text: #e8ecf1;
  --text-dim: #9aa7b5;
  --accent: #4ade80;
  --accent-dark: #22c55e;
  --accent-ink: #06281a;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(14, 17, 22, 0.9);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo {
  font-weight: 800; font-size: 1.1rem; color: var(--text);
  text-decoration: none; letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
.site-nav { display: flex; gap: 18px; }
.site-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 0.88rem;
  transition: color 0.15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); }

/* Hero */
.hero { text-align: center; padding: 48px 0 8px; }
.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  color: var(--text-dim); max-width: 560px; margin: 12px auto 0;
  font-size: 1.02rem;
}

/* Tool card */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 32px auto;
}
.options-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.option label {
  display: block; font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); margin-bottom: 6px;
}
.option select {
  width: 100%; padding: 11px 12px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 0.95rem; font-family: inherit;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa7b5' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.option select:focus { outline: 2px solid var(--accent-dark); border-color: transparent; }

.btn-primary {
  width: 100%; padding: 15px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: var(--accent-ink);
  font-size: 1.05rem; font-weight: 800; font-family: inherit;
  border: none; border-radius: 10px; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 26px rgba(74, 222, 128, 0.35); }
.btn-primary:active { transform: translateY(0); }

/* Output */
#workout-output { display: none; margin-top: 26px; }
#workout-output.visible { display: block; }
.workout-header h2 { font-size: 1.25rem; letter-spacing: -0.02em; }
.workout-header p { color: var(--text-dim); font-size: 0.9rem; margin-top: 2px; }
.exercise-list { list-style: none; margin-top: 16px; counter-reset: ex; }
.exercise-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px; margin-bottom: 8px;
  counter-increment: ex;
  animation: slideIn 0.35s ease both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.exercise-item::before {
  content: counter(ex);
  min-width: 26px; height: 26px; margin-right: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 50%; font-size: 0.8rem; font-weight: 800;
}
.exercise-info { flex: 1; display: flex; flex-direction: column; }
.exercise-name { font-weight: 600; font-size: 0.98rem; }
.exercise-muscle {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim);
}
.exercise-reps { font-weight: 700; color: var(--accent); font-size: 0.92rem; white-space: nowrap; margin-left: 12px; }
.workout-footer { margin-top: 16px; }
.workout-footer > p { font-size: 0.82rem; color: var(--text-dim); }
.workout-actions { display: flex; gap: 10px; margin-top: 12px; }
.btn-secondary {
  flex: 1; padding: 11px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 0.92rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.empty-msg { color: var(--text-dim); text-align: center; padding: 12px; }

/* Content sections */
.content-section { padding: 28px 0; }
.content-section h2 {
  font-size: 1.45rem; letter-spacing: -0.02em; margin-bottom: 14px;
}
.content-section h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.content-section p, .content-section li { color: var(--text-dim); font-size: 0.97rem; }
.content-section p + p { margin-top: 12px; }
.content-section ul, .content-section ol { padding-left: 22px; margin-top: 8px; }
.content-section a { color: var(--accent); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq-item summary {
  cursor: pointer; font-weight: 600; padding: 13px 0;
  list-style: none; position: relative; padding-right: 28px;
}
.faq-item summary::after {
  content: "+"; position: absolute; right: 4px; color: var(--accent);
  font-size: 1.2rem; font-weight: 400;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding: 0 0 14px; color: var(--text-dim); }

/* Related tools */
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-top: 16px;
}
.related-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card h3 { color: var(--text); font-size: 1rem; margin: 0 0 4px; }
.related-card p { color: var(--text-dim); font-size: 0.85rem; margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px; padding: 28px 0;
  text-align: center; font-size: 0.85rem; color: var(--text-dim);
}
.site-footer nav { display: flex; gap: 18px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* Legal pages */
.legal-page h1 { font-size: 1.8rem; margin: 40px 0 20px; letter-spacing: -0.02em; }
.legal-page h2 { font-size: 1.2rem; margin: 26px 0 10px; }
.legal-page p, .legal-page li { color: var(--text-dim); }
.legal-page ul { padding-left: 22px; }

@media (max-width: 560px) {
  .tool-card { padding: 20px 16px; }
  .site-nav { display: none; }
  .exercise-reps { font-size: 0.84rem; }
}
