*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--brand-primary); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.navbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  min-height: var(--nav-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.brand-name { line-height: 1; }

.workout-mark {
  display: block;
  flex-shrink: 0;
}

.brand-icon,
.hero-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hero-brand h1 { margin: 0; }

.brand:hover { text-decoration: none; color: var(--brand-primary); }

.site-nav {
  display: flex;
  gap: 0.75rem;
  flex: 1;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.site-nav a.is-active {
  color: var(--brand-primary);
  background: var(--hover-tint);
  font-weight: 600;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-role {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.9rem; }

.nav-actions .btn-icon-theme {
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
}

.btn-icon-theme {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-icon-theme:hover {
  background: var(--hover-tint);
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border));
}

.icon-theme-moon,
.icon-theme-sun {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.btn-icon-theme svg {
  display: block;
  width: 18px;
  height: 18px;
}

.hero {
  text-align: center;
  padding: 2.5rem 1rem;
}

.hero h1 { font-size: 2.2rem; margin: 0 0 0.75rem; }

.lead { color: var(--text-muted); max-width: 640px; margin: 0 auto 1.5rem; }

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.panel--narrow { max-width: 480px; margin: 0 auto; }

.form-stack label {
  display: block;
  margin-bottom: 0.85rem;
}

.form-stack input,
.form-stack select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-app);
  color: var(--text);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-error { background: #fde8e8; color: #8b1c1c; }
.alert-success { background: #e6f7ef; color: #1a5c3a; }
.alert-info { background: #e8f4fd; color: #1a4a6b; }

.text-muted { color: var(--text-muted); }

.list-plain { padding-left: 1.2rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.5rem;
  text-align: left;
}

.invite-banner {
  background: var(--hover-tint);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 35%, var(--border));
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.invite-banner__title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.invite-benefits {
  margin: 1rem 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.form-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.form-note--promo {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

.form-footer {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.inline-form {
  margin: 1rem 0 1.25rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
  }
  .site-nav.is-open { display: flex; }
  .navbar { position: relative; flex-wrap: wrap; }
  .nav-end { order: 3; width: 100%; justify-content: space-between; }
}
