.download-auth-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 16, 29, 0.34);
}

.download-auth-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.download-auth-copy strong { font-size: 0.88rem; }
.download-auth-copy span { color: var(--muted); font-size: 0.74rem; line-height: 1.35; }
.download-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.passkey-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.passkey-actions .button { min-height: 40px; }
.download-button { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.coach-copy-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  line-height: 1;
}
.coach-copy-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.coach-copy-button.is-copied {
  border-color: rgba(87, 209, 161, 0.42);
  color: var(--accent);
  background: rgba(87, 209, 161, 0.1);
}
.download-error { color: var(--danger) !important; }
.download-ok { color: var(--accent) !important; }

.pin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 6, 14, 0.78);
  backdrop-filter: blur(8px);
}

.pin-modal {
  width: min(100%, 360px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #101d31;
  box-shadow: var(--shadow);
}

.pin-modal h3 { margin: 0 0 6px; font-size: 1.05rem; }
.pin-modal p { margin-bottom: 12px; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.pin-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(7, 16, 29, 0.72);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.18em;
  outline: none;
}
.pin-input:focus { border-color: rgba(87, 209, 161, 0.65); }
.pin-modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pin-modal-actions-stack { grid-template-columns: 1fr; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .download-auth-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    margin: 9px 0;
    padding: 10px 11px;
    border-radius: 12px;
  }

  .download-auth-copy strong { font-size: 0.79rem; }
  .download-auth-copy span { font-size: 0.68rem; }
  .download-actions { width: 100%; }
  .download-actions .button { flex: 1 1 auto; }
  .download-actions .coach-copy-button { flex: 0 0 40px; }
  .passkey-actions { width: 100%; }
  .passkey-actions .button { flex: 1 1 100%; }
  .pin-modal { border-radius: 14px; padding: 13px; }
}
