/* Music Teacher Lab — Shared instructions (i) button + modal */

.mtl-help-btn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + 46px + 10px + env(safe-area-inset-left, 0px));
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  font-family: 'Nunito', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  font-style: italic;
  color: #ffffff;
  background: linear-gradient(135deg, #1f6bdc, #14a6a1);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 26px rgba(12, 34, 75, 0.35);
  z-index: 2147483000;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mtl-help-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 14px 28px rgba(12, 34, 75, 0.45);
  filter: saturate(1.12);
}

.mtl-help-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

.mtl-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 18, 40, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mtl-help-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mtl-help-modal {
  width: min(560px, 100%);
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #1c2b46;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(10, 24, 56, 0.45);
  font-family: 'Nunito', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.mtl-help-overlay.is-open .mtl-help-modal {
  transform: translateY(0) scale(1);
}

.mtl-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(20, 40, 80, 0.1);
}

.mtl-help-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  color: #14306a;
}

.mtl-help-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  color: #14306a;
  background: rgba(20, 48, 106, 0.09);
  transition: background 0.15s ease, transform 0.15s ease;
}

.mtl-help-close:hover {
  background: rgba(20, 48, 106, 0.18);
  transform: scale(1.05);
}

.mtl-help-close:focus-visible {
  outline: 3px solid #1f6bdc;
  outline-offset: 2px;
}

.mtl-help-body {
  padding: 16px 22px 22px;
  overflow-y: auto;
  line-height: 1.55;
  font-size: 1rem;
}

.mtl-help-body h3 {
  margin: 18px 0 6px;
  font-size: 1.02rem;
  font-weight: 800;
  color: #1f6bdc;
}

.mtl-help-body h3:first-child {
  margin-top: 0;
}

.mtl-help-body p {
  margin: 0 0 10px;
}

.mtl-help-body ul,
.mtl-help-body ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.mtl-help-body li {
  margin-bottom: 6px;
}

.mtl-help-body .mtl-help-premium {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(31, 107, 220, 0.1), rgba(20, 166, 161, 0.12));
  border: 1px solid rgba(31, 107, 220, 0.25);
  font-size: 0.94rem;
}

.mtl-help-body .mtl-help-premium strong {
  color: #14306a;
}

@media (max-width: 680px) {
  .mtl-help-btn {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: calc(10px + 42px + 8px + env(safe-area-inset-left, 0px));
  }

  .mtl-help-modal {
    max-height: 86vh;
  }

  .mtl-help-head h2 {
    font-size: 1.15rem;
  }
}

@media (prefers-color-scheme: dark) {
  .mtl-help-modal {
    background: #15203a;
    color: #e7edf8;
  }

  .mtl-help-head {
    border-bottom-color: rgba(255, 255, 255, 0.12);
  }

  .mtl-help-head h2 {
    color: #cfe0ff;
  }

  .mtl-help-body h3 {
    color: #7fb2ff;
  }

  .mtl-help-close {
    color: #cfe0ff;
    background: rgba(255, 255, 255, 0.12);
  }

  .mtl-help-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .mtl-help-body .mtl-help-premium {
    background: rgba(127, 178, 255, 0.12);
    border-color: rgba(127, 178, 255, 0.3);
  }

  .mtl-help-body .mtl-help-premium strong {
    color: #cfe0ff;
  }
}
